@bike4mind/cli 0.2.12-ctrl-c-clear-input.17412 → 0.2.12-feat-new-architecture.17438
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/{artifactExtractor-URGQJDMT.js → artifactExtractor-32VRZFES.js} +1 -1
- package/dist/{chunk-INYINU6X.js → chunk-KG3EYFQJ.js} +1 -1
- package/dist/{chunk-7N7AZPLK.js → chunk-NYV5QDO4.js} +2 -2
- package/dist/{chunk-OHR7UCTC.js → chunk-O3O6NO7R.js} +15 -3
- package/dist/{chunk-JXROCVSM.js → chunk-QA2RCPTF.js} +2 -2
- package/dist/{chunk-XM52K32A.js → chunk-XPNXIFHW.js} +2 -2
- package/dist/{create-IGUAAYLC.js → create-2LELHKRM.js} +3 -3
- package/dist/index.js +87 -160
- package/dist/{llmMarkdownGenerator-QLIULZ4H.js → llmMarkdownGenerator-UQPSJDFD.js} +1 -1
- package/dist/{markdownGenerator-WE5PLZRI.js → markdownGenerator-6ZXAXYAU.js} +1 -1
- package/dist/{mementoService-OGW5IEJX.js → mementoService-6G3ANT7X.js} +3 -3
- package/dist/{src-7JPWO5SS.js → src-IR57MKLV.js} +1 -1
- package/dist/{src-557ODV2Y.js → src-M3Q6EOMO.js} +2 -2
- package/dist/{subtractCredits-QSGEUH6U.js → subtractCredits-C3KPVE7W.js} +3 -3
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-O3O6NO7R.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;
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
dayjsConfig_default,
|
|
17
17
|
extractSnippetMeta,
|
|
18
18
|
settingsMap
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-O3O6NO7R.js";
|
|
20
20
|
|
|
21
21
|
// ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
|
|
22
22
|
import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KG3EYFQJ.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O3O6NO7R.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2104,7 +2104,9 @@ var SettingKeySchema = z19.enum([
|
|
|
2104
2104
|
// TIME MACHINE & NIGHT SKY SETTINGS
|
|
2105
2105
|
"EnableEnhancedDateTime",
|
|
2106
2106
|
"EnableHistoricalFeatures",
|
|
2107
|
-
"EnableAstronomyFeatures"
|
|
2107
|
+
"EnableAstronomyFeatures",
|
|
2108
|
+
// ARCHITECTURE TRANSITION
|
|
2109
|
+
"EnableArchitectureTransition"
|
|
2108
2110
|
]);
|
|
2109
2111
|
var CategoryOrder = [
|
|
2110
2112
|
"AI",
|
|
@@ -2463,7 +2465,8 @@ var API_SERVICE_GROUPS = {
|
|
|
2463
2465
|
{ key: "EnableRapidReply", order: 7 },
|
|
2464
2466
|
{ key: "EnableResearchEngine", order: 8 },
|
|
2465
2467
|
{ key: "EnableReactViewer", order: 9 },
|
|
2466
|
-
{ key: "EnableDeepResearch", order: 10 }
|
|
2468
|
+
{ key: "EnableDeepResearch", order: 10 },
|
|
2469
|
+
{ key: "EnableArchitectureTransition", order: 11 }
|
|
2467
2470
|
]
|
|
2468
2471
|
},
|
|
2469
2472
|
NOTEBOOK: {
|
|
@@ -3546,8 +3549,17 @@ var settingsMap = {
|
|
|
3546
3549
|
category: "Tools",
|
|
3547
3550
|
group: API_SERVICE_GROUPS.DATETIME_ASTRONOMY.id,
|
|
3548
3551
|
order: 3
|
|
3552
|
+
}),
|
|
3553
|
+
// Architecture Transition
|
|
3554
|
+
EnableArchitectureTransition: makeBooleanSetting({
|
|
3555
|
+
key: "EnableArchitectureTransition",
|
|
3556
|
+
name: "Enable Architecture Transition",
|
|
3557
|
+
defaultValue: false,
|
|
3558
|
+
description: "Enable the transition to the new Simplified Hexagonal Architecture pattern. When enabled, new features will use the core/infra separation pattern.",
|
|
3559
|
+
category: "Experimental",
|
|
3560
|
+
group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
|
|
3561
|
+
order: 11
|
|
3549
3562
|
})
|
|
3550
|
-
// Add more settings as needed
|
|
3551
3563
|
};
|
|
3552
3564
|
|
|
3553
3565
|
// ../../b4m-core/packages/common/dist/src/schemas/zod.js
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KG3EYFQJ.js";
|
|
6
6
|
import {
|
|
7
7
|
GenericCreditDeductTransaction,
|
|
8
8
|
ImageEditUsageTransaction,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
RealtimeVoiceUsageTransaction,
|
|
11
11
|
TextGenerationUsageTransaction,
|
|
12
12
|
TransferCreditTransaction
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-O3O6NO7R.js";
|
|
14
14
|
|
|
15
15
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
16
16
|
import { z } from "zod";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KG3EYFQJ.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O3O6NO7R.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createFabFile,
|
|
4
4
|
createFabFileSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-NYV5QDO4.js";
|
|
6
|
+
import "./chunk-KG3EYFQJ.js";
|
|
7
7
|
import "./chunk-OCYRD7D6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-O3O6NO7R.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|
|
11
11
|
createFabFileSchema
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getEffectiveApiKey,
|
|
5
5
|
getOpenWeatherKey,
|
|
6
6
|
getSerperKey
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XPNXIFHW.js";
|
|
8
|
+
import "./chunk-QA2RCPTF.js";
|
|
9
|
+
import "./chunk-NYV5QDO4.js";
|
|
10
10
|
import {
|
|
11
11
|
BFLImageService,
|
|
12
12
|
BaseStorage,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
OpenAIBackend,
|
|
16
16
|
OpenAIImageService,
|
|
17
17
|
XAIImageService
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KG3EYFQJ.js";
|
|
19
19
|
import {
|
|
20
20
|
Logger
|
|
21
21
|
} from "./chunk-OCYRD7D6.js";
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
XAI_IMAGE_MODELS,
|
|
74
74
|
b4mLLMTools,
|
|
75
75
|
getMcpProviderMetadata
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-O3O6NO7R.js";
|
|
77
77
|
|
|
78
78
|
// src/index.tsx
|
|
79
79
|
import React17, { useState as useState8, useEffect as useEffect3, useCallback, useRef as useRef2 } from "react";
|
|
@@ -773,63 +773,6 @@ var ImageInputDetector = class {
|
|
|
773
773
|
}
|
|
774
774
|
};
|
|
775
775
|
|
|
776
|
-
// src/store/index.ts
|
|
777
|
-
import { create } from "zustand";
|
|
778
|
-
var useCliStore = create((set) => ({
|
|
779
|
-
// Session state
|
|
780
|
-
session: null,
|
|
781
|
-
setSession: (session) => set({ session }),
|
|
782
|
-
addMessage: (message) => set((state) => {
|
|
783
|
-
if (!state.session) return state;
|
|
784
|
-
return {
|
|
785
|
-
session: {
|
|
786
|
-
...state.session,
|
|
787
|
-
messages: [...state.session.messages, message],
|
|
788
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
|
-
}),
|
|
792
|
-
// Pending messages
|
|
793
|
-
pendingMessages: [],
|
|
794
|
-
addPendingMessage: (message) => set((state) => ({ pendingMessages: [...state.pendingMessages, message] })),
|
|
795
|
-
updatePendingMessage: (index, message) => set((state) => {
|
|
796
|
-
const updated = [...state.pendingMessages];
|
|
797
|
-
updated[index] = message;
|
|
798
|
-
return { pendingMessages: updated };
|
|
799
|
-
}),
|
|
800
|
-
clearPendingMessages: () => set({ pendingMessages: [] }),
|
|
801
|
-
completePendingMessage: (index, finalMessage) => set((state) => {
|
|
802
|
-
const pending = [...state.pendingMessages];
|
|
803
|
-
pending.splice(index, 1);
|
|
804
|
-
const session = state.session;
|
|
805
|
-
if (!session) return { pendingMessages: pending };
|
|
806
|
-
return {
|
|
807
|
-
pendingMessages: pending,
|
|
808
|
-
session: {
|
|
809
|
-
...session,
|
|
810
|
-
messages: [...session.messages, finalMessage],
|
|
811
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
812
|
-
}
|
|
813
|
-
};
|
|
814
|
-
}),
|
|
815
|
-
// UI state
|
|
816
|
-
isThinking: false,
|
|
817
|
-
setIsThinking: (thinking) => set({ isThinking: thinking }),
|
|
818
|
-
// Input state (for Ctrl+C clearing)
|
|
819
|
-
inputValue: "",
|
|
820
|
-
setInputValue: (value) => set({ inputValue: value }),
|
|
821
|
-
clearInput: () => set({ inputValue: "" }),
|
|
822
|
-
// Permission prompt
|
|
823
|
-
permissionPrompt: null,
|
|
824
|
-
setPermissionPrompt: (prompt) => set({ permissionPrompt: prompt }),
|
|
825
|
-
// Config editor
|
|
826
|
-
showConfigEditor: false,
|
|
827
|
-
setShowConfigEditor: (show) => set({ showConfigEditor: show }),
|
|
828
|
-
// Exit handling
|
|
829
|
-
exitRequested: false,
|
|
830
|
-
setExitRequested: (requested) => set({ exitRequested: requested })
|
|
831
|
-
}));
|
|
832
|
-
|
|
833
776
|
// src/components/InputPrompt.tsx
|
|
834
777
|
function looksLikeFilePath(input) {
|
|
835
778
|
const trimmed = input.trim();
|
|
@@ -867,9 +810,7 @@ function InputPrompt({
|
|
|
867
810
|
onPrefillConsumed,
|
|
868
811
|
onBashModeChange
|
|
869
812
|
}) {
|
|
870
|
-
const value =
|
|
871
|
-
const setInputValue = useCliStore((state) => state.setInputValue);
|
|
872
|
-
const setValue = setInputValue;
|
|
813
|
+
const [value, setValue] = useState2("");
|
|
873
814
|
const [selectedIndex, setSelectedIndex] = useState2(0);
|
|
874
815
|
const [historyIndex, setHistoryIndex] = useState2(-1);
|
|
875
816
|
const [tempInput, setTempInput] = useState2("");
|
|
@@ -925,11 +866,10 @@ function InputPrompt({
|
|
|
925
866
|
if (shouldShowCommandAutocomplete && filteredCommands.length > 0) {
|
|
926
867
|
if (key.upArrow) {
|
|
927
868
|
setSelectedIndex((prev) => prev > 0 ? prev - 1 : filteredCommands.length - 1);
|
|
928
|
-
return;
|
|
929
869
|
} else if (key.downArrow) {
|
|
930
870
|
setSelectedIndex((prev) => prev < filteredCommands.length - 1 ? prev + 1 : 0);
|
|
931
|
-
return;
|
|
932
871
|
}
|
|
872
|
+
return;
|
|
933
873
|
}
|
|
934
874
|
if (!shouldShowCommandAutocomplete && !fileAutocomplete?.active && history.length > 0) {
|
|
935
875
|
if (key.upArrow) {
|
|
@@ -1067,6 +1007,59 @@ var ThoughtStream = React6.memo(function ThoughtStream2({ isThinking }) {
|
|
|
1067
1007
|
return /* @__PURE__ */ React6.createElement(Box5, { flexDirection: "column", gap: 1 }, isThinking && /* @__PURE__ */ React6.createElement(Box5, null, /* @__PURE__ */ React6.createElement(Text6, { color: "yellow" }, /* @__PURE__ */ React6.createElement(Spinner, { type: "dots" })), /* @__PURE__ */ React6.createElement(Text6, null, " Thinking...")));
|
|
1068
1008
|
});
|
|
1069
1009
|
|
|
1010
|
+
// src/store/index.ts
|
|
1011
|
+
import { create } from "zustand";
|
|
1012
|
+
var useCliStore = create((set) => ({
|
|
1013
|
+
// Session state
|
|
1014
|
+
session: null,
|
|
1015
|
+
setSession: (session) => set({ session }),
|
|
1016
|
+
addMessage: (message) => set((state) => {
|
|
1017
|
+
if (!state.session) return state;
|
|
1018
|
+
return {
|
|
1019
|
+
session: {
|
|
1020
|
+
...state.session,
|
|
1021
|
+
messages: [...state.session.messages, message],
|
|
1022
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
}),
|
|
1026
|
+
// Pending messages
|
|
1027
|
+
pendingMessages: [],
|
|
1028
|
+
addPendingMessage: (message) => set((state) => ({ pendingMessages: [...state.pendingMessages, message] })),
|
|
1029
|
+
updatePendingMessage: (index, message) => set((state) => {
|
|
1030
|
+
const updated = [...state.pendingMessages];
|
|
1031
|
+
updated[index] = message;
|
|
1032
|
+
return { pendingMessages: updated };
|
|
1033
|
+
}),
|
|
1034
|
+
clearPendingMessages: () => set({ pendingMessages: [] }),
|
|
1035
|
+
completePendingMessage: (index, finalMessage) => set((state) => {
|
|
1036
|
+
const pending = [...state.pendingMessages];
|
|
1037
|
+
pending.splice(index, 1);
|
|
1038
|
+
const session = state.session;
|
|
1039
|
+
if (!session) return { pendingMessages: pending };
|
|
1040
|
+
return {
|
|
1041
|
+
pendingMessages: pending,
|
|
1042
|
+
session: {
|
|
1043
|
+
...session,
|
|
1044
|
+
messages: [...session.messages, finalMessage],
|
|
1045
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
}),
|
|
1049
|
+
// UI state
|
|
1050
|
+
isThinking: false,
|
|
1051
|
+
setIsThinking: (thinking) => set({ isThinking: thinking }),
|
|
1052
|
+
// Permission prompt
|
|
1053
|
+
permissionPrompt: null,
|
|
1054
|
+
setPermissionPrompt: (prompt) => set({ permissionPrompt: prompt }),
|
|
1055
|
+
// Config editor
|
|
1056
|
+
showConfigEditor: false,
|
|
1057
|
+
setShowConfigEditor: (show) => set({ showConfigEditor: show }),
|
|
1058
|
+
// Exit handling
|
|
1059
|
+
exitRequested: false,
|
|
1060
|
+
setExitRequested: (requested) => set({ exitRequested: requested })
|
|
1061
|
+
}));
|
|
1062
|
+
|
|
1070
1063
|
// src/components/AgentThinking.tsx
|
|
1071
1064
|
var AgentThinking = React7.memo(function AgentThinking2() {
|
|
1072
1065
|
const isThinking = useCliStore((state) => state.isThinking);
|
|
@@ -1355,7 +1348,7 @@ function MessageItem({ message }) {
|
|
|
1355
1348
|
const isUser = message.role === "user";
|
|
1356
1349
|
return /* @__PURE__ */ React10.createElement(Box9, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Box9, null, /* @__PURE__ */ React10.createElement(Text9, { bold: true, color: isUser ? "cyan" : "green" }, isUser ? "\u{1F464} You" : "\u{1F916} Assistant"), isUser && /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, " \u2022 ", new Date(message.timestamp).toLocaleTimeString())), isUser && message.content && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2 }, /* @__PURE__ */ React10.createElement(Text9, { backgroundColor: "whiteBright", color: "black" }, " ", message.content, " ")), !isUser && message.metadata?.steps && message.metadata.steps.length > 0 && /* @__PURE__ */ React10.createElement(Box9, { paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { 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__ */ React10.createElement(Text9, { dimColor: true }, "Step types: ", message.metadata.steps.map((s) => s.type).join(", ")), message.metadata.steps.map((step, idx) => {
|
|
1357
1350
|
if (step.type === "thought") {
|
|
1358
|
-
return /* @__PURE__ */ React10.createElement(Box9, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { color: "blue" }, "\u{1F4AD} Thought:"), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, ` ${step.content}`));
|
|
1351
|
+
return /* @__PURE__ */ React10.createElement(Box9, { key: idx, paddingLeft: 2, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text9, { color: "blue" }, "\u{1F4AD} Thought:"), /* @__PURE__ */ React10.createElement(Text9, { dimColor: true }, ` ${step.content.slice(0, 200)}${step.content.length > 200 ? "..." : ""}`));
|
|
1359
1352
|
}
|
|
1360
1353
|
if (step.type === "action") {
|
|
1361
1354
|
const toolName = step.metadata?.toolName || "unknown";
|
|
@@ -10842,82 +10835,6 @@ async function loadContextFiles(projectDir) {
|
|
|
10842
10835
|
};
|
|
10843
10836
|
}
|
|
10844
10837
|
|
|
10845
|
-
// src/utils/formatStep.ts
|
|
10846
|
-
var MAX_INPUT_LENGTH = 500;
|
|
10847
|
-
var formatStep = (step) => {
|
|
10848
|
-
if (step.type === "action" && step.metadata?.toolInput) {
|
|
10849
|
-
let parsedInput = step.metadata.toolInput;
|
|
10850
|
-
if (typeof parsedInput === "string") {
|
|
10851
|
-
try {
|
|
10852
|
-
parsedInput = JSON.parse(parsedInput);
|
|
10853
|
-
} catch {
|
|
10854
|
-
}
|
|
10855
|
-
}
|
|
10856
|
-
if (step.metadata.toolName === "edit_local_file") {
|
|
10857
|
-
const pathOnly = typeof parsedInput === "object" && parsedInput !== null && "path" in parsedInput ? { path: parsedInput.path } : parsedInput;
|
|
10858
|
-
return {
|
|
10859
|
-
...step,
|
|
10860
|
-
metadata: {
|
|
10861
|
-
...step.metadata,
|
|
10862
|
-
toolInput: pathOnly
|
|
10863
|
-
}
|
|
10864
|
-
};
|
|
10865
|
-
}
|
|
10866
|
-
if (step.metadata.toolName === "write_todos") {
|
|
10867
|
-
const todos = typeof parsedInput === "object" && parsedInput !== null && "todos" in parsedInput ? parsedInput.todos : null;
|
|
10868
|
-
const count = Array.isArray(todos) ? todos.length : 0;
|
|
10869
|
-
return {
|
|
10870
|
-
...step,
|
|
10871
|
-
metadata: {
|
|
10872
|
-
...step.metadata,
|
|
10873
|
-
toolInput: `${count} todo${count !== 1 ? "s" : ""}`
|
|
10874
|
-
}
|
|
10875
|
-
};
|
|
10876
|
-
}
|
|
10877
|
-
const inputStr = typeof parsedInput === "string" ? parsedInput : JSON.stringify(parsedInput);
|
|
10878
|
-
if (inputStr.length > MAX_INPUT_LENGTH) {
|
|
10879
|
-
const truncatedInput = inputStr.slice(0, MAX_INPUT_LENGTH) + `... (${inputStr.length - MAX_INPUT_LENGTH} more chars)`;
|
|
10880
|
-
return {
|
|
10881
|
-
...step,
|
|
10882
|
-
metadata: {
|
|
10883
|
-
...step.metadata,
|
|
10884
|
-
toolInput: truncatedInput
|
|
10885
|
-
}
|
|
10886
|
-
};
|
|
10887
|
-
}
|
|
10888
|
-
}
|
|
10889
|
-
if (step.type === "observation" && step.content) {
|
|
10890
|
-
if (step.metadata?.toolName === "file_read") {
|
|
10891
|
-
const lineCount = step.content.split("\n").length;
|
|
10892
|
-
return {
|
|
10893
|
-
...step,
|
|
10894
|
-
content: `Read ${lineCount} line${lineCount !== 1 ? "s" : ""}`
|
|
10895
|
-
};
|
|
10896
|
-
}
|
|
10897
|
-
if (step.metadata?.toolName === "grep_search") {
|
|
10898
|
-
const match = step.content.match(/^Found (\d+) file\(s\)/);
|
|
10899
|
-
if (match) {
|
|
10900
|
-
const count = parseInt(match[1], 10);
|
|
10901
|
-
return {
|
|
10902
|
-
...step,
|
|
10903
|
-
content: `Found ${count} file${count !== 1 ? "s" : ""}`
|
|
10904
|
-
};
|
|
10905
|
-
}
|
|
10906
|
-
}
|
|
10907
|
-
if (step.metadata?.toolName === "glob_files") {
|
|
10908
|
-
const match = step.content.match(/^Found (\d+) file\(s\)/);
|
|
10909
|
-
if (match) {
|
|
10910
|
-
const count = parseInt(match[1], 10);
|
|
10911
|
-
return {
|
|
10912
|
-
...step,
|
|
10913
|
-
content: `Found ${count} file${count !== 1 ? "s" : ""}`
|
|
10914
|
-
};
|
|
10915
|
-
}
|
|
10916
|
-
}
|
|
10917
|
-
}
|
|
10918
|
-
return step;
|
|
10919
|
-
};
|
|
10920
|
-
|
|
10921
10838
|
// src/utils/argumentSubstitution.ts
|
|
10922
10839
|
function substituteArguments(template, args) {
|
|
10923
10840
|
let result = template;
|
|
@@ -11833,7 +11750,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
11833
11750
|
// package.json
|
|
11834
11751
|
var package_default = {
|
|
11835
11752
|
name: "@bike4mind/cli",
|
|
11836
|
-
version: "0.2.12-
|
|
11753
|
+
version: "0.2.12-feat-new-architecture.17438+2d0558ef2",
|
|
11837
11754
|
type: "module",
|
|
11838
11755
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
11839
11756
|
license: "UNLICENSED",
|
|
@@ -11939,10 +11856,10 @@ var package_default = {
|
|
|
11939
11856
|
},
|
|
11940
11857
|
devDependencies: {
|
|
11941
11858
|
"@bike4mind/agents": "0.1.0",
|
|
11942
|
-
"@bike4mind/common": "2.41.1-
|
|
11943
|
-
"@bike4mind/mcp": "1.21.1-
|
|
11944
|
-
"@bike4mind/services": "2.36.1-
|
|
11945
|
-
"@bike4mind/utils": "2.1.6-
|
|
11859
|
+
"@bike4mind/common": "2.41.1-feat-new-architecture.17438+2d0558ef2",
|
|
11860
|
+
"@bike4mind/mcp": "1.21.1-feat-new-architecture.17438+2d0558ef2",
|
|
11861
|
+
"@bike4mind/services": "2.36.1-feat-new-architecture.17438+2d0558ef2",
|
|
11862
|
+
"@bike4mind/utils": "2.1.6-feat-new-architecture.17438+2d0558ef2",
|
|
11946
11863
|
"@types/better-sqlite3": "^7.6.13",
|
|
11947
11864
|
"@types/diff": "^5.0.9",
|
|
11948
11865
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -11955,7 +11872,7 @@ var package_default = {
|
|
|
11955
11872
|
typescript: "^5.9.3",
|
|
11956
11873
|
vitest: "^3.2.4"
|
|
11957
11874
|
},
|
|
11958
|
-
gitHead: "
|
|
11875
|
+
gitHead: "2d0558ef2faf6af380292a8b968633c73cd4fca5"
|
|
11959
11876
|
};
|
|
11960
11877
|
|
|
11961
11878
|
// src/config/constants.ts
|
|
@@ -12526,16 +12443,12 @@ function CliApp() {
|
|
|
12526
12443
|
if (key.ctrl && input === "c") {
|
|
12527
12444
|
const now = Date.now();
|
|
12528
12445
|
if (exitTimestamp && now - exitTimestamp < EXIT_TIMEOUT_MS) {
|
|
12529
|
-
logger.debug("[EXIT
|
|
12446
|
+
logger.debug("[EXIT Second Ctrl+C - cleaning up and exiting...");
|
|
12530
12447
|
performCleanup().then(() => {
|
|
12531
12448
|
exit();
|
|
12532
12449
|
});
|
|
12533
12450
|
} else {
|
|
12534
|
-
logger.debug("[EXIT
|
|
12535
|
-
const currentInput = useCliStore.getState().inputValue;
|
|
12536
|
-
if (currentInput.length > 0) {
|
|
12537
|
-
useCliStore.getState().clearInput();
|
|
12538
|
-
}
|
|
12451
|
+
logger.debug("[EXIT First Ctrl+C - press again to exit");
|
|
12539
12452
|
exitTimestamp = now;
|
|
12540
12453
|
setExitRequested(true);
|
|
12541
12454
|
setTimeout(() => {
|
|
@@ -12766,12 +12679,26 @@ ${contextResult.mergedContent}` : "";
|
|
|
12766
12679
|
const lastIdx = pendingMessages.length - 1;
|
|
12767
12680
|
if (lastIdx >= 0 && pendingMessages[lastIdx].role === "assistant") {
|
|
12768
12681
|
const existingSteps = pendingMessages[lastIdx].metadata?.steps || [];
|
|
12769
|
-
const
|
|
12682
|
+
const MAX_INPUT_LENGTH = 500;
|
|
12683
|
+
let truncatedStep = step;
|
|
12684
|
+
if (step.type === "action" && step.metadata?.toolInput) {
|
|
12685
|
+
const inputStr = typeof step.metadata.toolInput === "string" ? step.metadata.toolInput : JSON.stringify(step.metadata.toolInput);
|
|
12686
|
+
if (inputStr.length > MAX_INPUT_LENGTH) {
|
|
12687
|
+
const truncatedInput = inputStr.slice(0, MAX_INPUT_LENGTH) + `... (${inputStr.length - MAX_INPUT_LENGTH} more chars)`;
|
|
12688
|
+
truncatedStep = {
|
|
12689
|
+
...step,
|
|
12690
|
+
metadata: {
|
|
12691
|
+
...step.metadata,
|
|
12692
|
+
toolInput: truncatedInput
|
|
12693
|
+
}
|
|
12694
|
+
};
|
|
12695
|
+
}
|
|
12696
|
+
}
|
|
12770
12697
|
updatePendingMessage(lastIdx, {
|
|
12771
12698
|
...pendingMessages[lastIdx],
|
|
12772
12699
|
metadata: {
|
|
12773
12700
|
...pendingMessages[lastIdx].metadata,
|
|
12774
|
-
steps: [...existingSteps,
|
|
12701
|
+
steps: [...existingSteps, truncatedStep]
|
|
12775
12702
|
}
|
|
12776
12703
|
});
|
|
12777
12704
|
}
|
|
@@ -12913,7 +12840,7 @@ ${contextResult.mergedContent}` : "";
|
|
|
12913
12840
|
content: result.finalAnswer,
|
|
12914
12841
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12915
12842
|
metadata: {
|
|
12916
|
-
steps: result.steps
|
|
12843
|
+
steps: result.steps,
|
|
12917
12844
|
tokenUsage: {
|
|
12918
12845
|
prompt: 0,
|
|
12919
12846
|
completion: 0,
|
|
@@ -13086,7 +13013,7 @@ ${contextResult.mergedContent}` : "";
|
|
|
13086
13013
|
completion: 0,
|
|
13087
13014
|
total: result.completionInfo.totalTokens
|
|
13088
13015
|
},
|
|
13089
|
-
steps: result.steps
|
|
13016
|
+
steps: result.steps,
|
|
13090
13017
|
// Complete history: thoughts, actions, observations
|
|
13091
13018
|
permissionDenied
|
|
13092
13019
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-XPNXIFHW.js";
|
|
6
|
+
import "./chunk-KG3EYFQJ.js";
|
|
7
7
|
import "./chunk-OCYRD7D6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-O3O6NO7R.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
11
11
|
getRelevantMementos
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
validateMermaidSyntax,
|
|
121
121
|
warmUpSettingsCache,
|
|
122
122
|
withRetry
|
|
123
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-KG3EYFQJ.js";
|
|
124
124
|
import {
|
|
125
125
|
Logger,
|
|
126
126
|
NotificationDeduplicator,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
postLowCreditsNotificationToSlack,
|
|
130
130
|
postMessageToSlack
|
|
131
131
|
} from "./chunk-OCYRD7D6.js";
|
|
132
|
-
import "./chunk-
|
|
132
|
+
import "./chunk-O3O6NO7R.js";
|
|
133
133
|
export {
|
|
134
134
|
AWSBackend,
|
|
135
135
|
AdminSettingsCache,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-QA2RCPTF.js";
|
|
6
|
+
import "./chunk-KG3EYFQJ.js";
|
|
7
7
|
import "./chunk-OCYRD7D6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-O3O6NO7R.js";
|
|
9
9
|
export {
|
|
10
10
|
SubtractCreditsSchema,
|
|
11
11
|
subtractCredits
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.12-
|
|
3
|
+
"version": "0.2.12-feat-new-architecture.17438+2d0558ef2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@bike4mind/agents": "0.1.0",
|
|
109
|
-
"@bike4mind/common": "2.41.1-
|
|
110
|
-
"@bike4mind/mcp": "1.21.1-
|
|
111
|
-
"@bike4mind/services": "2.36.1-
|
|
112
|
-
"@bike4mind/utils": "2.1.6-
|
|
109
|
+
"@bike4mind/common": "2.41.1-feat-new-architecture.17438+2d0558ef2",
|
|
110
|
+
"@bike4mind/mcp": "1.21.1-feat-new-architecture.17438+2d0558ef2",
|
|
111
|
+
"@bike4mind/services": "2.36.1-feat-new-architecture.17438+2d0558ef2",
|
|
112
|
+
"@bike4mind/utils": "2.1.6-feat-new-architecture.17438+2d0558ef2",
|
|
113
113
|
"@types/better-sqlite3": "^7.6.13",
|
|
114
114
|
"@types/diff": "^5.0.9",
|
|
115
115
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -122,5 +122,5 @@
|
|
|
122
122
|
"typescript": "^5.9.3",
|
|
123
123
|
"vitest": "^3.2.4"
|
|
124
124
|
},
|
|
125
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "2d0558ef2faf6af380292a8b968633c73cd4fca5"
|
|
126
126
|
}
|