@bike4mind/cli 0.2.31-feat-python-playground.19625 → 0.2.31-feat-multi-directory-support.19528
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/bin/bike4mind-cli.mjs +11 -48
- package/dist/{artifactExtractor-HSTGLMPL.js → artifactExtractor-T6NJ7V7P.js} +1 -1
- package/dist/{chunk-2PXPXXDN.js → chunk-3SPW5FYJ.js} +7 -116
- package/dist/{chunk-RTD3GUAP.js → chunk-ERV5G6MX.js} +2 -2
- package/dist/{chunk-ZHXVJFCI.js → chunk-F4PXVLZX.js} +2 -2
- package/dist/{chunk-32PKF3N7.js → chunk-IJRONVAD.js} +54 -3
- package/dist/{chunk-LAZAO77H.js → chunk-JWJF6O4L.js} +2 -2
- package/dist/{chunk-EEGKRFVP.js → chunk-NI22LIK3.js} +2 -40
- package/dist/commands/mcpCommand.js +1 -1
- package/dist/{create-ICV35GRO.js → create-XOEMSBER.js} +3 -3
- package/dist/index.js +514 -1739
- package/dist/{llmMarkdownGenerator-6FOXI2T4.js → llmMarkdownGenerator-NPX7ULSW.js} +1 -1
- package/dist/{markdownGenerator-6RY7C5B7.js → markdownGenerator-TVJ2RQXC.js} +1 -1
- package/dist/{mementoService-OHL67X43.js → mementoService-HGH2XVLM.js} +3 -3
- package/dist/{src-O2DE2WAD.js → src-2BRBILH7.js} +1 -7
- package/dist/{src-ZR2BFWLN.js → src-JZ6OHGTX.js} +2 -2
- package/dist/{subtractCredits-OPURYRNV.js → subtractCredits-4VIHTUR4.js} +3 -3
- package/package.json +6 -6
- package/dist/chunk-S3S2FV2N.js +0 -244
- package/dist/commands/doctorCommand.js +0 -87
- package/dist/commands/updateCommand.js +0 -42
package/bin/bike4mind-cli.mjs
CHANGED
|
@@ -46,6 +46,11 @@ const argv = await yargs(hideBin(process.argv))
|
|
|
46
46
|
description: 'Disable loading project-specific configuration (.bike4mind/)',
|
|
47
47
|
default: false,
|
|
48
48
|
})
|
|
49
|
+
.option('add-dir', {
|
|
50
|
+
type: 'array',
|
|
51
|
+
description: 'Add additional directories for file access (can be used multiple times)',
|
|
52
|
+
string: true,
|
|
53
|
+
})
|
|
49
54
|
.command('mcp', 'Manage MCP (Model Context Protocol) servers', (yargs) => {
|
|
50
55
|
return yargs
|
|
51
56
|
.command('list', 'List configured MCP servers', {}, async () => {
|
|
@@ -88,8 +93,6 @@ const argv = await yargs(hideBin(process.argv))
|
|
|
88
93
|
})
|
|
89
94
|
.demandCommand(1, 'You must provide a subcommand (list, add, remove, enable, disable)');
|
|
90
95
|
})
|
|
91
|
-
.command('update', 'Check for and install CLI updates')
|
|
92
|
-
.command('doctor', 'Run diagnostic checks on CLI installation')
|
|
93
96
|
.help()
|
|
94
97
|
.alias('help', 'h')
|
|
95
98
|
.version()
|
|
@@ -109,6 +112,12 @@ if (argv['debug-stream']) {
|
|
|
109
112
|
if (argv['no-project-config']) {
|
|
110
113
|
process.env.B4M_NO_PROJECT_CONFIG = '1';
|
|
111
114
|
}
|
|
115
|
+
if (argv['add-dir'] && argv['add-dir'].length > 0) {
|
|
116
|
+
// Resolve paths to absolute and pass via environment variable
|
|
117
|
+
const { resolve } = await import('path');
|
|
118
|
+
const resolvedDirs = argv['add-dir'].map(d => resolve(d));
|
|
119
|
+
process.env.B4M_ADDITIONAL_DIRS = JSON.stringify(resolvedDirs);
|
|
120
|
+
}
|
|
112
121
|
|
|
113
122
|
// Auto-detect environment: prefer production mode when dist exists
|
|
114
123
|
const distPath = join(__dirname, '../dist/index.js');
|
|
@@ -151,52 +160,6 @@ if (argv._[0] === 'mcp') {
|
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
|
|
154
|
-
// Handle update command (external command)
|
|
155
|
-
if (argv._[0] === 'update') {
|
|
156
|
-
try {
|
|
157
|
-
let handleUpdateCommand;
|
|
158
|
-
|
|
159
|
-
if (isDev) {
|
|
160
|
-
const { register } = require('tsx/esm/api');
|
|
161
|
-
register();
|
|
162
|
-
const module = await import('../src/commands/updateCommand.ts');
|
|
163
|
-
handleUpdateCommand = module.handleUpdateCommand;
|
|
164
|
-
} else {
|
|
165
|
-
const module = await import('../dist/commands/updateCommand.js');
|
|
166
|
-
handleUpdateCommand = module.handleUpdateCommand;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
await handleUpdateCommand();
|
|
170
|
-
process.exit(0);
|
|
171
|
-
} catch (error) {
|
|
172
|
-
console.error('Error:', error.message);
|
|
173
|
-
process.exit(1);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Handle doctor command (external command)
|
|
178
|
-
if (argv._[0] === 'doctor') {
|
|
179
|
-
try {
|
|
180
|
-
let handleDoctorCommand;
|
|
181
|
-
|
|
182
|
-
if (isDev) {
|
|
183
|
-
const { register } = require('tsx/esm/api');
|
|
184
|
-
register();
|
|
185
|
-
const module = await import('../src/commands/doctorCommand.ts');
|
|
186
|
-
handleDoctorCommand = module.handleDoctorCommand;
|
|
187
|
-
} else {
|
|
188
|
-
const module = await import('../dist/commands/doctorCommand.js');
|
|
189
|
-
handleDoctorCommand = module.handleDoctorCommand;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
await handleDoctorCommand();
|
|
193
|
-
process.exit(0);
|
|
194
|
-
} catch (error) {
|
|
195
|
-
console.error('Error:', error.message);
|
|
196
|
-
process.exit(1);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
163
|
if (isDev) {
|
|
201
164
|
// Show dev mode indicator for developers
|
|
202
165
|
console.log('🔧 Running in development mode (using TypeScript source)\n');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NI22LIK3.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-NI22LIK3.js";
|
|
20
20
|
import {
|
|
21
21
|
Logger
|
|
22
22
|
} from "./chunk-PFBYGCOW.js";
|
|
@@ -2250,7 +2250,6 @@ var TEMPERATURE_ONLY_MODELS = [
|
|
|
2250
2250
|
ChatModels.CLAUDE_4_1_OPUS,
|
|
2251
2251
|
ChatModels.CLAUDE_4_5_HAIKU,
|
|
2252
2252
|
ChatModels.CLAUDE_4_5_OPUS,
|
|
2253
|
-
ChatModels.CLAUDE_4_6_SONNET,
|
|
2254
2253
|
ChatModels.CLAUDE_4_6_OPUS
|
|
2255
2254
|
];
|
|
2256
2255
|
var INITIAL_TIMEOUT_MS = 3e4;
|
|
@@ -2586,32 +2585,6 @@ var AnthropicBackend = class {
|
|
|
2586
2585
|
releaseDate: "2025-11-25",
|
|
2587
2586
|
description: "Claude 4.5 Opus with Anthropic. Top-tier extended thinking model with excellent performance for complex reasoning, coding, and creative tasks."
|
|
2588
2587
|
},
|
|
2589
|
-
{
|
|
2590
|
-
id: ChatModels.CLAUDE_4_6_SONNET,
|
|
2591
|
-
type: "text",
|
|
2592
|
-
name: "Claude 4.6 Sonnet",
|
|
2593
|
-
backend: ModelBackend.Anthropic,
|
|
2594
|
-
contextWindow: 2e5,
|
|
2595
|
-
max_tokens: 16384,
|
|
2596
|
-
can_stream: true,
|
|
2597
|
-
can_think: true,
|
|
2598
|
-
pricing: {
|
|
2599
|
-
2e5: {
|
|
2600
|
-
input: 3 / 1e6,
|
|
2601
|
-
// $3 per 1M input tokens
|
|
2602
|
-
output: 15 / 1e6
|
|
2603
|
-
// $15 per 1M output tokens
|
|
2604
|
-
}
|
|
2605
|
-
},
|
|
2606
|
-
supportsVision: true,
|
|
2607
|
-
supportsTools: true,
|
|
2608
|
-
supportsImageVariation: false,
|
|
2609
|
-
logoFile: "Anthropic_logo.png",
|
|
2610
|
-
rank: 0,
|
|
2611
|
-
trainingCutoff: "2025-10-01",
|
|
2612
|
-
releaseDate: "2026-02-19",
|
|
2613
|
-
description: "Anthropic's newest Claude 4.6 Sonnet model. Delivers enhanced performance across coding, analysis, and complex reasoning tasks with improved speed and efficiency."
|
|
2614
|
-
},
|
|
2615
2588
|
{
|
|
2616
2589
|
id: ChatModels.CLAUDE_4_6_OPUS,
|
|
2617
2590
|
type: "text",
|
|
@@ -3097,25 +3070,8 @@ IMPORTANT! Only when someone asks, remember that you are specifically the ${mode
|
|
|
3097
3070
|
return;
|
|
3098
3071
|
}
|
|
3099
3072
|
} else {
|
|
3100
|
-
this.logger.info("[AnthropicBackend] Non-streaming request", {
|
|
3101
|
-
model,
|
|
3102
|
-
hasThinking: !!apiParams.thinking,
|
|
3103
|
-
thinkingBudget: apiParams.thinking?.budget_tokens,
|
|
3104
|
-
maxTokens: apiParams.max_tokens,
|
|
3105
|
-
temperature: apiParams.temperature,
|
|
3106
|
-
isThinkingEnabled: this.isThinkingEnabled
|
|
3107
|
-
});
|
|
3108
3073
|
const response = await this._api.messages.create(apiParams, { signal: options.abortSignal });
|
|
3109
3074
|
const streamedText = [];
|
|
3110
|
-
const contentTypes = "content" in response && Array.isArray(response.content) ? response.content.map((c) => c.type || (c.text ? "text" : "unknown")) : [];
|
|
3111
|
-
this.logger.info("[AnthropicBackend] Non-streaming response received", {
|
|
3112
|
-
model,
|
|
3113
|
-
stopReason: response.stop_reason,
|
|
3114
|
-
contentBlockCount: contentTypes.length,
|
|
3115
|
-
contentTypes: contentTypes.join(","),
|
|
3116
|
-
inputTokens: response.usage?.input_tokens,
|
|
3117
|
-
outputTokens: response.usage?.output_tokens
|
|
3118
|
-
});
|
|
3119
3075
|
if ("content" in response && Array.isArray(response.content)) {
|
|
3120
3076
|
if (this.isThinkingEnabled) {
|
|
3121
3077
|
this.lastAssistantContent = response.content;
|
|
@@ -3124,21 +3080,12 @@ IMPORTANT! Only when someone asks, remember that you are specifically the ${mode
|
|
|
3124
3080
|
const content = response.content[i];
|
|
3125
3081
|
if ("text" in content) {
|
|
3126
3082
|
streamedText.push(content.text);
|
|
3127
|
-
this.logger.debug("[AnthropicBackend] Text block extracted", {
|
|
3128
|
-
blockIndex: i,
|
|
3129
|
-
textLength: content.text.length
|
|
3130
|
-
});
|
|
3131
3083
|
} else if ("type" in content) {
|
|
3132
3084
|
if (content.type === "tool_use") {
|
|
3133
3085
|
func[i] ||= {};
|
|
3134
3086
|
func[i].name = content.name;
|
|
3135
3087
|
func[i].id = content.id;
|
|
3136
3088
|
func[i].parameters = JSON.stringify(content.input || {});
|
|
3137
|
-
} else if (content.type === "thinking") {
|
|
3138
|
-
this.logger.warn("[AnthropicBackend] Unexpected thinking block in response", {
|
|
3139
|
-
blockIndex: i,
|
|
3140
|
-
thinkingLength: content.thinking?.length || 0
|
|
3141
|
-
});
|
|
3142
3089
|
}
|
|
3143
3090
|
}
|
|
3144
3091
|
}
|
|
@@ -3766,7 +3713,6 @@ var TEMPERATURE_ONLY_MODELS2 = [
|
|
|
3766
3713
|
ChatModels.CLAUDE_4_5_SONNET_BEDROCK,
|
|
3767
3714
|
ChatModels.CLAUDE_4_5_HAIKU_BEDROCK,
|
|
3768
3715
|
ChatModels.CLAUDE_4_5_OPUS_BEDROCK,
|
|
3769
|
-
ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
|
|
3770
3716
|
ChatModels.CLAUDE_4_6_OPUS_BEDROCK
|
|
3771
3717
|
];
|
|
3772
3718
|
var AnthropicBedrockBackend = class extends BaseBedrockBackend {
|
|
@@ -4016,32 +3962,6 @@ var AnthropicBedrockBackend = class extends BaseBedrockBackend {
|
|
|
4016
3962
|
releaseDate: "2025-11-25",
|
|
4017
3963
|
description: "Claude 4.5 Opus via AWS Bedrock. Top-tier extended thinking model with excellent performance for complex reasoning, coding, and creative tasks."
|
|
4018
3964
|
},
|
|
4019
|
-
{
|
|
4020
|
-
id: ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
|
|
4021
|
-
type: "text",
|
|
4022
|
-
name: "Claude 4.6 Sonnet",
|
|
4023
|
-
backend: ModelBackend.Bedrock,
|
|
4024
|
-
contextWindow: 2e5,
|
|
4025
|
-
max_tokens: 16384,
|
|
4026
|
-
can_stream: true,
|
|
4027
|
-
can_think: true,
|
|
4028
|
-
pricing: {
|
|
4029
|
-
2e5: {
|
|
4030
|
-
input: 3 / 1e6,
|
|
4031
|
-
// $3 per 1M input tokens
|
|
4032
|
-
output: 15 / 1e6
|
|
4033
|
-
// $15 per 1M output tokens
|
|
4034
|
-
}
|
|
4035
|
-
},
|
|
4036
|
-
supportsVision: true,
|
|
4037
|
-
supportsTools: true,
|
|
4038
|
-
supportsImageVariation: false,
|
|
4039
|
-
logoFile: "Anthropic_logo.png",
|
|
4040
|
-
rank: 0,
|
|
4041
|
-
trainingCutoff: "2025-10-01",
|
|
4042
|
-
releaseDate: "2026-02-19",
|
|
4043
|
-
description: "Anthropic's newest Claude 4.6 Sonnet model via AWS Bedrock. Delivers enhanced performance across coding, analysis, and complex reasoning tasks with improved speed and efficiency."
|
|
4044
|
-
},
|
|
4045
3965
|
{
|
|
4046
3966
|
id: ChatModels.CLAUDE_4_6_OPUS_BEDROCK,
|
|
4047
3967
|
type: "text",
|
|
@@ -4158,6 +4078,8 @@ ${modelIdentity}` : modelIdentity;
|
|
|
4158
4078
|
topP: options.topP
|
|
4159
4079
|
}
|
|
4160
4080
|
}, null, 2)}`);
|
|
4081
|
+
const bodyStr = JSON.stringify(body);
|
|
4082
|
+
console.log(`[AnthropicBedrockBackend] Request body: ${bodyStr.substring(0, 1e3)}${bodyStr.length > 1e3 ? "..." : ""}`);
|
|
4161
4083
|
return {
|
|
4162
4084
|
modelId,
|
|
4163
4085
|
contentType: "application/json",
|
|
@@ -4215,30 +4137,7 @@ ${modelIdentity}` : modelIdentity;
|
|
|
4215
4137
|
translateChunk(model, chunk) {
|
|
4216
4138
|
try {
|
|
4217
4139
|
const response = chunk;
|
|
4218
|
-
const contentTypes = response.content.map((c) => c.type);
|
|
4219
|
-
const thinkingBlocks = response.content.filter((c) => c.type === "thinking");
|
|
4220
|
-
console.log(`[AnthropicBedrockBackend] Response received:`, {
|
|
4221
|
-
model,
|
|
4222
|
-
stopReason: response.stop_reason,
|
|
4223
|
-
contentBlockCount: response.content.length,
|
|
4224
|
-
contentTypes: contentTypes.join(","),
|
|
4225
|
-
hasThinkingBlocks: thinkingBlocks.length > 0,
|
|
4226
|
-
thinkingBlockCount: thinkingBlocks.length,
|
|
4227
|
-
inputTokens: response.usage?.input_tokens,
|
|
4228
|
-
outputTokens: response.usage?.output_tokens
|
|
4229
|
-
});
|
|
4230
|
-
if (thinkingBlocks.length > 0) {
|
|
4231
|
-
console.warn(`[AnthropicBedrockBackend] Unexpected thinking blocks in response`, {
|
|
4232
|
-
thinkingBlockCount: thinkingBlocks.length,
|
|
4233
|
-
thinkingLengths: thinkingBlocks.map((b) => b.thinking?.length || 0)
|
|
4234
|
-
});
|
|
4235
|
-
}
|
|
4236
4140
|
const textContent = response.content.filter((item) => item.type === "text").map((item) => item.text || "").join("");
|
|
4237
|
-
console.log(`[AnthropicBedrockBackend] Text extracted:`, {
|
|
4238
|
-
textLength: textContent.length,
|
|
4239
|
-
textPreview: textContent.substring(0, 200),
|
|
4240
|
-
endsWithCloseBrace: textContent.trim().endsWith("}")
|
|
4241
|
-
});
|
|
4242
4141
|
const toolUseBlocks = response.content.filter((item) => item.type === "tool_use");
|
|
4243
4142
|
let choice;
|
|
4244
4143
|
if (toolUseBlocks.length > 0) {
|
|
@@ -7760,7 +7659,6 @@ function getLlmByModel(apiKeyTable, options) {
|
|
|
7760
7659
|
case ChatModels.CLAUDE_4_5_SONNET_BEDROCK:
|
|
7761
7660
|
case ChatModels.CLAUDE_4_5_HAIKU_BEDROCK:
|
|
7762
7661
|
case ChatModels.CLAUDE_4_5_OPUS_BEDROCK:
|
|
7763
|
-
case ChatModels.CLAUDE_4_6_SONNET_BEDROCK:
|
|
7764
7662
|
case ChatModels.CLAUDE_4_6_OPUS_BEDROCK:
|
|
7765
7663
|
return new AnthropicBedrockBackend();
|
|
7766
7664
|
case ChatModels.LLAMA3_INSTRUCT_8B_V1:
|
|
@@ -11859,16 +11757,9 @@ function findAutomaticFallback(originalModel, availableModels, apiKeyTable, logg
|
|
|
11859
11757
|
"gemini-2.5-flash-preview-05-20": ["claude-3-5-haiku-20241022", "gpt-4o-mini", "claude-3-haiku-20240307"],
|
|
11860
11758
|
"gemini-1.5-pro": ["claude-3-5-sonnet-20241022", "gpt-4o", "claude-3-opus-20240229"],
|
|
11861
11759
|
"gemini-1.5-flash": ["claude-3-5-haiku-20241022", "gpt-4o-mini", "claude-3-haiku-20240307"],
|
|
11862
|
-
// Claude 4.5/4.6 models fallback
|
|
11863
|
-
"claude-opus-4-5-20251101": [
|
|
11864
|
-
|
|
11865
|
-
"claude-sonnet-4-5-20250929",
|
|
11866
|
-
"gpt-5",
|
|
11867
|
-
"claude-haiku-4-5-20251001"
|
|
11868
|
-
],
|
|
11869
|
-
"claude-opus-4-6": ["claude-sonnet-4-6", "claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001"],
|
|
11870
|
-
"claude-sonnet-4-6": ["claude-sonnet-4-5-20250929", "claude-opus-4-5-20251101", "gpt-5"],
|
|
11871
|
-
"claude-sonnet-4-5-20250929": ["claude-sonnet-4-6", "claude-haiku-4-5-20251001", "gpt-5"],
|
|
11760
|
+
// Claude 4.5/4.6 Opus models fallback to Sonnet 4.5
|
|
11761
|
+
"claude-opus-4-5-20251101": ["claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001"],
|
|
11762
|
+
"claude-opus-4-6": ["claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001"],
|
|
11872
11763
|
// Claude models fallback to other Claude models or GPT
|
|
11873
11764
|
"claude-3-5-sonnet-20241022": ["claude-3-opus-20240229", "gpt-4o", "claude-3-sonnet-20240229"],
|
|
11874
11765
|
"claude-3-opus-20240229": ["claude-3-5-sonnet-20241022", "gpt-4o", "claude-3-sonnet-20240229"],
|
|
@@ -11878,7 +11769,7 @@ function findAutomaticFallback(originalModel, availableModels, apiKeyTable, logg
|
|
|
11878
11769
|
};
|
|
11879
11770
|
const preferences = fallbackPreferences[originalModel.id] || [];
|
|
11880
11771
|
if (preferences.length === 0) {
|
|
11881
|
-
preferences.push("claude-sonnet-4-
|
|
11772
|
+
preferences.push("claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001");
|
|
11882
11773
|
}
|
|
11883
11774
|
for (const modelId of preferences) {
|
|
11884
11775
|
const fallbackModel = availableModels.find((m) => m.id === modelId);
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3SPW5FYJ.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NI22LIK3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3SPW5FYJ.js";
|
|
6
6
|
import {
|
|
7
7
|
CompletionApiUsageTransaction,
|
|
8
8
|
GenericCreditDeductTransaction,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TextGenerationUsageTransaction,
|
|
13
13
|
TransferCreditTransaction,
|
|
14
14
|
VideoGenerationUsageTransaction
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NI22LIK3.js";
|
|
16
16
|
|
|
17
17
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
18
18
|
import { z } from "zod";
|
|
@@ -337,7 +337,8 @@ var CliConfigSchema = z.object({
|
|
|
337
337
|
disabled: z.array(z.string()),
|
|
338
338
|
config: z.record(z.string(), z.any())
|
|
339
339
|
}),
|
|
340
|
-
trustedTools: z.array(z.string()).optional().prefault([])
|
|
340
|
+
trustedTools: z.array(z.string()).optional().prefault([]),
|
|
341
|
+
additionalDirectories: z.array(z.string()).optional().prefault([])
|
|
341
342
|
});
|
|
342
343
|
var ProjectConfigSchema = z.object({
|
|
343
344
|
tools: z.object({
|
|
@@ -355,7 +356,8 @@ var ProjectConfigSchema = z.object({
|
|
|
355
356
|
theme: z.enum(["light", "dark"]).optional(),
|
|
356
357
|
exportFormat: z.enum(["markdown", "json"]).optional(),
|
|
357
358
|
enableSkillTool: z.boolean().optional()
|
|
358
|
-
}).optional()
|
|
359
|
+
}).optional(),
|
|
360
|
+
additionalDirectories: z.array(z.string()).optional()
|
|
359
361
|
});
|
|
360
362
|
var ProjectLocalConfigSchema = z.object({
|
|
361
363
|
trustedTools: z.array(z.string()).optional(),
|
|
@@ -399,8 +401,10 @@ var DEFAULT_CONFIG = {
|
|
|
399
401
|
// Web-only tools
|
|
400
402
|
config: {}
|
|
401
403
|
},
|
|
402
|
-
trustedTools: []
|
|
404
|
+
trustedTools: [],
|
|
403
405
|
// No tools trusted by default
|
|
406
|
+
additionalDirectories: []
|
|
407
|
+
// No additional directories by default
|
|
404
408
|
};
|
|
405
409
|
function findProjectConfigDir(startDir = process.cwd()) {
|
|
406
410
|
let currentDir = startDir;
|
|
@@ -926,6 +930,53 @@ ${entryToAdd}
|
|
|
926
930
|
}
|
|
927
931
|
return loadProjectLocalConfig(this.projectConfigDir);
|
|
928
932
|
}
|
|
933
|
+
/**
|
|
934
|
+
* Add a directory to the allowed directories list
|
|
935
|
+
* Persists to global config
|
|
936
|
+
*/
|
|
937
|
+
async addDirectory(dirPath) {
|
|
938
|
+
const config = await this.load();
|
|
939
|
+
if (!config.additionalDirectories) {
|
|
940
|
+
config.additionalDirectories = [];
|
|
941
|
+
}
|
|
942
|
+
const resolvedPath = path2.resolve(dirPath);
|
|
943
|
+
if (!config.additionalDirectories.includes(resolvedPath)) {
|
|
944
|
+
config.additionalDirectories.push(resolvedPath);
|
|
945
|
+
await this.save(config);
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Remove a directory from the allowed directories list
|
|
950
|
+
*/
|
|
951
|
+
async removeDirectory(dirPath) {
|
|
952
|
+
const config = await this.load();
|
|
953
|
+
if (config.additionalDirectories) {
|
|
954
|
+
const resolvedPath = path2.resolve(dirPath);
|
|
955
|
+
config.additionalDirectories = config.additionalDirectories.filter((d) => path2.resolve(d) !== resolvedPath);
|
|
956
|
+
await this.save(config);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Get all additional directories (merged from global + project configs)
|
|
961
|
+
* Returns resolved absolute paths
|
|
962
|
+
*/
|
|
963
|
+
async getAdditionalDirectories() {
|
|
964
|
+
const config = await this.load();
|
|
965
|
+
const dirs = /* @__PURE__ */ new Set();
|
|
966
|
+
if (config.additionalDirectories) {
|
|
967
|
+
for (const dir of config.additionalDirectories) {
|
|
968
|
+
dirs.add(path2.resolve(dir));
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
const projectConfig = await this.loadRawProjectConfig();
|
|
972
|
+
if (projectConfig?.additionalDirectories) {
|
|
973
|
+
const projectRoot = this.projectConfigDir || process.cwd();
|
|
974
|
+
for (const dir of projectConfig.additionalDirectories) {
|
|
975
|
+
dirs.add(path2.resolve(projectRoot, dir));
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
return Array.from(dirs);
|
|
979
|
+
}
|
|
929
980
|
};
|
|
930
981
|
|
|
931
982
|
export {
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3SPW5FYJ.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NI22LIK3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -133,7 +133,6 @@ var ChatModels;
|
|
|
133
133
|
ChatModels2["CLAUDE_4_5_SONNET_BEDROCK"] = "us.anthropic.claude-sonnet-4-5-20250929-v1:0";
|
|
134
134
|
ChatModels2["CLAUDE_4_5_HAIKU_BEDROCK"] = "us.anthropic.claude-haiku-4-5-20251001-v1:0";
|
|
135
135
|
ChatModels2["CLAUDE_4_5_OPUS_BEDROCK"] = "global.anthropic.claude-opus-4-5-20251101-v1:0";
|
|
136
|
-
ChatModels2["CLAUDE_4_6_SONNET_BEDROCK"] = "anthropic.claude-sonnet-4-6";
|
|
137
136
|
ChatModels2["CLAUDE_4_6_OPUS_BEDROCK"] = "global.anthropic.claude-opus-4-6-v1";
|
|
138
137
|
ChatModels2["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
139
138
|
ChatModels2["CLAUDE_3_5_HAIKU_ANTHROPIC"] = "claude-3-5-haiku-20241022";
|
|
@@ -145,7 +144,6 @@ var ChatModels;
|
|
|
145
144
|
ChatModels2["CLAUDE_4_5_SONNET"] = "claude-sonnet-4-5-20250929";
|
|
146
145
|
ChatModels2["CLAUDE_4_5_HAIKU"] = "claude-haiku-4-5-20251001";
|
|
147
146
|
ChatModels2["CLAUDE_4_5_OPUS"] = "claude-opus-4-5-20251101";
|
|
148
|
-
ChatModels2["CLAUDE_4_6_SONNET"] = "claude-sonnet-4-6";
|
|
149
147
|
ChatModels2["CLAUDE_4_6_OPUS"] = "claude-opus-4-6";
|
|
150
148
|
ChatModels2["JURASSIC2_ULTRA"] = "ai21.j2-ultra-v1";
|
|
151
149
|
ChatModels2["JURASSIC2_MID"] = "ai21.j2-mid-v1";
|
|
@@ -483,15 +481,6 @@ var LatticeArtifactSchema = ArtifactSchema.extend({
|
|
|
483
481
|
lastComputedAt: z6.date().optional()
|
|
484
482
|
})
|
|
485
483
|
});
|
|
486
|
-
var PythonArtifactSchema = ArtifactSchema.extend({
|
|
487
|
-
type: z6.literal("python"),
|
|
488
|
-
metadata: ArtifactMetadataSchema.extend({
|
|
489
|
-
packages: z6.array(z6.string()).default([]),
|
|
490
|
-
hasOutput: z6.boolean().default(false),
|
|
491
|
-
executionState: z6.enum(["idle", "running", "completed", "error"]).optional(),
|
|
492
|
-
lastExecutionTime: z6.number().optional()
|
|
493
|
-
})
|
|
494
|
-
});
|
|
495
484
|
var MermaidChartMetadataSchema = z6.object({
|
|
496
485
|
chartType: z6.enum([
|
|
497
486
|
"flowchart",
|
|
@@ -526,8 +515,7 @@ var ClaudeArtifactMimeTypes = {
|
|
|
526
515
|
RECHARTS: "application/vnd.ant.recharts",
|
|
527
516
|
CODE: "application/vnd.ant.code",
|
|
528
517
|
MARKDOWN: "text/markdown",
|
|
529
|
-
LATTICE: "application/vnd.b4m.lattice"
|
|
530
|
-
PYTHON: "application/vnd.ant.python"
|
|
518
|
+
LATTICE: "application/vnd.b4m.lattice"
|
|
531
519
|
};
|
|
532
520
|
|
|
533
521
|
// ../../b4m-core/packages/common/dist/src/types/entities/AppFileTypes.js
|
|
@@ -1471,12 +1459,7 @@ var StreamedChatCompletionAction = z10.object({
|
|
|
1471
1459
|
endTime: z10.number().optional()
|
|
1472
1460
|
}).optional(),
|
|
1473
1461
|
// Add fallback info to support backend fallback mechanism
|
|
1474
|
-
fallbackInfo: FallbackInfoSchema.optional()
|
|
1475
|
-
// UI side-effects dispatched on the client when streaming completes
|
|
1476
|
-
uiSideEffects: z10.array(z10.object({
|
|
1477
|
-
type: z10.string(),
|
|
1478
|
-
payload: z10.unknown()
|
|
1479
|
-
})).optional()
|
|
1462
|
+
fallbackInfo: FallbackInfoSchema.optional()
|
|
1480
1463
|
}).partial().nullable()
|
|
1481
1464
|
});
|
|
1482
1465
|
var StreamedRapidReplyAction = z10.object({
|
|
@@ -2845,12 +2828,7 @@ var LT = LIVEOPS_TRIAGE_VALIDATION_LIMITS;
|
|
|
2845
2828
|
var LiveopsTriageConfigSchema = z21.object({
|
|
2846
2829
|
// General settings
|
|
2847
2830
|
enabled: z21.boolean().default(false),
|
|
2848
|
-
slackWorkspaceId: z21.string().optional(),
|
|
2849
|
-
// MongoDB ObjectId of the Slack workspace to use
|
|
2850
2831
|
slackChannelId: z21.string(),
|
|
2851
|
-
// Source channel - where errors are read from
|
|
2852
|
-
slackOutputChannelId: z21.string().optional(),
|
|
2853
|
-
// Output channel - where summaries are posted (defaults to slackChannelId if not set)
|
|
2854
2832
|
githubOwner: z21.string(),
|
|
2855
2833
|
githubRepo: z21.string(),
|
|
2856
2834
|
// Model configuration
|
|
@@ -9129,16 +9107,6 @@ var MermaidArtifactV2Schema = BaseArtifactSchema.extend({
|
|
|
9129
9107
|
description: z28.string().optional()
|
|
9130
9108
|
})
|
|
9131
9109
|
});
|
|
9132
|
-
var PythonArtifactV2Schema = BaseArtifactSchema.extend({
|
|
9133
|
-
type: z28.literal("python"),
|
|
9134
|
-
content: z28.string(),
|
|
9135
|
-
metadata: EnhancedArtifactMetadataSchema.extend({
|
|
9136
|
-
packages: z28.array(z28.string()).default([]),
|
|
9137
|
-
hasOutput: z28.boolean().default(false),
|
|
9138
|
-
executionState: z28.enum(["idle", "running", "completed", "error"]).optional(),
|
|
9139
|
-
lastExecutionTime: z28.number().optional()
|
|
9140
|
-
})
|
|
9141
|
-
});
|
|
9142
9110
|
var ArtifactStatuses;
|
|
9143
9111
|
(function(ArtifactStatuses2) {
|
|
9144
9112
|
ArtifactStatuses2["DRAFT"] = "draft";
|
|
@@ -9162,9 +9130,6 @@ var validateSvgArtifactV2 = (data) => {
|
|
|
9162
9130
|
var validateMermaidArtifactV2 = (data) => {
|
|
9163
9131
|
return MermaidArtifactV2Schema.parse(data);
|
|
9164
9132
|
};
|
|
9165
|
-
var validatePythonArtifactV2 = (data) => {
|
|
9166
|
-
return PythonArtifactV2Schema.parse(data);
|
|
9167
|
-
};
|
|
9168
9133
|
|
|
9169
9134
|
// ../../b4m-core/packages/common/dist/src/schemas/questmaster.js
|
|
9170
9135
|
import { z as z29 } from "zod";
|
|
@@ -10207,7 +10172,6 @@ export {
|
|
|
10207
10172
|
MermaidArtifactSchema,
|
|
10208
10173
|
RechartsArtifactSchema,
|
|
10209
10174
|
LatticeArtifactSchema,
|
|
10210
|
-
PythonArtifactSchema,
|
|
10211
10175
|
MermaidChartMetadataSchema,
|
|
10212
10176
|
ChatHistoryItemWithArtifactsSchema,
|
|
10213
10177
|
ArtifactOperationSchema,
|
|
@@ -10556,14 +10520,12 @@ export {
|
|
|
10556
10520
|
HtmlArtifactV2Schema,
|
|
10557
10521
|
SvgArtifactV2Schema,
|
|
10558
10522
|
MermaidArtifactV2Schema,
|
|
10559
|
-
PythonArtifactV2Schema,
|
|
10560
10523
|
ArtifactStatuses,
|
|
10561
10524
|
validateBaseArtifact,
|
|
10562
10525
|
validateReactArtifactV2,
|
|
10563
10526
|
validateHtmlArtifactV2,
|
|
10564
10527
|
validateSvgArtifactV2,
|
|
10565
10528
|
validateMermaidArtifactV2,
|
|
10566
|
-
validatePythonArtifactV2,
|
|
10567
10529
|
QuestStatusSchema,
|
|
10568
10530
|
QuestSchema,
|
|
10569
10531
|
QuestResourceSchema,
|
|
@@ -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-ERV5G6MX.js";
|
|
6
|
+
import "./chunk-3SPW5FYJ.js";
|
|
7
|
+
import "./chunk-NI22LIK3.js";
|
|
8
8
|
import "./chunk-PFBYGCOW.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|