@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/index.js CHANGED
@@ -4,12 +4,12 @@ import {
4
4
  getEffectiveApiKey,
5
5
  getOpenWeatherKey,
6
6
  getSerperKey
7
- } from "./chunk-FV2VQXYX.js";
7
+ } from "./chunk-AHVXP2NS.js";
8
8
  import {
9
9
  ConfigStore
10
10
  } from "./chunk-23T2XGSZ.js";
11
- import "./chunk-JHCQOESZ.js";
12
- import "./chunk-GGQZHK5U.js";
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-XFN2ICKP.js";
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-LOIWIBZT.js";
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 toolCallId = `${toolUse.name}_${JSON.stringify(toolUse.arguments)}`;
3264
- if (processedToolIds.has(toolCallId)) {
3265
- continue;
3385
+ const toolCallIdStr = getToolId(toolUse);
3386
+ if (!processedToolIds.has(toolCallIdStr)) {
3387
+ processedToolIds.add(toolCallIdStr);
3388
+ unprocessedTools.push(toolUse);
3266
3389
  }
3267
- processedToolIds.add(toolCallId);
3268
- this.toolCallCount++;
3269
- const actionStep = {
3270
- type: "action",
3271
- content: `Using tool: ${toolUse.name}`,
3272
- metadata: {
3273
- toolName: toolUse.name,
3274
- toolInput: toolUse.arguments,
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 observationStep = {
3324
- type: "observation",
3325
- content: typeof observation === "string" ? observation : JSON.stringify(observation),
3326
- metadata: {
3327
- toolName: toolUse.name,
3328
- timestamp: Date.now()
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
- this.steps.push(observationStep);
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 z2 } from "zod";
3572
- var generateReferralCodesSchema = z2.object({
3573
- count: z2.number().optional(),
3574
- unlimitedUse: z2.boolean().optional(),
3575
- expiresAt: z2.date().optional()
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 z3 } from "zod";
3580
- var deleteInviteCodesSchema = z3.object({
3581
- ids: z3.array(z3.string())
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 z4 } from "zod";
3832
+ import { z as z5 } from "zod";
3586
3833
  import bcrypt from "bcryptjs";
3587
- var loginUserSchema = z4.object({
3588
- usernameOrEmail: z4.string(),
3589
- password: z4.string(),
3590
- metadata: z4.object({
3591
- loginTime: z4.date(),
3592
- userAgent: z4.string(),
3593
- browser: z4.string(),
3594
- operatingSystem: z4.string(),
3595
- deviceType: z4.string(),
3596
- screenResolution: z4.string(),
3597
- viewportSize: z4.string(),
3598
- colorDepth: z4.number(),
3599
- pixelDepth: z4.number(),
3600
- devicePixelRatio: z4.number(),
3601
- ip: z4.string().optional().default(""),
3602
- location: z4.string().optional()
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 z5 } from "zod";
3613
- var forgotPasswordUserSchema = z5.object({
3614
- email: z5.string().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 z6 } from "zod";
3620
- var updateUserSchema = z6.object({
3621
- name: z6.string().optional(),
3622
- username: z6.string().optional(),
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: z6.string().nullable().optional(),
3626
- team: z6.string().nullable().optional(),
3627
- role: z6.string().nullable().optional(),
3628
- phone: z6.string().nullable().optional(),
3629
- preferredLanguage: z6.string().nullable().optional(),
3630
- preferredContact: z6.string().nullable().optional(),
3631
- preferredVoice: z6.string().nullable().optional(),
3632
- tshirtSize: z6.string().nullable().optional(),
3633
- geoLocation: z6.string().nullable().optional(),
3634
- lastNotebookId: z6.string().nullable().optional(),
3635
- tags: z6.array(z6.string()).nullable().optional(),
3636
- lastCreditsPurchasedAt: z6.date().nullable().optional(),
3637
- systemFiles: z6.array(z6.object({
3638
- fileId: z6.string(),
3639
- enabled: z6.boolean()
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: z6.array(z6.object({ question: z6.string(), answer: z6.string() })).nullable().optional(),
3642
- photoUrl: z6.string().nullable().optional(),
3643
- showCreditsUsed: z6.boolean().optional()
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 z8 } from "zod";
3894
+ import { z as z9 } from "zod";
3648
3895
 
3649
3896
  // ../../b4m-core/packages/services/dist/src/friendshipService/sendFriendRequest.js
3650
- import { z as z7 } from "zod";
3651
- var sendFriendRequestSchema = z7.object({
3652
- requesterId: z7.string(),
3653
- recipientId: z7.string(),
3654
- message: z7.string().optional()
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: z8.string(),
3906
+ id: z9.string(),
3660
3907
  // Admins can directly update email addresses without verification
3661
- email: z8.string().email().optional(),
3662
- role: z8.string().optional().nullable(),
3663
- isAdmin: z8.boolean().optional(),
3664
- organizationId: z8.string().optional().nullable(),
3665
- storageLimit: z8.number().optional(),
3666
- currentCredits: z8.number().optional(),
3667
- isBanned: z8.boolean().optional(),
3668
- isModerated: z8.boolean().optional(),
3669
- subscribedUntil: z8.string().optional().nullable(),
3670
- systemFiles: z8.array(z8.object({ fileId: z8.string(), enabled: z8.boolean() })).optional(),
3671
- level: z8.enum(["DemoUser", "PaidUser", "VIPUser", "ManagerUser", "AdminUser"]).optional(),
3672
- lastNotebookId: z8.string().optional().nullable(),
3673
- userNotes: z8.array(z8.object({ timestamp: z8.string(), note: z8.string(), userName: z8.string() })).optional(),
3674
- numReferralsAvailable: z8.number().optional()
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 z10 } from "zod";
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 z9 } from "zod";
3683
- var AddCreditsSchema = z9.discriminatedUnion("type", [
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 = z10.object({
3692
- username: z10.string(),
3693
- email: z10.string(),
3694
- name: z10.string(),
3695
- inviteCode: z10.string(),
3696
- password: z10.string(),
3697
- metadata: z10.object({
3698
- loginTime: z10.date(),
3699
- userAgent: z10.string(),
3700
- browser: z10.string(),
3701
- operatingSystem: z10.string(),
3702
- deviceType: z10.string(),
3703
- screenResolution: z10.string(),
3704
- viewportSize: z10.string(),
3705
- colorDepth: z10.number(),
3706
- pixelDepth: z10.number(),
3707
- devicePixelRatio: z10.number(),
3708
- ip: z10.string().optional().default(""),
3709
- location: z10.string().optional()
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 z11 } from "zod";
3715
- var adminDeleteUserSchema = z11.object({
3716
- id: z11.string()
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 z12 } from "zod";
3721
- var searchUserCollectionSchema = z12.object({
3722
- userId: z12.string(),
3723
- page: z12.coerce.number().optional().default(1),
3724
- limit: z12.coerce.number().optional().default(10),
3725
- search: z12.string().optional().default(""),
3726
- type: z12.nativeEnum(CollectionType).optional()
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 z13 } from "zod";
3731
- var recalculateUserStorageSchema = z13.object({
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: z13.string()
3982
+ userId: z14.string()
3736
3983
  });
3737
3984
 
3738
3985
  // ../../b4m-core/packages/services/dist/src/userService/listRecentActivities.js
3739
- import { z as z14 } from "zod";
3740
- var listRecentActivitiesSchema = z14.object({
3741
- coverage: z14.enum(["all", "important"]).default("important")
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 z15 } from "zod";
3756
- var sendEmailVerificationSchema = z15.object({
3757
- userId: z15.string()
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 z16 } from "zod";
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 = z16.object({
3768
- token: z16.string()
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 z17 } from "zod";
3774
- var resendEmailVerificationSchema = z17.object({
3775
- userId: z17.string()
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 z18 } from "zod";
3781
- var requestEmailChangeSchema = z18.object({
3782
- userId: z18.string(),
3783
- newEmail: z18.string().email(),
3784
- password: z18.string()
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 z19 } from "zod";
3789
- var verifyEmailChangeSchema = z19.object({
3790
- token: z19.string()
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 z20 } from "zod";
3795
- var cancelEmailChangeSchema = z20.object({
3796
- userId: z20.string()
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 z21 } from "zod";
3803
- var createUserApiKeySchema = z21.object({
3804
- name: z21.string().min(1).max(100),
3805
- scopes: z21.array(z21.nativeEnum(ApiKeyScope)).min(1),
3806
- expiresAt: z21.date().optional(),
3807
- rateLimit: z21.object({
3808
- requestsPerMinute: z21.number().min(1).max(1e3).default(60),
3809
- requestsPerDay: z21.number().min(1).max(1e4).default(1e3)
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: z21.object({
3812
- clientIP: z21.string().optional(),
3813
- userAgent: z21.string().optional(),
3814
- createdFrom: z21.enum(["dashboard", "cli", "api"])
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 z22 } from "zod";
3820
- var revokeUserApiKeySchema = z22.object({
3821
- keyId: z22.string(),
3822
- reason: z22.string().optional()
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 z23 } from "zod";
3829
- var rotateUserApiKeySchema = z23.object({
3830
- keyId: z23.string()
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 z25 } from "zod";
4224
+ import { z as z26 } from "zod";
3978
4225
 
3979
4226
  // ../../b4m-core/packages/services/dist/src/countersService/getAllCounterFrom24Hours.js
3980
- import { z as z24 } from "zod";
4227
+ import { z as z25 } from "zod";
3981
4228
  import dayjs2 from "dayjs";
3982
- var getCounterTotalsForLast24HoursSchema = z24.object({
3983
- date: z24.string(),
3984
- endDate: z24.string().optional()
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 = z25.object({
3989
- date: z25.string(),
3990
- startDate: z25.string().optional(),
3991
- endDate: z25.string().optional()
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 z26 } from "zod";
3996
- var incrementUserCounterSchema = z26.object({
3997
- action: z26.string(),
3998
- increment: z26.coerce.number().default(1).optional(),
3999
- metadata: z26.record(z26.unknown()).optional()
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 z27 } from "zod";
4267
+ import { z as z28 } from "zod";
4021
4268
  import last from "lodash/last.js";
4022
- var epochDate = () => z27.preprocess((val) => new Date(Number(val) * 1e3), z27.date());
4023
- var openaiConversationSchema = z27.object({
4024
- id: z27.string(),
4025
- title: z27.string(),
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: z27.record(
4029
- z27.string(),
4030
- z27.object({
4031
- id: z27.string(),
4032
- parent: z27.string().nullable(),
4033
- children: z27.array(z27.string()),
4034
- message: z27.object({
4035
- id: z27.string(),
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: z27.object({
4039
- role: z27.string(),
4040
- name: z27.string().nullable(),
4041
- metadata: z27.any()
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: z27.object({
4046
- content_type: z27.string(),
4047
- parts: z27.array(z27.any()).optional()
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: z27.string(),
4052
- end_turn: z27.boolean().nullable(),
4053
- metadata: z27.any(),
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: z27.string()
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 z28 } from "zod";
4064
- var claudeChatMessageSchema = z28.object({
4065
- uuid: z28.string().uuid(),
4066
- text: z28.string(),
4067
- content: z28.array(
4068
- z28.object({
4069
- type: z28.string(),
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: z28.string().optional()
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: z28.enum(["human", "assistant"]),
4077
- created_at: z28.coerce.date(),
4078
- updated_at: z28.coerce.date(),
4079
- attachments: z28.array(z28.any()),
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: z28.array(z28.any())
4328
+ files: z29.array(z29.any())
4082
4329
  // Accept any file structure
4083
4330
  }).passthrough();
4084
- var claudeConversationSchema = z28.object({
4085
- uuid: z28.string().uuid(),
4086
- name: z28.string(),
4087
- summary: z28.string().optional(),
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: z28.coerce.date(),
4090
- updated_at: z28.coerce.date(),
4091
- account: z28.object({
4092
- uuid: z28.string().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: z28.array(claudeChatMessageSchema)
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 z29 } from "zod";
4106
- var createSessionParametersSchema = z29.object({
4107
- name: z29.string(),
4108
- knowledgeIds: z29.array(z29.string()).optional(),
4109
- artifactIds: z29.array(z29.string()).optional(),
4110
- agentIds: z29.array(z29.string()).optional(),
4111
- tags: z29.array(z29.object({ name: z29.string(), strength: z29.number() })).optional(),
4112
- summary: z29.string().optional(),
4113
- summaryAt: z29.date().optional(),
4114
- clonedSourceId: z29.string().optional().nullable(),
4115
- forkedSourceId: z29.string().optional().nullable(),
4116
- projectId: z29.string().optional(),
4117
- lastUsedModel: z29.string().optional().nullable()
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 z30 } from "zod";
4122
- var deleteSessionSchema = z30.object({
4123
- id: z30.string()
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 z31 } from "zod";
4128
- var sumarizeSessionSchema = z31.object({
4129
- id: z31.string()
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 z32 } from "zod";
4134
- var createProjectSchema = z32.object({
4135
- name: z32.string().min(1),
4136
- description: z32.string().min(1),
4137
- sessionIds: z32.array(z32.string()).optional(),
4138
- fileIds: z32.array(z32.string()).optional()
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 z33 } from "zod";
4143
- var searchProjectsSchema = z33.object({
4144
- search: z33.string().optional(),
4145
- filters: z33.object({
4146
- favorite: z33.coerce.boolean().optional(),
4147
- scope: z33.record(z33.any()).optional()
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: z33.object({
4150
- page: z33.coerce.number().optional(),
4151
- limit: z33.coerce.number().optional()
4396
+ pagination: z34.object({
4397
+ page: z34.coerce.number().optional(),
4398
+ limit: z34.coerce.number().optional()
4152
4399
  }).optional(),
4153
- orderBy: z33.object({
4154
- by: z33.enum(["createdAt", "updatedAt"]).optional(),
4155
- direction: z33.enum(["asc", "desc"]).optional()
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 z44 } from "zod";
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 z34 } from "zod";
4165
- var acceptInviteSchema = z34.object({
4166
- id: z34.string()
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 z35 } from "zod";
4171
- var cancelInviteSchema = z35.object({
4172
- id: z35.string(),
4173
- type: z35.nativeEnum(InviteType),
4174
- email: z35.string().email().optional()
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 z36 } from "zod";
4179
- var cancelOwnDocumentInvitesSchema = z36.object({
4180
- documentId: z36.string(),
4181
- type: z36.nativeEnum(InviteType)
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 z37 } from "zod";
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 = z37.object({
4189
- id: z37.string(),
4190
- type: z37.nativeEnum(InviteType),
4191
- permissions: z37.array(z37.nativeEnum(Permission)),
4192
- recipients: z37.string().array().optional(),
4193
- description: z37.string().optional(),
4194
- expiresAt: z37.date().optional().default(defaultExpiration()),
4195
- available: z37.number().optional().default(DEFAULT_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 z38 } from "zod";
4200
- var getInviteSchema = z38.object({
4201
- id: z38.string(),
4202
- withUsername: z38.boolean().optional()
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 z39 } from "zod";
4207
- var listInviteByDocumentIdAndTypeSchema = z39.object({
4208
- documentId: z39.string(),
4209
- type: z39.nativeEnum(InviteType)
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 z40 } from "zod";
4214
- var listOwnPendingInvitesSchema = z40.object({
4215
- limit: z40.number().min(1).max(100).default(20),
4216
- page: z40.number().min(1).default(1)
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 z41 } from "zod";
4221
- var refuseInviteSchema = z41.object({
4222
- id: z41.string()
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 z42 } from "zod";
4227
- var revokeSharingSchema = z42.object({
4228
- id: z42.string(),
4229
- type: z42.enum(["files", "sessions", "projects"]),
4230
- userId: z42.string(),
4231
- projectId: z42.string().optional()
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 z43 } from "zod";
4482
+ import { z as z44 } from "zod";
4236
4483
  import uniq from "lodash/uniq.js";
4237
- var addFilesProjectSchema = z43.object({
4238
- projectId: z43.string().nonempty(),
4239
- fileIds: z43.array(z43.string().nonempty())
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 = z44.object({
4244
- projectId: z44.string().nonempty(),
4245
- sessionIds: z44.array(z44.string().nonempty())
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 updateProjectSchema = z46.object({
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/delete.js
4501
+ // ../../b4m-core/packages/services/dist/src/projectService/update.js
4263
4502
  import { z as z47 } from "zod";
4264
- var deleteProjectSchema = z47.object({
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/removeFiles.js
4509
+ // ../../b4m-core/packages/services/dist/src/projectService/delete.js
4269
4510
  import { z as z48 } from "zod";
4270
- var removeProjectFilesSchema = z48.object({
4271
- projectId: z48.string(),
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/removeSessions.js
4515
+ // ../../b4m-core/packages/services/dist/src/projectService/removeFiles.js
4276
4516
  import { z as z49 } from "zod";
4277
- var removeProjectSessionsSchema = z49.object({
4517
+ var removeProjectFilesSchema = z49.object({
4278
4518
  projectId: z49.string(),
4279
- sessionIds: z49.array(z49.string())
4519
+ fileIds: z49.array(z49.string())
4280
4520
  });
4281
4521
 
4282
- // ../../b4m-core/packages/services/dist/src/projectService/listSessions.js
4522
+ // ../../b4m-core/packages/services/dist/src/projectService/removeSessions.js
4283
4523
  import { z as z50 } from "zod";
4284
- var listProjectSessionsSchema = z50.object({
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/listFiles.js
4529
+ // ../../b4m-core/packages/services/dist/src/projectService/listSessions.js
4289
4530
  import { z as z51 } from "zod";
4290
- var listProjectFilesSchema = z51.object({
4531
+ var listProjectSessionsSchema = z51.object({
4291
4532
  projectId: z51.string()
4292
4533
  });
4293
4534
 
4294
- // ../../b4m-core/packages/services/dist/src/projectService/listInvites.js
4535
+ // ../../b4m-core/packages/services/dist/src/projectService/listFiles.js
4295
4536
  import { z as z52 } from "zod";
4296
- var listProjectInvitesParamsSchema = z52.object({
4297
- id: z52.string(),
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/addSystemPrompts.js
4541
+ // ../../b4m-core/packages/services/dist/src/projectService/listInvites.js
4304
4542
  import { z as z53 } from "zod";
4305
- var addSystemPromptsSchema = z53.object({
4306
- projectId: z53.string(),
4307
- fileIds: z53.array(z53.string())
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/toggleSystemPrompt.js
4550
+ // ../../b4m-core/packages/services/dist/src/projectService/addSystemPrompts.js
4311
4551
  import { z as z54 } from "zod";
4312
- var toggleSystemPromptSchema = z54.object({
4552
+ var addSystemPromptsSchema = z54.object({
4313
4553
  projectId: z54.string(),
4314
- fileId: z54.string()
4554
+ fileIds: z54.array(z54.string())
4315
4555
  });
4316
4556
 
4317
- // ../../b4m-core/packages/services/dist/src/projectService/removeSystemPrompt.js
4557
+ // ../../b4m-core/packages/services/dist/src/projectService/toggleSystemPrompt.js
4318
4558
  import { z as z55 } from "zod";
4319
- var removeSystemPromptSchema = z55.object({
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/addFavorite.js
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 createFavoriteParametersSchema = z56.object({
4330
- documentId: z56.string(),
4331
- documentType: z56.nativeEnum(FavoriteDocumentType)
4566
+ var removeSystemPromptSchema = z56.object({
4567
+ projectId: z56.string(),
4568
+ fileId: z56.string()
4332
4569
  });
4333
4570
 
4334
- // ../../b4m-core/packages/services/dist/src/favoriteService/delete.js
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 deleteFavoriteParametersSchema = z57.object({
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/projectService/addFavorite.js
4342
- var addFavoriteParametersSchema = z58.object({
4343
- projectId: z58.string()
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/deleteFavorite.js
4347
- import { z as z59 } from "zod";
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/removeNonExistentFiles.js
4593
+ // ../../b4m-core/packages/services/dist/src/projectService/deleteFavorite.js
4353
4594
  import { z as z60 } from "zod";
4354
- var removeNonExistentFilesSchema = z60.object({
4595
+ var deleteFavoriteParametersSchema2 = z60.object({
4355
4596
  projectId: z60.string()
4356
4597
  });
4357
4598
 
4358
- // ../../b4m-core/packages/services/dist/src/projectService/leaveProject.js
4599
+ // ../../b4m-core/packages/services/dist/src/projectService/removeNonExistentFiles.js
4359
4600
  import { z as z61 } from "zod";
4360
- var leaveProjectParamsSchema = z61.object({
4361
- id: z61.string(),
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/sessionService/update.js
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 updateSessionParamtersSchema = z62.object({
4607
+ var leaveProjectParamsSchema = z62.object({
4371
4608
  id: z62.string(),
4372
- name: z62.string().optional(),
4373
- knowledgeIds: z62.array(z62.string()).optional(),
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/clone.js
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 cloneSessionSchema = z63.object({
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/fork.js
4626
+ // ../../b4m-core/packages/services/dist/src/sessionService/clone.js
4386
4627
  import { z as z64 } from "zod";
4387
- var forkSessionSchema = z64.object({
4388
- sessionId: z64.string(),
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/snip.js
4632
+ // ../../b4m-core/packages/services/dist/src/sessionService/fork.js
4393
4633
  import { z as z65 } from "zod";
4394
- var snipSessionSchema = z65.object({
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/get.js
4639
+ // ../../b4m-core/packages/services/dist/src/sessionService/snip.js
4400
4640
  import { z as z66 } from "zod";
4401
- var getSessionSchema = z66.object({
4402
- id: z66.string()
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/deleteMessage.js
4646
+ // ../../b4m-core/packages/services/dist/src/sessionService/get.js
4406
4647
  import { z as z67 } from "zod";
4407
- var deleteSessionMessageSchema = z67.object({
4408
- sessionId: z67.string(),
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/addFavorite.js
4652
+ // ../../b4m-core/packages/services/dist/src/sessionService/deleteMessage.js
4413
4653
  import { z as z68 } from "zod";
4414
- var addFavoriteParametersSchema2 = z68.object({
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/deleteFavorite.js
4659
+ // ../../b4m-core/packages/services/dist/src/sessionService/addFavorite.js
4419
4660
  import { z as z69 } from "zod";
4420
- var deleteFavoriteParametersSchema3 = z69.object({
4661
+ var addFavoriteParametersSchema2 = z69.object({
4421
4662
  sessionId: z69.string()
4422
4663
  });
4423
4664
 
4424
- // ../../b4m-core/packages/services/dist/src/sessionService/autoName.js
4665
+ // ../../b4m-core/packages/services/dist/src/sessionService/deleteFavorite.js
4425
4666
  import { z as z70 } from "zod";
4426
- var autoNameParameterSchema = z70.object({
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: z70.number().optional()
4676
+ maxWords: z71.number().optional()
4430
4677
  });
4431
4678
 
4432
4679
  // ../../b4m-core/packages/services/dist/src/organizationService/search.js
4433
- import { z as z71 } from "zod";
4434
- var searchSchema2 = z71.object({
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: z71.string().optional(),
4685
+ query: z72.string().optional(),
4439
4686
  /**
4440
4687
  * Filter by personal organizations
4441
4688
  */
4442
- filters: z71.object({
4443
- personal: z71.union([z71.enum(["true", "false"]).transform((val) => val === "true"), z71.boolean()]).optional(),
4444
- userId: z71.string().optional()
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: z71.object({
4447
- page: z71.coerce.number().int().positive().default(1),
4448
- limit: z71.coerce.number().int().positive().max(100).default(10)
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: z71.object({
4454
- field: z71.enum(["name", "createdAt", "updatedAt"]).default("name"),
4455
- direction: z71.enum(["asc", "desc"]).default("asc")
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 z72 } from "zod";
4464
- var getSchema = z72.object({
4710
+ import { z as z73 } from "zod";
4711
+ var getSchema = z73.object({
4465
4712
  /**
4466
4713
  * Organization ID
4467
4714
  */
4468
- id: z72.string().min(1)
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 z73 } from "zod";
4473
- var addMemberSchema = z73.object({
4474
- userId: z73.string().optional(),
4475
- email: z73.string().optional(),
4476
- organizationId: z73.string(),
4477
- force: z73.boolean().optional()
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 z74 } from "zod";
4483
- var getUsersSchema = z74.object({
4484
- id: z74.string()
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 z75 } from "zod";
4489
- var createSchema = z75.object({
4490
- name: z75.string(),
4491
- personal: z75.boolean().default(false),
4492
- seats: z75.number().default(1),
4493
- stripeCustomerId: z75.string().nullable(),
4494
- billingOwnerId: z75.string().optional(),
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: z75.string().optional()
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 z76 } from "zod";
4502
- var updateSchema = z76.object({
4503
- id: z76.string(),
4504
- name: z76.string().optional(),
4505
- description: z76.string().optional(),
4506
- billingContact: z76.string().optional(),
4507
- currentCredits: z76.coerce.number().optional(),
4508
- systemPrompt: z76.string().max(1e4).optional()
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 z77 } from "zod";
4514
- var deleteSchema = z77.object({
4760
+ import { z as z78 } from "zod";
4761
+ var deleteSchema = z78.object({
4515
4762
  /**
4516
4763
  * Organization ID
4517
4764
  */
4518
- id: z77.string().min(1)
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 z78 } from "zod";
4523
- var listPendingUsersSchema = z78.object({
4524
- organizationId: z78.string()
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 z79 } from "zod";
4529
- var revokeAccessSchema = z79.object({
4530
- id: z79.string(),
4531
- userId: z79.string()
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 z80 } from "zod";
4536
- var organizationLeaveSchema = z80.object({
4537
- id: z80.string()
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 z81 } from "zod";
4542
- var createApiKeySchema = z81.object({
4543
- apiKey: z81.string().min(6),
4544
- description: z81.string().optional().default(""),
4545
- isActive: z81.boolean().optional().default(true),
4546
- type: z81.nativeEnum(ApiKeyType),
4547
- expireDays: z81.number().min(1).max(365).default(90)
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 z82 } from "zod";
4553
- var setApiKeySchema = z82.object({
4554
- id: z82.string(),
4555
- type: z82.nativeEnum(ApiKeyType)
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 z83 } from "zod";
4560
- var deleteApiKeySchema = z83.object({
4561
- id: z83.string()
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 z84 } from "zod";
4566
- var getFabFileSchema = z84.object({
4567
- id: z84.string()
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 z85 } from "zod";
4572
- var listFabFilesSchema = z85.object({
4573
- ids: z85.array(z85.string()).optional()
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 z86 } from "zod";
4580
- var updateFabFileSchema = z86.object({
4581
- id: z86.string(),
4582
- fileName: z86.string().optional(),
4583
- mimeType: z86.string().optional(),
4584
- fileContent: z86.string().optional(),
4585
- type: z86.nativeEnum(KnowledgeType).optional(),
4586
- system: z86.boolean().optional(),
4587
- systemPriority: z86.number().min(0).max(999).optional(),
4588
- sessionId: z86.string().optional(),
4589
- notes: z86.string().optional(),
4590
- primaryTag: z86.string().optional(),
4591
- tags: z86.array(z86.object({
4592
- name: z86.string(),
4593
- strength: z86.number()
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: z86.string().nullable().optional()
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 z87 } from "zod";
4600
- var deleteFabFileSchema = z87.object({
4601
- id: z87.string()
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 z88 } from "zod";
4606
- var chunkFileSchema = z88.object({
4607
- fabFileId: z88.string(),
4608
- embeddingModel: z88.string()
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 z89 } from "zod";
4613
- var vectorizeFabFileChunkSchema = z89.object({
4614
- fabFileId: z89.string(),
4615
- chunkId: z89.string()
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 z90 } from "zod";
4620
- var listFabFilesBySessionSchema = z90.object({
4621
- sessionId: z90.string()
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 z91 } from "zod";
4626
- var listFabFilesByQuestSchema = z91.object({
4627
- questId: z91.string()
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 z92 } from "zod";
4632
- var createFabFileByUrlSchema = z92.object({
4633
- url: z92.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,})).+/)
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 z93 } from "zod";
4638
- var searchFabFilesSchema = z93.object({
4639
- search: z93.string().optional(),
4640
- filters: z93.object({
4641
- tags: z93.array(z93.string()).optional(),
4642
- type: z93.enum(["text", "pdf", "url", "image", "excel", "word", "json", "csv", "markdown", "code"]).optional(),
4643
- shared: z93.coerce.boolean().optional(),
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: z93.coerce.boolean().optional(),
4892
+ curated: z94.coerce.boolean().optional(),
4646
4893
  // Indicates if the user is searching for curated notebook files
4647
- projectId: z93.string().optional(),
4648
- ids: z93.array(z93.string()).optional()
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: z93.object({
4652
- page: z93.coerce.number(),
4653
- limit: z93.coerce.number()
4898
+ pagination: z94.object({
4899
+ page: z94.coerce.number(),
4900
+ limit: z94.coerce.number()
4654
4901
  }).optional(),
4655
- order: z93.object({
4656
- by: z93.enum(["createdAt", "fileName", "fileSize"]),
4657
- direction: z93.enum(["asc", "desc"])
4902
+ order: z94.object({
4903
+ by: z94.enum(["createdAt", "fileName", "fileSize"]),
4904
+ direction: z94.enum(["asc", "desc"])
4658
4905
  }).optional(),
4659
- options: z93.object({
4660
- includeShared: z93.coerce.boolean().optional()
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 z94 } from "zod";
4666
- var addFavoriteParametersSchema3 = z94.object({
4667
- fileId: z94.string()
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 z95 } from "zod";
4672
- var deleteFavoriteParametersSchema4 = z95.object({
4673
- fileId: z95.string()
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 z96 } from "zod";
4678
- var fabFileToggleTagsSchema = z96.object({
4679
- ids: z96.array(z96.string()),
4680
- tags: z96.array(z96.string())
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 z97 } from "zod";
4931
+ import { z as z98 } from "zod";
4685
4932
  import { diffLines } from "diff";
4686
- var editFabFileSchema = z97.object({
4687
- id: z97.string(),
4688
- instruction: z97.string(),
4689
- selection: z97.object({
4690
- start: z97.number(),
4691
- end: z97.number()
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: z97.boolean().optional().default(true),
4694
- applyImmediately: z97.boolean().optional().default(false)
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 z98 } from "zod";
4701
- var applyEditSchema = z98.object({
4702
- id: z98.string(),
4703
- modifiedContent: z98.string(),
4704
- createBackup: z98.boolean().optional().default(true)
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 z99 } from "zod";
4709
- var respondToFriendRequestSchema = z99.object({
4710
- id: z99.string(),
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: z99.string(),
4713
- accept: z99.boolean()
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 z100 } from "zod";
4718
- var unfriendSchema = z100.object({
4719
- friendshipId: z100.string(),
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: z100.string()
4968
+ userId: z101.string()
4722
4969
  });
4723
4970
 
4724
4971
  // ../../b4m-core/packages/services/dist/src/friendshipService/list.js
4725
- import { z as z101 } from "zod";
4726
- var listFriendsSchema = z101.object({
4727
- userId: z101.string()
4972
+ import { z as z102 } from "zod";
4973
+ var listFriendsSchema = z102.object({
4974
+ userId: z102.string()
4728
4975
  });
4729
- var listPendingFriendRequestsSchema = z101.object({
4730
- userId: z101.string()
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 z102 } from "zod";
4735
- var loginAsSchema = z102.object({
4736
- targetUserId: z102.string()
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 z103 } from "zod";
4741
- var getParamsSchema = z103.object({
4742
- key: z103.string()
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 z104 } from "zod";
4747
- var setParamsSchema = z104.object({
4748
- key: z104.string(),
4749
- value: z104.any(),
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: z104.number(),
4754
- recache: z104.boolean().optional()
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 z105 } from "zod";
4759
- var ttlParamsSchema = z105.object({
4760
- key: z105.string()
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 z106 } from "zod";
5011
+ import { z as z107 } from "zod";
4765
5012
  import dayjs3 from "dayjs";
4766
- var weeklyReportSchema = z106.object({
4767
- startDate: z106.string(),
4768
- endDate: z106.string(),
4769
- report: z106.string(),
4770
- aiInsights: z106.string().nullable()
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 researchAgentUpdateSchema = z108.object({
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/remove.js
5030
+ // ../../b4m-core/packages/services/dist/src/researchAgentService/update.js
4792
5031
  import { z as z109 } from "zod";
4793
- var researchAgentRemoveSchema = z109.object({
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/get.js
5038
+ // ../../b4m-core/packages/services/dist/src/researchAgentService/remove.js
4798
5039
  import { z as z110 } from "zod";
4799
- var researchAgentGetSchema = z110.object({
5040
+ var researchAgentRemoveSchema = z110.object({
4800
5041
  id: z110.string()
4801
5042
  });
4802
5043
 
4803
- // ../../b4m-core/packages/services/dist/src/researchAgentService/listFiles.js
5044
+ // ../../b4m-core/packages/services/dist/src/researchAgentService/get.js
4804
5045
  import { z as z111 } from "zod";
4805
- var researchAgentListFilesSchema = z111.object({
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: z111.string()
5056
+ id: z112.string()
4810
5057
  });
4811
5058
 
4812
5059
  // ../../b4m-core/packages/services/dist/src/researchTaskService/process.js
4813
- import { z as z112 } from "zod";
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 = z112.object({
5205
- id: z112.string()
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 z113 } from "zod";
5210
- var researchTaskCreateSchema = z113.object({
5211
- researchAgentId: z113.string(),
5212
- title: z113.string().max(100),
5213
- description: z113.string().max(500),
5214
- prompt: z113.string().max(500).optional(),
5215
- type: z113.nativeEnum(ResearchTaskType),
5216
- executionType: z113.nativeEnum(ResearchTaskExecutionType).default(ResearchTaskExecutionType.ON_DEMAND),
5217
- fileTagId: z113.string().optional(),
5218
- autoGeneratedTag: z113.object({
5219
- name: z113.string(),
5220
- icon: z113.string(),
5221
- color: z113.string()
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: z113.array(z113.string().url()).min(1),
5226
- canDiscoverLinks: z113.boolean()
5472
+ urls: z114.array(z114.string().url()).min(1),
5473
+ canDiscoverLinks: z114.boolean()
5227
5474
  });
5228
5475
  var researchTaskPeriodicCreateSchema = researchTaskCreateSchema.extend({
5229
- executionPeriodicStartAt: z113.coerce.date(),
5230
- executionPeriodicEndAt: z113.coerce.date(),
5231
- executionPeriodicFrequency: z113.nativeEnum(ResearchTaskPeriodicFrequencyType)
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: z113.coerce.date()
5481
+ executionScheduledAt: z114.coerce.date()
5235
5482
  });
5236
5483
  var researchTaskDeepResearchCreateSchema = researchTaskCreateSchema.extend({
5237
- maxDepth: z113.number().min(1).max(10).optional()
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 z114 } from "zod";
5242
- var searchResearchTasksSchema = z114.object({
5243
- search: z114.string().optional(),
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: z114.object({
5251
- page: z114.coerce.number().optional(),
5252
- limit: z114.coerce.number().optional()
5497
+ pagination: z115.object({
5498
+ page: z115.coerce.number().optional(),
5499
+ limit: z115.coerce.number().optional()
5253
5500
  }).optional(),
5254
- orderBy: z114.object({
5255
- by: z114.enum(["createdAt", "updatedAt"]).optional(),
5256
- direction: z114.enum(["asc", "desc"]).optional()
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 z115 } from "zod";
5262
- var getResearchTaskSchema = z115.object({
5263
- id: z115.string().min(1)
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 z116 } from "zod";
5268
- var updateResearchTaskSchema = z116.object({
5269
- id: z116.string(),
5270
- title: z116.string(),
5271
- description: z116.string(),
5272
- type: z116.nativeEnum(ResearchTaskType)
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: z116.array(z116.string().url()).min(1),
5276
- canDiscoverLinks: z116.boolean()
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 z117 } from "zod";
5281
- var listByAgentIdSchema = z117.object({
5282
- researchAgentId: z117.string()
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 z118 } from "zod";
5287
- var researchTaskRemoveSchema = z118.object({
5288
- id: z118.string().min(1)
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 z119 } from "zod";
5293
- var researchTaskRetrySchema = z119.object({
5294
- id: z119.string(),
5295
- userId: z119.string()
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 z120 } from "zod";
5547
+ import { z as z121 } from "zod";
5301
5548
  import plimit from "p-limit";
5302
5549
  import pLimit2 from "p-limit";
5303
- var researchTaskProcessDiscoveredLinksSchema = z120.object({
5304
- id: z120.string()
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 z121 } from "zod";
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 = z121.object({
5313
- id: z121.string()
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 z122 } from "zod";
5318
- var researchDataRemoveSchema = z122.object({
5319
- id: z122.string(),
5320
- researchAgentId: z122.string()
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 z123 } from "zod";
5325
- var researchTaskPayload = z123.object({
5326
- id: z123.string(),
5327
- userId: z123.string()
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 = z123.object({
5330
- test: z123.string()
5576
+ var customTaskPayload = z124.object({
5577
+ test: z124.string()
5331
5578
  });
5332
- var taskSchedulerCreate = z123.discriminatedUnion("handler", [
5333
- z123.object({
5334
- handler: z123.literal(TaskScheduleHandler.RESEARCH_TASK_PROCESS),
5579
+ var taskSchedulerCreate = z124.discriminatedUnion("handler", [
5580
+ z124.object({
5581
+ handler: z124.literal(TaskScheduleHandler.RESEARCH_TASK_PROCESS),
5335
5582
  payload: researchTaskPayload,
5336
- processDate: z123.date()
5583
+ processDate: z124.date()
5337
5584
  }),
5338
- z123.object({
5339
- handler: z123.literal(TaskScheduleHandler.CUSTOM_TASK_PROCESS),
5585
+ z124.object({
5586
+ handler: z124.literal(TaskScheduleHandler.CUSTOM_TASK_PROCESS),
5340
5587
  payload: customTaskPayload,
5341
- processDate: z123.date()
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 tagCreateSchema = z125.object({
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
- type: z125.nativeEnum(TagType)
5598
+ description: z125.string().optional()
5362
5599
  });
5363
5600
 
5364
- // ../../b4m-core/packages/services/dist/src/tagService/update.js
5601
+ // ../../b4m-core/packages/services/dist/src/tagService/create.js
5365
5602
  import { z as z126 } from "zod";
5366
- var tagUpdateSchema = z126.object({
5367
- id: z126.string(),
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/remove.js
5611
+ // ../../b4m-core/packages/services/dist/src/tagService/update.js
5375
5612
  import { z as z127 } from "zod";
5376
- var tagRemoveSchema = z127.object({
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/artifactService/create.js
5621
+ // ../../b4m-core/packages/services/dist/src/tagService/remove.js
5381
5622
  import { z as z128 } from "zod";
5382
- var createArtifactSchema = z128.object({
5383
- id: z128.string().optional(),
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: z128.enum(["mermaid", "recharts", "python", "react", "html", "svg", "code", "quest", "file", "questmaster"]),
5386
- title: z128.string().min(1).max(255),
5387
- description: z128.string().max(1e3).optional(),
5388
- content: z128.string().min(1),
5389
- projectId: z128.string().optional(),
5390
- organizationId: z128.string().optional(),
5391
- visibility: z128.enum(["private", "project", "organization", "public"]).default("private"),
5392
- tags: z128.array(z128.string().max(50)).max(20).default([]),
5393
- versionTag: z128.string().max(100).optional(),
5394
- sourceQuestId: z128.string().optional(),
5395
- sessionId: z128.string().optional(),
5396
- parentArtifactId: z128.string().optional(),
5397
- permissions: z128.object({
5398
- canRead: z128.array(z128.string()).default([]),
5399
- canWrite: z128.array(z128.string()).default([]),
5400
- canDelete: z128.array(z128.string()).default([]),
5401
- isPublic: z128.boolean().default(false),
5402
- inheritFromProject: z128.boolean().default(true)
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: z128.record(z128.unknown()).default({})
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 z129 } from "zod";
5409
- var getArtifactSchema = z129.object({
5410
- id: z129.string(),
5411
- includeContent: z129.boolean().default(false),
5412
- includeVersions: z129.boolean().default(false),
5413
- version: z129.number().optional()
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 z130 } from "zod";
5418
- var listArtifactsSchema = z130.object({
5419
- type: z130.string().optional(),
5420
- status: z130.enum(["draft", "review", "published", "archived"]).optional(),
5421
- visibility: z130.enum(["private", "project", "organization", "public"]).optional(),
5422
- projectId: z130.string().optional(),
5423
- sessionId: z130.string().optional(),
5424
- tags: z130.array(z130.string()).optional(),
5425
- search: z130.string().optional(),
5426
- limit: z130.number().min(1).max(100).default(20),
5427
- offset: z130.number().min(0).default(0),
5428
- sortBy: z130.enum(["createdAt", "updatedAt", "title", "type"]).default("updatedAt"),
5429
- sortOrder: z130.enum(["asc", "desc"]).default("desc"),
5430
- includeDeleted: z130.boolean().default(false)
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 z131 } from "zod";
5435
- var updateArtifactSchema = z131.object({
5436
- id: z131.string(),
5437
- title: z131.string().min(1).max(255).optional(),
5438
- description: z131.string().max(1e3).optional(),
5439
- content: z131.string().optional(),
5440
- visibility: z131.enum(["private", "project", "organization", "public"]).optional(),
5441
- status: z131.enum(["draft", "review", "published", "archived"]).optional(),
5442
- tags: z131.array(z131.string().max(50)).max(20).optional(),
5443
- versionTag: z131.string().max(100).optional(),
5444
- permissions: z131.object({
5445
- canRead: z131.array(z131.string()).optional(),
5446
- canWrite: z131.array(z131.string()).optional(),
5447
- canDelete: z131.array(z131.string()).optional(),
5448
- isPublic: z131.boolean().optional(),
5449
- inheritFromProject: z131.boolean().optional()
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: z131.record(z131.unknown()).optional(),
5452
- changes: z131.array(z131.string()).optional(),
5453
- changeDescription: z131.string().max(1e3).optional(),
5454
- createNewVersion: z131.boolean().optional(),
5455
- versionMessage: z131.string().max(500).optional()
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 z132 } from "zod";
5460
- var deleteArtifactSchema = z132.object({
5461
- id: z132.string(),
5462
- hardDelete: z132.boolean().default(false)
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 z133 } from "zod";
5468
- var questSchema = z133.object({
5469
- id: z133.string(),
5470
- title: z133.string().min(1).max(255),
5471
- description: z133.string().max(MAX_DESCRIPTION_LENGTH),
5472
- status: z133.enum(["not_started", "in_progress", "completed", "blocked"]).default("not_started"),
5473
- order: z133.number().min(0),
5474
- dependencies: z133.array(z133.string()).default([]),
5475
- estimatedTime: z133.string().optional()
5476
- });
5477
- var questResourceSchema = z133.object({
5478
- title: z133.string().min(1).max(255),
5479
- url: z133.string().url(),
5480
- type: z133.enum(["documentation", "tutorial", "reference", "example"])
5481
- });
5482
- var createQuestMasterSchema = z133.object({
5483
- title: z133.string().min(1).max(255),
5484
- description: z133.string().max(MAX_DESCRIPTION_LENGTH).optional(),
5485
- goal: z133.string().min(1).max(MAX_GOAL_LENGTH),
5486
- complexity: z133.enum(["beginner", "intermediate", "advanced", "expert"]),
5487
- estimatedTotalTime: z133.string().optional(),
5488
- prerequisites: z133.array(z133.string().max(200)).default([]),
5489
- quests: z133.array(questSchema).min(1),
5490
- resources: z133.array(questResourceSchema).default([]),
5491
- projectId: z133.string().optional(),
5492
- organizationId: z133.string().optional(),
5493
- visibility: z133.enum(["private", "project", "organization", "public"]).default("private"),
5494
- tags: z133.array(z133.string().max(MAX_TAG_LENGTH)).max(20).default([]),
5495
- permissions: z133.object({
5496
- canRead: z133.array(z133.string()).default([]),
5497
- canWrite: z133.array(z133.string()).default([]),
5498
- canDelete: z133.array(z133.string()).default([]),
5499
- isPublic: z133.boolean().default(false),
5500
- inheritFromProject: z133.boolean().default(true)
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: z133.string().optional(),
5503
- sessionId: z133.string().optional(),
5504
- metadata: z133.record(z133.unknown()).default({})
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 z134 } from "zod";
5509
- var updateQuestStatusSchema = z134.object({
5510
- artifactId: z134.string(),
5511
- questId: z134.string(),
5512
- status: z134.enum(["not_started", "in_progress", "completed", "blocked"]),
5513
- completionNote: z134.string().max(500).optional()
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 z135 } from "zod";
5534
- var processIngestedEmailOptionsSchema = z135.object({
5535
- platformDomain: z135.string().optional(),
5536
- isNewsletter: z135.boolean().optional()
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 = z135.object({
5539
- filename: z135.string().optional(),
5540
- contentType: z135.string().optional(),
5541
- contentDisposition: z135.string().optional(),
5542
- size: z135.number().min(0),
5543
- content: z135.instanceof(Buffer),
5544
- related: z135.boolean().optional()
5545
- });
5546
- var parsedEmailObjectSchema = z135.object({
5547
- messageId: z135.string().optional(),
5548
- inReplyTo: z135.string().optional(),
5549
- references: z135.union([z135.string(), z135.array(z135.string())]).optional(),
5550
- from: z135.any().optional(),
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: z135.any().optional(),
5553
- cc: z135.any().optional(),
5554
- bcc: z135.any().optional(),
5555
- subject: z135.string().optional(),
5556
- date: z135.date().optional(),
5557
- text: z135.string().optional(),
5558
- html: z135.string().optional(),
5559
- attachments: z135.array(emailAttachmentSchema).optional()
5560
- });
5561
- var processIngestedEmailSchema = z135.object({
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: z135.string().min(1, "rawEmailS3Key cannot be empty"),
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 z136 } from "zod";
5569
- var llmAnalysisResponseSchema = z136.object({
5570
- summary: z136.string().min(1, "Summary cannot be empty"),
5571
- entities: z136.object({
5572
- companies: z136.array(z136.string()).default([]),
5573
- people: z136.array(z136.string()).default([]),
5574
- products: z136.array(z136.string()).default([]),
5575
- technologies: z136.array(z136.string()).default([])
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: z136.enum(["positive", "neutral", "negative", "urgent"]),
5578
- actionItems: z136.array(z136.object({
5579
- description: z136.string(),
5580
- deadline: z136.string().optional()
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: z136.enum(["public", "team", "private"]),
5584
- embargoDetected: z136.boolean().default(false),
5585
- suggestedTags: z136.array(z136.string()).default([])
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 z137 } from "zod";
7027
+ import { z as z138 } from "zod";
6772
7028
  import { diffLines as diffLines2 } from "diff";
6773
- var editFileSchema = z137.object({
6774
- fileId: z137.string().describe("The ID of the file to edit"),
6775
- instruction: z137.string().describe("Natural language instruction describing the changes to make"),
6776
- selection: z137.object({
6777
- start: z137.number().describe("Starting character position of the selection"),
6778
- end: z137.number().describe("Ending character position of the selection")
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: z137.boolean().optional().default(true).describe("Whether to preserve the original formatting style"),
6781
- returnDiff: z137.boolean().optional().default(true).describe("Whether to return a diff of the changes")
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
- var QuestStartBodySchema = z138.object({
10094
- userId: z138.string(),
10095
- sessionId: z138.string(),
10096
- questId: z138.string(),
10097
- message: z138.string(),
10098
- messageFileIds: z138.array(z138.string()),
10099
- historyCount: z138.number(),
10100
- fabFileIds: z138.array(z138.string()),
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: z138.boolean().optional(),
10104
- enableMementos: z138.boolean().optional(),
10105
- enableArtifacts: z138.boolean().optional(),
10106
- enableAgents: z138.boolean().optional(),
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: z138.array(z138.union([b4mLLMTools, z138.string()])).optional(),
10109
- mcpServers: z138.array(z138.string()).optional(),
10110
- projectId: z138.string().optional(),
10111
- organizationId: z138.string().nullable().optional(),
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: z138.string().optional(),
10377
+ toolPromptId: z139.string().optional(),
10114
10378
  researchMode: ResearchModeParamsSchema.optional(),
10115
- fallbackModel: z138.string().optional(),
10116
- embeddingModel: z138.string().optional(),
10117
- queryComplexity: z138.string(),
10379
+ fallbackModel: z139.string().optional(),
10380
+ embeddingModel: z139.string().optional(),
10381
+ queryComplexity: z139.string(),
10118
10382
  imageConfig: GenerateImageToolCallSchema.optional(),
10119
- deepResearchConfig: z138.object({
10120
- maxDepth: z138.number().optional(),
10121
- duration: z138.number().optional(),
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: z138.array(z138.any()).optional()
10387
+ searchers: z139.array(z139.any()).optional()
10124
10388
  }).optional(),
10125
- extraContextMessages: z138.array(z138.object({
10126
- role: z138.enum(["user", "assistant", "system", "function", "tool"]),
10127
- content: z138.union([z138.string(), z138.array(z138.any())]),
10128
- fabFileIds: z138.array(z138.string()).optional()
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: z138.string().optional()
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 z139 } from "zod";
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: z139.string(),
10155
- questId: z139.string(),
10156
- userId: z139.string(),
10157
- prompt: z139.string(),
10158
- organizationId: z139.string().nullable().optional(),
10159
- safety_tolerance: z139.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
10160
- prompt_upsampling: z139.boolean().optional().default(false),
10161
- seed: z139.number().nullable().optional(),
10162
- output_format: z139.enum(["jpeg", "png"]).nullable().optional().default("png"),
10163
- width: z139.number().optional(),
10164
- height: z139.number().optional(),
10165
- aspect_ratio: z139.string().optional(),
10166
- fabFileIds: z139.array(z139.string()).optional()
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 z140 } from "zod";
10423
+ import { z as z141 } from "zod";
10173
10424
  import { fromZodError as fromZodError3 } from "zod-validation-error";
10174
- var VideoGenerationBodySchema = z140.object({
10175
- sessionId: z140.string(),
10176
- questId: z140.string(),
10177
- userId: z140.string(),
10178
- prompt: z140.string(),
10179
- model: z140.nativeEnum(VideoModels).default(VideoModels.SORA_2),
10180
- seconds: z140.union([z140.literal(4), z140.literal(8), z140.literal(12)]).default(4),
10181
- size: z140.enum(["720x1280", "1280x720", "1024x1792", "1792x1024"]).default(VIDEO_SIZE_CONSTRAINTS.SORA.defaultSize),
10182
- organizationId: z140.string().nullable().optional()
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 z141 } from "zod";
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: z141.string(),
10193
- questId: z141.string(),
10194
- userId: z141.string(),
10195
- prompt: z141.string(),
10196
- organizationId: z141.string().nullable().optional(),
10197
- safety_tolerance: z141.number().min(BFL_SAFETY_TOLERANCE.MIN).max(BFL_SAFETY_TOLERANCE.MAX).optional().default(BFL_SAFETY_TOLERANCE.DEFAULT),
10198
- prompt_upsampling: z141.boolean().optional().default(false),
10199
- seed: z141.number().nullable().optional(),
10200
- output_format: z141.enum(["jpeg", "png"]).optional().default("png"),
10201
- width: z141.number().optional(),
10202
- height: z141.number().optional(),
10203
- aspect_ratio: z141.string().optional(),
10204
- size: z141.string().optional(),
10205
- fabFileIds: z141.array(z141.string()).optional(),
10206
- image: z141.string()
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 z142 } from "zod";
10211
- var refineTextLLMSchema = z142.object({
10212
- text: z142.string(),
10213
- context: z142.string().optional()
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 z143 } from "zod";
10220
- var SingleMementoEvalSchema = z143.object({
10221
- importance: z143.number().min(1).max(10),
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: z143.string(),
10224
- tags: z143.array(z143.string()).optional()
10474
+ summary: z144.string(),
10475
+ tags: z144.array(z144.string()).optional()
10225
10476
  });
10226
- var MementoEvalResponseSchema = z143.object({
10227
- isPersonal: z143.boolean(),
10228
- mementos: z143.array(SingleMementoEvalSchema).optional()
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 z144 } from "zod";
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 z145 } from "zod";
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 = z145.object({
10538
- type: z145.literal("command"),
10539
- command: z145.string().min(1, "Command is required for command hooks"),
10540
- timeout: z145.number().optional()
10541
- });
10542
- var PromptHookSchema = z145.object({
10543
- type: z145.literal("prompt"),
10544
- prompt: z145.string().min(1, "Prompt is required for prompt hooks"),
10545
- timeout: z145.number().optional()
10546
- });
10547
- var HookDefinitionSchema = z145.discriminatedUnion("type", [CommandHookSchema, PromptHookSchema]);
10548
- var HookMatcherSchema = z145.object({
10549
- matcher: z145.string().optional(),
10550
- hooks: z145.array(HookDefinitionSchema)
10551
- });
10552
- var AgentHooksSchema = z145.object({
10553
- PreToolUse: z145.array(HookMatcherSchema).optional(),
10554
- PostToolUse: z145.array(HookMatcherSchema).optional(),
10555
- PostToolUseFailure: z145.array(HookMatcherSchema).optional(),
10556
- Stop: z145.array(HookMatcherSchema).optional()
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 = z145.object({
10559
- description: z145.string().min(1, "Agent description is required"),
10560
- model: z145.string().optional(),
10561
- "allowed-tools": z145.array(z145.string()).optional(),
10562
- "denied-tools": z145.array(z145.string()).optional(),
10563
- "max-iterations": z145.object({
10564
- quick: z145.number().int().positive().optional(),
10565
- medium: z145.number().int().positive().optional(),
10566
- very_thorough: z145.number().int().positive().optional()
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": z145.enum(["quick", "medium", "very_thorough"]).optional(),
10569
- variables: z145.record(z145.string()).optional(),
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-pr-files-diff-tools.18476+a439e5cc8",
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-pr-files-diff-tools.18476+a439e5cc8",
12621
- "@bike4mind/mcp": "1.27.1-feat-pr-files-diff-tools.18476+a439e5cc8",
12622
- "@bike4mind/services": "2.45.1-feat-pr-files-diff-tools.18476+a439e5cc8",
12623
- "@bike4mind/utils": "2.3.3-feat-pr-files-diff-tools.18476+a439e5cc8",
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: "a439e5cc8e3193b0aa90c0a58da1b5ca6e3ea539"
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) {