@bike4mind/cli 0.2.14-fix-openai-embedding-300k-token-limit.17484 → 0.2.15
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/ImageStore-MMUOUPI2.js +0 -0
- package/dist/{artifactExtractor-BRHUIR7I.js → artifactExtractor-EEX5G4EB.js} +1 -1
- package/dist/chunk-BDQBOLYG.js +0 -0
- package/dist/chunk-BPFEGDC7.js +0 -0
- package/dist/{chunk-ZXEIAHZC.js → chunk-ECSELHYP.js} +2 -2
- package/dist/chunk-FFJX3FF3.js +0 -0
- package/dist/{chunk-QOFBG5HF.js → chunk-I3CPL4SJ.js} +2 -2
- package/dist/{chunk-A7POWM75.js → chunk-LL5J3SVB.js} +21 -0
- package/dist/{chunk-V24ANIVO.js → chunk-M2CSCYOY.js} +1 -1
- package/dist/{chunk-7L5QKAIU.js → chunk-O7G3G3FD.js} +2 -2
- package/dist/chunk-OCYRD7D6.js +0 -0
- package/dist/commands/mcpCommand.js +0 -0
- package/dist/{create-3XS5ZK2T.js → create-2DJZDMFQ.js} +3 -3
- package/dist/formatConverter-5QEJDW24.js +0 -0
- package/dist/index.js +193 -82
- package/dist/{llmMarkdownGenerator-AHTZFV2T.js → llmMarkdownGenerator-SRA436DB.js} +1 -1
- package/dist/{markdownGenerator-BLXDOZWQ.js → markdownGenerator-E7F5GFPO.js} +1 -1
- package/dist/{mementoService-II67SGWE.js → mementoService-2WXW5352.js} +3 -3
- package/dist/notificationDeduplicator-UTHJHMSZ.js +0 -0
- package/dist/{src-SIU2KHTA.js → src-3MJEHI5W.js} +3 -1
- package/dist/{src-WVK2DS2D.js → src-K45DVAW4.js} +2 -2
- package/dist/{subtractCredits-2YC6PEOH.js → subtractCredits-OHI7VBH3.js} +3 -3
- package/dist/utils-JCHWDM4Z.js +0 -0
- package/package.json +18 -19
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LL5J3SVB.js";
|
|
5
5
|
|
|
6
6
|
// ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
|
|
7
7
|
var ARTIFACT_TAG_REGEX = /<artifact\s+(.*?)>([\s\S]*?)<\/artifact>/gi;
|
package/dist/chunk-BDQBOLYG.js
CHANGED
|
File without changes
|
package/dist/chunk-BPFEGDC7.js
CHANGED
|
File without changes
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M2CSCYOY.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LL5J3SVB.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
package/dist/chunk-FFJX3FF3.js
CHANGED
|
File without changes
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M2CSCYOY.js";
|
|
6
6
|
import {
|
|
7
7
|
CompletionApiUsageTransaction,
|
|
8
8
|
GenericCreditDeductTransaction,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
RealtimeVoiceUsageTransaction,
|
|
12
12
|
TextGenerationUsageTransaction,
|
|
13
13
|
TransferCreditTransaction
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LL5J3SVB.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2109,6 +2109,7 @@ var SettingKeySchema = z19.enum([
|
|
|
2109
2109
|
// MODAL AUTOMATION SETTINGS
|
|
2110
2110
|
"whatsNewAutomationEnabled",
|
|
2111
2111
|
"whatsNewConfig",
|
|
2112
|
+
"whatsNewSyncConfig",
|
|
2112
2113
|
// AGENT PROACTIVE MESSAGING SETTINGS
|
|
2113
2114
|
"enableAgentProactiveMessages",
|
|
2114
2115
|
// TIME MACHINE & NIGHT SKY SETTINGS
|
|
@@ -2331,6 +2332,14 @@ var WhatsNewConfigSchema = z19.object({
|
|
|
2331
2332
|
// Custom prompt template (optional)
|
|
2332
2333
|
promptTemplate: z19.string().min(L.promptTemplate.min, `Prompt template must be at least ${L.promptTemplate.min} characters`).max(L.promptTemplate.max, `Prompt template cannot exceed ${L.promptTemplate.max.toLocaleString()} characters`).trim().optional()
|
|
2333
2334
|
});
|
|
2335
|
+
var WhatsNewSyncConfigSchema = z19.object({
|
|
2336
|
+
autoSyncEnabled: z19.boolean().default(true),
|
|
2337
|
+
lastSyncAt: z19.string().datetime().optional(),
|
|
2338
|
+
lastSyncResult: z19.enum(["success", "skipped", "failed"]).optional(),
|
|
2339
|
+
lastSyncModalId: z19.string().optional(),
|
|
2340
|
+
/** Error message from last sync attempt (only populated when lastSyncResult is 'failed') */
|
|
2341
|
+
lastSyncError: z19.string().max(500).optional()
|
|
2342
|
+
});
|
|
2334
2343
|
var API_SERVICE_GROUPS = {
|
|
2335
2344
|
OPENAI: {
|
|
2336
2345
|
id: "openAIService",
|
|
@@ -3520,6 +3529,17 @@ var settingsMap = {
|
|
|
3520
3529
|
order: 101,
|
|
3521
3530
|
schema: WhatsNewConfigSchema
|
|
3522
3531
|
}),
|
|
3532
|
+
whatsNewSyncConfig: makeObjectSetting({
|
|
3533
|
+
key: "whatsNewSyncConfig",
|
|
3534
|
+
name: "What's New Sync Configuration",
|
|
3535
|
+
defaultValue: {
|
|
3536
|
+
autoSyncEnabled: true
|
|
3537
|
+
},
|
|
3538
|
+
description: "Configuration for What's New modal syncing from production. Used by fork/non-production environments to control automatic synchronization.",
|
|
3539
|
+
category: "Admin",
|
|
3540
|
+
order: 102,
|
|
3541
|
+
schema: WhatsNewSyncConfigSchema
|
|
3542
|
+
}),
|
|
3523
3543
|
enableAgentProactiveMessages: makeBooleanSetting({
|
|
3524
3544
|
key: "enableAgentProactiveMessages",
|
|
3525
3545
|
name: "Enable Agent Proactive Messages",
|
|
@@ -6301,6 +6321,7 @@ export {
|
|
|
6301
6321
|
RapidReplySettingsSchema,
|
|
6302
6322
|
WHATS_NEW_VALIDATION_LIMITS,
|
|
6303
6323
|
WhatsNewConfigSchema,
|
|
6324
|
+
WhatsNewSyncConfigSchema,
|
|
6304
6325
|
API_SERVICE_GROUPS,
|
|
6305
6326
|
settingsMap,
|
|
6306
6327
|
StringBooleanSchema,
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-M2CSCYOY.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LL5J3SVB.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
package/dist/chunk-OCYRD7D6.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createFabFile,
|
|
4
4
|
createFabFileSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-O7G3G3FD.js";
|
|
6
|
+
import "./chunk-M2CSCYOY.js";
|
|
7
|
+
import "./chunk-LL5J3SVB.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
getEffectiveApiKey,
|
|
5
5
|
getOpenWeatherKey,
|
|
6
6
|
getSerperKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ECSELHYP.js";
|
|
8
8
|
import {
|
|
9
9
|
ConfigStore
|
|
10
10
|
} from "./chunk-FFJX3FF3.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-I3CPL4SJ.js";
|
|
12
|
+
import "./chunk-O7G3G3FD.js";
|
|
13
13
|
import {
|
|
14
14
|
BFLImageService,
|
|
15
15
|
BaseStorage,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
OpenAIBackend,
|
|
22
22
|
OpenAIImageService,
|
|
23
23
|
XAIImageService
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-M2CSCYOY.js";
|
|
25
25
|
import {
|
|
26
26
|
AiEvents,
|
|
27
27
|
ApiKeyEvents,
|
|
@@ -75,21 +75,21 @@ import {
|
|
|
75
75
|
XAI_IMAGE_MODELS,
|
|
76
76
|
b4mLLMTools,
|
|
77
77
|
getMcpProviderMetadata
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-LL5J3SVB.js";
|
|
79
79
|
import {
|
|
80
80
|
Logger
|
|
81
81
|
} from "./chunk-OCYRD7D6.js";
|
|
82
82
|
import "./chunk-BPFEGDC7.js";
|
|
83
83
|
|
|
84
84
|
// src/index.tsx
|
|
85
|
-
import
|
|
86
|
-
import { render, Box as
|
|
85
|
+
import React19, { useState as useState8, useEffect as useEffect4, useCallback, useRef as useRef3 } from "react";
|
|
86
|
+
import { render, Box as Box18, Text as Text18, useApp, useInput as useInput7 } from "ink";
|
|
87
87
|
import { execSync } from "child_process";
|
|
88
88
|
import { v4 as uuidv49 } from "uuid";
|
|
89
89
|
|
|
90
90
|
// src/components/App.tsx
|
|
91
|
-
import
|
|
92
|
-
import { Box as
|
|
91
|
+
import React13, { useState as useState4 } from "react";
|
|
92
|
+
import { Box as Box12, Text as Text12, Static } from "ink";
|
|
93
93
|
|
|
94
94
|
// src/components/StatusBar.tsx
|
|
95
95
|
import React from "react";
|
|
@@ -99,11 +99,11 @@ var StatusBar = React.memo(function StatusBar2({ sessionName, model, tokenUsage
|
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
// src/components/InputPrompt.tsx
|
|
102
|
-
import React5, { useState as useState2, useMemo, useEffect, useRef } from "react";
|
|
102
|
+
import React5, { useState as useState2, useMemo, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
103
103
|
import { Box as Box4, Text as Text5, useInput as useInput2 } from "ink";
|
|
104
104
|
|
|
105
105
|
// src/components/CustomTextInput.tsx
|
|
106
|
-
import React2, { useState } from "react";
|
|
106
|
+
import React2, { useEffect, useRef, useState } from "react";
|
|
107
107
|
import { Text as Text2, useInput } from "ink";
|
|
108
108
|
function CustomTextInput({
|
|
109
109
|
value,
|
|
@@ -114,6 +114,13 @@ function CustomTextInput({
|
|
|
114
114
|
disabled = false
|
|
115
115
|
}) {
|
|
116
116
|
const [cursorOffset, setCursorOffset] = useState(value.length);
|
|
117
|
+
const prevValueRef = useRef(value);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (value !== prevValueRef.current) {
|
|
120
|
+
setCursorOffset(value.length);
|
|
121
|
+
prevValueRef.current = value;
|
|
122
|
+
}
|
|
123
|
+
}, [value]);
|
|
117
124
|
useInput(
|
|
118
125
|
(input, key) => {
|
|
119
126
|
if (key.return && !key.meta && !key.shift) {
|
|
@@ -887,8 +894,8 @@ function InputPrompt({
|
|
|
887
894
|
const [selectedIndex, setSelectedIndex] = useState2(0);
|
|
888
895
|
const [historyIndex, setHistoryIndex] = useState2(-1);
|
|
889
896
|
const [tempInput, setTempInput] = useState2("");
|
|
890
|
-
const inputKey =
|
|
891
|
-
|
|
897
|
+
const inputKey = useRef2(0);
|
|
898
|
+
useEffect2(() => {
|
|
892
899
|
if (prefillInput) {
|
|
893
900
|
setValue(prefillInput);
|
|
894
901
|
onPrefillConsumed?.();
|
|
@@ -897,7 +904,7 @@ function InputPrompt({
|
|
|
897
904
|
const [fileAutocomplete, setFileAutocomplete] = useState2(null);
|
|
898
905
|
const [fileSelectedIndex, setFileSelectedIndex] = useState2(0);
|
|
899
906
|
const isBashMode = value.startsWith("!");
|
|
900
|
-
|
|
907
|
+
useEffect2(() => {
|
|
901
908
|
onBashModeChange?.(isBashMode);
|
|
902
909
|
}, [isBashMode, onBashModeChange]);
|
|
903
910
|
const shouldShowCommandAutocomplete = value.startsWith("/") && !disabled && !fileAutocomplete?.active && !looksLikeFilePath(value);
|
|
@@ -910,10 +917,10 @@ function InputPrompt({
|
|
|
910
917
|
if (!fileAutocomplete?.active) return [];
|
|
911
918
|
return searchFiles(fileAutocomplete.query);
|
|
912
919
|
}, [fileAutocomplete?.active, fileAutocomplete?.query]);
|
|
913
|
-
|
|
920
|
+
useEffect2(() => {
|
|
914
921
|
setSelectedIndex(0);
|
|
915
922
|
}, [filteredCommands]);
|
|
916
|
-
|
|
923
|
+
useEffect2(() => {
|
|
917
924
|
setFileSelectedIndex(0);
|
|
918
925
|
}, [filteredFiles]);
|
|
919
926
|
useInput2(
|
|
@@ -1422,24 +1429,128 @@ function McpViewer({ config, mcpManager, onClose }) {
|
|
|
1422
1429
|
}
|
|
1423
1430
|
|
|
1424
1431
|
// src/components/MessageItem.tsx
|
|
1432
|
+
import React12 from "react";
|
|
1433
|
+
import { Box as Box11, Text as Text11 } from "ink";
|
|
1434
|
+
|
|
1435
|
+
// src/components/MarkdownRenderer.tsx
|
|
1425
1436
|
import React11 from "react";
|
|
1426
1437
|
import { Box as Box10, Text as Text10 } from "ink";
|
|
1438
|
+
import { marked } from "marked";
|
|
1439
|
+
import { highlight } from "cli-highlight";
|
|
1440
|
+
function MarkdownRenderer({ content }) {
|
|
1441
|
+
const tokens = marked.lexer(content);
|
|
1442
|
+
return /* @__PURE__ */ React11.createElement(Box10, { flexDirection: "column" }, tokens.map((token, idx) => renderToken(token, idx)));
|
|
1443
|
+
}
|
|
1444
|
+
function renderToken(token, idx) {
|
|
1445
|
+
switch (token.type) {
|
|
1446
|
+
case "heading":
|
|
1447
|
+
return renderHeading(token, idx);
|
|
1448
|
+
case "code":
|
|
1449
|
+
return renderCodeBlock(token, idx);
|
|
1450
|
+
case "paragraph":
|
|
1451
|
+
return renderParagraph(token, idx);
|
|
1452
|
+
case "list":
|
|
1453
|
+
return renderList(token, idx);
|
|
1454
|
+
case "blockquote":
|
|
1455
|
+
return renderBlockquote(token, idx);
|
|
1456
|
+
case "hr":
|
|
1457
|
+
return /* @__PURE__ */ React11.createElement(Text10, { key: idx, dimColor: true }, "\u2500".repeat(50));
|
|
1458
|
+
case "space":
|
|
1459
|
+
return null;
|
|
1460
|
+
default:
|
|
1461
|
+
if ("text" in token) {
|
|
1462
|
+
return /* @__PURE__ */ React11.createElement(Text10, { key: idx }, token.text);
|
|
1463
|
+
}
|
|
1464
|
+
return null;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
function renderHeading(token, idx) {
|
|
1468
|
+
const colors = {
|
|
1469
|
+
1: "cyan",
|
|
1470
|
+
2: "cyan",
|
|
1471
|
+
3: "blue",
|
|
1472
|
+
4: "blue",
|
|
1473
|
+
5: "white",
|
|
1474
|
+
6: "white"
|
|
1475
|
+
};
|
|
1476
|
+
const color = colors[token.depth] || "white";
|
|
1477
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx, marginTop: idx > 0 ? 1 : 0 }, /* @__PURE__ */ React11.createElement(Text10, { bold: true, color }, parseInlineText(token.text)));
|
|
1478
|
+
}
|
|
1479
|
+
function renderCodeBlock(token, idx) {
|
|
1480
|
+
let highlightedCode;
|
|
1481
|
+
try {
|
|
1482
|
+
highlightedCode = highlight(token.text, {
|
|
1483
|
+
language: token.lang || "javascript",
|
|
1484
|
+
ignoreIllegals: true
|
|
1485
|
+
});
|
|
1486
|
+
} catch (error) {
|
|
1487
|
+
highlightedCode = token.text;
|
|
1488
|
+
}
|
|
1489
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx, flexDirection: "column", paddingLeft: 2 }, token.lang && /* @__PURE__ */ React11.createElement(Text10, { dimColor: true, color: "gray" }, token.lang), /* @__PURE__ */ React11.createElement(Text10, null, highlightedCode));
|
|
1490
|
+
}
|
|
1491
|
+
function renderParagraph(token, idx) {
|
|
1492
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx }, /* @__PURE__ */ React11.createElement(Text10, null, parseInlineText(token.text)));
|
|
1493
|
+
}
|
|
1494
|
+
function renderList(token, idx) {
|
|
1495
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx, flexDirection: "column" }, token.items.map((item, itemIdx) => renderListItem(item, itemIdx, token.ordered, itemIdx + 1)));
|
|
1496
|
+
}
|
|
1497
|
+
function renderListItem(item, idx, ordered, number) {
|
|
1498
|
+
const bullet = ordered ? `${number}.` : "\u2022";
|
|
1499
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx, paddingLeft: 2 }, /* @__PURE__ */ React11.createElement(Text10, null, bullet, " ", parseInlineText(item.text)));
|
|
1500
|
+
}
|
|
1501
|
+
function renderBlockquote(token, idx) {
|
|
1502
|
+
return /* @__PURE__ */ React11.createElement(Box10, { key: idx, paddingLeft: 2, borderStyle: "single", borderLeft: true, borderColor: "gray" }, token.tokens.map((t, i) => renderToken(t, i)));
|
|
1503
|
+
}
|
|
1504
|
+
function parseInlineText(text) {
|
|
1505
|
+
const parts = [];
|
|
1506
|
+
let lastIndex = 0;
|
|
1507
|
+
const regex = /(\*\*(.+?)\*\*)|(\*(.+?)\*)|(`(.+?)`)/g;
|
|
1508
|
+
let match;
|
|
1509
|
+
while ((match = regex.exec(text)) !== null) {
|
|
1510
|
+
if (match.index > lastIndex) {
|
|
1511
|
+
parts.push(text.slice(lastIndex, match.index));
|
|
1512
|
+
}
|
|
1513
|
+
if (match[1]) {
|
|
1514
|
+
parts.push(
|
|
1515
|
+
/* @__PURE__ */ React11.createElement(Text10, { key: match.index, bold: true }, match[2])
|
|
1516
|
+
);
|
|
1517
|
+
} else if (match[3]) {
|
|
1518
|
+
parts.push(
|
|
1519
|
+
/* @__PURE__ */ React11.createElement(Text10, { key: match.index, italic: true }, match[4])
|
|
1520
|
+
);
|
|
1521
|
+
} else if (match[5]) {
|
|
1522
|
+
parts.push(
|
|
1523
|
+
/* @__PURE__ */ React11.createElement(Text10, { key: match.index, color: "cyan" }, match[6])
|
|
1524
|
+
);
|
|
1525
|
+
}
|
|
1526
|
+
lastIndex = regex.lastIndex;
|
|
1527
|
+
}
|
|
1528
|
+
if (lastIndex < text.length) {
|
|
1529
|
+
parts.push(text.slice(lastIndex));
|
|
1530
|
+
}
|
|
1531
|
+
if (parts.length === 0) {
|
|
1532
|
+
return text;
|
|
1533
|
+
}
|
|
1534
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, parts);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
// src/components/MessageItem.tsx
|
|
1427
1538
|
function MessageItem({ message }) {
|
|
1428
1539
|
const isUser = message.role === "user";
|
|
1429
1540
|
const isSystem = message.role === "system";
|
|
1430
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ React12.createElement(Box11, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Box11, null, /* @__PURE__ */ React12.createElement(Text11, { bold: true, color: isUser ? "cyan" : isSystem ? "gray" : "green" }, isUser ? "\u{1F464} You" : isSystem ? "\u2139\uFE0F System" : "\u{1F916} Assistant"), isUser && /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, " \u2022 ", new Date(message.timestamp).toLocaleTimeString())), isUser && message.content && /* @__PURE__ */ React12.createElement(Box11, { paddingLeft: 2 }, /* @__PURE__ */ React12.createElement(Text11, { backgroundColor: "whiteBright", color: "black" }, " ", message.content, " ")), !isUser && message.metadata?.steps && message.metadata.steps.length > 0 && /* @__PURE__ */ React12.createElement(Box11, { paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text11, { dimColor: true, bold: true }, "\u{1F527} Agent Reasoning Trace (", message.metadata.steps.filter((s) => s.type === "action").length, " ", "tools used, ", message.metadata.steps.length, " total steps)", message.metadata.tokenUsage && ` \u2022 ${message.metadata.tokenUsage.total} tokens`), /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, "Step types: ", message.metadata.steps.map((s) => s.type).join(", ")), message.metadata.steps.map((step, idx) => {
|
|
1431
1542
|
if (step.type === "thought") {
|
|
1432
|
-
return /* @__PURE__ */
|
|
1543
|
+
return /* @__PURE__ */ React12.createElement(Box11, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text11, { color: "blue" }, "\u{1F4AD} Thought:"), /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, ` ${step.content}`));
|
|
1433
1544
|
}
|
|
1434
1545
|
if (step.type === "action") {
|
|
1435
1546
|
const toolName = step.metadata?.toolName || "unknown";
|
|
1436
1547
|
const toolInput = step.metadata?.toolInput;
|
|
1437
1548
|
const observationStep = message.metadata.steps[idx + 1];
|
|
1438
1549
|
const result = observationStep?.type === "observation" ? observationStep.content : null;
|
|
1439
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React12.createElement(Box11, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text11, { color: "yellow" }, "\u{1F527} Action: ", toolName), toolInput && /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, ` Input: ${typeof toolInput === "string" ? toolInput : JSON.stringify(toolInput).slice(0, 100)}`), result && /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, ` Result: ${typeof result === "string" ? result.slice(0, 200) : JSON.stringify(result).slice(0, 200)}${(typeof result === "string" ? result.length : JSON.stringify(result).length) > 200 ? "..." : ""}`));
|
|
1440
1551
|
}
|
|
1441
1552
|
return null;
|
|
1442
|
-
}).filter(Boolean)), !isUser && message.content !== "..." && /* @__PURE__ */
|
|
1553
|
+
}).filter(Boolean)), !isUser && message.content !== "..." && /* @__PURE__ */ React12.createElement(Box11, { paddingLeft: 2, marginTop: message.metadata?.steps?.length ? 1 : 0 }, message.metadata?.permissionDenied ? /* @__PURE__ */ React12.createElement(Text11, { color: "yellow" }, "\u26A0\uFE0F ", message.content) : /* @__PURE__ */ React12.createElement(MarkdownRenderer, { content: message.content })), message.metadata?.tokenUsage && (!message.metadata.steps || message.metadata.steps.length === 0) && /* @__PURE__ */ React12.createElement(Box11, { paddingLeft: 2 }, /* @__PURE__ */ React12.createElement(Text11, { dimColor: true }, `${message.metadata.tokenUsage.total} tokens`)));
|
|
1443
1554
|
}
|
|
1444
1555
|
|
|
1445
1556
|
// src/utils/processFileReferences.ts
|
|
@@ -1586,7 +1697,7 @@ function App({
|
|
|
1586
1697
|
const exitRequested = useCliStore((state) => state.exitRequested);
|
|
1587
1698
|
const setIsThinking = useCliStore((state) => state.setIsThinking);
|
|
1588
1699
|
const [isBashMode, setIsBashMode] = useState4(false);
|
|
1589
|
-
const handleSubmit =
|
|
1700
|
+
const handleSubmit = React13.useCallback(
|
|
1590
1701
|
async (input) => {
|
|
1591
1702
|
const trimmed = input.trim();
|
|
1592
1703
|
if (!trimmed) return;
|
|
@@ -1615,7 +1726,7 @@ ${errorBlock}`;
|
|
|
1615
1726
|
},
|
|
1616
1727
|
[onMessage, onCommand, setIsThinking]
|
|
1617
1728
|
);
|
|
1618
|
-
return /* @__PURE__ */
|
|
1729
|
+
return /* @__PURE__ */ React13.createElement(Box12, { flexDirection: "column" }, showConfigEditor && config && onSaveConfig ? /* @__PURE__ */ React13.createElement(Box12, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React13.createElement(
|
|
1619
1730
|
ConfigEditor,
|
|
1620
1731
|
{
|
|
1621
1732
|
config,
|
|
@@ -1625,8 +1736,8 @@ ${errorBlock}`;
|
|
|
1625
1736
|
}
|
|
1626
1737
|
)) : showMcpViewer && config ? (
|
|
1627
1738
|
/* MCP Viewer - full screen takeover */
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
) : /* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ React13.createElement(Box12, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React13.createElement(McpViewer, { config, mcpManager, onClose: () => setShowMcpViewer(false) }))
|
|
1740
|
+
) : /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Static, { items: messages }, (message) => /* @__PURE__ */ React13.createElement(Box12, { key: message.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React13.createElement(MessageItem, { message }))), /* @__PURE__ */ React13.createElement(Box12, { flexDirection: "column" }, pendingMessages.map((message) => /* @__PURE__ */ React13.createElement(Box12, { key: message.id, flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React13.createElement(MessageItem, { message })))), permissionPrompt && /* @__PURE__ */ React13.createElement(Box12, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React13.createElement(
|
|
1630
1741
|
PermissionPrompt,
|
|
1631
1742
|
{
|
|
1632
1743
|
toolName: permissionPrompt.toolName,
|
|
@@ -1635,7 +1746,7 @@ ${errorBlock}`;
|
|
|
1635
1746
|
canBeTrusted: permissionPrompt.canBeTrusted,
|
|
1636
1747
|
onResponse: onPermissionResponse
|
|
1637
1748
|
}
|
|
1638
|
-
)), !permissionPrompt && /* @__PURE__ */
|
|
1749
|
+
)), !permissionPrompt && /* @__PURE__ */ React13.createElement(AgentThinking, null), exitRequested && /* @__PURE__ */ React13.createElement(Box12, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text12, { color: "yellow", bold: true }, "Press Ctrl+C again to exit")), /* @__PURE__ */ React13.createElement(Box12, { borderStyle: "single", borderColor: isBashMode ? "yellow" : "cyan", paddingX: 1 }, /* @__PURE__ */ React13.createElement(
|
|
1639
1750
|
InputPrompt,
|
|
1640
1751
|
{
|
|
1641
1752
|
onSubmit: handleSubmit,
|
|
@@ -1648,24 +1759,24 @@ ${errorBlock}`;
|
|
|
1648
1759
|
onPrefillConsumed,
|
|
1649
1760
|
onBashModeChange: setIsBashMode
|
|
1650
1761
|
}
|
|
1651
|
-
)), /* @__PURE__ */
|
|
1762
|
+
)), /* @__PURE__ */ React13.createElement(StatusBar, { sessionName, model: currentModel, tokenUsage: totalTokens })));
|
|
1652
1763
|
}
|
|
1653
1764
|
|
|
1654
1765
|
// src/components/MessageList.tsx
|
|
1655
|
-
import
|
|
1656
|
-
import { Box as
|
|
1766
|
+
import React14 from "react";
|
|
1767
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
1657
1768
|
function stripThinkingTags(content) {
|
|
1658
1769
|
return content.replace(/<think>[\s\S]*?<\/think>/g, "").trim();
|
|
1659
1770
|
}
|
|
1660
|
-
var MessageList =
|
|
1771
|
+
var MessageList = React14.memo(
|
|
1661
1772
|
function MessageList2({ messages }) {
|
|
1662
1773
|
if (messages.length === 0) {
|
|
1663
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ React14.createElement(Box13, { paddingY: 1 }, /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, "No messages yet. Type a message to start!"));
|
|
1664
1775
|
}
|
|
1665
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ React14.createElement(Box13, { flexDirection: "column", gap: 1, paddingY: 1 }, messages.map((message, index) => /* @__PURE__ */ React14.createElement(Box13, { key: index, flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React14.createElement(Box13, null, /* @__PURE__ */ React14.createElement(Text13, { bold: true, color: message.role === "user" ? "cyan" : "green" }, message.role === "user" ? "\u{1F464} You" : "\u{1F916} Assistant"), /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, " \u2022 ", new Date(message.timestamp).toLocaleTimeString())), /* @__PURE__ */ React14.createElement(Box13, { paddingLeft: 2 }, message.metadata?.permissionDenied ? /* @__PURE__ */ React14.createElement(Text13, { color: "yellow" }, "\u26A0\uFE0F ", stripThinkingTags(message.content)) : /* @__PURE__ */ React14.createElement(Text13, null, stripThinkingTags(message.content))), message.metadata?.steps && message.metadata.steps.length > 0 && /* @__PURE__ */ React14.createElement(Box13, { paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React14.createElement(Text13, { dimColor: true, bold: true }, "\u{1F527} Agent Reasoning Trace (", message.metadata.steps.filter((s) => s.type === "action").length, " tools used,", " ", message.metadata.steps.length, " total steps)", message.metadata.tokenUsage && ` \u2022 ${message.metadata.tokenUsage.total} tokens`), /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, "Step types: ", message.metadata.steps.map((s) => s.type).join(", ")), message.metadata.steps.map((step, idx) => {
|
|
1666
1777
|
if (step.type === "thought") {
|
|
1667
|
-
return /* @__PURE__ */
|
|
1668
|
-
|
|
1778
|
+
return /* @__PURE__ */ React14.createElement(Box13, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React14.createElement(Text13, { color: "blue" }, "\u{1F4AD} Thought:"), /* @__PURE__ */ React14.createElement(
|
|
1779
|
+
Text13,
|
|
1669
1780
|
{
|
|
1670
1781
|
dimColor: true
|
|
1671
1782
|
},
|
|
@@ -1677,10 +1788,10 @@ var MessageList = React13.memo(
|
|
|
1677
1788
|
const toolInput = step.metadata?.toolInput;
|
|
1678
1789
|
const observationStep = message.metadata.steps[idx + 1];
|
|
1679
1790
|
const result = observationStep?.type === "observation" ? observationStep.content : null;
|
|
1680
|
-
return /* @__PURE__ */
|
|
1791
|
+
return /* @__PURE__ */ React14.createElement(Box13, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React14.createElement(Text13, { color: "yellow" }, "\u{1F527} Action: ", toolName), toolInput && /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, ` Input: ${typeof toolInput === "string" ? toolInput : JSON.stringify(toolInput).slice(0, 100)}`), result && /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, ` Result: ${typeof result === "string" ? result.slice(0, 200) : JSON.stringify(result).slice(0, 200)}${(typeof result === "string" ? result.length : JSON.stringify(result).length) > 200 ? "..." : ""}`));
|
|
1681
1792
|
}
|
|
1682
1793
|
return null;
|
|
1683
|
-
}).filter(Boolean)), message.metadata?.tokenUsage && (!message.metadata.steps || message.metadata.steps.length === 0) && /* @__PURE__ */
|
|
1794
|
+
}).filter(Boolean)), message.metadata?.tokenUsage && (!message.metadata.steps || message.metadata.steps.length === 0) && /* @__PURE__ */ React14.createElement(Box13, { paddingLeft: 2 }, /* @__PURE__ */ React14.createElement(Text13, { dimColor: true }, `${message.metadata.tokenUsage.total} tokens`)))));
|
|
1684
1795
|
},
|
|
1685
1796
|
(prevProps, nextProps) => {
|
|
1686
1797
|
if (prevProps.messages.length !== nextProps.messages.length) {
|
|
@@ -1691,8 +1802,8 @@ var MessageList = React13.memo(
|
|
|
1691
1802
|
);
|
|
1692
1803
|
|
|
1693
1804
|
// src/components/TrustLocationSelector.tsx
|
|
1694
|
-
import
|
|
1695
|
-
import { Box as
|
|
1805
|
+
import React15 from "react";
|
|
1806
|
+
import { Box as Box14, Text as Text14 } from "ink";
|
|
1696
1807
|
import SelectInput2 from "ink-select-input";
|
|
1697
1808
|
function TrustLocationSelector({ inProject, onSelect, onCancel }) {
|
|
1698
1809
|
const items = [];
|
|
@@ -1713,19 +1824,19 @@ function TrustLocationSelector({ inProject, onSelect, onCancel }) {
|
|
|
1713
1824
|
const handleSelect = (item) => {
|
|
1714
1825
|
onSelect(item.value);
|
|
1715
1826
|
};
|
|
1716
|
-
return /* @__PURE__ */
|
|
1827
|
+
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text14, { bold: true }, "Where should this rule be saved?")), /* @__PURE__ */ React15.createElement(
|
|
1717
1828
|
SelectInput2,
|
|
1718
1829
|
{
|
|
1719
1830
|
items,
|
|
1720
1831
|
onSelect: handleSelect,
|
|
1721
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
1832
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Text14, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " ", label))
|
|
1722
1833
|
}
|
|
1723
|
-
), /* @__PURE__ */
|
|
1834
|
+
), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text14, { dimColor: true }, "Use \u2191\u2193 arrows to navigate, Enter to select, Ctrl+C to cancel")));
|
|
1724
1835
|
}
|
|
1725
1836
|
|
|
1726
1837
|
// src/components/RewindSelector.tsx
|
|
1727
|
-
import
|
|
1728
|
-
import { Box as
|
|
1838
|
+
import React16, { useState as useState5 } from "react";
|
|
1839
|
+
import { Box as Box15, Text as Text15, useInput as useInput5 } from "ink";
|
|
1729
1840
|
import SelectInput3 from "ink-select-input";
|
|
1730
1841
|
function RewindSelector({ messages, onSelect, onCancel }) {
|
|
1731
1842
|
const [step, setStep] = useState5("selection");
|
|
@@ -1767,14 +1878,14 @@ function RewindSelector({ messages, onSelect, onCancel }) {
|
|
|
1767
1878
|
return sum2 + (msg.metadata?.tokenUsage?.total || 0);
|
|
1768
1879
|
}, 0);
|
|
1769
1880
|
if (step === "selection") {
|
|
1770
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ React16.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React16.createElement(Box15, { marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text15, { bold: true }, "Select a point to rewind to:")), /* @__PURE__ */ React16.createElement(
|
|
1771
1882
|
SelectInput3,
|
|
1772
1883
|
{
|
|
1773
1884
|
items,
|
|
1774
1885
|
onSelect: handleSelectionSelect,
|
|
1775
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
1886
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ React16.createElement(Box15, null, /* @__PURE__ */ React16.createElement(Text15, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " ", label))
|
|
1776
1887
|
}
|
|
1777
|
-
), /* @__PURE__ */
|
|
1888
|
+
), /* @__PURE__ */ React16.createElement(Box15, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text15, { dimColor: true }, "Use \u2191\u2193 arrows to navigate, Enter to select, Esc to cancel")));
|
|
1778
1889
|
}
|
|
1779
1890
|
const confirmationItems = [
|
|
1780
1891
|
{ label: "Yes, rewind to this point", value: "confirm" },
|
|
@@ -1782,19 +1893,19 @@ function RewindSelector({ messages, onSelect, onCancel }) {
|
|
|
1782
1893
|
];
|
|
1783
1894
|
const selectedMessage = selectedMessageIndex !== null && selectedMessageIndex >= 0 && selectedMessageIndex < messages.length ? messages[selectedMessageIndex] : null;
|
|
1784
1895
|
const selectedPreview = selectedMessage ? selectedMessage.content.length > 50 ? selectedMessage.content.substring(0, 50) + "..." : selectedMessage.content : "";
|
|
1785
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ React16.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React16.createElement(Box15, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text15, { bold: true }, "Confirm rewind operation:"), /* @__PURE__ */ React16.createElement(Text15, { dimColor: true }, "Message: ", selectedPreview), /* @__PURE__ */ React16.createElement(Text15, { color: "yellow" }, "This will remove ", messagesToRemove.length, " message(s) (", tokensToRemove.toLocaleString(), " tokens)"), /* @__PURE__ */ React16.createElement(Text15, { color: "cyan" }, "The selected message will be placed in your input for editing.")), /* @__PURE__ */ React16.createElement(
|
|
1786
1897
|
SelectInput3,
|
|
1787
1898
|
{
|
|
1788
1899
|
items: confirmationItems,
|
|
1789
1900
|
onSelect: handleConfirmationSelect,
|
|
1790
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
1901
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ React16.createElement(Box15, null, /* @__PURE__ */ React16.createElement(Text15, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " ", label))
|
|
1791
1902
|
}
|
|
1792
|
-
), /* @__PURE__ */
|
|
1903
|
+
), /* @__PURE__ */ React16.createElement(Box15, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text15, { dimColor: true }, "Use \u2191\u2193 arrows to navigate, Enter to select, Esc to go back")));
|
|
1793
1904
|
}
|
|
1794
1905
|
|
|
1795
1906
|
// src/components/SessionSelector.tsx
|
|
1796
|
-
import
|
|
1797
|
-
import { Box as
|
|
1907
|
+
import React17, { useState as useState6 } from "react";
|
|
1908
|
+
import { Box as Box16, Text as Text16, useInput as useInput6 } from "ink";
|
|
1798
1909
|
import SelectInput4 from "ink-select-input";
|
|
1799
1910
|
function SessionSelector({ sessions, currentSession, onSelect, onCancel }) {
|
|
1800
1911
|
const [step, setStep] = useState6("selection");
|
|
@@ -1832,32 +1943,32 @@ function SessionSelector({ sessions, currentSession, onSelect, onCancel }) {
|
|
|
1832
1943
|
}
|
|
1833
1944
|
};
|
|
1834
1945
|
if (step === "selection") {
|
|
1835
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ React17.createElement(Box16, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React17.createElement(Box16, { marginBottom: 1 }, /* @__PURE__ */ React17.createElement(Text16, { bold: true }, "Select a session to resume:")), /* @__PURE__ */ React17.createElement(
|
|
1836
1947
|
SelectInput4,
|
|
1837
1948
|
{
|
|
1838
1949
|
items,
|
|
1839
1950
|
onSelect: handleSelectionSelect,
|
|
1840
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
1951
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ React17.createElement(Box16, null, /* @__PURE__ */ React17.createElement(Text16, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " ", label))
|
|
1841
1952
|
}
|
|
1842
|
-
), /* @__PURE__ */
|
|
1953
|
+
), /* @__PURE__ */ React17.createElement(Box16, { marginTop: 1 }, /* @__PURE__ */ React17.createElement(Text16, { dimColor: true }, "Use \u2191\u2193 arrows to navigate, Enter to select, Esc to cancel")));
|
|
1843
1954
|
}
|
|
1844
1955
|
const confirmationItems = [
|
|
1845
1956
|
{ label: "Yes, resume this session", value: "confirm" },
|
|
1846
1957
|
{ label: "No, go back to selection", value: "cancel" }
|
|
1847
1958
|
];
|
|
1848
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ React17.createElement(Box16, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React17.createElement(Box16, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React17.createElement(Text16, { bold: true }, 'Resume session: "', selectedSession?.name, '"'), /* @__PURE__ */ React17.createElement(Text16, { dimColor: true }, selectedSession?.messages.length, " messages | ", selectedSession?.model, " |", " ", selectedSession?.metadata?.totalTokens?.toLocaleString() ?? 0, " tokens"), hasUnsavedWork && /* @__PURE__ */ React17.createElement(Text16, { color: "yellow" }, "Warning: Your current session has unsaved messages. Use /save first if needed.")), /* @__PURE__ */ React17.createElement(
|
|
1849
1960
|
SelectInput4,
|
|
1850
1961
|
{
|
|
1851
1962
|
items: confirmationItems,
|
|
1852
1963
|
onSelect: handleConfirmationSelect,
|
|
1853
|
-
itemComponent: ({ isSelected, label }) => /* @__PURE__ */
|
|
1964
|
+
itemComponent: ({ isSelected, label }) => /* @__PURE__ */ React17.createElement(Box16, null, /* @__PURE__ */ React17.createElement(Text16, { color: isSelected ? "cyan" : void 0 }, isSelected ? "\u276F " : " ", label))
|
|
1854
1965
|
}
|
|
1855
|
-
), /* @__PURE__ */
|
|
1966
|
+
), /* @__PURE__ */ React17.createElement(Box16, { marginTop: 1 }, /* @__PURE__ */ React17.createElement(Text16, { dimColor: true }, "Use \u2191\u2193 arrows to navigate, Enter to select, Esc to go back")));
|
|
1856
1967
|
}
|
|
1857
1968
|
|
|
1858
1969
|
// src/components/LoginFlow.tsx
|
|
1859
|
-
import
|
|
1860
|
-
import { Box as
|
|
1970
|
+
import React18, { useState as useState7, useEffect as useEffect3 } from "react";
|
|
1971
|
+
import { Box as Box17, Text as Text17 } from "ink";
|
|
1861
1972
|
import Spinner2 from "ink-spinner";
|
|
1862
1973
|
import jwt from "jsonwebtoken";
|
|
1863
1974
|
import open from "open";
|
|
@@ -1977,7 +2088,7 @@ function LoginFlow({ apiUrl = "http://localhost:3000", configStore, onSuccess, o
|
|
|
1977
2088
|
const [deviceFlow, setDeviceFlow] = useState7(null);
|
|
1978
2089
|
const [statusMessage, setStatusMessage] = useState7("Initiating device authorization...");
|
|
1979
2090
|
const [error, setError] = useState7(null);
|
|
1980
|
-
|
|
2091
|
+
useEffect3(() => {
|
|
1981
2092
|
const runLoginFlow = async () => {
|
|
1982
2093
|
const oauth = new OAuthClient(apiUrl);
|
|
1983
2094
|
try {
|
|
@@ -2012,7 +2123,7 @@ function LoginFlow({ apiUrl = "http://localhost:3000", configStore, onSuccess, o
|
|
|
2012
2123
|
};
|
|
2013
2124
|
runLoginFlow();
|
|
2014
2125
|
}, [apiUrl, configStore, onSuccess, onError]);
|
|
2015
|
-
|
|
2126
|
+
useEffect3(() => {
|
|
2016
2127
|
if (deviceFlow && status === "waiting") {
|
|
2017
2128
|
open(deviceFlow.verification_uri_complete).catch((err) => {
|
|
2018
2129
|
console.error("Failed to auto-open browser:", err);
|
|
@@ -2020,15 +2131,15 @@ function LoginFlow({ apiUrl = "http://localhost:3000", configStore, onSuccess, o
|
|
|
2020
2131
|
}
|
|
2021
2132
|
}, [deviceFlow, status]);
|
|
2022
2133
|
if (status === "initiating") {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2134
|
+
return /* @__PURE__ */ React18.createElement(Box17, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React18.createElement(Box17, null, /* @__PURE__ */ React18.createElement(Text17, { color: "cyan" }, /* @__PURE__ */ React18.createElement(Spinner2, { type: "dots" }), " Initiating device authorization...")));
|
|
2024
2135
|
}
|
|
2025
2136
|
if (status === "error") {
|
|
2026
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ React18.createElement(Box17, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "red", bold: true }, "\u2716 Authentication Failed")), /* @__PURE__ */ React18.createElement(Box17, null, /* @__PURE__ */ React18.createElement(Text17, { color: "red" }, error)));
|
|
2027
2138
|
}
|
|
2028
2139
|
if (status === "success") {
|
|
2029
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ React18.createElement(Box17, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "green", bold: true }, "\u2714 Successfully authenticated!")), /* @__PURE__ */ React18.createElement(Box17, null, /* @__PURE__ */ React18.createElement(Text17, { dimColor: true }, "You can now use B4M CLI with your account.")));
|
|
2030
2141
|
}
|
|
2031
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ React18.createElement(Box17, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan" }, /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "cyan", bold: true }, "\u{1F510} Device Authorization")), /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, null, "Opening browser automatically... If it doesn't open, please visit:")), /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React18.createElement(Text17, { color: "blue", bold: true }, deviceFlow?.verification_uri)), /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, null, "And enter this code when prompted:")), /* @__PURE__ */ React18.createElement(Box17, { marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React18.createElement(Text17, { color: "yellow", bold: true }, deviceFlow?.user_code)), /* @__PURE__ */ React18.createElement(Box17, { marginTop: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "cyan" }, /* @__PURE__ */ React18.createElement(Spinner2, { type: "dots" }), " ", statusMessage)), /* @__PURE__ */ React18.createElement(Box17, { marginTop: 1 }, /* @__PURE__ */ React18.createElement(Text17, { dimColor: true }, "Expires in ", deviceFlow ? Math.floor(deviceFlow.expires_in / 60) : 0, " minutes")));
|
|
2032
2143
|
}
|
|
2033
2144
|
|
|
2034
2145
|
// src/storage/SessionStore.ts
|
|
@@ -11319,7 +11430,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
11319
11430
|
// package.json
|
|
11320
11431
|
var package_default = {
|
|
11321
11432
|
name: "@bike4mind/cli",
|
|
11322
|
-
version: "0.2.
|
|
11433
|
+
version: "0.2.15",
|
|
11323
11434
|
type: "module",
|
|
11324
11435
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
11325
11436
|
license: "UNLICENSED",
|
|
@@ -11383,6 +11494,7 @@ var package_default = {
|
|
|
11383
11494
|
bcryptjs: "^2.4.3",
|
|
11384
11495
|
"better-sqlite3": "^12.5.0",
|
|
11385
11496
|
cheerio: "1.0.0-rc.12",
|
|
11497
|
+
"cli-highlight": "^2.1.11",
|
|
11386
11498
|
"csv-parse": "^5.5.6",
|
|
11387
11499
|
dayjs: "^1.11.13",
|
|
11388
11500
|
diff: "^8.0.2",
|
|
@@ -11424,11 +11536,11 @@ var package_default = {
|
|
|
11424
11536
|
zustand: "^4.5.4"
|
|
11425
11537
|
},
|
|
11426
11538
|
devDependencies: {
|
|
11427
|
-
"@bike4mind/agents": "
|
|
11428
|
-
"@bike4mind/common": "
|
|
11429
|
-
"@bike4mind/mcp": "
|
|
11430
|
-
"@bike4mind/services": "
|
|
11431
|
-
"@bike4mind/utils": "
|
|
11539
|
+
"@bike4mind/agents": "workspace:*",
|
|
11540
|
+
"@bike4mind/common": "workspace:*",
|
|
11541
|
+
"@bike4mind/mcp": "workspace:*",
|
|
11542
|
+
"@bike4mind/services": "workspace:*",
|
|
11543
|
+
"@bike4mind/utils": "workspace:*",
|
|
11432
11544
|
"@types/better-sqlite3": "^7.6.13",
|
|
11433
11545
|
"@types/diff": "^5.0.9",
|
|
11434
11546
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -11441,8 +11553,7 @@ var package_default = {
|
|
|
11441
11553
|
tsx: "^4.21.0",
|
|
11442
11554
|
typescript: "^5.9.3",
|
|
11443
11555
|
vitest: "^3.2.4"
|
|
11444
|
-
}
|
|
11445
|
-
gitHead: "80b2b6cb3adec51e5bb59c7fddec4a2e82148393"
|
|
11556
|
+
}
|
|
11446
11557
|
};
|
|
11447
11558
|
|
|
11448
11559
|
// src/config/constants.ts
|
|
@@ -11960,7 +12071,7 @@ function CliApp() {
|
|
|
11960
12071
|
const [isInitialized, setIsInitialized] = useState8(false);
|
|
11961
12072
|
const [initError, setInitError] = useState8(null);
|
|
11962
12073
|
const [commandHistory, setCommandHistory] = useState8([]);
|
|
11963
|
-
const imageStoreInitPromise =
|
|
12074
|
+
const imageStoreInitPromise = useRef3(null);
|
|
11964
12075
|
const setStoreSession = useCliStore((state2) => state2.setSession);
|
|
11965
12076
|
const setPermissionPrompt = useCliStore((state2) => state2.setPermissionPrompt);
|
|
11966
12077
|
const setShowConfigEditor = useCliStore((state2) => state2.setShowConfigEditor);
|
|
@@ -12309,7 +12420,7 @@ ${contextResult.mergedContent}` : "";
|
|
|
12309
12420
|
setStoreSession,
|
|
12310
12421
|
setState
|
|
12311
12422
|
]);
|
|
12312
|
-
|
|
12423
|
+
useEffect4(() => {
|
|
12313
12424
|
init();
|
|
12314
12425
|
}, [init]);
|
|
12315
12426
|
const handleCustomCommandMessage = async (fullTemplate, displayMessage) => {
|
|
@@ -13398,12 +13509,12 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
13398
13509
|
}
|
|
13399
13510
|
};
|
|
13400
13511
|
if (initError) {
|
|
13401
|
-
return /* @__PURE__ */
|
|
13512
|
+
return /* @__PURE__ */ React19.createElement(Box18, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React19.createElement(Text18, { color: "red", bold: true }, "\u274C Initialization Error"), /* @__PURE__ */ React19.createElement(Text18, null, initError), /* @__PURE__ */ React19.createElement(Text18, { dimColor: true }, "\n", "Tip: Run /config to set up your API keys"));
|
|
13402
13513
|
}
|
|
13403
13514
|
if (state.trustLocationSelector) {
|
|
13404
13515
|
const projectDir = state.configStore.getProjectConfigDir();
|
|
13405
13516
|
const inProject = projectDir !== null;
|
|
13406
|
-
return /* @__PURE__ */
|
|
13517
|
+
return /* @__PURE__ */ React19.createElement(
|
|
13407
13518
|
TrustLocationSelector,
|
|
13408
13519
|
{
|
|
13409
13520
|
inProject,
|
|
@@ -13421,7 +13532,7 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
13421
13532
|
);
|
|
13422
13533
|
}
|
|
13423
13534
|
if (state.rewindSelector && state.session) {
|
|
13424
|
-
return /* @__PURE__ */
|
|
13535
|
+
return /* @__PURE__ */ React19.createElement(
|
|
13425
13536
|
RewindSelector,
|
|
13426
13537
|
{
|
|
13427
13538
|
messages: state.session.messages,
|
|
@@ -13439,7 +13550,7 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
13439
13550
|
);
|
|
13440
13551
|
}
|
|
13441
13552
|
if (state.sessionSelector) {
|
|
13442
|
-
return /* @__PURE__ */
|
|
13553
|
+
return /* @__PURE__ */ React19.createElement(
|
|
13443
13554
|
SessionSelector,
|
|
13444
13555
|
{
|
|
13445
13556
|
sessions: state.sessionSelector.sessions,
|
|
@@ -13459,7 +13570,7 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
13459
13570
|
}
|
|
13460
13571
|
if (state.showLoginFlow) {
|
|
13461
13572
|
const loginApiUrl = getApiUrl(state.config?.apiConfig);
|
|
13462
|
-
return /* @__PURE__ */
|
|
13573
|
+
return /* @__PURE__ */ React19.createElement(
|
|
13463
13574
|
LoginFlow,
|
|
13464
13575
|
{
|
|
13465
13576
|
apiUrl: loginApiUrl,
|
|
@@ -13482,10 +13593,10 @@ No usage data available for the last ${USAGE_DAYS} days.`);
|
|
|
13482
13593
|
);
|
|
13483
13594
|
}
|
|
13484
13595
|
if (!isInitialized) {
|
|
13485
|
-
return /* @__PURE__ */
|
|
13596
|
+
return /* @__PURE__ */ React19.createElement(Box18, { flexDirection: "column", padding: 1 }, /* @__PURE__ */ React19.createElement(Text18, null, "\u{1F680} Initializing..."));
|
|
13486
13597
|
}
|
|
13487
13598
|
const allCommands = mergeCommands(state.customCommandStore.getAllCommands());
|
|
13488
|
-
return /* @__PURE__ */
|
|
13599
|
+
return /* @__PURE__ */ React19.createElement(
|
|
13489
13600
|
App,
|
|
13490
13601
|
{
|
|
13491
13602
|
onMessage: handleMessage,
|
|
@@ -13527,6 +13638,6 @@ var isDevMode = import.meta.url.includes("/src/") || process.env.NODE_ENV === "d
|
|
|
13527
13638
|
if (isDevMode) {
|
|
13528
13639
|
logger.debug("\u{1F527} Running in development mode (using TypeScript source)\n");
|
|
13529
13640
|
}
|
|
13530
|
-
render(/* @__PURE__ */
|
|
13641
|
+
render(/* @__PURE__ */ React19.createElement(CliApp, null), {
|
|
13531
13642
|
exitOnCtrlC: false
|
|
13532
13643
|
});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-ECSELHYP.js";
|
|
6
|
+
import "./chunk-M2CSCYOY.js";
|
|
7
|
+
import "./chunk-LL5J3SVB.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
File without changes
|
|
@@ -220,6 +220,7 @@ import {
|
|
|
220
220
|
WEBSITE_URL,
|
|
221
221
|
WHATS_NEW_VALIDATION_LIMITS,
|
|
222
222
|
WhatsNewConfigSchema,
|
|
223
|
+
WhatsNewSyncConfigSchema,
|
|
223
224
|
XAI_IMAGE_MODELS,
|
|
224
225
|
b4mLLMTools,
|
|
225
226
|
buildSSEEvent,
|
|
@@ -296,7 +297,7 @@ import {
|
|
|
296
297
|
validateReactArtifactV2,
|
|
297
298
|
validateSvgArtifactV2,
|
|
298
299
|
wikiMarkupToAdf
|
|
299
|
-
} from "./chunk-
|
|
300
|
+
} from "./chunk-LL5J3SVB.js";
|
|
300
301
|
export {
|
|
301
302
|
ALL_IMAGE_MODELS,
|
|
302
303
|
ALL_IMAGE_SIZES,
|
|
@@ -518,6 +519,7 @@ export {
|
|
|
518
519
|
WEBSITE_URL,
|
|
519
520
|
WHATS_NEW_VALIDATION_LIMITS,
|
|
520
521
|
WhatsNewConfigSchema,
|
|
522
|
+
WhatsNewSyncConfigSchema,
|
|
521
523
|
XAI_IMAGE_MODELS,
|
|
522
524
|
b4mLLMTools,
|
|
523
525
|
buildSSEEvent,
|
|
@@ -127,8 +127,8 @@ import {
|
|
|
127
127
|
validateMermaidSyntax,
|
|
128
128
|
warmUpSettingsCache,
|
|
129
129
|
withRetry
|
|
130
|
-
} from "./chunk-
|
|
131
|
-
import "./chunk-
|
|
130
|
+
} from "./chunk-M2CSCYOY.js";
|
|
131
|
+
import "./chunk-LL5J3SVB.js";
|
|
132
132
|
import {
|
|
133
133
|
Logger,
|
|
134
134
|
NotificationDeduplicator,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-I3CPL4SJ.js";
|
|
6
|
+
import "./chunk-M2CSCYOY.js";
|
|
7
|
+
import "./chunk-LL5J3SVB.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
SubtractCreditsSchema,
|
package/dist/utils-JCHWDM4Z.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -30,16 +30,6 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"bin"
|
|
32
32
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"dev": "tsx src/index.tsx",
|
|
35
|
-
"build": "tsup",
|
|
36
|
-
"typecheck": "tsc --noEmit",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
-
"test:watch": "vitest",
|
|
39
|
-
"start": "node dist/index.js",
|
|
40
|
-
"prepublishOnly": "pnpm build",
|
|
41
|
-
"postinstall": "node -e \"try { require('better-sqlite3') } catch(e) { if(e.message.includes('bindings')) { console.log('\\n⚠️ Rebuilding better-sqlite3 native bindings...'); require('child_process').execSync('pnpm rebuild better-sqlite3', {stdio:'inherit'}) } }\""
|
|
42
|
-
},
|
|
43
33
|
"dependencies": {
|
|
44
34
|
"@anthropic-ai/sdk": "^0.22.0",
|
|
45
35
|
"@aws-sdk/client-apigatewaymanagementapi": "3.654.0",
|
|
@@ -64,6 +54,7 @@
|
|
|
64
54
|
"bcryptjs": "^2.4.3",
|
|
65
55
|
"better-sqlite3": "^12.5.0",
|
|
66
56
|
"cheerio": "1.0.0-rc.12",
|
|
57
|
+
"cli-highlight": "^2.1.11",
|
|
67
58
|
"csv-parse": "^5.5.6",
|
|
68
59
|
"dayjs": "^1.11.13",
|
|
69
60
|
"diff": "^8.0.2",
|
|
@@ -105,11 +96,6 @@
|
|
|
105
96
|
"zustand": "^4.5.4"
|
|
106
97
|
},
|
|
107
98
|
"devDependencies": {
|
|
108
|
-
"@bike4mind/agents": "0.1.0",
|
|
109
|
-
"@bike4mind/common": "2.42.1-fix-openai-embedding-300k-token-limit.17484+80b2b6cb3",
|
|
110
|
-
"@bike4mind/mcp": "1.21.3-fix-openai-embedding-300k-token-limit.17484+80b2b6cb3",
|
|
111
|
-
"@bike4mind/services": "2.37.1-fix-openai-embedding-300k-token-limit.17484+80b2b6cb3",
|
|
112
|
-
"@bike4mind/utils": "2.1.8-fix-openai-embedding-300k-token-limit.17484+80b2b6cb3",
|
|
113
99
|
"@types/better-sqlite3": "^7.6.13",
|
|
114
100
|
"@types/diff": "^5.0.9",
|
|
115
101
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -121,7 +107,20 @@
|
|
|
121
107
|
"tsup": "^8.5.1",
|
|
122
108
|
"tsx": "^4.21.0",
|
|
123
109
|
"typescript": "^5.9.3",
|
|
124
|
-
"vitest": "^3.2.4"
|
|
110
|
+
"vitest": "^3.2.4",
|
|
111
|
+
"@bike4mind/agents": "0.1.0",
|
|
112
|
+
"@bike4mind/common": "2.42.1",
|
|
113
|
+
"@bike4mind/mcp": "1.22.1",
|
|
114
|
+
"@bike4mind/services": "2.39.0",
|
|
115
|
+
"@bike4mind/utils": "2.1.9"
|
|
125
116
|
},
|
|
126
|
-
"
|
|
127
|
-
|
|
117
|
+
"scripts": {
|
|
118
|
+
"dev": "tsx src/index.tsx",
|
|
119
|
+
"build": "tsup",
|
|
120
|
+
"typecheck": "tsc --noEmit",
|
|
121
|
+
"test": "vitest run",
|
|
122
|
+
"test:watch": "vitest",
|
|
123
|
+
"start": "node dist/index.js",
|
|
124
|
+
"postinstall": "node -e \"try { require('better-sqlite3') } catch(e) { if(e.message.includes('bindings')) { console.log('\\n⚠️ Rebuilding better-sqlite3 native bindings...'); require('child_process').execSync('pnpm rebuild better-sqlite3', {stdio:'inherit'}) } }\""
|
|
125
|
+
}
|
|
126
|
+
}
|