@bike4mind/cli 0.2.24-feat-pr-files-diff-tools.18476 → 0.2.24-feat-parallel-tool-execution.18470
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-JZ5EU5YH.js → artifactExtractor-UWINLSHU.js} +1 -1
- package/dist/{chunk-XFN2ICKP.js → chunk-6ZSQC2VF.js} +1 -1
- package/dist/{chunk-LOIWIBZT.js → chunk-7L7YVDTP.js} +14 -1
- package/dist/{chunk-FV2VQXYX.js → chunk-AHVXP2NS.js} +2 -2
- package/dist/{chunk-JHCQOESZ.js → chunk-LPM3TSSU.js} +2 -2
- package/dist/{chunk-GGQZHK5U.js → chunk-U4GFPBS7.js} +2 -2
- package/dist/{create-DOGMZSYL.js → create-OUHPA36R.js} +3 -3
- package/dist/index.js +1322 -1123
- package/dist/{llmMarkdownGenerator-XTKTGXLR.js → llmMarkdownGenerator-H5KBHEND.js} +1 -1
- package/dist/{markdownGenerator-BPNTWLQB.js → markdownGenerator-XVDGKPVZ.js} +1 -1
- package/dist/{mementoService-65C2EYD5.js → mementoService-NW6AADXH.js} +3 -3
- package/dist/{src-SWWFC3US.js → src-C6D5BBNC.js} +1 -1
- package/dist/{src-FB7KXX74.js → src-YVHC5322.js} +2 -2
- package/dist/{subtractCredits-GEE7TE3Y.js → subtractCredits-YLWP2W6I.js} +3 -3
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
getEffectiveApiKey,
|
|
5
5
|
getOpenWeatherKey,
|
|
6
6
|
getSerperKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AHVXP2NS.js";
|
|
8
8
|
import {
|
|
9
9
|
ConfigStore
|
|
10
10
|
} from "./chunk-23T2XGSZ.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-LPM3TSSU.js";
|
|
12
|
+
import "./chunk-U4GFPBS7.js";
|
|
13
13
|
import {
|
|
14
14
|
BFLImageService,
|
|
15
15
|
BaseStorage,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
OpenAIBackend,
|
|
22
22
|
OpenAIImageService,
|
|
23
23
|
XAIImageService
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6ZSQC2VF.js";
|
|
25
25
|
import {
|
|
26
26
|
AiEvents,
|
|
27
27
|
ApiKeyEvents,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
XAI_IMAGE_MODELS,
|
|
78
78
|
b4mLLMTools,
|
|
79
79
|
getMcpProviderMetadata
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-7L7YVDTP.js";
|
|
81
81
|
import {
|
|
82
82
|
Logger
|
|
83
83
|
} from "./chunk-OCYRD7D6.js";
|
|
@@ -3132,6 +3132,127 @@ You can use:
|
|
|
3132
3132
|
|
|
3133
3133
|
// ../../b4m-core/packages/agents/src/ReActAgent.ts
|
|
3134
3134
|
import { EventEmitter } from "events";
|
|
3135
|
+
|
|
3136
|
+
// ../../b4m-core/packages/agents/src/toolParallelizer.ts
|
|
3137
|
+
var DEFAULT_WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
3138
|
+
"edit_file",
|
|
3139
|
+
"edit_local_file",
|
|
3140
|
+
"create_file",
|
|
3141
|
+
"delete_file",
|
|
3142
|
+
"shell_execute",
|
|
3143
|
+
"bash_execute",
|
|
3144
|
+
"git_commit",
|
|
3145
|
+
"git_push"
|
|
3146
|
+
]);
|
|
3147
|
+
function defaultIsReadOnlyTool(toolName) {
|
|
3148
|
+
return !DEFAULT_WRITE_TOOLS.has(toolName);
|
|
3149
|
+
}
|
|
3150
|
+
function getToolId(tool) {
|
|
3151
|
+
return `${tool.name}_${JSON.stringify(tool.arguments)}`;
|
|
3152
|
+
}
|
|
3153
|
+
function categorizeTools(toolsUsed, isReadOnly = defaultIsReadOnlyTool) {
|
|
3154
|
+
const parallelBatch = [];
|
|
3155
|
+
const sequentialBatch = [];
|
|
3156
|
+
const originalOrder = [];
|
|
3157
|
+
for (const tool of toolsUsed) {
|
|
3158
|
+
originalOrder.push(getToolId(tool));
|
|
3159
|
+
if (isReadOnly(tool.name)) {
|
|
3160
|
+
parallelBatch.push(tool);
|
|
3161
|
+
} else {
|
|
3162
|
+
sequentialBatch.push(tool);
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
return {
|
|
3166
|
+
parallelBatch,
|
|
3167
|
+
sequentialBatch,
|
|
3168
|
+
originalOrder
|
|
3169
|
+
};
|
|
3170
|
+
}
|
|
3171
|
+
async function executeToolsInParallel(plan, executor, signal) {
|
|
3172
|
+
const results = /* @__PURE__ */ new Map();
|
|
3173
|
+
if (signal?.aborted) {
|
|
3174
|
+
throw new Error("Tool execution aborted");
|
|
3175
|
+
}
|
|
3176
|
+
if (plan.parallelBatch.length > 0) {
|
|
3177
|
+
const parallelPromises = plan.parallelBatch.map(async (tool) => {
|
|
3178
|
+
const toolId = getToolId(tool);
|
|
3179
|
+
if (signal?.aborted) {
|
|
3180
|
+
return {
|
|
3181
|
+
toolId,
|
|
3182
|
+
result: {
|
|
3183
|
+
toolName: tool.name,
|
|
3184
|
+
error: new Error("Tool execution aborted"),
|
|
3185
|
+
status: "rejected"
|
|
3186
|
+
}
|
|
3187
|
+
};
|
|
3188
|
+
}
|
|
3189
|
+
try {
|
|
3190
|
+
const result = await executor(tool);
|
|
3191
|
+
return {
|
|
3192
|
+
toolId,
|
|
3193
|
+
result: {
|
|
3194
|
+
toolName: tool.name,
|
|
3195
|
+
result,
|
|
3196
|
+
status: "fulfilled"
|
|
3197
|
+
}
|
|
3198
|
+
};
|
|
3199
|
+
} catch (error) {
|
|
3200
|
+
return {
|
|
3201
|
+
toolId,
|
|
3202
|
+
result: {
|
|
3203
|
+
toolName: tool.name,
|
|
3204
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
3205
|
+
status: "rejected"
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
}
|
|
3209
|
+
});
|
|
3210
|
+
const settledResults = await Promise.allSettled(parallelPromises);
|
|
3211
|
+
for (const settled of settledResults) {
|
|
3212
|
+
if (settled.status === "fulfilled") {
|
|
3213
|
+
results.set(settled.value.toolId, settled.value.result);
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
if (signal?.aborted) {
|
|
3218
|
+
throw new Error("Tool execution aborted");
|
|
3219
|
+
}
|
|
3220
|
+
for (const tool of plan.sequentialBatch) {
|
|
3221
|
+
const toolId = getToolId(tool);
|
|
3222
|
+
if (signal?.aborted) {
|
|
3223
|
+
results.set(toolId, {
|
|
3224
|
+
toolName: tool.name,
|
|
3225
|
+
error: new Error("Tool execution aborted"),
|
|
3226
|
+
status: "rejected"
|
|
3227
|
+
});
|
|
3228
|
+
throw new Error("Tool execution aborted");
|
|
3229
|
+
}
|
|
3230
|
+
try {
|
|
3231
|
+
const result = await executor(tool);
|
|
3232
|
+
results.set(toolId, {
|
|
3233
|
+
toolName: tool.name,
|
|
3234
|
+
result,
|
|
3235
|
+
status: "fulfilled"
|
|
3236
|
+
});
|
|
3237
|
+
} catch (error) {
|
|
3238
|
+
results.set(toolId, {
|
|
3239
|
+
toolName: tool.name,
|
|
3240
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
3241
|
+
status: "rejected"
|
|
3242
|
+
});
|
|
3243
|
+
}
|
|
3244
|
+
}
|
|
3245
|
+
return results;
|
|
3246
|
+
}
|
|
3247
|
+
function shouldUseParallelExecution(toolsUsed, isReadOnly = defaultIsReadOnlyTool) {
|
|
3248
|
+
if (toolsUsed.length < 2) {
|
|
3249
|
+
return false;
|
|
3250
|
+
}
|
|
3251
|
+
const readOnlyCount = toolsUsed.filter((tool) => isReadOnly(tool.name)).length;
|
|
3252
|
+
return readOnlyCount >= 2;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
// ../../b4m-core/packages/agents/src/ReActAgent.ts
|
|
3135
3256
|
var ReActAgent = class extends EventEmitter {
|
|
3136
3257
|
constructor(context) {
|
|
3137
3258
|
super();
|
|
@@ -3259,77 +3380,51 @@ ${options.context}` : this.getSystemPrompt()
|
|
|
3259
3380
|
if (completionInfo.toolsUsed && completionInfo.toolsUsed.length > 0) {
|
|
3260
3381
|
hadToolCalls = true;
|
|
3261
3382
|
const thinkingBlocks = completionInfo.thinking || [];
|
|
3383
|
+
const unprocessedTools = [];
|
|
3262
3384
|
for (const toolUse of completionInfo.toolsUsed) {
|
|
3263
|
-
const
|
|
3264
|
-
if (processedToolIds.has(
|
|
3265
|
-
|
|
3385
|
+
const toolCallIdStr = getToolId(toolUse);
|
|
3386
|
+
if (!processedToolIds.has(toolCallIdStr)) {
|
|
3387
|
+
processedToolIds.add(toolCallIdStr);
|
|
3388
|
+
unprocessedTools.push(toolUse);
|
|
3266
3389
|
}
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
timestamp: Date.now()
|
|
3276
|
-
}
|
|
3277
|
-
};
|
|
3278
|
-
this.steps.push(actionStep);
|
|
3279
|
-
this.emit("action", actionStep);
|
|
3280
|
-
const queuedObs = this.observationQueue.find((obs) => obs.toolName === toolUse.name);
|
|
3281
|
-
let observation;
|
|
3282
|
-
if (queuedObs) {
|
|
3283
|
-
observation = queuedObs.result;
|
|
3284
|
-
const index = this.observationQueue.indexOf(queuedObs);
|
|
3285
|
-
this.observationQueue.splice(index, 1);
|
|
3286
|
-
} else {
|
|
3287
|
-
const tool = this.context.tools.find((t) => t.toolSchema.name === toolUse.name);
|
|
3288
|
-
if (!tool) {
|
|
3289
|
-
throw new Error(`Tool ${toolUse.name} not found in agent context`);
|
|
3290
|
-
}
|
|
3291
|
-
const params = typeof toolUse.arguments === "string" ? JSON.parse(toolUse.arguments) : toolUse.arguments;
|
|
3292
|
-
observation = await tool.toolFn(params);
|
|
3293
|
-
const toolCallId2 = `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
3294
|
-
const assistantContent = [
|
|
3295
|
-
// Include thinking blocks first (required by Anthropic when thinking is enabled)
|
|
3296
|
-
...thinkingBlocks,
|
|
3297
|
-
// Then the tool use
|
|
3298
|
-
{
|
|
3299
|
-
type: "tool_use",
|
|
3300
|
-
id: toolCallId2,
|
|
3301
|
-
name: toolUse.name,
|
|
3302
|
-
input: params
|
|
3303
|
-
}
|
|
3304
|
-
];
|
|
3305
|
-
this.context.logger.debug(
|
|
3306
|
-
`[assistantContent] ${assistantContent.length} blocks (${thinkingBlocks.length} thinking, 1 tool_use)`
|
|
3307
|
-
);
|
|
3308
|
-
messages.push({
|
|
3309
|
-
role: "assistant",
|
|
3310
|
-
content: assistantContent
|
|
3311
|
-
});
|
|
3312
|
-
messages.push({
|
|
3313
|
-
role: "user",
|
|
3314
|
-
content: [
|
|
3315
|
-
{
|
|
3316
|
-
type: "tool_result",
|
|
3317
|
-
tool_use_id: toolCallId2,
|
|
3318
|
-
content: typeof observation === "string" ? observation : JSON.stringify(observation)
|
|
3319
|
-
}
|
|
3320
|
-
]
|
|
3321
|
-
});
|
|
3390
|
+
}
|
|
3391
|
+
if (unprocessedTools.length === 0) {
|
|
3392
|
+
} else if (options.parallelExecution && shouldUseParallelExecution(unprocessedTools, options.isReadOnlyTool ?? defaultIsReadOnlyTool)) {
|
|
3393
|
+
this.context.logger.debug(
|
|
3394
|
+
`[ReActAgent] Parallel execution enabled for ${unprocessedTools.length} tools`
|
|
3395
|
+
);
|
|
3396
|
+
for (const toolUse of unprocessedTools) {
|
|
3397
|
+
this.emitActionStep(toolUse);
|
|
3322
3398
|
}
|
|
3323
|
-
const
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3399
|
+
const plan = categorizeTools(unprocessedTools, options.isReadOnlyTool ?? defaultIsReadOnlyTool);
|
|
3400
|
+
const results = await executeToolsInParallel(
|
|
3401
|
+
plan,
|
|
3402
|
+
(toolUse) => this.executeToolWithQueueFallback(toolUse),
|
|
3403
|
+
options.signal
|
|
3404
|
+
);
|
|
3405
|
+
for (const toolUse of unprocessedTools) {
|
|
3406
|
+
const toolIdStr = getToolId(toolUse);
|
|
3407
|
+
const result2 = results.get(toolIdStr);
|
|
3408
|
+
const observation = result2?.status === "fulfilled" ? result2.result ?? "" : `Error: ${result2?.error?.message ?? "Unknown error"}`;
|
|
3409
|
+
this.appendToolMessages(messages, toolUse, observation, thinkingBlocks);
|
|
3410
|
+
this.emitObservationStep(toolUse.name, observation);
|
|
3411
|
+
}
|
|
3412
|
+
} else {
|
|
3413
|
+
for (const toolUse of unprocessedTools) {
|
|
3414
|
+
this.emitActionStep(toolUse);
|
|
3415
|
+
const queuedObs = this.observationQueue.find((obs) => obs.toolId === getToolId(toolUse));
|
|
3416
|
+
let observation;
|
|
3417
|
+
if (queuedObs) {
|
|
3418
|
+
const result2 = queuedObs.result;
|
|
3419
|
+
const index = this.observationQueue.indexOf(queuedObs);
|
|
3420
|
+
this.observationQueue.splice(index, 1);
|
|
3421
|
+
observation = typeof result2 === "string" ? result2 : JSON.stringify(result2);
|
|
3422
|
+
} else {
|
|
3423
|
+
observation = await this.executeToolWithQueueFallback(toolUse);
|
|
3424
|
+
this.appendToolMessages(messages, toolUse, observation, thinkingBlocks);
|
|
3329
3425
|
}
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
this.emit("observation", observationStep);
|
|
3426
|
+
this.emitObservationStep(toolUse.name, observation);
|
|
3427
|
+
}
|
|
3333
3428
|
}
|
|
3334
3429
|
}
|
|
3335
3430
|
}
|
|
@@ -3466,8 +3561,160 @@ Remember: You are an autonomous AGENT. Act independently and solve problems proa
|
|
|
3466
3561
|
getToolCallCount() {
|
|
3467
3562
|
return this.toolCallCount;
|
|
3468
3563
|
}
|
|
3564
|
+
/**
|
|
3565
|
+
* Create and emit an action step for a tool use
|
|
3566
|
+
*/
|
|
3567
|
+
emitActionStep(toolUse) {
|
|
3568
|
+
this.toolCallCount++;
|
|
3569
|
+
const actionStep = {
|
|
3570
|
+
type: "action",
|
|
3571
|
+
content: `Using tool: ${toolUse.name}`,
|
|
3572
|
+
metadata: {
|
|
3573
|
+
toolName: toolUse.name,
|
|
3574
|
+
toolInput: toolUse.arguments,
|
|
3575
|
+
timestamp: Date.now()
|
|
3576
|
+
}
|
|
3577
|
+
};
|
|
3578
|
+
this.steps.push(actionStep);
|
|
3579
|
+
this.emit("action", actionStep);
|
|
3580
|
+
}
|
|
3581
|
+
/**
|
|
3582
|
+
* Create and emit an observation step
|
|
3583
|
+
*/
|
|
3584
|
+
emitObservationStep(toolName, observation) {
|
|
3585
|
+
const observationStep = {
|
|
3586
|
+
type: "observation",
|
|
3587
|
+
content: observation,
|
|
3588
|
+
metadata: {
|
|
3589
|
+
toolName,
|
|
3590
|
+
timestamp: Date.now()
|
|
3591
|
+
}
|
|
3592
|
+
};
|
|
3593
|
+
this.steps.push(observationStep);
|
|
3594
|
+
this.emit("observation", observationStep);
|
|
3595
|
+
}
|
|
3596
|
+
/**
|
|
3597
|
+
* Parse tool arguments, handling both string and object forms
|
|
3598
|
+
*/
|
|
3599
|
+
parseToolArguments(args) {
|
|
3600
|
+
return typeof args === "string" ? JSON.parse(args) : args;
|
|
3601
|
+
}
|
|
3602
|
+
/**
|
|
3603
|
+
* Execute a tool and return the result as a string.
|
|
3604
|
+
* Checks observation queue first for backward compatibility.
|
|
3605
|
+
*/
|
|
3606
|
+
async executeToolWithQueueFallback(toolUse) {
|
|
3607
|
+
const queuedObs = this.observationQueue.find((obs) => obs.toolId === getToolId(toolUse));
|
|
3608
|
+
if (queuedObs) {
|
|
3609
|
+
const result2 = queuedObs.result;
|
|
3610
|
+
const index = this.observationQueue.indexOf(queuedObs);
|
|
3611
|
+
this.observationQueue.splice(index, 1);
|
|
3612
|
+
return typeof result2 === "string" ? result2 : JSON.stringify(result2);
|
|
3613
|
+
}
|
|
3614
|
+
const tool = this.context.tools.find((t) => t.toolSchema.name === toolUse.name);
|
|
3615
|
+
if (!tool) {
|
|
3616
|
+
throw new Error(`Tool ${toolUse.name} not found in agent context`);
|
|
3617
|
+
}
|
|
3618
|
+
const params = this.parseToolArguments(toolUse.arguments);
|
|
3619
|
+
const result = await tool.toolFn(params);
|
|
3620
|
+
return typeof result === "string" ? result : JSON.stringify(result);
|
|
3621
|
+
}
|
|
3622
|
+
/**
|
|
3623
|
+
* Build and append tool call/result messages for the conversation history
|
|
3624
|
+
*/
|
|
3625
|
+
appendToolMessages(messages, toolUse, observation, thinkingBlocks) {
|
|
3626
|
+
const params = this.parseToolArguments(toolUse.arguments);
|
|
3627
|
+
const msgToolCallId = `${toolUse.name}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
3628
|
+
const assistantContent = [
|
|
3629
|
+
...thinkingBlocks,
|
|
3630
|
+
{
|
|
3631
|
+
type: "tool_use",
|
|
3632
|
+
id: msgToolCallId,
|
|
3633
|
+
name: toolUse.name,
|
|
3634
|
+
input: params
|
|
3635
|
+
}
|
|
3636
|
+
];
|
|
3637
|
+
messages.push({
|
|
3638
|
+
role: "assistant",
|
|
3639
|
+
content: assistantContent
|
|
3640
|
+
});
|
|
3641
|
+
messages.push({
|
|
3642
|
+
role: "user",
|
|
3643
|
+
content: [
|
|
3644
|
+
{
|
|
3645
|
+
type: "tool_result",
|
|
3646
|
+
tool_use_id: msgToolCallId,
|
|
3647
|
+
content: observation
|
|
3648
|
+
}
|
|
3649
|
+
]
|
|
3650
|
+
});
|
|
3651
|
+
}
|
|
3469
3652
|
};
|
|
3470
3653
|
|
|
3654
|
+
// src/config/toolSafety.ts
|
|
3655
|
+
import { z as z2 } from "zod";
|
|
3656
|
+
var ToolCategorySchema = z2.enum([
|
|
3657
|
+
"auto_approve",
|
|
3658
|
+
// Safe tools that run automatically without permission
|
|
3659
|
+
"prompt_always",
|
|
3660
|
+
// Dangerous tools that ALWAYS require permission (cannot be trusted)
|
|
3661
|
+
"prompt_default"
|
|
3662
|
+
// Tools that prompt by default but can be trusted
|
|
3663
|
+
]);
|
|
3664
|
+
var ToolSafetyConfigSchema = z2.object({
|
|
3665
|
+
categories: z2.record(z2.string(), ToolCategorySchema),
|
|
3666
|
+
trustedTools: z2.array(z2.string())
|
|
3667
|
+
});
|
|
3668
|
+
var DEFAULT_TOOL_CATEGORIES = {
|
|
3669
|
+
// ===== AUTO APPROVE (Safe tools) =====
|
|
3670
|
+
// These tools have no side effects and are always safe to execute
|
|
3671
|
+
math_evaluate: "auto_approve",
|
|
3672
|
+
current_datetime: "auto_approve",
|
|
3673
|
+
dice_roll: "auto_approve",
|
|
3674
|
+
prompt_enhancement: "auto_approve",
|
|
3675
|
+
weather_info: "prompt_default",
|
|
3676
|
+
// ===== PROMPT ALWAYS (Dangerous tools) =====
|
|
3677
|
+
// These tools can modify files, execute code, or have other dangerous side effects
|
|
3678
|
+
// They ALWAYS require permission and cannot be trusted automatically
|
|
3679
|
+
edit_file: "prompt_always",
|
|
3680
|
+
edit_local_file: "prompt_always",
|
|
3681
|
+
create_file: "prompt_always",
|
|
3682
|
+
delete_file: "prompt_always",
|
|
3683
|
+
shell_execute: "prompt_always",
|
|
3684
|
+
bash_execute: "prompt_always",
|
|
3685
|
+
git_commit: "prompt_always",
|
|
3686
|
+
git_push: "prompt_always",
|
|
3687
|
+
// ===== PROMPT DEFAULT (Repository read tools) =====
|
|
3688
|
+
// These tools read from the repository but don't modify anything
|
|
3689
|
+
// Users can trust them if they want to avoid prompts
|
|
3690
|
+
web_search: "prompt_default",
|
|
3691
|
+
deep_research: "prompt_default",
|
|
3692
|
+
file_read: "prompt_default",
|
|
3693
|
+
grep_search: "prompt_default",
|
|
3694
|
+
glob_files: "prompt_default",
|
|
3695
|
+
get_file_tree: "prompt_default",
|
|
3696
|
+
git_status: "prompt_default",
|
|
3697
|
+
git_diff: "prompt_default",
|
|
3698
|
+
git_log: "prompt_default",
|
|
3699
|
+
git_branch: "prompt_default"
|
|
3700
|
+
};
|
|
3701
|
+
function getToolCategory(toolName, customCategories) {
|
|
3702
|
+
if (customCategories && toolName in customCategories) {
|
|
3703
|
+
return customCategories[toolName];
|
|
3704
|
+
}
|
|
3705
|
+
if (toolName in DEFAULT_TOOL_CATEGORIES) {
|
|
3706
|
+
return DEFAULT_TOOL_CATEGORIES[toolName];
|
|
3707
|
+
}
|
|
3708
|
+
return "prompt_default";
|
|
3709
|
+
}
|
|
3710
|
+
function canTrustTool(toolName, customCategories) {
|
|
3711
|
+
const category = getToolCategory(toolName, customCategories);
|
|
3712
|
+
return category !== "prompt_always";
|
|
3713
|
+
}
|
|
3714
|
+
function isReadOnlyTool(toolName, customCategories) {
|
|
3715
|
+
return getToolCategory(toolName, customCategories) !== "prompt_always";
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3471
3718
|
// src/core/prompts.ts
|
|
3472
3719
|
var TOOL_GREP_SEARCH = "grep_search";
|
|
3473
3720
|
var TOOL_GLOB_FILES = "glob_files";
|
|
@@ -3568,38 +3815,38 @@ Remember: Use context from previous messages to understand follow-up questions.$
|
|
|
3568
3815
|
// ../../b4m-core/packages/services/dist/src/referService/generateCodes.js
|
|
3569
3816
|
import { randomBytes } from "crypto";
|
|
3570
3817
|
import range from "lodash/range.js";
|
|
3571
|
-
import { z as
|
|
3572
|
-
var generateReferralCodesSchema =
|
|
3573
|
-
count:
|
|
3574
|
-
unlimitedUse:
|
|
3575
|
-
expiresAt:
|
|
3818
|
+
import { z as z3 } from "zod";
|
|
3819
|
+
var generateReferralCodesSchema = z3.object({
|
|
3820
|
+
count: z3.number().optional(),
|
|
3821
|
+
unlimitedUse: z3.boolean().optional(),
|
|
3822
|
+
expiresAt: z3.date().optional()
|
|
3576
3823
|
});
|
|
3577
3824
|
|
|
3578
3825
|
// ../../b4m-core/packages/services/dist/src/referService/delete.js
|
|
3579
|
-
import { z as
|
|
3580
|
-
var deleteInviteCodesSchema =
|
|
3581
|
-
ids:
|
|
3826
|
+
import { z as z4 } from "zod";
|
|
3827
|
+
var deleteInviteCodesSchema = z4.object({
|
|
3828
|
+
ids: z4.array(z4.string())
|
|
3582
3829
|
});
|
|
3583
3830
|
|
|
3584
3831
|
// ../../b4m-core/packages/services/dist/src/userService/login.js
|
|
3585
|
-
import { z as
|
|
3832
|
+
import { z as z5 } from "zod";
|
|
3586
3833
|
import bcrypt from "bcryptjs";
|
|
3587
|
-
var loginUserSchema =
|
|
3588
|
-
usernameOrEmail:
|
|
3589
|
-
password:
|
|
3590
|
-
metadata:
|
|
3591
|
-
loginTime:
|
|
3592
|
-
userAgent:
|
|
3593
|
-
browser:
|
|
3594
|
-
operatingSystem:
|
|
3595
|
-
deviceType:
|
|
3596
|
-
screenResolution:
|
|
3597
|
-
viewportSize:
|
|
3598
|
-
colorDepth:
|
|
3599
|
-
pixelDepth:
|
|
3600
|
-
devicePixelRatio:
|
|
3601
|
-
ip:
|
|
3602
|
-
location:
|
|
3834
|
+
var loginUserSchema = z5.object({
|
|
3835
|
+
usernameOrEmail: z5.string(),
|
|
3836
|
+
password: z5.string(),
|
|
3837
|
+
metadata: z5.object({
|
|
3838
|
+
loginTime: z5.date(),
|
|
3839
|
+
userAgent: z5.string(),
|
|
3840
|
+
browser: z5.string(),
|
|
3841
|
+
operatingSystem: z5.string(),
|
|
3842
|
+
deviceType: z5.string(),
|
|
3843
|
+
screenResolution: z5.string(),
|
|
3844
|
+
viewportSize: z5.string(),
|
|
3845
|
+
colorDepth: z5.number(),
|
|
3846
|
+
pixelDepth: z5.number(),
|
|
3847
|
+
devicePixelRatio: z5.number(),
|
|
3848
|
+
ip: z5.string().optional().default(""),
|
|
3849
|
+
location: z5.string().optional()
|
|
3603
3850
|
}).optional()
|
|
3604
3851
|
});
|
|
3605
3852
|
|
|
@@ -3609,78 +3856,78 @@ import escapeRegExp from "lodash/escapeRegExp.js";
|
|
|
3609
3856
|
|
|
3610
3857
|
// ../../b4m-core/packages/services/dist/src/userService/forgotPassword.js
|
|
3611
3858
|
import { randomUUID } from "crypto";
|
|
3612
|
-
import { z as
|
|
3613
|
-
var forgotPasswordUserSchema =
|
|
3614
|
-
email:
|
|
3859
|
+
import { z as z6 } from "zod";
|
|
3860
|
+
var forgotPasswordUserSchema = z6.object({
|
|
3861
|
+
email: z6.string().email()
|
|
3615
3862
|
});
|
|
3616
3863
|
|
|
3617
3864
|
// ../../b4m-core/packages/services/dist/src/userService/update.js
|
|
3618
3865
|
import bcrypt3 from "bcryptjs";
|
|
3619
|
-
import { z as
|
|
3620
|
-
var updateUserSchema =
|
|
3621
|
-
name:
|
|
3622
|
-
username:
|
|
3866
|
+
import { z as z7 } from "zod";
|
|
3867
|
+
var updateUserSchema = z7.object({
|
|
3868
|
+
name: z7.string().optional(),
|
|
3869
|
+
username: z7.string().optional(),
|
|
3623
3870
|
// email field removed - users must use the secure email change verification flow
|
|
3624
3871
|
// See requestEmailChange and verifyEmailChange in userService
|
|
3625
|
-
password:
|
|
3626
|
-
team:
|
|
3627
|
-
role:
|
|
3628
|
-
phone:
|
|
3629
|
-
preferredLanguage:
|
|
3630
|
-
preferredContact:
|
|
3631
|
-
preferredVoice:
|
|
3632
|
-
tshirtSize:
|
|
3633
|
-
geoLocation:
|
|
3634
|
-
lastNotebookId:
|
|
3635
|
-
tags:
|
|
3636
|
-
lastCreditsPurchasedAt:
|
|
3637
|
-
systemFiles:
|
|
3638
|
-
fileId:
|
|
3639
|
-
enabled:
|
|
3872
|
+
password: z7.string().nullable().optional(),
|
|
3873
|
+
team: z7.string().nullable().optional(),
|
|
3874
|
+
role: z7.string().nullable().optional(),
|
|
3875
|
+
phone: z7.string().nullable().optional(),
|
|
3876
|
+
preferredLanguage: z7.string().nullable().optional(),
|
|
3877
|
+
preferredContact: z7.string().nullable().optional(),
|
|
3878
|
+
preferredVoice: z7.string().nullable().optional(),
|
|
3879
|
+
tshirtSize: z7.string().nullable().optional(),
|
|
3880
|
+
geoLocation: z7.string().nullable().optional(),
|
|
3881
|
+
lastNotebookId: z7.string().nullable().optional(),
|
|
3882
|
+
tags: z7.array(z7.string()).nullable().optional(),
|
|
3883
|
+
lastCreditsPurchasedAt: z7.date().nullable().optional(),
|
|
3884
|
+
systemFiles: z7.array(z7.object({
|
|
3885
|
+
fileId: z7.string(),
|
|
3886
|
+
enabled: z7.boolean()
|
|
3640
3887
|
})).nullable().optional(),
|
|
3641
|
-
securityQuestions:
|
|
3642
|
-
photoUrl:
|
|
3643
|
-
showCreditsUsed:
|
|
3888
|
+
securityQuestions: z7.array(z7.object({ question: z7.string(), answer: z7.string() })).nullable().optional(),
|
|
3889
|
+
photoUrl: z7.string().nullable().optional(),
|
|
3890
|
+
showCreditsUsed: z7.boolean().optional()
|
|
3644
3891
|
});
|
|
3645
3892
|
|
|
3646
3893
|
// ../../b4m-core/packages/services/dist/src/userService/adminUpdate.js
|
|
3647
|
-
import { z as
|
|
3894
|
+
import { z as z9 } from "zod";
|
|
3648
3895
|
|
|
3649
3896
|
// ../../b4m-core/packages/services/dist/src/friendshipService/sendFriendRequest.js
|
|
3650
|
-
import { z as
|
|
3651
|
-
var sendFriendRequestSchema =
|
|
3652
|
-
requesterId:
|
|
3653
|
-
recipientId:
|
|
3654
|
-
message:
|
|
3897
|
+
import { z as z8 } from "zod";
|
|
3898
|
+
var sendFriendRequestSchema = z8.object({
|
|
3899
|
+
requesterId: z8.string(),
|
|
3900
|
+
recipientId: z8.string(),
|
|
3901
|
+
message: z8.string().optional()
|
|
3655
3902
|
});
|
|
3656
3903
|
|
|
3657
3904
|
// ../../b4m-core/packages/services/dist/src/userService/adminUpdate.js
|
|
3658
3905
|
var adminUpdateUserSchema = updateUserSchema.extend({
|
|
3659
|
-
id:
|
|
3906
|
+
id: z9.string(),
|
|
3660
3907
|
// Admins can directly update email addresses without verification
|
|
3661
|
-
email:
|
|
3662
|
-
role:
|
|
3663
|
-
isAdmin:
|
|
3664
|
-
organizationId:
|
|
3665
|
-
storageLimit:
|
|
3666
|
-
currentCredits:
|
|
3667
|
-
isBanned:
|
|
3668
|
-
isModerated:
|
|
3669
|
-
subscribedUntil:
|
|
3670
|
-
systemFiles:
|
|
3671
|
-
level:
|
|
3672
|
-
lastNotebookId:
|
|
3673
|
-
userNotes:
|
|
3674
|
-
numReferralsAvailable:
|
|
3908
|
+
email: z9.string().email().optional(),
|
|
3909
|
+
role: z9.string().optional().nullable(),
|
|
3910
|
+
isAdmin: z9.boolean().optional(),
|
|
3911
|
+
organizationId: z9.string().optional().nullable(),
|
|
3912
|
+
storageLimit: z9.number().optional(),
|
|
3913
|
+
currentCredits: z9.number().optional(),
|
|
3914
|
+
isBanned: z9.boolean().optional(),
|
|
3915
|
+
isModerated: z9.boolean().optional(),
|
|
3916
|
+
subscribedUntil: z9.string().optional().nullable(),
|
|
3917
|
+
systemFiles: z9.array(z9.object({ fileId: z9.string(), enabled: z9.boolean() })).optional(),
|
|
3918
|
+
level: z9.enum(["DemoUser", "PaidUser", "VIPUser", "ManagerUser", "AdminUser"]).optional(),
|
|
3919
|
+
lastNotebookId: z9.string().optional().nullable(),
|
|
3920
|
+
userNotes: z9.array(z9.object({ timestamp: z9.string(), note: z9.string(), userName: z9.string() })).optional(),
|
|
3921
|
+
numReferralsAvailable: z9.number().optional()
|
|
3675
3922
|
});
|
|
3676
3923
|
|
|
3677
3924
|
// ../../b4m-core/packages/services/dist/src/userService/register.js
|
|
3678
|
-
import { z as
|
|
3925
|
+
import { z as z11 } from "zod";
|
|
3679
3926
|
import bcrypt4 from "bcryptjs";
|
|
3680
3927
|
|
|
3681
3928
|
// ../../b4m-core/packages/services/dist/src/creditService/addCredits.js
|
|
3682
|
-
import { z as
|
|
3683
|
-
var AddCreditsSchema =
|
|
3929
|
+
import { z as z10 } from "zod";
|
|
3930
|
+
var AddCreditsSchema = z10.discriminatedUnion("type", [
|
|
3684
3931
|
PurchaseTransaction.omit({ createdAt: true, updatedAt: true }),
|
|
3685
3932
|
SubscriptionCreditTransaction.omit({ createdAt: true, updatedAt: true }),
|
|
3686
3933
|
GenericCreditAddTransaction.omit({ createdAt: true, updatedAt: true }),
|
|
@@ -3688,57 +3935,57 @@ var AddCreditsSchema = z9.discriminatedUnion("type", [
|
|
|
3688
3935
|
]);
|
|
3689
3936
|
|
|
3690
3937
|
// ../../b4m-core/packages/services/dist/src/userService/register.js
|
|
3691
|
-
var registerUserSchema =
|
|
3692
|
-
username:
|
|
3693
|
-
email:
|
|
3694
|
-
name:
|
|
3695
|
-
inviteCode:
|
|
3696
|
-
password:
|
|
3697
|
-
metadata:
|
|
3698
|
-
loginTime:
|
|
3699
|
-
userAgent:
|
|
3700
|
-
browser:
|
|
3701
|
-
operatingSystem:
|
|
3702
|
-
deviceType:
|
|
3703
|
-
screenResolution:
|
|
3704
|
-
viewportSize:
|
|
3705
|
-
colorDepth:
|
|
3706
|
-
pixelDepth:
|
|
3707
|
-
devicePixelRatio:
|
|
3708
|
-
ip:
|
|
3709
|
-
location:
|
|
3938
|
+
var registerUserSchema = z11.object({
|
|
3939
|
+
username: z11.string(),
|
|
3940
|
+
email: z11.string(),
|
|
3941
|
+
name: z11.string(),
|
|
3942
|
+
inviteCode: z11.string(),
|
|
3943
|
+
password: z11.string(),
|
|
3944
|
+
metadata: z11.object({
|
|
3945
|
+
loginTime: z11.date(),
|
|
3946
|
+
userAgent: z11.string(),
|
|
3947
|
+
browser: z11.string(),
|
|
3948
|
+
operatingSystem: z11.string(),
|
|
3949
|
+
deviceType: z11.string(),
|
|
3950
|
+
screenResolution: z11.string(),
|
|
3951
|
+
viewportSize: z11.string(),
|
|
3952
|
+
colorDepth: z11.number(),
|
|
3953
|
+
pixelDepth: z11.number(),
|
|
3954
|
+
devicePixelRatio: z11.number(),
|
|
3955
|
+
ip: z11.string().optional().default(""),
|
|
3956
|
+
location: z11.string().optional()
|
|
3710
3957
|
}).optional()
|
|
3711
3958
|
});
|
|
3712
3959
|
|
|
3713
3960
|
// ../../b4m-core/packages/services/dist/src/userService/adminDelete.js
|
|
3714
|
-
import { z as
|
|
3715
|
-
var adminDeleteUserSchema =
|
|
3716
|
-
id:
|
|
3961
|
+
import { z as z12 } from "zod";
|
|
3962
|
+
var adminDeleteUserSchema = z12.object({
|
|
3963
|
+
id: z12.string()
|
|
3717
3964
|
});
|
|
3718
3965
|
|
|
3719
3966
|
// ../../b4m-core/packages/services/dist/src/userService/searchUserCollection.js
|
|
3720
|
-
import { z as
|
|
3721
|
-
var searchUserCollectionSchema =
|
|
3722
|
-
userId:
|
|
3723
|
-
page:
|
|
3724
|
-
limit:
|
|
3725
|
-
search:
|
|
3726
|
-
type:
|
|
3967
|
+
import { z as z13 } from "zod";
|
|
3968
|
+
var searchUserCollectionSchema = z13.object({
|
|
3969
|
+
userId: z13.string(),
|
|
3970
|
+
page: z13.coerce.number().optional().default(1),
|
|
3971
|
+
limit: z13.coerce.number().optional().default(10),
|
|
3972
|
+
search: z13.string().optional().default(""),
|
|
3973
|
+
type: z13.nativeEnum(CollectionType).optional()
|
|
3727
3974
|
});
|
|
3728
3975
|
|
|
3729
3976
|
// ../../b4m-core/packages/services/dist/src/userService/recalculateUserStorage.js
|
|
3730
|
-
import { z as
|
|
3731
|
-
var recalculateUserStorageSchema =
|
|
3977
|
+
import { z as z14 } from "zod";
|
|
3978
|
+
var recalculateUserStorageSchema = z14.object({
|
|
3732
3979
|
/**
|
|
3733
3980
|
* The user to recalculate the storage for
|
|
3734
3981
|
*/
|
|
3735
|
-
userId:
|
|
3982
|
+
userId: z14.string()
|
|
3736
3983
|
});
|
|
3737
3984
|
|
|
3738
3985
|
// ../../b4m-core/packages/services/dist/src/userService/listRecentActivities.js
|
|
3739
|
-
import { z as
|
|
3740
|
-
var listRecentActivitiesSchema =
|
|
3741
|
-
coverage:
|
|
3986
|
+
import { z as z15 } from "zod";
|
|
3987
|
+
var listRecentActivitiesSchema = z15.object({
|
|
3988
|
+
coverage: z15.enum(["all", "important"]).default("important")
|
|
3742
3989
|
});
|
|
3743
3990
|
var IMPORTANT_COUNTER_NAMES = [
|
|
3744
3991
|
SessionEvents.CREATE_SESSION,
|
|
@@ -3752,82 +3999,82 @@ var IMPORTANT_COUNTER_NAMES = [
|
|
|
3752
3999
|
|
|
3753
4000
|
// ../../b4m-core/packages/services/dist/src/userService/sendEmailVerification.js
|
|
3754
4001
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
3755
|
-
import { z as
|
|
3756
|
-
var sendEmailVerificationSchema =
|
|
3757
|
-
userId:
|
|
4002
|
+
import { z as z16 } from "zod";
|
|
4003
|
+
var sendEmailVerificationSchema = z16.object({
|
|
4004
|
+
userId: z16.string()
|
|
3758
4005
|
});
|
|
3759
4006
|
|
|
3760
4007
|
// ../../b4m-core/packages/services/dist/src/userService/verifyEmailToken.js
|
|
3761
|
-
import { z as
|
|
4008
|
+
import { z as z17 } from "zod";
|
|
3762
4009
|
|
|
3763
4010
|
// ../../b4m-core/packages/services/dist/src/utils/crypto.js
|
|
3764
4011
|
import crypto from "crypto";
|
|
3765
4012
|
|
|
3766
4013
|
// ../../b4m-core/packages/services/dist/src/userService/verifyEmailToken.js
|
|
3767
|
-
var verifyEmailTokenSchema =
|
|
3768
|
-
token:
|
|
4014
|
+
var verifyEmailTokenSchema = z17.object({
|
|
4015
|
+
token: z17.string()
|
|
3769
4016
|
});
|
|
3770
4017
|
|
|
3771
4018
|
// ../../b4m-core/packages/services/dist/src/userService/resendEmailVerification.js
|
|
3772
4019
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
3773
|
-
import { z as
|
|
3774
|
-
var resendEmailVerificationSchema =
|
|
3775
|
-
userId:
|
|
4020
|
+
import { z as z18 } from "zod";
|
|
4021
|
+
var resendEmailVerificationSchema = z18.object({
|
|
4022
|
+
userId: z18.string()
|
|
3776
4023
|
});
|
|
3777
4024
|
|
|
3778
4025
|
// ../../b4m-core/packages/services/dist/src/userService/requestEmailChange.js
|
|
3779
4026
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
3780
|
-
import { z as
|
|
3781
|
-
var requestEmailChangeSchema =
|
|
3782
|
-
userId:
|
|
3783
|
-
newEmail:
|
|
3784
|
-
password:
|
|
4027
|
+
import { z as z19 } from "zod";
|
|
4028
|
+
var requestEmailChangeSchema = z19.object({
|
|
4029
|
+
userId: z19.string(),
|
|
4030
|
+
newEmail: z19.string().email(),
|
|
4031
|
+
password: z19.string()
|
|
3785
4032
|
});
|
|
3786
4033
|
|
|
3787
4034
|
// ../../b4m-core/packages/services/dist/src/userService/verifyEmailChange.js
|
|
3788
|
-
import { z as
|
|
3789
|
-
var verifyEmailChangeSchema =
|
|
3790
|
-
token:
|
|
4035
|
+
import { z as z20 } from "zod";
|
|
4036
|
+
var verifyEmailChangeSchema = z20.object({
|
|
4037
|
+
token: z20.string()
|
|
3791
4038
|
});
|
|
3792
4039
|
|
|
3793
4040
|
// ../../b4m-core/packages/services/dist/src/userService/cancelEmailChange.js
|
|
3794
|
-
import { z as
|
|
3795
|
-
var cancelEmailChangeSchema =
|
|
3796
|
-
userId:
|
|
4041
|
+
import { z as z21 } from "zod";
|
|
4042
|
+
var cancelEmailChangeSchema = z21.object({
|
|
4043
|
+
userId: z21.string()
|
|
3797
4044
|
});
|
|
3798
4045
|
|
|
3799
4046
|
// ../../b4m-core/packages/services/dist/src/userApiKeyService/create.js
|
|
3800
4047
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
3801
4048
|
import bcrypt5 from "bcryptjs";
|
|
3802
|
-
import { z as
|
|
3803
|
-
var createUserApiKeySchema =
|
|
3804
|
-
name:
|
|
3805
|
-
scopes:
|
|
3806
|
-
expiresAt:
|
|
3807
|
-
rateLimit:
|
|
3808
|
-
requestsPerMinute:
|
|
3809
|
-
requestsPerDay:
|
|
4049
|
+
import { z as z22 } from "zod";
|
|
4050
|
+
var createUserApiKeySchema = z22.object({
|
|
4051
|
+
name: z22.string().min(1).max(100),
|
|
4052
|
+
scopes: z22.array(z22.nativeEnum(ApiKeyScope)).min(1),
|
|
4053
|
+
expiresAt: z22.date().optional(),
|
|
4054
|
+
rateLimit: z22.object({
|
|
4055
|
+
requestsPerMinute: z22.number().min(1).max(1e3).default(60),
|
|
4056
|
+
requestsPerDay: z22.number().min(1).max(1e4).default(1e3)
|
|
3810
4057
|
}).optional(),
|
|
3811
|
-
metadata:
|
|
3812
|
-
clientIP:
|
|
3813
|
-
userAgent:
|
|
3814
|
-
createdFrom:
|
|
4058
|
+
metadata: z22.object({
|
|
4059
|
+
clientIP: z22.string().optional(),
|
|
4060
|
+
userAgent: z22.string().optional(),
|
|
4061
|
+
createdFrom: z22.enum(["dashboard", "cli", "api"])
|
|
3815
4062
|
})
|
|
3816
4063
|
});
|
|
3817
4064
|
|
|
3818
4065
|
// ../../b4m-core/packages/services/dist/src/userApiKeyService/revoke.js
|
|
3819
|
-
import { z as
|
|
3820
|
-
var revokeUserApiKeySchema =
|
|
3821
|
-
keyId:
|
|
3822
|
-
reason:
|
|
4066
|
+
import { z as z23 } from "zod";
|
|
4067
|
+
var revokeUserApiKeySchema = z23.object({
|
|
4068
|
+
keyId: z23.string(),
|
|
4069
|
+
reason: z23.string().optional()
|
|
3823
4070
|
});
|
|
3824
4071
|
|
|
3825
4072
|
// ../../b4m-core/packages/services/dist/src/userApiKeyService/rotate.js
|
|
3826
4073
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
3827
4074
|
import bcrypt6 from "bcryptjs";
|
|
3828
|
-
import { z as
|
|
3829
|
-
var rotateUserApiKeySchema =
|
|
3830
|
-
keyId:
|
|
4075
|
+
import { z as z24 } from "zod";
|
|
4076
|
+
var rotateUserApiKeySchema = z24.object({
|
|
4077
|
+
keyId: z24.string()
|
|
3831
4078
|
});
|
|
3832
4079
|
|
|
3833
4080
|
// ../../b4m-core/packages/services/dist/src/userApiKeyService/validate.js
|
|
@@ -3974,29 +4221,29 @@ var EVENT_GROUPS = [
|
|
|
3974
4221
|
];
|
|
3975
4222
|
|
|
3976
4223
|
// ../../b4m-core/packages/services/dist/src/countersService/generateReport.js
|
|
3977
|
-
import { z as
|
|
4224
|
+
import { z as z26 } from "zod";
|
|
3978
4225
|
|
|
3979
4226
|
// ../../b4m-core/packages/services/dist/src/countersService/getAllCounterFrom24Hours.js
|
|
3980
|
-
import { z as
|
|
4227
|
+
import { z as z25 } from "zod";
|
|
3981
4228
|
import dayjs2 from "dayjs";
|
|
3982
|
-
var getCounterTotalsForLast24HoursSchema =
|
|
3983
|
-
date:
|
|
3984
|
-
endDate:
|
|
4229
|
+
var getCounterTotalsForLast24HoursSchema = z25.object({
|
|
4230
|
+
date: z25.string(),
|
|
4231
|
+
endDate: z25.string().optional()
|
|
3985
4232
|
});
|
|
3986
4233
|
|
|
3987
4234
|
// ../../b4m-core/packages/services/dist/src/countersService/generateReport.js
|
|
3988
|
-
var generateDailyReportSchema =
|
|
3989
|
-
date:
|
|
3990
|
-
startDate:
|
|
3991
|
-
endDate:
|
|
4235
|
+
var generateDailyReportSchema = z26.object({
|
|
4236
|
+
date: z26.string(),
|
|
4237
|
+
startDate: z26.string().optional(),
|
|
4238
|
+
endDate: z26.string().optional()
|
|
3992
4239
|
});
|
|
3993
4240
|
|
|
3994
4241
|
// ../../b4m-core/packages/services/dist/src/countersService/incrementUserCounter.js
|
|
3995
|
-
import { z as
|
|
3996
|
-
var incrementUserCounterSchema =
|
|
3997
|
-
action:
|
|
3998
|
-
increment:
|
|
3999
|
-
metadata:
|
|
4242
|
+
import { z as z27 } from "zod";
|
|
4243
|
+
var incrementUserCounterSchema = z27.object({
|
|
4244
|
+
action: z27.string(),
|
|
4245
|
+
increment: z27.coerce.number().default(1).optional(),
|
|
4246
|
+
metadata: z27.record(z27.unknown()).optional()
|
|
4000
4247
|
});
|
|
4001
4248
|
|
|
4002
4249
|
// ../../b4m-core/packages/services/dist/src/countersService/sendSlackReport.js
|
|
@@ -4017,42 +4264,42 @@ import yauzl from "yauzl";
|
|
|
4017
4264
|
import axios3 from "axios";
|
|
4018
4265
|
|
|
4019
4266
|
// ../../b4m-core/packages/services/dist/src/importHistoryService/importOpenaiHistory.js
|
|
4020
|
-
import { z as
|
|
4267
|
+
import { z as z28 } from "zod";
|
|
4021
4268
|
import last from "lodash/last.js";
|
|
4022
|
-
var epochDate = () =>
|
|
4023
|
-
var openaiConversationSchema =
|
|
4024
|
-
id:
|
|
4025
|
-
title:
|
|
4269
|
+
var epochDate = () => z28.preprocess((val) => new Date(Number(val) * 1e3), z28.date());
|
|
4270
|
+
var openaiConversationSchema = z28.object({
|
|
4271
|
+
id: z28.string(),
|
|
4272
|
+
title: z28.string(),
|
|
4026
4273
|
create_time: epochDate(),
|
|
4027
4274
|
update_time: epochDate().nullable(),
|
|
4028
|
-
mapping:
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
id:
|
|
4032
|
-
parent:
|
|
4033
|
-
children:
|
|
4034
|
-
message:
|
|
4035
|
-
id:
|
|
4275
|
+
mapping: z28.record(
|
|
4276
|
+
z28.string(),
|
|
4277
|
+
z28.object({
|
|
4278
|
+
id: z28.string(),
|
|
4279
|
+
parent: z28.string().nullable(),
|
|
4280
|
+
children: z28.array(z28.string()),
|
|
4281
|
+
message: z28.object({
|
|
4282
|
+
id: z28.string(),
|
|
4036
4283
|
create_time: epochDate(),
|
|
4037
4284
|
update_time: epochDate().nullable(),
|
|
4038
|
-
author:
|
|
4039
|
-
role:
|
|
4040
|
-
name:
|
|
4041
|
-
metadata:
|
|
4285
|
+
author: z28.object({
|
|
4286
|
+
role: z28.string(),
|
|
4287
|
+
name: z28.string().nullable(),
|
|
4288
|
+
metadata: z28.any()
|
|
4042
4289
|
// Accept any metadata structure
|
|
4043
4290
|
}).passthrough(),
|
|
4044
4291
|
// Allow extra fields in author
|
|
4045
|
-
content:
|
|
4046
|
-
content_type:
|
|
4047
|
-
parts:
|
|
4292
|
+
content: z28.object({
|
|
4293
|
+
content_type: z28.string(),
|
|
4294
|
+
parts: z28.array(z28.any()).optional()
|
|
4048
4295
|
// Accept any type in parts array (strings, objects, etc.)
|
|
4049
4296
|
}).passthrough(),
|
|
4050
4297
|
// Allow extra fields in content
|
|
4051
|
-
status:
|
|
4052
|
-
end_turn:
|
|
4053
|
-
metadata:
|
|
4298
|
+
status: z28.string(),
|
|
4299
|
+
end_turn: z28.boolean().nullable(),
|
|
4300
|
+
metadata: z28.any(),
|
|
4054
4301
|
// Accept any metadata structure since it varies widely
|
|
4055
|
-
recipient:
|
|
4302
|
+
recipient: z28.string()
|
|
4056
4303
|
}).passthrough().nullable()
|
|
4057
4304
|
}).passthrough()
|
|
4058
4305
|
// Allow extra fields in mapping node
|
|
@@ -4060,38 +4307,38 @@ var openaiConversationSchema = z27.object({
|
|
|
4060
4307
|
}).passthrough();
|
|
4061
4308
|
|
|
4062
4309
|
// ../../b4m-core/packages/services/dist/src/importHistoryService/importClaudeHistory.js
|
|
4063
|
-
import { z as
|
|
4064
|
-
var claudeChatMessageSchema =
|
|
4065
|
-
uuid:
|
|
4066
|
-
text:
|
|
4067
|
-
content:
|
|
4068
|
-
|
|
4069
|
-
type:
|
|
4310
|
+
import { z as z29 } from "zod";
|
|
4311
|
+
var claudeChatMessageSchema = z29.object({
|
|
4312
|
+
uuid: z29.string().uuid(),
|
|
4313
|
+
text: z29.string(),
|
|
4314
|
+
content: z29.array(
|
|
4315
|
+
z29.object({
|
|
4316
|
+
type: z29.string(),
|
|
4070
4317
|
// Accept any type: "text", "image", "tool_result", etc.
|
|
4071
|
-
text:
|
|
4318
|
+
text: z29.string().optional()
|
|
4072
4319
|
// Make text optional since tool_result may not have it
|
|
4073
4320
|
}).passthrough()
|
|
4074
4321
|
// Allow all other fields
|
|
4075
4322
|
),
|
|
4076
|
-
sender:
|
|
4077
|
-
created_at:
|
|
4078
|
-
updated_at:
|
|
4079
|
-
attachments:
|
|
4323
|
+
sender: z29.enum(["human", "assistant"]),
|
|
4324
|
+
created_at: z29.coerce.date(),
|
|
4325
|
+
updated_at: z29.coerce.date(),
|
|
4326
|
+
attachments: z29.array(z29.any()),
|
|
4080
4327
|
// Accept any attachment structure
|
|
4081
|
-
files:
|
|
4328
|
+
files: z29.array(z29.any())
|
|
4082
4329
|
// Accept any file structure
|
|
4083
4330
|
}).passthrough();
|
|
4084
|
-
var claudeConversationSchema =
|
|
4085
|
-
uuid:
|
|
4086
|
-
name:
|
|
4087
|
-
summary:
|
|
4331
|
+
var claudeConversationSchema = z29.object({
|
|
4332
|
+
uuid: z29.string().uuid(),
|
|
4333
|
+
name: z29.string(),
|
|
4334
|
+
summary: z29.string().optional(),
|
|
4088
4335
|
// Summary field is optional
|
|
4089
|
-
created_at:
|
|
4090
|
-
updated_at:
|
|
4091
|
-
account:
|
|
4092
|
-
uuid:
|
|
4336
|
+
created_at: z29.coerce.date(),
|
|
4337
|
+
updated_at: z29.coerce.date(),
|
|
4338
|
+
account: z29.object({
|
|
4339
|
+
uuid: z29.string().uuid()
|
|
4093
4340
|
}),
|
|
4094
|
-
chat_messages:
|
|
4341
|
+
chat_messages: z29.array(claudeChatMessageSchema)
|
|
4095
4342
|
}).passthrough();
|
|
4096
4343
|
|
|
4097
4344
|
// ../../b4m-core/packages/services/dist/src/importHistoryService/index.js
|
|
@@ -4102,357 +4349,357 @@ var ImportSource;
|
|
|
4102
4349
|
})(ImportSource || (ImportSource = {}));
|
|
4103
4350
|
|
|
4104
4351
|
// ../../b4m-core/packages/services/dist/src/sessionService/create.js
|
|
4105
|
-
import { z as
|
|
4106
|
-
var createSessionParametersSchema =
|
|
4107
|
-
name:
|
|
4108
|
-
knowledgeIds:
|
|
4109
|
-
artifactIds:
|
|
4110
|
-
agentIds:
|
|
4111
|
-
tags:
|
|
4112
|
-
summary:
|
|
4113
|
-
summaryAt:
|
|
4114
|
-
clonedSourceId:
|
|
4115
|
-
forkedSourceId:
|
|
4116
|
-
projectId:
|
|
4117
|
-
lastUsedModel:
|
|
4352
|
+
import { z as z30 } from "zod";
|
|
4353
|
+
var createSessionParametersSchema = z30.object({
|
|
4354
|
+
name: z30.string(),
|
|
4355
|
+
knowledgeIds: z30.array(z30.string()).optional(),
|
|
4356
|
+
artifactIds: z30.array(z30.string()).optional(),
|
|
4357
|
+
agentIds: z30.array(z30.string()).optional(),
|
|
4358
|
+
tags: z30.array(z30.object({ name: z30.string(), strength: z30.number() })).optional(),
|
|
4359
|
+
summary: z30.string().optional(),
|
|
4360
|
+
summaryAt: z30.date().optional(),
|
|
4361
|
+
clonedSourceId: z30.string().optional().nullable(),
|
|
4362
|
+
forkedSourceId: z30.string().optional().nullable(),
|
|
4363
|
+
projectId: z30.string().optional(),
|
|
4364
|
+
lastUsedModel: z30.string().optional().nullable()
|
|
4118
4365
|
});
|
|
4119
4366
|
|
|
4120
4367
|
// ../../b4m-core/packages/services/dist/src/sessionService/delete.js
|
|
4121
|
-
import { z as
|
|
4122
|
-
var deleteSessionSchema =
|
|
4123
|
-
id:
|
|
4368
|
+
import { z as z31 } from "zod";
|
|
4369
|
+
var deleteSessionSchema = z31.object({
|
|
4370
|
+
id: z31.string()
|
|
4124
4371
|
});
|
|
4125
4372
|
|
|
4126
4373
|
// ../../b4m-core/packages/services/dist/src/sessionService/sumarize.js
|
|
4127
|
-
import { z as
|
|
4128
|
-
var sumarizeSessionSchema =
|
|
4129
|
-
id:
|
|
4374
|
+
import { z as z32 } from "zod";
|
|
4375
|
+
var sumarizeSessionSchema = z32.object({
|
|
4376
|
+
id: z32.string()
|
|
4130
4377
|
});
|
|
4131
4378
|
|
|
4132
4379
|
// ../../b4m-core/packages/services/dist/src/projectService/create.js
|
|
4133
|
-
import { z as
|
|
4134
|
-
var createProjectSchema =
|
|
4135
|
-
name:
|
|
4136
|
-
description:
|
|
4137
|
-
sessionIds:
|
|
4138
|
-
fileIds:
|
|
4380
|
+
import { z as z33 } from "zod";
|
|
4381
|
+
var createProjectSchema = z33.object({
|
|
4382
|
+
name: z33.string().min(1),
|
|
4383
|
+
description: z33.string().min(1),
|
|
4384
|
+
sessionIds: z33.array(z33.string()).optional(),
|
|
4385
|
+
fileIds: z33.array(z33.string()).optional()
|
|
4139
4386
|
});
|
|
4140
4387
|
|
|
4141
4388
|
// ../../b4m-core/packages/services/dist/src/projectService/search.js
|
|
4142
|
-
import { z as
|
|
4143
|
-
var searchProjectsSchema =
|
|
4144
|
-
search:
|
|
4145
|
-
filters:
|
|
4146
|
-
favorite:
|
|
4147
|
-
scope:
|
|
4389
|
+
import { z as z34 } from "zod";
|
|
4390
|
+
var searchProjectsSchema = z34.object({
|
|
4391
|
+
search: z34.string().optional(),
|
|
4392
|
+
filters: z34.object({
|
|
4393
|
+
favorite: z34.coerce.boolean().optional(),
|
|
4394
|
+
scope: z34.record(z34.any()).optional()
|
|
4148
4395
|
}).optional(),
|
|
4149
|
-
pagination:
|
|
4150
|
-
page:
|
|
4151
|
-
limit:
|
|
4396
|
+
pagination: z34.object({
|
|
4397
|
+
page: z34.coerce.number().optional(),
|
|
4398
|
+
limit: z34.coerce.number().optional()
|
|
4152
4399
|
}).optional(),
|
|
4153
|
-
orderBy:
|
|
4154
|
-
by:
|
|
4155
|
-
direction:
|
|
4400
|
+
orderBy: z34.object({
|
|
4401
|
+
by: z34.enum(["createdAt", "updatedAt"]).optional(),
|
|
4402
|
+
direction: z34.enum(["asc", "desc"]).optional()
|
|
4156
4403
|
}).optional()
|
|
4157
4404
|
});
|
|
4158
4405
|
|
|
4159
4406
|
// ../../b4m-core/packages/services/dist/src/projectService/addSessions.js
|
|
4160
|
-
import { z as
|
|
4407
|
+
import { z as z45 } from "zod";
|
|
4161
4408
|
import uniq2 from "lodash/uniq.js";
|
|
4162
4409
|
|
|
4163
4410
|
// ../../b4m-core/packages/services/dist/src/sharingService/accept.js
|
|
4164
|
-
import { z as
|
|
4165
|
-
var acceptInviteSchema =
|
|
4166
|
-
id:
|
|
4411
|
+
import { z as z35 } from "zod";
|
|
4412
|
+
var acceptInviteSchema = z35.object({
|
|
4413
|
+
id: z35.string()
|
|
4167
4414
|
});
|
|
4168
4415
|
|
|
4169
4416
|
// ../../b4m-core/packages/services/dist/src/sharingService/cancel.js
|
|
4170
|
-
import { z as
|
|
4171
|
-
var cancelInviteSchema =
|
|
4172
|
-
id:
|
|
4173
|
-
type:
|
|
4174
|
-
email:
|
|
4417
|
+
import { z as z36 } from "zod";
|
|
4418
|
+
var cancelInviteSchema = z36.object({
|
|
4419
|
+
id: z36.string(),
|
|
4420
|
+
type: z36.nativeEnum(InviteType),
|
|
4421
|
+
email: z36.string().email().optional()
|
|
4175
4422
|
});
|
|
4176
4423
|
|
|
4177
4424
|
// ../../b4m-core/packages/services/dist/src/sharingService/cancelOwnDocument.js
|
|
4178
|
-
import { z as
|
|
4179
|
-
var cancelOwnDocumentInvitesSchema =
|
|
4180
|
-
documentId:
|
|
4181
|
-
type:
|
|
4425
|
+
import { z as z37 } from "zod";
|
|
4426
|
+
var cancelOwnDocumentInvitesSchema = z37.object({
|
|
4427
|
+
documentId: z37.string(),
|
|
4428
|
+
type: z37.nativeEnum(InviteType)
|
|
4182
4429
|
});
|
|
4183
4430
|
|
|
4184
4431
|
// ../../b4m-core/packages/services/dist/src/sharingService/create.js
|
|
4185
|
-
import { z as
|
|
4432
|
+
import { z as z38 } from "zod";
|
|
4186
4433
|
var defaultExpiration = () => new Date((/* @__PURE__ */ new Date()).getFullYear() + 100, (/* @__PURE__ */ new Date()).getMonth(), (/* @__PURE__ */ new Date()).getDate());
|
|
4187
4434
|
var DEFAULT_AVAILABLE = 1;
|
|
4188
|
-
var createInviteSchema =
|
|
4189
|
-
id:
|
|
4190
|
-
type:
|
|
4191
|
-
permissions:
|
|
4192
|
-
recipients:
|
|
4193
|
-
description:
|
|
4194
|
-
expiresAt:
|
|
4195
|
-
available:
|
|
4435
|
+
var createInviteSchema = z38.object({
|
|
4436
|
+
id: z38.string(),
|
|
4437
|
+
type: z38.nativeEnum(InviteType),
|
|
4438
|
+
permissions: z38.array(z38.nativeEnum(Permission)),
|
|
4439
|
+
recipients: z38.string().array().optional(),
|
|
4440
|
+
description: z38.string().optional(),
|
|
4441
|
+
expiresAt: z38.date().optional().default(defaultExpiration()),
|
|
4442
|
+
available: z38.number().optional().default(DEFAULT_AVAILABLE)
|
|
4196
4443
|
});
|
|
4197
4444
|
|
|
4198
4445
|
// ../../b4m-core/packages/services/dist/src/sharingService/get.js
|
|
4199
|
-
import { z as
|
|
4200
|
-
var getInviteSchema =
|
|
4201
|
-
id:
|
|
4202
|
-
withUsername:
|
|
4446
|
+
import { z as z39 } from "zod";
|
|
4447
|
+
var getInviteSchema = z39.object({
|
|
4448
|
+
id: z39.string(),
|
|
4449
|
+
withUsername: z39.boolean().optional()
|
|
4203
4450
|
});
|
|
4204
4451
|
|
|
4205
4452
|
// ../../b4m-core/packages/services/dist/src/sharingService/listByDocumentIdAndType.js
|
|
4206
|
-
import { z as
|
|
4207
|
-
var listInviteByDocumentIdAndTypeSchema =
|
|
4208
|
-
documentId:
|
|
4209
|
-
type:
|
|
4453
|
+
import { z as z40 } from "zod";
|
|
4454
|
+
var listInviteByDocumentIdAndTypeSchema = z40.object({
|
|
4455
|
+
documentId: z40.string(),
|
|
4456
|
+
type: z40.nativeEnum(InviteType)
|
|
4210
4457
|
});
|
|
4211
4458
|
|
|
4212
4459
|
// ../../b4m-core/packages/services/dist/src/sharingService/listOwnPending.js
|
|
4213
|
-
import { z as
|
|
4214
|
-
var listOwnPendingInvitesSchema =
|
|
4215
|
-
limit:
|
|
4216
|
-
page:
|
|
4460
|
+
import { z as z41 } from "zod";
|
|
4461
|
+
var listOwnPendingInvitesSchema = z41.object({
|
|
4462
|
+
limit: z41.number().min(1).max(100).default(20),
|
|
4463
|
+
page: z41.number().min(1).default(1)
|
|
4217
4464
|
});
|
|
4218
4465
|
|
|
4219
4466
|
// ../../b4m-core/packages/services/dist/src/sharingService/refuse.js
|
|
4220
|
-
import { z as
|
|
4221
|
-
var refuseInviteSchema =
|
|
4222
|
-
id:
|
|
4467
|
+
import { z as z42 } from "zod";
|
|
4468
|
+
var refuseInviteSchema = z42.object({
|
|
4469
|
+
id: z42.string()
|
|
4223
4470
|
});
|
|
4224
4471
|
|
|
4225
4472
|
// ../../b4m-core/packages/services/dist/src/sharingService/revoke.js
|
|
4226
|
-
import { z as
|
|
4227
|
-
var revokeSharingSchema =
|
|
4228
|
-
id:
|
|
4229
|
-
type:
|
|
4230
|
-
userId:
|
|
4231
|
-
projectId:
|
|
4473
|
+
import { z as z43 } from "zod";
|
|
4474
|
+
var revokeSharingSchema = z43.object({
|
|
4475
|
+
id: z43.string(),
|
|
4476
|
+
type: z43.enum(["files", "sessions", "projects"]),
|
|
4477
|
+
userId: z43.string(),
|
|
4478
|
+
projectId: z43.string().optional()
|
|
4232
4479
|
});
|
|
4233
4480
|
|
|
4234
4481
|
// ../../b4m-core/packages/services/dist/src/projectService/addFiles.js
|
|
4235
|
-
import { z as
|
|
4482
|
+
import { z as z44 } from "zod";
|
|
4236
4483
|
import uniq from "lodash/uniq.js";
|
|
4237
|
-
var addFilesProjectSchema =
|
|
4238
|
-
projectId:
|
|
4239
|
-
fileIds:
|
|
4484
|
+
var addFilesProjectSchema = z44.object({
|
|
4485
|
+
projectId: z44.string().nonempty(),
|
|
4486
|
+
fileIds: z44.array(z44.string().nonempty())
|
|
4240
4487
|
});
|
|
4241
4488
|
|
|
4242
4489
|
// ../../b4m-core/packages/services/dist/src/projectService/addSessions.js
|
|
4243
|
-
var addSessionsProjectSchema =
|
|
4244
|
-
projectId:
|
|
4245
|
-
sessionIds:
|
|
4490
|
+
var addSessionsProjectSchema = z45.object({
|
|
4491
|
+
projectId: z45.string().nonempty(),
|
|
4492
|
+
sessionIds: z45.array(z45.string().nonempty())
|
|
4246
4493
|
});
|
|
4247
4494
|
|
|
4248
4495
|
// ../../b4m-core/packages/services/dist/src/projectService/get.js
|
|
4249
|
-
import { z as z45 } from "zod";
|
|
4250
|
-
var getProjectSchema = z45.object({
|
|
4251
|
-
id: z45.string()
|
|
4252
|
-
});
|
|
4253
|
-
|
|
4254
|
-
// ../../b4m-core/packages/services/dist/src/projectService/update.js
|
|
4255
4496
|
import { z as z46 } from "zod";
|
|
4256
|
-
var
|
|
4257
|
-
id: z46.string()
|
|
4258
|
-
name: z46.string().optional(),
|
|
4259
|
-
description: z46.string().optional()
|
|
4497
|
+
var getProjectSchema = z46.object({
|
|
4498
|
+
id: z46.string()
|
|
4260
4499
|
});
|
|
4261
4500
|
|
|
4262
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4501
|
+
// ../../b4m-core/packages/services/dist/src/projectService/update.js
|
|
4263
4502
|
import { z as z47 } from "zod";
|
|
4264
|
-
var
|
|
4265
|
-
id: z47.string()
|
|
4503
|
+
var updateProjectSchema = z47.object({
|
|
4504
|
+
id: z47.string(),
|
|
4505
|
+
name: z47.string().optional(),
|
|
4506
|
+
description: z47.string().optional()
|
|
4266
4507
|
});
|
|
4267
4508
|
|
|
4268
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4509
|
+
// ../../b4m-core/packages/services/dist/src/projectService/delete.js
|
|
4269
4510
|
import { z as z48 } from "zod";
|
|
4270
|
-
var
|
|
4271
|
-
|
|
4272
|
-
fileIds: z48.array(z48.string())
|
|
4511
|
+
var deleteProjectSchema = z48.object({
|
|
4512
|
+
id: z48.string()
|
|
4273
4513
|
});
|
|
4274
4514
|
|
|
4275
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4515
|
+
// ../../b4m-core/packages/services/dist/src/projectService/removeFiles.js
|
|
4276
4516
|
import { z as z49 } from "zod";
|
|
4277
|
-
var
|
|
4517
|
+
var removeProjectFilesSchema = z49.object({
|
|
4278
4518
|
projectId: z49.string(),
|
|
4279
|
-
|
|
4519
|
+
fileIds: z49.array(z49.string())
|
|
4280
4520
|
});
|
|
4281
4521
|
|
|
4282
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4522
|
+
// ../../b4m-core/packages/services/dist/src/projectService/removeSessions.js
|
|
4283
4523
|
import { z as z50 } from "zod";
|
|
4284
|
-
var
|
|
4285
|
-
projectId: z50.string()
|
|
4524
|
+
var removeProjectSessionsSchema = z50.object({
|
|
4525
|
+
projectId: z50.string(),
|
|
4526
|
+
sessionIds: z50.array(z50.string())
|
|
4286
4527
|
});
|
|
4287
4528
|
|
|
4288
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4529
|
+
// ../../b4m-core/packages/services/dist/src/projectService/listSessions.js
|
|
4289
4530
|
import { z as z51 } from "zod";
|
|
4290
|
-
var
|
|
4531
|
+
var listProjectSessionsSchema = z51.object({
|
|
4291
4532
|
projectId: z51.string()
|
|
4292
4533
|
});
|
|
4293
4534
|
|
|
4294
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4535
|
+
// ../../b4m-core/packages/services/dist/src/projectService/listFiles.js
|
|
4295
4536
|
import { z as z52 } from "zod";
|
|
4296
|
-
var
|
|
4297
|
-
|
|
4298
|
-
statuses: z52.string().optional().default(""),
|
|
4299
|
-
limit: z52.coerce.number().optional().default(10),
|
|
4300
|
-
page: z52.coerce.number().optional().default(1)
|
|
4537
|
+
var listProjectFilesSchema = z52.object({
|
|
4538
|
+
projectId: z52.string()
|
|
4301
4539
|
});
|
|
4302
4540
|
|
|
4303
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4541
|
+
// ../../b4m-core/packages/services/dist/src/projectService/listInvites.js
|
|
4304
4542
|
import { z as z53 } from "zod";
|
|
4305
|
-
var
|
|
4306
|
-
|
|
4307
|
-
|
|
4543
|
+
var listProjectInvitesParamsSchema = z53.object({
|
|
4544
|
+
id: z53.string(),
|
|
4545
|
+
statuses: z53.string().optional().default(""),
|
|
4546
|
+
limit: z53.coerce.number().optional().default(10),
|
|
4547
|
+
page: z53.coerce.number().optional().default(1)
|
|
4308
4548
|
});
|
|
4309
4549
|
|
|
4310
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4550
|
+
// ../../b4m-core/packages/services/dist/src/projectService/addSystemPrompts.js
|
|
4311
4551
|
import { z as z54 } from "zod";
|
|
4312
|
-
var
|
|
4552
|
+
var addSystemPromptsSchema = z54.object({
|
|
4313
4553
|
projectId: z54.string(),
|
|
4314
|
-
|
|
4554
|
+
fileIds: z54.array(z54.string())
|
|
4315
4555
|
});
|
|
4316
4556
|
|
|
4317
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4557
|
+
// ../../b4m-core/packages/services/dist/src/projectService/toggleSystemPrompt.js
|
|
4318
4558
|
import { z as z55 } from "zod";
|
|
4319
|
-
var
|
|
4559
|
+
var toggleSystemPromptSchema = z55.object({
|
|
4320
4560
|
projectId: z55.string(),
|
|
4321
4561
|
fileId: z55.string()
|
|
4322
4562
|
});
|
|
4323
4563
|
|
|
4324
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4325
|
-
import { z as z58 } from "zod";
|
|
4326
|
-
|
|
4327
|
-
// ../../b4m-core/packages/services/dist/src/favoriteService/create.js
|
|
4564
|
+
// ../../b4m-core/packages/services/dist/src/projectService/removeSystemPrompt.js
|
|
4328
4565
|
import { z as z56 } from "zod";
|
|
4329
|
-
var
|
|
4330
|
-
|
|
4331
|
-
|
|
4566
|
+
var removeSystemPromptSchema = z56.object({
|
|
4567
|
+
projectId: z56.string(),
|
|
4568
|
+
fileId: z56.string()
|
|
4332
4569
|
});
|
|
4333
4570
|
|
|
4334
|
-
// ../../b4m-core/packages/services/dist/src/
|
|
4571
|
+
// ../../b4m-core/packages/services/dist/src/projectService/addFavorite.js
|
|
4572
|
+
import { z as z59 } from "zod";
|
|
4573
|
+
|
|
4574
|
+
// ../../b4m-core/packages/services/dist/src/favoriteService/create.js
|
|
4335
4575
|
import { z as z57 } from "zod";
|
|
4336
|
-
var
|
|
4576
|
+
var createFavoriteParametersSchema = z57.object({
|
|
4337
4577
|
documentId: z57.string(),
|
|
4338
4578
|
documentType: z57.nativeEnum(FavoriteDocumentType)
|
|
4339
4579
|
});
|
|
4340
4580
|
|
|
4341
|
-
// ../../b4m-core/packages/services/dist/src/
|
|
4342
|
-
|
|
4343
|
-
|
|
4581
|
+
// ../../b4m-core/packages/services/dist/src/favoriteService/delete.js
|
|
4582
|
+
import { z as z58 } from "zod";
|
|
4583
|
+
var deleteFavoriteParametersSchema = z58.object({
|
|
4584
|
+
documentId: z58.string(),
|
|
4585
|
+
documentType: z58.nativeEnum(FavoriteDocumentType)
|
|
4344
4586
|
});
|
|
4345
4587
|
|
|
4346
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4347
|
-
|
|
4348
|
-
var deleteFavoriteParametersSchema2 = z59.object({
|
|
4588
|
+
// ../../b4m-core/packages/services/dist/src/projectService/addFavorite.js
|
|
4589
|
+
var addFavoriteParametersSchema = z59.object({
|
|
4349
4590
|
projectId: z59.string()
|
|
4350
4591
|
});
|
|
4351
4592
|
|
|
4352
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4593
|
+
// ../../b4m-core/packages/services/dist/src/projectService/deleteFavorite.js
|
|
4353
4594
|
import { z as z60 } from "zod";
|
|
4354
|
-
var
|
|
4595
|
+
var deleteFavoriteParametersSchema2 = z60.object({
|
|
4355
4596
|
projectId: z60.string()
|
|
4356
4597
|
});
|
|
4357
4598
|
|
|
4358
|
-
// ../../b4m-core/packages/services/dist/src/projectService/
|
|
4599
|
+
// ../../b4m-core/packages/services/dist/src/projectService/removeNonExistentFiles.js
|
|
4359
4600
|
import { z as z61 } from "zod";
|
|
4360
|
-
var
|
|
4361
|
-
|
|
4362
|
-
userIdToRemove: z61.string().optional()
|
|
4363
|
-
// Optional: if provided, this is a removal by owner
|
|
4601
|
+
var removeNonExistentFilesSchema = z61.object({
|
|
4602
|
+
projectId: z61.string()
|
|
4364
4603
|
});
|
|
4365
4604
|
|
|
4366
|
-
// ../../b4m-core/packages/services/dist/src/
|
|
4367
|
-
import uniq3 from "lodash/uniq.js";
|
|
4368
|
-
import isEqual from "lodash/isEqual.js";
|
|
4605
|
+
// ../../b4m-core/packages/services/dist/src/projectService/leaveProject.js
|
|
4369
4606
|
import { z as z62 } from "zod";
|
|
4370
|
-
var
|
|
4607
|
+
var leaveProjectParamsSchema = z62.object({
|
|
4371
4608
|
id: z62.string(),
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
artifactIds: z62.array(z62.string()).optional(),
|
|
4375
|
-
tags: z62.array(z62.object({ name: z62.string(), strength: z62.number() })).optional(),
|
|
4376
|
-
lastUsedModel: z62.string().optional()
|
|
4609
|
+
userIdToRemove: z62.string().optional()
|
|
4610
|
+
// Optional: if provided, this is a removal by owner
|
|
4377
4611
|
});
|
|
4378
4612
|
|
|
4379
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4613
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/update.js
|
|
4614
|
+
import uniq3 from "lodash/uniq.js";
|
|
4615
|
+
import isEqual from "lodash/isEqual.js";
|
|
4380
4616
|
import { z as z63 } from "zod";
|
|
4381
|
-
var
|
|
4382
|
-
id: z63.string()
|
|
4617
|
+
var updateSessionParamtersSchema = z63.object({
|
|
4618
|
+
id: z63.string(),
|
|
4619
|
+
name: z63.string().optional(),
|
|
4620
|
+
knowledgeIds: z63.array(z63.string()).optional(),
|
|
4621
|
+
artifactIds: z63.array(z63.string()).optional(),
|
|
4622
|
+
tags: z63.array(z63.object({ name: z63.string(), strength: z63.number() })).optional(),
|
|
4623
|
+
lastUsedModel: z63.string().optional()
|
|
4383
4624
|
});
|
|
4384
4625
|
|
|
4385
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4626
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/clone.js
|
|
4386
4627
|
import { z as z64 } from "zod";
|
|
4387
|
-
var
|
|
4388
|
-
|
|
4389
|
-
messageId: z64.string()
|
|
4628
|
+
var cloneSessionSchema = z64.object({
|
|
4629
|
+
id: z64.string()
|
|
4390
4630
|
});
|
|
4391
4631
|
|
|
4392
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4632
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/fork.js
|
|
4393
4633
|
import { z as z65 } from "zod";
|
|
4394
|
-
var
|
|
4634
|
+
var forkSessionSchema = z65.object({
|
|
4395
4635
|
sessionId: z65.string(),
|
|
4396
4636
|
messageId: z65.string()
|
|
4397
4637
|
});
|
|
4398
4638
|
|
|
4399
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4639
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/snip.js
|
|
4400
4640
|
import { z as z66 } from "zod";
|
|
4401
|
-
var
|
|
4402
|
-
|
|
4641
|
+
var snipSessionSchema = z66.object({
|
|
4642
|
+
sessionId: z66.string(),
|
|
4643
|
+
messageId: z66.string()
|
|
4403
4644
|
});
|
|
4404
4645
|
|
|
4405
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4646
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/get.js
|
|
4406
4647
|
import { z as z67 } from "zod";
|
|
4407
|
-
var
|
|
4408
|
-
|
|
4409
|
-
messageId: z67.string()
|
|
4648
|
+
var getSessionSchema = z67.object({
|
|
4649
|
+
id: z67.string()
|
|
4410
4650
|
});
|
|
4411
4651
|
|
|
4412
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4652
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/deleteMessage.js
|
|
4413
4653
|
import { z as z68 } from "zod";
|
|
4414
|
-
var
|
|
4415
|
-
sessionId: z68.string()
|
|
4654
|
+
var deleteSessionMessageSchema = z68.object({
|
|
4655
|
+
sessionId: z68.string(),
|
|
4656
|
+
messageId: z68.string()
|
|
4416
4657
|
});
|
|
4417
4658
|
|
|
4418
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4659
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/addFavorite.js
|
|
4419
4660
|
import { z as z69 } from "zod";
|
|
4420
|
-
var
|
|
4661
|
+
var addFavoriteParametersSchema2 = z69.object({
|
|
4421
4662
|
sessionId: z69.string()
|
|
4422
4663
|
});
|
|
4423
4664
|
|
|
4424
|
-
// ../../b4m-core/packages/services/dist/src/sessionService/
|
|
4665
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/deleteFavorite.js
|
|
4425
4666
|
import { z as z70 } from "zod";
|
|
4426
|
-
var
|
|
4427
|
-
sessionId: z70.string()
|
|
4667
|
+
var deleteFavoriteParametersSchema3 = z70.object({
|
|
4668
|
+
sessionId: z70.string()
|
|
4669
|
+
});
|
|
4670
|
+
|
|
4671
|
+
// ../../b4m-core/packages/services/dist/src/sessionService/autoName.js
|
|
4672
|
+
import { z as z71 } from "zod";
|
|
4673
|
+
var autoNameParameterSchema = z71.object({
|
|
4674
|
+
sessionId: z71.string(),
|
|
4428
4675
|
/** The maximum number of words to include in the title */
|
|
4429
|
-
maxWords:
|
|
4676
|
+
maxWords: z71.number().optional()
|
|
4430
4677
|
});
|
|
4431
4678
|
|
|
4432
4679
|
// ../../b4m-core/packages/services/dist/src/organizationService/search.js
|
|
4433
|
-
import { z as
|
|
4434
|
-
var searchSchema2 =
|
|
4680
|
+
import { z as z72 } from "zod";
|
|
4681
|
+
var searchSchema2 = z72.object({
|
|
4435
4682
|
/**
|
|
4436
4683
|
* Text search query (searches in name and description)
|
|
4437
4684
|
*/
|
|
4438
|
-
query:
|
|
4685
|
+
query: z72.string().optional(),
|
|
4439
4686
|
/**
|
|
4440
4687
|
* Filter by personal organizations
|
|
4441
4688
|
*/
|
|
4442
|
-
filters:
|
|
4443
|
-
personal:
|
|
4444
|
-
userId:
|
|
4689
|
+
filters: z72.object({
|
|
4690
|
+
personal: z72.union([z72.enum(["true", "false"]).transform((val) => val === "true"), z72.boolean()]).optional(),
|
|
4691
|
+
userId: z72.string().optional()
|
|
4445
4692
|
}).default({}),
|
|
4446
|
-
pagination:
|
|
4447
|
-
page:
|
|
4448
|
-
limit:
|
|
4693
|
+
pagination: z72.object({
|
|
4694
|
+
page: z72.coerce.number().int().positive().default(1),
|
|
4695
|
+
limit: z72.coerce.number().int().positive().max(100).default(10)
|
|
4449
4696
|
}).default({
|
|
4450
4697
|
page: 1,
|
|
4451
4698
|
limit: 10
|
|
4452
4699
|
}),
|
|
4453
|
-
orderBy:
|
|
4454
|
-
field:
|
|
4455
|
-
direction:
|
|
4700
|
+
orderBy: z72.object({
|
|
4701
|
+
field: z72.enum(["name", "createdAt", "updatedAt"]).default("name"),
|
|
4702
|
+
direction: z72.enum(["asc", "desc"]).default("asc")
|
|
4456
4703
|
}).default({
|
|
4457
4704
|
field: "name",
|
|
4458
4705
|
direction: "asc"
|
|
@@ -4460,357 +4707,357 @@ var searchSchema2 = z71.object({
|
|
|
4460
4707
|
});
|
|
4461
4708
|
|
|
4462
4709
|
// ../../b4m-core/packages/services/dist/src/organizationService/get.js
|
|
4463
|
-
import { z as
|
|
4464
|
-
var getSchema =
|
|
4710
|
+
import { z as z73 } from "zod";
|
|
4711
|
+
var getSchema = z73.object({
|
|
4465
4712
|
/**
|
|
4466
4713
|
* Organization ID
|
|
4467
4714
|
*/
|
|
4468
|
-
id:
|
|
4715
|
+
id: z73.string().min(1)
|
|
4469
4716
|
});
|
|
4470
4717
|
|
|
4471
4718
|
// ../../b4m-core/packages/services/dist/src/organizationService/addMember.js
|
|
4472
|
-
import { z as
|
|
4473
|
-
var addMemberSchema =
|
|
4474
|
-
userId:
|
|
4475
|
-
email:
|
|
4476
|
-
organizationId:
|
|
4477
|
-
force:
|
|
4719
|
+
import { z as z74 } from "zod";
|
|
4720
|
+
var addMemberSchema = z74.object({
|
|
4721
|
+
userId: z74.string().optional(),
|
|
4722
|
+
email: z74.string().optional(),
|
|
4723
|
+
organizationId: z74.string(),
|
|
4724
|
+
force: z74.boolean().optional()
|
|
4478
4725
|
// If true, add the user to the organization even if it's at full capacity
|
|
4479
4726
|
});
|
|
4480
4727
|
|
|
4481
4728
|
// ../../b4m-core/packages/services/dist/src/organizationService/getUsers.js
|
|
4482
|
-
import { z as
|
|
4483
|
-
var getUsersSchema =
|
|
4484
|
-
id:
|
|
4729
|
+
import { z as z75 } from "zod";
|
|
4730
|
+
var getUsersSchema = z75.object({
|
|
4731
|
+
id: z75.string()
|
|
4485
4732
|
});
|
|
4486
4733
|
|
|
4487
4734
|
// ../../b4m-core/packages/services/dist/src/organizationService/create.js
|
|
4488
|
-
import { z as
|
|
4489
|
-
var createSchema =
|
|
4490
|
-
name:
|
|
4491
|
-
personal:
|
|
4492
|
-
seats:
|
|
4493
|
-
stripeCustomerId:
|
|
4494
|
-
billingOwnerId:
|
|
4735
|
+
import { z as z76 } from "zod";
|
|
4736
|
+
var createSchema = z76.object({
|
|
4737
|
+
name: z76.string(),
|
|
4738
|
+
personal: z76.boolean().default(false),
|
|
4739
|
+
seats: z76.number().default(1),
|
|
4740
|
+
stripeCustomerId: z76.string().nullable(),
|
|
4741
|
+
billingOwnerId: z76.string().optional(),
|
|
4495
4742
|
// Optional billing owner (defaults to user if not provided)
|
|
4496
|
-
managerId:
|
|
4743
|
+
managerId: z76.string().optional()
|
|
4497
4744
|
// Optional team manager
|
|
4498
4745
|
});
|
|
4499
4746
|
|
|
4500
4747
|
// ../../b4m-core/packages/services/dist/src/organizationService/update.js
|
|
4501
|
-
import { z as
|
|
4502
|
-
var updateSchema =
|
|
4503
|
-
id:
|
|
4504
|
-
name:
|
|
4505
|
-
description:
|
|
4506
|
-
billingContact:
|
|
4507
|
-
currentCredits:
|
|
4508
|
-
systemPrompt:
|
|
4748
|
+
import { z as z77 } from "zod";
|
|
4749
|
+
var updateSchema = z77.object({
|
|
4750
|
+
id: z77.string(),
|
|
4751
|
+
name: z77.string().optional(),
|
|
4752
|
+
description: z77.string().optional(),
|
|
4753
|
+
billingContact: z77.string().optional(),
|
|
4754
|
+
currentCredits: z77.coerce.number().optional(),
|
|
4755
|
+
systemPrompt: z77.string().max(1e4).optional()
|
|
4509
4756
|
// ~2500 tokens
|
|
4510
4757
|
});
|
|
4511
4758
|
|
|
4512
4759
|
// ../../b4m-core/packages/services/dist/src/organizationService/delete.js
|
|
4513
|
-
import { z as
|
|
4514
|
-
var deleteSchema =
|
|
4760
|
+
import { z as z78 } from "zod";
|
|
4761
|
+
var deleteSchema = z78.object({
|
|
4515
4762
|
/**
|
|
4516
4763
|
* Organization ID
|
|
4517
4764
|
*/
|
|
4518
|
-
id:
|
|
4765
|
+
id: z78.string().min(1)
|
|
4519
4766
|
});
|
|
4520
4767
|
|
|
4521
4768
|
// ../../b4m-core/packages/services/dist/src/organizationService/listPendingUsers.js
|
|
4522
|
-
import { z as
|
|
4523
|
-
var listPendingUsersSchema =
|
|
4524
|
-
organizationId:
|
|
4769
|
+
import { z as z79 } from "zod";
|
|
4770
|
+
var listPendingUsersSchema = z79.object({
|
|
4771
|
+
organizationId: z79.string()
|
|
4525
4772
|
});
|
|
4526
4773
|
|
|
4527
4774
|
// ../../b4m-core/packages/services/dist/src/organizationService/revokeAccess.js
|
|
4528
|
-
import { z as
|
|
4529
|
-
var revokeAccessSchema =
|
|
4530
|
-
id:
|
|
4531
|
-
userId:
|
|
4775
|
+
import { z as z80 } from "zod";
|
|
4776
|
+
var revokeAccessSchema = z80.object({
|
|
4777
|
+
id: z80.string(),
|
|
4778
|
+
userId: z80.string()
|
|
4532
4779
|
});
|
|
4533
4780
|
|
|
4534
4781
|
// ../../b4m-core/packages/services/dist/src/organizationService/leave.js
|
|
4535
|
-
import { z as
|
|
4536
|
-
var organizationLeaveSchema =
|
|
4537
|
-
id:
|
|
4782
|
+
import { z as z81 } from "zod";
|
|
4783
|
+
var organizationLeaveSchema = z81.object({
|
|
4784
|
+
id: z81.string()
|
|
4538
4785
|
});
|
|
4539
4786
|
|
|
4540
4787
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/create.js
|
|
4541
|
-
import { z as
|
|
4542
|
-
var createApiKeySchema =
|
|
4543
|
-
apiKey:
|
|
4544
|
-
description:
|
|
4545
|
-
isActive:
|
|
4546
|
-
type:
|
|
4547
|
-
expireDays:
|
|
4788
|
+
import { z as z82 } from "zod";
|
|
4789
|
+
var createApiKeySchema = z82.object({
|
|
4790
|
+
apiKey: z82.string().min(6),
|
|
4791
|
+
description: z82.string().optional().default(""),
|
|
4792
|
+
isActive: z82.boolean().optional().default(true),
|
|
4793
|
+
type: z82.nativeEnum(ApiKeyType),
|
|
4794
|
+
expireDays: z82.number().min(1).max(365).default(90)
|
|
4548
4795
|
// Default 90-day expiration
|
|
4549
4796
|
});
|
|
4550
4797
|
|
|
4551
4798
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/set.js
|
|
4552
|
-
import { z as
|
|
4553
|
-
var setApiKeySchema =
|
|
4554
|
-
id:
|
|
4555
|
-
type:
|
|
4799
|
+
import { z as z83 } from "zod";
|
|
4800
|
+
var setApiKeySchema = z83.object({
|
|
4801
|
+
id: z83.string(),
|
|
4802
|
+
type: z83.nativeEnum(ApiKeyType)
|
|
4556
4803
|
});
|
|
4557
4804
|
|
|
4558
4805
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/delete.js
|
|
4559
|
-
import { z as
|
|
4560
|
-
var deleteApiKeySchema =
|
|
4561
|
-
id:
|
|
4806
|
+
import { z as z84 } from "zod";
|
|
4807
|
+
var deleteApiKeySchema = z84.object({
|
|
4808
|
+
id: z84.string()
|
|
4562
4809
|
});
|
|
4563
4810
|
|
|
4564
4811
|
// ../../b4m-core/packages/services/dist/src/fabFileService/get.js
|
|
4565
|
-
import { z as
|
|
4566
|
-
var getFabFileSchema =
|
|
4567
|
-
id:
|
|
4812
|
+
import { z as z85 } from "zod";
|
|
4813
|
+
var getFabFileSchema = z85.object({
|
|
4814
|
+
id: z85.string()
|
|
4568
4815
|
});
|
|
4569
4816
|
|
|
4570
4817
|
// ../../b4m-core/packages/services/dist/src/fabFileService/list.js
|
|
4571
|
-
import { z as
|
|
4572
|
-
var listFabFilesSchema =
|
|
4573
|
-
ids:
|
|
4818
|
+
import { z as z86 } from "zod";
|
|
4819
|
+
var listFabFilesSchema = z86.object({
|
|
4820
|
+
ids: z86.array(z86.string()).optional()
|
|
4574
4821
|
});
|
|
4575
4822
|
|
|
4576
4823
|
// ../../b4m-core/packages/services/dist/src/fabFileService/update.js
|
|
4577
4824
|
import mime from "mime-types";
|
|
4578
4825
|
import { v4 as uuidv42 } from "uuid";
|
|
4579
|
-
import { z as
|
|
4580
|
-
var updateFabFileSchema =
|
|
4581
|
-
id:
|
|
4582
|
-
fileName:
|
|
4583
|
-
mimeType:
|
|
4584
|
-
fileContent:
|
|
4585
|
-
type:
|
|
4586
|
-
system:
|
|
4587
|
-
systemPriority:
|
|
4588
|
-
sessionId:
|
|
4589
|
-
notes:
|
|
4590
|
-
primaryTag:
|
|
4591
|
-
tags:
|
|
4592
|
-
name:
|
|
4593
|
-
strength:
|
|
4826
|
+
import { z as z87 } from "zod";
|
|
4827
|
+
var updateFabFileSchema = z87.object({
|
|
4828
|
+
id: z87.string(),
|
|
4829
|
+
fileName: z87.string().optional(),
|
|
4830
|
+
mimeType: z87.string().optional(),
|
|
4831
|
+
fileContent: z87.string().optional(),
|
|
4832
|
+
type: z87.nativeEnum(KnowledgeType).optional(),
|
|
4833
|
+
system: z87.boolean().optional(),
|
|
4834
|
+
systemPriority: z87.number().min(0).max(999).optional(),
|
|
4835
|
+
sessionId: z87.string().optional(),
|
|
4836
|
+
notes: z87.string().optional(),
|
|
4837
|
+
primaryTag: z87.string().optional(),
|
|
4838
|
+
tags: z87.array(z87.object({
|
|
4839
|
+
name: z87.string(),
|
|
4840
|
+
strength: z87.number()
|
|
4594
4841
|
})).optional(),
|
|
4595
|
-
error:
|
|
4842
|
+
error: z87.string().nullable().optional()
|
|
4596
4843
|
});
|
|
4597
4844
|
|
|
4598
4845
|
// ../../b4m-core/packages/services/dist/src/fabFileService/delete.js
|
|
4599
|
-
import { z as
|
|
4600
|
-
var deleteFabFileSchema =
|
|
4601
|
-
id:
|
|
4846
|
+
import { z as z88 } from "zod";
|
|
4847
|
+
var deleteFabFileSchema = z88.object({
|
|
4848
|
+
id: z88.string()
|
|
4602
4849
|
});
|
|
4603
4850
|
|
|
4604
4851
|
// ../../b4m-core/packages/services/dist/src/fabFileService/chunk.js
|
|
4605
|
-
import { z as
|
|
4606
|
-
var chunkFileSchema =
|
|
4607
|
-
fabFileId:
|
|
4608
|
-
embeddingModel:
|
|
4852
|
+
import { z as z89 } from "zod";
|
|
4853
|
+
var chunkFileSchema = z89.object({
|
|
4854
|
+
fabFileId: z89.string(),
|
|
4855
|
+
embeddingModel: z89.string()
|
|
4609
4856
|
});
|
|
4610
4857
|
|
|
4611
4858
|
// ../../b4m-core/packages/services/dist/src/fabFileService/vectorize.js
|
|
4612
|
-
import { z as
|
|
4613
|
-
var vectorizeFabFileChunkSchema =
|
|
4614
|
-
fabFileId:
|
|
4615
|
-
chunkId:
|
|
4859
|
+
import { z as z90 } from "zod";
|
|
4860
|
+
var vectorizeFabFileChunkSchema = z90.object({
|
|
4861
|
+
fabFileId: z90.string(),
|
|
4862
|
+
chunkId: z90.string()
|
|
4616
4863
|
});
|
|
4617
4864
|
|
|
4618
4865
|
// ../../b4m-core/packages/services/dist/src/fabFileService/listBySession.js
|
|
4619
|
-
import { z as
|
|
4620
|
-
var listFabFilesBySessionSchema =
|
|
4621
|
-
sessionId:
|
|
4866
|
+
import { z as z91 } from "zod";
|
|
4867
|
+
var listFabFilesBySessionSchema = z91.object({
|
|
4868
|
+
sessionId: z91.string()
|
|
4622
4869
|
});
|
|
4623
4870
|
|
|
4624
4871
|
// ../../b4m-core/packages/services/dist/src/fabFileService/listByQuest.js
|
|
4625
|
-
import { z as
|
|
4626
|
-
var listFabFilesByQuestSchema =
|
|
4627
|
-
questId:
|
|
4872
|
+
import { z as z92 } from "zod";
|
|
4873
|
+
var listFabFilesByQuestSchema = z92.object({
|
|
4874
|
+
questId: z92.string()
|
|
4628
4875
|
});
|
|
4629
4876
|
|
|
4630
4877
|
// ../../b4m-core/packages/services/dist/src/fabFileService/createByUrl.js
|
|
4631
|
-
import { z as
|
|
4632
|
-
var createFabFileByUrlSchema =
|
|
4633
|
-
url:
|
|
4878
|
+
import { z as z93 } from "zod";
|
|
4879
|
+
var createFabFileByUrlSchema = z93.object({
|
|
4880
|
+
url: z93.string().regex(/^(?!https?:\/\/(drive|docs)\.google\.com\/(?:file\/d\/|open\?id=|uc\?id=|document\/d\/|spreadsheets\/d\/|presentation\/d\/|forms\/d\/|drive\/folders\/)([a-zA-Z0-9_-]{10,})).+/)
|
|
4634
4881
|
});
|
|
4635
4882
|
|
|
4636
4883
|
// ../../b4m-core/packages/services/dist/src/fabFileService/search.js
|
|
4637
|
-
import { z as
|
|
4638
|
-
var searchFabFilesSchema =
|
|
4639
|
-
search:
|
|
4640
|
-
filters:
|
|
4641
|
-
tags:
|
|
4642
|
-
type:
|
|
4643
|
-
shared:
|
|
4884
|
+
import { z as z94 } from "zod";
|
|
4885
|
+
var searchFabFilesSchema = z94.object({
|
|
4886
|
+
search: z94.string().optional(),
|
|
4887
|
+
filters: z94.object({
|
|
4888
|
+
tags: z94.array(z94.string()).optional(),
|
|
4889
|
+
type: z94.enum(["text", "pdf", "url", "image", "excel", "word", "json", "csv", "markdown", "code"]).optional(),
|
|
4890
|
+
shared: z94.coerce.boolean().optional(),
|
|
4644
4891
|
// Indicates if the user is searching for shared files
|
|
4645
|
-
curated:
|
|
4892
|
+
curated: z94.coerce.boolean().optional(),
|
|
4646
4893
|
// Indicates if the user is searching for curated notebook files
|
|
4647
|
-
projectId:
|
|
4648
|
-
ids:
|
|
4894
|
+
projectId: z94.string().optional(),
|
|
4895
|
+
ids: z94.array(z94.string()).optional()
|
|
4649
4896
|
// Add support for filtering by IDs
|
|
4650
4897
|
}).optional(),
|
|
4651
|
-
pagination:
|
|
4652
|
-
page:
|
|
4653
|
-
limit:
|
|
4898
|
+
pagination: z94.object({
|
|
4899
|
+
page: z94.coerce.number(),
|
|
4900
|
+
limit: z94.coerce.number()
|
|
4654
4901
|
}).optional(),
|
|
4655
|
-
order:
|
|
4656
|
-
by:
|
|
4657
|
-
direction:
|
|
4902
|
+
order: z94.object({
|
|
4903
|
+
by: z94.enum(["createdAt", "fileName", "fileSize"]),
|
|
4904
|
+
direction: z94.enum(["asc", "desc"])
|
|
4658
4905
|
}).optional(),
|
|
4659
|
-
options:
|
|
4660
|
-
includeShared:
|
|
4906
|
+
options: z94.object({
|
|
4907
|
+
includeShared: z94.coerce.boolean().optional()
|
|
4661
4908
|
}).optional()
|
|
4662
4909
|
});
|
|
4663
4910
|
|
|
4664
4911
|
// ../../b4m-core/packages/services/dist/src/fabFileService/addFavorite.js
|
|
4665
|
-
import { z as
|
|
4666
|
-
var addFavoriteParametersSchema3 =
|
|
4667
|
-
fileId:
|
|
4912
|
+
import { z as z95 } from "zod";
|
|
4913
|
+
var addFavoriteParametersSchema3 = z95.object({
|
|
4914
|
+
fileId: z95.string()
|
|
4668
4915
|
});
|
|
4669
4916
|
|
|
4670
4917
|
// ../../b4m-core/packages/services/dist/src/fabFileService/deleteFavorite.js
|
|
4671
|
-
import { z as
|
|
4672
|
-
var deleteFavoriteParametersSchema4 =
|
|
4673
|
-
fileId:
|
|
4918
|
+
import { z as z96 } from "zod";
|
|
4919
|
+
var deleteFavoriteParametersSchema4 = z96.object({
|
|
4920
|
+
fileId: z96.string()
|
|
4674
4921
|
});
|
|
4675
4922
|
|
|
4676
4923
|
// ../../b4m-core/packages/services/dist/src/fabFileService/toggleTags.js
|
|
4677
|
-
import { z as
|
|
4678
|
-
var fabFileToggleTagsSchema =
|
|
4679
|
-
ids:
|
|
4680
|
-
tags:
|
|
4924
|
+
import { z as z97 } from "zod";
|
|
4925
|
+
var fabFileToggleTagsSchema = z97.object({
|
|
4926
|
+
ids: z97.array(z97.string()),
|
|
4927
|
+
tags: z97.array(z97.string())
|
|
4681
4928
|
});
|
|
4682
4929
|
|
|
4683
4930
|
// ../../b4m-core/packages/services/dist/src/fabFileService/edit.js
|
|
4684
|
-
import { z as
|
|
4931
|
+
import { z as z98 } from "zod";
|
|
4685
4932
|
import { diffLines } from "diff";
|
|
4686
|
-
var editFabFileSchema =
|
|
4687
|
-
id:
|
|
4688
|
-
instruction:
|
|
4689
|
-
selection:
|
|
4690
|
-
start:
|
|
4691
|
-
end:
|
|
4933
|
+
var editFabFileSchema = z98.object({
|
|
4934
|
+
id: z98.string(),
|
|
4935
|
+
instruction: z98.string(),
|
|
4936
|
+
selection: z98.object({
|
|
4937
|
+
start: z98.number(),
|
|
4938
|
+
end: z98.number()
|
|
4692
4939
|
}).optional(),
|
|
4693
|
-
preserveFormatting:
|
|
4694
|
-
applyImmediately:
|
|
4940
|
+
preserveFormatting: z98.boolean().optional().default(true),
|
|
4941
|
+
applyImmediately: z98.boolean().optional().default(false)
|
|
4695
4942
|
});
|
|
4696
4943
|
|
|
4697
4944
|
// ../../b4m-core/packages/services/dist/src/fabFileService/applyEdit.js
|
|
4698
4945
|
import mime2 from "mime-types";
|
|
4699
4946
|
import { v4 as uuidv43 } from "uuid";
|
|
4700
|
-
import { z as
|
|
4701
|
-
var applyEditSchema =
|
|
4702
|
-
id:
|
|
4703
|
-
modifiedContent:
|
|
4704
|
-
createBackup:
|
|
4947
|
+
import { z as z99 } from "zod";
|
|
4948
|
+
var applyEditSchema = z99.object({
|
|
4949
|
+
id: z99.string(),
|
|
4950
|
+
modifiedContent: z99.string(),
|
|
4951
|
+
createBackup: z99.boolean().optional().default(true)
|
|
4705
4952
|
});
|
|
4706
4953
|
|
|
4707
4954
|
// ../../b4m-core/packages/services/dist/src/friendshipService/respondToFriendRequest.js
|
|
4708
|
-
import { z as
|
|
4709
|
-
var respondToFriendRequestSchema =
|
|
4710
|
-
id:
|
|
4955
|
+
import { z as z100 } from "zod";
|
|
4956
|
+
var respondToFriendRequestSchema = z100.object({
|
|
4957
|
+
id: z100.string(),
|
|
4711
4958
|
/** The user ID of the recipient of the friend request */
|
|
4712
|
-
userId:
|
|
4713
|
-
accept:
|
|
4959
|
+
userId: z100.string(),
|
|
4960
|
+
accept: z100.boolean()
|
|
4714
4961
|
});
|
|
4715
4962
|
|
|
4716
4963
|
// ../../b4m-core/packages/services/dist/src/friendshipService/unfriend.js
|
|
4717
|
-
import { z as
|
|
4718
|
-
var unfriendSchema =
|
|
4719
|
-
friendshipId:
|
|
4964
|
+
import { z as z101 } from "zod";
|
|
4965
|
+
var unfriendSchema = z101.object({
|
|
4966
|
+
friendshipId: z101.string(),
|
|
4720
4967
|
/** The user ID of the user who wants to unfriend the other user */
|
|
4721
|
-
userId:
|
|
4968
|
+
userId: z101.string()
|
|
4722
4969
|
});
|
|
4723
4970
|
|
|
4724
4971
|
// ../../b4m-core/packages/services/dist/src/friendshipService/list.js
|
|
4725
|
-
import { z as
|
|
4726
|
-
var listFriendsSchema =
|
|
4727
|
-
userId:
|
|
4972
|
+
import { z as z102 } from "zod";
|
|
4973
|
+
var listFriendsSchema = z102.object({
|
|
4974
|
+
userId: z102.string()
|
|
4728
4975
|
});
|
|
4729
|
-
var listPendingFriendRequestsSchema =
|
|
4730
|
-
userId:
|
|
4976
|
+
var listPendingFriendRequestsSchema = z102.object({
|
|
4977
|
+
userId: z102.string()
|
|
4731
4978
|
});
|
|
4732
4979
|
|
|
4733
4980
|
// ../../b4m-core/packages/services/dist/src/adminService/loginAs.js
|
|
4734
|
-
import { z as
|
|
4735
|
-
var loginAsSchema =
|
|
4736
|
-
targetUserId:
|
|
4981
|
+
import { z as z103 } from "zod";
|
|
4982
|
+
var loginAsSchema = z103.object({
|
|
4983
|
+
targetUserId: z103.string()
|
|
4737
4984
|
});
|
|
4738
4985
|
|
|
4739
4986
|
// ../../b4m-core/packages/services/dist/src/cacheService/get.js
|
|
4740
|
-
import { z as
|
|
4741
|
-
var getParamsSchema =
|
|
4742
|
-
key:
|
|
4987
|
+
import { z as z104 } from "zod";
|
|
4988
|
+
var getParamsSchema = z104.object({
|
|
4989
|
+
key: z104.string()
|
|
4743
4990
|
});
|
|
4744
4991
|
|
|
4745
4992
|
// ../../b4m-core/packages/services/dist/src/cacheService/set.js
|
|
4746
|
-
import { z as
|
|
4747
|
-
var setParamsSchema =
|
|
4748
|
-
key:
|
|
4749
|
-
value:
|
|
4993
|
+
import { z as z105 } from "zod";
|
|
4994
|
+
var setParamsSchema = z105.object({
|
|
4995
|
+
key: z105.string(),
|
|
4996
|
+
value: z105.any(),
|
|
4750
4997
|
/**
|
|
4751
4998
|
* Time to live in milliseconds
|
|
4752
4999
|
*/
|
|
4753
|
-
ttl:
|
|
4754
|
-
recache:
|
|
5000
|
+
ttl: z105.number(),
|
|
5001
|
+
recache: z105.boolean().optional()
|
|
4755
5002
|
});
|
|
4756
5003
|
|
|
4757
5004
|
// ../../b4m-core/packages/services/dist/src/cacheService/ttl.js
|
|
4758
|
-
import { z as
|
|
4759
|
-
var ttlParamsSchema =
|
|
4760
|
-
key:
|
|
5005
|
+
import { z as z106 } from "zod";
|
|
5006
|
+
var ttlParamsSchema = z106.object({
|
|
5007
|
+
key: z106.string()
|
|
4761
5008
|
});
|
|
4762
5009
|
|
|
4763
5010
|
// ../../b4m-core/packages/services/dist/src/cacheService/weeklyReports.js
|
|
4764
|
-
import { z as
|
|
5011
|
+
import { z as z107 } from "zod";
|
|
4765
5012
|
import dayjs3 from "dayjs";
|
|
4766
|
-
var weeklyReportSchema =
|
|
4767
|
-
startDate:
|
|
4768
|
-
endDate:
|
|
4769
|
-
report:
|
|
4770
|
-
aiInsights:
|
|
5013
|
+
var weeklyReportSchema = z107.object({
|
|
5014
|
+
startDate: z107.string(),
|
|
5015
|
+
endDate: z107.string(),
|
|
5016
|
+
report: z107.string(),
|
|
5017
|
+
aiInsights: z107.string().nullable()
|
|
4771
5018
|
});
|
|
4772
5019
|
|
|
4773
5020
|
// ../../b4m-core/packages/services/dist/src/embeddingCacheService/generateCacheKey.js
|
|
4774
5021
|
import crypto2 from "crypto";
|
|
4775
5022
|
|
|
4776
5023
|
// ../../b4m-core/packages/services/dist/src/researchAgentService/create.js
|
|
4777
|
-
import { z as z107 } from "zod";
|
|
4778
|
-
var researchAgentCreateSchema = z107.object({
|
|
4779
|
-
name: z107.string().min(1),
|
|
4780
|
-
description: z107.string().min(1)
|
|
4781
|
-
});
|
|
4782
|
-
|
|
4783
|
-
// ../../b4m-core/packages/services/dist/src/researchAgentService/update.js
|
|
4784
5024
|
import { z as z108 } from "zod";
|
|
4785
|
-
var
|
|
4786
|
-
id: z108.string(),
|
|
5025
|
+
var researchAgentCreateSchema = z108.object({
|
|
4787
5026
|
name: z108.string().min(1),
|
|
4788
5027
|
description: z108.string().min(1)
|
|
4789
5028
|
});
|
|
4790
5029
|
|
|
4791
|
-
// ../../b4m-core/packages/services/dist/src/researchAgentService/
|
|
5030
|
+
// ../../b4m-core/packages/services/dist/src/researchAgentService/update.js
|
|
4792
5031
|
import { z as z109 } from "zod";
|
|
4793
|
-
var
|
|
4794
|
-
id: z109.string()
|
|
5032
|
+
var researchAgentUpdateSchema = z109.object({
|
|
5033
|
+
id: z109.string(),
|
|
5034
|
+
name: z109.string().min(1),
|
|
5035
|
+
description: z109.string().min(1)
|
|
4795
5036
|
});
|
|
4796
5037
|
|
|
4797
|
-
// ../../b4m-core/packages/services/dist/src/researchAgentService/
|
|
5038
|
+
// ../../b4m-core/packages/services/dist/src/researchAgentService/remove.js
|
|
4798
5039
|
import { z as z110 } from "zod";
|
|
4799
|
-
var
|
|
5040
|
+
var researchAgentRemoveSchema = z110.object({
|
|
4800
5041
|
id: z110.string()
|
|
4801
5042
|
});
|
|
4802
5043
|
|
|
4803
|
-
// ../../b4m-core/packages/services/dist/src/researchAgentService/
|
|
5044
|
+
// ../../b4m-core/packages/services/dist/src/researchAgentService/get.js
|
|
4804
5045
|
import { z as z111 } from "zod";
|
|
4805
|
-
var
|
|
5046
|
+
var researchAgentGetSchema = z111.object({
|
|
5047
|
+
id: z111.string()
|
|
5048
|
+
});
|
|
5049
|
+
|
|
5050
|
+
// ../../b4m-core/packages/services/dist/src/researchAgentService/listFiles.js
|
|
5051
|
+
import { z as z112 } from "zod";
|
|
5052
|
+
var researchAgentListFilesSchema = z112.object({
|
|
4806
5053
|
/**
|
|
4807
5054
|
* The ID of the research agent
|
|
4808
5055
|
*/
|
|
4809
|
-
id:
|
|
5056
|
+
id: z112.string()
|
|
4810
5057
|
});
|
|
4811
5058
|
|
|
4812
5059
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/process.js
|
|
4813
|
-
import { z as
|
|
5060
|
+
import { z as z113 } from "zod";
|
|
4814
5061
|
|
|
4815
5062
|
// ../../b4m-core/packages/services/dist/src/lib/turndown.js
|
|
4816
5063
|
import turndown from "turndown";
|
|
@@ -5201,316 +5448,316 @@ var deepResearchTool = {
|
|
|
5201
5448
|
};
|
|
5202
5449
|
|
|
5203
5450
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/process.js
|
|
5204
|
-
var ResearchTaskProcessSchema =
|
|
5205
|
-
id:
|
|
5451
|
+
var ResearchTaskProcessSchema = z113.object({
|
|
5452
|
+
id: z113.string()
|
|
5206
5453
|
});
|
|
5207
5454
|
|
|
5208
5455
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/create.js
|
|
5209
|
-
import { z as
|
|
5210
|
-
var researchTaskCreateSchema =
|
|
5211
|
-
researchAgentId:
|
|
5212
|
-
title:
|
|
5213
|
-
description:
|
|
5214
|
-
prompt:
|
|
5215
|
-
type:
|
|
5216
|
-
executionType:
|
|
5217
|
-
fileTagId:
|
|
5218
|
-
autoGeneratedTag:
|
|
5219
|
-
name:
|
|
5220
|
-
icon:
|
|
5221
|
-
color:
|
|
5456
|
+
import { z as z114 } from "zod";
|
|
5457
|
+
var researchTaskCreateSchema = z114.object({
|
|
5458
|
+
researchAgentId: z114.string(),
|
|
5459
|
+
title: z114.string().max(100),
|
|
5460
|
+
description: z114.string().max(500),
|
|
5461
|
+
prompt: z114.string().max(500).optional(),
|
|
5462
|
+
type: z114.nativeEnum(ResearchTaskType),
|
|
5463
|
+
executionType: z114.nativeEnum(ResearchTaskExecutionType).default(ResearchTaskExecutionType.ON_DEMAND),
|
|
5464
|
+
fileTagId: z114.string().optional(),
|
|
5465
|
+
autoGeneratedTag: z114.object({
|
|
5466
|
+
name: z114.string(),
|
|
5467
|
+
icon: z114.string(),
|
|
5468
|
+
color: z114.string()
|
|
5222
5469
|
}).optional()
|
|
5223
5470
|
});
|
|
5224
5471
|
var researchTaskScrapeCreateSchema = researchTaskCreateSchema.extend({
|
|
5225
|
-
urls:
|
|
5226
|
-
canDiscoverLinks:
|
|
5472
|
+
urls: z114.array(z114.string().url()).min(1),
|
|
5473
|
+
canDiscoverLinks: z114.boolean()
|
|
5227
5474
|
});
|
|
5228
5475
|
var researchTaskPeriodicCreateSchema = researchTaskCreateSchema.extend({
|
|
5229
|
-
executionPeriodicStartAt:
|
|
5230
|
-
executionPeriodicEndAt:
|
|
5231
|
-
executionPeriodicFrequency:
|
|
5476
|
+
executionPeriodicStartAt: z114.coerce.date(),
|
|
5477
|
+
executionPeriodicEndAt: z114.coerce.date(),
|
|
5478
|
+
executionPeriodicFrequency: z114.nativeEnum(ResearchTaskPeriodicFrequencyType)
|
|
5232
5479
|
});
|
|
5233
5480
|
var researchTaskScheduledCreateSchema = researchTaskCreateSchema.extend({
|
|
5234
|
-
executionScheduledAt:
|
|
5481
|
+
executionScheduledAt: z114.coerce.date()
|
|
5235
5482
|
});
|
|
5236
5483
|
var researchTaskDeepResearchCreateSchema = researchTaskCreateSchema.extend({
|
|
5237
|
-
maxDepth:
|
|
5484
|
+
maxDepth: z114.number().min(1).max(10).optional()
|
|
5238
5485
|
});
|
|
5239
5486
|
|
|
5240
5487
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/search.js
|
|
5241
|
-
import { z as
|
|
5242
|
-
var searchResearchTasksSchema =
|
|
5243
|
-
search:
|
|
5488
|
+
import { z as z115 } from "zod";
|
|
5489
|
+
var searchResearchTasksSchema = z115.object({
|
|
5490
|
+
search: z115.string().optional(),
|
|
5244
5491
|
// ADD FILTERS SCHEMA HERE
|
|
5245
5492
|
// filters: z
|
|
5246
5493
|
// .object({
|
|
5247
5494
|
// userId: z.string().optional(),
|
|
5248
5495
|
// })
|
|
5249
5496
|
// .optional(),
|
|
5250
|
-
pagination:
|
|
5251
|
-
page:
|
|
5252
|
-
limit:
|
|
5497
|
+
pagination: z115.object({
|
|
5498
|
+
page: z115.coerce.number().optional(),
|
|
5499
|
+
limit: z115.coerce.number().optional()
|
|
5253
5500
|
}).optional(),
|
|
5254
|
-
orderBy:
|
|
5255
|
-
by:
|
|
5256
|
-
direction:
|
|
5501
|
+
orderBy: z115.object({
|
|
5502
|
+
by: z115.enum(["createdAt", "updatedAt"]).optional(),
|
|
5503
|
+
direction: z115.enum(["asc", "desc"]).optional()
|
|
5257
5504
|
}).optional()
|
|
5258
5505
|
});
|
|
5259
5506
|
|
|
5260
5507
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/get.js
|
|
5261
|
-
import { z as
|
|
5262
|
-
var getResearchTaskSchema =
|
|
5263
|
-
id:
|
|
5508
|
+
import { z as z116 } from "zod";
|
|
5509
|
+
var getResearchTaskSchema = z116.object({
|
|
5510
|
+
id: z116.string().min(1)
|
|
5264
5511
|
});
|
|
5265
5512
|
|
|
5266
5513
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/update.js
|
|
5267
|
-
import { z as
|
|
5268
|
-
var updateResearchTaskSchema =
|
|
5269
|
-
id:
|
|
5270
|
-
title:
|
|
5271
|
-
description:
|
|
5272
|
-
type:
|
|
5514
|
+
import { z as z117 } from "zod";
|
|
5515
|
+
var updateResearchTaskSchema = z117.object({
|
|
5516
|
+
id: z117.string(),
|
|
5517
|
+
title: z117.string(),
|
|
5518
|
+
description: z117.string(),
|
|
5519
|
+
type: z117.nativeEnum(ResearchTaskType)
|
|
5273
5520
|
});
|
|
5274
5521
|
var researchTaskScrapeUpdateSchema = updateResearchTaskSchema.extend({
|
|
5275
|
-
urls:
|
|
5276
|
-
canDiscoverLinks:
|
|
5522
|
+
urls: z117.array(z117.string().url()).min(1),
|
|
5523
|
+
canDiscoverLinks: z117.boolean()
|
|
5277
5524
|
});
|
|
5278
5525
|
|
|
5279
5526
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/listByAgentId.js
|
|
5280
|
-
import { z as
|
|
5281
|
-
var listByAgentIdSchema =
|
|
5282
|
-
researchAgentId:
|
|
5527
|
+
import { z as z118 } from "zod";
|
|
5528
|
+
var listByAgentIdSchema = z118.object({
|
|
5529
|
+
researchAgentId: z118.string()
|
|
5283
5530
|
});
|
|
5284
5531
|
|
|
5285
5532
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/remove.js
|
|
5286
|
-
import { z as
|
|
5287
|
-
var researchTaskRemoveSchema =
|
|
5288
|
-
id:
|
|
5533
|
+
import { z as z119 } from "zod";
|
|
5534
|
+
var researchTaskRemoveSchema = z119.object({
|
|
5535
|
+
id: z119.string().min(1)
|
|
5289
5536
|
});
|
|
5290
5537
|
|
|
5291
5538
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/retry.js
|
|
5292
|
-
import { z as
|
|
5293
|
-
var researchTaskRetrySchema =
|
|
5294
|
-
id:
|
|
5295
|
-
userId:
|
|
5539
|
+
import { z as z120 } from "zod";
|
|
5540
|
+
var researchTaskRetrySchema = z120.object({
|
|
5541
|
+
id: z120.string(),
|
|
5542
|
+
userId: z120.string()
|
|
5296
5543
|
});
|
|
5297
5544
|
|
|
5298
5545
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/processDiscoveredLinks.js
|
|
5299
5546
|
import axios4 from "axios";
|
|
5300
|
-
import { z as
|
|
5547
|
+
import { z as z121 } from "zod";
|
|
5301
5548
|
import plimit from "p-limit";
|
|
5302
5549
|
import pLimit2 from "p-limit";
|
|
5303
|
-
var researchTaskProcessDiscoveredLinksSchema =
|
|
5304
|
-
id:
|
|
5550
|
+
var researchTaskProcessDiscoveredLinksSchema = z121.object({
|
|
5551
|
+
id: z121.string()
|
|
5305
5552
|
});
|
|
5306
5553
|
|
|
5307
5554
|
// ../../b4m-core/packages/services/dist/src/researchTaskService/downloadRelevantLinks.js
|
|
5308
|
-
import { z as
|
|
5555
|
+
import { z as z122 } from "zod";
|
|
5309
5556
|
import plimit2 from "p-limit";
|
|
5310
5557
|
import axios5 from "axios";
|
|
5311
5558
|
import { fileTypeFromBuffer } from "file-type";
|
|
5312
|
-
var researchTaskDownloadRelevantLinksSchema =
|
|
5313
|
-
id:
|
|
5559
|
+
var researchTaskDownloadRelevantLinksSchema = z122.object({
|
|
5560
|
+
id: z122.string()
|
|
5314
5561
|
});
|
|
5315
5562
|
|
|
5316
5563
|
// ../../b4m-core/packages/services/dist/src/researchData/remove.js
|
|
5317
|
-
import { z as
|
|
5318
|
-
var researchDataRemoveSchema =
|
|
5319
|
-
id:
|
|
5320
|
-
researchAgentId:
|
|
5564
|
+
import { z as z123 } from "zod";
|
|
5565
|
+
var researchDataRemoveSchema = z123.object({
|
|
5566
|
+
id: z123.string(),
|
|
5567
|
+
researchAgentId: z123.string()
|
|
5321
5568
|
});
|
|
5322
5569
|
|
|
5323
5570
|
// ../../b4m-core/packages/services/dist/src/taskSchedulerService/create.js
|
|
5324
|
-
import { z as
|
|
5325
|
-
var researchTaskPayload =
|
|
5326
|
-
id:
|
|
5327
|
-
userId:
|
|
5571
|
+
import { z as z124 } from "zod";
|
|
5572
|
+
var researchTaskPayload = z124.object({
|
|
5573
|
+
id: z124.string(),
|
|
5574
|
+
userId: z124.string()
|
|
5328
5575
|
});
|
|
5329
|
-
var customTaskPayload =
|
|
5330
|
-
test:
|
|
5576
|
+
var customTaskPayload = z124.object({
|
|
5577
|
+
test: z124.string()
|
|
5331
5578
|
});
|
|
5332
|
-
var taskSchedulerCreate =
|
|
5333
|
-
|
|
5334
|
-
handler:
|
|
5579
|
+
var taskSchedulerCreate = z124.discriminatedUnion("handler", [
|
|
5580
|
+
z124.object({
|
|
5581
|
+
handler: z124.literal(TaskScheduleHandler.RESEARCH_TASK_PROCESS),
|
|
5335
5582
|
payload: researchTaskPayload,
|
|
5336
|
-
processDate:
|
|
5583
|
+
processDate: z124.date()
|
|
5337
5584
|
}),
|
|
5338
|
-
|
|
5339
|
-
handler:
|
|
5585
|
+
z124.object({
|
|
5586
|
+
handler: z124.literal(TaskScheduleHandler.CUSTOM_TASK_PROCESS),
|
|
5340
5587
|
payload: customTaskPayload,
|
|
5341
|
-
processDate:
|
|
5588
|
+
processDate: z124.date()
|
|
5342
5589
|
})
|
|
5343
5590
|
]);
|
|
5344
5591
|
|
|
5345
5592
|
// ../../b4m-core/packages/services/dist/src/tagService/createFileTag.js
|
|
5346
|
-
import { z as z124 } from "zod";
|
|
5347
|
-
var tagCreateFileTagSchema = z124.object({
|
|
5348
|
-
name: z124.string(),
|
|
5349
|
-
icon: z124.string().optional(),
|
|
5350
|
-
color: z124.string().optional(),
|
|
5351
|
-
description: z124.string().optional()
|
|
5352
|
-
});
|
|
5353
|
-
|
|
5354
|
-
// ../../b4m-core/packages/services/dist/src/tagService/create.js
|
|
5355
5593
|
import { z as z125 } from "zod";
|
|
5356
|
-
var
|
|
5594
|
+
var tagCreateFileTagSchema = z125.object({
|
|
5357
5595
|
name: z125.string(),
|
|
5358
5596
|
icon: z125.string().optional(),
|
|
5359
|
-
description: z125.string().optional(),
|
|
5360
5597
|
color: z125.string().optional(),
|
|
5361
|
-
|
|
5598
|
+
description: z125.string().optional()
|
|
5362
5599
|
});
|
|
5363
5600
|
|
|
5364
|
-
// ../../b4m-core/packages/services/dist/src/tagService/
|
|
5601
|
+
// ../../b4m-core/packages/services/dist/src/tagService/create.js
|
|
5365
5602
|
import { z as z126 } from "zod";
|
|
5366
|
-
var
|
|
5367
|
-
|
|
5368
|
-
name: z126.string().optional(),
|
|
5603
|
+
var tagCreateSchema = z126.object({
|
|
5604
|
+
name: z126.string(),
|
|
5369
5605
|
icon: z126.string().optional(),
|
|
5370
5606
|
description: z126.string().optional(),
|
|
5371
|
-
color: z126.string().optional()
|
|
5607
|
+
color: z126.string().optional(),
|
|
5608
|
+
type: z126.nativeEnum(TagType)
|
|
5372
5609
|
});
|
|
5373
5610
|
|
|
5374
|
-
// ../../b4m-core/packages/services/dist/src/tagService/
|
|
5611
|
+
// ../../b4m-core/packages/services/dist/src/tagService/update.js
|
|
5375
5612
|
import { z as z127 } from "zod";
|
|
5376
|
-
var
|
|
5377
|
-
id: z127.string()
|
|
5613
|
+
var tagUpdateSchema = z127.object({
|
|
5614
|
+
id: z127.string(),
|
|
5615
|
+
name: z127.string().optional(),
|
|
5616
|
+
icon: z127.string().optional(),
|
|
5617
|
+
description: z127.string().optional(),
|
|
5618
|
+
color: z127.string().optional()
|
|
5378
5619
|
});
|
|
5379
5620
|
|
|
5380
|
-
// ../../b4m-core/packages/services/dist/src/
|
|
5621
|
+
// ../../b4m-core/packages/services/dist/src/tagService/remove.js
|
|
5381
5622
|
import { z as z128 } from "zod";
|
|
5382
|
-
var
|
|
5383
|
-
id: z128.string()
|
|
5623
|
+
var tagRemoveSchema = z128.object({
|
|
5624
|
+
id: z128.string()
|
|
5625
|
+
});
|
|
5626
|
+
|
|
5627
|
+
// ../../b4m-core/packages/services/dist/src/artifactService/create.js
|
|
5628
|
+
import { z as z129 } from "zod";
|
|
5629
|
+
var createArtifactSchema = z129.object({
|
|
5630
|
+
id: z129.string().optional(),
|
|
5384
5631
|
// Allow custom ID for AI-generated artifacts
|
|
5385
|
-
type:
|
|
5386
|
-
title:
|
|
5387
|
-
description:
|
|
5388
|
-
content:
|
|
5389
|
-
projectId:
|
|
5390
|
-
organizationId:
|
|
5391
|
-
visibility:
|
|
5392
|
-
tags:
|
|
5393
|
-
versionTag:
|
|
5394
|
-
sourceQuestId:
|
|
5395
|
-
sessionId:
|
|
5396
|
-
parentArtifactId:
|
|
5397
|
-
permissions:
|
|
5398
|
-
canRead:
|
|
5399
|
-
canWrite:
|
|
5400
|
-
canDelete:
|
|
5401
|
-
isPublic:
|
|
5402
|
-
inheritFromProject:
|
|
5632
|
+
type: z129.enum(["mermaid", "recharts", "python", "react", "html", "svg", "code", "quest", "file", "questmaster"]),
|
|
5633
|
+
title: z129.string().min(1).max(255),
|
|
5634
|
+
description: z129.string().max(1e3).optional(),
|
|
5635
|
+
content: z129.string().min(1),
|
|
5636
|
+
projectId: z129.string().optional(),
|
|
5637
|
+
organizationId: z129.string().optional(),
|
|
5638
|
+
visibility: z129.enum(["private", "project", "organization", "public"]).default("private"),
|
|
5639
|
+
tags: z129.array(z129.string().max(50)).max(20).default([]),
|
|
5640
|
+
versionTag: z129.string().max(100).optional(),
|
|
5641
|
+
sourceQuestId: z129.string().optional(),
|
|
5642
|
+
sessionId: z129.string().optional(),
|
|
5643
|
+
parentArtifactId: z129.string().optional(),
|
|
5644
|
+
permissions: z129.object({
|
|
5645
|
+
canRead: z129.array(z129.string()).default([]),
|
|
5646
|
+
canWrite: z129.array(z129.string()).default([]),
|
|
5647
|
+
canDelete: z129.array(z129.string()).default([]),
|
|
5648
|
+
isPublic: z129.boolean().default(false),
|
|
5649
|
+
inheritFromProject: z129.boolean().default(true)
|
|
5403
5650
|
}).optional(),
|
|
5404
|
-
metadata:
|
|
5651
|
+
metadata: z129.record(z129.unknown()).default({})
|
|
5405
5652
|
});
|
|
5406
5653
|
|
|
5407
5654
|
// ../../b4m-core/packages/services/dist/src/artifactService/get.js
|
|
5408
|
-
import { z as
|
|
5409
|
-
var getArtifactSchema =
|
|
5410
|
-
id:
|
|
5411
|
-
includeContent:
|
|
5412
|
-
includeVersions:
|
|
5413
|
-
version:
|
|
5655
|
+
import { z as z130 } from "zod";
|
|
5656
|
+
var getArtifactSchema = z130.object({
|
|
5657
|
+
id: z130.string(),
|
|
5658
|
+
includeContent: z130.boolean().default(false),
|
|
5659
|
+
includeVersions: z130.boolean().default(false),
|
|
5660
|
+
version: z130.number().optional()
|
|
5414
5661
|
});
|
|
5415
5662
|
|
|
5416
5663
|
// ../../b4m-core/packages/services/dist/src/artifactService/list.js
|
|
5417
|
-
import { z as
|
|
5418
|
-
var listArtifactsSchema =
|
|
5419
|
-
type:
|
|
5420
|
-
status:
|
|
5421
|
-
visibility:
|
|
5422
|
-
projectId:
|
|
5423
|
-
sessionId:
|
|
5424
|
-
tags:
|
|
5425
|
-
search:
|
|
5426
|
-
limit:
|
|
5427
|
-
offset:
|
|
5428
|
-
sortBy:
|
|
5429
|
-
sortOrder:
|
|
5430
|
-
includeDeleted:
|
|
5664
|
+
import { z as z131 } from "zod";
|
|
5665
|
+
var listArtifactsSchema = z131.object({
|
|
5666
|
+
type: z131.string().optional(),
|
|
5667
|
+
status: z131.enum(["draft", "review", "published", "archived"]).optional(),
|
|
5668
|
+
visibility: z131.enum(["private", "project", "organization", "public"]).optional(),
|
|
5669
|
+
projectId: z131.string().optional(),
|
|
5670
|
+
sessionId: z131.string().optional(),
|
|
5671
|
+
tags: z131.array(z131.string()).optional(),
|
|
5672
|
+
search: z131.string().optional(),
|
|
5673
|
+
limit: z131.number().min(1).max(100).default(20),
|
|
5674
|
+
offset: z131.number().min(0).default(0),
|
|
5675
|
+
sortBy: z131.enum(["createdAt", "updatedAt", "title", "type"]).default("updatedAt"),
|
|
5676
|
+
sortOrder: z131.enum(["asc", "desc"]).default("desc"),
|
|
5677
|
+
includeDeleted: z131.boolean().default(false)
|
|
5431
5678
|
});
|
|
5432
5679
|
|
|
5433
5680
|
// ../../b4m-core/packages/services/dist/src/artifactService/update.js
|
|
5434
|
-
import { z as
|
|
5435
|
-
var updateArtifactSchema =
|
|
5436
|
-
id:
|
|
5437
|
-
title:
|
|
5438
|
-
description:
|
|
5439
|
-
content:
|
|
5440
|
-
visibility:
|
|
5441
|
-
status:
|
|
5442
|
-
tags:
|
|
5443
|
-
versionTag:
|
|
5444
|
-
permissions:
|
|
5445
|
-
canRead:
|
|
5446
|
-
canWrite:
|
|
5447
|
-
canDelete:
|
|
5448
|
-
isPublic:
|
|
5449
|
-
inheritFromProject:
|
|
5681
|
+
import { z as z132 } from "zod";
|
|
5682
|
+
var updateArtifactSchema = z132.object({
|
|
5683
|
+
id: z132.string(),
|
|
5684
|
+
title: z132.string().min(1).max(255).optional(),
|
|
5685
|
+
description: z132.string().max(1e3).optional(),
|
|
5686
|
+
content: z132.string().optional(),
|
|
5687
|
+
visibility: z132.enum(["private", "project", "organization", "public"]).optional(),
|
|
5688
|
+
status: z132.enum(["draft", "review", "published", "archived"]).optional(),
|
|
5689
|
+
tags: z132.array(z132.string().max(50)).max(20).optional(),
|
|
5690
|
+
versionTag: z132.string().max(100).optional(),
|
|
5691
|
+
permissions: z132.object({
|
|
5692
|
+
canRead: z132.array(z132.string()).optional(),
|
|
5693
|
+
canWrite: z132.array(z132.string()).optional(),
|
|
5694
|
+
canDelete: z132.array(z132.string()).optional(),
|
|
5695
|
+
isPublic: z132.boolean().optional(),
|
|
5696
|
+
inheritFromProject: z132.boolean().optional()
|
|
5450
5697
|
}).optional(),
|
|
5451
|
-
metadata:
|
|
5452
|
-
changes:
|
|
5453
|
-
changeDescription:
|
|
5454
|
-
createNewVersion:
|
|
5455
|
-
versionMessage:
|
|
5698
|
+
metadata: z132.record(z132.unknown()).optional(),
|
|
5699
|
+
changes: z132.array(z132.string()).optional(),
|
|
5700
|
+
changeDescription: z132.string().max(1e3).optional(),
|
|
5701
|
+
createNewVersion: z132.boolean().optional(),
|
|
5702
|
+
versionMessage: z132.string().max(500).optional()
|
|
5456
5703
|
});
|
|
5457
5704
|
|
|
5458
5705
|
// ../../b4m-core/packages/services/dist/src/artifactService/delete.js
|
|
5459
|
-
import { z as
|
|
5460
|
-
var deleteArtifactSchema =
|
|
5461
|
-
id:
|
|
5462
|
-
hardDelete:
|
|
5706
|
+
import { z as z133 } from "zod";
|
|
5707
|
+
var deleteArtifactSchema = z133.object({
|
|
5708
|
+
id: z133.string(),
|
|
5709
|
+
hardDelete: z133.boolean().default(false)
|
|
5463
5710
|
// For future implementation
|
|
5464
5711
|
});
|
|
5465
5712
|
|
|
5466
5713
|
// ../../b4m-core/packages/services/dist/src/questMasterService/create.js
|
|
5467
|
-
import { z as
|
|
5468
|
-
var questSchema =
|
|
5469
|
-
id:
|
|
5470
|
-
title:
|
|
5471
|
-
description:
|
|
5472
|
-
status:
|
|
5473
|
-
order:
|
|
5474
|
-
dependencies:
|
|
5475
|
-
estimatedTime:
|
|
5476
|
-
});
|
|
5477
|
-
var questResourceSchema =
|
|
5478
|
-
title:
|
|
5479
|
-
url:
|
|
5480
|
-
type:
|
|
5481
|
-
});
|
|
5482
|
-
var createQuestMasterSchema =
|
|
5483
|
-
title:
|
|
5484
|
-
description:
|
|
5485
|
-
goal:
|
|
5486
|
-
complexity:
|
|
5487
|
-
estimatedTotalTime:
|
|
5488
|
-
prerequisites:
|
|
5489
|
-
quests:
|
|
5490
|
-
resources:
|
|
5491
|
-
projectId:
|
|
5492
|
-
organizationId:
|
|
5493
|
-
visibility:
|
|
5494
|
-
tags:
|
|
5495
|
-
permissions:
|
|
5496
|
-
canRead:
|
|
5497
|
-
canWrite:
|
|
5498
|
-
canDelete:
|
|
5499
|
-
isPublic:
|
|
5500
|
-
inheritFromProject:
|
|
5714
|
+
import { z as z134 } from "zod";
|
|
5715
|
+
var questSchema = z134.object({
|
|
5716
|
+
id: z134.string(),
|
|
5717
|
+
title: z134.string().min(1).max(255),
|
|
5718
|
+
description: z134.string().max(MAX_DESCRIPTION_LENGTH),
|
|
5719
|
+
status: z134.enum(["not_started", "in_progress", "completed", "blocked"]).default("not_started"),
|
|
5720
|
+
order: z134.number().min(0),
|
|
5721
|
+
dependencies: z134.array(z134.string()).default([]),
|
|
5722
|
+
estimatedTime: z134.string().optional()
|
|
5723
|
+
});
|
|
5724
|
+
var questResourceSchema = z134.object({
|
|
5725
|
+
title: z134.string().min(1).max(255),
|
|
5726
|
+
url: z134.string().url(),
|
|
5727
|
+
type: z134.enum(["documentation", "tutorial", "reference", "example"])
|
|
5728
|
+
});
|
|
5729
|
+
var createQuestMasterSchema = z134.object({
|
|
5730
|
+
title: z134.string().min(1).max(255),
|
|
5731
|
+
description: z134.string().max(MAX_DESCRIPTION_LENGTH).optional(),
|
|
5732
|
+
goal: z134.string().min(1).max(MAX_GOAL_LENGTH),
|
|
5733
|
+
complexity: z134.enum(["beginner", "intermediate", "advanced", "expert"]),
|
|
5734
|
+
estimatedTotalTime: z134.string().optional(),
|
|
5735
|
+
prerequisites: z134.array(z134.string().max(200)).default([]),
|
|
5736
|
+
quests: z134.array(questSchema).min(1),
|
|
5737
|
+
resources: z134.array(questResourceSchema).default([]),
|
|
5738
|
+
projectId: z134.string().optional(),
|
|
5739
|
+
organizationId: z134.string().optional(),
|
|
5740
|
+
visibility: z134.enum(["private", "project", "organization", "public"]).default("private"),
|
|
5741
|
+
tags: z134.array(z134.string().max(MAX_TAG_LENGTH)).max(20).default([]),
|
|
5742
|
+
permissions: z134.object({
|
|
5743
|
+
canRead: z134.array(z134.string()).default([]),
|
|
5744
|
+
canWrite: z134.array(z134.string()).default([]),
|
|
5745
|
+
canDelete: z134.array(z134.string()).default([]),
|
|
5746
|
+
isPublic: z134.boolean().default(false),
|
|
5747
|
+
inheritFromProject: z134.boolean().default(true)
|
|
5501
5748
|
}).optional(),
|
|
5502
|
-
sourceQuestId:
|
|
5503
|
-
sessionId:
|
|
5504
|
-
metadata:
|
|
5749
|
+
sourceQuestId: z134.string().optional(),
|
|
5750
|
+
sessionId: z134.string().optional(),
|
|
5751
|
+
metadata: z134.record(z134.unknown()).default({})
|
|
5505
5752
|
});
|
|
5506
5753
|
|
|
5507
5754
|
// ../../b4m-core/packages/services/dist/src/questMasterService/updateQuestStatus.js
|
|
5508
|
-
import { z as
|
|
5509
|
-
var updateQuestStatusSchema =
|
|
5510
|
-
artifactId:
|
|
5511
|
-
questId:
|
|
5512
|
-
status:
|
|
5513
|
-
completionNote:
|
|
5755
|
+
import { z as z135 } from "zod";
|
|
5756
|
+
var updateQuestStatusSchema = z135.object({
|
|
5757
|
+
artifactId: z135.string(),
|
|
5758
|
+
questId: z135.string(),
|
|
5759
|
+
status: z135.enum(["not_started", "in_progress", "completed", "blocked"]),
|
|
5760
|
+
completionNote: z135.string().max(500).optional()
|
|
5514
5761
|
});
|
|
5515
5762
|
|
|
5516
5763
|
// ../../b4m-core/packages/services/dist/src/dataLakeService/opensearchClient.js
|
|
@@ -5530,61 +5777,70 @@ import { v4 as uuidv44 } from "uuid";
|
|
|
5530
5777
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
5531
5778
|
|
|
5532
5779
|
// ../../b4m-core/packages/services/dist/src/emailIngestionService/types.js
|
|
5533
|
-
import { z as
|
|
5534
|
-
var processIngestedEmailOptionsSchema =
|
|
5535
|
-
platformDomain:
|
|
5536
|
-
isNewsletter:
|
|
5780
|
+
import { z as z136 } from "zod";
|
|
5781
|
+
var processIngestedEmailOptionsSchema = z136.object({
|
|
5782
|
+
platformDomain: z136.string().optional(),
|
|
5783
|
+
isNewsletter: z136.boolean().optional()
|
|
5537
5784
|
}).optional();
|
|
5538
|
-
var emailAttachmentSchema =
|
|
5539
|
-
filename:
|
|
5540
|
-
contentType:
|
|
5541
|
-
contentDisposition:
|
|
5542
|
-
size:
|
|
5543
|
-
content:
|
|
5544
|
-
related:
|
|
5545
|
-
});
|
|
5546
|
-
var parsedEmailObjectSchema =
|
|
5547
|
-
messageId:
|
|
5548
|
-
inReplyTo:
|
|
5549
|
-
references:
|
|
5550
|
-
from:
|
|
5785
|
+
var emailAttachmentSchema = z136.object({
|
|
5786
|
+
filename: z136.string().optional(),
|
|
5787
|
+
contentType: z136.string().optional(),
|
|
5788
|
+
contentDisposition: z136.string().optional(),
|
|
5789
|
+
size: z136.number().min(0),
|
|
5790
|
+
content: z136.instanceof(Buffer),
|
|
5791
|
+
related: z136.boolean().optional()
|
|
5792
|
+
});
|
|
5793
|
+
var parsedEmailObjectSchema = z136.object({
|
|
5794
|
+
messageId: z136.string().optional(),
|
|
5795
|
+
inReplyTo: z136.string().optional(),
|
|
5796
|
+
references: z136.union([z136.string(), z136.array(z136.string())]).optional(),
|
|
5797
|
+
from: z136.any().optional(),
|
|
5551
5798
|
// Complex email address object
|
|
5552
|
-
to:
|
|
5553
|
-
cc:
|
|
5554
|
-
bcc:
|
|
5555
|
-
subject:
|
|
5556
|
-
date:
|
|
5557
|
-
text:
|
|
5558
|
-
html:
|
|
5559
|
-
attachments:
|
|
5560
|
-
});
|
|
5561
|
-
var processIngestedEmailSchema =
|
|
5799
|
+
to: z136.any().optional(),
|
|
5800
|
+
cc: z136.any().optional(),
|
|
5801
|
+
bcc: z136.any().optional(),
|
|
5802
|
+
subject: z136.string().optional(),
|
|
5803
|
+
date: z136.date().optional(),
|
|
5804
|
+
text: z136.string().optional(),
|
|
5805
|
+
html: z136.string().optional(),
|
|
5806
|
+
attachments: z136.array(emailAttachmentSchema).optional()
|
|
5807
|
+
});
|
|
5808
|
+
var processIngestedEmailSchema = z136.object({
|
|
5562
5809
|
parsedEmail: parsedEmailObjectSchema,
|
|
5563
|
-
rawEmailS3Key:
|
|
5810
|
+
rawEmailS3Key: z136.string().min(1, "rawEmailS3Key cannot be empty"),
|
|
5564
5811
|
options: processIngestedEmailOptionsSchema
|
|
5565
5812
|
});
|
|
5566
5813
|
|
|
5567
5814
|
// ../../b4m-core/packages/services/dist/src/emailAnalysisService/types.js
|
|
5568
|
-
import { z as
|
|
5569
|
-
var llmAnalysisResponseSchema =
|
|
5570
|
-
summary:
|
|
5571
|
-
entities:
|
|
5572
|
-
companies:
|
|
5573
|
-
people:
|
|
5574
|
-
products:
|
|
5575
|
-
technologies:
|
|
5815
|
+
import { z as z137 } from "zod";
|
|
5816
|
+
var llmAnalysisResponseSchema = z137.object({
|
|
5817
|
+
summary: z137.string().min(1, "Summary cannot be empty"),
|
|
5818
|
+
entities: z137.object({
|
|
5819
|
+
companies: z137.array(z137.string()).default([]),
|
|
5820
|
+
people: z137.array(z137.string()).default([]),
|
|
5821
|
+
products: z137.array(z137.string()).default([]),
|
|
5822
|
+
technologies: z137.array(z137.string()).default([])
|
|
5576
5823
|
}),
|
|
5577
|
-
sentiment:
|
|
5578
|
-
actionItems:
|
|
5579
|
-
description:
|
|
5580
|
-
deadline:
|
|
5824
|
+
sentiment: z137.enum(["positive", "neutral", "negative", "urgent"]),
|
|
5825
|
+
actionItems: z137.array(z137.object({
|
|
5826
|
+
description: z137.string(),
|
|
5827
|
+
deadline: z137.string().optional()
|
|
5581
5828
|
// ISO date string from LLM
|
|
5582
5829
|
})).default([]),
|
|
5583
|
-
privacyRecommendation:
|
|
5584
|
-
embargoDetected:
|
|
5585
|
-
suggestedTags:
|
|
5830
|
+
privacyRecommendation: z137.enum(["public", "team", "private"]),
|
|
5831
|
+
embargoDetected: z137.boolean().default(false),
|
|
5832
|
+
suggestedTags: z137.array(z137.string()).default([])
|
|
5586
5833
|
});
|
|
5587
5834
|
|
|
5835
|
+
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletion.js
|
|
5836
|
+
import { z as z139 } from "zod";
|
|
5837
|
+
|
|
5838
|
+
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionInvoke.js
|
|
5839
|
+
import { fromZodError } from "zod-validation-error";
|
|
5840
|
+
|
|
5841
|
+
// ../../b4m-core/packages/services/dist/src/llm/tools/toolManager.js
|
|
5842
|
+
var BUILT_IN_TOOL_SET = new Set(b4mLLMTools.options);
|
|
5843
|
+
|
|
5588
5844
|
// ../../b4m-core/packages/services/dist/src/llm/tools/ToolCacheManager.js
|
|
5589
5845
|
var DEFAULT_CONFIG = {
|
|
5590
5846
|
ttl: 5 * 60 * 1e3,
|
|
@@ -6768,17 +7024,17 @@ var rechartsTool = {
|
|
|
6768
7024
|
};
|
|
6769
7025
|
|
|
6770
7026
|
// ../../b4m-core/packages/services/dist/src/llm/tools/implementation/editFile/index.js
|
|
6771
|
-
import { z as
|
|
7027
|
+
import { z as z138 } from "zod";
|
|
6772
7028
|
import { diffLines as diffLines2 } from "diff";
|
|
6773
|
-
var editFileSchema =
|
|
6774
|
-
fileId:
|
|
6775
|
-
instruction:
|
|
6776
|
-
selection:
|
|
6777
|
-
start:
|
|
6778
|
-
end:
|
|
7029
|
+
var editFileSchema = z138.object({
|
|
7030
|
+
fileId: z138.string().describe("The ID of the file to edit"),
|
|
7031
|
+
instruction: z138.string().describe("Natural language instruction describing the changes to make"),
|
|
7032
|
+
selection: z138.object({
|
|
7033
|
+
start: z138.number().describe("Starting character position of the selection"),
|
|
7034
|
+
end: z138.number().describe("Ending character position of the selection")
|
|
6779
7035
|
}).optional().describe("Optional selection range to edit within the file"),
|
|
6780
|
-
preserveFormatting:
|
|
6781
|
-
returnDiff:
|
|
7036
|
+
preserveFormatting: z138.boolean().optional().default(true).describe("Whether to preserve the original formatting style"),
|
|
7037
|
+
returnDiff: z138.boolean().optional().default(true).describe("Whether to return a diff of the changes")
|
|
6782
7038
|
});
|
|
6783
7039
|
function generateSimpleDiff(original, modified) {
|
|
6784
7040
|
const differences = diffLines2(original, modified);
|
|
@@ -10088,149 +10344,144 @@ var generateMcpTools = async (mcpData) => {
|
|
|
10088
10344
|
import throttle2 from "lodash/throttle.js";
|
|
10089
10345
|
|
|
10090
10346
|
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionFeatures.js
|
|
10091
|
-
import { z as z138 } from "zod";
|
|
10092
10347
|
import uniq4 from "lodash/uniq.js";
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10348
|
+
|
|
10349
|
+
// ../../b4m-core/packages/services/dist/src/llm/StatusManager.js
|
|
10350
|
+
import throttle from "lodash/throttle.js";
|
|
10351
|
+
|
|
10352
|
+
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionProcess.js
|
|
10353
|
+
var DISABLE_SERVER_THROTTLING = process.env.DISABLE_SERVER_THROTTLING === "true";
|
|
10354
|
+
var questSaveMutex = new Mutex();
|
|
10355
|
+
|
|
10356
|
+
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletion.js
|
|
10357
|
+
var QuestStartBodySchema = z139.object({
|
|
10358
|
+
userId: z139.string(),
|
|
10359
|
+
sessionId: z139.string(),
|
|
10360
|
+
questId: z139.string(),
|
|
10361
|
+
message: z139.string(),
|
|
10362
|
+
messageFileIds: z139.array(z139.string()),
|
|
10363
|
+
historyCount: z139.number(),
|
|
10364
|
+
fabFileIds: z139.array(z139.string()),
|
|
10101
10365
|
params: ChatCompletionCreateInputSchema,
|
|
10102
10366
|
dashboardParams: DashboardParamsSchema.optional(),
|
|
10103
|
-
enableQuestMaster:
|
|
10104
|
-
enableMementos:
|
|
10105
|
-
enableArtifacts:
|
|
10106
|
-
enableAgents:
|
|
10367
|
+
enableQuestMaster: z139.boolean().optional(),
|
|
10368
|
+
enableMementos: z139.boolean().optional(),
|
|
10369
|
+
enableArtifacts: z139.boolean().optional(),
|
|
10370
|
+
enableAgents: z139.boolean().optional(),
|
|
10107
10371
|
promptMeta: PromptMetaZodSchema,
|
|
10108
|
-
tools:
|
|
10109
|
-
mcpServers:
|
|
10110
|
-
projectId:
|
|
10111
|
-
organizationId:
|
|
10372
|
+
tools: z139.array(z139.union([b4mLLMTools, z139.string()])).optional(),
|
|
10373
|
+
mcpServers: z139.array(z139.string()).optional(),
|
|
10374
|
+
projectId: z139.string().optional(),
|
|
10375
|
+
organizationId: z139.string().nullable().optional(),
|
|
10112
10376
|
questMaster: QuestMasterParamsSchema.optional(),
|
|
10113
|
-
toolPromptId:
|
|
10377
|
+
toolPromptId: z139.string().optional(),
|
|
10114
10378
|
researchMode: ResearchModeParamsSchema.optional(),
|
|
10115
|
-
fallbackModel:
|
|
10116
|
-
embeddingModel:
|
|
10117
|
-
queryComplexity:
|
|
10379
|
+
fallbackModel: z139.string().optional(),
|
|
10380
|
+
embeddingModel: z139.string().optional(),
|
|
10381
|
+
queryComplexity: z139.string(),
|
|
10118
10382
|
imageConfig: GenerateImageToolCallSchema.optional(),
|
|
10119
|
-
deepResearchConfig:
|
|
10120
|
-
maxDepth:
|
|
10121
|
-
duration:
|
|
10383
|
+
deepResearchConfig: z139.object({
|
|
10384
|
+
maxDepth: z139.number().optional(),
|
|
10385
|
+
duration: z139.number().optional(),
|
|
10122
10386
|
// Note: searchers are passed via ToolContext and not through this API schema
|
|
10123
|
-
searchers:
|
|
10387
|
+
searchers: z139.array(z139.any()).optional()
|
|
10124
10388
|
}).optional(),
|
|
10125
|
-
extraContextMessages:
|
|
10126
|
-
role:
|
|
10127
|
-
content:
|
|
10128
|
-
fabFileIds:
|
|
10389
|
+
extraContextMessages: z139.array(z139.object({
|
|
10390
|
+
role: z139.enum(["user", "assistant", "system", "function", "tool"]),
|
|
10391
|
+
content: z139.union([z139.string(), z139.array(z139.any())]),
|
|
10392
|
+
fabFileIds: z139.array(z139.string()).optional()
|
|
10129
10393
|
})).optional(),
|
|
10130
10394
|
/** User's timezone (IANA format, e.g., "America/New_York") */
|
|
10131
|
-
timezone:
|
|
10395
|
+
timezone: z139.string().optional()
|
|
10132
10396
|
});
|
|
10133
10397
|
|
|
10134
|
-
// ../../b4m-core/packages/services/dist/src/llm/StatusManager.js
|
|
10135
|
-
import throttle from "lodash/throttle.js";
|
|
10136
|
-
|
|
10137
|
-
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionProcess.js
|
|
10138
|
-
var DISABLE_SERVER_THROTTLING = process.env.DISABLE_SERVER_THROTTLING === "true";
|
|
10139
|
-
var questSaveMutex = new Mutex();
|
|
10140
|
-
|
|
10141
|
-
// ../../b4m-core/packages/services/dist/src/llm/ChatCompletionInvoke.js
|
|
10142
|
-
import { fromZodError } from "zod-validation-error";
|
|
10143
|
-
|
|
10144
|
-
// ../../b4m-core/packages/services/dist/src/llm/tools/toolManager.js
|
|
10145
|
-
var BUILT_IN_TOOL_SET = new Set(b4mLLMTools.options);
|
|
10146
|
-
|
|
10147
10398
|
// ../../b4m-core/packages/services/dist/src/llm/ImageGeneration.js
|
|
10148
10399
|
import axios8 from "axios";
|
|
10149
10400
|
import { fileTypeFromBuffer as fileTypeFromBuffer4 } from "file-type";
|
|
10150
10401
|
import { v4 as uuidv47 } from "uuid";
|
|
10151
|
-
import { z as
|
|
10402
|
+
import { z as z140 } from "zod";
|
|
10152
10403
|
import { fromZodError as fromZodError2 } from "zod-validation-error";
|
|
10153
10404
|
var ImageGenerationBodySchema = OpenAIImageGenerationInput.extend({
|
|
10154
|
-
sessionId:
|
|
10155
|
-
questId:
|
|
10156
|
-
userId:
|
|
10157
|
-
prompt:
|
|
10158
|
-
organizationId:
|
|
10159
|
-
safety_tolerance:
|
|
10160
|
-
prompt_upsampling:
|
|
10161
|
-
seed:
|
|
10162
|
-
output_format:
|
|
10163
|
-
width:
|
|
10164
|
-
height:
|
|
10165
|
-
aspect_ratio:
|
|
10166
|
-
fabFileIds:
|
|
10405
|
+
sessionId: z140.string(),
|
|
10406
|
+
questId: z140.string(),
|
|
10407
|
+
userId: z140.string(),
|
|
10408
|
+
prompt: z140.string(),
|
|
10409
|
+
organizationId: z140.string().nullable().optional(),
|
|
10410
|
+
safety_tolerance: z140.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
|
|
10411
|
+
prompt_upsampling: z140.boolean().optional().default(false),
|
|
10412
|
+
seed: z140.number().nullable().optional(),
|
|
10413
|
+
output_format: z140.enum(["jpeg", "png"]).nullable().optional().default("png"),
|
|
10414
|
+
width: z140.number().optional(),
|
|
10415
|
+
height: z140.number().optional(),
|
|
10416
|
+
aspect_ratio: z140.string().optional(),
|
|
10417
|
+
fabFileIds: z140.array(z140.string()).optional()
|
|
10167
10418
|
});
|
|
10168
10419
|
|
|
10169
10420
|
// ../../b4m-core/packages/services/dist/src/llm/VideoGeneration.js
|
|
10170
10421
|
import axios9 from "axios";
|
|
10171
10422
|
import { v4 as uuidv48 } from "uuid";
|
|
10172
|
-
import { z as
|
|
10423
|
+
import { z as z141 } from "zod";
|
|
10173
10424
|
import { fromZodError as fromZodError3 } from "zod-validation-error";
|
|
10174
|
-
var VideoGenerationBodySchema =
|
|
10175
|
-
sessionId:
|
|
10176
|
-
questId:
|
|
10177
|
-
userId:
|
|
10178
|
-
prompt:
|
|
10179
|
-
model:
|
|
10180
|
-
seconds:
|
|
10181
|
-
size:
|
|
10182
|
-
organizationId:
|
|
10425
|
+
var VideoGenerationBodySchema = z141.object({
|
|
10426
|
+
sessionId: z141.string(),
|
|
10427
|
+
questId: z141.string(),
|
|
10428
|
+
userId: z141.string(),
|
|
10429
|
+
prompt: z141.string(),
|
|
10430
|
+
model: z141.nativeEnum(VideoModels).default(VideoModels.SORA_2),
|
|
10431
|
+
seconds: z141.union([z141.literal(4), z141.literal(8), z141.literal(12)]).default(4),
|
|
10432
|
+
size: z141.enum(["720x1280", "1280x720", "1024x1792", "1792x1024"]).default(VIDEO_SIZE_CONSTRAINTS.SORA.defaultSize),
|
|
10433
|
+
organizationId: z141.string().nullable().optional()
|
|
10183
10434
|
});
|
|
10184
10435
|
|
|
10185
10436
|
// ../../b4m-core/packages/services/dist/src/llm/ImageEdit.js
|
|
10186
10437
|
import axios10 from "axios";
|
|
10187
10438
|
import { fileTypeFromBuffer as fileTypeFromBuffer5 } from "file-type";
|
|
10188
10439
|
import { v4 as uuidv49 } from "uuid";
|
|
10189
|
-
import { z as
|
|
10440
|
+
import { z as z142 } from "zod";
|
|
10190
10441
|
import { fromZodError as fromZodError4 } from "zod-validation-error";
|
|
10191
10442
|
var ImageEditBodySchema = OpenAIImageGenerationInput.extend({
|
|
10192
|
-
sessionId:
|
|
10193
|
-
questId:
|
|
10194
|
-
userId:
|
|
10195
|
-
prompt:
|
|
10196
|
-
organizationId:
|
|
10197
|
-
safety_tolerance:
|
|
10198
|
-
prompt_upsampling:
|
|
10199
|
-
seed:
|
|
10200
|
-
output_format:
|
|
10201
|
-
width:
|
|
10202
|
-
height:
|
|
10203
|
-
aspect_ratio:
|
|
10204
|
-
size:
|
|
10205
|
-
fabFileIds:
|
|
10206
|
-
image:
|
|
10443
|
+
sessionId: z142.string(),
|
|
10444
|
+
questId: z142.string(),
|
|
10445
|
+
userId: z142.string(),
|
|
10446
|
+
prompt: z142.string(),
|
|
10447
|
+
organizationId: z142.string().nullable().optional(),
|
|
10448
|
+
safety_tolerance: z142.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
|
|
10449
|
+
prompt_upsampling: z142.boolean().optional().default(false),
|
|
10450
|
+
seed: z142.number().nullable().optional(),
|
|
10451
|
+
output_format: z142.enum(["jpeg", "png"]).optional().default("png"),
|
|
10452
|
+
width: z142.number().optional(),
|
|
10453
|
+
height: z142.number().optional(),
|
|
10454
|
+
aspect_ratio: z142.string().optional(),
|
|
10455
|
+
size: z142.string().optional(),
|
|
10456
|
+
fabFileIds: z142.array(z142.string()).optional(),
|
|
10457
|
+
image: z142.string()
|
|
10207
10458
|
});
|
|
10208
10459
|
|
|
10209
10460
|
// ../../b4m-core/packages/services/dist/src/llm/refineText.js
|
|
10210
|
-
import { z as
|
|
10211
|
-
var refineTextLLMSchema =
|
|
10212
|
-
text:
|
|
10213
|
-
context:
|
|
10461
|
+
import { z as z143 } from "zod";
|
|
10462
|
+
var refineTextLLMSchema = z143.object({
|
|
10463
|
+
text: z143.string(),
|
|
10464
|
+
context: z143.string().optional()
|
|
10214
10465
|
// tone: z.enum(['formal', 'informal', 'neutral']).optional(),
|
|
10215
10466
|
// style: z.enum(['technical', 'creative', 'academic', 'business', 'narrative']).optional(),
|
|
10216
10467
|
});
|
|
10217
10468
|
|
|
10218
10469
|
// ../../b4m-core/packages/services/dist/src/llm/MementoEvaluationService.js
|
|
10219
|
-
import { z as
|
|
10220
|
-
var SingleMementoEvalSchema =
|
|
10221
|
-
importance:
|
|
10470
|
+
import { z as z144 } from "zod";
|
|
10471
|
+
var SingleMementoEvalSchema = z144.object({
|
|
10472
|
+
importance: z144.number().min(1).max(10),
|
|
10222
10473
|
// 1-10 scale for personal info importance
|
|
10223
|
-
summary:
|
|
10224
|
-
tags:
|
|
10474
|
+
summary: z144.string(),
|
|
10475
|
+
tags: z144.array(z144.string()).optional()
|
|
10225
10476
|
});
|
|
10226
|
-
var MementoEvalResponseSchema =
|
|
10227
|
-
isPersonal:
|
|
10228
|
-
mementos:
|
|
10477
|
+
var MementoEvalResponseSchema = z144.object({
|
|
10478
|
+
isPersonal: z144.boolean(),
|
|
10479
|
+
mementos: z144.array(SingleMementoEvalSchema).optional()
|
|
10229
10480
|
// Array of distinct personal information
|
|
10230
10481
|
});
|
|
10231
10482
|
|
|
10232
10483
|
// ../../b4m-core/packages/services/dist/src/llm/SmallLLMService.js
|
|
10233
|
-
import { z as
|
|
10484
|
+
import { z as z145 } from "zod";
|
|
10234
10485
|
|
|
10235
10486
|
// ../../b4m-core/packages/services/dist/src/auth/AccessTokenGeneratorService.js
|
|
10236
10487
|
import jwt2 from "jsonwebtoken";
|
|
@@ -10522,7 +10773,7 @@ function buildHookContext(params) {
|
|
|
10522
10773
|
}
|
|
10523
10774
|
|
|
10524
10775
|
// src/agents/types.ts
|
|
10525
|
-
import { z as
|
|
10776
|
+
import { z as z146 } from "zod";
|
|
10526
10777
|
var HookBlockedError = class extends Error {
|
|
10527
10778
|
constructor(toolName, reason) {
|
|
10528
10779
|
super(`Hook blocked execution of ${toolName}: ${reason || "No reason provided"}`);
|
|
@@ -10534,39 +10785,39 @@ var ALWAYS_DENIED_FOR_AGENTS = [
|
|
|
10534
10785
|
"agent_delegate"
|
|
10535
10786
|
// No agent chaining
|
|
10536
10787
|
];
|
|
10537
|
-
var CommandHookSchema =
|
|
10538
|
-
type:
|
|
10539
|
-
command:
|
|
10540
|
-
timeout:
|
|
10541
|
-
});
|
|
10542
|
-
var PromptHookSchema =
|
|
10543
|
-
type:
|
|
10544
|
-
prompt:
|
|
10545
|
-
timeout:
|
|
10546
|
-
});
|
|
10547
|
-
var HookDefinitionSchema =
|
|
10548
|
-
var HookMatcherSchema =
|
|
10549
|
-
matcher:
|
|
10550
|
-
hooks:
|
|
10551
|
-
});
|
|
10552
|
-
var AgentHooksSchema =
|
|
10553
|
-
PreToolUse:
|
|
10554
|
-
PostToolUse:
|
|
10555
|
-
PostToolUseFailure:
|
|
10556
|
-
Stop:
|
|
10788
|
+
var CommandHookSchema = z146.object({
|
|
10789
|
+
type: z146.literal("command"),
|
|
10790
|
+
command: z146.string().min(1, "Command is required for command hooks"),
|
|
10791
|
+
timeout: z146.number().optional()
|
|
10792
|
+
});
|
|
10793
|
+
var PromptHookSchema = z146.object({
|
|
10794
|
+
type: z146.literal("prompt"),
|
|
10795
|
+
prompt: z146.string().min(1, "Prompt is required for prompt hooks"),
|
|
10796
|
+
timeout: z146.number().optional()
|
|
10797
|
+
});
|
|
10798
|
+
var HookDefinitionSchema = z146.discriminatedUnion("type", [CommandHookSchema, PromptHookSchema]);
|
|
10799
|
+
var HookMatcherSchema = z146.object({
|
|
10800
|
+
matcher: z146.string().optional(),
|
|
10801
|
+
hooks: z146.array(HookDefinitionSchema)
|
|
10802
|
+
});
|
|
10803
|
+
var AgentHooksSchema = z146.object({
|
|
10804
|
+
PreToolUse: z146.array(HookMatcherSchema).optional(),
|
|
10805
|
+
PostToolUse: z146.array(HookMatcherSchema).optional(),
|
|
10806
|
+
PostToolUseFailure: z146.array(HookMatcherSchema).optional(),
|
|
10807
|
+
Stop: z146.array(HookMatcherSchema).optional()
|
|
10557
10808
|
}).optional();
|
|
10558
|
-
var AgentFrontmatterSchema =
|
|
10559
|
-
description:
|
|
10560
|
-
model:
|
|
10561
|
-
"allowed-tools":
|
|
10562
|
-
"denied-tools":
|
|
10563
|
-
"max-iterations":
|
|
10564
|
-
quick:
|
|
10565
|
-
medium:
|
|
10566
|
-
very_thorough:
|
|
10809
|
+
var AgentFrontmatterSchema = z146.object({
|
|
10810
|
+
description: z146.string().min(1, "Agent description is required"),
|
|
10811
|
+
model: z146.string().optional(),
|
|
10812
|
+
"allowed-tools": z146.array(z146.string()).optional(),
|
|
10813
|
+
"denied-tools": z146.array(z146.string()).optional(),
|
|
10814
|
+
"max-iterations": z146.object({
|
|
10815
|
+
quick: z146.number().int().positive().optional(),
|
|
10816
|
+
medium: z146.number().int().positive().optional(),
|
|
10817
|
+
very_thorough: z146.number().int().positive().optional()
|
|
10567
10818
|
}).optional(),
|
|
10568
|
-
"default-thoroughness":
|
|
10569
|
-
variables:
|
|
10819
|
+
"default-thoroughness": z146.enum(["quick", "medium", "very_thorough"]).optional(),
|
|
10820
|
+
variables: z146.record(z146.string()).optional(),
|
|
10570
10821
|
hooks: AgentHooksSchema
|
|
10571
10822
|
});
|
|
10572
10823
|
var DEFAULT_MAX_ITERATIONS = {
|
|
@@ -10877,67 +11128,6 @@ function generateCliTools(userId, llm, model, permissionManager, showPermissionP
|
|
|
10877
11128
|
return { tools: tools2, agentContext };
|
|
10878
11129
|
}
|
|
10879
11130
|
|
|
10880
|
-
// src/config/toolSafety.ts
|
|
10881
|
-
import { z as z146 } from "zod";
|
|
10882
|
-
var ToolCategorySchema = z146.enum([
|
|
10883
|
-
"auto_approve",
|
|
10884
|
-
// Safe tools that run automatically without permission
|
|
10885
|
-
"prompt_always",
|
|
10886
|
-
// Dangerous tools that ALWAYS require permission (cannot be trusted)
|
|
10887
|
-
"prompt_default"
|
|
10888
|
-
// Tools that prompt by default but can be trusted
|
|
10889
|
-
]);
|
|
10890
|
-
var ToolSafetyConfigSchema = z146.object({
|
|
10891
|
-
categories: z146.record(z146.string(), ToolCategorySchema),
|
|
10892
|
-
trustedTools: z146.array(z146.string())
|
|
10893
|
-
});
|
|
10894
|
-
var DEFAULT_TOOL_CATEGORIES = {
|
|
10895
|
-
// ===== AUTO APPROVE (Safe tools) =====
|
|
10896
|
-
// These tools have no side effects and are always safe to execute
|
|
10897
|
-
math_evaluate: "auto_approve",
|
|
10898
|
-
current_datetime: "auto_approve",
|
|
10899
|
-
dice_roll: "auto_approve",
|
|
10900
|
-
prompt_enhancement: "auto_approve",
|
|
10901
|
-
weather_info: "prompt_default",
|
|
10902
|
-
// ===== PROMPT ALWAYS (Dangerous tools) =====
|
|
10903
|
-
// These tools can modify files, execute code, or have other dangerous side effects
|
|
10904
|
-
// They ALWAYS require permission and cannot be trusted automatically
|
|
10905
|
-
edit_file: "prompt_always",
|
|
10906
|
-
edit_local_file: "prompt_always",
|
|
10907
|
-
create_file: "prompt_always",
|
|
10908
|
-
delete_file: "prompt_always",
|
|
10909
|
-
shell_execute: "prompt_always",
|
|
10910
|
-
bash_execute: "prompt_always",
|
|
10911
|
-
git_commit: "prompt_always",
|
|
10912
|
-
git_push: "prompt_always",
|
|
10913
|
-
// ===== PROMPT DEFAULT (Repository read tools) =====
|
|
10914
|
-
// These tools read from the repository but don't modify anything
|
|
10915
|
-
// Users can trust them if they want to avoid prompts
|
|
10916
|
-
web_search: "prompt_default",
|
|
10917
|
-
deep_research: "prompt_default",
|
|
10918
|
-
file_read: "prompt_default",
|
|
10919
|
-
grep_search: "prompt_default",
|
|
10920
|
-
glob_files: "prompt_default",
|
|
10921
|
-
get_file_tree: "prompt_default",
|
|
10922
|
-
git_status: "prompt_default",
|
|
10923
|
-
git_diff: "prompt_default",
|
|
10924
|
-
git_log: "prompt_default",
|
|
10925
|
-
git_branch: "prompt_default"
|
|
10926
|
-
};
|
|
10927
|
-
function getToolCategory(toolName, customCategories) {
|
|
10928
|
-
if (customCategories && toolName in customCategories) {
|
|
10929
|
-
return customCategories[toolName];
|
|
10930
|
-
}
|
|
10931
|
-
if (toolName in DEFAULT_TOOL_CATEGORIES) {
|
|
10932
|
-
return DEFAULT_TOOL_CATEGORIES[toolName];
|
|
10933
|
-
}
|
|
10934
|
-
return "prompt_default";
|
|
10935
|
-
}
|
|
10936
|
-
function canTrustTool(toolName, customCategories) {
|
|
10937
|
-
const category = getToolCategory(toolName, customCategories);
|
|
10938
|
-
return category !== "prompt_always";
|
|
10939
|
-
}
|
|
10940
|
-
|
|
10941
11131
|
// src/utils/PermissionManager.ts
|
|
10942
11132
|
var PermissionManager = class {
|
|
10943
11133
|
constructor(trustedTools = [], customCategories, deniedTools) {
|
|
@@ -12509,7 +12699,7 @@ import { isAxiosError as isAxiosError2 } from "axios";
|
|
|
12509
12699
|
// package.json
|
|
12510
12700
|
var package_default = {
|
|
12511
12701
|
name: "@bike4mind/cli",
|
|
12512
|
-
version: "0.2.24-feat-
|
|
12702
|
+
version: "0.2.24-feat-parallel-tool-execution.18470+d8da60d93",
|
|
12513
12703
|
type: "module",
|
|
12514
12704
|
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
12515
12705
|
license: "UNLICENSED",
|
|
@@ -12617,10 +12807,10 @@ var package_default = {
|
|
|
12617
12807
|
},
|
|
12618
12808
|
devDependencies: {
|
|
12619
12809
|
"@bike4mind/agents": "0.1.0",
|
|
12620
|
-
"@bike4mind/common": "2.47.1-feat-
|
|
12621
|
-
"@bike4mind/mcp": "1.27.1-feat-
|
|
12622
|
-
"@bike4mind/services": "2.45.1-feat-
|
|
12623
|
-
"@bike4mind/utils": "2.3.3-feat-
|
|
12810
|
+
"@bike4mind/common": "2.47.1-feat-parallel-tool-execution.18470+d8da60d93",
|
|
12811
|
+
"@bike4mind/mcp": "1.27.1-feat-parallel-tool-execution.18470+d8da60d93",
|
|
12812
|
+
"@bike4mind/services": "2.45.1-feat-parallel-tool-execution.18470+d8da60d93",
|
|
12813
|
+
"@bike4mind/utils": "2.3.3-feat-parallel-tool-execution.18470+d8da60d93",
|
|
12624
12814
|
"@types/better-sqlite3": "^7.6.13",
|
|
12625
12815
|
"@types/diff": "^5.0.9",
|
|
12626
12816
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -12637,7 +12827,7 @@ var package_default = {
|
|
|
12637
12827
|
optionalDependencies: {
|
|
12638
12828
|
"@vscode/ripgrep": "^1.17.0"
|
|
12639
12829
|
},
|
|
12640
|
-
gitHead: "
|
|
12830
|
+
gitHead: "d8da60d93ecc5623c4d068a78b391a1f19352cdb"
|
|
12641
12831
|
};
|
|
12642
12832
|
|
|
12643
12833
|
// src/config/constants.ts
|
|
@@ -12756,7 +12946,9 @@ var SubagentOrchestrator = class {
|
|
|
12756
12946
|
let result;
|
|
12757
12947
|
try {
|
|
12758
12948
|
result = await agent.run(task, {
|
|
12759
|
-
maxIterations
|
|
12949
|
+
maxIterations,
|
|
12950
|
+
parallelExecution: this.deps.enableParallelToolExecution === true,
|
|
12951
|
+
isReadOnlyTool
|
|
12760
12952
|
});
|
|
12761
12953
|
} catch (error) {
|
|
12762
12954
|
if (error instanceof HookBlockedError) {
|
|
@@ -13956,7 +14148,8 @@ function CliApp() {
|
|
|
13956
14148
|
showPermissionPrompt: promptFn,
|
|
13957
14149
|
configStore: state.configStore,
|
|
13958
14150
|
apiClient,
|
|
13959
|
-
agentStore
|
|
14151
|
+
agentStore,
|
|
14152
|
+
enableParallelToolExecution: config.preferences.enableParallelToolExecution === true
|
|
13960
14153
|
});
|
|
13961
14154
|
const agentDelegateTool = createAgentDelegateTool(orchestrator, agentStore, newSession.id);
|
|
13962
14155
|
const todoStore = createTodoStore();
|
|
@@ -14156,9 +14349,12 @@ ${contextResult.mergedContent}` : "";
|
|
|
14156
14349
|
role: msg.role,
|
|
14157
14350
|
content: msg.content
|
|
14158
14351
|
}));
|
|
14352
|
+
const cliConfig = await state.configStore.get();
|
|
14159
14353
|
const result = await state.agent.run(messageContent, {
|
|
14160
14354
|
previousMessages: previousMessages.length > 0 ? previousMessages : void 0,
|
|
14161
|
-
signal: abortController.signal
|
|
14355
|
+
signal: abortController.signal,
|
|
14356
|
+
parallelExecution: cliConfig.preferences.enableParallelToolExecution === true,
|
|
14357
|
+
isReadOnlyTool
|
|
14162
14358
|
});
|
|
14163
14359
|
const permissionDenied = result.finalAnswer.startsWith("Permission denied for tool");
|
|
14164
14360
|
if (permissionDenied) {
|
|
@@ -14359,9 +14555,12 @@ ${contextResult.mergedContent}` : "";
|
|
|
14359
14555
|
role: msg.role,
|
|
14360
14556
|
content: msg.content
|
|
14361
14557
|
}));
|
|
14558
|
+
const cliConfig = await state.configStore.get();
|
|
14362
14559
|
const result = await state.agent.run(messageContent, {
|
|
14363
14560
|
previousMessages: previousMessages.length > 0 ? previousMessages : void 0,
|
|
14364
|
-
signal: abortController.signal
|
|
14561
|
+
signal: abortController.signal,
|
|
14562
|
+
parallelExecution: cliConfig.preferences.enableParallelToolExecution === true,
|
|
14563
|
+
isReadOnlyTool
|
|
14365
14564
|
});
|
|
14366
14565
|
const permissionDenied = result.finalAnswer.startsWith("Permission denied for tool");
|
|
14367
14566
|
if (permissionDenied) {
|