@letta-ai/letta-code 0.12.3 → 0.12.5
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/letta.js +578 -491
- package/package.json +1 -1
package/letta.js
CHANGED
|
@@ -3237,7 +3237,7 @@ var package_default;
|
|
|
3237
3237
|
var init_package = __esm(() => {
|
|
3238
3238
|
package_default = {
|
|
3239
3239
|
name: "@letta-ai/letta-code",
|
|
3240
|
-
version: "0.12.
|
|
3240
|
+
version: "0.12.5",
|
|
3241
3241
|
description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
3242
3242
|
type: "module",
|
|
3243
3243
|
bin: {
|
|
@@ -4495,6 +4495,50 @@ var init_anthropic_provider = __esm(async () => {
|
|
|
4495
4495
|
await init_settings_manager();
|
|
4496
4496
|
});
|
|
4497
4497
|
|
|
4498
|
+
// src/utils/timing.ts
|
|
4499
|
+
function isTimingsEnabled() {
|
|
4500
|
+
const val = process.env.LETTA_DEBUG_TIMINGS;
|
|
4501
|
+
return val === "1" || val === "true";
|
|
4502
|
+
}
|
|
4503
|
+
function formatDuration(ms) {
|
|
4504
|
+
if (ms < 1000)
|
|
4505
|
+
return `${Math.round(ms)}ms`;
|
|
4506
|
+
return `${(ms / 1000).toFixed(2)}s`;
|
|
4507
|
+
}
|
|
4508
|
+
function formatTimestamp(date) {
|
|
4509
|
+
return date.toISOString().slice(11, 23);
|
|
4510
|
+
}
|
|
4511
|
+
function logTiming(message) {
|
|
4512
|
+
if (isTimingsEnabled()) {
|
|
4513
|
+
console.error(`[timing] ${message}`);
|
|
4514
|
+
}
|
|
4515
|
+
}
|
|
4516
|
+
function createTimingFetch(baseFetch) {
|
|
4517
|
+
return async (input, init) => {
|
|
4518
|
+
const start = performance.now();
|
|
4519
|
+
const startTime = formatTimestamp(new Date);
|
|
4520
|
+
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
|
|
4521
|
+
const method = init?.method || "GET";
|
|
4522
|
+
let path2;
|
|
4523
|
+
try {
|
|
4524
|
+
path2 = new URL(url).pathname;
|
|
4525
|
+
} catch {
|
|
4526
|
+
path2 = url;
|
|
4527
|
+
}
|
|
4528
|
+
logTiming(`${method} ${path2} started at ${startTime}`);
|
|
4529
|
+
try {
|
|
4530
|
+
const response = await baseFetch(input, init);
|
|
4531
|
+
const duration = performance.now() - start;
|
|
4532
|
+
logTiming(`${method} ${path2} -> ${formatDuration(duration)} (status: ${response.status})`);
|
|
4533
|
+
return response;
|
|
4534
|
+
} catch (error) {
|
|
4535
|
+
const duration = performance.now() - start;
|
|
4536
|
+
logTiming(`${method} ${path2} -> FAILED after ${formatDuration(duration)}`);
|
|
4537
|
+
throw error;
|
|
4538
|
+
}
|
|
4539
|
+
};
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4498
4542
|
// src/agent/client.ts
|
|
4499
4543
|
var exports_client = {};
|
|
4500
4544
|
__export(exports_client, {
|
|
@@ -4543,7 +4587,8 @@ async function getClient2() {
|
|
|
4543
4587
|
defaultHeaders: {
|
|
4544
4588
|
"X-Letta-Source": "letta-code",
|
|
4545
4589
|
"User-Agent": `letta-code/${package_default.version}`
|
|
4546
|
-
}
|
|
4590
|
+
},
|
|
4591
|
+
...isTimingsEnabled() && { fetch: createTimingFetch(fetch) }
|
|
4547
4592
|
});
|
|
4548
4593
|
}
|
|
4549
4594
|
var init_client2 = __esm(async () => {
|
|
@@ -34376,6 +34421,12 @@ class PermissionModeManager2 {
|
|
|
34376
34421
|
return "allow";
|
|
34377
34422
|
}
|
|
34378
34423
|
}
|
|
34424
|
+
if (toolName === "Skill" || toolName === "skill") {
|
|
34425
|
+
const command = toolArgs?.command;
|
|
34426
|
+
if (command && ["load", "unload", "refresh"].includes(command)) {
|
|
34427
|
+
return "allow";
|
|
34428
|
+
}
|
|
34429
|
+
}
|
|
34379
34430
|
const shellTools = [
|
|
34380
34431
|
"Bash",
|
|
34381
34432
|
"shell",
|
|
@@ -43995,9 +44046,12 @@ function handleApprovalRequestEvent(event, state) {
|
|
|
43995
44046
|
}
|
|
43996
44047
|
}
|
|
43997
44048
|
function handleAutoApprovalEvent(event, state, subagentId) {
|
|
43998
|
-
const
|
|
43999
|
-
if (
|
|
44000
|
-
|
|
44049
|
+
const tc = event.tool_call;
|
|
44050
|
+
if (!tc)
|
|
44051
|
+
return;
|
|
44052
|
+
const { tool_call_id, name, arguments: tool_args = "{}" } = tc;
|
|
44053
|
+
if (tool_call_id && name) {
|
|
44054
|
+
recordToolCall(subagentId, tool_call_id, name, tool_args, state.displayedToolCalls);
|
|
44001
44055
|
}
|
|
44002
44056
|
}
|
|
44003
44057
|
function handleResultEvent(event, state, subagentId) {
|
|
@@ -44025,7 +44079,10 @@ function processStreamEvent(line, state, baseURL, subagentId) {
|
|
|
44025
44079
|
const event = JSON.parse(line);
|
|
44026
44080
|
switch (event.type) {
|
|
44027
44081
|
case "init":
|
|
44028
|
-
|
|
44082
|
+
case "system":
|
|
44083
|
+
if (event.type === "init" || event.subtype === "init") {
|
|
44084
|
+
handleInitEvent(event, state, baseURL, subagentId);
|
|
44085
|
+
}
|
|
44029
44086
|
break;
|
|
44030
44087
|
case "message":
|
|
44031
44088
|
if (event.message_type === "approval_request_message") {
|
|
@@ -50614,20 +50671,27 @@ var init_create = __esm(async () => {
|
|
|
50614
50671
|
|
|
50615
50672
|
// src/agent/message.ts
|
|
50616
50673
|
async function sendMessageStream(agentId, messages, opts = { streamTokens: true, background: true }, requestOptions = { maxRetries: 0 }) {
|
|
50674
|
+
const requestStartTime = isTimingsEnabled() ? performance.now() : undefined;
|
|
50617
50675
|
const client = await getClient2();
|
|
50618
|
-
|
|
50676
|
+
const stream2 = await client.agents.messages.create(agentId, {
|
|
50619
50677
|
messages,
|
|
50620
50678
|
streaming: true,
|
|
50621
50679
|
stream_tokens: opts.streamTokens ?? true,
|
|
50622
50680
|
background: opts.background ?? true,
|
|
50623
50681
|
client_tools: getClientToolsFromRegistry()
|
|
50624
50682
|
}, requestOptions);
|
|
50683
|
+
if (requestStartTime !== undefined) {
|
|
50684
|
+
stream2[STREAM_REQUEST_START_TIME] = requestStartTime;
|
|
50685
|
+
}
|
|
50686
|
+
return stream2;
|
|
50625
50687
|
}
|
|
50688
|
+
var STREAM_REQUEST_START_TIME;
|
|
50626
50689
|
var init_message = __esm(async () => {
|
|
50627
50690
|
await __promiseAll([
|
|
50628
50691
|
init_manager4(),
|
|
50629
50692
|
init_client2()
|
|
50630
50693
|
]);
|
|
50694
|
+
STREAM_REQUEST_START_TIME = Symbol("streamRequestStartTime");
|
|
50631
50695
|
});
|
|
50632
50696
|
|
|
50633
50697
|
// src/agent/stats.ts
|
|
@@ -51052,6 +51116,8 @@ function safeJsonParseOr(json, defaultValue) {
|
|
|
51052
51116
|
// src/cli/helpers/stream.ts
|
|
51053
51117
|
async function drainStream(stream2, buffers, refresh, abortSignal, onFirstMessage) {
|
|
51054
51118
|
const startTime = performance.now();
|
|
51119
|
+
const requestStartTime = stream2[STREAM_REQUEST_START_TIME];
|
|
51120
|
+
let hasLoggedTTFT = false;
|
|
51055
51121
|
let _approvalRequestId = null;
|
|
51056
51122
|
const pendingApprovals = new Map;
|
|
51057
51123
|
let stopReason = null;
|
|
@@ -51104,6 +51170,11 @@ async function drainStream(stream2, buffers, refresh, abortSignal, onFirstMessag
|
|
|
51104
51170
|
hasCalledFirstMessage = true;
|
|
51105
51171
|
queueMicrotask(() => onFirstMessage());
|
|
51106
51172
|
}
|
|
51173
|
+
if (!hasLoggedTTFT && requestStartTime !== undefined && (chunk.message_type === "reasoning_message" || chunk.message_type === "assistant_message")) {
|
|
51174
|
+
hasLoggedTTFT = true;
|
|
51175
|
+
const ttft = performance.now() - requestStartTime;
|
|
51176
|
+
logTiming(`TTFT: ${formatDuration(ttft)} (from POST to first content)`);
|
|
51177
|
+
}
|
|
51107
51178
|
if (chunk.message_type === "tool_return_message") {
|
|
51108
51179
|
if (chunk.tool_call_id) {
|
|
51109
51180
|
pendingApprovals.delete(chunk.tool_call_id);
|
|
@@ -51235,7 +51306,10 @@ async function drainStreamWithResume(stream2, buffers, refresh, abortSignal, onF
|
|
|
51235
51306
|
var init_stream = __esm(async () => {
|
|
51236
51307
|
init_error();
|
|
51237
51308
|
init_accumulator();
|
|
51238
|
-
await
|
|
51309
|
+
await __promiseAll([
|
|
51310
|
+
init_client2(),
|
|
51311
|
+
init_message()
|
|
51312
|
+
]);
|
|
51239
51313
|
});
|
|
51240
51314
|
|
|
51241
51315
|
// src/tools/toolset.ts
|
|
@@ -59079,10 +59153,26 @@ var init_HelpDialog = __esm(async () => {
|
|
|
59079
59153
|
HELP_TABS = ["commands", "shortcuts"];
|
|
59080
59154
|
});
|
|
59081
59155
|
|
|
59156
|
+
// src/cli/hooks/useProgressIndicator.ts
|
|
59157
|
+
function useProgressIndicator(active = true) {
|
|
59158
|
+
import_react41.useEffect(() => {
|
|
59159
|
+
if (!active)
|
|
59160
|
+
return;
|
|
59161
|
+
process.stdout.write(PROGRESS_INDETERMINATE);
|
|
59162
|
+
return () => {
|
|
59163
|
+
process.stdout.write(PROGRESS_CLEAR);
|
|
59164
|
+
};
|
|
59165
|
+
}, [active]);
|
|
59166
|
+
}
|
|
59167
|
+
var import_react41, PROGRESS_INDETERMINATE = "\x1B]9;4;3;0\x07", PROGRESS_CLEAR = "\x1B]9;4;0;0\x07";
|
|
59168
|
+
var init_useProgressIndicator = __esm(() => {
|
|
59169
|
+
import_react41 = __toESM(require_react(), 1);
|
|
59170
|
+
});
|
|
59171
|
+
|
|
59082
59172
|
// src/cli/hooks/useTextInputCursor.ts
|
|
59083
59173
|
function useTextInputCursor(initialText = "") {
|
|
59084
|
-
const [text, setText] =
|
|
59085
|
-
const [cursorPos, setCursorPos] =
|
|
59174
|
+
const [text, setText] = import_react42.useState(initialText);
|
|
59175
|
+
const [cursorPos, setCursorPos] = import_react42.useState(0);
|
|
59086
59176
|
const handleKey = (input, key) => {
|
|
59087
59177
|
if (key.leftArrow) {
|
|
59088
59178
|
setCursorPos((prev) => Math.max(0, prev - 1));
|
|
@@ -59119,21 +59209,22 @@ function useTextInputCursor(initialText = "") {
|
|
|
59119
59209
|
clear
|
|
59120
59210
|
};
|
|
59121
59211
|
}
|
|
59122
|
-
var
|
|
59212
|
+
var import_react42;
|
|
59123
59213
|
var init_useTextInputCursor = __esm(() => {
|
|
59124
|
-
|
|
59214
|
+
import_react42 = __toESM(require_react(), 1);
|
|
59125
59215
|
});
|
|
59126
59216
|
|
|
59127
59217
|
// src/cli/components/InlineBashApproval.tsx
|
|
59128
|
-
var
|
|
59218
|
+
var import_react43, jsx_dev_runtime20, SOLID_LINE4 = "─", InlineBashApproval;
|
|
59129
59219
|
var init_InlineBashApproval = __esm(async () => {
|
|
59220
|
+
init_useProgressIndicator();
|
|
59130
59221
|
init_useTerminalWidth();
|
|
59131
59222
|
init_useTextInputCursor();
|
|
59132
59223
|
init_colors();
|
|
59133
59224
|
await init_build2();
|
|
59134
|
-
|
|
59225
|
+
import_react43 = __toESM(require_react(), 1);
|
|
59135
59226
|
jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
59136
|
-
InlineBashApproval =
|
|
59227
|
+
InlineBashApproval = import_react43.memo(({
|
|
59137
59228
|
bashInfo,
|
|
59138
59229
|
onApprove,
|
|
59139
59230
|
onApproveAlways,
|
|
@@ -59143,7 +59234,7 @@ var init_InlineBashApproval = __esm(async () => {
|
|
|
59143
59234
|
approveAlwaysText,
|
|
59144
59235
|
allowPersistence = true
|
|
59145
59236
|
}) => {
|
|
59146
|
-
const [selectedOption, setSelectedOption] =
|
|
59237
|
+
const [selectedOption, setSelectedOption] = import_react43.useState(0);
|
|
59147
59238
|
const {
|
|
59148
59239
|
text: customReason,
|
|
59149
59240
|
cursorPos,
|
|
@@ -59151,6 +59242,7 @@ var init_InlineBashApproval = __esm(async () => {
|
|
|
59151
59242
|
clear
|
|
59152
59243
|
} = useTextInputCursor();
|
|
59153
59244
|
const columns = useTerminalWidth();
|
|
59245
|
+
useProgressIndicator();
|
|
59154
59246
|
const customOptionIndex = allowPersistence ? 2 : 1;
|
|
59155
59247
|
const maxOptionIndex = customOptionIndex;
|
|
59156
59248
|
const isOnCustomOption = selectedOption === customOptionIndex;
|
|
@@ -59201,7 +59293,7 @@ var init_InlineBashApproval = __esm(async () => {
|
|
|
59201
59293
|
}
|
|
59202
59294
|
}, { isActive: isFocused });
|
|
59203
59295
|
const solidLine = SOLID_LINE4.repeat(Math.max(columns - 2, 10));
|
|
59204
|
-
const memoizedCommandContent =
|
|
59296
|
+
const memoizedCommandContent = import_react43.useMemo(() => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
59205
59297
|
children: [
|
|
59206
59298
|
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
59207
59299
|
dimColor: true,
|
|
@@ -59342,14 +59434,15 @@ var init_InlineBashApproval = __esm(async () => {
|
|
|
59342
59434
|
});
|
|
59343
59435
|
|
|
59344
59436
|
// src/cli/components/InlineEnterPlanModeApproval.tsx
|
|
59345
|
-
var
|
|
59437
|
+
var import_react44, jsx_dev_runtime21, SOLID_LINE5 = "─", OptionsRenderer, InlineEnterPlanModeApproval;
|
|
59346
59438
|
var init_InlineEnterPlanModeApproval = __esm(async () => {
|
|
59439
|
+
init_useProgressIndicator();
|
|
59347
59440
|
init_useTerminalWidth();
|
|
59348
59441
|
init_colors();
|
|
59349
59442
|
await init_build2();
|
|
59350
|
-
|
|
59443
|
+
import_react44 = __toESM(require_react(), 1);
|
|
59351
59444
|
jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
59352
|
-
OptionsRenderer =
|
|
59445
|
+
OptionsRenderer = import_react44.memo(({
|
|
59353
59446
|
options,
|
|
59354
59447
|
selectedOption
|
|
59355
59448
|
}) => {
|
|
@@ -59375,9 +59468,10 @@ var init_InlineEnterPlanModeApproval = __esm(async () => {
|
|
|
59375
59468
|
}, undefined, false, undefined, this);
|
|
59376
59469
|
});
|
|
59377
59470
|
OptionsRenderer.displayName = "OptionsRenderer";
|
|
59378
|
-
InlineEnterPlanModeApproval =
|
|
59379
|
-
const [selectedOption, setSelectedOption] =
|
|
59471
|
+
InlineEnterPlanModeApproval = import_react44.memo(({ onApprove, onReject, isFocused = true }) => {
|
|
59472
|
+
const [selectedOption, setSelectedOption] = import_react44.useState(0);
|
|
59380
59473
|
const columns = useTerminalWidth();
|
|
59474
|
+
useProgressIndicator();
|
|
59381
59475
|
const options = [
|
|
59382
59476
|
{ label: "Yes, enter plan mode", action: onApprove },
|
|
59383
59477
|
{ label: "No, start implementing now", action: onReject }
|
|
@@ -59526,10 +59620,11 @@ function getDiffKind(toolName) {
|
|
|
59526
59620
|
}
|
|
59527
59621
|
return "edit";
|
|
59528
59622
|
}
|
|
59529
|
-
var
|
|
59623
|
+
var import_react45, jsx_dev_runtime22, SOLID_LINE6 = "─", DOTTED_LINE3 = "╌", InlineFileEditApproval;
|
|
59530
59624
|
var init_InlineFileEditApproval = __esm(async () => {
|
|
59531
59625
|
init_diff2();
|
|
59532
59626
|
init_formatArgsDisplay();
|
|
59627
|
+
init_useProgressIndicator();
|
|
59533
59628
|
init_useTerminalWidth();
|
|
59534
59629
|
init_useTextInputCursor();
|
|
59535
59630
|
init_colors();
|
|
@@ -59537,9 +59632,9 @@ var init_InlineFileEditApproval = __esm(async () => {
|
|
|
59537
59632
|
init_build2(),
|
|
59538
59633
|
init_AdvancedDiffRenderer()
|
|
59539
59634
|
]);
|
|
59540
|
-
|
|
59635
|
+
import_react45 = __toESM(require_react(), 1);
|
|
59541
59636
|
jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
|
|
59542
|
-
InlineFileEditApproval =
|
|
59637
|
+
InlineFileEditApproval = import_react45.memo(({
|
|
59543
59638
|
fileEdit,
|
|
59544
59639
|
precomputedDiff,
|
|
59545
59640
|
allDiffs,
|
|
@@ -59551,7 +59646,7 @@ var init_InlineFileEditApproval = __esm(async () => {
|
|
|
59551
59646
|
approveAlwaysText,
|
|
59552
59647
|
allowPersistence = true
|
|
59553
59648
|
}) => {
|
|
59554
|
-
const [selectedOption, setSelectedOption] =
|
|
59649
|
+
const [selectedOption, setSelectedOption] = import_react45.useState(0);
|
|
59555
59650
|
const {
|
|
59556
59651
|
text: customReason,
|
|
59557
59652
|
cursorPos,
|
|
@@ -59559,10 +59654,11 @@ var init_InlineFileEditApproval = __esm(async () => {
|
|
|
59559
59654
|
clear
|
|
59560
59655
|
} = useTextInputCursor();
|
|
59561
59656
|
const columns = useTerminalWidth();
|
|
59657
|
+
useProgressIndicator();
|
|
59562
59658
|
const customOptionIndex = allowPersistence ? 2 : 1;
|
|
59563
59659
|
const maxOptionIndex = customOptionIndex;
|
|
59564
59660
|
const isOnCustomOption = selectedOption === customOptionIndex;
|
|
59565
|
-
const diffsToPass =
|
|
59661
|
+
const diffsToPass = import_react45.useMemo(() => {
|
|
59566
59662
|
const diffs = new Map;
|
|
59567
59663
|
const toolCallId = fileEdit.toolCallId;
|
|
59568
59664
|
if (precomputedDiff && toolCallId) {
|
|
@@ -59645,7 +59741,7 @@ var init_InlineFileEditApproval = __esm(async () => {
|
|
|
59645
59741
|
const dottedLine = DOTTED_LINE3.repeat(Math.max(columns - 2, 10));
|
|
59646
59742
|
const headerText = getHeaderText(fileEdit);
|
|
59647
59743
|
const diffKind = getDiffKind(fileEdit.toolName);
|
|
59648
|
-
const memoizedDiffContent =
|
|
59744
|
+
const memoizedDiffContent = import_react45.useMemo(() => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(jsx_dev_runtime22.Fragment, {
|
|
59649
59745
|
children: [
|
|
59650
59746
|
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
59651
59747
|
dimColor: true,
|
|
@@ -59900,15 +59996,16 @@ function formatArgs(toolArgs) {
|
|
|
59900
59996
|
return toolArgs || "(no arguments)";
|
|
59901
59997
|
}
|
|
59902
59998
|
}
|
|
59903
|
-
var
|
|
59999
|
+
var import_react46, jsx_dev_runtime23, SOLID_LINE7 = "─", InlineGenericApproval;
|
|
59904
60000
|
var init_InlineGenericApproval = __esm(async () => {
|
|
60001
|
+
init_useProgressIndicator();
|
|
59905
60002
|
init_useTerminalWidth();
|
|
59906
60003
|
init_useTextInputCursor();
|
|
59907
60004
|
init_colors();
|
|
59908
60005
|
await init_build2();
|
|
59909
|
-
|
|
60006
|
+
import_react46 = __toESM(require_react(), 1);
|
|
59910
60007
|
jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
|
|
59911
|
-
InlineGenericApproval =
|
|
60008
|
+
InlineGenericApproval = import_react46.memo(({
|
|
59912
60009
|
toolName,
|
|
59913
60010
|
toolArgs,
|
|
59914
60011
|
onApprove,
|
|
@@ -59919,7 +60016,7 @@ var init_InlineGenericApproval = __esm(async () => {
|
|
|
59919
60016
|
approveAlwaysText,
|
|
59920
60017
|
allowPersistence = true
|
|
59921
60018
|
}) => {
|
|
59922
|
-
const [selectedOption, setSelectedOption] =
|
|
60019
|
+
const [selectedOption, setSelectedOption] = import_react46.useState(0);
|
|
59923
60020
|
const {
|
|
59924
60021
|
text: customReason,
|
|
59925
60022
|
cursorPos,
|
|
@@ -59927,6 +60024,7 @@ var init_InlineGenericApproval = __esm(async () => {
|
|
|
59927
60024
|
clear
|
|
59928
60025
|
} = useTextInputCursor();
|
|
59929
60026
|
const columns = useTerminalWidth();
|
|
60027
|
+
useProgressIndicator();
|
|
59930
60028
|
const customOptionIndex = allowPersistence ? 2 : 1;
|
|
59931
60029
|
const maxOptionIndex = customOptionIndex;
|
|
59932
60030
|
const isOnCustomOption = selectedOption === customOptionIndex;
|
|
@@ -59978,7 +60076,7 @@ var init_InlineGenericApproval = __esm(async () => {
|
|
|
59978
60076
|
}, { isActive: isFocused });
|
|
59979
60077
|
const solidLine = SOLID_LINE7.repeat(Math.max(columns - 2, 10));
|
|
59980
60078
|
const formattedArgs = formatArgs(toolArgs);
|
|
59981
|
-
const memoizedToolContent =
|
|
60079
|
+
const memoizedToolContent = import_react46.useMemo(() => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
|
|
59982
60080
|
children: [
|
|
59983
60081
|
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
59984
60082
|
dimColor: true,
|
|
@@ -60118,18 +60216,19 @@ var init_InlineGenericApproval = __esm(async () => {
|
|
|
60118
60216
|
});
|
|
60119
60217
|
|
|
60120
60218
|
// src/cli/components/InlineQuestionApproval.tsx
|
|
60121
|
-
var
|
|
60219
|
+
var import_react47, jsx_dev_runtime24, SOLID_LINE8 = "─", InlineQuestionApproval;
|
|
60122
60220
|
var init_InlineQuestionApproval = __esm(async () => {
|
|
60221
|
+
init_useProgressIndicator();
|
|
60123
60222
|
init_useTerminalWidth();
|
|
60124
60223
|
init_useTextInputCursor();
|
|
60125
60224
|
init_colors();
|
|
60126
60225
|
await init_build2();
|
|
60127
|
-
|
|
60226
|
+
import_react47 = __toESM(require_react(), 1);
|
|
60128
60227
|
jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
|
|
60129
|
-
InlineQuestionApproval =
|
|
60130
|
-
const [currentQuestionIndex, setCurrentQuestionIndex] =
|
|
60131
|
-
const [answers, setAnswers] =
|
|
60132
|
-
const [selectedOption, setSelectedOption] =
|
|
60228
|
+
InlineQuestionApproval = import_react47.memo(({ questions, onSubmit, onCancel, isFocused = true }) => {
|
|
60229
|
+
const [currentQuestionIndex, setCurrentQuestionIndex] = import_react47.useState(0);
|
|
60230
|
+
const [answers, setAnswers] = import_react47.useState({});
|
|
60231
|
+
const [selectedOption, setSelectedOption] = import_react47.useState(0);
|
|
60133
60232
|
const {
|
|
60134
60233
|
text: customText,
|
|
60135
60234
|
setText: setCustomText,
|
|
@@ -60138,8 +60237,9 @@ var init_InlineQuestionApproval = __esm(async () => {
|
|
|
60138
60237
|
handleKey,
|
|
60139
60238
|
clear: clearCustomText
|
|
60140
60239
|
} = useTextInputCursor();
|
|
60141
|
-
const [selectedMulti, setSelectedMulti] =
|
|
60240
|
+
const [selectedMulti, setSelectedMulti] = import_react47.useState(new Set);
|
|
60142
60241
|
const columns = useTerminalWidth();
|
|
60242
|
+
useProgressIndicator();
|
|
60143
60243
|
const currentQuestion = questions[currentQuestionIndex];
|
|
60144
60244
|
const baseOptions = currentQuestion ? [
|
|
60145
60245
|
...currentQuestion.options,
|
|
@@ -60306,7 +60406,7 @@ var init_InlineQuestionApproval = __esm(async () => {
|
|
|
60306
60406
|
}
|
|
60307
60407
|
}, { isActive: isFocused });
|
|
60308
60408
|
const solidLine = SOLID_LINE8.repeat(Math.max(columns - 2, 10));
|
|
60309
|
-
const memoizedHeaderContent =
|
|
60409
|
+
const memoizedHeaderContent = import_react47.useMemo(() => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
|
60310
60410
|
children: [
|
|
60311
60411
|
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
60312
60412
|
dimColor: true,
|
|
@@ -60399,7 +60499,7 @@ var init_InlineQuestionApproval = __esm(async () => {
|
|
|
60399
60499
|
}, "submit", true, undefined, this);
|
|
60400
60500
|
}
|
|
60401
60501
|
const hasDescription = option.description && !isCustomOption;
|
|
60402
|
-
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(
|
|
60502
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(import_react47.Fragment, {
|
|
60403
60503
|
children: [
|
|
60404
60504
|
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
60405
60505
|
flexDirection: "row",
|
|
@@ -60487,15 +60587,16 @@ function truncate(text, maxLength) {
|
|
|
60487
60587
|
return text;
|
|
60488
60588
|
return `${text.slice(0, maxLength - 3)}...`;
|
|
60489
60589
|
}
|
|
60490
|
-
var
|
|
60590
|
+
var import_react48, jsx_dev_runtime25, SOLID_LINE9 = "─", InlineTaskApproval;
|
|
60491
60591
|
var init_InlineTaskApproval = __esm(async () => {
|
|
60592
|
+
init_useProgressIndicator();
|
|
60492
60593
|
init_useTerminalWidth();
|
|
60493
60594
|
init_useTextInputCursor();
|
|
60494
60595
|
init_colors();
|
|
60495
60596
|
await init_build2();
|
|
60496
|
-
|
|
60597
|
+
import_react48 = __toESM(require_react(), 1);
|
|
60497
60598
|
jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
|
|
60498
|
-
InlineTaskApproval =
|
|
60599
|
+
InlineTaskApproval = import_react48.memo(({
|
|
60499
60600
|
taskInfo,
|
|
60500
60601
|
onApprove,
|
|
60501
60602
|
onApproveAlways,
|
|
@@ -60505,7 +60606,7 @@ var init_InlineTaskApproval = __esm(async () => {
|
|
|
60505
60606
|
approveAlwaysText,
|
|
60506
60607
|
allowPersistence = true
|
|
60507
60608
|
}) => {
|
|
60508
|
-
const [selectedOption, setSelectedOption] =
|
|
60609
|
+
const [selectedOption, setSelectedOption] = import_react48.useState(0);
|
|
60509
60610
|
const {
|
|
60510
60611
|
text: customReason,
|
|
60511
60612
|
cursorPos,
|
|
@@ -60513,6 +60614,7 @@ var init_InlineTaskApproval = __esm(async () => {
|
|
|
60513
60614
|
clear
|
|
60514
60615
|
} = useTextInputCursor();
|
|
60515
60616
|
const columns = useTerminalWidth();
|
|
60617
|
+
useProgressIndicator();
|
|
60516
60618
|
const customOptionIndex = allowPersistence ? 2 : 1;
|
|
60517
60619
|
const maxOptionIndex = customOptionIndex;
|
|
60518
60620
|
const isOnCustomOption = selectedOption === customOptionIndex;
|
|
@@ -60564,7 +60666,7 @@ var init_InlineTaskApproval = __esm(async () => {
|
|
|
60564
60666
|
}, { isActive: isFocused });
|
|
60565
60667
|
const solidLine = SOLID_LINE9.repeat(Math.max(columns - 2, 10));
|
|
60566
60668
|
const contentWidth = Math.max(0, columns - 4);
|
|
60567
|
-
const memoizedTaskContent =
|
|
60669
|
+
const memoizedTaskContent = import_react48.useMemo(() => {
|
|
60568
60670
|
const { subagentType, description, prompt, model } = taskInfo;
|
|
60569
60671
|
const truncatedPrompt = truncate(prompt, 300);
|
|
60570
60672
|
return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(jsx_dev_runtime25.Fragment, {
|
|
@@ -62430,9 +62532,9 @@ var require_cli_spinners = __commonJS((exports, module) => {
|
|
|
62430
62532
|
|
|
62431
62533
|
// node_modules/ink-spinner/build/index.js
|
|
62432
62534
|
function Spinner({ type = "dots" }) {
|
|
62433
|
-
const [frame, setFrame] =
|
|
62535
|
+
const [frame, setFrame] = import_react49.useState(0);
|
|
62434
62536
|
const spinner = import_cli_spinners.default[type];
|
|
62435
|
-
|
|
62537
|
+
import_react49.useEffect(() => {
|
|
62436
62538
|
const timer = setInterval(() => {
|
|
62437
62539
|
setFrame((previousFrame) => {
|
|
62438
62540
|
const isLastFrame = previousFrame === spinner.frames.length - 1;
|
|
@@ -62443,12 +62545,12 @@ function Spinner({ type = "dots" }) {
|
|
|
62443
62545
|
clearInterval(timer);
|
|
62444
62546
|
};
|
|
62445
62547
|
}, [spinner]);
|
|
62446
|
-
return
|
|
62548
|
+
return import_react49.default.createElement(Text, null, spinner.frames[frame]);
|
|
62447
62549
|
}
|
|
62448
|
-
var
|
|
62550
|
+
var import_react49, import_cli_spinners, build_default2;
|
|
62449
62551
|
var init_build5 = __esm(async () => {
|
|
62450
62552
|
await init_build2();
|
|
62451
|
-
|
|
62553
|
+
import_react49 = __toESM(require_react(), 1);
|
|
62452
62554
|
import_cli_spinners = __toESM(require_cli_spinners(), 1);
|
|
62453
62555
|
build_default2 = Spinner;
|
|
62454
62556
|
});
|
|
@@ -63655,7 +63757,7 @@ var init_dist4 = __esm(async () => {
|
|
|
63655
63757
|
});
|
|
63656
63758
|
|
|
63657
63759
|
// src/cli/components/AgentInfoBar.tsx
|
|
63658
|
-
var
|
|
63760
|
+
var import_react50, jsx_dev_runtime26, AgentInfoBar;
|
|
63659
63761
|
var init_AgentInfoBar = __esm(async () => {
|
|
63660
63762
|
init_constants();
|
|
63661
63763
|
init_colors();
|
|
@@ -63664,14 +63766,14 @@ var init_AgentInfoBar = __esm(async () => {
|
|
|
63664
63766
|
init_dist4(),
|
|
63665
63767
|
init_settings_manager()
|
|
63666
63768
|
]);
|
|
63667
|
-
|
|
63769
|
+
import_react50 = __toESM(require_react(), 1);
|
|
63668
63770
|
jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
|
|
63669
|
-
AgentInfoBar =
|
|
63771
|
+
AgentInfoBar = import_react50.memo(function AgentInfoBar2({
|
|
63670
63772
|
agentId,
|
|
63671
63773
|
agentName,
|
|
63672
63774
|
serverUrl
|
|
63673
63775
|
}) {
|
|
63674
|
-
const isPinned =
|
|
63776
|
+
const isPinned = import_react50.useMemo(() => {
|
|
63675
63777
|
if (!agentId)
|
|
63676
63778
|
return false;
|
|
63677
63779
|
const localPinned = settingsManager.getLocalPinnedAgents();
|
|
@@ -63845,16 +63947,16 @@ function useAutocompleteNavigation({
|
|
|
63845
63947
|
manageActiveState = true,
|
|
63846
63948
|
disabled = false
|
|
63847
63949
|
}) {
|
|
63848
|
-
const [selectedIndex, setSelectedIndex] =
|
|
63849
|
-
const prevMatchCountRef =
|
|
63850
|
-
const prevIsActiveRef =
|
|
63851
|
-
|
|
63950
|
+
const [selectedIndex, setSelectedIndex] = import_react51.useState(0);
|
|
63951
|
+
const prevMatchCountRef = import_react51.useRef(0);
|
|
63952
|
+
const prevIsActiveRef = import_react51.useRef(false);
|
|
63953
|
+
import_react51.useEffect(() => {
|
|
63852
63954
|
if (matches.length !== prevMatchCountRef.current) {
|
|
63853
63955
|
setSelectedIndex(0);
|
|
63854
63956
|
prevMatchCountRef.current = matches.length;
|
|
63855
63957
|
}
|
|
63856
63958
|
}, [matches.length]);
|
|
63857
|
-
|
|
63959
|
+
import_react51.useEffect(() => {
|
|
63858
63960
|
if (manageActiveState) {
|
|
63859
63961
|
const isActive = matches.length > 0;
|
|
63860
63962
|
if (isActive !== prevIsActiveRef.current) {
|
|
@@ -63889,10 +63991,10 @@ function useAutocompleteNavigation({
|
|
|
63889
63991
|
});
|
|
63890
63992
|
return { selectedIndex };
|
|
63891
63993
|
}
|
|
63892
|
-
var
|
|
63994
|
+
var import_react51;
|
|
63893
63995
|
var init_useAutocompleteNavigation = __esm(async () => {
|
|
63894
63996
|
await init_build2();
|
|
63895
|
-
|
|
63997
|
+
import_react51 = __toESM(require_react(), 1);
|
|
63896
63998
|
});
|
|
63897
63999
|
|
|
63898
64000
|
// src/cli/components/Autocomplete.tsx
|
|
@@ -63967,10 +64069,10 @@ function FileAutocomplete({
|
|
|
63967
64069
|
onSelect,
|
|
63968
64070
|
onActiveChange
|
|
63969
64071
|
}) {
|
|
63970
|
-
const [matches, setMatches] =
|
|
63971
|
-
const [isLoading, setIsLoading] =
|
|
63972
|
-
const [lastValidQuery, setLastValidQuery] =
|
|
63973
|
-
const debounceTimeout =
|
|
64072
|
+
const [matches, setMatches] = import_react52.useState([]);
|
|
64073
|
+
const [isLoading, setIsLoading] = import_react52.useState(false);
|
|
64074
|
+
const [lastValidQuery, setLastValidQuery] = import_react52.useState("");
|
|
64075
|
+
const debounceTimeout = import_react52.useRef(null);
|
|
63974
64076
|
const { selectedIndex } = useAutocompleteNavigation({
|
|
63975
64077
|
matches,
|
|
63976
64078
|
maxVisible: 10,
|
|
@@ -63978,7 +64080,7 @@ function FileAutocomplete({
|
|
|
63978
64080
|
manageActiveState: false,
|
|
63979
64081
|
disabled: isLoading
|
|
63980
64082
|
});
|
|
63981
|
-
|
|
64083
|
+
import_react52.useEffect(() => {
|
|
63982
64084
|
if (debounceTimeout.current) {
|
|
63983
64085
|
clearTimeout(debounceTimeout.current);
|
|
63984
64086
|
}
|
|
@@ -64097,7 +64199,7 @@ function FileAutocomplete({
|
|
|
64097
64199
|
}, undefined, false, undefined, this)
|
|
64098
64200
|
}, undefined, false, undefined, this);
|
|
64099
64201
|
}
|
|
64100
|
-
var
|
|
64202
|
+
var import_react52, jsx_dev_runtime28;
|
|
64101
64203
|
var init_FileAutocomplete = __esm(async () => {
|
|
64102
64204
|
init_fileSearch();
|
|
64103
64205
|
init_colors();
|
|
@@ -64106,7 +64208,7 @@ var init_FileAutocomplete = __esm(async () => {
|
|
|
64106
64208
|
init_useAutocompleteNavigation(),
|
|
64107
64209
|
init_Autocomplete()
|
|
64108
64210
|
]);
|
|
64109
|
-
|
|
64211
|
+
import_react52 = __toESM(require_react(), 1);
|
|
64110
64212
|
jsx_dev_runtime28 = __toESM(require_jsx_dev_runtime(), 1);
|
|
64111
64213
|
});
|
|
64112
64214
|
|
|
@@ -64133,9 +64235,9 @@ function SlashCommandAutocomplete({
|
|
|
64133
64235
|
agentId,
|
|
64134
64236
|
workingDirectory = process.cwd()
|
|
64135
64237
|
}) {
|
|
64136
|
-
const [matches, setMatches] =
|
|
64137
|
-
const [customCommands, setCustomCommands] =
|
|
64138
|
-
|
|
64238
|
+
const [matches, setMatches] = import_react53.useState([]);
|
|
64239
|
+
const [customCommands, setCustomCommands] = import_react53.useState([]);
|
|
64240
|
+
import_react53.useEffect(() => {
|
|
64139
64241
|
Promise.resolve().then(() => (init_custom(), exports_custom)).then(({ getCustomCommands: getCustomCommands2 }) => {
|
|
64140
64242
|
getCustomCommands2().then((customs) => {
|
|
64141
64243
|
const matches2 = customs.map((cmd) => ({
|
|
@@ -64147,7 +64249,7 @@ function SlashCommandAutocomplete({
|
|
|
64147
64249
|
});
|
|
64148
64250
|
});
|
|
64149
64251
|
}, []);
|
|
64150
|
-
const allCommands =
|
|
64252
|
+
const allCommands = import_react53.useMemo(() => {
|
|
64151
64253
|
let builtins = _allCommands;
|
|
64152
64254
|
if (agentId) {
|
|
64153
64255
|
try {
|
|
@@ -64178,7 +64280,7 @@ function SlashCommandAutocomplete({
|
|
|
64178
64280
|
onAutocomplete: onAutocomplete ? (item) => onAutocomplete(item.cmd) : undefined,
|
|
64179
64281
|
onActiveChange
|
|
64180
64282
|
});
|
|
64181
|
-
|
|
64283
|
+
import_react53.useEffect(() => {
|
|
64182
64284
|
const result = extractSearchQuery2(currentInput, cursorPosition);
|
|
64183
64285
|
if (!result) {
|
|
64184
64286
|
setMatches([]);
|
|
@@ -64279,7 +64381,7 @@ function SlashCommandAutocomplete({
|
|
|
64279
64381
|
]
|
|
64280
64382
|
}, undefined, true, undefined, this);
|
|
64281
64383
|
}
|
|
64282
|
-
var
|
|
64384
|
+
var import_react53, jsx_dev_runtime29, VISIBLE_COMMANDS = 8, _allCommands;
|
|
64283
64385
|
var init_SlashCommandAutocomplete = __esm(async () => {
|
|
64284
64386
|
init_version();
|
|
64285
64387
|
init_registry();
|
|
@@ -64291,7 +64393,7 @@ var init_SlashCommandAutocomplete = __esm(async () => {
|
|
|
64291
64393
|
init_useAutocompleteNavigation(),
|
|
64292
64394
|
init_Autocomplete()
|
|
64293
64395
|
]);
|
|
64294
|
-
|
|
64396
|
+
import_react53 = __toESM(require_react(), 1);
|
|
64295
64397
|
jsx_dev_runtime29 = __toESM(require_jsx_dev_runtime(), 1);
|
|
64296
64398
|
_allCommands = Object.entries(commands).filter(([, { hidden }]) => !hidden).map(([cmd, { desc, order }]) => ({
|
|
64297
64399
|
cmd,
|
|
@@ -64315,7 +64417,7 @@ function InputAssist({
|
|
|
64315
64417
|
}) {
|
|
64316
64418
|
const showFileAutocomplete = currentInput.includes("@");
|
|
64317
64419
|
const showCommandAutocomplete = !showFileAutocomplete && currentInput.startsWith("/");
|
|
64318
|
-
|
|
64420
|
+
import_react54.useEffect(() => {
|
|
64319
64421
|
if (!showFileAutocomplete && !showCommandAutocomplete) {
|
|
64320
64422
|
onAutocompleteActiveChange(false);
|
|
64321
64423
|
}
|
|
@@ -64355,7 +64457,7 @@ function InputAssist({
|
|
|
64355
64457
|
}
|
|
64356
64458
|
return null;
|
|
64357
64459
|
}
|
|
64358
|
-
var
|
|
64460
|
+
var import_react54, jsx_dev_runtime30;
|
|
64359
64461
|
var init_InputAssist = __esm(async () => {
|
|
64360
64462
|
await __promiseAll([
|
|
64361
64463
|
init_build2(),
|
|
@@ -64363,17 +64465,17 @@ var init_InputAssist = __esm(async () => {
|
|
|
64363
64465
|
init_FileAutocomplete(),
|
|
64364
64466
|
init_SlashCommandAutocomplete()
|
|
64365
64467
|
]);
|
|
64366
|
-
|
|
64468
|
+
import_react54 = __toESM(require_react(), 1);
|
|
64367
64469
|
jsx_dev_runtime30 = __toESM(require_jsx_dev_runtime(), 1);
|
|
64368
64470
|
});
|
|
64369
64471
|
|
|
64370
64472
|
// src/cli/components/QueuedMessages.tsx
|
|
64371
|
-
var
|
|
64473
|
+
var import_react55, jsx_dev_runtime31, QueuedMessages;
|
|
64372
64474
|
var init_QueuedMessages = __esm(async () => {
|
|
64373
64475
|
await init_build2();
|
|
64374
|
-
|
|
64476
|
+
import_react55 = __toESM(require_react(), 1);
|
|
64375
64477
|
jsx_dev_runtime31 = __toESM(require_jsx_dev_runtime(), 1);
|
|
64376
|
-
QueuedMessages =
|
|
64478
|
+
QueuedMessages = import_react55.memo(({ messages }) => {
|
|
64377
64479
|
const maxDisplay = 5;
|
|
64378
64480
|
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
64379
64481
|
flexDirection: "column",
|
|
@@ -64482,22 +64584,22 @@ function Input({
|
|
|
64482
64584
|
ralphPendingYolo = false,
|
|
64483
64585
|
onRalphExit
|
|
64484
64586
|
}) {
|
|
64485
|
-
const [value, setValue] =
|
|
64486
|
-
const [escapePressed, setEscapePressed] =
|
|
64487
|
-
const escapeTimerRef =
|
|
64488
|
-
const [ctrlCPressed, setCtrlCPressed] =
|
|
64489
|
-
const ctrlCTimerRef =
|
|
64490
|
-
const previousValueRef =
|
|
64491
|
-
const [currentMode, setCurrentMode] =
|
|
64492
|
-
const [isAutocompleteActive, setIsAutocompleteActive] =
|
|
64493
|
-
const [cursorPos, setCursorPos] =
|
|
64494
|
-
const [currentCursorPosition, setCurrentCursorPosition] =
|
|
64495
|
-
const [history, setHistory] =
|
|
64496
|
-
const [historyIndex, setHistoryIndex] =
|
|
64497
|
-
const [temporaryInput, setTemporaryInput] =
|
|
64498
|
-
const [atStartBoundary, setAtStartBoundary] =
|
|
64499
|
-
const [atEndBoundary, setAtEndBoundary] =
|
|
64500
|
-
const [isBashMode, setIsBashMode] =
|
|
64587
|
+
const [value, setValue] = import_react56.useState("");
|
|
64588
|
+
const [escapePressed, setEscapePressed] = import_react56.useState(false);
|
|
64589
|
+
const escapeTimerRef = import_react56.useRef(null);
|
|
64590
|
+
const [ctrlCPressed, setCtrlCPressed] = import_react56.useState(false);
|
|
64591
|
+
const ctrlCTimerRef = import_react56.useRef(null);
|
|
64592
|
+
const previousValueRef = import_react56.useRef(value);
|
|
64593
|
+
const [currentMode, setCurrentMode] = import_react56.useState(externalMode || permissionMode2.getMode());
|
|
64594
|
+
const [isAutocompleteActive, setIsAutocompleteActive] = import_react56.useState(false);
|
|
64595
|
+
const [cursorPos, setCursorPos] = import_react56.useState(undefined);
|
|
64596
|
+
const [currentCursorPosition, setCurrentCursorPosition] = import_react56.useState(0);
|
|
64597
|
+
const [history, setHistory] = import_react56.useState([]);
|
|
64598
|
+
const [historyIndex, setHistoryIndex] = import_react56.useState(-1);
|
|
64599
|
+
const [temporaryInput, setTemporaryInput] = import_react56.useState("");
|
|
64600
|
+
const [atStartBoundary, setAtStartBoundary] = import_react56.useState(false);
|
|
64601
|
+
const [atEndBoundary, setAtEndBoundary] = import_react56.useState(false);
|
|
64602
|
+
const [isBashMode, setIsBashMode] = import_react56.useState(false);
|
|
64501
64603
|
const handleBangAtEmpty = () => {
|
|
64502
64604
|
if (isBashMode)
|
|
64503
64605
|
return false;
|
|
@@ -64510,13 +64612,13 @@ function Input({
|
|
|
64510
64612
|
setIsBashMode(false);
|
|
64511
64613
|
return true;
|
|
64512
64614
|
};
|
|
64513
|
-
|
|
64615
|
+
import_react56.useEffect(() => {
|
|
64514
64616
|
if (cursorPos !== undefined) {
|
|
64515
64617
|
const timer = setTimeout(() => setCursorPos(undefined), 0);
|
|
64516
64618
|
return () => clearTimeout(timer);
|
|
64517
64619
|
}
|
|
64518
64620
|
}, [cursorPos]);
|
|
64519
|
-
|
|
64621
|
+
import_react56.useEffect(() => {
|
|
64520
64622
|
if (currentCursorPosition !== 0) {
|
|
64521
64623
|
setAtStartBoundary(false);
|
|
64522
64624
|
}
|
|
@@ -64524,14 +64626,14 @@ function Input({
|
|
|
64524
64626
|
setAtEndBoundary(false);
|
|
64525
64627
|
}
|
|
64526
64628
|
}, [currentCursorPosition, value.length]);
|
|
64527
|
-
|
|
64629
|
+
import_react56.useEffect(() => {
|
|
64528
64630
|
if (externalMode !== undefined) {
|
|
64529
64631
|
setCurrentMode(externalMode);
|
|
64530
64632
|
}
|
|
64531
64633
|
}, [externalMode]);
|
|
64532
|
-
const [shimmerOffset, setShimmerOffset] =
|
|
64533
|
-
const [elapsedMs, setElapsedMs] =
|
|
64534
|
-
const streamStartRef =
|
|
64634
|
+
const [shimmerOffset, setShimmerOffset] = import_react56.useState(-3);
|
|
64635
|
+
const [elapsedMs, setElapsedMs] = import_react56.useState(0);
|
|
64636
|
+
const streamStartRef = import_react56.useRef(null);
|
|
64535
64637
|
const columns = useTerminalWidth();
|
|
64536
64638
|
const contentWidth = Math.max(0, columns - 2);
|
|
64537
64639
|
const settings = settingsManager.getSettings();
|
|
@@ -64699,7 +64801,7 @@ function Input({
|
|
|
64699
64801
|
}
|
|
64700
64802
|
}
|
|
64701
64803
|
});
|
|
64702
|
-
|
|
64804
|
+
import_react56.useEffect(() => {
|
|
64703
64805
|
if (value !== previousValueRef.current && value !== "") {
|
|
64704
64806
|
setEscapePressed(false);
|
|
64705
64807
|
if (escapeTimerRef.current)
|
|
@@ -64714,13 +64816,13 @@ function Input({
|
|
|
64714
64816
|
}
|
|
64715
64817
|
previousValueRef.current = value;
|
|
64716
64818
|
}, [value]);
|
|
64717
|
-
|
|
64819
|
+
import_react56.useEffect(() => {
|
|
64718
64820
|
if (historyIndex !== -1 && value !== history[historyIndex]) {
|
|
64719
64821
|
setHistoryIndex(-1);
|
|
64720
64822
|
setTemporaryInput("");
|
|
64721
64823
|
}
|
|
64722
64824
|
}, [value, historyIndex, history]);
|
|
64723
|
-
|
|
64825
|
+
import_react56.useEffect(() => {
|
|
64724
64826
|
return () => {
|
|
64725
64827
|
if (escapeTimerRef.current)
|
|
64726
64828
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -64728,7 +64830,7 @@ function Input({
|
|
|
64728
64830
|
clearTimeout(ctrlCTimerRef.current);
|
|
64729
64831
|
};
|
|
64730
64832
|
}, []);
|
|
64731
|
-
|
|
64833
|
+
import_react56.useEffect(() => {
|
|
64732
64834
|
if (!streaming || !visible)
|
|
64733
64835
|
return;
|
|
64734
64836
|
const id = setInterval(() => {
|
|
@@ -64741,7 +64843,7 @@ function Input({
|
|
|
64741
64843
|
}, 120);
|
|
64742
64844
|
return () => clearInterval(id);
|
|
64743
64845
|
}, [streaming, thinkingMessage, visible, agentName]);
|
|
64744
|
-
|
|
64846
|
+
import_react56.useEffect(() => {
|
|
64745
64847
|
if (streaming && visible) {
|
|
64746
64848
|
if (streamStartRef.current === null) {
|
|
64747
64849
|
streamStartRef.current = Date.now();
|
|
@@ -65042,7 +65144,7 @@ function Input({
|
|
|
65042
65144
|
]
|
|
65043
65145
|
}, undefined, true, undefined, this);
|
|
65044
65146
|
}
|
|
65045
|
-
var
|
|
65147
|
+
var import_react56, jsx_dev_runtime33, Spinner2, ESC_CLEAR_WINDOW_MS = 2500;
|
|
65046
65148
|
var init_InputRich = __esm(async () => {
|
|
65047
65149
|
init_source();
|
|
65048
65150
|
init_oauth();
|
|
@@ -65061,7 +65163,7 @@ var init_InputRich = __esm(async () => {
|
|
|
65061
65163
|
init_QueuedMessages(),
|
|
65062
65164
|
init_ShimmerText()
|
|
65063
65165
|
]);
|
|
65064
|
-
|
|
65166
|
+
import_react56 = __toESM(require_react(), 1);
|
|
65065
65167
|
jsx_dev_runtime33 = __toESM(require_jsx_dev_runtime(), 1);
|
|
65066
65168
|
Spinner2 = build_default2;
|
|
65067
65169
|
stdin.setMaxListeners(20);
|
|
@@ -65097,7 +65199,7 @@ function truncateText(text, maxWidth) {
|
|
|
65097
65199
|
return text.slice(0, maxWidth);
|
|
65098
65200
|
return `${text.slice(0, maxWidth - 3)}...`;
|
|
65099
65201
|
}
|
|
65100
|
-
var
|
|
65202
|
+
var import_react57, jsx_dev_runtime34, DISPLAY_PAGE_SIZE = 5, TOOLS_DISPLAY_PAGE_SIZE = 8, McpSelector;
|
|
65101
65203
|
var init_McpSelector = __esm(async () => {
|
|
65102
65204
|
init_useTerminalWidth();
|
|
65103
65205
|
init_colors();
|
|
@@ -65105,30 +65207,30 @@ var init_McpSelector = __esm(async () => {
|
|
|
65105
65207
|
init_build2(),
|
|
65106
65208
|
init_client2()
|
|
65107
65209
|
]);
|
|
65108
|
-
|
|
65210
|
+
import_react57 = __toESM(require_react(), 1);
|
|
65109
65211
|
jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1);
|
|
65110
|
-
McpSelector =
|
|
65212
|
+
McpSelector = import_react57.memo(function McpSelector2({
|
|
65111
65213
|
agentId,
|
|
65112
65214
|
onAdd,
|
|
65113
65215
|
onCancel
|
|
65114
65216
|
}) {
|
|
65115
65217
|
const terminalWidth = useTerminalWidth();
|
|
65116
|
-
const [servers, setServers] =
|
|
65117
|
-
const [loading, setLoading] =
|
|
65118
|
-
const [selectedIndex, setSelectedIndex] =
|
|
65119
|
-
const [currentPage, setCurrentPage] =
|
|
65120
|
-
const [mode, setMode] =
|
|
65121
|
-
const [deleteConfirmIndex, setDeleteConfirmIndex] =
|
|
65122
|
-
const [error, setError] =
|
|
65123
|
-
const [viewingServer, setViewingServer] =
|
|
65124
|
-
const [tools, setTools] =
|
|
65125
|
-
const [attachedToolIds, setAttachedToolIds] =
|
|
65126
|
-
const [toolsLoading, setToolsLoading] =
|
|
65127
|
-
const [toolsError, setToolsError] =
|
|
65128
|
-
const [toolsPage, setToolsPage] =
|
|
65129
|
-
const [toolsSelectedIndex, setToolsSelectedIndex] =
|
|
65130
|
-
const [isTogglingTool, setIsTogglingTool] =
|
|
65131
|
-
const loadServers =
|
|
65218
|
+
const [servers, setServers] = import_react57.useState([]);
|
|
65219
|
+
const [loading, setLoading] = import_react57.useState(true);
|
|
65220
|
+
const [selectedIndex, setSelectedIndex] = import_react57.useState(0);
|
|
65221
|
+
const [currentPage, setCurrentPage] = import_react57.useState(0);
|
|
65222
|
+
const [mode, setMode] = import_react57.useState("browsing");
|
|
65223
|
+
const [deleteConfirmIndex, setDeleteConfirmIndex] = import_react57.useState(0);
|
|
65224
|
+
const [error, setError] = import_react57.useState(null);
|
|
65225
|
+
const [viewingServer, setViewingServer] = import_react57.useState(null);
|
|
65226
|
+
const [tools, setTools] = import_react57.useState([]);
|
|
65227
|
+
const [attachedToolIds, setAttachedToolIds] = import_react57.useState(new Set);
|
|
65228
|
+
const [toolsLoading, setToolsLoading] = import_react57.useState(false);
|
|
65229
|
+
const [toolsError, setToolsError] = import_react57.useState(null);
|
|
65230
|
+
const [toolsPage, setToolsPage] = import_react57.useState(0);
|
|
65231
|
+
const [toolsSelectedIndex, setToolsSelectedIndex] = import_react57.useState(0);
|
|
65232
|
+
const [isTogglingTool, setIsTogglingTool] = import_react57.useState(false);
|
|
65233
|
+
const loadServers = import_react57.useCallback(async () => {
|
|
65132
65234
|
setLoading(true);
|
|
65133
65235
|
setError(null);
|
|
65134
65236
|
try {
|
|
@@ -65142,7 +65244,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65142
65244
|
setLoading(false);
|
|
65143
65245
|
}
|
|
65144
65246
|
}, []);
|
|
65145
|
-
const loadTools3 =
|
|
65247
|
+
const loadTools3 = import_react57.useCallback(async (server) => {
|
|
65146
65248
|
if (!server.id) {
|
|
65147
65249
|
setToolsError("Server ID not available");
|
|
65148
65250
|
return;
|
|
@@ -65170,7 +65272,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65170
65272
|
setToolsLoading(false);
|
|
65171
65273
|
}
|
|
65172
65274
|
}, [agentId]);
|
|
65173
|
-
const refreshToolsFromServer =
|
|
65275
|
+
const refreshToolsFromServer = import_react57.useCallback(async () => {
|
|
65174
65276
|
if (!viewingServer?.id)
|
|
65175
65277
|
return;
|
|
65176
65278
|
setToolsLoading(true);
|
|
@@ -65194,7 +65296,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65194
65296
|
setToolsLoading(false);
|
|
65195
65297
|
}
|
|
65196
65298
|
}, [agentId, viewingServer]);
|
|
65197
|
-
const toggleTool =
|
|
65299
|
+
const toggleTool = import_react57.useCallback(async (tool) => {
|
|
65198
65300
|
setIsTogglingTool(true);
|
|
65199
65301
|
try {
|
|
65200
65302
|
const client = await getClient2();
|
|
@@ -65213,7 +65315,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65213
65315
|
setIsTogglingTool(false);
|
|
65214
65316
|
}
|
|
65215
65317
|
}, [agentId, attachedToolIds]);
|
|
65216
|
-
const attachAllTools =
|
|
65318
|
+
const attachAllTools = import_react57.useCallback(async () => {
|
|
65217
65319
|
setIsTogglingTool(true);
|
|
65218
65320
|
try {
|
|
65219
65321
|
const client = await getClient2();
|
|
@@ -65228,7 +65330,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65228
65330
|
setIsTogglingTool(false);
|
|
65229
65331
|
}
|
|
65230
65332
|
}, [agentId, tools, attachedToolIds]);
|
|
65231
|
-
const detachAllTools =
|
|
65333
|
+
const detachAllTools = import_react57.useCallback(async () => {
|
|
65232
65334
|
setIsTogglingTool(true);
|
|
65233
65335
|
try {
|
|
65234
65336
|
const client = await getClient2();
|
|
@@ -65243,7 +65345,7 @@ var init_McpSelector = __esm(async () => {
|
|
|
65243
65345
|
setIsTogglingTool(false);
|
|
65244
65346
|
}
|
|
65245
65347
|
}, [agentId, tools, attachedToolIds]);
|
|
65246
|
-
|
|
65348
|
+
import_react57.useEffect(() => {
|
|
65247
65349
|
loadServers();
|
|
65248
65350
|
}, [loadServers]);
|
|
65249
65351
|
const totalPages = Math.ceil(servers.length / DISPLAY_PAGE_SIZE);
|
|
@@ -65713,10 +65815,10 @@ function MemoryViewer({
|
|
|
65713
65815
|
onClose
|
|
65714
65816
|
}) {
|
|
65715
65817
|
const adeUrl = `https://app.letta.com/agents/${agentId}?view=memory`;
|
|
65716
|
-
const [selectedIndex, setSelectedIndex] =
|
|
65717
|
-
const [currentPage, setCurrentPage] =
|
|
65718
|
-
const [detailBlockIndex, setDetailBlockIndex] =
|
|
65719
|
-
const [scrollOffset, setScrollOffset] =
|
|
65818
|
+
const [selectedIndex, setSelectedIndex] = import_react58.useState(0);
|
|
65819
|
+
const [currentPage, setCurrentPage] = import_react58.useState(0);
|
|
65820
|
+
const [detailBlockIndex, setDetailBlockIndex] = import_react58.useState(null);
|
|
65821
|
+
const [scrollOffset, setScrollOffset] = import_react58.useState(0);
|
|
65720
65822
|
const totalPages = Math.ceil(blocks.length / PAGE_SIZE2);
|
|
65721
65823
|
const startIndex = currentPage * PAGE_SIZE2;
|
|
65722
65824
|
const visibleBlocks = blocks.slice(startIndex, startIndex + PAGE_SIZE2);
|
|
@@ -66007,14 +66109,14 @@ function MemoryViewer({
|
|
|
66007
66109
|
]
|
|
66008
66110
|
}, undefined, true, undefined, this);
|
|
66009
66111
|
}
|
|
66010
|
-
var
|
|
66112
|
+
var import_react58, jsx_dev_runtime35, PAGE_SIZE2 = 3, PREVIEW_LINES = 3, DETAIL_DESCRIPTION_LINES = 3, DETAIL_VALUE_LINES = 12;
|
|
66011
66113
|
var init_MemoryViewer = __esm(async () => {
|
|
66012
66114
|
init_colors();
|
|
66013
66115
|
await __promiseAll([
|
|
66014
66116
|
init_build2(),
|
|
66015
66117
|
init_dist4()
|
|
66016
66118
|
]);
|
|
66017
|
-
|
|
66119
|
+
import_react58 = __toESM(require_react(), 1);
|
|
66018
66120
|
jsx_dev_runtime35 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66019
66121
|
});
|
|
66020
66122
|
|
|
@@ -66091,16 +66193,16 @@ function getMessageText(msg) {
|
|
|
66091
66193
|
}
|
|
66092
66194
|
function MessageSearch({ onClose }) {
|
|
66093
66195
|
const terminalWidth = useTerminalWidth();
|
|
66094
|
-
const [searchInput, setSearchInput] =
|
|
66095
|
-
const [activeQuery, setActiveQuery] =
|
|
66096
|
-
const [searchMode, setSearchMode] =
|
|
66097
|
-
const [results, setResults] =
|
|
66098
|
-
const [loading, setLoading] =
|
|
66099
|
-
const [error, setError] =
|
|
66100
|
-
const [currentPage, setCurrentPage] =
|
|
66101
|
-
const [selectedIndex, setSelectedIndex] =
|
|
66102
|
-
const clientRef =
|
|
66103
|
-
const executeSearch =
|
|
66196
|
+
const [searchInput, setSearchInput] = import_react59.useState("");
|
|
66197
|
+
const [activeQuery, setActiveQuery] = import_react59.useState("");
|
|
66198
|
+
const [searchMode, setSearchMode] = import_react59.useState("hybrid");
|
|
66199
|
+
const [results, setResults] = import_react59.useState([]);
|
|
66200
|
+
const [loading, setLoading] = import_react59.useState(false);
|
|
66201
|
+
const [error, setError] = import_react59.useState(null);
|
|
66202
|
+
const [currentPage, setCurrentPage] = import_react59.useState(0);
|
|
66203
|
+
const [selectedIndex, setSelectedIndex] = import_react59.useState(0);
|
|
66204
|
+
const clientRef = import_react59.useRef(null);
|
|
66205
|
+
const executeSearch = import_react59.useCallback(async (query, mode) => {
|
|
66104
66206
|
if (!query.trim())
|
|
66105
66207
|
return;
|
|
66106
66208
|
setLoading(true);
|
|
@@ -66125,27 +66227,27 @@ function MessageSearch({ onClose }) {
|
|
|
66125
66227
|
setLoading(false);
|
|
66126
66228
|
}
|
|
66127
66229
|
}, []);
|
|
66128
|
-
const submitSearch =
|
|
66230
|
+
const submitSearch = import_react59.useCallback(() => {
|
|
66129
66231
|
if (searchInput.trim() && searchInput !== activeQuery) {
|
|
66130
66232
|
setActiveQuery(searchInput);
|
|
66131
66233
|
executeSearch(searchInput, searchMode);
|
|
66132
66234
|
}
|
|
66133
66235
|
}, [searchInput, activeQuery, searchMode, executeSearch]);
|
|
66134
|
-
const clearSearch =
|
|
66236
|
+
const clearSearch = import_react59.useCallback(() => {
|
|
66135
66237
|
setSearchInput("");
|
|
66136
66238
|
setActiveQuery("");
|
|
66137
66239
|
setResults([]);
|
|
66138
66240
|
setCurrentPage(0);
|
|
66139
66241
|
setSelectedIndex(0);
|
|
66140
66242
|
}, []);
|
|
66141
|
-
const cycleSearchMode =
|
|
66243
|
+
const cycleSearchMode = import_react59.useCallback(() => {
|
|
66142
66244
|
setSearchMode((current) => {
|
|
66143
66245
|
const currentIndex = SEARCH_MODES.indexOf(current);
|
|
66144
66246
|
const nextIndex = (currentIndex + 1) % SEARCH_MODES.length;
|
|
66145
66247
|
return SEARCH_MODES[nextIndex];
|
|
66146
66248
|
});
|
|
66147
66249
|
}, []);
|
|
66148
|
-
|
|
66250
|
+
import_react59.useEffect(() => {
|
|
66149
66251
|
if (activeQuery) {
|
|
66150
66252
|
executeSearch(activeQuery, searchMode);
|
|
66151
66253
|
}
|
|
@@ -66393,7 +66495,7 @@ function MessageSearch({ onClose }) {
|
|
|
66393
66495
|
]
|
|
66394
66496
|
}, undefined, true, undefined, this);
|
|
66395
66497
|
}
|
|
66396
|
-
var
|
|
66498
|
+
var import_react59, jsx_dev_runtime36, DISPLAY_PAGE_SIZE2 = 5, SEARCH_LIMIT = 100, SEARCH_MODES;
|
|
66397
66499
|
var init_MessageSearch = __esm(async () => {
|
|
66398
66500
|
init_useTerminalWidth();
|
|
66399
66501
|
init_colors();
|
|
@@ -66402,7 +66504,7 @@ var init_MessageSearch = __esm(async () => {
|
|
|
66402
66504
|
init_dist4(),
|
|
66403
66505
|
init_client2()
|
|
66404
66506
|
]);
|
|
66405
|
-
|
|
66507
|
+
import_react59 = __toESM(require_react(), 1);
|
|
66406
66508
|
jsx_dev_runtime36 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66407
66509
|
SEARCH_MODES = ["hybrid", "vector", "fts"];
|
|
66408
66510
|
});
|
|
@@ -66414,24 +66516,24 @@ function ModelSelector({
|
|
|
66414
66516
|
onCancel
|
|
66415
66517
|
}) {
|
|
66416
66518
|
const typedModels = models;
|
|
66417
|
-
const [category, setCategory] =
|
|
66418
|
-
const [currentPage, setCurrentPage] =
|
|
66419
|
-
const [selectedIndex, setSelectedIndex] =
|
|
66420
|
-
const [availableHandles, setAvailableHandles] =
|
|
66421
|
-
const [allApiHandles, setAllApiHandles] =
|
|
66422
|
-
const [isLoading, setIsLoading] =
|
|
66423
|
-
const [error, setError] =
|
|
66424
|
-
const [isCached, setIsCached] =
|
|
66425
|
-
const [refreshing, setRefreshing] =
|
|
66426
|
-
const [searchQuery, setSearchQuery] =
|
|
66427
|
-
const mountedRef =
|
|
66428
|
-
|
|
66519
|
+
const [category, setCategory] = import_react60.useState("supported");
|
|
66520
|
+
const [currentPage, setCurrentPage] = import_react60.useState(0);
|
|
66521
|
+
const [selectedIndex, setSelectedIndex] = import_react60.useState(0);
|
|
66522
|
+
const [availableHandles, setAvailableHandles] = import_react60.useState(undefined);
|
|
66523
|
+
const [allApiHandles, setAllApiHandles] = import_react60.useState([]);
|
|
66524
|
+
const [isLoading, setIsLoading] = import_react60.useState(true);
|
|
66525
|
+
const [error, setError] = import_react60.useState(null);
|
|
66526
|
+
const [isCached, setIsCached] = import_react60.useState(false);
|
|
66527
|
+
const [refreshing, setRefreshing] = import_react60.useState(false);
|
|
66528
|
+
const [searchQuery, setSearchQuery] = import_react60.useState("");
|
|
66529
|
+
const mountedRef = import_react60.useRef(true);
|
|
66530
|
+
import_react60.useEffect(() => {
|
|
66429
66531
|
mountedRef.current = true;
|
|
66430
66532
|
return () => {
|
|
66431
66533
|
mountedRef.current = false;
|
|
66432
66534
|
};
|
|
66433
66535
|
}, []);
|
|
66434
|
-
const loadModels =
|
|
66536
|
+
const loadModels = import_react60.useRef(async (forceRefresh = false) => {
|
|
66435
66537
|
try {
|
|
66436
66538
|
if (forceRefresh) {
|
|
66437
66539
|
clearAvailableModelsCache();
|
|
@@ -66459,11 +66561,11 @@ function ModelSelector({
|
|
|
66459
66561
|
setAllApiHandles([]);
|
|
66460
66562
|
}
|
|
66461
66563
|
});
|
|
66462
|
-
|
|
66564
|
+
import_react60.useEffect(() => {
|
|
66463
66565
|
loadModels.current(false);
|
|
66464
66566
|
}, []);
|
|
66465
|
-
const staticModelHandles =
|
|
66466
|
-
const supportedModels =
|
|
66567
|
+
const staticModelHandles = import_react60.useMemo(() => new Set(typedModels.map((m) => m.handle)), [typedModels]);
|
|
66568
|
+
const supportedModels = import_react60.useMemo(() => {
|
|
66467
66569
|
if (availableHandles === undefined)
|
|
66468
66570
|
return [];
|
|
66469
66571
|
const available = availableHandles === null ? typedModels : typedModels.filter((m) => availableHandles.has(m.handle));
|
|
@@ -66471,14 +66573,14 @@ function ModelSelector({
|
|
|
66471
66573
|
const nonFeatured = available.filter((m) => !m.isFeatured);
|
|
66472
66574
|
return [...featured, ...nonFeatured];
|
|
66473
66575
|
}, [typedModels, availableHandles]);
|
|
66474
|
-
const otherModelHandles =
|
|
66576
|
+
const otherModelHandles = import_react60.useMemo(() => {
|
|
66475
66577
|
const filtered = allApiHandles.filter((handle) => !staticModelHandles.has(handle));
|
|
66476
66578
|
if (!searchQuery)
|
|
66477
66579
|
return filtered;
|
|
66478
66580
|
const query = searchQuery.toLowerCase();
|
|
66479
66581
|
return filtered.filter((handle) => handle.toLowerCase().includes(query));
|
|
66480
66582
|
}, [allApiHandles, staticModelHandles, searchQuery]);
|
|
66481
|
-
const currentList =
|
|
66583
|
+
const currentList = import_react60.useMemo(() => {
|
|
66482
66584
|
if (category === "supported") {
|
|
66483
66585
|
return supportedModels;
|
|
66484
66586
|
}
|
|
@@ -66489,12 +66591,12 @@ function ModelSelector({
|
|
|
66489
66591
|
description: ""
|
|
66490
66592
|
}));
|
|
66491
66593
|
}, [category, supportedModels, otherModelHandles]);
|
|
66492
|
-
const totalPages =
|
|
66493
|
-
const visibleModels =
|
|
66594
|
+
const totalPages = import_react60.useMemo(() => Math.max(1, Math.ceil(currentList.length / PAGE_SIZE3)), [currentList.length]);
|
|
66595
|
+
const visibleModels = import_react60.useMemo(() => {
|
|
66494
66596
|
const start = currentPage * PAGE_SIZE3;
|
|
66495
66597
|
return currentList.slice(start, start + PAGE_SIZE3);
|
|
66496
66598
|
}, [currentList, currentPage]);
|
|
66497
|
-
const cycleCategory =
|
|
66599
|
+
const cycleCategory = import_react60.useCallback(() => {
|
|
66498
66600
|
setCategory((current) => {
|
|
66499
66601
|
const idx = MODEL_CATEGORIES.indexOf(current);
|
|
66500
66602
|
return MODEL_CATEGORIES[(idx + 1) % MODEL_CATEGORIES.length];
|
|
@@ -66503,8 +66605,8 @@ function ModelSelector({
|
|
|
66503
66605
|
setSelectedIndex(0);
|
|
66504
66606
|
setSearchQuery("");
|
|
66505
66607
|
}, []);
|
|
66506
|
-
const initializedRef =
|
|
66507
|
-
|
|
66608
|
+
const initializedRef = import_react60.useRef(false);
|
|
66609
|
+
import_react60.useEffect(() => {
|
|
66508
66610
|
if (!initializedRef.current && visibleModels.length > 0) {
|
|
66509
66611
|
const index = visibleModels.findIndex((m) => m.id === currentModelId);
|
|
66510
66612
|
if (index >= 0) {
|
|
@@ -66513,7 +66615,7 @@ function ModelSelector({
|
|
|
66513
66615
|
initializedRef.current = true;
|
|
66514
66616
|
}
|
|
66515
66617
|
}, [visibleModels, currentModelId]);
|
|
66516
|
-
|
|
66618
|
+
import_react60.useEffect(() => {
|
|
66517
66619
|
if (selectedIndex >= visibleModels.length && visibleModels.length > 0) {
|
|
66518
66620
|
setSelectedIndex(visibleModels.length - 1);
|
|
66519
66621
|
}
|
|
@@ -66717,7 +66819,7 @@ function ModelSelector({
|
|
|
66717
66819
|
]
|
|
66718
66820
|
}, undefined, true, undefined, this);
|
|
66719
66821
|
}
|
|
66720
|
-
var
|
|
66822
|
+
var import_react60, jsx_dev_runtime37, PAGE_SIZE3 = 10, MODEL_CATEGORIES;
|
|
66721
66823
|
var init_ModelSelector = __esm(async () => {
|
|
66722
66824
|
init_model();
|
|
66723
66825
|
init_colors();
|
|
@@ -66725,7 +66827,7 @@ var init_ModelSelector = __esm(async () => {
|
|
|
66725
66827
|
init_build2(),
|
|
66726
66828
|
init_available_models()
|
|
66727
66829
|
]);
|
|
66728
|
-
|
|
66830
|
+
import_react60 = __toESM(require_react(), 1);
|
|
66729
66831
|
jsx_dev_runtime37 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66730
66832
|
MODEL_CATEGORIES = ["supported", "all"];
|
|
66731
66833
|
});
|
|
@@ -66755,10 +66857,10 @@ function PinDialog({
|
|
|
66755
66857
|
onCancel
|
|
66756
66858
|
}) {
|
|
66757
66859
|
const isDefault = isDefaultAgentName(currentName);
|
|
66758
|
-
const [mode, setMode] =
|
|
66759
|
-
const [nameInput, setNameInput] =
|
|
66760
|
-
const [selectedOption, setSelectedOption] =
|
|
66761
|
-
const [error, setError] =
|
|
66860
|
+
const [mode, setMode] = import_react61.useState(isDefault ? "input" : "choose");
|
|
66861
|
+
const [nameInput, setNameInput] = import_react61.useState("");
|
|
66862
|
+
const [selectedOption, setSelectedOption] = import_react61.useState(0);
|
|
66863
|
+
const [error, setError] = import_react61.useState("");
|
|
66762
66864
|
const scopeText = local ? "to this project" : "globally";
|
|
66763
66865
|
use_input_default((input, key) => {
|
|
66764
66866
|
if (key.ctrl && input === "c") {
|
|
@@ -66932,7 +67034,7 @@ function PinDialog({
|
|
|
66932
67034
|
]
|
|
66933
67035
|
}, undefined, true, undefined, this);
|
|
66934
67036
|
}
|
|
66935
|
-
var
|
|
67037
|
+
var import_react61, jsx_dev_runtime38;
|
|
66936
67038
|
var init_PinDialog = __esm(async () => {
|
|
66937
67039
|
init_constants();
|
|
66938
67040
|
init_colors();
|
|
@@ -66940,14 +67042,14 @@ var init_PinDialog = __esm(async () => {
|
|
|
66940
67042
|
init_build2(),
|
|
66941
67043
|
init_PasteAwareTextInput()
|
|
66942
67044
|
]);
|
|
66943
|
-
|
|
67045
|
+
import_react61 = __toESM(require_react(), 1);
|
|
66944
67046
|
jsx_dev_runtime38 = __toESM(require_jsx_dev_runtime(), 1);
|
|
66945
67047
|
});
|
|
66946
67048
|
|
|
66947
67049
|
// src/cli/components/NewAgentDialog.tsx
|
|
66948
67050
|
function NewAgentDialog({ onSubmit, onCancel }) {
|
|
66949
|
-
const [nameInput, setNameInput] =
|
|
66950
|
-
const [error, setError] =
|
|
67051
|
+
const [nameInput, setNameInput] = import_react62.useState("");
|
|
67052
|
+
const [error, setError] = import_react62.useState("");
|
|
66951
67053
|
use_input_default((input, key) => {
|
|
66952
67054
|
if (key.ctrl && input === "c") {
|
|
66953
67055
|
onCancel();
|
|
@@ -67034,7 +67136,7 @@ function NewAgentDialog({ onSubmit, onCancel }) {
|
|
|
67034
67136
|
]
|
|
67035
67137
|
}, undefined, true, undefined, this);
|
|
67036
67138
|
}
|
|
67037
|
-
var
|
|
67139
|
+
var import_react62, jsx_dev_runtime39;
|
|
67038
67140
|
var init_NewAgentDialog = __esm(async () => {
|
|
67039
67141
|
init_constants();
|
|
67040
67142
|
init_colors();
|
|
@@ -67043,12 +67145,12 @@ var init_NewAgentDialog = __esm(async () => {
|
|
|
67043
67145
|
init_PasteAwareTextInput(),
|
|
67044
67146
|
init_PinDialog()
|
|
67045
67147
|
]);
|
|
67046
|
-
|
|
67148
|
+
import_react62 = __toESM(require_react(), 1);
|
|
67047
67149
|
jsx_dev_runtime39 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67048
67150
|
});
|
|
67049
67151
|
|
|
67050
67152
|
// src/cli/components/OAuthCodeDialog.tsx
|
|
67051
|
-
var
|
|
67153
|
+
var import_react63, jsx_dev_runtime40, OAuthCodeDialog, WaitForKeyThenClose;
|
|
67052
67154
|
var init_OAuthCodeDialog = __esm(async () => {
|
|
67053
67155
|
init_anthropic_oauth();
|
|
67054
67156
|
init_colors();
|
|
@@ -67058,18 +67160,18 @@ var init_OAuthCodeDialog = __esm(async () => {
|
|
|
67058
67160
|
init_settings_manager(),
|
|
67059
67161
|
init_PasteAwareTextInput()
|
|
67060
67162
|
]);
|
|
67061
|
-
|
|
67163
|
+
import_react63 = __toESM(require_react(), 1);
|
|
67062
67164
|
jsx_dev_runtime40 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67063
|
-
OAuthCodeDialog =
|
|
67064
|
-
const [flowState, setFlowState] =
|
|
67065
|
-
const [authUrl, setAuthUrl] =
|
|
67066
|
-
const [codeInput, setCodeInput] =
|
|
67067
|
-
const [errorMessage, setErrorMessage] =
|
|
67068
|
-
const [codeVerifier, setCodeVerifier] =
|
|
67069
|
-
const [state, setState] =
|
|
67070
|
-
const [availableModels, setAvailableModels] =
|
|
67071
|
-
const [selectedModelIndex, setSelectedModelIndex] =
|
|
67072
|
-
|
|
67165
|
+
OAuthCodeDialog = import_react63.memo(({ onComplete, onCancel, onModelSwitch }) => {
|
|
67166
|
+
const [flowState, setFlowState] = import_react63.useState("initializing");
|
|
67167
|
+
const [authUrl, setAuthUrl] = import_react63.useState("");
|
|
67168
|
+
const [codeInput, setCodeInput] = import_react63.useState("");
|
|
67169
|
+
const [errorMessage, setErrorMessage] = import_react63.useState("");
|
|
67170
|
+
const [codeVerifier, setCodeVerifier] = import_react63.useState("");
|
|
67171
|
+
const [state, setState] = import_react63.useState("");
|
|
67172
|
+
const [availableModels, setAvailableModels] = import_react63.useState([]);
|
|
67173
|
+
const [selectedModelIndex, setSelectedModelIndex] = import_react63.useState(0);
|
|
67174
|
+
import_react63.useEffect(() => {
|
|
67073
67175
|
const initFlow = async () => {
|
|
67074
67176
|
try {
|
|
67075
67177
|
if (settingsManager.hasAnthropicOAuth() && !settingsManager.isAnthropicTokenExpired()) {
|
|
@@ -67398,7 +67500,7 @@ Use /model to switch to a Claude model.`);
|
|
|
67398
67500
|
}, undefined, true, undefined, this);
|
|
67399
67501
|
});
|
|
67400
67502
|
OAuthCodeDialog.displayName = "OAuthCodeDialog";
|
|
67401
|
-
WaitForKeyThenClose =
|
|
67503
|
+
WaitForKeyThenClose = import_react63.memo(({ onClose }) => {
|
|
67402
67504
|
use_input_default(() => {
|
|
67403
67505
|
onClose();
|
|
67404
67506
|
});
|
|
@@ -67408,12 +67510,12 @@ Use /model to switch to a Claude model.`);
|
|
|
67408
67510
|
});
|
|
67409
67511
|
|
|
67410
67512
|
// src/cli/components/PendingApprovalStub.tsx
|
|
67411
|
-
var
|
|
67513
|
+
var import_react64, jsx_dev_runtime41, PendingApprovalStub;
|
|
67412
67514
|
var init_PendingApprovalStub = __esm(async () => {
|
|
67413
67515
|
await init_build2();
|
|
67414
|
-
|
|
67516
|
+
import_react64 = __toESM(require_react(), 1);
|
|
67415
67517
|
jsx_dev_runtime41 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67416
|
-
PendingApprovalStub =
|
|
67518
|
+
PendingApprovalStub = import_react64.memo(({ toolName, description, decision }) => {
|
|
67417
67519
|
if (decision) {
|
|
67418
67520
|
const isApprove = decision.type === "approve";
|
|
67419
67521
|
return /* @__PURE__ */ jsx_dev_runtime41.jsxDEV(Box_default, {
|
|
@@ -67469,7 +67571,7 @@ var init_PendingApprovalStub = __esm(async () => {
|
|
|
67469
67571
|
});
|
|
67470
67572
|
|
|
67471
67573
|
// src/cli/components/ReasoningMessageRich.tsx
|
|
67472
|
-
var
|
|
67574
|
+
var import_react65, jsx_dev_runtime42, normalize5 = (s) => s.replace(/\r\n/g, `
|
|
67473
67575
|
`).replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, `
|
|
67474
67576
|
|
|
67475
67577
|
`).replace(/^\n+|\n+$/g, ""), ReasoningMessage;
|
|
@@ -67479,9 +67581,9 @@ var init_ReasoningMessageRich = __esm(async () => {
|
|
|
67479
67581
|
init_build2(),
|
|
67480
67582
|
init_MarkdownDisplay()
|
|
67481
67583
|
]);
|
|
67482
|
-
|
|
67584
|
+
import_react65 = __toESM(require_react(), 1);
|
|
67483
67585
|
jsx_dev_runtime42 = __toESM(require_jsx_dev_runtime(), 1);
|
|
67484
|
-
ReasoningMessage =
|
|
67586
|
+
ReasoningMessage = import_react65.memo(({ line }) => {
|
|
67485
67587
|
const columns = useTerminalWidth();
|
|
67486
67588
|
const contentWidth = Math.max(0, columns - 2);
|
|
67487
67589
|
const normalizedText = normalize5(line.text);
|
|
@@ -67590,35 +67692,35 @@ function ResumeSelector({
|
|
|
67590
67692
|
onCancel
|
|
67591
67693
|
}) {
|
|
67592
67694
|
const terminalWidth = useTerminalWidth();
|
|
67593
|
-
const clientRef =
|
|
67594
|
-
const [activeTab, setActiveTab] =
|
|
67595
|
-
const [pinnedAgents, setPinnedAgents] =
|
|
67596
|
-
const [pinnedLoading, setPinnedLoading] =
|
|
67597
|
-
const [pinnedSelectedIndex, setPinnedSelectedIndex] =
|
|
67598
|
-
const [pinnedPage, setPinnedPage] =
|
|
67599
|
-
const [lettaCodeAgents, setLettaCodeAgents] =
|
|
67600
|
-
const [lettaCodeCursor, setLettaCodeCursor] =
|
|
67601
|
-
const [lettaCodeLoading, setLettaCodeLoading] =
|
|
67602
|
-
const [lettaCodeLoadingMore, setLettaCodeLoadingMore] =
|
|
67603
|
-
const [lettaCodeHasMore, setLettaCodeHasMore] =
|
|
67604
|
-
const [lettaCodeSelectedIndex, setLettaCodeSelectedIndex] =
|
|
67605
|
-
const [lettaCodePage, setLettaCodePage] =
|
|
67606
|
-
const [lettaCodeError, setLettaCodeError] =
|
|
67607
|
-
const [lettaCodeLoaded, setLettaCodeLoaded] =
|
|
67608
|
-
const [lettaCodeQuery, setLettaCodeQuery] =
|
|
67609
|
-
const [allAgents, setAllAgents] =
|
|
67610
|
-
const [allCursor, setAllCursor] =
|
|
67611
|
-
const [allLoading, setAllLoading] =
|
|
67612
|
-
const [allLoadingMore, setAllLoadingMore] =
|
|
67613
|
-
const [allHasMore, setAllHasMore] =
|
|
67614
|
-
const [allSelectedIndex, setAllSelectedIndex] =
|
|
67615
|
-
const [allPage, setAllPage] =
|
|
67616
|
-
const [allError, setAllError] =
|
|
67617
|
-
const [allLoaded, setAllLoaded] =
|
|
67618
|
-
const [allQuery, setAllQuery] =
|
|
67619
|
-
const [searchInput, setSearchInput] =
|
|
67620
|
-
const [activeQuery, setActiveQuery] =
|
|
67621
|
-
const loadPinnedAgents =
|
|
67695
|
+
const clientRef = import_react66.useRef(null);
|
|
67696
|
+
const [activeTab, setActiveTab] = import_react66.useState("pinned");
|
|
67697
|
+
const [pinnedAgents, setPinnedAgents] = import_react66.useState([]);
|
|
67698
|
+
const [pinnedLoading, setPinnedLoading] = import_react66.useState(true);
|
|
67699
|
+
const [pinnedSelectedIndex, setPinnedSelectedIndex] = import_react66.useState(0);
|
|
67700
|
+
const [pinnedPage, setPinnedPage] = import_react66.useState(0);
|
|
67701
|
+
const [lettaCodeAgents, setLettaCodeAgents] = import_react66.useState([]);
|
|
67702
|
+
const [lettaCodeCursor, setLettaCodeCursor] = import_react66.useState(null);
|
|
67703
|
+
const [lettaCodeLoading, setLettaCodeLoading] = import_react66.useState(false);
|
|
67704
|
+
const [lettaCodeLoadingMore, setLettaCodeLoadingMore] = import_react66.useState(false);
|
|
67705
|
+
const [lettaCodeHasMore, setLettaCodeHasMore] = import_react66.useState(true);
|
|
67706
|
+
const [lettaCodeSelectedIndex, setLettaCodeSelectedIndex] = import_react66.useState(0);
|
|
67707
|
+
const [lettaCodePage, setLettaCodePage] = import_react66.useState(0);
|
|
67708
|
+
const [lettaCodeError, setLettaCodeError] = import_react66.useState(null);
|
|
67709
|
+
const [lettaCodeLoaded, setLettaCodeLoaded] = import_react66.useState(false);
|
|
67710
|
+
const [lettaCodeQuery, setLettaCodeQuery] = import_react66.useState("");
|
|
67711
|
+
const [allAgents, setAllAgents] = import_react66.useState([]);
|
|
67712
|
+
const [allCursor, setAllCursor] = import_react66.useState(null);
|
|
67713
|
+
const [allLoading, setAllLoading] = import_react66.useState(false);
|
|
67714
|
+
const [allLoadingMore, setAllLoadingMore] = import_react66.useState(false);
|
|
67715
|
+
const [allHasMore, setAllHasMore] = import_react66.useState(true);
|
|
67716
|
+
const [allSelectedIndex, setAllSelectedIndex] = import_react66.useState(0);
|
|
67717
|
+
const [allPage, setAllPage] = import_react66.useState(0);
|
|
67718
|
+
const [allError, setAllError] = import_react66.useState(null);
|
|
67719
|
+
const [allLoaded, setAllLoaded] = import_react66.useState(false);
|
|
67720
|
+
const [allQuery, setAllQuery] = import_react66.useState("");
|
|
67721
|
+
const [searchInput, setSearchInput] = import_react66.useState("");
|
|
67722
|
+
const [activeQuery, setActiveQuery] = import_react66.useState("");
|
|
67723
|
+
const loadPinnedAgents = import_react66.useCallback(async () => {
|
|
67622
67724
|
setPinnedLoading(true);
|
|
67623
67725
|
try {
|
|
67624
67726
|
const mergedPinned = settingsManager.getMergedPinnedAgents();
|
|
@@ -67646,7 +67748,7 @@ function ResumeSelector({
|
|
|
67646
67748
|
setPinnedLoading(false);
|
|
67647
67749
|
}
|
|
67648
67750
|
}, []);
|
|
67649
|
-
const fetchListAgents =
|
|
67751
|
+
const fetchListAgents = import_react66.useCallback(async (filterLettaCode, afterCursor, query) => {
|
|
67650
67752
|
const client = clientRef.current || await getClient2();
|
|
67651
67753
|
clientRef.current = client;
|
|
67652
67754
|
const agentList = await client.agents.list({
|
|
@@ -67661,7 +67763,7 @@ function ResumeSelector({
|
|
|
67661
67763
|
const cursor = agentList.items.length === FETCH_PAGE_SIZE ? agentList.items[agentList.items.length - 1]?.id ?? null : null;
|
|
67662
67764
|
return { agents: agentList.items, nextCursor: cursor };
|
|
67663
67765
|
}, []);
|
|
67664
|
-
const loadLettaCodeAgents =
|
|
67766
|
+
const loadLettaCodeAgents = import_react66.useCallback(async (query) => {
|
|
67665
67767
|
setLettaCodeLoading(true);
|
|
67666
67768
|
setLettaCodeError(null);
|
|
67667
67769
|
try {
|
|
@@ -67679,7 +67781,7 @@ function ResumeSelector({
|
|
|
67679
67781
|
setLettaCodeLoading(false);
|
|
67680
67782
|
}
|
|
67681
67783
|
}, [fetchListAgents]);
|
|
67682
|
-
const loadAllAgents =
|
|
67784
|
+
const loadAllAgents = import_react66.useCallback(async (query) => {
|
|
67683
67785
|
setAllLoading(true);
|
|
67684
67786
|
setAllError(null);
|
|
67685
67787
|
try {
|
|
@@ -67697,10 +67799,10 @@ function ResumeSelector({
|
|
|
67697
67799
|
setAllLoading(false);
|
|
67698
67800
|
}
|
|
67699
67801
|
}, [fetchListAgents]);
|
|
67700
|
-
|
|
67802
|
+
import_react66.useEffect(() => {
|
|
67701
67803
|
loadPinnedAgents();
|
|
67702
67804
|
}, [loadPinnedAgents]);
|
|
67703
|
-
|
|
67805
|
+
import_react66.useEffect(() => {
|
|
67704
67806
|
if (activeTab === "letta-code" && !lettaCodeLoaded && !lettaCodeLoading) {
|
|
67705
67807
|
loadLettaCodeAgents();
|
|
67706
67808
|
} else if (activeTab === "all" && !allLoaded && !allLoading) {
|
|
@@ -67715,7 +67817,7 @@ function ResumeSelector({
|
|
|
67715
67817
|
allLoading,
|
|
67716
67818
|
loadAllAgents
|
|
67717
67819
|
]);
|
|
67718
|
-
|
|
67820
|
+
import_react66.useEffect(() => {
|
|
67719
67821
|
if (activeTab === "letta-code" && activeQuery !== lettaCodeQuery) {
|
|
67720
67822
|
loadLettaCodeAgents(activeQuery || undefined);
|
|
67721
67823
|
} else if (activeTab === "all" && activeQuery !== allQuery) {
|
|
@@ -67729,7 +67831,7 @@ function ResumeSelector({
|
|
|
67729
67831
|
loadLettaCodeAgents,
|
|
67730
67832
|
loadAllAgents
|
|
67731
67833
|
]);
|
|
67732
|
-
const fetchMoreLettaCodeAgents =
|
|
67834
|
+
const fetchMoreLettaCodeAgents = import_react66.useCallback(async () => {
|
|
67733
67835
|
if (lettaCodeLoadingMore || !lettaCodeHasMore || !lettaCodeCursor)
|
|
67734
67836
|
return;
|
|
67735
67837
|
setLettaCodeLoadingMore(true);
|
|
@@ -67748,7 +67850,7 @@ function ResumeSelector({
|
|
|
67748
67850
|
fetchListAgents,
|
|
67749
67851
|
activeQuery
|
|
67750
67852
|
]);
|
|
67751
|
-
const fetchMoreAllAgents =
|
|
67853
|
+
const fetchMoreAllAgents = import_react66.useCallback(async () => {
|
|
67752
67854
|
if (allLoadingMore || !allHasMore || !allCursor)
|
|
67753
67855
|
return;
|
|
67754
67856
|
setAllLoadingMore(true);
|
|
@@ -67776,12 +67878,12 @@ function ResumeSelector({
|
|
|
67776
67878
|
const currentError = activeTab === "letta-code" ? lettaCodeError : activeTab === "all" ? allError : null;
|
|
67777
67879
|
const currentAgents = activeTab === "pinned" ? pinnedPageAgents.map((p) => p.agent).filter(Boolean) : activeTab === "letta-code" ? lettaCodePageAgents : allPageAgents;
|
|
67778
67880
|
const setCurrentSelectedIndex = activeTab === "pinned" ? setPinnedSelectedIndex : activeTab === "letta-code" ? setLettaCodeSelectedIndex : setAllSelectedIndex;
|
|
67779
|
-
const submitSearch =
|
|
67881
|
+
const submitSearch = import_react66.useCallback(() => {
|
|
67780
67882
|
if (searchInput !== activeQuery) {
|
|
67781
67883
|
setActiveQuery(searchInput);
|
|
67782
67884
|
}
|
|
67783
67885
|
}, [searchInput, activeQuery]);
|
|
67784
|
-
const clearSearch =
|
|
67886
|
+
const clearSearch = import_react66.useCallback(() => {
|
|
67785
67887
|
setSearchInput("");
|
|
67786
67888
|
if (activeQuery) {
|
|
67787
67889
|
setActiveQuery("");
|
|
@@ -68146,7 +68248,7 @@ function ResumeSelector({
|
|
|
68146
68248
|
]
|
|
68147
68249
|
}, undefined, true, undefined, this);
|
|
68148
68250
|
}
|
|
68149
|
-
var
|
|
68251
|
+
var import_react66, jsx_dev_runtime43, TABS, TAB_DESCRIPTIONS, TAB_EMPTY_STATES, DISPLAY_PAGE_SIZE3 = 5, FETCH_PAGE_SIZE = 20;
|
|
68150
68252
|
var init_ResumeSelector = __esm(async () => {
|
|
68151
68253
|
init_model();
|
|
68152
68254
|
init_useTerminalWidth();
|
|
@@ -68156,7 +68258,7 @@ var init_ResumeSelector = __esm(async () => {
|
|
|
68156
68258
|
init_client2(),
|
|
68157
68259
|
init_settings_manager()
|
|
68158
68260
|
]);
|
|
68159
|
-
|
|
68261
|
+
import_react66 = __toESM(require_react(), 1);
|
|
68160
68262
|
jsx_dev_runtime43 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68161
68263
|
TABS = [
|
|
68162
68264
|
{ id: "pinned", label: "Pinned" },
|
|
@@ -68176,7 +68278,7 @@ var init_ResumeSelector = __esm(async () => {
|
|
|
68176
68278
|
});
|
|
68177
68279
|
|
|
68178
68280
|
// src/cli/components/SessionStats.tsx
|
|
68179
|
-
function
|
|
68281
|
+
function formatDuration2(ms) {
|
|
68180
68282
|
if (ms < 1000) {
|
|
68181
68283
|
return `${Math.round(ms)}ms`;
|
|
68182
68284
|
}
|
|
@@ -68200,8 +68302,8 @@ function formatUsageStats({
|
|
|
68200
68302
|
balance
|
|
68201
68303
|
}) {
|
|
68202
68304
|
const outputLines = [
|
|
68203
|
-
`Total duration (API): ${
|
|
68204
|
-
`Total duration (wall): ${
|
|
68305
|
+
`Total duration (API): ${formatDuration2(stats.totalApiMs)}`,
|
|
68306
|
+
`Total duration (wall): ${formatDuration2(stats.totalWallMs)}`,
|
|
68205
68307
|
`Session usage: ${stats.usage.stepCount} steps, ${formatCompact(stats.usage.promptTokens)} input, ${formatCompact(stats.usage.completionTokens)} output`,
|
|
68206
68308
|
""
|
|
68207
68309
|
];
|
|
@@ -68218,21 +68320,22 @@ function formatUsageStats({
|
|
|
68218
68320
|
var init_SessionStats = () => {};
|
|
68219
68321
|
|
|
68220
68322
|
// src/cli/components/StaticPlanApproval.tsx
|
|
68221
|
-
var
|
|
68323
|
+
var import_react67, jsx_dev_runtime44, StaticPlanApproval;
|
|
68222
68324
|
var init_StaticPlanApproval = __esm(async () => {
|
|
68325
|
+
init_useProgressIndicator();
|
|
68223
68326
|
init_useTerminalWidth();
|
|
68224
68327
|
init_useTextInputCursor();
|
|
68225
68328
|
init_colors();
|
|
68226
68329
|
await init_build2();
|
|
68227
|
-
|
|
68330
|
+
import_react67 = __toESM(require_react(), 1);
|
|
68228
68331
|
jsx_dev_runtime44 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68229
|
-
StaticPlanApproval =
|
|
68332
|
+
StaticPlanApproval = import_react67.memo(({
|
|
68230
68333
|
onApprove,
|
|
68231
68334
|
onApproveAndAcceptEdits,
|
|
68232
68335
|
onKeepPlanning,
|
|
68233
68336
|
isFocused = true
|
|
68234
68337
|
}) => {
|
|
68235
|
-
const [selectedOption, setSelectedOption] =
|
|
68338
|
+
const [selectedOption, setSelectedOption] = import_react67.useState(0);
|
|
68236
68339
|
const {
|
|
68237
68340
|
text: customReason,
|
|
68238
68341
|
cursorPos,
|
|
@@ -68240,6 +68343,7 @@ var init_StaticPlanApproval = __esm(async () => {
|
|
|
68240
68343
|
clear
|
|
68241
68344
|
} = useTextInputCursor();
|
|
68242
68345
|
const columns = useTerminalWidth();
|
|
68346
|
+
useProgressIndicator();
|
|
68243
68347
|
const customOptionIndex = 2;
|
|
68244
68348
|
const maxOptionIndex = customOptionIndex;
|
|
68245
68349
|
const isOnCustomOption = selectedOption === customOptionIndex;
|
|
@@ -68419,14 +68523,14 @@ function renderColoredText(text) {
|
|
|
68419
68523
|
}, i, false, undefined, this);
|
|
68420
68524
|
});
|
|
68421
68525
|
}
|
|
68422
|
-
var
|
|
68526
|
+
var import_react68, jsx_dev_runtime45, StatusMessage;
|
|
68423
68527
|
var init_StatusMessage = __esm(async () => {
|
|
68424
68528
|
init_useTerminalWidth();
|
|
68425
68529
|
init_colors();
|
|
68426
68530
|
await init_build2();
|
|
68427
|
-
|
|
68531
|
+
import_react68 = __toESM(require_react(), 1);
|
|
68428
68532
|
jsx_dev_runtime45 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68429
|
-
StatusMessage =
|
|
68533
|
+
StatusMessage = import_react68.memo(({ line }) => {
|
|
68430
68534
|
const columns = useTerminalWidth();
|
|
68431
68535
|
const contentWidth = Math.max(0, columns - 2);
|
|
68432
68536
|
return /* @__PURE__ */ jsx_dev_runtime45.jsxDEV(Box_default, {
|
|
@@ -68491,7 +68595,7 @@ function formatToolArgs(argsStr) {
|
|
|
68491
68595
|
return "";
|
|
68492
68596
|
}
|
|
68493
68597
|
}
|
|
68494
|
-
var
|
|
68598
|
+
var import_react69, jsx_dev_runtime46, AgentRow, GroupHeader, SubagentGroupDisplay;
|
|
68495
68599
|
var init_SubagentGroupDisplay = __esm(async () => {
|
|
68496
68600
|
init_subagentState();
|
|
68497
68601
|
init_useTerminalWidth();
|
|
@@ -68500,12 +68604,12 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68500
68604
|
init_build2(),
|
|
68501
68605
|
init_BlinkDot()
|
|
68502
68606
|
]);
|
|
68503
|
-
|
|
68607
|
+
import_react69 = __toESM(require_react(), 1);
|
|
68504
68608
|
jsx_dev_runtime46 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68505
|
-
AgentRow =
|
|
68609
|
+
AgentRow = import_react69.memo(({ agent, isLast, expanded }) => {
|
|
68506
68610
|
const { treeChar, continueChar } = getTreeChars(isLast);
|
|
68507
68611
|
const columns = useTerminalWidth();
|
|
68508
|
-
const gutterWidth =
|
|
68612
|
+
const gutterWidth = 7;
|
|
68509
68613
|
const contentWidth = Math.max(0, columns - gutterWidth);
|
|
68510
68614
|
const getDotElement = () => {
|
|
68511
68615
|
switch (agent.status) {
|
|
@@ -68582,33 +68686,17 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68582
68686
|
agent.agentURL && /* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Box_default, {
|
|
68583
68687
|
flexDirection: "row",
|
|
68584
68688
|
children: [
|
|
68585
|
-
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(
|
|
68586
|
-
|
|
68587
|
-
|
|
68588
|
-
children: /* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68589
|
-
children: [
|
|
68590
|
-
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68591
|
-
color: colors.subagent.treeChar,
|
|
68592
|
-
children: continueChar
|
|
68593
|
-
}, undefined, false, undefined, this),
|
|
68594
|
-
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68595
|
-
dimColor: true,
|
|
68596
|
-
children: " ⎿ "
|
|
68597
|
-
}, undefined, false, undefined, this)
|
|
68598
|
-
]
|
|
68599
|
-
}, undefined, true, undefined, this)
|
|
68689
|
+
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68690
|
+
color: colors.subagent.treeChar,
|
|
68691
|
+
children: continueChar
|
|
68600
68692
|
}, undefined, false, undefined, this),
|
|
68601
|
-
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(
|
|
68602
|
-
|
|
68603
|
-
|
|
68604
|
-
|
|
68605
|
-
|
|
68606
|
-
|
|
68607
|
-
|
|
68608
|
-
"Subagent: ",
|
|
68609
|
-
agent.agentURL
|
|
68610
|
-
]
|
|
68611
|
-
}, undefined, true, undefined, this)
|
|
68693
|
+
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68694
|
+
dimColor: true,
|
|
68695
|
+
children: " ⎿ Subagent: "
|
|
68696
|
+
}, undefined, false, undefined, this),
|
|
68697
|
+
/* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68698
|
+
dimColor: true,
|
|
68699
|
+
children: agent.agentURL
|
|
68612
68700
|
}, undefined, false, undefined, this)
|
|
68613
68701
|
]
|
|
68614
68702
|
}, undefined, true, undefined, this),
|
|
@@ -68706,7 +68794,7 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68706
68794
|
}, undefined, true, undefined, this);
|
|
68707
68795
|
});
|
|
68708
68796
|
AgentRow.displayName = "AgentRow";
|
|
68709
|
-
GroupHeader =
|
|
68797
|
+
GroupHeader = import_react69.memo(({ count, allCompleted, hasErrors, expanded }) => {
|
|
68710
68798
|
const statusText = allCompleted ? `Ran ${count} subagent${count !== 1 ? "s" : ""}` : `Running ${count} subagent${count !== 1 ? "s" : ""}…`;
|
|
68711
68799
|
const hint = expanded ? "(ctrl+o to collapse)" : "(ctrl+o to expand)";
|
|
68712
68800
|
const dotColor = hasErrors ? colors.subagent.error : colors.subagent.completed;
|
|
@@ -68715,7 +68803,7 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68715
68803
|
children: [
|
|
68716
68804
|
allCompleted ? /* @__PURE__ */ jsx_dev_runtime46.jsxDEV(Text, {
|
|
68717
68805
|
color: dotColor,
|
|
68718
|
-
children: "
|
|
68806
|
+
children: "●"
|
|
68719
68807
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime46.jsxDEV(BlinkDot, {
|
|
68720
68808
|
color: colors.subagent.header
|
|
68721
68809
|
}, undefined, false, undefined, this),
|
|
@@ -68735,8 +68823,8 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68735
68823
|
}, undefined, true, undefined, this);
|
|
68736
68824
|
});
|
|
68737
68825
|
GroupHeader.displayName = "GroupHeader";
|
|
68738
|
-
SubagentGroupDisplay =
|
|
68739
|
-
const { agents, expanded } =
|
|
68826
|
+
SubagentGroupDisplay = import_react69.memo(() => {
|
|
68827
|
+
const { agents, expanded } = import_react69.useSyncExternalStore(subscribe, getSnapshot);
|
|
68740
68828
|
use_input_default((input, key) => {
|
|
68741
68829
|
if (key.ctrl && input === "o") {
|
|
68742
68830
|
toggleExpanded();
|
|
@@ -68768,17 +68856,17 @@ var init_SubagentGroupDisplay = __esm(async () => {
|
|
|
68768
68856
|
});
|
|
68769
68857
|
|
|
68770
68858
|
// src/cli/components/SubagentGroupStatic.tsx
|
|
68771
|
-
var
|
|
68859
|
+
var import_react70, jsx_dev_runtime47, AgentRow2, SubagentGroupStatic;
|
|
68772
68860
|
var init_SubagentGroupStatic = __esm(async () => {
|
|
68773
68861
|
init_useTerminalWidth();
|
|
68774
68862
|
init_colors();
|
|
68775
68863
|
await init_build2();
|
|
68776
|
-
|
|
68864
|
+
import_react70 = __toESM(require_react(), 1);
|
|
68777
68865
|
jsx_dev_runtime47 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68778
|
-
AgentRow2 =
|
|
68866
|
+
AgentRow2 = import_react70.memo(({ agent, isLast }) => {
|
|
68779
68867
|
const { treeChar, continueChar } = getTreeChars(isLast);
|
|
68780
68868
|
const columns = useTerminalWidth();
|
|
68781
|
-
const gutterWidth =
|
|
68869
|
+
const gutterWidth = 7;
|
|
68782
68870
|
const contentWidth = Math.max(0, columns - gutterWidth);
|
|
68783
68871
|
const dotColor = agent.status === "completed" ? colors.subagent.completed : colors.subagent.error;
|
|
68784
68872
|
const stats = formatStats(agent.toolCount, agent.totalTokens);
|
|
@@ -68831,33 +68919,17 @@ var init_SubagentGroupStatic = __esm(async () => {
|
|
|
68831
68919
|
agent.agentURL && /* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Box_default, {
|
|
68832
68920
|
flexDirection: "row",
|
|
68833
68921
|
children: [
|
|
68834
|
-
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(
|
|
68835
|
-
|
|
68836
|
-
|
|
68837
|
-
children: /* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68838
|
-
children: [
|
|
68839
|
-
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68840
|
-
color: colors.subagent.treeChar,
|
|
68841
|
-
children: continueChar
|
|
68842
|
-
}, undefined, false, undefined, this),
|
|
68843
|
-
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68844
|
-
dimColor: true,
|
|
68845
|
-
children: " ⎿ "
|
|
68846
|
-
}, undefined, false, undefined, this)
|
|
68847
|
-
]
|
|
68848
|
-
}, undefined, true, undefined, this)
|
|
68922
|
+
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68923
|
+
color: colors.subagent.treeChar,
|
|
68924
|
+
children: continueChar
|
|
68849
68925
|
}, undefined, false, undefined, this),
|
|
68850
|
-
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(
|
|
68851
|
-
|
|
68852
|
-
|
|
68853
|
-
|
|
68854
|
-
|
|
68855
|
-
|
|
68856
|
-
|
|
68857
|
-
"Subagent: ",
|
|
68858
|
-
agent.agentURL
|
|
68859
|
-
]
|
|
68860
|
-
}, undefined, true, undefined, this)
|
|
68926
|
+
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68927
|
+
dimColor: true,
|
|
68928
|
+
children: " ⎿ Subagent: "
|
|
68929
|
+
}, undefined, false, undefined, this),
|
|
68930
|
+
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68931
|
+
dimColor: true,
|
|
68932
|
+
children: agent.agentURL
|
|
68861
68933
|
}, undefined, false, undefined, this)
|
|
68862
68934
|
]
|
|
68863
68935
|
}, undefined, true, undefined, this),
|
|
@@ -68908,7 +68980,7 @@ var init_SubagentGroupStatic = __esm(async () => {
|
|
|
68908
68980
|
}, undefined, true, undefined, this);
|
|
68909
68981
|
});
|
|
68910
68982
|
AgentRow2.displayName = "AgentRow";
|
|
68911
|
-
SubagentGroupStatic =
|
|
68983
|
+
SubagentGroupStatic = import_react70.memo(({ agents }) => {
|
|
68912
68984
|
if (agents.length === 0) {
|
|
68913
68985
|
return null;
|
|
68914
68986
|
}
|
|
@@ -68923,7 +68995,7 @@ var init_SubagentGroupStatic = __esm(async () => {
|
|
|
68923
68995
|
children: [
|
|
68924
68996
|
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68925
68997
|
color: dotColor,
|
|
68926
|
-
children: "
|
|
68998
|
+
children: "●"
|
|
68927
68999
|
}, undefined, false, undefined, this),
|
|
68928
69000
|
/* @__PURE__ */ jsx_dev_runtime47.jsxDEV(Text, {
|
|
68929
69001
|
color: colors.subagent.header,
|
|
@@ -68946,11 +69018,11 @@ var init_SubagentGroupStatic = __esm(async () => {
|
|
|
68946
69018
|
|
|
68947
69019
|
// src/cli/components/SubagentManager.tsx
|
|
68948
69020
|
function SubagentManager({ onClose }) {
|
|
68949
|
-
const [builtinSubagents, setBuiltinSubagents] =
|
|
68950
|
-
const [customSubagents, setCustomSubagents] =
|
|
68951
|
-
const [loading, setLoading] =
|
|
68952
|
-
const [error, setError] =
|
|
68953
|
-
|
|
69021
|
+
const [builtinSubagents, setBuiltinSubagents] = import_react71.useState([]);
|
|
69022
|
+
const [customSubagents, setCustomSubagents] = import_react71.useState([]);
|
|
69023
|
+
const [loading, setLoading] = import_react71.useState(true);
|
|
69024
|
+
const [error, setError] = import_react71.useState(null);
|
|
69025
|
+
import_react71.useEffect(() => {
|
|
68954
69026
|
async function loadSubagents() {
|
|
68955
69027
|
setLoading(true);
|
|
68956
69028
|
setError(null);
|
|
@@ -69091,12 +69163,12 @@ function SubagentManager({ onClose }) {
|
|
|
69091
69163
|
]
|
|
69092
69164
|
}, undefined, true, undefined, this);
|
|
69093
69165
|
}
|
|
69094
|
-
var
|
|
69166
|
+
var import_react71, jsx_dev_runtime48;
|
|
69095
69167
|
var init_SubagentManager = __esm(async () => {
|
|
69096
69168
|
init_subagents();
|
|
69097
69169
|
init_colors();
|
|
69098
69170
|
await init_build2();
|
|
69099
|
-
|
|
69171
|
+
import_react71 = __toESM(require_react(), 1);
|
|
69100
69172
|
jsx_dev_runtime48 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69101
69173
|
});
|
|
69102
69174
|
|
|
@@ -69106,10 +69178,10 @@ function SystemPromptSelector({
|
|
|
69106
69178
|
onSelect,
|
|
69107
69179
|
onCancel
|
|
69108
69180
|
}) {
|
|
69109
|
-
const [showAll, setShowAll] =
|
|
69110
|
-
const [selectedIndex, setSelectedIndex] =
|
|
69111
|
-
const featuredPrompts =
|
|
69112
|
-
const visiblePrompts =
|
|
69181
|
+
const [showAll, setShowAll] = import_react72.useState(false);
|
|
69182
|
+
const [selectedIndex, setSelectedIndex] = import_react72.useState(0);
|
|
69183
|
+
const featuredPrompts = import_react72.useMemo(() => SYSTEM_PROMPTS.filter((prompt) => prompt.isFeatured), []);
|
|
69184
|
+
const visiblePrompts = import_react72.useMemo(() => {
|
|
69113
69185
|
if (showAll)
|
|
69114
69186
|
return SYSTEM_PROMPTS;
|
|
69115
69187
|
if (featuredPrompts.length > 0)
|
|
@@ -69212,12 +69284,12 @@ function SystemPromptSelector({
|
|
|
69212
69284
|
]
|
|
69213
69285
|
}, undefined, true, undefined, this);
|
|
69214
69286
|
}
|
|
69215
|
-
var
|
|
69287
|
+
var import_react72, jsx_dev_runtime49;
|
|
69216
69288
|
var init_SystemPromptSelector = __esm(async () => {
|
|
69217
69289
|
init_promptAssets();
|
|
69218
69290
|
init_colors();
|
|
69219
69291
|
await init_build2();
|
|
69220
|
-
|
|
69292
|
+
import_react72 = __toESM(require_react(), 1);
|
|
69221
69293
|
jsx_dev_runtime49 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69222
69294
|
});
|
|
69223
69295
|
|
|
@@ -70107,7 +70179,7 @@ var init_TodoRenderer = __esm(async () => {
|
|
|
70107
70179
|
function isQuestionTool(name) {
|
|
70108
70180
|
return name === "AskUserQuestion";
|
|
70109
70181
|
}
|
|
70110
|
-
var
|
|
70182
|
+
var import_react73, jsx_dev_runtime53, ToolCallMessage;
|
|
70111
70183
|
var init_ToolCallMessageRich = __esm(async () => {
|
|
70112
70184
|
init_constants();
|
|
70113
70185
|
init_formatArgsDisplay();
|
|
@@ -70124,9 +70196,9 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
70124
70196
|
init_PlanRenderer(),
|
|
70125
70197
|
init_TodoRenderer()
|
|
70126
70198
|
]);
|
|
70127
|
-
|
|
70199
|
+
import_react73 = __toESM(require_react(), 1);
|
|
70128
70200
|
jsx_dev_runtime53 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70129
|
-
ToolCallMessage =
|
|
70201
|
+
ToolCallMessage = import_react73.memo(({
|
|
70130
70202
|
line,
|
|
70131
70203
|
precomputedDiffs,
|
|
70132
70204
|
lastPlanFilePath
|
|
@@ -70630,10 +70702,10 @@ function ToolsetSelector({
|
|
|
70630
70702
|
onSelect,
|
|
70631
70703
|
onCancel
|
|
70632
70704
|
}) {
|
|
70633
|
-
const [showAll, setShowAll] =
|
|
70634
|
-
const [selectedIndex, setSelectedIndex] =
|
|
70635
|
-
const featuredToolsets =
|
|
70636
|
-
const visibleToolsets =
|
|
70705
|
+
const [showAll, setShowAll] = import_react74.useState(false);
|
|
70706
|
+
const [selectedIndex, setSelectedIndex] = import_react74.useState(0);
|
|
70707
|
+
const featuredToolsets = import_react74.useMemo(() => toolsets.filter((toolset) => toolset.isFeatured), []);
|
|
70708
|
+
const visibleToolsets = import_react74.useMemo(() => {
|
|
70637
70709
|
if (showAll)
|
|
70638
70710
|
return toolsets;
|
|
70639
70711
|
if (featuredToolsets.length > 0)
|
|
@@ -70745,11 +70817,11 @@ function ToolsetSelector({
|
|
|
70745
70817
|
]
|
|
70746
70818
|
}, undefined, true, undefined, this);
|
|
70747
70819
|
}
|
|
70748
|
-
var
|
|
70820
|
+
var import_react74, jsx_dev_runtime54, toolsets;
|
|
70749
70821
|
var init_ToolsetSelector = __esm(async () => {
|
|
70750
70822
|
init_colors();
|
|
70751
70823
|
await init_build2();
|
|
70752
|
-
|
|
70824
|
+
import_react74 = __toESM(require_react(), 1);
|
|
70753
70825
|
jsx_dev_runtime54 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70754
70826
|
toolsets = [
|
|
70755
70827
|
{
|
|
@@ -70843,16 +70915,16 @@ var init_ToolsetSelector = __esm(async () => {
|
|
|
70843
70915
|
});
|
|
70844
70916
|
|
|
70845
70917
|
// src/cli/components/UserMessageRich.tsx
|
|
70846
|
-
var
|
|
70918
|
+
var import_react75, jsx_dev_runtime55, UserMessage;
|
|
70847
70919
|
var init_UserMessageRich = __esm(async () => {
|
|
70848
70920
|
init_useTerminalWidth();
|
|
70849
70921
|
await __promiseAll([
|
|
70850
70922
|
init_build2(),
|
|
70851
70923
|
init_MarkdownDisplay()
|
|
70852
70924
|
]);
|
|
70853
|
-
|
|
70925
|
+
import_react75 = __toESM(require_react(), 1);
|
|
70854
70926
|
jsx_dev_runtime55 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70855
|
-
UserMessage =
|
|
70927
|
+
UserMessage = import_react75.memo(({ line }) => {
|
|
70856
70928
|
const columns = useTerminalWidth();
|
|
70857
70929
|
const contentWidth = Math.max(0, columns - 2);
|
|
70858
70930
|
return /* @__PURE__ */ jsx_dev_runtime55.jsxDEV(Box_default, {
|
|
@@ -71245,8 +71317,8 @@ var init_thinkingMessages = __esm(() => {
|
|
|
71245
71317
|
// src/cli/hooks/useSuspend/useSuspend.ts
|
|
71246
71318
|
function useSuspend() {
|
|
71247
71319
|
const { stdin: stdin2, isRawModeSupported } = use_stdin_default();
|
|
71248
|
-
const [resumeKey, setResumeKey] =
|
|
71249
|
-
const forceUpdate =
|
|
71320
|
+
const [resumeKey, setResumeKey] = import_react76.useState(0);
|
|
71321
|
+
const forceUpdate = import_react76.useCallback(() => {
|
|
71250
71322
|
setResumeKey((prev) => prev + 1);
|
|
71251
71323
|
}, []);
|
|
71252
71324
|
use_input_default((input, key) => {
|
|
@@ -71258,7 +71330,7 @@ function useSuspend() {
|
|
|
71258
71330
|
return;
|
|
71259
71331
|
}
|
|
71260
71332
|
});
|
|
71261
|
-
|
|
71333
|
+
import_react76.useEffect(() => {
|
|
71262
71334
|
const handleResume = () => {
|
|
71263
71335
|
if (stdin2 && isRawModeSupported && stdin2.setRawMode) {
|
|
71264
71336
|
stdin2.setRawMode(true);
|
|
@@ -71273,25 +71345,25 @@ function useSuspend() {
|
|
|
71273
71345
|
}, [stdin2, isRawModeSupported, forceUpdate]);
|
|
71274
71346
|
return resumeKey;
|
|
71275
71347
|
}
|
|
71276
|
-
var
|
|
71348
|
+
var import_react76;
|
|
71277
71349
|
var init_useSuspend = __esm(async () => {
|
|
71278
71350
|
await init_build2();
|
|
71279
|
-
|
|
71351
|
+
import_react76 = __toESM(require_react(), 1);
|
|
71280
71352
|
});
|
|
71281
71353
|
|
|
71282
71354
|
// src/cli/hooks/useSyncedState.ts
|
|
71283
71355
|
function useSyncedState(initialValue) {
|
|
71284
|
-
const [state, setState] =
|
|
71285
|
-
const ref =
|
|
71286
|
-
const setSyncedState =
|
|
71356
|
+
const [state, setState] = import_react77.useState(initialValue);
|
|
71357
|
+
const ref = import_react77.useRef(initialValue);
|
|
71358
|
+
const setSyncedState = import_react77.useCallback((value) => {
|
|
71287
71359
|
ref.current = value;
|
|
71288
71360
|
setState(value);
|
|
71289
71361
|
}, []);
|
|
71290
71362
|
return [state, setSyncedState, ref];
|
|
71291
71363
|
}
|
|
71292
|
-
var
|
|
71364
|
+
var import_react77;
|
|
71293
71365
|
var init_useSyncedState = __esm(() => {
|
|
71294
|
-
|
|
71366
|
+
import_react77 = __toESM(require_react(), 1);
|
|
71295
71367
|
});
|
|
71296
71368
|
|
|
71297
71369
|
// src/cli/commands/connect.ts
|
|
@@ -71866,54 +71938,58 @@ function App2({
|
|
|
71866
71938
|
tokenStreaming = false,
|
|
71867
71939
|
agentProvenance = null
|
|
71868
71940
|
}) {
|
|
71869
|
-
|
|
71941
|
+
import_react78.useEffect(() => {
|
|
71870
71942
|
prefetchAvailableModelHandles();
|
|
71871
71943
|
}, []);
|
|
71872
|
-
const [agentId, setAgentId] =
|
|
71873
|
-
const [agentState, setAgentState] =
|
|
71874
|
-
const agentIdRef =
|
|
71875
|
-
|
|
71944
|
+
const [agentId, setAgentId] = import_react78.useState(initialAgentId);
|
|
71945
|
+
const [agentState, setAgentState] = import_react78.useState(initialAgentState);
|
|
71946
|
+
const agentIdRef = import_react78.useRef(agentId);
|
|
71947
|
+
import_react78.useEffect(() => {
|
|
71876
71948
|
agentIdRef.current = agentId;
|
|
71877
71949
|
telemetry2.setCurrentAgentId(agentId);
|
|
71878
71950
|
}, [agentId]);
|
|
71879
71951
|
const resumeKey = useSuspend();
|
|
71880
|
-
const prevInitialAgentIdRef =
|
|
71881
|
-
const prevInitialAgentStateRef =
|
|
71882
|
-
|
|
71952
|
+
const prevInitialAgentIdRef = import_react78.useRef(initialAgentId);
|
|
71953
|
+
const prevInitialAgentStateRef = import_react78.useRef(initialAgentState);
|
|
71954
|
+
import_react78.useEffect(() => {
|
|
71883
71955
|
if (initialAgentId !== prevInitialAgentIdRef.current) {
|
|
71884
71956
|
prevInitialAgentIdRef.current = initialAgentId;
|
|
71885
71957
|
agentIdRef.current = initialAgentId;
|
|
71886
71958
|
setAgentId(initialAgentId);
|
|
71887
71959
|
}
|
|
71888
71960
|
}, [initialAgentId]);
|
|
71889
|
-
|
|
71961
|
+
import_react78.useEffect(() => {
|
|
71890
71962
|
if (initialAgentState !== prevInitialAgentStateRef.current) {
|
|
71891
71963
|
prevInitialAgentStateRef.current = initialAgentState;
|
|
71892
71964
|
setAgentState(initialAgentState);
|
|
71893
71965
|
}
|
|
71894
71966
|
}, [initialAgentState]);
|
|
71895
|
-
|
|
71967
|
+
import_react78.useEffect(() => {
|
|
71896
71968
|
if (agentId) {
|
|
71897
71969
|
setCurrentAgentId(agentId);
|
|
71898
71970
|
}
|
|
71899
71971
|
}, [agentId]);
|
|
71972
|
+
import_react78.useEffect(() => {
|
|
71973
|
+
const title = agentState?.name ? `${agentState.name} | Letta Code` : "Letta Code";
|
|
71974
|
+
process.stdout.write(`\x1B]0;${title}\x07`);
|
|
71975
|
+
}, [agentState?.name]);
|
|
71900
71976
|
const [streaming, setStreaming, streamingRef] = useSyncedState(false);
|
|
71901
|
-
const processingConversationRef =
|
|
71902
|
-
const conversationGenerationRef =
|
|
71903
|
-
const [interruptRequested, setInterruptRequested] =
|
|
71977
|
+
const processingConversationRef = import_react78.useRef(0);
|
|
71978
|
+
const conversationGenerationRef = import_react78.useRef(0);
|
|
71979
|
+
const [interruptRequested, setInterruptRequested] = import_react78.useState(false);
|
|
71904
71980
|
const [commandRunning, setCommandRunning, commandRunningRef] = useSyncedState(false);
|
|
71905
|
-
const [profileConfirmPending, setProfileConfirmPending] =
|
|
71906
|
-
const [pendingApprovals, setPendingApprovals] =
|
|
71907
|
-
const [approvalContexts, setApprovalContexts] =
|
|
71908
|
-
const [approvalResults, setApprovalResults] =
|
|
71909
|
-
const [isExecutingTool, setIsExecutingTool] =
|
|
71910
|
-
const [queuedApprovalResults, setQueuedApprovalResults] =
|
|
71911
|
-
const toolAbortControllerRef =
|
|
71912
|
-
const [autoHandledResults, setAutoHandledResults] =
|
|
71913
|
-
const [autoDeniedApprovals, setAutoDeniedApprovals] =
|
|
71914
|
-
const bashCommandCacheRef =
|
|
71915
|
-
const [pendingRalphConfig, setPendingRalphConfig] =
|
|
71916
|
-
const [uiRalphActive, setUiRalphActive] =
|
|
71981
|
+
const [profileConfirmPending, setProfileConfirmPending] = import_react78.useState(null);
|
|
71982
|
+
const [pendingApprovals, setPendingApprovals] = import_react78.useState([]);
|
|
71983
|
+
const [approvalContexts, setApprovalContexts] = import_react78.useState([]);
|
|
71984
|
+
const [approvalResults, setApprovalResults] = import_react78.useState([]);
|
|
71985
|
+
const [isExecutingTool, setIsExecutingTool] = import_react78.useState(false);
|
|
71986
|
+
const [queuedApprovalResults, setQueuedApprovalResults] = import_react78.useState(null);
|
|
71987
|
+
const toolAbortControllerRef = import_react78.useRef(null);
|
|
71988
|
+
const [autoHandledResults, setAutoHandledResults] = import_react78.useState([]);
|
|
71989
|
+
const [autoDeniedApprovals, setAutoDeniedApprovals] = import_react78.useState([]);
|
|
71990
|
+
const bashCommandCacheRef = import_react78.useRef([]);
|
|
71991
|
+
const [pendingRalphConfig, setPendingRalphConfig] = import_react78.useState(null);
|
|
71992
|
+
const [uiRalphActive, setUiRalphActive] = import_react78.useState(ralphMode.getState().isActive);
|
|
71917
71993
|
const currentApproval = pendingApprovals[approvalResults.length];
|
|
71918
71994
|
const currentApprovalContext = approvalContexts[approvalResults.length];
|
|
71919
71995
|
const activeApprovalId = currentApproval?.toolCallId ?? null;
|
|
@@ -71923,7 +71999,7 @@ function App2({
|
|
|
71923
71999
|
approvalMap,
|
|
71924
72000
|
stubDescriptions,
|
|
71925
72001
|
queuedDecisions
|
|
71926
|
-
} =
|
|
72002
|
+
} = import_react78.useMemo(() => {
|
|
71927
72003
|
const pending = new Set;
|
|
71928
72004
|
const queued = new Set;
|
|
71929
72005
|
const map = new Map;
|
|
@@ -71980,59 +72056,59 @@ function App2({
|
|
|
71980
72056
|
queuedDecisions: decisions
|
|
71981
72057
|
};
|
|
71982
72058
|
}, [pendingApprovals, approvalResults, activeApprovalId]);
|
|
71983
|
-
const [activeOverlay, setActiveOverlay] =
|
|
71984
|
-
const [feedbackPrefill, setFeedbackPrefill] =
|
|
71985
|
-
const closeOverlay =
|
|
72059
|
+
const [activeOverlay, setActiveOverlay] = import_react78.useState(null);
|
|
72060
|
+
const [feedbackPrefill, setFeedbackPrefill] = import_react78.useState("");
|
|
72061
|
+
const closeOverlay = import_react78.useCallback(() => {
|
|
71986
72062
|
setActiveOverlay(null);
|
|
71987
72063
|
setFeedbackPrefill("");
|
|
71988
72064
|
}, []);
|
|
71989
|
-
const [pinDialogLocal, setPinDialogLocal] =
|
|
72065
|
+
const [pinDialogLocal, setPinDialogLocal] = import_react78.useState(false);
|
|
71990
72066
|
const anySelectorOpen = activeOverlay !== null;
|
|
71991
|
-
const [currentSystemPromptId, setCurrentSystemPromptId] =
|
|
71992
|
-
const [currentToolset, setCurrentToolset] =
|
|
71993
|
-
const [llmConfig, setLlmConfig] =
|
|
71994
|
-
const llmConfigRef =
|
|
71995
|
-
|
|
72067
|
+
const [currentSystemPromptId, setCurrentSystemPromptId] = import_react78.useState("default");
|
|
72068
|
+
const [currentToolset, setCurrentToolset] = import_react78.useState(null);
|
|
72069
|
+
const [llmConfig, setLlmConfig] = import_react78.useState(null);
|
|
72070
|
+
const llmConfigRef = import_react78.useRef(llmConfig);
|
|
72071
|
+
import_react78.useEffect(() => {
|
|
71996
72072
|
llmConfigRef.current = llmConfig;
|
|
71997
72073
|
}, [llmConfig]);
|
|
71998
|
-
const [currentModelId, setCurrentModelId] =
|
|
71999
|
-
const [agentName, setAgentName] =
|
|
72000
|
-
const [agentDescription, setAgentDescription] =
|
|
72001
|
-
const [agentLastRunAt, setAgentLastRunAt] =
|
|
72074
|
+
const [currentModelId, setCurrentModelId] = import_react78.useState(null);
|
|
72075
|
+
const [agentName, setAgentName] = import_react78.useState(null);
|
|
72076
|
+
const [agentDescription, setAgentDescription] = import_react78.useState(null);
|
|
72077
|
+
const [agentLastRunAt, setAgentLastRunAt] = import_react78.useState(null);
|
|
72002
72078
|
const currentModelLabel = llmConfig?.model_endpoint_type && llmConfig?.model ? `${llmConfig.model_endpoint_type}/${llmConfig.model}` : llmConfig?.model ?? null;
|
|
72003
72079
|
const currentModelDisplay = currentModelLabel ? getModelDisplayName(currentModelLabel) ?? currentModelLabel.split("/").pop() : null;
|
|
72004
72080
|
const currentModelProvider = llmConfig?.provider_name ?? null;
|
|
72005
|
-
const [tokenStreamingEnabled, setTokenStreamingEnabled] =
|
|
72006
|
-
const [tokenCount, setTokenCount] =
|
|
72007
|
-
const [thinkingMessage, setThinkingMessage] =
|
|
72008
|
-
const sessionStatsRef =
|
|
72009
|
-
|
|
72081
|
+
const [tokenStreamingEnabled, setTokenStreamingEnabled] = import_react78.useState(tokenStreaming);
|
|
72082
|
+
const [tokenCount, setTokenCount] = import_react78.useState(0);
|
|
72083
|
+
const [thinkingMessage, setThinkingMessage] = import_react78.useState(getRandomThinkingVerb());
|
|
72084
|
+
const sessionStatsRef = import_react78.useRef(new SessionStats);
|
|
72085
|
+
import_react78.useEffect(() => {
|
|
72010
72086
|
telemetry2.setSessionStatsGetter(() => sessionStatsRef.current.getSnapshot());
|
|
72011
72087
|
return () => {
|
|
72012
72088
|
telemetry2.setSessionStatsGetter(undefined);
|
|
72013
72089
|
};
|
|
72014
72090
|
}, []);
|
|
72015
|
-
const [showExitStats, setShowExitStats] =
|
|
72016
|
-
const hasSentSessionContextRef =
|
|
72017
|
-
const turnCountRef =
|
|
72018
|
-
const [staticItems, setStaticItems] =
|
|
72019
|
-
const emittedIdsRef =
|
|
72020
|
-
const welcomeCommittedRef =
|
|
72021
|
-
const abortControllerRef =
|
|
72022
|
-
const userCancelledRef =
|
|
72023
|
-
const llmApiErrorRetriesRef =
|
|
72024
|
-
const [messageQueue, setMessageQueue] =
|
|
72025
|
-
const waitingForQueueCancelRef =
|
|
72026
|
-
const queueSnapshotRef =
|
|
72027
|
-
const [restoreQueueOnCancel, setRestoreQueueOnCancel] =
|
|
72028
|
-
const restoreQueueOnCancelRef =
|
|
72029
|
-
|
|
72091
|
+
const [showExitStats, setShowExitStats] = import_react78.useState(false);
|
|
72092
|
+
const hasSentSessionContextRef = import_react78.useRef(false);
|
|
72093
|
+
const turnCountRef = import_react78.useRef(0);
|
|
72094
|
+
const [staticItems, setStaticItems] = import_react78.useState([]);
|
|
72095
|
+
const emittedIdsRef = import_react78.useRef(new Set);
|
|
72096
|
+
const welcomeCommittedRef = import_react78.useRef(false);
|
|
72097
|
+
const abortControllerRef = import_react78.useRef(null);
|
|
72098
|
+
const userCancelledRef = import_react78.useRef(false);
|
|
72099
|
+
const llmApiErrorRetriesRef = import_react78.useRef(0);
|
|
72100
|
+
const [messageQueue, setMessageQueue] = import_react78.useState([]);
|
|
72101
|
+
const waitingForQueueCancelRef = import_react78.useRef(false);
|
|
72102
|
+
const queueSnapshotRef = import_react78.useRef([]);
|
|
72103
|
+
const [restoreQueueOnCancel, setRestoreQueueOnCancel] = import_react78.useState(false);
|
|
72104
|
+
const restoreQueueOnCancelRef = import_react78.useRef(restoreQueueOnCancel);
|
|
72105
|
+
import_react78.useEffect(() => {
|
|
72030
72106
|
restoreQueueOnCancelRef.current = restoreQueueOnCancel;
|
|
72031
72107
|
}, [restoreQueueOnCancel]);
|
|
72032
|
-
const isAgentBusy =
|
|
72108
|
+
const isAgentBusy = import_react78.useCallback(() => {
|
|
72033
72109
|
return streamingRef.current || isExecutingTool || commandRunningRef.current || abortControllerRef.current !== null;
|
|
72034
72110
|
}, [isExecutingTool]);
|
|
72035
|
-
const withCommandLock =
|
|
72111
|
+
const withCommandLock = import_react78.useCallback(async (asyncFn) => {
|
|
72036
72112
|
setActiveOverlay(null);
|
|
72037
72113
|
setCommandRunning(true);
|
|
72038
72114
|
try {
|
|
@@ -72042,9 +72118,9 @@ function App2({
|
|
|
72042
72118
|
}
|
|
72043
72119
|
}, [setCommandRunning]);
|
|
72044
72120
|
const columns = useTerminalWidth();
|
|
72045
|
-
const prevColumnsRef =
|
|
72046
|
-
const [staticRenderEpoch, setStaticRenderEpoch] =
|
|
72047
|
-
|
|
72121
|
+
const prevColumnsRef = import_react78.useRef(columns);
|
|
72122
|
+
const [staticRenderEpoch, setStaticRenderEpoch] = import_react78.useState(0);
|
|
72123
|
+
import_react78.useEffect(() => {
|
|
72048
72124
|
const prev = prevColumnsRef.current;
|
|
72049
72125
|
if (columns === prev)
|
|
72050
72126
|
return;
|
|
@@ -72054,7 +72130,7 @@ function App2({
|
|
|
72054
72130
|
setStaticRenderEpoch((epoch) => epoch + 1);
|
|
72055
72131
|
prevColumnsRef.current = columns;
|
|
72056
72132
|
}, [columns]);
|
|
72057
|
-
const commitEligibleLines =
|
|
72133
|
+
const commitEligibleLines = import_react78.useCallback((b) => {
|
|
72058
72134
|
const newlyCommitted = [];
|
|
72059
72135
|
let firstTaskIndex = -1;
|
|
72060
72136
|
const hasInProgress = hasInProgressTaskToolCalls(b.order, b.byId, emittedIdsRef.current);
|
|
@@ -72108,20 +72184,20 @@ function App2({
|
|
|
72108
72184
|
setStaticItems((prev) => [...prev, ...newlyCommitted]);
|
|
72109
72185
|
}
|
|
72110
72186
|
}, []);
|
|
72111
|
-
const [lines, setLines] =
|
|
72112
|
-
const buffersRef =
|
|
72113
|
-
const hasBackfilledRef =
|
|
72114
|
-
const precomputedDiffsRef =
|
|
72115
|
-
const lastPlanFilePathRef =
|
|
72116
|
-
const eagerCommittedPreviewsRef =
|
|
72117
|
-
const refreshDerived =
|
|
72187
|
+
const [lines, setLines] = import_react78.useState([]);
|
|
72188
|
+
const buffersRef = import_react78.useRef(createBuffers());
|
|
72189
|
+
const hasBackfilledRef = import_react78.useRef(false);
|
|
72190
|
+
const precomputedDiffsRef = import_react78.useRef(new Map);
|
|
72191
|
+
const lastPlanFilePathRef = import_react78.useRef(null);
|
|
72192
|
+
const eagerCommittedPreviewsRef = import_react78.useRef(new Set);
|
|
72193
|
+
const refreshDerived = import_react78.useCallback(() => {
|
|
72118
72194
|
const b = buffersRef.current;
|
|
72119
72195
|
setTokenCount(b.tokenCount);
|
|
72120
72196
|
const newLines = toLines(b);
|
|
72121
72197
|
setLines(newLines);
|
|
72122
72198
|
commitEligibleLines(b);
|
|
72123
72199
|
}, [commitEligibleLines]);
|
|
72124
|
-
const refreshDerivedThrottled =
|
|
72200
|
+
const refreshDerivedThrottled = import_react78.useCallback(() => {
|
|
72125
72201
|
if (!buffersRef.current.pendingRefresh) {
|
|
72126
72202
|
buffersRef.current.pendingRefresh = true;
|
|
72127
72203
|
const capturedGeneration = buffersRef.current.commitGeneration || 0;
|
|
@@ -72133,7 +72209,7 @@ function App2({
|
|
|
72133
72209
|
}, 16);
|
|
72134
72210
|
}
|
|
72135
72211
|
}, [refreshDerived]);
|
|
72136
|
-
|
|
72212
|
+
import_react78.useEffect(() => {
|
|
72137
72213
|
const approvals = startupApprovals?.length > 0 ? startupApprovals : startupApproval ? [startupApproval] : [];
|
|
72138
72214
|
if (loadingState === "ready" && approvals.length > 0) {
|
|
72139
72215
|
setPendingApprovals(approvals);
|
|
@@ -72151,7 +72227,7 @@ function App2({
|
|
|
72151
72227
|
analyzeStartupApprovals();
|
|
72152
72228
|
}
|
|
72153
72229
|
}, [loadingState, startupApproval, startupApprovals]);
|
|
72154
|
-
|
|
72230
|
+
import_react78.useEffect(() => {
|
|
72155
72231
|
if (!currentApproval)
|
|
72156
72232
|
return;
|
|
72157
72233
|
if (currentApproval.toolName !== "ExitPlanMode")
|
|
@@ -72183,7 +72259,7 @@ function App2({
|
|
|
72183
72259
|
lastPlanFilePathRef.current = planFilePath;
|
|
72184
72260
|
} catch {}
|
|
72185
72261
|
}, [currentApproval]);
|
|
72186
|
-
|
|
72262
|
+
import_react78.useEffect(() => {
|
|
72187
72263
|
if (loadingState === "ready" && messageHistory.length > 0 && !hasBackfilledRef.current) {
|
|
72188
72264
|
hasBackfilledRef.current = true;
|
|
72189
72265
|
if (!welcomeCommittedRef.current) {
|
|
@@ -72242,7 +72318,7 @@ function App2({
|
|
|
72242
72318
|
agentState,
|
|
72243
72319
|
agentProvenance
|
|
72244
72320
|
]);
|
|
72245
|
-
|
|
72321
|
+
import_react78.useEffect(() => {
|
|
72246
72322
|
if (loadingState === "ready" && agentId && agentId !== "loading") {
|
|
72247
72323
|
const fetchConfig = async () => {
|
|
72248
72324
|
try {
|
|
@@ -72272,7 +72348,7 @@ function App2({
|
|
|
72272
72348
|
fetchConfig();
|
|
72273
72349
|
}
|
|
72274
72350
|
}, [loadingState, agentId]);
|
|
72275
|
-
const appendError =
|
|
72351
|
+
const appendError = import_react78.useCallback((message, skipTelemetry = false) => {
|
|
72276
72352
|
const text = typeof message === "string" ? message : message != null ? JSON.stringify(message) : "[Unknown error]";
|
|
72277
72353
|
const id = uid4("err");
|
|
72278
72354
|
buffersRef.current.byId.set(id, {
|
|
@@ -72288,7 +72364,7 @@ function App2({
|
|
|
72288
72364
|
});
|
|
72289
72365
|
}
|
|
72290
72366
|
}, [refreshDerived, currentModelId]);
|
|
72291
|
-
const processConversation =
|
|
72367
|
+
const processConversation = import_react78.useCallback(async (initialInput, options) => {
|
|
72292
72368
|
const handleRalphContinuation = () => {
|
|
72293
72369
|
const ralphState = ralphMode.getState();
|
|
72294
72370
|
const lines2 = toLines(buffersRef.current);
|
|
@@ -72990,7 +73066,7 @@ ${newState.originalPrompt}`
|
|
|
72990
73066
|
setStreaming,
|
|
72991
73067
|
currentModelId
|
|
72992
73068
|
]);
|
|
72993
|
-
const handleExit =
|
|
73069
|
+
const handleExit = import_react78.useCallback(async () => {
|
|
72994
73070
|
saveLastAgentBeforeExit();
|
|
72995
73071
|
const stats = sessionStatsRef.current.getSnapshot();
|
|
72996
73072
|
telemetry2.trackSessionEnd(stats, "exit_command");
|
|
@@ -73000,10 +73076,10 @@ ${newState.originalPrompt}`
|
|
|
73000
73076
|
process.exit(0);
|
|
73001
73077
|
}, 100);
|
|
73002
73078
|
}, []);
|
|
73003
|
-
const handleEnterQueueEditMode =
|
|
73079
|
+
const handleEnterQueueEditMode = import_react78.useCallback(() => {
|
|
73004
73080
|
setMessageQueue([]);
|
|
73005
73081
|
}, []);
|
|
73006
|
-
const handleInterrupt =
|
|
73082
|
+
const handleInterrupt = import_react78.useCallback(async () => {
|
|
73007
73083
|
if (isExecutingTool && toolAbortControllerRef.current) {
|
|
73008
73084
|
toolAbortControllerRef.current.abort();
|
|
73009
73085
|
buffersRef.current.abortGeneration = (buffersRef.current.abortGeneration || 0) + 1;
|
|
@@ -73090,11 +73166,11 @@ ${newState.originalPrompt}`
|
|
|
73090
73166
|
setStreaming,
|
|
73091
73167
|
pendingApprovals
|
|
73092
73168
|
]);
|
|
73093
|
-
const processConversationRef =
|
|
73094
|
-
|
|
73169
|
+
const processConversationRef = import_react78.useRef(processConversation);
|
|
73170
|
+
import_react78.useEffect(() => {
|
|
73095
73171
|
processConversationRef.current = processConversation;
|
|
73096
73172
|
}, [processConversation]);
|
|
73097
|
-
const handleAgentSelect =
|
|
73173
|
+
const handleAgentSelect = import_react78.useCallback(async (targetAgentId, _opts) => {
|
|
73098
73174
|
setActiveOverlay(null);
|
|
73099
73175
|
if (targetAgentId === agentId) {
|
|
73100
73176
|
const label = agentName || targetAgentId.slice(0, 12);
|
|
@@ -73191,7 +73267,7 @@ ${newState.originalPrompt}`
|
|
|
73191
73267
|
setCommandRunning(false);
|
|
73192
73268
|
}
|
|
73193
73269
|
}, [refreshDerived, agentId, agentName, setCommandRunning]);
|
|
73194
|
-
const handleCreateNewAgent =
|
|
73270
|
+
const handleCreateNewAgent = import_react78.useCallback(async (name) => {
|
|
73195
73271
|
setActiveOverlay(null);
|
|
73196
73272
|
setCommandRunning(true);
|
|
73197
73273
|
const inputCmd = "/new";
|
|
@@ -73256,7 +73332,7 @@ ${newState.originalPrompt}`
|
|
|
73256
73332
|
setCommandRunning(false);
|
|
73257
73333
|
}
|
|
73258
73334
|
}, [refreshDerived, agentId, setCommandRunning]);
|
|
73259
|
-
const handleBashSubmit =
|
|
73335
|
+
const handleBashSubmit = import_react78.useCallback(async (command) => {
|
|
73260
73336
|
const cmdId = uid4("bash");
|
|
73261
73337
|
buffersRef.current.byId.set(cmdId, {
|
|
73262
73338
|
kind: "bash_command",
|
|
@@ -73303,7 +73379,7 @@ ${newState.originalPrompt}`
|
|
|
73303
73379
|
}
|
|
73304
73380
|
refreshDerived();
|
|
73305
73381
|
}, [refreshDerived]);
|
|
73306
|
-
const checkPendingApprovalsForSlashCommand =
|
|
73382
|
+
const checkPendingApprovalsForSlashCommand = import_react78.useCallback(async () => {
|
|
73307
73383
|
if (!CHECK_PENDING_APPROVALS_BEFORE_SEND) {
|
|
73308
73384
|
return { blocked: false };
|
|
73309
73385
|
}
|
|
@@ -73393,7 +73469,7 @@ ${newState.originalPrompt}`
|
|
|
73393
73469
|
return { blocked: false };
|
|
73394
73470
|
}
|
|
73395
73471
|
}, [agentId, processConversation]);
|
|
73396
|
-
const onSubmit =
|
|
73472
|
+
const onSubmit = import_react78.useCallback(async (message) => {
|
|
73397
73473
|
const msg = message?.trim() ?? "";
|
|
73398
73474
|
if (profileConfirmPending && !msg) {
|
|
73399
73475
|
const { name, agentId: targetAgentId, cmdId } = profileConfirmPending;
|
|
@@ -74876,11 +74952,11 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
74876
74952
|
setCommandRunning,
|
|
74877
74953
|
pendingRalphConfig
|
|
74878
74954
|
]);
|
|
74879
|
-
const onSubmitRef =
|
|
74880
|
-
|
|
74955
|
+
const onSubmitRef = import_react78.useRef(onSubmit);
|
|
74956
|
+
import_react78.useEffect(() => {
|
|
74881
74957
|
onSubmitRef.current = onSubmit;
|
|
74882
74958
|
}, [onSubmit]);
|
|
74883
|
-
|
|
74959
|
+
import_react78.useEffect(() => {
|
|
74884
74960
|
if (!streaming && messageQueue.length > 0 && pendingApprovals.length === 0 && !commandRunning && !isExecutingTool && !anySelectorOpen && !waitingForQueueCancelRef.current && !userCancelledRef.current) {
|
|
74885
74961
|
const [firstMessage, ...rest] = messageQueue;
|
|
74886
74962
|
setMessageQueue(rest);
|
|
@@ -74894,7 +74970,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
74894
74970
|
isExecutingTool,
|
|
74895
74971
|
anySelectorOpen
|
|
74896
74972
|
]);
|
|
74897
|
-
const sendAllResults =
|
|
74973
|
+
const sendAllResults = import_react78.useCallback(async (additionalDecision) => {
|
|
74898
74974
|
try {
|
|
74899
74975
|
if (userCancelledRef.current || abortControllerRef.current?.signal.aborted) {
|
|
74900
74976
|
setStreaming(false);
|
|
@@ -74999,7 +75075,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
74999
75075
|
appendError,
|
|
75000
75076
|
setStreaming
|
|
75001
75077
|
]);
|
|
75002
|
-
const handleApproveCurrent =
|
|
75078
|
+
const handleApproveCurrent = import_react78.useCallback(async (diffs) => {
|
|
75003
75079
|
if (isExecutingTool)
|
|
75004
75080
|
return;
|
|
75005
75081
|
const currentIndex = approvalResults.length;
|
|
@@ -75038,7 +75114,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
75038
75114
|
isExecutingTool,
|
|
75039
75115
|
setStreaming
|
|
75040
75116
|
]);
|
|
75041
|
-
const handleApproveAlways =
|
|
75117
|
+
const handleApproveAlways = import_react78.useCallback(async (scope, diffs) => {
|
|
75042
75118
|
if (isExecutingTool)
|
|
75043
75119
|
return;
|
|
75044
75120
|
if (pendingApprovals.length === 0 || approvalContexts.length === 0)
|
|
@@ -75147,7 +75223,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
75147
75223
|
isExecutingTool,
|
|
75148
75224
|
setStreaming
|
|
75149
75225
|
]);
|
|
75150
|
-
const handleDenyCurrent =
|
|
75226
|
+
const handleDenyCurrent = import_react78.useCallback(async (reason) => {
|
|
75151
75227
|
if (isExecutingTool)
|
|
75152
75228
|
return;
|
|
75153
75229
|
const currentIndex = approvalResults.length;
|
|
@@ -75183,7 +75259,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
75183
75259
|
isExecutingTool,
|
|
75184
75260
|
setStreaming
|
|
75185
75261
|
]);
|
|
75186
|
-
const handleCancelApprovals =
|
|
75262
|
+
const handleCancelApprovals = import_react78.useCallback(() => {
|
|
75187
75263
|
if (pendingApprovals.length === 0)
|
|
75188
75264
|
return;
|
|
75189
75265
|
const denialResults = pendingApprovals.map((approval) => ({
|
|
@@ -75201,7 +75277,7 @@ DO NOT respond to these messages or otherwise consider them in your response unl
|
|
|
75201
75277
|
setAutoHandledResults([]);
|
|
75202
75278
|
setAutoDeniedApprovals([]);
|
|
75203
75279
|
}, [pendingApprovals, refreshDerived]);
|
|
75204
|
-
const handleModelSelect =
|
|
75280
|
+
const handleModelSelect = import_react78.useCallback(async (modelId) => {
|
|
75205
75281
|
await withCommandLock(async () => {
|
|
75206
75282
|
let cmdId = null;
|
|
75207
75283
|
try {
|
|
@@ -75286,7 +75362,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75286
75362
|
}
|
|
75287
75363
|
});
|
|
75288
75364
|
}, [agentId, refreshDerived, currentToolset, withCommandLock]);
|
|
75289
|
-
const handleSystemPromptSelect =
|
|
75365
|
+
const handleSystemPromptSelect = import_react78.useCallback(async (promptId) => {
|
|
75290
75366
|
await withCommandLock(async () => {
|
|
75291
75367
|
const cmdId = uid4("cmd");
|
|
75292
75368
|
try {
|
|
@@ -75351,7 +75427,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75351
75427
|
}
|
|
75352
75428
|
});
|
|
75353
75429
|
}, [agentId, refreshDerived, withCommandLock]);
|
|
75354
|
-
const handleToolsetSelect =
|
|
75430
|
+
const handleToolsetSelect = import_react78.useCallback(async (toolsetId) => {
|
|
75355
75431
|
await withCommandLock(async () => {
|
|
75356
75432
|
const cmdId = uid4("cmd");
|
|
75357
75433
|
try {
|
|
@@ -75390,7 +75466,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75390
75466
|
}
|
|
75391
75467
|
});
|
|
75392
75468
|
}, [agentId, refreshDerived, withCommandLock]);
|
|
75393
|
-
const handleFeedbackSubmit =
|
|
75469
|
+
const handleFeedbackSubmit = import_react78.useCallback(async (message) => {
|
|
75394
75470
|
closeOverlay();
|
|
75395
75471
|
await withCommandLock(async () => {
|
|
75396
75472
|
const cmdId = uid4("cmd");
|
|
@@ -75458,7 +75534,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75458
75534
|
}
|
|
75459
75535
|
});
|
|
75460
75536
|
}, [agentId, refreshDerived, withCommandLock, closeOverlay]);
|
|
75461
|
-
const handleProfileEscapeCancel =
|
|
75537
|
+
const handleProfileEscapeCancel = import_react78.useCallback(() => {
|
|
75462
75538
|
if (profileConfirmPending) {
|
|
75463
75539
|
const { cmdId, name } = profileConfirmPending;
|
|
75464
75540
|
buffersRef.current.byId.set(cmdId, {
|
|
@@ -75473,8 +75549,8 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75473
75549
|
setProfileConfirmPending(null);
|
|
75474
75550
|
}
|
|
75475
75551
|
}, [profileConfirmPending, refreshDerived]);
|
|
75476
|
-
const [uiPermissionMode, setUiPermissionMode] =
|
|
75477
|
-
const handleRalphExit =
|
|
75552
|
+
const [uiPermissionMode, setUiPermissionMode] = import_react78.useState(permissionMode2.getMode());
|
|
75553
|
+
const handleRalphExit = import_react78.useCallback(() => {
|
|
75478
75554
|
const ralph = ralphMode.getState();
|
|
75479
75555
|
if (ralph.isActive) {
|
|
75480
75556
|
const wasYolo = ralph.isYolo;
|
|
@@ -75486,14 +75562,14 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75486
75562
|
}
|
|
75487
75563
|
}
|
|
75488
75564
|
}, []);
|
|
75489
|
-
const handlePermissionModeChange =
|
|
75565
|
+
const handlePermissionModeChange = import_react78.useCallback((mode) => {
|
|
75490
75566
|
if (mode === "plan") {
|
|
75491
75567
|
const planPath = generatePlanFilePath();
|
|
75492
75568
|
permissionMode2.setPlanFilePath(planPath);
|
|
75493
75569
|
}
|
|
75494
75570
|
setUiPermissionMode(mode);
|
|
75495
75571
|
}, []);
|
|
75496
|
-
const handlePlanApprove =
|
|
75572
|
+
const handlePlanApprove = import_react78.useCallback(async (acceptEdits = false) => {
|
|
75497
75573
|
const currentIndex = approvalResults.length;
|
|
75498
75574
|
const approval = pendingApprovals[currentIndex];
|
|
75499
75575
|
if (!approval)
|
|
@@ -75544,7 +75620,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75544
75620
|
refreshDerived,
|
|
75545
75621
|
setStreaming
|
|
75546
75622
|
]);
|
|
75547
|
-
const handlePlanKeepPlanning =
|
|
75623
|
+
const handlePlanKeepPlanning = import_react78.useCallback(async (reason) => {
|
|
75548
75624
|
const currentIndex = approvalResults.length;
|
|
75549
75625
|
const approval = pendingApprovals[currentIndex];
|
|
75550
75626
|
if (!approval)
|
|
@@ -75563,7 +75639,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75563
75639
|
setApprovalResults((prev) => [...prev, decision]);
|
|
75564
75640
|
}
|
|
75565
75641
|
}, [pendingApprovals, approvalResults, sendAllResults]);
|
|
75566
|
-
|
|
75642
|
+
import_react78.useEffect(() => {
|
|
75567
75643
|
const currentIndex = approvalResults.length;
|
|
75568
75644
|
const approval = pendingApprovals[currentIndex];
|
|
75569
75645
|
if (approval?.toolName === "ExitPlanMode" && !planFileExists()) {
|
|
@@ -75573,7 +75649,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75573
75649
|
` + `Use a write tool (e.g. Write, ApplyPatch, etc.) to create your plan, then call ExitPlanMode again.`);
|
|
75574
75650
|
}
|
|
75575
75651
|
}, [pendingApprovals, approvalResults.length, handlePlanKeepPlanning]);
|
|
75576
|
-
const handleQuestionSubmit =
|
|
75652
|
+
const handleQuestionSubmit = import_react78.useCallback(async (answers) => {
|
|
75577
75653
|
const currentIndex = approvalResults.length;
|
|
75578
75654
|
const approval = pendingApprovals[currentIndex];
|
|
75579
75655
|
if (!approval)
|
|
@@ -75614,7 +75690,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
75614
75690
|
setApprovalResults((prev) => [...prev, decision]);
|
|
75615
75691
|
}
|
|
75616
75692
|
}, [pendingApprovals, approvalResults, sendAllResults, refreshDerived]);
|
|
75617
|
-
const handleEnterPlanModeApprove =
|
|
75693
|
+
const handleEnterPlanModeApprove = import_react78.useCallback(async () => {
|
|
75618
75694
|
const currentIndex = approvalResults.length;
|
|
75619
75695
|
const approval = pendingApprovals[currentIndex];
|
|
75620
75696
|
if (!approval)
|
|
@@ -75665,7 +75741,7 @@ Plan file path: ${planFilePath}`;
|
|
|
75665
75741
|
setApprovalResults((prev) => [...prev, decision]);
|
|
75666
75742
|
}
|
|
75667
75743
|
}, [pendingApprovals, approvalResults, sendAllResults, refreshDerived]);
|
|
75668
|
-
const handleEnterPlanModeReject =
|
|
75744
|
+
const handleEnterPlanModeReject = import_react78.useCallback(async () => {
|
|
75669
75745
|
const currentIndex = approvalResults.length;
|
|
75670
75746
|
const approval = pendingApprovals[currentIndex];
|
|
75671
75747
|
if (!approval)
|
|
@@ -75684,7 +75760,7 @@ Plan file path: ${planFilePath}`;
|
|
|
75684
75760
|
setApprovalResults((prev) => [...prev, decision]);
|
|
75685
75761
|
}
|
|
75686
75762
|
}, [pendingApprovals, approvalResults, sendAllResults]);
|
|
75687
|
-
const liveItems =
|
|
75763
|
+
const liveItems = import_react78.useMemo(() => {
|
|
75688
75764
|
return lines.filter((ln) => {
|
|
75689
75765
|
if (!("phase" in ln))
|
|
75690
75766
|
return false;
|
|
@@ -75702,7 +75778,7 @@ Plan file path: ${planFilePath}`;
|
|
|
75702
75778
|
return ln.phase === "streaming";
|
|
75703
75779
|
});
|
|
75704
75780
|
}, [lines, tokenStreamingEnabled]);
|
|
75705
|
-
|
|
75781
|
+
import_react78.useEffect(() => {
|
|
75706
75782
|
if (loadingState === "ready" && !welcomeCommittedRef.current && messageHistory.length === 0) {
|
|
75707
75783
|
if (!continueSession && !agentProvenance) {
|
|
75708
75784
|
return;
|
|
@@ -76180,7 +76256,7 @@ Plan file path: ${planFilePath}`;
|
|
|
76180
76256
|
]
|
|
76181
76257
|
}, resumeKey, true, undefined, this);
|
|
76182
76258
|
}
|
|
76183
|
-
var
|
|
76259
|
+
var import_react78, jsx_dev_runtime56, CLEAR_SCREEN_AND_HOME = "\x1B[2J\x1B[H", CHECK_PENDING_APPROVALS_BEFORE_SEND = true, EAGER_CANCEL = true, LLM_API_ERROR_MAX_RETRIES2 = 3, INTERRUPT_MESSAGE = "Interrupted – tell the agent what to do differently. Something went wrong? Use /feedback to report the issue.";
|
|
76184
76260
|
var init_App2 = __esm(async () => {
|
|
76185
76261
|
init_error();
|
|
76186
76262
|
init_check_approval();
|
|
@@ -76254,7 +76330,7 @@ var init_App2 = __esm(async () => {
|
|
|
76254
76330
|
init_stream(),
|
|
76255
76331
|
init_useSuspend()
|
|
76256
76332
|
]);
|
|
76257
|
-
|
|
76333
|
+
import_react78 = __toESM(require_react(), 1);
|
|
76258
76334
|
jsx_dev_runtime56 = __toESM(require_jsx_dev_runtime(), 1);
|
|
76259
76335
|
});
|
|
76260
76336
|
|
|
@@ -77261,7 +77337,8 @@ async function getClient() {
|
|
|
77261
77337
|
defaultHeaders: {
|
|
77262
77338
|
"X-Letta-Source": "letta-code",
|
|
77263
77339
|
"User-Agent": `letta-code/${package_default.version}`
|
|
77264
|
-
}
|
|
77340
|
+
},
|
|
77341
|
+
...isTimingsEnabled() && { fetch: createTimingFetch(fetch) }
|
|
77265
77342
|
});
|
|
77266
77343
|
}
|
|
77267
77344
|
|
|
@@ -77717,6 +77794,12 @@ class PermissionModeManager {
|
|
|
77717
77794
|
return "allow";
|
|
77718
77795
|
}
|
|
77719
77796
|
}
|
|
77797
|
+
if (toolName === "Skill" || toolName === "skill") {
|
|
77798
|
+
const command = toolArgs?.command;
|
|
77799
|
+
if (command && ["load", "unload", "refresh"].includes(command)) {
|
|
77800
|
+
return "allow";
|
|
77801
|
+
}
|
|
77802
|
+
}
|
|
77720
77803
|
const shellTools = [
|
|
77721
77804
|
"Bash",
|
|
77722
77805
|
"shell",
|
|
@@ -79241,7 +79324,7 @@ Error: ${message}`);
|
|
|
79241
79324
|
} catch {}
|
|
79242
79325
|
const React14 = await Promise.resolve().then(() => __toESM(require_react2(), 1));
|
|
79243
79326
|
const { render: render2 } = await init_build3().then(() => exports_build);
|
|
79244
|
-
const { useState: useState39, useEffect:
|
|
79327
|
+
const { useState: useState39, useEffect: useEffect26 } = React14;
|
|
79245
79328
|
const AppModule = await init_App2().then(() => exports_App);
|
|
79246
79329
|
const App3 = AppModule.default;
|
|
79247
79330
|
function LoadingApp({
|
|
@@ -79264,7 +79347,8 @@ Error: ${message}`);
|
|
|
79264
79347
|
const [isResumingSession, setIsResumingSession] = useState39(false);
|
|
79265
79348
|
const [agentProvenance, setAgentProvenance] = useState39(null);
|
|
79266
79349
|
const [selectedGlobalAgentId, setSelectedGlobalAgentId] = useState39(null);
|
|
79267
|
-
|
|
79350
|
+
const [userRequestedNewAgent, setUserRequestedNewAgent] = useState39(false);
|
|
79351
|
+
useEffect26(() => {
|
|
79268
79352
|
async function autoInstallKeybinding() {
|
|
79269
79353
|
const {
|
|
79270
79354
|
detectTerminalType: detectTerminalType3,
|
|
@@ -79321,7 +79405,7 @@ Error: ${message}`);
|
|
|
79321
79405
|
autoInstallKeybinding();
|
|
79322
79406
|
autoInstallWezTermFix();
|
|
79323
79407
|
}, []);
|
|
79324
|
-
|
|
79408
|
+
useEffect26(() => {
|
|
79325
79409
|
async function checkAndStart() {
|
|
79326
79410
|
await settingsManager2.loadLocalProjectSettings();
|
|
79327
79411
|
const localSettings = settingsManager2.getLocalProjectSettings();
|
|
@@ -79335,7 +79419,7 @@ Error: ${message}`);
|
|
|
79335
79419
|
}
|
|
79336
79420
|
checkAndStart();
|
|
79337
79421
|
}, [forceNew2, agentIdArg, fromAfFile2, continueSession]);
|
|
79338
|
-
|
|
79422
|
+
useEffect26(() => {
|
|
79339
79423
|
if (loadingState !== "assembling")
|
|
79340
79424
|
return;
|
|
79341
79425
|
async function init() {
|
|
@@ -79347,7 +79431,8 @@ Error: ${message}`);
|
|
|
79347
79431
|
resumingAgentId = agentIdArg;
|
|
79348
79432
|
} catch {}
|
|
79349
79433
|
}
|
|
79350
|
-
|
|
79434
|
+
const shouldCreateNew = forceNew2 || userRequestedNewAgent;
|
|
79435
|
+
if (!resumingAgentId && !shouldCreateNew) {
|
|
79351
79436
|
const localProjectSettings = settingsManager2.getLocalProjectSettings();
|
|
79352
79437
|
if (localProjectSettings?.lastAgent) {
|
|
79353
79438
|
try {
|
|
@@ -79414,7 +79499,7 @@ Error: ${message}`);
|
|
|
79414
79499
|
process.exit(1);
|
|
79415
79500
|
}
|
|
79416
79501
|
}
|
|
79417
|
-
if (!agent &&
|
|
79502
|
+
if (!agent && shouldCreateNew) {
|
|
79418
79503
|
const updateArgs = getModelUpdateArgs3(model);
|
|
79419
79504
|
const result = await createAgent3(undefined, model, undefined, updateArgs, skillsDirectory2, true, sleeptimeFlag ?? settings.enableSleeptime, systemPromptPreset2, initBlocks2, baseTools2);
|
|
79420
79505
|
agent = result.agent;
|
|
@@ -79472,8 +79557,8 @@ Error: ${message}`);
|
|
|
79472
79557
|
} catch (error) {
|
|
79473
79558
|
console.warn(`Failed to update skills: ${error instanceof Error ? error.message : String(error)}`);
|
|
79474
79559
|
}
|
|
79475
|
-
const isResumingProject = !
|
|
79476
|
-
const isReusingExistingAgent = !
|
|
79560
|
+
const isResumingProject = !shouldCreateNew && !!resumingAgentId;
|
|
79561
|
+
const isReusingExistingAgent = !shouldCreateNew && !fromAfFile2 && agent && agent.id;
|
|
79477
79562
|
const resuming = !!(continueSession || agentIdArg || isResumingProject || isReusingExistingAgent);
|
|
79478
79563
|
setIsResumingSession(resuming);
|
|
79479
79564
|
if (resuming && (model || systemPromptPreset2)) {
|
|
@@ -79526,6 +79611,7 @@ Error during initialization: ${message}`);
|
|
|
79526
79611
|
}, [
|
|
79527
79612
|
continueSession,
|
|
79528
79613
|
forceNew2,
|
|
79614
|
+
userRequestedNewAgent,
|
|
79529
79615
|
agentIdArg,
|
|
79530
79616
|
model,
|
|
79531
79617
|
systemPromptPreset2,
|
|
@@ -79550,6 +79636,7 @@ Error during initialization: ${message}`);
|
|
|
79550
79636
|
setLoadingState("assembling");
|
|
79551
79637
|
},
|
|
79552
79638
|
onCreateNew: () => {
|
|
79639
|
+
setUserRequestedNewAgent(true);
|
|
79553
79640
|
setLoadingState("assembling");
|
|
79554
79641
|
},
|
|
79555
79642
|
onExit: () => {
|
|
@@ -79598,4 +79685,4 @@ Error during initialization: ${message}`);
|
|
|
79598
79685
|
}
|
|
79599
79686
|
main();
|
|
79600
79687
|
|
|
79601
|
-
//# debugId=
|
|
79688
|
+
//# debugId=F6FA3742BB8A91B864756E2164756E21
|