@bike4mind/cli 0.2.28 → 0.2.29-cache-mcp-tools-schema-and-refactor.18897
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/README.md +1 -1
- package/dist/{artifactExtractor-36XHJYOZ.js → artifactExtractor-NO6YMWJN.js} +1 -1
- package/dist/{chunk-JJBDHUGY.js → chunk-7DZY5UWH.js} +2 -2
- package/dist/{chunk-ZEMWV6IR.js → chunk-AQMAXCNK.js} +2 -2
- package/dist/{chunk-UNOJBVD2.js → chunk-BAYMEX5W.js} +83 -5
- package/dist/{chunk-VGYTNJXN.js → chunk-BPXPHQXQ.js} +15 -15
- package/dist/{chunk-XJRPAAUS.js → chunk-E6AOHC4U.js} +30 -4
- package/dist/{chunk-23T2XGSZ.js → chunk-LBTTUQJM.js} +290 -33
- package/dist/commands/mcpCommand.js +1 -1
- package/dist/{create-NGI7IIQ4.js → create-AMD5NY5D.js} +3 -3
- package/dist/index.js +723 -626
- package/dist/{llmMarkdownGenerator-JDYKJUEC.js → llmMarkdownGenerator-KMLHDAZU.js} +1 -1
- package/dist/{markdownGenerator-QXBC2EW5.js → markdownGenerator-3SQD4T42.js} +1 -1
- package/dist/{mementoService-X35OMHVC.js → mementoService-RQHVW32J.js} +3 -3
- package/dist/{src-6NIYIWZD.js → src-YXJL5FLE.js} +3 -1
- package/dist/{src-CBU6EAO3.js → src-ZEBZX6IS.js} +4 -2
- package/dist/{subtractCredits-RL6JVDMI.js → subtractCredits-JX5MH4ES.js} +3 -3
- package/dist/treeSitterEngine-4SGFQDY3.js +330 -0
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ While in interactive mode:
|
|
|
101
101
|
|
|
102
102
|
**Session Management:**
|
|
103
103
|
- `/save <name>` - Save current session
|
|
104
|
-
- `/
|
|
104
|
+
- `/resume` - List and resume saved sessions
|
|
105
105
|
|
|
106
106
|
**API Configuration:**
|
|
107
107
|
- `/set-api <url>` - Connect to self-hosted Bike4Mind instance
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E6AOHC4U.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;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BAYMEX5W.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-E6AOHC4U.js";
|
|
16
16
|
|
|
17
17
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
18
18
|
import { z } from "zod";
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BAYMEX5W.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-E6AOHC4U.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
dayjsConfig_default,
|
|
16
16
|
extractSnippetMeta,
|
|
17
17
|
settingsMap
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-E6AOHC4U.js";
|
|
19
19
|
import {
|
|
20
20
|
Logger
|
|
21
21
|
} from "./chunk-OCYRD7D6.js";
|
|
@@ -1285,11 +1285,14 @@ async function processFabFilesServer(embeddingFactory, fabFiles, userPrompt, max
|
|
|
1285
1285
|
}
|
|
1286
1286
|
switch (modelInfo?.backend) {
|
|
1287
1287
|
case ModelBackend.OpenAI:
|
|
1288
|
-
case ModelBackend.XAI:
|
|
1288
|
+
case ModelBackend.XAI: {
|
|
1289
|
+
const openaiImageBuffer = await storage.download(file.filePath);
|
|
1290
|
+
const { mime: openaiMimeType } = await getFileType(openaiImageBuffer, file.fileName, file.mimeType);
|
|
1291
|
+
const openaiBase64 = openaiImageBuffer.toString("base64");
|
|
1289
1292
|
imageContent.push({
|
|
1290
1293
|
type: "image_url",
|
|
1291
1294
|
image_url: {
|
|
1292
|
-
url:
|
|
1295
|
+
url: `data:${openaiMimeType};base64,${openaiBase64}`
|
|
1293
1296
|
}
|
|
1294
1297
|
});
|
|
1295
1298
|
imageContent.push({
|
|
@@ -1297,6 +1300,7 @@ async function processFabFilesServer(embeddingFactory, fabFiles, userPrompt, max
|
|
|
1297
1300
|
text: `Image URL: ${fileUrl}`
|
|
1298
1301
|
});
|
|
1299
1302
|
break;
|
|
1303
|
+
}
|
|
1300
1304
|
case ModelBackend.Anthropic:
|
|
1301
1305
|
case ModelBackend.Gemini:
|
|
1302
1306
|
case ModelBackend.Bedrock:
|
|
@@ -1793,7 +1797,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
|
|
|
1793
1797
|
}
|
|
1794
1798
|
logger.log(`Tool pairing integrity: removed ${parts.join(" and ")} after truncation`);
|
|
1795
1799
|
}
|
|
1796
|
-
let adjacencyStrippedCount = 0;
|
|
1797
1800
|
for (let i = 0; i < result.length; i++) {
|
|
1798
1801
|
const msg = result[i];
|
|
1799
1802
|
if (msg.role !== "assistant" || !Array.isArray(msg.content))
|
|
@@ -1818,7 +1821,6 @@ var ensureToolPairingIntegrity = (messages, logger) => {
|
|
|
1818
1821
|
const unmatchedSet = new Set(unmatchedIds);
|
|
1819
1822
|
const filtered = content.filter((b) => {
|
|
1820
1823
|
if (b.type === "tool_use" && "id" in b && unmatchedSet.has(b.id)) {
|
|
1821
|
-
adjacencyStrippedCount++;
|
|
1822
1824
|
return false;
|
|
1823
1825
|
}
|
|
1824
1826
|
return true;
|
|
@@ -6889,6 +6891,24 @@ var XAIBackend = class {
|
|
|
6889
6891
|
}
|
|
6890
6892
|
async getModelInfo() {
|
|
6891
6893
|
return [
|
|
6894
|
+
{
|
|
6895
|
+
id: ChatModels.GROK_4,
|
|
6896
|
+
type: "text",
|
|
6897
|
+
name: "Grok 4",
|
|
6898
|
+
backend: ModelBackend.XAI,
|
|
6899
|
+
contextWindow: 256e3,
|
|
6900
|
+
max_tokens: 16384,
|
|
6901
|
+
can_stream: true,
|
|
6902
|
+
pricing: {
|
|
6903
|
+
// $3.00 / 1M Input tokens, $15.00 / 1M Output tokens. @see https://docs.x.ai/developers/models
|
|
6904
|
+
256e3: { input: 3 / 1e6, output: 15 / 1e6 }
|
|
6905
|
+
},
|
|
6906
|
+
can_think: true,
|
|
6907
|
+
supportsVision: true,
|
|
6908
|
+
supportsTools: true,
|
|
6909
|
+
supportsImageVariation: false,
|
|
6910
|
+
description: "xAI's most capable reasoning model. Excels at complex problem-solving, coding, math, and multimodal understanding with 256K context window."
|
|
6911
|
+
},
|
|
6892
6912
|
{
|
|
6893
6913
|
id: ChatModels.GROK_3,
|
|
6894
6914
|
type: "text",
|
|
@@ -7392,6 +7412,51 @@ var XAIBackend = class {
|
|
|
7392
7412
|
}
|
|
7393
7413
|
};
|
|
7394
7414
|
|
|
7415
|
+
// ../../b4m-core/packages/utils/dist/src/llm/PipelineTimer.js
|
|
7416
|
+
var PipelineTimer = class {
|
|
7417
|
+
start = Date.now();
|
|
7418
|
+
phases = [];
|
|
7419
|
+
/** End the current phase (if any) and start a new one. */
|
|
7420
|
+
phase(name) {
|
|
7421
|
+
const now = Date.now();
|
|
7422
|
+
const active = this.phases[this.phases.length - 1];
|
|
7423
|
+
if (active && active.end === void 0) {
|
|
7424
|
+
active.end = now;
|
|
7425
|
+
}
|
|
7426
|
+
this.phases.push({ name, start: now });
|
|
7427
|
+
}
|
|
7428
|
+
/** End the current phase without starting a new one. */
|
|
7429
|
+
end() {
|
|
7430
|
+
const active = this.phases[this.phases.length - 1];
|
|
7431
|
+
if (active && active.end === void 0) {
|
|
7432
|
+
active.end = Date.now();
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
/** Return a record of phase name → duration in ms. */
|
|
7436
|
+
toRecord() {
|
|
7437
|
+
const record = {};
|
|
7438
|
+
for (const p of this.phases) {
|
|
7439
|
+
record[p.name] = (p.end ?? Date.now()) - p.start;
|
|
7440
|
+
}
|
|
7441
|
+
return record;
|
|
7442
|
+
}
|
|
7443
|
+
/** Total elapsed time since timer creation. */
|
|
7444
|
+
totalMs() {
|
|
7445
|
+
return Date.now() - this.start;
|
|
7446
|
+
}
|
|
7447
|
+
/** Formatted single-line summary suitable for structured loggers that prefix each line. */
|
|
7448
|
+
summary() {
|
|
7449
|
+
const total = this.totalMs();
|
|
7450
|
+
const parts = [];
|
|
7451
|
+
for (const p of this.phases) {
|
|
7452
|
+
const dur = (p.end ?? Date.now()) - p.start;
|
|
7453
|
+
const pct = total > 0 ? (dur / total * 100).toFixed(1) : "0.0";
|
|
7454
|
+
parts.push(`${p.name}: ${dur}ms (${pct}%)`);
|
|
7455
|
+
}
|
|
7456
|
+
return `${parts.join(" | ")} | TOTAL: ${total}ms`;
|
|
7457
|
+
}
|
|
7458
|
+
};
|
|
7459
|
+
|
|
7395
7460
|
// ../../b4m-core/packages/utils/dist/src/llm/index.js
|
|
7396
7461
|
function getLlmByModel(apiKeyTable, options) {
|
|
7397
7462
|
const { modelInfo } = options;
|
|
@@ -7476,7 +7541,18 @@ function getLlmByModel(apiKeyTable, options) {
|
|
|
7476
7541
|
}
|
|
7477
7542
|
return backend;
|
|
7478
7543
|
}
|
|
7544
|
+
var MODEL_CACHE_TTL_MS = 6e4;
|
|
7545
|
+
var _modelCache = null;
|
|
7546
|
+
function getModelCacheKey(apiKeys) {
|
|
7547
|
+
if (!apiKeys)
|
|
7548
|
+
return "null";
|
|
7549
|
+
return Object.keys(apiKeys).sort().map((k) => `${k}:${apiKeys[k] ? "1" : "0"}`).join(",");
|
|
7550
|
+
}
|
|
7479
7551
|
var getAvailableModels = async (apiKeys) => {
|
|
7552
|
+
const cacheKey = getModelCacheKey(apiKeys);
|
|
7553
|
+
if (_modelCache && _modelCache.key === cacheKey && Date.now() < _modelCache.expiresAt) {
|
|
7554
|
+
return _modelCache.models;
|
|
7555
|
+
}
|
|
7480
7556
|
const backends = {
|
|
7481
7557
|
[ModelBackend.OpenAI]: apiKeys?.openai ? new OpenAIBackend(apiKeys.openai) : null,
|
|
7482
7558
|
[ModelBackend.Anthropic]: apiKeys?.anthropic ? new AnthropicBackend(apiKeys.anthropic) : null,
|
|
@@ -7530,6 +7606,7 @@ var getAvailableModels = async (apiKeys) => {
|
|
|
7530
7606
|
const cutoff = /* @__PURE__ */ new Date(m.deprecationDate + "T00:00:00Z");
|
|
7531
7607
|
return today.getTime() < cutoff.getTime();
|
|
7532
7608
|
});
|
|
7609
|
+
_modelCache = { key: cacheKey, models: filtered, expiresAt: Date.now() + MODEL_CACHE_TTL_MS };
|
|
7533
7610
|
return filtered;
|
|
7534
7611
|
};
|
|
7535
7612
|
|
|
@@ -11969,6 +12046,7 @@ export {
|
|
|
11969
12046
|
OllamaBackend,
|
|
11970
12047
|
OpenAIBackend,
|
|
11971
12048
|
XAIBackend,
|
|
12049
|
+
PipelineTimer,
|
|
11972
12050
|
getLlmByModel,
|
|
11973
12051
|
getAvailableModels,
|
|
11974
12052
|
secureParameters,
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BAYMEX5W.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-E6AOHC4U.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -79,15 +79,6 @@ var getEffectiveLLMApiKeys = async (userId, adapters, options) => {
|
|
|
79
79
|
const { db } = adapters;
|
|
80
80
|
const logger = options?.logger;
|
|
81
81
|
const apiKeyFetchStartTime = Date.now();
|
|
82
|
-
const userApiKeys = await getMultipleApiKeys(userId, [ApiKeyType.openai, ApiKeyType.anthropic, ApiKeyType.gemini, ApiKeyType.bfl, ApiKeyType.xai, ApiKeyType.voyageai], adapters);
|
|
83
|
-
const userKeyMap = /* @__PURE__ */ new Map();
|
|
84
|
-
userApiKeys.forEach((key) => userKeyMap.set(key.type, key));
|
|
85
|
-
const openaiUserKey = userKeyMap.get(ApiKeyType.openai) || null;
|
|
86
|
-
const anthropicUserKey = userKeyMap.get(ApiKeyType.anthropic) || null;
|
|
87
|
-
const geminiUserKey = userKeyMap.get(ApiKeyType.gemini) || null;
|
|
88
|
-
const bflUserKey = userKeyMap.get(ApiKeyType.bfl) || null;
|
|
89
|
-
const xaiUserKey = userKeyMap.get(ApiKeyType.xai) || null;
|
|
90
|
-
const voyageaiUserKey = userKeyMap.get(ApiKeyType.voyageai) || null;
|
|
91
82
|
const adminSettingNames = [
|
|
92
83
|
"openaiDemoKey",
|
|
93
84
|
"anthropicDemoKey",
|
|
@@ -98,8 +89,18 @@ var getEffectiveLLMApiKeys = async (userId, adapters, options) => {
|
|
|
98
89
|
"ollamaBackend",
|
|
99
90
|
"EnableOllama"
|
|
100
91
|
];
|
|
101
|
-
const
|
|
102
|
-
|
|
92
|
+
const [userApiKeys, adminSettings] = await Promise.all([
|
|
93
|
+
getMultipleApiKeys(userId, [ApiKeyType.openai, ApiKeyType.anthropic, ApiKeyType.gemini, ApiKeyType.bfl, ApiKeyType.xai, ApiKeyType.voyageai], adapters),
|
|
94
|
+
getSettingsByNames(adminSettingNames, { adminSettings: db.adminSettings }, { logger })
|
|
95
|
+
]);
|
|
96
|
+
const userKeyMap = /* @__PURE__ */ new Map();
|
|
97
|
+
userApiKeys.forEach((key) => userKeyMap.set(key.type, key));
|
|
98
|
+
const openaiUserKey = userKeyMap.get(ApiKeyType.openai) || null;
|
|
99
|
+
const anthropicUserKey = userKeyMap.get(ApiKeyType.anthropic) || null;
|
|
100
|
+
const geminiUserKey = userKeyMap.get(ApiKeyType.gemini) || null;
|
|
101
|
+
const bflUserKey = userKeyMap.get(ApiKeyType.bfl) || null;
|
|
102
|
+
const xaiUserKey = userKeyMap.get(ApiKeyType.xai) || null;
|
|
103
|
+
const voyageaiUserKey = userKeyMap.get(ApiKeyType.voyageai) || null;
|
|
103
104
|
const openaiDemoKey = adminSettings["openaiDemoKey"];
|
|
104
105
|
const anthropicDemoKey = adminSettings["anthropicDemoKey"];
|
|
105
106
|
const geminiDemoKey = adminSettings["geminiDemoKey"];
|
|
@@ -108,10 +109,9 @@ var getEffectiveLLMApiKeys = async (userId, adapters, options) => {
|
|
|
108
109
|
const voyageaiDemoKey = adminSettings["voyageApiKey"];
|
|
109
110
|
const ollamaBackend = adminSettings["ollamaBackend"];
|
|
110
111
|
const enableOllama = adminSettings["EnableOllama"];
|
|
111
|
-
const adminSettingsTime = Date.now() - adminSettingsStartTime;
|
|
112
112
|
const totalTime = Date.now() - apiKeyFetchStartTime;
|
|
113
113
|
if (logger) {
|
|
114
|
-
logger.info(`\u{1F4E6}
|
|
114
|
+
logger.info(`\u{1F4E6} API key + admin settings parallel fetch completed in ${totalTime}ms`);
|
|
115
115
|
}
|
|
116
116
|
const ollamaEnabled = enableOllama === "true" || enableOllama === true;
|
|
117
117
|
const keyOrExpired = (apiKey) => {
|
|
@@ -165,6 +165,7 @@ var ChatModels;
|
|
|
165
165
|
ChatModels2["GROK_3_MINI_FAST"] = "grok-3-mini-fast";
|
|
166
166
|
ChatModels2["GROK_2"] = "grok-2-1212";
|
|
167
167
|
ChatModels2["GROK_2_VISION"] = "grok-2-vision-1212";
|
|
168
|
+
ChatModels2["GROK_4"] = "grok-4-0709";
|
|
168
169
|
ChatModels2["GROK_BETA"] = "grok-beta";
|
|
169
170
|
ChatModels2["GROK_VISION_BETA"] = "grok-vision-beta";
|
|
170
171
|
})(ChatModels || (ChatModels = {}));
|
|
@@ -1982,9 +1983,13 @@ var OPENAI_IMAGE_QUALITIES = ["standard", "hd", "low", "medium", "high"];
|
|
|
1982
1983
|
var OpenAIImageQualitySchema = z16.enum(OPENAI_IMAGE_QUALITIES);
|
|
1983
1984
|
var OPENAI_IMAGE_STYLES = ["vivid", "natural"];
|
|
1984
1985
|
var OpenAIImageStyleSchema = z16.enum(OPENAI_IMAGE_STYLES);
|
|
1986
|
+
var LEGACY_IMAGE_MODEL_MAP = {
|
|
1987
|
+
"dall-e-3": ImageModels.GPT_IMAGE_1,
|
|
1988
|
+
"dall-e-2": ImageModels.GPT_IMAGE_1
|
|
1989
|
+
};
|
|
1985
1990
|
var OpenAIImageGenerationInput = z16.object({
|
|
1986
1991
|
prompt: z16.string(),
|
|
1987
|
-
model: z16.enum(ALL_IMAGE_MODELS),
|
|
1992
|
+
model: z16.preprocess((val) => typeof val === "string" && Object.prototype.hasOwnProperty.call(LEGACY_IMAGE_MODEL_MAP, val) ? LEGACY_IMAGE_MODEL_MAP[val] : val, z16.enum(ALL_IMAGE_MODELS)),
|
|
1988
1993
|
n: z16.number().min(1).max(10).optional(),
|
|
1989
1994
|
quality: OpenAIImageQualitySchema.optional(),
|
|
1990
1995
|
response_format: z16.enum(["b64_json", "url"]).optional(),
|
|
@@ -2256,7 +2261,9 @@ var SettingKeySchema = z21.enum([
|
|
|
2256
2261
|
// PARALLEL TOOL EXECUTION SETTINGS
|
|
2257
2262
|
"EnableParallelToolExecution",
|
|
2258
2263
|
// LIVEOPS TRIAGE AUTOMATION SETTINGS
|
|
2259
|
-
"liveopsTriageConfig"
|
|
2264
|
+
"liveopsTriageConfig",
|
|
2265
|
+
// HELP CENTER SETTINGS
|
|
2266
|
+
"EnableHelpChat"
|
|
2260
2267
|
]);
|
|
2261
2268
|
var CategoryOrder = [
|
|
2262
2269
|
"AI",
|
|
@@ -2675,7 +2682,8 @@ var API_SERVICE_GROUPS = {
|
|
|
2675
2682
|
{ key: "StreamIdleTimeoutSeconds", order: 13 },
|
|
2676
2683
|
{ key: "EnableMcpToolFiltering", order: 14 },
|
|
2677
2684
|
{ key: "McpToolFilteringMaxTools", order: 15 },
|
|
2678
|
-
{ key: "EnableParallelToolExecution", order: 16 }
|
|
2685
|
+
{ key: "EnableParallelToolExecution", order: 16 },
|
|
2686
|
+
{ key: "EnableHelpChat", order: 17 }
|
|
2679
2687
|
]
|
|
2680
2688
|
},
|
|
2681
2689
|
NOTEBOOK: {
|
|
@@ -3846,6 +3854,16 @@ var settingsMap = {
|
|
|
3846
3854
|
category: "Admin",
|
|
3847
3855
|
order: 110,
|
|
3848
3856
|
schema: LiveopsTriageConfigSchema
|
|
3857
|
+
}),
|
|
3858
|
+
// Help Center Settings
|
|
3859
|
+
EnableHelpChat: makeBooleanSetting({
|
|
3860
|
+
key: "EnableHelpChat",
|
|
3861
|
+
name: "Enable Help Chat",
|
|
3862
|
+
defaultValue: true,
|
|
3863
|
+
description: "Enable the AI-powered chat assistant in the Help Center panel. When enabled, users can ask questions about the documentation and get contextual answers.",
|
|
3864
|
+
category: "Experimental",
|
|
3865
|
+
group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
|
|
3866
|
+
order: 17
|
|
3849
3867
|
})
|
|
3850
3868
|
// Add more settings as needed
|
|
3851
3869
|
};
|
|
@@ -4028,7 +4046,8 @@ var PromptMetaPerformanceSchema = z23.object({
|
|
|
4028
4046
|
charsPerSecond: z23.number().optional()
|
|
4029
4047
|
}).optional(),
|
|
4030
4048
|
featureExecutionTimes: z23.union([z23.record(z23.string(), z23.number()), z23.map(z23.string(), z23.number())]).optional(),
|
|
4031
|
-
databaseOperationTimes: z23.union([z23.record(z23.string(), z23.number()), z23.map(z23.string(), z23.number())]).optional()
|
|
4049
|
+
databaseOperationTimes: z23.union([z23.record(z23.string(), z23.number()), z23.map(z23.string(), z23.number())]).optional(),
|
|
4050
|
+
phases: z23.record(z23.string(), z23.number()).optional()
|
|
4032
4051
|
});
|
|
4033
4052
|
var PromptMetaSessionSchema = z23.object({
|
|
4034
4053
|
id: z23.string(),
|
|
@@ -7762,6 +7781,12 @@ function buildSSEEvent(text, info) {
|
|
|
7762
7781
|
outputTokens: info.outputTokens
|
|
7763
7782
|
};
|
|
7764
7783
|
}
|
|
7784
|
+
if (info?.creditsUsed !== void 0 || info?.usdCost !== void 0) {
|
|
7785
|
+
event.credits = {
|
|
7786
|
+
used: info.creditsUsed,
|
|
7787
|
+
usdCost: info.usdCost
|
|
7788
|
+
};
|
|
7789
|
+
}
|
|
7765
7790
|
if (info?.thinking && info.thinking.length > 0) {
|
|
7766
7791
|
event.thinking = info.thinking;
|
|
7767
7792
|
}
|
|
@@ -7957,6 +7982,7 @@ export {
|
|
|
7957
7982
|
OpenAIImageQualitySchema,
|
|
7958
7983
|
OPENAI_IMAGE_STYLES,
|
|
7959
7984
|
OpenAIImageStyleSchema,
|
|
7985
|
+
LEGACY_IMAGE_MODEL_MAP,
|
|
7960
7986
|
OpenAIImageGenerationInput,
|
|
7961
7987
|
PASSWORD_RULES,
|
|
7962
7988
|
PASSWORD_ERROR_MESSAGES,
|