sharkbait 1.0.27 → 1.0.29

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 +875 -650
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3597,17 +3597,23 @@ Revise your approach based on what we've learned.`
3597
3597
  content: fullContent,
3598
3598
  tool_calls: toolCalls
3599
3599
  });
3600
- const toolResults = await Promise.allSettled(toolCalls.map(async (call) => {
3600
+ const parsedArgs = [];
3601
+ for (let i = 0;i < toolCalls.length; i++) {
3602
+ const call = toolCalls[i];
3601
3603
  let args;
3602
3604
  try {
3603
3605
  args = JSON.parse(call.function.arguments);
3604
3606
  } catch (parseErr) {
3605
- throw new Error(`Invalid tool arguments for ${call.function.name}: ${parseErr instanceof Error ? parseErr.message : String(parseErr)}`);
3607
+ args = {};
3606
3608
  }
3609
+ parsedArgs.push(args);
3610
+ yield { type: "tool_start", name: call.function.name, args };
3611
+ }
3612
+ const toolResults = await Promise.allSettled(toolCalls.map(async (call, i) => {
3607
3613
  return {
3608
3614
  call,
3609
- args,
3610
- result: await this.tools.execute(call.function.name, args)
3615
+ args: parsedArgs[i],
3616
+ result: await this.tools.execute(call.function.name, parsedArgs[i])
3611
3617
  };
3612
3618
  }));
3613
3619
  for (let i = 0;i < toolResults.length; i++) {
@@ -3615,7 +3621,6 @@ Revise your approach based on what we've learned.`
3615
3621
  const settled = toolResults[i];
3616
3622
  if (settled.status === "fulfilled") {
3617
3623
  const { args, result } = settled.value;
3618
- yield { type: "tool_start", name: call.function.name, args };
3619
3624
  yield { type: "tool_result", name: call.function.name, result };
3620
3625
  this.messages.push({
3621
3626
  role: "tool",
@@ -3638,7 +3643,6 @@ Revise your approach based on what we've learned.`
3638
3643
  progressLedger.lastProgressAt = new Date;
3639
3644
  } else {
3640
3645
  const errorMsg = getErrorMessage(settled.reason);
3641
- yield { type: "tool_start", name: call.function.name, args: {} };
3642
3646
  yield { type: "tool_error", name: call.function.name, error: errorMsg };
3643
3647
  this.messages.push({
3644
3648
  role: "tool",
@@ -6763,12 +6767,12 @@ Duration: ${(result.totalDurationMs / 1000).toFixed(1)}s`
6763
6767
  }
6764
6768
  }
6765
6769
  // src/agent/start-chat.ts
6766
- import React6 from "react";
6770
+ import React13 from "react";
6767
6771
  import { render } from "ink";
6768
6772
 
6769
6773
  // src/ui/app.tsx
6770
- import React5, { useState as useState2, useEffect as useEffect2, useCallback, useRef } from "react";
6771
- import { Box as Box12, Text as Text12, useInput, useApp } from "ink";
6774
+ import { useCallback as useCallback2, useMemo } from "react";
6775
+ import { Box as Box13, Text as Text13, useApp as useApp2 } from "ink";
6772
6776
 
6773
6777
  // src/ui/message.tsx
6774
6778
  import { memo } from "react";
@@ -7031,10 +7035,10 @@ var MessageView = memo(function MessageView2({
7031
7035
  });
7032
7036
 
7033
7037
  // src/ui/spinner.tsx
7034
- import { useState, useEffect } from "react";
7038
+ import { useState, useEffect, memo as memo2 } from "react";
7035
7039
  import { Text as Text3, Box as Box3 } from "ink";
7036
7040
  import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
7037
- function Spinner({
7041
+ var Spinner = memo2(function Spinner2({
7038
7042
  text = "Thinking...",
7039
7043
  variant = "braille",
7040
7044
  showTokens = false,
@@ -7045,7 +7049,7 @@ function Spinner({
7045
7049
  useEffect(() => {
7046
7050
  const timer = setInterval(() => {
7047
7051
  setFrameIndex((prev) => (prev + 1) % frames.length);
7048
- }, 200);
7052
+ }, 300);
7049
7053
  return () => clearInterval(timer);
7050
7054
  }, [frames.length]);
7051
7055
  return /* @__PURE__ */ jsxDEV3(Box3, {
@@ -7071,12 +7075,14 @@ function Spinner({
7071
7075
  }, undefined, true, undefined, this)
7072
7076
  ]
7073
7077
  }, undefined, true, undefined, this);
7074
- }
7078
+ });
7075
7079
 
7076
7080
  // src/ui/welcome.tsx
7081
+ import { memo as memo4 } from "react";
7077
7082
  import { Box as Box5, Text as Text5 } from "ink";
7078
7083
 
7079
7084
  // src/ui/logo.tsx
7085
+ import { memo as memo3 } from "react";
7080
7086
  import { Box as Box4, Text as Text4 } from "ink";
7081
7087
  import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
7082
7088
  var SHARK_LOGO = `
@@ -7107,7 +7113,7 @@ var SHARK_LOGO = `
7107
7113
  #. .+. ..- +. .###-
7108
7114
  #-. + #
7109
7115
  `.trimEnd();
7110
- function Logo({ variant = "full", version = "0.0.0" }) {
7116
+ var Logo = memo3(function Logo2({ variant = "full", version = "0.0.0" }) {
7111
7117
  const logoText = variant === "inline" ? "" : SHARK_LOGO;
7112
7118
  return /* @__PURE__ */ jsxDEV4(Box4, {
7113
7119
  flexDirection: "column",
@@ -7136,8 +7142,8 @@ function Logo({ variant = "full", version = "0.0.0" }) {
7136
7142
  }, undefined, true, undefined, this)
7137
7143
  ]
7138
7144
  }, undefined, true, undefined, this);
7139
- }
7140
- function InlineLogo() {
7145
+ });
7146
+ var InlineLogo = memo3(function InlineLogo2() {
7141
7147
  return /* @__PURE__ */ jsxDEV4(Text4, {
7142
7148
  children: [
7143
7149
  /* @__PURE__ */ jsxDEV4(Text4, {
@@ -7151,11 +7157,11 @@ function InlineLogo() {
7151
7157
  }, undefined, false, undefined, this)
7152
7158
  ]
7153
7159
  }, undefined, true, undefined, this);
7154
- }
7160
+ });
7155
7161
 
7156
7162
  // src/ui/welcome.tsx
7157
7163
  import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
7158
- function WelcomeScreen({ version, workingDir }) {
7164
+ var WelcomeScreen = memo4(function WelcomeScreen2({ version, workingDir }) {
7159
7165
  const tips = [
7160
7166
  "Type your request and press Enter to send",
7161
7167
  "Use /help for available commands",
@@ -7221,13 +7227,13 @@ function WelcomeScreen({ version, workingDir }) {
7221
7227
  }, undefined, false, undefined, this)
7222
7228
  ]
7223
7229
  }, undefined, true, undefined, this);
7224
- }
7230
+ });
7225
7231
 
7226
7232
  // src/ui/status-bar.tsx
7227
- import { memo as memo2 } from "react";
7233
+ import { memo as memo5 } from "react";
7228
7234
  import { Box as Box6, Text as Text6 } from "ink";
7229
7235
  import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
7230
- var StatusBar = memo2(function StatusBar2({
7236
+ var StatusBar = memo5(function StatusBar2({
7231
7237
  model,
7232
7238
  tokens = 0,
7233
7239
  cost = 0,
@@ -7319,42 +7325,11 @@ var StatusBar = memo2(function StatusBar2({
7319
7325
  }, undefined, true, undefined, this);
7320
7326
  });
7321
7327
 
7322
- // src/ui/input-prompt.tsx
7328
+ // src/ui/tool-call.tsx
7329
+ import { memo as memo6 } from "react";
7323
7330
  import { Box as Box7, Text as Text7 } from "ink";
7324
7331
  import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
7325
- function InputPrompt({
7326
- value,
7327
- placeholder = "Send a message...",
7328
- disabled = false
7329
- }) {
7330
- return /* @__PURE__ */ jsxDEV7(Box7, {
7331
- borderStyle: "round",
7332
- borderColor: disabled ? colors.border : colors.primary,
7333
- paddingX: 1,
7334
- children: [
7335
- /* @__PURE__ */ jsxDEV7(Text7, {
7336
- color: colors.primary,
7337
- children: "❯ "
7338
- }, undefined, false, undefined, this),
7339
- value ? /* @__PURE__ */ jsxDEV7(Text7, {
7340
- children: value
7341
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV7(Text7, {
7342
- color: colors.textDim,
7343
- children: placeholder
7344
- }, undefined, false, undefined, this),
7345
- !disabled && /* @__PURE__ */ jsxDEV7(Text7, {
7346
- color: colors.primary,
7347
- children: "▋"
7348
- }, undefined, false, undefined, this)
7349
- ]
7350
- }, undefined, true, undefined, this);
7351
- }
7352
-
7353
- // src/ui/tool-call.tsx
7354
- import { memo as memo3 } from "react";
7355
- import { Box as Box8, Text as Text8 } from "ink";
7356
- import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
7357
- var ToolCallView = memo3(function ToolCallView2({
7332
+ var ToolCallView = memo6(function ToolCallView2({
7358
7333
  name,
7359
7334
  status,
7360
7335
  result,
@@ -7368,7 +7343,7 @@ var ToolCallView = memo3(function ToolCallView2({
7368
7343
  };
7369
7344
  const config = statusConfig[status];
7370
7345
  const durationText = duration ? `${(duration / 1000).toFixed(1)}s` : null;
7371
- return /* @__PURE__ */ jsxDEV8(Box8, {
7346
+ return /* @__PURE__ */ jsxDEV7(Box7, {
7372
7347
  flexDirection: "column",
7373
7348
  marginLeft: 3,
7374
7349
  marginY: 0,
@@ -7376,25 +7351,25 @@ var ToolCallView = memo3(function ToolCallView2({
7376
7351
  borderColor: colors.border,
7377
7352
  paddingX: 1,
7378
7353
  children: [
7379
- /* @__PURE__ */ jsxDEV8(Box8, {
7354
+ /* @__PURE__ */ jsxDEV7(Box7, {
7380
7355
  children: [
7381
- /* @__PURE__ */ jsxDEV8(Text8, {
7356
+ /* @__PURE__ */ jsxDEV7(Text7, {
7382
7357
  color: config.color,
7383
7358
  children: [
7384
7359
  config.icon,
7385
7360
  " "
7386
7361
  ]
7387
7362
  }, undefined, true, undefined, this),
7388
- /* @__PURE__ */ jsxDEV8(Text8, {
7363
+ /* @__PURE__ */ jsxDEV7(Text7, {
7389
7364
  bold: true,
7390
7365
  color: colors.text,
7391
7366
  children: name
7392
7367
  }, undefined, false, undefined, this),
7393
- status === "running" && /* @__PURE__ */ jsxDEV8(Text8, {
7368
+ status === "running" && /* @__PURE__ */ jsxDEV7(Text7, {
7394
7369
  color: colors.textDim,
7395
7370
  children: " ..."
7396
7371
  }, undefined, false, undefined, this),
7397
- durationText && /* @__PURE__ */ jsxDEV8(Text8, {
7372
+ durationText && /* @__PURE__ */ jsxDEV7(Text7, {
7398
7373
  color: colors.textDim,
7399
7374
  children: [
7400
7375
  " (",
@@ -7404,10 +7379,10 @@ var ToolCallView = memo3(function ToolCallView2({
7404
7379
  }, undefined, true, undefined, this)
7405
7380
  ]
7406
7381
  }, undefined, true, undefined, this),
7407
- result && status === "success" && /* @__PURE__ */ jsxDEV8(Box8, {
7382
+ result && status === "success" && /* @__PURE__ */ jsxDEV7(Box7, {
7408
7383
  marginLeft: 2,
7409
7384
  marginTop: 0,
7410
- children: /* @__PURE__ */ jsxDEV8(Text8, {
7385
+ children: /* @__PURE__ */ jsxDEV7(Text7, {
7411
7386
  color: colors.textMuted,
7412
7387
  wrap: "truncate-end",
7413
7388
  children: [
@@ -7417,10 +7392,10 @@ var ToolCallView = memo3(function ToolCallView2({
7417
7392
  ]
7418
7393
  }, undefined, true, undefined, this)
7419
7394
  }, undefined, false, undefined, this),
7420
- error && status === "error" && /* @__PURE__ */ jsxDEV8(Box8, {
7395
+ error && status === "error" && /* @__PURE__ */ jsxDEV7(Box7, {
7421
7396
  marginLeft: 2,
7422
7397
  marginTop: 0,
7423
- children: /* @__PURE__ */ jsxDEV8(Text8, {
7398
+ children: /* @__PURE__ */ jsxDEV7(Text7, {
7424
7399
  color: colors.error,
7425
7400
  children: [
7426
7401
  box.vertical,
@@ -7434,25 +7409,26 @@ var ToolCallView = memo3(function ToolCallView2({
7434
7409
  });
7435
7410
 
7436
7411
  // src/ui/parallel-progress.tsx
7437
- import { Box as Box9, Text as Text9 } from "ink";
7438
- import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
7412
+ import { memo as memo7 } from "react";
7413
+ import { Box as Box8, Text as Text8 } from "ink";
7414
+ import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
7439
7415
  function ProgressBar({
7440
7416
  progress = 0,
7441
7417
  width = 20
7442
7418
  }) {
7443
7419
  const filled = Math.round(progress / 100 * width);
7444
7420
  const empty = width - filled;
7445
- return /* @__PURE__ */ jsxDEV9(Text9, {
7421
+ return /* @__PURE__ */ jsxDEV8(Text8, {
7446
7422
  children: [
7447
- /* @__PURE__ */ jsxDEV9(Text9, {
7423
+ /* @__PURE__ */ jsxDEV8(Text8, {
7448
7424
  color: colors.primary,
7449
7425
  children: "█".repeat(filled)
7450
7426
  }, undefined, false, undefined, this),
7451
- /* @__PURE__ */ jsxDEV9(Text9, {
7427
+ /* @__PURE__ */ jsxDEV8(Text8, {
7452
7428
  color: colors.border,
7453
7429
  children: "░".repeat(empty)
7454
7430
  }, undefined, false, undefined, this),
7455
- /* @__PURE__ */ jsxDEV9(Text9, {
7431
+ /* @__PURE__ */ jsxDEV8(Text8, {
7456
7432
  color: colors.textMuted,
7457
7433
  children: [
7458
7434
  " ",
@@ -7480,7 +7456,7 @@ function formatDuration(ms) {
7480
7456
  return `${ms}ms`;
7481
7457
  return `${(ms / 1000).toFixed(1)}s`;
7482
7458
  }
7483
- function ParallelProgressView({
7459
+ var ParallelProgressView = memo7(function ParallelProgressView2({
7484
7460
  title = "Parallel Execution",
7485
7461
  agents,
7486
7462
  strategy,
@@ -7490,22 +7466,22 @@ function ParallelProgressView({
7490
7466
  const errorCount = agents.filter((a) => a.status === "error").length;
7491
7467
  const runningCount = agents.filter((a) => a.status === "running").length;
7492
7468
  const strategyText = strategy === "all" ? "Waiting for all agents" : strategy === "race" ? "First to complete wins" : `Quorum: ${quorumSize || Math.ceil(agents.length / 2)} required`;
7493
- return /* @__PURE__ */ jsxDEV9(Box9, {
7469
+ return /* @__PURE__ */ jsxDEV8(Box8, {
7494
7470
  flexDirection: "column",
7495
7471
  borderStyle: "round",
7496
7472
  borderColor: colors.border,
7497
7473
  marginY: 1,
7498
7474
  children: [
7499
- /* @__PURE__ */ jsxDEV9(Box9, {
7475
+ /* @__PURE__ */ jsxDEV8(Box8, {
7500
7476
  paddingX: 1,
7501
7477
  justifyContent: "space-between",
7502
7478
  children: [
7503
- /* @__PURE__ */ jsxDEV9(Text9, {
7479
+ /* @__PURE__ */ jsxDEV8(Text8, {
7504
7480
  bold: true,
7505
7481
  color: colors.primary,
7506
7482
  children: title
7507
7483
  }, undefined, false, undefined, this),
7508
- /* @__PURE__ */ jsxDEV9(Text9, {
7484
+ /* @__PURE__ */ jsxDEV8(Text8, {
7509
7485
  color: colors.textMuted,
7510
7486
  children: [
7511
7487
  "Strategy: ",
@@ -7519,39 +7495,39 @@ function ParallelProgressView({
7519
7495
  }, undefined, true, undefined, this)
7520
7496
  ]
7521
7497
  }, undefined, true, undefined, this),
7522
- /* @__PURE__ */ jsxDEV9(Box9, {
7498
+ /* @__PURE__ */ jsxDEV8(Box8, {
7523
7499
  paddingX: 1,
7524
- children: /* @__PURE__ */ jsxDEV9(Text9, {
7500
+ children: /* @__PURE__ */ jsxDEV8(Text8, {
7525
7501
  color: colors.textDim,
7526
7502
  children: strategyText
7527
7503
  }, undefined, false, undefined, this)
7528
7504
  }, undefined, false, undefined, this),
7529
- /* @__PURE__ */ jsxDEV9(Box9, {
7505
+ /* @__PURE__ */ jsxDEV8(Box8, {
7530
7506
  flexDirection: "column",
7531
7507
  paddingX: 1,
7532
7508
  marginTop: 1,
7533
7509
  children: agents.map((agent, idx) => {
7534
7510
  const { icon, color } = getStatusDisplay(agent.status);
7535
- return /* @__PURE__ */ jsxDEV9(Box9, {
7511
+ return /* @__PURE__ */ jsxDEV8(Box8, {
7536
7512
  marginBottom: 0,
7537
7513
  children: [
7538
- /* @__PURE__ */ jsxDEV9(Box9, {
7514
+ /* @__PURE__ */ jsxDEV8(Box8, {
7539
7515
  width: 3,
7540
- children: agent.status === "running" ? /* @__PURE__ */ jsxDEV9(Text9, {
7516
+ children: agent.status === "running" ? /* @__PURE__ */ jsxDEV8(Text8, {
7541
7517
  color,
7542
7518
  children: "◐"
7543
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9(Text9, {
7519
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8(Text8, {
7544
7520
  color,
7545
7521
  children: icon
7546
7522
  }, undefined, false, undefined, this)
7547
7523
  }, undefined, false, undefined, this),
7548
- /* @__PURE__ */ jsxDEV9(Box9, {
7524
+ /* @__PURE__ */ jsxDEV8(Box8, {
7549
7525
  width: 15,
7550
- children: /* @__PURE__ */ jsxDEV9(Text9, {
7526
+ children: /* @__PURE__ */ jsxDEV8(Text8, {
7551
7527
  color: colors.text,
7552
7528
  children: [
7553
7529
  agent.name,
7554
- agent.mode && /* @__PURE__ */ jsxDEV9(Text9, {
7530
+ agent.mode && /* @__PURE__ */ jsxDEV8(Text8, {
7555
7531
  color: colors.textMuted,
7556
7532
  children: [
7557
7533
  " (",
@@ -7562,20 +7538,20 @@ function ParallelProgressView({
7562
7538
  ]
7563
7539
  }, undefined, true, undefined, this)
7564
7540
  }, undefined, false, undefined, this),
7565
- /* @__PURE__ */ jsxDEV9(Box9, {
7541
+ /* @__PURE__ */ jsxDEV8(Box8, {
7566
7542
  flexGrow: 1,
7567
- children: agent.status === "running" && agent.progress !== undefined ? /* @__PURE__ */ jsxDEV9(ProgressBar, {
7543
+ children: agent.status === "running" && agent.progress !== undefined ? /* @__PURE__ */ jsxDEV8(ProgressBar, {
7568
7544
  progress: agent.progress
7569
- }, undefined, false, undefined, this) : agent.status === "complete" ? /* @__PURE__ */ jsxDEV9(Text9, {
7545
+ }, undefined, false, undefined, this) : agent.status === "complete" ? /* @__PURE__ */ jsxDEV8(Text8, {
7570
7546
  color: colors.success,
7571
7547
  children: [
7572
7548
  "Complete ",
7573
7549
  agent.duration && `(${formatDuration(agent.duration)})`
7574
7550
  ]
7575
- }, undefined, true, undefined, this) : agent.status === "error" ? /* @__PURE__ */ jsxDEV9(Text9, {
7551
+ }, undefined, true, undefined, this) : agent.status === "error" ? /* @__PURE__ */ jsxDEV8(Text8, {
7576
7552
  color: colors.error,
7577
7553
  children: agent.error || "Failed"
7578
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV9(Text9, {
7554
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV8(Text8, {
7579
7555
  color: colors.textMuted,
7580
7556
  children: "Pending"
7581
7557
  }, undefined, false, undefined, this)
@@ -7584,10 +7560,10 @@ function ParallelProgressView({
7584
7560
  }, idx, true, undefined, this);
7585
7561
  })
7586
7562
  }, undefined, false, undefined, this),
7587
- runningCount === 0 && (completedCount > 0 || errorCount > 0) && /* @__PURE__ */ jsxDEV9(Box9, {
7563
+ runningCount === 0 && (completedCount > 0 || errorCount > 0) && /* @__PURE__ */ jsxDEV8(Box8, {
7588
7564
  paddingX: 1,
7589
7565
  marginTop: 1,
7590
- children: /* @__PURE__ */ jsxDEV9(Text9, {
7566
+ children: /* @__PURE__ */ jsxDEV8(Text8, {
7591
7567
  color: completedCount > 0 ? colors.success : colors.error,
7592
7568
  children: [
7593
7569
  icons.success,
@@ -7603,12 +7579,13 @@ function ParallelProgressView({
7603
7579
  }, undefined, false, undefined, this)
7604
7580
  ]
7605
7581
  }, undefined, true, undefined, this);
7606
- }
7582
+ });
7607
7583
 
7608
7584
  // src/ui/diff-view.tsx
7609
- import { Box as Box10, Text as Text10 } from "ink";
7585
+ import { memo as memo8 } from "react";
7586
+ import { Box as Box9, Text as Text9 } from "ink";
7610
7587
  import { basename as basename2 } from "path";
7611
- import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
7588
+ import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
7612
7589
  function computeDiff(oldLines, newLines) {
7613
7590
  const result = [];
7614
7591
  let i = 0, j = 0;
@@ -7671,7 +7648,7 @@ function collapseContext(lines, contextLines) {
7671
7648
  }
7672
7649
  return result;
7673
7650
  }
7674
- function DiffView({
7651
+ var DiffView = memo8(function DiffView2({
7675
7652
  filePath,
7676
7653
  oldContent,
7677
7654
  newContent,
@@ -7686,31 +7663,31 @@ function DiffView({
7686
7663
  const addCount = diff.filter((l) => l.type === "add").length;
7687
7664
  const removeCount = diff.filter((l) => l.type === "remove").length;
7688
7665
  if (addCount === 0 && removeCount === 0) {
7689
- return /* @__PURE__ */ jsxDEV10(Box10, {
7666
+ return /* @__PURE__ */ jsxDEV9(Box9, {
7690
7667
  flexDirection: "column",
7691
7668
  marginY: 1,
7692
- children: /* @__PURE__ */ jsxDEV10(Text10, {
7669
+ children: /* @__PURE__ */ jsxDEV9(Text9, {
7693
7670
  color: colors.textMuted,
7694
7671
  children: "No changes detected"
7695
7672
  }, undefined, false, undefined, this)
7696
7673
  }, undefined, false, undefined, this);
7697
7674
  }
7698
- return /* @__PURE__ */ jsxDEV10(Box10, {
7675
+ return /* @__PURE__ */ jsxDEV9(Box9, {
7699
7676
  flexDirection: "column",
7700
7677
  borderStyle: "round",
7701
7678
  borderColor: colors.border,
7702
7679
  marginY: 1,
7703
7680
  children: [
7704
- /* @__PURE__ */ jsxDEV10(Box10, {
7681
+ /* @__PURE__ */ jsxDEV9(Box9, {
7705
7682
  paddingX: 1,
7706
7683
  borderBottom: true,
7707
7684
  children: [
7708
- /* @__PURE__ */ jsxDEV10(Text10, {
7685
+ /* @__PURE__ */ jsxDEV9(Text9, {
7709
7686
  bold: true,
7710
7687
  color: colors.text,
7711
7688
  children: basename2(filePath)
7712
7689
  }, undefined, false, undefined, this),
7713
- /* @__PURE__ */ jsxDEV10(Text10, {
7690
+ /* @__PURE__ */ jsxDEV9(Text9, {
7714
7691
  color: colors.textMuted,
7715
7692
  children: [
7716
7693
  " (",
@@ -7720,21 +7697,21 @@ function DiffView({
7720
7697
  }, undefined, true, undefined, this)
7721
7698
  ]
7722
7699
  }, undefined, true, undefined, this),
7723
- /* @__PURE__ */ jsxDEV10(Box10, {
7700
+ /* @__PURE__ */ jsxDEV9(Box9, {
7724
7701
  paddingX: 1,
7725
7702
  children: [
7726
- /* @__PURE__ */ jsxDEV10(Text10, {
7703
+ /* @__PURE__ */ jsxDEV9(Text9, {
7727
7704
  color: colors.success,
7728
7705
  children: [
7729
7706
  "+",
7730
7707
  addCount
7731
7708
  ]
7732
7709
  }, undefined, true, undefined, this),
7733
- /* @__PURE__ */ jsxDEV10(Text10, {
7710
+ /* @__PURE__ */ jsxDEV9(Text9, {
7734
7711
  color: colors.textMuted,
7735
7712
  children: " / "
7736
7713
  }, undefined, false, undefined, this),
7737
- /* @__PURE__ */ jsxDEV10(Text10, {
7714
+ /* @__PURE__ */ jsxDEV9(Text9, {
7738
7715
  color: colors.error,
7739
7716
  children: [
7740
7717
  "-",
@@ -7743,15 +7720,15 @@ function DiffView({
7743
7720
  }, undefined, true, undefined, this)
7744
7721
  ]
7745
7722
  }, undefined, true, undefined, this),
7746
- /* @__PURE__ */ jsxDEV10(Box10, {
7723
+ /* @__PURE__ */ jsxDEV9(Box9, {
7747
7724
  flexDirection: "column",
7748
7725
  paddingX: 1,
7749
7726
  children: diff.map((line, idx) => {
7750
7727
  const prefix = line.type === "add" ? "+" : line.type === "remove" ? "-" : " ";
7751
7728
  const textColor = line.type === "add" ? colors.success : line.type === "remove" ? colors.error : colors.textMuted;
7752
7729
  const bgColor = line.type === "add" ? "#1a3d1a" : line.type === "remove" ? "#3d1a1a" : undefined;
7753
- return /* @__PURE__ */ jsxDEV10(Box10, {
7754
- children: /* @__PURE__ */ jsxDEV10(Text10, {
7730
+ return /* @__PURE__ */ jsxDEV9(Box9, {
7731
+ children: /* @__PURE__ */ jsxDEV9(Text9, {
7755
7732
  color: textColor,
7756
7733
  backgroundColor: bgColor,
7757
7734
  children: [
@@ -7765,70 +7742,71 @@ function DiffView({
7765
7742
  }, undefined, false, undefined, this)
7766
7743
  ]
7767
7744
  }, undefined, true, undefined, this);
7768
- }
7745
+ });
7769
7746
 
7770
7747
  // src/ui/confirm-dialog.tsx
7771
- import { Box as Box11, Text as Text11 } from "ink";
7772
- import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
7773
- function ConfirmDialog({
7748
+ import { memo as memo9 } from "react";
7749
+ import { Box as Box10, Text as Text10 } from "ink";
7750
+ import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
7751
+ var ConfirmDialog = memo9(function ConfirmDialog2({
7774
7752
  message,
7775
7753
  details,
7776
7754
  showDiff
7777
7755
  }) {
7778
- return /* @__PURE__ */ jsxDEV11(Box11, {
7756
+ return /* @__PURE__ */ jsxDEV10(Box10, {
7779
7757
  flexDirection: "column",
7780
7758
  borderStyle: "round",
7781
7759
  borderColor: colors.warning,
7782
7760
  paddingX: 1,
7783
7761
  marginY: 1,
7784
7762
  children: [
7785
- /* @__PURE__ */ jsxDEV11(Box11, {
7763
+ /* @__PURE__ */ jsxDEV10(Box10, {
7786
7764
  children: [
7787
- /* @__PURE__ */ jsxDEV11(Text11, {
7765
+ /* @__PURE__ */ jsxDEV10(Text10, {
7788
7766
  color: colors.warning,
7789
7767
  children: [
7790
7768
  icons.warning,
7791
7769
  " "
7792
7770
  ]
7793
7771
  }, undefined, true, undefined, this),
7794
- /* @__PURE__ */ jsxDEV11(Text11, {
7772
+ /* @__PURE__ */ jsxDEV10(Text10, {
7795
7773
  bold: true,
7796
7774
  color: colors.warning,
7797
7775
  children: "Confirmation Required"
7798
7776
  }, undefined, false, undefined, this)
7799
7777
  ]
7800
7778
  }, undefined, true, undefined, this),
7801
- /* @__PURE__ */ jsxDEV11(Box11, {
7779
+ /* @__PURE__ */ jsxDEV10(Box10, {
7802
7780
  marginTop: 1,
7803
- children: /* @__PURE__ */ jsxDEV11(Text11, {
7781
+ children: /* @__PURE__ */ jsxDEV10(Text10, {
7804
7782
  color: colors.text,
7805
7783
  children: message
7806
7784
  }, undefined, false, undefined, this)
7807
7785
  }, undefined, false, undefined, this),
7808
- details && /* @__PURE__ */ jsxDEV11(Box11, {
7786
+ details && /* @__PURE__ */ jsxDEV10(Box10, {
7809
7787
  marginTop: 1,
7810
7788
  marginLeft: 2,
7811
- children: /* @__PURE__ */ jsxDEV11(Text11, {
7789
+ children: /* @__PURE__ */ jsxDEV10(Text10, {
7812
7790
  color: colors.textMuted,
7813
7791
  children: details
7814
7792
  }, undefined, false, undefined, this)
7815
7793
  }, undefined, false, undefined, this),
7816
- showDiff && /* @__PURE__ */ jsxDEV11(Box11, {
7794
+ showDiff && /* @__PURE__ */ jsxDEV10(Box10, {
7817
7795
  marginTop: 1,
7818
7796
  children: showDiff
7819
7797
  }, undefined, false, undefined, this),
7820
- /* @__PURE__ */ jsxDEV11(Box11, {
7798
+ /* @__PURE__ */ jsxDEV10(Box10, {
7821
7799
  marginTop: 1,
7822
- children: /* @__PURE__ */ jsxDEV11(Text11, {
7800
+ children: /* @__PURE__ */ jsxDEV10(Text10, {
7823
7801
  color: colors.primary,
7824
7802
  children: [
7825
7803
  "Type ",
7826
- /* @__PURE__ */ jsxDEV11(Text11, {
7804
+ /* @__PURE__ */ jsxDEV10(Text10, {
7827
7805
  bold: true,
7828
7806
  children: "y"
7829
7807
  }, undefined, false, undefined, this),
7830
7808
  " or ",
7831
- /* @__PURE__ */ jsxDEV11(Text11, {
7809
+ /* @__PURE__ */ jsxDEV10(Text10, {
7832
7810
  bold: true,
7833
7811
  children: "yes"
7834
7812
  }, undefined, false, undefined, this),
@@ -7838,7 +7816,7 @@ function ConfirmDialog({
7838
7816
  }, undefined, false, undefined, this)
7839
7817
  ]
7840
7818
  }, undefined, true, undefined, this);
7841
- }
7819
+ });
7842
7820
 
7843
7821
  // src/ui/commands/registry.ts
7844
7822
  import { resolve as resolve3, isAbsolute } from "path";
@@ -8562,9 +8540,97 @@ Type /help for available commands.`,
8562
8540
  }
8563
8541
  return await cmd.handler(args.trim(), ctx);
8564
8542
  }
8565
- // src/ui/app.tsx
8543
+ // src/ui/hooks/useAgentSession.ts
8544
+ import { useReducer, useRef, useCallback, useEffect as useEffect2 } from "react";
8566
8545
  import { basename as basename3 } from "path";
8567
- import { jsxDEV as jsxDEV12, Fragment } from "react/jsx-dev-runtime";
8546
+ function sessionReducer(state, action) {
8547
+ switch (action.type) {
8548
+ case "ADD_MESSAGE":
8549
+ return { ...state, messages: [...state.messages, action.message] };
8550
+ case "CLEAR_MESSAGES":
8551
+ return { ...state, messages: [] };
8552
+ case "SET_LOADING":
8553
+ return { ...state, isLoading: action.value };
8554
+ case "SET_EXECUTING":
8555
+ return { ...state, isExecuting: action.value };
8556
+ case "SET_CURRENT_OUTPUT":
8557
+ return { ...state, currentOutput: action.value };
8558
+ case "FLUSH_STREAMING": {
8559
+ const next = { ...state };
8560
+ next.currentOutput = action.output;
8561
+ next.currentReasoning = action.reasoning;
8562
+ if (action.tokenDelta > 0) {
8563
+ next.tokenCount = state.tokenCount + action.tokenDelta;
8564
+ next.sessionCost = state.sessionCost + action.costDelta;
8565
+ }
8566
+ if (action.toolCalls !== null) {
8567
+ next.activeToolCalls = action.toolCalls;
8568
+ }
8569
+ return next;
8570
+ }
8571
+ case "HIDE_WELCOME":
8572
+ return { ...state, showWelcome: false };
8573
+ case "SHOW_WELCOME":
8574
+ return { ...state, showWelcome: true };
8575
+ case "SET_CURRENT_DIR":
8576
+ return { ...state, currentDir: action.value };
8577
+ case "SET_PENDING_CONFIRM":
8578
+ return { ...state, pendingConfirm: action.value };
8579
+ case "SET_BEADS_ENABLED":
8580
+ return { ...state, beadsEnabled: action.value };
8581
+ case "SET_CONTEXT_FILES":
8582
+ return { ...state, contextFiles: action.value };
8583
+ case "SET_CURRENT_AGENT":
8584
+ return { ...state, currentAgent: action.value };
8585
+ case "SET_PARALLEL_PROGRESS":
8586
+ return { ...state, parallelProgress: action.value };
8587
+ case "SET_THINKING":
8588
+ return { ...state, thinkingMessage: action.value };
8589
+ case "SET_MODEL":
8590
+ return { ...state, currentModel: action.value };
8591
+ case "SET_TOKEN_COUNT":
8592
+ return { ...state, tokenCount: action.value };
8593
+ case "ADD_TOKENS":
8594
+ return { ...state, tokenCount: state.tokenCount + action.delta };
8595
+ case "CANCEL_OPERATION":
8596
+ return {
8597
+ ...state,
8598
+ isLoading: false,
8599
+ isExecuting: false,
8600
+ currentOutput: "",
8601
+ currentReasoning: "",
8602
+ activeToolCalls: [],
8603
+ thinkingMessage: null,
8604
+ messages: [
8605
+ ...state.messages,
8606
+ { role: "system", content: "Operation cancelled", timestamp: new Date }
8607
+ ]
8608
+ };
8609
+ case "FINISH_RESPONSE":
8610
+ return {
8611
+ ...state,
8612
+ currentOutput: "",
8613
+ currentReasoning: "",
8614
+ activeToolCalls: [],
8615
+ currentAgent: null,
8616
+ thinkingMessage: null,
8617
+ parallelProgress: null,
8618
+ isLoading: false,
8619
+ isExecuting: false,
8620
+ messages: action.content.trim() ? [
8621
+ ...state.messages,
8622
+ {
8623
+ role: "assistant",
8624
+ content: action.content.trim(),
8625
+ timestamp: new Date,
8626
+ toolCalls: action.toolCalls.length > 0 ? action.toolCalls : undefined
8627
+ }
8628
+ ] : state.messages
8629
+ };
8630
+ default:
8631
+ return state;
8632
+ }
8633
+ }
8568
8634
  function estimateTokens(text) {
8569
8635
  return Math.ceil(text.length / 4);
8570
8636
  }
@@ -8574,329 +8640,193 @@ function formatToolInfo(name, args) {
8574
8640
  const path = args["path"] || args["filePath"] || args["file"];
8575
8641
  const command = args["command"];
8576
8642
  const taskName = args["name"] || args["task"];
8577
- if (path && typeof path === "string") {
8643
+ if (path && typeof path === "string")
8578
8644
  return `${name} → ${basename3(path)}`;
8579
- }
8580
8645
  if (command && typeof command === "string") {
8581
- const shortCmd = command.length > 40 ? command.slice(0, 37) + "..." : command;
8582
- return `${name} → ${shortCmd}`;
8646
+ const short = command.length > 40 ? command.slice(0, 37) + "..." : command;
8647
+ return `${name} → ${short}`;
8583
8648
  }
8584
- if (taskName && typeof taskName === "string") {
8649
+ if (taskName && typeof taskName === "string")
8585
8650
  return `${name} → "${taskName}"`;
8586
- }
8587
8651
  return name;
8588
8652
  }
8589
- function App({ contextFiles: initialContextFiles, enableBeads: initialBeadsEnabled = true, version = "0.0.0", workingDir: cliWorkingDir }) {
8590
- const [messages, setMessages] = useState2([]);
8591
- const [input, setInput] = useState2("");
8592
- const [isLoading, setIsLoading] = useState2(false);
8593
- const [currentOutput, setCurrentOutput] = useState2("");
8594
- const [showWelcome, setShowWelcome] = useState2(true);
8595
- const [tokenCount, setTokenCount] = useState2(0);
8596
- const [sessionCost, setSessionCost] = useState2(0);
8597
- const [currentDir, setCurrentDir] = useState2(() => getWorkingDir(cliWorkingDir));
8598
- const [pendingConfirm, setPendingConfirm] = useState2(null);
8599
- const [beadsEnabled, setBeadsEnabled] = useState2(initialBeadsEnabled);
8600
- const [contextFiles, setContextFiles] = useState2(initialContextFiles || []);
8601
- const [activeToolCalls, setActiveToolCalls] = useState2([]);
8602
- const [currentAgent, setCurrentAgent] = useState2(null);
8603
- const [isExecuting, setIsExecuting] = useState2(false);
8604
- const [parallelProgress, setParallelProgress] = useState2(null);
8605
- const [thinkingMessage, setThinkingMessage] = useState2(null);
8606
- const [currentReasoning, setCurrentReasoning] = useState2("");
8607
- const pendingReasoningRef = useRef("");
8608
- const [currentModel, setCurrentModel] = useState2(() => {
8609
- const config = loadConfig();
8610
- return config.azure.deployment;
8653
+ var RENDER_INTERVAL = 150;
8654
+ function useAgentSession(options = {}) {
8655
+ const config = loadConfig();
8656
+ const [state, dispatch] = useReducer(sessionReducer, {
8657
+ messages: [],
8658
+ isLoading: false,
8659
+ currentOutput: "",
8660
+ showWelcome: true,
8661
+ tokenCount: 0,
8662
+ sessionCost: 0,
8663
+ currentDir: getWorkingDir(options.workingDir),
8664
+ pendingConfirm: null,
8665
+ beadsEnabled: options.enableBeads ?? true,
8666
+ contextFiles: options.contextFiles || [],
8667
+ activeToolCalls: [],
8668
+ currentAgent: null,
8669
+ isExecuting: false,
8670
+ parallelProgress: null,
8671
+ thinkingMessage: null,
8672
+ currentReasoning: "",
8673
+ currentModel: config.azure.deployment
8611
8674
  });
8612
8675
  const abortControllerRef = useRef(null);
8613
8676
  const pendingOutputRef = useRef("");
8677
+ const pendingReasoningRef = useRef("");
8614
8678
  const pendingTokensRef = useRef(0);
8615
8679
  const pendingCostRef = useRef(0);
8616
- const outputTimerRef = useRef(null);
8617
- const { exit } = useApp();
8618
- const workingDir = currentDir;
8619
- const flushOutput = useCallback(() => {
8620
- const output = pendingOutputRef.current;
8621
- const reasoning = pendingReasoningRef.current;
8680
+ const activeToolCallsRef = useRef([]);
8681
+ const toolCallsDirtyRef = useRef(false);
8682
+ const renderTimerRef = useRef(null);
8683
+ const flushRender = useCallback(() => {
8622
8684
  const tokens = pendingTokensRef.current;
8623
8685
  const cost = pendingCostRef.current;
8624
- if (output)
8625
- setCurrentOutput(output);
8626
- if (reasoning)
8627
- setCurrentReasoning(reasoning);
8628
- if (tokens > 0) {
8629
- setTokenCount((prev) => prev + tokens);
8630
- pendingTokensRef.current = 0;
8631
- }
8632
- if (cost > 0) {
8633
- setSessionCost((prev) => prev + cost);
8634
- pendingCostRef.current = 0;
8635
- }
8636
- outputTimerRef.current = null;
8686
+ pendingTokensRef.current = 0;
8687
+ pendingCostRef.current = 0;
8688
+ const toolCallsSnapshot = toolCallsDirtyRef.current ? [...activeToolCallsRef.current] : null;
8689
+ toolCallsDirtyRef.current = false;
8690
+ renderTimerRef.current = null;
8691
+ dispatch({
8692
+ type: "FLUSH_STREAMING",
8693
+ output: pendingOutputRef.current,
8694
+ reasoning: pendingReasoningRef.current,
8695
+ tokenDelta: tokens,
8696
+ costDelta: cost,
8697
+ toolCalls: toolCallsSnapshot
8698
+ });
8637
8699
  }, []);
8638
- const throttledSetOutput = useCallback((content, chunkTokens) => {
8639
- pendingOutputRef.current = content;
8640
- if (chunkTokens && chunkTokens > 0) {
8641
- pendingTokensRef.current += chunkTokens;
8642
- pendingCostRef.current += chunkTokens * 0.00003;
8700
+ const scheduleRender = useCallback(() => {
8701
+ if (!renderTimerRef.current) {
8702
+ renderTimerRef.current = setTimeout(flushRender, RENDER_INTERVAL);
8643
8703
  }
8644
- if (!outputTimerRef.current) {
8645
- outputTimerRef.current = setTimeout(flushOutput, 80);
8646
- }
8647
- }, [flushOutput]);
8704
+ }, [flushRender]);
8648
8705
  useEffect2(() => {
8649
8706
  return () => {
8650
- if (outputTimerRef.current)
8651
- clearTimeout(outputTimerRef.current);
8707
+ if (renderTimerRef.current)
8708
+ clearTimeout(renderTimerRef.current);
8652
8709
  };
8653
8710
  }, []);
8654
- const agent = React5.useMemo(() => new Agent({
8655
- contextFiles,
8656
- enableBeads: beadsEnabled
8657
- }), [contextFiles, beadsEnabled]);
8658
- const commandContext = React5.useMemo(() => ({
8659
- currentDir,
8660
- setCurrentDir,
8661
- addMessage: (role, content) => {
8662
- setMessages((prev) => [...prev, { role, content, timestamp: new Date }]);
8663
- },
8664
- clearMessages: () => setMessages([]),
8665
- showWelcome: () => setShowWelcome(true),
8666
- agent,
8667
- version,
8668
- exit,
8669
- setPendingConfirm,
8670
- beadsEnabled,
8671
- setBeadsEnabled,
8672
- contextFiles,
8673
- setContextFiles,
8674
- emitParallelStart: (agents, strategy) => {
8675
- setParallelProgress({ agents, strategy });
8676
- },
8677
- emitParallelProgress: (agents) => {
8678
- setParallelProgress((prev) => prev ? { ...prev, agents } : null);
8679
- },
8680
- emitParallelComplete: (results, consolidated) => {
8681
- setParallelProgress(null);
8682
- setMessages((prev) => [...prev, {
8683
- role: "assistant",
8684
- content: consolidated,
8685
- timestamp: new Date
8686
- }]);
8687
- },
8688
- currentModel,
8689
- setCurrentModel
8690
- }), [currentDir, agent, version, exit, beadsEnabled, contextFiles, currentModel]);
8691
- useInput((inputChar, key) => {
8692
- if (key.ctrl && inputChar === "c") {
8693
- if (isExecuting && abortControllerRef.current) {
8694
- abortControllerRef.current.abort();
8695
- setMessages((prev) => [...prev, {
8696
- role: "system",
8697
- content: "⚠️ Operation cancelled",
8698
- timestamp: new Date
8699
- }]);
8700
- setIsLoading(false);
8701
- setIsExecuting(false);
8702
- setCurrentOutput("");
8703
- setActiveToolCalls([]);
8704
- } else if (!input.trim()) {
8705
- exit();
8706
- }
8707
- return;
8708
- }
8709
- if (key.escape) {
8710
- exit();
8711
- return;
8712
- }
8713
- if (key.return && input.trim() && !isLoading) {
8714
- handleSubmit();
8715
- return;
8716
- }
8717
- if (key.backspace || key.delete) {
8718
- setInput((prev) => prev.slice(0, -1));
8719
- return;
8720
- }
8721
- if (!key.ctrl && !key.meta && inputChar) {
8722
- setInput((prev) => prev + inputChar);
8723
- }
8724
- });
8725
- function handleConfirmation(response) {
8726
- if (!pendingConfirm)
8727
- return false;
8728
- const isYes = response.toLowerCase() === "y" || response.toLowerCase() === "yes";
8729
- if (pendingConfirm.type === "mkdir") {
8730
- const { path: targetPath } = pendingConfirm.data;
8731
- const { mkdirSync: mkdirSync2 } = __require("fs");
8732
- if (isYes) {
8733
- try {
8734
- mkdirSync2(targetPath, { recursive: true });
8735
- process.chdir(targetPath);
8736
- setCurrentDir(targetPath);
8737
- setMessages((prev) => [...prev, {
8738
- role: "system",
8739
- content: `✓ Created directory and changed to: ${targetPath}`,
8740
- timestamp: new Date
8741
- }]);
8742
- } catch (err) {
8743
- setMessages((prev) => [...prev, {
8744
- role: "system",
8745
- content: `Error creating directory: ${err.message}`,
8746
- timestamp: new Date
8747
- }]);
8748
- }
8749
- } else {
8750
- setMessages((prev) => [...prev, {
8751
- role: "system",
8752
- content: `Cancelled. Directory not created.`,
8753
- timestamp: new Date
8754
- }]);
8755
- }
8756
- setPendingConfirm(null);
8757
- return true;
8758
- }
8759
- setPendingConfirm(null);
8760
- return false;
8761
- }
8762
- async function handleSubmit() {
8763
- const userMessage = input.trim();
8764
- if (!userMessage)
8765
- return;
8766
- if (pendingConfirm) {
8767
- setInput("");
8768
- if (showWelcome)
8769
- setShowWelcome(false);
8770
- setMessages((prev) => [...prev, { role: "user", content: userMessage, timestamp: new Date }]);
8771
- handleConfirmation(userMessage);
8772
- return;
8773
- }
8774
- const lowerMessage = userMessage.toLowerCase();
8775
- if (userMessage.startsWith("/") || lowerMessage.startsWith("cd ") || lowerMessage === "cd" || lowerMessage === "pwd") {
8776
- setInput("");
8777
- let normalizedCommand = userMessage;
8778
- if (!userMessage.startsWith("/")) {
8779
- normalizedCommand = "/" + userMessage;
8780
- }
8781
- const result = await executeCommand(normalizedCommand, commandContext);
8782
- if (result.handled) {
8783
- if (result.message) {
8784
- setMessages((prev) => [...prev, {
8785
- role: "system",
8786
- content: result.message,
8787
- timestamp: new Date
8788
- }]);
8789
- }
8790
- if (showWelcome)
8791
- setShowWelcome(false);
8792
- return;
8793
- }
8794
- }
8795
- if (showWelcome) {
8796
- setShowWelcome(false);
8797
- }
8798
- setMessages((prev) => [...prev, { role: "user", content: userMessage, timestamp: new Date }]);
8799
- setInput("");
8800
- setIsLoading(true);
8801
- setIsExecuting(true);
8802
- setCurrentOutput("");
8803
- setCurrentReasoning("");
8711
+ const updateToolCalls = useCallback((updater) => {
8712
+ activeToolCallsRef.current = updater(activeToolCallsRef.current);
8713
+ toolCallsDirtyRef.current = true;
8714
+ scheduleRender();
8715
+ }, [scheduleRender]);
8716
+ const processAgentEvents = useCallback(async (agent, userMessage) => {
8717
+ dispatch({ type: "ADD_TOKENS", delta: estimateTokens(userMessage) });
8718
+ dispatch({ type: "SET_LOADING", value: true });
8719
+ dispatch({ type: "SET_EXECUTING", value: true });
8720
+ dispatch({ type: "SET_CURRENT_OUTPUT", value: "" });
8721
+ pendingOutputRef.current = "";
8804
8722
  pendingReasoningRef.current = "";
8805
- setActiveToolCalls([]);
8806
- const inputTokens = estimateTokens(userMessage);
8807
- setTokenCount((prev) => prev + inputTokens);
8723
+ pendingTokensRef.current = 0;
8724
+ pendingCostRef.current = 0;
8725
+ activeToolCallsRef.current = [];
8726
+ toolCallsDirtyRef.current = false;
8808
8727
  abortControllerRef.current = new AbortController;
8728
+ let assistantContent = "";
8729
+ const completedToolCalls = [];
8809
8730
  try {
8810
- let assistantContent = "";
8811
- const completedToolCalls = [];
8812
8731
  for await (const event of agent.run(userMessage)) {
8813
- if (abortControllerRef.current?.signal.aborted) {
8732
+ if (abortControllerRef.current?.signal.aborted)
8814
8733
  break;
8815
- }
8816
8734
  switch (event.type) {
8817
8735
  case "reasoning":
8818
8736
  pendingReasoningRef.current += event.content;
8819
- if (!outputTimerRef.current) {
8820
- outputTimerRef.current = setTimeout(flushOutput, 80);
8821
- }
8737
+ scheduleRender();
8822
8738
  break;
8823
- case "text":
8739
+ case "text": {
8740
+ const tokens = estimateTokens(event.content);
8824
8741
  assistantContent += event.content;
8825
- const chunkTokens = estimateTokens(event.content);
8826
- throttledSetOutput(assistantContent, chunkTokens);
8742
+ pendingOutputRef.current = assistantContent;
8743
+ pendingTokensRef.current += tokens;
8744
+ pendingCostRef.current += tokens * 0.00003;
8745
+ scheduleRender();
8827
8746
  break;
8747
+ }
8828
8748
  case "agent_start":
8829
- setCurrentAgent(event.agent);
8830
- setMessages((prev) => [...prev, {
8831
- role: "system",
8832
- content: `${icons.shark} ${event.agent} agent starting${event.mode ? ` (${event.mode} mode)` : ""}...`,
8833
- timestamp: new Date
8834
- }]);
8749
+ dispatch({ type: "SET_CURRENT_AGENT", value: event.agent });
8750
+ dispatch({
8751
+ type: "ADD_MESSAGE",
8752
+ message: {
8753
+ role: "system",
8754
+ content: `${event.agent} agent starting${"mode" in event && event.mode ? ` (${event.mode} mode)` : ""}...`,
8755
+ timestamp: new Date
8756
+ }
8757
+ });
8835
8758
  break;
8836
8759
  case "handoff":
8837
- setMessages((prev) => [...prev, {
8838
- role: "system",
8839
- content: `\uD83D\uDCE4 Delegating to ${event.to}...`,
8840
- timestamp: new Date
8841
- }]);
8760
+ dispatch({
8761
+ type: "ADD_MESSAGE",
8762
+ message: {
8763
+ role: "system",
8764
+ content: `Delegating to ${event.to}...`,
8765
+ timestamp: new Date
8766
+ }
8767
+ });
8842
8768
  break;
8843
8769
  case "replan":
8844
- setMessages((prev) => [...prev, {
8845
- role: "system",
8846
- content: `⚠️ Re-planning: ${event.reason}`,
8847
- timestamp: new Date
8848
- }]);
8770
+ dispatch({
8771
+ type: "ADD_MESSAGE",
8772
+ message: {
8773
+ role: "system",
8774
+ content: `Re-planning: ${event.reason}`,
8775
+ timestamp: new Date
8776
+ }
8777
+ });
8849
8778
  break;
8850
8779
  case "thinking":
8851
- setThinkingMessage(event.message || `${event.agent} is thinking...`);
8780
+ dispatch({ type: "SET_THINKING", value: event.message || `${event.agent} is thinking...` });
8852
8781
  break;
8853
8782
  case "parallel_start":
8854
- setParallelProgress({
8855
- agents: event.agents,
8856
- strategy: event.strategy
8783
+ dispatch({
8784
+ type: "SET_PARALLEL_PROGRESS",
8785
+ value: { agents: event.agents, strategy: event.strategy }
8786
+ });
8787
+ dispatch({
8788
+ type: "ADD_MESSAGE",
8789
+ message: {
8790
+ role: "system",
8791
+ content: `Starting parallel execution (${event.strategy} strategy) with ${event.agents.length} agents...`,
8792
+ timestamp: new Date
8793
+ }
8857
8794
  });
8858
- setMessages((prev) => [...prev, {
8859
- role: "system",
8860
- content: `\uD83D\uDD00 Starting parallel execution (${event.strategy} strategy) with ${event.agents.length} agents...`,
8861
- timestamp: new Date
8862
- }]);
8863
8795
  break;
8864
8796
  case "parallel_progress":
8865
- setParallelProgress((prev) => prev ? {
8866
- ...prev,
8867
- agents: event.agents
8868
- } : null);
8797
+ dispatch({
8798
+ type: "SET_PARALLEL_PROGRESS",
8799
+ value: { agents: event.agents, strategy: "all" }
8800
+ });
8869
8801
  break;
8870
8802
  case "parallel_complete":
8871
- setParallelProgress(null);
8872
- setMessages((prev) => [...prev, {
8873
- role: "system",
8874
- content: `✅ Parallel execution complete:
8803
+ dispatch({ type: "SET_PARALLEL_PROGRESS", value: null });
8804
+ dispatch({
8805
+ type: "ADD_MESSAGE",
8806
+ message: {
8807
+ role: "system",
8808
+ content: `Parallel execution complete:
8875
8809
  ${event.consolidated}`,
8876
- timestamp: new Date
8877
- }]);
8810
+ timestamp: new Date
8811
+ }
8812
+ });
8878
8813
  break;
8879
8814
  case "tool_start": {
8880
8815
  const toolInfo = formatToolInfo(event.name, event.args);
8881
- const newTool = {
8816
+ updateToolCalls((prev) => [...prev, {
8882
8817
  id: `${event.name}-${Date.now()}`,
8883
8818
  name: event.name,
8884
8819
  displayName: toolInfo,
8885
8820
  status: "running",
8886
8821
  startTime: Date.now()
8887
- };
8888
- setActiveToolCalls((prev) => [...prev, newTool]);
8822
+ }]);
8889
8823
  break;
8890
8824
  }
8891
8825
  case "tool_result": {
8826
+ const resultStr = typeof event.result === "string" ? event.result.slice(0, 100) : JSON.stringify(event.result).slice(0, 100);
8892
8827
  const duration = event.duration;
8893
- setActiveToolCalls((prev) => {
8894
- const updated = prev.map((tc) => tc.name === event.name && tc.status === "running" ? {
8895
- ...tc,
8896
- status: "success",
8897
- duration,
8898
- result: typeof event.result === "string" ? event.result.slice(0, 100) : JSON.stringify(event.result).slice(0, 100)
8899
- } : tc);
8828
+ updateToolCalls((prev) => {
8829
+ const updated = prev.map((tc) => tc.name === event.name && tc.status === "running" ? { ...tc, status: "success", duration, result: resultStr } : tc);
8900
8830
  const completed = updated.find((tc) => tc.name === event.name && tc.status === "success");
8901
8831
  if (completed) {
8902
8832
  completedToolCalls.push(completed);
@@ -8907,83 +8837,356 @@ ${event.consolidated}`,
8907
8837
  }
8908
8838
  case "tool_error": {
8909
8839
  const duration = event.duration;
8910
- setActiveToolCalls((prev) => prev.map((tc) => tc.name === event.name && tc.status === "running" ? {
8911
- ...tc,
8912
- status: "error",
8913
- duration,
8914
- error: event.error
8915
- } : tc));
8840
+ updateToolCalls((prev) => prev.map((tc) => tc.name === event.name && tc.status === "running" ? { ...tc, status: "error", duration, error: event.error } : tc));
8916
8841
  break;
8917
8842
  }
8918
8843
  case "token_usage":
8919
- setTokenCount(event.totalTokens);
8844
+ dispatch({ type: "SET_TOKEN_COUNT", value: event.totalTokens });
8920
8845
  break;
8921
- case "done":
8922
- if (outputTimerRef.current) {
8923
- clearTimeout(outputTimerRef.current);
8924
- outputTimerRef.current = null;
8846
+ case "done": {
8847
+ if (renderTimerRef.current) {
8848
+ clearTimeout(renderTimerRef.current);
8849
+ renderTimerRef.current = null;
8925
8850
  }
8926
8851
  if (pendingTokensRef.current > 0) {
8927
- setTokenCount((prev) => prev + pendingTokensRef.current);
8852
+ dispatch({ type: "ADD_TOKENS", delta: pendingTokensRef.current });
8928
8853
  pendingTokensRef.current = 0;
8929
8854
  }
8930
- if (pendingCostRef.current > 0) {
8931
- setSessionCost((prev) => prev + pendingCostRef.current);
8932
- pendingCostRef.current = 0;
8933
- }
8934
8855
  pendingOutputRef.current = "";
8935
8856
  pendingReasoningRef.current = "";
8936
- setCurrentReasoning("");
8937
- if (assistantContent.trim()) {
8938
- setMessages((prev) => [...prev, {
8939
- role: "assistant",
8940
- content: assistantContent.trim(),
8941
- timestamp: new Date,
8942
- toolCalls: completedToolCalls.length > 0 ? [...completedToolCalls] : undefined
8943
- }]);
8944
- }
8945
- setCurrentOutput("");
8946
- setActiveToolCalls([]);
8947
- setCurrentAgent(null);
8948
- setThinkingMessage(null);
8949
- setParallelProgress(null);
8857
+ pendingCostRef.current = 0;
8858
+ activeToolCallsRef.current = [];
8859
+ toolCallsDirtyRef.current = false;
8860
+ dispatch({
8861
+ type: "FINISH_RESPONSE",
8862
+ content: assistantContent,
8863
+ toolCalls: completedToolCalls
8864
+ });
8950
8865
  break;
8866
+ }
8951
8867
  case "error":
8952
- setMessages((prev) => [...prev, {
8953
- role: "system",
8954
- content: `Error: ${event.message}`,
8955
- timestamp: new Date
8956
- }]);
8868
+ dispatch({
8869
+ type: "ADD_MESSAGE",
8870
+ message: {
8871
+ role: "system",
8872
+ content: `Error: ${event.message}`,
8873
+ timestamp: new Date
8874
+ }
8875
+ });
8957
8876
  break;
8958
8877
  }
8959
8878
  }
8960
8879
  } catch (error) {
8961
- if (abortControllerRef.current?.signal.aborted) {} else {
8880
+ if (!abortControllerRef.current?.signal.aborted) {
8962
8881
  const message = error instanceof Error ? error.message : "Unknown error";
8963
- setMessages((prev) => [...prev, {
8964
- role: "system",
8965
- content: `Error: ${message}`,
8966
- timestamp: new Date
8967
- }]);
8882
+ dispatch({
8883
+ type: "ADD_MESSAGE",
8884
+ message: { role: "system", content: `Error: ${message}`, timestamp: new Date }
8885
+ });
8968
8886
  }
8887
+ dispatch({ type: "SET_LOADING", value: false });
8888
+ dispatch({ type: "SET_EXECUTING", value: false });
8969
8889
  }
8970
- setIsLoading(false);
8971
- setIsExecuting(false);
8972
8890
  abortControllerRef.current = null;
8973
- }
8974
- return /* @__PURE__ */ jsxDEV12(Box12, {
8891
+ }, [scheduleRender, updateToolCalls]);
8892
+ const cancelOperation = useCallback(() => {
8893
+ if (abortControllerRef.current) {
8894
+ abortControllerRef.current.abort();
8895
+ }
8896
+ if (renderTimerRef.current) {
8897
+ clearTimeout(renderTimerRef.current);
8898
+ renderTimerRef.current = null;
8899
+ }
8900
+ pendingOutputRef.current = "";
8901
+ pendingReasoningRef.current = "";
8902
+ activeToolCallsRef.current = [];
8903
+ toolCallsDirtyRef.current = false;
8904
+ dispatch({ type: "CANCEL_OPERATION" });
8905
+ }, []);
8906
+ return {
8907
+ state,
8908
+ dispatch,
8909
+ processAgentEvents,
8910
+ cancelOperation,
8911
+ abortControllerRef
8912
+ };
8913
+ }
8914
+
8915
+ // src/ui/hooks/managed-input.tsx
8916
+ import { useState as useState2, memo as memo11 } from "react";
8917
+ import { useInput, useApp } from "ink";
8918
+
8919
+ // src/ui/input-prompt.tsx
8920
+ import { memo as memo10 } from "react";
8921
+ import { Box as Box11, Text as Text11 } from "ink";
8922
+ import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
8923
+ var InputPrompt = memo10(function InputPrompt2({
8924
+ value,
8925
+ placeholder = "Send a message...",
8926
+ disabled = false
8927
+ }) {
8928
+ return /* @__PURE__ */ jsxDEV11(Box11, {
8929
+ borderStyle: "round",
8930
+ borderColor: disabled ? colors.border : colors.primary,
8931
+ paddingX: 1,
8932
+ children: [
8933
+ /* @__PURE__ */ jsxDEV11(Text11, {
8934
+ color: colors.primary,
8935
+ children: "❯ "
8936
+ }, undefined, false, undefined, this),
8937
+ value ? /* @__PURE__ */ jsxDEV11(Text11, {
8938
+ children: value
8939
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV11(Text11, {
8940
+ color: colors.textDim,
8941
+ children: placeholder
8942
+ }, undefined, false, undefined, this),
8943
+ !disabled && /* @__PURE__ */ jsxDEV11(Text11, {
8944
+ color: colors.primary,
8945
+ children: "▋"
8946
+ }, undefined, false, undefined, this)
8947
+ ]
8948
+ }, undefined, true, undefined, this);
8949
+ });
8950
+
8951
+ // src/ui/hooks/managed-input.tsx
8952
+ import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
8953
+ var ManagedInput = memo11(function ManagedInput2({
8954
+ onSubmit,
8955
+ visible,
8956
+ isExecuting,
8957
+ onCancel
8958
+ }) {
8959
+ const [input, setInput] = useState2("");
8960
+ const { exit } = useApp();
8961
+ useInput((inputChar, key) => {
8962
+ if (key.ctrl && inputChar === "c") {
8963
+ if (isExecuting) {
8964
+ onCancel();
8965
+ } else if (!input.trim()) {
8966
+ exit();
8967
+ }
8968
+ return;
8969
+ }
8970
+ if (key.escape) {
8971
+ exit();
8972
+ return;
8973
+ }
8974
+ if (!visible)
8975
+ return;
8976
+ if (key.return && input.trim()) {
8977
+ onSubmit(input.trim());
8978
+ setInput("");
8979
+ return;
8980
+ }
8981
+ if (key.backspace || key.delete) {
8982
+ setInput((prev) => prev.slice(0, -1));
8983
+ return;
8984
+ }
8985
+ if (!key.ctrl && !key.meta && inputChar) {
8986
+ setInput((prev) => prev + inputChar);
8987
+ }
8988
+ });
8989
+ if (!visible)
8990
+ return null;
8991
+ return /* @__PURE__ */ jsxDEV12(InputPrompt, {
8992
+ value: input
8993
+ }, undefined, false, undefined, this);
8994
+ });
8995
+
8996
+ // src/ui/app.tsx
8997
+ import { jsxDEV as jsxDEV13, Fragment } from "react/jsx-dev-runtime";
8998
+ function App({
8999
+ contextFiles: initialContextFiles,
9000
+ enableBeads: initialBeadsEnabled = true,
9001
+ version = "0.0.0",
9002
+ workingDir: cliWorkingDir
9003
+ }) {
9004
+ const { exit } = useApp2();
9005
+ const { state, dispatch, processAgentEvents, cancelOperation } = useAgentSession({
9006
+ contextFiles: initialContextFiles,
9007
+ enableBeads: initialBeadsEnabled,
9008
+ workingDir: cliWorkingDir
9009
+ });
9010
+ const {
9011
+ messages,
9012
+ isLoading,
9013
+ currentOutput,
9014
+ showWelcome,
9015
+ tokenCount,
9016
+ sessionCost,
9017
+ currentDir,
9018
+ pendingConfirm,
9019
+ beadsEnabled,
9020
+ contextFiles,
9021
+ activeToolCalls,
9022
+ currentAgent,
9023
+ isExecuting,
9024
+ parallelProgress,
9025
+ thinkingMessage,
9026
+ currentReasoning,
9027
+ currentModel
9028
+ } = state;
9029
+ const agent = useMemo(() => new Agent({ contextFiles, enableBeads: beadsEnabled }), [contextFiles, beadsEnabled]);
9030
+ const commandContext = useMemo(() => ({
9031
+ currentDir,
9032
+ setCurrentDir: (dir) => dispatch({ type: "SET_CURRENT_DIR", value: dir }),
9033
+ addMessage: (role, content) => {
9034
+ dispatch({ type: "ADD_MESSAGE", message: { role, content, timestamp: new Date } });
9035
+ },
9036
+ clearMessages: () => dispatch({ type: "CLEAR_MESSAGES" }),
9037
+ showWelcome: () => dispatch({ type: "SHOW_WELCOME" }),
9038
+ agent,
9039
+ version,
9040
+ exit,
9041
+ setPendingConfirm: (confirm) => dispatch({ type: "SET_PENDING_CONFIRM", value: confirm }),
9042
+ beadsEnabled,
9043
+ setBeadsEnabled: (enabled) => dispatch({ type: "SET_BEADS_ENABLED", value: enabled }),
9044
+ contextFiles,
9045
+ setContextFiles: (files) => dispatch({ type: "SET_CONTEXT_FILES", value: files }),
9046
+ emitParallelStart: (agents, strategy) => {
9047
+ dispatch({ type: "SET_PARALLEL_PROGRESS", value: { agents, strategy } });
9048
+ },
9049
+ emitParallelProgress: (agents) => {
9050
+ dispatch({
9051
+ type: "SET_PARALLEL_PROGRESS",
9052
+ value: { agents, strategy: "all" }
9053
+ });
9054
+ },
9055
+ emitParallelComplete: (_results, consolidated) => {
9056
+ dispatch({ type: "SET_PARALLEL_PROGRESS", value: null });
9057
+ dispatch({
9058
+ type: "ADD_MESSAGE",
9059
+ message: { role: "assistant", content: consolidated, timestamp: new Date }
9060
+ });
9061
+ },
9062
+ currentModel,
9063
+ setCurrentModel: (model) => dispatch({ type: "SET_MODEL", value: model })
9064
+ }), [currentDir, agent, version, exit, beadsEnabled, contextFiles, currentModel, dispatch]);
9065
+ const handleConfirmation = useCallback2((response) => {
9066
+ if (!pendingConfirm)
9067
+ return false;
9068
+ const isYes = response.toLowerCase() === "y" || response.toLowerCase() === "yes";
9069
+ if (pendingConfirm.type === "mkdir") {
9070
+ const { path: targetPath } = pendingConfirm.data;
9071
+ const { mkdirSync: mkdirSync2 } = __require("fs");
9072
+ if (isYes) {
9073
+ try {
9074
+ mkdirSync2(targetPath, { recursive: true });
9075
+ process.chdir(targetPath);
9076
+ dispatch({ type: "SET_CURRENT_DIR", value: targetPath });
9077
+ dispatch({
9078
+ type: "ADD_MESSAGE",
9079
+ message: {
9080
+ role: "system",
9081
+ content: `Created directory and changed to: ${targetPath}`,
9082
+ timestamp: new Date
9083
+ }
9084
+ });
9085
+ } catch (err) {
9086
+ dispatch({
9087
+ type: "ADD_MESSAGE",
9088
+ message: {
9089
+ role: "system",
9090
+ content: `Error creating directory: ${err.message}`,
9091
+ timestamp: new Date
9092
+ }
9093
+ });
9094
+ }
9095
+ } else {
9096
+ dispatch({
9097
+ type: "ADD_MESSAGE",
9098
+ message: { role: "system", content: "Cancelled. Directory not created.", timestamp: new Date }
9099
+ });
9100
+ }
9101
+ dispatch({ type: "SET_PENDING_CONFIRM", value: null });
9102
+ return true;
9103
+ }
9104
+ dispatch({ type: "SET_PENDING_CONFIRM", value: null });
9105
+ return false;
9106
+ }, [pendingConfirm, dispatch]);
9107
+ const handleSubmit = useCallback2(async (userMessage) => {
9108
+ if (pendingConfirm) {
9109
+ if (showWelcome)
9110
+ dispatch({ type: "HIDE_WELCOME" });
9111
+ dispatch({
9112
+ type: "ADD_MESSAGE",
9113
+ message: { role: "user", content: userMessage, timestamp: new Date }
9114
+ });
9115
+ handleConfirmation(userMessage);
9116
+ return;
9117
+ }
9118
+ const lowerMessage = userMessage.toLowerCase();
9119
+ if (userMessage.startsWith("/") || lowerMessage.startsWith("cd ") || lowerMessage === "cd" || lowerMessage === "pwd") {
9120
+ let normalizedCommand = userMessage;
9121
+ if (!userMessage.startsWith("/")) {
9122
+ normalizedCommand = "/" + userMessage;
9123
+ }
9124
+ const result = await executeCommand(normalizedCommand, commandContext);
9125
+ if (result.handled) {
9126
+ if (result.message) {
9127
+ dispatch({
9128
+ type: "ADD_MESSAGE",
9129
+ message: { role: "system", content: result.message, timestamp: new Date }
9130
+ });
9131
+ }
9132
+ if (showWelcome)
9133
+ dispatch({ type: "HIDE_WELCOME" });
9134
+ return;
9135
+ }
9136
+ }
9137
+ if (showWelcome)
9138
+ dispatch({ type: "HIDE_WELCOME" });
9139
+ dispatch({
9140
+ type: "ADD_MESSAGE",
9141
+ message: { role: "user", content: userMessage, timestamp: new Date }
9142
+ });
9143
+ await processAgentEvents(agent, userMessage);
9144
+ }, [pendingConfirm, showWelcome, commandContext, agent, processAgentEvents, handleConfirmation, dispatch]);
9145
+ const messageList = useMemo(() => messages.map((msg, i) => /* @__PURE__ */ jsxDEV13(Box13, {
9146
+ flexDirection: "column",
9147
+ children: [
9148
+ /* @__PURE__ */ jsxDEV13(MessageView, {
9149
+ role: msg.role,
9150
+ content: msg.content,
9151
+ timestamp: msg.timestamp
9152
+ }, undefined, false, undefined, this),
9153
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsxDEV13(Box13, {
9154
+ flexDirection: "column",
9155
+ marginLeft: 2,
9156
+ children: msg.toolCalls.map((tc, j) => /* @__PURE__ */ jsxDEV13(ToolCallView, {
9157
+ name: tc.displayName,
9158
+ status: tc.status,
9159
+ result: tc.result,
9160
+ error: tc.error,
9161
+ duration: tc.duration
9162
+ }, j, false, undefined, this))
9163
+ }, undefined, false, undefined, this)
9164
+ ]
9165
+ }, i, true, undefined, this)), [messages]);
9166
+ const activeToolCallList = useMemo(() => activeToolCalls.length > 0 ? /* @__PURE__ */ jsxDEV13(Box13, {
9167
+ flexDirection: "column",
9168
+ marginLeft: 2,
9169
+ children: activeToolCalls.map((tc, i) => /* @__PURE__ */ jsxDEV13(ToolCallView, {
9170
+ name: tc.displayName,
9171
+ status: tc.status,
9172
+ result: tc.result,
9173
+ error: tc.error,
9174
+ duration: tc.duration
9175
+ }, i, false, undefined, this))
9176
+ }, undefined, false, undefined, this) : null, [activeToolCalls]);
9177
+ return /* @__PURE__ */ jsxDEV13(Box13, {
8975
9178
  flexDirection: "column",
8976
9179
  padding: 0,
8977
9180
  children: [
8978
- showWelcome ? /* @__PURE__ */ jsxDEV12(WelcomeScreen, {
9181
+ showWelcome ? /* @__PURE__ */ jsxDEV13(WelcomeScreen, {
8979
9182
  version,
8980
- workingDir
8981
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12(Box12, {
9183
+ workingDir: currentDir
9184
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(Box13, {
8982
9185
  marginBottom: 0,
8983
9186
  justifyContent: "space-between",
8984
9187
  children: [
8985
- /* @__PURE__ */ jsxDEV12(InlineLogo, {}, undefined, false, undefined, this),
8986
- /* @__PURE__ */ jsxDEV12(Text12, {
9188
+ /* @__PURE__ */ jsxDEV13(InlineLogo, {}, undefined, false, undefined, this),
9189
+ /* @__PURE__ */ jsxDEV13(Text13, {
8987
9190
  color: colors.textDim,
8988
9191
  children: [
8989
9192
  "v",
@@ -8992,66 +9195,36 @@ ${event.consolidated}`,
8992
9195
  }, undefined, true, undefined, this)
8993
9196
  ]
8994
9197
  }, undefined, true, undefined, this),
8995
- !showWelcome && /* @__PURE__ */ jsxDEV12(Box12, {
9198
+ !showWelcome && /* @__PURE__ */ jsxDEV13(Box13, {
8996
9199
  flexDirection: "column",
8997
9200
  marginBottom: 0,
8998
9201
  children: [
8999
- messages.map((msg, i) => /* @__PURE__ */ jsxDEV12(Box12, {
9000
- flexDirection: "column",
9001
- children: [
9002
- /* @__PURE__ */ jsxDEV12(MessageView, {
9003
- role: msg.role,
9004
- content: msg.content,
9005
- timestamp: msg.timestamp
9006
- }, undefined, false, undefined, this),
9007
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsxDEV12(Box12, {
9008
- flexDirection: "column",
9009
- marginLeft: 2,
9010
- children: msg.toolCalls.map((tc, j) => /* @__PURE__ */ jsxDEV12(ToolCallView, {
9011
- name: tc.displayName,
9012
- status: tc.status,
9013
- result: tc.result,
9014
- error: tc.error,
9015
- duration: tc.duration
9016
- }, j, false, undefined, this))
9017
- }, undefined, false, undefined, this)
9018
- ]
9019
- }, i, true, undefined, this)),
9020
- activeToolCalls.length > 0 && /* @__PURE__ */ jsxDEV12(Box12, {
9021
- flexDirection: "column",
9022
- marginLeft: 2,
9023
- children: activeToolCalls.map((tc, i) => /* @__PURE__ */ jsxDEV12(ToolCallView, {
9024
- name: tc.displayName,
9025
- status: tc.status,
9026
- result: tc.result,
9027
- error: tc.error,
9028
- duration: tc.duration
9029
- }, i, false, undefined, this))
9030
- }, undefined, false, undefined, this),
9031
- parallelProgress && /* @__PURE__ */ jsxDEV12(ParallelProgressView, {
9202
+ messageList,
9203
+ activeToolCallList,
9204
+ parallelProgress && /* @__PURE__ */ jsxDEV13(ParallelProgressView, {
9032
9205
  title: "Parallel Execution",
9033
9206
  agents: parallelProgress.agents,
9034
9207
  strategy: parallelProgress.strategy
9035
9208
  }, undefined, false, undefined, this),
9036
- pendingConfirm && /* @__PURE__ */ jsxDEV12(ConfirmDialog, {
9209
+ pendingConfirm && /* @__PURE__ */ jsxDEV13(ConfirmDialog, {
9037
9210
  message: pendingConfirm.type === "mkdir" ? `Create directory: ${pendingConfirm.data.path}?` : pendingConfirm.type === "edit_file" ? `Apply changes to: ${pendingConfirm.data.filePath}?` : `Confirm ${pendingConfirm.type}?`,
9038
9211
  details: pendingConfirm.data.details,
9039
- showDiff: pendingConfirm.type === "edit_file" && pendingConfirm.data.oldContent && pendingConfirm.data.newContent ? /* @__PURE__ */ jsxDEV12(DiffView, {
9212
+ showDiff: pendingConfirm.type === "edit_file" && pendingConfirm.data.oldContent && pendingConfirm.data.newContent ? /* @__PURE__ */ jsxDEV13(DiffView, {
9040
9213
  filePath: pendingConfirm.data.filePath,
9041
9214
  oldContent: pendingConfirm.data.oldContent,
9042
9215
  newContent: pendingConfirm.data.newContent
9043
9216
  }, undefined, false, undefined, this) : undefined
9044
9217
  }, undefined, false, undefined, this),
9045
- currentReasoning && /* @__PURE__ */ jsxDEV12(Box12, {
9218
+ currentReasoning && /* @__PURE__ */ jsxDEV13(Box13, {
9046
9219
  marginLeft: 3,
9047
9220
  marginBottom: 0,
9048
9221
  children: [
9049
- /* @__PURE__ */ jsxDEV12(Text12, {
9222
+ /* @__PURE__ */ jsxDEV13(Text13, {
9050
9223
  color: colors.textDim,
9051
9224
  dimColor: true,
9052
9225
  children: "\uD83D\uDCAD "
9053
9226
  }, undefined, false, undefined, this),
9054
- /* @__PURE__ */ jsxDEV12(Text12, {
9227
+ /* @__PURE__ */ jsxDEV13(Text13, {
9055
9228
  color: colors.textDim,
9056
9229
  dimColor: true,
9057
9230
  wrap: "wrap",
@@ -9059,59 +9232,65 @@ ${event.consolidated}`,
9059
9232
  }, undefined, false, undefined, this)
9060
9233
  ]
9061
9234
  }, undefined, true, undefined, this),
9062
- currentOutput && /* @__PURE__ */ jsxDEV12(MessageView, {
9235
+ currentOutput && /* @__PURE__ */ jsxDEV13(MessageView, {
9063
9236
  role: "assistant",
9064
9237
  content: currentOutput,
9065
9238
  enableHighlighting: false
9066
9239
  }, undefined, false, undefined, this)
9067
9240
  ]
9068
9241
  }, undefined, true, undefined, this),
9069
- /* @__PURE__ */ jsxDEV12(Box12, {
9242
+ /* @__PURE__ */ jsxDEV13(Box13, {
9070
9243
  marginTop: 0,
9071
- children: isLoading ? /* @__PURE__ */ jsxDEV12(Box12, {
9072
- flexDirection: "column",
9073
- marginLeft: 1,
9074
- children: /* @__PURE__ */ jsxDEV12(Spinner, {
9075
- text: thinkingMessage || (currentAgent ? `${currentAgent} thinking...` : "Thinking..."),
9076
- showTokens: true,
9077
- tokens: tokenCount
9244
+ children: [
9245
+ isLoading && /* @__PURE__ */ jsxDEV13(Box13, {
9246
+ flexDirection: "column",
9247
+ marginLeft: 1,
9248
+ children: /* @__PURE__ */ jsxDEV13(Spinner, {
9249
+ text: thinkingMessage || (currentAgent ? `${currentAgent} thinking...` : "Thinking..."),
9250
+ showTokens: true,
9251
+ tokens: tokenCount
9252
+ }, undefined, false, undefined, this)
9253
+ }, undefined, false, undefined, this),
9254
+ /* @__PURE__ */ jsxDEV13(ManagedInput, {
9255
+ onSubmit: handleSubmit,
9256
+ visible: !isLoading,
9257
+ isExecuting,
9258
+ onCancel: cancelOperation
9078
9259
  }, undefined, false, undefined, this)
9079
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12(InputPrompt, {
9080
- value: input
9081
- }, undefined, false, undefined, this)
9082
- }, undefined, false, undefined, this),
9083
- /* @__PURE__ */ jsxDEV12(Box12, {
9260
+ ]
9261
+ }, undefined, true, undefined, this),
9262
+ /* @__PURE__ */ jsxDEV13(Box13, {
9084
9263
  marginTop: 0,
9085
- children: /* @__PURE__ */ jsxDEV12(StatusBar, {
9264
+ children: /* @__PURE__ */ jsxDEV13(StatusBar, {
9086
9265
  mode: isExecuting ? "agent" : "chat",
9087
9266
  tokens: tokenCount,
9088
9267
  cost: sessionCost,
9089
9268
  model: currentModel
9090
9269
  }, undefined, false, undefined, this)
9091
9270
  }, undefined, false, undefined, this),
9092
- /* @__PURE__ */ jsxDEV12(Box12, {
9271
+ /* @__PURE__ */ jsxDEV13(Box13, {
9093
9272
  marginTop: 0,
9094
9273
  justifyContent: "center",
9095
- children: /* @__PURE__ */ jsxDEV12(Text12, {
9274
+ children: /* @__PURE__ */ jsxDEV13(Text13, {
9096
9275
  color: colors.textDim,
9097
- children: isExecuting ? /* @__PURE__ */ jsxDEV12(Fragment, {
9276
+ children: isExecuting ? /* @__PURE__ */ jsxDEV13(Fragment, {
9098
9277
  children: [
9099
9278
  "Press ",
9100
- /* @__PURE__ */ jsxDEV12(Text12, {
9279
+ /* @__PURE__ */ jsxDEV13(Text13, {
9101
9280
  color: colors.warning,
9102
9281
  children: "Ctrl+C"
9103
9282
  }, undefined, false, undefined, this),
9104
9283
  " to cancel"
9105
9284
  ]
9106
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV12(Fragment, {
9285
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV13(Fragment, {
9107
9286
  children: [
9108
9287
  "Press ",
9109
- /* @__PURE__ */ jsxDEV12(Text12, {
9288
+ /* @__PURE__ */ jsxDEV13(Text13, {
9110
9289
  color: colors.primary,
9111
9290
  children: "Ctrl+C"
9112
9291
  }, undefined, false, undefined, this),
9113
9292
  " to exit •",
9114
- /* @__PURE__ */ jsxDEV12(Text12, {
9293
+ /* @__PURE__ */ jsxDEV13(Text13, {
9115
9294
  color: colors.primary,
9116
9295
  children: " Enter"
9117
9296
  }, undefined, false, undefined, this),
@@ -9125,7 +9304,7 @@ ${event.consolidated}`,
9125
9304
  }
9126
9305
 
9127
9306
  // src/version.ts
9128
- var VERSION = "1.0.27";
9307
+ var VERSION = "1.0.29";
9129
9308
 
9130
9309
  // src/agent/start-chat.ts
9131
9310
  async function startChat(options = {}) {
@@ -9135,7 +9314,7 @@ async function startChat(options = {}) {
9135
9314
  process.chdir(workingDir);
9136
9315
  }
9137
9316
  } catch {}
9138
- const { waitUntilExit } = render(React6.createElement(App, {
9317
+ const { waitUntilExit } = render(React13.createElement(App, {
9139
9318
  contextFiles: options.context,
9140
9319
  enableBeads: options.beads ?? true,
9141
9320
  version: VERSION,
@@ -9309,17 +9488,17 @@ Task completed.`);
9309
9488
  }
9310
9489
 
9311
9490
  // src/commands/setup.tsx
9312
- import React7, { useState as useState3, useEffect as useEffect3 } from "react";
9313
- import { render as render2, Box as Box13, Text as Text13, useInput as useInput2, useApp as useApp2 } from "ink";
9491
+ import React14, { useState as useState3, useEffect as useEffect3 } from "react";
9492
+ import { render as render2, Box as Box14, Text as Text14, useInput as useInput2, useApp as useApp3 } from "ink";
9314
9493
  import TextInput from "ink-text-input";
9315
9494
  import { writeFile as writeFile4, readFile as readFile3, mkdir as mkdir4, stat as stat3 } from "fs/promises";
9316
9495
  import { join as join8, resolve as resolve4 } from "path";
9317
9496
  import { homedir as homedir4 } from "os";
9318
9497
  import { existsSync as existsSync6 } from "fs";
9319
9498
  import { execSync as execSync2 } from "child_process";
9320
- import { jsxDEV as jsxDEV13, Fragment as Fragment2 } from "react/jsx-dev-runtime";
9499
+ import { jsxDEV as jsxDEV14, Fragment as Fragment2 } from "react/jsx-dev-runtime";
9321
9500
  function SetupWizardWithCallback({ onComplete }) {
9322
- const { exit } = useApp2();
9501
+ const { exit } = useApp3();
9323
9502
  const [step, setStep] = useState3("welcome");
9324
9503
  const [state, setState] = useState3({
9325
9504
  azureEndpoint: "",
@@ -9605,17 +9784,17 @@ function SetupWizardWithCallback({ onComplete }) {
9605
9784
  }
9606
9785
  }
9607
9786
  const configDir = join8(homedir4(), ".sharkbait");
9608
- return /* @__PURE__ */ jsxDEV13(Box13, {
9787
+ return /* @__PURE__ */ jsxDEV14(Box14, {
9609
9788
  flexDirection: "column",
9610
9789
  padding: 1,
9611
9790
  children: [
9612
- /* @__PURE__ */ jsxDEV13(Logo, {
9791
+ /* @__PURE__ */ jsxDEV14(Logo, {
9613
9792
  variant: "full",
9614
9793
  version: VERSION
9615
9794
  }, undefined, false, undefined, this),
9616
- /* @__PURE__ */ jsxDEV13(Box13, {
9795
+ /* @__PURE__ */ jsxDEV14(Box14, {
9617
9796
  marginBottom: 1,
9618
- children: /* @__PURE__ */ jsxDEV13(Text13, {
9797
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
9619
9798
  color: colors.primary,
9620
9799
  bold: true,
9621
9800
  children: [
@@ -9624,14 +9803,14 @@ function SetupWizardWithCallback({ onComplete }) {
9624
9803
  ]
9625
9804
  }, undefined, true, undefined, this)
9626
9805
  }, undefined, false, undefined, this),
9627
- step === "welcome" && /* @__PURE__ */ jsxDEV13(Box13, {
9806
+ step === "welcome" && /* @__PURE__ */ jsxDEV14(Box14, {
9628
9807
  flexDirection: "column",
9629
9808
  children: [
9630
- /* @__PURE__ */ jsxDEV13(Text13, {
9809
+ /* @__PURE__ */ jsxDEV14(Text14, {
9631
9810
  color: colors.text,
9632
9811
  children: "Welcome! This wizard will help you configure Sharkbait."
9633
9812
  }, undefined, false, undefined, this),
9634
- /* @__PURE__ */ jsxDEV13(Text13, {
9813
+ /* @__PURE__ */ jsxDEV14(Text14, {
9635
9814
  color: colors.textMuted,
9636
9815
  children: [
9637
9816
  `
@@ -9639,22 +9818,22 @@ function SetupWizardWithCallback({ onComplete }) {
9639
9818
  "Configuration will be saved to:"
9640
9819
  ]
9641
9820
  }, undefined, true, undefined, this),
9642
- /* @__PURE__ */ jsxDEV13(Text13, {
9821
+ /* @__PURE__ */ jsxDEV14(Text14, {
9643
9822
  color: colors.primary,
9644
9823
  children: configDir
9645
9824
  }, undefined, false, undefined, this),
9646
- /* @__PURE__ */ jsxDEV13(Box13, {
9825
+ /* @__PURE__ */ jsxDEV14(Box14, {
9647
9826
  marginTop: 1,
9648
- children: /* @__PURE__ */ jsxDEV13(Text13, {
9827
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
9649
9828
  color: colors.textDim,
9650
9829
  children: [
9651
9830
  "Press ",
9652
- /* @__PURE__ */ jsxDEV13(Text13, {
9831
+ /* @__PURE__ */ jsxDEV14(Text14, {
9653
9832
  color: colors.success,
9654
9833
  children: "Enter"
9655
9834
  }, undefined, false, undefined, this),
9656
9835
  " to continue, ",
9657
- /* @__PURE__ */ jsxDEV13(Text13, {
9836
+ /* @__PURE__ */ jsxDEV14(Text14, {
9658
9837
  color: colors.warning,
9659
9838
  children: "ESC"
9660
9839
  }, undefined, false, undefined, this),
@@ -9664,34 +9843,34 @@ function SetupWizardWithCallback({ onComplete }) {
9664
9843
  }, undefined, false, undefined, this)
9665
9844
  ]
9666
9845
  }, undefined, true, undefined, this),
9667
- step === "azure-endpoint" && /* @__PURE__ */ jsxDEV13(Box13, {
9846
+ step === "azure-endpoint" && /* @__PURE__ */ jsxDEV14(Box14, {
9668
9847
  flexDirection: "column",
9669
9848
  children: [
9670
- /* @__PURE__ */ jsxDEV13(Text13, {
9849
+ /* @__PURE__ */ jsxDEV14(Text14, {
9671
9850
  color: colors.text,
9672
9851
  bold: true,
9673
9852
  children: "Step 1/5: Azure OpenAI Endpoint"
9674
9853
  }, undefined, false, undefined, this),
9675
- /* @__PURE__ */ jsxDEV13(Text13, {
9854
+ /* @__PURE__ */ jsxDEV14(Text14, {
9676
9855
  color: colors.textMuted,
9677
9856
  children: "Enter your Azure OpenAI resource endpoint URL"
9678
9857
  }, undefined, false, undefined, this),
9679
- /* @__PURE__ */ jsxDEV13(Text13, {
9858
+ /* @__PURE__ */ jsxDEV14(Text14, {
9680
9859
  color: colors.textDim,
9681
9860
  italic: true,
9682
9861
  children: "Example: https://your-resource.openai.azure.com"
9683
9862
  }, undefined, false, undefined, this),
9684
- /* @__PURE__ */ jsxDEV13(Box13, {
9863
+ /* @__PURE__ */ jsxDEV14(Box14, {
9685
9864
  marginTop: 1,
9686
9865
  children: [
9687
- /* @__PURE__ */ jsxDEV13(Text13, {
9866
+ /* @__PURE__ */ jsxDEV14(Text14, {
9688
9867
  color: colors.primary,
9689
9868
  children: [
9690
9869
  ">",
9691
9870
  " "
9692
9871
  ]
9693
9872
  }, undefined, true, undefined, this),
9694
- /* @__PURE__ */ jsxDEV13(TextInput, {
9873
+ /* @__PURE__ */ jsxDEV14(TextInput, {
9695
9874
  value: inputValue,
9696
9875
  onChange: setInputValue,
9697
9876
  onSubmit: handleInputSubmit,
@@ -9699,7 +9878,7 @@ function SetupWizardWithCallback({ onComplete }) {
9699
9878
  }, undefined, false, undefined, this)
9700
9879
  ]
9701
9880
  }, undefined, true, undefined, this),
9702
- error && /* @__PURE__ */ jsxDEV13(Text13, {
9881
+ error && /* @__PURE__ */ jsxDEV14(Text14, {
9703
9882
  color: colors.error,
9704
9883
  children: [
9705
9884
  icons.error,
@@ -9709,51 +9888,51 @@ function SetupWizardWithCallback({ onComplete }) {
9709
9888
  }, undefined, true, undefined, this)
9710
9889
  ]
9711
9890
  }, undefined, true, undefined, this),
9712
- step === "auth-method" && /* @__PURE__ */ jsxDEV13(Box13, {
9891
+ step === "auth-method" && /* @__PURE__ */ jsxDEV14(Box14, {
9713
9892
  flexDirection: "column",
9714
9893
  children: [
9715
- /* @__PURE__ */ jsxDEV13(Text13, {
9894
+ /* @__PURE__ */ jsxDEV14(Text14, {
9716
9895
  color: colors.text,
9717
9896
  bold: true,
9718
9897
  children: "Step 2/5: Authentication Method"
9719
9898
  }, undefined, false, undefined, this),
9720
- /* @__PURE__ */ jsxDEV13(Text13, {
9899
+ /* @__PURE__ */ jsxDEV14(Text14, {
9721
9900
  color: colors.textMuted,
9722
9901
  children: "Choose how to authenticate with Azure OpenAI"
9723
9902
  }, undefined, false, undefined, this),
9724
- /* @__PURE__ */ jsxDEV13(Box13, {
9903
+ /* @__PURE__ */ jsxDEV14(Box14, {
9725
9904
  marginTop: 1,
9726
9905
  flexDirection: "column",
9727
9906
  children: [
9728
- /* @__PURE__ */ jsxDEV13(Text13, {
9907
+ /* @__PURE__ */ jsxDEV14(Text14, {
9729
9908
  children: [
9730
- /* @__PURE__ */ jsxDEV13(Text13, {
9909
+ /* @__PURE__ */ jsxDEV14(Text14, {
9731
9910
  color: colors.primary,
9732
9911
  children: "[1]"
9733
9912
  }, undefined, false, undefined, this),
9734
9913
  " ",
9735
- /* @__PURE__ */ jsxDEV13(Text13, {
9914
+ /* @__PURE__ */ jsxDEV14(Text14, {
9736
9915
  color: colors.success,
9737
9916
  children: "Azure Identity (recommended)"
9738
9917
  }, undefined, false, undefined, this),
9739
- /* @__PURE__ */ jsxDEV13(Text13, {
9918
+ /* @__PURE__ */ jsxDEV14(Text14, {
9740
9919
  color: colors.textDim,
9741
9920
  children: " - Uses az login, managed identity, VS Code creds"
9742
9921
  }, undefined, false, undefined, this)
9743
9922
  ]
9744
9923
  }, undefined, true, undefined, this),
9745
- /* @__PURE__ */ jsxDEV13(Text13, {
9924
+ /* @__PURE__ */ jsxDEV14(Text14, {
9746
9925
  children: [
9747
- /* @__PURE__ */ jsxDEV13(Text13, {
9926
+ /* @__PURE__ */ jsxDEV14(Text14, {
9748
9927
  color: colors.primary,
9749
9928
  children: "[2]"
9750
9929
  }, undefined, false, undefined, this),
9751
9930
  " ",
9752
- /* @__PURE__ */ jsxDEV13(Text13, {
9931
+ /* @__PURE__ */ jsxDEV14(Text14, {
9753
9932
  color: colors.text,
9754
9933
  children: "API Key"
9755
9934
  }, undefined, false, undefined, this),
9756
- /* @__PURE__ */ jsxDEV13(Text13, {
9935
+ /* @__PURE__ */ jsxDEV14(Text14, {
9757
9936
  color: colors.textDim,
9758
9937
  children: " - Manual key entry (fallback)"
9759
9938
  }, undefined, false, undefined, this)
@@ -9761,9 +9940,9 @@ function SetupWizardWithCallback({ onComplete }) {
9761
9940
  }, undefined, true, undefined, this)
9762
9941
  ]
9763
9942
  }, undefined, true, undefined, this),
9764
- error && /* @__PURE__ */ jsxDEV13(Box13, {
9943
+ error && /* @__PURE__ */ jsxDEV14(Box14, {
9765
9944
  marginTop: 1,
9766
- children: /* @__PURE__ */ jsxDEV13(Text13, {
9945
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
9767
9946
  color: colors.error,
9768
9947
  children: [
9769
9948
  icons.error,
@@ -9772,18 +9951,18 @@ function SetupWizardWithCallback({ onComplete }) {
9772
9951
  ]
9773
9952
  }, undefined, true, undefined, this)
9774
9953
  }, undefined, false, undefined, this),
9775
- /* @__PURE__ */ jsxDEV13(Box13, {
9954
+ /* @__PURE__ */ jsxDEV14(Box14, {
9776
9955
  marginTop: 1,
9777
- children: /* @__PURE__ */ jsxDEV13(Text13, {
9956
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
9778
9957
  color: colors.textDim,
9779
9958
  children: [
9780
9959
  "Press ",
9781
- /* @__PURE__ */ jsxDEV13(Text13, {
9960
+ /* @__PURE__ */ jsxDEV14(Text14, {
9782
9961
  color: colors.success,
9783
9962
  children: "1"
9784
9963
  }, undefined, false, undefined, this),
9785
9964
  " or ",
9786
- /* @__PURE__ */ jsxDEV13(Text13, {
9965
+ /* @__PURE__ */ jsxDEV14(Text14, {
9787
9966
  color: colors.success,
9788
9967
  children: "2"
9789
9968
  }, undefined, false, undefined, this),
@@ -9793,34 +9972,34 @@ function SetupWizardWithCallback({ onComplete }) {
9793
9972
  }, undefined, false, undefined, this)
9794
9973
  ]
9795
9974
  }, undefined, true, undefined, this),
9796
- step === "azure-key" && /* @__PURE__ */ jsxDEV13(Box13, {
9975
+ step === "azure-key" && /* @__PURE__ */ jsxDEV14(Box14, {
9797
9976
  flexDirection: "column",
9798
9977
  children: [
9799
- /* @__PURE__ */ jsxDEV13(Text13, {
9978
+ /* @__PURE__ */ jsxDEV14(Text14, {
9800
9979
  color: colors.text,
9801
9980
  bold: true,
9802
9981
  children: "Step 2b/5: Azure OpenAI API Key"
9803
9982
  }, undefined, false, undefined, this),
9804
- /* @__PURE__ */ jsxDEV13(Text13, {
9983
+ /* @__PURE__ */ jsxDEV14(Text14, {
9805
9984
  color: colors.textMuted,
9806
9985
  children: "Enter your Azure OpenAI API key"
9807
9986
  }, undefined, false, undefined, this),
9808
- /* @__PURE__ */ jsxDEV13(Text13, {
9987
+ /* @__PURE__ */ jsxDEV14(Text14, {
9809
9988
  color: colors.textDim,
9810
9989
  italic: true,
9811
9990
  children: "This will be stored in ~/.sharkbait/.env"
9812
9991
  }, undefined, false, undefined, this),
9813
- /* @__PURE__ */ jsxDEV13(Box13, {
9992
+ /* @__PURE__ */ jsxDEV14(Box14, {
9814
9993
  marginTop: 1,
9815
9994
  children: [
9816
- /* @__PURE__ */ jsxDEV13(Text13, {
9995
+ /* @__PURE__ */ jsxDEV14(Text14, {
9817
9996
  color: colors.primary,
9818
9997
  children: [
9819
9998
  ">",
9820
9999
  " "
9821
10000
  ]
9822
10001
  }, undefined, true, undefined, this),
9823
- /* @__PURE__ */ jsxDEV13(TextInput, {
10002
+ /* @__PURE__ */ jsxDEV14(TextInput, {
9824
10003
  value: inputValue,
9825
10004
  onChange: setInputValue,
9826
10005
  onSubmit: handleInputSubmit,
@@ -9829,7 +10008,7 @@ function SetupWizardWithCallback({ onComplete }) {
9829
10008
  }, undefined, false, undefined, this)
9830
10009
  ]
9831
10010
  }, undefined, true, undefined, this),
9832
- error && /* @__PURE__ */ jsxDEV13(Text13, {
10011
+ error && /* @__PURE__ */ jsxDEV14(Text14, {
9833
10012
  color: colors.error,
9834
10013
  children: [
9835
10014
  icons.error,
@@ -9839,34 +10018,34 @@ function SetupWizardWithCallback({ onComplete }) {
9839
10018
  }, undefined, true, undefined, this)
9840
10019
  ]
9841
10020
  }, undefined, true, undefined, this),
9842
- step === "azure-deployment" && /* @__PURE__ */ jsxDEV13(Box13, {
10021
+ step === "azure-deployment" && /* @__PURE__ */ jsxDEV14(Box14, {
9843
10022
  flexDirection: "column",
9844
10023
  children: [
9845
- /* @__PURE__ */ jsxDEV13(Text13, {
10024
+ /* @__PURE__ */ jsxDEV14(Text14, {
9846
10025
  color: colors.text,
9847
10026
  bold: true,
9848
10027
  children: "Step 3/5: Model Deployment Name"
9849
10028
  }, undefined, false, undefined, this),
9850
- /* @__PURE__ */ jsxDEV13(Text13, {
10029
+ /* @__PURE__ */ jsxDEV14(Text14, {
9851
10030
  color: colors.textMuted,
9852
10031
  children: "Enter your Azure OpenAI model deployment name"
9853
10032
  }, undefined, false, undefined, this),
9854
- /* @__PURE__ */ jsxDEV13(Text13, {
10033
+ /* @__PURE__ */ jsxDEV14(Text14, {
9855
10034
  color: colors.textDim,
9856
10035
  italic: true,
9857
10036
  children: "Default: gpt-5.3-codex"
9858
10037
  }, undefined, false, undefined, this),
9859
- /* @__PURE__ */ jsxDEV13(Box13, {
10038
+ /* @__PURE__ */ jsxDEV14(Box14, {
9860
10039
  marginTop: 1,
9861
10040
  children: [
9862
- /* @__PURE__ */ jsxDEV13(Text13, {
10041
+ /* @__PURE__ */ jsxDEV14(Text14, {
9863
10042
  color: colors.primary,
9864
10043
  children: [
9865
10044
  ">",
9866
10045
  " "
9867
10046
  ]
9868
10047
  }, undefined, true, undefined, this),
9869
- /* @__PURE__ */ jsxDEV13(TextInput, {
10048
+ /* @__PURE__ */ jsxDEV14(TextInput, {
9870
10049
  value: inputValue,
9871
10050
  onChange: setInputValue,
9872
10051
  onSubmit: handleInputSubmit,
@@ -9876,34 +10055,34 @@ function SetupWizardWithCallback({ onComplete }) {
9876
10055
  }, undefined, true, undefined, this)
9877
10056
  ]
9878
10057
  }, undefined, true, undefined, this),
9879
- step === "working-dir" && /* @__PURE__ */ jsxDEV13(Box13, {
10058
+ step === "working-dir" && /* @__PURE__ */ jsxDEV14(Box14, {
9880
10059
  flexDirection: "column",
9881
10060
  children: [
9882
- /* @__PURE__ */ jsxDEV13(Text13, {
10061
+ /* @__PURE__ */ jsxDEV14(Text14, {
9883
10062
  color: colors.text,
9884
10063
  bold: true,
9885
10064
  children: "Step 4/5: Default Working Directory"
9886
10065
  }, undefined, false, undefined, this),
9887
- /* @__PURE__ */ jsxDEV13(Text13, {
10066
+ /* @__PURE__ */ jsxDEV14(Text14, {
9888
10067
  color: colors.textMuted,
9889
10068
  children: "Set a default project directory (optional)"
9890
10069
  }, undefined, false, undefined, this),
9891
- /* @__PURE__ */ jsxDEV13(Text13, {
10070
+ /* @__PURE__ */ jsxDEV14(Text14, {
9892
10071
  color: colors.textDim,
9893
10072
  italic: true,
9894
10073
  children: "Leave empty to always use current directory"
9895
10074
  }, undefined, false, undefined, this),
9896
- /* @__PURE__ */ jsxDEV13(Box13, {
10075
+ /* @__PURE__ */ jsxDEV14(Box14, {
9897
10076
  marginTop: 1,
9898
10077
  children: [
9899
- /* @__PURE__ */ jsxDEV13(Text13, {
10078
+ /* @__PURE__ */ jsxDEV14(Text14, {
9900
10079
  color: colors.primary,
9901
10080
  children: [
9902
10081
  ">",
9903
10082
  " "
9904
10083
  ]
9905
10084
  }, undefined, true, undefined, this),
9906
- /* @__PURE__ */ jsxDEV13(TextInput, {
10085
+ /* @__PURE__ */ jsxDEV14(TextInput, {
9907
10086
  value: inputValue,
9908
10087
  onChange: setInputValue,
9909
10088
  onSubmit: handleInputSubmit,
@@ -9913,57 +10092,57 @@ function SetupWizardWithCallback({ onComplete }) {
9913
10092
  }, undefined, true, undefined, this)
9914
10093
  ]
9915
10094
  }, undefined, true, undefined, this),
9916
- step === "features" && /* @__PURE__ */ jsxDEV13(Box13, {
10095
+ step === "features" && /* @__PURE__ */ jsxDEV14(Box14, {
9917
10096
  flexDirection: "column",
9918
10097
  children: [
9919
- /* @__PURE__ */ jsxDEV13(Text13, {
10098
+ /* @__PURE__ */ jsxDEV14(Text14, {
9920
10099
  color: colors.text,
9921
10100
  bold: true,
9922
10101
  children: "Step 5/5: Features"
9923
10102
  }, undefined, false, undefined, this),
9924
- /* @__PURE__ */ jsxDEV13(Text13, {
10103
+ /* @__PURE__ */ jsxDEV14(Text14, {
9925
10104
  color: colors.textMuted,
9926
10105
  children: "Toggle features with number keys, Enter to continue"
9927
10106
  }, undefined, false, undefined, this),
9928
- /* @__PURE__ */ jsxDEV13(Box13, {
10107
+ /* @__PURE__ */ jsxDEV14(Box14, {
9929
10108
  marginTop: 1,
9930
10109
  flexDirection: "column",
9931
10110
  children: [
9932
- /* @__PURE__ */ jsxDEV13(Text13, {
10111
+ /* @__PURE__ */ jsxDEV14(Text14, {
9933
10112
  children: [
9934
- /* @__PURE__ */ jsxDEV13(Text13, {
10113
+ /* @__PURE__ */ jsxDEV14(Text14, {
9935
10114
  color: colors.primary,
9936
10115
  children: "[1]"
9937
10116
  }, undefined, false, undefined, this),
9938
10117
  " ",
9939
- /* @__PURE__ */ jsxDEV13(Text13, {
10118
+ /* @__PURE__ */ jsxDEV14(Text14, {
9940
10119
  color: state.enableBeads ? colors.success : colors.textDim,
9941
10120
  children: [
9942
10121
  state.enableBeads ? icons.success : "○",
9943
10122
  " Beads Memory"
9944
10123
  ]
9945
10124
  }, undefined, true, undefined, this),
9946
- /* @__PURE__ */ jsxDEV13(Text13, {
10125
+ /* @__PURE__ */ jsxDEV14(Text14, {
9947
10126
  color: colors.textDim,
9948
10127
  children: " - Git-backed task persistence"
9949
10128
  }, undefined, false, undefined, this)
9950
10129
  ]
9951
10130
  }, undefined, true, undefined, this),
9952
- /* @__PURE__ */ jsxDEV13(Text13, {
10131
+ /* @__PURE__ */ jsxDEV14(Text14, {
9953
10132
  children: [
9954
- /* @__PURE__ */ jsxDEV13(Text13, {
10133
+ /* @__PURE__ */ jsxDEV14(Text14, {
9955
10134
  color: colors.primary,
9956
10135
  children: "[2]"
9957
10136
  }, undefined, false, undefined, this),
9958
10137
  " ",
9959
- /* @__PURE__ */ jsxDEV13(Text13, {
10138
+ /* @__PURE__ */ jsxDEV14(Text14, {
9960
10139
  color: state.confirmDestructive ? colors.success : colors.textDim,
9961
10140
  children: [
9962
10141
  state.confirmDestructive ? icons.success : "○",
9963
10142
  " Confirm Destructive"
9964
10143
  ]
9965
10144
  }, undefined, true, undefined, this),
9966
- /* @__PURE__ */ jsxDEV13(Text13, {
10145
+ /* @__PURE__ */ jsxDEV14(Text14, {
9967
10146
  color: colors.textDim,
9968
10147
  children: " - Require confirmation for risky commands"
9969
10148
  }, undefined, false, undefined, this)
@@ -9971,13 +10150,13 @@ function SetupWizardWithCallback({ onComplete }) {
9971
10150
  }, undefined, true, undefined, this)
9972
10151
  ]
9973
10152
  }, undefined, true, undefined, this),
9974
- /* @__PURE__ */ jsxDEV13(Box13, {
10153
+ /* @__PURE__ */ jsxDEV14(Box14, {
9975
10154
  marginTop: 1,
9976
- children: /* @__PURE__ */ jsxDEV13(Text13, {
10155
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
9977
10156
  color: colors.textDim,
9978
10157
  children: [
9979
10158
  "Press ",
9980
- /* @__PURE__ */ jsxDEV13(Text13, {
10159
+ /* @__PURE__ */ jsxDEV14(Text14, {
9981
10160
  color: colors.success,
9982
10161
  children: "Enter"
9983
10162
  }, undefined, false, undefined, this),
@@ -9987,15 +10166,15 @@ function SetupWizardWithCallback({ onComplete }) {
9987
10166
  }, undefined, false, undefined, this)
9988
10167
  ]
9989
10168
  }, undefined, true, undefined, this),
9990
- step === "confirm" && /* @__PURE__ */ jsxDEV13(Box13, {
10169
+ step === "confirm" && /* @__PURE__ */ jsxDEV14(Box14, {
9991
10170
  flexDirection: "column",
9992
10171
  children: [
9993
- /* @__PURE__ */ jsxDEV13(Text13, {
10172
+ /* @__PURE__ */ jsxDEV14(Text14, {
9994
10173
  color: colors.text,
9995
10174
  bold: true,
9996
10175
  children: "Review Configuration"
9997
10176
  }, undefined, false, undefined, this),
9998
- /* @__PURE__ */ jsxDEV13(Box13, {
10177
+ /* @__PURE__ */ jsxDEV14(Box14, {
9999
10178
  marginTop: 1,
10000
10179
  flexDirection: "column",
10001
10180
  borderStyle: "single",
@@ -10003,79 +10182,79 @@ function SetupWizardWithCallback({ onComplete }) {
10003
10182
  paddingX: 2,
10004
10183
  paddingY: 1,
10005
10184
  children: [
10006
- /* @__PURE__ */ jsxDEV13(Text13, {
10185
+ /* @__PURE__ */ jsxDEV14(Text14, {
10007
10186
  children: [
10008
- /* @__PURE__ */ jsxDEV13(Text13, {
10187
+ /* @__PURE__ */ jsxDEV14(Text14, {
10009
10188
  color: colors.textMuted,
10010
10189
  children: "Endpoint:"
10011
10190
  }, undefined, false, undefined, this),
10012
10191
  " ",
10013
- /* @__PURE__ */ jsxDEV13(Text13, {
10192
+ /* @__PURE__ */ jsxDEV14(Text14, {
10014
10193
  color: colors.text,
10015
10194
  children: state.azureEndpoint
10016
10195
  }, undefined, false, undefined, this)
10017
10196
  ]
10018
10197
  }, undefined, true, undefined, this),
10019
- /* @__PURE__ */ jsxDEV13(Text13, {
10198
+ /* @__PURE__ */ jsxDEV14(Text14, {
10020
10199
  children: [
10021
- /* @__PURE__ */ jsxDEV13(Text13, {
10200
+ /* @__PURE__ */ jsxDEV14(Text14, {
10022
10201
  color: colors.textMuted,
10023
10202
  children: "Auth:"
10024
10203
  }, undefined, false, undefined, this),
10025
10204
  " ",
10026
- /* @__PURE__ */ jsxDEV13(Text13, {
10205
+ /* @__PURE__ */ jsxDEV14(Text14, {
10027
10206
  color: state.authMethod === "azure-identity" ? colors.success : colors.text,
10028
10207
  children: state.authMethod === "azure-identity" ? "Azure Identity (DefaultAzureCredential)" : "API Key (" + "*".repeat(8) + ")"
10029
10208
  }, undefined, false, undefined, this)
10030
10209
  ]
10031
10210
  }, undefined, true, undefined, this),
10032
- /* @__PURE__ */ jsxDEV13(Text13, {
10211
+ /* @__PURE__ */ jsxDEV14(Text14, {
10033
10212
  children: [
10034
- /* @__PURE__ */ jsxDEV13(Text13, {
10213
+ /* @__PURE__ */ jsxDEV14(Text14, {
10035
10214
  color: colors.textMuted,
10036
10215
  children: "Deployment:"
10037
10216
  }, undefined, false, undefined, this),
10038
10217
  " ",
10039
- /* @__PURE__ */ jsxDEV13(Text13, {
10218
+ /* @__PURE__ */ jsxDEV14(Text14, {
10040
10219
  color: colors.text,
10041
10220
  children: state.azureDeployment
10042
10221
  }, undefined, false, undefined, this)
10043
10222
  ]
10044
10223
  }, undefined, true, undefined, this),
10045
- /* @__PURE__ */ jsxDEV13(Text13, {
10224
+ /* @__PURE__ */ jsxDEV14(Text14, {
10046
10225
  children: [
10047
- /* @__PURE__ */ jsxDEV13(Text13, {
10226
+ /* @__PURE__ */ jsxDEV14(Text14, {
10048
10227
  color: colors.textMuted,
10049
10228
  children: "Working Dir:"
10050
10229
  }, undefined, false, undefined, this),
10051
10230
  " ",
10052
- /* @__PURE__ */ jsxDEV13(Text13, {
10231
+ /* @__PURE__ */ jsxDEV14(Text14, {
10053
10232
  color: colors.text,
10054
10233
  children: state.defaultWorkingDir || "(current directory)"
10055
10234
  }, undefined, false, undefined, this)
10056
10235
  ]
10057
10236
  }, undefined, true, undefined, this),
10058
- /* @__PURE__ */ jsxDEV13(Text13, {
10237
+ /* @__PURE__ */ jsxDEV14(Text14, {
10059
10238
  children: [
10060
- /* @__PURE__ */ jsxDEV13(Text13, {
10239
+ /* @__PURE__ */ jsxDEV14(Text14, {
10061
10240
  color: colors.textMuted,
10062
10241
  children: "Beads:"
10063
10242
  }, undefined, false, undefined, this),
10064
10243
  " ",
10065
- /* @__PURE__ */ jsxDEV13(Text13, {
10244
+ /* @__PURE__ */ jsxDEV14(Text14, {
10066
10245
  color: state.enableBeads ? colors.success : colors.textDim,
10067
10246
  children: state.enableBeads ? "enabled" : "disabled"
10068
10247
  }, undefined, false, undefined, this)
10069
10248
  ]
10070
10249
  }, undefined, true, undefined, this),
10071
- /* @__PURE__ */ jsxDEV13(Text13, {
10250
+ /* @__PURE__ */ jsxDEV14(Text14, {
10072
10251
  children: [
10073
- /* @__PURE__ */ jsxDEV13(Text13, {
10252
+ /* @__PURE__ */ jsxDEV14(Text14, {
10074
10253
  color: colors.textMuted,
10075
10254
  children: "Confirm Destructive:"
10076
10255
  }, undefined, false, undefined, this),
10077
10256
  " ",
10078
- /* @__PURE__ */ jsxDEV13(Text13, {
10257
+ /* @__PURE__ */ jsxDEV14(Text14, {
10079
10258
  color: state.confirmDestructive ? colors.success : colors.textDim,
10080
10259
  children: state.confirmDestructive ? "enabled" : "disabled"
10081
10260
  }, undefined, false, undefined, this)
@@ -10083,29 +10262,29 @@ function SetupWizardWithCallback({ onComplete }) {
10083
10262
  }, undefined, true, undefined, this)
10084
10263
  ]
10085
10264
  }, undefined, true, undefined, this),
10086
- /* @__PURE__ */ jsxDEV13(Box13, {
10265
+ /* @__PURE__ */ jsxDEV14(Box14, {
10087
10266
  marginTop: 1,
10088
- children: /* @__PURE__ */ jsxDEV13(Text13, {
10267
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
10089
10268
  color: colors.textDim,
10090
10269
  children: [
10091
10270
  "Save configuration? ",
10092
- /* @__PURE__ */ jsxDEV13(Text13, {
10271
+ /* @__PURE__ */ jsxDEV14(Text14, {
10093
10272
  color: colors.success,
10094
10273
  children: "[Y]es"
10095
10274
  }, undefined, false, undefined, this),
10096
10275
  " / ",
10097
- /* @__PURE__ */ jsxDEV13(Text13, {
10276
+ /* @__PURE__ */ jsxDEV14(Text14, {
10098
10277
  color: colors.error,
10099
10278
  children: "[N]o"
10100
10279
  }, undefined, false, undefined, this)
10101
10280
  ]
10102
10281
  }, undefined, true, undefined, this)
10103
10282
  }, undefined, false, undefined, this),
10104
- saving && /* @__PURE__ */ jsxDEV13(Text13, {
10283
+ saving && /* @__PURE__ */ jsxDEV14(Text14, {
10105
10284
  color: colors.primary,
10106
10285
  children: "Saving..."
10107
10286
  }, undefined, false, undefined, this),
10108
- error && /* @__PURE__ */ jsxDEV13(Text13, {
10287
+ error && /* @__PURE__ */ jsxDEV14(Text14, {
10109
10288
  color: colors.error,
10110
10289
  children: [
10111
10290
  icons.error,
@@ -10115,10 +10294,10 @@ function SetupWizardWithCallback({ onComplete }) {
10115
10294
  }, undefined, true, undefined, this)
10116
10295
  ]
10117
10296
  }, undefined, true, undefined, this),
10118
- step === "complete" && /* @__PURE__ */ jsxDEV13(Box13, {
10297
+ step === "complete" && /* @__PURE__ */ jsxDEV14(Box14, {
10119
10298
  flexDirection: "column",
10120
10299
  children: [
10121
- /* @__PURE__ */ jsxDEV13(Text13, {
10300
+ /* @__PURE__ */ jsxDEV14(Text14, {
10122
10301
  color: colors.success,
10123
10302
  bold: true,
10124
10303
  children: [
@@ -10126,15 +10305,15 @@ function SetupWizardWithCallback({ onComplete }) {
10126
10305
  " Setup Complete!"
10127
10306
  ]
10128
10307
  }, undefined, true, undefined, this),
10129
- /* @__PURE__ */ jsxDEV13(Box13, {
10308
+ /* @__PURE__ */ jsxDEV14(Box14, {
10130
10309
  marginTop: 1,
10131
10310
  flexDirection: "column",
10132
10311
  children: [
10133
- /* @__PURE__ */ jsxDEV13(Text13, {
10312
+ /* @__PURE__ */ jsxDEV14(Text14, {
10134
10313
  color: colors.textMuted,
10135
10314
  children: "Configuration saved to:"
10136
10315
  }, undefined, false, undefined, this),
10137
- /* @__PURE__ */ jsxDEV13(Text13, {
10316
+ /* @__PURE__ */ jsxDEV14(Text14, {
10138
10317
  color: colors.text,
10139
10318
  children: [
10140
10319
  " ",
@@ -10142,7 +10321,7 @@ function SetupWizardWithCallback({ onComplete }) {
10142
10321
  "/config.json"
10143
10322
  ]
10144
10323
  }, undefined, true, undefined, this),
10145
- /* @__PURE__ */ jsxDEV13(Text13, {
10324
+ /* @__PURE__ */ jsxDEV14(Text14, {
10146
10325
  color: colors.text,
10147
10326
  children: [
10148
10327
  " ",
@@ -10152,11 +10331,11 @@ function SetupWizardWithCallback({ onComplete }) {
10152
10331
  }, undefined, true, undefined, this)
10153
10332
  ]
10154
10333
  }, undefined, true, undefined, this),
10155
- state.enableBeads && /* @__PURE__ */ jsxDEV13(Box13, {
10334
+ state.enableBeads && /* @__PURE__ */ jsxDEV14(Box14, {
10156
10335
  marginTop: 1,
10157
10336
  flexDirection: "column",
10158
10337
  children: [
10159
- beadsInstallStatus === "installed" && /* @__PURE__ */ jsxDEV13(Text13, {
10338
+ beadsInstallStatus === "installed" && /* @__PURE__ */ jsxDEV14(Text14, {
10160
10339
  color: colors.success,
10161
10340
  children: [
10162
10341
  icons.success,
@@ -10164,7 +10343,7 @@ function SetupWizardWithCallback({ onComplete }) {
10164
10343
  beadsVersion ? ` — ${beadsVersion}` : ""
10165
10344
  ]
10166
10345
  }, undefined, true, undefined, this),
10167
- beadsInstallStatus === "skipped" && /* @__PURE__ */ jsxDEV13(Text13, {
10346
+ beadsInstallStatus === "skipped" && /* @__PURE__ */ jsxDEV14(Text14, {
10168
10347
  color: colors.textMuted,
10169
10348
  children: [
10170
10349
  icons.success,
@@ -10172,25 +10351,25 @@ function SetupWizardWithCallback({ onComplete }) {
10172
10351
  beadsVersion ? ` — ${beadsVersion}` : ""
10173
10352
  ]
10174
10353
  }, undefined, true, undefined, this),
10175
- beadsInstallStatus === "failed" && /* @__PURE__ */ jsxDEV13(Fragment2, {
10354
+ beadsInstallStatus === "failed" && /* @__PURE__ */ jsxDEV14(Fragment2, {
10176
10355
  children: [
10177
- /* @__PURE__ */ jsxDEV13(Text13, {
10356
+ /* @__PURE__ */ jsxDEV14(Text14, {
10178
10357
  color: colors.warning,
10179
10358
  children: "⚠ Beads (bd) install failed. Install manually:"
10180
10359
  }, undefined, false, undefined, this),
10181
- /* @__PURE__ */ jsxDEV13(Text13, {
10360
+ /* @__PURE__ */ jsxDEV14(Text14, {
10182
10361
  color: colors.text,
10183
10362
  children: " curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash"
10184
10363
  }, undefined, false, undefined, this),
10185
- /* @__PURE__ */ jsxDEV13(Text13, {
10364
+ /* @__PURE__ */ jsxDEV14(Text14, {
10186
10365
  color: colors.textDim,
10187
10366
  children: " Or: npm install -g @beads/bd"
10188
10367
  }, undefined, false, undefined, this),
10189
- /* @__PURE__ */ jsxDEV13(Text13, {
10368
+ /* @__PURE__ */ jsxDEV14(Text14, {
10190
10369
  color: colors.textDim,
10191
10370
  children: " Or: brew install beads"
10192
10371
  }, undefined, false, undefined, this),
10193
- beadsInstallError && /* @__PURE__ */ jsxDEV13(Text13, {
10372
+ beadsInstallError && /* @__PURE__ */ jsxDEV14(Text14, {
10194
10373
  color: colors.textDim,
10195
10374
  children: [
10196
10375
  " Error: ",
@@ -10201,63 +10380,63 @@ function SetupWizardWithCallback({ onComplete }) {
10201
10380
  }, undefined, true, undefined, this)
10202
10381
  ]
10203
10382
  }, undefined, true, undefined, this),
10204
- /* @__PURE__ */ jsxDEV13(Box13, {
10383
+ /* @__PURE__ */ jsxDEV14(Box14, {
10205
10384
  marginTop: 1,
10206
10385
  flexDirection: "column",
10207
- children: state.authMethod === "azure-identity" ? /* @__PURE__ */ jsxDEV13(Fragment2, {
10386
+ children: state.authMethod === "azure-identity" ? /* @__PURE__ */ jsxDEV14(Fragment2, {
10208
10387
  children: [
10209
- /* @__PURE__ */ jsxDEV13(Text13, {
10388
+ /* @__PURE__ */ jsxDEV14(Text14, {
10210
10389
  color: colors.textMuted,
10211
10390
  children: "Using Azure Identity — ensure you're logged in:"
10212
10391
  }, undefined, false, undefined, this),
10213
- /* @__PURE__ */ jsxDEV13(Text13, {
10392
+ /* @__PURE__ */ jsxDEV14(Text14, {
10214
10393
  color: colors.text,
10215
10394
  children: [
10216
10395
  " • Run: ",
10217
- /* @__PURE__ */ jsxDEV13(Text13, {
10396
+ /* @__PURE__ */ jsxDEV14(Text14, {
10218
10397
  color: colors.primary,
10219
10398
  children: "az login"
10220
10399
  }, undefined, false, undefined, this)
10221
10400
  ]
10222
10401
  }, undefined, true, undefined, this)
10223
10402
  ]
10224
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV13(Fragment2, {
10403
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV14(Fragment2, {
10225
10404
  children: [
10226
- /* @__PURE__ */ jsxDEV13(Text13, {
10405
+ /* @__PURE__ */ jsxDEV14(Text14, {
10227
10406
  color: colors.textMuted,
10228
10407
  children: "To load credentials, either:"
10229
10408
  }, undefined, false, undefined, this),
10230
- /* @__PURE__ */ jsxDEV13(Text13, {
10409
+ /* @__PURE__ */ jsxDEV14(Text14, {
10231
10410
  color: colors.text,
10232
10411
  children: [
10233
10412
  " • Source the env file: ",
10234
- /* @__PURE__ */ jsxDEV13(Text13, {
10413
+ /* @__PURE__ */ jsxDEV14(Text14, {
10235
10414
  color: colors.primary,
10236
10415
  children: "source ~/.sharkbait/.env"
10237
10416
  }, undefined, false, undefined, this)
10238
10417
  ]
10239
10418
  }, undefined, true, undefined, this),
10240
- /* @__PURE__ */ jsxDEV13(Text13, {
10419
+ /* @__PURE__ */ jsxDEV14(Text14, {
10241
10420
  color: colors.text,
10242
10421
  children: " • Or copy to your project's .env file"
10243
10422
  }, undefined, false, undefined, this)
10244
10423
  ]
10245
10424
  }, undefined, true, undefined, this)
10246
10425
  }, undefined, false, undefined, this),
10247
- /* @__PURE__ */ jsxDEV13(Box13, {
10426
+ /* @__PURE__ */ jsxDEV14(Box14, {
10248
10427
  marginTop: 1,
10249
- children: /* @__PURE__ */ jsxDEV13(Text13, {
10428
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
10250
10429
  color: colors.textDim,
10251
10430
  children: "Press Enter to start coding..."
10252
10431
  }, undefined, false, undefined, this)
10253
10432
  }, undefined, false, undefined, this)
10254
10433
  ]
10255
10434
  }, undefined, true, undefined, this),
10256
- step !== "welcome" && step !== "complete" && /* @__PURE__ */ jsxDEV13(Box13, {
10435
+ step !== "welcome" && step !== "complete" && /* @__PURE__ */ jsxDEV14(Box14, {
10257
10436
  marginTop: 2,
10258
- children: /* @__PURE__ */ jsxDEV13(Text13, {
10437
+ children: /* @__PURE__ */ jsxDEV14(Text14, {
10259
10438
  color: colors.textDim,
10260
- children: ["azure-endpoint", "auth-method", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */ jsxDEV13(Text13, {
10439
+ children: ["azure-endpoint", "auth-method", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */ jsxDEV14(Text14, {
10261
10440
  color: step === s ? colors.primary : colors.textDim,
10262
10441
  children: [
10263
10442
  step === s ? "●" : "○",
@@ -10272,13 +10451,13 @@ function SetupWizardWithCallback({ onComplete }) {
10272
10451
  async function runSetup() {
10273
10452
  let setupCompleted = false;
10274
10453
  function SetupWizardWrapper() {
10275
- return React7.createElement(SetupWizardWithCallback, {
10454
+ return React14.createElement(SetupWizardWithCallback, {
10276
10455
  onComplete: () => {
10277
10456
  setupCompleted = true;
10278
10457
  }
10279
10458
  });
10280
10459
  }
10281
- const { waitUntilExit } = render2(React7.createElement(SetupWizardWrapper));
10460
+ const { waitUntilExit } = render2(React14.createElement(SetupWizardWrapper));
10282
10461
  await waitUntilExit();
10283
10462
  return setupCompleted;
10284
10463
  }
@@ -10409,11 +10588,12 @@ ${"━".repeat(60)}`);
10409
10588
  }
10410
10589
 
10411
10590
  // src/version.ts
10412
- var VERSION2 = "1.0.27";
10591
+ var VERSION2 = "1.0.29";
10413
10592
 
10414
10593
  // src/ui/logo.tsx
10415
- import { Box as Box14, Text as Text14 } from "ink";
10416
- import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
10594
+ import { memo as memo12 } from "react";
10595
+ import { Box as Box15, Text as Text15 } from "ink";
10596
+ import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
10417
10597
  var SHARK_LOGO2 = `
10418
10598
  +.+++.
10419
10599
  ## ....-### -
@@ -10442,6 +10622,51 @@ var SHARK_LOGO2 = `
10442
10622
  #. .+. ..- +. .###-
10443
10623
  #-. + #
10444
10624
  `.trimEnd();
10625
+ var Logo3 = memo12(function Logo4({ variant = "full", version = "0.0.0" }) {
10626
+ const logoText = variant === "inline" ? "" : SHARK_LOGO2;
10627
+ return /* @__PURE__ */ jsxDEV15(Box15, {
10628
+ flexDirection: "column",
10629
+ alignItems: "center",
10630
+ children: [
10631
+ /* @__PURE__ */ jsxDEV15(Text15, {
10632
+ color: colors.primary,
10633
+ children: logoText
10634
+ }, undefined, false, undefined, this),
10635
+ variant !== "inline" && /* @__PURE__ */ jsxDEV15(Box15, {
10636
+ marginTop: 0,
10637
+ children: [
10638
+ /* @__PURE__ */ jsxDEV15(Text15, {
10639
+ bold: true,
10640
+ color: colors.primary,
10641
+ children: "SHARKBAIT"
10642
+ }, undefined, false, undefined, this),
10643
+ /* @__PURE__ */ jsxDEV15(Text15, {
10644
+ color: colors.textMuted,
10645
+ children: [
10646
+ " v",
10647
+ version
10648
+ ]
10649
+ }, undefined, true, undefined, this)
10650
+ ]
10651
+ }, undefined, true, undefined, this)
10652
+ ]
10653
+ }, undefined, true, undefined, this);
10654
+ });
10655
+ var InlineLogo3 = memo12(function InlineLogo4() {
10656
+ return /* @__PURE__ */ jsxDEV15(Text15, {
10657
+ children: [
10658
+ /* @__PURE__ */ jsxDEV15(Text15, {
10659
+ color: colors.primary,
10660
+ children: "\uD83E\uDD88"
10661
+ }, undefined, false, undefined, this),
10662
+ /* @__PURE__ */ jsxDEV15(Text15, {
10663
+ bold: true,
10664
+ color: colors.primary,
10665
+ children: " sharkbait"
10666
+ }, undefined, false, undefined, this)
10667
+ ]
10668
+ }, undefined, true, undefined, this);
10669
+ });
10445
10670
 
10446
10671
  // src/cli.ts
10447
10672
  import { existsSync as existsSync8 } from "fs";