@bike4mind/cli 0.2.30-feat-universal-prompt-caching.19181 → 0.2.30-feat-cli-scrollable-command-autocomplete.19203
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-FPTQA6QK.js → artifactExtractor-SVFEWL53.js} +1 -1
- package/dist/{chunk-7FGWZUYS.js → chunk-5HA4JEOV.js} +26 -404
- package/dist/{chunk-RHR4QRAI.js → chunk-65DLNQY2.js} +2 -2
- package/dist/{chunk-ZFFJO4JD.js → chunk-B7Z2QQMD.js} +2 -2
- package/dist/{chunk-Q64OUQDG.js → chunk-BYLWQZ5S.js} +2 -2
- package/dist/{chunk-LQRI6AKT.js → chunk-C3K7SH2V.js} +15 -0
- package/dist/{create-EB4BK7CX.js → create-IDGWY5LO.js} +3 -3
- package/dist/index.js +30 -16
- package/dist/{llmMarkdownGenerator-L4FJDAYW.js → llmMarkdownGenerator-BILRFSX6.js} +1 -1
- package/dist/{markdownGenerator-TWB6RRAR.js → markdownGenerator-AI3EZ4Z3.js} +1 -1
- package/dist/{mementoService-ICKCCKSL.js → mementoService-34S5SRX4.js} +3 -3
- package/dist/{src-7CHMPY4J.js → src-MDS22ESD.js} +2 -2
- package/dist/{src-3EWLI2XV.js → src-QX72HMCT.js} +3 -1
- package/dist/{subtractCredits-G6ZJLDCV.js → subtractCredits-6CK3FPNG.js} +3 -3
- package/package.json +9 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C3K7SH2V.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;
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ModelBackend,
|
|
8
8
|
OpenAIEmbeddingModel,
|
|
9
9
|
PermissionDeniedError,
|
|
10
|
+
REASONING_SUPPORTED_MODELS,
|
|
10
11
|
SpeechToTextModels,
|
|
11
12
|
SupportedFabFileMimeTypes,
|
|
12
13
|
VIDEO_SIZE_CONSTRAINTS,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
dayjsConfig_default,
|
|
16
17
|
extractSnippetMeta,
|
|
17
18
|
settingsMap
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-C3K7SH2V.js";
|
|
19
20
|
import {
|
|
20
21
|
Logger
|
|
21
22
|
} from "./chunk-OCYRD7D6.js";
|
|
@@ -2086,212 +2087,6 @@ function getLastBuildDebugInfo() {
|
|
|
2086
2087
|
return buildAndSortMessages.lastDebugInfo?.messageTruncation || null;
|
|
2087
2088
|
}
|
|
2088
2089
|
|
|
2089
|
-
// ../../b4m-core/packages/utils/dist/src/llm/caching/adapters/anthropic.js
|
|
2090
|
-
var AnthropicCachingAdapter = class {
|
|
2091
|
-
applyCaching(apiParams, strategy) {
|
|
2092
|
-
if (!strategy.enableCaching)
|
|
2093
|
-
return apiParams;
|
|
2094
|
-
const ttl = strategy.cacheTTL ?? "5m";
|
|
2095
|
-
const modifiedParams = { ...apiParams };
|
|
2096
|
-
if (strategy.cacheTools && modifiedParams.tools?.length > 0) {
|
|
2097
|
-
const tools = [...modifiedParams.tools];
|
|
2098
|
-
const lastTool = tools[tools.length - 1];
|
|
2099
|
-
tools[tools.length - 1] = {
|
|
2100
|
-
...lastTool,
|
|
2101
|
-
cache_control: { type: "ephemeral", ...ttl === "1h" ? { ttl } : {} }
|
|
2102
|
-
};
|
|
2103
|
-
modifiedParams.tools = tools;
|
|
2104
|
-
}
|
|
2105
|
-
if (strategy.cacheSystemPrompt && modifiedParams.system?.length > 0) {
|
|
2106
|
-
const system = Array.isArray(modifiedParams.system) ? [...modifiedParams.system] : [{ type: "text", text: modifiedParams.system }];
|
|
2107
|
-
const lastBlock = system[system.length - 1];
|
|
2108
|
-
system[system.length - 1] = {
|
|
2109
|
-
...lastBlock,
|
|
2110
|
-
cache_control: { type: "ephemeral", ...ttl === "1h" ? { ttl } : {} }
|
|
2111
|
-
};
|
|
2112
|
-
modifiedParams.system = system;
|
|
2113
|
-
}
|
|
2114
|
-
if (strategy.cacheConversationHistory && modifiedParams.messages?.length > 0) {
|
|
2115
|
-
const messages = [...modifiedParams.messages];
|
|
2116
|
-
const lastMsg = messages[messages.length - 1];
|
|
2117
|
-
let content = lastMsg.content;
|
|
2118
|
-
if (typeof content === "string") {
|
|
2119
|
-
content = [{ type: "text", text: content }];
|
|
2120
|
-
} else if (!Array.isArray(content)) {
|
|
2121
|
-
return modifiedParams;
|
|
2122
|
-
}
|
|
2123
|
-
const contentArr = [...content];
|
|
2124
|
-
const lastBlock = contentArr[contentArr.length - 1];
|
|
2125
|
-
contentArr[contentArr.length - 1] = {
|
|
2126
|
-
...lastBlock,
|
|
2127
|
-
cache_control: { type: "ephemeral", ...ttl === "1h" ? { ttl } : {} }
|
|
2128
|
-
};
|
|
2129
|
-
messages[messages.length - 1] = {
|
|
2130
|
-
...lastMsg,
|
|
2131
|
-
content: contentArr
|
|
2132
|
-
};
|
|
2133
|
-
modifiedParams.messages = messages;
|
|
2134
|
-
}
|
|
2135
|
-
return modifiedParams;
|
|
2136
|
-
}
|
|
2137
|
-
extractCacheStats(response, model) {
|
|
2138
|
-
const usage = response.usage;
|
|
2139
|
-
if (!usage)
|
|
2140
|
-
return void 0;
|
|
2141
|
-
const cacheReadTokens = usage.cache_read_input_tokens || 0;
|
|
2142
|
-
const cacheWriteTokens = usage.cache_creation_input_tokens || 0;
|
|
2143
|
-
const uncachedTokens = usage.input_tokens || 0;
|
|
2144
|
-
const totalInputTokens = cacheReadTokens + cacheWriteTokens + uncachedTokens;
|
|
2145
|
-
const cacheHitRate = totalInputTokens > 0 ? cacheReadTokens / totalInputTokens * 100 : 0;
|
|
2146
|
-
const costSavingsPercent = cacheHitRate * 0.9;
|
|
2147
|
-
const estimatedLatencyReduction = cacheHitRate * 0.85;
|
|
2148
|
-
return {
|
|
2149
|
-
provider: ModelBackend.Anthropic,
|
|
2150
|
-
model,
|
|
2151
|
-
totalInputTokens,
|
|
2152
|
-
cacheReadTokens,
|
|
2153
|
-
cacheWriteTokens,
|
|
2154
|
-
uncachedTokens,
|
|
2155
|
-
cacheHitRate,
|
|
2156
|
-
costSavingsPercent,
|
|
2157
|
-
estimatedLatencyReduction,
|
|
2158
|
-
providerMetadata: {
|
|
2159
|
-
ttl: usage.cache_creation_input_tokens ? usage.cache_creation_input_tokens > 0 ? "5m" : "1h" : void 0
|
|
2160
|
-
}
|
|
2161
|
-
};
|
|
2162
|
-
}
|
|
2163
|
-
};
|
|
2164
|
-
|
|
2165
|
-
// ../../b4m-core/packages/utils/dist/src/llm/caching/adapters/openai.js
|
|
2166
|
-
var OpenAICachingAdapter = class {
|
|
2167
|
-
applyCaching(apiParams, strategy) {
|
|
2168
|
-
return apiParams;
|
|
2169
|
-
}
|
|
2170
|
-
extractCacheStats(response, model) {
|
|
2171
|
-
const usage = response.usage;
|
|
2172
|
-
if (!usage)
|
|
2173
|
-
return void 0;
|
|
2174
|
-
const totalInputTokens = usage.prompt_tokens || 0;
|
|
2175
|
-
const cachedTokens = usage.prompt_tokens_details?.cached_tokens || 0;
|
|
2176
|
-
const cacheHitRate = totalInputTokens > 0 ? cachedTokens / totalInputTokens * 100 : 0;
|
|
2177
|
-
const costSavingsPercent = cacheHitRate * 0.9;
|
|
2178
|
-
const estimatedLatencyReduction = cacheHitRate * 0.8;
|
|
2179
|
-
return {
|
|
2180
|
-
provider: ModelBackend.OpenAI,
|
|
2181
|
-
model,
|
|
2182
|
-
totalInputTokens,
|
|
2183
|
-
cacheReadTokens: cachedTokens,
|
|
2184
|
-
cacheWriteTokens: 0,
|
|
2185
|
-
// OpenAI doesn't expose this
|
|
2186
|
-
uncachedTokens: totalInputTokens - cachedTokens,
|
|
2187
|
-
cacheHitRate,
|
|
2188
|
-
costSavingsPercent,
|
|
2189
|
-
estimatedLatencyReduction,
|
|
2190
|
-
providerMetadata: {
|
|
2191
|
-
automatic: true
|
|
2192
|
-
}
|
|
2193
|
-
};
|
|
2194
|
-
}
|
|
2195
|
-
};
|
|
2196
|
-
|
|
2197
|
-
// ../../b4m-core/packages/utils/dist/src/llm/caching/adapters/gemini.js
|
|
2198
|
-
var GeminiCachingAdapter = class {
|
|
2199
|
-
applyCaching(apiParams, strategy) {
|
|
2200
|
-
return apiParams;
|
|
2201
|
-
}
|
|
2202
|
-
extractCacheStats(response, model) {
|
|
2203
|
-
const usage = response.usageMetadata;
|
|
2204
|
-
if (!usage)
|
|
2205
|
-
return void 0;
|
|
2206
|
-
const totalInputTokens = usage.promptTokenCount || 0;
|
|
2207
|
-
const cachedTokens = usage.cachedContentTokenCount || 0;
|
|
2208
|
-
const cacheHitRate = totalInputTokens > 0 ? cachedTokens / totalInputTokens * 100 : 0;
|
|
2209
|
-
const savingsMultiplier = model.includes("2.5") ? 0.9 : 0.75;
|
|
2210
|
-
const costSavingsPercent = cacheHitRate * savingsMultiplier;
|
|
2211
|
-
const estimatedLatencyReduction = cacheHitRate * 0.75;
|
|
2212
|
-
return {
|
|
2213
|
-
provider: ModelBackend.Gemini,
|
|
2214
|
-
model,
|
|
2215
|
-
totalInputTokens,
|
|
2216
|
-
cacheReadTokens: cachedTokens,
|
|
2217
|
-
cacheWriteTokens: 0,
|
|
2218
|
-
// Not exposed
|
|
2219
|
-
uncachedTokens: totalInputTokens - cachedTokens,
|
|
2220
|
-
cacheHitRate,
|
|
2221
|
-
costSavingsPercent,
|
|
2222
|
-
estimatedLatencyReduction,
|
|
2223
|
-
providerMetadata: {
|
|
2224
|
-
implicit: true
|
|
2225
|
-
}
|
|
2226
|
-
};
|
|
2227
|
-
}
|
|
2228
|
-
};
|
|
2229
|
-
|
|
2230
|
-
// ../../b4m-core/packages/utils/dist/src/llm/caching/adapters/xai.js
|
|
2231
|
-
var XAICachingAdapter = class {
|
|
2232
|
-
applyCaching(apiParams, strategy) {
|
|
2233
|
-
return apiParams;
|
|
2234
|
-
}
|
|
2235
|
-
getHeaders(strategy) {
|
|
2236
|
-
const headers = {};
|
|
2237
|
-
if (strategy.conversationId) {
|
|
2238
|
-
headers["x-grok-conv-id"] = strategy.conversationId;
|
|
2239
|
-
}
|
|
2240
|
-
return headers;
|
|
2241
|
-
}
|
|
2242
|
-
extractCacheStats(response, model) {
|
|
2243
|
-
const usage = response.usage;
|
|
2244
|
-
if (!usage)
|
|
2245
|
-
return void 0;
|
|
2246
|
-
const totalInputTokens = usage.prompt_tokens || 0;
|
|
2247
|
-
const cachedTokens = usage.cached_prompt_tokens || 0;
|
|
2248
|
-
const cacheHitRate = totalInputTokens > 0 ? cachedTokens / totalInputTokens * 100 : 0;
|
|
2249
|
-
const costSavingsPercent = cacheHitRate * 0.65;
|
|
2250
|
-
const estimatedLatencyReduction = cacheHitRate * 0.7;
|
|
2251
|
-
return {
|
|
2252
|
-
provider: ModelBackend.XAI,
|
|
2253
|
-
model,
|
|
2254
|
-
totalInputTokens,
|
|
2255
|
-
cacheReadTokens: cachedTokens,
|
|
2256
|
-
cacheWriteTokens: 0,
|
|
2257
|
-
// Not exposed
|
|
2258
|
-
uncachedTokens: totalInputTokens - cachedTokens,
|
|
2259
|
-
cacheHitRate,
|
|
2260
|
-
costSavingsPercent,
|
|
2261
|
-
estimatedLatencyReduction,
|
|
2262
|
-
providerMetadata: {
|
|
2263
|
-
automatic: true,
|
|
2264
|
-
conversationId: usage.x_grok_conv_id
|
|
2265
|
-
}
|
|
2266
|
-
};
|
|
2267
|
-
}
|
|
2268
|
-
};
|
|
2269
|
-
|
|
2270
|
-
// ../../b4m-core/packages/utils/dist/src/llm/caching/adapters/index.js
|
|
2271
|
-
var NoOpCachingAdapter = class {
|
|
2272
|
-
applyCaching(apiParams) {
|
|
2273
|
-
return apiParams;
|
|
2274
|
-
}
|
|
2275
|
-
extractCacheStats() {
|
|
2276
|
-
return void 0;
|
|
2277
|
-
}
|
|
2278
|
-
};
|
|
2279
|
-
var ADAPTERS = {
|
|
2280
|
-
[ModelBackend.Anthropic]: new AnthropicCachingAdapter(),
|
|
2281
|
-
[ModelBackend.OpenAI]: new OpenAICachingAdapter(),
|
|
2282
|
-
[ModelBackend.Gemini]: new GeminiCachingAdapter(),
|
|
2283
|
-
[ModelBackend.Bedrock]: new AnthropicCachingAdapter(),
|
|
2284
|
-
// Uses Anthropic format
|
|
2285
|
-
[ModelBackend.XAI]: new XAICachingAdapter(),
|
|
2286
|
-
[ModelBackend.Ollama]: new NoOpCachingAdapter(),
|
|
2287
|
-
[ModelBackend.BFL]: new NoOpCachingAdapter(),
|
|
2288
|
-
[ModelBackend.VoyageAI]: new NoOpCachingAdapter(),
|
|
2289
|
-
[ModelBackend.AWS]: new NoOpCachingAdapter()
|
|
2290
|
-
};
|
|
2291
|
-
function getCachingAdapter(backend) {
|
|
2292
|
-
return ADAPTERS[backend] || new NoOpCachingAdapter();
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
2090
|
// ../../b4m-core/packages/utils/dist/src/llm/anthropicBackend.js
|
|
2296
2091
|
var TEMPERATURE_ONLY_MODELS = [
|
|
2297
2092
|
ChatModels.CLAUDE_4_5_SONNET,
|
|
@@ -2791,19 +2586,6 @@ var AnthropicBackend = class {
|
|
|
2791
2586
|
this.isThinkingEnabled = true;
|
|
2792
2587
|
this.logger.debug(`[AnthropicBackend] QuestMaster enabled thinking with budget: ${thinkingBudget}, max_tokens: ${apiParams.max_tokens}, temperature: ${apiParams.temperature}, top_p: ${apiParams.top_p}`);
|
|
2793
2588
|
}
|
|
2794
|
-
const cacheStrategy = options.cacheStrategy;
|
|
2795
|
-
if (cacheStrategy?.enableCaching) {
|
|
2796
|
-
const adapter = getCachingAdapter(ModelBackend.Anthropic);
|
|
2797
|
-
const cachedParams = adapter.applyCaching(apiParams, cacheStrategy);
|
|
2798
|
-
Object.assign(apiParams, cachedParams);
|
|
2799
|
-
this.logger.info("[PromptCache] Caching enabled for Anthropic request", {
|
|
2800
|
-
model,
|
|
2801
|
-
cacheSystemPrompt: cacheStrategy.cacheSystemPrompt,
|
|
2802
|
-
cacheTools: cacheStrategy.cacheTools,
|
|
2803
|
-
cacheConversationHistory: cacheStrategy.cacheConversationHistory,
|
|
2804
|
-
cacheTTL: cacheStrategy.cacheTTL
|
|
2805
|
-
});
|
|
2806
|
-
}
|
|
2807
2589
|
try {
|
|
2808
2590
|
const func = [];
|
|
2809
2591
|
if (options.stream) {
|
|
@@ -2849,7 +2631,6 @@ var AnthropicBackend = class {
|
|
|
2849
2631
|
clearTimeout(requestTimeout);
|
|
2850
2632
|
let isInThinkingBlock = false;
|
|
2851
2633
|
const collectedContent = [];
|
|
2852
|
-
let usageInfo = void 0;
|
|
2853
2634
|
const enableIdleTimeout = options._internal?.enableIdleTimeout ?? false;
|
|
2854
2635
|
const configuredIdleTimeoutMs = options._internal?.idleTimeoutMs;
|
|
2855
2636
|
const idleTimeoutMs = this.isThinkingEnabled ? THINKING_IDLE_TIMEOUT_MS : configuredIdleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
|
|
@@ -2951,10 +2732,6 @@ var AnthropicBackend = class {
|
|
|
2951
2732
|
func[0].name = toolEvent.name;
|
|
2952
2733
|
func[0].parameters = JSON.stringify(toolEvent.input);
|
|
2953
2734
|
func[0].id = toolEvent.id;
|
|
2954
|
-
} else if (event.type === "message_delta") {
|
|
2955
|
-
if ("usage" in event) {
|
|
2956
|
-
usageInfo = event.usage;
|
|
2957
|
-
}
|
|
2958
2735
|
}
|
|
2959
2736
|
}
|
|
2960
2737
|
} finally {
|
|
@@ -2964,21 +2741,6 @@ var AnthropicBackend = class {
|
|
|
2964
2741
|
if (this.isThinkingEnabled && collectedContent.length > 0) {
|
|
2965
2742
|
this.lastAssistantContent = collectedContent.filter((c) => c != null);
|
|
2966
2743
|
}
|
|
2967
|
-
let cacheStats;
|
|
2968
|
-
if (cacheStrategy?.enableCaching && usageInfo) {
|
|
2969
|
-
const adapter = getCachingAdapter(ModelBackend.Anthropic);
|
|
2970
|
-
cacheStats = adapter.extractCacheStats({ usage: usageInfo }, model);
|
|
2971
|
-
if (cacheStats) {
|
|
2972
|
-
this.logger.info("[PromptCache] Anthropic cache stats", {
|
|
2973
|
-
model,
|
|
2974
|
-
cacheHitRate: cacheStats.cacheHitRate.toFixed(2) + "%",
|
|
2975
|
-
costSavingsPercent: cacheStats.costSavingsPercent.toFixed(2) + "%",
|
|
2976
|
-
totalInputTokens: cacheStats.totalInputTokens,
|
|
2977
|
-
cacheReadTokens: cacheStats.cacheReadTokens,
|
|
2978
|
-
cacheWriteTokens: cacheStats.cacheWriteTokens
|
|
2979
|
-
});
|
|
2980
|
-
}
|
|
2981
|
-
}
|
|
2982
2744
|
const hasToolsToExecute = func.some((f) => f && f.name);
|
|
2983
2745
|
if (!hasToolsToExecute) {
|
|
2984
2746
|
if (options.tools && options.tools.length > 0) {
|
|
@@ -2988,7 +2750,7 @@ var AnthropicBackend = class {
|
|
|
2988
2750
|
this.logger.warn(`\u26A0\uFE0F [AnthropicBackend] Model returned empty content with ${mcpToolCount} MCP tools available. Total tools: ${options.tools.length}. This may indicate tool overload or model confusion.`);
|
|
2989
2751
|
}
|
|
2990
2752
|
}
|
|
2991
|
-
await cb([], { toolsUsed
|
|
2753
|
+
await cb([], { toolsUsed });
|
|
2992
2754
|
}
|
|
2993
2755
|
resolve();
|
|
2994
2756
|
} catch (error) {
|
|
@@ -4150,19 +3912,6 @@ var AnthropicBedrockBackend = class extends BaseBedrockBackend {
|
|
|
4150
3912
|
topP: options.topP
|
|
4151
3913
|
}
|
|
4152
3914
|
}, null, 2)}`);
|
|
4153
|
-
const cacheStrategy = options.cacheStrategy;
|
|
4154
|
-
if (cacheStrategy?.enableCaching) {
|
|
4155
|
-
const adapter = getCachingAdapter(ModelBackend.Bedrock);
|
|
4156
|
-
const cachedBody = adapter.applyCaching(body, cacheStrategy);
|
|
4157
|
-
Object.assign(body, cachedBody);
|
|
4158
|
-
console.log("[PromptCache] Bedrock caching enabled", {
|
|
4159
|
-
model: modelId,
|
|
4160
|
-
cacheSystemPrompt: cacheStrategy.cacheSystemPrompt,
|
|
4161
|
-
cacheTools: cacheStrategy.cacheTools,
|
|
4162
|
-
cacheConversationHistory: cacheStrategy.cacheConversationHistory,
|
|
4163
|
-
cacheTTL: cacheStrategy.cacheTTL
|
|
4164
|
-
});
|
|
4165
|
-
}
|
|
4166
3915
|
const bodyStr = JSON.stringify(body);
|
|
4167
3916
|
console.log(`[AnthropicBedrockBackend] Request body: ${bodyStr.substring(0, 1e3)}${bodyStr.length > 1e3 ? "..." : ""}`);
|
|
4168
3917
|
return {
|
|
@@ -5663,26 +5412,10 @@ var GeminiBackend = class {
|
|
|
5663
5412
|
});
|
|
5664
5413
|
}
|
|
5665
5414
|
});
|
|
5666
|
-
const cacheStrategy = options.cacheStrategy;
|
|
5667
|
-
let cacheStats;
|
|
5668
|
-
if (cacheStrategy?.enableCaching && lastChunk.usageMetadata) {
|
|
5669
|
-
const adapter = getCachingAdapter(ModelBackend.Gemini);
|
|
5670
|
-
cacheStats = adapter.extractCacheStats(lastChunk, modelName);
|
|
5671
|
-
if (cacheStats && cacheStats.cacheReadTokens > 0) {
|
|
5672
|
-
this.logger.info("[PromptCache] Gemini cache stats (streaming)", {
|
|
5673
|
-
model: modelName,
|
|
5674
|
-
cacheHitRate: cacheStats.cacheHitRate.toFixed(2) + "%",
|
|
5675
|
-
costSavingsPercent: cacheStats.costSavingsPercent.toFixed(2) + "%",
|
|
5676
|
-
totalInputTokens: cacheStats.totalInputTokens,
|
|
5677
|
-
cacheReadTokens: cacheStats.cacheReadTokens
|
|
5678
|
-
});
|
|
5679
|
-
}
|
|
5680
|
-
}
|
|
5681
5415
|
await callback([], {
|
|
5682
5416
|
inputTokens: lastChunk.usageMetadata?.promptTokenCount ?? 0,
|
|
5683
5417
|
outputTokens: lastChunk.usageMetadata?.candidatesTokenCount ?? 0,
|
|
5684
|
-
toolsUsed
|
|
5685
|
-
cacheStats
|
|
5418
|
+
toolsUsed
|
|
5686
5419
|
});
|
|
5687
5420
|
}
|
|
5688
5421
|
if (toolCalls.length > 0 && options.tools?.length) {
|
|
@@ -5775,26 +5508,10 @@ var GeminiBackend = class {
|
|
|
5775
5508
|
if (options.abortSignal?.aborted) {
|
|
5776
5509
|
throw new Error("Request aborted");
|
|
5777
5510
|
}
|
|
5778
|
-
const cacheStrategy = options.cacheStrategy;
|
|
5779
|
-
let cacheStats;
|
|
5780
|
-
if (cacheStrategy?.enableCaching && r.usageMetadata) {
|
|
5781
|
-
const adapter = getCachingAdapter(ModelBackend.Gemini);
|
|
5782
|
-
cacheStats = adapter.extractCacheStats(r, modelName);
|
|
5783
|
-
if (cacheStats && cacheStats.cacheReadTokens > 0) {
|
|
5784
|
-
this.logger.info("[PromptCache] Gemini cache stats (non-streaming)", {
|
|
5785
|
-
model: modelName,
|
|
5786
|
-
cacheHitRate: cacheStats.cacheHitRate.toFixed(2) + "%",
|
|
5787
|
-
costSavingsPercent: cacheStats.costSavingsPercent.toFixed(2) + "%",
|
|
5788
|
-
totalInputTokens: cacheStats.totalInputTokens,
|
|
5789
|
-
cacheReadTokens: cacheStats.cacheReadTokens
|
|
5790
|
-
});
|
|
5791
|
-
}
|
|
5792
|
-
}
|
|
5793
5511
|
await callback(r.candidates?.map((candidate) => candidate.content?.parts?.[0]?.text) ?? [], {
|
|
5794
5512
|
inputTokens: r.usageMetadata?.promptTokenCount ?? 0,
|
|
5795
5513
|
outputTokens: r.usageMetadata?.candidatesTokenCount ?? 0,
|
|
5796
|
-
toolsUsed
|
|
5797
|
-
cacheStats
|
|
5514
|
+
toolsUsed
|
|
5798
5515
|
});
|
|
5799
5516
|
} catch (error) {
|
|
5800
5517
|
if (options.abortSignal?.aborted || error.message.includes("aborted")) {
|
|
@@ -6196,12 +5913,12 @@ var GPT5_MODELS = [
|
|
|
6196
5913
|
var GPT5_1_MODELS = [ChatModels.GPT5_1, ChatModels.GPT5_1_CHAT_LATEST];
|
|
6197
5914
|
var GPT5_2_MODELS = [ChatModels.GPT5_2, ChatModels.GPT5_2_CHAT_LATEST];
|
|
6198
5915
|
var effortMap = {
|
|
6199
|
-
simple: "
|
|
5916
|
+
simple: "low",
|
|
6200
5917
|
contextual: "low",
|
|
6201
5918
|
complex: "medium"
|
|
6202
5919
|
};
|
|
6203
5920
|
var effortMap_GPT5_1_2 = {
|
|
6204
|
-
simple: "
|
|
5921
|
+
simple: "low",
|
|
6205
5922
|
contextual: "low",
|
|
6206
5923
|
complex: "medium"
|
|
6207
5924
|
};
|
|
@@ -6851,20 +6568,20 @@ var OpenAIBackend = class {
|
|
|
6851
6568
|
stream: true,
|
|
6852
6569
|
...options.maxTokens && { max_completion_tokens: options.maxTokens }
|
|
6853
6570
|
});
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
}
|
|
6867
|
-
}
|
|
6571
|
+
if (REASONING_SUPPORTED_MODELS.has(model)) {
|
|
6572
|
+
let reasoningEffort;
|
|
6573
|
+
if (options.reasoningEffort) {
|
|
6574
|
+
reasoningEffort = options.reasoningEffort;
|
|
6575
|
+
this.logger.debug(`Using explicit reasoning effort: ${reasoningEffort}`);
|
|
6576
|
+
} else if (options.complexity && effortMap[options.complexity]) {
|
|
6577
|
+
reasoningEffort = isGPT5_1Model || isGPT5_2Model ? effortMap_GPT5_1_2[options.complexity] : effortMap[options.complexity];
|
|
6578
|
+
this.logger.debug(`Auto-classified reasoning effort from complexity '${options.complexity}': ${reasoningEffort}`);
|
|
6579
|
+
}
|
|
6580
|
+
if (reasoningEffort) {
|
|
6581
|
+
Object.assign(parameters, {
|
|
6582
|
+
reasoning_effort: reasoningEffort
|
|
6583
|
+
});
|
|
6584
|
+
}
|
|
6868
6585
|
}
|
|
6869
6586
|
} else {
|
|
6870
6587
|
const useStreaming = options.stream && (!options.n || options.n === 1);
|
|
@@ -6982,26 +6699,10 @@ var OpenAIBackend = class {
|
|
|
6982
6699
|
streamedText[c.index] = c.message.content || "";
|
|
6983
6700
|
}
|
|
6984
6701
|
}
|
|
6985
|
-
const cacheStrategy2 = options.cacheStrategy;
|
|
6986
|
-
let cacheStats2;
|
|
6987
|
-
if (cacheStrategy2?.enableCaching && response.usage) {
|
|
6988
|
-
const adapter = getCachingAdapter(ModelBackend.OpenAI);
|
|
6989
|
-
cacheStats2 = adapter.extractCacheStats(response, model);
|
|
6990
|
-
if (cacheStats2) {
|
|
6991
|
-
this.logger.info("[PromptCache] OpenAI cache stats (non-streaming)", {
|
|
6992
|
-
model,
|
|
6993
|
-
cacheHitRate: cacheStats2.cacheHitRate.toFixed(2) + "%",
|
|
6994
|
-
costSavingsPercent: cacheStats2.costSavingsPercent.toFixed(2) + "%",
|
|
6995
|
-
totalInputTokens: cacheStats2.totalInputTokens,
|
|
6996
|
-
cacheReadTokens: cacheStats2.cacheReadTokens
|
|
6997
|
-
});
|
|
6998
|
-
}
|
|
6999
|
-
}
|
|
7000
6702
|
const completionInfo = {
|
|
7001
6703
|
inputTokens: response.usage?.prompt_tokens || 0,
|
|
7002
6704
|
outputTokens: response.usage?.completion_tokens || 0,
|
|
7003
|
-
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7004
|
-
cacheStats: cacheStats2
|
|
6705
|
+
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7005
6706
|
};
|
|
7006
6707
|
await callback(streamedText, completionInfo);
|
|
7007
6708
|
return;
|
|
@@ -7032,33 +6733,6 @@ var OpenAIBackend = class {
|
|
|
7032
6733
|
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7033
6734
|
});
|
|
7034
6735
|
}
|
|
7035
|
-
const cacheStrategy = options.cacheStrategy;
|
|
7036
|
-
let cacheStats;
|
|
7037
|
-
if (cacheStrategy?.enableCaching && inputTokens > 0) {
|
|
7038
|
-
const adapter = getCachingAdapter(ModelBackend.OpenAI);
|
|
7039
|
-
const mockResponse = {
|
|
7040
|
-
usage: {
|
|
7041
|
-
prompt_tokens: inputTokens,
|
|
7042
|
-
completion_tokens: outputTokens,
|
|
7043
|
-
prompt_tokens_details: {
|
|
7044
|
-
// OpenAI provides cached token count in prompt_tokens_details
|
|
7045
|
-
// We don't have direct access to it in streaming, so this will be 0
|
|
7046
|
-
// unless the SDK exposes it in chunk.usage
|
|
7047
|
-
cached_tokens: 0
|
|
7048
|
-
}
|
|
7049
|
-
}
|
|
7050
|
-
};
|
|
7051
|
-
cacheStats = adapter.extractCacheStats(mockResponse, model);
|
|
7052
|
-
if (cacheStats && cacheStats.cacheReadTokens > 0) {
|
|
7053
|
-
this.logger.info("[PromptCache] OpenAI cache stats (streaming)", {
|
|
7054
|
-
model,
|
|
7055
|
-
cacheHitRate: cacheStats.cacheHitRate.toFixed(2) + "%",
|
|
7056
|
-
costSavingsPercent: cacheStats.costSavingsPercent.toFixed(2) + "%",
|
|
7057
|
-
totalInputTokens: cacheStats.totalInputTokens,
|
|
7058
|
-
cacheReadTokens: cacheStats.cacheReadTokens
|
|
7059
|
-
});
|
|
7060
|
-
}
|
|
7061
|
-
}
|
|
7062
6736
|
if (!isO1Model && func.length > 0) {
|
|
7063
6737
|
for (const tool of func) {
|
|
7064
6738
|
if (tool.name && tool.parameters) {
|
|
@@ -7083,8 +6757,7 @@ var OpenAIBackend = class {
|
|
|
7083
6757
|
await callback(results, {
|
|
7084
6758
|
inputTokens,
|
|
7085
6759
|
outputTokens,
|
|
7086
|
-
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7087
|
-
cacheStats
|
|
6760
|
+
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7088
6761
|
});
|
|
7089
6762
|
});
|
|
7090
6763
|
this.pushToolMessages(messages, {
|
|
@@ -7137,8 +6810,7 @@ var OpenAIBackend = class {
|
|
|
7137
6810
|
await callback([null], {
|
|
7138
6811
|
inputTokens,
|
|
7139
6812
|
outputTokens,
|
|
7140
|
-
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7141
|
-
cacheStats
|
|
6813
|
+
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7142
6814
|
});
|
|
7143
6815
|
}
|
|
7144
6816
|
}
|
|
@@ -7461,21 +7133,8 @@ var XAIBackend = class {
|
|
|
7461
7133
|
}
|
|
7462
7134
|
const supportsThinking = await this.modelSupportsThinking(model);
|
|
7463
7135
|
const thinkingEnabled = supportsThinking && options.thinking?.enabled !== false;
|
|
7464
|
-
const cacheStrategy = options.cacheStrategy;
|
|
7465
|
-
let headers = {};
|
|
7466
|
-
if (cacheStrategy?.enableCaching) {
|
|
7467
|
-
const adapter = getCachingAdapter(ModelBackend.XAI);
|
|
7468
|
-
headers = adapter.getHeaders?.(cacheStrategy) || {};
|
|
7469
|
-
if (headers["x-grok-conv-id"]) {
|
|
7470
|
-
this.logger.info("[PromptCache] xAI caching enabled with conversation ID", {
|
|
7471
|
-
model,
|
|
7472
|
-
conversationId: headers["x-grok-conv-id"]
|
|
7473
|
-
});
|
|
7474
|
-
}
|
|
7475
|
-
}
|
|
7476
7136
|
const response = await this._api.chat.completions.create(parameters, {
|
|
7477
|
-
signal: options.abortSignal
|
|
7478
|
-
headers
|
|
7137
|
+
signal: options.abortSignal
|
|
7479
7138
|
});
|
|
7480
7139
|
let inputTokens = 0;
|
|
7481
7140
|
let outputTokens = 0;
|
|
@@ -7584,25 +7243,10 @@ var XAIBackend = class {
|
|
|
7584
7243
|
streamedText[c.index] = c.message.content || "";
|
|
7585
7244
|
}
|
|
7586
7245
|
}
|
|
7587
|
-
let cacheStats2;
|
|
7588
|
-
if (cacheStrategy?.enableCaching && response.usage) {
|
|
7589
|
-
const adapter = getCachingAdapter(ModelBackend.XAI);
|
|
7590
|
-
cacheStats2 = adapter.extractCacheStats(response, model);
|
|
7591
|
-
if (cacheStats2 && cacheStats2.cacheReadTokens > 0) {
|
|
7592
|
-
this.logger.info("[PromptCache] xAI cache stats (non-streaming)", {
|
|
7593
|
-
model,
|
|
7594
|
-
cacheHitRate: cacheStats2.cacheHitRate.toFixed(2) + "%",
|
|
7595
|
-
costSavingsPercent: cacheStats2.costSavingsPercent.toFixed(2) + "%",
|
|
7596
|
-
totalInputTokens: cacheStats2.totalInputTokens,
|
|
7597
|
-
cacheReadTokens: cacheStats2.cacheReadTokens
|
|
7598
|
-
});
|
|
7599
|
-
}
|
|
7600
|
-
}
|
|
7601
7246
|
const completionInfo = {
|
|
7602
7247
|
inputTokens: response.usage?.prompt_tokens || 0,
|
|
7603
7248
|
outputTokens: response.usage?.completion_tokens || 0,
|
|
7604
|
-
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7605
|
-
cacheStats: cacheStats2
|
|
7249
|
+
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7606
7250
|
};
|
|
7607
7251
|
await callback(streamedText, completionInfo);
|
|
7608
7252
|
return;
|
|
@@ -7647,28 +7291,6 @@ var XAIBackend = class {
|
|
|
7647
7291
|
toolsUsed: toolsUsed.length > 0 ? toolsUsed : void 0
|
|
7648
7292
|
});
|
|
7649
7293
|
}
|
|
7650
|
-
let cacheStats;
|
|
7651
|
-
if (cacheStrategy?.enableCaching && inputTokens > 0) {
|
|
7652
|
-
const adapter = getCachingAdapter(ModelBackend.XAI);
|
|
7653
|
-
const mockResponse = {
|
|
7654
|
-
usage: {
|
|
7655
|
-
prompt_tokens: inputTokens,
|
|
7656
|
-
completion_tokens: outputTokens,
|
|
7657
|
-
cached_prompt_tokens: 0
|
|
7658
|
-
// xAI provides this in the response
|
|
7659
|
-
}
|
|
7660
|
-
};
|
|
7661
|
-
cacheStats = adapter.extractCacheStats(mockResponse, model);
|
|
7662
|
-
if (cacheStats && cacheStats.cacheReadTokens > 0) {
|
|
7663
|
-
this.logger.info("[PromptCache] xAI cache stats (streaming)", {
|
|
7664
|
-
model,
|
|
7665
|
-
cacheHitRate: cacheStats.cacheHitRate.toFixed(2) + "%",
|
|
7666
|
-
costSavingsPercent: cacheStats.costSavingsPercent.toFixed(2) + "%",
|
|
7667
|
-
totalInputTokens: cacheStats.totalInputTokens,
|
|
7668
|
-
cacheReadTokens: cacheStats.cacheReadTokens
|
|
7669
|
-
});
|
|
7670
|
-
}
|
|
7671
|
-
}
|
|
7672
7294
|
if (func.length > 0) {
|
|
7673
7295
|
for await (const tool of func) {
|
|
7674
7296
|
const { name, parameters: parameters2 } = tool;
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5HA4JEOV.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C3K7SH2V.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-5HA4JEOV.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C3K7SH2V.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-5HA4JEOV.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-C3K7SH2V.js";
|
|
16
16
|
|
|
17
17
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
18
18
|
import { z } from "zod";
|
|
@@ -171,6 +171,20 @@ var ChatModels;
|
|
|
171
171
|
})(ChatModels || (ChatModels = {}));
|
|
172
172
|
var CHAT_MODELS = Object.values(ChatModels);
|
|
173
173
|
var supportedChatModels = z.nativeEnum(ChatModels);
|
|
174
|
+
var REASONING_SUPPORTED_MODELS = /* @__PURE__ */ new Set([
|
|
175
|
+
ChatModels.O1,
|
|
176
|
+
ChatModels.O3_MINI,
|
|
177
|
+
ChatModels.O3,
|
|
178
|
+
ChatModels.O4_MINI,
|
|
179
|
+
ChatModels.GPT5,
|
|
180
|
+
ChatModels.GPT5_MINI,
|
|
181
|
+
ChatModels.GPT5_NANO,
|
|
182
|
+
ChatModels.GPT5_CHAT_LATEST,
|
|
183
|
+
ChatModels.GPT5_1,
|
|
184
|
+
ChatModels.GPT5_1_CHAT_LATEST,
|
|
185
|
+
ChatModels.GPT5_2,
|
|
186
|
+
ChatModels.GPT5_2_CHAT_LATEST
|
|
187
|
+
]);
|
|
174
188
|
var SpeechToTextModels;
|
|
175
189
|
(function(SpeechToTextModels2) {
|
|
176
190
|
SpeechToTextModels2["WHISPER_1"] = "whisper-1";
|
|
@@ -8595,6 +8609,7 @@ export {
|
|
|
8595
8609
|
ChatModels,
|
|
8596
8610
|
CHAT_MODELS,
|
|
8597
8611
|
supportedChatModels,
|
|
8612
|
+
REASONING_SUPPORTED_MODELS,
|
|
8598
8613
|
SpeechToTextModels,
|
|
8599
8614
|
SPEECH_TO_TEXT_MODELS,
|
|
8600
8615
|
supportedSpeechToTextModels,
|
|
@@ -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-B7Z2QQMD.js";
|
|
6
|
+
import "./chunk-5HA4JEOV.js";
|
|
7
|
+
import "./chunk-C3K7SH2V.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
createFabFile,
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getEffectiveApiKey,
|
|
6
6
|
getOpenWeatherKey,
|
|
7
7
|
getSerperKey
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-65DLNQY2.js";
|
|
9
9
|
import "./chunk-RUI6HNLO.js";
|
|
10
10
|
import {
|
|
11
11
|
ConfigStore,
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
selectActiveBackgroundAgents,
|
|
16
16
|
useCliStore
|
|
17
17
|
} from "./chunk-TVW4ZESU.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-BYLWQZ5S.js";
|
|
19
|
+
import "./chunk-B7Z2QQMD.js";
|
|
20
20
|
import {
|
|
21
21
|
BFLImageService,
|
|
22
22
|
BaseStorage,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
OpenAIBackend,
|
|
29
29
|
OpenAIImageService,
|
|
30
30
|
XAIImageService
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-5HA4JEOV.js";
|
|
32
32
|
import {
|
|
33
33
|
AiEvents,
|
|
34
34
|
ApiKeyEvents,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
XAI_IMAGE_MODELS,
|
|
85
85
|
b4mLLMTools,
|
|
86
86
|
getMcpProviderMetadata
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-C3K7SH2V.js";
|
|
88
88
|
import {
|
|
89
89
|
Logger
|
|
90
90
|
} from "./chunk-OCYRD7D6.js";
|
|
@@ -316,9 +316,23 @@ function CommandAutocomplete({ commands, selectedIndex }) {
|
|
|
316
316
|
if (commands.length === 0) {
|
|
317
317
|
return /* @__PURE__ */ React3.createElement(Box2, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "No matching commands"));
|
|
318
318
|
}
|
|
319
|
-
|
|
319
|
+
const VIEWPORT_SIZE = 6;
|
|
320
|
+
const totalCommands = commands.length;
|
|
321
|
+
let startIndex = 0;
|
|
322
|
+
let endIndex = Math.min(VIEWPORT_SIZE, totalCommands);
|
|
323
|
+
if (totalCommands > VIEWPORT_SIZE) {
|
|
324
|
+
const halfViewport = Math.floor(VIEWPORT_SIZE / 2);
|
|
325
|
+
startIndex = Math.max(0, selectedIndex - halfViewport);
|
|
326
|
+
endIndex = Math.min(totalCommands, startIndex + VIEWPORT_SIZE);
|
|
327
|
+
if (endIndex === totalCommands) {
|
|
328
|
+
startIndex = Math.max(0, totalCommands - VIEWPORT_SIZE);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
const visibleCommands = commands.slice(startIndex, endIndex);
|
|
332
|
+
return /* @__PURE__ */ React3.createElement(Box2, { flexDirection: "column", marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, totalCommands === 1 ? "1 command" : `${totalCommands} commands`, totalCommands > VIEWPORT_SIZE && ` (${selectedIndex + 1}/${totalCommands})`, " \u2022 Use \u2191\u2193 to navigate, Enter to select")), visibleCommands.map((cmd, viewportIndex) => {
|
|
333
|
+
const actualIndex = startIndex + viewportIndex;
|
|
320
334
|
const args = cmd.args ? ` ${cmd.args}` : "";
|
|
321
|
-
const isSelected =
|
|
335
|
+
const isSelected = actualIndex === selectedIndex;
|
|
322
336
|
const sourceIcon = cmd.source === "global" ? "\u{1F3E0} " : cmd.source === "project" ? "\u{1F4C1} " : cmd.source === "built-in" ? "\u{1F527} " : "";
|
|
323
337
|
return /* @__PURE__ */ React3.createElement(Box2, { key: cmd.name, marginLeft: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: isSelected ? "cyan" : void 0, bold: isSelected }, isSelected ? "\u25B8 " : " ", sourceIcon, "/", cmd.name, args, " - ", cmd.description));
|
|
324
338
|
}));
|
|
@@ -14636,7 +14650,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
14636
14650
|
// package.json
|
|
14637
14651
|
var package_default = {
|
|
14638
14652
|
name: "@bike4mind/cli",
|
|
14639
|
-
version: "0.2.30-feat-
|
|
14653
|
+
version: "0.2.30-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
14640
14654
|
type: "module",
|
|
14641
14655
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
14642
14656
|
license: "UNLICENSED",
|
|
@@ -14707,13 +14721,10 @@ var package_default = {
|
|
|
14707
14721
|
diff: "^8.0.2",
|
|
14708
14722
|
dotenv: "^16.3.1",
|
|
14709
14723
|
"eventsource-parser": "^3.0.6",
|
|
14710
|
-
fdir: "^6.5.0",
|
|
14711
14724
|
"file-type": "^18.7.0",
|
|
14712
14725
|
"fuse.js": "^7.1.0",
|
|
14713
|
-
fzf: "^0.5.2",
|
|
14714
14726
|
glob: "^13.0.0",
|
|
14715
14727
|
"gray-matter": "^4.0.3",
|
|
14716
|
-
ignore: "^7.0.5",
|
|
14717
14728
|
ink: "^6.5.1",
|
|
14718
14729
|
"ink-select-input": "^6.2.0",
|
|
14719
14730
|
"ink-spinner": "^5.0.0",
|
|
@@ -14750,10 +14761,10 @@ var package_default = {
|
|
|
14750
14761
|
},
|
|
14751
14762
|
devDependencies: {
|
|
14752
14763
|
"@bike4mind/agents": "0.1.0",
|
|
14753
|
-
"@bike4mind/common": "2.51.1-feat-
|
|
14754
|
-
"@bike4mind/mcp": "1.30.1-feat-
|
|
14755
|
-
"@bike4mind/services": "2.49.1-feat-
|
|
14756
|
-
"@bike4mind/utils": "2.6.1-feat-
|
|
14764
|
+
"@bike4mind/common": "2.51.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
14765
|
+
"@bike4mind/mcp": "1.30.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
14766
|
+
"@bike4mind/services": "2.49.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
14767
|
+
"@bike4mind/utils": "2.6.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
14757
14768
|
"@types/better-sqlite3": "^7.6.13",
|
|
14758
14769
|
"@types/diff": "^5.0.9",
|
|
14759
14770
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -14762,6 +14773,9 @@ var package_default = {
|
|
|
14762
14773
|
"@types/react": "^19.2.7",
|
|
14763
14774
|
"@types/uuid": "^9.0.7",
|
|
14764
14775
|
"@types/yargs": "^17.0.32",
|
|
14776
|
+
fdir: "^6.5.0",
|
|
14777
|
+
fzf: "^0.5.2",
|
|
14778
|
+
ignore: "^7.0.5",
|
|
14765
14779
|
"ink-testing-library": "^4.0.0",
|
|
14766
14780
|
tsup: "^8.5.1",
|
|
14767
14781
|
tsx: "^4.21.0",
|
|
@@ -14771,7 +14785,7 @@ var package_default = {
|
|
|
14771
14785
|
optionalDependencies: {
|
|
14772
14786
|
"@vscode/ripgrep": "^1.17.0"
|
|
14773
14787
|
},
|
|
14774
|
-
gitHead: "
|
|
14788
|
+
gitHead: "b74387251e07e79e94b8720e6d4b1c8e16bde324"
|
|
14775
14789
|
};
|
|
14776
14790
|
|
|
14777
14791
|
// src/config/constants.ts
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-65DLNQY2.js";
|
|
6
|
+
import "./chunk-5HA4JEOV.js";
|
|
7
|
+
import "./chunk-C3K7SH2V.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
@@ -134,12 +134,12 @@ import {
|
|
|
134
134
|
validateMermaidSyntax,
|
|
135
135
|
warmUpSettingsCache,
|
|
136
136
|
withRetry
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-5HA4JEOV.js";
|
|
138
138
|
import {
|
|
139
139
|
buildRateLimitLogEntry,
|
|
140
140
|
isNearLimit,
|
|
141
141
|
parseRateLimitHeaders
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-C3K7SH2V.js";
|
|
143
143
|
import {
|
|
144
144
|
Logger,
|
|
145
145
|
NotificationDeduplicator,
|
|
@@ -232,6 +232,7 @@ import {
|
|
|
232
232
|
QuestStatusSchema,
|
|
233
233
|
REASONING_EFFORT_DESCRIPTIONS,
|
|
234
234
|
REASONING_EFFORT_LABELS,
|
|
235
|
+
REASONING_SUPPORTED_MODELS,
|
|
235
236
|
RESTRICTION_OPERATIONS,
|
|
236
237
|
RESTRICTION_SUBJECT_TYPES,
|
|
237
238
|
RapidReplyFallbackBehaviors,
|
|
@@ -418,7 +419,7 @@ import {
|
|
|
418
419
|
validateReactArtifactV2,
|
|
419
420
|
validateSvgArtifactV2,
|
|
420
421
|
wikiMarkupToAdf
|
|
421
|
-
} from "./chunk-
|
|
422
|
+
} from "./chunk-C3K7SH2V.js";
|
|
422
423
|
export {
|
|
423
424
|
ALL_IMAGE_MODELS,
|
|
424
425
|
ALL_IMAGE_SIZES,
|
|
@@ -653,6 +654,7 @@ export {
|
|
|
653
654
|
QuestStatusSchema,
|
|
654
655
|
REASONING_EFFORT_DESCRIPTIONS,
|
|
655
656
|
REASONING_EFFORT_LABELS,
|
|
657
|
+
REASONING_SUPPORTED_MODELS,
|
|
656
658
|
RESTRICTION_OPERATIONS,
|
|
657
659
|
RESTRICTION_SUBJECT_TYPES,
|
|
658
660
|
RapidReplyFallbackBehaviors,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-BYLWQZ5S.js";
|
|
6
|
+
import "./chunk-5HA4JEOV.js";
|
|
7
|
+
import "./chunk-C3K7SH2V.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
SubtractCreditsSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.30-feat-
|
|
3
|
+
"version": "0.2.30-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -71,13 +71,10 @@
|
|
|
71
71
|
"diff": "^8.0.2",
|
|
72
72
|
"dotenv": "^16.3.1",
|
|
73
73
|
"eventsource-parser": "^3.0.6",
|
|
74
|
-
"fdir": "^6.5.0",
|
|
75
74
|
"file-type": "^18.7.0",
|
|
76
75
|
"fuse.js": "^7.1.0",
|
|
77
|
-
"fzf": "^0.5.2",
|
|
78
76
|
"glob": "^13.0.0",
|
|
79
77
|
"gray-matter": "^4.0.3",
|
|
80
|
-
"ignore": "^7.0.5",
|
|
81
78
|
"ink": "^6.5.1",
|
|
82
79
|
"ink-select-input": "^6.2.0",
|
|
83
80
|
"ink-spinner": "^5.0.0",
|
|
@@ -114,10 +111,10 @@
|
|
|
114
111
|
},
|
|
115
112
|
"devDependencies": {
|
|
116
113
|
"@bike4mind/agents": "0.1.0",
|
|
117
|
-
"@bike4mind/common": "2.51.1-feat-
|
|
118
|
-
"@bike4mind/mcp": "1.30.1-feat-
|
|
119
|
-
"@bike4mind/services": "2.49.1-feat-
|
|
120
|
-
"@bike4mind/utils": "2.6.1-feat-
|
|
114
|
+
"@bike4mind/common": "2.51.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
115
|
+
"@bike4mind/mcp": "1.30.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
116
|
+
"@bike4mind/services": "2.49.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
117
|
+
"@bike4mind/utils": "2.6.1-feat-cli-scrollable-command-autocomplete.19203+b74387251",
|
|
121
118
|
"@types/better-sqlite3": "^7.6.13",
|
|
122
119
|
"@types/diff": "^5.0.9",
|
|
123
120
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -126,6 +123,9 @@
|
|
|
126
123
|
"@types/react": "^19.2.7",
|
|
127
124
|
"@types/uuid": "^9.0.7",
|
|
128
125
|
"@types/yargs": "^17.0.32",
|
|
126
|
+
"fdir": "^6.5.0",
|
|
127
|
+
"fzf": "^0.5.2",
|
|
128
|
+
"ignore": "^7.0.5",
|
|
129
129
|
"ink-testing-library": "^4.0.0",
|
|
130
130
|
"tsup": "^8.5.1",
|
|
131
131
|
"tsx": "^4.21.0",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"optionalDependencies": {
|
|
136
136
|
"@vscode/ripgrep": "^1.17.0"
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "b74387251e07e79e94b8720e6d4b1c8e16bde324"
|
|
139
139
|
}
|