@letta-ai/letta-code 0.6.0 → 0.6.1
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/README.md +16 -4
- package/letta.js +1122 -941
- package/package.json +2 -2
package/letta.js
CHANGED
|
@@ -251,7 +251,7 @@ var init_values = __esm(() => {
|
|
|
251
251
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
252
252
|
|
|
253
253
|
// node_modules/@letta-ai/letta-client/version.mjs
|
|
254
|
-
var VERSION = "1.
|
|
254
|
+
var VERSION = "1.4.0";
|
|
255
255
|
|
|
256
256
|
// node_modules/@letta-ai/letta-client/internal/detect-platform.mjs
|
|
257
257
|
function getDetectedPlatform() {
|
|
@@ -18265,6 +18265,7 @@ var init_filter = __esm(() => {
|
|
|
18265
18265
|
var exports_manager = {};
|
|
18266
18266
|
__export(exports_manager, {
|
|
18267
18267
|
upsertToolsToServer: () => upsertToolsToServer,
|
|
18268
|
+
upsertToolsIfNeeded: () => upsertToolsIfNeeded,
|
|
18268
18269
|
savePermissionRule: () => savePermissionRule2,
|
|
18269
18270
|
requiresApproval: () => requiresApproval,
|
|
18270
18271
|
loadTools: () => loadTools,
|
|
@@ -18279,6 +18280,7 @@ __export(exports_manager, {
|
|
|
18279
18280
|
getInternalToolName: () => getInternalToolName,
|
|
18280
18281
|
getAllLettaToolNames: () => getAllLettaToolNames,
|
|
18281
18282
|
executeTool: () => executeTool,
|
|
18283
|
+
computeToolsHash: () => computeToolsHash,
|
|
18282
18284
|
clipToolReturn: () => clipToolReturn,
|
|
18283
18285
|
clearTools: () => clearTools,
|
|
18284
18286
|
checkToolPermission: () => checkToolPermission,
|
|
@@ -18290,6 +18292,7 @@ __export(exports_manager, {
|
|
|
18290
18292
|
GEMINI_DEFAULT_TOOLS: () => GEMINI_DEFAULT_TOOLS,
|
|
18291
18293
|
ANTHROPIC_DEFAULT_TOOLS: () => ANTHROPIC_DEFAULT_TOOLS
|
|
18292
18294
|
});
|
|
18295
|
+
import { createHash } from "node:crypto";
|
|
18293
18296
|
function getServerToolName(internalName) {
|
|
18294
18297
|
return TOOL_NAME_MAPPINGS[internalName] || internalName;
|
|
18295
18298
|
}
|
|
@@ -18491,6 +18494,27 @@ Original error: ${error.message}`);
|
|
|
18491
18494
|
}
|
|
18492
18495
|
await attemptUpsert();
|
|
18493
18496
|
}
|
|
18497
|
+
function computeToolsHash() {
|
|
18498
|
+
const toolData = Array.from(toolRegistry.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([name, tool]) => ({
|
|
18499
|
+
name,
|
|
18500
|
+
serverName: getServerToolName(name),
|
|
18501
|
+
schema: tool.schema
|
|
18502
|
+
}));
|
|
18503
|
+
return createHash("sha256").update(JSON.stringify(toolData)).digest("hex").slice(0, 16);
|
|
18504
|
+
}
|
|
18505
|
+
async function upsertToolsIfNeeded(client, serverUrl) {
|
|
18506
|
+
const currentHash = computeToolsHash();
|
|
18507
|
+
const { settingsManager: settingsManager3 } = await Promise.resolve().then(() => (init_settings_manager(), exports_settings_manager));
|
|
18508
|
+
const cachedHashes = settingsManager3.getSetting("toolUpsertHashes") || {};
|
|
18509
|
+
if (cachedHashes[serverUrl] === currentHash) {
|
|
18510
|
+
return false;
|
|
18511
|
+
}
|
|
18512
|
+
await upsertToolsToServer(client);
|
|
18513
|
+
settingsManager3.updateSettings({
|
|
18514
|
+
toolUpsertHashes: { ...cachedHashes, [serverUrl]: currentHash }
|
|
18515
|
+
});
|
|
18516
|
+
return true;
|
|
18517
|
+
}
|
|
18494
18518
|
function clipToolReturn(text, maxLines = 3, maxChars = 300) {
|
|
18495
18519
|
if (!text)
|
|
18496
18520
|
return text;
|
|
@@ -18761,7 +18785,7 @@ var package_default;
|
|
|
18761
18785
|
var init_package = __esm(() => {
|
|
18762
18786
|
package_default = {
|
|
18763
18787
|
name: "@letta-ai/letta-code",
|
|
18764
|
-
version: "0.6.
|
|
18788
|
+
version: "0.6.1",
|
|
18765
18789
|
description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
18766
18790
|
type: "module",
|
|
18767
18791
|
bin: {
|
|
@@ -18783,7 +18807,7 @@ var init_package = __esm(() => {
|
|
|
18783
18807
|
access: "public"
|
|
18784
18808
|
},
|
|
18785
18809
|
dependencies: {
|
|
18786
|
-
"@letta-ai/letta-client": "^1.
|
|
18810
|
+
"@letta-ai/letta-client": "^1.4.0",
|
|
18787
18811
|
glob: "^13.0.0",
|
|
18788
18812
|
"ink-link": "^5.0.0",
|
|
18789
18813
|
open: "^10.2.0"
|
|
@@ -45858,6 +45882,7 @@ var init_client2 = __esm(() => {
|
|
|
45858
45882
|
var exports_manager2 = {};
|
|
45859
45883
|
__export(exports_manager2, {
|
|
45860
45884
|
upsertToolsToServer: () => upsertToolsToServer2,
|
|
45885
|
+
upsertToolsIfNeeded: () => upsertToolsIfNeeded2,
|
|
45861
45886
|
savePermissionRule: () => savePermissionRule3,
|
|
45862
45887
|
requiresApproval: () => requiresApproval2,
|
|
45863
45888
|
loadTools: () => loadTools2,
|
|
@@ -45872,6 +45897,7 @@ __export(exports_manager2, {
|
|
|
45872
45897
|
getInternalToolName: () => getInternalToolName2,
|
|
45873
45898
|
getAllLettaToolNames: () => getAllLettaToolNames2,
|
|
45874
45899
|
executeTool: () => executeTool2,
|
|
45900
|
+
computeToolsHash: () => computeToolsHash2,
|
|
45875
45901
|
clipToolReturn: () => clipToolReturn2,
|
|
45876
45902
|
clearTools: () => clearTools2,
|
|
45877
45903
|
checkToolPermission: () => checkToolPermission2,
|
|
@@ -45883,6 +45909,7 @@ __export(exports_manager2, {
|
|
|
45883
45909
|
GEMINI_DEFAULT_TOOLS: () => GEMINI_DEFAULT_TOOLS2,
|
|
45884
45910
|
ANTHROPIC_DEFAULT_TOOLS: () => ANTHROPIC_DEFAULT_TOOLS2
|
|
45885
45911
|
});
|
|
45912
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
45886
45913
|
function getServerToolName2(internalName) {
|
|
45887
45914
|
return TOOL_NAME_MAPPINGS2[internalName] || internalName;
|
|
45888
45915
|
}
|
|
@@ -46084,6 +46111,27 @@ Original error: ${error.message}`);
|
|
|
46084
46111
|
}
|
|
46085
46112
|
await attemptUpsert();
|
|
46086
46113
|
}
|
|
46114
|
+
function computeToolsHash2() {
|
|
46115
|
+
const toolData = Array.from(toolRegistry2.entries()).sort(([a], [b]) => a.localeCompare(b)).map(([name, tool]) => ({
|
|
46116
|
+
name,
|
|
46117
|
+
serverName: getServerToolName2(name),
|
|
46118
|
+
schema: tool.schema
|
|
46119
|
+
}));
|
|
46120
|
+
return createHash2("sha256").update(JSON.stringify(toolData)).digest("hex").slice(0, 16);
|
|
46121
|
+
}
|
|
46122
|
+
async function upsertToolsIfNeeded2(client, serverUrl) {
|
|
46123
|
+
const currentHash = computeToolsHash2();
|
|
46124
|
+
const { settingsManager: settingsManager3 } = await Promise.resolve().then(() => (init_settings_manager(), exports_settings_manager));
|
|
46125
|
+
const cachedHashes = settingsManager3.getSetting("toolUpsertHashes") || {};
|
|
46126
|
+
if (cachedHashes[serverUrl] === currentHash) {
|
|
46127
|
+
return false;
|
|
46128
|
+
}
|
|
46129
|
+
await upsertToolsToServer2(client);
|
|
46130
|
+
settingsManager3.updateSettings({
|
|
46131
|
+
toolUpsertHashes: { ...cachedHashes, [serverUrl]: currentHash }
|
|
46132
|
+
});
|
|
46133
|
+
return true;
|
|
46134
|
+
}
|
|
46087
46135
|
function clipToolReturn2(text, maxLines = 3, maxChars = 300) {
|
|
46088
46136
|
if (!text)
|
|
46089
46137
|
return text;
|
|
@@ -54890,172 +54938,8 @@ var init_dist4 = __esm(async () => {
|
|
|
54890
54938
|
dist_default4 = Link;
|
|
54891
54939
|
});
|
|
54892
54940
|
|
|
54893
|
-
// src/cli/
|
|
54894
|
-
|
|
54895
|
-
__export(exports_registry, {
|
|
54896
|
-
executeCommand: () => executeCommand,
|
|
54897
|
-
commands: () => commands
|
|
54898
|
-
});
|
|
54899
|
-
async function executeCommand(input) {
|
|
54900
|
-
const [command, ...args] = input.trim().split(/\s+/);
|
|
54901
|
-
if (!command) {
|
|
54902
|
-
return {
|
|
54903
|
-
success: false,
|
|
54904
|
-
output: "No command found"
|
|
54905
|
-
};
|
|
54906
|
-
}
|
|
54907
|
-
const handler = commands[command];
|
|
54908
|
-
if (!handler) {
|
|
54909
|
-
return {
|
|
54910
|
-
success: false,
|
|
54911
|
-
output: `Unknown command: ${command}`
|
|
54912
|
-
};
|
|
54913
|
-
}
|
|
54914
|
-
try {
|
|
54915
|
-
const output = await handler.handler(args);
|
|
54916
|
-
return { success: true, output };
|
|
54917
|
-
} catch (error) {
|
|
54918
|
-
return {
|
|
54919
|
-
success: false,
|
|
54920
|
-
output: `Error executing ${command}: ${error instanceof Error ? error.message : String(error)}`
|
|
54921
|
-
};
|
|
54922
|
-
}
|
|
54923
|
-
}
|
|
54924
|
-
var commands;
|
|
54925
|
-
var init_registry = __esm(() => {
|
|
54926
|
-
commands = {
|
|
54927
|
-
"/model": {
|
|
54928
|
-
desc: "Switch model",
|
|
54929
|
-
handler: () => {
|
|
54930
|
-
return "Opening model selector...";
|
|
54931
|
-
}
|
|
54932
|
-
},
|
|
54933
|
-
"/stream": {
|
|
54934
|
-
desc: "Toggle token streaming on/off",
|
|
54935
|
-
handler: () => {
|
|
54936
|
-
return "Toggling token streaming...";
|
|
54937
|
-
}
|
|
54938
|
-
},
|
|
54939
|
-
"/exit": {
|
|
54940
|
-
desc: "Exit and show session stats",
|
|
54941
|
-
handler: () => {
|
|
54942
|
-
return "Exiting...";
|
|
54943
|
-
}
|
|
54944
|
-
},
|
|
54945
|
-
"/clear": {
|
|
54946
|
-
desc: "Clear conversation history",
|
|
54947
|
-
handler: () => {
|
|
54948
|
-
return "Clearing messages...";
|
|
54949
|
-
}
|
|
54950
|
-
},
|
|
54951
|
-
"/logout": {
|
|
54952
|
-
desc: "Clear credentials and exit",
|
|
54953
|
-
handler: () => {
|
|
54954
|
-
return "Clearing credentials...";
|
|
54955
|
-
}
|
|
54956
|
-
},
|
|
54957
|
-
"/link": {
|
|
54958
|
-
desc: "Attach Letta Code tools to current agent",
|
|
54959
|
-
handler: () => {
|
|
54960
|
-
return "Attaching tools...";
|
|
54961
|
-
}
|
|
54962
|
-
},
|
|
54963
|
-
"/unlink": {
|
|
54964
|
-
desc: "Remove Letta Code tools from current agent",
|
|
54965
|
-
handler: () => {
|
|
54966
|
-
return "Removing tools...";
|
|
54967
|
-
}
|
|
54968
|
-
},
|
|
54969
|
-
"/rename": {
|
|
54970
|
-
desc: "Rename the current agent",
|
|
54971
|
-
handler: () => {
|
|
54972
|
-
return "Renaming agent...";
|
|
54973
|
-
}
|
|
54974
|
-
},
|
|
54975
|
-
"/description": {
|
|
54976
|
-
desc: "Update the current agent's description",
|
|
54977
|
-
handler: () => {
|
|
54978
|
-
return "Updating description...";
|
|
54979
|
-
}
|
|
54980
|
-
},
|
|
54981
|
-
"/toolset": {
|
|
54982
|
-
desc: "Switch toolset",
|
|
54983
|
-
handler: () => {
|
|
54984
|
-
return "Opening toolset selector...";
|
|
54985
|
-
}
|
|
54986
|
-
},
|
|
54987
|
-
"/system": {
|
|
54988
|
-
desc: "Switch system prompt",
|
|
54989
|
-
handler: () => {
|
|
54990
|
-
return "Opening system prompt selector...";
|
|
54991
|
-
}
|
|
54992
|
-
},
|
|
54993
|
-
"/download": {
|
|
54994
|
-
desc: "Download AgentFile (.af)",
|
|
54995
|
-
handler: () => {
|
|
54996
|
-
return "Downloading agent file...";
|
|
54997
|
-
}
|
|
54998
|
-
},
|
|
54999
|
-
"/bashes": {
|
|
55000
|
-
desc: "Show background shell processes",
|
|
55001
|
-
handler: () => {
|
|
55002
|
-
return "Showing background processes...";
|
|
55003
|
-
}
|
|
55004
|
-
},
|
|
55005
|
-
"/init": {
|
|
55006
|
-
desc: "Initialize agent memory for this project",
|
|
55007
|
-
handler: () => {
|
|
55008
|
-
return "Initializing memory...";
|
|
55009
|
-
}
|
|
55010
|
-
},
|
|
55011
|
-
"/skill": {
|
|
55012
|
-
desc: "Enter skill creation mode (optionally: /skill <description>)",
|
|
55013
|
-
handler: () => {
|
|
55014
|
-
return "Starting skill creation...";
|
|
55015
|
-
}
|
|
55016
|
-
},
|
|
55017
|
-
"/remember": {
|
|
55018
|
-
desc: "Remember something from the conversation",
|
|
55019
|
-
handler: () => {
|
|
55020
|
-
return "Processing memory request...";
|
|
55021
|
-
}
|
|
55022
|
-
},
|
|
55023
|
-
"/resume": {
|
|
55024
|
-
desc: "Browse and switch to another agent",
|
|
55025
|
-
handler: () => {
|
|
55026
|
-
return "Opening agent selector...";
|
|
55027
|
-
}
|
|
55028
|
-
},
|
|
55029
|
-
"/search": {
|
|
55030
|
-
desc: "Search messages across all agents",
|
|
55031
|
-
handler: () => {
|
|
55032
|
-
return "Opening message search...";
|
|
55033
|
-
}
|
|
55034
|
-
},
|
|
55035
|
-
"/pin": {
|
|
55036
|
-
desc: "Pin current agent globally (use -l for local only)",
|
|
55037
|
-
handler: () => {
|
|
55038
|
-
return "Pinning agent...";
|
|
55039
|
-
}
|
|
55040
|
-
},
|
|
55041
|
-
"/unpin": {
|
|
55042
|
-
desc: "Unpin current agent globally (use -l for local only)",
|
|
55043
|
-
handler: () => {
|
|
55044
|
-
return "Unpinning agent...";
|
|
55045
|
-
}
|
|
55046
|
-
},
|
|
55047
|
-
"/pinned": {
|
|
55048
|
-
desc: "Show pinned agents",
|
|
55049
|
-
handler: () => {
|
|
55050
|
-
return "Opening pinned agents...";
|
|
55051
|
-
}
|
|
55052
|
-
}
|
|
55053
|
-
};
|
|
55054
|
-
});
|
|
55055
|
-
|
|
55056
|
-
// src/cli/components/CommandPreview.tsx
|
|
55057
|
-
function CommandPreview({
|
|
55058
|
-
currentInput,
|
|
54941
|
+
// src/cli/components/AgentInfoBar.tsx
|
|
54942
|
+
function AgentInfoBar({
|
|
55059
54943
|
agentId,
|
|
55060
54944
|
agentName,
|
|
55061
54945
|
serverUrl
|
|
@@ -55067,91 +54951,74 @@ function CommandPreview({
|
|
|
55067
54951
|
const globalPinned = settingsManager.getGlobalPinnedAgents();
|
|
55068
54952
|
return localPinned.includes(agentId) || globalPinned.includes(agentId);
|
|
55069
54953
|
}, [agentId]);
|
|
55070
|
-
if (!currentInput.startsWith("/")) {
|
|
55071
|
-
return null;
|
|
55072
|
-
}
|
|
55073
54954
|
const isCloudUser = serverUrl?.includes("api.letta.com");
|
|
55074
54955
|
const showBottomBar = agentId && agentId !== "loading";
|
|
54956
|
+
if (!showBottomBar) {
|
|
54957
|
+
return null;
|
|
54958
|
+
}
|
|
55075
54959
|
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
55076
54960
|
flexDirection: "column",
|
|
55077
54961
|
borderStyle: "round",
|
|
55078
54962
|
borderColor: colors.command.border,
|
|
55079
54963
|
paddingX: 1,
|
|
54964
|
+
marginBottom: 1,
|
|
55080
54965
|
children: [
|
|
55081
|
-
|
|
55082
|
-
children:
|
|
55083
|
-
|
|
55084
|
-
|
|
55085
|
-
" "
|
|
55086
|
-
|
|
55087
|
-
|
|
55088
|
-
|
|
55089
|
-
|
|
55090
|
-
|
|
55091
|
-
|
|
55092
|
-
|
|
55093
|
-
|
|
55094
|
-
|
|
55095
|
-
|
|
54966
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
54967
|
+
children: [
|
|
54968
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
54969
|
+
color: "gray",
|
|
54970
|
+
children: "Current agent: "
|
|
54971
|
+
}, undefined, false, undefined, this),
|
|
54972
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
54973
|
+
bold: true,
|
|
54974
|
+
children: agentName || "Unnamed"
|
|
54975
|
+
}, undefined, false, undefined, this),
|
|
54976
|
+
isPinned ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
54977
|
+
color: "green",
|
|
54978
|
+
children: " (pinned ✓)"
|
|
54979
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
54980
|
+
color: "gray",
|
|
54981
|
+
children: " (type /pin to pin agent)"
|
|
54982
|
+
}, undefined, false, undefined, this)
|
|
54983
|
+
]
|
|
54984
|
+
}, undefined, true, undefined, this),
|
|
54985
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
55096
54986
|
children: [
|
|
55097
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(
|
|
54987
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
54988
|
+
dimColor: true,
|
|
54989
|
+
children: agentId
|
|
54990
|
+
}, undefined, false, undefined, this),
|
|
54991
|
+
isCloudUser && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
|
55098
54992
|
children: [
|
|
55099
54993
|
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55100
|
-
|
|
55101
|
-
children: "
|
|
54994
|
+
dimColor: true,
|
|
54995
|
+
children: " · "
|
|
54996
|
+
}, undefined, false, undefined, this),
|
|
54997
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(dist_default4, {
|
|
54998
|
+
url: `https://app.letta.com/agents/${agentId}`,
|
|
54999
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55000
|
+
color: colors.link.text,
|
|
55001
|
+
children: "Open in ADE ↗"
|
|
55002
|
+
}, undefined, false, undefined, this)
|
|
55102
55003
|
}, undefined, false, undefined, this),
|
|
55103
55004
|
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55104
|
-
|
|
55105
|
-
children:
|
|
55005
|
+
dimColor: true,
|
|
55006
|
+
children: " · "
|
|
55106
55007
|
}, undefined, false, undefined, this),
|
|
55107
|
-
|
|
55108
|
-
|
|
55109
|
-
children:
|
|
55110
|
-
|
|
55111
|
-
|
|
55112
|
-
|
|
55008
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(dist_default4, {
|
|
55009
|
+
url: "https://app.letta.com/settings/organization/usage",
|
|
55010
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55011
|
+
color: colors.link.text,
|
|
55012
|
+
children: "View usage ↗"
|
|
55013
|
+
}, undefined, false, undefined, this)
|
|
55113
55014
|
}, undefined, false, undefined, this)
|
|
55114
55015
|
]
|
|
55115
55016
|
}, undefined, true, undefined, this),
|
|
55116
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(
|
|
55017
|
+
!isCloudUser && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55018
|
+
dimColor: true,
|
|
55117
55019
|
children: [
|
|
55118
|
-
|
|
55119
|
-
|
|
55120
|
-
children: agentId
|
|
55121
|
-
}, undefined, false, undefined, this),
|
|
55122
|
-
isCloudUser && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(jsx_dev_runtime13.Fragment, {
|
|
55123
|
-
children: [
|
|
55124
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55125
|
-
dimColor: true,
|
|
55126
|
-
children: " · "
|
|
55127
|
-
}, undefined, false, undefined, this),
|
|
55128
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(dist_default4, {
|
|
55129
|
-
url: `https://app.letta.com/agents/${agentId}`,
|
|
55130
|
-
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55131
|
-
color: colors.link.text,
|
|
55132
|
-
children: "Open in ADE ↗"
|
|
55133
|
-
}, undefined, false, undefined, this)
|
|
55134
|
-
}, undefined, false, undefined, this),
|
|
55135
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55136
|
-
dimColor: true,
|
|
55137
|
-
children: "· "
|
|
55138
|
-
}, undefined, false, undefined, this),
|
|
55139
|
-
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(dist_default4, {
|
|
55140
|
-
url: "https://app.letta.com/settings/organization/usage",
|
|
55141
|
-
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55142
|
-
color: colors.link.text,
|
|
55143
|
-
children: "View usage ↗"
|
|
55144
|
-
}, undefined, false, undefined, this)
|
|
55145
|
-
}, undefined, false, undefined, this)
|
|
55146
|
-
]
|
|
55147
|
-
}, undefined, true, undefined, this),
|
|
55148
|
-
!isCloudUser && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
55149
|
-
dimColor: true,
|
|
55150
|
-
children: [
|
|
55151
|
-
" · ",
|
|
55152
|
-
serverUrl
|
|
55153
|
-
]
|
|
55154
|
-
}, undefined, true, undefined, this)
|
|
55020
|
+
" · ",
|
|
55021
|
+
serverUrl
|
|
55155
55022
|
]
|
|
55156
55023
|
}, undefined, true, undefined, this)
|
|
55157
55024
|
]
|
|
@@ -55159,10 +55026,9 @@ function CommandPreview({
|
|
|
55159
55026
|
]
|
|
55160
55027
|
}, undefined, true, undefined, this);
|
|
55161
55028
|
}
|
|
55162
|
-
var import_react35, jsx_dev_runtime13
|
|
55163
|
-
var
|
|
55029
|
+
var import_react35, jsx_dev_runtime13;
|
|
55030
|
+
var init_AgentInfoBar = __esm(async () => {
|
|
55164
55031
|
init_settings_manager();
|
|
55165
|
-
init_registry();
|
|
55166
55032
|
init_colors();
|
|
55167
55033
|
await __promiseAll([
|
|
55168
55034
|
init_build2(),
|
|
@@ -55170,10 +55036,6 @@ var init_CommandPreview = __esm(async () => {
|
|
|
55170
55036
|
]);
|
|
55171
55037
|
import_react35 = __toESM(require_react(), 1);
|
|
55172
55038
|
jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55173
|
-
commandList = Object.entries(commands).filter(([, { hidden }]) => !hidden).map(([cmd, { desc }]) => ({
|
|
55174
|
-
cmd,
|
|
55175
|
-
desc
|
|
55176
|
-
})).sort((a, b) => a.cmd.localeCompare(b.cmd));
|
|
55177
55039
|
});
|
|
55178
55040
|
|
|
55179
55041
|
// src/cli/helpers/fileSearch.ts
|
|
@@ -55267,51 +55129,32 @@ async function searchFiles(query, deep = false) {
|
|
|
55267
55129
|
}
|
|
55268
55130
|
var init_fileSearch = () => {};
|
|
55269
55131
|
|
|
55270
|
-
// src/cli/
|
|
55271
|
-
function
|
|
55272
|
-
|
|
55273
|
-
|
|
55132
|
+
// src/cli/hooks/useAutocompleteNavigation.ts
|
|
55133
|
+
function useAutocompleteNavigation({
|
|
55134
|
+
matches,
|
|
55135
|
+
maxVisible = 10,
|
|
55274
55136
|
onSelect,
|
|
55275
|
-
onActiveChange
|
|
55137
|
+
onActiveChange,
|
|
55138
|
+
manageActiveState = true,
|
|
55139
|
+
disabled = false
|
|
55276
55140
|
}) {
|
|
55277
|
-
const [matches, setMatches] = import_react36.useState([]);
|
|
55278
|
-
const [isLoading, setIsLoading] = import_react36.useState(false);
|
|
55279
55141
|
const [selectedIndex, setSelectedIndex] = import_react36.useState(0);
|
|
55280
|
-
const
|
|
55281
|
-
|
|
55282
|
-
|
|
55283
|
-
|
|
55284
|
-
|
|
55285
|
-
if (input[i] === "@") {
|
|
55286
|
-
if (i === 0 || input[i - 1] === " ") {
|
|
55287
|
-
atPositions.push(i);
|
|
55288
|
-
}
|
|
55289
|
-
}
|
|
55142
|
+
const prevMatchCountRef = import_react36.useRef(0);
|
|
55143
|
+
import_react36.useEffect(() => {
|
|
55144
|
+
if (matches.length !== prevMatchCountRef.current) {
|
|
55145
|
+
setSelectedIndex(0);
|
|
55146
|
+
prevMatchCountRef.current = matches.length;
|
|
55290
55147
|
}
|
|
55291
|
-
|
|
55292
|
-
|
|
55293
|
-
|
|
55294
|
-
|
|
55295
|
-
const afterAt2 = input.slice(pos + 1);
|
|
55296
|
-
const spaceIndex2 = afterAt2.indexOf(" ");
|
|
55297
|
-
const endPos = spaceIndex2 === -1 ? input.length : pos + 1 + spaceIndex2;
|
|
55298
|
-
if (cursor >= pos && cursor <= endPos) {
|
|
55299
|
-
atIndex = pos;
|
|
55300
|
-
break;
|
|
55301
|
-
}
|
|
55148
|
+
}, [matches.length]);
|
|
55149
|
+
import_react36.useEffect(() => {
|
|
55150
|
+
if (manageActiveState) {
|
|
55151
|
+
onActiveChange?.(matches.length > 0);
|
|
55302
55152
|
}
|
|
55303
|
-
|
|
55304
|
-
return null;
|
|
55305
|
-
const afterAt = input.slice(atIndex + 1);
|
|
55306
|
-
const spaceIndex = afterAt.indexOf(" ");
|
|
55307
|
-
const query = spaceIndex === -1 ? afterAt : afterAt.slice(0, spaceIndex);
|
|
55308
|
-
const hasSpaceAfter = spaceIndex !== -1;
|
|
55309
|
-
return { query, hasSpaceAfter, atIndex };
|
|
55310
|
-
}, []);
|
|
55153
|
+
}, [matches.length, onActiveChange, manageActiveState]);
|
|
55311
55154
|
use_input_default((_input, key) => {
|
|
55312
|
-
if (!matches.length ||
|
|
55155
|
+
if (!matches.length || disabled)
|
|
55313
55156
|
return;
|
|
55314
|
-
const maxIndex = Math.min(matches.length,
|
|
55157
|
+
const maxIndex = Math.min(matches.length, maxVisible) - 1;
|
|
55315
55158
|
if (key.upArrow) {
|
|
55316
55159
|
setSelectedIndex((prev) => prev > 0 ? prev - 1 : maxIndex);
|
|
55317
55160
|
} else if (key.downArrow) {
|
|
@@ -55319,18 +55162,72 @@ function FileAutocomplete({
|
|
|
55319
55162
|
} else if ((key.tab || key.return) && onSelect) {
|
|
55320
55163
|
const selected = matches[selectedIndex];
|
|
55321
55164
|
if (selected) {
|
|
55322
|
-
onSelect(selected
|
|
55165
|
+
onSelect(selected);
|
|
55323
55166
|
}
|
|
55324
55167
|
}
|
|
55325
55168
|
});
|
|
55326
|
-
|
|
55169
|
+
return { selectedIndex };
|
|
55170
|
+
}
|
|
55171
|
+
var import_react36;
|
|
55172
|
+
var init_useAutocompleteNavigation = __esm(async () => {
|
|
55173
|
+
await init_build2();
|
|
55174
|
+
import_react36 = __toESM(require_react(), 1);
|
|
55175
|
+
});
|
|
55176
|
+
|
|
55177
|
+
// src/cli/components/FileAutocomplete.tsx
|
|
55178
|
+
function extractSearchQuery(input, cursor) {
|
|
55179
|
+
const atPositions = [];
|
|
55180
|
+
for (let i = 0;i < input.length; i++) {
|
|
55181
|
+
if (input[i] === "@") {
|
|
55182
|
+
if (i === 0 || input[i - 1] === " ") {
|
|
55183
|
+
atPositions.push(i);
|
|
55184
|
+
}
|
|
55185
|
+
}
|
|
55186
|
+
}
|
|
55187
|
+
if (atPositions.length === 0)
|
|
55188
|
+
return null;
|
|
55189
|
+
let atIndex = -1;
|
|
55190
|
+
for (const pos of atPositions) {
|
|
55191
|
+
const afterAt2 = input.slice(pos + 1);
|
|
55192
|
+
const spaceIndex2 = afterAt2.indexOf(" ");
|
|
55193
|
+
const endPos = spaceIndex2 === -1 ? input.length : pos + 1 + spaceIndex2;
|
|
55194
|
+
if (cursor >= pos && cursor <= endPos) {
|
|
55195
|
+
atIndex = pos;
|
|
55196
|
+
break;
|
|
55197
|
+
}
|
|
55198
|
+
}
|
|
55199
|
+
if (atIndex === -1)
|
|
55200
|
+
return null;
|
|
55201
|
+
const afterAt = input.slice(atIndex + 1);
|
|
55202
|
+
const spaceIndex = afterAt.indexOf(" ");
|
|
55203
|
+
const query = spaceIndex === -1 ? afterAt : afterAt.slice(0, spaceIndex);
|
|
55204
|
+
const hasSpaceAfter = spaceIndex !== -1;
|
|
55205
|
+
return { query, hasSpaceAfter, atIndex };
|
|
55206
|
+
}
|
|
55207
|
+
function FileAutocomplete({
|
|
55208
|
+
currentInput,
|
|
55209
|
+
cursorPosition = currentInput.length,
|
|
55210
|
+
onSelect,
|
|
55211
|
+
onActiveChange
|
|
55212
|
+
}) {
|
|
55213
|
+
const [matches, setMatches] = import_react37.useState([]);
|
|
55214
|
+
const [isLoading, setIsLoading] = import_react37.useState(false);
|
|
55215
|
+
const [lastValidQuery, setLastValidQuery] = import_react37.useState("");
|
|
55216
|
+
const debounceTimeout = import_react37.useRef(null);
|
|
55217
|
+
const { selectedIndex } = useAutocompleteNavigation({
|
|
55218
|
+
matches,
|
|
55219
|
+
maxVisible: 10,
|
|
55220
|
+
onSelect: onSelect ? (item) => onSelect(item.path) : undefined,
|
|
55221
|
+
manageActiveState: false,
|
|
55222
|
+
disabled: isLoading
|
|
55223
|
+
});
|
|
55224
|
+
import_react37.useEffect(() => {
|
|
55327
55225
|
if (debounceTimeout.current) {
|
|
55328
55226
|
clearTimeout(debounceTimeout.current);
|
|
55329
55227
|
}
|
|
55330
55228
|
const result = extractSearchQuery(currentInput, cursorPosition);
|
|
55331
55229
|
if (!result) {
|
|
55332
55230
|
setMatches([]);
|
|
55333
|
-
setSelectedIndex(0);
|
|
55334
55231
|
onActiveChange?.(false);
|
|
55335
55232
|
return;
|
|
55336
55233
|
}
|
|
@@ -55340,20 +55237,17 @@ function FileAutocomplete({
|
|
|
55340
55237
|
const afterSpace = currentInput.slice(atIndex + 1 + query.length + 1);
|
|
55341
55238
|
if (afterSpace.trim().length > 0 || afterSpace.includes("@")) {
|
|
55342
55239
|
setMatches([]);
|
|
55343
|
-
setSelectedIndex(0);
|
|
55344
55240
|
onActiveChange?.(false);
|
|
55345
55241
|
return;
|
|
55346
55242
|
}
|
|
55347
55243
|
if (query === lastValidQuery && lastValidQuery.length > 0) {
|
|
55348
55244
|
if (matches[0]?.path !== query) {
|
|
55349
55245
|
setMatches([{ path: query, type: "file" }]);
|
|
55350
|
-
setSelectedIndex(0);
|
|
55351
55246
|
}
|
|
55352
55247
|
onActiveChange?.(false);
|
|
55353
55248
|
return;
|
|
55354
55249
|
}
|
|
55355
55250
|
setMatches([]);
|
|
55356
|
-
setSelectedIndex(0);
|
|
55357
55251
|
onActiveChange?.(false);
|
|
55358
55252
|
return;
|
|
55359
55253
|
}
|
|
@@ -55362,12 +55256,10 @@ function FileAutocomplete({
|
|
|
55362
55256
|
onActiveChange?.(true);
|
|
55363
55257
|
searchFiles("", false).then((results) => {
|
|
55364
55258
|
setMatches(results);
|
|
55365
|
-
setSelectedIndex(0);
|
|
55366
55259
|
setIsLoading(false);
|
|
55367
55260
|
onActiveChange?.(results.length > 0);
|
|
55368
55261
|
}).catch(() => {
|
|
55369
55262
|
setMatches([]);
|
|
55370
|
-
setSelectedIndex(0);
|
|
55371
55263
|
setIsLoading(false);
|
|
55372
55264
|
onActiveChange?.(false);
|
|
55373
55265
|
});
|
|
@@ -55375,7 +55267,6 @@ function FileAutocomplete({
|
|
|
55375
55267
|
}
|
|
55376
55268
|
if (query.startsWith("http://") || query.startsWith("https://")) {
|
|
55377
55269
|
setMatches([{ path: query, type: "url" }]);
|
|
55378
|
-
setSelectedIndex(0);
|
|
55379
55270
|
onActiveChange?.(true);
|
|
55380
55271
|
return;
|
|
55381
55272
|
}
|
|
@@ -55384,7 +55275,6 @@ function FileAutocomplete({
|
|
|
55384
55275
|
debounceTimeout.current = setTimeout(() => {
|
|
55385
55276
|
searchFiles(query, true).then((results) => {
|
|
55386
55277
|
setMatches(results);
|
|
55387
|
-
setSelectedIndex(0);
|
|
55388
55278
|
setIsLoading(false);
|
|
55389
55279
|
onActiveChange?.(results.length > 0);
|
|
55390
55280
|
if (results.length > 0) {
|
|
@@ -55392,7 +55282,6 @@ function FileAutocomplete({
|
|
|
55392
55282
|
}
|
|
55393
55283
|
}).catch(() => {
|
|
55394
55284
|
setMatches([]);
|
|
55395
|
-
setSelectedIndex(0);
|
|
55396
55285
|
setIsLoading(false);
|
|
55397
55286
|
onActiveChange?.(false);
|
|
55398
55287
|
});
|
|
@@ -55406,7 +55295,6 @@ function FileAutocomplete({
|
|
|
55406
55295
|
currentInput,
|
|
55407
55296
|
cursorPosition,
|
|
55408
55297
|
onActiveChange,
|
|
55409
|
-
extractSearchQuery,
|
|
55410
55298
|
lastValidQuery,
|
|
55411
55299
|
matches[0]?.path
|
|
55412
55300
|
]);
|
|
@@ -55432,22 +55320,17 @@ function FileAutocomplete({
|
|
|
55432
55320
|
}, undefined, true, undefined, this),
|
|
55433
55321
|
matches.length > 0 ? /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(jsx_dev_runtime14.Fragment, {
|
|
55434
55322
|
children: [
|
|
55435
|
-
matches.slice(0, 10).map((item, idx) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(
|
|
55436
|
-
|
|
55437
|
-
|
|
55323
|
+
matches.slice(0, 10).map((item, idx) => /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
55324
|
+
color: idx === selectedIndex ? colors.command.selected : undefined,
|
|
55325
|
+
bold: idx === selectedIndex,
|
|
55438
55326
|
children: [
|
|
55327
|
+
idx === selectedIndex ? "▶ " : " ",
|
|
55439
55328
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
55440
|
-
color: idx
|
|
55441
|
-
|
|
55442
|
-
|
|
55443
|
-
|
|
55444
|
-
|
|
55445
|
-
]
|
|
55446
|
-
}, undefined, true, undefined, this),
|
|
55447
|
-
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
55448
|
-
bold: idx === selectedIndex,
|
|
55449
|
-
children: item.path
|
|
55450
|
-
}, undefined, false, undefined, this)
|
|
55329
|
+
color: idx !== selectedIndex && item.type === "dir" ? colors.status.processing : undefined,
|
|
55330
|
+
children: item.type === "dir" ? "\uD83D\uDCC1" : item.type === "url" ? "\uD83D\uDD17" : "\uD83D\uDCC4"
|
|
55331
|
+
}, undefined, false, undefined, this),
|
|
55332
|
+
" ",
|
|
55333
|
+
item.path
|
|
55451
55334
|
]
|
|
55452
55335
|
}, item.path, true, undefined, this)),
|
|
55453
55336
|
matches.length > 10 && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
@@ -55466,27 +55349,292 @@ function FileAutocomplete({
|
|
|
55466
55349
|
]
|
|
55467
55350
|
}, undefined, true, undefined, this);
|
|
55468
55351
|
}
|
|
55469
|
-
var
|
|
55352
|
+
var import_react37, jsx_dev_runtime14;
|
|
55470
55353
|
var init_FileAutocomplete = __esm(async () => {
|
|
55471
55354
|
init_fileSearch();
|
|
55472
55355
|
init_colors();
|
|
55473
|
-
await
|
|
55474
|
-
|
|
55356
|
+
await __promiseAll([
|
|
55357
|
+
init_build2(),
|
|
55358
|
+
init_useAutocompleteNavigation()
|
|
55359
|
+
]);
|
|
55360
|
+
import_react37 = __toESM(require_react(), 1);
|
|
55475
55361
|
jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55476
55362
|
});
|
|
55477
55363
|
|
|
55364
|
+
// src/cli/commands/registry.ts
|
|
55365
|
+
var exports_registry = {};
|
|
55366
|
+
__export(exports_registry, {
|
|
55367
|
+
executeCommand: () => executeCommand,
|
|
55368
|
+
commands: () => commands
|
|
55369
|
+
});
|
|
55370
|
+
async function executeCommand(input) {
|
|
55371
|
+
const [command, ...args] = input.trim().split(/\s+/);
|
|
55372
|
+
if (!command) {
|
|
55373
|
+
return {
|
|
55374
|
+
success: false,
|
|
55375
|
+
output: "No command found"
|
|
55376
|
+
};
|
|
55377
|
+
}
|
|
55378
|
+
const handler = commands[command];
|
|
55379
|
+
if (!handler) {
|
|
55380
|
+
return {
|
|
55381
|
+
success: false,
|
|
55382
|
+
output: `Unknown command: ${command}`
|
|
55383
|
+
};
|
|
55384
|
+
}
|
|
55385
|
+
try {
|
|
55386
|
+
const output = await handler.handler(args);
|
|
55387
|
+
return { success: true, output };
|
|
55388
|
+
} catch (error) {
|
|
55389
|
+
return {
|
|
55390
|
+
success: false,
|
|
55391
|
+
output: `Error executing ${command}: ${error instanceof Error ? error.message : String(error)}`
|
|
55392
|
+
};
|
|
55393
|
+
}
|
|
55394
|
+
}
|
|
55395
|
+
var commands;
|
|
55396
|
+
var init_registry = __esm(() => {
|
|
55397
|
+
commands = {
|
|
55398
|
+
"/model": {
|
|
55399
|
+
desc: "Switch model",
|
|
55400
|
+
handler: () => {
|
|
55401
|
+
return "Opening model selector...";
|
|
55402
|
+
}
|
|
55403
|
+
},
|
|
55404
|
+
"/stream": {
|
|
55405
|
+
desc: "Toggle token streaming on/off",
|
|
55406
|
+
handler: () => {
|
|
55407
|
+
return "Toggling token streaming...";
|
|
55408
|
+
}
|
|
55409
|
+
},
|
|
55410
|
+
"/exit": {
|
|
55411
|
+
desc: "Exit and show session stats",
|
|
55412
|
+
handler: () => {
|
|
55413
|
+
return "Exiting...";
|
|
55414
|
+
}
|
|
55415
|
+
},
|
|
55416
|
+
"/clear": {
|
|
55417
|
+
desc: "Clear conversation history",
|
|
55418
|
+
handler: () => {
|
|
55419
|
+
return "Clearing messages...";
|
|
55420
|
+
}
|
|
55421
|
+
},
|
|
55422
|
+
"/logout": {
|
|
55423
|
+
desc: "Clear credentials and exit",
|
|
55424
|
+
handler: () => {
|
|
55425
|
+
return "Clearing credentials...";
|
|
55426
|
+
}
|
|
55427
|
+
},
|
|
55428
|
+
"/link": {
|
|
55429
|
+
desc: "Attach Letta Code tools to current agent",
|
|
55430
|
+
handler: () => {
|
|
55431
|
+
return "Attaching tools...";
|
|
55432
|
+
}
|
|
55433
|
+
},
|
|
55434
|
+
"/unlink": {
|
|
55435
|
+
desc: "Remove Letta Code tools from current agent",
|
|
55436
|
+
handler: () => {
|
|
55437
|
+
return "Removing tools...";
|
|
55438
|
+
}
|
|
55439
|
+
},
|
|
55440
|
+
"/rename": {
|
|
55441
|
+
desc: "Rename the current agent",
|
|
55442
|
+
handler: () => {
|
|
55443
|
+
return "Renaming agent...";
|
|
55444
|
+
}
|
|
55445
|
+
},
|
|
55446
|
+
"/description": {
|
|
55447
|
+
desc: "Update the current agent's description",
|
|
55448
|
+
handler: () => {
|
|
55449
|
+
return "Updating description...";
|
|
55450
|
+
}
|
|
55451
|
+
},
|
|
55452
|
+
"/toolset": {
|
|
55453
|
+
desc: "Switch toolset",
|
|
55454
|
+
handler: () => {
|
|
55455
|
+
return "Opening toolset selector...";
|
|
55456
|
+
}
|
|
55457
|
+
},
|
|
55458
|
+
"/system": {
|
|
55459
|
+
desc: "Switch system prompt",
|
|
55460
|
+
handler: () => {
|
|
55461
|
+
return "Opening system prompt selector...";
|
|
55462
|
+
}
|
|
55463
|
+
},
|
|
55464
|
+
"/download": {
|
|
55465
|
+
desc: "Download AgentFile (.af)",
|
|
55466
|
+
handler: () => {
|
|
55467
|
+
return "Downloading agent file...";
|
|
55468
|
+
}
|
|
55469
|
+
},
|
|
55470
|
+
"/bashes": {
|
|
55471
|
+
desc: "Show background shell processes",
|
|
55472
|
+
handler: () => {
|
|
55473
|
+
return "Showing background processes...";
|
|
55474
|
+
}
|
|
55475
|
+
},
|
|
55476
|
+
"/init": {
|
|
55477
|
+
desc: "Initialize agent memory for this project",
|
|
55478
|
+
handler: () => {
|
|
55479
|
+
return "Initializing memory...";
|
|
55480
|
+
}
|
|
55481
|
+
},
|
|
55482
|
+
"/skill": {
|
|
55483
|
+
desc: "Enter skill creation mode (optionally: /skill <description>)",
|
|
55484
|
+
handler: () => {
|
|
55485
|
+
return "Starting skill creation...";
|
|
55486
|
+
}
|
|
55487
|
+
},
|
|
55488
|
+
"/remember": {
|
|
55489
|
+
desc: "Remember something from the conversation",
|
|
55490
|
+
handler: () => {
|
|
55491
|
+
return "Processing memory request...";
|
|
55492
|
+
}
|
|
55493
|
+
},
|
|
55494
|
+
"/resume": {
|
|
55495
|
+
desc: "Browse and switch to another agent",
|
|
55496
|
+
handler: () => {
|
|
55497
|
+
return "Opening agent selector...";
|
|
55498
|
+
}
|
|
55499
|
+
},
|
|
55500
|
+
"/search": {
|
|
55501
|
+
desc: "Search messages across all agents",
|
|
55502
|
+
handler: () => {
|
|
55503
|
+
return "Opening message search...";
|
|
55504
|
+
}
|
|
55505
|
+
},
|
|
55506
|
+
"/pin": {
|
|
55507
|
+
desc: "Pin current agent globally (use -l for local only)",
|
|
55508
|
+
handler: () => {
|
|
55509
|
+
return "Pinning agent...";
|
|
55510
|
+
}
|
|
55511
|
+
},
|
|
55512
|
+
"/unpin": {
|
|
55513
|
+
desc: "Unpin current agent globally (use -l for local only)",
|
|
55514
|
+
handler: () => {
|
|
55515
|
+
return "Unpinning agent...";
|
|
55516
|
+
}
|
|
55517
|
+
},
|
|
55518
|
+
"/pinned": {
|
|
55519
|
+
desc: "Show pinned agents",
|
|
55520
|
+
handler: () => {
|
|
55521
|
+
return "Opening pinned agents...";
|
|
55522
|
+
}
|
|
55523
|
+
}
|
|
55524
|
+
};
|
|
55525
|
+
});
|
|
55526
|
+
|
|
55527
|
+
// src/cli/components/SlashCommandAutocomplete.tsx
|
|
55528
|
+
function extractSearchQuery2(input, cursor) {
|
|
55529
|
+
if (!input.startsWith("/"))
|
|
55530
|
+
return null;
|
|
55531
|
+
const afterSlash = input.slice(1);
|
|
55532
|
+
const spaceIndex = afterSlash.indexOf(" ");
|
|
55533
|
+
const endPos = spaceIndex === -1 ? input.length : 1 + spaceIndex;
|
|
55534
|
+
if (cursor < 0 || cursor > endPos) {
|
|
55535
|
+
return null;
|
|
55536
|
+
}
|
|
55537
|
+
const query = spaceIndex === -1 ? afterSlash : afterSlash.slice(0, spaceIndex);
|
|
55538
|
+
const hasSpaceAfter = spaceIndex !== -1;
|
|
55539
|
+
return { query, hasSpaceAfter };
|
|
55540
|
+
}
|
|
55541
|
+
function SlashCommandAutocomplete({
|
|
55542
|
+
currentInput,
|
|
55543
|
+
cursorPosition = currentInput.length,
|
|
55544
|
+
onSelect,
|
|
55545
|
+
onActiveChange
|
|
55546
|
+
}) {
|
|
55547
|
+
const [matches, setMatches] = import_react38.useState([]);
|
|
55548
|
+
const { selectedIndex } = useAutocompleteNavigation({
|
|
55549
|
+
matches,
|
|
55550
|
+
onSelect: onSelect ? (item) => onSelect(item.cmd) : undefined,
|
|
55551
|
+
onActiveChange
|
|
55552
|
+
});
|
|
55553
|
+
import_react38.useEffect(() => {
|
|
55554
|
+
const result = extractSearchQuery2(currentInput, cursorPosition);
|
|
55555
|
+
if (!result) {
|
|
55556
|
+
setMatches([]);
|
|
55557
|
+
return;
|
|
55558
|
+
}
|
|
55559
|
+
const { query, hasSpaceAfter } = result;
|
|
55560
|
+
if (hasSpaceAfter) {
|
|
55561
|
+
setMatches([]);
|
|
55562
|
+
return;
|
|
55563
|
+
}
|
|
55564
|
+
let newMatches;
|
|
55565
|
+
if (query.length === 0) {
|
|
55566
|
+
newMatches = allCommands;
|
|
55567
|
+
} else {
|
|
55568
|
+
const lowerQuery = query.toLowerCase();
|
|
55569
|
+
newMatches = allCommands.filter((item) => {
|
|
55570
|
+
const cmdName = item.cmd.slice(1).toLowerCase();
|
|
55571
|
+
return cmdName.includes(lowerQuery);
|
|
55572
|
+
});
|
|
55573
|
+
}
|
|
55574
|
+
setMatches(newMatches);
|
|
55575
|
+
}, [currentInput, cursorPosition]);
|
|
55576
|
+
if (!currentInput.startsWith("/")) {
|
|
55577
|
+
return null;
|
|
55578
|
+
}
|
|
55579
|
+
if (matches.length === 0) {
|
|
55580
|
+
return null;
|
|
55581
|
+
}
|
|
55582
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
55583
|
+
flexDirection: "column",
|
|
55584
|
+
borderStyle: "round",
|
|
55585
|
+
borderColor: colors.command.border,
|
|
55586
|
+
paddingX: 1,
|
|
55587
|
+
marginBottom: 1,
|
|
55588
|
+
children: [
|
|
55589
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
55590
|
+
dimColor: true,
|
|
55591
|
+
children: "↑↓ navigate, Tab/Enter select"
|
|
55592
|
+
}, undefined, false, undefined, this),
|
|
55593
|
+
matches.map((item, idx) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
55594
|
+
color: idx === selectedIndex ? colors.command.selected : undefined,
|
|
55595
|
+
bold: idx === selectedIndex,
|
|
55596
|
+
children: [
|
|
55597
|
+
idx === selectedIndex ? "▶ " : " ",
|
|
55598
|
+
item.cmd.padEnd(14),
|
|
55599
|
+
" ",
|
|
55600
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
55601
|
+
dimColor: idx !== selectedIndex,
|
|
55602
|
+
children: item.desc
|
|
55603
|
+
}, undefined, false, undefined, this)
|
|
55604
|
+
]
|
|
55605
|
+
}, item.cmd, true, undefined, this))
|
|
55606
|
+
]
|
|
55607
|
+
}, undefined, true, undefined, this);
|
|
55608
|
+
}
|
|
55609
|
+
var import_react38, jsx_dev_runtime15, allCommands;
|
|
55610
|
+
var init_SlashCommandAutocomplete = __esm(async () => {
|
|
55611
|
+
init_registry();
|
|
55612
|
+
init_colors();
|
|
55613
|
+
await __promiseAll([
|
|
55614
|
+
init_build2(),
|
|
55615
|
+
init_useAutocompleteNavigation()
|
|
55616
|
+
]);
|
|
55617
|
+
import_react38 = __toESM(require_react(), 1);
|
|
55618
|
+
jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55619
|
+
allCommands = Object.entries(commands).filter(([, { hidden }]) => !hidden).map(([cmd, { desc }]) => ({
|
|
55620
|
+
cmd,
|
|
55621
|
+
desc
|
|
55622
|
+
})).sort((a, b) => a.cmd.localeCompare(b.cmd));
|
|
55623
|
+
});
|
|
55624
|
+
|
|
55478
55625
|
// src/cli/components/InputAssist.tsx
|
|
55479
55626
|
function InputAssist({
|
|
55480
55627
|
currentInput,
|
|
55481
55628
|
cursorPosition,
|
|
55482
55629
|
onFileSelect,
|
|
55630
|
+
onCommandSelect,
|
|
55483
55631
|
onAutocompleteActiveChange,
|
|
55484
55632
|
agentId,
|
|
55485
55633
|
agentName,
|
|
55486
55634
|
serverUrl
|
|
55487
55635
|
}) {
|
|
55488
55636
|
if (currentInput.includes("@")) {
|
|
55489
|
-
return /* @__PURE__ */
|
|
55637
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(FileAutocomplete, {
|
|
55490
55638
|
currentInput,
|
|
55491
55639
|
cursorPosition,
|
|
55492
55640
|
onSelect: onFileSelect,
|
|
@@ -55494,66 +55642,78 @@ function InputAssist({
|
|
|
55494
55642
|
}, undefined, false, undefined, this);
|
|
55495
55643
|
}
|
|
55496
55644
|
if (currentInput.startsWith("/")) {
|
|
55497
|
-
return /* @__PURE__ */
|
|
55498
|
-
|
|
55499
|
-
|
|
55500
|
-
|
|
55501
|
-
|
|
55502
|
-
|
|
55645
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV(Box_default, {
|
|
55646
|
+
flexDirection: "column",
|
|
55647
|
+
children: [
|
|
55648
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(SlashCommandAutocomplete, {
|
|
55649
|
+
currentInput,
|
|
55650
|
+
cursorPosition,
|
|
55651
|
+
onSelect: onCommandSelect,
|
|
55652
|
+
onActiveChange: onAutocompleteActiveChange
|
|
55653
|
+
}, undefined, false, undefined, this),
|
|
55654
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV(AgentInfoBar, {
|
|
55655
|
+
agentId,
|
|
55656
|
+
agentName,
|
|
55657
|
+
serverUrl
|
|
55658
|
+
}, undefined, false, undefined, this)
|
|
55659
|
+
]
|
|
55660
|
+
}, undefined, true, undefined, this);
|
|
55503
55661
|
}
|
|
55504
55662
|
return null;
|
|
55505
55663
|
}
|
|
55506
|
-
var
|
|
55664
|
+
var jsx_dev_runtime16;
|
|
55507
55665
|
var init_InputAssist = __esm(async () => {
|
|
55508
55666
|
await __promiseAll([
|
|
55509
|
-
|
|
55510
|
-
|
|
55667
|
+
init_build2(),
|
|
55668
|
+
init_AgentInfoBar(),
|
|
55669
|
+
init_FileAutocomplete(),
|
|
55670
|
+
init_SlashCommandAutocomplete()
|
|
55511
55671
|
]);
|
|
55512
|
-
|
|
55672
|
+
jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55513
55673
|
});
|
|
55514
55674
|
|
|
55515
55675
|
// src/cli/components/QueuedMessages.tsx
|
|
55516
|
-
var
|
|
55676
|
+
var import_react39, jsx_dev_runtime17, QueuedMessages;
|
|
55517
55677
|
var init_QueuedMessages = __esm(async () => {
|
|
55518
55678
|
await init_build2();
|
|
55519
|
-
|
|
55520
|
-
|
|
55521
|
-
QueuedMessages =
|
|
55679
|
+
import_react39 = __toESM(require_react(), 1);
|
|
55680
|
+
jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55681
|
+
QueuedMessages = import_react39.memo(({ messages }) => {
|
|
55522
55682
|
const maxDisplay = 5;
|
|
55523
|
-
return /* @__PURE__ */
|
|
55683
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55524
55684
|
flexDirection: "column",
|
|
55525
55685
|
marginBottom: 1,
|
|
55526
55686
|
children: [
|
|
55527
|
-
messages.slice(0, maxDisplay).map((msg, index) => /* @__PURE__ */
|
|
55687
|
+
messages.slice(0, maxDisplay).map((msg, index) => /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55528
55688
|
flexDirection: "row",
|
|
55529
55689
|
children: [
|
|
55530
|
-
/* @__PURE__ */
|
|
55690
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55531
55691
|
width: 2,
|
|
55532
55692
|
flexShrink: 0,
|
|
55533
|
-
children: /* @__PURE__ */
|
|
55693
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
55534
55694
|
dimColor: true,
|
|
55535
55695
|
children: ">"
|
|
55536
55696
|
}, undefined, false, undefined, this)
|
|
55537
55697
|
}, undefined, false, undefined, this),
|
|
55538
|
-
/* @__PURE__ */
|
|
55698
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55539
55699
|
flexGrow: 1,
|
|
55540
|
-
children: /* @__PURE__ */
|
|
55700
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
55541
55701
|
dimColor: true,
|
|
55542
55702
|
children: msg
|
|
55543
55703
|
}, undefined, false, undefined, this)
|
|
55544
55704
|
}, undefined, false, undefined, this)
|
|
55545
55705
|
]
|
|
55546
55706
|
}, `${index}-${msg.slice(0, 50)}`, true, undefined, this)),
|
|
55547
|
-
messages.length > maxDisplay && /* @__PURE__ */
|
|
55707
|
+
messages.length > maxDisplay && /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55548
55708
|
flexDirection: "row",
|
|
55549
55709
|
children: [
|
|
55550
|
-
/* @__PURE__ */
|
|
55710
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55551
55711
|
width: 2,
|
|
55552
55712
|
flexShrink: 0
|
|
55553
55713
|
}, undefined, false, undefined, this),
|
|
55554
|
-
/* @__PURE__ */
|
|
55714
|
+
/* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
|
|
55555
55715
|
flexGrow: 1,
|
|
55556
|
-
children: /* @__PURE__ */
|
|
55716
|
+
children: /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Text, {
|
|
55557
55717
|
dimColor: true,
|
|
55558
55718
|
children: [
|
|
55559
55719
|
"...and ",
|
|
@@ -55571,7 +55731,7 @@ var init_QueuedMessages = __esm(async () => {
|
|
|
55571
55731
|
});
|
|
55572
55732
|
|
|
55573
55733
|
// src/cli/components/ShimmerText.tsx
|
|
55574
|
-
var
|
|
55734
|
+
var jsx_dev_runtime18, ShimmerText = ({
|
|
55575
55735
|
color = colors.status.processing,
|
|
55576
55736
|
message,
|
|
55577
55737
|
shimmerOffset
|
|
@@ -55584,7 +55744,7 @@ var jsx_dev_runtime17, ShimmerText = ({
|
|
|
55584
55744
|
}
|
|
55585
55745
|
return source_default.hex(color)(char);
|
|
55586
55746
|
}).join("");
|
|
55587
|
-
return /* @__PURE__ */
|
|
55747
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
|
|
55588
55748
|
children: shimmerText
|
|
55589
55749
|
}, undefined, false, undefined, this);
|
|
55590
55750
|
};
|
|
@@ -55592,7 +55752,7 @@ var init_ShimmerText = __esm(async () => {
|
|
|
55592
55752
|
init_source();
|
|
55593
55753
|
init_colors();
|
|
55594
55754
|
await init_build2();
|
|
55595
|
-
|
|
55755
|
+
jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
55596
55756
|
});
|
|
55597
55757
|
|
|
55598
55758
|
// src/cli/components/InputRich.tsx
|
|
@@ -55614,28 +55774,28 @@ function Input({
|
|
|
55614
55774
|
onEnterQueueEditMode,
|
|
55615
55775
|
onEscapeCancel
|
|
55616
55776
|
}) {
|
|
55617
|
-
const [value, setValue] =
|
|
55618
|
-
const [escapePressed, setEscapePressed] =
|
|
55619
|
-
const escapeTimerRef =
|
|
55620
|
-
const [ctrlCPressed, setCtrlCPressed] =
|
|
55621
|
-
const ctrlCTimerRef =
|
|
55622
|
-
const previousValueRef =
|
|
55623
|
-
const [currentMode, setCurrentMode] =
|
|
55624
|
-
const [isAutocompleteActive, setIsAutocompleteActive] =
|
|
55625
|
-
const [cursorPos, setCursorPos] =
|
|
55626
|
-
const [currentCursorPosition, setCurrentCursorPosition] =
|
|
55627
|
-
const [history, setHistory] =
|
|
55628
|
-
const [historyIndex, setHistoryIndex] =
|
|
55629
|
-
const [temporaryInput, setTemporaryInput] =
|
|
55630
|
-
const [atStartBoundary, setAtStartBoundary] =
|
|
55631
|
-
const [atEndBoundary, setAtEndBoundary] =
|
|
55632
|
-
|
|
55777
|
+
const [value, setValue] = import_react40.useState("");
|
|
55778
|
+
const [escapePressed, setEscapePressed] = import_react40.useState(false);
|
|
55779
|
+
const escapeTimerRef = import_react40.useRef(null);
|
|
55780
|
+
const [ctrlCPressed, setCtrlCPressed] = import_react40.useState(false);
|
|
55781
|
+
const ctrlCTimerRef = import_react40.useRef(null);
|
|
55782
|
+
const previousValueRef = import_react40.useRef(value);
|
|
55783
|
+
const [currentMode, setCurrentMode] = import_react40.useState(externalMode || permissionMode2.getMode());
|
|
55784
|
+
const [isAutocompleteActive, setIsAutocompleteActive] = import_react40.useState(false);
|
|
55785
|
+
const [cursorPos, setCursorPos] = import_react40.useState(undefined);
|
|
55786
|
+
const [currentCursorPosition, setCurrentCursorPosition] = import_react40.useState(0);
|
|
55787
|
+
const [history, setHistory] = import_react40.useState([]);
|
|
55788
|
+
const [historyIndex, setHistoryIndex] = import_react40.useState(-1);
|
|
55789
|
+
const [temporaryInput, setTemporaryInput] = import_react40.useState("");
|
|
55790
|
+
const [atStartBoundary, setAtStartBoundary] = import_react40.useState(false);
|
|
55791
|
+
const [atEndBoundary, setAtEndBoundary] = import_react40.useState(false);
|
|
55792
|
+
import_react40.useEffect(() => {
|
|
55633
55793
|
if (cursorPos !== undefined) {
|
|
55634
55794
|
const timer = setTimeout(() => setCursorPos(undefined), 0);
|
|
55635
55795
|
return () => clearTimeout(timer);
|
|
55636
55796
|
}
|
|
55637
55797
|
}, [cursorPos]);
|
|
55638
|
-
|
|
55798
|
+
import_react40.useEffect(() => {
|
|
55639
55799
|
if (currentCursorPosition !== 0) {
|
|
55640
55800
|
setAtStartBoundary(false);
|
|
55641
55801
|
}
|
|
@@ -55643,12 +55803,12 @@ function Input({
|
|
|
55643
55803
|
setAtEndBoundary(false);
|
|
55644
55804
|
}
|
|
55645
55805
|
}, [currentCursorPosition, value.length]);
|
|
55646
|
-
|
|
55806
|
+
import_react40.useEffect(() => {
|
|
55647
55807
|
if (externalMode !== undefined) {
|
|
55648
55808
|
setCurrentMode(externalMode);
|
|
55649
55809
|
}
|
|
55650
55810
|
}, [externalMode]);
|
|
55651
|
-
const [shimmerOffset, setShimmerOffset] =
|
|
55811
|
+
const [shimmerOffset, setShimmerOffset] = import_react40.useState(-3);
|
|
55652
55812
|
const columns = useTerminalWidth();
|
|
55653
55813
|
const contentWidth = Math.max(0, columns - 2);
|
|
55654
55814
|
const settings = settingsManager.getSettings();
|
|
@@ -55814,7 +55974,7 @@ function Input({
|
|
|
55814
55974
|
}
|
|
55815
55975
|
}
|
|
55816
55976
|
});
|
|
55817
|
-
|
|
55977
|
+
import_react40.useEffect(() => {
|
|
55818
55978
|
if (value !== previousValueRef.current && value !== "") {
|
|
55819
55979
|
setEscapePressed(false);
|
|
55820
55980
|
if (escapeTimerRef.current)
|
|
@@ -55829,13 +55989,13 @@ function Input({
|
|
|
55829
55989
|
}
|
|
55830
55990
|
previousValueRef.current = value;
|
|
55831
55991
|
}, [value]);
|
|
55832
|
-
|
|
55992
|
+
import_react40.useEffect(() => {
|
|
55833
55993
|
if (historyIndex !== -1 && value !== history[historyIndex]) {
|
|
55834
55994
|
setHistoryIndex(-1);
|
|
55835
55995
|
setTemporaryInput("");
|
|
55836
55996
|
}
|
|
55837
55997
|
}, [value, historyIndex, history]);
|
|
55838
|
-
|
|
55998
|
+
import_react40.useEffect(() => {
|
|
55839
55999
|
return () => {
|
|
55840
56000
|
if (escapeTimerRef.current)
|
|
55841
56001
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -55843,7 +56003,7 @@ function Input({
|
|
|
55843
56003
|
clearTimeout(ctrlCTimerRef.current);
|
|
55844
56004
|
};
|
|
55845
56005
|
}, []);
|
|
55846
|
-
|
|
56006
|
+
import_react40.useEffect(() => {
|
|
55847
56007
|
if (!streaming || !visible)
|
|
55848
56008
|
return;
|
|
55849
56009
|
const id = setInterval(() => {
|
|
@@ -55891,6 +56051,26 @@ function Input({
|
|
|
55891
56051
|
setValue(newValue);
|
|
55892
56052
|
setCursorPos(newCursorPos);
|
|
55893
56053
|
};
|
|
56054
|
+
const handleCommandSelect = (selectedCommand) => {
|
|
56055
|
+
const slashIndex = value.indexOf("/");
|
|
56056
|
+
if (slashIndex === -1)
|
|
56057
|
+
return;
|
|
56058
|
+
const beforeSlash = value.slice(0, slashIndex);
|
|
56059
|
+
const afterSlash = value.slice(slashIndex + 1);
|
|
56060
|
+
const spaceIndex = afterSlash.indexOf(" ");
|
|
56061
|
+
let newValue;
|
|
56062
|
+
let newCursorPos;
|
|
56063
|
+
if (spaceIndex === -1) {
|
|
56064
|
+
newValue = `${beforeSlash}${selectedCommand} `;
|
|
56065
|
+
newCursorPos = newValue.length;
|
|
56066
|
+
} else {
|
|
56067
|
+
const afterCommand = afterSlash.slice(spaceIndex);
|
|
56068
|
+
newValue = `${beforeSlash}${selectedCommand}${afterCommand}`;
|
|
56069
|
+
newCursorPos = beforeSlash.length + selectedCommand.length;
|
|
56070
|
+
}
|
|
56071
|
+
setValue(newValue);
|
|
56072
|
+
setCursorPos(newCursorPos);
|
|
56073
|
+
};
|
|
55894
56074
|
const getModeInfo = () => {
|
|
55895
56075
|
switch (currentMode) {
|
|
55896
56076
|
case "acceptEdits":
|
|
@@ -55912,31 +56092,31 @@ function Input({
|
|
|
55912
56092
|
if (!visible) {
|
|
55913
56093
|
return null;
|
|
55914
56094
|
}
|
|
55915
|
-
return /* @__PURE__ */
|
|
56095
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55916
56096
|
flexDirection: "column",
|
|
55917
56097
|
children: [
|
|
55918
|
-
streaming && /* @__PURE__ */
|
|
56098
|
+
streaming && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55919
56099
|
flexDirection: "row",
|
|
55920
56100
|
marginBottom: 1,
|
|
55921
56101
|
children: [
|
|
55922
|
-
/* @__PURE__ */
|
|
56102
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55923
56103
|
width: 2,
|
|
55924
56104
|
flexShrink: 0,
|
|
55925
|
-
children: /* @__PURE__ */
|
|
56105
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55926
56106
|
color: colors.status.processing,
|
|
55927
|
-
children: /* @__PURE__ */
|
|
56107
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Spinner2, {
|
|
55928
56108
|
type: "layer"
|
|
55929
56109
|
}, undefined, false, undefined, this)
|
|
55930
56110
|
}, undefined, false, undefined, this)
|
|
55931
56111
|
}, undefined, false, undefined, this),
|
|
55932
|
-
/* @__PURE__ */
|
|
56112
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55933
56113
|
flexGrow: 1,
|
|
55934
56114
|
children: [
|
|
55935
|
-
/* @__PURE__ */
|
|
56115
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ShimmerText, {
|
|
55936
56116
|
message: thinkingMessage,
|
|
55937
56117
|
shimmerOffset
|
|
55938
56118
|
}, undefined, false, undefined, this),
|
|
55939
|
-
/* @__PURE__ */
|
|
56119
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55940
56120
|
dimColor: true,
|
|
55941
56121
|
children: [
|
|
55942
56122
|
" (",
|
|
@@ -55949,36 +56129,36 @@ function Input({
|
|
|
55949
56129
|
}, undefined, true, undefined, this)
|
|
55950
56130
|
]
|
|
55951
56131
|
}, undefined, true, undefined, this),
|
|
55952
|
-
streaming && messageQueue && messageQueue.length > 0 && /* @__PURE__ */
|
|
56132
|
+
streaming && messageQueue && messageQueue.length > 0 && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(QueuedMessages, {
|
|
55953
56133
|
messages: messageQueue
|
|
55954
56134
|
}, undefined, false, undefined, this),
|
|
55955
|
-
/* @__PURE__ */
|
|
56135
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55956
56136
|
flexDirection: "column",
|
|
55957
56137
|
children: [
|
|
55958
|
-
/* @__PURE__ */
|
|
56138
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55959
56139
|
dimColor: true,
|
|
55960
56140
|
children: horizontalLine
|
|
55961
56141
|
}, undefined, false, undefined, this),
|
|
55962
|
-
/* @__PURE__ */
|
|
56142
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55963
56143
|
flexDirection: "row",
|
|
55964
56144
|
children: [
|
|
55965
|
-
/* @__PURE__ */
|
|
56145
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55966
56146
|
width: 2,
|
|
55967
56147
|
flexShrink: 0,
|
|
55968
56148
|
children: [
|
|
55969
|
-
/* @__PURE__ */
|
|
56149
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55970
56150
|
color: colors.input.prompt,
|
|
55971
56151
|
children: ">"
|
|
55972
56152
|
}, undefined, false, undefined, this),
|
|
55973
|
-
/* @__PURE__ */
|
|
56153
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55974
56154
|
children: " "
|
|
55975
56155
|
}, undefined, false, undefined, this)
|
|
55976
56156
|
]
|
|
55977
56157
|
}, undefined, true, undefined, this),
|
|
55978
|
-
/* @__PURE__ */
|
|
56158
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
55979
56159
|
flexGrow: 1,
|
|
55980
56160
|
width: contentWidth,
|
|
55981
|
-
children: /* @__PURE__ */
|
|
56161
|
+
children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(PasteAwareTextInput, {
|
|
55982
56162
|
value,
|
|
55983
56163
|
onChange: setValue,
|
|
55984
56164
|
onSubmit: handleSubmit,
|
|
@@ -55989,39 +56169,40 @@ function Input({
|
|
|
55989
56169
|
}, undefined, false, undefined, this)
|
|
55990
56170
|
]
|
|
55991
56171
|
}, undefined, true, undefined, this),
|
|
55992
|
-
/* @__PURE__ */
|
|
56172
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
55993
56173
|
dimColor: true,
|
|
55994
56174
|
children: horizontalLine
|
|
55995
56175
|
}, undefined, false, undefined, this),
|
|
55996
|
-
/* @__PURE__ */
|
|
56176
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(InputAssist, {
|
|
55997
56177
|
currentInput: value,
|
|
55998
56178
|
cursorPosition: currentCursorPosition,
|
|
55999
56179
|
onFileSelect: handleFileSelect,
|
|
56180
|
+
onCommandSelect: handleCommandSelect,
|
|
56000
56181
|
onAutocompleteActiveChange: setIsAutocompleteActive,
|
|
56001
56182
|
agentId,
|
|
56002
56183
|
agentName,
|
|
56003
56184
|
serverUrl
|
|
56004
56185
|
}, undefined, false, undefined, this),
|
|
56005
|
-
/* @__PURE__ */
|
|
56186
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
|
|
56006
56187
|
justifyContent: "space-between",
|
|
56007
56188
|
marginBottom: 1,
|
|
56008
56189
|
children: [
|
|
56009
|
-
ctrlCPressed ? /* @__PURE__ */
|
|
56190
|
+
ctrlCPressed ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56010
56191
|
dimColor: true,
|
|
56011
56192
|
children: "Press CTRL-C again to exit"
|
|
56012
|
-
}, undefined, false, undefined, this) : escapePressed ? /* @__PURE__ */
|
|
56193
|
+
}, undefined, false, undefined, this) : escapePressed ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56013
56194
|
dimColor: true,
|
|
56014
56195
|
children: "Press Esc again to clear"
|
|
56015
|
-
}, undefined, false, undefined, this) : modeInfo ? /* @__PURE__ */
|
|
56196
|
+
}, undefined, false, undefined, this) : modeInfo ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56016
56197
|
children: [
|
|
56017
|
-
/* @__PURE__ */
|
|
56198
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56018
56199
|
color: modeInfo.color,
|
|
56019
56200
|
children: [
|
|
56020
56201
|
"⏵⏵ ",
|
|
56021
56202
|
modeInfo.name
|
|
56022
56203
|
]
|
|
56023
56204
|
}, undefined, true, undefined, this),
|
|
56024
|
-
/* @__PURE__ */
|
|
56205
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56025
56206
|
color: modeInfo.color,
|
|
56026
56207
|
dimColor: true,
|
|
56027
56208
|
children: [
|
|
@@ -56030,11 +56211,11 @@ function Input({
|
|
|
56030
56211
|
]
|
|
56031
56212
|
}, undefined, true, undefined, this)
|
|
56032
56213
|
]
|
|
56033
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
56214
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56034
56215
|
dimColor: true,
|
|
56035
56216
|
children: "Press / for commands or @ for files"
|
|
56036
56217
|
}, undefined, false, undefined, this),
|
|
56037
|
-
/* @__PURE__ */
|
|
56218
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
|
|
56038
56219
|
dimColor: true,
|
|
56039
56220
|
children: `Letta Code v${appVersion} [${currentModel ?? "unknown"}]`
|
|
56040
56221
|
}, undefined, false, undefined, this)
|
|
@@ -56045,7 +56226,7 @@ function Input({
|
|
|
56045
56226
|
]
|
|
56046
56227
|
}, undefined, true, undefined, this);
|
|
56047
56228
|
}
|
|
56048
|
-
var
|
|
56229
|
+
var import_react40, jsx_dev_runtime19, Spinner2, appVersion, COUNTER_VISIBLE_THRESHOLD = 1000;
|
|
56049
56230
|
var init_InputRich = __esm(async () => {
|
|
56050
56231
|
init_oauth();
|
|
56051
56232
|
init_mode();
|
|
@@ -56061,8 +56242,8 @@ var init_InputRich = __esm(async () => {
|
|
|
56061
56242
|
init_QueuedMessages(),
|
|
56062
56243
|
init_ShimmerText()
|
|
56063
56244
|
]);
|
|
56064
|
-
|
|
56065
|
-
|
|
56245
|
+
import_react40 = __toESM(require_react(), 1);
|
|
56246
|
+
jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
|
|
56066
56247
|
Spinner2 = build_default2;
|
|
56067
56248
|
appVersion = getVersion();
|
|
56068
56249
|
});
|
|
@@ -56125,16 +56306,16 @@ function getMessageText(msg) {
|
|
|
56125
56306
|
}
|
|
56126
56307
|
function MessageSearch({ onClose }) {
|
|
56127
56308
|
const terminalWidth = useTerminalWidth();
|
|
56128
|
-
const [searchInput, setSearchInput] =
|
|
56129
|
-
const [activeQuery, setActiveQuery] =
|
|
56130
|
-
const [searchMode, setSearchMode] =
|
|
56131
|
-
const [results, setResults] =
|
|
56132
|
-
const [loading, setLoading] =
|
|
56133
|
-
const [error, setError] =
|
|
56134
|
-
const [currentPage, setCurrentPage] =
|
|
56135
|
-
const [selectedIndex, setSelectedIndex] =
|
|
56136
|
-
const clientRef =
|
|
56137
|
-
const executeSearch =
|
|
56309
|
+
const [searchInput, setSearchInput] = import_react41.useState("");
|
|
56310
|
+
const [activeQuery, setActiveQuery] = import_react41.useState("");
|
|
56311
|
+
const [searchMode, setSearchMode] = import_react41.useState("hybrid");
|
|
56312
|
+
const [results, setResults] = import_react41.useState([]);
|
|
56313
|
+
const [loading, setLoading] = import_react41.useState(false);
|
|
56314
|
+
const [error, setError] = import_react41.useState(null);
|
|
56315
|
+
const [currentPage, setCurrentPage] = import_react41.useState(0);
|
|
56316
|
+
const [selectedIndex, setSelectedIndex] = import_react41.useState(0);
|
|
56317
|
+
const clientRef = import_react41.useRef(null);
|
|
56318
|
+
const executeSearch = import_react41.useCallback(async (query, mode) => {
|
|
56138
56319
|
if (!query.trim())
|
|
56139
56320
|
return;
|
|
56140
56321
|
setLoading(true);
|
|
@@ -56157,27 +56338,27 @@ function MessageSearch({ onClose }) {
|
|
|
56157
56338
|
setLoading(false);
|
|
56158
56339
|
}
|
|
56159
56340
|
}, []);
|
|
56160
|
-
const submitSearch =
|
|
56341
|
+
const submitSearch = import_react41.useCallback(() => {
|
|
56161
56342
|
if (searchInput.trim() && searchInput !== activeQuery) {
|
|
56162
56343
|
setActiveQuery(searchInput);
|
|
56163
56344
|
executeSearch(searchInput, searchMode);
|
|
56164
56345
|
}
|
|
56165
56346
|
}, [searchInput, activeQuery, searchMode, executeSearch]);
|
|
56166
|
-
const clearSearch =
|
|
56347
|
+
const clearSearch = import_react41.useCallback(() => {
|
|
56167
56348
|
setSearchInput("");
|
|
56168
56349
|
setActiveQuery("");
|
|
56169
56350
|
setResults([]);
|
|
56170
56351
|
setCurrentPage(0);
|
|
56171
56352
|
setSelectedIndex(0);
|
|
56172
56353
|
}, []);
|
|
56173
|
-
const cycleSearchMode =
|
|
56354
|
+
const cycleSearchMode = import_react41.useCallback(() => {
|
|
56174
56355
|
setSearchMode((current) => {
|
|
56175
56356
|
const currentIndex = SEARCH_MODES.indexOf(current);
|
|
56176
56357
|
const nextIndex = (currentIndex + 1) % SEARCH_MODES.length;
|
|
56177
56358
|
return SEARCH_MODES[nextIndex];
|
|
56178
56359
|
});
|
|
56179
56360
|
}, []);
|
|
56180
|
-
|
|
56361
|
+
import_react41.useEffect(() => {
|
|
56181
56362
|
if (activeQuery) {
|
|
56182
56363
|
executeSearch(activeQuery, searchMode);
|
|
56183
56364
|
}
|
|
@@ -56216,63 +56397,63 @@ function MessageSearch({ onClose }) {
|
|
|
56216
56397
|
setSearchInput((prev) => prev + input);
|
|
56217
56398
|
}
|
|
56218
56399
|
});
|
|
56219
|
-
return /* @__PURE__ */
|
|
56400
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56220
56401
|
flexDirection: "column",
|
|
56221
56402
|
gap: 1,
|
|
56222
56403
|
children: [
|
|
56223
|
-
/* @__PURE__ */
|
|
56224
|
-
children: /* @__PURE__ */
|
|
56404
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56405
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56225
56406
|
bold: true,
|
|
56226
56407
|
color: colors.selector.title,
|
|
56227
56408
|
children: "Search messages across all agents"
|
|
56228
56409
|
}, undefined, false, undefined, this)
|
|
56229
56410
|
}, undefined, false, undefined, this),
|
|
56230
|
-
/* @__PURE__ */
|
|
56411
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56231
56412
|
flexDirection: "column",
|
|
56232
56413
|
children: [
|
|
56233
|
-
/* @__PURE__ */
|
|
56414
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56234
56415
|
children: [
|
|
56235
|
-
/* @__PURE__ */
|
|
56416
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56236
56417
|
dimColor: true,
|
|
56237
56418
|
children: "Search: "
|
|
56238
56419
|
}, undefined, false, undefined, this),
|
|
56239
|
-
searchInput ? /* @__PURE__ */
|
|
56420
|
+
searchInput ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
|
|
56240
56421
|
children: [
|
|
56241
|
-
/* @__PURE__ */
|
|
56422
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56242
56423
|
children: searchInput
|
|
56243
56424
|
}, undefined, false, undefined, this),
|
|
56244
|
-
searchInput !== activeQuery && /* @__PURE__ */
|
|
56425
|
+
searchInput !== activeQuery && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56245
56426
|
dimColor: true,
|
|
56246
56427
|
children: " (press Enter to search)"
|
|
56247
56428
|
}, undefined, false, undefined, this)
|
|
56248
56429
|
]
|
|
56249
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
56430
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56250
56431
|
dimColor: true,
|
|
56251
56432
|
italic: true,
|
|
56252
56433
|
children: "(type your query)"
|
|
56253
56434
|
}, undefined, false, undefined, this)
|
|
56254
56435
|
]
|
|
56255
56436
|
}, undefined, true, undefined, this),
|
|
56256
|
-
/* @__PURE__ */
|
|
56437
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56257
56438
|
children: [
|
|
56258
|
-
/* @__PURE__ */
|
|
56439
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56259
56440
|
dimColor: true,
|
|
56260
56441
|
children: "Mode: "
|
|
56261
56442
|
}, undefined, false, undefined, this),
|
|
56262
|
-
SEARCH_MODES.map((mode, i) => /* @__PURE__ */
|
|
56443
|
+
SEARCH_MODES.map((mode, i) => /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56263
56444
|
children: [
|
|
56264
|
-
i > 0 && /* @__PURE__ */
|
|
56445
|
+
i > 0 && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56265
56446
|
dimColor: true,
|
|
56266
56447
|
children: " · "
|
|
56267
56448
|
}, undefined, false, undefined, this),
|
|
56268
|
-
/* @__PURE__ */
|
|
56449
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56269
56450
|
bold: mode === searchMode,
|
|
56270
56451
|
color: mode === searchMode ? colors.selector.itemHighlighted : undefined,
|
|
56271
56452
|
children: mode
|
|
56272
56453
|
}, undefined, false, undefined, this)
|
|
56273
56454
|
]
|
|
56274
56455
|
}, mode, true, undefined, this)),
|
|
56275
|
-
/* @__PURE__ */
|
|
56456
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56276
56457
|
dimColor: true,
|
|
56277
56458
|
children: " (Tab to change)"
|
|
56278
56459
|
}, undefined, false, undefined, this)
|
|
@@ -56280,8 +56461,8 @@ function MessageSearch({ onClose }) {
|
|
|
56280
56461
|
}, undefined, true, undefined, this)
|
|
56281
56462
|
]
|
|
56282
56463
|
}, undefined, true, undefined, this),
|
|
56283
|
-
error && /* @__PURE__ */
|
|
56284
|
-
children: /* @__PURE__ */
|
|
56464
|
+
error && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56465
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56285
56466
|
color: "red",
|
|
56286
56467
|
children: [
|
|
56287
56468
|
"Error: ",
|
|
@@ -56289,14 +56470,14 @@ function MessageSearch({ onClose }) {
|
|
|
56289
56470
|
]
|
|
56290
56471
|
}, undefined, true, undefined, this)
|
|
56291
56472
|
}, undefined, false, undefined, this),
|
|
56292
|
-
loading && /* @__PURE__ */
|
|
56293
|
-
children: /* @__PURE__ */
|
|
56473
|
+
loading && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56474
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56294
56475
|
dimColor: true,
|
|
56295
56476
|
children: "Searching..."
|
|
56296
56477
|
}, undefined, false, undefined, this)
|
|
56297
56478
|
}, undefined, false, undefined, this),
|
|
56298
|
-
!loading && activeQuery && results.length === 0 && /* @__PURE__ */
|
|
56299
|
-
children: /* @__PURE__ */
|
|
56479
|
+
!loading && activeQuery && results.length === 0 && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56480
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56300
56481
|
dimColor: true,
|
|
56301
56482
|
children: [
|
|
56302
56483
|
'No results found for "',
|
|
@@ -56305,7 +56486,7 @@ function MessageSearch({ onClose }) {
|
|
|
56305
56486
|
]
|
|
56306
56487
|
}, undefined, true, undefined, this)
|
|
56307
56488
|
}, undefined, false, undefined, this),
|
|
56308
|
-
!loading && results.length > 0 && /* @__PURE__ */
|
|
56489
|
+
!loading && results.length > 0 && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56309
56490
|
flexDirection: "column",
|
|
56310
56491
|
children: pageResults.map((msg, index) => {
|
|
56311
56492
|
const isSelected = index === selectedIndex;
|
|
@@ -56318,31 +56499,31 @@ function MessageSearch({ onClose }) {
|
|
|
56318
56499
|
const displayText = truncateText(messageText.replace(/\n/g, " "), availableWidth);
|
|
56319
56500
|
const msgId = "id" in msg ? String(msg.id) : "result";
|
|
56320
56501
|
const uniqueKey = `${msgId}-${startIndex + index}`;
|
|
56321
|
-
return /* @__PURE__ */
|
|
56502
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56322
56503
|
flexDirection: "column",
|
|
56323
56504
|
marginBottom: 1,
|
|
56324
56505
|
children: [
|
|
56325
|
-
/* @__PURE__ */
|
|
56506
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56326
56507
|
flexDirection: "row",
|
|
56327
56508
|
children: [
|
|
56328
|
-
/* @__PURE__ */
|
|
56509
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56329
56510
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56330
56511
|
children: isSelected ? ">" : " "
|
|
56331
56512
|
}, undefined, false, undefined, this),
|
|
56332
|
-
/* @__PURE__ */
|
|
56513
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56333
56514
|
children: " "
|
|
56334
56515
|
}, undefined, false, undefined, this),
|
|
56335
|
-
/* @__PURE__ */
|
|
56516
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56336
56517
|
bold: isSelected,
|
|
56337
56518
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56338
56519
|
children: displayText
|
|
56339
56520
|
}, undefined, false, undefined, this)
|
|
56340
56521
|
]
|
|
56341
56522
|
}, undefined, true, undefined, this),
|
|
56342
|
-
/* @__PURE__ */
|
|
56523
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56343
56524
|
flexDirection: "row",
|
|
56344
56525
|
marginLeft: 2,
|
|
56345
|
-
children: /* @__PURE__ */
|
|
56526
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56346
56527
|
dimColor: true,
|
|
56347
56528
|
children: [
|
|
56348
56529
|
msgType,
|
|
@@ -56354,12 +56535,12 @@ function MessageSearch({ onClose }) {
|
|
|
56354
56535
|
}, uniqueKey, true, undefined, this);
|
|
56355
56536
|
})
|
|
56356
56537
|
}, undefined, false, undefined, this),
|
|
56357
|
-
/* @__PURE__ */
|
|
56538
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56358
56539
|
flexDirection: "column",
|
|
56359
56540
|
marginTop: 1,
|
|
56360
56541
|
children: [
|
|
56361
|
-
results.length > 0 && /* @__PURE__ */
|
|
56362
|
-
children: /* @__PURE__ */
|
|
56542
|
+
results.length > 0 && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56543
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56363
56544
|
dimColor: true,
|
|
56364
56545
|
children: [
|
|
56365
56546
|
"Page ",
|
|
@@ -56373,8 +56554,8 @@ function MessageSearch({ onClose }) {
|
|
|
56373
56554
|
]
|
|
56374
56555
|
}, undefined, true, undefined, this)
|
|
56375
56556
|
}, undefined, false, undefined, this),
|
|
56376
|
-
/* @__PURE__ */
|
|
56377
|
-
children: /* @__PURE__ */
|
|
56557
|
+
/* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
|
|
56558
|
+
children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
|
|
56378
56559
|
dimColor: true,
|
|
56379
56560
|
children: "Type + Enter to search · Tab mode · J/K page · Esc close"
|
|
56380
56561
|
}, undefined, false, undefined, this)
|
|
@@ -56384,14 +56565,14 @@ function MessageSearch({ onClose }) {
|
|
|
56384
56565
|
]
|
|
56385
56566
|
}, undefined, true, undefined, this);
|
|
56386
56567
|
}
|
|
56387
|
-
var
|
|
56568
|
+
var import_react41, jsx_dev_runtime20, DISPLAY_PAGE_SIZE = 5, SEARCH_LIMIT = 100, SEARCH_MODES;
|
|
56388
56569
|
var init_MessageSearch = __esm(async () => {
|
|
56389
56570
|
init_client2();
|
|
56390
56571
|
init_useTerminalWidth();
|
|
56391
56572
|
init_colors();
|
|
56392
56573
|
await init_build2();
|
|
56393
|
-
|
|
56394
|
-
|
|
56574
|
+
import_react41 = __toESM(require_react(), 1);
|
|
56575
|
+
jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
|
|
56395
56576
|
SEARCH_MODES = ["hybrid", "vector", "fts"];
|
|
56396
56577
|
});
|
|
56397
56578
|
|
|
@@ -56403,18 +56584,18 @@ function ModelSelector({
|
|
|
56403
56584
|
onCancel
|
|
56404
56585
|
}) {
|
|
56405
56586
|
const typedModels = models;
|
|
56406
|
-
const [showAll, setShowAll] =
|
|
56407
|
-
const [selectedIndex, setSelectedIndex] =
|
|
56408
|
-
const featuredModels =
|
|
56409
|
-
const visibleModels =
|
|
56587
|
+
const [showAll, setShowAll] = import_react42.useState(false);
|
|
56588
|
+
const [selectedIndex, setSelectedIndex] = import_react42.useState(0);
|
|
56589
|
+
const featuredModels = import_react42.useMemo(() => typedModels.filter((model) => model.isFeatured), [typedModels]);
|
|
56590
|
+
const visibleModels = import_react42.useMemo(() => {
|
|
56410
56591
|
if (showAll)
|
|
56411
56592
|
return typedModels;
|
|
56412
56593
|
if (featuredModels.length > 0)
|
|
56413
56594
|
return featuredModels;
|
|
56414
56595
|
return typedModels.slice(0, 5);
|
|
56415
56596
|
}, [featuredModels, showAll, typedModels]);
|
|
56416
|
-
const initializedRef =
|
|
56417
|
-
|
|
56597
|
+
const initializedRef = import_react42.useRef(false);
|
|
56598
|
+
import_react42.useEffect(() => {
|
|
56418
56599
|
if (!initializedRef.current) {
|
|
56419
56600
|
const index = visibleModels.findIndex((m) => m.handle === currentModel);
|
|
56420
56601
|
if (index >= 0) {
|
|
@@ -56443,18 +56624,18 @@ function ModelSelector({
|
|
|
56443
56624
|
onCancel();
|
|
56444
56625
|
}
|
|
56445
56626
|
});
|
|
56446
|
-
return /* @__PURE__ */
|
|
56627
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56447
56628
|
flexDirection: "column",
|
|
56448
56629
|
gap: 1,
|
|
56449
56630
|
children: [
|
|
56450
|
-
/* @__PURE__ */
|
|
56451
|
-
children: /* @__PURE__ */
|
|
56631
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56632
|
+
children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56452
56633
|
bold: true,
|
|
56453
56634
|
color: colors.selector.title,
|
|
56454
56635
|
children: "Select Model (↑↓ to navigate, Enter to select, ESC to cancel)"
|
|
56455
56636
|
}, undefined, false, undefined, this)
|
|
56456
56637
|
}, undefined, false, undefined, this),
|
|
56457
|
-
/* @__PURE__ */
|
|
56638
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56458
56639
|
flexDirection: "column",
|
|
56459
56640
|
children: [
|
|
56460
56641
|
visibleModels.map((model, index) => {
|
|
@@ -56468,29 +56649,29 @@ function ModelSelector({
|
|
|
56468
56649
|
isCurrent = isCurrent && currentEnableReasoner !== false;
|
|
56469
56650
|
}
|
|
56470
56651
|
}
|
|
56471
|
-
return /* @__PURE__ */
|
|
56652
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56472
56653
|
flexDirection: "row",
|
|
56473
56654
|
gap: 1,
|
|
56474
56655
|
children: [
|
|
56475
|
-
/* @__PURE__ */
|
|
56656
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56476
56657
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56477
56658
|
children: isSelected ? "›" : " "
|
|
56478
56659
|
}, undefined, false, undefined, this),
|
|
56479
|
-
/* @__PURE__ */
|
|
56660
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56480
56661
|
flexDirection: "row",
|
|
56481
56662
|
children: [
|
|
56482
|
-
/* @__PURE__ */
|
|
56663
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56483
56664
|
bold: isSelected,
|
|
56484
56665
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56485
56666
|
children: [
|
|
56486
56667
|
model.label,
|
|
56487
|
-
isCurrent && /* @__PURE__ */
|
|
56668
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56488
56669
|
color: colors.selector.itemCurrent,
|
|
56489
56670
|
children: " (current)"
|
|
56490
56671
|
}, undefined, false, undefined, this)
|
|
56491
56672
|
]
|
|
56492
56673
|
}, undefined, true, undefined, this),
|
|
56493
|
-
/* @__PURE__ */
|
|
56674
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56494
56675
|
dimColor: true,
|
|
56495
56676
|
children: [
|
|
56496
56677
|
" ",
|
|
@@ -56502,15 +56683,15 @@ function ModelSelector({
|
|
|
56502
56683
|
]
|
|
56503
56684
|
}, model.id, true, undefined, this);
|
|
56504
56685
|
}),
|
|
56505
|
-
!showAll && /* @__PURE__ */
|
|
56686
|
+
!showAll && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
|
|
56506
56687
|
flexDirection: "row",
|
|
56507
56688
|
gap: 1,
|
|
56508
56689
|
children: [
|
|
56509
|
-
/* @__PURE__ */
|
|
56690
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56510
56691
|
color: selectedIndex === visibleModels.length ? colors.selector.itemHighlighted : undefined,
|
|
56511
56692
|
children: selectedIndex === visibleModels.length ? "›" : " "
|
|
56512
56693
|
}, undefined, false, undefined, this),
|
|
56513
|
-
/* @__PURE__ */
|
|
56694
|
+
/* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
|
|
56514
56695
|
dimColor: true,
|
|
56515
56696
|
children: "Show all models"
|
|
56516
56697
|
}, undefined, false, undefined, this)
|
|
@@ -56521,17 +56702,17 @@ function ModelSelector({
|
|
|
56521
56702
|
]
|
|
56522
56703
|
}, undefined, true, undefined, this);
|
|
56523
56704
|
}
|
|
56524
|
-
var
|
|
56705
|
+
var import_react42, jsx_dev_runtime21;
|
|
56525
56706
|
var init_ModelSelector = __esm(async () => {
|
|
56526
56707
|
init_model();
|
|
56527
56708
|
init_colors();
|
|
56528
56709
|
await init_build2();
|
|
56529
|
-
|
|
56530
|
-
|
|
56710
|
+
import_react42 = __toESM(require_react(), 1);
|
|
56711
|
+
jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
|
|
56531
56712
|
});
|
|
56532
56713
|
|
|
56533
56714
|
// src/cli/components/PlanModeDialog.tsx
|
|
56534
|
-
var
|
|
56715
|
+
var import_react43, jsx_dev_runtime22, OptionsRenderer2, PlanModeDialog;
|
|
56535
56716
|
var init_PlanModeDialog = __esm(async () => {
|
|
56536
56717
|
init_pasteRegistry();
|
|
56537
56718
|
init_colors();
|
|
@@ -56540,20 +56721,20 @@ var init_PlanModeDialog = __esm(async () => {
|
|
|
56540
56721
|
init_MarkdownDisplay(),
|
|
56541
56722
|
init_PasteAwareTextInput()
|
|
56542
56723
|
]);
|
|
56543
|
-
|
|
56544
|
-
|
|
56545
|
-
OptionsRenderer2 =
|
|
56724
|
+
import_react43 = __toESM(require_react(), 1);
|
|
56725
|
+
jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
|
|
56726
|
+
OptionsRenderer2 = import_react43.memo(({
|
|
56546
56727
|
options,
|
|
56547
56728
|
selectedOption
|
|
56548
56729
|
}) => {
|
|
56549
|
-
return /* @__PURE__ */
|
|
56730
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56550
56731
|
flexDirection: "column",
|
|
56551
56732
|
children: options.map((option, index) => {
|
|
56552
56733
|
const isSelected = index === selectedOption;
|
|
56553
56734
|
const color = isSelected ? colors.approval.header : undefined;
|
|
56554
|
-
return /* @__PURE__ */
|
|
56735
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56555
56736
|
flexDirection: "row",
|
|
56556
|
-
children: /* @__PURE__ */
|
|
56737
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56557
56738
|
color,
|
|
56558
56739
|
children: [
|
|
56559
56740
|
isSelected ? "❯" : " ",
|
|
@@ -56568,10 +56749,10 @@ var init_PlanModeDialog = __esm(async () => {
|
|
|
56568
56749
|
}, undefined, false, undefined, this);
|
|
56569
56750
|
});
|
|
56570
56751
|
OptionsRenderer2.displayName = "OptionsRenderer";
|
|
56571
|
-
PlanModeDialog =
|
|
56572
|
-
const [selectedOption, setSelectedOption] =
|
|
56573
|
-
const [isEnteringReason, setIsEnteringReason] =
|
|
56574
|
-
const [denyReason, setDenyReason] =
|
|
56752
|
+
PlanModeDialog = import_react43.memo(({ plan, onApprove, onApproveAndAcceptEdits, onKeepPlanning }) => {
|
|
56753
|
+
const [selectedOption, setSelectedOption] = import_react43.useState(0);
|
|
56754
|
+
const [isEnteringReason, setIsEnteringReason] = import_react43.useState(false);
|
|
56755
|
+
const [denyReason, setDenyReason] = import_react43.useState("");
|
|
56575
56756
|
const options = [
|
|
56576
56757
|
{ label: "Yes, and auto-accept edits", action: onApproveAndAcceptEdits },
|
|
56577
56758
|
{ label: "Yes, and manually approve edits", action: onApprove },
|
|
@@ -56605,30 +56786,30 @@ var init_PlanModeDialog = __esm(async () => {
|
|
|
56605
56786
|
}
|
|
56606
56787
|
});
|
|
56607
56788
|
if (isEnteringReason) {
|
|
56608
|
-
return /* @__PURE__ */
|
|
56789
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56609
56790
|
flexDirection: "column",
|
|
56610
56791
|
children: [
|
|
56611
|
-
/* @__PURE__ */
|
|
56792
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56612
56793
|
borderStyle: "round",
|
|
56613
56794
|
borderColor: colors.approval.border,
|
|
56614
56795
|
width: "100%",
|
|
56615
56796
|
flexDirection: "column",
|
|
56616
56797
|
paddingX: 1,
|
|
56617
56798
|
children: [
|
|
56618
|
-
/* @__PURE__ */
|
|
56799
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56619
56800
|
bold: true,
|
|
56620
56801
|
children: "Enter feedback to continue planning (ESC to cancel):"
|
|
56621
56802
|
}, undefined, false, undefined, this),
|
|
56622
|
-
/* @__PURE__ */
|
|
56803
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56623
56804
|
height: 1
|
|
56624
56805
|
}, undefined, false, undefined, this),
|
|
56625
|
-
/* @__PURE__ */
|
|
56806
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56626
56807
|
children: [
|
|
56627
|
-
/* @__PURE__ */
|
|
56808
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56628
56809
|
dimColor: true,
|
|
56629
56810
|
children: "> "
|
|
56630
56811
|
}, undefined, false, undefined, this),
|
|
56631
|
-
/* @__PURE__ */
|
|
56812
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(PasteAwareTextInput, {
|
|
56632
56813
|
value: denyReason,
|
|
56633
56814
|
onChange: setDenyReason
|
|
56634
56815
|
}, undefined, false, undefined, this)
|
|
@@ -56636,49 +56817,49 @@ var init_PlanModeDialog = __esm(async () => {
|
|
|
56636
56817
|
}, undefined, true, undefined, this)
|
|
56637
56818
|
]
|
|
56638
56819
|
}, undefined, true, undefined, this),
|
|
56639
|
-
/* @__PURE__ */
|
|
56820
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56640
56821
|
height: 1
|
|
56641
56822
|
}, undefined, false, undefined, this)
|
|
56642
56823
|
]
|
|
56643
56824
|
}, undefined, true, undefined, this);
|
|
56644
56825
|
}
|
|
56645
|
-
return /* @__PURE__ */
|
|
56826
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56646
56827
|
flexDirection: "column",
|
|
56647
56828
|
borderStyle: "round",
|
|
56648
56829
|
borderColor: colors.approval.border,
|
|
56649
56830
|
paddingX: 1,
|
|
56650
56831
|
children: [
|
|
56651
|
-
/* @__PURE__ */
|
|
56832
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56652
56833
|
bold: true,
|
|
56653
56834
|
color: colors.approval.header,
|
|
56654
56835
|
children: "Ready to code?"
|
|
56655
56836
|
}, undefined, false, undefined, this),
|
|
56656
|
-
/* @__PURE__ */
|
|
56837
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56657
56838
|
height: 1
|
|
56658
56839
|
}, undefined, false, undefined, this),
|
|
56659
|
-
/* @__PURE__ */
|
|
56840
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56660
56841
|
children: "Here's the proposed plan:"
|
|
56661
56842
|
}, undefined, false, undefined, this),
|
|
56662
|
-
/* @__PURE__ */
|
|
56843
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56663
56844
|
height: 1
|
|
56664
56845
|
}, undefined, false, undefined, this),
|
|
56665
|
-
/* @__PURE__ */
|
|
56846
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56666
56847
|
borderStyle: "round",
|
|
56667
56848
|
paddingX: 1,
|
|
56668
|
-
children: /* @__PURE__ */
|
|
56849
|
+
children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(MarkdownDisplay, {
|
|
56669
56850
|
text: plan
|
|
56670
56851
|
}, undefined, false, undefined, this)
|
|
56671
56852
|
}, undefined, false, undefined, this),
|
|
56672
|
-
/* @__PURE__ */
|
|
56853
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56673
56854
|
height: 1
|
|
56674
56855
|
}, undefined, false, undefined, this),
|
|
56675
|
-
/* @__PURE__ */
|
|
56856
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
|
|
56676
56857
|
children: "Would you like to proceed?"
|
|
56677
56858
|
}, undefined, false, undefined, this),
|
|
56678
|
-
/* @__PURE__ */
|
|
56859
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
|
|
56679
56860
|
height: 1
|
|
56680
56861
|
}, undefined, false, undefined, this),
|
|
56681
|
-
/* @__PURE__ */
|
|
56862
|
+
/* @__PURE__ */ jsx_dev_runtime22.jsxDEV(OptionsRenderer2, {
|
|
56682
56863
|
options,
|
|
56683
56864
|
selectedOption
|
|
56684
56865
|
}, undefined, false, undefined, this)
|
|
@@ -56728,29 +56909,29 @@ function formatModel(agent) {
|
|
|
56728
56909
|
}
|
|
56729
56910
|
return "unknown";
|
|
56730
56911
|
}
|
|
56731
|
-
var
|
|
56912
|
+
var import_react44, jsx_dev_runtime23, DISPLAY_PAGE_SIZE2 = 5, ProfileSelector;
|
|
56732
56913
|
var init_ProfileSelector = __esm(async () => {
|
|
56733
56914
|
init_client2();
|
|
56734
56915
|
init_settings_manager();
|
|
56735
56916
|
init_useTerminalWidth();
|
|
56736
56917
|
init_colors();
|
|
56737
56918
|
await init_build2();
|
|
56738
|
-
|
|
56739
|
-
|
|
56740
|
-
ProfileSelector =
|
|
56919
|
+
import_react44 = __toESM(require_react(), 1);
|
|
56920
|
+
jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
|
|
56921
|
+
ProfileSelector = import_react44.memo(function ProfileSelector2({
|
|
56741
56922
|
currentAgentId,
|
|
56742
56923
|
onSelect,
|
|
56743
56924
|
onUnpin,
|
|
56744
56925
|
onCancel
|
|
56745
56926
|
}) {
|
|
56746
56927
|
const terminalWidth = useTerminalWidth();
|
|
56747
|
-
const [profiles, setProfiles] =
|
|
56748
|
-
const [loading, setLoading] =
|
|
56749
|
-
const [selectedIndex, setSelectedIndex] =
|
|
56750
|
-
const [currentPage, setCurrentPage] =
|
|
56751
|
-
const [mode, setMode] =
|
|
56752
|
-
const [deleteConfirmIndex, setDeleteConfirmIndex] =
|
|
56753
|
-
const loadProfiles =
|
|
56928
|
+
const [profiles, setProfiles] = import_react44.useState([]);
|
|
56929
|
+
const [loading, setLoading] = import_react44.useState(true);
|
|
56930
|
+
const [selectedIndex, setSelectedIndex] = import_react44.useState(0);
|
|
56931
|
+
const [currentPage, setCurrentPage] = import_react44.useState(0);
|
|
56932
|
+
const [mode, setMode] = import_react44.useState("browsing");
|
|
56933
|
+
const [deleteConfirmIndex, setDeleteConfirmIndex] = import_react44.useState(0);
|
|
56934
|
+
const loadProfiles = import_react44.useCallback(async () => {
|
|
56754
56935
|
setLoading(true);
|
|
56755
56936
|
try {
|
|
56756
56937
|
const mergedPinned = settingsManager.getMergedPinnedAgents();
|
|
@@ -56786,7 +56967,7 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
56786
56967
|
setLoading(false);
|
|
56787
56968
|
}
|
|
56788
56969
|
}, []);
|
|
56789
|
-
|
|
56970
|
+
import_react44.useEffect(() => {
|
|
56790
56971
|
loadProfiles();
|
|
56791
56972
|
}, [loadProfiles]);
|
|
56792
56973
|
const totalPages = Math.ceil(profiles.length / DISPLAY_PAGE_SIZE2);
|
|
@@ -56851,19 +57032,19 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
56851
57032
|
});
|
|
56852
57033
|
if (mode === "confirming-delete" && selectedProfile) {
|
|
56853
57034
|
const options = ["Yes, unpin", "No, cancel"];
|
|
56854
|
-
return /* @__PURE__ */
|
|
57035
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56855
57036
|
flexDirection: "column",
|
|
56856
57037
|
gap: 1,
|
|
56857
57038
|
children: [
|
|
56858
|
-
/* @__PURE__ */
|
|
56859
|
-
children: /* @__PURE__ */
|
|
57039
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57040
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56860
57041
|
bold: true,
|
|
56861
57042
|
color: colors.selector.title,
|
|
56862
57043
|
children: "Unpin Agent"
|
|
56863
57044
|
}, undefined, false, undefined, this)
|
|
56864
57045
|
}, undefined, false, undefined, this),
|
|
56865
|
-
/* @__PURE__ */
|
|
56866
|
-
children: /* @__PURE__ */
|
|
57046
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57047
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56867
57048
|
children: [
|
|
56868
57049
|
'Unpin "',
|
|
56869
57050
|
selectedProfile.name,
|
|
@@ -56871,13 +57052,13 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
56871
57052
|
]
|
|
56872
57053
|
}, undefined, true, undefined, this)
|
|
56873
57054
|
}, undefined, false, undefined, this),
|
|
56874
|
-
/* @__PURE__ */
|
|
57055
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56875
57056
|
flexDirection: "column",
|
|
56876
57057
|
marginTop: 1,
|
|
56877
57058
|
children: options.map((option, index) => {
|
|
56878
57059
|
const isSelected = index === deleteConfirmIndex;
|
|
56879
|
-
return /* @__PURE__ */
|
|
56880
|
-
children: /* @__PURE__ */
|
|
57060
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57061
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56881
57062
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56882
57063
|
bold: isSelected,
|
|
56883
57064
|
children: [
|
|
@@ -56892,44 +57073,44 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
56892
57073
|
]
|
|
56893
57074
|
}, undefined, true, undefined, this);
|
|
56894
57075
|
}
|
|
56895
|
-
return /* @__PURE__ */
|
|
57076
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56896
57077
|
flexDirection: "column",
|
|
56897
57078
|
gap: 1,
|
|
56898
57079
|
children: [
|
|
56899
|
-
/* @__PURE__ */
|
|
56900
|
-
children: /* @__PURE__ */
|
|
57080
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57081
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56901
57082
|
bold: true,
|
|
56902
57083
|
color: colors.selector.title,
|
|
56903
57084
|
children: "Pinned Agents"
|
|
56904
57085
|
}, undefined, false, undefined, this)
|
|
56905
57086
|
}, undefined, false, undefined, this),
|
|
56906
|
-
loading && /* @__PURE__ */
|
|
56907
|
-
children: /* @__PURE__ */
|
|
57087
|
+
loading && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57088
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56908
57089
|
dimColor: true,
|
|
56909
57090
|
children: "Loading pinned agents..."
|
|
56910
57091
|
}, undefined, false, undefined, this)
|
|
56911
57092
|
}, undefined, false, undefined, this),
|
|
56912
|
-
!loading && profiles.length === 0 && /* @__PURE__ */
|
|
57093
|
+
!loading && profiles.length === 0 && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56913
57094
|
flexDirection: "column",
|
|
56914
57095
|
children: [
|
|
56915
|
-
/* @__PURE__ */
|
|
57096
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56916
57097
|
dimColor: true,
|
|
56917
57098
|
children: "No agents pinned."
|
|
56918
57099
|
}, undefined, false, undefined, this),
|
|
56919
|
-
/* @__PURE__ */
|
|
57100
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56920
57101
|
dimColor: true,
|
|
56921
57102
|
children: "Press P to pin the current agent."
|
|
56922
57103
|
}, undefined, false, undefined, this),
|
|
56923
|
-
/* @__PURE__ */
|
|
57104
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56924
57105
|
marginTop: 1,
|
|
56925
|
-
children: /* @__PURE__ */
|
|
57106
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56926
57107
|
dimColor: true,
|
|
56927
57108
|
children: "Esc to close"
|
|
56928
57109
|
}, undefined, false, undefined, this)
|
|
56929
57110
|
}, undefined, false, undefined, this)
|
|
56930
57111
|
]
|
|
56931
57112
|
}, undefined, true, undefined, this),
|
|
56932
|
-
!loading && profiles.length > 0 && /* @__PURE__ */
|
|
57113
|
+
!loading && profiles.length > 0 && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56933
57114
|
flexDirection: "column",
|
|
56934
57115
|
children: pageProfiles.map((profile, index) => {
|
|
56935
57116
|
const isSelected = index === selectedIndex;
|
|
@@ -56939,59 +57120,59 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
56939
57120
|
const fixedChars = 2 + 3 + (isCurrent ? 10 : 0);
|
|
56940
57121
|
const availableForId = Math.max(15, terminalWidth - nameLen - fixedChars);
|
|
56941
57122
|
const displayId = truncateAgentId(profile.agentId, availableForId);
|
|
56942
|
-
return /* @__PURE__ */
|
|
57123
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56943
57124
|
flexDirection: "column",
|
|
56944
57125
|
marginBottom: 1,
|
|
56945
57126
|
children: [
|
|
56946
|
-
/* @__PURE__ */
|
|
57127
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56947
57128
|
flexDirection: "row",
|
|
56948
57129
|
children: [
|
|
56949
|
-
/* @__PURE__ */
|
|
57130
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56950
57131
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56951
57132
|
children: isSelected ? ">" : " "
|
|
56952
57133
|
}, undefined, false, undefined, this),
|
|
56953
|
-
/* @__PURE__ */
|
|
57134
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56954
57135
|
children: " "
|
|
56955
57136
|
}, undefined, false, undefined, this),
|
|
56956
|
-
/* @__PURE__ */
|
|
57137
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56957
57138
|
bold: isSelected,
|
|
56958
57139
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
56959
57140
|
children: profile.name
|
|
56960
57141
|
}, undefined, false, undefined, this),
|
|
56961
|
-
profile.isPinned && /* @__PURE__ */
|
|
57142
|
+
profile.isPinned && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56962
57143
|
color: colors.selector.itemCurrent,
|
|
56963
57144
|
children: " (pinned)"
|
|
56964
57145
|
}, undefined, false, undefined, this),
|
|
56965
|
-
/* @__PURE__ */
|
|
57146
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56966
57147
|
dimColor: true,
|
|
56967
57148
|
children: [
|
|
56968
57149
|
" · ",
|
|
56969
57150
|
displayId
|
|
56970
57151
|
]
|
|
56971
57152
|
}, undefined, true, undefined, this),
|
|
56972
|
-
isCurrent && /* @__PURE__ */
|
|
57153
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56973
57154
|
color: colors.selector.itemCurrent,
|
|
56974
57155
|
children: " (current)"
|
|
56975
57156
|
}, undefined, false, undefined, this)
|
|
56976
57157
|
]
|
|
56977
57158
|
}, undefined, true, undefined, this),
|
|
56978
|
-
/* @__PURE__ */
|
|
57159
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56979
57160
|
flexDirection: "row",
|
|
56980
57161
|
marginLeft: 2,
|
|
56981
|
-
children: hasAgent ? /* @__PURE__ */
|
|
57162
|
+
children: hasAgent ? /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56982
57163
|
dimColor: true,
|
|
56983
57164
|
italic: true,
|
|
56984
57165
|
children: profile.agent?.description || "No description"
|
|
56985
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
57166
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56986
57167
|
color: "red",
|
|
56987
57168
|
italic: true,
|
|
56988
57169
|
children: profile.error
|
|
56989
57170
|
}, undefined, false, undefined, this)
|
|
56990
57171
|
}, undefined, false, undefined, this),
|
|
56991
|
-
hasAgent && profile.agent && /* @__PURE__ */
|
|
57172
|
+
hasAgent && profile.agent && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
56992
57173
|
flexDirection: "row",
|
|
56993
57174
|
marginLeft: 2,
|
|
56994
|
-
children: /* @__PURE__ */
|
|
57175
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
56995
57176
|
dimColor: true,
|
|
56996
57177
|
children: [
|
|
56997
57178
|
formatRelativeTime2(profile.agent.last_run_completion),
|
|
@@ -57010,12 +57191,12 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
57010
57191
|
}, profile.name, true, undefined, this);
|
|
57011
57192
|
})
|
|
57012
57193
|
}, undefined, false, undefined, this),
|
|
57013
|
-
!loading && profiles.length > 0 && /* @__PURE__ */
|
|
57194
|
+
!loading && profiles.length > 0 && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57014
57195
|
flexDirection: "column",
|
|
57015
57196
|
marginTop: 1,
|
|
57016
57197
|
children: [
|
|
57017
|
-
totalPages > 1 && /* @__PURE__ */
|
|
57018
|
-
children: /* @__PURE__ */
|
|
57198
|
+
totalPages > 1 && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57199
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
57019
57200
|
dimColor: true,
|
|
57020
57201
|
children: [
|
|
57021
57202
|
"Page ",
|
|
@@ -57025,8 +57206,8 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
57025
57206
|
]
|
|
57026
57207
|
}, undefined, true, undefined, this)
|
|
57027
57208
|
}, undefined, false, undefined, this),
|
|
57028
|
-
/* @__PURE__ */
|
|
57029
|
-
children: /* @__PURE__ */
|
|
57209
|
+
/* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
|
|
57210
|
+
children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
|
|
57030
57211
|
dimColor: true,
|
|
57031
57212
|
children: "↑↓ navigate · Enter load · P pin/unpin · D unpin all · Esc close"
|
|
57032
57213
|
}, undefined, false, undefined, this)
|
|
@@ -57040,22 +57221,22 @@ var init_ProfileSelector = __esm(async () => {
|
|
|
57040
57221
|
});
|
|
57041
57222
|
|
|
57042
57223
|
// src/cli/components/QuestionDialog.tsx
|
|
57043
|
-
var
|
|
57224
|
+
var import_react45, jsx_dev_runtime24, QuestionDialog;
|
|
57044
57225
|
var init_QuestionDialog = __esm(async () => {
|
|
57045
57226
|
init_colors();
|
|
57046
57227
|
await __promiseAll([
|
|
57047
57228
|
init_build2(),
|
|
57048
57229
|
init_PasteAwareTextInput()
|
|
57049
57230
|
]);
|
|
57050
|
-
|
|
57051
|
-
|
|
57052
|
-
QuestionDialog =
|
|
57053
|
-
const [currentQuestionIndex, setCurrentQuestionIndex] =
|
|
57054
|
-
const [answers, setAnswers] =
|
|
57055
|
-
const [selectedOption, setSelectedOption] =
|
|
57056
|
-
const [isOtherMode, setIsOtherMode] =
|
|
57057
|
-
const [otherText, setOtherText] =
|
|
57058
|
-
const [selectedMulti, setSelectedMulti] =
|
|
57231
|
+
import_react45 = __toESM(require_react(), 1);
|
|
57232
|
+
jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57233
|
+
QuestionDialog = import_react45.memo(({ questions, onSubmit }) => {
|
|
57234
|
+
const [currentQuestionIndex, setCurrentQuestionIndex] = import_react45.useState(0);
|
|
57235
|
+
const [answers, setAnswers] = import_react45.useState({});
|
|
57236
|
+
const [selectedOption, setSelectedOption] = import_react45.useState(0);
|
|
57237
|
+
const [isOtherMode, setIsOtherMode] = import_react45.useState(false);
|
|
57238
|
+
const [otherText, setOtherText] = import_react45.useState("");
|
|
57239
|
+
const [selectedMulti, setSelectedMulti] = import_react45.useState(new Set);
|
|
57059
57240
|
const currentQuestion = questions[currentQuestionIndex];
|
|
57060
57241
|
const optionsWithOther = currentQuestion ? [
|
|
57061
57242
|
...currentQuestion.options,
|
|
@@ -57150,15 +57331,15 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57150
57331
|
};
|
|
57151
57332
|
if (!currentQuestion)
|
|
57152
57333
|
return null;
|
|
57153
|
-
return /* @__PURE__ */
|
|
57334
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57154
57335
|
flexDirection: "column",
|
|
57155
57336
|
children: [
|
|
57156
|
-
/* @__PURE__ */
|
|
57337
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57157
57338
|
marginBottom: 1,
|
|
57158
|
-
children: /* @__PURE__ */
|
|
57339
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57159
57340
|
color: colors.approval.header,
|
|
57160
57341
|
children: [
|
|
57161
|
-
/* @__PURE__ */
|
|
57342
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57162
57343
|
bold: true,
|
|
57163
57344
|
children: [
|
|
57164
57345
|
"[",
|
|
@@ -57171,9 +57352,9 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57171
57352
|
]
|
|
57172
57353
|
}, undefined, true, undefined, this)
|
|
57173
57354
|
}, undefined, false, undefined, this),
|
|
57174
|
-
questions.length > 1 && /* @__PURE__ */
|
|
57355
|
+
questions.length > 1 && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57175
57356
|
marginBottom: 1,
|
|
57176
|
-
children: /* @__PURE__ */
|
|
57357
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57177
57358
|
dimColor: true,
|
|
57178
57359
|
children: [
|
|
57179
57360
|
"Question ",
|
|
@@ -57183,21 +57364,21 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57183
57364
|
]
|
|
57184
57365
|
}, undefined, true, undefined, this)
|
|
57185
57366
|
}, undefined, false, undefined, this),
|
|
57186
|
-
isOtherMode ? /* @__PURE__ */
|
|
57367
|
+
isOtherMode ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57187
57368
|
flexDirection: "column",
|
|
57188
57369
|
children: [
|
|
57189
|
-
/* @__PURE__ */
|
|
57370
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57190
57371
|
dimColor: true,
|
|
57191
57372
|
children: "Type your response (Esc to cancel):"
|
|
57192
57373
|
}, undefined, false, undefined, this),
|
|
57193
|
-
/* @__PURE__ */
|
|
57374
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57194
57375
|
marginTop: 1,
|
|
57195
57376
|
children: [
|
|
57196
|
-
/* @__PURE__ */
|
|
57377
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57197
57378
|
color: colors.approval.header,
|
|
57198
57379
|
children: "> "
|
|
57199
57380
|
}, undefined, false, undefined, this),
|
|
57200
|
-
/* @__PURE__ */
|
|
57381
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(PasteAwareTextInput, {
|
|
57201
57382
|
value: otherText,
|
|
57202
57383
|
onChange: setOtherText,
|
|
57203
57384
|
onSubmit: handleOtherSubmit
|
|
@@ -57205,32 +57386,32 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57205
57386
|
]
|
|
57206
57387
|
}, undefined, true, undefined, this)
|
|
57207
57388
|
]
|
|
57208
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
57389
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57209
57390
|
flexDirection: "column",
|
|
57210
57391
|
children: [
|
|
57211
57392
|
optionsWithOther.map((option, index) => {
|
|
57212
57393
|
const isSelected = index === selectedOption;
|
|
57213
57394
|
const isChecked = selectedMulti.has(index);
|
|
57214
57395
|
const color = isSelected ? colors.approval.header : undefined;
|
|
57215
|
-
return /* @__PURE__ */
|
|
57396
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57216
57397
|
flexDirection: "column",
|
|
57217
57398
|
marginBottom: index < optionsWithOther.length - 1 ? 1 : 0,
|
|
57218
57399
|
children: [
|
|
57219
|
-
/* @__PURE__ */
|
|
57400
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57220
57401
|
flexDirection: "row",
|
|
57221
57402
|
children: [
|
|
57222
|
-
/* @__PURE__ */
|
|
57403
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57223
57404
|
width: 2,
|
|
57224
57405
|
flexShrink: 0,
|
|
57225
|
-
children: /* @__PURE__ */
|
|
57406
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57226
57407
|
color,
|
|
57227
57408
|
children: isSelected ? ">" : " "
|
|
57228
57409
|
}, undefined, false, undefined, this)
|
|
57229
57410
|
}, undefined, false, undefined, this),
|
|
57230
|
-
currentQuestion.multiSelect && index < optionsWithOther.length - 1 && /* @__PURE__ */
|
|
57411
|
+
currentQuestion.multiSelect && index < optionsWithOther.length - 1 && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57231
57412
|
width: 4,
|
|
57232
57413
|
flexShrink: 0,
|
|
57233
|
-
children: /* @__PURE__ */
|
|
57414
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57234
57415
|
color,
|
|
57235
57416
|
children: [
|
|
57236
57417
|
"[",
|
|
@@ -57239,9 +57420,9 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57239
57420
|
]
|
|
57240
57421
|
}, undefined, true, undefined, this)
|
|
57241
57422
|
}, undefined, false, undefined, this),
|
|
57242
|
-
/* @__PURE__ */
|
|
57423
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57243
57424
|
flexGrow: 1,
|
|
57244
|
-
children: /* @__PURE__ */
|
|
57425
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57245
57426
|
color,
|
|
57246
57427
|
bold: isSelected,
|
|
57247
57428
|
children: [
|
|
@@ -57253,9 +57434,9 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57253
57434
|
}, undefined, false, undefined, this)
|
|
57254
57435
|
]
|
|
57255
57436
|
}, undefined, true, undefined, this),
|
|
57256
|
-
option.description && /* @__PURE__ */
|
|
57437
|
+
option.description && /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57257
57438
|
paddingLeft: currentQuestion.multiSelect ? 6 : 2,
|
|
57258
|
-
children: /* @__PURE__ */
|
|
57439
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57259
57440
|
dimColor: true,
|
|
57260
57441
|
children: option.description
|
|
57261
57442
|
}, undefined, false, undefined, this)
|
|
@@ -57263,9 +57444,9 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57263
57444
|
]
|
|
57264
57445
|
}, option.label, true, undefined, this);
|
|
57265
57446
|
}),
|
|
57266
|
-
/* @__PURE__ */
|
|
57447
|
+
/* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
|
|
57267
57448
|
marginTop: 1,
|
|
57268
|
-
children: /* @__PURE__ */
|
|
57449
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
|
|
57269
57450
|
dimColor: true,
|
|
57270
57451
|
children: currentQuestion.multiSelect ? "Space to toggle, Enter to confirm selection" : `Enter to select, or type 1-${optionsWithOther.length}`
|
|
57271
57452
|
}, undefined, false, undefined, this)
|
|
@@ -57279,7 +57460,7 @@ var init_QuestionDialog = __esm(async () => {
|
|
|
57279
57460
|
});
|
|
57280
57461
|
|
|
57281
57462
|
// src/cli/components/ReasoningMessageRich.tsx
|
|
57282
|
-
var
|
|
57463
|
+
var import_react46, jsx_dev_runtime25, normalize3 = (s) => s.replace(/\r\n/g, `
|
|
57283
57464
|
`).replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, `
|
|
57284
57465
|
|
|
57285
57466
|
`).replace(/^\n+|\n+$/g, ""), ReasoningMessage;
|
|
@@ -57289,53 +57470,53 @@ var init_ReasoningMessageRich = __esm(async () => {
|
|
|
57289
57470
|
init_build2(),
|
|
57290
57471
|
init_MarkdownDisplay()
|
|
57291
57472
|
]);
|
|
57292
|
-
|
|
57293
|
-
|
|
57294
|
-
ReasoningMessage =
|
|
57473
|
+
import_react46 = __toESM(require_react(), 1);
|
|
57474
|
+
jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57475
|
+
ReasoningMessage = import_react46.memo(({ line }) => {
|
|
57295
57476
|
const columns = useTerminalWidth();
|
|
57296
57477
|
const contentWidth = Math.max(0, columns - 2);
|
|
57297
57478
|
const normalizedText = normalize3(line.text);
|
|
57298
|
-
return /* @__PURE__ */
|
|
57479
|
+
return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57299
57480
|
flexDirection: "column",
|
|
57300
57481
|
children: [
|
|
57301
|
-
/* @__PURE__ */
|
|
57482
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57302
57483
|
flexDirection: "row",
|
|
57303
57484
|
children: [
|
|
57304
|
-
/* @__PURE__ */
|
|
57485
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57305
57486
|
width: 2,
|
|
57306
57487
|
flexShrink: 0,
|
|
57307
|
-
children: /* @__PURE__ */
|
|
57488
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
|
|
57308
57489
|
dimColor: true,
|
|
57309
57490
|
children: "✻"
|
|
57310
57491
|
}, undefined, false, undefined, this)
|
|
57311
57492
|
}, undefined, false, undefined, this),
|
|
57312
|
-
/* @__PURE__ */
|
|
57493
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57313
57494
|
flexGrow: 1,
|
|
57314
57495
|
width: contentWidth,
|
|
57315
|
-
children: /* @__PURE__ */
|
|
57496
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
|
|
57316
57497
|
dimColor: true,
|
|
57317
57498
|
children: "Thinking…"
|
|
57318
57499
|
}, undefined, false, undefined, this)
|
|
57319
57500
|
}, undefined, false, undefined, this)
|
|
57320
57501
|
]
|
|
57321
57502
|
}, undefined, true, undefined, this),
|
|
57322
|
-
/* @__PURE__ */
|
|
57503
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57323
57504
|
height: 1
|
|
57324
57505
|
}, undefined, false, undefined, this),
|
|
57325
|
-
/* @__PURE__ */
|
|
57506
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57326
57507
|
flexDirection: "row",
|
|
57327
57508
|
children: [
|
|
57328
|
-
/* @__PURE__ */
|
|
57509
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57329
57510
|
width: 2,
|
|
57330
57511
|
flexShrink: 0,
|
|
57331
|
-
children: /* @__PURE__ */
|
|
57512
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
|
|
57332
57513
|
children: " "
|
|
57333
57514
|
}, undefined, false, undefined, this)
|
|
57334
57515
|
}, undefined, false, undefined, this),
|
|
57335
|
-
/* @__PURE__ */
|
|
57516
|
+
/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
|
|
57336
57517
|
flexGrow: 1,
|
|
57337
57518
|
width: contentWidth,
|
|
57338
|
-
children: /* @__PURE__ */
|
|
57519
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(MarkdownDisplay, {
|
|
57339
57520
|
text: normalizedText,
|
|
57340
57521
|
dimColor: true
|
|
57341
57522
|
}, undefined, false, undefined, this)
|
|
@@ -57394,18 +57575,18 @@ function ResumeSelector({
|
|
|
57394
57575
|
onCancel
|
|
57395
57576
|
}) {
|
|
57396
57577
|
const terminalWidth = useTerminalWidth();
|
|
57397
|
-
const [allAgents, setAllAgents] =
|
|
57398
|
-
const [nextCursor, setNextCursor] =
|
|
57399
|
-
const [currentPage, setCurrentPage] =
|
|
57400
|
-
const [loading, setLoading] =
|
|
57401
|
-
const [loadingMore, setLoadingMore] =
|
|
57402
|
-
const [error, setError] =
|
|
57403
|
-
const [selectedIndex, setSelectedIndex] =
|
|
57404
|
-
const [searchInput, setSearchInput] =
|
|
57405
|
-
const [activeQuery, setActiveQuery] =
|
|
57406
|
-
const [hasMore, setHasMore] =
|
|
57407
|
-
const clientRef =
|
|
57408
|
-
const fetchAgents =
|
|
57578
|
+
const [allAgents, setAllAgents] = import_react47.useState([]);
|
|
57579
|
+
const [nextCursor, setNextCursor] = import_react47.useState(null);
|
|
57580
|
+
const [currentPage, setCurrentPage] = import_react47.useState(0);
|
|
57581
|
+
const [loading, setLoading] = import_react47.useState(true);
|
|
57582
|
+
const [loadingMore, setLoadingMore] = import_react47.useState(false);
|
|
57583
|
+
const [error, setError] = import_react47.useState(null);
|
|
57584
|
+
const [selectedIndex, setSelectedIndex] = import_react47.useState(0);
|
|
57585
|
+
const [searchInput, setSearchInput] = import_react47.useState("");
|
|
57586
|
+
const [activeQuery, setActiveQuery] = import_react47.useState("");
|
|
57587
|
+
const [hasMore, setHasMore] = import_react47.useState(true);
|
|
57588
|
+
const clientRef = import_react47.useRef(null);
|
|
57589
|
+
const fetchAgents = import_react47.useCallback(async (afterCursor, query) => {
|
|
57409
57590
|
const client = clientRef.current || await getClient2();
|
|
57410
57591
|
clientRef.current = client;
|
|
57411
57592
|
const agentList = await client.agents.list({
|
|
@@ -57423,7 +57604,7 @@ function ResumeSelector({
|
|
|
57423
57604
|
nextCursor: cursor
|
|
57424
57605
|
};
|
|
57425
57606
|
}, []);
|
|
57426
|
-
|
|
57607
|
+
import_react47.useEffect(() => {
|
|
57427
57608
|
const doFetch = async () => {
|
|
57428
57609
|
setLoading(true);
|
|
57429
57610
|
try {
|
|
@@ -57441,18 +57622,18 @@ function ResumeSelector({
|
|
|
57441
57622
|
};
|
|
57442
57623
|
doFetch();
|
|
57443
57624
|
}, [fetchAgents, activeQuery]);
|
|
57444
|
-
const submitSearch =
|
|
57625
|
+
const submitSearch = import_react47.useCallback(() => {
|
|
57445
57626
|
if (searchInput !== activeQuery) {
|
|
57446
57627
|
setActiveQuery(searchInput);
|
|
57447
57628
|
}
|
|
57448
57629
|
}, [searchInput, activeQuery]);
|
|
57449
|
-
const clearSearch =
|
|
57630
|
+
const clearSearch = import_react47.useCallback(() => {
|
|
57450
57631
|
setSearchInput("");
|
|
57451
57632
|
if (activeQuery) {
|
|
57452
57633
|
setActiveQuery("");
|
|
57453
57634
|
}
|
|
57454
57635
|
}, [activeQuery]);
|
|
57455
|
-
const fetchMoreAgents =
|
|
57636
|
+
const fetchMoreAgents = import_react47.useCallback(async () => {
|
|
57456
57637
|
if (loadingMore || !hasMore || !nextCursor)
|
|
57457
57638
|
return;
|
|
57458
57639
|
setLoadingMore(true);
|
|
@@ -57514,72 +57695,72 @@ function ResumeSelector({
|
|
|
57514
57695
|
setSearchInput((prev) => prev + input);
|
|
57515
57696
|
}
|
|
57516
57697
|
});
|
|
57517
|
-
return /* @__PURE__ */
|
|
57698
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57518
57699
|
flexDirection: "column",
|
|
57519
57700
|
gap: 1,
|
|
57520
57701
|
children: [
|
|
57521
|
-
/* @__PURE__ */
|
|
57522
|
-
children: /* @__PURE__ */
|
|
57702
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57703
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57523
57704
|
bold: true,
|
|
57524
57705
|
color: colors.selector.title,
|
|
57525
57706
|
children: "Browsing Agents (sorting by last run)"
|
|
57526
57707
|
}, undefined, false, undefined, this)
|
|
57527
57708
|
}, undefined, false, undefined, this),
|
|
57528
|
-
(searchInput || activeQuery) && /* @__PURE__ */
|
|
57709
|
+
(searchInput || activeQuery) && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57529
57710
|
children: [
|
|
57530
|
-
/* @__PURE__ */
|
|
57711
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57531
57712
|
dimColor: true,
|
|
57532
57713
|
children: "Search: "
|
|
57533
57714
|
}, undefined, false, undefined, this),
|
|
57534
|
-
/* @__PURE__ */
|
|
57715
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57535
57716
|
children: searchInput
|
|
57536
57717
|
}, undefined, false, undefined, this),
|
|
57537
|
-
searchInput && searchInput !== activeQuery && /* @__PURE__ */
|
|
57718
|
+
searchInput && searchInput !== activeQuery && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57538
57719
|
dimColor: true,
|
|
57539
57720
|
children: " (press Enter to search)"
|
|
57540
57721
|
}, undefined, false, undefined, this),
|
|
57541
|
-
activeQuery && searchInput === activeQuery && /* @__PURE__ */
|
|
57722
|
+
activeQuery && searchInput === activeQuery && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57542
57723
|
dimColor: true,
|
|
57543
57724
|
children: " (Esc to clear)"
|
|
57544
57725
|
}, undefined, false, undefined, this)
|
|
57545
57726
|
]
|
|
57546
57727
|
}, undefined, true, undefined, this),
|
|
57547
|
-
error && /* @__PURE__ */
|
|
57728
|
+
error && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57548
57729
|
flexDirection: "column",
|
|
57549
57730
|
children: [
|
|
57550
|
-
/* @__PURE__ */
|
|
57731
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57551
57732
|
color: "red",
|
|
57552
57733
|
children: [
|
|
57553
57734
|
"Error: ",
|
|
57554
57735
|
error
|
|
57555
57736
|
]
|
|
57556
57737
|
}, undefined, true, undefined, this),
|
|
57557
|
-
/* @__PURE__ */
|
|
57738
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57558
57739
|
dimColor: true,
|
|
57559
57740
|
children: "Press ESC to cancel"
|
|
57560
57741
|
}, undefined, false, undefined, this)
|
|
57561
57742
|
]
|
|
57562
57743
|
}, undefined, true, undefined, this),
|
|
57563
|
-
loading && !error && /* @__PURE__ */
|
|
57564
|
-
children: /* @__PURE__ */
|
|
57744
|
+
loading && !error && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57745
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57565
57746
|
dimColor: true,
|
|
57566
57747
|
children: "Loading agents..."
|
|
57567
57748
|
}, undefined, false, undefined, this)
|
|
57568
57749
|
}, undefined, false, undefined, this),
|
|
57569
|
-
!loading && !error && allAgents.length === 0 && /* @__PURE__ */
|
|
57750
|
+
!loading && !error && allAgents.length === 0 && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57570
57751
|
flexDirection: "column",
|
|
57571
57752
|
children: [
|
|
57572
|
-
/* @__PURE__ */
|
|
57753
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57573
57754
|
dimColor: true,
|
|
57574
57755
|
children: activeQuery ? "No matching agents found" : "No agents found"
|
|
57575
57756
|
}, undefined, false, undefined, this),
|
|
57576
|
-
/* @__PURE__ */
|
|
57757
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57577
57758
|
dimColor: true,
|
|
57578
57759
|
children: "Press ESC to cancel"
|
|
57579
57760
|
}, undefined, false, undefined, this)
|
|
57580
57761
|
]
|
|
57581
57762
|
}, undefined, true, undefined, this),
|
|
57582
|
-
!loading && !error && allAgents.length > 0 && /* @__PURE__ */
|
|
57763
|
+
!loading && !error && allAgents.length > 0 && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57583
57764
|
flexDirection: "column",
|
|
57584
57765
|
children: pageAgents.map((agent, index) => {
|
|
57585
57766
|
const isSelected = index === selectedIndex;
|
|
@@ -57591,51 +57772,51 @@ function ResumeSelector({
|
|
|
57591
57772
|
const fixedChars = 2 + 3 + (isCurrent ? 10 : 0);
|
|
57592
57773
|
const availableForId = Math.max(15, terminalWidth - nameLen - fixedChars);
|
|
57593
57774
|
const displayId = truncateAgentId2(agent.id, availableForId);
|
|
57594
|
-
return /* @__PURE__ */
|
|
57775
|
+
return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57595
57776
|
flexDirection: "column",
|
|
57596
57777
|
marginBottom: 1,
|
|
57597
57778
|
children: [
|
|
57598
|
-
/* @__PURE__ */
|
|
57779
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57599
57780
|
flexDirection: "row",
|
|
57600
57781
|
children: [
|
|
57601
|
-
/* @__PURE__ */
|
|
57782
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57602
57783
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
57603
57784
|
children: isSelected ? ">" : " "
|
|
57604
57785
|
}, undefined, false, undefined, this),
|
|
57605
|
-
/* @__PURE__ */
|
|
57786
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57606
57787
|
children: " "
|
|
57607
57788
|
}, undefined, false, undefined, this),
|
|
57608
|
-
/* @__PURE__ */
|
|
57789
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57609
57790
|
bold: isSelected,
|
|
57610
57791
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
57611
57792
|
children: agent.name || "Unnamed"
|
|
57612
57793
|
}, undefined, false, undefined, this),
|
|
57613
|
-
/* @__PURE__ */
|
|
57794
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57614
57795
|
dimColor: true,
|
|
57615
57796
|
children: [
|
|
57616
57797
|
" · ",
|
|
57617
57798
|
displayId
|
|
57618
57799
|
]
|
|
57619
57800
|
}, undefined, true, undefined, this),
|
|
57620
|
-
isCurrent && /* @__PURE__ */
|
|
57801
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57621
57802
|
color: colors.selector.itemCurrent,
|
|
57622
57803
|
children: " (current)"
|
|
57623
57804
|
}, undefined, false, undefined, this)
|
|
57624
57805
|
]
|
|
57625
57806
|
}, undefined, true, undefined, this),
|
|
57626
|
-
/* @__PURE__ */
|
|
57807
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57627
57808
|
flexDirection: "row",
|
|
57628
57809
|
marginLeft: 2,
|
|
57629
|
-
children: /* @__PURE__ */
|
|
57810
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57630
57811
|
dimColor: true,
|
|
57631
57812
|
italic: true,
|
|
57632
57813
|
children: agent.description || "No description"
|
|
57633
57814
|
}, undefined, false, undefined, this)
|
|
57634
57815
|
}, undefined, false, undefined, this),
|
|
57635
|
-
/* @__PURE__ */
|
|
57816
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57636
57817
|
flexDirection: "row",
|
|
57637
57818
|
marginLeft: 2,
|
|
57638
|
-
children: /* @__PURE__ */
|
|
57819
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57639
57820
|
dimColor: true,
|
|
57640
57821
|
children: [
|
|
57641
57822
|
relativeTime,
|
|
@@ -57652,12 +57833,12 @@ function ResumeSelector({
|
|
|
57652
57833
|
}, agent.id, true, undefined, this);
|
|
57653
57834
|
})
|
|
57654
57835
|
}, undefined, false, undefined, this),
|
|
57655
|
-
!loading && !error && allAgents.length > 0 && /* @__PURE__ */
|
|
57836
|
+
!loading && !error && allAgents.length > 0 && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57656
57837
|
flexDirection: "column",
|
|
57657
57838
|
marginTop: 1,
|
|
57658
57839
|
children: [
|
|
57659
|
-
/* @__PURE__ */
|
|
57660
|
-
children: /* @__PURE__ */
|
|
57840
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57841
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57661
57842
|
dimColor: true,
|
|
57662
57843
|
children: [
|
|
57663
57844
|
"Page ",
|
|
@@ -57667,8 +57848,8 @@ function ResumeSelector({
|
|
|
57667
57848
|
]
|
|
57668
57849
|
}, undefined, true, undefined, this)
|
|
57669
57850
|
}, undefined, false, undefined, this),
|
|
57670
|
-
/* @__PURE__ */
|
|
57671
|
-
children: /* @__PURE__ */
|
|
57851
|
+
/* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
|
|
57852
|
+
children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
|
|
57672
57853
|
dimColor: true,
|
|
57673
57854
|
children: "↑↓ navigate · Enter to switch agents · J/K page · Type + Enter to search"
|
|
57674
57855
|
}, undefined, false, undefined, this)
|
|
@@ -57678,14 +57859,14 @@ function ResumeSelector({
|
|
|
57678
57859
|
]
|
|
57679
57860
|
}, undefined, true, undefined, this);
|
|
57680
57861
|
}
|
|
57681
|
-
var
|
|
57862
|
+
var import_react47, jsx_dev_runtime26, DISPLAY_PAGE_SIZE3 = 5, FETCH_PAGE_SIZE = 20;
|
|
57682
57863
|
var init_ResumeSelector = __esm(async () => {
|
|
57683
57864
|
init_client2();
|
|
57684
57865
|
init_useTerminalWidth();
|
|
57685
57866
|
init_colors();
|
|
57686
57867
|
await init_build2();
|
|
57687
|
-
|
|
57688
|
-
|
|
57868
|
+
import_react47 = __toESM(require_react(), 1);
|
|
57869
|
+
jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57689
57870
|
});
|
|
57690
57871
|
|
|
57691
57872
|
// src/cli/components/SessionStats.tsx
|
|
@@ -57701,25 +57882,25 @@ function formatNumber(n) {
|
|
|
57701
57882
|
function SessionStats2({ stats, agentId }) {
|
|
57702
57883
|
const wallDuration = formatDuration(stats.totalWallMs);
|
|
57703
57884
|
const apiDuration = formatDuration(stats.totalApiMs);
|
|
57704
|
-
return /* @__PURE__ */
|
|
57885
|
+
return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
|
|
57705
57886
|
flexDirection: "column",
|
|
57706
57887
|
paddingTop: 1,
|
|
57707
57888
|
children: [
|
|
57708
|
-
/* @__PURE__ */
|
|
57889
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
|
|
57709
57890
|
dimColor: true,
|
|
57710
57891
|
children: [
|
|
57711
57892
|
"Total duration (API): ",
|
|
57712
57893
|
apiDuration
|
|
57713
57894
|
]
|
|
57714
57895
|
}, undefined, true, undefined, this),
|
|
57715
|
-
/* @__PURE__ */
|
|
57896
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
|
|
57716
57897
|
dimColor: true,
|
|
57717
57898
|
children: [
|
|
57718
57899
|
"Total duration (wall): ",
|
|
57719
57900
|
wallDuration
|
|
57720
57901
|
]
|
|
57721
57902
|
}, undefined, true, undefined, this),
|
|
57722
|
-
/* @__PURE__ */
|
|
57903
|
+
/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
|
|
57723
57904
|
dimColor: true,
|
|
57724
57905
|
children: [
|
|
57725
57906
|
"Usage: ",
|
|
@@ -57733,7 +57914,7 @@ function SessionStats2({ stats, agentId }) {
|
|
|
57733
57914
|
" output"
|
|
57734
57915
|
]
|
|
57735
57916
|
}, undefined, true, undefined, this),
|
|
57736
|
-
agentId && /* @__PURE__ */
|
|
57917
|
+
agentId && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
|
|
57737
57918
|
dimColor: true,
|
|
57738
57919
|
children: [
|
|
57739
57920
|
"Agent ID: ",
|
|
@@ -57743,39 +57924,39 @@ function SessionStats2({ stats, agentId }) {
|
|
|
57743
57924
|
]
|
|
57744
57925
|
}, undefined, true, undefined, this);
|
|
57745
57926
|
}
|
|
57746
|
-
var
|
|
57927
|
+
var jsx_dev_runtime27;
|
|
57747
57928
|
var init_SessionStats = __esm(async () => {
|
|
57748
57929
|
await init_build2();
|
|
57749
|
-
|
|
57930
|
+
jsx_dev_runtime27 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57750
57931
|
});
|
|
57751
57932
|
|
|
57752
57933
|
// src/cli/components/StatusMessage.tsx
|
|
57753
|
-
var
|
|
57934
|
+
var import_react48, jsx_dev_runtime28, StatusMessage;
|
|
57754
57935
|
var init_StatusMessage = __esm(async () => {
|
|
57755
57936
|
init_useTerminalWidth();
|
|
57756
57937
|
await init_build2();
|
|
57757
|
-
|
|
57758
|
-
|
|
57759
|
-
StatusMessage =
|
|
57938
|
+
import_react48 = __toESM(require_react(), 1);
|
|
57939
|
+
jsx_dev_runtime28 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57940
|
+
StatusMessage = import_react48.memo(({ line }) => {
|
|
57760
57941
|
const columns = useTerminalWidth();
|
|
57761
57942
|
const contentWidth = Math.max(0, columns - 2);
|
|
57762
|
-
return /* @__PURE__ */
|
|
57943
|
+
return /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
57763
57944
|
flexDirection: "column",
|
|
57764
|
-
children: line.lines.map((text, idx) => /* @__PURE__ */
|
|
57945
|
+
children: line.lines.map((text, idx) => /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
57765
57946
|
flexDirection: "row",
|
|
57766
57947
|
children: [
|
|
57767
|
-
/* @__PURE__ */
|
|
57948
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
57768
57949
|
width: 2,
|
|
57769
57950
|
flexShrink: 0,
|
|
57770
|
-
children: /* @__PURE__ */
|
|
57951
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
|
|
57771
57952
|
dimColor: true,
|
|
57772
57953
|
children: idx === 0 ? "●" : " "
|
|
57773
57954
|
}, undefined, false, undefined, this)
|
|
57774
57955
|
}, undefined, false, undefined, this),
|
|
57775
|
-
/* @__PURE__ */
|
|
57956
|
+
/* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Box_default, {
|
|
57776
57957
|
flexGrow: 1,
|
|
57777
57958
|
width: contentWidth,
|
|
57778
|
-
children: /* @__PURE__ */
|
|
57959
|
+
children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(Text, {
|
|
57779
57960
|
dimColor: true,
|
|
57780
57961
|
children: text
|
|
57781
57962
|
}, undefined, false, undefined, this)
|
|
@@ -57793,10 +57974,10 @@ function SystemPromptSelector({
|
|
|
57793
57974
|
onSelect,
|
|
57794
57975
|
onCancel
|
|
57795
57976
|
}) {
|
|
57796
|
-
const [showAll, setShowAll] =
|
|
57797
|
-
const [selectedIndex, setSelectedIndex] =
|
|
57798
|
-
const featuredPrompts =
|
|
57799
|
-
const visiblePrompts =
|
|
57977
|
+
const [showAll, setShowAll] = import_react49.useState(false);
|
|
57978
|
+
const [selectedIndex, setSelectedIndex] = import_react49.useState(0);
|
|
57979
|
+
const featuredPrompts = import_react49.useMemo(() => SYSTEM_PROMPTS2.filter((prompt) => prompt.isFeatured), []);
|
|
57980
|
+
const visiblePrompts = import_react49.useMemo(() => {
|
|
57800
57981
|
if (showAll)
|
|
57801
57982
|
return SYSTEM_PROMPTS2;
|
|
57802
57983
|
if (featuredPrompts.length > 0)
|
|
@@ -57825,46 +58006,46 @@ function SystemPromptSelector({
|
|
|
57825
58006
|
onCancel();
|
|
57826
58007
|
}
|
|
57827
58008
|
});
|
|
57828
|
-
return /* @__PURE__ */
|
|
58009
|
+
return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
57829
58010
|
flexDirection: "column",
|
|
57830
58011
|
gap: 1,
|
|
57831
58012
|
children: [
|
|
57832
|
-
/* @__PURE__ */
|
|
57833
|
-
children: /* @__PURE__ */
|
|
58013
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
58014
|
+
children: /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57834
58015
|
bold: true,
|
|
57835
58016
|
color: colors.selector.title,
|
|
57836
58017
|
children: "Select System Prompt (↑↓ to navigate, Enter to select, ESC to cancel)"
|
|
57837
58018
|
}, undefined, false, undefined, this)
|
|
57838
58019
|
}, undefined, false, undefined, this),
|
|
57839
|
-
/* @__PURE__ */
|
|
58020
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
57840
58021
|
flexDirection: "column",
|
|
57841
58022
|
children: [
|
|
57842
58023
|
visiblePrompts.map((prompt, index) => {
|
|
57843
58024
|
const isSelected = index === selectedIndex;
|
|
57844
58025
|
const isCurrent = prompt.id === currentPromptId;
|
|
57845
|
-
return /* @__PURE__ */
|
|
58026
|
+
return /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
57846
58027
|
flexDirection: "row",
|
|
57847
58028
|
gap: 1,
|
|
57848
58029
|
children: [
|
|
57849
|
-
/* @__PURE__ */
|
|
58030
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57850
58031
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
57851
58032
|
children: isSelected ? "›" : " "
|
|
57852
58033
|
}, undefined, false, undefined, this),
|
|
57853
|
-
/* @__PURE__ */
|
|
58034
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
57854
58035
|
flexDirection: "row",
|
|
57855
58036
|
children: [
|
|
57856
|
-
/* @__PURE__ */
|
|
58037
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57857
58038
|
bold: isSelected,
|
|
57858
58039
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
57859
58040
|
children: [
|
|
57860
58041
|
prompt.label,
|
|
57861
|
-
isCurrent && /* @__PURE__ */
|
|
58042
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57862
58043
|
color: colors.selector.itemCurrent,
|
|
57863
58044
|
children: " (current)"
|
|
57864
58045
|
}, undefined, false, undefined, this)
|
|
57865
58046
|
]
|
|
57866
58047
|
}, undefined, true, undefined, this),
|
|
57867
|
-
/* @__PURE__ */
|
|
58048
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57868
58049
|
dimColor: true,
|
|
57869
58050
|
children: [
|
|
57870
58051
|
" ",
|
|
@@ -57876,15 +58057,15 @@ function SystemPromptSelector({
|
|
|
57876
58057
|
]
|
|
57877
58058
|
}, prompt.id, true, undefined, this);
|
|
57878
58059
|
}),
|
|
57879
|
-
hasShowAllOption && /* @__PURE__ */
|
|
58060
|
+
hasShowAllOption && /* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Box_default, {
|
|
57880
58061
|
flexDirection: "row",
|
|
57881
58062
|
gap: 1,
|
|
57882
58063
|
children: [
|
|
57883
|
-
/* @__PURE__ */
|
|
58064
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57884
58065
|
color: selectedIndex === visiblePrompts.length ? colors.selector.itemHighlighted : undefined,
|
|
57885
58066
|
children: selectedIndex === visiblePrompts.length ? "›" : " "
|
|
57886
58067
|
}, undefined, false, undefined, this),
|
|
57887
|
-
/* @__PURE__ */
|
|
58068
|
+
/* @__PURE__ */ jsx_dev_runtime29.jsxDEV(Text, {
|
|
57888
58069
|
dimColor: true,
|
|
57889
58070
|
children: "Show all prompts"
|
|
57890
58071
|
}, undefined, false, undefined, this)
|
|
@@ -57895,13 +58076,13 @@ function SystemPromptSelector({
|
|
|
57895
58076
|
]
|
|
57896
58077
|
}, undefined, true, undefined, this);
|
|
57897
58078
|
}
|
|
57898
|
-
var
|
|
58079
|
+
var import_react49, jsx_dev_runtime29;
|
|
57899
58080
|
var init_SystemPromptSelector = __esm(async () => {
|
|
57900
58081
|
init_promptAssets2();
|
|
57901
58082
|
init_colors();
|
|
57902
58083
|
await init_build2();
|
|
57903
|
-
|
|
57904
|
-
|
|
58084
|
+
import_react49 = __toESM(require_react(), 1);
|
|
58085
|
+
jsx_dev_runtime29 = __toESM(require_jsx_dev_runtime(), 1);
|
|
57905
58086
|
});
|
|
57906
58087
|
|
|
57907
58088
|
// src/cli/helpers/formatArgsDisplay.ts
|
|
@@ -57973,19 +58154,19 @@ function formatArgsDisplay(argsJson) {
|
|
|
57973
58154
|
var isRecord4 = (v) => typeof v === "object" && v !== null;
|
|
57974
58155
|
|
|
57975
58156
|
// src/cli/components/PlanRenderer.tsx
|
|
57976
|
-
var
|
|
58157
|
+
var jsx_dev_runtime30, PlanRenderer = ({
|
|
57977
58158
|
plan,
|
|
57978
58159
|
explanation
|
|
57979
58160
|
}) => {
|
|
57980
|
-
return /* @__PURE__ */
|
|
58161
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
57981
58162
|
flexDirection: "column",
|
|
57982
58163
|
children: [
|
|
57983
|
-
explanation && /* @__PURE__ */
|
|
58164
|
+
explanation && /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
57984
58165
|
children: [
|
|
57985
|
-
/* @__PURE__ */
|
|
58166
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
57986
58167
|
children: " ⎿ "
|
|
57987
58168
|
}, undefined, false, undefined, this),
|
|
57988
|
-
/* @__PURE__ */
|
|
58169
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
57989
58170
|
italic: true,
|
|
57990
58171
|
dimColor: true,
|
|
57991
58172
|
children: explanation
|
|
@@ -57996,7 +58177,7 @@ var jsx_dev_runtime29, PlanRenderer = ({
|
|
|
57996
58177
|
const checkbox = item.status === "completed" ? "☒" : "☐";
|
|
57997
58178
|
let textElement;
|
|
57998
58179
|
if (item.status === "completed") {
|
|
57999
|
-
textElement = /* @__PURE__ */
|
|
58180
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
58000
58181
|
color: colors.todo.completed,
|
|
58001
58182
|
strikethrough: true,
|
|
58002
58183
|
children: [
|
|
@@ -58006,7 +58187,7 @@ var jsx_dev_runtime29, PlanRenderer = ({
|
|
|
58006
58187
|
]
|
|
58007
58188
|
}, undefined, true, undefined, this);
|
|
58008
58189
|
} else if (item.status === "in_progress") {
|
|
58009
|
-
textElement = /* @__PURE__ */
|
|
58190
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
58010
58191
|
color: colors.todo.inProgress,
|
|
58011
58192
|
bold: true,
|
|
58012
58193
|
children: [
|
|
@@ -58016,7 +58197,7 @@ var jsx_dev_runtime29, PlanRenderer = ({
|
|
|
58016
58197
|
]
|
|
58017
58198
|
}, undefined, true, undefined, this);
|
|
58018
58199
|
} else {
|
|
58019
|
-
textElement = /* @__PURE__ */
|
|
58200
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
58020
58201
|
children: [
|
|
58021
58202
|
checkbox,
|
|
58022
58203
|
" ",
|
|
@@ -58025,9 +58206,9 @@ var jsx_dev_runtime29, PlanRenderer = ({
|
|
|
58025
58206
|
}, undefined, true, undefined, this);
|
|
58026
58207
|
}
|
|
58027
58208
|
const prefix = index === 0 && !explanation ? " ⎿ " : " ";
|
|
58028
|
-
return /* @__PURE__ */
|
|
58209
|
+
return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Box_default, {
|
|
58029
58210
|
children: [
|
|
58030
|
-
/* @__PURE__ */
|
|
58211
|
+
/* @__PURE__ */ jsx_dev_runtime30.jsxDEV(Text, {
|
|
58031
58212
|
children: prefix
|
|
58032
58213
|
}, undefined, false, undefined, this),
|
|
58033
58214
|
textElement
|
|
@@ -58040,18 +58221,18 @@ var jsx_dev_runtime29, PlanRenderer = ({
|
|
|
58040
58221
|
var init_PlanRenderer = __esm(async () => {
|
|
58041
58222
|
init_colors();
|
|
58042
58223
|
await init_build2();
|
|
58043
|
-
|
|
58224
|
+
jsx_dev_runtime30 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58044
58225
|
});
|
|
58045
58226
|
|
|
58046
58227
|
// src/cli/components/TodoRenderer.tsx
|
|
58047
|
-
var
|
|
58048
|
-
return /* @__PURE__ */
|
|
58228
|
+
var jsx_dev_runtime31, TodoRenderer = ({ todos }) => {
|
|
58229
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
58049
58230
|
flexDirection: "column",
|
|
58050
58231
|
children: todos.map((todo, index) => {
|
|
58051
58232
|
const checkbox = todo.status === "completed" ? "☒" : "☐";
|
|
58052
58233
|
let textElement;
|
|
58053
58234
|
if (todo.status === "completed") {
|
|
58054
|
-
textElement = /* @__PURE__ */
|
|
58235
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text, {
|
|
58055
58236
|
color: colors.todo.completed,
|
|
58056
58237
|
strikethrough: true,
|
|
58057
58238
|
children: [
|
|
@@ -58061,7 +58242,7 @@ var jsx_dev_runtime30, TodoRenderer = ({ todos }) => {
|
|
|
58061
58242
|
]
|
|
58062
58243
|
}, undefined, true, undefined, this);
|
|
58063
58244
|
} else if (todo.status === "in_progress") {
|
|
58064
|
-
textElement = /* @__PURE__ */
|
|
58245
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text, {
|
|
58065
58246
|
color: colors.todo.inProgress,
|
|
58066
58247
|
bold: true,
|
|
58067
58248
|
children: [
|
|
@@ -58071,7 +58252,7 @@ var jsx_dev_runtime30, TodoRenderer = ({ todos }) => {
|
|
|
58071
58252
|
]
|
|
58072
58253
|
}, undefined, true, undefined, this);
|
|
58073
58254
|
} else {
|
|
58074
|
-
textElement = /* @__PURE__ */
|
|
58255
|
+
textElement = /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text, {
|
|
58075
58256
|
children: [
|
|
58076
58257
|
checkbox,
|
|
58077
58258
|
" ",
|
|
@@ -58080,9 +58261,9 @@ var jsx_dev_runtime30, TodoRenderer = ({ todos }) => {
|
|
|
58080
58261
|
}, undefined, true, undefined, this);
|
|
58081
58262
|
}
|
|
58082
58263
|
const prefix = index === 0 ? " ⎿ " : " ";
|
|
58083
|
-
return /* @__PURE__ */
|
|
58264
|
+
return /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Box_default, {
|
|
58084
58265
|
children: [
|
|
58085
|
-
/* @__PURE__ */
|
|
58266
|
+
/* @__PURE__ */ jsx_dev_runtime31.jsxDEV(Text, {
|
|
58086
58267
|
children: prefix
|
|
58087
58268
|
}, undefined, false, undefined, this),
|
|
58088
58269
|
textElement
|
|
@@ -58094,19 +58275,19 @@ var jsx_dev_runtime30, TodoRenderer = ({ todos }) => {
|
|
|
58094
58275
|
var init_TodoRenderer = __esm(async () => {
|
|
58095
58276
|
init_colors();
|
|
58096
58277
|
await init_build2();
|
|
58097
|
-
|
|
58278
|
+
jsx_dev_runtime31 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58098
58279
|
});
|
|
58099
58280
|
|
|
58100
58281
|
// src/cli/components/ToolCallMessageRich.tsx
|
|
58101
|
-
var
|
|
58282
|
+
var import_react50, jsx_dev_runtime32, BlinkDot2 = ({
|
|
58102
58283
|
color = colors.tool.pending
|
|
58103
58284
|
}) => {
|
|
58104
|
-
const [on, setOn] =
|
|
58105
|
-
|
|
58285
|
+
const [on, setOn] = import_react50.useState(true);
|
|
58286
|
+
import_react50.useEffect(() => {
|
|
58106
58287
|
const t = setInterval(() => setOn((v) => !v), 400);
|
|
58107
58288
|
return () => clearInterval(t);
|
|
58108
58289
|
}, []);
|
|
58109
|
-
return /* @__PURE__ */
|
|
58290
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58110
58291
|
color,
|
|
58111
58292
|
children: on ? "●" : " "
|
|
58112
58293
|
}, undefined, false, undefined, this);
|
|
@@ -58121,9 +58302,9 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58121
58302
|
init_PlanRenderer(),
|
|
58122
58303
|
init_TodoRenderer()
|
|
58123
58304
|
]);
|
|
58124
|
-
|
|
58125
|
-
|
|
58126
|
-
ToolCallMessage =
|
|
58305
|
+
import_react50 = __toESM(require_react(), 1);
|
|
58306
|
+
jsx_dev_runtime32 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58307
|
+
ToolCallMessage = import_react50.memo(({ line }) => {
|
|
58127
58308
|
const columns = useTerminalWidth();
|
|
58128
58309
|
const rawName = line.name ?? "?";
|
|
58129
58310
|
const argsText = line.argsText ?? "...";
|
|
@@ -58217,31 +58398,31 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58217
58398
|
const getDotElement = () => {
|
|
58218
58399
|
switch (line.phase) {
|
|
58219
58400
|
case "streaming":
|
|
58220
|
-
return /* @__PURE__ */
|
|
58401
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58221
58402
|
color: colors.tool.streaming,
|
|
58222
58403
|
children: "●"
|
|
58223
58404
|
}, undefined, false, undefined, this);
|
|
58224
58405
|
case "ready":
|
|
58225
|
-
return /* @__PURE__ */
|
|
58406
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(BlinkDot2, {
|
|
58226
58407
|
color: colors.tool.pending
|
|
58227
58408
|
}, undefined, false, undefined, this);
|
|
58228
58409
|
case "running":
|
|
58229
|
-
return /* @__PURE__ */
|
|
58410
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(BlinkDot2, {
|
|
58230
58411
|
color: colors.tool.running
|
|
58231
58412
|
}, undefined, false, undefined, this);
|
|
58232
58413
|
case "finished":
|
|
58233
58414
|
if (line.resultOk === false) {
|
|
58234
|
-
return /* @__PURE__ */
|
|
58415
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58235
58416
|
color: colors.tool.error,
|
|
58236
58417
|
children: "●"
|
|
58237
58418
|
}, undefined, false, undefined, this);
|
|
58238
58419
|
}
|
|
58239
|
-
return /* @__PURE__ */
|
|
58420
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58240
58421
|
color: colors.tool.completed,
|
|
58241
58422
|
children: "●"
|
|
58242
58423
|
}, undefined, false, undefined, this);
|
|
58243
58424
|
default:
|
|
58244
|
-
return /* @__PURE__ */
|
|
58425
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58245
58426
|
children: "●"
|
|
58246
58427
|
}, undefined, false, undefined, this);
|
|
58247
58428
|
}
|
|
@@ -58253,20 +58434,20 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58253
58434
|
const prefixWidth = 5;
|
|
58254
58435
|
const contentWidth = Math.max(0, columns - prefixWidth);
|
|
58255
58436
|
if (line.resultText === "Running...") {
|
|
58256
|
-
return /* @__PURE__ */
|
|
58437
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58257
58438
|
flexDirection: "row",
|
|
58258
58439
|
children: [
|
|
58259
|
-
/* @__PURE__ */
|
|
58440
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58260
58441
|
width: prefixWidth,
|
|
58261
58442
|
flexShrink: 0,
|
|
58262
|
-
children: /* @__PURE__ */
|
|
58443
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58263
58444
|
children: prefix
|
|
58264
58445
|
}, undefined, false, undefined, this)
|
|
58265
58446
|
}, undefined, false, undefined, this),
|
|
58266
|
-
/* @__PURE__ */
|
|
58447
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58267
58448
|
flexGrow: 1,
|
|
58268
58449
|
width: contentWidth,
|
|
58269
|
-
children: /* @__PURE__ */
|
|
58450
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58270
58451
|
dimColor: true,
|
|
58271
58452
|
children: "Running..."
|
|
58272
58453
|
}, undefined, false, undefined, this)
|
|
@@ -58275,20 +58456,20 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58275
58456
|
}, undefined, true, undefined, this);
|
|
58276
58457
|
}
|
|
58277
58458
|
if (line.resultText === "Interrupted by user") {
|
|
58278
|
-
return /* @__PURE__ */
|
|
58459
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58279
58460
|
flexDirection: "row",
|
|
58280
58461
|
children: [
|
|
58281
|
-
/* @__PURE__ */
|
|
58462
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58282
58463
|
width: prefixWidth,
|
|
58283
58464
|
flexShrink: 0,
|
|
58284
|
-
children: /* @__PURE__ */
|
|
58465
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58285
58466
|
children: prefix
|
|
58286
58467
|
}, undefined, false, undefined, this)
|
|
58287
58468
|
}, undefined, false, undefined, this),
|
|
58288
|
-
/* @__PURE__ */
|
|
58469
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58289
58470
|
flexGrow: 1,
|
|
58290
58471
|
width: contentWidth,
|
|
58291
|
-
children: /* @__PURE__ */
|
|
58472
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58292
58473
|
color: colors.status.interrupt,
|
|
58293
58474
|
children: "Interrupted by user"
|
|
58294
58475
|
}, undefined, false, undefined, this)
|
|
@@ -58311,7 +58492,7 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58311
58492
|
const priority = rec.priority === "high" ? "high" : rec.priority === "medium" ? "medium" : rec.priority === "low" ? "low" : undefined;
|
|
58312
58493
|
return { content, status, id, priority };
|
|
58313
58494
|
});
|
|
58314
|
-
return /* @__PURE__ */
|
|
58495
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(TodoRenderer, {
|
|
58315
58496
|
todos: safeTodos
|
|
58316
58497
|
}, undefined, false, undefined, this);
|
|
58317
58498
|
}
|
|
@@ -58329,7 +58510,7 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58329
58510
|
return { step, status };
|
|
58330
58511
|
});
|
|
58331
58512
|
const explanation = typeof parsedArgs.explanation === "string" ? parsedArgs.explanation : undefined;
|
|
58332
|
-
return /* @__PURE__ */
|
|
58513
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(PlanRenderer, {
|
|
58333
58514
|
plan: safePlan,
|
|
58334
58515
|
explanation
|
|
58335
58516
|
}, undefined, false, undefined, this);
|
|
@@ -58349,59 +58530,59 @@ var init_ToolCallMessageRich = __esm(async () => {
|
|
|
58349
58530
|
const reason = match3?.[1]?.trim() || "(empty)";
|
|
58350
58531
|
displayText = `User rejected the tool call with reason: ${reason}`;
|
|
58351
58532
|
}
|
|
58352
|
-
return /* @__PURE__ */
|
|
58533
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58353
58534
|
flexDirection: "row",
|
|
58354
58535
|
children: [
|
|
58355
|
-
/* @__PURE__ */
|
|
58536
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58356
58537
|
width: prefixWidth,
|
|
58357
58538
|
flexShrink: 0,
|
|
58358
|
-
children: /* @__PURE__ */
|
|
58539
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58359
58540
|
children: prefix
|
|
58360
58541
|
}, undefined, false, undefined, this)
|
|
58361
58542
|
}, undefined, false, undefined, this),
|
|
58362
|
-
/* @__PURE__ */
|
|
58543
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58363
58544
|
flexGrow: 1,
|
|
58364
58545
|
width: contentWidth,
|
|
58365
|
-
children: isError ? /* @__PURE__ */
|
|
58546
|
+
children: isError ? /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58366
58547
|
color: colors.status.error,
|
|
58367
58548
|
children: displayText
|
|
58368
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
58549
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(MarkdownDisplay, {
|
|
58369
58550
|
text: displayText
|
|
58370
58551
|
}, undefined, false, undefined, this)
|
|
58371
58552
|
}, undefined, false, undefined, this)
|
|
58372
58553
|
]
|
|
58373
58554
|
}, undefined, true, undefined, this);
|
|
58374
58555
|
};
|
|
58375
|
-
return /* @__PURE__ */
|
|
58556
|
+
return /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58376
58557
|
flexDirection: "column",
|
|
58377
58558
|
children: [
|
|
58378
|
-
/* @__PURE__ */
|
|
58559
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58379
58560
|
flexDirection: "row",
|
|
58380
58561
|
children: [
|
|
58381
|
-
/* @__PURE__ */
|
|
58562
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58382
58563
|
width: 2,
|
|
58383
58564
|
flexShrink: 0,
|
|
58384
58565
|
children: [
|
|
58385
58566
|
getDotElement(),
|
|
58386
|
-
/* @__PURE__ */
|
|
58567
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {}, undefined, false, undefined, this)
|
|
58387
58568
|
]
|
|
58388
58569
|
}, undefined, true, undefined, this),
|
|
58389
|
-
/* @__PURE__ */
|
|
58570
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58390
58571
|
flexGrow: 1,
|
|
58391
58572
|
width: rightWidth,
|
|
58392
|
-
children: fallback ? /* @__PURE__ */
|
|
58573
|
+
children: fallback ? /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58393
58574
|
wrap: "wrap",
|
|
58394
58575
|
children: `${displayName}${args}`
|
|
58395
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
58576
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58396
58577
|
flexDirection: "row",
|
|
58397
58578
|
children: [
|
|
58398
|
-
/* @__PURE__ */
|
|
58579
|
+
/* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58399
58580
|
children: displayName
|
|
58400
58581
|
}, undefined, false, undefined, this),
|
|
58401
|
-
args ? /* @__PURE__ */
|
|
58582
|
+
args ? /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Box_default, {
|
|
58402
58583
|
flexGrow: 1,
|
|
58403
58584
|
width: Math.max(0, rightWidth - displayName.length),
|
|
58404
|
-
children: /* @__PURE__ */
|
|
58585
|
+
children: /* @__PURE__ */ jsx_dev_runtime32.jsxDEV(Text, {
|
|
58405
58586
|
wrap: "wrap",
|
|
58406
58587
|
children: args
|
|
58407
58588
|
}, undefined, false, undefined, this)
|
|
@@ -58424,10 +58605,10 @@ function ToolsetSelector({
|
|
|
58424
58605
|
onSelect,
|
|
58425
58606
|
onCancel
|
|
58426
58607
|
}) {
|
|
58427
|
-
const [showAll, setShowAll] =
|
|
58428
|
-
const [selectedIndex, setSelectedIndex] =
|
|
58429
|
-
const featuredToolsets =
|
|
58430
|
-
const visibleToolsets =
|
|
58608
|
+
const [showAll, setShowAll] = import_react51.useState(false);
|
|
58609
|
+
const [selectedIndex, setSelectedIndex] = import_react51.useState(0);
|
|
58610
|
+
const featuredToolsets = import_react51.useMemo(() => toolsets.filter((toolset) => toolset.isFeatured), []);
|
|
58611
|
+
const visibleToolsets = import_react51.useMemo(() => {
|
|
58431
58612
|
if (showAll)
|
|
58432
58613
|
return toolsets;
|
|
58433
58614
|
if (featuredToolsets.length > 0)
|
|
@@ -58456,44 +58637,44 @@ function ToolsetSelector({
|
|
|
58456
58637
|
onCancel();
|
|
58457
58638
|
}
|
|
58458
58639
|
});
|
|
58459
|
-
return /* @__PURE__ */
|
|
58640
|
+
return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58460
58641
|
flexDirection: "column",
|
|
58461
58642
|
gap: 1,
|
|
58462
58643
|
children: [
|
|
58463
|
-
/* @__PURE__ */
|
|
58464
|
-
children: /* @__PURE__ */
|
|
58644
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58645
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58465
58646
|
bold: true,
|
|
58466
58647
|
color: colors.selector.title,
|
|
58467
58648
|
children: "Select Toolset (↑↓ to navigate, Enter to select, ESC to cancel)"
|
|
58468
58649
|
}, undefined, false, undefined, this)
|
|
58469
58650
|
}, undefined, false, undefined, this),
|
|
58470
|
-
/* @__PURE__ */
|
|
58651
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58471
58652
|
flexDirection: "column",
|
|
58472
58653
|
children: [
|
|
58473
58654
|
visibleToolsets.map((toolset, index) => {
|
|
58474
58655
|
const isSelected = index === selectedIndex;
|
|
58475
58656
|
const isCurrent = toolset.id === currentToolset;
|
|
58476
|
-
return /* @__PURE__ */
|
|
58657
|
+
return /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58477
58658
|
flexDirection: "column",
|
|
58478
|
-
children: /* @__PURE__ */
|
|
58659
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58479
58660
|
flexDirection: "row",
|
|
58480
58661
|
gap: 1,
|
|
58481
58662
|
children: [
|
|
58482
|
-
/* @__PURE__ */
|
|
58663
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58483
58664
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
58484
58665
|
children: isSelected ? "›" : " "
|
|
58485
58666
|
}, undefined, false, undefined, this),
|
|
58486
|
-
/* @__PURE__ */
|
|
58667
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58487
58668
|
flexDirection: "column",
|
|
58488
58669
|
children: [
|
|
58489
|
-
/* @__PURE__ */
|
|
58670
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58490
58671
|
flexDirection: "row",
|
|
58491
|
-
children: /* @__PURE__ */
|
|
58672
|
+
children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58492
58673
|
bold: isSelected,
|
|
58493
58674
|
color: isSelected ? colors.selector.itemHighlighted : undefined,
|
|
58494
58675
|
children: [
|
|
58495
58676
|
toolset.label,
|
|
58496
|
-
isCurrent && /* @__PURE__ */
|
|
58677
|
+
isCurrent && /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58497
58678
|
color: colors.selector.itemCurrent,
|
|
58498
58679
|
children: [
|
|
58499
58680
|
" ",
|
|
@@ -58503,7 +58684,7 @@ function ToolsetSelector({
|
|
|
58503
58684
|
]
|
|
58504
58685
|
}, undefined, true, undefined, this)
|
|
58505
58686
|
}, undefined, false, undefined, this),
|
|
58506
|
-
/* @__PURE__ */
|
|
58687
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58507
58688
|
dimColor: true,
|
|
58508
58689
|
children: [
|
|
58509
58690
|
" ",
|
|
@@ -58516,15 +58697,15 @@ function ToolsetSelector({
|
|
|
58516
58697
|
}, undefined, true, undefined, this)
|
|
58517
58698
|
}, toolset.id, false, undefined, this);
|
|
58518
58699
|
}),
|
|
58519
|
-
hasShowAllOption && /* @__PURE__ */
|
|
58700
|
+
hasShowAllOption && /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Box_default, {
|
|
58520
58701
|
flexDirection: "row",
|
|
58521
58702
|
gap: 1,
|
|
58522
58703
|
children: [
|
|
58523
|
-
/* @__PURE__ */
|
|
58704
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58524
58705
|
color: selectedIndex === visibleToolsets.length ? colors.selector.itemHighlighted : undefined,
|
|
58525
58706
|
children: selectedIndex === visibleToolsets.length ? "›" : " "
|
|
58526
58707
|
}, undefined, false, undefined, this),
|
|
58527
|
-
/* @__PURE__ */
|
|
58708
|
+
/* @__PURE__ */ jsx_dev_runtime33.jsxDEV(Text, {
|
|
58528
58709
|
dimColor: true,
|
|
58529
58710
|
children: "Show all toolsets"
|
|
58530
58711
|
}, undefined, false, undefined, this)
|
|
@@ -58535,12 +58716,12 @@ function ToolsetSelector({
|
|
|
58535
58716
|
]
|
|
58536
58717
|
}, undefined, true, undefined, this);
|
|
58537
58718
|
}
|
|
58538
|
-
var
|
|
58719
|
+
var import_react51, jsx_dev_runtime33, toolsets;
|
|
58539
58720
|
var init_ToolsetSelector = __esm(async () => {
|
|
58540
58721
|
init_colors();
|
|
58541
58722
|
await init_build2();
|
|
58542
|
-
|
|
58543
|
-
|
|
58723
|
+
import_react51 = __toESM(require_react(), 1);
|
|
58724
|
+
jsx_dev_runtime33 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58544
58725
|
toolsets = [
|
|
58545
58726
|
{
|
|
58546
58727
|
id: "default",
|
|
@@ -58626,35 +58807,35 @@ var init_ToolsetSelector = __esm(async () => {
|
|
|
58626
58807
|
});
|
|
58627
58808
|
|
|
58628
58809
|
// src/cli/components/UserMessageRich.tsx
|
|
58629
|
-
var
|
|
58810
|
+
var import_react52, jsx_dev_runtime34, UserMessage;
|
|
58630
58811
|
var init_UserMessageRich = __esm(async () => {
|
|
58631
58812
|
init_useTerminalWidth();
|
|
58632
58813
|
await __promiseAll([
|
|
58633
58814
|
init_build2(),
|
|
58634
58815
|
init_MarkdownDisplay()
|
|
58635
58816
|
]);
|
|
58636
|
-
|
|
58637
|
-
|
|
58638
|
-
UserMessage =
|
|
58817
|
+
import_react52 = __toESM(require_react(), 1);
|
|
58818
|
+
jsx_dev_runtime34 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58819
|
+
UserMessage = import_react52.memo(({ line }) => {
|
|
58639
58820
|
const columns = useTerminalWidth();
|
|
58640
58821
|
const contentWidth = Math.max(0, columns - 2);
|
|
58641
|
-
return /* @__PURE__ */
|
|
58822
|
+
return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
58642
58823
|
flexDirection: "row",
|
|
58643
58824
|
children: [
|
|
58644
|
-
/* @__PURE__ */
|
|
58825
|
+
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
58645
58826
|
width: 2,
|
|
58646
58827
|
flexShrink: 0,
|
|
58647
|
-
children: /* @__PURE__ */
|
|
58828
|
+
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Text, {
|
|
58648
58829
|
children: [
|
|
58649
58830
|
">",
|
|
58650
58831
|
" "
|
|
58651
58832
|
]
|
|
58652
58833
|
}, undefined, true, undefined, this)
|
|
58653
58834
|
}, undefined, false, undefined, this),
|
|
58654
|
-
/* @__PURE__ */
|
|
58835
|
+
/* @__PURE__ */ jsx_dev_runtime34.jsxDEV(Box_default, {
|
|
58655
58836
|
flexGrow: 1,
|
|
58656
58837
|
width: contentWidth,
|
|
58657
|
-
children: /* @__PURE__ */
|
|
58838
|
+
children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(MarkdownDisplay, {
|
|
58658
58839
|
text: line.text
|
|
58659
58840
|
}, undefined, false, undefined, this)
|
|
58660
58841
|
}, undefined, false, undefined, this)
|
|
@@ -58725,31 +58906,31 @@ function WelcomeScreen({
|
|
|
58725
58906
|
const model = fullModel?.split("/").pop();
|
|
58726
58907
|
const authMethod = getAuthMethod();
|
|
58727
58908
|
const authDisplay = authMethod === "url" ? process.env.LETTA_BASE_URL || "Custom URL" : authMethod === "api-key" ? "API key auth" : "OAuth";
|
|
58728
|
-
return /* @__PURE__ */
|
|
58909
|
+
return /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
58729
58910
|
flexDirection: "row",
|
|
58730
58911
|
marginTop: 1,
|
|
58731
58912
|
children: [
|
|
58732
|
-
/* @__PURE__ */
|
|
58913
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
58733
58914
|
flexDirection: "column",
|
|
58734
58915
|
paddingLeft: 1,
|
|
58735
58916
|
paddingRight: 2,
|
|
58736
|
-
children: logoLines.map((line, idx) => /* @__PURE__ */
|
|
58917
|
+
children: logoLines.map((line, idx) => /* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text, {
|
|
58737
58918
|
bold: true,
|
|
58738
58919
|
color: colors.welcome.accent,
|
|
58739
58920
|
children: idx === 0 ? ` ${line}` : line
|
|
58740
58921
|
}, idx, false, undefined, this))
|
|
58741
58922
|
}, undefined, false, undefined, this),
|
|
58742
|
-
/* @__PURE__ */
|
|
58923
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
58743
58924
|
flexDirection: "column",
|
|
58744
58925
|
marginTop: 0,
|
|
58745
58926
|
children: [
|
|
58746
|
-
/* @__PURE__ */
|
|
58927
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Box_default, {
|
|
58747
58928
|
children: [
|
|
58748
|
-
/* @__PURE__ */
|
|
58929
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text, {
|
|
58749
58930
|
bold: true,
|
|
58750
58931
|
children: "Letta Code"
|
|
58751
58932
|
}, undefined, false, undefined, this),
|
|
58752
|
-
/* @__PURE__ */
|
|
58933
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text, {
|
|
58753
58934
|
color: "gray",
|
|
58754
58935
|
children: [
|
|
58755
58936
|
" v",
|
|
@@ -58758,11 +58939,11 @@ function WelcomeScreen({
|
|
|
58758
58939
|
}, undefined, true, undefined, this)
|
|
58759
58940
|
]
|
|
58760
58941
|
}, undefined, true, undefined, this),
|
|
58761
|
-
/* @__PURE__ */
|
|
58942
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text, {
|
|
58762
58943
|
color: "gray",
|
|
58763
58944
|
children: model ? `${model} · ${authDisplay}` : authDisplay
|
|
58764
58945
|
}, undefined, false, undefined, this),
|
|
58765
|
-
/* @__PURE__ */
|
|
58946
|
+
/* @__PURE__ */ jsx_dev_runtime35.jsxDEV(Text, {
|
|
58766
58947
|
color: "gray",
|
|
58767
58948
|
children: loadingState === "ready" ? tildePath : getLoadingMessage(loadingState, !!continueSession)
|
|
58768
58949
|
}, undefined, false, undefined, this)
|
|
@@ -58791,14 +58972,14 @@ function getLoadingMessage(loadingState, continueSession) {
|
|
|
58791
58972
|
return "Loading...";
|
|
58792
58973
|
}
|
|
58793
58974
|
}
|
|
58794
|
-
var
|
|
58975
|
+
var jsx_dev_runtime35;
|
|
58795
58976
|
var init_WelcomeScreen = __esm(async () => {
|
|
58796
58977
|
init_settings_manager();
|
|
58797
58978
|
init_version();
|
|
58798
58979
|
init_useTerminalWidth();
|
|
58799
58980
|
init_colors();
|
|
58800
58981
|
await init_build2();
|
|
58801
|
-
|
|
58982
|
+
jsx_dev_runtime35 = __toESM(require_jsx_dev_runtime(), 1);
|
|
58802
58983
|
});
|
|
58803
58984
|
|
|
58804
58985
|
// src/cli/helpers/backfill.ts
|
|
@@ -59127,8 +59308,8 @@ var init_thinkingMessages = __esm(() => {
|
|
|
59127
59308
|
// src/cli/hooks/useSuspend/useSuspend.ts
|
|
59128
59309
|
function useSuspend() {
|
|
59129
59310
|
const { stdin, isRawModeSupported } = use_stdin_default();
|
|
59130
|
-
const [resumeKey, setResumeKey] =
|
|
59131
|
-
const forceUpdate =
|
|
59311
|
+
const [resumeKey, setResumeKey] = import_react53.useState(0);
|
|
59312
|
+
const forceUpdate = import_react53.useCallback(() => {
|
|
59132
59313
|
setResumeKey((prev) => prev + 1);
|
|
59133
59314
|
}, []);
|
|
59134
59315
|
use_input_default((input, key) => {
|
|
@@ -59140,7 +59321,7 @@ function useSuspend() {
|
|
|
59140
59321
|
return;
|
|
59141
59322
|
}
|
|
59142
59323
|
});
|
|
59143
|
-
|
|
59324
|
+
import_react53.useEffect(() => {
|
|
59144
59325
|
const handleResume = () => {
|
|
59145
59326
|
if (stdin && isRawModeSupported && stdin.setRawMode) {
|
|
59146
59327
|
stdin.setRawMode(true);
|
|
@@ -59155,10 +59336,10 @@ function useSuspend() {
|
|
|
59155
59336
|
}, [stdin, isRawModeSupported, forceUpdate]);
|
|
59156
59337
|
return resumeKey;
|
|
59157
59338
|
}
|
|
59158
|
-
var
|
|
59339
|
+
var import_react53;
|
|
59159
59340
|
var init_useSuspend = __esm(async () => {
|
|
59160
59341
|
await init_build2();
|
|
59161
|
-
|
|
59342
|
+
import_react53 = __toESM(require_react(), 1);
|
|
59162
59343
|
});
|
|
59163
59344
|
|
|
59164
59345
|
// src/tools/toolset.ts
|
|
@@ -59433,76 +59614,76 @@ function App2({
|
|
|
59433
59614
|
tokenStreaming = false,
|
|
59434
59615
|
agentProvenance = null
|
|
59435
59616
|
}) {
|
|
59436
|
-
const [agentId, setAgentId] =
|
|
59437
|
-
const [agentState, setAgentState] =
|
|
59438
|
-
const agentIdRef =
|
|
59439
|
-
|
|
59617
|
+
const [agentId, setAgentId] = import_react54.useState(initialAgentId);
|
|
59618
|
+
const [agentState, setAgentState] = import_react54.useState(initialAgentState);
|
|
59619
|
+
const agentIdRef = import_react54.useRef(agentId);
|
|
59620
|
+
import_react54.useEffect(() => {
|
|
59440
59621
|
agentIdRef.current = agentId;
|
|
59441
59622
|
}, [agentId]);
|
|
59442
59623
|
const resumeKey = useSuspend();
|
|
59443
|
-
const prevInitialAgentIdRef =
|
|
59444
|
-
const prevInitialAgentStateRef =
|
|
59445
|
-
|
|
59624
|
+
const prevInitialAgentIdRef = import_react54.useRef(initialAgentId);
|
|
59625
|
+
const prevInitialAgentStateRef = import_react54.useRef(initialAgentState);
|
|
59626
|
+
import_react54.useEffect(() => {
|
|
59446
59627
|
if (initialAgentId !== prevInitialAgentIdRef.current) {
|
|
59447
59628
|
prevInitialAgentIdRef.current = initialAgentId;
|
|
59448
59629
|
agentIdRef.current = initialAgentId;
|
|
59449
59630
|
setAgentId(initialAgentId);
|
|
59450
59631
|
}
|
|
59451
59632
|
}, [initialAgentId]);
|
|
59452
|
-
|
|
59633
|
+
import_react54.useEffect(() => {
|
|
59453
59634
|
if (initialAgentState !== prevInitialAgentStateRef.current) {
|
|
59454
59635
|
prevInitialAgentStateRef.current = initialAgentState;
|
|
59455
59636
|
setAgentState(initialAgentState);
|
|
59456
59637
|
}
|
|
59457
59638
|
}, [initialAgentState]);
|
|
59458
|
-
const [streaming, setStreaming] =
|
|
59459
|
-
const [interruptRequested, setInterruptRequested] =
|
|
59460
|
-
const [commandRunning, setCommandRunning] =
|
|
59461
|
-
const [profileConfirmPending, setProfileConfirmPending] =
|
|
59462
|
-
const [pendingApprovals, setPendingApprovals] =
|
|
59463
|
-
const [approvalContexts, setApprovalContexts] =
|
|
59464
|
-
const [approvalResults, setApprovalResults] =
|
|
59465
|
-
const [isExecutingTool, setIsExecutingTool] =
|
|
59466
|
-
const [queuedApprovalResults, setQueuedApprovalResults] =
|
|
59467
|
-
const toolAbortControllerRef =
|
|
59468
|
-
const [autoHandledResults, setAutoHandledResults] =
|
|
59469
|
-
const [autoDeniedApprovals, setAutoDeniedApprovals] =
|
|
59639
|
+
const [streaming, setStreaming] = import_react54.useState(false);
|
|
59640
|
+
const [interruptRequested, setInterruptRequested] = import_react54.useState(false);
|
|
59641
|
+
const [commandRunning, setCommandRunning] = import_react54.useState(false);
|
|
59642
|
+
const [profileConfirmPending, setProfileConfirmPending] = import_react54.useState(null);
|
|
59643
|
+
const [pendingApprovals, setPendingApprovals] = import_react54.useState([]);
|
|
59644
|
+
const [approvalContexts, setApprovalContexts] = import_react54.useState([]);
|
|
59645
|
+
const [approvalResults, setApprovalResults] = import_react54.useState([]);
|
|
59646
|
+
const [isExecutingTool, setIsExecutingTool] = import_react54.useState(false);
|
|
59647
|
+
const [queuedApprovalResults, setQueuedApprovalResults] = import_react54.useState(null);
|
|
59648
|
+
const toolAbortControllerRef = import_react54.useRef(null);
|
|
59649
|
+
const [autoHandledResults, setAutoHandledResults] = import_react54.useState([]);
|
|
59650
|
+
const [autoDeniedApprovals, setAutoDeniedApprovals] = import_react54.useState([]);
|
|
59470
59651
|
const currentApproval = pendingApprovals[approvalResults.length];
|
|
59471
|
-
const [modelSelectorOpen, setModelSelectorOpen] =
|
|
59472
|
-
const [toolsetSelectorOpen, setToolsetSelectorOpen] =
|
|
59473
|
-
const [systemPromptSelectorOpen, setSystemPromptSelectorOpen] =
|
|
59474
|
-
const [currentSystemPromptId, setCurrentSystemPromptId] =
|
|
59475
|
-
const [currentToolset, setCurrentToolset] =
|
|
59476
|
-
const [llmConfig, setLlmConfig] =
|
|
59477
|
-
const [agentName, setAgentName] =
|
|
59652
|
+
const [modelSelectorOpen, setModelSelectorOpen] = import_react54.useState(false);
|
|
59653
|
+
const [toolsetSelectorOpen, setToolsetSelectorOpen] = import_react54.useState(false);
|
|
59654
|
+
const [systemPromptSelectorOpen, setSystemPromptSelectorOpen] = import_react54.useState(false);
|
|
59655
|
+
const [currentSystemPromptId, setCurrentSystemPromptId] = import_react54.useState("default");
|
|
59656
|
+
const [currentToolset, setCurrentToolset] = import_react54.useState(null);
|
|
59657
|
+
const [llmConfig, setLlmConfig] = import_react54.useState(null);
|
|
59658
|
+
const [agentName, setAgentName] = import_react54.useState(null);
|
|
59478
59659
|
const currentModelLabel = llmConfig?.model_endpoint_type && llmConfig?.model ? `${llmConfig.model_endpoint_type}/${llmConfig.model}` : llmConfig?.model ?? null;
|
|
59479
59660
|
const currentModelDisplay = currentModelLabel?.split("/").pop() ?? null;
|
|
59480
|
-
const [agentSelectorOpen, setAgentSelectorOpen] =
|
|
59481
|
-
const [resumeSelectorOpen, setResumeSelectorOpen] =
|
|
59482
|
-
const [messageSearchOpen, setMessageSearchOpen] =
|
|
59483
|
-
const [profileSelectorOpen, setProfileSelectorOpen] =
|
|
59484
|
-
const [tokenStreamingEnabled, setTokenStreamingEnabled] =
|
|
59485
|
-
const [tokenCount, setTokenCount] =
|
|
59486
|
-
const [thinkingMessage, setThinkingMessage] =
|
|
59487
|
-
const sessionStatsRef =
|
|
59488
|
-
const [showExitStats, setShowExitStats] =
|
|
59489
|
-
const [staticItems, setStaticItems] =
|
|
59490
|
-
const emittedIdsRef =
|
|
59491
|
-
const welcomeCommittedRef =
|
|
59492
|
-
const abortControllerRef =
|
|
59493
|
-
const userCancelledRef =
|
|
59494
|
-
const [messageQueue, setMessageQueue] =
|
|
59495
|
-
const waitingForQueueCancelRef =
|
|
59496
|
-
const queueSnapshotRef =
|
|
59497
|
-
const [restoreQueueOnCancel, setRestoreQueueOnCancel] =
|
|
59498
|
-
const restoreQueueOnCancelRef =
|
|
59499
|
-
|
|
59661
|
+
const [agentSelectorOpen, setAgentSelectorOpen] = import_react54.useState(false);
|
|
59662
|
+
const [resumeSelectorOpen, setResumeSelectorOpen] = import_react54.useState(false);
|
|
59663
|
+
const [messageSearchOpen, setMessageSearchOpen] = import_react54.useState(false);
|
|
59664
|
+
const [profileSelectorOpen, setProfileSelectorOpen] = import_react54.useState(false);
|
|
59665
|
+
const [tokenStreamingEnabled, setTokenStreamingEnabled] = import_react54.useState(tokenStreaming);
|
|
59666
|
+
const [tokenCount, setTokenCount] = import_react54.useState(0);
|
|
59667
|
+
const [thinkingMessage, setThinkingMessage] = import_react54.useState(getRandomThinkingMessage());
|
|
59668
|
+
const sessionStatsRef = import_react54.useRef(new SessionStats);
|
|
59669
|
+
const [showExitStats, setShowExitStats] = import_react54.useState(false);
|
|
59670
|
+
const [staticItems, setStaticItems] = import_react54.useState([]);
|
|
59671
|
+
const emittedIdsRef = import_react54.useRef(new Set);
|
|
59672
|
+
const welcomeCommittedRef = import_react54.useRef(false);
|
|
59673
|
+
const abortControllerRef = import_react54.useRef(null);
|
|
59674
|
+
const userCancelledRef = import_react54.useRef(false);
|
|
59675
|
+
const [messageQueue, setMessageQueue] = import_react54.useState([]);
|
|
59676
|
+
const waitingForQueueCancelRef = import_react54.useRef(false);
|
|
59677
|
+
const queueSnapshotRef = import_react54.useRef([]);
|
|
59678
|
+
const [restoreQueueOnCancel, setRestoreQueueOnCancel] = import_react54.useState(false);
|
|
59679
|
+
const restoreQueueOnCancelRef = import_react54.useRef(restoreQueueOnCancel);
|
|
59680
|
+
import_react54.useEffect(() => {
|
|
59500
59681
|
restoreQueueOnCancelRef.current = restoreQueueOnCancel;
|
|
59501
59682
|
}, [restoreQueueOnCancel]);
|
|
59502
59683
|
const columns = useTerminalWidth();
|
|
59503
|
-
const prevColumnsRef =
|
|
59504
|
-
const [staticRenderEpoch, setStaticRenderEpoch] =
|
|
59505
|
-
|
|
59684
|
+
const prevColumnsRef = import_react54.useRef(columns);
|
|
59685
|
+
const [staticRenderEpoch, setStaticRenderEpoch] = import_react54.useState(0);
|
|
59686
|
+
import_react54.useEffect(() => {
|
|
59506
59687
|
const prev = prevColumnsRef.current;
|
|
59507
59688
|
if (columns === prev)
|
|
59508
59689
|
return;
|
|
@@ -59512,7 +59693,7 @@ function App2({
|
|
|
59512
59693
|
setStaticRenderEpoch((epoch) => epoch + 1);
|
|
59513
59694
|
prevColumnsRef.current = columns;
|
|
59514
59695
|
}, [columns]);
|
|
59515
|
-
const commitEligibleLines =
|
|
59696
|
+
const commitEligibleLines = import_react54.useCallback((b) => {
|
|
59516
59697
|
const newlyCommitted = [];
|
|
59517
59698
|
for (const id of b.order) {
|
|
59518
59699
|
if (emittedIdsRef.current.has(id))
|
|
@@ -59541,17 +59722,17 @@ function App2({
|
|
|
59541
59722
|
setStaticItems((prev) => [...prev, ...newlyCommitted]);
|
|
59542
59723
|
}
|
|
59543
59724
|
}, []);
|
|
59544
|
-
const [lines, setLines] =
|
|
59545
|
-
const buffersRef =
|
|
59546
|
-
const hasBackfilledRef =
|
|
59547
|
-
const refreshDerived =
|
|
59725
|
+
const [lines, setLines] = import_react54.useState([]);
|
|
59726
|
+
const buffersRef = import_react54.useRef(createBuffers());
|
|
59727
|
+
const hasBackfilledRef = import_react54.useRef(false);
|
|
59728
|
+
const refreshDerived = import_react54.useCallback(() => {
|
|
59548
59729
|
const b = buffersRef.current;
|
|
59549
59730
|
setTokenCount(b.tokenCount);
|
|
59550
59731
|
const newLines = toLines(b);
|
|
59551
59732
|
setLines(newLines);
|
|
59552
59733
|
commitEligibleLines(b);
|
|
59553
59734
|
}, [commitEligibleLines]);
|
|
59554
|
-
const refreshDerivedThrottled =
|
|
59735
|
+
const refreshDerivedThrottled = import_react54.useCallback(() => {
|
|
59555
59736
|
if (!buffersRef.current.pendingRefresh) {
|
|
59556
59737
|
buffersRef.current.pendingRefresh = true;
|
|
59557
59738
|
setTimeout(() => {
|
|
@@ -59560,7 +59741,7 @@ function App2({
|
|
|
59560
59741
|
}, 16);
|
|
59561
59742
|
}
|
|
59562
59743
|
}, [refreshDerived]);
|
|
59563
|
-
|
|
59744
|
+
import_react54.useEffect(() => {
|
|
59564
59745
|
const approvals = startupApprovals?.length > 0 ? startupApprovals : startupApproval ? [startupApproval] : [];
|
|
59565
59746
|
if (loadingState === "ready" && approvals.length > 0) {
|
|
59566
59747
|
setPendingApprovals(approvals);
|
|
@@ -59578,7 +59759,7 @@ function App2({
|
|
|
59578
59759
|
analyzeStartupApprovals();
|
|
59579
59760
|
}
|
|
59580
59761
|
}, [loadingState, startupApproval, startupApprovals]);
|
|
59581
|
-
|
|
59762
|
+
import_react54.useEffect(() => {
|
|
59582
59763
|
if (loadingState === "ready" && messageHistory.length > 0 && !hasBackfilledRef.current) {
|
|
59583
59764
|
hasBackfilledRef.current = true;
|
|
59584
59765
|
if (!welcomeCommittedRef.current) {
|
|
@@ -59627,7 +59808,7 @@ function App2({
|
|
|
59627
59808
|
agentState,
|
|
59628
59809
|
agentProvenance
|
|
59629
59810
|
]);
|
|
59630
|
-
|
|
59811
|
+
import_react54.useEffect(() => {
|
|
59631
59812
|
if (loadingState === "ready" && agentId && agentId !== "loading") {
|
|
59632
59813
|
const fetchConfig = async () => {
|
|
59633
59814
|
try {
|
|
@@ -59648,7 +59829,7 @@ function App2({
|
|
|
59648
59829
|
fetchConfig();
|
|
59649
59830
|
}
|
|
59650
59831
|
}, [loadingState, agentId]);
|
|
59651
|
-
const appendError =
|
|
59832
|
+
const appendError = import_react54.useCallback((message) => {
|
|
59652
59833
|
const id = uid2("err");
|
|
59653
59834
|
buffersRef.current.byId.set(id, {
|
|
59654
59835
|
kind: "error",
|
|
@@ -59658,7 +59839,7 @@ function App2({
|
|
|
59658
59839
|
buffersRef.current.order.push(id);
|
|
59659
59840
|
refreshDerived();
|
|
59660
59841
|
}, [refreshDerived]);
|
|
59661
|
-
const processConversation =
|
|
59842
|
+
const processConversation = import_react54.useCallback(async (initialInput) => {
|
|
59662
59843
|
const currentInput = initialInput;
|
|
59663
59844
|
try {
|
|
59664
59845
|
if (userCancelledRef.current) {
|
|
@@ -59983,16 +60164,16 @@ function App2({
|
|
|
59983
60164
|
abortControllerRef.current = null;
|
|
59984
60165
|
}
|
|
59985
60166
|
}, [appendError, refreshDerived, refreshDerivedThrottled]);
|
|
59986
|
-
const handleExit =
|
|
60167
|
+
const handleExit = import_react54.useCallback(() => {
|
|
59987
60168
|
setShowExitStats(true);
|
|
59988
60169
|
setTimeout(() => {
|
|
59989
60170
|
process.exit(0);
|
|
59990
60171
|
}, 100);
|
|
59991
60172
|
}, []);
|
|
59992
|
-
const handleEnterQueueEditMode =
|
|
60173
|
+
const handleEnterQueueEditMode = import_react54.useCallback(() => {
|
|
59993
60174
|
setMessageQueue([]);
|
|
59994
60175
|
}, []);
|
|
59995
|
-
const handleInterrupt =
|
|
60176
|
+
const handleInterrupt = import_react54.useCallback(async () => {
|
|
59996
60177
|
if (isExecutingTool && toolAbortControllerRef.current) {
|
|
59997
60178
|
toolAbortControllerRef.current.abort();
|
|
59998
60179
|
setStreaming(false);
|
|
@@ -60044,16 +60225,16 @@ function App2({
|
|
|
60044
60225
|
isExecutingTool,
|
|
60045
60226
|
refreshDerived
|
|
60046
60227
|
]);
|
|
60047
|
-
const processConversationRef =
|
|
60048
|
-
|
|
60228
|
+
const processConversationRef = import_react54.useRef(processConversation);
|
|
60229
|
+
import_react54.useEffect(() => {
|
|
60049
60230
|
processConversationRef.current = processConversation;
|
|
60050
60231
|
}, [processConversation]);
|
|
60051
|
-
|
|
60232
|
+
import_react54.useEffect(() => {
|
|
60052
60233
|
if (!streaming) {
|
|
60053
60234
|
setInterruptRequested(false);
|
|
60054
60235
|
}
|
|
60055
60236
|
}, [streaming]);
|
|
60056
|
-
const handleAgentSelect =
|
|
60237
|
+
const handleAgentSelect = import_react54.useCallback(async (targetAgentId, _opts) => {
|
|
60057
60238
|
setAgentSelectorOpen(false);
|
|
60058
60239
|
if (targetAgentId === agentId) {
|
|
60059
60240
|
const label = agentName || targetAgentId.slice(0, 12);
|
|
@@ -60138,7 +60319,7 @@ function App2({
|
|
|
60138
60319
|
setCommandRunning(false);
|
|
60139
60320
|
}
|
|
60140
60321
|
}, [refreshDerived, agentId, agentName]);
|
|
60141
|
-
const onSubmit =
|
|
60322
|
+
const onSubmit = import_react54.useCallback(async (message) => {
|
|
60142
60323
|
const msg = message?.trim() ?? "";
|
|
60143
60324
|
if (profileConfirmPending && !msg) {
|
|
60144
60325
|
const { name, agentId: targetAgentId, cmdId } = profileConfirmPending;
|
|
@@ -61019,11 +61200,11 @@ ${gitContext}
|
|
|
61019
61200
|
handleAgentSelect,
|
|
61020
61201
|
tokenStreamingEnabled
|
|
61021
61202
|
]);
|
|
61022
|
-
const onSubmitRef =
|
|
61023
|
-
|
|
61203
|
+
const onSubmitRef = import_react54.useRef(onSubmit);
|
|
61204
|
+
import_react54.useEffect(() => {
|
|
61024
61205
|
onSubmitRef.current = onSubmit;
|
|
61025
61206
|
}, [onSubmit]);
|
|
61026
|
-
|
|
61207
|
+
import_react54.useEffect(() => {
|
|
61027
61208
|
if (!streaming && messageQueue.length > 0 && pendingApprovals.length === 0 && !commandRunning && !isExecutingTool && !waitingForQueueCancelRef.current && !userCancelledRef.current) {
|
|
61028
61209
|
const [firstMessage, ...rest] = messageQueue;
|
|
61029
61210
|
setMessageQueue(rest);
|
|
@@ -61036,7 +61217,7 @@ ${gitContext}
|
|
|
61036
61217
|
commandRunning,
|
|
61037
61218
|
isExecutingTool
|
|
61038
61219
|
]);
|
|
61039
|
-
const sendAllResults =
|
|
61220
|
+
const sendAllResults = import_react54.useCallback(async (additionalDecision) => {
|
|
61040
61221
|
try {
|
|
61041
61222
|
if (userCancelledRef.current || abortControllerRef.current?.signal.aborted) {
|
|
61042
61223
|
setStreaming(false);
|
|
@@ -61137,7 +61318,7 @@ ${gitContext}
|
|
|
61137
61318
|
refreshDerived,
|
|
61138
61319
|
appendError
|
|
61139
61320
|
]);
|
|
61140
|
-
const handleApproveCurrent =
|
|
61321
|
+
const handleApproveCurrent = import_react54.useCallback(async () => {
|
|
61141
61322
|
if (isExecutingTool)
|
|
61142
61323
|
return;
|
|
61143
61324
|
const currentIndex = approvalResults.length;
|
|
@@ -61170,7 +61351,7 @@ ${gitContext}
|
|
|
61170
61351
|
appendError,
|
|
61171
61352
|
isExecutingTool
|
|
61172
61353
|
]);
|
|
61173
|
-
const handleApproveAlways =
|
|
61354
|
+
const handleApproveAlways = import_react54.useCallback(async (scope) => {
|
|
61174
61355
|
if (isExecutingTool)
|
|
61175
61356
|
return;
|
|
61176
61357
|
if (pendingApprovals.length === 0 || approvalContexts.length === 0)
|
|
@@ -61201,7 +61382,7 @@ ${gitContext}
|
|
|
61201
61382
|
refreshDerived,
|
|
61202
61383
|
isExecutingTool
|
|
61203
61384
|
]);
|
|
61204
|
-
const handleDenyCurrent =
|
|
61385
|
+
const handleDenyCurrent = import_react54.useCallback(async (reason) => {
|
|
61205
61386
|
if (isExecutingTool)
|
|
61206
61387
|
return;
|
|
61207
61388
|
const currentIndex = approvalResults.length;
|
|
@@ -61236,7 +61417,7 @@ ${gitContext}
|
|
|
61236
61417
|
appendError,
|
|
61237
61418
|
isExecutingTool
|
|
61238
61419
|
]);
|
|
61239
|
-
const handleCancelApprovals =
|
|
61420
|
+
const handleCancelApprovals = import_react54.useCallback(() => {
|
|
61240
61421
|
if (pendingApprovals.length === 0)
|
|
61241
61422
|
return;
|
|
61242
61423
|
const denialResults = pendingApprovals.map((approval) => ({
|
|
@@ -61254,7 +61435,7 @@ ${gitContext}
|
|
|
61254
61435
|
setAutoHandledResults([]);
|
|
61255
61436
|
setAutoDeniedApprovals([]);
|
|
61256
61437
|
}, [pendingApprovals, refreshDerived]);
|
|
61257
|
-
const handleModelSelect =
|
|
61438
|
+
const handleModelSelect = import_react54.useCallback(async (modelId) => {
|
|
61258
61439
|
setModelSelectorOpen(false);
|
|
61259
61440
|
let cmdId = null;
|
|
61260
61441
|
try {
|
|
@@ -61329,7 +61510,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61329
61510
|
setCommandRunning(false);
|
|
61330
61511
|
}
|
|
61331
61512
|
}, [agentId, refreshDerived, currentToolset]);
|
|
61332
|
-
const handleSystemPromptSelect =
|
|
61513
|
+
const handleSystemPromptSelect = import_react54.useCallback(async (promptId) => {
|
|
61333
61514
|
setSystemPromptSelectorOpen(false);
|
|
61334
61515
|
const cmdId = uid2("cmd");
|
|
61335
61516
|
try {
|
|
@@ -61396,7 +61577,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61396
61577
|
setCommandRunning(false);
|
|
61397
61578
|
}
|
|
61398
61579
|
}, [agentId, refreshDerived]);
|
|
61399
|
-
const handleToolsetSelect =
|
|
61580
|
+
const handleToolsetSelect = import_react54.useCallback(async (toolsetId) => {
|
|
61400
61581
|
setToolsetSelectorOpen(false);
|
|
61401
61582
|
const cmdId = uid2("cmd");
|
|
61402
61583
|
try {
|
|
@@ -61437,7 +61618,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61437
61618
|
setCommandRunning(false);
|
|
61438
61619
|
}
|
|
61439
61620
|
}, [agentId, refreshDerived]);
|
|
61440
|
-
const handleProfileEscapeCancel =
|
|
61621
|
+
const handleProfileEscapeCancel = import_react54.useCallback(() => {
|
|
61441
61622
|
if (profileConfirmPending) {
|
|
61442
61623
|
const { cmdId, name } = profileConfirmPending;
|
|
61443
61624
|
buffersRef.current.byId.set(cmdId, {
|
|
@@ -61452,8 +61633,8 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61452
61633
|
setProfileConfirmPending(null);
|
|
61453
61634
|
}
|
|
61454
61635
|
}, [profileConfirmPending, refreshDerived]);
|
|
61455
|
-
const [uiPermissionMode, setUiPermissionMode] =
|
|
61456
|
-
const handlePlanApprove =
|
|
61636
|
+
const [uiPermissionMode, setUiPermissionMode] = import_react54.useState(permissionMode2.getMode());
|
|
61637
|
+
const handlePlanApprove = import_react54.useCallback(async (acceptEdits = false) => {
|
|
61457
61638
|
const currentIndex = approvalResults.length;
|
|
61458
61639
|
const approval = pendingApprovals[currentIndex];
|
|
61459
61640
|
if (!approval)
|
|
@@ -61501,7 +61682,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61501
61682
|
appendError,
|
|
61502
61683
|
refreshDerived
|
|
61503
61684
|
]);
|
|
61504
|
-
const handlePlanKeepPlanning =
|
|
61685
|
+
const handlePlanKeepPlanning = import_react54.useCallback(async (reason) => {
|
|
61505
61686
|
const currentIndex = approvalResults.length;
|
|
61506
61687
|
const approval = pendingApprovals[currentIndex];
|
|
61507
61688
|
if (!approval)
|
|
@@ -61520,7 +61701,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61520
61701
|
setApprovalResults((prev) => [...prev, decision]);
|
|
61521
61702
|
}
|
|
61522
61703
|
}, [pendingApprovals, approvalResults, sendAllResults]);
|
|
61523
|
-
|
|
61704
|
+
import_react54.useEffect(() => {
|
|
61524
61705
|
const currentIndex = approvalResults.length;
|
|
61525
61706
|
const approval = pendingApprovals[currentIndex];
|
|
61526
61707
|
if (approval?.toolName === "ExitPlanMode" && !planFileExists()) {
|
|
@@ -61530,7 +61711,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61530
61711
|
` + `Use the Write tool to create your plan, then call ExitPlanMode again.`);
|
|
61531
61712
|
}
|
|
61532
61713
|
}, [pendingApprovals, approvalResults.length, handlePlanKeepPlanning]);
|
|
61533
|
-
const handleQuestionSubmit =
|
|
61714
|
+
const handleQuestionSubmit = import_react54.useCallback(async (answers) => {
|
|
61534
61715
|
const currentIndex = approvalResults.length;
|
|
61535
61716
|
const approval = pendingApprovals[currentIndex];
|
|
61536
61717
|
if (!approval)
|
|
@@ -61570,7 +61751,7 @@ Consider switching to a different system prompt using /system to match.` : null;
|
|
|
61570
61751
|
setApprovalResults((prev) => [...prev, decision]);
|
|
61571
61752
|
}
|
|
61572
61753
|
}, [pendingApprovals, approvalResults, sendAllResults, refreshDerived]);
|
|
61573
|
-
const handleEnterPlanModeApprove =
|
|
61754
|
+
const handleEnterPlanModeApprove = import_react54.useCallback(async () => {
|
|
61574
61755
|
const currentIndex = approvalResults.length;
|
|
61575
61756
|
const approval = pendingApprovals[currentIndex];
|
|
61576
61757
|
if (!approval)
|
|
@@ -61621,7 +61802,7 @@ Plan file path: ${planFilePath}`;
|
|
|
61621
61802
|
setApprovalResults((prev) => [...prev, decision]);
|
|
61622
61803
|
}
|
|
61623
61804
|
}, [pendingApprovals, approvalResults, sendAllResults, refreshDerived]);
|
|
61624
|
-
const handleEnterPlanModeReject =
|
|
61805
|
+
const handleEnterPlanModeReject = import_react54.useCallback(async () => {
|
|
61625
61806
|
const currentIndex = approvalResults.length;
|
|
61626
61807
|
const approval = pendingApprovals[currentIndex];
|
|
61627
61808
|
if (!approval)
|
|
@@ -61640,7 +61821,7 @@ Plan file path: ${planFilePath}`;
|
|
|
61640
61821
|
setApprovalResults((prev) => [...prev, decision]);
|
|
61641
61822
|
}
|
|
61642
61823
|
}, [pendingApprovals, approvalResults, sendAllResults]);
|
|
61643
|
-
const liveItems =
|
|
61824
|
+
const liveItems = import_react54.useMemo(() => {
|
|
61644
61825
|
return lines.filter((ln) => {
|
|
61645
61826
|
if (!("phase" in ln))
|
|
61646
61827
|
return false;
|
|
@@ -61655,7 +61836,7 @@ Plan file path: ${planFilePath}`;
|
|
|
61655
61836
|
return ln.phase === "streaming";
|
|
61656
61837
|
});
|
|
61657
61838
|
}, [lines, tokenStreamingEnabled]);
|
|
61658
|
-
|
|
61839
|
+
import_react54.useEffect(() => {
|
|
61659
61840
|
if (loadingState === "ready" && !welcomeCommittedRef.current && messageHistory.length === 0) {
|
|
61660
61841
|
if (!continueSession && !agentProvenance) {
|
|
61661
61842
|
return;
|
|
@@ -61702,78 +61883,78 @@ Plan file path: ${planFilePath}`;
|
|
|
61702
61883
|
agentState,
|
|
61703
61884
|
refreshDerived
|
|
61704
61885
|
]);
|
|
61705
|
-
return /* @__PURE__ */
|
|
61886
|
+
return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61706
61887
|
flexDirection: "column",
|
|
61707
61888
|
gap: 1,
|
|
61708
61889
|
children: [
|
|
61709
|
-
/* @__PURE__ */
|
|
61890
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Static, {
|
|
61710
61891
|
items: staticItems,
|
|
61711
61892
|
style: { flexDirection: "column" },
|
|
61712
|
-
children: (item, index) => /* @__PURE__ */
|
|
61893
|
+
children: (item, index) => /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61713
61894
|
marginTop: index > 0 ? 1 : 0,
|
|
61714
|
-
children: item.kind === "welcome" ? /* @__PURE__ */
|
|
61895
|
+
children: item.kind === "welcome" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(WelcomeScreen, {
|
|
61715
61896
|
loadingState: "ready",
|
|
61716
61897
|
...item.snapshot
|
|
61717
|
-
}, undefined, false, undefined, this) : item.kind === "user" ? /* @__PURE__ */
|
|
61898
|
+
}, undefined, false, undefined, this) : item.kind === "user" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(UserMessage, {
|
|
61718
61899
|
line: item
|
|
61719
|
-
}, undefined, false, undefined, this) : item.kind === "reasoning" ? /* @__PURE__ */
|
|
61900
|
+
}, undefined, false, undefined, this) : item.kind === "reasoning" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ReasoningMessage, {
|
|
61720
61901
|
line: item
|
|
61721
|
-
}, undefined, false, undefined, this) : item.kind === "assistant" ? /* @__PURE__ */
|
|
61902
|
+
}, undefined, false, undefined, this) : item.kind === "assistant" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(AssistantMessage, {
|
|
61722
61903
|
line: item
|
|
61723
|
-
}, undefined, false, undefined, this) : item.kind === "tool_call" ? /* @__PURE__ */
|
|
61904
|
+
}, undefined, false, undefined, this) : item.kind === "tool_call" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ToolCallMessage, {
|
|
61724
61905
|
line: item
|
|
61725
|
-
}, undefined, false, undefined, this) : item.kind === "error" ? /* @__PURE__ */
|
|
61906
|
+
}, undefined, false, undefined, this) : item.kind === "error" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ErrorMessage, {
|
|
61726
61907
|
line: item
|
|
61727
|
-
}, undefined, false, undefined, this) : item.kind === "status" ? /* @__PURE__ */
|
|
61908
|
+
}, undefined, false, undefined, this) : item.kind === "status" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(StatusMessage, {
|
|
61728
61909
|
line: item
|
|
61729
|
-
}, undefined, false, undefined, this) : item.kind === "separator" ? /* @__PURE__ */
|
|
61910
|
+
}, undefined, false, undefined, this) : item.kind === "separator" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
|
|
61730
61911
|
dimColor: true,
|
|
61731
61912
|
children: "─".repeat(columns)
|
|
61732
|
-
}, undefined, false, undefined, this) : item.kind === "command" ? /* @__PURE__ */
|
|
61913
|
+
}, undefined, false, undefined, this) : item.kind === "command" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(CommandMessage, {
|
|
61733
61914
|
line: item
|
|
61734
61915
|
}, undefined, false, undefined, this) : null
|
|
61735
61916
|
}, item.id, false, undefined, this)
|
|
61736
61917
|
}, staticRenderEpoch, false, undefined, this),
|
|
61737
|
-
/* @__PURE__ */
|
|
61918
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61738
61919
|
flexDirection: "column",
|
|
61739
61920
|
gap: 1,
|
|
61740
61921
|
children: [
|
|
61741
|
-
loadingState !== "ready" && /* @__PURE__ */
|
|
61922
|
+
loadingState !== "ready" && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(WelcomeScreen, {
|
|
61742
61923
|
loadingState,
|
|
61743
61924
|
continueSession,
|
|
61744
61925
|
agentState
|
|
61745
61926
|
}, undefined, false, undefined, this),
|
|
61746
|
-
loadingState === "ready" && /* @__PURE__ */
|
|
61927
|
+
loadingState === "ready" && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(jsx_dev_runtime36.Fragment, {
|
|
61747
61928
|
children: [
|
|
61748
|
-
liveItems.length > 0 && pendingApprovals.length === 0 && /* @__PURE__ */
|
|
61929
|
+
liveItems.length > 0 && pendingApprovals.length === 0 && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61749
61930
|
flexDirection: "column",
|
|
61750
|
-
children: liveItems.map((ln) => /* @__PURE__ */
|
|
61931
|
+
children: liveItems.map((ln) => /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61751
61932
|
marginTop: 1,
|
|
61752
|
-
children: ln.kind === "user" ? /* @__PURE__ */
|
|
61933
|
+
children: ln.kind === "user" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(UserMessage, {
|
|
61753
61934
|
line: ln
|
|
61754
|
-
}, undefined, false, undefined, this) : ln.kind === "reasoning" ? /* @__PURE__ */
|
|
61935
|
+
}, undefined, false, undefined, this) : ln.kind === "reasoning" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ReasoningMessage, {
|
|
61755
61936
|
line: ln
|
|
61756
|
-
}, undefined, false, undefined, this) : ln.kind === "assistant" ? /* @__PURE__ */
|
|
61937
|
+
}, undefined, false, undefined, this) : ln.kind === "assistant" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(AssistantMessage, {
|
|
61757
61938
|
line: ln
|
|
61758
|
-
}, undefined, false, undefined, this) : ln.kind === "tool_call" ? /* @__PURE__ */
|
|
61939
|
+
}, undefined, false, undefined, this) : ln.kind === "tool_call" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ToolCallMessage, {
|
|
61759
61940
|
line: ln
|
|
61760
|
-
}, undefined, false, undefined, this) : ln.kind === "error" ? /* @__PURE__ */
|
|
61941
|
+
}, undefined, false, undefined, this) : ln.kind === "error" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ErrorMessage, {
|
|
61761
61942
|
line: ln
|
|
61762
|
-
}, undefined, false, undefined, this) : ln.kind === "status" ? /* @__PURE__ */
|
|
61943
|
+
}, undefined, false, undefined, this) : ln.kind === "status" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(StatusMessage, {
|
|
61763
61944
|
line: ln
|
|
61764
|
-
}, undefined, false, undefined, this) : ln.kind === "command" ? /* @__PURE__ */
|
|
61945
|
+
}, undefined, false, undefined, this) : ln.kind === "command" ? /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(CommandMessage, {
|
|
61765
61946
|
line: ln
|
|
61766
61947
|
}, undefined, false, undefined, this) : null
|
|
61767
61948
|
}, ln.id, false, undefined, this))
|
|
61768
61949
|
}, undefined, false, undefined, this),
|
|
61769
|
-
liveItems.length === 0 && /* @__PURE__ */
|
|
61950
|
+
liveItems.length === 0 && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61770
61951
|
height: 1
|
|
61771
61952
|
}, undefined, false, undefined, this),
|
|
61772
|
-
showExitStats && /* @__PURE__ */
|
|
61953
|
+
showExitStats && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(SessionStats2, {
|
|
61773
61954
|
stats: sessionStatsRef.current.getSnapshot(),
|
|
61774
61955
|
agentId
|
|
61775
61956
|
}, undefined, false, undefined, this),
|
|
61776
|
-
/* @__PURE__ */
|
|
61957
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Input, {
|
|
61777
61958
|
visible: !showExitStats && pendingApprovals.length === 0 && !modelSelectorOpen && !toolsetSelectorOpen && !systemPromptSelectorOpen && !agentSelectorOpen && !resumeSelectorOpen && !profileSelectorOpen && !messageSearchOpen,
|
|
61778
61959
|
streaming: streaming && !abortControllerRef.current?.signal.aborted,
|
|
61779
61960
|
tokenCount,
|
|
@@ -61791,28 +61972,28 @@ Plan file path: ${planFilePath}`;
|
|
|
61791
61972
|
onEnterQueueEditMode: handleEnterQueueEditMode,
|
|
61792
61973
|
onEscapeCancel: profileConfirmPending ? handleProfileEscapeCancel : undefined
|
|
61793
61974
|
}, undefined, false, undefined, this),
|
|
61794
|
-
modelSelectorOpen && /* @__PURE__ */
|
|
61975
|
+
modelSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ModelSelector, {
|
|
61795
61976
|
currentModel: llmConfig?.model_endpoint_type && llmConfig?.model ? `${llmConfig.model_endpoint_type}/${llmConfig.model}` : undefined,
|
|
61796
61977
|
currentEnableReasoner: llmConfig?.enable_reasoner,
|
|
61797
61978
|
onSelect: handleModelSelect,
|
|
61798
61979
|
onCancel: () => setModelSelectorOpen(false)
|
|
61799
61980
|
}, undefined, false, undefined, this),
|
|
61800
|
-
toolsetSelectorOpen && /* @__PURE__ */
|
|
61981
|
+
toolsetSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ToolsetSelector, {
|
|
61801
61982
|
currentToolset: currentToolset ?? undefined,
|
|
61802
61983
|
onSelect: handleToolsetSelect,
|
|
61803
61984
|
onCancel: () => setToolsetSelectorOpen(false)
|
|
61804
61985
|
}, undefined, false, undefined, this),
|
|
61805
|
-
systemPromptSelectorOpen && /* @__PURE__ */
|
|
61986
|
+
systemPromptSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(SystemPromptSelector, {
|
|
61806
61987
|
currentPromptId: currentSystemPromptId ?? undefined,
|
|
61807
61988
|
onSelect: handleSystemPromptSelect,
|
|
61808
61989
|
onCancel: () => setSystemPromptSelectorOpen(false)
|
|
61809
61990
|
}, undefined, false, undefined, this),
|
|
61810
|
-
agentSelectorOpen && /* @__PURE__ */
|
|
61991
|
+
agentSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(AgentSelector, {
|
|
61811
61992
|
currentAgentId: agentId,
|
|
61812
61993
|
onSelect: handleAgentSelect,
|
|
61813
61994
|
onCancel: () => setAgentSelectorOpen(false)
|
|
61814
61995
|
}, undefined, false, undefined, this),
|
|
61815
|
-
resumeSelectorOpen && /* @__PURE__ */
|
|
61996
|
+
resumeSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ResumeSelector, {
|
|
61816
61997
|
currentAgentId: agentId,
|
|
61817
61998
|
onSelect: async (id) => {
|
|
61818
61999
|
setResumeSelectorOpen(false);
|
|
@@ -61820,7 +62001,7 @@ Plan file path: ${planFilePath}`;
|
|
|
61820
62001
|
},
|
|
61821
62002
|
onCancel: () => setResumeSelectorOpen(false)
|
|
61822
62003
|
}, undefined, false, undefined, this),
|
|
61823
|
-
profileSelectorOpen && /* @__PURE__ */
|
|
62004
|
+
profileSelectorOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ProfileSelector, {
|
|
61824
62005
|
currentAgentId: agentId,
|
|
61825
62006
|
onSelect: async (id) => {
|
|
61826
62007
|
setProfileSelectorOpen(false);
|
|
@@ -61843,15 +62024,15 @@ Plan file path: ${planFilePath}`;
|
|
|
61843
62024
|
},
|
|
61844
62025
|
onCancel: () => setProfileSelectorOpen(false)
|
|
61845
62026
|
}, undefined, false, undefined, this),
|
|
61846
|
-
messageSearchOpen && /* @__PURE__ */
|
|
62027
|
+
messageSearchOpen && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(MessageSearch, {
|
|
61847
62028
|
onClose: () => setMessageSearchOpen(false)
|
|
61848
62029
|
}, undefined, false, undefined, this),
|
|
61849
|
-
currentApproval?.toolName === "ExitPlanMode" && /* @__PURE__ */
|
|
62030
|
+
currentApproval?.toolName === "ExitPlanMode" && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(jsx_dev_runtime36.Fragment, {
|
|
61850
62031
|
children: [
|
|
61851
|
-
/* @__PURE__ */
|
|
62032
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61852
62033
|
height: 1
|
|
61853
62034
|
}, undefined, false, undefined, this),
|
|
61854
|
-
/* @__PURE__ */
|
|
62035
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(PlanModeDialog, {
|
|
61855
62036
|
plan: readPlanFile(),
|
|
61856
62037
|
onApprove: () => handlePlanApprove(false),
|
|
61857
62038
|
onApproveAndAcceptEdits: () => handlePlanApprove(true),
|
|
@@ -61859,34 +62040,34 @@ Plan file path: ${planFilePath}`;
|
|
|
61859
62040
|
}, undefined, false, undefined, this)
|
|
61860
62041
|
]
|
|
61861
62042
|
}, undefined, true, undefined, this),
|
|
61862
|
-
currentApproval?.toolName === "AskUserQuestion" && /* @__PURE__ */
|
|
62043
|
+
currentApproval?.toolName === "AskUserQuestion" && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(jsx_dev_runtime36.Fragment, {
|
|
61863
62044
|
children: [
|
|
61864
|
-
/* @__PURE__ */
|
|
62045
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61865
62046
|
height: 1
|
|
61866
62047
|
}, undefined, false, undefined, this),
|
|
61867
|
-
/* @__PURE__ */
|
|
62048
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(QuestionDialog, {
|
|
61868
62049
|
questions: getQuestionsFromApproval(currentApproval),
|
|
61869
62050
|
onSubmit: handleQuestionSubmit
|
|
61870
62051
|
}, undefined, false, undefined, this)
|
|
61871
62052
|
]
|
|
61872
62053
|
}, undefined, true, undefined, this),
|
|
61873
|
-
currentApproval?.toolName === "EnterPlanMode" && /* @__PURE__ */
|
|
62054
|
+
currentApproval?.toolName === "EnterPlanMode" && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(jsx_dev_runtime36.Fragment, {
|
|
61874
62055
|
children: [
|
|
61875
|
-
/* @__PURE__ */
|
|
62056
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61876
62057
|
height: 1
|
|
61877
62058
|
}, undefined, false, undefined, this),
|
|
61878
|
-
/* @__PURE__ */
|
|
62059
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(EnterPlanModeDialog, {
|
|
61879
62060
|
onApprove: handleEnterPlanModeApprove,
|
|
61880
62061
|
onReject: handleEnterPlanModeReject
|
|
61881
62062
|
}, undefined, false, undefined, this)
|
|
61882
62063
|
]
|
|
61883
62064
|
}, undefined, true, undefined, this),
|
|
61884
|
-
currentApproval && !isFancyUITool(currentApproval.toolName) && /* @__PURE__ */
|
|
62065
|
+
currentApproval && !isFancyUITool(currentApproval.toolName) && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(jsx_dev_runtime36.Fragment, {
|
|
61885
62066
|
children: [
|
|
61886
|
-
/* @__PURE__ */
|
|
62067
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
|
|
61887
62068
|
height: 1
|
|
61888
62069
|
}, undefined, false, undefined, this),
|
|
61889
|
-
/* @__PURE__ */
|
|
62070
|
+
/* @__PURE__ */ jsx_dev_runtime36.jsxDEV(ApprovalDialog, {
|
|
61890
62071
|
approvals: [currentApproval],
|
|
61891
62072
|
approvalContexts: approvalContexts[approvalResults.length] ? [
|
|
61892
62073
|
approvalContexts[approvalResults.length]
|
|
@@ -61911,7 +62092,7 @@ Plan file path: ${planFilePath}`;
|
|
|
61911
62092
|
]
|
|
61912
62093
|
}, resumeKey, true, undefined, this);
|
|
61913
62094
|
}
|
|
61914
|
-
var
|
|
62095
|
+
var import_react54, jsx_dev_runtime36, CLEAR_SCREEN_AND_HOME = "\x1B[2J\x1B[H", CHECK_PENDING_APPROVALS_BEFORE_SEND = true, EAGER_CANCEL = true;
|
|
61915
62096
|
var init_App2 = __esm(async () => {
|
|
61916
62097
|
init_error();
|
|
61917
62098
|
init_check_approval();
|
|
@@ -61954,8 +62135,8 @@ var init_App2 = __esm(async () => {
|
|
|
61954
62135
|
init_WelcomeScreen(),
|
|
61955
62136
|
init_useSuspend()
|
|
61956
62137
|
]);
|
|
61957
|
-
|
|
61958
|
-
|
|
62138
|
+
import_react54 = __toESM(require_react(), 1);
|
|
62139
|
+
jsx_dev_runtime36 = __toESM(require_jsx_dev_runtime(), 1);
|
|
61959
62140
|
});
|
|
61960
62141
|
|
|
61961
62142
|
// src/tools/toolset.ts
|
|
@@ -63673,14 +63854,14 @@ Note: Flags should use double dashes for full names (e.g., --yolo, not -yolo)`);
|
|
|
63673
63854
|
const modelForTools = getModelForToolLoading(specifiedModel, specifiedToolset);
|
|
63674
63855
|
await loadTools(modelForTools);
|
|
63675
63856
|
const client = await getClient();
|
|
63676
|
-
await
|
|
63857
|
+
await upsertToolsIfNeeded(client, baseURL);
|
|
63677
63858
|
const { handleHeadlessCommand: handleHeadlessCommand2 } = await Promise.resolve().then(() => (init_headless(), exports_headless));
|
|
63678
63859
|
await handleHeadlessCommand2(process.argv, specifiedModel, skillsDirectory);
|
|
63679
63860
|
return;
|
|
63680
63861
|
}
|
|
63681
63862
|
const React13 = await Promise.resolve().then(() => __toESM(require_react2(), 1));
|
|
63682
63863
|
const { render: render2 } = await init_build3().then(() => exports_build);
|
|
63683
|
-
const { useState:
|
|
63864
|
+
const { useState: useState26, useEffect: useEffect21 } = React13;
|
|
63684
63865
|
const AppModule = await init_App2().then(() => exports_App);
|
|
63685
63866
|
const App3 = AppModule.default;
|
|
63686
63867
|
function LoadingApp({
|
|
@@ -63695,20 +63876,20 @@ Note: Flags should use double dashes for full names (e.g., --yolo, not -yolo)`);
|
|
|
63695
63876
|
skillsDirectory: skillsDirectory2,
|
|
63696
63877
|
fromAfFile: fromAfFile2
|
|
63697
63878
|
}) {
|
|
63698
|
-
const [loadingState, setLoadingState] =
|
|
63699
|
-
const [agentId, setAgentId] =
|
|
63700
|
-
const [agentState, setAgentState] =
|
|
63701
|
-
const [resumeData, setResumeData] =
|
|
63702
|
-
const [isResumingSession, setIsResumingSession] =
|
|
63703
|
-
const [agentProvenance, setAgentProvenance] =
|
|
63704
|
-
|
|
63879
|
+
const [loadingState, setLoadingState] = useState26("selecting");
|
|
63880
|
+
const [agentId, setAgentId] = useState26(null);
|
|
63881
|
+
const [agentState, setAgentState] = useState26(null);
|
|
63882
|
+
const [resumeData, setResumeData] = useState26(null);
|
|
63883
|
+
const [isResumingSession, setIsResumingSession] = useState26(false);
|
|
63884
|
+
const [agentProvenance, setAgentProvenance] = useState26(null);
|
|
63885
|
+
useEffect21(() => {
|
|
63705
63886
|
async function checkAndStart() {
|
|
63706
63887
|
await settingsManager2.loadLocalProjectSettings();
|
|
63707
63888
|
setLoadingState("assembling");
|
|
63708
63889
|
}
|
|
63709
63890
|
checkAndStart();
|
|
63710
63891
|
}, []);
|
|
63711
|
-
|
|
63892
|
+
useEffect21(() => {
|
|
63712
63893
|
if (loadingState !== "assembling")
|
|
63713
63894
|
return;
|
|
63714
63895
|
async function init() {
|
|
@@ -63756,7 +63937,7 @@ Note: Flags should use double dashes for full names (e.g., --yolo, not -yolo)`);
|
|
|
63756
63937
|
await loadTools(modelForTools);
|
|
63757
63938
|
}
|
|
63758
63939
|
setLoadingState("upserting");
|
|
63759
|
-
await
|
|
63940
|
+
await upsertToolsIfNeeded(client, baseURL);
|
|
63760
63941
|
if (shouldLink || shouldUnlink) {
|
|
63761
63942
|
if (!agentIdArg) {
|
|
63762
63943
|
console.error("Error: --link/--unlink requires --agent <id>");
|
|
@@ -63919,4 +64100,4 @@ Note: Flags should use double dashes for full names (e.g., --yolo, not -yolo)`);
|
|
|
63919
64100
|
}
|
|
63920
64101
|
main();
|
|
63921
64102
|
|
|
63922
|
-
//# debugId=
|
|
64103
|
+
//# debugId=07B432E4D35B02AE64756E2164756E21
|