@robota-sdk/agent-cli 3.0.0-beta.29 → 3.0.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/bin.cjs +232 -122
- package/dist/node/bin.js +1 -1
- package/dist/node/{chunk-74GXDZY7.js → chunk-MCZP5QLE.js} +212 -102
- package/dist/node/index.cjs +232 -122
- package/dist/node/index.js +1 -1
- package/package.json +3 -3
package/dist/node/bin.cjs
CHANGED
|
@@ -163,16 +163,42 @@ var PrintTerminal = class {
|
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
// src/ui/render.tsx
|
|
166
|
-
var
|
|
166
|
+
var import_ink12 = require("ink");
|
|
167
167
|
|
|
168
168
|
// src/ui/App.tsx
|
|
169
169
|
var import_react13 = require("react");
|
|
170
|
-
var
|
|
170
|
+
var import_ink11 = require("ink");
|
|
171
171
|
var import_agent_core3 = require("@robota-sdk/agent-core");
|
|
172
172
|
|
|
173
173
|
// src/ui/hooks/useSession.ts
|
|
174
174
|
var import_react = require("react");
|
|
175
175
|
var import_agent_sdk = require("@robota-sdk/agent-sdk");
|
|
176
|
+
|
|
177
|
+
// src/utils/edit-diff.ts
|
|
178
|
+
function generateDiffLines(oldStr, newStr) {
|
|
179
|
+
if (oldStr === newStr) return [];
|
|
180
|
+
const lines = [];
|
|
181
|
+
for (const line of oldStr.split("\n")) {
|
|
182
|
+
lines.push({ type: "remove", text: line });
|
|
183
|
+
}
|
|
184
|
+
for (const line of newStr.split("\n")) {
|
|
185
|
+
lines.push({ type: "add", text: line });
|
|
186
|
+
}
|
|
187
|
+
return lines;
|
|
188
|
+
}
|
|
189
|
+
function extractEditDiff(toolName, toolArgs) {
|
|
190
|
+
if (toolName !== "Edit" || !toolArgs) return null;
|
|
191
|
+
const filePath = toolArgs.file_path ?? toolArgs.filePath;
|
|
192
|
+
const oldStr = toolArgs.old_string ?? toolArgs.oldString;
|
|
193
|
+
const newStr = toolArgs.new_string ?? toolArgs.newString;
|
|
194
|
+
if (typeof filePath !== "string") return null;
|
|
195
|
+
if (typeof oldStr !== "string" || typeof newStr !== "string") return null;
|
|
196
|
+
const lines = generateDiffLines(oldStr, newStr);
|
|
197
|
+
if (lines.length === 0) return null;
|
|
198
|
+
return { file: filePath, lines };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// src/ui/hooks/useSession.ts
|
|
176
202
|
var TOOL_ARG_DISPLAY_MAX = 80;
|
|
177
203
|
var TAIL_KEEP = 30;
|
|
178
204
|
var MAX_COMPLETED_TOOLS = 50;
|
|
@@ -238,14 +264,26 @@ function useSession(props) {
|
|
|
238
264
|
}
|
|
239
265
|
setActiveTools((prev) => [
|
|
240
266
|
...prev,
|
|
241
|
-
{ toolName: event.toolName, firstArg, isRunning: true }
|
|
267
|
+
{ toolName: event.toolName, firstArg, isRunning: true, _toolArgs: event.toolArgs }
|
|
242
268
|
]);
|
|
243
269
|
} else {
|
|
244
270
|
const toolResult = event.denied ? "denied" : event.success === false ? "error" : "success";
|
|
245
271
|
setActiveTools((prev) => {
|
|
246
|
-
const updated = prev.map(
|
|
247
|
-
(t
|
|
248
|
-
|
|
272
|
+
const updated = prev.map((t) => {
|
|
273
|
+
if (!(t.toolName === event.toolName && t.isRunning)) return t;
|
|
274
|
+
const editDiff = extractEditDiff(event.toolName, t._toolArgs);
|
|
275
|
+
const finished = {
|
|
276
|
+
...t,
|
|
277
|
+
isRunning: false,
|
|
278
|
+
result: toolResult
|
|
279
|
+
};
|
|
280
|
+
if (editDiff) {
|
|
281
|
+
finished.diffLines = editDiff.lines;
|
|
282
|
+
finished.diffFile = editDiff.file;
|
|
283
|
+
}
|
|
284
|
+
delete finished._toolArgs;
|
|
285
|
+
return finished;
|
|
286
|
+
});
|
|
249
287
|
const completed = updated.filter((t) => !t.isRunning);
|
|
250
288
|
if (completed.length > MAX_COMPLETED_TOOLS) {
|
|
251
289
|
const excess = completed.length - MAX_COMPLETED_TOOLS;
|
|
@@ -626,19 +664,33 @@ var import_react4 = require("react");
|
|
|
626
664
|
// src/utils/tool-call-extractor.ts
|
|
627
665
|
var TOOL_ARG_MAX_LENGTH = 80;
|
|
628
666
|
var TAIL_KEEP2 = 30;
|
|
629
|
-
function
|
|
630
|
-
const
|
|
667
|
+
function extractToolCallsWithDiff(history, startIndex) {
|
|
668
|
+
const summaries = [];
|
|
631
669
|
for (let i = startIndex; i < history.length; i++) {
|
|
632
670
|
const msg = history[i];
|
|
633
671
|
if (msg.role === "assistant" && msg.toolCalls) {
|
|
634
672
|
for (const tc of msg.toolCalls) {
|
|
635
673
|
const value = parseFirstArgValue(tc.function.arguments);
|
|
636
674
|
const truncated = value.length > TOOL_ARG_MAX_LENGTH ? value.slice(0, TOOL_ARG_MAX_LENGTH - TAIL_KEEP2 - 3) + "..." + value.slice(-TAIL_KEEP2) : value;
|
|
637
|
-
|
|
675
|
+
const summary = {
|
|
676
|
+
line: `${tc.function.name}(${truncated})`
|
|
677
|
+
};
|
|
678
|
+
if (tc.function.name === "Edit") {
|
|
679
|
+
try {
|
|
680
|
+
const args = JSON.parse(tc.function.arguments);
|
|
681
|
+
const diff = extractEditDiff("Edit", args);
|
|
682
|
+
if (diff) {
|
|
683
|
+
summary.diffLines = diff.lines;
|
|
684
|
+
summary.diffFile = diff.file;
|
|
685
|
+
}
|
|
686
|
+
} catch {
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
summaries.push(summary);
|
|
638
690
|
}
|
|
639
691
|
}
|
|
640
692
|
}
|
|
641
|
-
return
|
|
693
|
+
return summaries;
|
|
642
694
|
}
|
|
643
695
|
function parseFirstArgValue(argsJson) {
|
|
644
696
|
try {
|
|
@@ -725,15 +777,15 @@ async function runSessionPrompt(prompt, session, addMessage, clearStreamingText,
|
|
|
725
777
|
const response = await session.run(prompt, rawInput);
|
|
726
778
|
clearStreamingText();
|
|
727
779
|
const history = session.getHistory();
|
|
728
|
-
const
|
|
780
|
+
const toolSummaries = extractToolCallsWithDiff(
|
|
729
781
|
history,
|
|
730
782
|
historyBefore
|
|
731
783
|
);
|
|
732
|
-
if (
|
|
784
|
+
if (toolSummaries.length > 0) {
|
|
733
785
|
addMessage({
|
|
734
786
|
role: "tool",
|
|
735
|
-
content:
|
|
736
|
-
toolName: `${
|
|
787
|
+
content: JSON.stringify(toolSummaries),
|
|
788
|
+
toolName: `${toolSummaries.length} tools`
|
|
737
789
|
});
|
|
738
790
|
}
|
|
739
791
|
addMessage({ role: "assistant", content: response || "(empty response)" });
|
|
@@ -1227,7 +1279,7 @@ function usePluginCallbacks(cwd) {
|
|
|
1227
1279
|
|
|
1228
1280
|
// src/ui/MessageList.tsx
|
|
1229
1281
|
var import_react7 = __toESM(require("react"), 1);
|
|
1230
|
-
var
|
|
1282
|
+
var import_ink2 = require("ink");
|
|
1231
1283
|
|
|
1232
1284
|
// src/ui/render-markdown.ts
|
|
1233
1285
|
var import_marked = require("marked");
|
|
@@ -1240,48 +1292,103 @@ function renderMarkdown(md) {
|
|
|
1240
1292
|
return typeof result === "string" ? result.trimEnd() : md;
|
|
1241
1293
|
}
|
|
1242
1294
|
|
|
1243
|
-
// src/ui/
|
|
1295
|
+
// src/ui/DiffBlock.tsx
|
|
1296
|
+
var import_ink = require("ink");
|
|
1244
1297
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1298
|
+
var MAX_DIFF_LINES = 10;
|
|
1299
|
+
var TRUNCATED_SHOW = 8;
|
|
1300
|
+
function DiffBlock({ file, lines }) {
|
|
1301
|
+
const truncated = lines.length > MAX_DIFF_LINES;
|
|
1302
|
+
const visible = truncated ? lines.slice(0, TRUNCATED_SHOW) : lines;
|
|
1303
|
+
const remaining = lines.length - TRUNCATED_SHOW;
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Box, { flexDirection: "column", marginLeft: 4, children: [
|
|
1305
|
+
file && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "white", dimColor: true, children: [
|
|
1306
|
+
"\u2502 ",
|
|
1307
|
+
file
|
|
1308
|
+
] }),
|
|
1309
|
+
visible.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: line.type === "remove" ? "red" : "greenBright", children: [
|
|
1310
|
+
"\u2502 ",
|
|
1311
|
+
line.type === "remove" ? "-" : "+",
|
|
1312
|
+
" ",
|
|
1313
|
+
line.text
|
|
1314
|
+
] }, i)),
|
|
1315
|
+
truncated && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "white", dimColor: true, children: [
|
|
1316
|
+
"\u2502 ... and ",
|
|
1317
|
+
remaining,
|
|
1318
|
+
" more lines"
|
|
1319
|
+
] })
|
|
1320
|
+
] });
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
// src/ui/MessageList.tsx
|
|
1324
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1245
1325
|
function RoleLabel({ role }) {
|
|
1246
1326
|
switch (role) {
|
|
1247
1327
|
case "user":
|
|
1248
|
-
return /* @__PURE__ */ (0,
|
|
1328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "green", bold: true, children: [
|
|
1249
1329
|
"You:",
|
|
1250
1330
|
" "
|
|
1251
1331
|
] });
|
|
1252
1332
|
case "assistant":
|
|
1253
|
-
return /* @__PURE__ */ (0,
|
|
1333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "cyan", bold: true, children: [
|
|
1254
1334
|
"Robota:",
|
|
1255
1335
|
" "
|
|
1256
1336
|
] });
|
|
1257
1337
|
case "system":
|
|
1258
|
-
return /* @__PURE__ */ (0,
|
|
1338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "yellow", bold: true, children: [
|
|
1259
1339
|
"System:",
|
|
1260
1340
|
" "
|
|
1261
1341
|
] });
|
|
1262
1342
|
case "tool":
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "white", bold: true, children: [
|
|
1264
1344
|
"Tool:",
|
|
1265
1345
|
" "
|
|
1266
1346
|
] });
|
|
1267
1347
|
}
|
|
1268
1348
|
}
|
|
1269
1349
|
function ToolMessage({ message }) {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1350
|
+
let summaries = null;
|
|
1351
|
+
try {
|
|
1352
|
+
const parsed = JSON.parse(message.content);
|
|
1353
|
+
if (Array.isArray(parsed) && parsed.length > 0 && typeof parsed[0].line === "string") {
|
|
1354
|
+
summaries = parsed;
|
|
1355
|
+
}
|
|
1356
|
+
} catch {
|
|
1357
|
+
}
|
|
1358
|
+
if (summaries) {
|
|
1359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { color: "white", bold: true, children: "Tool: " }),
|
|
1362
|
+
message.toolName && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "white", dimColor: true, children: [
|
|
1363
|
+
"[",
|
|
1364
|
+
message.toolName,
|
|
1365
|
+
"]"
|
|
1366
|
+
] })
|
|
1276
1367
|
] }),
|
|
1277
|
-
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { children: " " }),
|
|
1369
|
+
summaries.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { flexDirection: "column", children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "green", children: [
|
|
1371
|
+
" ",
|
|
1372
|
+
"\u2713",
|
|
1373
|
+
" ",
|
|
1374
|
+
s.line
|
|
1375
|
+
] }),
|
|
1376
|
+
s.diffLines && s.diffLines.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DiffBlock, { file: s.diffFile, lines: s.diffLines })
|
|
1377
|
+
] }, i))
|
|
1378
|
+
] });
|
|
1379
|
+
}
|
|
1380
|
+
const lines = message.content.split("\n").filter((l) => l.trim());
|
|
1381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { color: "white", bold: true, children: "Tool: " }),
|
|
1384
|
+
message.toolName && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "white", dimColor: true, children: [
|
|
1278
1385
|
"[",
|
|
1279
1386
|
message.toolName,
|
|
1280
1387
|
"]"
|
|
1281
1388
|
] })
|
|
1282
1389
|
] }),
|
|
1283
|
-
/* @__PURE__ */ (0,
|
|
1284
|
-
lines.map((line, i) => /* @__PURE__ */ (0,
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { children: " " }),
|
|
1391
|
+
lines.map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "green", children: [
|
|
1285
1392
|
" ",
|
|
1286
1393
|
"\u2713",
|
|
1287
1394
|
" ",
|
|
@@ -1293,30 +1400,30 @@ var MessageItem = import_react7.default.memo(function MessageItem2({
|
|
|
1293
1400
|
message
|
|
1294
1401
|
}) {
|
|
1295
1402
|
if (message.role === "tool") {
|
|
1296
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolMessage, { message });
|
|
1297
1404
|
}
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1300
|
-
/* @__PURE__ */ (0,
|
|
1301
|
-
message.toolName && /* @__PURE__ */ (0,
|
|
1405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Box, { children: [
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RoleLabel, { role: message.role }),
|
|
1408
|
+
message.toolName && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ink2.Text, { color: "magenta", dimColor: true, children: [
|
|
1302
1409
|
"[",
|
|
1303
1410
|
message.toolName,
|
|
1304
1411
|
"]",
|
|
1305
1412
|
" "
|
|
1306
1413
|
] })
|
|
1307
1414
|
] }),
|
|
1308
|
-
/* @__PURE__ */ (0,
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { children: " " }),
|
|
1416
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Box, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Text, { wrap: "wrap", children: message.role === "assistant" ? renderMarkdown(message.content) : message.content }) })
|
|
1310
1417
|
] });
|
|
1311
1418
|
});
|
|
1312
1419
|
function MessageList({ messages }) {
|
|
1313
|
-
return /* @__PURE__ */ (0,
|
|
1420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ink2.Box, { flexDirection: "column", children: messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MessageItem, { message: msg }, msg.id)) });
|
|
1314
1421
|
}
|
|
1315
1422
|
|
|
1316
1423
|
// src/ui/StatusBar.tsx
|
|
1317
|
-
var
|
|
1424
|
+
var import_ink3 = require("ink");
|
|
1318
1425
|
var import_agent_core2 = require("@robota-sdk/agent-core");
|
|
1319
|
-
var
|
|
1426
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1320
1427
|
var CONTEXT_YELLOW_THRESHOLD = 70;
|
|
1321
1428
|
var CONTEXT_RED_THRESHOLD = 90;
|
|
1322
1429
|
function getContextColor(percentage) {
|
|
@@ -1335,8 +1442,8 @@ function StatusBar({
|
|
|
1335
1442
|
contextMaxTokens
|
|
1336
1443
|
}) {
|
|
1337
1444
|
const contextColor = getContextColor(contextPercentage);
|
|
1338
|
-
return /* @__PURE__ */ (0,
|
|
1339
|
-
|
|
1445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
1446
|
+
import_ink3.Box,
|
|
1340
1447
|
{
|
|
1341
1448
|
borderStyle: "single",
|
|
1342
1449
|
borderColor: "gray",
|
|
@@ -1344,14 +1451,14 @@ function StatusBar({
|
|
|
1344
1451
|
paddingRight: 1,
|
|
1345
1452
|
justifyContent: "space-between",
|
|
1346
1453
|
children: [
|
|
1347
|
-
/* @__PURE__ */ (0,
|
|
1348
|
-
/* @__PURE__ */ (0,
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ink3.Text, { children: [
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { color: "cyan", bold: true, children: "Mode:" }),
|
|
1349
1456
|
" ",
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1457
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { children: permissionMode }),
|
|
1351
1458
|
" | ",
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1459
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { dimColor: true, children: modelName }),
|
|
1353
1460
|
" | ",
|
|
1354
|
-
/* @__PURE__ */ (0,
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ink3.Text, { color: contextColor, children: [
|
|
1355
1462
|
"Context: ",
|
|
1356
1463
|
Math.round(contextPercentage),
|
|
1357
1464
|
"% (",
|
|
@@ -1361,9 +1468,9 @@ function StatusBar({
|
|
|
1361
1468
|
")"
|
|
1362
1469
|
] })
|
|
1363
1470
|
] }),
|
|
1364
|
-
/* @__PURE__ */ (0,
|
|
1365
|
-
isThinking && /* @__PURE__ */ (0,
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ink3.Text, { children: [
|
|
1472
|
+
isThinking && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ink3.Text, { color: "yellow", children: "Thinking... " }),
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_ink3.Text, { dimColor: true, children: [
|
|
1367
1474
|
"msgs: ",
|
|
1368
1475
|
messageCount
|
|
1369
1476
|
] })
|
|
@@ -1375,13 +1482,13 @@ function StatusBar({
|
|
|
1375
1482
|
|
|
1376
1483
|
// src/ui/InputArea.tsx
|
|
1377
1484
|
var import_react10 = __toESM(require("react"), 1);
|
|
1378
|
-
var
|
|
1485
|
+
var import_ink7 = require("ink");
|
|
1379
1486
|
|
|
1380
1487
|
// src/ui/CjkTextInput.tsx
|
|
1381
1488
|
var import_react8 = require("react");
|
|
1382
|
-
var
|
|
1489
|
+
var import_ink4 = require("ink");
|
|
1383
1490
|
var import_chalk = __toESM(require("chalk"), 1);
|
|
1384
|
-
var
|
|
1491
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1385
1492
|
function filterPrintable(input) {
|
|
1386
1493
|
if (!input || input.length === 0) return "";
|
|
1387
1494
|
return input.replace(/[\x00-\x1f\x7f]/g, "");
|
|
@@ -1407,7 +1514,7 @@ function CjkTextInput({
|
|
|
1407
1514
|
cursorRef.current = value.length;
|
|
1408
1515
|
}
|
|
1409
1516
|
}
|
|
1410
|
-
(0,
|
|
1517
|
+
(0, import_ink4.useInput)(
|
|
1411
1518
|
(input, key) => {
|
|
1412
1519
|
try {
|
|
1413
1520
|
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.tab || key.shift && key.tab) {
|
|
@@ -1452,7 +1559,7 @@ function CjkTextInput({
|
|
|
1452
1559
|
},
|
|
1453
1560
|
{ isActive: focus }
|
|
1454
1561
|
);
|
|
1455
|
-
return /* @__PURE__ */ (0,
|
|
1562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ink4.Text, { children: renderWithCursor(valueRef.current, cursorRef.current, placeholder, showCursor && focus) });
|
|
1456
1563
|
}
|
|
1457
1564
|
function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
|
|
1458
1565
|
if (!showCursor) {
|
|
@@ -1478,8 +1585,8 @@ function renderWithCursor(value, cursorOffset, placeholder, showCursor) {
|
|
|
1478
1585
|
|
|
1479
1586
|
// src/ui/WaveText.tsx
|
|
1480
1587
|
var import_react9 = require("react");
|
|
1481
|
-
var
|
|
1482
|
-
var
|
|
1588
|
+
var import_ink5 = require("ink");
|
|
1589
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1483
1590
|
var WAVE_COLORS = ["#666666", "#888888", "#aaaaaa", "#888888"];
|
|
1484
1591
|
var INTERVAL_MS = 400;
|
|
1485
1592
|
var CHARS_PER_GROUP = 4;
|
|
@@ -1492,23 +1599,23 @@ function WaveText({ text }) {
|
|
|
1492
1599
|
return () => clearInterval(timer);
|
|
1493
1600
|
}, []);
|
|
1494
1601
|
const chars = [...text];
|
|
1495
|
-
return /* @__PURE__ */ (0,
|
|
1602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ink5.Text, { children: chars.map((char, i) => {
|
|
1496
1603
|
const group = Math.floor(i / CHARS_PER_GROUP);
|
|
1497
1604
|
const colorIndex = (tick + group) % WAVE_COLORS.length;
|
|
1498
|
-
return /* @__PURE__ */ (0,
|
|
1605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ink5.Text, { color: WAVE_COLORS[colorIndex], children: char }, i);
|
|
1499
1606
|
}) });
|
|
1500
1607
|
}
|
|
1501
1608
|
|
|
1502
1609
|
// src/ui/SlashAutocomplete.tsx
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1610
|
+
var import_ink6 = require("ink");
|
|
1611
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1505
1612
|
var MAX_VISIBLE = 8;
|
|
1506
1613
|
function CommandRow(props) {
|
|
1507
1614
|
const { cmd, isSelected, showSlash } = props;
|
|
1508
1615
|
const indicator = isSelected ? "\u25B8 " : " ";
|
|
1509
1616
|
const nameColor = isSelected ? "cyan" : void 0;
|
|
1510
1617
|
const dimmed = !isSelected;
|
|
1511
|
-
return /* @__PURE__ */ (0,
|
|
1618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ink6.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_ink6.Text, { color: nameColor, dimColor: dimmed, children: [
|
|
1512
1619
|
indicator,
|
|
1513
1620
|
showSlash ? `/${cmd.name} ${cmd.description}` : cmd.description
|
|
1514
1621
|
] }) });
|
|
@@ -1522,7 +1629,7 @@ function SlashAutocomplete({
|
|
|
1522
1629
|
if (!visible || commands.length === 0) return null;
|
|
1523
1630
|
const scrollOffset = computeScrollOffset(selectedIndex, commands.length);
|
|
1524
1631
|
const visibleCommands = commands.slice(scrollOffset, scrollOffset + MAX_VISIBLE);
|
|
1525
|
-
return /* @__PURE__ */ (0,
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ink6.Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, children: visibleCommands.map((cmd, i) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1526
1633
|
CommandRow,
|
|
1527
1634
|
{
|
|
1528
1635
|
cmd,
|
|
@@ -1540,7 +1647,7 @@ function computeScrollOffset(selectedIndex, total) {
|
|
|
1540
1647
|
}
|
|
1541
1648
|
|
|
1542
1649
|
// src/ui/InputArea.tsx
|
|
1543
|
-
var
|
|
1650
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1544
1651
|
function parseSlashInput(value) {
|
|
1545
1652
|
if (!value.startsWith("/")) return { isSlash: false, parentCommand: "", filter: "" };
|
|
1546
1653
|
const afterSlash = value.slice(1);
|
|
@@ -1635,7 +1742,7 @@ function InputArea({ onSubmit, isDisabled, registry }) {
|
|
|
1635
1742
|
},
|
|
1636
1743
|
[value, onSubmit, setSelectedIndex]
|
|
1637
1744
|
);
|
|
1638
|
-
(0,
|
|
1745
|
+
(0, import_ink7.useInput)(
|
|
1639
1746
|
(_input, key) => {
|
|
1640
1747
|
if (!showPopup) return;
|
|
1641
1748
|
if (key.upArrow) {
|
|
@@ -1651,8 +1758,8 @@ function InputArea({ onSubmit, isDisabled, registry }) {
|
|
|
1651
1758
|
},
|
|
1652
1759
|
{ isActive: showPopup && !isDisabled }
|
|
1653
1760
|
);
|
|
1654
|
-
return /* @__PURE__ */ (0,
|
|
1655
|
-
showPopup && /* @__PURE__ */ (0,
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Box, { flexDirection: "column", children: [
|
|
1762
|
+
showPopup && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1656
1763
|
SlashAutocomplete,
|
|
1657
1764
|
{
|
|
1658
1765
|
commands: filteredCommands,
|
|
@@ -1661,9 +1768,9 @@ function InputArea({ onSubmit, isDisabled, registry }) {
|
|
|
1661
1768
|
isSubcommandMode
|
|
1662
1769
|
}
|
|
1663
1770
|
),
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1665
|
-
/* @__PURE__ */ (0,
|
|
1666
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Box, { borderStyle: "single", borderColor: isDisabled ? "gray" : "green", paddingLeft: 1, children: isDisabled ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WaveText, { text: " Waiting for response..." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_ink7.Box, { children: [
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ink7.Text, { color: "green", bold: true, children: "> " }),
|
|
1773
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1667
1774
|
CjkTextInput,
|
|
1668
1775
|
{
|
|
1669
1776
|
value,
|
|
@@ -1678,8 +1785,8 @@ function InputArea({ onSubmit, isDisabled, registry }) {
|
|
|
1678
1785
|
|
|
1679
1786
|
// src/ui/ConfirmPrompt.tsx
|
|
1680
1787
|
var import_react11 = require("react");
|
|
1681
|
-
var
|
|
1682
|
-
var
|
|
1788
|
+
var import_ink8 = require("ink");
|
|
1789
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1683
1790
|
function ConfirmPrompt({
|
|
1684
1791
|
message,
|
|
1685
1792
|
options = ["Yes", "No"],
|
|
@@ -1695,7 +1802,7 @@ function ConfirmPrompt({
|
|
|
1695
1802
|
},
|
|
1696
1803
|
[onSelect]
|
|
1697
1804
|
);
|
|
1698
|
-
(0,
|
|
1805
|
+
(0, import_ink8.useInput)((input, key) => {
|
|
1699
1806
|
if (resolvedRef.current) return;
|
|
1700
1807
|
if (key.leftArrow || key.upArrow) {
|
|
1701
1808
|
setSelected((prev) => prev > 0 ? prev - 1 : prev);
|
|
@@ -1709,20 +1816,20 @@ function ConfirmPrompt({
|
|
|
1709
1816
|
doSelect(1);
|
|
1710
1817
|
}
|
|
1711
1818
|
});
|
|
1712
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ink8.Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Text, { color: "yellow", children: message }),
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Box, { marginTop: 1, children: options.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Box, { marginRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_ink8.Text, { color: i === selected ? "cyan" : void 0, bold: i === selected, children: [
|
|
1715
1822
|
i === selected ? "> " : " ",
|
|
1716
1823
|
opt
|
|
1717
1824
|
] }) }, opt)) }),
|
|
1718
|
-
/* @__PURE__ */ (0,
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_ink8.Text, { dimColor: true, children: " arrow keys to select, Enter to confirm" })
|
|
1719
1826
|
] });
|
|
1720
1827
|
}
|
|
1721
1828
|
|
|
1722
1829
|
// src/ui/PermissionPrompt.tsx
|
|
1723
1830
|
var import_react12 = __toESM(require("react"), 1);
|
|
1724
|
-
var
|
|
1725
|
-
var
|
|
1831
|
+
var import_ink9 = require("ink");
|
|
1832
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1726
1833
|
var OPTIONS = ["Allow", "Allow always (this session)", "Deny"];
|
|
1727
1834
|
function formatArgs(args) {
|
|
1728
1835
|
const entries = Object.entries(args);
|
|
@@ -1748,7 +1855,7 @@ function PermissionPrompt({ request }) {
|
|
|
1748
1855
|
},
|
|
1749
1856
|
[request]
|
|
1750
1857
|
);
|
|
1751
|
-
(0,
|
|
1858
|
+
(0, import_ink9.useInput)((input, key) => {
|
|
1752
1859
|
if (resolvedRef.current) return;
|
|
1753
1860
|
if (key.upArrow || key.leftArrow) {
|
|
1754
1861
|
setSelected((prev) => prev > 0 ? prev - 1 : prev);
|
|
@@ -1764,28 +1871,28 @@ function PermissionPrompt({ request }) {
|
|
|
1764
1871
|
doResolve(2);
|
|
1765
1872
|
}
|
|
1766
1873
|
});
|
|
1767
|
-
return /* @__PURE__ */ (0,
|
|
1768
|
-
/* @__PURE__ */ (0,
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_ink9.Box, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, children: [
|
|
1875
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ink9.Text, { color: "yellow", bold: true, children: "[Permission Required]" }),
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_ink9.Text, { children: [
|
|
1770
1877
|
"Tool:",
|
|
1771
1878
|
" ",
|
|
1772
|
-
/* @__PURE__ */ (0,
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ink9.Text, { color: "cyan", bold: true, children: request.toolName })
|
|
1773
1880
|
] }),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_ink9.Text, { dimColor: true, children: [
|
|
1775
1882
|
" ",
|
|
1776
1883
|
formatArgs(request.toolArgs)
|
|
1777
1884
|
] }),
|
|
1778
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ink9.Box, { marginTop: 1, children: OPTIONS.map((opt, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ink9.Box, { marginRight: 2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_ink9.Text, { color: i === selected ? "cyan" : void 0, bold: i === selected, children: [
|
|
1779
1886
|
i === selected ? "> " : " ",
|
|
1780
1887
|
opt
|
|
1781
1888
|
] }) }, opt)) }),
|
|
1782
|
-
/* @__PURE__ */ (0,
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_ink9.Text, { dimColor: true, children: " left/right to select, Enter to confirm" })
|
|
1783
1890
|
] });
|
|
1784
1891
|
}
|
|
1785
1892
|
|
|
1786
1893
|
// src/ui/StreamingIndicator.tsx
|
|
1787
|
-
var
|
|
1788
|
-
var
|
|
1894
|
+
var import_ink10 = require("ink");
|
|
1895
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1789
1896
|
function getToolStyle(t) {
|
|
1790
1897
|
if (t.isRunning) return { color: "yellow", icon: "\u27F3", strikethrough: false };
|
|
1791
1898
|
if (t.result === "error") return { color: "red", icon: "\u2717", strikethrough: true };
|
|
@@ -1796,35 +1903,38 @@ function StreamingIndicator({ text, activeTools }) {
|
|
|
1796
1903
|
const hasTools = activeTools.length > 0;
|
|
1797
1904
|
const hasText = text.length > 0;
|
|
1798
1905
|
if (!hasTools && !hasText) {
|
|
1799
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { color: "yellow", children: "Thinking..." });
|
|
1800
1907
|
}
|
|
1801
|
-
return /* @__PURE__ */ (0,
|
|
1802
|
-
hasTools && /* @__PURE__ */ (0,
|
|
1803
|
-
/* @__PURE__ */ (0,
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ink10.Box, { flexDirection: "column", children: [
|
|
1909
|
+
hasTools && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ink10.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { color: "white", bold: true, children: "Tools:" }),
|
|
1911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { children: " " }),
|
|
1805
1912
|
activeTools.map((t, i) => {
|
|
1806
1913
|
const { color, icon, strikethrough } = getToolStyle(t);
|
|
1807
|
-
return /* @__PURE__ */ (0,
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ink10.Box, { flexDirection: "column", children: [
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ink10.Text, { color, strikethrough, children: [
|
|
1916
|
+
" ",
|
|
1917
|
+
icon,
|
|
1918
|
+
" ",
|
|
1919
|
+
t.toolName,
|
|
1920
|
+
"(",
|
|
1921
|
+
t.firstArg,
|
|
1922
|
+
")"
|
|
1923
|
+
] }),
|
|
1924
|
+
t.diffLines && t.diffLines.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DiffBlock, { file: t.diffFile, lines: t.diffLines })
|
|
1815
1925
|
] }, `${t.toolName}-${i}`);
|
|
1816
1926
|
})
|
|
1817
1927
|
] }),
|
|
1818
|
-
hasText && /* @__PURE__ */ (0,
|
|
1819
|
-
/* @__PURE__ */ (0,
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1821
|
-
/* @__PURE__ */ (0,
|
|
1928
|
+
hasText && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_ink10.Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
1929
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { color: "cyan", bold: true, children: "Robota:" }),
|
|
1930
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { children: " " }),
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Box, { marginLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_ink10.Text, { wrap: "wrap", children: renderMarkdown(text) }) })
|
|
1822
1932
|
] })
|
|
1823
1933
|
] });
|
|
1824
1934
|
}
|
|
1825
1935
|
|
|
1826
1936
|
// src/ui/App.tsx
|
|
1827
|
-
var
|
|
1937
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1828
1938
|
var EXIT_DELAY_MS2 = 500;
|
|
1829
1939
|
function mergeHooksIntoConfig(configHooks, pluginHooks) {
|
|
1830
1940
|
const pluginKeys = Object.keys(pluginHooks);
|
|
@@ -1843,7 +1953,7 @@ function mergeHooksIntoConfig(configHooks, pluginHooks) {
|
|
|
1843
1953
|
return merged;
|
|
1844
1954
|
}
|
|
1845
1955
|
function App(props) {
|
|
1846
|
-
const { exit } = (0,
|
|
1956
|
+
const { exit } = (0, import_ink11.useApp)();
|
|
1847
1957
|
const { registry, pluginHooks } = useCommandRegistry(props.cwd ?? process.cwd());
|
|
1848
1958
|
const configWithPluginHooks = {
|
|
1849
1959
|
...props.config,
|
|
@@ -1885,33 +1995,33 @@ function App(props) {
|
|
|
1885
1995
|
setContextState,
|
|
1886
1996
|
registry
|
|
1887
1997
|
);
|
|
1888
|
-
(0,
|
|
1998
|
+
(0, import_ink11.useInput)(
|
|
1889
1999
|
(_input, key) => {
|
|
1890
2000
|
if (key.ctrl && _input === "c") exit();
|
|
1891
2001
|
if (key.escape && isThinking) session.abort();
|
|
1892
2002
|
},
|
|
1893
2003
|
{ isActive: !permissionRequest }
|
|
1894
2004
|
);
|
|
1895
|
-
return /* @__PURE__ */ (0,
|
|
1896
|
-
/* @__PURE__ */ (0,
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
2005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_ink11.Box, { flexDirection: "column", children: [
|
|
2006
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_ink11.Box, { flexDirection: "column", paddingX: 1, marginBottom: 1, children: [
|
|
2007
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ink11.Text, { color: "cyan", bold: true, children: `
|
|
1898
2008
|
____ ___ ____ ___ _____ _
|
|
1899
2009
|
| _ \\ / _ \\| __ ) / _ \\_ _|/ \\
|
|
1900
2010
|
| |_) | | | | _ \\| | | || | / _ \\
|
|
1901
2011
|
| _ <| |_| | |_) | |_| || |/ ___ \\
|
|
1902
2012
|
|_| \\_\\\\___/|____/ \\___/ |_/_/ \\_\\
|
|
1903
2013
|
` }),
|
|
1904
|
-
/* @__PURE__ */ (0,
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_ink11.Text, { dimColor: true, children: [
|
|
1905
2015
|
" v",
|
|
1906
2016
|
props.version ?? "0.0.0"
|
|
1907
2017
|
] })
|
|
1908
2018
|
] }),
|
|
1909
|
-
/* @__PURE__ */ (0,
|
|
1910
|
-
/* @__PURE__ */ (0,
|
|
1911
|
-
isThinking && /* @__PURE__ */ (0,
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_ink11.Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [
|
|
2020
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MessageList, { messages }),
|
|
2021
|
+
isThinking && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ink11.Box, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StreamingIndicator, { text: streamingText, activeTools }) })
|
|
1912
2022
|
] }),
|
|
1913
|
-
permissionRequest && /* @__PURE__ */ (0,
|
|
1914
|
-
pendingModelId && /* @__PURE__ */ (0,
|
|
2023
|
+
permissionRequest && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PermissionPrompt, { request: permissionRequest }),
|
|
2024
|
+
pendingModelId && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1915
2025
|
ConfirmPrompt,
|
|
1916
2026
|
{
|
|
1917
2027
|
message: `Change model to ${(0, import_agent_core3.getModelName)(pendingModelId)}? This will restart the session.`,
|
|
@@ -1939,7 +2049,7 @@ function App(props) {
|
|
|
1939
2049
|
}
|
|
1940
2050
|
}
|
|
1941
2051
|
),
|
|
1942
|
-
/* @__PURE__ */ (0,
|
|
2052
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1943
2053
|
StatusBar,
|
|
1944
2054
|
{
|
|
1945
2055
|
permissionMode: session.getPermissionMode(),
|
|
@@ -1952,7 +2062,7 @@ function App(props) {
|
|
|
1952
2062
|
contextMaxTokens: contextState.maxTokens
|
|
1953
2063
|
}
|
|
1954
2064
|
),
|
|
1955
|
-
/* @__PURE__ */ (0,
|
|
2065
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1956
2066
|
InputArea,
|
|
1957
2067
|
{
|
|
1958
2068
|
onSubmit: handleSubmit,
|
|
@@ -1960,12 +2070,12 @@ function App(props) {
|
|
|
1960
2070
|
registry
|
|
1961
2071
|
}
|
|
1962
2072
|
),
|
|
1963
|
-
/* @__PURE__ */ (0,
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ink11.Text, { children: " " })
|
|
1964
2074
|
] });
|
|
1965
2075
|
}
|
|
1966
2076
|
|
|
1967
2077
|
// src/ui/render.tsx
|
|
1968
|
-
var
|
|
2078
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1969
2079
|
function renderApp(options) {
|
|
1970
2080
|
process.on("unhandledRejection", (reason) => {
|
|
1971
2081
|
process.stderr.write(`
|
|
@@ -1976,7 +2086,7 @@ function renderApp(options) {
|
|
|
1976
2086
|
`);
|
|
1977
2087
|
}
|
|
1978
2088
|
});
|
|
1979
|
-
const instance = (0,
|
|
2089
|
+
const instance = (0, import_ink12.render)(/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(App, { ...options }), {
|
|
1980
2090
|
exitOnCtrlC: true
|
|
1981
2091
|
});
|
|
1982
2092
|
instance.waitUntilExit().catch((err) => {
|