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