@bike4mind/cli 0.2.61-fix-bedrock-image-dimension-limit.21703 → 0.2.61
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-UI7MK2WJ.js → artifactExtractor-TK2FFZ4C.js} +1 -1
- package/dist/{chunk-SLQS2YOB.js → chunk-22G2T3X7.js} +1 -1
- package/dist/{chunk-HD2W2IIP.js → chunk-4QTLLPJJ.js} +2 -0
- package/dist/{chunk-VV7RGNDI.js → chunk-6RJWHTIX.js} +7 -4
- package/dist/{chunk-3U4MQY23.js → chunk-76NSNH4E.js} +2 -32
- package/dist/{chunk-HIFDFFH2.js → chunk-F5WF4RWS.js} +2 -2
- package/dist/{chunk-4FYA5BE4.js → chunk-JTBRGW2F.js} +2 -2
- package/dist/{chunk-ORU7WRKU.js → chunk-RFVINAUP.js} +2 -2
- package/dist/{chunk-YWLJP5XM.js → chunk-UB2LL4RE.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-AMELTHMZ.js → create-NVG5T7TG.js} +3 -3
- package/dist/index.js +8 -8
- package/dist/{llmMarkdownGenerator-QT4CMIAP.js → llmMarkdownGenerator-EYODN3A7.js} +1 -1
- package/dist/{markdownGenerator-VCEAQJ4R.js → markdownGenerator-JGCTGPEX.js} +1 -1
- package/dist/{mementoService-NG7PZ2AI.js → mementoService-OT4FL5SA.js} +3 -3
- package/dist/{src-BOTVEMJD.js → src-2AUTMBAJ.js} +2 -2
- package/dist/{src-4SIKEV27.js → src-Z43GIM7S.js} +1 -1
- package/dist/{subtractCredits-OVD6XP7W.js → subtractCredits-JKD3JDC2.js} +3 -3
- 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-4QTLLPJJ.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;
|
|
@@ -2015,6 +2015,8 @@ var TavernHeartbeatLogAction = z11.object({
|
|
|
2015
2015
|
confidence: z11.number().optional(),
|
|
2016
2016
|
confidenceSource: z11.string().optional(),
|
|
2017
2017
|
creditsUsed: z11.number().optional(),
|
|
2018
|
+
energy: z11.number().optional(),
|
|
2019
|
+
curiosity: z11.number().optional(),
|
|
2018
2020
|
artifact: z11.object({
|
|
2019
2021
|
type: z11.enum(["mermaid", "recharts", "image"]),
|
|
2020
2022
|
data: z11.string(),
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getOpenWeatherKey,
|
|
5
5
|
getSerperKey,
|
|
6
6
|
getWolframAlphaKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RFVINAUP.js";
|
|
8
8
|
import {
|
|
9
9
|
assertPathAllowed,
|
|
10
10
|
isPathAllowed
|
|
@@ -20,14 +20,14 @@ import {
|
|
|
20
20
|
OpenAIBackend,
|
|
21
21
|
OpenAIImageService,
|
|
22
22
|
XAIImageService
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-76NSNH4E.js";
|
|
24
24
|
import {
|
|
25
25
|
Logger
|
|
26
26
|
} from "./chunk-PFBYGCOW.js";
|
|
27
27
|
import {
|
|
28
28
|
ConfigStore,
|
|
29
29
|
logger
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-22G2T3X7.js";
|
|
31
31
|
import {
|
|
32
32
|
ALERT_THRESHOLDS,
|
|
33
33
|
AiEvents,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
getViewById,
|
|
89
89
|
resolveNavigationIntents,
|
|
90
90
|
sanitizeTelemetryError
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
92
92
|
|
|
93
93
|
// src/utils/fileSearch.ts
|
|
94
94
|
import * as fs from "fs";
|
|
@@ -1855,6 +1855,9 @@ ${options.context}` : this.getSystemPrompt()
|
|
|
1855
1855
|
return result2;
|
|
1856
1856
|
}
|
|
1857
1857
|
iterations++;
|
|
1858
|
+
if (iterations > 1 && options.iterationDelayMs && options.iterationDelayMs > 0) {
|
|
1859
|
+
await new Promise((resolve3) => setTimeout(resolve3, options.iterationDelayMs));
|
|
1860
|
+
}
|
|
1858
1861
|
this.context.logger.debug(`[ReActAgent] Starting iteration ${iterations}/${maxIterations}`);
|
|
1859
1862
|
let iterationComplete = false;
|
|
1860
1863
|
let currentText = "";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isGPTImageModel,
|
|
22
22
|
isModelDeprecated,
|
|
23
23
|
settingsMap
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
25
25
|
|
|
26
26
|
// ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
|
|
27
27
|
import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
|
@@ -1089,12 +1089,10 @@ var MIME_TO_EXT = {
|
|
|
1089
1089
|
};
|
|
1090
1090
|
|
|
1091
1091
|
// ../../b4m-core/packages/utils/dist/src/llm/utils.js
|
|
1092
|
-
import { Jimp } from "jimp";
|
|
1093
1092
|
var INFINITE_VALUE = 14;
|
|
1094
1093
|
var MAX_FILE_SIZE = 6e3;
|
|
1095
1094
|
var PREVIEW_CHUNK = 700;
|
|
1096
1095
|
var CHARS_PER_TOKEN = 3.5;
|
|
1097
|
-
var MAX_IMAGE_DIMENSION_PX = 2e3;
|
|
1098
1096
|
var EMBEDDING_TOKEN_LIMITS = {
|
|
1099
1097
|
MAX_EMBEDDING_TOKENS: 8e3,
|
|
1100
1098
|
// Conservative limit under 8192
|
|
@@ -1409,33 +1407,6 @@ async function cosineSearch(file, userPromptVector, { db, logger }) {
|
|
|
1409
1407
|
}).filter((result) => result !== null);
|
|
1410
1408
|
return searchResults.sort((a, b) => b.score - a.score).slice(0, 3);
|
|
1411
1409
|
}
|
|
1412
|
-
var JIMP_SUPPORTED_MIMES = /* @__PURE__ */ new Set([
|
|
1413
|
-
"image/bmp",
|
|
1414
|
-
"image/x-ms-bmp",
|
|
1415
|
-
"image/gif",
|
|
1416
|
-
"image/jpeg",
|
|
1417
|
-
"image/png",
|
|
1418
|
-
"image/tiff"
|
|
1419
|
-
]);
|
|
1420
|
-
async function ensureImageWithinDimensionLimit(imageBuffer, maxDimension = MAX_IMAGE_DIMENSION_PX, logger) {
|
|
1421
|
-
try {
|
|
1422
|
-
const image = await Jimp.read(imageBuffer);
|
|
1423
|
-
const { width, height } = image.bitmap;
|
|
1424
|
-
if (width <= maxDimension && height <= maxDimension) {
|
|
1425
|
-
return imageBuffer;
|
|
1426
|
-
}
|
|
1427
|
-
const scale = maxDimension / Math.max(width, height);
|
|
1428
|
-
const newWidth = Math.floor(width * scale);
|
|
1429
|
-
const newHeight = Math.floor(height * scale);
|
|
1430
|
-
logger?.info(`[ensureImageWithinDimensionLimit] Resizing from ${width}x${height} to ${newWidth}x${newHeight}`);
|
|
1431
|
-
const resized = image.resize({ w: newWidth, h: newHeight });
|
|
1432
|
-
const outputMime = image.mime && JIMP_SUPPORTED_MIMES.has(image.mime) ? image.mime : "image/png";
|
|
1433
|
-
return Buffer.from(await resized.getBuffer(outputMime));
|
|
1434
|
-
} catch (error) {
|
|
1435
|
-
logger?.warn(`[ensureImageWithinDimensionLimit] Failed to resize image, using original: ${error}`);
|
|
1436
|
-
return imageBuffer;
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
1410
|
async function processFabFilesServer(embeddingFactory, fabFiles, userPrompt, maxTokens, modelInfo, sendStatusUpdate, { logger, storage, db }, progressCallback) {
|
|
1440
1411
|
if (!fabFiles || fabFiles.length === 0) {
|
|
1441
1412
|
return { userMessages: [], errorMessages: [] };
|
|
@@ -1511,8 +1482,7 @@ When referencing this file, use the exact filename "${file.fileName}" \u2014 do
|
|
|
1511
1482
|
});
|
|
1512
1483
|
return;
|
|
1513
1484
|
}
|
|
1514
|
-
const
|
|
1515
|
-
const imageBuffer = await ensureImageWithinDimensionLimit(rawImageBuffer, MAX_IMAGE_DIMENSION_PX, logger);
|
|
1485
|
+
const imageBuffer = await storage.download(file.filePath);
|
|
1516
1486
|
const imageData = imageBuffer.toString("base64");
|
|
1517
1487
|
const { mime: actualMimeType } = await getFileType(imageBuffer, file.fileName, file.mimeType);
|
|
1518
1488
|
imageContent.push({
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-76NSNH4E.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-4QTLLPJJ.js";
|
|
17
17
|
|
|
18
18
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
19
19
|
import { z } from "zod";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-76NSNH4E.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-76NSNH4E.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "@bike4mind/cli",
|
|
6
|
-
version: "0.2.61
|
|
6
|
+
version: "0.2.61",
|
|
7
7
|
type: "module",
|
|
8
8
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
9
9
|
license: "UNLICENSED",
|
|
@@ -118,11 +118,11 @@ var package_default = {
|
|
|
118
118
|
zustand: "^4.5.4"
|
|
119
119
|
},
|
|
120
120
|
devDependencies: {
|
|
121
|
-
"@bike4mind/agents": "0.
|
|
122
|
-
"@bike4mind/common": "2.
|
|
123
|
-
"@bike4mind/mcp": "1.33.19
|
|
124
|
-
"@bike4mind/services": "2.68.1
|
|
125
|
-
"@bike4mind/utils": "2.
|
|
121
|
+
"@bike4mind/agents": "0.3.0",
|
|
122
|
+
"@bike4mind/common": "2.74.0",
|
|
123
|
+
"@bike4mind/mcp": "1.33.19",
|
|
124
|
+
"@bike4mind/services": "2.68.1",
|
|
125
|
+
"@bike4mind/utils": "2.16.0",
|
|
126
126
|
"@types/better-sqlite3": "^7.6.13",
|
|
127
127
|
"@types/jsonwebtoken": "^9.0.4",
|
|
128
128
|
"@types/node": "^22.9.0",
|
|
@@ -139,7 +139,7 @@ var package_default = {
|
|
|
139
139
|
optionalDependencies: {
|
|
140
140
|
"@vscode/ripgrep": "^1.17.1"
|
|
141
141
|
},
|
|
142
|
-
gitHead: "
|
|
142
|
+
gitHead: "858b954a8d7d70d9272e26403521d995aceff0b9"
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
// src/utils/updateChecker.ts
|
|
@@ -36,21 +36,21 @@ import {
|
|
|
36
36
|
isReadOnlyTool,
|
|
37
37
|
loadContextFiles,
|
|
38
38
|
setWebSocketToolExecutor
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-6RJWHTIX.js";
|
|
40
40
|
import "../chunk-BDQBOLYG.js";
|
|
41
|
-
import "../chunk-
|
|
41
|
+
import "../chunk-RFVINAUP.js";
|
|
42
42
|
import "../chunk-GQGOWACU.js";
|
|
43
43
|
import "../chunk-LTLJRF6I.js";
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-F5WF4RWS.js";
|
|
45
|
+
import "../chunk-JTBRGW2F.js";
|
|
46
|
+
import "../chunk-76NSNH4E.js";
|
|
47
47
|
import "../chunk-PFBYGCOW.js";
|
|
48
48
|
import "../chunk-BPFEGDC7.js";
|
|
49
49
|
import {
|
|
50
50
|
ConfigStore,
|
|
51
51
|
logger
|
|
52
|
-
} from "../chunk-
|
|
53
|
-
import "../chunk-
|
|
52
|
+
} from "../chunk-22G2T3X7.js";
|
|
53
|
+
import "../chunk-4QTLLPJJ.js";
|
|
54
54
|
import {
|
|
55
55
|
DEFAULT_SANDBOX_CONFIG
|
|
56
56
|
} 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-JTBRGW2F.js";
|
|
6
|
+
import "./chunk-76NSNH4E.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-4QTLLPJJ.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|
|
11
11
|
createFabFileSchema
|
package/dist/index.js
CHANGED
|
@@ -48,26 +48,26 @@ import {
|
|
|
48
48
|
setWebSocketToolExecutor,
|
|
49
49
|
substituteArguments,
|
|
50
50
|
warmFileCache
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-6RJWHTIX.js";
|
|
52
52
|
import "./chunk-BDQBOLYG.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-RFVINAUP.js";
|
|
54
54
|
import "./chunk-GQGOWACU.js";
|
|
55
55
|
import "./chunk-LTLJRF6I.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-F5WF4RWS.js";
|
|
57
|
+
import "./chunk-JTBRGW2F.js";
|
|
58
58
|
import {
|
|
59
59
|
OllamaBackend
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-76NSNH4E.js";
|
|
61
61
|
import "./chunk-PFBYGCOW.js";
|
|
62
62
|
import "./chunk-BPFEGDC7.js";
|
|
63
63
|
import {
|
|
64
64
|
ConfigStore,
|
|
65
65
|
logger
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-22G2T3X7.js";
|
|
67
67
|
import {
|
|
68
68
|
checkForUpdate,
|
|
69
69
|
package_default
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-UB2LL4RE.js";
|
|
71
71
|
import {
|
|
72
72
|
selectActiveBackgroundAgents,
|
|
73
73
|
useCliStore
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
ChatModels,
|
|
78
78
|
validateJupyterKernelName,
|
|
79
79
|
validateNotebookPath
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
81
81
|
import "./chunk-4BIBE3J7.js";
|
|
82
82
|
|
|
83
83
|
// src/index.tsx
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-RFVINAUP.js";
|
|
6
|
+
import "./chunk-76NSNH4E.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-4QTLLPJJ.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
11
11
|
getRelevantMementos
|
|
@@ -146,7 +146,7 @@ import {
|
|
|
146
146
|
validateUrlForFetch,
|
|
147
147
|
warmUpSettingsCache,
|
|
148
148
|
withRetry
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-76NSNH4E.js";
|
|
150
150
|
import {
|
|
151
151
|
Logger,
|
|
152
152
|
NotificationDeduplicator,
|
|
@@ -159,7 +159,7 @@ import {
|
|
|
159
159
|
buildRateLimitLogEntry,
|
|
160
160
|
isNearLimit,
|
|
161
161
|
parseRateLimitHeaders
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-4QTLLPJJ.js";
|
|
163
163
|
export {
|
|
164
164
|
AIVideoService,
|
|
165
165
|
AWSBackend,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-F5WF4RWS.js";
|
|
6
|
+
import "./chunk-76NSNH4E.js";
|
|
7
7
|
import "./chunk-PFBYGCOW.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-4QTLLPJJ.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.61
|
|
3
|
+
"version": "0.2.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -115,11 +115,11 @@
|
|
|
115
115
|
"zustand": "^4.5.4"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
|
-
"@bike4mind/agents": "0.
|
|
119
|
-
"@bike4mind/common": "2.
|
|
120
|
-
"@bike4mind/mcp": "1.33.19
|
|
121
|
-
"@bike4mind/services": "2.68.1
|
|
122
|
-
"@bike4mind/utils": "2.
|
|
118
|
+
"@bike4mind/agents": "0.3.0",
|
|
119
|
+
"@bike4mind/common": "2.74.0",
|
|
120
|
+
"@bike4mind/mcp": "1.33.19",
|
|
121
|
+
"@bike4mind/services": "2.68.1",
|
|
122
|
+
"@bike4mind/utils": "2.16.0",
|
|
123
123
|
"@types/better-sqlite3": "^7.6.13",
|
|
124
124
|
"@types/jsonwebtoken": "^9.0.4",
|
|
125
125
|
"@types/node": "^22.9.0",
|
|
@@ -136,5 +136,5 @@
|
|
|
136
136
|
"optionalDependencies": {
|
|
137
137
|
"@vscode/ripgrep": "^1.17.1"
|
|
138
138
|
},
|
|
139
|
-
"gitHead": "
|
|
139
|
+
"gitHead": "858b954a8d7d70d9272e26403521d995aceff0b9"
|
|
140
140
|
}
|