sharkbait 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +844 -641
- 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, 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,
|
|
@@ -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 = 150;
|
|
8654
|
+
function useAgentSession(options = {}) {
|
|
8655
|
+
const config = loadConfig();
|
|
8656
|
+
const [state, dispatch] = useReducer(sessionReducer, {
|
|
8657
|
+
messages: [],
|
|
8658
|
+
isLoading: false,
|
|
8659
|
+
currentOutput: "",
|
|
8660
|
+
showWelcome: true,
|
|
8661
|
+
tokenCount: 0,
|
|
8662
|
+
sessionCost: 0,
|
|
8663
|
+
currentDir: getWorkingDir(options.workingDir),
|
|
8664
|
+
pendingConfirm: null,
|
|
8665
|
+
beadsEnabled: options.enableBeads ?? true,
|
|
8666
|
+
contextFiles: options.contextFiles || [],
|
|
8667
|
+
activeToolCalls: [],
|
|
8668
|
+
currentAgent: null,
|
|
8669
|
+
isExecuting: false,
|
|
8670
|
+
parallelProgress: null,
|
|
8671
|
+
thinkingMessage: null,
|
|
8672
|
+
currentReasoning: "",
|
|
8673
|
+
currentModel: config.azure.deployment
|
|
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,85 +8837,356 @@ ${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 messageList = useMemo(() => messages.map((msg, i) => /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9146
|
+
flexDirection: "column",
|
|
9147
|
+
children: [
|
|
9148
|
+
/* @__PURE__ */ jsxDEV13(MessageView, {
|
|
9149
|
+
role: msg.role,
|
|
9150
|
+
content: msg.content,
|
|
9151
|
+
timestamp: msg.timestamp
|
|
9152
|
+
}, undefined, false, undefined, this),
|
|
9153
|
+
msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9154
|
+
flexDirection: "column",
|
|
9155
|
+
marginLeft: 2,
|
|
9156
|
+
children: msg.toolCalls.map((tc, j) => /* @__PURE__ */ jsxDEV13(ToolCallView, {
|
|
9157
|
+
name: tc.displayName,
|
|
9158
|
+
status: tc.status,
|
|
9159
|
+
result: tc.result,
|
|
9160
|
+
error: tc.error,
|
|
9161
|
+
duration: tc.duration
|
|
9162
|
+
}, j, false, undefined, this))
|
|
9163
|
+
}, undefined, false, undefined, this)
|
|
9164
|
+
]
|
|
9165
|
+
}, i, true, undefined, this)), [messages]);
|
|
9166
|
+
const activeToolCallList = useMemo(() => activeToolCalls.length > 0 ? /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9167
|
+
flexDirection: "column",
|
|
9168
|
+
marginLeft: 2,
|
|
9169
|
+
children: activeToolCalls.map((tc, i) => /* @__PURE__ */ jsxDEV13(ToolCallView, {
|
|
9170
|
+
name: tc.displayName,
|
|
9171
|
+
status: tc.status,
|
|
9172
|
+
result: tc.result,
|
|
9173
|
+
error: tc.error,
|
|
9174
|
+
duration: tc.duration
|
|
9175
|
+
}, i, false, undefined, this))
|
|
9176
|
+
}, undefined, false, undefined, this) : null, [activeToolCalls]);
|
|
9177
|
+
return /* @__PURE__ */ jsxDEV13(Box13, {
|
|
8997
9178
|
flexDirection: "column",
|
|
8998
9179
|
padding: 0,
|
|
8999
9180
|
children: [
|
|
9000
|
-
showWelcome ? /* @__PURE__ */
|
|
9181
|
+
showWelcome ? /* @__PURE__ */ jsxDEV13(WelcomeScreen, {
|
|
9001
9182
|
version,
|
|
9002
|
-
workingDir
|
|
9003
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
9183
|
+
workingDir: currentDir
|
|
9184
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9004
9185
|
marginBottom: 0,
|
|
9005
9186
|
justifyContent: "space-between",
|
|
9006
9187
|
children: [
|
|
9007
|
-
/* @__PURE__ */
|
|
9008
|
-
/* @__PURE__ */
|
|
9188
|
+
/* @__PURE__ */ jsxDEV13(InlineLogo, {}, undefined, false, undefined, this),
|
|
9189
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9009
9190
|
color: colors.textDim,
|
|
9010
9191
|
children: [
|
|
9011
9192
|
"v",
|
|
@@ -9014,66 +9195,36 @@ ${event.consolidated}`,
|
|
|
9014
9195
|
}, undefined, true, undefined, this)
|
|
9015
9196
|
]
|
|
9016
9197
|
}, undefined, true, undefined, this),
|
|
9017
|
-
!showWelcome && /* @__PURE__ */
|
|
9198
|
+
!showWelcome && /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9018
9199
|
flexDirection: "column",
|
|
9019
9200
|
marginBottom: 0,
|
|
9020
9201
|
children: [
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
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, {
|
|
9202
|
+
messageList,
|
|
9203
|
+
activeToolCallList,
|
|
9204
|
+
parallelProgress && /* @__PURE__ */ jsxDEV13(ParallelProgressView, {
|
|
9054
9205
|
title: "Parallel Execution",
|
|
9055
9206
|
agents: parallelProgress.agents,
|
|
9056
9207
|
strategy: parallelProgress.strategy
|
|
9057
9208
|
}, undefined, false, undefined, this),
|
|
9058
|
-
pendingConfirm && /* @__PURE__ */
|
|
9209
|
+
pendingConfirm && /* @__PURE__ */ jsxDEV13(ConfirmDialog, {
|
|
9059
9210
|
message: pendingConfirm.type === "mkdir" ? `Create directory: ${pendingConfirm.data.path}?` : pendingConfirm.type === "edit_file" ? `Apply changes to: ${pendingConfirm.data.filePath}?` : `Confirm ${pendingConfirm.type}?`,
|
|
9060
9211
|
details: pendingConfirm.data.details,
|
|
9061
|
-
showDiff: pendingConfirm.type === "edit_file" && pendingConfirm.data.oldContent && pendingConfirm.data.newContent ? /* @__PURE__ */
|
|
9212
|
+
showDiff: pendingConfirm.type === "edit_file" && pendingConfirm.data.oldContent && pendingConfirm.data.newContent ? /* @__PURE__ */ jsxDEV13(DiffView, {
|
|
9062
9213
|
filePath: pendingConfirm.data.filePath,
|
|
9063
9214
|
oldContent: pendingConfirm.data.oldContent,
|
|
9064
9215
|
newContent: pendingConfirm.data.newContent
|
|
9065
9216
|
}, undefined, false, undefined, this) : undefined
|
|
9066
9217
|
}, undefined, false, undefined, this),
|
|
9067
|
-
currentReasoning && /* @__PURE__ */
|
|
9218
|
+
currentReasoning && /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9068
9219
|
marginLeft: 3,
|
|
9069
9220
|
marginBottom: 0,
|
|
9070
9221
|
children: [
|
|
9071
|
-
/* @__PURE__ */
|
|
9222
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9072
9223
|
color: colors.textDim,
|
|
9073
9224
|
dimColor: true,
|
|
9074
9225
|
children: "\uD83D\uDCAD "
|
|
9075
9226
|
}, undefined, false, undefined, this),
|
|
9076
|
-
/* @__PURE__ */
|
|
9227
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9077
9228
|
color: colors.textDim,
|
|
9078
9229
|
dimColor: true,
|
|
9079
9230
|
wrap: "wrap",
|
|
@@ -9081,59 +9232,65 @@ ${event.consolidated}`,
|
|
|
9081
9232
|
}, undefined, false, undefined, this)
|
|
9082
9233
|
]
|
|
9083
9234
|
}, undefined, true, undefined, this),
|
|
9084
|
-
currentOutput && /* @__PURE__ */
|
|
9235
|
+
currentOutput && /* @__PURE__ */ jsxDEV13(MessageView, {
|
|
9085
9236
|
role: "assistant",
|
|
9086
9237
|
content: currentOutput,
|
|
9087
9238
|
enableHighlighting: false
|
|
9088
9239
|
}, undefined, false, undefined, this)
|
|
9089
9240
|
]
|
|
9090
9241
|
}, undefined, true, undefined, this),
|
|
9091
|
-
/* @__PURE__ */
|
|
9242
|
+
/* @__PURE__ */ jsxDEV13(Box13, {
|
|
9092
9243
|
marginTop: 0,
|
|
9093
|
-
children:
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9244
|
+
children: [
|
|
9245
|
+
isLoading && /* @__PURE__ */ jsxDEV13(Box13, {
|
|
9246
|
+
flexDirection: "column",
|
|
9247
|
+
marginLeft: 1,
|
|
9248
|
+
children: /* @__PURE__ */ jsxDEV13(Spinner, {
|
|
9249
|
+
text: thinkingMessage || (currentAgent ? `${currentAgent} thinking...` : "Thinking..."),
|
|
9250
|
+
showTokens: true,
|
|
9251
|
+
tokens: tokenCount
|
|
9252
|
+
}, undefined, false, undefined, this)
|
|
9253
|
+
}, undefined, false, undefined, this),
|
|
9254
|
+
/* @__PURE__ */ jsxDEV13(ManagedInput, {
|
|
9255
|
+
onSubmit: handleSubmit,
|
|
9256
|
+
visible: !isLoading,
|
|
9257
|
+
isExecuting,
|
|
9258
|
+
onCancel: cancelOperation
|
|
9100
9259
|
}, undefined, false, undefined, this)
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
}, undefined, false, undefined, this),
|
|
9105
|
-
/* @__PURE__ */ jsxDEV12(Box12, {
|
|
9260
|
+
]
|
|
9261
|
+
}, undefined, true, undefined, this),
|
|
9262
|
+
/* @__PURE__ */ jsxDEV13(Box13, {
|
|
9106
9263
|
marginTop: 0,
|
|
9107
|
-
children: /* @__PURE__ */
|
|
9264
|
+
children: /* @__PURE__ */ jsxDEV13(StatusBar, {
|
|
9108
9265
|
mode: isExecuting ? "agent" : "chat",
|
|
9109
9266
|
tokens: tokenCount,
|
|
9110
9267
|
cost: sessionCost,
|
|
9111
9268
|
model: currentModel
|
|
9112
9269
|
}, undefined, false, undefined, this)
|
|
9113
9270
|
}, undefined, false, undefined, this),
|
|
9114
|
-
/* @__PURE__ */
|
|
9271
|
+
/* @__PURE__ */ jsxDEV13(Box13, {
|
|
9115
9272
|
marginTop: 0,
|
|
9116
9273
|
justifyContent: "center",
|
|
9117
|
-
children: /* @__PURE__ */
|
|
9274
|
+
children: /* @__PURE__ */ jsxDEV13(Text13, {
|
|
9118
9275
|
color: colors.textDim,
|
|
9119
|
-
children: isExecuting ? /* @__PURE__ */
|
|
9276
|
+
children: isExecuting ? /* @__PURE__ */ jsxDEV13(Fragment, {
|
|
9120
9277
|
children: [
|
|
9121
9278
|
"Press ",
|
|
9122
|
-
/* @__PURE__ */
|
|
9279
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9123
9280
|
color: colors.warning,
|
|
9124
9281
|
children: "Ctrl+C"
|
|
9125
9282
|
}, undefined, false, undefined, this),
|
|
9126
9283
|
" to cancel"
|
|
9127
9284
|
]
|
|
9128
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
9285
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV13(Fragment, {
|
|
9129
9286
|
children: [
|
|
9130
9287
|
"Press ",
|
|
9131
|
-
/* @__PURE__ */
|
|
9288
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9132
9289
|
color: colors.primary,
|
|
9133
9290
|
children: "Ctrl+C"
|
|
9134
9291
|
}, undefined, false, undefined, this),
|
|
9135
9292
|
" to exit •",
|
|
9136
|
-
/* @__PURE__ */
|
|
9293
|
+
/* @__PURE__ */ jsxDEV13(Text13, {
|
|
9137
9294
|
color: colors.primary,
|
|
9138
9295
|
children: " Enter"
|
|
9139
9296
|
}, undefined, false, undefined, this),
|
|
@@ -9147,7 +9304,7 @@ ${event.consolidated}`,
|
|
|
9147
9304
|
}
|
|
9148
9305
|
|
|
9149
9306
|
// src/version.ts
|
|
9150
|
-
var VERSION = "1.0.
|
|
9307
|
+
var VERSION = "1.0.29";
|
|
9151
9308
|
|
|
9152
9309
|
// src/agent/start-chat.ts
|
|
9153
9310
|
async function startChat(options = {}) {
|
|
@@ -9157,7 +9314,7 @@ async function startChat(options = {}) {
|
|
|
9157
9314
|
process.chdir(workingDir);
|
|
9158
9315
|
}
|
|
9159
9316
|
} catch {}
|
|
9160
|
-
const { waitUntilExit } = render(
|
|
9317
|
+
const { waitUntilExit } = render(React13.createElement(App, {
|
|
9161
9318
|
contextFiles: options.context,
|
|
9162
9319
|
enableBeads: options.beads ?? true,
|
|
9163
9320
|
version: VERSION,
|
|
@@ -9331,17 +9488,17 @@ Task completed.`);
|
|
|
9331
9488
|
}
|
|
9332
9489
|
|
|
9333
9490
|
// src/commands/setup.tsx
|
|
9334
|
-
import
|
|
9335
|
-
import { render as render2, Box as
|
|
9491
|
+
import React14, { useState as useState3, useEffect as useEffect3 } from "react";
|
|
9492
|
+
import { render as render2, Box as Box14, Text as Text14, useInput as useInput2, useApp as useApp3 } from "ink";
|
|
9336
9493
|
import TextInput from "ink-text-input";
|
|
9337
9494
|
import { writeFile as writeFile4, readFile as readFile3, mkdir as mkdir4, stat as stat3 } from "fs/promises";
|
|
9338
9495
|
import { join as join8, resolve as resolve4 } from "path";
|
|
9339
9496
|
import { homedir as homedir4 } from "os";
|
|
9340
9497
|
import { existsSync as existsSync6 } from "fs";
|
|
9341
9498
|
import { execSync as execSync2 } from "child_process";
|
|
9342
|
-
import { jsxDEV as
|
|
9499
|
+
import { jsxDEV as jsxDEV14, Fragment as Fragment2 } from "react/jsx-dev-runtime";
|
|
9343
9500
|
function SetupWizardWithCallback({ onComplete }) {
|
|
9344
|
-
const { exit } =
|
|
9501
|
+
const { exit } = useApp3();
|
|
9345
9502
|
const [step, setStep] = useState3("welcome");
|
|
9346
9503
|
const [state, setState] = useState3({
|
|
9347
9504
|
azureEndpoint: "",
|
|
@@ -9627,17 +9784,17 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9627
9784
|
}
|
|
9628
9785
|
}
|
|
9629
9786
|
const configDir = join8(homedir4(), ".sharkbait");
|
|
9630
|
-
return /* @__PURE__ */
|
|
9787
|
+
return /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9631
9788
|
flexDirection: "column",
|
|
9632
9789
|
padding: 1,
|
|
9633
9790
|
children: [
|
|
9634
|
-
/* @__PURE__ */
|
|
9791
|
+
/* @__PURE__ */ jsxDEV14(Logo, {
|
|
9635
9792
|
variant: "full",
|
|
9636
9793
|
version: VERSION
|
|
9637
9794
|
}, undefined, false, undefined, this),
|
|
9638
|
-
/* @__PURE__ */
|
|
9795
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9639
9796
|
marginBottom: 1,
|
|
9640
|
-
children: /* @__PURE__ */
|
|
9797
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9641
9798
|
color: colors.primary,
|
|
9642
9799
|
bold: true,
|
|
9643
9800
|
children: [
|
|
@@ -9646,14 +9803,14 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9646
9803
|
]
|
|
9647
9804
|
}, undefined, true, undefined, this)
|
|
9648
9805
|
}, undefined, false, undefined, this),
|
|
9649
|
-
step === "welcome" && /* @__PURE__ */
|
|
9806
|
+
step === "welcome" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9650
9807
|
flexDirection: "column",
|
|
9651
9808
|
children: [
|
|
9652
|
-
/* @__PURE__ */
|
|
9809
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9653
9810
|
color: colors.text,
|
|
9654
9811
|
children: "Welcome! This wizard will help you configure Sharkbait."
|
|
9655
9812
|
}, undefined, false, undefined, this),
|
|
9656
|
-
/* @__PURE__ */
|
|
9813
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9657
9814
|
color: colors.textMuted,
|
|
9658
9815
|
children: [
|
|
9659
9816
|
`
|
|
@@ -9661,22 +9818,22 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9661
9818
|
"Configuration will be saved to:"
|
|
9662
9819
|
]
|
|
9663
9820
|
}, undefined, true, undefined, this),
|
|
9664
|
-
/* @__PURE__ */
|
|
9821
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9665
9822
|
color: colors.primary,
|
|
9666
9823
|
children: configDir
|
|
9667
9824
|
}, undefined, false, undefined, this),
|
|
9668
|
-
/* @__PURE__ */
|
|
9825
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9669
9826
|
marginTop: 1,
|
|
9670
|
-
children: /* @__PURE__ */
|
|
9827
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9671
9828
|
color: colors.textDim,
|
|
9672
9829
|
children: [
|
|
9673
9830
|
"Press ",
|
|
9674
|
-
/* @__PURE__ */
|
|
9831
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9675
9832
|
color: colors.success,
|
|
9676
9833
|
children: "Enter"
|
|
9677
9834
|
}, undefined, false, undefined, this),
|
|
9678
9835
|
" to continue, ",
|
|
9679
|
-
/* @__PURE__ */
|
|
9836
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9680
9837
|
color: colors.warning,
|
|
9681
9838
|
children: "ESC"
|
|
9682
9839
|
}, undefined, false, undefined, this),
|
|
@@ -9686,34 +9843,34 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9686
9843
|
}, undefined, false, undefined, this)
|
|
9687
9844
|
]
|
|
9688
9845
|
}, undefined, true, undefined, this),
|
|
9689
|
-
step === "azure-endpoint" && /* @__PURE__ */
|
|
9846
|
+
step === "azure-endpoint" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9690
9847
|
flexDirection: "column",
|
|
9691
9848
|
children: [
|
|
9692
|
-
/* @__PURE__ */
|
|
9849
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9693
9850
|
color: colors.text,
|
|
9694
9851
|
bold: true,
|
|
9695
9852
|
children: "Step 1/5: Azure OpenAI Endpoint"
|
|
9696
9853
|
}, undefined, false, undefined, this),
|
|
9697
|
-
/* @__PURE__ */
|
|
9854
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9698
9855
|
color: colors.textMuted,
|
|
9699
9856
|
children: "Enter your Azure OpenAI resource endpoint URL"
|
|
9700
9857
|
}, undefined, false, undefined, this),
|
|
9701
|
-
/* @__PURE__ */
|
|
9858
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9702
9859
|
color: colors.textDim,
|
|
9703
9860
|
italic: true,
|
|
9704
9861
|
children: "Example: https://your-resource.openai.azure.com"
|
|
9705
9862
|
}, undefined, false, undefined, this),
|
|
9706
|
-
/* @__PURE__ */
|
|
9863
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9707
9864
|
marginTop: 1,
|
|
9708
9865
|
children: [
|
|
9709
|
-
/* @__PURE__ */
|
|
9866
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9710
9867
|
color: colors.primary,
|
|
9711
9868
|
children: [
|
|
9712
9869
|
">",
|
|
9713
9870
|
" "
|
|
9714
9871
|
]
|
|
9715
9872
|
}, undefined, true, undefined, this),
|
|
9716
|
-
/* @__PURE__ */
|
|
9873
|
+
/* @__PURE__ */ jsxDEV14(TextInput, {
|
|
9717
9874
|
value: inputValue,
|
|
9718
9875
|
onChange: setInputValue,
|
|
9719
9876
|
onSubmit: handleInputSubmit,
|
|
@@ -9721,7 +9878,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9721
9878
|
}, undefined, false, undefined, this)
|
|
9722
9879
|
]
|
|
9723
9880
|
}, undefined, true, undefined, this),
|
|
9724
|
-
error && /* @__PURE__ */
|
|
9881
|
+
error && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9725
9882
|
color: colors.error,
|
|
9726
9883
|
children: [
|
|
9727
9884
|
icons.error,
|
|
@@ -9731,51 +9888,51 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9731
9888
|
}, undefined, true, undefined, this)
|
|
9732
9889
|
]
|
|
9733
9890
|
}, undefined, true, undefined, this),
|
|
9734
|
-
step === "auth-method" && /* @__PURE__ */
|
|
9891
|
+
step === "auth-method" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9735
9892
|
flexDirection: "column",
|
|
9736
9893
|
children: [
|
|
9737
|
-
/* @__PURE__ */
|
|
9894
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9738
9895
|
color: colors.text,
|
|
9739
9896
|
bold: true,
|
|
9740
9897
|
children: "Step 2/5: Authentication Method"
|
|
9741
9898
|
}, undefined, false, undefined, this),
|
|
9742
|
-
/* @__PURE__ */
|
|
9899
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9743
9900
|
color: colors.textMuted,
|
|
9744
9901
|
children: "Choose how to authenticate with Azure OpenAI"
|
|
9745
9902
|
}, undefined, false, undefined, this),
|
|
9746
|
-
/* @__PURE__ */
|
|
9903
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9747
9904
|
marginTop: 1,
|
|
9748
9905
|
flexDirection: "column",
|
|
9749
9906
|
children: [
|
|
9750
|
-
/* @__PURE__ */
|
|
9907
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9751
9908
|
children: [
|
|
9752
|
-
/* @__PURE__ */
|
|
9909
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9753
9910
|
color: colors.primary,
|
|
9754
9911
|
children: "[1]"
|
|
9755
9912
|
}, undefined, false, undefined, this),
|
|
9756
9913
|
" ",
|
|
9757
|
-
/* @__PURE__ */
|
|
9914
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9758
9915
|
color: colors.success,
|
|
9759
9916
|
children: "Azure Identity (recommended)"
|
|
9760
9917
|
}, undefined, false, undefined, this),
|
|
9761
|
-
/* @__PURE__ */
|
|
9918
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9762
9919
|
color: colors.textDim,
|
|
9763
9920
|
children: " - Uses az login, managed identity, VS Code creds"
|
|
9764
9921
|
}, undefined, false, undefined, this)
|
|
9765
9922
|
]
|
|
9766
9923
|
}, undefined, true, undefined, this),
|
|
9767
|
-
/* @__PURE__ */
|
|
9924
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9768
9925
|
children: [
|
|
9769
|
-
/* @__PURE__ */
|
|
9926
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9770
9927
|
color: colors.primary,
|
|
9771
9928
|
children: "[2]"
|
|
9772
9929
|
}, undefined, false, undefined, this),
|
|
9773
9930
|
" ",
|
|
9774
|
-
/* @__PURE__ */
|
|
9931
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9775
9932
|
color: colors.text,
|
|
9776
9933
|
children: "API Key"
|
|
9777
9934
|
}, undefined, false, undefined, this),
|
|
9778
|
-
/* @__PURE__ */
|
|
9935
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9779
9936
|
color: colors.textDim,
|
|
9780
9937
|
children: " - Manual key entry (fallback)"
|
|
9781
9938
|
}, undefined, false, undefined, this)
|
|
@@ -9783,9 +9940,9 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9783
9940
|
}, undefined, true, undefined, this)
|
|
9784
9941
|
]
|
|
9785
9942
|
}, undefined, true, undefined, this),
|
|
9786
|
-
error && /* @__PURE__ */
|
|
9943
|
+
error && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9787
9944
|
marginTop: 1,
|
|
9788
|
-
children: /* @__PURE__ */
|
|
9945
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9789
9946
|
color: colors.error,
|
|
9790
9947
|
children: [
|
|
9791
9948
|
icons.error,
|
|
@@ -9794,18 +9951,18 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9794
9951
|
]
|
|
9795
9952
|
}, undefined, true, undefined, this)
|
|
9796
9953
|
}, undefined, false, undefined, this),
|
|
9797
|
-
/* @__PURE__ */
|
|
9954
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9798
9955
|
marginTop: 1,
|
|
9799
|
-
children: /* @__PURE__ */
|
|
9956
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9800
9957
|
color: colors.textDim,
|
|
9801
9958
|
children: [
|
|
9802
9959
|
"Press ",
|
|
9803
|
-
/* @__PURE__ */
|
|
9960
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9804
9961
|
color: colors.success,
|
|
9805
9962
|
children: "1"
|
|
9806
9963
|
}, undefined, false, undefined, this),
|
|
9807
9964
|
" or ",
|
|
9808
|
-
/* @__PURE__ */
|
|
9965
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9809
9966
|
color: colors.success,
|
|
9810
9967
|
children: "2"
|
|
9811
9968
|
}, undefined, false, undefined, this),
|
|
@@ -9815,34 +9972,34 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9815
9972
|
}, undefined, false, undefined, this)
|
|
9816
9973
|
]
|
|
9817
9974
|
}, undefined, true, undefined, this),
|
|
9818
|
-
step === "azure-key" && /* @__PURE__ */
|
|
9975
|
+
step === "azure-key" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9819
9976
|
flexDirection: "column",
|
|
9820
9977
|
children: [
|
|
9821
|
-
/* @__PURE__ */
|
|
9978
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9822
9979
|
color: colors.text,
|
|
9823
9980
|
bold: true,
|
|
9824
9981
|
children: "Step 2b/5: Azure OpenAI API Key"
|
|
9825
9982
|
}, undefined, false, undefined, this),
|
|
9826
|
-
/* @__PURE__ */
|
|
9983
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9827
9984
|
color: colors.textMuted,
|
|
9828
9985
|
children: "Enter your Azure OpenAI API key"
|
|
9829
9986
|
}, undefined, false, undefined, this),
|
|
9830
|
-
/* @__PURE__ */
|
|
9987
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9831
9988
|
color: colors.textDim,
|
|
9832
9989
|
italic: true,
|
|
9833
9990
|
children: "This will be stored in ~/.sharkbait/.env"
|
|
9834
9991
|
}, undefined, false, undefined, this),
|
|
9835
|
-
/* @__PURE__ */
|
|
9992
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9836
9993
|
marginTop: 1,
|
|
9837
9994
|
children: [
|
|
9838
|
-
/* @__PURE__ */
|
|
9995
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9839
9996
|
color: colors.primary,
|
|
9840
9997
|
children: [
|
|
9841
9998
|
">",
|
|
9842
9999
|
" "
|
|
9843
10000
|
]
|
|
9844
10001
|
}, undefined, true, undefined, this),
|
|
9845
|
-
/* @__PURE__ */
|
|
10002
|
+
/* @__PURE__ */ jsxDEV14(TextInput, {
|
|
9846
10003
|
value: inputValue,
|
|
9847
10004
|
onChange: setInputValue,
|
|
9848
10005
|
onSubmit: handleInputSubmit,
|
|
@@ -9851,7 +10008,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9851
10008
|
}, undefined, false, undefined, this)
|
|
9852
10009
|
]
|
|
9853
10010
|
}, undefined, true, undefined, this),
|
|
9854
|
-
error && /* @__PURE__ */
|
|
10011
|
+
error && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9855
10012
|
color: colors.error,
|
|
9856
10013
|
children: [
|
|
9857
10014
|
icons.error,
|
|
@@ -9861,34 +10018,34 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9861
10018
|
}, undefined, true, undefined, this)
|
|
9862
10019
|
]
|
|
9863
10020
|
}, undefined, true, undefined, this),
|
|
9864
|
-
step === "azure-deployment" && /* @__PURE__ */
|
|
10021
|
+
step === "azure-deployment" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9865
10022
|
flexDirection: "column",
|
|
9866
10023
|
children: [
|
|
9867
|
-
/* @__PURE__ */
|
|
10024
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9868
10025
|
color: colors.text,
|
|
9869
10026
|
bold: true,
|
|
9870
10027
|
children: "Step 3/5: Model Deployment Name"
|
|
9871
10028
|
}, undefined, false, undefined, this),
|
|
9872
|
-
/* @__PURE__ */
|
|
10029
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9873
10030
|
color: colors.textMuted,
|
|
9874
10031
|
children: "Enter your Azure OpenAI model deployment name"
|
|
9875
10032
|
}, undefined, false, undefined, this),
|
|
9876
|
-
/* @__PURE__ */
|
|
10033
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9877
10034
|
color: colors.textDim,
|
|
9878
10035
|
italic: true,
|
|
9879
10036
|
children: "Default: gpt-5.3-codex"
|
|
9880
10037
|
}, undefined, false, undefined, this),
|
|
9881
|
-
/* @__PURE__ */
|
|
10038
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9882
10039
|
marginTop: 1,
|
|
9883
10040
|
children: [
|
|
9884
|
-
/* @__PURE__ */
|
|
10041
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9885
10042
|
color: colors.primary,
|
|
9886
10043
|
children: [
|
|
9887
10044
|
">",
|
|
9888
10045
|
" "
|
|
9889
10046
|
]
|
|
9890
10047
|
}, undefined, true, undefined, this),
|
|
9891
|
-
/* @__PURE__ */
|
|
10048
|
+
/* @__PURE__ */ jsxDEV14(TextInput, {
|
|
9892
10049
|
value: inputValue,
|
|
9893
10050
|
onChange: setInputValue,
|
|
9894
10051
|
onSubmit: handleInputSubmit,
|
|
@@ -9898,34 +10055,34 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9898
10055
|
}, undefined, true, undefined, this)
|
|
9899
10056
|
]
|
|
9900
10057
|
}, undefined, true, undefined, this),
|
|
9901
|
-
step === "working-dir" && /* @__PURE__ */
|
|
10058
|
+
step === "working-dir" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9902
10059
|
flexDirection: "column",
|
|
9903
10060
|
children: [
|
|
9904
|
-
/* @__PURE__ */
|
|
10061
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9905
10062
|
color: colors.text,
|
|
9906
10063
|
bold: true,
|
|
9907
10064
|
children: "Step 4/5: Default Working Directory"
|
|
9908
10065
|
}, undefined, false, undefined, this),
|
|
9909
|
-
/* @__PURE__ */
|
|
10066
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9910
10067
|
color: colors.textMuted,
|
|
9911
10068
|
children: "Set a default project directory (optional)"
|
|
9912
10069
|
}, undefined, false, undefined, this),
|
|
9913
|
-
/* @__PURE__ */
|
|
10070
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9914
10071
|
color: colors.textDim,
|
|
9915
10072
|
italic: true,
|
|
9916
10073
|
children: "Leave empty to always use current directory"
|
|
9917
10074
|
}, undefined, false, undefined, this),
|
|
9918
|
-
/* @__PURE__ */
|
|
10075
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9919
10076
|
marginTop: 1,
|
|
9920
10077
|
children: [
|
|
9921
|
-
/* @__PURE__ */
|
|
10078
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9922
10079
|
color: colors.primary,
|
|
9923
10080
|
children: [
|
|
9924
10081
|
">",
|
|
9925
10082
|
" "
|
|
9926
10083
|
]
|
|
9927
10084
|
}, undefined, true, undefined, this),
|
|
9928
|
-
/* @__PURE__ */
|
|
10085
|
+
/* @__PURE__ */ jsxDEV14(TextInput, {
|
|
9929
10086
|
value: inputValue,
|
|
9930
10087
|
onChange: setInputValue,
|
|
9931
10088
|
onSubmit: handleInputSubmit,
|
|
@@ -9935,57 +10092,57 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9935
10092
|
}, undefined, true, undefined, this)
|
|
9936
10093
|
]
|
|
9937
10094
|
}, undefined, true, undefined, this),
|
|
9938
|
-
step === "features" && /* @__PURE__ */
|
|
10095
|
+
step === "features" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
9939
10096
|
flexDirection: "column",
|
|
9940
10097
|
children: [
|
|
9941
|
-
/* @__PURE__ */
|
|
10098
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9942
10099
|
color: colors.text,
|
|
9943
10100
|
bold: true,
|
|
9944
10101
|
children: "Step 5/5: Features"
|
|
9945
10102
|
}, undefined, false, undefined, this),
|
|
9946
|
-
/* @__PURE__ */
|
|
10103
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9947
10104
|
color: colors.textMuted,
|
|
9948
10105
|
children: "Toggle features with number keys, Enter to continue"
|
|
9949
10106
|
}, undefined, false, undefined, this),
|
|
9950
|
-
/* @__PURE__ */
|
|
10107
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9951
10108
|
marginTop: 1,
|
|
9952
10109
|
flexDirection: "column",
|
|
9953
10110
|
children: [
|
|
9954
|
-
/* @__PURE__ */
|
|
10111
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9955
10112
|
children: [
|
|
9956
|
-
/* @__PURE__ */
|
|
10113
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9957
10114
|
color: colors.primary,
|
|
9958
10115
|
children: "[1]"
|
|
9959
10116
|
}, undefined, false, undefined, this),
|
|
9960
10117
|
" ",
|
|
9961
|
-
/* @__PURE__ */
|
|
10118
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9962
10119
|
color: state.enableBeads ? colors.success : colors.textDim,
|
|
9963
10120
|
children: [
|
|
9964
10121
|
state.enableBeads ? icons.success : "○",
|
|
9965
10122
|
" Beads Memory"
|
|
9966
10123
|
]
|
|
9967
10124
|
}, undefined, true, undefined, this),
|
|
9968
|
-
/* @__PURE__ */
|
|
10125
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9969
10126
|
color: colors.textDim,
|
|
9970
10127
|
children: " - Git-backed task persistence"
|
|
9971
10128
|
}, undefined, false, undefined, this)
|
|
9972
10129
|
]
|
|
9973
10130
|
}, undefined, true, undefined, this),
|
|
9974
|
-
/* @__PURE__ */
|
|
10131
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9975
10132
|
children: [
|
|
9976
|
-
/* @__PURE__ */
|
|
10133
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9977
10134
|
color: colors.primary,
|
|
9978
10135
|
children: "[2]"
|
|
9979
10136
|
}, undefined, false, undefined, this),
|
|
9980
10137
|
" ",
|
|
9981
|
-
/* @__PURE__ */
|
|
10138
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9982
10139
|
color: state.confirmDestructive ? colors.success : colors.textDim,
|
|
9983
10140
|
children: [
|
|
9984
10141
|
state.confirmDestructive ? icons.success : "○",
|
|
9985
10142
|
" Confirm Destructive"
|
|
9986
10143
|
]
|
|
9987
10144
|
}, undefined, true, undefined, this),
|
|
9988
|
-
/* @__PURE__ */
|
|
10145
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
9989
10146
|
color: colors.textDim,
|
|
9990
10147
|
children: " - Require confirmation for risky commands"
|
|
9991
10148
|
}, undefined, false, undefined, this)
|
|
@@ -9993,13 +10150,13 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
9993
10150
|
}, undefined, true, undefined, this)
|
|
9994
10151
|
]
|
|
9995
10152
|
}, undefined, true, undefined, this),
|
|
9996
|
-
/* @__PURE__ */
|
|
10153
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
9997
10154
|
marginTop: 1,
|
|
9998
|
-
children: /* @__PURE__ */
|
|
10155
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
9999
10156
|
color: colors.textDim,
|
|
10000
10157
|
children: [
|
|
10001
10158
|
"Press ",
|
|
10002
|
-
/* @__PURE__ */
|
|
10159
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10003
10160
|
color: colors.success,
|
|
10004
10161
|
children: "Enter"
|
|
10005
10162
|
}, undefined, false, undefined, this),
|
|
@@ -10009,15 +10166,15 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10009
10166
|
}, undefined, false, undefined, this)
|
|
10010
10167
|
]
|
|
10011
10168
|
}, undefined, true, undefined, this),
|
|
10012
|
-
step === "confirm" && /* @__PURE__ */
|
|
10169
|
+
step === "confirm" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
10013
10170
|
flexDirection: "column",
|
|
10014
10171
|
children: [
|
|
10015
|
-
/* @__PURE__ */
|
|
10172
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10016
10173
|
color: colors.text,
|
|
10017
10174
|
bold: true,
|
|
10018
10175
|
children: "Review Configuration"
|
|
10019
10176
|
}, undefined, false, undefined, this),
|
|
10020
|
-
/* @__PURE__ */
|
|
10177
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
10021
10178
|
marginTop: 1,
|
|
10022
10179
|
flexDirection: "column",
|
|
10023
10180
|
borderStyle: "single",
|
|
@@ -10025,79 +10182,79 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10025
10182
|
paddingX: 2,
|
|
10026
10183
|
paddingY: 1,
|
|
10027
10184
|
children: [
|
|
10028
|
-
/* @__PURE__ */
|
|
10185
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10029
10186
|
children: [
|
|
10030
|
-
/* @__PURE__ */
|
|
10187
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10031
10188
|
color: colors.textMuted,
|
|
10032
10189
|
children: "Endpoint:"
|
|
10033
10190
|
}, undefined, false, undefined, this),
|
|
10034
10191
|
" ",
|
|
10035
|
-
/* @__PURE__ */
|
|
10192
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10036
10193
|
color: colors.text,
|
|
10037
10194
|
children: state.azureEndpoint
|
|
10038
10195
|
}, undefined, false, undefined, this)
|
|
10039
10196
|
]
|
|
10040
10197
|
}, undefined, true, undefined, this),
|
|
10041
|
-
/* @__PURE__ */
|
|
10198
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10042
10199
|
children: [
|
|
10043
|
-
/* @__PURE__ */
|
|
10200
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10044
10201
|
color: colors.textMuted,
|
|
10045
10202
|
children: "Auth:"
|
|
10046
10203
|
}, undefined, false, undefined, this),
|
|
10047
10204
|
" ",
|
|
10048
|
-
/* @__PURE__ */
|
|
10205
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10049
10206
|
color: state.authMethod === "azure-identity" ? colors.success : colors.text,
|
|
10050
10207
|
children: state.authMethod === "azure-identity" ? "Azure Identity (DefaultAzureCredential)" : "API Key (" + "*".repeat(8) + ")"
|
|
10051
10208
|
}, undefined, false, undefined, this)
|
|
10052
10209
|
]
|
|
10053
10210
|
}, undefined, true, undefined, this),
|
|
10054
|
-
/* @__PURE__ */
|
|
10211
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10055
10212
|
children: [
|
|
10056
|
-
/* @__PURE__ */
|
|
10213
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10057
10214
|
color: colors.textMuted,
|
|
10058
10215
|
children: "Deployment:"
|
|
10059
10216
|
}, undefined, false, undefined, this),
|
|
10060
10217
|
" ",
|
|
10061
|
-
/* @__PURE__ */
|
|
10218
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10062
10219
|
color: colors.text,
|
|
10063
10220
|
children: state.azureDeployment
|
|
10064
10221
|
}, undefined, false, undefined, this)
|
|
10065
10222
|
]
|
|
10066
10223
|
}, undefined, true, undefined, this),
|
|
10067
|
-
/* @__PURE__ */
|
|
10224
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10068
10225
|
children: [
|
|
10069
|
-
/* @__PURE__ */
|
|
10226
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10070
10227
|
color: colors.textMuted,
|
|
10071
10228
|
children: "Working Dir:"
|
|
10072
10229
|
}, undefined, false, undefined, this),
|
|
10073
10230
|
" ",
|
|
10074
|
-
/* @__PURE__ */
|
|
10231
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10075
10232
|
color: colors.text,
|
|
10076
10233
|
children: state.defaultWorkingDir || "(current directory)"
|
|
10077
10234
|
}, undefined, false, undefined, this)
|
|
10078
10235
|
]
|
|
10079
10236
|
}, undefined, true, undefined, this),
|
|
10080
|
-
/* @__PURE__ */
|
|
10237
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10081
10238
|
children: [
|
|
10082
|
-
/* @__PURE__ */
|
|
10239
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10083
10240
|
color: colors.textMuted,
|
|
10084
10241
|
children: "Beads:"
|
|
10085
10242
|
}, undefined, false, undefined, this),
|
|
10086
10243
|
" ",
|
|
10087
|
-
/* @__PURE__ */
|
|
10244
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10088
10245
|
color: state.enableBeads ? colors.success : colors.textDim,
|
|
10089
10246
|
children: state.enableBeads ? "enabled" : "disabled"
|
|
10090
10247
|
}, undefined, false, undefined, this)
|
|
10091
10248
|
]
|
|
10092
10249
|
}, undefined, true, undefined, this),
|
|
10093
|
-
/* @__PURE__ */
|
|
10250
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10094
10251
|
children: [
|
|
10095
|
-
/* @__PURE__ */
|
|
10252
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10096
10253
|
color: colors.textMuted,
|
|
10097
10254
|
children: "Confirm Destructive:"
|
|
10098
10255
|
}, undefined, false, undefined, this),
|
|
10099
10256
|
" ",
|
|
10100
|
-
/* @__PURE__ */
|
|
10257
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10101
10258
|
color: state.confirmDestructive ? colors.success : colors.textDim,
|
|
10102
10259
|
children: state.confirmDestructive ? "enabled" : "disabled"
|
|
10103
10260
|
}, undefined, false, undefined, this)
|
|
@@ -10105,29 +10262,29 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10105
10262
|
}, undefined, true, undefined, this)
|
|
10106
10263
|
]
|
|
10107
10264
|
}, undefined, true, undefined, this),
|
|
10108
|
-
/* @__PURE__ */
|
|
10265
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
10109
10266
|
marginTop: 1,
|
|
10110
|
-
children: /* @__PURE__ */
|
|
10267
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10111
10268
|
color: colors.textDim,
|
|
10112
10269
|
children: [
|
|
10113
10270
|
"Save configuration? ",
|
|
10114
|
-
/* @__PURE__ */
|
|
10271
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10115
10272
|
color: colors.success,
|
|
10116
10273
|
children: "[Y]es"
|
|
10117
10274
|
}, undefined, false, undefined, this),
|
|
10118
10275
|
" / ",
|
|
10119
|
-
/* @__PURE__ */
|
|
10276
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10120
10277
|
color: colors.error,
|
|
10121
10278
|
children: "[N]o"
|
|
10122
10279
|
}, undefined, false, undefined, this)
|
|
10123
10280
|
]
|
|
10124
10281
|
}, undefined, true, undefined, this)
|
|
10125
10282
|
}, undefined, false, undefined, this),
|
|
10126
|
-
saving && /* @__PURE__ */
|
|
10283
|
+
saving && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10127
10284
|
color: colors.primary,
|
|
10128
10285
|
children: "Saving..."
|
|
10129
10286
|
}, undefined, false, undefined, this),
|
|
10130
|
-
error && /* @__PURE__ */
|
|
10287
|
+
error && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10131
10288
|
color: colors.error,
|
|
10132
10289
|
children: [
|
|
10133
10290
|
icons.error,
|
|
@@ -10137,10 +10294,10 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10137
10294
|
}, undefined, true, undefined, this)
|
|
10138
10295
|
]
|
|
10139
10296
|
}, undefined, true, undefined, this),
|
|
10140
|
-
step === "complete" && /* @__PURE__ */
|
|
10297
|
+
step === "complete" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
10141
10298
|
flexDirection: "column",
|
|
10142
10299
|
children: [
|
|
10143
|
-
/* @__PURE__ */
|
|
10300
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10144
10301
|
color: colors.success,
|
|
10145
10302
|
bold: true,
|
|
10146
10303
|
children: [
|
|
@@ -10148,15 +10305,15 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10148
10305
|
" Setup Complete!"
|
|
10149
10306
|
]
|
|
10150
10307
|
}, undefined, true, undefined, this),
|
|
10151
|
-
/* @__PURE__ */
|
|
10308
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
10152
10309
|
marginTop: 1,
|
|
10153
10310
|
flexDirection: "column",
|
|
10154
10311
|
children: [
|
|
10155
|
-
/* @__PURE__ */
|
|
10312
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10156
10313
|
color: colors.textMuted,
|
|
10157
10314
|
children: "Configuration saved to:"
|
|
10158
10315
|
}, undefined, false, undefined, this),
|
|
10159
|
-
/* @__PURE__ */
|
|
10316
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10160
10317
|
color: colors.text,
|
|
10161
10318
|
children: [
|
|
10162
10319
|
" ",
|
|
@@ -10164,7 +10321,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10164
10321
|
"/config.json"
|
|
10165
10322
|
]
|
|
10166
10323
|
}, undefined, true, undefined, this),
|
|
10167
|
-
/* @__PURE__ */
|
|
10324
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10168
10325
|
color: colors.text,
|
|
10169
10326
|
children: [
|
|
10170
10327
|
" ",
|
|
@@ -10174,11 +10331,11 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10174
10331
|
}, undefined, true, undefined, this)
|
|
10175
10332
|
]
|
|
10176
10333
|
}, undefined, true, undefined, this),
|
|
10177
|
-
state.enableBeads && /* @__PURE__ */
|
|
10334
|
+
state.enableBeads && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
10178
10335
|
marginTop: 1,
|
|
10179
10336
|
flexDirection: "column",
|
|
10180
10337
|
children: [
|
|
10181
|
-
beadsInstallStatus === "installed" && /* @__PURE__ */
|
|
10338
|
+
beadsInstallStatus === "installed" && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10182
10339
|
color: colors.success,
|
|
10183
10340
|
children: [
|
|
10184
10341
|
icons.success,
|
|
@@ -10186,7 +10343,7 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10186
10343
|
beadsVersion ? ` — ${beadsVersion}` : ""
|
|
10187
10344
|
]
|
|
10188
10345
|
}, undefined, true, undefined, this),
|
|
10189
|
-
beadsInstallStatus === "skipped" && /* @__PURE__ */
|
|
10346
|
+
beadsInstallStatus === "skipped" && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10190
10347
|
color: colors.textMuted,
|
|
10191
10348
|
children: [
|
|
10192
10349
|
icons.success,
|
|
@@ -10194,25 +10351,25 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10194
10351
|
beadsVersion ? ` — ${beadsVersion}` : ""
|
|
10195
10352
|
]
|
|
10196
10353
|
}, undefined, true, undefined, this),
|
|
10197
|
-
beadsInstallStatus === "failed" && /* @__PURE__ */
|
|
10354
|
+
beadsInstallStatus === "failed" && /* @__PURE__ */ jsxDEV14(Fragment2, {
|
|
10198
10355
|
children: [
|
|
10199
|
-
/* @__PURE__ */
|
|
10356
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10200
10357
|
color: colors.warning,
|
|
10201
10358
|
children: "⚠ Beads (bd) install failed. Install manually:"
|
|
10202
10359
|
}, undefined, false, undefined, this),
|
|
10203
|
-
/* @__PURE__ */
|
|
10360
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10204
10361
|
color: colors.text,
|
|
10205
10362
|
children: " curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash"
|
|
10206
10363
|
}, undefined, false, undefined, this),
|
|
10207
|
-
/* @__PURE__ */
|
|
10364
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10208
10365
|
color: colors.textDim,
|
|
10209
10366
|
children: " Or: npm install -g @beads/bd"
|
|
10210
10367
|
}, undefined, false, undefined, this),
|
|
10211
|
-
/* @__PURE__ */
|
|
10368
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10212
10369
|
color: colors.textDim,
|
|
10213
10370
|
children: " Or: brew install beads"
|
|
10214
10371
|
}, undefined, false, undefined, this),
|
|
10215
|
-
beadsInstallError && /* @__PURE__ */
|
|
10372
|
+
beadsInstallError && /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10216
10373
|
color: colors.textDim,
|
|
10217
10374
|
children: [
|
|
10218
10375
|
" Error: ",
|
|
@@ -10223,63 +10380,63 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10223
10380
|
}, undefined, true, undefined, this)
|
|
10224
10381
|
]
|
|
10225
10382
|
}, undefined, true, undefined, this),
|
|
10226
|
-
/* @__PURE__ */
|
|
10383
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
10227
10384
|
marginTop: 1,
|
|
10228
10385
|
flexDirection: "column",
|
|
10229
|
-
children: state.authMethod === "azure-identity" ? /* @__PURE__ */
|
|
10386
|
+
children: state.authMethod === "azure-identity" ? /* @__PURE__ */ jsxDEV14(Fragment2, {
|
|
10230
10387
|
children: [
|
|
10231
|
-
/* @__PURE__ */
|
|
10388
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10232
10389
|
color: colors.textMuted,
|
|
10233
10390
|
children: "Using Azure Identity — ensure you're logged in:"
|
|
10234
10391
|
}, undefined, false, undefined, this),
|
|
10235
|
-
/* @__PURE__ */
|
|
10392
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10236
10393
|
color: colors.text,
|
|
10237
10394
|
children: [
|
|
10238
10395
|
" • Run: ",
|
|
10239
|
-
/* @__PURE__ */
|
|
10396
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10240
10397
|
color: colors.primary,
|
|
10241
10398
|
children: "az login"
|
|
10242
10399
|
}, undefined, false, undefined, this)
|
|
10243
10400
|
]
|
|
10244
10401
|
}, undefined, true, undefined, this)
|
|
10245
10402
|
]
|
|
10246
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
10403
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV14(Fragment2, {
|
|
10247
10404
|
children: [
|
|
10248
|
-
/* @__PURE__ */
|
|
10405
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10249
10406
|
color: colors.textMuted,
|
|
10250
10407
|
children: "To load credentials, either:"
|
|
10251
10408
|
}, undefined, false, undefined, this),
|
|
10252
|
-
/* @__PURE__ */
|
|
10409
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10253
10410
|
color: colors.text,
|
|
10254
10411
|
children: [
|
|
10255
10412
|
" • Source the env file: ",
|
|
10256
|
-
/* @__PURE__ */
|
|
10413
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10257
10414
|
color: colors.primary,
|
|
10258
10415
|
children: "source ~/.sharkbait/.env"
|
|
10259
10416
|
}, undefined, false, undefined, this)
|
|
10260
10417
|
]
|
|
10261
10418
|
}, undefined, true, undefined, this),
|
|
10262
|
-
/* @__PURE__ */
|
|
10419
|
+
/* @__PURE__ */ jsxDEV14(Text14, {
|
|
10263
10420
|
color: colors.text,
|
|
10264
10421
|
children: " • Or copy to your project's .env file"
|
|
10265
10422
|
}, undefined, false, undefined, this)
|
|
10266
10423
|
]
|
|
10267
10424
|
}, undefined, true, undefined, this)
|
|
10268
10425
|
}, undefined, false, undefined, this),
|
|
10269
|
-
/* @__PURE__ */
|
|
10426
|
+
/* @__PURE__ */ jsxDEV14(Box14, {
|
|
10270
10427
|
marginTop: 1,
|
|
10271
|
-
children: /* @__PURE__ */
|
|
10428
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10272
10429
|
color: colors.textDim,
|
|
10273
10430
|
children: "Press Enter to start coding..."
|
|
10274
10431
|
}, undefined, false, undefined, this)
|
|
10275
10432
|
}, undefined, false, undefined, this)
|
|
10276
10433
|
]
|
|
10277
10434
|
}, undefined, true, undefined, this),
|
|
10278
|
-
step !== "welcome" && step !== "complete" && /* @__PURE__ */
|
|
10435
|
+
step !== "welcome" && step !== "complete" && /* @__PURE__ */ jsxDEV14(Box14, {
|
|
10279
10436
|
marginTop: 2,
|
|
10280
|
-
children: /* @__PURE__ */
|
|
10437
|
+
children: /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10281
10438
|
color: colors.textDim,
|
|
10282
|
-
children: ["azure-endpoint", "auth-method", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */
|
|
10439
|
+
children: ["azure-endpoint", "auth-method", "azure-key", "azure-deployment", "working-dir", "features", "confirm"].map((s, i) => /* @__PURE__ */ jsxDEV14(Text14, {
|
|
10283
10440
|
color: step === s ? colors.primary : colors.textDim,
|
|
10284
10441
|
children: [
|
|
10285
10442
|
step === s ? "●" : "○",
|
|
@@ -10294,13 +10451,13 @@ function SetupWizardWithCallback({ onComplete }) {
|
|
|
10294
10451
|
async function runSetup() {
|
|
10295
10452
|
let setupCompleted = false;
|
|
10296
10453
|
function SetupWizardWrapper() {
|
|
10297
|
-
return
|
|
10454
|
+
return React14.createElement(SetupWizardWithCallback, {
|
|
10298
10455
|
onComplete: () => {
|
|
10299
10456
|
setupCompleted = true;
|
|
10300
10457
|
}
|
|
10301
10458
|
});
|
|
10302
10459
|
}
|
|
10303
|
-
const { waitUntilExit } = render2(
|
|
10460
|
+
const { waitUntilExit } = render2(React14.createElement(SetupWizardWrapper));
|
|
10304
10461
|
await waitUntilExit();
|
|
10305
10462
|
return setupCompleted;
|
|
10306
10463
|
}
|
|
@@ -10431,11 +10588,12 @@ ${"━".repeat(60)}`);
|
|
|
10431
10588
|
}
|
|
10432
10589
|
|
|
10433
10590
|
// src/version.ts
|
|
10434
|
-
var VERSION2 = "1.0.
|
|
10591
|
+
var VERSION2 = "1.0.29";
|
|
10435
10592
|
|
|
10436
10593
|
// src/ui/logo.tsx
|
|
10437
|
-
import {
|
|
10438
|
-
import {
|
|
10594
|
+
import { memo as memo12 } from "react";
|
|
10595
|
+
import { Box as Box15, Text as Text15 } from "ink";
|
|
10596
|
+
import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
|
|
10439
10597
|
var SHARK_LOGO2 = `
|
|
10440
10598
|
+.+++.
|
|
10441
10599
|
## ....-### -
|
|
@@ -10464,6 +10622,51 @@ var SHARK_LOGO2 = `
|
|
|
10464
10622
|
#. .+. ..- +. .###-
|
|
10465
10623
|
#-. + #
|
|
10466
10624
|
`.trimEnd();
|
|
10625
|
+
var Logo3 = memo12(function Logo4({ variant = "full", version = "0.0.0" }) {
|
|
10626
|
+
const logoText = variant === "inline" ? "" : SHARK_LOGO2;
|
|
10627
|
+
return /* @__PURE__ */ jsxDEV15(Box15, {
|
|
10628
|
+
flexDirection: "column",
|
|
10629
|
+
alignItems: "center",
|
|
10630
|
+
children: [
|
|
10631
|
+
/* @__PURE__ */ jsxDEV15(Text15, {
|
|
10632
|
+
color: colors.primary,
|
|
10633
|
+
children: logoText
|
|
10634
|
+
}, undefined, false, undefined, this),
|
|
10635
|
+
variant !== "inline" && /* @__PURE__ */ jsxDEV15(Box15, {
|
|
10636
|
+
marginTop: 0,
|
|
10637
|
+
children: [
|
|
10638
|
+
/* @__PURE__ */ jsxDEV15(Text15, {
|
|
10639
|
+
bold: true,
|
|
10640
|
+
color: colors.primary,
|
|
10641
|
+
children: "SHARKBAIT"
|
|
10642
|
+
}, undefined, false, undefined, this),
|
|
10643
|
+
/* @__PURE__ */ jsxDEV15(Text15, {
|
|
10644
|
+
color: colors.textMuted,
|
|
10645
|
+
children: [
|
|
10646
|
+
" v",
|
|
10647
|
+
version
|
|
10648
|
+
]
|
|
10649
|
+
}, undefined, true, undefined, this)
|
|
10650
|
+
]
|
|
10651
|
+
}, undefined, true, undefined, this)
|
|
10652
|
+
]
|
|
10653
|
+
}, undefined, true, undefined, this);
|
|
10654
|
+
});
|
|
10655
|
+
var InlineLogo3 = memo12(function InlineLogo4() {
|
|
10656
|
+
return /* @__PURE__ */ jsxDEV15(Text15, {
|
|
10657
|
+
children: [
|
|
10658
|
+
/* @__PURE__ */ jsxDEV15(Text15, {
|
|
10659
|
+
color: colors.primary,
|
|
10660
|
+
children: "\uD83E\uDD88"
|
|
10661
|
+
}, undefined, false, undefined, this),
|
|
10662
|
+
/* @__PURE__ */ jsxDEV15(Text15, {
|
|
10663
|
+
bold: true,
|
|
10664
|
+
color: colors.primary,
|
|
10665
|
+
children: " sharkbait"
|
|
10666
|
+
}, undefined, false, undefined, this)
|
|
10667
|
+
]
|
|
10668
|
+
}, undefined, true, undefined, this);
|
|
10669
|
+
});
|
|
10467
10670
|
|
|
10468
10671
|
// src/cli.ts
|
|
10469
10672
|
import { existsSync as existsSync8 } from "fs";
|