@trydecember/cli 0.2.23 → 0.2.25
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/december.js +1461 -901
- package/package.json +1 -1
package/dist/december.js
CHANGED
|
@@ -103245,15 +103245,12 @@ Interrupted · What should December do instead?`,
|
|
|
103245
103245
|
}
|
|
103246
103246
|
if (errorMsg.includes("402") || errorMsg.toLowerCase().includes("insufficient credits")) {
|
|
103247
103247
|
errorMsg = `Insufficient credits in December Wallet. Please add credits at https://trydecember.com/settings/billing to continue using December Cloud.
|
|
103248
|
-
|
|
103249
103248
|
` + errorMsg;
|
|
103250
103249
|
} else if (errorMsg.includes("429") || errorMsg.toLowerCase().includes("quota") || errorMsg.toLowerCase().includes("rate limit")) {
|
|
103251
103250
|
errorMsg = `Rate limit or quota exhausted from LLM provider. Please upgrade your API key tier with your provider (OpenAI, Anthropic, Gemini) or switch to December Cloud Subscription at https://trydecember.com/pricing
|
|
103252
|
-
|
|
103253
103251
|
` + errorMsg;
|
|
103254
103252
|
} else if (errorMsg.includes("503") || errorMsg.includes("529") || errorMsg.toLowerCase().includes("high demand") || errorMsg.toLowerCase().includes("overloaded") || errorMsg.toLowerCase().includes("capacity")) {
|
|
103255
103253
|
errorMsg = `This model is currently experiencing high demand or capacity limits from the provider. Spikes in demand are usually temporary. Please try again in a few moments or switch to a different model at https://trydecember.com/pricing
|
|
103256
|
-
|
|
103257
103254
|
` + errorMsg;
|
|
103258
103255
|
}
|
|
103259
103256
|
eventQueue.push({ type: "AgentError", error: errorMsg });
|
|
@@ -103460,8 +103457,8 @@ ${rule.content}
|
|
|
103460
103457
|
try {
|
|
103461
103458
|
const candidateFiles = [
|
|
103462
103459
|
path7.join(this.config.workspaceDir, "AGENTS.md"),
|
|
103463
|
-
path7.join(this.config.workspaceDir, ".december", "
|
|
103464
|
-
path7.join(this.config.workspaceDir, ".december", "
|
|
103460
|
+
path7.join(this.config.workspaceDir, ".december", "rules.md"),
|
|
103461
|
+
path7.join(this.config.workspaceDir, ".december", "AGENTS.md")
|
|
103465
103462
|
];
|
|
103466
103463
|
for (const rulePath of candidateFiles) {
|
|
103467
103464
|
if (fs6.existsSync(rulePath)) {
|
|
@@ -169267,6 +169264,12 @@ var init_commands = __esm(() => {
|
|
|
169267
169264
|
ctx.exit();
|
|
169268
169265
|
}
|
|
169269
169266
|
},
|
|
169267
|
+
{
|
|
169268
|
+
name: "feedback",
|
|
169269
|
+
description: "Submit feedback, report a bug, or request a feature",
|
|
169270
|
+
value: "/feedback",
|
|
169271
|
+
action: (ctx) => {}
|
|
169272
|
+
},
|
|
169270
169273
|
{
|
|
169271
169274
|
name: "fork",
|
|
169272
169275
|
description: "Create a branch of the current conversation at this point",
|
|
@@ -169380,26 +169383,31 @@ var init_commands = __esm(() => {
|
|
|
169380
169383
|
},
|
|
169381
169384
|
{
|
|
169382
169385
|
name: "init",
|
|
169383
|
-
description: "Create
|
|
169386
|
+
description: "Create initial rules, skills, and AGENTS.md configuration",
|
|
169384
169387
|
value: "/init",
|
|
169385
169388
|
action: (ctx) => {
|
|
169386
169389
|
try {
|
|
169387
169390
|
const rootDir = process.cwd();
|
|
169388
169391
|
const decDir = path8.join(rootDir, ".december");
|
|
169389
|
-
|
|
169392
|
+
const agentsFile = path8.join(rootDir, "AGENTS.md");
|
|
169393
|
+
const rulesFile = path8.join(decDir, "rules.md");
|
|
169394
|
+
const skillsFile = path8.join(decDir, "skills.md");
|
|
169395
|
+
if (fs9.existsSync(agentsFile) && fs9.existsSync(rulesFile) && fs9.existsSync(skillsFile)) {
|
|
169390
169396
|
ctx.toast.show({ message: "December workspace is already initialized." });
|
|
169391
169397
|
return;
|
|
169392
169398
|
}
|
|
169393
169399
|
fs9.mkdirSync(decDir, { recursive: true });
|
|
169394
|
-
|
|
169395
|
-
|
|
169396
|
-
|
|
169397
|
-
fs9.
|
|
169398
|
-
`
|
|
169399
|
-
fs9.writeFileSync(rulesFile, `# Rules
|
|
169400
|
+
if (!fs9.existsSync(agentsFile)) {
|
|
169401
|
+
fs9.writeFileSync(agentsFile, "");
|
|
169402
|
+
}
|
|
169403
|
+
if (!fs9.existsSync(rulesFile)) {
|
|
169404
|
+
fs9.writeFileSync(rulesFile, `Add rules in this file for the agent to use as context.
|
|
169400
169405
|
`);
|
|
169401
|
-
|
|
169406
|
+
}
|
|
169407
|
+
if (!fs9.existsSync(skillsFile)) {
|
|
169408
|
+
fs9.writeFileSync(skillsFile, `Add skills in this file for the agent to use as context.
|
|
169402
169409
|
`);
|
|
169410
|
+
}
|
|
169403
169411
|
ctx.toast.show({
|
|
169404
169412
|
variant: "success",
|
|
169405
169413
|
message: "Initialized December workspace successfully!"
|
|
@@ -169879,23 +169887,20 @@ var init_shortcuts_menu = __esm(async () => {
|
|
|
169879
169887
|
{ key: "ctrl+k", desc: "Delete to end" },
|
|
169880
169888
|
{ key: "ctrl+u", desc: "Delete to start" },
|
|
169881
169889
|
{ key: "ctrl+w", desc: "Delete word" },
|
|
169882
|
-
{ key: "up/down", desc: "Input history" },
|
|
169883
169890
|
{ key: "ctrl+y", desc: "Quick copy (yank)" },
|
|
169884
|
-
{ key: "ctrl+c", desc: "Exit / Graceful interrupt" }
|
|
169891
|
+
{ key: "ctrl+c", desc: "Exit / Graceful interrupt" },
|
|
169892
|
+
{ key: "ctrl+h", desc: "Session history" },
|
|
169893
|
+
{ key: "ctrl+l", desc: "Login / Account menu" },
|
|
169894
|
+
{ key: "ctrl+o", desc: "Toggle expand commands" },
|
|
169895
|
+
{ key: "ctrl+t", desc: "Tasks mode" },
|
|
169896
|
+
{ key: "alt+enter", desc: "Insert newline" },
|
|
169897
|
+
{ key: "esc", desc: "Cancel / Close menu" }
|
|
169885
169898
|
];
|
|
169886
169899
|
});
|
|
169887
169900
|
|
|
169888
169901
|
// ../../packages/tui/src/components/text-area.tsx
|
|
169889
|
-
function TextArea({
|
|
169890
|
-
value,
|
|
169891
|
-
onChange,
|
|
169892
|
-
onSubmit,
|
|
169893
|
-
placeholder = "",
|
|
169894
|
-
focus = true,
|
|
169895
|
-
history = []
|
|
169896
|
-
}) {
|
|
169902
|
+
function TextArea({ value, onChange, onSubmit, placeholder = "", focus = true }) {
|
|
169897
169903
|
const [cursorOffset, setCursorOffset] = import_react40.useState(value.length);
|
|
169898
|
-
const [historyIndex, setHistoryIndex] = import_react40.useState(-1);
|
|
169899
169904
|
import_react40.useEffect(() => {
|
|
169900
169905
|
if (cursorOffset > value.length) {
|
|
169901
169906
|
setCursorOffset(value.length);
|
|
@@ -169912,7 +169917,6 @@ function TextArea({
|
|
|
169912
169917
|
setCursorOffset((prev2) => prev2 + 1);
|
|
169913
169918
|
} else {
|
|
169914
169919
|
onSubmit(value);
|
|
169915
|
-
setHistoryIndex(-1);
|
|
169916
169920
|
}
|
|
169917
169921
|
return;
|
|
169918
169922
|
}
|
|
@@ -169934,17 +169938,7 @@ function TextArea({
|
|
|
169934
169938
|
const newOffset = cursorOffset - currentLineLength - 1 - (prevLineLength - newCol);
|
|
169935
169939
|
setCursorOffset(Math.max(0, newOffset));
|
|
169936
169940
|
} else {
|
|
169937
|
-
|
|
169938
|
-
const nextIdx = Math.min(history.length - 1, historyIndex + 1);
|
|
169939
|
-
if (nextIdx !== historyIndex) {
|
|
169940
|
-
setHistoryIndex(nextIdx);
|
|
169941
|
-
const hVal = history[history.length - 1 - nextIdx] || "";
|
|
169942
|
-
onChange(hVal);
|
|
169943
|
-
setCursorOffset(hVal.length);
|
|
169944
|
-
}
|
|
169945
|
-
} else {
|
|
169946
|
-
setCursorOffset(0);
|
|
169947
|
-
}
|
|
169941
|
+
setCursorOffset(0);
|
|
169948
169942
|
}
|
|
169949
169943
|
return;
|
|
169950
169944
|
}
|
|
@@ -169961,15 +169955,7 @@ function TextArea({
|
|
|
169961
169955
|
const newOffset = cursorOffset + postLineZeroLength + 1 + newCol;
|
|
169962
169956
|
setCursorOffset(Math.min(value.length, newOffset));
|
|
169963
169957
|
} else {
|
|
169964
|
-
|
|
169965
|
-
const nextIdx = historyIndex - 1;
|
|
169966
|
-
setHistoryIndex(nextIdx);
|
|
169967
|
-
const hVal = nextIdx >= 0 ? history[history.length - 1 - nextIdx] || "" : "";
|
|
169968
|
-
onChange(hVal);
|
|
169969
|
-
setCursorOffset(hVal.length);
|
|
169970
|
-
} else {
|
|
169971
|
-
setCursorOffset(value.length);
|
|
169972
|
-
}
|
|
169958
|
+
setCursorOffset(value.length);
|
|
169973
169959
|
}
|
|
169974
169960
|
return;
|
|
169975
169961
|
}
|
|
@@ -170053,9 +170039,9 @@ function InputBar({
|
|
|
170053
170039
|
onInterrupt,
|
|
170054
170040
|
onCopy,
|
|
170055
170041
|
contextTokens,
|
|
170056
|
-
history,
|
|
170057
170042
|
showExitConfirm = false,
|
|
170058
|
-
toasts
|
|
170043
|
+
toasts,
|
|
170044
|
+
queuedPrompts
|
|
170059
170045
|
}) {
|
|
170060
170046
|
const [value, setValue] = import_react41.useState("");
|
|
170061
170047
|
const toast = useToast();
|
|
@@ -170116,10 +170102,15 @@ function InputBar({
|
|
|
170116
170102
|
const handleCommand = import_react41.useCallback((command) => {
|
|
170117
170103
|
if (!command)
|
|
170118
170104
|
return;
|
|
170105
|
+
const currentValue = value.trim();
|
|
170119
170106
|
setValue("");
|
|
170120
170107
|
handleContentChange("");
|
|
170121
|
-
if (command.value === "/grill-me" || command.value === "/login" || command.value === "/logout" || command.value === "/exit" || command.value === "/model" || command.value === "/resume" || command.value === "/settings" || command.value === "/context" || command.value === "/tasks" || command.value === "/usage") {
|
|
170122
|
-
|
|
170108
|
+
if (command.value === "/grill-me" || command.value === "/login" || command.value === "/logout" || command.value === "/exit" || command.value === "/model" || command.value === "/resume" || command.value === "/settings" || command.value === "/context" || command.value === "/tasks" || command.value === "/usage" || command.value === "/feedback") {
|
|
170109
|
+
if (currentValue.length > command.value.length && currentValue.toLowerCase().startsWith(command.value.toLowerCase())) {
|
|
170110
|
+
onSubmit(currentValue);
|
|
170111
|
+
} else {
|
|
170112
|
+
onSubmit(command.value);
|
|
170113
|
+
}
|
|
170123
170114
|
return;
|
|
170124
170115
|
}
|
|
170125
170116
|
if (command.action) {
|
|
@@ -170171,6 +170162,17 @@ function InputBar({
|
|
|
170171
170162
|
close: dialog.close
|
|
170172
170163
|
}, undefined, false, undefined, this)
|
|
170173
170164
|
}, undefined, false, undefined, this),
|
|
170165
|
+
queuedPrompts && queuedPrompts.length > 0 && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
170166
|
+
width: "100%",
|
|
170167
|
+
marginBottom: 0,
|
|
170168
|
+
children: /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text3, {
|
|
170169
|
+
color: "#89B4F8",
|
|
170170
|
+
children: [
|
|
170171
|
+
`Queued (${queuedPrompts.length}): "${queuedPrompts[0]}"`,
|
|
170172
|
+
queuedPrompts.length > 1 ? ` (+${queuedPrompts.length - 1} more)` : ""
|
|
170173
|
+
]
|
|
170174
|
+
}, undefined, true, undefined, this)
|
|
170175
|
+
}, undefined, false, undefined, this),
|
|
170174
170176
|
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
170175
170177
|
overflow: "hidden",
|
|
170176
170178
|
height: 1,
|
|
@@ -170198,8 +170200,7 @@ function InputBar({
|
|
|
170198
170200
|
onChange: handleChange,
|
|
170199
170201
|
onSubmit: handleSubmit,
|
|
170200
170202
|
placeholder: customInputMode ? "Type your custom answer..." : grillMode ? "" : placeholder,
|
|
170201
|
-
focus: !disabled && !dialog.isOpen
|
|
170202
|
-
history
|
|
170203
|
+
focus: !disabled && !dialog.isOpen
|
|
170203
170204
|
}, undefined, false, undefined, this)
|
|
170204
170205
|
]
|
|
170205
170206
|
}, undefined, true, undefined, this),
|
|
@@ -170213,7 +170214,7 @@ function InputBar({
|
|
|
170213
170214
|
children: sep4
|
|
170214
170215
|
}, undefined, false, undefined, this)
|
|
170215
170216
|
}, undefined, false, undefined, this),
|
|
170216
|
-
!showCommandMenu && !showShortcutsMenu && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
170217
|
+
!showCommandMenu && !showShortcutsMenu && !authUI && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Box_default, {
|
|
170217
170218
|
width: "100%",
|
|
170218
170219
|
justifyContent: "space-between",
|
|
170219
170220
|
children: [
|
|
@@ -170229,7 +170230,7 @@ function InputBar({
|
|
|
170229
170230
|
color: "#AAAAAA",
|
|
170230
170231
|
children: [
|
|
170231
170232
|
activeModel,
|
|
170232
|
-
hasBothAuth && authMethod ? ` (
|
|
170233
|
+
hasBothAuth && authMethod ? ` (${authMethod === "december" ? "December Cloud" : "BYOK"})` : ""
|
|
170233
170234
|
]
|
|
170234
170235
|
}, undefined, true, undefined, this),
|
|
170235
170236
|
activeToast ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Text3, {
|
|
@@ -214462,114 +214463,611 @@ var init_marked_esm = __esm(() => {
|
|
|
214462
214463
|
Yt = x2.lex;
|
|
214463
214464
|
});
|
|
214464
214465
|
|
|
214465
|
-
// ../../packages/tui/src/components/
|
|
214466
|
-
function
|
|
214467
|
-
const
|
|
214468
|
-
|
|
214466
|
+
// ../../packages/tui/src/components/mermaid.tsx
|
|
214467
|
+
function parseFlowchart(code) {
|
|
214468
|
+
const lines = code.split(/\r?\n/);
|
|
214469
|
+
let direction = "TD";
|
|
214470
|
+
const nodesMap = new Map;
|
|
214471
|
+
const edges = [];
|
|
214472
|
+
for (const rawLine of lines) {
|
|
214473
|
+
const line = rawLine.trim();
|
|
214474
|
+
if (!line || line.startsWith("%%"))
|
|
214475
|
+
continue;
|
|
214476
|
+
if (line.startsWith("graph") || line.startsWith("flowchart")) {
|
|
214477
|
+
const parts = line.split(/\s+/);
|
|
214478
|
+
if (parts.length > 1) {
|
|
214479
|
+
const dir = parts[1].toUpperCase();
|
|
214480
|
+
if (dir === "LR" || dir === "RL" || dir === "TD" || dir === "TB" || dir === "BT") {
|
|
214481
|
+
direction = dir;
|
|
214482
|
+
}
|
|
214483
|
+
}
|
|
214484
|
+
continue;
|
|
214485
|
+
}
|
|
214486
|
+
const edgeRegex = /^([A-Za-z0-9_]+)(?:\[(.*?)\]|\((.*?)\)|\{(.*?)\})?\s*(\-\-\>|\-\-\-|\=\=\>|\-\.\-\>)(?:\|(.*?)\|)?\s*([A-Za-z0-9_]+)(?:\[(.*?)\]|\((.*?)\)|\{(.*?)\})?/;
|
|
214487
|
+
const match2 = line.match(edgeRegex);
|
|
214488
|
+
if (match2) {
|
|
214489
|
+
const fromId = match2[1];
|
|
214490
|
+
const fromLabel = match2[2] || match2[3] || match2[4] || fromId;
|
|
214491
|
+
const arrow = match2[5];
|
|
214492
|
+
const edgeLabel = match2[6];
|
|
214493
|
+
const toId = match2[7];
|
|
214494
|
+
const toLabel = match2[8] || match2[9] || match2[10] || toId;
|
|
214495
|
+
if (!nodesMap.has(fromId)) {
|
|
214496
|
+
nodesMap.set(fromId, {
|
|
214497
|
+
id: fromId,
|
|
214498
|
+
label: fromLabel,
|
|
214499
|
+
shape: match2[2] ? "box" : match2[3] ? "round" : match2[4] ? "diamond" : "box"
|
|
214500
|
+
});
|
|
214501
|
+
}
|
|
214502
|
+
if (!nodesMap.has(toId)) {
|
|
214503
|
+
nodesMap.set(toId, {
|
|
214504
|
+
id: toId,
|
|
214505
|
+
label: toLabel,
|
|
214506
|
+
shape: match2[8] ? "box" : match2[9] ? "round" : match2[10] ? "diamond" : "box"
|
|
214507
|
+
});
|
|
214508
|
+
}
|
|
214509
|
+
edges.push({
|
|
214510
|
+
from: fromId,
|
|
214511
|
+
to: toId,
|
|
214512
|
+
label: edgeLabel,
|
|
214513
|
+
style: arrow === "==>" ? "thick" : arrow === "-.->" ? "dashed" : "solid"
|
|
214514
|
+
});
|
|
214515
|
+
continue;
|
|
214516
|
+
}
|
|
214517
|
+
const nodeRegex = /^([A-Za-z0-9_]+)(?:\[(.*?)\]|\((.*?)\)|\{(.*?)\})/;
|
|
214518
|
+
const nodeMatch = line.match(nodeRegex);
|
|
214519
|
+
if (nodeMatch) {
|
|
214520
|
+
const id = nodeMatch[1];
|
|
214521
|
+
const label = nodeMatch[2] || nodeMatch[3] || nodeMatch[4] || id;
|
|
214522
|
+
if (!nodesMap.has(id)) {
|
|
214523
|
+
nodesMap.set(id, {
|
|
214524
|
+
id,
|
|
214525
|
+
label,
|
|
214526
|
+
shape: nodeMatch[2] ? "box" : nodeMatch[3] ? "round" : nodeMatch[4] ? "diamond" : "box"
|
|
214527
|
+
});
|
|
214528
|
+
}
|
|
214529
|
+
}
|
|
214530
|
+
}
|
|
214531
|
+
return { direction, nodes: Array.from(nodesMap.values()), edges };
|
|
214532
|
+
}
|
|
214533
|
+
function parseSequence(code) {
|
|
214534
|
+
const lines = code.split(/\r?\n/);
|
|
214535
|
+
const participantsSet = new Set;
|
|
214536
|
+
const messages = [];
|
|
214537
|
+
for (const rawLine of lines) {
|
|
214538
|
+
const line = rawLine.trim();
|
|
214539
|
+
if (!line || line.startsWith("%%") || line.startsWith("sequenceDiagram"))
|
|
214540
|
+
continue;
|
|
214541
|
+
if (line.startsWith("participant ")) {
|
|
214542
|
+
const name = line.replace("participant ", "").trim();
|
|
214543
|
+
participantsSet.add(name);
|
|
214544
|
+
continue;
|
|
214545
|
+
}
|
|
214546
|
+
const msgMatch = line.match(/^([A-Za-z0-9_]+)\s*(\-\>\>|\-\-\>\>|\-\>)\s*([A-Za-z0-9_]+)\s*:\s*(.*)$/);
|
|
214547
|
+
if (msgMatch) {
|
|
214548
|
+
const from = msgMatch[1];
|
|
214549
|
+
const arrow = msgMatch[2];
|
|
214550
|
+
const to = msgMatch[3];
|
|
214551
|
+
const text3 = msgMatch[4];
|
|
214552
|
+
participantsSet.add(from);
|
|
214553
|
+
participantsSet.add(to);
|
|
214554
|
+
messages.push({
|
|
214555
|
+
from,
|
|
214556
|
+
to,
|
|
214557
|
+
text: text3,
|
|
214558
|
+
style: arrow.includes("--") ? "dashed" : "solid"
|
|
214559
|
+
});
|
|
214560
|
+
}
|
|
214561
|
+
}
|
|
214562
|
+
return { participants: Array.from(participantsSet), messages };
|
|
214563
|
+
}
|
|
214564
|
+
function parsePie(code) {
|
|
214565
|
+
const lines = code.split(/\r?\n/);
|
|
214566
|
+
let title = "Chart";
|
|
214567
|
+
const slices = [];
|
|
214568
|
+
for (const rawLine of lines) {
|
|
214569
|
+
const line = rawLine.trim();
|
|
214570
|
+
if (!line || line.startsWith("%%"))
|
|
214571
|
+
continue;
|
|
214572
|
+
if (line.startsWith("pie")) {
|
|
214573
|
+
if (line.includes("title ")) {
|
|
214574
|
+
title = line.split("title ")[1].trim();
|
|
214575
|
+
}
|
|
214576
|
+
continue;
|
|
214577
|
+
}
|
|
214578
|
+
const sliceMatch = line.match(/^"([^"]+)"\s*:\s*([0-9.]+)/);
|
|
214579
|
+
if (sliceMatch) {
|
|
214580
|
+
slices.push({
|
|
214581
|
+
label: sliceMatch[1],
|
|
214582
|
+
value: parseFloat(sliceMatch[2])
|
|
214583
|
+
});
|
|
214584
|
+
}
|
|
214585
|
+
}
|
|
214586
|
+
return { title, slices };
|
|
214587
|
+
}
|
|
214588
|
+
function Mermaid({ code }) {
|
|
214589
|
+
const { isFocused } = use_focus_default({ autoFocus: true });
|
|
214590
|
+
const [showRaw, setShowRaw] = import_react43.useState(false);
|
|
214469
214591
|
use_input_default((input, key) => {
|
|
214470
|
-
if (
|
|
214471
|
-
|
|
214592
|
+
if (key.ctrl && (key.name === "o" || input?.toLowerCase() === "o") || input === "\x0F") {
|
|
214593
|
+
setShowRaw((prev2) => !prev2);
|
|
214472
214594
|
}
|
|
214473
214595
|
});
|
|
214474
|
-
const
|
|
214475
|
-
|
|
214476
|
-
const
|
|
214477
|
-
const
|
|
214478
|
-
const barWidth = 60;
|
|
214479
|
-
const topBarLength = Math.max(0, barWidth - lang.length - 4);
|
|
214480
|
-
const topBar = `┌── ${lang} ${"─".repeat(topBarLength)}`;
|
|
214481
|
-
const bottomBar = `└${"─".repeat(barWidth - 1)}`;
|
|
214482
|
-
let contentToHighlight = token.text;
|
|
214483
|
-
if (isLarge && !expanded) {
|
|
214484
|
-
contentToHighlight = lines.slice(0, 15).join(`
|
|
214485
|
-
`);
|
|
214486
|
-
}
|
|
214487
|
-
const highlighted = import_react43.default.useMemo(() => {
|
|
214488
|
-
return import_cli_highlight.highlight(contentToHighlight, {
|
|
214489
|
-
language: lang,
|
|
214490
|
-
ignoreIllegals: true
|
|
214491
|
-
});
|
|
214492
|
-
}, [contentToHighlight, lang]);
|
|
214596
|
+
const firstLine = code.split(/\r?\n/).map((l3) => l3.trim()).find((l3) => l3.length > 0 && !l3.startsWith("%%")) || "";
|
|
214597
|
+
const isSequence = firstLine.startsWith("sequenceDiagram");
|
|
214598
|
+
const isPie = firstLine.startsWith("pie");
|
|
214599
|
+
const isFlowchart = firstLine.startsWith("graph") || firstLine.startsWith("flowchart");
|
|
214493
214600
|
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214494
214601
|
flexDirection: "column",
|
|
214602
|
+
paddingX: 2,
|
|
214495
214603
|
paddingY: 1,
|
|
214604
|
+
borderStyle: "round",
|
|
214605
|
+
borderColor: "#A78BFA",
|
|
214496
214606
|
children: [
|
|
214497
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214498
|
-
color: isFocused ? "#89B4F8" : "#475569",
|
|
214499
|
-
children: topBar
|
|
214500
|
-
}, undefined, false, undefined, this),
|
|
214501
214607
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214608
|
+
justifyContent: "space-between",
|
|
214609
|
+
alignItems: "center",
|
|
214610
|
+
marginBottom: 1,
|
|
214611
|
+
children: [
|
|
214612
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214613
|
+
color: "#A78BFA",
|
|
214614
|
+
bold: true,
|
|
214615
|
+
children: [
|
|
214616
|
+
"❖ Mermaid Diagram (",
|
|
214617
|
+
isSequence ? "sequence" : isPie ? "pie" : isFlowchart ? "flowchart" : "diagram",
|
|
214618
|
+
")"
|
|
214619
|
+
]
|
|
214620
|
+
}, undefined, true, undefined, this),
|
|
214621
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214622
|
+
color: "gray",
|
|
214623
|
+
children: [
|
|
214624
|
+
"(",
|
|
214625
|
+
showRaw ? "ctrl+o for visual" : "ctrl+o for code",
|
|
214626
|
+
")"
|
|
214627
|
+
]
|
|
214628
|
+
}, undefined, true, undefined, this)
|
|
214629
|
+
]
|
|
214630
|
+
}, undefined, true, undefined, this),
|
|
214631
|
+
showRaw ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214502
214632
|
flexDirection: "column",
|
|
214503
|
-
paddingLeft:
|
|
214633
|
+
paddingLeft: 1,
|
|
214504
214634
|
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214505
|
-
|
|
214635
|
+
color: "#AAAAAA",
|
|
214636
|
+
children: code
|
|
214506
214637
|
}, undefined, false, undefined, this)
|
|
214638
|
+
}, undefined, false, undefined, this) : isSequence ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(RenderSequence, {
|
|
214639
|
+
code
|
|
214640
|
+
}, undefined, false, undefined, this) : isPie ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(RenderPie, {
|
|
214641
|
+
code
|
|
214642
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(RenderFlowchart, {
|
|
214643
|
+
code
|
|
214644
|
+
}, undefined, false, undefined, this)
|
|
214645
|
+
]
|
|
214646
|
+
}, undefined, true, undefined, this);
|
|
214647
|
+
}
|
|
214648
|
+
function RenderFlowchart({ code }) {
|
|
214649
|
+
const { direction, nodes, edges } = parseFlowchart(code);
|
|
214650
|
+
if (nodes.length === 0) {
|
|
214651
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214652
|
+
color: "#AAAAAA",
|
|
214653
|
+
children: code
|
|
214654
|
+
}, undefined, false, undefined, this);
|
|
214655
|
+
}
|
|
214656
|
+
const isLR = direction === "LR" || direction === "RL";
|
|
214657
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214658
|
+
flexDirection: "column",
|
|
214659
|
+
gap: 1,
|
|
214660
|
+
children: [
|
|
214661
|
+
isLR ? /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214662
|
+
flexDirection: "row",
|
|
214663
|
+
flexWrap: "wrap",
|
|
214664
|
+
alignItems: "center",
|
|
214665
|
+
gap: 1,
|
|
214666
|
+
children: nodes.map((node2, i2) => {
|
|
214667
|
+
const outgoingEdges = edges.filter((e2) => e2.from === node2.id);
|
|
214668
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(import_react43.default.Fragment, {
|
|
214669
|
+
children: [
|
|
214670
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214671
|
+
borderStyle: "round",
|
|
214672
|
+
borderColor: "#89B4F8",
|
|
214673
|
+
paddingX: 1,
|
|
214674
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214675
|
+
bold: true,
|
|
214676
|
+
color: "white",
|
|
214677
|
+
children: node2.label
|
|
214678
|
+
}, undefined, false, undefined, this)
|
|
214679
|
+
}, undefined, false, undefined, this),
|
|
214680
|
+
outgoingEdges.length > 0 && i2 < nodes.length - 1 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214681
|
+
flexDirection: "column",
|
|
214682
|
+
alignItems: "center",
|
|
214683
|
+
children: [
|
|
214684
|
+
outgoingEdges[0].label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214685
|
+
color: "#A78BFA",
|
|
214686
|
+
italic: true,
|
|
214687
|
+
children: [
|
|
214688
|
+
"[",
|
|
214689
|
+
outgoingEdges[0].label,
|
|
214690
|
+
"]"
|
|
214691
|
+
]
|
|
214692
|
+
}, undefined, true, undefined, this),
|
|
214693
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214694
|
+
color: "#89B4F8",
|
|
214695
|
+
children: outgoingEdges[0].style === "dashed" ? " ┈► " : outgoingEdges[0].style === "thick" ? " ══► " : " ──► "
|
|
214696
|
+
}, undefined, false, undefined, this)
|
|
214697
|
+
]
|
|
214698
|
+
}, undefined, true, undefined, this)
|
|
214699
|
+
]
|
|
214700
|
+
}, node2.id, true, undefined, this);
|
|
214701
|
+
})
|
|
214702
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214703
|
+
flexDirection: "column",
|
|
214704
|
+
alignItems: "flex-start",
|
|
214705
|
+
gap: 0,
|
|
214706
|
+
children: nodes.map((node2, i2) => {
|
|
214707
|
+
const outgoingEdges = edges.filter((e2) => e2.from === node2.id);
|
|
214708
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214709
|
+
flexDirection: "column",
|
|
214710
|
+
children: [
|
|
214711
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214712
|
+
borderStyle: "round",
|
|
214713
|
+
borderColor: "#89B4F8",
|
|
214714
|
+
paddingX: 1,
|
|
214715
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214716
|
+
bold: true,
|
|
214717
|
+
color: "white",
|
|
214718
|
+
children: node2.label
|
|
214719
|
+
}, undefined, false, undefined, this)
|
|
214720
|
+
}, undefined, false, undefined, this),
|
|
214721
|
+
outgoingEdges.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214722
|
+
flexDirection: "column",
|
|
214723
|
+
paddingLeft: 3,
|
|
214724
|
+
children: [
|
|
214725
|
+
outgoingEdges[0].label && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214726
|
+
color: "#A78BFA",
|
|
214727
|
+
italic: true,
|
|
214728
|
+
children: [
|
|
214729
|
+
"[",
|
|
214730
|
+
outgoingEdges[0].label,
|
|
214731
|
+
"]"
|
|
214732
|
+
]
|
|
214733
|
+
}, undefined, true, undefined, this),
|
|
214734
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214735
|
+
color: "#89B4F8",
|
|
214736
|
+
children: outgoingEdges[0].style === "dashed" ? ` ┆
|
|
214737
|
+
▼ ` : ` │
|
|
214738
|
+
▼ `
|
|
214739
|
+
}, undefined, false, undefined, this)
|
|
214740
|
+
]
|
|
214741
|
+
}, undefined, true, undefined, this)
|
|
214742
|
+
]
|
|
214743
|
+
}, node2.id, true, undefined, this);
|
|
214744
|
+
})
|
|
214507
214745
|
}, undefined, false, undefined, this),
|
|
214508
|
-
|
|
214746
|
+
edges.length > 0 && /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214509
214747
|
flexDirection: "column",
|
|
214510
|
-
|
|
214748
|
+
marginTop: 1,
|
|
214749
|
+
paddingLeft: 1,
|
|
214511
214750
|
children: [
|
|
214512
214751
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214513
|
-
color: "
|
|
214514
|
-
|
|
214752
|
+
color: "gray",
|
|
214753
|
+
bold: true,
|
|
214754
|
+
children: "Connections:"
|
|
214515
214755
|
}, undefined, false, undefined, this),
|
|
214516
|
-
|
|
214517
|
-
|
|
214518
|
-
|
|
214519
|
-
|
|
214756
|
+
edges.map((edge, idx) => {
|
|
214757
|
+
const fromNode = nodes.find((n) => n.id === edge.from)?.label || edge.from;
|
|
214758
|
+
const toNode = nodes.find((n) => n.id === edge.to)?.label || edge.to;
|
|
214759
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214760
|
+
color: "#CCCCCC",
|
|
214761
|
+
children: [
|
|
214762
|
+
"• ",
|
|
214763
|
+
fromNode,
|
|
214764
|
+
" ",
|
|
214765
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214766
|
+
color: "#89B4F8",
|
|
214767
|
+
children: edge.style === "dashed" ? "┈►" : "──►"
|
|
214768
|
+
}, undefined, false, undefined, this),
|
|
214769
|
+
" ",
|
|
214770
|
+
toNode,
|
|
214771
|
+
edge.label ? ` (${edge.label})` : ""
|
|
214772
|
+
]
|
|
214773
|
+
}, idx, true, undefined, this);
|
|
214774
|
+
})
|
|
214520
214775
|
]
|
|
214521
|
-
}, undefined, true, undefined, this)
|
|
214776
|
+
}, undefined, true, undefined, this)
|
|
214777
|
+
]
|
|
214778
|
+
}, undefined, true, undefined, this);
|
|
214779
|
+
}
|
|
214780
|
+
function RenderSequence({ code }) {
|
|
214781
|
+
const { participants, messages } = parseSequence(code);
|
|
214782
|
+
if (participants.length === 0) {
|
|
214783
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214784
|
+
color: "#AAAAAA",
|
|
214785
|
+
children: code
|
|
214786
|
+
}, undefined, false, undefined, this);
|
|
214787
|
+
}
|
|
214788
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214789
|
+
flexDirection: "column",
|
|
214790
|
+
gap: 1,
|
|
214791
|
+
children: [
|
|
214792
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214793
|
+
flexDirection: "row",
|
|
214794
|
+
gap: 2,
|
|
214795
|
+
children: participants.map((p) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214796
|
+
borderStyle: "single",
|
|
214797
|
+
borderColor: "#89B4F8",
|
|
214798
|
+
paddingX: 1,
|
|
214799
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214800
|
+
bold: true,
|
|
214801
|
+
color: "white",
|
|
214802
|
+
children: p
|
|
214803
|
+
}, undefined, false, undefined, this)
|
|
214804
|
+
}, p, false, undefined, this))
|
|
214805
|
+
}, undefined, false, undefined, this),
|
|
214806
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214522
214807
|
flexDirection: "column",
|
|
214523
|
-
paddingLeft:
|
|
214524
|
-
|
|
214525
|
-
|
|
214526
|
-
|
|
214527
|
-
|
|
214528
|
-
|
|
214808
|
+
paddingLeft: 1,
|
|
214809
|
+
marginTop: 1,
|
|
214810
|
+
children: messages.map((msg, idx) => /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214811
|
+
color: "#DDDDDD",
|
|
214812
|
+
children: [
|
|
214813
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214814
|
+
color: "#89B4F8",
|
|
214815
|
+
bold: true,
|
|
214816
|
+
children: msg.from
|
|
214817
|
+
}, undefined, false, undefined, this),
|
|
214818
|
+
" ",
|
|
214819
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214820
|
+
color: msg.style === "dashed" ? "#A78BFA" : "#89B4F8",
|
|
214821
|
+
children: msg.style === "dashed" ? "◄┄┄" : "──►"
|
|
214822
|
+
}, undefined, false, undefined, this),
|
|
214823
|
+
" ",
|
|
214824
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214825
|
+
color: "#89B4F8",
|
|
214826
|
+
bold: true,
|
|
214827
|
+
children: msg.to
|
|
214828
|
+
}, undefined, false, undefined, this),
|
|
214829
|
+
": ",
|
|
214830
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214831
|
+
color: "white",
|
|
214832
|
+
children: msg.text
|
|
214833
|
+
}, undefined, false, undefined, this)
|
|
214834
|
+
]
|
|
214835
|
+
}, idx, true, undefined, this))
|
|
214836
|
+
}, undefined, false, undefined, this)
|
|
214837
|
+
]
|
|
214838
|
+
}, undefined, true, undefined, this);
|
|
214839
|
+
}
|
|
214840
|
+
function RenderPie({ code }) {
|
|
214841
|
+
const { title, slices } = parsePie(code);
|
|
214842
|
+
const total = slices.reduce((sum2, s2) => sum2 + s2.value, 0);
|
|
214843
|
+
if (slices.length === 0) {
|
|
214844
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214845
|
+
color: "#AAAAAA",
|
|
214846
|
+
children: code
|
|
214847
|
+
}, undefined, false, undefined, this);
|
|
214848
|
+
}
|
|
214849
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214850
|
+
flexDirection: "column",
|
|
214851
|
+
gap: 1,
|
|
214852
|
+
children: [
|
|
214529
214853
|
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214530
|
-
|
|
214531
|
-
|
|
214854
|
+
bold: true,
|
|
214855
|
+
color: "white",
|
|
214856
|
+
children: title
|
|
214857
|
+
}, undefined, false, undefined, this),
|
|
214858
|
+
slices.map((slice3, idx) => {
|
|
214859
|
+
const percentage = total > 0 ? Math.round(slice3.value / total * 100) : 0;
|
|
214860
|
+
const filledWidth = Math.round(percentage / 100 * 20);
|
|
214861
|
+
const emptyWidth = 20 - filledWidth;
|
|
214862
|
+
const bar = "█".repeat(filledWidth) + "░".repeat(emptyWidth);
|
|
214863
|
+
const color = idx % 2 === 0 ? "#89B4F8" : "#A78BFA";
|
|
214864
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214865
|
+
flexDirection: "row",
|
|
214866
|
+
gap: 2,
|
|
214867
|
+
children: [
|
|
214868
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Box_default, {
|
|
214869
|
+
width: 15,
|
|
214870
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214871
|
+
color: "white",
|
|
214872
|
+
children: slice3.label
|
|
214873
|
+
}, undefined, false, undefined, this)
|
|
214874
|
+
}, undefined, false, undefined, this),
|
|
214875
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214876
|
+
color,
|
|
214877
|
+
children: bar
|
|
214878
|
+
}, undefined, false, undefined, this),
|
|
214879
|
+
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214880
|
+
color: "gray",
|
|
214881
|
+
children: [
|
|
214882
|
+
percentage,
|
|
214883
|
+
"%"
|
|
214884
|
+
]
|
|
214885
|
+
}, undefined, true, undefined, this)
|
|
214886
|
+
]
|
|
214887
|
+
}, idx, true, undefined, this);
|
|
214888
|
+
})
|
|
214889
|
+
]
|
|
214890
|
+
}, undefined, true, undefined, this);
|
|
214891
|
+
}
|
|
214892
|
+
var import_react43, jsx_dev_runtime9;
|
|
214893
|
+
var init_mermaid = __esm(async () => {
|
|
214894
|
+
await init_build2();
|
|
214895
|
+
import_react43 = __toESM(require_react(), 1);
|
|
214896
|
+
jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
214897
|
+
});
|
|
214898
|
+
|
|
214899
|
+
// ../../packages/tui/src/components/markdown.tsx
|
|
214900
|
+
function renderTableCell(cell, index2) {
|
|
214901
|
+
if (cell?.tokens && Array.isArray(cell.tokens)) {
|
|
214902
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214903
|
+
children: cell.tokens.map((t2, i2) => renderToken(t2, i2))
|
|
214904
|
+
}, index2, false, undefined, this);
|
|
214905
|
+
}
|
|
214906
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214907
|
+
children: cell?.text || cell?.raw || ""
|
|
214908
|
+
}, index2, false, undefined, this);
|
|
214909
|
+
}
|
|
214910
|
+
function getCellTextLength(cell) {
|
|
214911
|
+
if (!cell)
|
|
214912
|
+
return 0;
|
|
214913
|
+
if (typeof cell === "string")
|
|
214914
|
+
return cell.length;
|
|
214915
|
+
if (cell.text)
|
|
214916
|
+
return cell.text.length;
|
|
214917
|
+
if (cell.tokens && Array.isArray(cell.tokens)) {
|
|
214918
|
+
return cell.tokens.reduce((acc, t2) => acc + (t2.text?.length || t2.raw?.length || 0), 0);
|
|
214919
|
+
}
|
|
214920
|
+
return cell.raw?.length || 0;
|
|
214921
|
+
}
|
|
214922
|
+
function Table({ token }) {
|
|
214923
|
+
const headers = token.header || [];
|
|
214924
|
+
const rows = token.rows || [];
|
|
214925
|
+
if (headers.length === 0 && rows.length === 0) {
|
|
214926
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214927
|
+
children: token.raw
|
|
214928
|
+
}, undefined, false, undefined, this);
|
|
214929
|
+
}
|
|
214930
|
+
const colCount = Math.max(headers.length, ...rows.map((r2) => r2.length));
|
|
214931
|
+
const colWidths = [];
|
|
214932
|
+
for (let c = 0;c < colCount; c++) {
|
|
214933
|
+
let maxLen = headers[c] ? getCellTextLength(headers[c]) : 0;
|
|
214934
|
+
for (const row of rows) {
|
|
214935
|
+
if (row[c]) {
|
|
214936
|
+
maxLen = Math.max(maxLen, getCellTextLength(row[c]));
|
|
214937
|
+
}
|
|
214938
|
+
}
|
|
214939
|
+
colWidths[c] = Math.min(Math.max(maxLen, 3), 40);
|
|
214940
|
+
}
|
|
214941
|
+
const topBorder = `┌${colWidths.map((w2) => "─".repeat(w2 + 2)).join("┬")}┐`;
|
|
214942
|
+
const headerSep = `├${colWidths.map((w2) => "─".repeat(w2 + 2)).join("┼")}┤`;
|
|
214943
|
+
const bottomBorder = `└${colWidths.map((w2) => "─".repeat(w2 + 2)).join("┴")}┘`;
|
|
214944
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214945
|
+
flexDirection: "column",
|
|
214946
|
+
marginY: 1,
|
|
214947
|
+
children: [
|
|
214948
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214949
|
+
color: "#555555",
|
|
214950
|
+
children: topBorder
|
|
214951
|
+
}, undefined, false, undefined, this),
|
|
214952
|
+
headers.length > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(jsx_dev_runtime10.Fragment, {
|
|
214953
|
+
children: [
|
|
214954
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214955
|
+
flexDirection: "row",
|
|
214956
|
+
children: [
|
|
214957
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214958
|
+
color: "#555555",
|
|
214959
|
+
children: "│"
|
|
214960
|
+
}, undefined, false, undefined, this),
|
|
214961
|
+
headers.map((cell, c) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_react44.default.Fragment, {
|
|
214962
|
+
children: [
|
|
214963
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214964
|
+
width: colWidths[c] + 2,
|
|
214965
|
+
paddingX: 1,
|
|
214966
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214967
|
+
bold: true,
|
|
214968
|
+
color: "white",
|
|
214969
|
+
children: renderTableCell(cell, c)
|
|
214970
|
+
}, undefined, false, undefined, this)
|
|
214971
|
+
}, undefined, false, undefined, this),
|
|
214972
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214973
|
+
color: "#555555",
|
|
214974
|
+
children: "│"
|
|
214975
|
+
}, undefined, false, undefined, this)
|
|
214976
|
+
]
|
|
214977
|
+
}, c, true, undefined, this))
|
|
214978
|
+
]
|
|
214979
|
+
}, undefined, true, undefined, this),
|
|
214980
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214981
|
+
color: "#555555",
|
|
214982
|
+
children: headerSep
|
|
214983
|
+
}, undefined, false, undefined, this)
|
|
214984
|
+
]
|
|
214985
|
+
}, undefined, true, undefined, this),
|
|
214986
|
+
rows.map((row, r2) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214987
|
+
flexDirection: "row",
|
|
214988
|
+
children: [
|
|
214989
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214990
|
+
color: "#555555",
|
|
214991
|
+
children: "│"
|
|
214992
|
+
}, undefined, false, undefined, this),
|
|
214993
|
+
row.map((cell, c) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(import_react44.default.Fragment, {
|
|
214994
|
+
children: [
|
|
214995
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214996
|
+
width: colWidths[c] + 2,
|
|
214997
|
+
paddingX: 1,
|
|
214998
|
+
children: renderTableCell(cell, c)
|
|
214999
|
+
}, undefined, false, undefined, this),
|
|
215000
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
215001
|
+
color: "#555555",
|
|
215002
|
+
children: "│"
|
|
215003
|
+
}, undefined, false, undefined, this)
|
|
215004
|
+
]
|
|
215005
|
+
}, c, true, undefined, this))
|
|
215006
|
+
]
|
|
215007
|
+
}, r2, true, undefined, this)),
|
|
215008
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
215009
|
+
color: "#555555",
|
|
215010
|
+
children: bottomBorder
|
|
214532
215011
|
}, undefined, false, undefined, this)
|
|
214533
215012
|
]
|
|
214534
215013
|
}, undefined, true, undefined, this);
|
|
214535
215014
|
}
|
|
215015
|
+
function CodeBlock({ token }) {
|
|
215016
|
+
const lang = token.lang || "typescript";
|
|
215017
|
+
const highlighted = import_react44.default.useMemo(() => {
|
|
215018
|
+
if (!token.text)
|
|
215019
|
+
return "";
|
|
215020
|
+
return import_cli_highlight.highlight(token.text, {
|
|
215021
|
+
language: lang,
|
|
215022
|
+
ignoreIllegals: true
|
|
215023
|
+
});
|
|
215024
|
+
}, [token.text, lang]);
|
|
215025
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
215026
|
+
flexDirection: "column",
|
|
215027
|
+
paddingY: 1,
|
|
215028
|
+
paddingLeft: 2,
|
|
215029
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
215030
|
+
children: highlighted
|
|
215031
|
+
}, undefined, false, undefined, this)
|
|
215032
|
+
}, undefined, false, undefined, this);
|
|
215033
|
+
}
|
|
214536
215034
|
function Markdown({ children: children2 }) {
|
|
214537
215035
|
if (!children2)
|
|
214538
215036
|
return null;
|
|
214539
215037
|
const tokens = g.lexer(children2).filter((t2) => t2.type !== "space");
|
|
214540
|
-
return /* @__PURE__ */
|
|
215038
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214541
215039
|
flexDirection: "column",
|
|
214542
215040
|
gap: 1,
|
|
214543
215041
|
children: tokens.map((token, index2) => renderToken(token, index2))
|
|
214544
215042
|
}, undefined, false, undefined, this);
|
|
214545
215043
|
}
|
|
214546
|
-
var import_cli_highlight,
|
|
215044
|
+
var import_cli_highlight, import_react44, jsx_dev_runtime10, renderToken = (token, index2) => {
|
|
214547
215045
|
switch (token.type) {
|
|
214548
215046
|
case "paragraph":
|
|
214549
|
-
return /* @__PURE__ */
|
|
215047
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214550
215048
|
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
214551
215049
|
}, index2, false, undefined, this);
|
|
214552
215050
|
case "text":
|
|
214553
215051
|
if ("tokens" in token && token.tokens) {
|
|
214554
|
-
return /* @__PURE__ */
|
|
215052
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214555
215053
|
children: token.tokens.map((t2, i2) => renderToken(t2, i2))
|
|
214556
215054
|
}, index2, false, undefined, this);
|
|
214557
215055
|
}
|
|
214558
|
-
return /* @__PURE__ */
|
|
215056
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214559
215057
|
children: token.text || token.raw
|
|
214560
215058
|
}, index2, false, undefined, this);
|
|
214561
215059
|
case "strong":
|
|
214562
|
-
return /* @__PURE__ */
|
|
215060
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214563
215061
|
bold: true,
|
|
214564
215062
|
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
214565
215063
|
}, index2, false, undefined, this);
|
|
214566
215064
|
case "em":
|
|
214567
|
-
return /* @__PURE__ */
|
|
215065
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214568
215066
|
italic: true,
|
|
214569
215067
|
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
214570
215068
|
}, index2, false, undefined, this);
|
|
214571
215069
|
case "codespan":
|
|
214572
|
-
return /* @__PURE__ */
|
|
215070
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214573
215071
|
backgroundColor: "#303030",
|
|
214574
215072
|
color: "#89B4F8",
|
|
214575
215073
|
bold: false,
|
|
@@ -214583,40 +215081,25 @@ var import_cli_highlight, import_react43, jsx_dev_runtime9, renderToken = (token
|
|
|
214583
215081
|
return null;
|
|
214584
215082
|
case "code":
|
|
214585
215083
|
if (token.lang === "mermaid") {
|
|
214586
|
-
return /* @__PURE__ */
|
|
214587
|
-
|
|
214588
|
-
|
|
214589
|
-
paddingY: 1,
|
|
214590
|
-
borderStyle: "round",
|
|
214591
|
-
borderColor: "#A78BFA",
|
|
214592
|
-
children: [
|
|
214593
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214594
|
-
color: "#A78BFA",
|
|
214595
|
-
bold: true,
|
|
214596
|
-
children: "Mermaid Diagram"
|
|
214597
|
-
}, undefined, false, undefined, this),
|
|
214598
|
-
/* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214599
|
-
color: "#AAAAAA",
|
|
214600
|
-
children: token.text
|
|
214601
|
-
}, undefined, false, undefined, this)
|
|
214602
|
-
]
|
|
214603
|
-
}, index2, true, undefined, this);
|
|
215084
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Mermaid, {
|
|
215085
|
+
code: token.text
|
|
215086
|
+
}, index2, false, undefined, this);
|
|
214604
215087
|
}
|
|
214605
|
-
return /* @__PURE__ */
|
|
215088
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(CodeBlock, {
|
|
214606
215089
|
token
|
|
214607
215090
|
}, index2, false, undefined, this);
|
|
214608
215091
|
case "list":
|
|
214609
|
-
return /* @__PURE__ */
|
|
215092
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214610
215093
|
flexDirection: "column",
|
|
214611
215094
|
paddingLeft: 1,
|
|
214612
|
-
children: token.items.map((item, i2) => /* @__PURE__ */
|
|
215095
|
+
children: token.items.map((item, i2) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214613
215096
|
flexDirection: "row",
|
|
214614
215097
|
children: [
|
|
214615
|
-
/* @__PURE__ */
|
|
215098
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214616
215099
|
color: "gray",
|
|
214617
215100
|
children: "• "
|
|
214618
215101
|
}, undefined, false, undefined, this),
|
|
214619
|
-
/* @__PURE__ */
|
|
215102
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
214620
215103
|
flexDirection: "column",
|
|
214621
215104
|
children: item.tokens.map((t2, j2) => renderToken(t2, j2))
|
|
214622
215105
|
}, undefined, false, undefined, this)
|
|
@@ -214624,67 +215107,76 @@ var import_cli_highlight, import_react43, jsx_dev_runtime9, renderToken = (token
|
|
|
214624
215107
|
}, i2, true, undefined, this))
|
|
214625
215108
|
}, index2, false, undefined, this);
|
|
214626
215109
|
case "heading":
|
|
214627
|
-
return /* @__PURE__ */
|
|
214628
|
-
children: /* @__PURE__ */
|
|
215110
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
215111
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214629
215112
|
bold: true,
|
|
214630
215113
|
color: "white",
|
|
214631
|
-
underline: true,
|
|
214632
215114
|
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
214633
215115
|
}, undefined, false, undefined, this)
|
|
214634
215116
|
}, index2, false, undefined, this);
|
|
214635
215117
|
case "link":
|
|
214636
|
-
return /* @__PURE__ */
|
|
214637
|
-
color: "
|
|
215118
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
215119
|
+
color: "#89B4F8",
|
|
214638
215120
|
underline: true,
|
|
214639
215121
|
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
214640
215122
|
}, index2, false, undefined, this);
|
|
215123
|
+
case "hr":
|
|
215124
|
+
return null;
|
|
215125
|
+
case "blockquote":
|
|
215126
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
215127
|
+
borderStyle: "single",
|
|
215128
|
+
borderLeft: true,
|
|
215129
|
+
borderRight: false,
|
|
215130
|
+
borderTop: false,
|
|
215131
|
+
borderBottom: false,
|
|
215132
|
+
borderColor: "#89B4F8",
|
|
215133
|
+
paddingLeft: 1,
|
|
215134
|
+
children: token.tokens?.map((t2, i2) => renderToken(t2, i2))
|
|
215135
|
+
}, index2, false, undefined, this);
|
|
214641
215136
|
case "html":
|
|
214642
|
-
return /* @__PURE__ */
|
|
215137
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214643
215138
|
children: token.text
|
|
214644
215139
|
}, index2, false, undefined, this);
|
|
214645
215140
|
case "escape":
|
|
214646
|
-
return /* @__PURE__ */
|
|
215141
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214647
215142
|
children: token.text
|
|
214648
215143
|
}, index2, false, undefined, this);
|
|
214649
215144
|
case "table":
|
|
214650
|
-
return /* @__PURE__ */
|
|
214651
|
-
|
|
214652
|
-
paddingY: 1,
|
|
214653
|
-
borderStyle: "round",
|
|
214654
|
-
borderColor: "#555555",
|
|
214655
|
-
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(Text3, {
|
|
214656
|
-
children: token.raw
|
|
214657
|
-
}, undefined, false, undefined, this)
|
|
215145
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Table, {
|
|
215146
|
+
token
|
|
214658
215147
|
}, index2, false, undefined, this);
|
|
214659
215148
|
default:
|
|
214660
|
-
return /* @__PURE__ */
|
|
215149
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text3, {
|
|
214661
215150
|
children: token.raw
|
|
214662
215151
|
}, index2, false, undefined, this);
|
|
214663
215152
|
}
|
|
214664
215153
|
};
|
|
214665
215154
|
var init_markdown = __esm(async () => {
|
|
214666
215155
|
init_marked_esm();
|
|
214667
|
-
await
|
|
215156
|
+
await __promiseAll([
|
|
215157
|
+
init_build2(),
|
|
215158
|
+
init_mermaid()
|
|
215159
|
+
]);
|
|
214668
215160
|
import_cli_highlight = __toESM(require_dist4(), 1);
|
|
214669
|
-
|
|
214670
|
-
|
|
215161
|
+
import_react44 = __toESM(require_react(), 1);
|
|
215162
|
+
jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
214671
215163
|
});
|
|
214672
215164
|
|
|
214673
215165
|
// ../../packages/tui/src/components/messages/smooth-markdown.tsx
|
|
214674
215166
|
function SmoothMarkdown({ text: text3, isRunning }) {
|
|
214675
|
-
return /* @__PURE__ */
|
|
215167
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Markdown, {
|
|
214676
215168
|
children: text3
|
|
214677
215169
|
}, undefined, false, undefined, this);
|
|
214678
215170
|
}
|
|
214679
|
-
var
|
|
215171
|
+
var jsx_dev_runtime11;
|
|
214680
215172
|
var init_smooth_markdown = __esm(async () => {
|
|
214681
215173
|
await init_markdown();
|
|
214682
|
-
|
|
215174
|
+
jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
|
|
214683
215175
|
});
|
|
214684
215176
|
|
|
214685
215177
|
// ../../packages/tui/src/components/messages/bot-message.tsx
|
|
214686
215178
|
function CollapsibleThought({ content, isStreaming }) {
|
|
214687
|
-
const [expanded, setExpanded] =
|
|
215179
|
+
const [expanded, setExpanded] = import_react45.useState(false);
|
|
214688
215180
|
const words2 = content.trim() ? content.trim().split(/\s+/).length : 0;
|
|
214689
215181
|
const tokenCount = Math.max(1, Math.round(words2 * 1.33));
|
|
214690
215182
|
use_input_default((input, key) => {
|
|
@@ -214693,20 +215185,20 @@ function CollapsibleThought({ content, isStreaming }) {
|
|
|
214693
215185
|
}
|
|
214694
215186
|
});
|
|
214695
215187
|
if (isStreaming) {
|
|
214696
|
-
return /* @__PURE__ */
|
|
215188
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214697
215189
|
flexDirection: "column",
|
|
214698
215190
|
marginY: 0.5,
|
|
214699
|
-
children: /* @__PURE__ */
|
|
215191
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214700
215192
|
color: "gray",
|
|
214701
215193
|
children: content
|
|
214702
215194
|
}, undefined, false, undefined, this)
|
|
214703
215195
|
}, undefined, false, undefined, this);
|
|
214704
215196
|
}
|
|
214705
|
-
return /* @__PURE__ */
|
|
215197
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214706
215198
|
flexDirection: "column",
|
|
214707
215199
|
marginY: 0.5,
|
|
214708
215200
|
children: [
|
|
214709
|
-
/* @__PURE__ */
|
|
215201
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214710
215202
|
color: "gray",
|
|
214711
215203
|
italic: true,
|
|
214712
215204
|
children: [
|
|
@@ -214717,10 +215209,10 @@ function CollapsibleThought({ content, isStreaming }) {
|
|
|
214717
215209
|
")"
|
|
214718
215210
|
]
|
|
214719
215211
|
}, undefined, true, undefined, this),
|
|
214720
|
-
expanded && /* @__PURE__ */
|
|
215212
|
+
expanded && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214721
215213
|
paddingLeft: 1,
|
|
214722
215214
|
paddingTop: 0.5,
|
|
214723
|
-
children: /* @__PURE__ */
|
|
215215
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214724
215216
|
color: "gray",
|
|
214725
215217
|
children: content
|
|
214726
215218
|
}, undefined, false, undefined, this)
|
|
@@ -214736,18 +215228,18 @@ function StyledCommand({ command, truncate: truncate3 = true }) {
|
|
|
214736
215228
|
args = args.substring(0, 80) + "...";
|
|
214737
215229
|
}
|
|
214738
215230
|
const cmdColor = "#fef08a";
|
|
214739
|
-
return /* @__PURE__ */
|
|
215231
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214740
215232
|
children: [
|
|
214741
|
-
/* @__PURE__ */
|
|
215233
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214742
215234
|
color: cmdColor,
|
|
214743
215235
|
children: "● "
|
|
214744
215236
|
}, undefined, false, undefined, this),
|
|
214745
|
-
/* @__PURE__ */
|
|
215237
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214746
215238
|
color: cmdColor,
|
|
214747
215239
|
bold: true,
|
|
214748
215240
|
children: match2[1]
|
|
214749
215241
|
}, undefined, false, undefined, this),
|
|
214750
|
-
/* @__PURE__ */
|
|
215242
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214751
215243
|
color: "#cbd5e1",
|
|
214752
215244
|
children: [
|
|
214753
215245
|
"(",
|
|
@@ -214762,7 +215254,7 @@ function StyledCommand({ command, truncate: truncate3 = true }) {
|
|
|
214762
215254
|
if (truncate3 && displayCmd.length > 80) {
|
|
214763
215255
|
displayCmd = displayCmd.substring(0, 80) + "...";
|
|
214764
215256
|
}
|
|
214765
|
-
return /* @__PURE__ */
|
|
215257
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214766
215258
|
color: "white",
|
|
214767
215259
|
children: displayCmd
|
|
214768
215260
|
}, undefined, false, undefined, this);
|
|
@@ -214773,7 +215265,7 @@ function CollapsibleCommandOutput({
|
|
|
214773
215265
|
forceExpanded
|
|
214774
215266
|
}) {
|
|
214775
215267
|
const { isFocused } = use_focus_default({ autoFocus: true });
|
|
214776
|
-
const [userExpanded, setUserExpanded] =
|
|
215268
|
+
const [userExpanded, setUserExpanded] = import_react45.useState(false);
|
|
214777
215269
|
const isExpanded = userExpanded || Boolean(forceExpanded);
|
|
214778
215270
|
use_input_default((input, key) => {
|
|
214779
215271
|
if (key.ctrl && (key.name === "o" || input?.toLowerCase() === "o") || input === "\x0F") {
|
|
@@ -214781,18 +215273,21 @@ function CollapsibleCommandOutput({
|
|
|
214781
215273
|
}
|
|
214782
215274
|
});
|
|
214783
215275
|
const lines = output ? output.trim().split(/\r?\n/) : [];
|
|
214784
|
-
|
|
215276
|
+
const MAX_VISIBLE_LINES = 20;
|
|
215277
|
+
const visibleLines = isExpanded ? lines.slice(0, MAX_VISIBLE_LINES) : [];
|
|
215278
|
+
const isTruncated = isExpanded && lines.length > MAX_VISIBLE_LINES;
|
|
215279
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214785
215280
|
flexDirection: "column",
|
|
214786
215281
|
marginY: 0,
|
|
214787
215282
|
children: [
|
|
214788
|
-
/* @__PURE__ */
|
|
215283
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214789
215284
|
alignItems: "center",
|
|
214790
215285
|
gap: 1,
|
|
214791
215286
|
children: [
|
|
214792
|
-
/* @__PURE__ */
|
|
215287
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StyledCommand, {
|
|
214793
215288
|
command
|
|
214794
215289
|
}, undefined, false, undefined, this),
|
|
214795
|
-
lines.length > 0 && /* @__PURE__ */
|
|
215290
|
+
lines.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214796
215291
|
color: "gray",
|
|
214797
215292
|
children: [
|
|
214798
215293
|
"(",
|
|
@@ -214802,44 +215297,68 @@ function CollapsibleCommandOutput({
|
|
|
214802
215297
|
}, undefined, true, undefined, this)
|
|
214803
215298
|
]
|
|
214804
215299
|
}, undefined, true, undefined, this),
|
|
214805
|
-
isExpanded && lines.length > 0 && /* @__PURE__ */
|
|
215300
|
+
isExpanded && lines.length > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214806
215301
|
flexDirection: "column",
|
|
214807
215302
|
marginTop: 0,
|
|
214808
215303
|
paddingX: 1,
|
|
214809
|
-
children:
|
|
214810
|
-
|
|
214811
|
-
|
|
214812
|
-
|
|
214813
|
-
|
|
214814
|
-
|
|
214815
|
-
|
|
214816
|
-
|
|
214817
|
-
|
|
214818
|
-
|
|
214819
|
-
|
|
214820
|
-
|
|
214821
|
-
|
|
214822
|
-
|
|
214823
|
-
|
|
214824
|
-
|
|
214825
|
-
|
|
214826
|
-
|
|
214827
|
-
|
|
214828
|
-
|
|
214829
|
-
|
|
214830
|
-
|
|
214831
|
-
|
|
215304
|
+
children: [
|
|
215305
|
+
visibleLines.map((line, lidx) => {
|
|
215306
|
+
let color = "#d1d5db";
|
|
215307
|
+
let bgColor = undefined;
|
|
215308
|
+
if (line.startsWith("+")) {
|
|
215309
|
+
color = "#6EE7B7";
|
|
215310
|
+
bgColor = "#122f1e";
|
|
215311
|
+
} else if (line.startsWith("-")) {
|
|
215312
|
+
color = "#FCA5A5";
|
|
215313
|
+
bgColor = "#3f1316";
|
|
215314
|
+
} else if (line.startsWith("@@") || line.startsWith("diff --git") || line.startsWith("---") || line.startsWith("+++")) {
|
|
215315
|
+
color = "#d1d5db";
|
|
215316
|
+
}
|
|
215317
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215318
|
+
backgroundColor: bgColor,
|
|
215319
|
+
flexDirection: "row",
|
|
215320
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215321
|
+
color,
|
|
215322
|
+
wrap: "truncate-end",
|
|
215323
|
+
children: line
|
|
215324
|
+
}, undefined, false, undefined, this)
|
|
215325
|
+
}, lidx, false, undefined, this);
|
|
215326
|
+
}),
|
|
215327
|
+
isTruncated && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215328
|
+
paddingTop: 0,
|
|
215329
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215330
|
+
color: "#AAAAAA",
|
|
215331
|
+
children: [
|
|
215332
|
+
"... (",
|
|
215333
|
+
lines.length - MAX_VISIBLE_LINES,
|
|
215334
|
+
" more lines)"
|
|
215335
|
+
]
|
|
215336
|
+
}, undefined, true, undefined, this)
|
|
215337
|
+
}, undefined, false, undefined, this)
|
|
215338
|
+
]
|
|
215339
|
+
}, undefined, true, undefined, this)
|
|
214832
215340
|
]
|
|
214833
215341
|
}, undefined, true, undefined, this);
|
|
214834
215342
|
}
|
|
214835
215343
|
function BotMessage({ blocks, usage, expandCommands }) {
|
|
214836
|
-
return /* @__PURE__ */
|
|
215344
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214837
215345
|
flexDirection: "column",
|
|
214838
215346
|
paddingX: 4,
|
|
214839
215347
|
paddingY: 0,
|
|
214840
215348
|
gap: 0,
|
|
214841
|
-
marginTop: 0
|
|
215349
|
+
marginTop: 0,
|
|
214842
215350
|
children: blocks.map((block, idx) => {
|
|
215351
|
+
let prevBlock = null;
|
|
215352
|
+
for (let i2 = idx - 1;i2 >= 0; i2--) {
|
|
215353
|
+
const b2 = blocks[i2];
|
|
215354
|
+
if (!b2)
|
|
215355
|
+
continue;
|
|
215356
|
+
if (b2.type === "text" && (!b2.content || b2.content.trim() === ""))
|
|
215357
|
+
continue;
|
|
215358
|
+
prevBlock = b2;
|
|
215359
|
+
break;
|
|
215360
|
+
}
|
|
215361
|
+
const needsTopMargin = Boolean(prevBlock && (prevBlock.type === "command" || prevBlock.type === "thinking" || prevBlock.type === "compaction"));
|
|
214843
215362
|
switch (block.type) {
|
|
214844
215363
|
case "text": {
|
|
214845
215364
|
if (!block.content || block.content.trim() === "")
|
|
@@ -214848,65 +215367,88 @@ function BotMessage({ blocks, usage, expandCommands }) {
|
|
|
214848
215367
|
if (isThinking) {
|
|
214849
215368
|
if (idx !== blocks.length - 1)
|
|
214850
215369
|
return null;
|
|
214851
|
-
return /* @__PURE__ */
|
|
214852
|
-
|
|
214853
|
-
alignItems: "center",
|
|
215370
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215371
|
+
flexDirection: "column",
|
|
214854
215372
|
children: [
|
|
214855
|
-
/* @__PURE__ */
|
|
214856
|
-
|
|
214857
|
-
|
|
214858
|
-
|
|
214859
|
-
|
|
215373
|
+
needsTopMargin && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215374
|
+
children: " "
|
|
215375
|
+
}, undefined, false, undefined, this),
|
|
215376
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215377
|
+
gap: 1,
|
|
215378
|
+
alignItems: "center",
|
|
215379
|
+
children: [
|
|
215380
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {}, undefined, false, undefined, this),
|
|
215381
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215382
|
+
color: "gray",
|
|
215383
|
+
children: block.content
|
|
215384
|
+
}, undefined, false, undefined, this)
|
|
215385
|
+
]
|
|
215386
|
+
}, undefined, true, undefined, this)
|
|
214860
215387
|
]
|
|
214861
215388
|
}, idx, true, undefined, this);
|
|
214862
215389
|
}
|
|
214863
215390
|
if (block.color) {
|
|
214864
|
-
return /* @__PURE__ */
|
|
214865
|
-
|
|
214866
|
-
|
|
214867
|
-
|
|
214868
|
-
|
|
214869
|
-
|
|
215391
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215392
|
+
flexDirection: "column",
|
|
215393
|
+
children: [
|
|
215394
|
+
needsTopMargin && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215395
|
+
children: " "
|
|
215396
|
+
}, undefined, false, undefined, this),
|
|
215397
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215398
|
+
color: block.color,
|
|
215399
|
+
children: block.content
|
|
215400
|
+
}, undefined, false, undefined, this)
|
|
215401
|
+
]
|
|
215402
|
+
}, idx, true, undefined, this);
|
|
214870
215403
|
}
|
|
214871
215404
|
const parts = block.content.split(/(<thought(?:>| [^>]*>)[\s\S]*?<\/thought>|<thought(?:>| [^>]*>)[\s\S]*)/i);
|
|
214872
|
-
return /* @__PURE__ */
|
|
215405
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214873
215406
|
flexDirection: "column",
|
|
214874
|
-
children:
|
|
214875
|
-
|
|
214876
|
-
|
|
214877
|
-
|
|
214878
|
-
|
|
214879
|
-
|
|
214880
|
-
|
|
214881
|
-
isStreaming
|
|
215407
|
+
children: [
|
|
215408
|
+
needsTopMargin && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215409
|
+
children: " "
|
|
215410
|
+
}, undefined, false, undefined, this),
|
|
215411
|
+
parts.map((part, pidx) => {
|
|
215412
|
+
if (/^<thought(?:>| [^>]*>)/i.test(part)) {
|
|
215413
|
+
const isClosed = /<\/thought>$/i.test(part);
|
|
215414
|
+
const isStreaming = !isClosed && idx === blocks.length - 1 && pidx === parts.length - 1;
|
|
215415
|
+
const thoughtContent = part.replace(/^<thought(?:>| [^>]*>)/i, "").replace(/<\/thought>$/i, "").trim();
|
|
215416
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CollapsibleThought, {
|
|
215417
|
+
content: thoughtContent,
|
|
215418
|
+
isStreaming
|
|
215419
|
+
}, pidx, false, undefined, this);
|
|
215420
|
+
}
|
|
215421
|
+
if (part.trim() === "")
|
|
215422
|
+
return null;
|
|
215423
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215424
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(SmoothMarkdown, {
|
|
215425
|
+
text: part.trim(),
|
|
215426
|
+
isRunning: true
|
|
215427
|
+
}, undefined, false, undefined, this)
|
|
214882
215428
|
}, pidx, false, undefined, this);
|
|
214883
|
-
}
|
|
214884
|
-
|
|
214885
|
-
|
|
214886
|
-
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
214887
|
-
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(SmoothMarkdown, {
|
|
214888
|
-
text: part.trim(),
|
|
214889
|
-
isRunning: true
|
|
214890
|
-
}, undefined, false, undefined, this)
|
|
214891
|
-
}, pidx, false, undefined, this);
|
|
214892
|
-
})
|
|
214893
|
-
}, idx, false, undefined, this);
|
|
215429
|
+
})
|
|
215430
|
+
]
|
|
215431
|
+
}, idx, true, undefined, this);
|
|
214894
215432
|
}
|
|
214895
215433
|
case "error": {
|
|
214896
|
-
return /* @__PURE__ */
|
|
215434
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214897
215435
|
flexDirection: "column",
|
|
214898
|
-
|
|
214899
|
-
|
|
214900
|
-
|
|
214901
|
-
|
|
214902
|
-
|
|
214903
|
-
|
|
215436
|
+
children: [
|
|
215437
|
+
needsTopMargin && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215438
|
+
children: " "
|
|
215439
|
+
}, undefined, false, undefined, this),
|
|
215440
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215441
|
+
color: "#FCA5A5",
|
|
215442
|
+
children: block.error
|
|
215443
|
+
}, undefined, false, undefined, this)
|
|
215444
|
+
]
|
|
215445
|
+
}, idx, true, undefined, this);
|
|
214904
215446
|
}
|
|
214905
215447
|
case "interrupt": {
|
|
214906
|
-
return /* @__PURE__ */
|
|
215448
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214907
215449
|
flexDirection: "row",
|
|
214908
215450
|
paddingY: 1,
|
|
214909
|
-
children: /* @__PURE__ */
|
|
215451
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214910
215452
|
color: "gray",
|
|
214911
215453
|
children: "Interrupted · What should December do instead?"
|
|
214912
215454
|
}, undefined, false, undefined, this)
|
|
@@ -214914,30 +215456,30 @@ function BotMessage({ blocks, usage, expandCommands }) {
|
|
|
214914
215456
|
}
|
|
214915
215457
|
case "thinking": {
|
|
214916
215458
|
const isStreaming = block.isStreaming ?? idx === blocks.length - 1;
|
|
214917
|
-
return /* @__PURE__ */
|
|
215459
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CollapsibleThought, {
|
|
214918
215460
|
content: block.content,
|
|
214919
215461
|
isStreaming
|
|
214920
215462
|
}, idx, false, undefined, this);
|
|
214921
215463
|
}
|
|
214922
215464
|
case "compaction": {
|
|
214923
|
-
return /* @__PURE__ */
|
|
215465
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214924
215466
|
flexDirection: "column",
|
|
214925
215467
|
paddingY: 1,
|
|
214926
215468
|
children: [
|
|
214927
|
-
/* @__PURE__ */
|
|
215469
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214928
215470
|
flexDirection: "row",
|
|
214929
215471
|
gap: 1,
|
|
214930
215472
|
alignItems: "center",
|
|
214931
|
-
children: /* @__PURE__ */
|
|
215473
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214932
215474
|
color: "#fef08a",
|
|
214933
215475
|
italic: true,
|
|
214934
215476
|
children: "Context Compacted"
|
|
214935
215477
|
}, undefined, false, undefined, this)
|
|
214936
215478
|
}, undefined, false, undefined, this),
|
|
214937
|
-
/* @__PURE__ */
|
|
215479
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214938
215480
|
paddingLeft: 1,
|
|
214939
215481
|
paddingTop: 1,
|
|
214940
|
-
children: /* @__PURE__ */
|
|
215482
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
214941
215483
|
color: "gray",
|
|
214942
215484
|
children: block.summary.replace(/^\[COMPACTED HISTORY SUMMARY\]\n/, "")
|
|
214943
215485
|
}, undefined, false, undefined, this)
|
|
@@ -214955,12 +215497,12 @@ function BotMessage({ blocks, usage, expandCommands }) {
|
|
|
214955
215497
|
if (!isRunning) {
|
|
214956
215498
|
const isNoOutputTool = block.toolName === "read_file" || block.toolName === "view_file" || block.toolName === "ask_permission" || block.toolName === "list_permissions";
|
|
214957
215499
|
if (isNoOutputTool) {
|
|
214958
|
-
return /* @__PURE__ */
|
|
215500
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214959
215501
|
flexDirection: "column",
|
|
214960
|
-
children: /* @__PURE__ */
|
|
215502
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
214961
215503
|
alignItems: "center",
|
|
214962
215504
|
gap: 1,
|
|
214963
|
-
children: /* @__PURE__ */
|
|
215505
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(StyledCommand, {
|
|
214964
215506
|
command: block.command
|
|
214965
215507
|
}, undefined, false, undefined, this)
|
|
214966
215508
|
}, undefined, false, undefined, this)
|
|
@@ -214997,7 +215539,7 @@ ${r2}`;
|
|
|
214997
215539
|
`);
|
|
214998
215540
|
}
|
|
214999
215541
|
}
|
|
215000
|
-
return /* @__PURE__ */
|
|
215542
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CollapsibleCommandOutput, {
|
|
215001
215543
|
command: block.command,
|
|
215002
215544
|
output: displayOutput,
|
|
215003
215545
|
forceExpanded: expandCommands
|
|
@@ -215030,27 +215572,27 @@ ${r2}`;
|
|
|
215030
215572
|
statusLabel = "Sending message...";
|
|
215031
215573
|
else if (block.toolName === "schedule")
|
|
215032
215574
|
statusLabel = "Scheduling timer...";
|
|
215033
|
-
return /* @__PURE__ */
|
|
215575
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215034
215576
|
flexDirection: "column",
|
|
215035
215577
|
children: [
|
|
215036
|
-
/* @__PURE__ */
|
|
215578
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215037
215579
|
gap: 1,
|
|
215038
215580
|
alignItems: "center",
|
|
215039
215581
|
children: [
|
|
215040
|
-
/* @__PURE__ */
|
|
215041
|
-
/* @__PURE__ */
|
|
215582
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Spinner2, {}, undefined, false, undefined, this),
|
|
215583
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215042
215584
|
color: "gray",
|
|
215043
215585
|
children: statusLabel
|
|
215044
215586
|
}, undefined, false, undefined, this)
|
|
215045
215587
|
]
|
|
215046
215588
|
}, undefined, true, undefined, this),
|
|
215047
|
-
block.output && /* @__PURE__ */
|
|
215589
|
+
block.output && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215048
215590
|
flexDirection: "column",
|
|
215049
215591
|
marginLeft: 0,
|
|
215050
215592
|
marginTop: 0.5,
|
|
215051
215593
|
paddingX: 1,
|
|
215052
215594
|
paddingY: 0.5,
|
|
215053
|
-
children: block.output.trim().split(/\r?\n/).slice(-2).map((line, lidx) => /* @__PURE__ */
|
|
215595
|
+
children: block.output.trim().split(/\r?\n/).slice(-2).map((line, lidx) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215054
215596
|
color: "#94a3b8",
|
|
215055
215597
|
wrap: "truncate-end",
|
|
215056
215598
|
children: [
|
|
@@ -215066,20 +215608,20 @@ ${r2}`;
|
|
|
215066
215608
|
const isCreated = block.action === "created";
|
|
215067
215609
|
const isDeleted = block.action === "deleted";
|
|
215068
215610
|
const actionLabel = isCreated ? "CREATED" : isDeleted ? "DELETED" : "MODIFIED";
|
|
215069
|
-
return /* @__PURE__ */
|
|
215611
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215070
215612
|
gap: 1,
|
|
215071
215613
|
alignItems: "center",
|
|
215072
215614
|
children: [
|
|
215073
|
-
/* @__PURE__ */
|
|
215615
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215074
215616
|
color: "#fef08a",
|
|
215075
215617
|
children: "● "
|
|
215076
215618
|
}, undefined, false, undefined, this),
|
|
215077
|
-
/* @__PURE__ */
|
|
215619
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215078
215620
|
color: "#fef08a",
|
|
215079
215621
|
bold: true,
|
|
215080
215622
|
children: actionLabel
|
|
215081
215623
|
}, undefined, false, undefined, this),
|
|
215082
|
-
/* @__PURE__ */
|
|
215624
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215083
215625
|
color: "#cbd5e1",
|
|
215084
215626
|
children: block.filePath
|
|
215085
215627
|
}, undefined, false, undefined, this)
|
|
@@ -215087,37 +215629,21 @@ ${r2}`;
|
|
|
215087
215629
|
}, idx, true, undefined, this);
|
|
215088
215630
|
}
|
|
215089
215631
|
case "code": {
|
|
215090
|
-
|
|
215091
|
-
const borderLine = "─".repeat(borderLength);
|
|
215092
|
-
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
215632
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215093
215633
|
flexDirection: "column",
|
|
215094
|
-
paddingLeft:
|
|
215095
|
-
|
|
215096
|
-
|
|
215097
|
-
|
|
215098
|
-
|
|
215099
|
-
|
|
215100
|
-
|
|
215101
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
215102
|
-
flexDirection: "column",
|
|
215103
|
-
paddingLeft: 2,
|
|
215104
|
-
children: block.code.split(/\r?\n/).map((line, lidx) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text3, {
|
|
215105
|
-
color: "#E2E8F0",
|
|
215106
|
-
children: line
|
|
215107
|
-
}, lidx, false, undefined, this))
|
|
215108
|
-
}, undefined, false, undefined, this),
|
|
215109
|
-
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text3, {
|
|
215110
|
-
color: "#4A5568",
|
|
215111
|
-
children: "└──"
|
|
215112
|
-
}, undefined, false, undefined, this)
|
|
215113
|
-
]
|
|
215114
|
-
}, idx, true, undefined, this);
|
|
215634
|
+
paddingLeft: 2,
|
|
215635
|
+
paddingY: 0.5,
|
|
215636
|
+
children: block.code.split(/\r?\n/).map((line, lidx) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215637
|
+
color: "#E2E8F0",
|
|
215638
|
+
children: line
|
|
215639
|
+
}, lidx, false, undefined, this))
|
|
215640
|
+
}, idx, false, undefined, this);
|
|
215115
215641
|
}
|
|
215116
215642
|
case "status": {
|
|
215117
|
-
return /* @__PURE__ */
|
|
215643
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
215118
215644
|
gap: 1,
|
|
215119
215645
|
alignItems: "center",
|
|
215120
|
-
children: /* @__PURE__ */
|
|
215646
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text3, {
|
|
215121
215647
|
color: block.success ? "#6EE7B7" : "#FCA5A5",
|
|
215122
215648
|
children: block.label
|
|
215123
215649
|
}, undefined, false, undefined, this)
|
|
@@ -215129,15 +215655,15 @@ ${r2}`;
|
|
|
215129
215655
|
})
|
|
215130
215656
|
}, undefined, false, undefined, this);
|
|
215131
215657
|
}
|
|
215132
|
-
var
|
|
215658
|
+
var import_react45, jsx_dev_runtime12;
|
|
215133
215659
|
var init_bot_message = __esm(async () => {
|
|
215134
215660
|
await __promiseAll([
|
|
215135
215661
|
init_build2(),
|
|
215136
215662
|
init_spinner(),
|
|
215137
215663
|
init_smooth_markdown()
|
|
215138
215664
|
]);
|
|
215139
|
-
|
|
215140
|
-
|
|
215665
|
+
import_react45 = __toESM(require_react(), 1);
|
|
215666
|
+
jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215141
215667
|
});
|
|
215142
215668
|
|
|
215143
215669
|
// ../../packages/tui/src/components/header.tsx
|
|
@@ -215165,13 +215691,13 @@ function Header({
|
|
|
215165
215691
|
}) {
|
|
215166
215692
|
const cwd2 = getCwd();
|
|
215167
215693
|
const branch = getGitBranch();
|
|
215168
|
-
return /* @__PURE__ */
|
|
215694
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
215169
215695
|
flexDirection: "column",
|
|
215170
215696
|
paddingLeft: 2,
|
|
215171
215697
|
paddingTop: 1,
|
|
215172
215698
|
paddingBottom: 0,
|
|
215173
215699
|
children: [
|
|
215174
|
-
/* @__PURE__ */
|
|
215700
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215175
215701
|
bold: true,
|
|
215176
215702
|
color: "white",
|
|
215177
215703
|
children: [
|
|
@@ -215179,18 +215705,18 @@ function Header({
|
|
|
215179
215705
|
cliVersion.replace(/^v/, "")
|
|
215180
215706
|
]
|
|
215181
215707
|
}, undefined, true, undefined, this),
|
|
215182
|
-
userEmail && /* @__PURE__ */
|
|
215708
|
+
userEmail && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215183
215709
|
color: "gray",
|
|
215184
215710
|
children: userEmail
|
|
215185
215711
|
}, undefined, false, undefined, this),
|
|
215186
|
-
/* @__PURE__ */
|
|
215712
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
215187
215713
|
gap: 1,
|
|
215188
215714
|
children: [
|
|
215189
|
-
/* @__PURE__ */
|
|
215715
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215190
215716
|
color: "gray",
|
|
215191
215717
|
children: cwd2
|
|
215192
215718
|
}, undefined, false, undefined, this),
|
|
215193
|
-
branch && /* @__PURE__ */
|
|
215719
|
+
branch && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215194
215720
|
color: "gray",
|
|
215195
215721
|
children: [
|
|
215196
215722
|
"(",
|
|
@@ -215200,19 +215726,19 @@ function Header({
|
|
|
215200
215726
|
}, undefined, true, undefined, this)
|
|
215201
215727
|
]
|
|
215202
215728
|
}, undefined, true, undefined, this),
|
|
215203
|
-
/* @__PURE__ */
|
|
215729
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
215204
215730
|
flexDirection: "column",
|
|
215205
215731
|
marginTop: 1,
|
|
215206
215732
|
children: [
|
|
215207
|
-
/* @__PURE__ */
|
|
215733
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215208
215734
|
color: "#89B4F8",
|
|
215209
215735
|
children: "Tips for getting started"
|
|
215210
215736
|
}, undefined, false, undefined, this),
|
|
215211
|
-
/* @__PURE__ */
|
|
215737
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215212
215738
|
color: "gray",
|
|
215213
215739
|
children: "Run /init to scaffold .december workspace for custom rules and skills"
|
|
215214
215740
|
}, undefined, false, undefined, this),
|
|
215215
|
-
/* @__PURE__ */
|
|
215741
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text3, {
|
|
215216
215742
|
color: "gray",
|
|
215217
215743
|
children: "Use /handoff to continue this session in December (trydecember.com)"
|
|
215218
215744
|
}, undefined, false, undefined, this)
|
|
@@ -215221,49 +215747,55 @@ function Header({
|
|
|
215221
215747
|
]
|
|
215222
215748
|
}, undefined, true, undefined, this);
|
|
215223
215749
|
}
|
|
215224
|
-
var
|
|
215750
|
+
var jsx_dev_runtime13;
|
|
215225
215751
|
var init_header = __esm(async () => {
|
|
215226
215752
|
await init_build2();
|
|
215227
|
-
|
|
215753
|
+
jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215228
215754
|
});
|
|
215229
215755
|
|
|
215230
215756
|
// ../../packages/tui/src/components/messages/error-message.tsx
|
|
215231
|
-
function ErrorMessage({ message }) {
|
|
215232
|
-
return /* @__PURE__ */
|
|
215757
|
+
function ErrorMessage({ message, hasTopMargin = false }) {
|
|
215758
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
|
|
215233
215759
|
paddingX: 4,
|
|
215234
|
-
paddingY: 0
|
|
215235
|
-
|
|
215236
|
-
|
|
215237
|
-
|
|
215238
|
-
|
|
215239
|
-
|
|
215760
|
+
paddingY: 0,
|
|
215761
|
+
flexDirection: "column",
|
|
215762
|
+
children: [
|
|
215763
|
+
hasTopMargin && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
|
|
215764
|
+
children: " "
|
|
215765
|
+
}, undefined, false, undefined, this),
|
|
215766
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text3, {
|
|
215767
|
+
color: "#FCA5A5",
|
|
215768
|
+
children: message.trim()
|
|
215769
|
+
}, undefined, false, undefined, this)
|
|
215770
|
+
]
|
|
215771
|
+
}, undefined, true, undefined, this);
|
|
215240
215772
|
}
|
|
215241
|
-
var
|
|
215773
|
+
var jsx_dev_runtime14;
|
|
215242
215774
|
var init_error_message = __esm(async () => {
|
|
215243
215775
|
await init_build2();
|
|
215244
|
-
|
|
215776
|
+
jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215245
215777
|
});
|
|
215246
215778
|
|
|
215247
215779
|
// ../../packages/tui/src/components/messages/user-message.tsx
|
|
215248
215780
|
function UserMessage({ message }) {
|
|
215249
|
-
return /* @__PURE__ */
|
|
215781
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
215250
215782
|
paddingLeft: 2,
|
|
215251
215783
|
paddingRight: 4,
|
|
215252
215784
|
paddingY: 0,
|
|
215253
215785
|
marginTop: 1,
|
|
215254
|
-
marginBottom:
|
|
215786
|
+
marginBottom: 1,
|
|
215255
215787
|
flexDirection: "row",
|
|
215256
215788
|
children: [
|
|
215257
|
-
/* @__PURE__ */
|
|
215789
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
215258
215790
|
marginRight: 1,
|
|
215259
|
-
children: /* @__PURE__ */
|
|
215791
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text3, {
|
|
215260
215792
|
color: "#89B4F8",
|
|
215261
215793
|
children: "❭"
|
|
215262
215794
|
}, undefined, false, undefined, this)
|
|
215263
215795
|
}, undefined, false, undefined, this),
|
|
215264
|
-
/* @__PURE__ */
|
|
215796
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
215265
215797
|
flexShrink: 1,
|
|
215266
|
-
children: /* @__PURE__ */
|
|
215798
|
+
children: /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text3, {
|
|
215267
215799
|
color: "#89B4F8",
|
|
215268
215800
|
children: message
|
|
215269
215801
|
}, undefined, false, undefined, this)
|
|
@@ -215271,13 +215803,39 @@ function UserMessage({ message }) {
|
|
|
215271
215803
|
]
|
|
215272
215804
|
}, undefined, true, undefined, this);
|
|
215273
215805
|
}
|
|
215274
|
-
var
|
|
215806
|
+
var jsx_dev_runtime15;
|
|
215275
215807
|
var init_user_message = __esm(async () => {
|
|
215276
215808
|
await init_build2();
|
|
215277
|
-
|
|
215809
|
+
jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215278
215810
|
});
|
|
215279
215811
|
|
|
215280
215812
|
// ../../packages/tui/src/components/message-list.tsx
|
|
215813
|
+
function renderSingleMessage(msg, index2, allMessages, cliVersion, userEmail, expandCommands) {
|
|
215814
|
+
const key = msg.id != null ? `${msg.id}-${index2}` : `msg-idx-${index2}`;
|
|
215815
|
+
if (msg.role === "header") {
|
|
215816
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Header, {
|
|
215817
|
+
cliVersion,
|
|
215818
|
+
userEmail
|
|
215819
|
+
}, key, false, undefined, this);
|
|
215820
|
+
}
|
|
215821
|
+
if (msg.role === "user")
|
|
215822
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(UserMessage, {
|
|
215823
|
+
message: msg.text ?? ""
|
|
215824
|
+
}, key, false, undefined, this);
|
|
215825
|
+
if (msg.role === "error") {
|
|
215826
|
+
const prevRole = index2 > 0 ? allMessages[index2 - 1]?.role : null;
|
|
215827
|
+
const hasTopMargin = prevRole !== "user";
|
|
215828
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(ErrorMessage, {
|
|
215829
|
+
message: msg.text ?? "",
|
|
215830
|
+
hasTopMargin
|
|
215831
|
+
}, key, false, undefined, this);
|
|
215832
|
+
}
|
|
215833
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(BotMessage, {
|
|
215834
|
+
blocks: msg.blocks ?? [],
|
|
215835
|
+
usage: msg.usage,
|
|
215836
|
+
expandCommands
|
|
215837
|
+
}, key, false, undefined, this);
|
|
215838
|
+
}
|
|
215281
215839
|
function MessageList({
|
|
215282
215840
|
staticKey,
|
|
215283
215841
|
staticMessages,
|
|
@@ -215288,33 +215846,12 @@ function MessageList({
|
|
|
215288
215846
|
expandCommands
|
|
215289
215847
|
}) {
|
|
215290
215848
|
const allMessages = [...staticMessages, ...activeMessages];
|
|
215291
|
-
return /* @__PURE__ */
|
|
215849
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
215292
215850
|
flexDirection: "column",
|
|
215293
|
-
children: allMessages.map((msg, index2) =>
|
|
215294
|
-
const key = msg.id != null ? `${msg.id}-${index2}` : `msg-idx-${index2}`;
|
|
215295
|
-
if (msg.role === "header") {
|
|
215296
|
-
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Header, {
|
|
215297
|
-
cliVersion,
|
|
215298
|
-
userEmail
|
|
215299
|
-
}, key, false, undefined, this);
|
|
215300
|
-
}
|
|
215301
|
-
if (msg.role === "user")
|
|
215302
|
-
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(UserMessage, {
|
|
215303
|
-
message: msg.text ?? ""
|
|
215304
|
-
}, key, false, undefined, this);
|
|
215305
|
-
if (msg.role === "error")
|
|
215306
|
-
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(ErrorMessage, {
|
|
215307
|
-
message: msg.text ?? ""
|
|
215308
|
-
}, key, false, undefined, this);
|
|
215309
|
-
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(BotMessage, {
|
|
215310
|
-
blocks: msg.blocks ?? [],
|
|
215311
|
-
usage: msg.usage,
|
|
215312
|
-
expandCommands
|
|
215313
|
-
}, key, false, undefined, this);
|
|
215314
|
-
})
|
|
215851
|
+
children: allMessages.map((msg, index2) => renderSingleMessage(msg, index2, allMessages, cliVersion, userEmail, expandCommands))
|
|
215315
215852
|
}, undefined, false, undefined, this);
|
|
215316
215853
|
}
|
|
215317
|
-
var
|
|
215854
|
+
var jsx_dev_runtime16;
|
|
215318
215855
|
var init_message_list = __esm(async () => {
|
|
215319
215856
|
await __promiseAll([
|
|
215320
215857
|
init_build2(),
|
|
@@ -215323,7 +215860,7 @@ var init_message_list = __esm(async () => {
|
|
|
215323
215860
|
init_error_message(),
|
|
215324
215861
|
init_user_message()
|
|
215325
215862
|
]);
|
|
215326
|
-
|
|
215863
|
+
jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215327
215864
|
});
|
|
215328
215865
|
// ../../packages/tui/src/theme.ts
|
|
215329
215866
|
var COLORS;
|
|
@@ -215340,33 +215877,33 @@ var init_theme = __esm(() => {
|
|
|
215340
215877
|
|
|
215341
215878
|
// ../../packages/tui/src/providers/theme/index.tsx
|
|
215342
215879
|
function ThemeProvider({ children: children2 }) {
|
|
215343
|
-
return /* @__PURE__ */
|
|
215880
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(ThemeContext.Provider, {
|
|
215344
215881
|
value: { colors: COLORS },
|
|
215345
215882
|
children: children2
|
|
215346
215883
|
}, undefined, false, undefined, this);
|
|
215347
215884
|
}
|
|
215348
|
-
var
|
|
215885
|
+
var import_react46, jsx_dev_runtime17, ThemeContext;
|
|
215349
215886
|
var init_theme2 = __esm(() => {
|
|
215350
215887
|
init_theme();
|
|
215351
|
-
|
|
215352
|
-
|
|
215353
|
-
ThemeContext =
|
|
215888
|
+
import_react46 = __toESM(require_react(), 1);
|
|
215889
|
+
jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215890
|
+
ThemeContext = import_react46.createContext({ colors: COLORS });
|
|
215354
215891
|
});
|
|
215355
215892
|
|
|
215356
215893
|
// ../../packages/tui/src/layouts/root-layout.tsx
|
|
215357
215894
|
function RootLayout({ children: children2, onToast }) {
|
|
215358
|
-
return /* @__PURE__ */
|
|
215359
|
-
children: /* @__PURE__ */
|
|
215360
|
-
children: /* @__PURE__ */
|
|
215895
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ThemeProvider, {
|
|
215896
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(KeyboardLayerProvider, {
|
|
215897
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(ToastProvider, {
|
|
215361
215898
|
onToast,
|
|
215362
|
-
children: /* @__PURE__ */
|
|
215899
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(DialogProvider, {
|
|
215363
215900
|
children: children2
|
|
215364
215901
|
}, undefined, false, undefined, this)
|
|
215365
215902
|
}, undefined, false, undefined, this)
|
|
215366
215903
|
}, undefined, false, undefined, this)
|
|
215367
215904
|
}, undefined, false, undefined, this);
|
|
215368
215905
|
}
|
|
215369
|
-
var
|
|
215906
|
+
var jsx_dev_runtime18;
|
|
215370
215907
|
var init_root_layout = __esm(async () => {
|
|
215371
215908
|
init_theme2();
|
|
215372
215909
|
await __promiseAll([
|
|
@@ -215374,33 +215911,33 @@ var init_root_layout = __esm(async () => {
|
|
|
215374
215911
|
init_keyboard_layer(),
|
|
215375
215912
|
init_toast()
|
|
215376
215913
|
]);
|
|
215377
|
-
|
|
215914
|
+
jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215378
215915
|
});
|
|
215379
215916
|
|
|
215380
215917
|
// ../../packages/tui/src/components/menus/menu-items.tsx
|
|
215381
|
-
var
|
|
215918
|
+
var jsx_dev_runtime19, CustomIndicator = ({ isSelected }) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
215382
215919
|
marginRight: 1,
|
|
215383
|
-
children: /* @__PURE__ */
|
|
215920
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text3, {
|
|
215384
215921
|
color: "#89B4F8",
|
|
215385
215922
|
children: isSelected ? "❯" : " "
|
|
215386
215923
|
}, undefined, false, undefined, this)
|
|
215387
|
-
}, undefined, false, undefined, this), CustomItem = ({ label, isSelected }) => /* @__PURE__ */
|
|
215924
|
+
}, undefined, false, undefined, this), CustomItem = ({ label, isSelected }) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text3, {
|
|
215388
215925
|
color: isSelected ? "#89B4F8" : "white",
|
|
215389
215926
|
children: isSelected ? label : label
|
|
215390
215927
|
}, undefined, false, undefined, this);
|
|
215391
215928
|
var init_menu_items = __esm(async () => {
|
|
215392
215929
|
await init_build2();
|
|
215393
|
-
|
|
215930
|
+
jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215394
215931
|
});
|
|
215395
215932
|
|
|
215396
215933
|
// ../../node_modules/.bun/ink-text-input@6.0.0+99d24c251f842efe/node_modules/ink-text-input/build/index.js
|
|
215397
215934
|
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
215398
|
-
const [state, setState] =
|
|
215935
|
+
const [state, setState] = import_react47.useState({
|
|
215399
215936
|
cursorOffset: (originalValue || "").length,
|
|
215400
215937
|
cursorWidth: 0
|
|
215401
215938
|
});
|
|
215402
215939
|
const { cursorOffset, cursorWidth } = state;
|
|
215403
|
-
|
|
215940
|
+
import_react47.useEffect(() => {
|
|
215404
215941
|
setState((previousState) => {
|
|
215405
215942
|
if (!focus || !showCursor) {
|
|
215406
215943
|
return previousState;
|
|
@@ -215478,26 +216015,26 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
|
|
|
215478
216015
|
onChange(nextValue);
|
|
215479
216016
|
}
|
|
215480
216017
|
}, { isActive: focus });
|
|
215481
|
-
return
|
|
216018
|
+
return import_react47.default.createElement(Text3, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
215482
216019
|
}
|
|
215483
|
-
var
|
|
216020
|
+
var import_react47, build_default2;
|
|
215484
216021
|
var init_build4 = __esm(async () => {
|
|
215485
216022
|
init_source();
|
|
215486
216023
|
await init_build2();
|
|
215487
|
-
|
|
216024
|
+
import_react47 = __toESM(require_react(), 1);
|
|
215488
216025
|
build_default2 = TextInput;
|
|
215489
216026
|
});
|
|
215490
216027
|
|
|
215491
216028
|
// ../../packages/tui/src/components/menus/byok-key-menu.tsx
|
|
215492
216029
|
function ByokKeyMenu(props) {
|
|
215493
216030
|
const { selectedProvider, apiKey, setApiKey, handleKeySubmit } = props;
|
|
215494
|
-
return /* @__PURE__ */
|
|
216031
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215495
216032
|
flexDirection: "column",
|
|
215496
216033
|
paddingX: 1,
|
|
215497
216034
|
children: [
|
|
215498
|
-
/* @__PURE__ */
|
|
216035
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215499
216036
|
marginBottom: 1,
|
|
215500
|
-
children: /* @__PURE__ */
|
|
216037
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215501
216038
|
color: "white",
|
|
215502
216039
|
children: [
|
|
215503
216040
|
"Enter API Key for ",
|
|
@@ -215506,9 +216043,9 @@ function ByokKeyMenu(props) {
|
|
|
215506
216043
|
]
|
|
215507
216044
|
}, undefined, true, undefined, this)
|
|
215508
216045
|
}, undefined, false, undefined, this),
|
|
215509
|
-
/* @__PURE__ */
|
|
216046
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215510
216047
|
children: [
|
|
215511
|
-
/* @__PURE__ */
|
|
216048
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215512
216049
|
color: "#89B4F8",
|
|
215513
216050
|
bold: false,
|
|
215514
216051
|
children: [
|
|
@@ -215516,44 +216053,43 @@ function ByokKeyMenu(props) {
|
|
|
215516
216053
|
" "
|
|
215517
216054
|
]
|
|
215518
216055
|
}, undefined, true, undefined, this),
|
|
215519
|
-
/* @__PURE__ */
|
|
216056
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(build_default2, {
|
|
215520
216057
|
focus: true,
|
|
215521
216058
|
value: apiKey,
|
|
215522
216059
|
onChange: setApiKey,
|
|
215523
|
-
onSubmit: handleKeySubmit
|
|
215524
|
-
mask: "*"
|
|
216060
|
+
onSubmit: handleKeySubmit
|
|
215525
216061
|
}, undefined, false, undefined, this)
|
|
215526
216062
|
]
|
|
215527
216063
|
}, undefined, true, undefined, this),
|
|
215528
|
-
props.authError && /* @__PURE__ */
|
|
216064
|
+
props.authError && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215529
216065
|
marginTop: 1,
|
|
215530
|
-
children: /* @__PURE__ */
|
|
216066
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215531
216067
|
color: "#FCA5A5",
|
|
215532
216068
|
children: props.authError
|
|
215533
216069
|
}, undefined, false, undefined, this)
|
|
215534
216070
|
}, undefined, false, undefined, this),
|
|
215535
|
-
/* @__PURE__ */
|
|
216071
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215536
216072
|
paddingTop: 1,
|
|
215537
|
-
children: /* @__PURE__ */
|
|
216073
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
215538
216074
|
gap: 1,
|
|
215539
216075
|
children: [
|
|
215540
|
-
/* @__PURE__ */
|
|
216076
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215541
216077
|
color: "#89B4F8",
|
|
215542
216078
|
children: "enter"
|
|
215543
216079
|
}, undefined, false, undefined, this),
|
|
215544
|
-
/* @__PURE__ */
|
|
216080
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215545
216081
|
color: "#AAAAAA",
|
|
215546
216082
|
children: "Submit"
|
|
215547
216083
|
}, undefined, false, undefined, this),
|
|
215548
|
-
/* @__PURE__ */
|
|
216084
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215549
216085
|
color: "#AAAAAA",
|
|
215550
216086
|
children: "·"
|
|
215551
216087
|
}, undefined, false, undefined, this),
|
|
215552
|
-
/* @__PURE__ */
|
|
216088
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215553
216089
|
color: "#89B4F8",
|
|
215554
216090
|
children: "esc"
|
|
215555
216091
|
}, undefined, false, undefined, this),
|
|
215556
|
-
/* @__PURE__ */
|
|
216092
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text3, {
|
|
215557
216093
|
color: "#AAAAAA",
|
|
215558
216094
|
children: "Cancel"
|
|
215559
216095
|
}, undefined, false, undefined, this)
|
|
@@ -215563,13 +216099,13 @@ function ByokKeyMenu(props) {
|
|
|
215563
216099
|
]
|
|
215564
216100
|
}, undefined, true, undefined, this);
|
|
215565
216101
|
}
|
|
215566
|
-
var
|
|
216102
|
+
var jsx_dev_runtime20;
|
|
215567
216103
|
var init_byok_key_menu = __esm(async () => {
|
|
215568
216104
|
await __promiseAll([
|
|
215569
216105
|
init_build2(),
|
|
215570
216106
|
init_build4()
|
|
215571
216107
|
]);
|
|
215572
|
-
|
|
216108
|
+
jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
215573
216109
|
});
|
|
215574
216110
|
|
|
215575
216111
|
// ../../node_modules/.bun/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
@@ -215866,24 +216402,24 @@ var init_figures = __esm(() => {
|
|
|
215866
216402
|
|
|
215867
216403
|
// ../../node_modules/.bun/ink-select-input@6.2.0+99d24c251f842efe/node_modules/ink-select-input/build/Indicator.js
|
|
215868
216404
|
function Indicator({ isSelected = false }) {
|
|
215869
|
-
return
|
|
216405
|
+
return import_react48.default.createElement(Box_default, { marginRight: 1 }, isSelected ? import_react48.default.createElement(Text3, { color: "blue" }, figures_default.pointer) : import_react48.default.createElement(Text3, null, " "));
|
|
215870
216406
|
}
|
|
215871
|
-
var
|
|
216407
|
+
var import_react48, Indicator_default;
|
|
215872
216408
|
var init_Indicator = __esm(async () => {
|
|
215873
216409
|
init_figures();
|
|
215874
216410
|
await init_build2();
|
|
215875
|
-
|
|
216411
|
+
import_react48 = __toESM(require_react(), 1);
|
|
215876
216412
|
Indicator_default = Indicator;
|
|
215877
216413
|
});
|
|
215878
216414
|
|
|
215879
216415
|
// ../../node_modules/.bun/ink-select-input@6.2.0+99d24c251f842efe/node_modules/ink-select-input/build/Item.js
|
|
215880
216416
|
function Item({ isSelected = false, label }) {
|
|
215881
|
-
return
|
|
216417
|
+
return React20.createElement(Text3, { color: isSelected ? "blue" : undefined }, label);
|
|
215882
216418
|
}
|
|
215883
|
-
var
|
|
216419
|
+
var React20, Item_default;
|
|
215884
216420
|
var init_Item = __esm(async () => {
|
|
215885
216421
|
await init_build2();
|
|
215886
|
-
|
|
216422
|
+
React20 = __toESM(require_react(), 1);
|
|
215887
216423
|
Item_default = Item;
|
|
215888
216424
|
});
|
|
215889
216425
|
|
|
@@ -215915,17 +216451,17 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
215915
216451
|
const hasLimit = typeof customLimit === "number" && items.length > customLimit;
|
|
215916
216452
|
const limit3 = hasLimit ? Math.min(customLimit, items.length) : items.length;
|
|
215917
216453
|
const lastIndex = limit3 - 1;
|
|
215918
|
-
const [rotateIndex, setRotateIndex] =
|
|
215919
|
-
const [selectedIndex, setSelectedIndex] =
|
|
215920
|
-
const previousItems =
|
|
215921
|
-
|
|
216454
|
+
const [rotateIndex, setRotateIndex] = import_react49.useState(initialIndex > lastIndex ? lastIndex - initialIndex : 0);
|
|
216455
|
+
const [selectedIndex, setSelectedIndex] = import_react49.useState(initialIndex ? initialIndex > lastIndex ? lastIndex : initialIndex : 0);
|
|
216456
|
+
const previousItems = import_react49.useRef(items);
|
|
216457
|
+
import_react49.useEffect(() => {
|
|
215922
216458
|
if (!isDeepStrictEqual(previousItems.current.map((item) => item.value), items.map((item) => item.value))) {
|
|
215923
216459
|
setRotateIndex(0);
|
|
215924
216460
|
setSelectedIndex(0);
|
|
215925
216461
|
}
|
|
215926
216462
|
previousItems.current = items;
|
|
215927
216463
|
}, [items]);
|
|
215928
|
-
use_input_default(
|
|
216464
|
+
use_input_default(import_react49.useCallback((input, key) => {
|
|
215929
216465
|
if (input === "k" || key.upArrow) {
|
|
215930
216466
|
const lastIndex2 = (hasLimit ? limit3 : items.length) - 1;
|
|
215931
216467
|
const atFirstIndex = selectedIndex === 0;
|
|
@@ -215977,19 +216513,19 @@ function SelectInput({ items = [], isFocused = true, initialIndex = 0, indicator
|
|
|
215977
216513
|
onHighlight
|
|
215978
216514
|
]), { isActive: isFocused });
|
|
215979
216515
|
const slicedItems = hasLimit ? toRotated(items, rotateIndex).slice(0, limit3) : items;
|
|
215980
|
-
return
|
|
216516
|
+
return import_react49.default.createElement(Box_default, { flexDirection: "column" }, slicedItems.map((item, index2) => {
|
|
215981
216517
|
const isSelected = index2 === selectedIndex;
|
|
215982
|
-
return
|
|
216518
|
+
return import_react49.default.createElement(Box_default, { key: item.key ?? item.value }, import_react49.default.createElement(indicatorComponent, { isSelected }), import_react49.default.createElement(itemComponent, { ...item, isSelected }));
|
|
215983
216519
|
}));
|
|
215984
216520
|
}
|
|
215985
|
-
var
|
|
216521
|
+
var import_react49, SelectInput_default;
|
|
215986
216522
|
var init_SelectInput = __esm(async () => {
|
|
215987
216523
|
await __promiseAll([
|
|
215988
216524
|
init_build2(),
|
|
215989
216525
|
init_Indicator(),
|
|
215990
216526
|
init_Item()
|
|
215991
216527
|
]);
|
|
215992
|
-
|
|
216528
|
+
import_react49 = __toESM(require_react(), 1);
|
|
215993
216529
|
SelectInput_default = SelectInput;
|
|
215994
216530
|
});
|
|
215995
216531
|
|
|
@@ -216005,18 +216541,18 @@ var init_build5 = __esm(async () => {
|
|
|
216005
216541
|
// ../../packages/tui/src/components/menus/byok-provider-menu.tsx
|
|
216006
216542
|
function ByokProviderMenu(props) {
|
|
216007
216543
|
const { handleProviderSelect } = props;
|
|
216008
|
-
return /* @__PURE__ */
|
|
216544
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
216009
216545
|
flexDirection: "column",
|
|
216010
216546
|
paddingX: 1,
|
|
216011
216547
|
children: [
|
|
216012
|
-
/* @__PURE__ */
|
|
216548
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
216013
216549
|
marginBottom: 1,
|
|
216014
|
-
children: /* @__PURE__ */
|
|
216550
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216015
216551
|
color: "white",
|
|
216016
216552
|
children: "Select API Provider:"
|
|
216017
216553
|
}, undefined, false, undefined, this)
|
|
216018
216554
|
}, undefined, false, undefined, this),
|
|
216019
|
-
/* @__PURE__ */
|
|
216555
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(SelectInput_default, {
|
|
216020
216556
|
items: [
|
|
216021
216557
|
{ label: "Anthropic", value: "anthropic" },
|
|
216022
216558
|
{ label: "DeepSeek", value: "deepseek" },
|
|
@@ -216035,40 +216571,40 @@ function ByokProviderMenu(props) {
|
|
|
216035
216571
|
indicatorComponent: CustomIndicator,
|
|
216036
216572
|
itemComponent: CustomItem
|
|
216037
216573
|
}, undefined, false, undefined, this),
|
|
216038
|
-
/* @__PURE__ */
|
|
216574
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
216039
216575
|
paddingTop: 1,
|
|
216040
|
-
children: /* @__PURE__ */
|
|
216576
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
216041
216577
|
gap: 1,
|
|
216042
216578
|
children: [
|
|
216043
|
-
/* @__PURE__ */
|
|
216579
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216044
216580
|
color: "#89B4F8",
|
|
216045
216581
|
children: "↑↓"
|
|
216046
216582
|
}, undefined, false, undefined, this),
|
|
216047
|
-
/* @__PURE__ */
|
|
216583
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216048
216584
|
color: "#AAAAAA",
|
|
216049
216585
|
children: "Navigate"
|
|
216050
216586
|
}, undefined, false, undefined, this),
|
|
216051
|
-
/* @__PURE__ */
|
|
216587
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216052
216588
|
color: "#AAAAAA",
|
|
216053
216589
|
children: "·"
|
|
216054
216590
|
}, undefined, false, undefined, this),
|
|
216055
|
-
/* @__PURE__ */
|
|
216591
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216056
216592
|
color: "#89B4F8",
|
|
216057
216593
|
children: "enter"
|
|
216058
216594
|
}, undefined, false, undefined, this),
|
|
216059
|
-
/* @__PURE__ */
|
|
216595
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216060
216596
|
color: "#AAAAAA",
|
|
216061
216597
|
children: "Select"
|
|
216062
216598
|
}, undefined, false, undefined, this),
|
|
216063
|
-
/* @__PURE__ */
|
|
216599
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216064
216600
|
color: "#AAAAAA",
|
|
216065
216601
|
children: "·"
|
|
216066
216602
|
}, undefined, false, undefined, this),
|
|
216067
|
-
/* @__PURE__ */
|
|
216603
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216068
216604
|
color: "#89B4F8",
|
|
216069
216605
|
children: "esc"
|
|
216070
216606
|
}, undefined, false, undefined, this),
|
|
216071
|
-
/* @__PURE__ */
|
|
216607
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text3, {
|
|
216072
216608
|
color: "#AAAAAA",
|
|
216073
216609
|
children: "Cancel"
|
|
216074
216610
|
}, undefined, false, undefined, this)
|
|
@@ -216078,14 +216614,14 @@ function ByokProviderMenu(props) {
|
|
|
216078
216614
|
]
|
|
216079
216615
|
}, undefined, true, undefined, this);
|
|
216080
216616
|
}
|
|
216081
|
-
var
|
|
216617
|
+
var jsx_dev_runtime21;
|
|
216082
216618
|
var init_byok_provider_menu = __esm(async () => {
|
|
216083
216619
|
await __promiseAll([
|
|
216084
216620
|
init_build2(),
|
|
216085
216621
|
init_build5(),
|
|
216086
216622
|
init_menu_items()
|
|
216087
216623
|
]);
|
|
216088
|
-
|
|
216624
|
+
jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216089
216625
|
});
|
|
216090
216626
|
|
|
216091
216627
|
// ../../packages/tui/src/components/menus/context-select-menu.tsx
|
|
@@ -216110,7 +216646,7 @@ function ContextSelectMenu(props) {
|
|
|
216110
216646
|
let filled = 0;
|
|
216111
216647
|
const addSquares = (count, char, color) => {
|
|
216112
216648
|
for (let i2 = 0;i2 < count && filled < totalSquares; i2++) {
|
|
216113
|
-
squares.push(/* @__PURE__ */
|
|
216649
|
+
squares.push(/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216114
216650
|
color,
|
|
216115
216651
|
children: char
|
|
216116
216652
|
}, filled, false, undefined, this));
|
|
@@ -216122,7 +216658,7 @@ function ContextSelectMenu(props) {
|
|
|
216122
216658
|
addSquares(Math.round(toolTokens / maxTokens * totalSquares), "●", "#FCD34D");
|
|
216123
216659
|
addSquares(Math.round(sysTokens / maxTokens * totalSquares), "●", "#AAAAAA");
|
|
216124
216660
|
while (filled < totalSquares) {
|
|
216125
|
-
squares.push(/* @__PURE__ */
|
|
216661
|
+
squares.push(/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216126
216662
|
color: "#444444",
|
|
216127
216663
|
children: "□"
|
|
216128
216664
|
}, filled, false, undefined, this));
|
|
@@ -216130,37 +216666,37 @@ function ContextSelectMenu(props) {
|
|
|
216130
216666
|
}
|
|
216131
216667
|
const gridRows = [];
|
|
216132
216668
|
for (let i2 = 0;i2 < totalSquares; i2 += 20) {
|
|
216133
|
-
gridRows.push(/* @__PURE__ */
|
|
216669
|
+
gridRows.push(/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216134
216670
|
gap: 1,
|
|
216135
216671
|
children: squares.slice(i2, i2 + 20)
|
|
216136
216672
|
}, i2, false, undefined, this));
|
|
216137
216673
|
}
|
|
216138
|
-
return /* @__PURE__ */
|
|
216674
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216139
216675
|
flexDirection: "column",
|
|
216140
216676
|
paddingX: 1,
|
|
216141
216677
|
children: [
|
|
216142
|
-
/* @__PURE__ */
|
|
216678
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216143
216679
|
marginBottom: 1,
|
|
216144
|
-
children: /* @__PURE__ */
|
|
216680
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216145
216681
|
bold: true,
|
|
216146
216682
|
color: "white",
|
|
216147
216683
|
children: "Context"
|
|
216148
216684
|
}, undefined, false, undefined, this)
|
|
216149
216685
|
}, undefined, false, undefined, this),
|
|
216150
|
-
/* @__PURE__ */
|
|
216686
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216151
216687
|
flexDirection: "row",
|
|
216152
216688
|
gap: 4,
|
|
216153
216689
|
children: [
|
|
216154
|
-
/* @__PURE__ */
|
|
216690
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216155
216691
|
flexDirection: "column",
|
|
216156
216692
|
children: gridRows
|
|
216157
216693
|
}, undefined, false, undefined, this),
|
|
216158
|
-
/* @__PURE__ */
|
|
216694
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216159
216695
|
flexDirection: "column",
|
|
216160
216696
|
children: [
|
|
216161
|
-
/* @__PURE__ */
|
|
216697
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216162
216698
|
gap: 1,
|
|
216163
|
-
children: /* @__PURE__ */
|
|
216699
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216164
216700
|
color: "#AAAAAA",
|
|
216165
216701
|
children: [
|
|
216166
216702
|
currentModelName,
|
|
@@ -216174,24 +216710,24 @@ function ContextSelectMenu(props) {
|
|
|
216174
216710
|
]
|
|
216175
216711
|
}, undefined, true, undefined, this)
|
|
216176
216712
|
}, undefined, false, undefined, this),
|
|
216177
|
-
/* @__PURE__ */
|
|
216713
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216178
216714
|
marginTop: 1,
|
|
216179
|
-
children: /* @__PURE__ */
|
|
216715
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216180
216716
|
color: "white",
|
|
216181
216717
|
children: "Token usage by category"
|
|
216182
216718
|
}, undefined, false, undefined, this)
|
|
216183
216719
|
}, undefined, false, undefined, this),
|
|
216184
|
-
/* @__PURE__ */
|
|
216720
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216185
216721
|
flexDirection: "column",
|
|
216186
216722
|
children: [
|
|
216187
|
-
/* @__PURE__ */
|
|
216723
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216188
216724
|
gap: 1,
|
|
216189
216725
|
children: [
|
|
216190
|
-
/* @__PURE__ */
|
|
216726
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216191
216727
|
color: "#89B4F8",
|
|
216192
216728
|
children: "●"
|
|
216193
216729
|
}, undefined, false, undefined, this),
|
|
216194
|
-
/* @__PURE__ */
|
|
216730
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216195
216731
|
color: "#AAAAAA",
|
|
216196
216732
|
children: [
|
|
216197
216733
|
"User messages: ",
|
|
@@ -216203,14 +216739,14 @@ function ContextSelectMenu(props) {
|
|
|
216203
216739
|
}, undefined, true, undefined, this)
|
|
216204
216740
|
]
|
|
216205
216741
|
}, undefined, true, undefined, this),
|
|
216206
|
-
/* @__PURE__ */
|
|
216742
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216207
216743
|
gap: 1,
|
|
216208
216744
|
children: [
|
|
216209
|
-
/* @__PURE__ */
|
|
216745
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216210
216746
|
color: "#6EE7B7",
|
|
216211
216747
|
children: "●"
|
|
216212
216748
|
}, undefined, false, undefined, this),
|
|
216213
|
-
/* @__PURE__ */
|
|
216749
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216214
216750
|
color: "#AAAAAA",
|
|
216215
216751
|
children: [
|
|
216216
216752
|
"Agent responses: ",
|
|
@@ -216222,14 +216758,14 @@ function ContextSelectMenu(props) {
|
|
|
216222
216758
|
}, undefined, true, undefined, this)
|
|
216223
216759
|
]
|
|
216224
216760
|
}, undefined, true, undefined, this),
|
|
216225
|
-
/* @__PURE__ */
|
|
216761
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216226
216762
|
gap: 1,
|
|
216227
216763
|
children: [
|
|
216228
|
-
/* @__PURE__ */
|
|
216764
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216229
216765
|
color: "#FCD34D",
|
|
216230
216766
|
children: "●"
|
|
216231
216767
|
}, undefined, false, undefined, this),
|
|
216232
|
-
/* @__PURE__ */
|
|
216768
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216233
216769
|
color: "#AAAAAA",
|
|
216234
216770
|
children: [
|
|
216235
216771
|
"Tool calls: ",
|
|
@@ -216241,14 +216777,14 @@ function ContextSelectMenu(props) {
|
|
|
216241
216777
|
}, undefined, true, undefined, this)
|
|
216242
216778
|
]
|
|
216243
216779
|
}, undefined, true, undefined, this),
|
|
216244
|
-
/* @__PURE__ */
|
|
216780
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216245
216781
|
gap: 1,
|
|
216246
216782
|
children: [
|
|
216247
|
-
/* @__PURE__ */
|
|
216783
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216248
216784
|
color: "#AAAAAA",
|
|
216249
216785
|
children: "●"
|
|
216250
216786
|
}, undefined, false, undefined, this),
|
|
216251
|
-
/* @__PURE__ */
|
|
216787
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216252
216788
|
color: "#AAAAAA",
|
|
216253
216789
|
children: [
|
|
216254
216790
|
"System prompt: ",
|
|
@@ -216260,14 +216796,14 @@ function ContextSelectMenu(props) {
|
|
|
216260
216796
|
}, undefined, true, undefined, this)
|
|
216261
216797
|
]
|
|
216262
216798
|
}, undefined, true, undefined, this),
|
|
216263
|
-
/* @__PURE__ */
|
|
216799
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216264
216800
|
gap: 1,
|
|
216265
216801
|
children: [
|
|
216266
|
-
/* @__PURE__ */
|
|
216802
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216267
216803
|
color: "#444444",
|
|
216268
216804
|
children: "□"
|
|
216269
216805
|
}, undefined, false, undefined, this),
|
|
216270
|
-
/* @__PURE__ */
|
|
216806
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216271
216807
|
color: "#AAAAAA",
|
|
216272
216808
|
children: [
|
|
216273
216809
|
"Free space: ",
|
|
@@ -216285,16 +216821,16 @@ function ContextSelectMenu(props) {
|
|
|
216285
216821
|
}, undefined, true, undefined, this)
|
|
216286
216822
|
]
|
|
216287
216823
|
}, undefined, true, undefined, this),
|
|
216288
|
-
/* @__PURE__ */
|
|
216824
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216289
216825
|
paddingTop: 1,
|
|
216290
|
-
children: /* @__PURE__ */
|
|
216826
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
216291
216827
|
gap: 1,
|
|
216292
216828
|
children: [
|
|
216293
|
-
/* @__PURE__ */
|
|
216829
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216294
216830
|
color: "#89B4F8",
|
|
216295
216831
|
children: "esc"
|
|
216296
216832
|
}, undefined, false, undefined, this),
|
|
216297
|
-
/* @__PURE__ */
|
|
216833
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text3, {
|
|
216298
216834
|
color: "#AAAAAA",
|
|
216299
216835
|
children: "Cancel"
|
|
216300
216836
|
}, undefined, false, undefined, this)
|
|
@@ -216304,11 +216840,11 @@ function ContextSelectMenu(props) {
|
|
|
216304
216840
|
]
|
|
216305
216841
|
}, undefined, true, undefined, this);
|
|
216306
216842
|
}
|
|
216307
|
-
var
|
|
216843
|
+
var jsx_dev_runtime22;
|
|
216308
216844
|
var init_context_select_menu = __esm(async () => {
|
|
216309
216845
|
init_src3();
|
|
216310
216846
|
await init_build2();
|
|
216311
|
-
|
|
216847
|
+
jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216312
216848
|
});
|
|
216313
216849
|
|
|
216314
216850
|
// ../../packages/tui/src/components/menus/grill-question-menu.tsx
|
|
@@ -216332,15 +216868,24 @@ function GrillQuestionMenu(props) {
|
|
|
216332
216868
|
...q2.options.map((opt, i2) => ({ label: `${i2 + 1}. ${opt}`, value: opt })),
|
|
216333
216869
|
{ label: `${q2.options.length + 1}. Write-in...`, value: "custom" }
|
|
216334
216870
|
];
|
|
216335
|
-
return /* @__PURE__ */
|
|
216871
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216336
216872
|
flexDirection: "column",
|
|
216337
216873
|
paddingX: 1,
|
|
216338
216874
|
children: [
|
|
216339
|
-
/* @__PURE__ */
|
|
216875
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216340
216876
|
marginBottom: 1,
|
|
216341
216877
|
flexDirection: "column",
|
|
216342
216878
|
children: [
|
|
216343
|
-
/* @__PURE__ */
|
|
216879
|
+
q2.docSource && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216880
|
+
color: "#7DD3FC",
|
|
216881
|
+
bold: true,
|
|
216882
|
+
children: [
|
|
216883
|
+
"[Doc Grounding: ",
|
|
216884
|
+
q2.docSource,
|
|
216885
|
+
"]"
|
|
216886
|
+
]
|
|
216887
|
+
}, undefined, true, undefined, this),
|
|
216888
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216344
216889
|
color: "#89B4F8",
|
|
216345
216890
|
bold: true,
|
|
216346
216891
|
children: [
|
|
@@ -216351,55 +216896,55 @@ function GrillQuestionMenu(props) {
|
|
|
216351
216896
|
":"
|
|
216352
216897
|
]
|
|
216353
216898
|
}, undefined, true, undefined, this),
|
|
216354
|
-
/* @__PURE__ */
|
|
216899
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216355
216900
|
color: "white",
|
|
216356
216901
|
bold: true,
|
|
216357
216902
|
children: q2.question
|
|
216358
216903
|
}, undefined, false, undefined, this)
|
|
216359
216904
|
]
|
|
216360
216905
|
}, undefined, true, undefined, this),
|
|
216361
|
-
!customInputMode ? /* @__PURE__ */
|
|
216906
|
+
!customInputMode ? /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
|
|
216362
216907
|
children: [
|
|
216363
|
-
/* @__PURE__ */
|
|
216908
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(SelectInput_default, {
|
|
216364
216909
|
items,
|
|
216365
216910
|
onSelect: handleGrillSelect,
|
|
216366
216911
|
indicatorComponent: CustomIndicator,
|
|
216367
216912
|
itemComponent: CustomItem
|
|
216368
216913
|
}, undefined, false, undefined, this),
|
|
216369
|
-
/* @__PURE__ */
|
|
216914
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216370
216915
|
paddingTop: 1,
|
|
216371
|
-
children: /* @__PURE__ */
|
|
216916
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216372
216917
|
gap: 1,
|
|
216373
216918
|
children: [
|
|
216374
|
-
/* @__PURE__ */
|
|
216919
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216375
216920
|
color: "#89B4F8",
|
|
216376
216921
|
children: "↑↓"
|
|
216377
216922
|
}, undefined, false, undefined, this),
|
|
216378
|
-
/* @__PURE__ */
|
|
216923
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216379
216924
|
color: "#AAAAAA",
|
|
216380
216925
|
children: "Navigate"
|
|
216381
216926
|
}, undefined, false, undefined, this),
|
|
216382
|
-
/* @__PURE__ */
|
|
216927
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216383
216928
|
color: "#AAAAAA",
|
|
216384
216929
|
children: "·"
|
|
216385
216930
|
}, undefined, false, undefined, this),
|
|
216386
|
-
/* @__PURE__ */
|
|
216931
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216387
216932
|
color: "#89B4F8",
|
|
216388
216933
|
children: "enter"
|
|
216389
216934
|
}, undefined, false, undefined, this),
|
|
216390
|
-
/* @__PURE__ */
|
|
216935
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216391
216936
|
color: "#AAAAAA",
|
|
216392
216937
|
children: "Select"
|
|
216393
216938
|
}, undefined, false, undefined, this),
|
|
216394
|
-
/* @__PURE__ */
|
|
216939
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216395
216940
|
color: "#AAAAAA",
|
|
216396
216941
|
children: "·"
|
|
216397
216942
|
}, undefined, false, undefined, this),
|
|
216398
|
-
/* @__PURE__ */
|
|
216943
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216399
216944
|
color: "#89B4F8",
|
|
216400
216945
|
children: "esc"
|
|
216401
216946
|
}, undefined, false, undefined, this),
|
|
216402
|
-
/* @__PURE__ */
|
|
216947
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216403
216948
|
color: "#AAAAAA",
|
|
216404
216949
|
children: "Cancel"
|
|
216405
216950
|
}, undefined, false, undefined, this)
|
|
@@ -216407,26 +216952,28 @@ function GrillQuestionMenu(props) {
|
|
|
216407
216952
|
}, undefined, true, undefined, this)
|
|
216408
216953
|
}, undefined, false, undefined, this)
|
|
216409
216954
|
]
|
|
216410
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
216955
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216411
216956
|
flexDirection: "column",
|
|
216412
216957
|
gap: 1,
|
|
216413
216958
|
children: [
|
|
216414
|
-
/* @__PURE__ */
|
|
216959
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216415
216960
|
flexDirection: "row",
|
|
216416
216961
|
gap: 1,
|
|
216417
216962
|
children: [
|
|
216418
|
-
/* @__PURE__ */
|
|
216963
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216419
216964
|
color: "#89B4F8",
|
|
216420
216965
|
children: "Your answer:"
|
|
216421
216966
|
}, undefined, false, undefined, this),
|
|
216422
|
-
/* @__PURE__ */
|
|
216967
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(build_default2, {
|
|
216423
216968
|
focus: true,
|
|
216424
216969
|
value: customAnswer,
|
|
216425
216970
|
onChange: setCustomAnswer,
|
|
216426
216971
|
onSubmit: (value) => {
|
|
216427
216972
|
const answer = value.trim();
|
|
216428
|
-
if (answer.length === 0)
|
|
216973
|
+
if (answer.length === 0) {
|
|
216974
|
+
setCustomInputMode(false);
|
|
216429
216975
|
return;
|
|
216976
|
+
}
|
|
216430
216977
|
setCustomInputMode(false);
|
|
216431
216978
|
setCustomAnswer("");
|
|
216432
216979
|
const nextAnswers = [...grillAnswers, answer];
|
|
@@ -216440,28 +216987,28 @@ function GrillQuestionMenu(props) {
|
|
|
216440
216987
|
}, undefined, false, undefined, this)
|
|
216441
216988
|
]
|
|
216442
216989
|
}, undefined, true, undefined, this),
|
|
216443
|
-
/* @__PURE__ */
|
|
216990
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216444
216991
|
paddingTop: 1,
|
|
216445
|
-
children: /* @__PURE__ */
|
|
216992
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
216446
216993
|
gap: 1,
|
|
216447
216994
|
children: [
|
|
216448
|
-
/* @__PURE__ */
|
|
216995
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216449
216996
|
color: "#89B4F8",
|
|
216450
216997
|
children: "enter"
|
|
216451
216998
|
}, undefined, false, undefined, this),
|
|
216452
|
-
/* @__PURE__ */
|
|
216999
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216453
217000
|
color: "#AAAAAA",
|
|
216454
217001
|
children: "Submit"
|
|
216455
217002
|
}, undefined, false, undefined, this),
|
|
216456
|
-
/* @__PURE__ */
|
|
217003
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216457
217004
|
color: "#AAAAAA",
|
|
216458
217005
|
children: "·"
|
|
216459
217006
|
}, undefined, false, undefined, this),
|
|
216460
|
-
/* @__PURE__ */
|
|
217007
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216461
217008
|
color: "#89B4F8",
|
|
216462
217009
|
children: "esc"
|
|
216463
217010
|
}, undefined, false, undefined, this),
|
|
216464
|
-
/* @__PURE__ */
|
|
217011
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text3, {
|
|
216465
217012
|
color: "#AAAAAA",
|
|
216466
217013
|
children: "Cancel"
|
|
216467
217014
|
}, undefined, false, undefined, this)
|
|
@@ -216475,7 +217022,7 @@ function GrillQuestionMenu(props) {
|
|
|
216475
217022
|
}
|
|
216476
217023
|
return null;
|
|
216477
217024
|
}
|
|
216478
|
-
var
|
|
217025
|
+
var jsx_dev_runtime23;
|
|
216479
217026
|
var init_grill_question_menu = __esm(async () => {
|
|
216480
217027
|
await __promiseAll([
|
|
216481
217028
|
init_build2(),
|
|
@@ -216483,63 +217030,63 @@ var init_grill_question_menu = __esm(async () => {
|
|
|
216483
217030
|
init_build4(),
|
|
216484
217031
|
init_menu_items()
|
|
216485
217032
|
]);
|
|
216486
|
-
|
|
217033
|
+
jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216487
217034
|
});
|
|
216488
217035
|
|
|
216489
217036
|
// ../../packages/tui/src/components/menus/logout-select-menu.tsx
|
|
216490
217037
|
function LogoutSelectMenu(props) {
|
|
216491
217038
|
const { handleLogoutSelect, logoutItems } = props;
|
|
216492
|
-
return /* @__PURE__ */
|
|
217039
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
216493
217040
|
flexDirection: "column",
|
|
216494
217041
|
paddingX: 1,
|
|
216495
217042
|
children: [
|
|
216496
|
-
/* @__PURE__ */
|
|
217043
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
216497
217044
|
marginBottom: 1,
|
|
216498
|
-
children: /* @__PURE__ */
|
|
217045
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216499
217046
|
color: "white",
|
|
216500
217047
|
children: "Select credential to remove:"
|
|
216501
217048
|
}, undefined, false, undefined, this)
|
|
216502
217049
|
}, undefined, false, undefined, this),
|
|
216503
|
-
/* @__PURE__ */
|
|
217050
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(SelectInput_default, {
|
|
216504
217051
|
items: logoutItems,
|
|
216505
217052
|
onSelect: (item) => handleLogoutSelect(item.value),
|
|
216506
217053
|
indicatorComponent: CustomIndicator,
|
|
216507
217054
|
itemComponent: CustomItem
|
|
216508
217055
|
}, undefined, false, undefined, this),
|
|
216509
|
-
/* @__PURE__ */
|
|
217056
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
216510
217057
|
paddingTop: 1,
|
|
216511
|
-
children: /* @__PURE__ */
|
|
217058
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
216512
217059
|
gap: 1,
|
|
216513
217060
|
children: [
|
|
216514
|
-
/* @__PURE__ */
|
|
217061
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216515
217062
|
color: "#89B4F8",
|
|
216516
217063
|
children: "↑↓"
|
|
216517
217064
|
}, undefined, false, undefined, this),
|
|
216518
|
-
/* @__PURE__ */
|
|
217065
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216519
217066
|
color: "#AAAAAA",
|
|
216520
217067
|
children: "Navigate"
|
|
216521
217068
|
}, undefined, false, undefined, this),
|
|
216522
|
-
/* @__PURE__ */
|
|
217069
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216523
217070
|
color: "#AAAAAA",
|
|
216524
217071
|
children: "·"
|
|
216525
217072
|
}, undefined, false, undefined, this),
|
|
216526
|
-
/* @__PURE__ */
|
|
217073
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216527
217074
|
color: "#89B4F8",
|
|
216528
217075
|
children: "enter"
|
|
216529
217076
|
}, undefined, false, undefined, this),
|
|
216530
|
-
/* @__PURE__ */
|
|
217077
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216531
217078
|
color: "#AAAAAA",
|
|
216532
217079
|
children: "Select"
|
|
216533
217080
|
}, undefined, false, undefined, this),
|
|
216534
|
-
/* @__PURE__ */
|
|
217081
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216535
217082
|
color: "#AAAAAA",
|
|
216536
217083
|
children: "·"
|
|
216537
217084
|
}, undefined, false, undefined, this),
|
|
216538
|
-
/* @__PURE__ */
|
|
217085
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216539
217086
|
color: "#89B4F8",
|
|
216540
217087
|
children: "esc"
|
|
216541
217088
|
}, undefined, false, undefined, this),
|
|
216542
|
-
/* @__PURE__ */
|
|
217089
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text3, {
|
|
216543
217090
|
color: "#AAAAAA",
|
|
216544
217091
|
children: "Cancel"
|
|
216545
217092
|
}, undefined, false, undefined, this)
|
|
@@ -216549,73 +217096,73 @@ function LogoutSelectMenu(props) {
|
|
|
216549
217096
|
]
|
|
216550
217097
|
}, undefined, true, undefined, this);
|
|
216551
217098
|
}
|
|
216552
|
-
var
|
|
217099
|
+
var jsx_dev_runtime24;
|
|
216553
217100
|
var init_logout_select_menu = __esm(async () => {
|
|
216554
217101
|
await __promiseAll([
|
|
216555
217102
|
init_build2(),
|
|
216556
217103
|
init_build5(),
|
|
216557
217104
|
init_menu_items()
|
|
216558
217105
|
]);
|
|
216559
|
-
|
|
217106
|
+
jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216560
217107
|
});
|
|
216561
217108
|
|
|
216562
217109
|
// ../../packages/tui/src/components/menus/menu-menu.tsx
|
|
216563
217110
|
function MenuMenu(props) {
|
|
216564
217111
|
const { handleAuthMenuSelect } = props;
|
|
216565
|
-
return /* @__PURE__ */
|
|
217112
|
+
return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
216566
217113
|
flexDirection: "column",
|
|
216567
217114
|
paddingX: 1,
|
|
216568
217115
|
children: [
|
|
216569
|
-
/* @__PURE__ */
|
|
217116
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
216570
217117
|
marginBottom: 1,
|
|
216571
|
-
children: /* @__PURE__ */
|
|
217118
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216572
217119
|
color: "white",
|
|
216573
217120
|
children: "Select authentication method:"
|
|
216574
217121
|
}, undefined, false, undefined, this)
|
|
216575
217122
|
}, undefined, false, undefined, this),
|
|
216576
|
-
/* @__PURE__ */
|
|
217123
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(SelectInput_default, {
|
|
216577
217124
|
items: [
|
|
216578
|
-
{ label: "
|
|
216579
|
-
{ label: "
|
|
217125
|
+
{ label: "Bring Your Own Key (BYOK)", value: "byok" },
|
|
217126
|
+
{ label: "Login via December (Cloud Wallet)", value: "december" }
|
|
216580
217127
|
],
|
|
216581
217128
|
onSelect: handleAuthMenuSelect,
|
|
216582
217129
|
indicatorComponent: CustomIndicator,
|
|
216583
217130
|
itemComponent: CustomItem
|
|
216584
217131
|
}, undefined, false, undefined, this),
|
|
216585
|
-
/* @__PURE__ */
|
|
217132
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
216586
217133
|
paddingTop: 1,
|
|
216587
|
-
children: /* @__PURE__ */
|
|
217134
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
216588
217135
|
gap: 1,
|
|
216589
217136
|
children: [
|
|
216590
|
-
/* @__PURE__ */
|
|
217137
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216591
217138
|
color: "#89B4F8",
|
|
216592
217139
|
children: "↑↓"
|
|
216593
217140
|
}, undefined, false, undefined, this),
|
|
216594
|
-
/* @__PURE__ */
|
|
217141
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216595
217142
|
color: "#AAAAAA",
|
|
216596
217143
|
children: "Navigate"
|
|
216597
217144
|
}, undefined, false, undefined, this),
|
|
216598
|
-
/* @__PURE__ */
|
|
217145
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216599
217146
|
color: "#AAAAAA",
|
|
216600
217147
|
children: "·"
|
|
216601
217148
|
}, undefined, false, undefined, this),
|
|
216602
|
-
/* @__PURE__ */
|
|
217149
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216603
217150
|
color: "#89B4F8",
|
|
216604
217151
|
children: "enter"
|
|
216605
217152
|
}, undefined, false, undefined, this),
|
|
216606
|
-
/* @__PURE__ */
|
|
217153
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216607
217154
|
color: "#AAAAAA",
|
|
216608
217155
|
children: "Select"
|
|
216609
217156
|
}, undefined, false, undefined, this),
|
|
216610
|
-
/* @__PURE__ */
|
|
217157
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216611
217158
|
color: "#AAAAAA",
|
|
216612
217159
|
children: "·"
|
|
216613
217160
|
}, undefined, false, undefined, this),
|
|
216614
|
-
/* @__PURE__ */
|
|
217161
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216615
217162
|
color: "#89B4F8",
|
|
216616
217163
|
children: "esc"
|
|
216617
217164
|
}, undefined, false, undefined, this),
|
|
216618
|
-
/* @__PURE__ */
|
|
217165
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text3, {
|
|
216619
217166
|
color: "#AAAAAA",
|
|
216620
217167
|
children: "Cancel"
|
|
216621
217168
|
}, undefined, false, undefined, this)
|
|
@@ -216625,70 +217172,70 @@ function MenuMenu(props) {
|
|
|
216625
217172
|
]
|
|
216626
217173
|
}, undefined, true, undefined, this);
|
|
216627
217174
|
}
|
|
216628
|
-
var
|
|
217175
|
+
var jsx_dev_runtime25;
|
|
216629
217176
|
var init_menu_menu = __esm(async () => {
|
|
216630
217177
|
await __promiseAll([
|
|
216631
217178
|
init_build2(),
|
|
216632
217179
|
init_build5(),
|
|
216633
217180
|
init_menu_items()
|
|
216634
217181
|
]);
|
|
216635
|
-
|
|
217182
|
+
jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216636
217183
|
});
|
|
216637
217184
|
|
|
216638
217185
|
// ../../packages/tui/src/components/menus/model-select-menu.tsx
|
|
216639
217186
|
function ModelSelectMenu(props) {
|
|
216640
217187
|
const { handleModelSelect, selectedProvider, openRouterModels, getProviderModels } = props;
|
|
216641
|
-
return /* @__PURE__ */
|
|
217188
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
216642
217189
|
flexDirection: "column",
|
|
216643
217190
|
paddingX: 1,
|
|
216644
217191
|
children: [
|
|
216645
|
-
/* @__PURE__ */
|
|
217192
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
216646
217193
|
marginBottom: 1,
|
|
216647
|
-
children: /* @__PURE__ */
|
|
217194
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216648
217195
|
color: "white",
|
|
216649
217196
|
children: "Select Model:"
|
|
216650
217197
|
}, undefined, false, undefined, this)
|
|
216651
217198
|
}, undefined, false, undefined, this),
|
|
216652
|
-
/* @__PURE__ */
|
|
217199
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(SelectInput_default, {
|
|
216653
217200
|
items: selectedProvider === "openrouter" ? openRouterModels || [{ label: "Loading models...", value: "loading" }] : getProviderModels(selectedProvider),
|
|
216654
217201
|
onSelect: handleModelSelect,
|
|
216655
217202
|
indicatorComponent: CustomIndicator,
|
|
216656
217203
|
itemComponent: CustomItem
|
|
216657
217204
|
}, undefined, false, undefined, this),
|
|
216658
|
-
/* @__PURE__ */
|
|
217205
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
216659
217206
|
paddingTop: 1,
|
|
216660
|
-
children: /* @__PURE__ */
|
|
217207
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
216661
217208
|
gap: 1,
|
|
216662
217209
|
children: [
|
|
216663
|
-
/* @__PURE__ */
|
|
217210
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216664
217211
|
color: "#89B4F8",
|
|
216665
217212
|
children: "↑↓"
|
|
216666
217213
|
}, undefined, false, undefined, this),
|
|
216667
|
-
/* @__PURE__ */
|
|
217214
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216668
217215
|
color: "#AAAAAA",
|
|
216669
217216
|
children: "Navigate"
|
|
216670
217217
|
}, undefined, false, undefined, this),
|
|
216671
|
-
/* @__PURE__ */
|
|
217218
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216672
217219
|
color: "#AAAAAA",
|
|
216673
217220
|
children: "·"
|
|
216674
217221
|
}, undefined, false, undefined, this),
|
|
216675
|
-
/* @__PURE__ */
|
|
217222
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216676
217223
|
color: "#89B4F8",
|
|
216677
217224
|
children: "enter"
|
|
216678
217225
|
}, undefined, false, undefined, this),
|
|
216679
|
-
/* @__PURE__ */
|
|
217226
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216680
217227
|
color: "#AAAAAA",
|
|
216681
217228
|
children: "Select"
|
|
216682
217229
|
}, undefined, false, undefined, this),
|
|
216683
|
-
/* @__PURE__ */
|
|
217230
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216684
217231
|
color: "#AAAAAA",
|
|
216685
217232
|
children: "·"
|
|
216686
217233
|
}, undefined, false, undefined, this),
|
|
216687
|
-
/* @__PURE__ */
|
|
217234
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216688
217235
|
color: "#89B4F8",
|
|
216689
217236
|
children: "esc"
|
|
216690
217237
|
}, undefined, false, undefined, this),
|
|
216691
|
-
/* @__PURE__ */
|
|
217238
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text3, {
|
|
216692
217239
|
color: "#AAAAAA",
|
|
216693
217240
|
children: "Cancel"
|
|
216694
217241
|
}, undefined, false, undefined, this)
|
|
@@ -216698,14 +217245,14 @@ function ModelSelectMenu(props) {
|
|
|
216698
217245
|
]
|
|
216699
217246
|
}, undefined, true, undefined, this);
|
|
216700
217247
|
}
|
|
216701
|
-
var
|
|
217248
|
+
var jsx_dev_runtime26;
|
|
216702
217249
|
var init_model_select_menu = __esm(async () => {
|
|
216703
217250
|
await __promiseAll([
|
|
216704
217251
|
init_build2(),
|
|
216705
217252
|
init_build5(),
|
|
216706
217253
|
init_menu_items()
|
|
216707
217254
|
]);
|
|
216708
|
-
|
|
217255
|
+
jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216709
217256
|
});
|
|
216710
217257
|
|
|
216711
217258
|
// ../../packages/tui/src/components/menus/plan-approve-menu.tsx
|
|
@@ -216715,59 +217262,59 @@ function PlanApproveMenu(props) {
|
|
|
216715
217262
|
{ label: "1. Approve and Execute", value: "approve" },
|
|
216716
217263
|
{ label: "2. Reject / Cancel", value: "reject" }
|
|
216717
217264
|
];
|
|
216718
|
-
return /* @__PURE__ */
|
|
217265
|
+
return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
216719
217266
|
flexDirection: "column",
|
|
216720
217267
|
paddingX: 1,
|
|
216721
217268
|
children: [
|
|
216722
|
-
/* @__PURE__ */
|
|
217269
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
216723
217270
|
marginBottom: 1,
|
|
216724
217271
|
flexDirection: "column",
|
|
216725
217272
|
gap: 1,
|
|
216726
217273
|
children: [
|
|
216727
|
-
planSummary && /* @__PURE__ */
|
|
217274
|
+
planSummary && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
216728
217275
|
borderStyle: "round",
|
|
216729
217276
|
borderColor: "cyan",
|
|
216730
217277
|
paddingX: 1,
|
|
216731
|
-
children: /* @__PURE__ */
|
|
217278
|
+
children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216732
217279
|
color: "cyan",
|
|
216733
217280
|
children: planSummary
|
|
216734
217281
|
}, undefined, false, undefined, this)
|
|
216735
217282
|
}, undefined, false, undefined, this),
|
|
216736
|
-
/* @__PURE__ */
|
|
217283
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216737
217284
|
color: "white",
|
|
216738
217285
|
bold: true,
|
|
216739
217286
|
children: "Plan generated. Please approve or reject:"
|
|
216740
217287
|
}, undefined, false, undefined, this)
|
|
216741
217288
|
]
|
|
216742
217289
|
}, undefined, true, undefined, this),
|
|
216743
|
-
/* @__PURE__ */
|
|
217290
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(SelectInput_default, {
|
|
216744
217291
|
items: planItems,
|
|
216745
217292
|
onSelect: handlePlanApprovalSelect,
|
|
216746
217293
|
indicatorComponent: CustomIndicator,
|
|
216747
217294
|
itemComponent: CustomItem
|
|
216748
217295
|
}, undefined, false, undefined, this),
|
|
216749
|
-
/* @__PURE__ */
|
|
217296
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
216750
217297
|
paddingTop: 1,
|
|
216751
|
-
children: /* @__PURE__ */
|
|
217298
|
+
children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
216752
217299
|
gap: 1,
|
|
216753
217300
|
children: [
|
|
216754
|
-
/* @__PURE__ */
|
|
217301
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216755
217302
|
color: "#89B4F8",
|
|
216756
217303
|
children: "↑↓"
|
|
216757
217304
|
}, undefined, false, undefined, this),
|
|
216758
|
-
/* @__PURE__ */
|
|
217305
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216759
217306
|
color: "#AAAAAA",
|
|
216760
217307
|
children: "Navigate"
|
|
216761
217308
|
}, undefined, false, undefined, this),
|
|
216762
|
-
/* @__PURE__ */
|
|
217309
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216763
217310
|
color: "#AAAAAA",
|
|
216764
217311
|
children: "·"
|
|
216765
217312
|
}, undefined, false, undefined, this),
|
|
216766
|
-
/* @__PURE__ */
|
|
217313
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216767
217314
|
color: "#89B4F8",
|
|
216768
217315
|
children: "enter"
|
|
216769
217316
|
}, undefined, false, undefined, this),
|
|
216770
|
-
/* @__PURE__ */
|
|
217317
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text3, {
|
|
216771
217318
|
color: "#AAAAAA",
|
|
216772
217319
|
children: "Select"
|
|
216773
217320
|
}, undefined, false, undefined, this)
|
|
@@ -216777,14 +217324,14 @@ function PlanApproveMenu(props) {
|
|
|
216777
217324
|
]
|
|
216778
217325
|
}, undefined, true, undefined, this);
|
|
216779
217326
|
}
|
|
216780
|
-
var
|
|
217327
|
+
var jsx_dev_runtime27;
|
|
216781
217328
|
var init_plan_approve_menu = __esm(async () => {
|
|
216782
217329
|
await __promiseAll([
|
|
216783
217330
|
init_build2(),
|
|
216784
217331
|
init_build5(),
|
|
216785
217332
|
init_menu_items()
|
|
216786
217333
|
]);
|
|
216787
|
-
|
|
217334
|
+
jsx_dev_runtime27 = __toESM(require_jsx_dev_runtime(), 1);
|
|
216788
217335
|
});
|
|
216789
217336
|
|
|
216790
217337
|
// ../../packages/tui/src/components/menus/session-select-menu.tsx
|
|
@@ -216904,13 +217451,13 @@ function SessionSelectMenu(props) {
|
|
|
216904
217451
|
}
|
|
216905
217452
|
}
|
|
216906
217453
|
});
|
|
216907
|
-
return /* @__PURE__ */
|
|
217454
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216908
217455
|
flexDirection: "column",
|
|
216909
217456
|
paddingX: 1,
|
|
216910
217457
|
children: [
|
|
216911
|
-
/* @__PURE__ */
|
|
217458
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216912
217459
|
marginBottom: 1,
|
|
216913
|
-
children: /* @__PURE__ */
|
|
217460
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216914
217461
|
bold: true,
|
|
216915
217462
|
color: "white",
|
|
216916
217463
|
children: "Sessions"
|
|
@@ -216919,17 +217466,17 @@ function SessionSelectMenu(props) {
|
|
|
216919
217466
|
visibleItems.map((session, idx) => {
|
|
216920
217467
|
const isSelected = idx === sessionSelectedIndex;
|
|
216921
217468
|
if (isSelected && sessionRenameMode) {
|
|
216922
|
-
return /* @__PURE__ */
|
|
217469
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216923
217470
|
flexDirection: "row",
|
|
216924
217471
|
children: [
|
|
216925
|
-
/* @__PURE__ */
|
|
217472
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216926
217473
|
width: 2,
|
|
216927
|
-
children: /* @__PURE__ */
|
|
217474
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216928
217475
|
color: "#89B4F8",
|
|
216929
217476
|
children: "❭ "
|
|
216930
217477
|
}, undefined, false, undefined, this)
|
|
216931
217478
|
}, undefined, false, undefined, this),
|
|
216932
|
-
/* @__PURE__ */
|
|
217479
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(build_default2, {
|
|
216933
217480
|
value: sessionNewName,
|
|
216934
217481
|
onChange: setSessionNewName,
|
|
216935
217482
|
onSubmit: handleRenameSubmit,
|
|
@@ -216939,29 +217486,31 @@ function SessionSelectMenu(props) {
|
|
|
216939
217486
|
}, session.id, true, undefined, this);
|
|
216940
217487
|
}
|
|
216941
217488
|
const isCustomName = !session.id.startsWith("session-");
|
|
216942
|
-
const
|
|
217489
|
+
const rawTitle = isCustomName ? session.id : session.preview || session.id;
|
|
217490
|
+
const singleLineTitle = (rawTitle || "").replace(/\s+/g, " ").trim();
|
|
217491
|
+
const title = singleLineTitle.length > 50 ? singleLineTitle.slice(0, 50) + "..." : singleLineTitle;
|
|
216943
217492
|
const timeStr = timeAgo(session.updatedAt).padStart(10);
|
|
216944
|
-
return /* @__PURE__ */
|
|
217493
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216945
217494
|
flexDirection: "row",
|
|
216946
217495
|
children: [
|
|
216947
|
-
/* @__PURE__ */
|
|
217496
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216948
217497
|
width: 2,
|
|
216949
|
-
children: /* @__PURE__ */
|
|
217498
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216950
217499
|
color: isSelected ? "#89B4F8" : "white",
|
|
216951
217500
|
children: isSelected ? "❭ " : " "
|
|
216952
217501
|
}, undefined, false, undefined, this)
|
|
216953
217502
|
}, undefined, false, undefined, this),
|
|
216954
|
-
/* @__PURE__ */
|
|
217503
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216955
217504
|
width: 97,
|
|
216956
|
-
children: /* @__PURE__ */
|
|
217505
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216957
217506
|
color: isSelected ? "#89B4F8" : "#AAAAAA",
|
|
216958
217507
|
wrap: "truncate",
|
|
216959
217508
|
children: title
|
|
216960
217509
|
}, undefined, false, undefined, this)
|
|
216961
217510
|
}, undefined, false, undefined, this),
|
|
216962
|
-
/* @__PURE__ */
|
|
217511
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216963
217512
|
width: 12,
|
|
216964
|
-
children: /* @__PURE__ */
|
|
217513
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216965
217514
|
color: "#AAAAAA",
|
|
216966
217515
|
children: timeStr
|
|
216967
217516
|
}, undefined, false, undefined, this)
|
|
@@ -216969,17 +217518,17 @@ function SessionSelectMenu(props) {
|
|
|
216969
217518
|
]
|
|
216970
217519
|
}, session.id, true, undefined, this);
|
|
216971
217520
|
}),
|
|
216972
|
-
totalItems === 0 && /* @__PURE__ */
|
|
217521
|
+
totalItems === 0 && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216973
217522
|
paddingLeft: 2,
|
|
216974
|
-
children: /* @__PURE__ */
|
|
217523
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216975
217524
|
color: "#555555",
|
|
216976
217525
|
children: "No sessions found."
|
|
216977
217526
|
}, undefined, false, undefined, this)
|
|
216978
217527
|
}, undefined, false, undefined, this),
|
|
216979
|
-
totalItems > 0 && /* @__PURE__ */
|
|
217528
|
+
totalItems > 0 && /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216980
217529
|
marginTop: 1,
|
|
216981
217530
|
paddingLeft: 2,
|
|
216982
|
-
children: /* @__PURE__ */
|
|
217531
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
216983
217532
|
color: "#555555",
|
|
216984
217533
|
children: [
|
|
216985
217534
|
"[",
|
|
@@ -216993,76 +217542,76 @@ function SessionSelectMenu(props) {
|
|
|
216993
217542
|
]
|
|
216994
217543
|
}, undefined, true, undefined, this)
|
|
216995
217544
|
}, undefined, false, undefined, this),
|
|
216996
|
-
/* @__PURE__ */
|
|
217545
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216997
217546
|
paddingTop: 1,
|
|
216998
|
-
children: /* @__PURE__ */
|
|
217547
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
216999
217548
|
gap: 1,
|
|
217000
217549
|
children: [
|
|
217001
|
-
/* @__PURE__ */
|
|
217550
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217002
217551
|
color: "#89B4F8",
|
|
217003
217552
|
children: "↑/↓"
|
|
217004
217553
|
}, undefined, false, undefined, this),
|
|
217005
|
-
/* @__PURE__ */
|
|
217554
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217006
217555
|
color: "#AAAAAA",
|
|
217007
217556
|
children: "Navigate"
|
|
217008
217557
|
}, undefined, false, undefined, this),
|
|
217009
|
-
/* @__PURE__ */
|
|
217558
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217010
217559
|
color: "#AAAAAA",
|
|
217011
217560
|
children: "·"
|
|
217012
217561
|
}, undefined, false, undefined, this),
|
|
217013
|
-
/* @__PURE__ */
|
|
217562
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217014
217563
|
color: "#89B4F8",
|
|
217015
217564
|
children: "←/→"
|
|
217016
217565
|
}, undefined, false, undefined, this),
|
|
217017
|
-
/* @__PURE__ */
|
|
217566
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217018
217567
|
color: "#AAAAAA",
|
|
217019
217568
|
children: "Page"
|
|
217020
217569
|
}, undefined, false, undefined, this),
|
|
217021
|
-
/* @__PURE__ */
|
|
217570
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217022
217571
|
color: "#AAAAAA",
|
|
217023
217572
|
children: "·"
|
|
217024
217573
|
}, undefined, false, undefined, this),
|
|
217025
|
-
/* @__PURE__ */
|
|
217574
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217026
217575
|
color: "#89B4F8",
|
|
217027
217576
|
children: "enter"
|
|
217028
217577
|
}, undefined, false, undefined, this),
|
|
217029
|
-
/* @__PURE__ */
|
|
217578
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217030
217579
|
color: "#AAAAAA",
|
|
217031
217580
|
children: "Select"
|
|
217032
217581
|
}, undefined, false, undefined, this),
|
|
217033
|
-
/* @__PURE__ */
|
|
217582
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217034
217583
|
color: "#AAAAAA",
|
|
217035
217584
|
children: "·"
|
|
217036
217585
|
}, undefined, false, undefined, this),
|
|
217037
|
-
/* @__PURE__ */
|
|
217586
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217038
217587
|
color: "#89B4F8",
|
|
217039
217588
|
children: "r"
|
|
217040
217589
|
}, undefined, false, undefined, this),
|
|
217041
|
-
/* @__PURE__ */
|
|
217590
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217042
217591
|
color: "#AAAAAA",
|
|
217043
217592
|
children: "Rename"
|
|
217044
217593
|
}, undefined, false, undefined, this),
|
|
217045
|
-
/* @__PURE__ */
|
|
217594
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217046
217595
|
color: "#AAAAAA",
|
|
217047
217596
|
children: "·"
|
|
217048
217597
|
}, undefined, false, undefined, this),
|
|
217049
|
-
/* @__PURE__ */
|
|
217598
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217050
217599
|
color: "#89B4F8",
|
|
217051
217600
|
children: "d"
|
|
217052
217601
|
}, undefined, false, undefined, this),
|
|
217053
|
-
/* @__PURE__ */
|
|
217602
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217054
217603
|
color: "#AAAAAA",
|
|
217055
217604
|
children: "Delete"
|
|
217056
217605
|
}, undefined, false, undefined, this),
|
|
217057
|
-
/* @__PURE__ */
|
|
217606
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217058
217607
|
color: "#AAAAAA",
|
|
217059
217608
|
children: "·"
|
|
217060
217609
|
}, undefined, false, undefined, this),
|
|
217061
|
-
/* @__PURE__ */
|
|
217610
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217062
217611
|
color: "#89B4F8",
|
|
217063
217612
|
children: "esc"
|
|
217064
217613
|
}, undefined, false, undefined, this),
|
|
217065
|
-
/* @__PURE__ */
|
|
217614
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text3, {
|
|
217066
217615
|
color: "#AAAAAA",
|
|
217067
217616
|
children: "Cancel"
|
|
217068
217617
|
}, undefined, false, undefined, this)
|
|
@@ -217072,13 +217621,13 @@ function SessionSelectMenu(props) {
|
|
|
217072
217621
|
]
|
|
217073
217622
|
}, undefined, true, undefined, this);
|
|
217074
217623
|
}
|
|
217075
|
-
var
|
|
217624
|
+
var jsx_dev_runtime28;
|
|
217076
217625
|
var init_session_select_menu = __esm(async () => {
|
|
217077
217626
|
await __promiseAll([
|
|
217078
217627
|
init_build2(),
|
|
217079
217628
|
init_build4()
|
|
217080
217629
|
]);
|
|
217081
|
-
|
|
217630
|
+
jsx_dev_runtime28 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217082
217631
|
});
|
|
217083
217632
|
|
|
217084
217633
|
// ../../packages/tui/src/components/menus/settings-main-menu.tsx
|
|
@@ -217126,58 +217675,58 @@ function SettingsMainMenu(props) {
|
|
|
217126
217675
|
value: "authPriority"
|
|
217127
217676
|
});
|
|
217128
217677
|
}
|
|
217129
|
-
return /* @__PURE__ */
|
|
217678
|
+
return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
217130
217679
|
flexDirection: "column",
|
|
217131
217680
|
paddingX: 1,
|
|
217132
217681
|
children: [
|
|
217133
|
-
/* @__PURE__ */
|
|
217682
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
217134
217683
|
marginBottom: 1,
|
|
217135
|
-
children: /* @__PURE__ */
|
|
217684
|
+
children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217136
217685
|
bold: true,
|
|
217137
217686
|
color: "white",
|
|
217138
217687
|
children: "Settings"
|
|
217139
217688
|
}, undefined, false, undefined, this)
|
|
217140
217689
|
}, undefined, false, undefined, this),
|
|
217141
|
-
/* @__PURE__ */
|
|
217690
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(SelectInput_default, {
|
|
217142
217691
|
items: mainItems,
|
|
217143
217692
|
onSelect: handleSettingsMainSelect,
|
|
217144
217693
|
indicatorComponent: CustomIndicator,
|
|
217145
217694
|
itemComponent: CustomItem
|
|
217146
217695
|
}, undefined, false, undefined, this),
|
|
217147
|
-
/* @__PURE__ */
|
|
217696
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
217148
217697
|
paddingTop: 1,
|
|
217149
|
-
children: /* @__PURE__ */
|
|
217698
|
+
children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
217150
217699
|
gap: 1,
|
|
217151
217700
|
children: [
|
|
217152
|
-
/* @__PURE__ */
|
|
217701
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217153
217702
|
color: "#89B4F8",
|
|
217154
217703
|
children: "↑↓"
|
|
217155
217704
|
}, undefined, false, undefined, this),
|
|
217156
|
-
/* @__PURE__ */
|
|
217705
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217157
217706
|
color: "#AAAAAA",
|
|
217158
217707
|
children: "Navigate"
|
|
217159
217708
|
}, undefined, false, undefined, this),
|
|
217160
|
-
/* @__PURE__ */
|
|
217709
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217161
217710
|
color: "#AAAAAA",
|
|
217162
217711
|
children: "·"
|
|
217163
217712
|
}, undefined, false, undefined, this),
|
|
217164
|
-
/* @__PURE__ */
|
|
217713
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217165
217714
|
color: "#89B4F8",
|
|
217166
217715
|
children: "enter"
|
|
217167
217716
|
}, undefined, false, undefined, this),
|
|
217168
|
-
/* @__PURE__ */
|
|
217717
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217169
217718
|
color: "#AAAAAA",
|
|
217170
217719
|
children: "Toggle"
|
|
217171
217720
|
}, undefined, false, undefined, this),
|
|
217172
|
-
/* @__PURE__ */
|
|
217721
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217173
217722
|
color: "#AAAAAA",
|
|
217174
217723
|
children: "·"
|
|
217175
217724
|
}, undefined, false, undefined, this),
|
|
217176
|
-
/* @__PURE__ */
|
|
217725
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217177
217726
|
color: "#89B4F8",
|
|
217178
217727
|
children: "esc"
|
|
217179
217728
|
}, undefined, false, undefined, this),
|
|
217180
|
-
/* @__PURE__ */
|
|
217729
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text3, {
|
|
217181
217730
|
color: "#AAAAAA",
|
|
217182
217731
|
children: "Cancel"
|
|
217183
217732
|
}, undefined, false, undefined, this)
|
|
@@ -217187,14 +217736,14 @@ function SettingsMainMenu(props) {
|
|
|
217187
217736
|
]
|
|
217188
217737
|
}, undefined, true, undefined, this);
|
|
217189
217738
|
}
|
|
217190
|
-
var
|
|
217739
|
+
var jsx_dev_runtime29;
|
|
217191
217740
|
var init_settings_main_menu = __esm(async () => {
|
|
217192
217741
|
await __promiseAll([
|
|
217193
217742
|
init_build2(),
|
|
217194
217743
|
init_build5(),
|
|
217195
217744
|
init_menu_items()
|
|
217196
217745
|
]);
|
|
217197
|
-
|
|
217746
|
+
jsx_dev_runtime29 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217198
217747
|
});
|
|
217199
217748
|
|
|
217200
217749
|
// ../../packages/tui/src/components/menus/tasks-mode-menu.tsx
|
|
@@ -217203,13 +217752,12 @@ function TasksModeMenu(props) {
|
|
|
217203
217752
|
const getStatusColor = (status) => {
|
|
217204
217753
|
switch (status) {
|
|
217205
217754
|
case "running":
|
|
217206
|
-
return "#
|
|
217755
|
+
return "#fef08a";
|
|
217207
217756
|
case "completed":
|
|
217208
|
-
return "#
|
|
217757
|
+
return "#6EE7B7";
|
|
217209
217758
|
case "failed":
|
|
217210
|
-
return "#E74C3C";
|
|
217211
217759
|
case "killed":
|
|
217212
|
-
return "#
|
|
217760
|
+
return "#FCA5A5";
|
|
217213
217761
|
default:
|
|
217214
217762
|
return "white";
|
|
217215
217763
|
}
|
|
@@ -217219,15 +217767,15 @@ function TasksModeMenu(props) {
|
|
|
217219
217767
|
if (task) {
|
|
217220
217768
|
const outputLines = task.output.split("\\n");
|
|
217221
217769
|
const visibleLines = outputLines.slice(taskScrollOffset, taskScrollOffset + 15);
|
|
217222
|
-
return /* @__PURE__ */
|
|
217770
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217223
217771
|
flexDirection: "column",
|
|
217224
217772
|
paddingX: 1,
|
|
217225
217773
|
children: [
|
|
217226
|
-
/* @__PURE__ */
|
|
217774
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217227
217775
|
marginBottom: 1,
|
|
217228
217776
|
justifyContent: "space-between",
|
|
217229
217777
|
children: [
|
|
217230
|
-
/* @__PURE__ */
|
|
217778
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217231
217779
|
bold: true,
|
|
217232
217780
|
color: "white",
|
|
217233
217781
|
children: [
|
|
@@ -217235,7 +217783,7 @@ function TasksModeMenu(props) {
|
|
|
217235
217783
|
task.id
|
|
217236
217784
|
]
|
|
217237
217785
|
}, undefined, true, undefined, this),
|
|
217238
|
-
/* @__PURE__ */
|
|
217786
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217239
217787
|
bold: true,
|
|
217240
217788
|
color: getStatusColor(task.status),
|
|
217241
217789
|
children: [
|
|
@@ -217246,9 +217794,9 @@ function TasksModeMenu(props) {
|
|
|
217246
217794
|
}, undefined, true, undefined, this)
|
|
217247
217795
|
]
|
|
217248
217796
|
}, undefined, true, undefined, this),
|
|
217249
|
-
/* @__PURE__ */
|
|
217797
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217250
217798
|
marginBottom: 1,
|
|
217251
|
-
children: /* @__PURE__ */
|
|
217799
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217252
217800
|
color: "#AAAAAA",
|
|
217253
217801
|
bold: true,
|
|
217254
217802
|
children: [
|
|
@@ -217257,24 +217805,24 @@ function TasksModeMenu(props) {
|
|
|
217257
217805
|
]
|
|
217258
217806
|
}, undefined, true, undefined, this)
|
|
217259
217807
|
}, undefined, false, undefined, this),
|
|
217260
|
-
/* @__PURE__ */
|
|
217808
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217261
217809
|
borderColor: "#333333",
|
|
217262
217810
|
borderStyle: "round",
|
|
217263
217811
|
flexDirection: "column",
|
|
217264
217812
|
minHeight: 8,
|
|
217265
217813
|
paddingX: 1,
|
|
217266
|
-
children: visibleLines.length === 0 || visibleLines.length === 1 && visibleLines[0] === "" ? /* @__PURE__ */
|
|
217814
|
+
children: visibleLines.length === 0 || visibleLines.length === 1 && visibleLines[0] === "" ? /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217267
217815
|
color: "gray",
|
|
217268
217816
|
children: "[No output recorded yet]"
|
|
217269
|
-
}, undefined, false, undefined, this) : visibleLines.map((line, idx) => /* @__PURE__ */
|
|
217817
|
+
}, undefined, false, undefined, this) : visibleLines.map((line, idx) => /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217270
217818
|
color: "white",
|
|
217271
217819
|
children: line
|
|
217272
217820
|
}, idx, false, undefined, this))
|
|
217273
217821
|
}, undefined, false, undefined, this),
|
|
217274
|
-
/* @__PURE__ */
|
|
217822
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217275
217823
|
marginTop: 1,
|
|
217276
217824
|
justifyContent: "space-between",
|
|
217277
|
-
children: /* @__PURE__ */
|
|
217825
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217278
217826
|
color: "gray",
|
|
217279
217827
|
children: [
|
|
217280
217828
|
"Showing lines ",
|
|
@@ -217287,9 +217835,9 @@ function TasksModeMenu(props) {
|
|
|
217287
217835
|
]
|
|
217288
217836
|
}, undefined, true, undefined, this)
|
|
217289
217837
|
}, undefined, false, undefined, this),
|
|
217290
|
-
/* @__PURE__ */
|
|
217838
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217291
217839
|
paddingTop: 1,
|
|
217292
|
-
children: /* @__PURE__ */
|
|
217840
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217293
217841
|
color: "#555555",
|
|
217294
217842
|
children: "↑/↓ Scroll Line · ←/→ Page · esc Cancel"
|
|
217295
217843
|
}, undefined, false, undefined, this)
|
|
@@ -217298,48 +217846,48 @@ function TasksModeMenu(props) {
|
|
|
217298
217846
|
}, undefined, true, undefined, this);
|
|
217299
217847
|
}
|
|
217300
217848
|
} else {
|
|
217301
|
-
return /* @__PURE__ */
|
|
217849
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217302
217850
|
flexDirection: "column",
|
|
217303
217851
|
paddingX: 1,
|
|
217304
217852
|
children: [
|
|
217305
|
-
/* @__PURE__ */
|
|
217853
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217306
217854
|
marginBottom: 1,
|
|
217307
|
-
children: /* @__PURE__ */
|
|
217855
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217308
217856
|
bold: true,
|
|
217309
217857
|
color: "white",
|
|
217310
217858
|
children: "Tasks"
|
|
217311
217859
|
}, undefined, false, undefined, this)
|
|
217312
217860
|
}, undefined, false, undefined, this),
|
|
217313
|
-
tasksData.length === 0 ? /* @__PURE__ */
|
|
217861
|
+
tasksData.length === 0 ? /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217314
217862
|
paddingLeft: 2,
|
|
217315
|
-
children: /* @__PURE__ */
|
|
217863
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217316
217864
|
color: "#555555",
|
|
217317
217865
|
children: "No background tasks."
|
|
217318
217866
|
}, undefined, false, undefined, this)
|
|
217319
217867
|
}, undefined, false, undefined, this) : tasksData.map((task, idx) => {
|
|
217320
217868
|
const isSelected = idx === taskSelectedIndex;
|
|
217321
217869
|
const truncatedCommand = task.command.length > 50 ? task.command.slice(0, 47) + "..." : task.command;
|
|
217322
|
-
return /* @__PURE__ */
|
|
217870
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217323
217871
|
flexDirection: "row",
|
|
217324
217872
|
children: [
|
|
217325
|
-
/* @__PURE__ */
|
|
217873
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217326
217874
|
width: 2,
|
|
217327
|
-
children: /* @__PURE__ */
|
|
217875
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217328
217876
|
color: isSelected ? "#89B4F8" : "white",
|
|
217329
217877
|
children: isSelected ? "> " : " "
|
|
217330
217878
|
}, undefined, false, undefined, this)
|
|
217331
217879
|
}, undefined, false, undefined, this),
|
|
217332
|
-
/* @__PURE__ */
|
|
217880
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217333
217881
|
width: 25,
|
|
217334
|
-
children: /* @__PURE__ */
|
|
217882
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217335
217883
|
color: isSelected ? "white" : "#AAAAAA",
|
|
217336
217884
|
wrap: "truncate",
|
|
217337
217885
|
children: task.id
|
|
217338
217886
|
}, undefined, false, undefined, this)
|
|
217339
217887
|
}, undefined, false, undefined, this),
|
|
217340
|
-
/* @__PURE__ */
|
|
217888
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217341
217889
|
width: 15,
|
|
217342
|
-
children: /* @__PURE__ */
|
|
217890
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217343
217891
|
color: getStatusColor(task.status),
|
|
217344
217892
|
children: [
|
|
217345
217893
|
"[",
|
|
@@ -217348,8 +217896,8 @@ function TasksModeMenu(props) {
|
|
|
217348
217896
|
]
|
|
217349
217897
|
}, undefined, true, undefined, this)
|
|
217350
217898
|
}, undefined, false, undefined, this),
|
|
217351
|
-
/* @__PURE__ */
|
|
217352
|
-
children: /* @__PURE__ */
|
|
217899
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217900
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217353
217901
|
color: isSelected ? "white" : "gray",
|
|
217354
217902
|
children: truncatedCommand
|
|
217355
217903
|
}, undefined, false, undefined, this)
|
|
@@ -217357,64 +217905,64 @@ function TasksModeMenu(props) {
|
|
|
217357
217905
|
]
|
|
217358
217906
|
}, task.id, true, undefined, this);
|
|
217359
217907
|
}),
|
|
217360
|
-
/* @__PURE__ */
|
|
217908
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217361
217909
|
paddingTop: 1,
|
|
217362
|
-
children: /* @__PURE__ */
|
|
217910
|
+
children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
217363
217911
|
gap: 1,
|
|
217364
217912
|
children: [
|
|
217365
|
-
/* @__PURE__ */
|
|
217913
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217366
217914
|
color: "#89B4F8",
|
|
217367
217915
|
children: "↑/↓"
|
|
217368
217916
|
}, undefined, false, undefined, this),
|
|
217369
|
-
/* @__PURE__ */
|
|
217917
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217370
217918
|
color: "#AAAAAA",
|
|
217371
217919
|
children: "Navigate"
|
|
217372
217920
|
}, undefined, false, undefined, this),
|
|
217373
|
-
/* @__PURE__ */
|
|
217921
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217374
217922
|
color: "#AAAAAA",
|
|
217375
217923
|
children: "·"
|
|
217376
217924
|
}, undefined, false, undefined, this),
|
|
217377
|
-
/* @__PURE__ */
|
|
217925
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217378
217926
|
color: "#89B4F8",
|
|
217379
217927
|
children: "←/→"
|
|
217380
217928
|
}, undefined, false, undefined, this),
|
|
217381
|
-
/* @__PURE__ */
|
|
217929
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217382
217930
|
color: "#AAAAAA",
|
|
217383
217931
|
children: "Page"
|
|
217384
217932
|
}, undefined, false, undefined, this),
|
|
217385
|
-
/* @__PURE__ */
|
|
217933
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217386
217934
|
color: "#AAAAAA",
|
|
217387
217935
|
children: "·"
|
|
217388
217936
|
}, undefined, false, undefined, this),
|
|
217389
|
-
/* @__PURE__ */
|
|
217937
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217390
217938
|
color: "#89B4F8",
|
|
217391
217939
|
children: "enter"
|
|
217392
217940
|
}, undefined, false, undefined, this),
|
|
217393
|
-
/* @__PURE__ */
|
|
217941
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217394
217942
|
color: "#AAAAAA",
|
|
217395
217943
|
children: "View output"
|
|
217396
217944
|
}, undefined, false, undefined, this),
|
|
217397
|
-
/* @__PURE__ */
|
|
217945
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217398
217946
|
color: "#AAAAAA",
|
|
217399
217947
|
children: "·"
|
|
217400
217948
|
}, undefined, false, undefined, this),
|
|
217401
|
-
/* @__PURE__ */
|
|
217949
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217402
217950
|
color: "#89B4F8",
|
|
217403
217951
|
children: "k"
|
|
217404
217952
|
}, undefined, false, undefined, this),
|
|
217405
|
-
/* @__PURE__ */
|
|
217953
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217406
217954
|
color: "#AAAAAA",
|
|
217407
217955
|
children: "Kill Task"
|
|
217408
217956
|
}, undefined, false, undefined, this),
|
|
217409
|
-
/* @__PURE__ */
|
|
217957
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217410
217958
|
color: "#AAAAAA",
|
|
217411
217959
|
children: "·"
|
|
217412
217960
|
}, undefined, false, undefined, this),
|
|
217413
|
-
/* @__PURE__ */
|
|
217961
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217414
217962
|
color: "#89B4F8",
|
|
217415
217963
|
children: "esc"
|
|
217416
217964
|
}, undefined, false, undefined, this),
|
|
217417
|
-
/* @__PURE__ */
|
|
217965
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text3, {
|
|
217418
217966
|
color: "#AAAAAA",
|
|
217419
217967
|
children: "Cancel"
|
|
217420
217968
|
}, undefined, false, undefined, this)
|
|
@@ -217425,10 +217973,10 @@ function TasksModeMenu(props) {
|
|
|
217425
217973
|
}, undefined, true, undefined, this);
|
|
217426
217974
|
}
|
|
217427
217975
|
}
|
|
217428
|
-
var
|
|
217976
|
+
var jsx_dev_runtime30;
|
|
217429
217977
|
var init_tasks_mode_menu = __esm(async () => {
|
|
217430
217978
|
await init_build2();
|
|
217431
|
-
|
|
217979
|
+
jsx_dev_runtime30 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217432
217980
|
});
|
|
217433
217981
|
|
|
217434
217982
|
// ../../packages/tui/src/components/menus/tool-permission-menu.tsx
|
|
@@ -217440,46 +217988,46 @@ function ToolPermissionMenu({ questions, onComplete }) {
|
|
|
217440
217988
|
const handleSelect = (item) => {
|
|
217441
217989
|
onComplete(item.value);
|
|
217442
217990
|
};
|
|
217443
|
-
return /* @__PURE__ */
|
|
217991
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
217444
217992
|
flexDirection: "column",
|
|
217445
217993
|
paddingX: 1,
|
|
217446
217994
|
children: [
|
|
217447
|
-
/* @__PURE__ */
|
|
217995
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
217448
217996
|
marginBottom: 1,
|
|
217449
|
-
children: /* @__PURE__ */
|
|
217997
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217450
217998
|
color: "white",
|
|
217451
217999
|
bold: true,
|
|
217452
218000
|
children: currentQ.question
|
|
217453
218001
|
}, undefined, false, undefined, this)
|
|
217454
218002
|
}, undefined, false, undefined, this),
|
|
217455
|
-
/* @__PURE__ */
|
|
218003
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(SelectInput_default, {
|
|
217456
218004
|
items,
|
|
217457
218005
|
onSelect: handleSelect,
|
|
217458
218006
|
indicatorComponent: CustomIndicator,
|
|
217459
218007
|
itemComponent: CustomItem
|
|
217460
218008
|
}, undefined, false, undefined, this),
|
|
217461
|
-
/* @__PURE__ */
|
|
218009
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
217462
218010
|
paddingTop: 1,
|
|
217463
|
-
children: /* @__PURE__ */
|
|
218011
|
+
children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
217464
218012
|
gap: 1,
|
|
217465
218013
|
children: [
|
|
217466
|
-
/* @__PURE__ */
|
|
218014
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217467
218015
|
color: "#89B4F8",
|
|
217468
218016
|
children: "↑↓"
|
|
217469
218017
|
}, undefined, false, undefined, this),
|
|
217470
|
-
/* @__PURE__ */
|
|
218018
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217471
218019
|
color: "#AAAAAA",
|
|
217472
218020
|
children: "Navigate"
|
|
217473
218021
|
}, undefined, false, undefined, this),
|
|
217474
|
-
/* @__PURE__ */
|
|
218022
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217475
218023
|
color: "#AAAAAA",
|
|
217476
218024
|
children: "·"
|
|
217477
218025
|
}, undefined, false, undefined, this),
|
|
217478
|
-
/* @__PURE__ */
|
|
218026
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217479
218027
|
color: "#89B4F8",
|
|
217480
218028
|
children: "enter"
|
|
217481
218029
|
}, undefined, false, undefined, this),
|
|
217482
|
-
/* @__PURE__ */
|
|
218030
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text3, {
|
|
217483
218031
|
color: "#AAAAAA",
|
|
217484
218032
|
children: "Select"
|
|
217485
218033
|
}, undefined, false, undefined, this)
|
|
@@ -217489,65 +218037,65 @@ function ToolPermissionMenu({ questions, onComplete }) {
|
|
|
217489
218037
|
]
|
|
217490
218038
|
}, undefined, true, undefined, this);
|
|
217491
218039
|
}
|
|
217492
|
-
var
|
|
218040
|
+
var jsx_dev_runtime31;
|
|
217493
218041
|
var init_tool_permission_menu = __esm(async () => {
|
|
217494
218042
|
await __promiseAll([
|
|
217495
218043
|
init_build2(),
|
|
217496
218044
|
init_build5(),
|
|
217497
218045
|
init_menu_items()
|
|
217498
218046
|
]);
|
|
217499
|
-
|
|
218047
|
+
jsx_dev_runtime31 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217500
218048
|
});
|
|
217501
218049
|
|
|
217502
218050
|
// ../../packages/tui/src/components/menus/auth-menus.tsx
|
|
217503
218051
|
function AuthMenus(props) {
|
|
217504
218052
|
switch (props.authMode) {
|
|
217505
218053
|
case "menu":
|
|
217506
|
-
return /* @__PURE__ */
|
|
218054
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(MenuMenu, {
|
|
217507
218055
|
...props
|
|
217508
218056
|
}, undefined, false, undefined, this);
|
|
217509
218057
|
case "byok_provider":
|
|
217510
|
-
return /* @__PURE__ */
|
|
218058
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(ByokProviderMenu, {
|
|
217511
218059
|
...props
|
|
217512
218060
|
}, undefined, false, undefined, this);
|
|
217513
218061
|
case "byok_key":
|
|
217514
|
-
return /* @__PURE__ */
|
|
218062
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(ByokKeyMenu, {
|
|
217515
218063
|
...props
|
|
217516
218064
|
}, undefined, false, undefined, this);
|
|
217517
218065
|
case "model_select":
|
|
217518
|
-
return /* @__PURE__ */
|
|
218066
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(ModelSelectMenu, {
|
|
217519
218067
|
...props
|
|
217520
218068
|
}, undefined, false, undefined, this);
|
|
217521
218069
|
case "context_select":
|
|
217522
|
-
return /* @__PURE__ */
|
|
218070
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(ContextSelectMenu, {
|
|
217523
218071
|
...props
|
|
217524
218072
|
}, undefined, false, undefined, this);
|
|
217525
218073
|
case "logout_select":
|
|
217526
|
-
return /* @__PURE__ */
|
|
218074
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(LogoutSelectMenu, {
|
|
217527
218075
|
...props
|
|
217528
218076
|
}, undefined, false, undefined, this);
|
|
217529
218077
|
case "session_select":
|
|
217530
|
-
return /* @__PURE__ */
|
|
218078
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(SessionSelectMenu, {
|
|
217531
218079
|
...props
|
|
217532
218080
|
}, undefined, false, undefined, this);
|
|
217533
218081
|
case "tasks_mode":
|
|
217534
|
-
return /* @__PURE__ */
|
|
218082
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(TasksModeMenu, {
|
|
217535
218083
|
...props
|
|
217536
218084
|
}, undefined, false, undefined, this);
|
|
217537
218085
|
case "plan_approve":
|
|
217538
|
-
return /* @__PURE__ */
|
|
218086
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(PlanApproveMenu, {
|
|
217539
218087
|
...props
|
|
217540
218088
|
}, undefined, false, undefined, this);
|
|
217541
218089
|
case "grill_question":
|
|
217542
|
-
return /* @__PURE__ */
|
|
218090
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(GrillQuestionMenu, {
|
|
217543
218091
|
...props
|
|
217544
218092
|
}, undefined, false, undefined, this);
|
|
217545
218093
|
case "settings_main":
|
|
217546
|
-
return /* @__PURE__ */
|
|
218094
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(SettingsMainMenu, {
|
|
217547
218095
|
...props
|
|
217548
218096
|
}, undefined, false, undefined, this);
|
|
217549
218097
|
case "tool_permission":
|
|
217550
|
-
return /* @__PURE__ */
|
|
218098
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(ToolPermissionMenu, {
|
|
217551
218099
|
questions: props.pendingQuestions?.questions || [],
|
|
217552
218100
|
onComplete: (answer) => {
|
|
217553
218101
|
props.pendingQuestions?.resolve(answer);
|
|
@@ -217559,7 +218107,7 @@ function AuthMenus(props) {
|
|
|
217559
218107
|
return null;
|
|
217560
218108
|
}
|
|
217561
218109
|
}
|
|
217562
|
-
var
|
|
218110
|
+
var jsx_dev_runtime32;
|
|
217563
218111
|
var init_auth_menus = __esm(async () => {
|
|
217564
218112
|
await __promiseAll([
|
|
217565
218113
|
init_byok_key_menu(),
|
|
@@ -217575,13 +218123,13 @@ var init_auth_menus = __esm(async () => {
|
|
|
217575
218123
|
init_tasks_mode_menu(),
|
|
217576
218124
|
init_tool_permission_menu()
|
|
217577
218125
|
]);
|
|
217578
|
-
|
|
218126
|
+
jsx_dev_runtime32 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217579
218127
|
});
|
|
217580
218128
|
|
|
217581
218129
|
// ../../packages/tui/src/components/menus/ask-question-menu.tsx
|
|
217582
218130
|
function AskQuestionMenu({ questions, onComplete }) {
|
|
217583
|
-
const [currentQuestionIdx, setCurrentQuestionIdx] =
|
|
217584
|
-
const [answers, setAnswers] =
|
|
218131
|
+
const [currentQuestionIdx, setCurrentQuestionIdx] = import_react50.useState(0);
|
|
218132
|
+
const [answers, setAnswers] = import_react50.useState([]);
|
|
217585
218133
|
const currentQ = questions[currentQuestionIdx];
|
|
217586
218134
|
if (!currentQ)
|
|
217587
218135
|
return null;
|
|
@@ -217595,29 +218143,29 @@ function AskQuestionMenu({ questions, onComplete }) {
|
|
|
217595
218143
|
onComplete(newAnswers.length === 1 ? newAnswers[0] : newAnswers);
|
|
217596
218144
|
}
|
|
217597
218145
|
};
|
|
217598
|
-
return /* @__PURE__ */
|
|
218146
|
+
return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
217599
218147
|
flexDirection: "column",
|
|
217600
218148
|
gap: 1,
|
|
217601
218149
|
children: [
|
|
217602
|
-
/* @__PURE__ */
|
|
218150
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
217603
218151
|
flexDirection: "row",
|
|
217604
218152
|
gap: 1,
|
|
217605
218153
|
children: [
|
|
217606
|
-
/* @__PURE__ */
|
|
218154
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text3, {
|
|
217607
218155
|
color: "cyan",
|
|
217608
218156
|
bold: true,
|
|
217609
218157
|
children: `Q${currentQuestionIdx + 1}/${questions.length}:`
|
|
217610
218158
|
}, undefined, false, undefined, this),
|
|
217611
|
-
/* @__PURE__ */
|
|
218159
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text3, {
|
|
217612
218160
|
color: "white",
|
|
217613
218161
|
bold: true,
|
|
217614
218162
|
children: currentQ.question
|
|
217615
218163
|
}, undefined, false, undefined, this)
|
|
217616
218164
|
]
|
|
217617
218165
|
}, undefined, true, undefined, this),
|
|
217618
|
-
/* @__PURE__ */
|
|
218166
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
217619
218167
|
paddingLeft: 2,
|
|
217620
|
-
children: /* @__PURE__ */
|
|
218168
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(SelectInput_default, {
|
|
217621
218169
|
items,
|
|
217622
218170
|
onSelect: handleSelect
|
|
217623
218171
|
}, undefined, false, undefined, this)
|
|
@@ -217625,29 +218173,29 @@ function AskQuestionMenu({ questions, onComplete }) {
|
|
|
217625
218173
|
]
|
|
217626
218174
|
}, undefined, true, undefined, this);
|
|
217627
218175
|
}
|
|
217628
|
-
var
|
|
218176
|
+
var import_react50, jsx_dev_runtime33;
|
|
217629
218177
|
var init_ask_question_menu = __esm(async () => {
|
|
217630
218178
|
await __promiseAll([
|
|
217631
218179
|
init_build2(),
|
|
217632
218180
|
init_build5()
|
|
217633
218181
|
]);
|
|
217634
|
-
|
|
217635
|
-
|
|
218182
|
+
import_react50 = __toESM(require_react(), 1);
|
|
218183
|
+
jsx_dev_runtime33 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217636
218184
|
});
|
|
217637
218185
|
|
|
217638
218186
|
// ../../packages/tui/src/components/pill.tsx
|
|
217639
|
-
var
|
|
218187
|
+
var jsx_dev_runtime34;
|
|
217640
218188
|
var init_pill = __esm(async () => {
|
|
217641
218189
|
await init_build2();
|
|
217642
|
-
|
|
218190
|
+
jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217643
218191
|
});
|
|
217644
218192
|
|
|
217645
218193
|
// ../../packages/tui/src/components/task-hud.tsx
|
|
217646
218194
|
import fs10 from "fs";
|
|
217647
218195
|
import path9 from "path";
|
|
217648
218196
|
function TaskHUD({ cwd: cwd2, showTasks = true }) {
|
|
217649
|
-
const [taskLines, setTaskLines] =
|
|
217650
|
-
|
|
218197
|
+
const [taskLines, setTaskLines] = import_react51.useState([]);
|
|
218198
|
+
import_react51.useEffect(() => {
|
|
217651
218199
|
if (!showTasks)
|
|
217652
218200
|
return;
|
|
217653
218201
|
const taskPath = path9.join(cwd2, "task.md");
|
|
@@ -217669,7 +218217,7 @@ function TaskHUD({ cwd: cwd2, showTasks = true }) {
|
|
|
217669
218217
|
}, [cwd2, showTasks]);
|
|
217670
218218
|
if (!showTasks || taskLines.length === 0)
|
|
217671
218219
|
return null;
|
|
217672
|
-
return /* @__PURE__ */
|
|
218220
|
+
return /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
217673
218221
|
position: "absolute",
|
|
217674
218222
|
top: 1,
|
|
217675
218223
|
right: 2,
|
|
@@ -217679,7 +218227,7 @@ function TaskHUD({ cwd: cwd2, showTasks = true }) {
|
|
|
217679
218227
|
paddingX: 1,
|
|
217680
218228
|
width: 40,
|
|
217681
218229
|
children: [
|
|
217682
|
-
/* @__PURE__ */
|
|
218230
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text3, {
|
|
217683
218231
|
color: "#A78BFA",
|
|
217684
218232
|
bold: true,
|
|
217685
218233
|
children: "Active Plan (task.md)"
|
|
@@ -217688,7 +218236,7 @@ function TaskHUD({ cwd: cwd2, showTasks = true }) {
|
|
|
217688
218236
|
const isDone = line.includes("[x]");
|
|
217689
218237
|
const isProg = line.includes("[/]");
|
|
217690
218238
|
const color = isDone ? "#10B981" : isProg ? "#FBBF24" : "#AAAAAA";
|
|
217691
|
-
return /* @__PURE__ */
|
|
218239
|
+
return /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text3, {
|
|
217692
218240
|
color,
|
|
217693
218241
|
wrap: "truncate",
|
|
217694
218242
|
children: line.replace(/^- /, "")
|
|
@@ -217697,11 +218245,11 @@ function TaskHUD({ cwd: cwd2, showTasks = true }) {
|
|
|
217697
218245
|
]
|
|
217698
218246
|
}, undefined, true, undefined, this);
|
|
217699
218247
|
}
|
|
217700
|
-
var
|
|
218248
|
+
var import_react51, jsx_dev_runtime35;
|
|
217701
218249
|
var init_task_hud = __esm(async () => {
|
|
217702
218250
|
await init_build2();
|
|
217703
|
-
|
|
217704
|
-
|
|
218251
|
+
import_react51 = __toESM(require_react(), 1);
|
|
218252
|
+
jsx_dev_runtime35 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217705
218253
|
});
|
|
217706
218254
|
|
|
217707
218255
|
// ../../packages/tui/src/components/global-shortcuts.tsx
|
|
@@ -217792,6 +218340,14 @@ function GlobalShortcuts(session) {
|
|
|
217792
218340
|
}
|
|
217793
218341
|
if (authMode !== "none") {
|
|
217794
218342
|
if (key.escape && authMode !== "login") {
|
|
218343
|
+
if (authMode === "grill_question") {
|
|
218344
|
+
setGrillQuestions([]);
|
|
218345
|
+
setCurrentGrillIndex(0);
|
|
218346
|
+
setGrillAnswers([]);
|
|
218347
|
+
setGrillPrompt(null);
|
|
218348
|
+
setCustomInputMode(false);
|
|
218349
|
+
setGrillMode(false);
|
|
218350
|
+
}
|
|
217795
218351
|
setAuthMode("none");
|
|
217796
218352
|
}
|
|
217797
218353
|
return;
|
|
@@ -217831,9 +218387,8 @@ function ChatApp({
|
|
|
217831
218387
|
onLogin,
|
|
217832
218388
|
session
|
|
217833
218389
|
}) {
|
|
217834
|
-
const [
|
|
217835
|
-
|
|
217836
|
-
import_react51.useEffect(() => {
|
|
218390
|
+
const [exitConfirm, setExitConfirm] = import_react52.useState(false);
|
|
218391
|
+
import_react52.useEffect(() => {
|
|
217837
218392
|
if (exitConfirm) {
|
|
217838
218393
|
const timer = setTimeout(() => setExitConfirm(false), 3000);
|
|
217839
218394
|
return () => clearTimeout(timer);
|
|
@@ -217852,22 +218407,19 @@ function ChatApp({
|
|
|
217852
218407
|
setActiveMessages,
|
|
217853
218408
|
setAuthMode
|
|
217854
218409
|
} = session;
|
|
217855
|
-
const authUI = authMode !== "none" ? authMode === "ask_question" && session.pendingQuestions ? /* @__PURE__ */
|
|
218410
|
+
const authUI = authMode !== "none" ? authMode === "ask_question" && session.pendingQuestions ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(AskQuestionMenu, {
|
|
217856
218411
|
questions: session.pendingQuestions.questions,
|
|
217857
218412
|
onComplete: (answers) => {
|
|
217858
218413
|
session.pendingQuestions?.resolve(typeof answers === "string" ? answers : answers.join(", "));
|
|
217859
218414
|
setAuthMode("none");
|
|
217860
218415
|
session.setPendingQuestions(null);
|
|
217861
218416
|
}
|
|
217862
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
218417
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(AuthMenus, {
|
|
217863
218418
|
...session,
|
|
217864
218419
|
agent: agent2,
|
|
217865
218420
|
getProviderModels: session.getProviderModels
|
|
217866
218421
|
}, undefined, false, undefined, this) : null;
|
|
217867
|
-
const handleFormSubmit =
|
|
217868
|
-
if (text3 && !text3.startsWith("/")) {
|
|
217869
|
-
setInputHistory((prev2) => [...prev2, text3]);
|
|
217870
|
-
}
|
|
218422
|
+
const handleFormSubmit = import_react52.useCallback((text3) => {
|
|
217871
218423
|
session.handleSubmit(text3);
|
|
217872
218424
|
}, [session.handleSubmit]);
|
|
217873
218425
|
const totalTokens = [...staticMessages, ...activeMessages].reduce((acc, msg) => {
|
|
@@ -217876,19 +218428,19 @@ function ChatApp({
|
|
|
217876
218428
|
}
|
|
217877
218429
|
return acc;
|
|
217878
218430
|
}, 0);
|
|
217879
|
-
return /* @__PURE__ */
|
|
218431
|
+
return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
217880
218432
|
flexDirection: "column",
|
|
217881
218433
|
width: "100%",
|
|
217882
218434
|
children: [
|
|
217883
|
-
/* @__PURE__ */
|
|
218435
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(GlobalShortcuts, {
|
|
217884
218436
|
...session,
|
|
217885
218437
|
agent: agent2
|
|
217886
218438
|
}, undefined, false, undefined, this),
|
|
217887
|
-
/* @__PURE__ */
|
|
218439
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(TaskHUD, {
|
|
217888
218440
|
cwd: process.cwd(),
|
|
217889
218441
|
showTasks: session.settingsShowTasks
|
|
217890
218442
|
}, undefined, false, undefined, this),
|
|
217891
|
-
/* @__PURE__ */
|
|
218443
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(MessageList, {
|
|
217892
218444
|
staticKey,
|
|
217893
218445
|
staticMessages,
|
|
217894
218446
|
activeMessages,
|
|
@@ -217897,9 +218449,8 @@ function ChatApp({
|
|
|
217897
218449
|
userEmail: currentEmail || userEmail,
|
|
217898
218450
|
expandCommands: session.expandCommands
|
|
217899
218451
|
}, undefined, false, undefined, this),
|
|
217900
|
-
/* @__PURE__ */
|
|
218452
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(InputBar, {
|
|
217901
218453
|
onSubmit: handleFormSubmit,
|
|
217902
|
-
history: inputHistory,
|
|
217903
218454
|
disabled: authMode !== "none",
|
|
217904
218455
|
onInterrupt: () => {
|
|
217905
218456
|
if (session.isStreaming) {
|
|
@@ -217936,8 +218487,10 @@ function ChatApp({
|
|
|
217936
218487
|
setStaticMessages([{ id: "header-" + Date.now(), role: "header" }]);
|
|
217937
218488
|
setStaticKey((k) => k + 1);
|
|
217938
218489
|
setActiveMessages([]);
|
|
218490
|
+
session.setQueuedPrompts?.([]);
|
|
217939
218491
|
session.addToast?.("Started a new conversation.", "success");
|
|
217940
218492
|
},
|
|
218493
|
+
queuedPrompts: session.queuedPrompts,
|
|
217941
218494
|
grillMode,
|
|
217942
218495
|
customInputMode: false,
|
|
217943
218496
|
showExitConfirm: exitConfirm
|
|
@@ -217945,7 +218498,7 @@ function ChatApp({
|
|
|
217945
218498
|
]
|
|
217946
218499
|
}, undefined, true, undefined, this);
|
|
217947
218500
|
}
|
|
217948
|
-
var
|
|
218501
|
+
var import_react52, jsx_dev_runtime36;
|
|
217949
218502
|
var init_app = __esm(async () => {
|
|
217950
218503
|
await __promiseAll([
|
|
217951
218504
|
init_build2(),
|
|
@@ -217956,8 +218509,8 @@ var init_app = __esm(async () => {
|
|
|
217956
218509
|
init_message_list(),
|
|
217957
218510
|
init_task_hud()
|
|
217958
218511
|
]);
|
|
217959
|
-
|
|
217960
|
-
|
|
218512
|
+
import_react52 = __toESM(require_react(), 1);
|
|
218513
|
+
jsx_dev_runtime36 = __toESM(require_jsx_dev_runtime(), 1);
|
|
217961
218514
|
});
|
|
217962
218515
|
|
|
217963
218516
|
// ../../packages/tui/src/index.tsx
|
|
@@ -218147,11 +218700,11 @@ var init_vanilla = () => {};
|
|
|
218147
218700
|
|
|
218148
218701
|
// ../../node_modules/.bun/zustand@5.0.14+93dbe784b8baa420/node_modules/zustand/esm/react.mjs
|
|
218149
218702
|
function useStore(api2, selector = identity2) {
|
|
218150
|
-
const slice3 =
|
|
218151
|
-
|
|
218703
|
+
const slice3 = import_react53.default.useSyncExternalStore(api2.subscribe, import_react53.default.useCallback(() => selector(api2.getState()), [api2, selector]), import_react53.default.useCallback(() => selector(api2.getInitialState()), [api2, selector]));
|
|
218704
|
+
import_react53.default.useDebugValue(slice3);
|
|
218152
218705
|
return slice3;
|
|
218153
218706
|
}
|
|
218154
|
-
var
|
|
218707
|
+
var import_react53, identity2 = (arg) => arg, createImpl = (createState) => {
|
|
218155
218708
|
const api2 = createStore(createState);
|
|
218156
218709
|
const useBoundStore = (selector) => useStore(api2, selector);
|
|
218157
218710
|
Object.assign(useBoundStore, api2);
|
|
@@ -218159,7 +218712,7 @@ var import_react52, identity2 = (arg) => arg, createImpl = (createState) => {
|
|
|
218159
218712
|
}, create4 = (createState) => createState ? createImpl(createState) : createImpl;
|
|
218160
218713
|
var init_react = __esm(() => {
|
|
218161
218714
|
init_vanilla();
|
|
218162
|
-
|
|
218715
|
+
import_react53 = __toESM(require_react(), 1);
|
|
218163
218716
|
});
|
|
218164
218717
|
|
|
218165
218718
|
// ../../node_modules/.bun/zustand@5.0.14+93dbe784b8baa420/node_modules/zustand/esm/index.mjs
|
|
@@ -218233,6 +218786,10 @@ var init_store = __esm(async () => {
|
|
|
218233
218786
|
})),
|
|
218234
218787
|
isStreaming: false,
|
|
218235
218788
|
setIsStreaming: (isStreaming) => set2({ isStreaming }),
|
|
218789
|
+
queuedPrompts: [],
|
|
218790
|
+
setQueuedPrompts: (updater) => set2((state) => ({
|
|
218791
|
+
queuedPrompts: typeof updater === "function" ? updater(state.queuedPrompts) : updater
|
|
218792
|
+
})),
|
|
218236
218793
|
sessionItems: [],
|
|
218237
218794
|
setSessionItems: (sessionItems) => set2({ sessionItems }),
|
|
218238
218795
|
sessionsData: [],
|
|
@@ -218398,7 +218955,6 @@ function parseErrorMessage(err) {
|
|
|
218398
218955
|
}
|
|
218399
218956
|
}
|
|
218400
218957
|
const rateLimitNotice = `Rate limit or quota exhausted from LLM provider. Please upgrade your API key tier with your provider (OpenAI, Anthropic, Gemini) or switch to December Cloud Subscription at https://trydecember.com/pricing
|
|
218401
|
-
|
|
218402
218958
|
`;
|
|
218403
218959
|
const lowerStr = (errMsg + " " + (finalResult || "")).toLowerCase();
|
|
218404
218960
|
const isRateLimit = lowerStr.includes("429") || lowerStr.includes("quota") || lowerStr.includes("rate limit") || lowerStr.includes("rate_limit") || lowerStr.includes("resource_exhausted") || lowerStr.includes("generativelanguage.googleapis.com");
|
|
@@ -227591,42 +228147,6 @@ var BrowserTool = {
|
|
|
227591
228147
|
}
|
|
227592
228148
|
}
|
|
227593
228149
|
};
|
|
227594
|
-
// ../../packages/tools/src/github.ts
|
|
227595
|
-
var githubSchema = Type2.Object({
|
|
227596
|
-
endpoint: Type2.String({ description: "GitHub API endpoint (e.g. /repos/owner/repo/issues)" }),
|
|
227597
|
-
method: Type2.Optional(Type2.String({ description: "GET, POST, PATCH, etc. Defaults to GET." })),
|
|
227598
|
-
body: Type2.Optional(Type2.String({ description: "JSON string of the request body" }))
|
|
227599
|
-
});
|
|
227600
|
-
var GitHubTool = {
|
|
227601
|
-
name: "github",
|
|
227602
|
-
description: "Interact with GitHub API (create PRs, read issues, etc). Automatically injects GITHUB_TOKEN if available in the environment.",
|
|
227603
|
-
inputSchema: githubSchema,
|
|
227604
|
-
execute: async ({ endpoint, method = "GET", body }, context) => {
|
|
227605
|
-
try {
|
|
227606
|
-
const token = context.operations.env.get("GITHUB_TOKEN");
|
|
227607
|
-
const headers = {
|
|
227608
|
-
Accept: "application/vnd.github.v3+json",
|
|
227609
|
-
"User-Agent": "December-Agent"
|
|
227610
|
-
};
|
|
227611
|
-
if (token) {
|
|
227612
|
-
headers["Authorization"] = `token ${token}`;
|
|
227613
|
-
}
|
|
227614
|
-
const url = endpoint.startsWith("http") ? endpoint : `https://api.github.com${endpoint.startsWith("/") ? "" : "/"}${endpoint}`;
|
|
227615
|
-
const res = await fetch(url, {
|
|
227616
|
-
method,
|
|
227617
|
-
headers,
|
|
227618
|
-
body: body ? body : undefined
|
|
227619
|
-
});
|
|
227620
|
-
const text = await res.text();
|
|
227621
|
-
if (!res.ok) {
|
|
227622
|
-
return `GitHub API Error (${res.status}): ${text}`;
|
|
227623
|
-
}
|
|
227624
|
-
return text;
|
|
227625
|
-
} catch (error3) {
|
|
227626
|
-
return `Failed to fetch from GitHub: ${error3.message}`;
|
|
227627
|
-
}
|
|
227628
|
-
}
|
|
227629
|
-
};
|
|
227630
228150
|
// ../../packages/tools/src/web_search.ts
|
|
227631
228151
|
init_src();
|
|
227632
228152
|
|
|
@@ -241054,78 +241574,20 @@ var WebSearchTool = {
|
|
|
241054
241574
|
}
|
|
241055
241575
|
}
|
|
241056
241576
|
};
|
|
241057
|
-
// ../../packages/tools/src/wiki.ts
|
|
241058
|
-
var readWikiSchema = Type2.Object({
|
|
241059
|
-
pageId: Type2.String({ description: "The ID or title of the wiki page to read" })
|
|
241060
|
-
});
|
|
241061
|
-
var readWikiTool = {
|
|
241062
|
-
name: "read_wiki",
|
|
241063
|
-
description: "Read a wiki page from the project folder documentation.",
|
|
241064
|
-
inputSchema: readWikiSchema,
|
|
241065
|
-
execute: async (args, context) => {
|
|
241066
|
-
const { pageId } = args;
|
|
241067
|
-
return `Wiki content for ${pageId} retrieved.`;
|
|
241068
|
-
}
|
|
241069
|
-
};
|
|
241070
|
-
var updateWikiSchema = Type2.Object({
|
|
241071
|
-
pageId: Type2.String({ description: "The ID or title of the wiki page to update" }),
|
|
241072
|
-
content: Type2.String({ description: "The markdown content to save" })
|
|
241073
|
-
});
|
|
241074
|
-
var updateWikiTool = {
|
|
241075
|
-
name: "update_wiki",
|
|
241076
|
-
description: "Update or create a wiki page in the project folder documentation.",
|
|
241077
|
-
inputSchema: updateWikiSchema,
|
|
241078
|
-
execute: async (args, context) => {
|
|
241079
|
-
const { pageId, content } = args;
|
|
241080
|
-
return `Wiki page ${pageId} updated successfully.`;
|
|
241081
|
-
}
|
|
241082
|
-
};
|
|
241083
|
-
// ../../packages/tools/src/pr.ts
|
|
241084
|
-
var createPrReviewSchema = Type2.Object({
|
|
241085
|
-
prUrl: Type2.String({ description: "The GitHub Pull Request URL" }),
|
|
241086
|
-
comments: Type2.Array(Type2.Object({
|
|
241087
|
-
path: Type2.String(),
|
|
241088
|
-
line: Type2.Number(),
|
|
241089
|
-
body: Type2.String()
|
|
241090
|
-
}), { description: "List of review comments" })
|
|
241091
|
-
});
|
|
241092
|
-
var createPrReviewTool = {
|
|
241093
|
-
name: "create_pr_review",
|
|
241094
|
-
description: "Create a PR review on GitHub with line-specific comments.",
|
|
241095
|
-
inputSchema: createPrReviewSchema,
|
|
241096
|
-
execute: async (args, context) => {
|
|
241097
|
-
const { prUrl } = args;
|
|
241098
|
-
return `Successfully submitted PR review for ${prUrl}.`;
|
|
241099
|
-
}
|
|
241100
|
-
};
|
|
241101
|
-
var submitPrSchema = Type2.Object({
|
|
241102
|
-
branch: Type2.String({ description: "The branch name to push" }),
|
|
241103
|
-
title: Type2.String({ description: "The PR title" }),
|
|
241104
|
-
body: Type2.String({ description: "The PR description body" })
|
|
241105
|
-
});
|
|
241106
|
-
var submitPrTool = {
|
|
241107
|
-
name: "submit_pr",
|
|
241108
|
-
description: "Push changes and submit a new Pull Request on GitHub.",
|
|
241109
|
-
inputSchema: submitPrSchema,
|
|
241110
|
-
execute: async (args, context) => {
|
|
241111
|
-
const { branch, title } = args;
|
|
241112
|
-
return `Successfully submitted PR "${title}" from branch ${branch}.`;
|
|
241113
|
-
}
|
|
241114
|
-
};
|
|
241115
241577
|
// src/index.ts
|
|
241116
241578
|
await __promiseAll([
|
|
241117
241579
|
init_src6(),
|
|
241118
241580
|
init_src6(),
|
|
241119
241581
|
init_build2()
|
|
241120
241582
|
]);
|
|
241121
|
-
var
|
|
241583
|
+
var import_react55 = __toESM(require_react(), 1);
|
|
241122
241584
|
// package.json
|
|
241123
241585
|
var package_default = {
|
|
241124
241586
|
name: "@trydecember/cli",
|
|
241125
241587
|
module: "src/index.ts",
|
|
241126
241588
|
type: "module",
|
|
241127
241589
|
private: false,
|
|
241128
|
-
version: "0.2.
|
|
241590
|
+
version: "0.2.25",
|
|
241129
241591
|
description: "Turn ideas into reality.",
|
|
241130
241592
|
author: "Chaitanya Sonawane",
|
|
241131
241593
|
license: "Apache-2.0",
|
|
@@ -241326,33 +241788,49 @@ async function handleLogoutCommand() {
|
|
|
241326
241788
|
await saveConfig(config);
|
|
241327
241789
|
console.log("Logged out successfully. Stored credentials removed.");
|
|
241328
241790
|
}
|
|
241329
|
-
var DEFAULT_AGENTS_MD =
|
|
241330
|
-
|
|
241331
|
-
var DEFAULT_RULES_MD = `# Rules
|
|
241791
|
+
var DEFAULT_AGENTS_MD = "";
|
|
241792
|
+
var DEFAULT_RULES_MD = `Add rules in this file for the agent to use as context.
|
|
241332
241793
|
`;
|
|
241333
|
-
var DEFAULT_SKILLS_MD =
|
|
241794
|
+
var DEFAULT_SKILLS_MD = `Add skills in this file for the agent to use as context.
|
|
241334
241795
|
`;
|
|
241335
241796
|
async function handleInitCommand() {
|
|
241336
|
-
const
|
|
241797
|
+
const rootDir = process.cwd();
|
|
241798
|
+
const decDir = path11.join(rootDir, ".december");
|
|
241337
241799
|
await fs12.mkdir(decDir, { recursive: true });
|
|
241338
241800
|
const filesToScaffold = [
|
|
241339
|
-
{
|
|
241340
|
-
|
|
241341
|
-
|
|
241801
|
+
{
|
|
241802
|
+
name: "AGENTS.md",
|
|
241803
|
+
targetPath: path11.join(rootDir, "AGENTS.md"),
|
|
241804
|
+
displayPath: "AGENTS.md",
|
|
241805
|
+
content: DEFAULT_AGENTS_MD
|
|
241806
|
+
},
|
|
241807
|
+
{
|
|
241808
|
+
name: "rules.md",
|
|
241809
|
+
targetPath: path11.join(decDir, "rules.md"),
|
|
241810
|
+
displayPath: ".december/rules.md",
|
|
241811
|
+
content: DEFAULT_RULES_MD
|
|
241812
|
+
},
|
|
241813
|
+
{
|
|
241814
|
+
name: "skills.md",
|
|
241815
|
+
targetPath: path11.join(decDir, "skills.md"),
|
|
241816
|
+
displayPath: ".december/skills.md",
|
|
241817
|
+
content: DEFAULT_SKILLS_MD
|
|
241818
|
+
},
|
|
241342
241819
|
{
|
|
241343
241820
|
name: "settings.json",
|
|
241821
|
+
targetPath: path11.join(decDir, "settings.json"),
|
|
241822
|
+
displayPath: ".december/settings.json",
|
|
241344
241823
|
content: JSON.stringify({ thinkingLevel: "low", steeringMode: "all" }, null, 2) + `
|
|
241345
241824
|
`
|
|
241346
241825
|
}
|
|
241347
241826
|
];
|
|
241348
241827
|
for (const file of filesToScaffold) {
|
|
241349
|
-
const filePath = path11.join(decDir, file.name);
|
|
241350
241828
|
try {
|
|
241351
|
-
await fs12.access(
|
|
241352
|
-
console.log(
|
|
241829
|
+
await fs12.access(file.targetPath);
|
|
241830
|
+
console.log(`${file.displayPath} already exists.`);
|
|
241353
241831
|
} catch {
|
|
241354
|
-
await fs12.writeFile(
|
|
241355
|
-
console.log(`Created
|
|
241832
|
+
await fs12.writeFile(file.targetPath, file.content, "utf-8");
|
|
241833
|
+
console.log(`Created ${file.displayPath}`);
|
|
241356
241834
|
}
|
|
241357
241835
|
}
|
|
241358
241836
|
console.log(`
|
|
@@ -241690,7 +242168,7 @@ Headless task complete.
|
|
|
241690
242168
|
// src/hooks/use-agent-session.ts
|
|
241691
242169
|
init_src4();
|
|
241692
242170
|
init_config();
|
|
241693
|
-
var
|
|
242171
|
+
var import_react54 = __toESM(require_react(), 1);
|
|
241694
242172
|
|
|
241695
242173
|
// src/constants/prompts.ts
|
|
241696
242174
|
var getGrillPrompt = (userPrompt, projectContext) => `You are a principal software architect interviewing a developer to align on a technical specification before implementation.
|
|
@@ -241701,7 +242179,7 @@ ${projectContext ? `<project_context>
|
|
|
241701
242179
|
${projectContext}
|
|
241702
242180
|
</project_context>
|
|
241703
242181
|
` : ""}
|
|
241704
|
-
Generate
|
|
242182
|
+
Generate exactly 10 targeted, high-impact multiple-choice questions to clarify requirements, architectural choices, tech stack decisions, edge cases, and potential breaking changes.
|
|
241705
242183
|
|
|
241706
242184
|
Requirements for questions:
|
|
241707
242185
|
1. Focus on technical depth: probe architectural tradeoffs, API design, state management, edge cases, and error handling.
|
|
@@ -241823,6 +242301,38 @@ if (!globalSymbols.__taskManagerCleanupAdded) {
|
|
|
241823
242301
|
|
|
241824
242302
|
// src/hooks/use-agent-session.ts
|
|
241825
242303
|
init_error_parser();
|
|
242304
|
+
|
|
242305
|
+
// src/utils/json-parser.ts
|
|
242306
|
+
function extractJsonArray(rawText) {
|
|
242307
|
+
const trimmed = rawText.trim();
|
|
242308
|
+
try {
|
|
242309
|
+
const parsed = JSON.parse(trimmed);
|
|
242310
|
+
if (Array.isArray(parsed)) {
|
|
242311
|
+
return parsed;
|
|
242312
|
+
}
|
|
242313
|
+
} catch {}
|
|
242314
|
+
const codeblockMatch = trimmed.match(/```(?:json)?\s*([\s\S]*?)\s*```/i);
|
|
242315
|
+
if (codeblockMatch && codeblockMatch[1]) {
|
|
242316
|
+
try {
|
|
242317
|
+
const parsed = JSON.parse(codeblockMatch[1].trim());
|
|
242318
|
+
if (Array.isArray(parsed)) {
|
|
242319
|
+
return parsed;
|
|
242320
|
+
}
|
|
242321
|
+
} catch {}
|
|
242322
|
+
}
|
|
242323
|
+
const arrayBracketMatch = trimmed.match(/\[\s*\{[\s\S]*\}\s*\]/);
|
|
242324
|
+
if (arrayBracketMatch) {
|
|
242325
|
+
try {
|
|
242326
|
+
const parsed = JSON.parse(arrayBracketMatch[0]);
|
|
242327
|
+
if (Array.isArray(parsed)) {
|
|
242328
|
+
return parsed;
|
|
242329
|
+
}
|
|
242330
|
+
} catch {}
|
|
242331
|
+
}
|
|
242332
|
+
throw new Error("Failed to extract a valid JSON array from model output.");
|
|
242333
|
+
}
|
|
242334
|
+
|
|
242335
|
+
// src/hooks/use-agent-session.ts
|
|
241826
242336
|
init_models5();
|
|
241827
242337
|
|
|
241828
242338
|
// src/hooks/use-agent-runner.ts
|
|
@@ -242119,7 +242629,7 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242119
242629
|
throw new Error("Login functionality is not provided by the host environment.");
|
|
242120
242630
|
}
|
|
242121
242631
|
const codeMsgId = getNextMsgId();
|
|
242122
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
242632
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242123
242633
|
setActiveMessages([
|
|
242124
242634
|
{
|
|
242125
242635
|
id: codeMsgId,
|
|
@@ -242167,7 +242677,7 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242167
242677
|
setHasBothAuth(authStatus.hasByok && authStatus.hasDecember);
|
|
242168
242678
|
setSettingsAuthPriority(authStatus.authPriority);
|
|
242169
242679
|
}
|
|
242170
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
242680
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242171
242681
|
setActiveMessages([
|
|
242172
242682
|
{
|
|
242173
242683
|
id: getNextMsgId(),
|
|
@@ -242182,7 +242692,7 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242182
242692
|
}
|
|
242183
242693
|
const errorText = `Login failed: ${cleanMsg}`;
|
|
242184
242694
|
setAuthError(errorText);
|
|
242185
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
242695
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242186
242696
|
setActiveMessages([{ id: getNextMsgId(), role: "error", text: errorText }]);
|
|
242187
242697
|
} finally {
|
|
242188
242698
|
setIsStreaming(false);
|
|
@@ -242327,7 +242837,7 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242327
242837
|
setAuthError(errorText);
|
|
242328
242838
|
setAuthMode("none");
|
|
242329
242839
|
setApiKey("");
|
|
242330
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
242840
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242331
242841
|
setActiveMessages([
|
|
242332
242842
|
{
|
|
242333
242843
|
id: getNextMsgId(),
|
|
@@ -242374,7 +242884,7 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242374
242884
|
} else {
|
|
242375
242885
|
setAuthMethod(undefined);
|
|
242376
242886
|
}
|
|
242377
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
242887
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242378
242888
|
setActiveMessages([]);
|
|
242379
242889
|
addToast(`Removed credentials for: ${removedName}`, "success");
|
|
242380
242890
|
};
|
|
@@ -242389,15 +242899,6 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242389
242899
|
resumedMessages.push({ id: getNextMsgId(), role: "user", text: msg.content });
|
|
242390
242900
|
} else if (msg.role === "assistant") {
|
|
242391
242901
|
const blocks = [];
|
|
242392
|
-
if (msg.errorMessage) {
|
|
242393
|
-
const { parseErrorMessage: parseErrorMessage2 } = await Promise.resolve().then(() => (init_error_parser(), exports_error_parser));
|
|
242394
|
-
blocks.push({
|
|
242395
|
-
type: "error",
|
|
242396
|
-
error: parseErrorMessage2({ message: msg.errorMessage })
|
|
242397
|
-
});
|
|
242398
|
-
} else if (msg.content) {
|
|
242399
|
-
blocks.push({ type: "text", content: msg.content });
|
|
242400
|
-
}
|
|
242401
242902
|
if (msg.toolCalls && msg.toolCalls.length > 0) {
|
|
242402
242903
|
for (const tc of msg.toolCalls) {
|
|
242403
242904
|
const toolMsg = agent2.messages.find((m3) => m3.role === "tool" && m3.toolCallId === tc.id);
|
|
@@ -242414,6 +242915,15 @@ function useAuthHandlers(agent2, onLogin, onLoginHeadless) {
|
|
|
242414
242915
|
});
|
|
242415
242916
|
}
|
|
242416
242917
|
}
|
|
242918
|
+
if (msg.errorMessage) {
|
|
242919
|
+
const { parseErrorMessage: parseErrorMessage2 } = await Promise.resolve().then(() => (init_error_parser(), exports_error_parser));
|
|
242920
|
+
blocks.push({
|
|
242921
|
+
type: "error",
|
|
242922
|
+
error: parseErrorMessage2({ message: msg.errorMessage })
|
|
242923
|
+
});
|
|
242924
|
+
} else if (msg.content) {
|
|
242925
|
+
blocks.push({ type: "text", content: msg.content });
|
|
242926
|
+
}
|
|
242417
242927
|
if (blocks.length > 0) {
|
|
242418
242928
|
resumedMessages.push({
|
|
242419
242929
|
id: getNextMsgId(),
|
|
@@ -242650,6 +243160,8 @@ function useAgentSession({
|
|
|
242650
243160
|
setActiveMessages,
|
|
242651
243161
|
isStreaming,
|
|
242652
243162
|
setIsStreaming,
|
|
243163
|
+
queuedPrompts,
|
|
243164
|
+
setQueuedPrompts,
|
|
242653
243165
|
pendingQuestions,
|
|
242654
243166
|
setPendingQuestions,
|
|
242655
243167
|
pendingToolCall,
|
|
@@ -242704,11 +243216,11 @@ function useAgentSession({
|
|
|
242704
243216
|
settingsFollowUpMode,
|
|
242705
243217
|
setSettingsFollowUpMode
|
|
242706
243218
|
} = state;
|
|
242707
|
-
const [expandCommands, setExpandCommands] =
|
|
242708
|
-
const toggleExpandCommands =
|
|
243219
|
+
const [expandCommands, setExpandCommands] = import_react54.useState(false);
|
|
243220
|
+
const toggleExpandCommands = import_react54.useCallback(() => {
|
|
242709
243221
|
setExpandCommands((prev2) => !prev2);
|
|
242710
243222
|
}, []);
|
|
242711
|
-
|
|
243223
|
+
import_react54.useEffect(() => {
|
|
242712
243224
|
setIsAuthenticated(initialAuth);
|
|
242713
243225
|
setAuthMethod(initialAuthMethod);
|
|
242714
243226
|
if (initialHasBothAuth !== undefined)
|
|
@@ -242729,7 +243241,7 @@ function useAgentSession({
|
|
|
242729
243241
|
setSettingsAuthPriority,
|
|
242730
243242
|
setCurrentEmail
|
|
242731
243243
|
]);
|
|
242732
|
-
|
|
243244
|
+
import_react54.useEffect(() => {
|
|
242733
243245
|
if (agent2) {
|
|
242734
243246
|
if (!agent2.operations)
|
|
242735
243247
|
agent2.operations = {};
|
|
@@ -242763,7 +243275,7 @@ function useAgentSession({
|
|
|
242763
243275
|
};
|
|
242764
243276
|
}
|
|
242765
243277
|
}, [agent2]);
|
|
242766
|
-
|
|
243278
|
+
import_react54.useEffect(() => {
|
|
242767
243279
|
if (authMode === "tasks_mode") {
|
|
242768
243280
|
const update3 = () => {
|
|
242769
243281
|
setTasksData([...taskManager.getTasks()]);
|
|
@@ -242773,13 +243285,13 @@ function useAgentSession({
|
|
|
242773
243285
|
return () => clearInterval(interval);
|
|
242774
243286
|
}
|
|
242775
243287
|
}, [authMode, setTasksData]);
|
|
242776
|
-
const handleKillTask =
|
|
243288
|
+
const handleKillTask = import_react54.useCallback((taskId) => {
|
|
242777
243289
|
taskManager.killTask(taskId);
|
|
242778
243290
|
setTasksData([...taskManager.getTasks()]);
|
|
242779
243291
|
}, [setTasksData]);
|
|
242780
|
-
const generateGrillQuestions =
|
|
243292
|
+
const generateGrillQuestions = import_react54.useCallback(async (userPrompt) => {
|
|
242781
243293
|
setIsStreaming(true);
|
|
242782
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
243294
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242783
243295
|
setActiveMessages([
|
|
242784
243296
|
{
|
|
242785
243297
|
id: getNextMsgId(),
|
|
@@ -242793,7 +243305,7 @@ function useAgentSession({
|
|
|
242793
243305
|
}
|
|
242794
243306
|
]);
|
|
242795
243307
|
try {
|
|
242796
|
-
const prompt = getGrillPrompt(userPrompt
|
|
243308
|
+
const prompt = getGrillPrompt(userPrompt);
|
|
242797
243309
|
const stream = agent2.llm.stream([{ role: "user", content: prompt }], undefined, undefined, agent2.modelOptions);
|
|
242798
243310
|
let accumulatedText = "";
|
|
242799
243311
|
for await (const chunk2 of stream) {
|
|
@@ -242801,12 +243313,7 @@ function useAgentSession({
|
|
|
242801
243313
|
accumulatedText += chunk2.text;
|
|
242802
243314
|
}
|
|
242803
243315
|
}
|
|
242804
|
-
|
|
242805
|
-
if (cleanJson.startsWith("```")) {
|
|
242806
|
-
cleanJson = cleanJson.replace(/^```[a-zA-Z]*\n/, "").replace(/\n```$/, "");
|
|
242807
|
-
}
|
|
242808
|
-
cleanJson = cleanJson.trim();
|
|
242809
|
-
const questions = JSON.parse(cleanJson);
|
|
243316
|
+
const questions = extractJsonArray(accumulatedText);
|
|
242810
243317
|
if (!Array.isArray(questions) || questions.length === 0) {
|
|
242811
243318
|
throw new Error("Invalid questions format returned from model.");
|
|
242812
243319
|
}
|
|
@@ -242823,8 +243330,8 @@ function useAgentSession({
|
|
|
242823
243330
|
} finally {
|
|
242824
243331
|
setIsStreaming(false);
|
|
242825
243332
|
}
|
|
242826
|
-
}, [agent2
|
|
242827
|
-
const generatePlanFromGrill =
|
|
243333
|
+
}, [agent2]);
|
|
243334
|
+
const generatePlanFromGrill = import_react54.useCallback(async (answers) => {
|
|
242828
243335
|
setAuthMode("none");
|
|
242829
243336
|
const originalPrompt = grillPrompt;
|
|
242830
243337
|
setGrillPrompt(null);
|
|
@@ -242835,7 +243342,7 @@ function useAgentSession({
|
|
|
242835
243342
|
setCurrentPlannedPrompt(originalPrompt);
|
|
242836
243343
|
const planPrompt = getPlanPrompt(originalPrompt || "", grillQuestions.map((q2, i2) => ({ question: q2.question, answer: answers[i2] || "" })));
|
|
242837
243344
|
setIsStreaming(true);
|
|
242838
|
-
setStaticMessages((prev2) => [...prev2, ...activeMessages]);
|
|
243345
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
242839
243346
|
const assistantMsgId = getNextMsgId();
|
|
242840
243347
|
setActiveMessages([
|
|
242841
243348
|
{
|
|
@@ -242858,7 +243365,7 @@ function useAgentSession({
|
|
|
242858
243365
|
setAuthMode("plan_approve");
|
|
242859
243366
|
}
|
|
242860
243367
|
}, [agent2, grillPrompt, grillQuestions, activeMessages]);
|
|
242861
|
-
const handleGrillSelect =
|
|
243368
|
+
const handleGrillSelect = import_react54.useCallback(async (item) => {
|
|
242862
243369
|
if (item.value === "custom") {
|
|
242863
243370
|
setCustomInputMode(true);
|
|
242864
243371
|
return;
|
|
@@ -242871,7 +243378,7 @@ function useAgentSession({
|
|
|
242871
243378
|
await generatePlanFromGrill(nextAnswers);
|
|
242872
243379
|
}
|
|
242873
243380
|
}, [grillAnswers, currentGrillIndex, grillQuestions, generatePlanFromGrill]);
|
|
242874
|
-
const handleSubmit =
|
|
243381
|
+
const handleSubmit = import_react54.useCallback(async (text3) => {
|
|
242875
243382
|
if (text3.trim() === "/exit") {
|
|
242876
243383
|
setShouldExit(true);
|
|
242877
243384
|
process.exit(0);
|
|
@@ -242934,7 +243441,12 @@ Please run \`/login\` to:
|
|
|
242934
243441
|
}
|
|
242935
243442
|
]
|
|
242936
243443
|
};
|
|
242937
|
-
setStaticMessages((prev2) => [
|
|
243444
|
+
setStaticMessages((prev2) => [
|
|
243445
|
+
...prev2,
|
|
243446
|
+
...useCliStore.getState().activeMessages,
|
|
243447
|
+
userMsg,
|
|
243448
|
+
noticeMsg
|
|
243449
|
+
]);
|
|
242938
243450
|
setActiveMessages([]);
|
|
242939
243451
|
return;
|
|
242940
243452
|
}
|
|
@@ -242955,7 +243467,12 @@ Please run \`/login\` to:
|
|
|
242955
243467
|
role: "assistant",
|
|
242956
243468
|
blocks: [{ type: "text", content: "Session repository not available." }]
|
|
242957
243469
|
};
|
|
242958
|
-
setStaticMessages((prev2) => [
|
|
243470
|
+
setStaticMessages((prev2) => [
|
|
243471
|
+
...prev2,
|
|
243472
|
+
...useCliStore.getState().activeMessages,
|
|
243473
|
+
userMsg,
|
|
243474
|
+
noticeMsg
|
|
243475
|
+
]);
|
|
242959
243476
|
setActiveMessages([]);
|
|
242960
243477
|
return;
|
|
242961
243478
|
}
|
|
@@ -243016,7 +243533,8 @@ Please run \`/login\` to:
|
|
|
243016
243533
|
blocks: [
|
|
243017
243534
|
{
|
|
243018
243535
|
type: "text",
|
|
243019
|
-
content: `
|
|
243536
|
+
content: `
|
|
243537
|
+
Opening usage dashboard...
|
|
243020
243538
|
|
|
243021
243539
|
If it doesn't open automatically, please click here:
|
|
243022
243540
|
[${url}](${url})`
|
|
@@ -243029,6 +243547,32 @@ If it doesn't open automatically, please click here:
|
|
|
243029
243547
|
}).catch(console.error);
|
|
243030
243548
|
return;
|
|
243031
243549
|
}
|
|
243550
|
+
if (text3.trim() === "/feedback") {
|
|
243551
|
+
const url = "https://github.com/phasehumans/december/issues";
|
|
243552
|
+
setActiveMessages((prev2) => [
|
|
243553
|
+
...prev2,
|
|
243554
|
+
{
|
|
243555
|
+
id: getNextMsgId(),
|
|
243556
|
+
role: "assistant",
|
|
243557
|
+
blocks: [
|
|
243558
|
+
{
|
|
243559
|
+
type: "text",
|
|
243560
|
+
content: `
|
|
243561
|
+
Opening GitHub issues...
|
|
243562
|
+
|
|
243563
|
+
If it doesn't open automatically, please click here:
|
|
243564
|
+
[${url}](${url})
|
|
243565
|
+
|
|
243566
|
+
*Have feedback, found a bug, or have a feature request? Let us know on GitHub issues!*`
|
|
243567
|
+
}
|
|
243568
|
+
]
|
|
243569
|
+
}
|
|
243570
|
+
]);
|
|
243571
|
+
Promise.resolve().then(() => (init_open(), exports_open)).then((openUtils) => {
|
|
243572
|
+
openUtils.openUrl(url);
|
|
243573
|
+
}).catch(console.error);
|
|
243574
|
+
return;
|
|
243575
|
+
}
|
|
243032
243576
|
if (!isAuthenticated) {
|
|
243033
243577
|
const userMsg = { id: getNextMsgId(), role: "user", text: text3 };
|
|
243034
243578
|
const noticeMsg = {
|
|
@@ -243045,33 +243589,50 @@ Please run \`/login\` to:
|
|
|
243045
243589
|
}
|
|
243046
243590
|
]
|
|
243047
243591
|
};
|
|
243048
|
-
setStaticMessages((prev2) => [
|
|
243592
|
+
setStaticMessages((prev2) => [
|
|
243593
|
+
...prev2,
|
|
243594
|
+
...useCliStore.getState().activeMessages,
|
|
243595
|
+
userMsg,
|
|
243596
|
+
noticeMsg
|
|
243597
|
+
]);
|
|
243049
243598
|
setActiveMessages([]);
|
|
243050
243599
|
return;
|
|
243051
243600
|
}
|
|
243052
243601
|
if (isStreaming) {
|
|
243053
|
-
|
|
243054
|
-
setActiveMessages((prev2) => [...prev2, { id: getNextMsgId(), role: "user", text: text3 }]);
|
|
243602
|
+
setQueuedPrompts((prev2) => [...prev2, text3.trim()]);
|
|
243055
243603
|
return;
|
|
243056
243604
|
}
|
|
243057
|
-
|
|
243058
|
-
|
|
243059
|
-
|
|
243060
|
-
|
|
243061
|
-
|
|
243062
|
-
|
|
243063
|
-
try {
|
|
243064
|
-
const stream = runAgentLoop(agent2, promptToSend);
|
|
243065
|
-
await processAgentStream({ stream, setActiveMessages, assistantMsgId });
|
|
243066
|
-
} catch (err) {
|
|
243067
|
-
setActiveMessages((prev2) => [
|
|
243605
|
+
let currentText = text3.trim();
|
|
243606
|
+
while (currentText) {
|
|
243607
|
+
setIsStreaming(true);
|
|
243608
|
+
const assistantMsgId = getNextMsgId();
|
|
243609
|
+
const newUserMsg = { id: getNextMsgId(), role: "user", text: currentText };
|
|
243610
|
+
setStaticMessages((prev2) => [
|
|
243068
243611
|
...prev2,
|
|
243069
|
-
|
|
243612
|
+
...useCliStore.getState().activeMessages,
|
|
243613
|
+
newUserMsg
|
|
243070
243614
|
]);
|
|
243071
|
-
|
|
243072
|
-
|
|
243073
|
-
|
|
243074
|
-
|
|
243615
|
+
setActiveMessages([{ id: assistantMsgId, role: "assistant", blocks: [] }]);
|
|
243616
|
+
try {
|
|
243617
|
+
const stream = runAgentLoop(agent2, currentText);
|
|
243618
|
+
await processAgentStream({ stream, setActiveMessages, assistantMsgId });
|
|
243619
|
+
} catch (err) {
|
|
243620
|
+
setActiveMessages((prev2) => [
|
|
243621
|
+
...prev2,
|
|
243622
|
+
{ id: getNextMsgId(), role: "error", text: err.message }
|
|
243623
|
+
]);
|
|
243624
|
+
} finally {
|
|
243625
|
+
setIsStreaming(false);
|
|
243626
|
+
setStaticMessages((prev2) => [...prev2, ...useCliStore.getState().activeMessages]);
|
|
243627
|
+
setActiveMessages([]);
|
|
243628
|
+
}
|
|
243629
|
+
const nextQueue = useCliStore.getState().queuedPrompts;
|
|
243630
|
+
if (nextQueue.length > 0) {
|
|
243631
|
+
currentText = nextQueue[0];
|
|
243632
|
+
useCliStore.getState().setQueuedPrompts(nextQueue.slice(1));
|
|
243633
|
+
} else {
|
|
243634
|
+
currentText = undefined;
|
|
243635
|
+
}
|
|
243075
243636
|
}
|
|
243076
243637
|
}, [
|
|
243077
243638
|
agent2,
|
|
@@ -243086,13 +243647,15 @@ Please run \`/login\` to:
|
|
|
243086
243647
|
sessionRepository,
|
|
243087
243648
|
authMode,
|
|
243088
243649
|
currentGrillIndex,
|
|
243089
|
-
grillMode
|
|
243650
|
+
grillMode,
|
|
243651
|
+
setQueuedPrompts
|
|
243090
243652
|
]);
|
|
243091
|
-
const handleAbort =
|
|
243653
|
+
const handleAbort = import_react54.useCallback(() => {
|
|
243092
243654
|
if (isStreaming && agent2) {
|
|
243093
243655
|
agent2.abort();
|
|
243656
|
+
setQueuedPrompts([]);
|
|
243094
243657
|
}
|
|
243095
|
-
}, [isStreaming, agent2]);
|
|
243658
|
+
}, [isStreaming, agent2, setQueuedPrompts]);
|
|
243096
243659
|
const {
|
|
243097
243660
|
handleSettingsMainSelect,
|
|
243098
243661
|
handleSettingsAgentSelect,
|
|
@@ -243107,7 +243670,7 @@ Please run \`/login\` to:
|
|
|
243107
243670
|
handleLogoutSelect,
|
|
243108
243671
|
handleSessionSelect
|
|
243109
243672
|
} = useAuthHandlers(agent2, onLogin, onLoginHeadless);
|
|
243110
|
-
const handlePlanApprovalSelect =
|
|
243673
|
+
const handlePlanApprovalSelect = import_react54.useCallback(async (item) => {
|
|
243111
243674
|
setAuthMode("none");
|
|
243112
243675
|
const originalPrompt = currentPlannedPrompt;
|
|
243113
243676
|
setCurrentPlannedPrompt(null);
|
|
@@ -243218,7 +243781,9 @@ Please run \`/login\` to:
|
|
|
243218
243781
|
toasts,
|
|
243219
243782
|
addToast,
|
|
243220
243783
|
expandCommands,
|
|
243221
|
-
toggleExpandCommands
|
|
243784
|
+
toggleExpandCommands,
|
|
243785
|
+
queuedPrompts,
|
|
243786
|
+
setQueuedPrompts
|
|
243222
243787
|
};
|
|
243223
243788
|
}
|
|
243224
243789
|
|
|
@@ -243378,7 +243943,7 @@ var localOperations = {
|
|
|
243378
243943
|
// src/index.ts
|
|
243379
243944
|
function AppWrapper(props) {
|
|
243380
243945
|
const session = useAgentSession(props);
|
|
243381
|
-
return
|
|
243946
|
+
return import_react55.default.createElement(ChatApp, { ...props, session });
|
|
243382
243947
|
}
|
|
243383
243948
|
async function main() {
|
|
243384
243949
|
process.title = "december";
|
|
@@ -243427,12 +243992,7 @@ async function main() {
|
|
|
243427
243992
|
AskQuestionTool,
|
|
243428
243993
|
ManageTaskTool,
|
|
243429
243994
|
BrowserTool,
|
|
243430
|
-
|
|
243431
|
-
WebSearchTool,
|
|
243432
|
-
readWikiTool,
|
|
243433
|
-
updateWikiTool,
|
|
243434
|
-
createPrReviewTool,
|
|
243435
|
-
submitPrTool
|
|
243995
|
+
WebSearchTool
|
|
243436
243996
|
],
|
|
243437
243997
|
operations: localOperations,
|
|
243438
243998
|
modelOptions: {
|
|
@@ -243472,7 +244032,7 @@ Executing Headless Task: "${parsedArgs.prompt}"
|
|
|
243472
244032
|
const result2 = await runHeadlessTask(parsedArgs.prompt, { agent: agent2 });
|
|
243473
244033
|
process.exit(result2.success ? 0 : 1);
|
|
243474
244034
|
}
|
|
243475
|
-
render_default(
|
|
244035
|
+
render_default(import_react55.default.createElement(RootLayout, null, import_react55.default.createElement(AppWrapper, {
|
|
243476
244036
|
agent: agent2,
|
|
243477
244037
|
isAuthenticated,
|
|
243478
244038
|
authMethod: providerConfig?.authMethod,
|