@bike4mind/cli 0.2.49-fix-telemetry-alert-debug.21031 → 0.2.49
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-SIFIV3ZN.js → artifactExtractor-VRHQFYPK.js} +1 -1
- package/dist/{chunk-F6IY547T.js → chunk-2K6DFEPJ.js} +2 -2
- package/dist/{chunk-WKPO5JDF.js → chunk-EOOKQOLY.js} +2 -2
- package/dist/{chunk-W5MJV36K.js → chunk-LZBANFHR.js} +1 -1
- package/dist/{chunk-M7QGYBN7.js → chunk-QU3ADG2K.js} +1 -1
- package/dist/{chunk-4ZO5RNWO.js → chunk-ST2Y3ZP7.js} +147 -125
- package/dist/{chunk-OFKZXY6L.js → chunk-UVP4KCPD.js} +2 -2
- package/dist/{chunk-QLY3LGPA.js → chunk-YRYNVLXM.js} +4 -2
- package/dist/{chunk-5SZI2XFM.js → chunk-ZGHPHONE.js} +7 -7
- package/dist/commands/doctorCommand.js +1 -1
- package/dist/commands/headlessCommand.js +7 -7
- package/dist/commands/mcpCommand.js +2 -2
- package/dist/commands/updateCommand.js +1 -1
- package/dist/{create-6Z46TX3C.js → create-GZMDYERE.js} +3 -3
- package/dist/index.js +38 -10
- package/dist/{llmMarkdownGenerator-WOAXMXDB.js → llmMarkdownGenerator-GUV467LM.js} +1 -1
- package/dist/{markdownGenerator-HZIPL4XS.js → markdownGenerator-MSDIQLK2.js} +1 -1
- package/dist/{mementoService-XAAA3Q54.js → mementoService-K2MKVU4Z.js} +3 -3
- package/dist/{src-FDPAPWTO.js → src-4HG4RMU4.js} +2 -2
- package/dist/{src-ODP5CCCC.js → src-GYWZKBK7.js} +1 -1
- package/dist/{subtractCredits-7SHS6DXL.js → subtractCredits-FBO5JUX3.js} +3 -3
- package/dist/terminalSetup-C5FHMLC3.js +214 -0
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YRYNVLXM.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;
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QU3ADG2K.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YRYNVLXM.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QU3ADG2K.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YRYNVLXM.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
extractSnippetMeta,
|
|
21
21
|
isGPTImageModel,
|
|
22
22
|
settingsMap
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-YRYNVLXM.js";
|
|
24
24
|
|
|
25
25
|
// ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
|
|
26
26
|
import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getOpenWeatherKey,
|
|
5
5
|
getSerperKey,
|
|
6
6
|
getWolframAlphaKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2K6DFEPJ.js";
|
|
8
8
|
import {
|
|
9
9
|
BFLImageService,
|
|
10
10
|
BaseStorage,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
OpenAIBackend,
|
|
17
17
|
OpenAIImageService,
|
|
18
18
|
XAIImageService
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QU3ADG2K.js";
|
|
20
20
|
import {
|
|
21
21
|
Logger
|
|
22
22
|
} from "./chunk-PFBYGCOW.js";
|
|
23
23
|
import {
|
|
24
24
|
ConfigStore,
|
|
25
25
|
logger
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LZBANFHR.js";
|
|
27
27
|
import {
|
|
28
28
|
ALERT_THRESHOLDS,
|
|
29
29
|
AiEvents,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
getViewById,
|
|
85
85
|
resolveNavigationIntents,
|
|
86
86
|
sanitizeTelemetryError
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-YRYNVLXM.js";
|
|
88
88
|
|
|
89
89
|
// src/utils/fileSearch.ts
|
|
90
90
|
import * as fs from "fs";
|
|
@@ -503,6 +503,10 @@ var COMMANDS = [
|
|
|
503
503
|
name: "sandbox:violations:clear",
|
|
504
504
|
description: "Clear all recorded sandbox violations"
|
|
505
505
|
},
|
|
506
|
+
{
|
|
507
|
+
name: "terminal-setup",
|
|
508
|
+
description: "Configure Shift+Enter for multi-line input"
|
|
509
|
+
},
|
|
506
510
|
{
|
|
507
511
|
name: "add-dir",
|
|
508
512
|
description: "Add a directory for file access",
|
|
@@ -1634,10 +1638,10 @@ You can use:
|
|
|
1634
1638
|
}
|
|
1635
1639
|
};
|
|
1636
1640
|
|
|
1637
|
-
// ../../b4m-core/packages/agents/src/ReActAgent.
|
|
1641
|
+
// ../../b4m-core/packages/agents/dist/src/ReActAgent.js
|
|
1638
1642
|
import { EventEmitter } from "events";
|
|
1639
1643
|
|
|
1640
|
-
// ../../b4m-core/packages/agents/src/toolParallelizer.
|
|
1644
|
+
// ../../b4m-core/packages/agents/dist/src/toolParallelizer.js
|
|
1641
1645
|
var DEFAULT_WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
1642
1646
|
"edit_file",
|
|
1643
1647
|
"edit_local_file",
|
|
@@ -1756,17 +1760,18 @@ function shouldUseParallelExecution(toolsUsed, isReadOnly = defaultIsReadOnlyToo
|
|
|
1756
1760
|
return readOnlyCount >= 2;
|
|
1757
1761
|
}
|
|
1758
1762
|
|
|
1759
|
-
// ../../b4m-core/packages/agents/src/ReActAgent.
|
|
1763
|
+
// ../../b4m-core/packages/agents/dist/src/ReActAgent.js
|
|
1760
1764
|
var ReActAgent = class extends EventEmitter {
|
|
1765
|
+
context;
|
|
1766
|
+
steps = [];
|
|
1767
|
+
totalTokens = 0;
|
|
1768
|
+
totalInputTokens = 0;
|
|
1769
|
+
totalOutputTokens = 0;
|
|
1770
|
+
totalCredits = 0;
|
|
1771
|
+
toolCallCount = 0;
|
|
1772
|
+
observationQueue = [];
|
|
1761
1773
|
constructor(context) {
|
|
1762
1774
|
super();
|
|
1763
|
-
this.steps = [];
|
|
1764
|
-
this.totalTokens = 0;
|
|
1765
|
-
this.totalInputTokens = 0;
|
|
1766
|
-
this.totalOutputTokens = 0;
|
|
1767
|
-
this.totalCredits = 0;
|
|
1768
|
-
this.toolCallCount = 0;
|
|
1769
|
-
this.observationQueue = [];
|
|
1770
1775
|
this.context = {
|
|
1771
1776
|
...context,
|
|
1772
1777
|
maxIterations: context.maxIterations ?? 5,
|
|
@@ -1840,116 +1845,105 @@ ${options.context}` : this.getSystemPrompt()
|
|
|
1840
1845
|
let currentText = "";
|
|
1841
1846
|
const processedToolIds = /* @__PURE__ */ new Set();
|
|
1842
1847
|
let hadToolCalls = false;
|
|
1843
|
-
await this.context.llm.complete(
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
async (texts, completionInfo) => {
|
|
1857
|
-
for (const text of texts) {
|
|
1858
|
-
if (text) {
|
|
1859
|
-
currentText += text;
|
|
1860
|
-
}
|
|
1848
|
+
await this.context.llm.complete(this.context.model, messages, {
|
|
1849
|
+
stream: false,
|
|
1850
|
+
tools: this.context.tools,
|
|
1851
|
+
maxTokens,
|
|
1852
|
+
temperature,
|
|
1853
|
+
abortSignal: options.signal,
|
|
1854
|
+
tool_choice: this.context.toolChoice,
|
|
1855
|
+
executeTools: false,
|
|
1856
|
+
thinking: this.context.thinking
|
|
1857
|
+
}, async (texts, completionInfo) => {
|
|
1858
|
+
for (const text of texts) {
|
|
1859
|
+
if (text) {
|
|
1860
|
+
currentText += text;
|
|
1861
1861
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1862
|
+
}
|
|
1863
|
+
if (completionInfo) {
|
|
1864
|
+
const inputTokens = completionInfo.inputTokens || 0;
|
|
1865
|
+
const outputTokens = completionInfo.outputTokens || 0;
|
|
1866
|
+
this.totalTokens += inputTokens + outputTokens;
|
|
1867
|
+
this.totalInputTokens += inputTokens;
|
|
1868
|
+
this.totalOutputTokens += outputTokens;
|
|
1869
|
+
if (completionInfo.creditsUsed) {
|
|
1870
|
+
this.totalCredits += completionInfo.creditsUsed;
|
|
1871
|
+
}
|
|
1872
|
+
if (currentText.trim() && completionInfo.toolsUsed?.length) {
|
|
1873
|
+
const thoughtStep = {
|
|
1874
|
+
type: "thought",
|
|
1875
|
+
content: currentText.trim(),
|
|
1876
|
+
metadata: {
|
|
1877
|
+
timestamp: Date.now()
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
this.steps.push(thoughtStep);
|
|
1881
|
+
this.emit("thought", thoughtStep);
|
|
1882
|
+
}
|
|
1883
|
+
if (!completionInfo.toolsUsed?.length && currentText.trim()) {
|
|
1884
|
+
finalAnswer = currentText.trim();
|
|
1885
|
+
const finalStep = {
|
|
1886
|
+
type: "final_answer",
|
|
1887
|
+
content: finalAnswer,
|
|
1888
|
+
metadata: {
|
|
1889
|
+
timestamp: Date.now(),
|
|
1890
|
+
tokenUsage: {
|
|
1891
|
+
prompt: inputTokens,
|
|
1892
|
+
completion: outputTokens,
|
|
1893
|
+
total: inputTokens + outputTokens
|
|
1894
1894
|
}
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
this.steps.push(finalStep);
|
|
1898
|
+
this.emit("final_answer", finalStep);
|
|
1899
|
+
iterationComplete = true;
|
|
1900
|
+
}
|
|
1901
|
+
if (completionInfo.toolsUsed && completionInfo.toolsUsed.length > 0) {
|
|
1902
|
+
hadToolCalls = true;
|
|
1903
|
+
const thinkingBlocks = completionInfo.thinking || [];
|
|
1904
|
+
const unprocessedTools = [];
|
|
1905
|
+
for (const toolUse of completionInfo.toolsUsed) {
|
|
1906
|
+
const toolCallIdStr = getToolId(toolUse);
|
|
1907
|
+
if (!processedToolIds.has(toolCallIdStr)) {
|
|
1908
|
+
processedToolIds.add(toolCallIdStr);
|
|
1909
|
+
unprocessedTools.push(toolUse);
|
|
1910
|
+
}
|
|
1899
1911
|
}
|
|
1900
|
-
if (
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
const unprocessedTools
|
|
1904
|
-
|
|
1905
|
-
const toolCallIdStr = getToolId(toolUse);
|
|
1906
|
-
if (!processedToolIds.has(toolCallIdStr)) {
|
|
1907
|
-
processedToolIds.add(toolCallIdStr);
|
|
1908
|
-
unprocessedTools.push(toolUse);
|
|
1909
|
-
}
|
|
1912
|
+
if (unprocessedTools.length === 0) {
|
|
1913
|
+
} else if (options.parallelExecution && shouldUseParallelExecution(unprocessedTools, options.isReadOnlyTool ?? defaultIsReadOnlyTool)) {
|
|
1914
|
+
this.context.logger.debug(`[ReActAgent] Parallel execution enabled for ${unprocessedTools.length} tools`);
|
|
1915
|
+
for (const toolUse of unprocessedTools) {
|
|
1916
|
+
this.emitActionStep(toolUse);
|
|
1910
1917
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
);
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
const
|
|
1927
|
-
const
|
|
1928
|
-
|
|
1918
|
+
const plan = categorizeTools(unprocessedTools, options.isReadOnlyTool ?? defaultIsReadOnlyTool);
|
|
1919
|
+
const results = await executeToolsInParallel(plan, (toolUse) => this.executeToolWithQueueFallback(toolUse), options.signal);
|
|
1920
|
+
for (const toolUse of unprocessedTools) {
|
|
1921
|
+
const toolIdStr = getToolId(toolUse);
|
|
1922
|
+
const result2 = results.get(toolIdStr);
|
|
1923
|
+
const observation = result2?.status === "fulfilled" ? result2.result ?? "" : `Error: ${result2?.error?.message ?? "Unknown error"}`;
|
|
1924
|
+
this.appendToolMessages(messages, toolUse, observation, thinkingBlocks);
|
|
1925
|
+
this.emitObservationStep(toolUse.name, observation);
|
|
1926
|
+
}
|
|
1927
|
+
} else {
|
|
1928
|
+
for (const toolUse of unprocessedTools) {
|
|
1929
|
+
this.emitActionStep(toolUse);
|
|
1930
|
+
const queuedObs = this.observationQueue.find((obs) => obs.toolId === getToolId(toolUse));
|
|
1931
|
+
let observation;
|
|
1932
|
+
if (queuedObs) {
|
|
1933
|
+
const result2 = queuedObs.result;
|
|
1934
|
+
const index = this.observationQueue.indexOf(queuedObs);
|
|
1935
|
+
this.observationQueue.splice(index, 1);
|
|
1936
|
+
observation = typeof result2 === "string" ? result2 : JSON.stringify(result2);
|
|
1937
|
+
} else {
|
|
1938
|
+
observation = await this.executeToolWithQueueFallback(toolUse);
|
|
1929
1939
|
this.appendToolMessages(messages, toolUse, observation, thinkingBlocks);
|
|
1930
|
-
this.emitObservationStep(toolUse.name, observation);
|
|
1931
|
-
}
|
|
1932
|
-
} else {
|
|
1933
|
-
for (const toolUse of unprocessedTools) {
|
|
1934
|
-
this.emitActionStep(toolUse);
|
|
1935
|
-
const queuedObs = this.observationQueue.find((obs) => obs.toolId === getToolId(toolUse));
|
|
1936
|
-
let observation;
|
|
1937
|
-
if (queuedObs) {
|
|
1938
|
-
const result2 = queuedObs.result;
|
|
1939
|
-
const index = this.observationQueue.indexOf(queuedObs);
|
|
1940
|
-
this.observationQueue.splice(index, 1);
|
|
1941
|
-
observation = typeof result2 === "string" ? result2 : JSON.stringify(result2);
|
|
1942
|
-
} else {
|
|
1943
|
-
observation = await this.executeToolWithQueueFallback(toolUse);
|
|
1944
|
-
this.appendToolMessages(messages, toolUse, observation, thinkingBlocks);
|
|
1945
|
-
}
|
|
1946
|
-
this.emitObservationStep(toolUse.name, observation);
|
|
1947
1940
|
}
|
|
1941
|
+
this.emitObservationStep(toolUse.name, observation);
|
|
1948
1942
|
}
|
|
1949
1943
|
}
|
|
1950
1944
|
}
|
|
1951
1945
|
}
|
|
1952
|
-
);
|
|
1946
|
+
});
|
|
1953
1947
|
if (iterationComplete && finalAnswer) {
|
|
1954
1948
|
break;
|
|
1955
1949
|
}
|
|
@@ -1993,9 +1987,7 @@ ${options.context}` : this.getSystemPrompt()
|
|
|
1993
1987
|
return result;
|
|
1994
1988
|
} catch (error) {
|
|
1995
1989
|
if (error instanceof PermissionDeniedError) {
|
|
1996
|
-
this.context.logger.info(
|
|
1997
|
-
`[ReActAgent] Permission denied for tool '${error.toolName}' - ending session gracefully`
|
|
1998
|
-
);
|
|
1990
|
+
this.context.logger.info(`[ReActAgent] Permission denied for tool '${error.toolName}' - ending session gracefully`);
|
|
1999
1991
|
const result = {
|
|
2000
1992
|
finalAnswer: `Permission denied for tool '${error.toolName}'. You can use /trust ${error.toolName} to trust this tool permanently, or rephrase your request.`,
|
|
2001
1993
|
steps: this.steps,
|
|
@@ -2159,12 +2151,7 @@ Remember: You are an autonomous AGENT. Act independently and solve problems proa
|
|
|
2159
2151
|
const params = this.parseToolArguments(toolUse.arguments);
|
|
2160
2152
|
const toolId = toolUse.id || `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
2161
2153
|
const parameters = typeof toolUse.arguments === "string" ? toolUse.arguments : JSON.stringify(params);
|
|
2162
|
-
this.context.llm.pushToolMessages(
|
|
2163
|
-
messages,
|
|
2164
|
-
{ id: toolId, name: toolUse.name, parameters },
|
|
2165
|
-
observation,
|
|
2166
|
-
thinkingBlocks
|
|
2167
|
-
);
|
|
2154
|
+
this.context.llm.pushToolMessages(messages, { id: toolId, name: toolUse.name, parameters }, observation, thinkingBlocks);
|
|
2168
2155
|
}
|
|
2169
2156
|
};
|
|
2170
2157
|
|
|
@@ -16627,8 +16614,43 @@ var WebSocketLlmBackend = class {
|
|
|
16627
16614
|
});
|
|
16628
16615
|
});
|
|
16629
16616
|
}
|
|
16630
|
-
pushToolMessages(
|
|
16631
|
-
|
|
16617
|
+
pushToolMessages(messages, tool, result, thinkingBlocks) {
|
|
16618
|
+
if (thinkingBlocks && thinkingBlocks.length > 0) {
|
|
16619
|
+
messages.push({
|
|
16620
|
+
role: "assistant",
|
|
16621
|
+
content: [
|
|
16622
|
+
...thinkingBlocks,
|
|
16623
|
+
{
|
|
16624
|
+
type: "tool_use",
|
|
16625
|
+
id: tool.id,
|
|
16626
|
+
name: tool.name,
|
|
16627
|
+
input: JSON.parse(tool.parameters || "{}")
|
|
16628
|
+
}
|
|
16629
|
+
]
|
|
16630
|
+
});
|
|
16631
|
+
} else {
|
|
16632
|
+
messages.push({
|
|
16633
|
+
role: "assistant",
|
|
16634
|
+
content: [
|
|
16635
|
+
{
|
|
16636
|
+
type: "tool_use",
|
|
16637
|
+
id: tool.id,
|
|
16638
|
+
name: tool.name,
|
|
16639
|
+
input: JSON.parse(tool.parameters || "{}")
|
|
16640
|
+
}
|
|
16641
|
+
]
|
|
16642
|
+
});
|
|
16643
|
+
}
|
|
16644
|
+
messages.push({
|
|
16645
|
+
role: "user",
|
|
16646
|
+
content: [
|
|
16647
|
+
{
|
|
16648
|
+
type: "tool_result",
|
|
16649
|
+
tool_use_id: tool.id,
|
|
16650
|
+
content: result
|
|
16651
|
+
}
|
|
16652
|
+
]
|
|
16653
|
+
});
|
|
16632
16654
|
}
|
|
16633
16655
|
/**
|
|
16634
16656
|
* Get available models from server (REST call, not streaming).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QU3ADG2K.js";
|
|
6
6
|
import {
|
|
7
7
|
CompletionApiUsageTransaction,
|
|
8
8
|
GenericCreditDeductTransaction,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
ToolUsageTransaction,
|
|
14
14
|
TransferCreditTransaction,
|
|
15
15
|
VideoGenerationUsageTransaction
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YRYNVLXM.js";
|
|
17
17
|
|
|
18
18
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1284,8 +1284,10 @@ var SreAgentConfigSchema = z10.object({
|
|
|
1284
1284
|
/** Repository name (e.g. "lumina5") */
|
|
1285
1285
|
repo: z10.string().default(""),
|
|
1286
1286
|
/** Comma-separated GitHub usernames to request as PR reviewers */
|
|
1287
|
-
reviewers: z10.string().default("")
|
|
1288
|
-
|
|
1287
|
+
reviewers: z10.string().default(""),
|
|
1288
|
+
/** HMAC secret for the system-level SRE webhook endpoint (encrypted at rest with SECRET_ENCRYPTION_KEY) */
|
|
1289
|
+
webhookSecret: z10.string().default("")
|
|
1290
|
+
}).default({ owner: "", repo: "", reviewers: "", webhookSecret: "" }),
|
|
1289
1291
|
/** Per-source toggles */
|
|
1290
1292
|
sources: z10.object({
|
|
1291
1293
|
cloudwatch: z10.object({ enabled: z10.boolean().default(false) }).default({ enabled: false }),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@bike4mind/cli",
|
|
6
|
-
version: "0.2.49
|
|
6
|
+
version: "0.2.49",
|
|
7
7
|
type: "module",
|
|
8
8
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
9
9
|
license: "UNLICENSED",
|
|
@@ -64,7 +64,7 @@ var package_default = {
|
|
|
64
64
|
"@smithy/node-http-handler": "^4.4.14",
|
|
65
65
|
"async-mutex": "^0.5.0",
|
|
66
66
|
axios: "^1.13.6",
|
|
67
|
-
bcryptjs: "^
|
|
67
|
+
bcryptjs: "^3.0.2",
|
|
68
68
|
"better-sqlite3": "^12.6.2",
|
|
69
69
|
cheerio: "1.0.0-rc.12",
|
|
70
70
|
"cli-highlight": "^2.1.11",
|
|
@@ -118,10 +118,10 @@ var package_default = {
|
|
|
118
118
|
},
|
|
119
119
|
devDependencies: {
|
|
120
120
|
"@bike4mind/agents": "0.1.0",
|
|
121
|
-
"@bike4mind/common": "2.
|
|
122
|
-
"@bike4mind/mcp": "1.33.11
|
|
123
|
-
"@bike4mind/services": "2.63.1
|
|
124
|
-
"@bike4mind/utils": "2.15.4
|
|
121
|
+
"@bike4mind/common": "2.68.0",
|
|
122
|
+
"@bike4mind/mcp": "1.33.11",
|
|
123
|
+
"@bike4mind/services": "2.63.1",
|
|
124
|
+
"@bike4mind/utils": "2.15.4",
|
|
125
125
|
"@types/better-sqlite3": "^7.6.13",
|
|
126
126
|
"@types/diff": "^5.0.9",
|
|
127
127
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -140,7 +140,7 @@ var package_default = {
|
|
|
140
140
|
optionalDependencies: {
|
|
141
141
|
"@vscode/ripgrep": "^1.17.0"
|
|
142
142
|
},
|
|
143
|
-
gitHead: "
|
|
143
|
+
gitHead: "57bd5d0fb946b8a8e27e0f3096f46282f85559b5"
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
// src/utils/updateChecker.ts
|
|
@@ -36,20 +36,20 @@ import {
|
|
|
36
36
|
isReadOnlyTool,
|
|
37
37
|
loadContextFiles,
|
|
38
38
|
setWebSocketToolExecutor
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-ST2Y3ZP7.js";
|
|
40
40
|
import "../chunk-BDQBOLYG.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-2K6DFEPJ.js";
|
|
42
42
|
import "../chunk-GQGOWACU.js";
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-UVP4KCPD.js";
|
|
44
|
+
import "../chunk-EOOKQOLY.js";
|
|
45
|
+
import "../chunk-QU3ADG2K.js";
|
|
46
46
|
import "../chunk-PFBYGCOW.js";
|
|
47
47
|
import "../chunk-BPFEGDC7.js";
|
|
48
48
|
import {
|
|
49
49
|
ConfigStore,
|
|
50
50
|
logger
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import "../chunk-
|
|
51
|
+
} from "../chunk-LZBANFHR.js";
|
|
52
|
+
import "../chunk-YRYNVLXM.js";
|
|
53
53
|
import {
|
|
54
54
|
DEFAULT_SANDBOX_CONFIG
|
|
55
55
|
} from "../chunk-4BIBE3J7.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createFabFile,
|
|
4
4
|
createFabFileSchema
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-EOOKQOLY.js";
|
|
6
|
+
import "./chunk-QU3ADG2K.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-YRYNVLXM.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|
|
11
11
|
createFabFileSchema
|
package/dist/index.js
CHANGED
|
@@ -46,25 +46,25 @@ import {
|
|
|
46
46
|
setWebSocketToolExecutor,
|
|
47
47
|
substituteArguments,
|
|
48
48
|
warmFileCache
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ST2Y3ZP7.js";
|
|
50
50
|
import "./chunk-BDQBOLYG.js";
|
|
51
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-2K6DFEPJ.js";
|
|
52
52
|
import "./chunk-GQGOWACU.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-UVP4KCPD.js";
|
|
54
|
+
import "./chunk-EOOKQOLY.js";
|
|
55
55
|
import {
|
|
56
56
|
OllamaBackend
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-QU3ADG2K.js";
|
|
58
58
|
import "./chunk-PFBYGCOW.js";
|
|
59
59
|
import "./chunk-BPFEGDC7.js";
|
|
60
60
|
import {
|
|
61
61
|
ConfigStore,
|
|
62
62
|
logger
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-LZBANFHR.js";
|
|
64
64
|
import {
|
|
65
65
|
checkForUpdate,
|
|
66
66
|
package_default
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-ZGHPHONE.js";
|
|
68
68
|
import {
|
|
69
69
|
selectActiveBackgroundAgents,
|
|
70
70
|
useCliStore
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
import {
|
|
73
73
|
CREDIT_DEDUCT_TRANSACTION_TYPES,
|
|
74
74
|
ChatModels
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-YRYNVLXM.js";
|
|
76
76
|
import "./chunk-4BIBE3J7.js";
|
|
77
77
|
|
|
78
78
|
// src/index.tsx
|
|
@@ -169,9 +169,21 @@ function CustomTextInput({
|
|
|
169
169
|
useInput(
|
|
170
170
|
(input, key) => {
|
|
171
171
|
if (key.return && !key.meta && !key.shift) {
|
|
172
|
+
if (value.length > 0 && value[cursorOffset - 1] === "\\") {
|
|
173
|
+
const newValue = value.slice(0, cursorOffset - 1) + "\n" + value.slice(cursorOffset);
|
|
174
|
+
emitChange(newValue);
|
|
175
|
+
setCursorOffset(cursorOffset);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
172
178
|
onSubmit(value);
|
|
173
179
|
return;
|
|
174
180
|
}
|
|
181
|
+
if (key.return && (key.shift || key.meta)) {
|
|
182
|
+
const newValue = value.slice(0, cursorOffset) + "\n" + value.slice(cursorOffset);
|
|
183
|
+
emitChange(newValue);
|
|
184
|
+
setCursorOffset(cursorOffset + 1);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
175
187
|
if (key.meta && !key.ctrl) {
|
|
176
188
|
if (key.shift) {
|
|
177
189
|
if (key.leftArrow) {
|
|
@@ -835,7 +847,10 @@ function InputPrompt({
|
|
|
835
847
|
const handlePaste = (content) => {
|
|
836
848
|
const truncated = content.length > MAX_PASTE_SIZE ? content.slice(0, MAX_PASTE_SIZE) : content;
|
|
837
849
|
const lineCount = truncated.split("\n").length;
|
|
838
|
-
|
|
850
|
+
const prefix = value.trim();
|
|
851
|
+
const combined = prefix ? `${prefix}
|
|
852
|
+
${truncated}` : truncated;
|
|
853
|
+
setPastedContent(combined, lineCount);
|
|
839
854
|
};
|
|
840
855
|
const handleChange = async (newValue) => {
|
|
841
856
|
if (pastedContent) {
|
|
@@ -4025,6 +4040,9 @@ Custom Commands:
|
|
|
4025
4040
|
/commands:new <name> - Create a new custom command
|
|
4026
4041
|
/commands:reload - Reload custom commands from disk
|
|
4027
4042
|
|
|
4043
|
+
Terminal Setup:
|
|
4044
|
+
/terminal-setup - Configure Shift+Enter for multi-line input
|
|
4045
|
+
|
|
4028
4046
|
Keyboard Shortcuts:
|
|
4029
4047
|
Ctrl+C - Press twice to exit
|
|
4030
4048
|
Esc - Abort current operation
|
|
@@ -4040,7 +4058,12 @@ Keyboard Shortcuts:
|
|
|
4040
4058
|
Ctrl+L - Clear input
|
|
4041
4059
|
\u2191 / \u2193 - Navigate history / autocomplete
|
|
4042
4060
|
Tab - Accept autocomplete suggestion
|
|
4043
|
-
Shift+Cmd+Click - Open links in browser
|
|
4061
|
+
Shift+Cmd+Click - Open links in browser
|
|
4062
|
+
|
|
4063
|
+
Multi-line Input:
|
|
4064
|
+
\\ + Enter - Insert newline (works everywhere)
|
|
4065
|
+
Option + Enter - Insert newline (macOS standard terminals)
|
|
4066
|
+
Shift + Enter - Insert newline (iTerm2, WezTerm, Ghostty, Kitty)${hasCustomCommands ? "\n\n\u{1F4DD} Custom Commands Available:" : ""}${hasCustomCommands ? customCommands.map((cmd) => {
|
|
4044
4067
|
const source = cmd.source === "global" ? "\u{1F3E0}" : "\u{1F4C1}";
|
|
4045
4068
|
const argHint = cmd.argumentHint ? ` ${cmd.argumentHint}` : "";
|
|
4046
4069
|
return `
|
|
@@ -5055,6 +5078,11 @@ Allowed domains (${domains.length}):`);
|
|
|
5055
5078
|
console.log("");
|
|
5056
5079
|
break;
|
|
5057
5080
|
}
|
|
5081
|
+
case "terminal-setup": {
|
|
5082
|
+
const { runTerminalSetup } = await import("./terminalSetup-C5FHMLC3.js");
|
|
5083
|
+
await runTerminalSetup();
|
|
5084
|
+
break;
|
|
5085
|
+
}
|
|
5058
5086
|
case "add-dir": {
|
|
5059
5087
|
let dirPath = args.join(" ").trim();
|
|
5060
5088
|
if (!dirPath) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-2K6DFEPJ.js";
|
|
6
|
+
import "./chunk-QU3ADG2K.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-YRYNVLXM.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
11
11
|
getRelevantMementos
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
validateUrlForFetch,
|
|
144
144
|
warmUpSettingsCache,
|
|
145
145
|
withRetry
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-QU3ADG2K.js";
|
|
147
147
|
import {
|
|
148
148
|
Logger,
|
|
149
149
|
NotificationDeduplicator,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
buildRateLimitLogEntry,
|
|
157
157
|
isNearLimit,
|
|
158
158
|
parseRateLimitHeaders
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-YRYNVLXM.js";
|
|
160
160
|
export {
|
|
161
161
|
AIVideoService,
|
|
162
162
|
AWSBackend,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-UVP4KCPD.js";
|
|
6
|
+
import "./chunk-QU3ADG2K.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-YRYNVLXM.js";
|
|
9
9
|
export {
|
|
10
10
|
SubtractCreditsSchema,
|
|
11
11
|
subtractCredits
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/terminalSetup.ts
|
|
4
|
+
import { existsSync, promises as fs } from "fs";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import { homedir } from "os";
|
|
7
|
+
var TERMINAL_INFO = {
|
|
8
|
+
iterm2: { name: "iTerm2", status: "native" },
|
|
9
|
+
wezterm: { name: "WezTerm", status: "native" },
|
|
10
|
+
ghostty: { name: "Ghostty", status: "native" },
|
|
11
|
+
kitty: { name: "Kitty", status: "native" },
|
|
12
|
+
vscode: { name: "VS Code", status: "configurable" },
|
|
13
|
+
alacritty: { name: "Alacritty", status: "configurable" },
|
|
14
|
+
zed: { name: "Zed", status: "manual" },
|
|
15
|
+
terminal_app: { name: "Terminal.app", status: "manual" },
|
|
16
|
+
warp: { name: "Warp", status: "manual" },
|
|
17
|
+
unknown: { name: "Unknown", status: "unknown" }
|
|
18
|
+
};
|
|
19
|
+
function detectTerminal() {
|
|
20
|
+
const termProgram = process.env["TERM_PROGRAM"] ?? "";
|
|
21
|
+
const term = process.env["TERM"] ?? "";
|
|
22
|
+
if (termProgram === "vscode" || process.env["VSCODE_PID"]) {
|
|
23
|
+
return { id: "vscode", ...TERMINAL_INFO.vscode };
|
|
24
|
+
}
|
|
25
|
+
if (termProgram === "iTerm.app" || process.env["ITERM_SESSION_ID"]) {
|
|
26
|
+
return { id: "iterm2", ...TERMINAL_INFO.iterm2 };
|
|
27
|
+
}
|
|
28
|
+
if (termProgram === "WezTerm" || process.env["WEZTERM_PANE"]) {
|
|
29
|
+
return { id: "wezterm", ...TERMINAL_INFO.wezterm };
|
|
30
|
+
}
|
|
31
|
+
if (termProgram === "ghostty" || term === "xterm-ghostty") {
|
|
32
|
+
return { id: "ghostty", ...TERMINAL_INFO.ghostty };
|
|
33
|
+
}
|
|
34
|
+
if (term === "xterm-kitty" || process.env["KITTY_PID"]) {
|
|
35
|
+
return { id: "kitty", ...TERMINAL_INFO.kitty };
|
|
36
|
+
}
|
|
37
|
+
if (termProgram === "Alacritty" || term === "alacritty") {
|
|
38
|
+
return { id: "alacritty", ...TERMINAL_INFO.alacritty };
|
|
39
|
+
}
|
|
40
|
+
if (termProgram === "WarpTerminal" || process.env["WARP_IS_LOCAL_SHELL_SESSION"]) {
|
|
41
|
+
return { id: "warp", ...TERMINAL_INFO.warp };
|
|
42
|
+
}
|
|
43
|
+
if (termProgram === "zed") {
|
|
44
|
+
return { id: "zed", ...TERMINAL_INFO.zed };
|
|
45
|
+
}
|
|
46
|
+
if (termProgram === "Apple_Terminal") {
|
|
47
|
+
return { id: "terminal_app", ...TERMINAL_INFO.terminal_app };
|
|
48
|
+
}
|
|
49
|
+
return { id: "unknown", ...TERMINAL_INFO.unknown };
|
|
50
|
+
}
|
|
51
|
+
var VSCODE_KEYBINDING = {
|
|
52
|
+
key: "shift+enter",
|
|
53
|
+
command: "workbench.action.terminal.sendSequence",
|
|
54
|
+
args: { text: "\x1B[13;2u" },
|
|
55
|
+
when: "terminalFocus"
|
|
56
|
+
};
|
|
57
|
+
async function setupVSCode() {
|
|
58
|
+
const vscodeDirs = [
|
|
59
|
+
path.join(homedir(), "Library", "Application Support", "Code", "User"),
|
|
60
|
+
// macOS
|
|
61
|
+
path.join(homedir(), ".config", "Code", "User"),
|
|
62
|
+
// Linux
|
|
63
|
+
path.join(homedir(), "AppData", "Roaming", "Code", "User")
|
|
64
|
+
// Windows
|
|
65
|
+
];
|
|
66
|
+
const vscodeDir = vscodeDirs.find((dir) => existsSync(dir));
|
|
67
|
+
if (!vscodeDir) {
|
|
68
|
+
return {
|
|
69
|
+
success: false,
|
|
70
|
+
message: "Could not find VS Code settings directory.\nManually add this to your keybindings.json (Cmd+K Cmd+S \u2192 Open Keyboard Shortcuts JSON):\n\n" + JSON.stringify(VSCODE_KEYBINDING, null, 2)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const keybindingsPath = path.join(vscodeDir, "keybindings.json");
|
|
74
|
+
let keybindings = [];
|
|
75
|
+
if (existsSync(keybindingsPath)) {
|
|
76
|
+
const content = await fs.readFile(keybindingsPath, "utf-8");
|
|
77
|
+
const stripped = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
78
|
+
try {
|
|
79
|
+
keybindings = JSON.parse(stripped);
|
|
80
|
+
} catch {
|
|
81
|
+
return {
|
|
82
|
+
success: false,
|
|
83
|
+
message: "Could not parse keybindings.json. Manually add this entry:\n\n" + JSON.stringify(VSCODE_KEYBINDING, null, 2)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const alreadyConfigured = keybindings.some(
|
|
88
|
+
(binding) => binding["key"] === "shift+enter" && binding["command"] === "workbench.action.terminal.sendSequence" && binding["when"] === "terminalFocus"
|
|
89
|
+
);
|
|
90
|
+
if (alreadyConfigured) {
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
message: "VS Code is already configured for Shift+Enter newlines."
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
keybindings.push(VSCODE_KEYBINDING);
|
|
97
|
+
await fs.writeFile(keybindingsPath, JSON.stringify(keybindings, null, 2) + "\n", "utf-8");
|
|
98
|
+
return {
|
|
99
|
+
success: true,
|
|
100
|
+
message: `Updated ${keybindingsPath}
|
|
101
|
+
Shift+Enter will now insert a newline in the B4M CLI.
|
|
102
|
+
Restart your VS Code terminal for the change to take effect.`
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
var ALACRITTY_TOML_SNIPPET = `
|
|
106
|
+
# B4M CLI: Shift+Enter sends Kitty-protocol sequence for newline
|
|
107
|
+
[[keyboard.bindings]]
|
|
108
|
+
key = "Return"
|
|
109
|
+
mods = "Shift"
|
|
110
|
+
chars = "\\u001b[13;2u"
|
|
111
|
+
`.trim();
|
|
112
|
+
async function setupAlacritty() {
|
|
113
|
+
const configPaths = [
|
|
114
|
+
path.join(homedir(), ".config", "alacritty", "alacritty.toml"),
|
|
115
|
+
path.join(homedir(), ".alacritty.toml")
|
|
116
|
+
];
|
|
117
|
+
const existingConfig = configPaths.find((p) => existsSync(p));
|
|
118
|
+
const configPath = existingConfig ?? configPaths[0];
|
|
119
|
+
let content = "";
|
|
120
|
+
if (existingConfig) {
|
|
121
|
+
content = await fs.readFile(configPath, "utf-8");
|
|
122
|
+
if (content.includes("[13;2u") || content.includes("\\u001b[13;2u")) {
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
message: "Alacritty is already configured for Shift+Enter newlines."
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const newContent = content ? content.trimEnd() + "\n\n" + ALACRITTY_TOML_SNIPPET + "\n" : ALACRITTY_TOML_SNIPPET + "\n";
|
|
130
|
+
const configDir = path.dirname(configPath);
|
|
131
|
+
if (!existsSync(configDir)) {
|
|
132
|
+
await fs.mkdir(configDir, { recursive: true });
|
|
133
|
+
}
|
|
134
|
+
await fs.writeFile(configPath, newContent, "utf-8");
|
|
135
|
+
return {
|
|
136
|
+
success: true,
|
|
137
|
+
message: `Updated ${configPath}
|
|
138
|
+
Shift+Enter will now insert a newline in the B4M CLI.
|
|
139
|
+
Restart Alacritty for the change to take effect.`
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function getManualInstructions(terminal) {
|
|
143
|
+
switch (terminal.id) {
|
|
144
|
+
case "zed":
|
|
145
|
+
return "Add this to your Zed keymap.json (Zed \u2192 Settings \u2192 Open Key Bindings):\n\n" + JSON.stringify(
|
|
146
|
+
[
|
|
147
|
+
{
|
|
148
|
+
context: "Terminal",
|
|
149
|
+
bindings: {
|
|
150
|
+
"shift-enter": ["terminal::SendText", "\\u001b[13;2u"]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
null,
|
|
155
|
+
2
|
|
156
|
+
);
|
|
157
|
+
case "terminal_app":
|
|
158
|
+
return "macOS Terminal.app cannot send distinct Shift+Enter sequences.\n\nAlternatives:\n \u2022 Use Option+Enter (\u2325+Enter) to insert newlines\n \u2022 Type \\ then Enter to insert newlines\n \u2022 Switch to iTerm2, WezTerm, or Ghostty for native Shift+Enter support";
|
|
159
|
+
case "warp":
|
|
160
|
+
return "Warp terminal has limited keybinding customization.\n\nAlternatives:\n \u2022 Use Option+Enter (\u2325+Enter) to insert newlines\n \u2022 Type \\ then Enter to insert newlines";
|
|
161
|
+
default:
|
|
162
|
+
return "Your terminal needs to be configured to send a distinct escape sequence for Shift+Enter.\nConfigure Shift+Enter to send: \\x1b[13;2u (Kitty keyboard protocol)\n\nAlternatives that work in all terminals:\n \u2022 Option/Alt+Enter to insert newlines\n \u2022 Type \\ then Enter to insert newlines";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function runTerminalSetup() {
|
|
166
|
+
const terminal = detectTerminal();
|
|
167
|
+
console.log(`
|
|
168
|
+
Detected terminal: ${terminal.name}
|
|
169
|
+
`);
|
|
170
|
+
switch (terminal.status) {
|
|
171
|
+
case "native":
|
|
172
|
+
console.log(`\u2705 ${terminal.name} natively supports Shift+Enter for newlines.
|
|
173
|
+
No configuration needed!
|
|
174
|
+
`);
|
|
175
|
+
break;
|
|
176
|
+
case "configurable": {
|
|
177
|
+
console.log(`Configuring ${terminal.name} for Shift+Enter support...
|
|
178
|
+
`);
|
|
179
|
+
let result;
|
|
180
|
+
switch (terminal.id) {
|
|
181
|
+
case "vscode":
|
|
182
|
+
result = await setupVSCode();
|
|
183
|
+
break;
|
|
184
|
+
case "alacritty":
|
|
185
|
+
result = await setupAlacritty();
|
|
186
|
+
break;
|
|
187
|
+
default:
|
|
188
|
+
result = { success: false, message: "No auto-configuration available." };
|
|
189
|
+
}
|
|
190
|
+
console.log(result.success ? `\u2705 ${result.message}` : `\u26A0\uFE0F ${result.message}`);
|
|
191
|
+
console.log();
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
case "manual":
|
|
195
|
+
console.log(`\u26A0\uFE0F ${terminal.name} requires manual configuration.
|
|
196
|
+
`);
|
|
197
|
+
console.log(getManualInstructions(terminal));
|
|
198
|
+
console.log();
|
|
199
|
+
break;
|
|
200
|
+
case "unknown":
|
|
201
|
+
console.log(getManualInstructions(terminal));
|
|
202
|
+
console.log();
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
console.log("Universal newline methods (work in all terminals):");
|
|
206
|
+
console.log(" \u2022 Option/Alt + Enter \u2014 insert newline");
|
|
207
|
+
console.log(" \u2022 \\ + Enter \u2014 insert newline (backslash-escape)");
|
|
208
|
+
console.log(" \u2022 Shift + Enter \u2014 insert newline (if terminal supports Kitty protocol)");
|
|
209
|
+
console.log();
|
|
210
|
+
}
|
|
211
|
+
export {
|
|
212
|
+
detectTerminal,
|
|
213
|
+
runTerminalSetup
|
|
214
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.49
|
|
3
|
+
"version": "0.2.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@smithy/node-http-handler": "^4.4.14",
|
|
62
62
|
"async-mutex": "^0.5.0",
|
|
63
63
|
"axios": "^1.13.6",
|
|
64
|
-
"bcryptjs": "^
|
|
64
|
+
"bcryptjs": "^3.0.2",
|
|
65
65
|
"better-sqlite3": "^12.6.2",
|
|
66
66
|
"cheerio": "1.0.0-rc.12",
|
|
67
67
|
"cli-highlight": "^2.1.11",
|
|
@@ -115,10 +115,10 @@
|
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@bike4mind/agents": "0.1.0",
|
|
118
|
-
"@bike4mind/common": "2.
|
|
119
|
-
"@bike4mind/mcp": "1.33.11
|
|
120
|
-
"@bike4mind/services": "2.63.1
|
|
121
|
-
"@bike4mind/utils": "2.15.4
|
|
118
|
+
"@bike4mind/common": "2.68.0",
|
|
119
|
+
"@bike4mind/mcp": "1.33.11",
|
|
120
|
+
"@bike4mind/services": "2.63.1",
|
|
121
|
+
"@bike4mind/utils": "2.15.4",
|
|
122
122
|
"@types/better-sqlite3": "^7.6.13",
|
|
123
123
|
"@types/diff": "^5.0.9",
|
|
124
124
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
"optionalDependencies": {
|
|
138
138
|
"@vscode/ripgrep": "^1.17.0"
|
|
139
139
|
},
|
|
140
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "57bd5d0fb946b8a8e27e0f3096f46282f85559b5"
|
|
141
141
|
}
|