@bike4mind/cli 0.2.29-cli-resume-command.18763 → 0.2.29-feature-b4m-pi.18846

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.
@@ -365,7 +365,9 @@ var ArtifactTypeSchema = z6.enum([
365
365
  "code",
366
366
  "quest",
367
367
  "file",
368
- "questmaster"
368
+ "questmaster",
369
+ "lattice"
370
+ // Financial pro-forma models
369
371
  ]);
370
372
  var ArtifactSchema = z6.object({
371
373
  id: z6.string(),
@@ -445,6 +447,17 @@ var RechartsArtifactSchema = ArtifactSchema.extend({
445
447
  colors: z6.array(z6.string()).optional()
446
448
  })
447
449
  });
450
+ var LatticeArtifactSchema = ArtifactSchema.extend({
451
+ type: z6.literal("lattice"),
452
+ metadata: ArtifactMetadataSchema.extend({
453
+ modelType: z6.enum(["income_statement", "balance_sheet", "cashflow", "saas_metrics", "custom"]).optional(),
454
+ periodGrain: z6.enum(["month", "quarter", "year"]).optional(),
455
+ currency: z6.string().default("USD"),
456
+ entityCount: z6.number().int().nonnegative().optional(),
457
+ ruleCount: z6.number().int().nonnegative().optional(),
458
+ lastComputedAt: z6.date().optional()
459
+ })
460
+ });
448
461
  var MermaidChartMetadataSchema = z6.object({
449
462
  chartType: z6.enum([
450
463
  "flowchart",
@@ -478,7 +491,8 @@ var ClaudeArtifactMimeTypes = {
478
491
  MERMAID: "application/vnd.ant.mermaid",
479
492
  RECHARTS: "application/vnd.ant.recharts",
480
493
  CODE: "application/vnd.ant.code",
481
- MARKDOWN: "text/markdown"
494
+ MARKDOWN: "text/markdown",
495
+ LATTICE: "application/vnd.b4m.lattice"
482
496
  };
483
497
 
484
498
  // ../../b4m-core/packages/common/dist/src/types/entities/AppFileTypes.js
@@ -894,6 +908,88 @@ var RapidReplyResponseStylesCommon = ["auto", "casual", "professional", "code"];
894
908
  var RapidReplyTransitionModes = ["replace", "append", "enhance"];
895
909
  var RapidReplyFallbackBehaviors = ["disable", "continue", "notify"];
896
910
 
911
+ // ../../b4m-core/packages/common/dist/src/types/entities/SoftwareSchedulerTypes.js
912
+ function calculateTaskValue(task, estimate) {
913
+ const reach = task.reach ?? estimate?.inferredStackRanking?.reach ?? 5;
914
+ const retention = task.retention ?? estimate?.inferredStackRanking?.retention ?? 5;
915
+ const revenue = task.revenue ?? estimate?.inferredStackRanking?.revenue ?? 5;
916
+ const romance = task.romance ?? estimate?.inferredStackRanking?.romance ?? 5;
917
+ const confidence = task.confidence ?? estimate?.inferredStackRanking?.confidence ?? 5;
918
+ const foundation = task.foundation ?? estimate?.inferredStackRanking?.foundation ?? 5;
919
+ const visibility = task.visibility ?? estimate?.inferredStackRanking?.visibility ?? 5;
920
+ const coreScore = reach * 2 + retention * 3 + revenue * 5;
921
+ const extendedScore = romance * 1.5 + confidence * 1.5 + foundation * 2 + visibility * 1.5;
922
+ return coreScore + extendedScore;
923
+ }
924
+ function calculateResourceAllocations(projects, resources, startPeriod, endPeriod) {
925
+ const allocations = /* @__PURE__ */ new Map();
926
+ for (const resource of resources) {
927
+ for (let period = startPeriod; period <= endPeriod; period++) {
928
+ const key = `${resource.id}-${period}`;
929
+ allocations.set(key, {
930
+ resourceId: resource.id,
931
+ period: period.toString(),
932
+ allocations: [],
933
+ totalPercentage: 0
934
+ });
935
+ }
936
+ }
937
+ for (const project of projects) {
938
+ if (project.status !== "active" && project.status !== "planned")
939
+ continue;
940
+ const projectDuration = project.endPeriod - project.startPeriod + 1;
941
+ for (const phase of project.phases) {
942
+ const phaseStartOffset = project.phases.slice(0, project.phases.indexOf(phase)).reduce((sum, p) => sum + p.pct, 0) / 100;
943
+ const phaseEndOffset = phaseStartOffset + phase.pct / 100;
944
+ const phaseStartPeriod = Math.floor(project.startPeriod + phaseStartOffset * projectDuration);
945
+ const phaseEndPeriod = Math.min(Math.floor(project.startPeriod + phaseEndOffset * projectDuration), project.endPeriod);
946
+ for (const [resourceId, percentage] of Object.entries(phase.teamWeights)) {
947
+ if (percentage <= 0)
948
+ continue;
949
+ for (let period = phaseStartPeriod; period <= phaseEndPeriod; period++) {
950
+ if (period < startPeriod || period > endPeriod)
951
+ continue;
952
+ const key = `${resourceId}-${period}`;
953
+ const allocation = allocations.get(key);
954
+ if (allocation) {
955
+ allocation.allocations.push({
956
+ projectId: project.id,
957
+ projectName: project.name,
958
+ phaseId: phase.id,
959
+ phaseName: phase.name,
960
+ percentage
961
+ });
962
+ allocation.totalPercentage += percentage;
963
+ }
964
+ }
965
+ }
966
+ }
967
+ }
968
+ return Array.from(allocations.values());
969
+ }
970
+ function detectResourceConflicts(allocations, resources) {
971
+ const resourceMap = new Map(resources.map((r) => [r.id, r]));
972
+ const conflicts = [];
973
+ for (const allocation of allocations) {
974
+ if (allocation.totalPercentage > 100) {
975
+ const resource = resourceMap.get(allocation.resourceId);
976
+ conflicts.push({
977
+ resourceId: allocation.resourceId,
978
+ resourceName: resource?.name || allocation.resourceId,
979
+ period: allocation.period,
980
+ allocations: allocation.allocations.map((a) => ({
981
+ projectId: a.projectId,
982
+ projectName: a.projectName,
983
+ percentage: a.percentage
984
+ })),
985
+ totalPercentage: allocation.totalPercentage,
986
+ severity: allocation.totalPercentage > 120 ? "critical" : "warning"
987
+ });
988
+ }
989
+ }
990
+ return conflicts;
991
+ }
992
+
897
993
  // ../../b4m-core/packages/common/dist/src/types/entities/SystemSecretsTypes.js
898
994
  var SST_PLACEHOLDER_VALUE = "my-secret-placeholder-value";
899
995
  var NOT_CONFIGURED_PLACEHOLDER = "not-configured";
@@ -1136,6 +1232,43 @@ var SpiderErrorAction = z10.object({
1136
1232
  dryRun: z10.boolean().optional(),
1137
1233
  clientId: z10.string().optional()
1138
1234
  });
1235
+ var PiHistoryProgressAction = z10.object({
1236
+ action: z10.literal("pi_history_progress"),
1237
+ analysisJobId: z10.string(),
1238
+ repoFullName: z10.string(),
1239
+ phase: z10.enum([
1240
+ "fetching_issues",
1241
+ "fetching_prs",
1242
+ "calculating_stats",
1243
+ "building_profiles",
1244
+ "extracting_keywords",
1245
+ "saving"
1246
+ ]),
1247
+ percentage: z10.number(),
1248
+ message: z10.string(),
1249
+ itemsProcessed: z10.number().optional(),
1250
+ totalItems: z10.number().optional(),
1251
+ clientId: z10.string().optional()
1252
+ });
1253
+ var PiHistoryCompleteAction = z10.object({
1254
+ action: z10.literal("pi_history_complete"),
1255
+ analysisJobId: z10.string(),
1256
+ repoFullName: z10.string(),
1257
+ stats: z10.object({
1258
+ closedIssues: z10.number(),
1259
+ mergedPRs: z10.number(),
1260
+ contributors: z10.number()
1261
+ }),
1262
+ clientId: z10.string().optional()
1263
+ });
1264
+ var PiHistoryErrorAction = z10.object({
1265
+ action: z10.literal("pi_history_error"),
1266
+ analysisJobId: z10.string(),
1267
+ repoFullName: z10.string(),
1268
+ error: z10.string(),
1269
+ phase: z10.string(),
1270
+ clientId: z10.string().optional()
1271
+ });
1139
1272
  var StreamedChatCompletionAction = z10.object({
1140
1273
  action: z10.literal("streamed_chat_completion"),
1141
1274
  clientId: z10.string().optional(),
@@ -1313,6 +1446,9 @@ var MessageDataToClient = z10.discriminatedUnion("action", [
1313
1446
  SpiderProgressUpdateAction,
1314
1447
  SpiderCompleteAction,
1315
1448
  SpiderErrorAction,
1449
+ PiHistoryProgressAction,
1450
+ PiHistoryCompleteAction,
1451
+ PiHistoryErrorAction,
1316
1452
  SessionCreatedAction
1317
1453
  ]);
1318
1454
 
@@ -2147,6 +2283,7 @@ var SettingKeySchema = z21.enum([
2147
2283
  "EnableArtifacts",
2148
2284
  "EnableAgents",
2149
2285
  "EnableRapidReply",
2286
+ "EnableLattice",
2150
2287
  "RapidReplySettings",
2151
2288
  "EnableResearchEngine",
2152
2289
  "EnableOllama",
@@ -2670,12 +2807,13 @@ var API_SERVICE_GROUPS = {
2670
2807
  { key: "EnableResearchEngine", order: 8 },
2671
2808
  { key: "EnableReactViewer", order: 9 },
2672
2809
  { key: "EnableDeepResearch", order: 10 },
2673
- { key: "EnableKnowledgeBaseSearch", order: 11 },
2674
- { key: "EnableStreamIdleTimeout", order: 12 },
2675
- { key: "StreamIdleTimeoutSeconds", order: 13 },
2676
- { key: "EnableMcpToolFiltering", order: 14 },
2677
- { key: "McpToolFilteringMaxTools", order: 15 },
2678
- { key: "EnableParallelToolExecution", order: 16 }
2810
+ { key: "EnableLattice", order: 11 },
2811
+ { key: "EnableKnowledgeBaseSearch", order: 12 },
2812
+ { key: "EnableStreamIdleTimeout", order: 13 },
2813
+ { key: "StreamIdleTimeoutSeconds", order: 14 },
2814
+ { key: "EnableMcpToolFiltering", order: 15 },
2815
+ { key: "McpToolFilteringMaxTools", order: 16 },
2816
+ { key: "EnableParallelToolExecution", order: 17 }
2679
2817
  ]
2680
2818
  },
2681
2819
  NOTEBOOK: {
@@ -3577,6 +3715,15 @@ var settingsMap = {
3577
3715
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
3578
3716
  order: 9
3579
3717
  }),
3718
+ EnableLattice: makeBooleanSetting({
3719
+ key: "EnableLattice",
3720
+ name: "Enable Lattice",
3721
+ defaultValue: false,
3722
+ description: "Whether to enable the Lattice feature for natural language financial pro-forma modeling. Allows creating and manipulating spreadsheet-like models through conversation.",
3723
+ category: "Experimental",
3724
+ group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
3725
+ order: 11
3726
+ }),
3580
3727
  EnableKnowledgeBaseSearch: makeBooleanSetting({
3581
3728
  key: "EnableKnowledgeBaseSearch",
3582
3729
  name: "Enable Knowledge Base Search",
@@ -3584,7 +3731,7 @@ var settingsMap = {
3584
3731
  description: "Allow AI to search user uploaded documents. When enabled, users can toggle the Knowledge Base Search tool in AI Settings.",
3585
3732
  category: "Experimental",
3586
3733
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
3587
- order: 11
3734
+ order: 12
3588
3735
  }),
3589
3736
  enableVoiceSession: makeBooleanSetting({
3590
3737
  key: "enableVoiceSession",
@@ -4379,6 +4526,445 @@ var InternalTeamMemberSchema = z24.object({
4379
4526
  });
4380
4527
  var InternalTeamMemberListSchema = z24.array(InternalTeamMemberSchema);
4381
4528
 
4529
+ // ../../b4m-core/packages/common/dist/src/schemas/lattice.js
4530
+ import { z as z25 } from "zod";
4531
+ var LatticeDataTypeSchema = z25.enum([
4532
+ "number",
4533
+ "currency",
4534
+ "percentage",
4535
+ "string",
4536
+ "boolean",
4537
+ "date",
4538
+ "datetime"
4539
+ ]);
4540
+ var LatticeEntityTypeSchema = z25.enum(["line_item", "account", "period", "category", "scenario", "custom"]);
4541
+ var LatticeRelationshipTypeSchema = z25.enum(["parent_child", "temporal", "reference", "derived"]);
4542
+ var LatticeRuleTypeSchema = z25.enum(["formula", "aggregation", "constraint", "transformation", "conditional"]);
4543
+ var LatticeOperationSchema = z25.enum([
4544
+ // Arithmetic
4545
+ "ADD",
4546
+ "SUBTRACT",
4547
+ "MULTIPLY",
4548
+ "DIVIDE",
4549
+ "ABS",
4550
+ "ROUND",
4551
+ "FLOOR",
4552
+ "CEIL",
4553
+ "POWER",
4554
+ "SQRT",
4555
+ // Aggregation
4556
+ "SUM",
4557
+ "AVERAGE",
4558
+ "MIN",
4559
+ "MAX",
4560
+ "COUNT",
4561
+ "MEDIAN",
4562
+ // Logical
4563
+ "IF",
4564
+ "AND",
4565
+ "OR",
4566
+ "NOT",
4567
+ "EQUALS",
4568
+ "GREATER_THAN",
4569
+ "LESS_THAN",
4570
+ "GREATER_THAN_OR_EQUAL",
4571
+ "LESS_THAN_OR_EQUAL",
4572
+ "BETWEEN",
4573
+ // Financial
4574
+ "PERCENT_OF",
4575
+ "GROWTH_RATE",
4576
+ "NPV",
4577
+ "IRR",
4578
+ "PMT",
4579
+ "FV",
4580
+ "PV",
4581
+ // Special
4582
+ "REFERENCE",
4583
+ "LOOKUP"
4584
+ ]);
4585
+ var LatticeConditionOperatorSchema = z25.enum(["==", "!=", ">", "<", ">=", "<=", "contains", "in"]);
4586
+ var LatticePeriodGrainSchema = z25.enum(["day", "week", "month", "quarter", "year"]);
4587
+ var LatticeNegativeFormatSchema = z25.enum(["parentheses", "minus", "red"]);
4588
+ var LatticeViewTypeSchema = z25.enum([
4589
+ "table",
4590
+ "pivot",
4591
+ "time_series",
4592
+ "comparison",
4593
+ "summary_card",
4594
+ "waterfall",
4595
+ "tree"
4596
+ ]);
4597
+ var LatticeModelTypeSchema = z25.enum([
4598
+ "income_statement",
4599
+ "balance_sheet",
4600
+ "cashflow",
4601
+ "saas_metrics",
4602
+ "dcf",
4603
+ "lbo",
4604
+ "custom"
4605
+ ]);
4606
+ var LatticeIntentTypeSchema = z25.enum([
4607
+ "CREATE_ENTITY",
4608
+ "SET_VALUE",
4609
+ "CREATE_RULE",
4610
+ "QUERY_VALUE",
4611
+ "QUERY_AGGREGATE",
4612
+ "CREATE_VIEW",
4613
+ "COMPARE",
4614
+ "FORECAST",
4615
+ "EXPLAIN",
4616
+ "UNDO",
4617
+ "REDO",
4618
+ "LIST",
4619
+ "DELETE",
4620
+ "AMBIGUOUS"
4621
+ ]);
4622
+ var LatticeErrorTypeSchema = z25.enum([
4623
+ "PARSE_ERROR",
4624
+ "AMBIGUOUS_REFERENCE",
4625
+ "ENTITY_NOT_FOUND",
4626
+ "RULE_NOT_FOUND",
4627
+ "CIRCULAR_DEPENDENCY",
4628
+ "TYPE_MISMATCH",
4629
+ "DIVISION_BY_ZERO",
4630
+ "MISSING_DATA",
4631
+ "INVALID_PERIOD",
4632
+ "CONSTRAINT_VIOLATION",
4633
+ "INVALID_OPERATION"
4634
+ ]);
4635
+ var LatticeOperationTypeSchema = z25.enum([
4636
+ "CREATE_ENTITY",
4637
+ "UPDATE_ENTITY",
4638
+ "DELETE_ENTITY",
4639
+ "CREATE_RULE",
4640
+ "UPDATE_RULE",
4641
+ "DELETE_RULE",
4642
+ "SET_VALUE",
4643
+ "CREATE_VIEW",
4644
+ "UPDATE_VIEW",
4645
+ "DELETE_VIEW",
4646
+ "CREATE_SCENARIO",
4647
+ "UPDATE_SCENARIO",
4648
+ "DELETE_SCENARIO",
4649
+ "UPDATE_SETTINGS"
4650
+ ]);
4651
+ var LatticeExportFormatSchema = z25.enum(["csv", "json", "xlsx"]);
4652
+ var LatticePrimitiveValueSchema = z25.union([z25.number(), z25.string(), z25.boolean(), z25.date(), z25.null()]);
4653
+ var LatticeAttributeSchema = z25.object({
4654
+ key: z25.string().min(1).max(100),
4655
+ value: LatticePrimitiveValueSchema,
4656
+ dataType: LatticeDataTypeSchema,
4657
+ isComputed: z25.boolean().default(false),
4658
+ computedByRuleId: z25.string().optional(),
4659
+ timestamp: z25.number().optional(),
4660
+ metadata: z25.record(z25.unknown()).optional()
4661
+ });
4662
+ var LatticeEntitySchema = z25.object({
4663
+ id: z25.string().min(1).max(100),
4664
+ type: LatticeEntityTypeSchema,
4665
+ name: z25.string().min(1).max(255),
4666
+ displayName: z25.string().max(255).optional(),
4667
+ attributes: z25.array(LatticeAttributeSchema).default([]),
4668
+ metadata: z25.record(z25.unknown()).default({}),
4669
+ createdAt: z25.date(),
4670
+ updatedAt: z25.date()
4671
+ });
4672
+ var LatticeRelationshipSchema = z25.object({
4673
+ id: z25.string().min(1).max(100),
4674
+ type: LatticeRelationshipTypeSchema,
4675
+ fromEntityId: z25.string(),
4676
+ toEntityId: z25.string(),
4677
+ metadata: z25.record(z25.unknown()).optional()
4678
+ });
4679
+ var LatticeDataStoreSchema = z25.object({
4680
+ entities: z25.array(LatticeEntitySchema).default([]),
4681
+ relationships: z25.array(LatticeRelationshipSchema).default([])
4682
+ });
4683
+ var LatticeInputSchema = z25.object({
4684
+ type: z25.enum(["entity", "attribute", "rule", "literal", "range"]),
4685
+ ref: z25.string(),
4686
+ selector: z25.string().optional()
4687
+ });
4688
+ var LatticeOutputSchema = z25.object({
4689
+ targetEntityId: z25.string(),
4690
+ targetAttribute: z25.string(),
4691
+ dataType: LatticeDataTypeSchema
4692
+ });
4693
+ var LatticeConditionSchema = z25.object({
4694
+ left: LatticeInputSchema,
4695
+ operator: LatticeConditionOperatorSchema,
4696
+ right: LatticeInputSchema,
4697
+ logicalJoin: z25.enum(["AND", "OR"]).optional()
4698
+ });
4699
+ var LatticeRuleDefinitionSchema = z25.object({
4700
+ operation: LatticeOperationSchema,
4701
+ inputs: z25.array(LatticeInputSchema).min(1),
4702
+ output: LatticeOutputSchema,
4703
+ conditions: z25.array(LatticeConditionSchema).optional()
4704
+ });
4705
+ var LatticeRuleSchema = z25.object({
4706
+ id: z25.string().min(1).max(100),
4707
+ name: z25.string().min(1).max(255),
4708
+ description: z25.string().max(1e3).optional(),
4709
+ type: LatticeRuleTypeSchema,
4710
+ definition: LatticeRuleDefinitionSchema,
4711
+ dependencies: z25.array(z25.string()).default([]),
4712
+ priority: z25.number().int().default(0),
4713
+ enabled: z25.boolean().default(true),
4714
+ createdAt: z25.date(),
4715
+ updatedAt: z25.date()
4716
+ });
4717
+ var LatticeRulesetSchema = z25.object({
4718
+ id: z25.string().min(1).max(100),
4719
+ name: z25.string().min(1).max(255),
4720
+ ruleIds: z25.array(z25.string()).default([]),
4721
+ description: z25.string().max(1e3).optional()
4722
+ });
4723
+ var LatticeRulesStoreSchema = z25.object({
4724
+ rules: z25.array(LatticeRuleSchema).default([]),
4725
+ rulesets: z25.array(LatticeRulesetSchema).default([])
4726
+ });
4727
+ var LatticeRowConfigSchema = z25.object({
4728
+ source: z25.enum(["entity", "rule", "category"]),
4729
+ ref: z25.string(),
4730
+ label: z25.string().optional(),
4731
+ indent: z25.number().int().min(0).max(10).optional(),
4732
+ isSummary: z25.boolean().optional()
4733
+ });
4734
+ var LatticeColumnConfigSchema = z25.object({
4735
+ source: z25.enum(["period", "scenario", "attribute", "computed"]),
4736
+ ref: z25.string(),
4737
+ label: z25.string().optional(),
4738
+ width: z25.number().positive().optional()
4739
+ });
4740
+ var LatticeFilterSchema = z25.object({
4741
+ field: z25.string(),
4742
+ operator: LatticeConditionOperatorSchema,
4743
+ value: LatticePrimitiveValueSchema
4744
+ });
4745
+ var LatticeSortConfigSchema = z25.object({
4746
+ field: z25.string(),
4747
+ direction: z25.enum(["asc", "desc"])
4748
+ });
4749
+ var LatticeGroupConfigSchema = z25.object({
4750
+ groupBy: z25.array(z25.string()),
4751
+ aggregation: LatticeOperationSchema
4752
+ });
4753
+ var LatticeFormatConfigSchema = z25.object({
4754
+ numberFormat: z25.string().optional(),
4755
+ currencySymbol: z25.string().max(10).optional(),
4756
+ percentageDecimals: z25.number().int().min(0).max(10).optional(),
4757
+ negativeFormat: LatticeNegativeFormatSchema.optional(),
4758
+ showGridLines: z25.boolean().optional(),
4759
+ zebra: z25.boolean().optional(),
4760
+ compactMode: z25.boolean().optional()
4761
+ });
4762
+ var LatticeViewConfigSchema = z25.object({
4763
+ rows: z25.array(LatticeRowConfigSchema).optional(),
4764
+ columns: z25.array(LatticeColumnConfigSchema).optional(),
4765
+ filters: z25.array(LatticeFilterSchema).optional(),
4766
+ sorting: z25.array(LatticeSortConfigSchema).optional(),
4767
+ grouping: LatticeGroupConfigSchema.optional(),
4768
+ formatting: LatticeFormatConfigSchema.optional()
4769
+ });
4770
+ var LatticeViewSchema = z25.object({
4771
+ id: z25.string().min(1).max(100),
4772
+ type: LatticeViewTypeSchema,
4773
+ name: z25.string().min(1).max(255),
4774
+ config: LatticeViewConfigSchema,
4775
+ createdAt: z25.date(),
4776
+ updatedAt: z25.date()
4777
+ });
4778
+ var LatticeViewStoreSchema = z25.object({
4779
+ views: z25.array(LatticeViewSchema).default([]),
4780
+ activeViewId: z25.string().optional()
4781
+ });
4782
+ var LatticeModelSettingsSchema = z25.object({
4783
+ currency: z25.string().min(1).max(10).default("USD"),
4784
+ fiscalYearStart: z25.string().regex(/^\d{2}-\d{2}$/).default("01-01"),
4785
+ periodGrain: LatticePeriodGrainSchema.default("quarter"),
4786
+ defaultDecimalPlaces: z25.number().int().min(0).max(10).default(2),
4787
+ negativeFormat: LatticeNegativeFormatSchema.default("parentheses")
4788
+ });
4789
+ var LatticeHistoryOperationSchema = z25.object({
4790
+ id: z25.string(),
4791
+ type: LatticeOperationTypeSchema,
4792
+ timestamp: z25.date(),
4793
+ data: z25.record(z25.unknown()),
4794
+ inverse: z25.record(z25.unknown()),
4795
+ description: z25.string(),
4796
+ messageId: z25.string().optional()
4797
+ });
4798
+ var LatticeScenarioOverrideSchema = z25.object({
4799
+ entityId: z25.string(),
4800
+ attributeKey: z25.string(),
4801
+ value: LatticePrimitiveValueSchema
4802
+ });
4803
+ var LatticeScenarioSchema = z25.object({
4804
+ id: z25.string().min(1).max(100),
4805
+ name: z25.string().min(1).max(255),
4806
+ description: z25.string().max(1e3).optional(),
4807
+ overrides: z25.array(LatticeScenarioOverrideSchema).default([]),
4808
+ createdAt: z25.date(),
4809
+ updatedAt: z25.date()
4810
+ });
4811
+ var LatticeComputedValueSchema = z25.object({
4812
+ value: LatticePrimitiveValueSchema,
4813
+ computedByRuleId: z25.string(),
4814
+ computedAt: z25.date()
4815
+ });
4816
+ var LatticeComputedValuesSchema = z25.record(z25.record(LatticeComputedValueSchema));
4817
+ var LatticeCalculationStepSchema = z25.object({
4818
+ ruleId: z25.string(),
4819
+ ruleName: z25.string(),
4820
+ operation: LatticeOperationSchema,
4821
+ inputs: z25.array(z25.object({
4822
+ name: z25.string(),
4823
+ value: LatticePrimitiveValueSchema
4824
+ })),
4825
+ output: LatticePrimitiveValueSchema
4826
+ });
4827
+ var LatticeCalculationChainSchema = z25.object({
4828
+ targetEntity: z25.string(),
4829
+ targetAttribute: z25.string(),
4830
+ finalValue: LatticePrimitiveValueSchema,
4831
+ steps: z25.array(LatticeCalculationStepSchema)
4832
+ });
4833
+ var LatticeModelSchema = z25.object({
4834
+ // Identity
4835
+ id: z25.string().min(1).max(100),
4836
+ name: z25.string().min(1).max(255),
4837
+ description: z25.string().max(2e3).optional(),
4838
+ modelType: LatticeModelTypeSchema.default("custom"),
4839
+ // Ownership
4840
+ userId: z25.string(),
4841
+ sessionId: z25.string().optional(),
4842
+ projectId: z25.string().optional(),
4843
+ organizationId: z25.string().optional(),
4844
+ // Core Data Layers
4845
+ data: LatticeDataStoreSchema.default({ entities: [], relationships: [] }),
4846
+ rules: LatticeRulesStoreSchema.default({ rules: [], rulesets: [] }),
4847
+ views: LatticeViewStoreSchema.default({ views: [] }),
4848
+ // Settings
4849
+ settings: LatticeModelSettingsSchema.default({}),
4850
+ // Scenarios
4851
+ scenarios: z25.array(LatticeScenarioSchema).default([]),
4852
+ activeScenarioId: z25.string().optional(),
4853
+ // History
4854
+ operations: z25.array(LatticeHistoryOperationSchema).default([]),
4855
+ operationIndex: z25.number().int().min(-1).default(-1),
4856
+ // Versioning
4857
+ version: z25.number().int().positive().default(1),
4858
+ contentHash: z25.string().optional(),
4859
+ // Timestamps
4860
+ createdAt: z25.date(),
4861
+ updatedAt: z25.date(),
4862
+ lastComputedAt: z25.date().optional(),
4863
+ // Soft delete
4864
+ deletedAt: z25.date().optional()
4865
+ });
4866
+ var LatticeExtractedEntitySchema = z25.object({
4867
+ type: z25.enum([
4868
+ "line_item_name",
4869
+ "period",
4870
+ "amount",
4871
+ "percentage",
4872
+ "operation",
4873
+ "comparison_operator",
4874
+ "entity_reference",
4875
+ "category",
4876
+ "scenario"
4877
+ ]),
4878
+ value: z25.string(),
4879
+ normalizedValue: z25.union([z25.string(), z25.number()]).optional(),
4880
+ position: z25.object({
4881
+ start: z25.number().int().min(0),
4882
+ end: z25.number().int().min(0)
4883
+ }),
4884
+ confidence: z25.number().min(0).max(1)
4885
+ });
4886
+ var LatticeParsedIntentSchema = z25.object({
4887
+ intent: LatticeIntentTypeSchema,
4888
+ confidence: z25.number().min(0).max(1),
4889
+ entities: z25.array(LatticeExtractedEntitySchema),
4890
+ rawInput: z25.string(),
4891
+ normalizedInput: z25.string(),
4892
+ suggestedOperations: z25.array(LatticeHistoryOperationSchema).optional(),
4893
+ ambiguousRefs: z25.array(z25.object({
4894
+ value: z25.string(),
4895
+ candidates: z25.array(z25.string())
4896
+ })).optional(),
4897
+ clarificationNeeded: z25.string().optional()
4898
+ });
4899
+ var LatticeErrorSchema = z25.object({
4900
+ type: LatticeErrorTypeSchema,
4901
+ message: z25.string(),
4902
+ suggestions: z25.array(z25.string()).optional(),
4903
+ context: z25.object({
4904
+ input: z25.string().optional(),
4905
+ position: z25.number().optional(),
4906
+ relatedEntities: z25.array(z25.string()).optional(),
4907
+ relatedRules: z25.array(z25.string()).optional()
4908
+ }).optional()
4909
+ });
4910
+ var CreateLatticeModelRequestSchema = z25.object({
4911
+ name: z25.string().min(1).max(255),
4912
+ description: z25.string().max(2e3).optional(),
4913
+ modelType: LatticeModelTypeSchema.optional(),
4914
+ sessionId: z25.string().optional(),
4915
+ projectId: z25.string().optional(),
4916
+ settings: LatticeModelSettingsSchema.partial().optional()
4917
+ });
4918
+ var UpdateLatticeModelRequestSchema = z25.object({
4919
+ name: z25.string().min(1).max(255).optional(),
4920
+ description: z25.string().max(2e3).optional(),
4921
+ settings: LatticeModelSettingsSchema.partial().optional(),
4922
+ data: LatticeDataStoreSchema.optional(),
4923
+ rules: LatticeRulesStoreSchema.optional(),
4924
+ views: LatticeViewStoreSchema.optional()
4925
+ });
4926
+ var ComputeLatticeRequestSchema = z25.object({
4927
+ scenarioId: z25.string().optional()
4928
+ });
4929
+ var ComputeLatticeResponseSchema = z25.object({
4930
+ computedValues: LatticeComputedValuesSchema,
4931
+ duration: z25.number(),
4932
+ errors: z25.array(LatticeErrorSchema).optional()
4933
+ });
4934
+ var ExplainLatticeRequestSchema = z25.object({
4935
+ entityId: z25.string(),
4936
+ attributeKey: z25.string()
4937
+ });
4938
+ var ExplainLatticeResponseSchema = z25.object({
4939
+ chain: LatticeCalculationChainSchema
4940
+ });
4941
+ var ExportLatticeRequestSchema = z25.object({
4942
+ format: LatticeExportFormatSchema,
4943
+ viewId: z25.string().optional(),
4944
+ scenarioId: z25.string().optional()
4945
+ });
4946
+ var validateLatticeModel = (data) => {
4947
+ return LatticeModelSchema.parse(data);
4948
+ };
4949
+ var validateLatticeEntity = (data) => {
4950
+ return LatticeEntitySchema.parse(data);
4951
+ };
4952
+ var validateLatticeRule = (data) => {
4953
+ return LatticeRuleSchema.parse(data);
4954
+ };
4955
+ var validateLatticeParsedIntent = (data) => {
4956
+ return LatticeParsedIntentSchema.parse(data);
4957
+ };
4958
+ var safeParseLatticeModel = (data) => {
4959
+ return LatticeModelSchema.safeParse(data);
4960
+ };
4961
+ var safeParseLatticeEntity = (data) => {
4962
+ return LatticeEntitySchema.safeParse(data);
4963
+ };
4964
+ var safeParseLatticeRule = (data) => {
4965
+ return LatticeRuleSchema.safeParse(data);
4966
+ };
4967
+
4382
4968
  // ../../b4m-core/packages/common/dist/src/constants/user.js
4383
4969
  var PREDEFINED_USER_TAGS = ["Developer", "Analyst", "Customer"];
4384
4970
  var isPredefinedTag = (tag) => {
@@ -4389,134 +4975,136 @@ var getPredefinedTags = () => {
4389
4975
  };
4390
4976
 
4391
4977
  // ../../b4m-core/packages/common/dist/src/llm.js
4392
- import { z as z25 } from "zod";
4393
- var DashboardParamsSchema = z25.object({
4394
- dashboardDataSources: z25.array(z25.object({
4395
- sourceName: z25.string(),
4396
- data: z25.any()
4978
+ import { z as z26 } from "zod";
4979
+ var DashboardParamsSchema = z26.object({
4980
+ dashboardDataSources: z26.array(z26.object({
4981
+ sourceName: z26.string(),
4982
+ data: z26.any()
4397
4983
  })),
4398
- promptName: z25.string().optional()
4984
+ promptName: z26.string().optional()
4399
4985
  });
4400
- var QuestMasterParamsSchema = z25.object({
4401
- questMasterPlanId: z25.string(),
4402
- questId: z25.string(),
4403
- subQuestId: z25.string()
4986
+ var QuestMasterParamsSchema = z26.object({
4987
+ questMasterPlanId: z26.string(),
4988
+ questId: z26.string(),
4989
+ subQuestId: z26.string()
4404
4990
  });
4405
- var ResearchModeConfigurationSchema = z25.object({
4406
- id: z25.string(),
4407
- enabled: z25.boolean(),
4408
- model: z25.string(),
4409
- parameters: z25.object({
4410
- temperature: z25.number().optional(),
4411
- maxTokens: z25.number().optional(),
4412
- topP: z25.number().optional(),
4413
- presencePenalty: z25.number().optional(),
4414
- frequencyPenalty: z25.number().optional()
4991
+ var ResearchModeConfigurationSchema = z26.object({
4992
+ id: z26.string(),
4993
+ enabled: z26.boolean(),
4994
+ model: z26.string(),
4995
+ parameters: z26.object({
4996
+ temperature: z26.number().optional(),
4997
+ maxTokens: z26.number().optional(),
4998
+ topP: z26.number().optional(),
4999
+ presencePenalty: z26.number().optional(),
5000
+ frequencyPenalty: z26.number().optional()
4415
5001
  }),
4416
- label: z25.string().optional()
5002
+ label: z26.string().optional()
4417
5003
  });
4418
- var ResearchModeParamsSchema = z25.object({
4419
- enabled: z25.boolean(),
4420
- configurations: z25.array(ResearchModeConfigurationSchema).max(4)
5004
+ var ResearchModeParamsSchema = z26.object({
5005
+ enabled: z26.boolean(),
5006
+ configurations: z26.array(ResearchModeConfigurationSchema).max(4)
4421
5007
  });
4422
5008
  var GenerateImageIvokeParamsSchema = OpenAIImageGenerationInput.extend({
4423
- sessionId: z25.string(),
4424
- questId: z25.string().optional(),
4425
- organizationId: z25.string().nullable().optional(),
4426
- width: z25.number().optional(),
4427
- height: z25.number().optional(),
4428
- aspect_ratio: z25.string().optional(),
4429
- fabFileIds: z25.array(z25.string()).default([]),
4430
- tools: z25.array(z25.union([b4mLLMTools, z25.string()])).optional(),
4431
- promptEnhancement: z25.object({
4432
- originalPrompt: z25.string(),
4433
- enhancedPrompt: z25.string(),
4434
- promptWasEnhanced: z25.boolean()
5009
+ sessionId: z26.string(),
5010
+ questId: z26.string().optional(),
5011
+ organizationId: z26.string().nullable().optional(),
5012
+ width: z26.number().optional(),
5013
+ height: z26.number().optional(),
5014
+ aspect_ratio: z26.string().optional(),
5015
+ fabFileIds: z26.array(z26.string()).default([]),
5016
+ tools: z26.array(z26.union([b4mLLMTools, z26.string()])).optional(),
5017
+ promptEnhancement: z26.object({
5018
+ originalPrompt: z26.string(),
5019
+ enhancedPrompt: z26.string(),
5020
+ promptWasEnhanced: z26.boolean()
4435
5021
  }).optional()
4436
5022
  });
4437
5023
  var GenerateImageRequestBodySchema = GenerateImageIvokeParamsSchema.extend({
4438
- sessionId: z25.string().optional(),
4439
- sessionName: z25.string().optional(),
4440
- projectId: z25.string().optional()
5024
+ sessionId: z26.string().optional(),
5025
+ sessionName: z26.string().optional(),
5026
+ projectId: z26.string().optional()
4441
5027
  });
4442
5028
  var GenerateImageToolCallSchema = OpenAIImageGenerationInput.extend({
4443
- safety_tolerance: z25.number().optional(),
4444
- prompt_upsampling: z25.boolean().optional(),
4445
- output_format: z25.enum(["jpeg", "png"]).nullable().optional(),
4446
- seed: z25.number().nullable().optional(),
4447
- editModel: z25.string().optional()
5029
+ safety_tolerance: z26.number().optional(),
5030
+ prompt_upsampling: z26.boolean().optional(),
5031
+ output_format: z26.enum(["jpeg", "png"]).nullable().optional(),
5032
+ seed: z26.number().nullable().optional(),
5033
+ editModel: z26.string().optional()
4448
5034
  // Model to use for image editing operations (separate from generation model)
4449
5035
  }).omit({
4450
5036
  prompt: true
4451
5037
  });
4452
5038
  var EditImageRequestBodySchema = OpenAIImageGenerationInput.extend({
4453
- sessionId: z25.string(),
4454
- questId: z25.string().optional(),
4455
- organizationId: z25.string().nullable().optional(),
4456
- aspect_ratio: z25.string().optional(),
4457
- fabFileIds: z25.array(z25.string()).default([]),
4458
- image: z25.string()
4459
- });
4460
- var ChatCompletionInvokeParamsSchema = z25.object({
5039
+ sessionId: z26.string(),
5040
+ questId: z26.string().optional(),
5041
+ organizationId: z26.string().nullable().optional(),
5042
+ aspect_ratio: z26.string().optional(),
5043
+ fabFileIds: z26.array(z26.string()).default([]),
5044
+ image: z26.string()
5045
+ });
5046
+ var ChatCompletionInvokeParamsSchema = z26.object({
4461
5047
  /** Notebook session ID */
4462
- sessionId: z25.string(),
4463
- historyCount: z25.number(),
5048
+ sessionId: z26.string(),
5049
+ historyCount: z26.number(),
4464
5050
  imageConfig: GenerateImageToolCallSchema.optional(),
4465
- deepResearchConfig: z25.object({
4466
- maxDepth: z25.number().optional(),
4467
- duration: z25.number().optional(),
5051
+ deepResearchConfig: z26.object({
5052
+ maxDepth: z26.number().optional(),
5053
+ duration: z26.number().optional(),
4468
5054
  // Note: searchers are passed via ToolContext and not through this API schema
4469
- searchers: z25.array(z25.any()).optional()
5055
+ searchers: z26.array(z26.any()).optional()
4470
5056
  }).optional(),
4471
- fabFileIds: z25.array(z25.string()),
5057
+ fabFileIds: z26.array(z26.string()),
4472
5058
  /** Prompt message */
4473
- message: z25.string(),
4474
- messageFileIds: z25.array(z25.string()).default([]),
4475
- questId: z25.string().optional(),
5059
+ message: z26.string(),
5060
+ messageFileIds: z26.array(z26.string()).default([]),
5061
+ questId: z26.string().optional(),
4476
5062
  /** Extra context messages to include in the conversation from external sources */
4477
- extraContextMessages: z25.array(z25.object({
4478
- role: z25.enum(["user", "assistant", "system", "function", "tool"]),
4479
- content: z25.union([z25.string(), z25.array(z25.any())]),
4480
- fabFileIds: z25.array(z25.string()).optional()
5063
+ extraContextMessages: z26.array(z26.object({
5064
+ role: z26.enum(["user", "assistant", "system", "function", "tool"]),
5065
+ content: z26.union([z26.string(), z26.array(z26.any())]),
5066
+ fabFileIds: z26.array(z26.string()).optional()
4481
5067
  })).optional(),
4482
5068
  /** Dashboard related params */
4483
5069
  dashboardParams: DashboardParamsSchema.optional(),
4484
5070
  /** LLM params */
4485
5071
  params: ChatCompletionCreateInputSchema,
4486
5072
  /** Whether Quest Master is enabled */
4487
- enableQuestMaster: z25.boolean().optional(),
5073
+ enableQuestMaster: z26.boolean().optional(),
4488
5074
  /** Whether Mementos is enabled */
4489
- enableMementos: z25.boolean().optional(),
5075
+ enableMementos: z26.boolean().optional(),
4490
5076
  /** Whether Artifacts is enabled */
4491
- enableArtifacts: z25.boolean().optional(),
5077
+ enableArtifacts: z26.boolean().optional(),
4492
5078
  /** Whether Agents is enabled */
4493
- enableAgents: z25.boolean().optional(),
5079
+ enableAgents: z26.boolean().optional(),
5080
+ /** Whether Lattice (financial pro-forma modeling) is enabled */
5081
+ enableLattice: z26.boolean().optional(),
4494
5082
  /** LLM tools to enable (built-in tools or MCP tool names) */
4495
- tools: z25.array(z25.union([b4mLLMTools, z25.string()])).optional(),
5083
+ tools: z26.array(z26.union([b4mLLMTools, z26.string()])).optional(),
4496
5084
  /** Enabled MCP servers */
4497
- mcpServers: z25.array(z25.string()).optional(),
5085
+ mcpServers: z26.array(z26.string()).optional(),
4498
5086
  /** Project ID */
4499
- projectId: z25.string().optional(),
5087
+ projectId: z26.string().optional(),
4500
5088
  /** Organization ID */
4501
- organizationId: z25.string().nullable().optional(),
5089
+ organizationId: z26.string().nullable().optional(),
4502
5090
  /** Tool prompt ID to use for the LLM */
4503
- toolPromptId: z25.string().optional(),
5091
+ toolPromptId: z26.string().optional(),
4504
5092
  /** Quest Master related params */
4505
5093
  questMaster: QuestMasterParamsSchema.optional(),
4506
5094
  /** Research Mode related params */
4507
5095
  researchMode: ResearchModeParamsSchema.optional(),
4508
5096
  /** Fallback model ID to try if primary model fails */
4509
- fallbackModel: z25.string().optional(),
5097
+ fallbackModel: z26.string().optional(),
4510
5098
  /** Embedding model to use */
4511
- embeddingModel: z25.string().optional(),
5099
+ embeddingModel: z26.string().optional(),
4512
5100
  /** User's timezone (IANA format, e.g., "America/New_York") */
4513
- timezone: z25.string().optional()
5101
+ timezone: z26.string().optional()
4514
5102
  });
4515
5103
  var LLMApiRequestBodySchema = ChatCompletionInvokeParamsSchema.extend({
4516
5104
  /** Notebook session ID */
4517
- sessionId: z25.string().optional(),
5105
+ sessionId: z26.string().optional(),
4518
5106
  /** Notebook session name */
4519
- sessionName: z25.string().optional()
5107
+ sessionName: z26.string().optional()
4520
5108
  });
4521
5109
 
4522
5110
  // ../../b4m-core/packages/common/dist/src/utils.js
@@ -4665,16 +5253,16 @@ var extractSnippetMeta = (content) => {
4665
5253
  };
4666
5254
 
4667
5255
  // ../../b4m-core/packages/common/dist/src/search.js
4668
- import { z as z26 } from "zod";
4669
- var searchSchema = z26.object({
4670
- search: z26.string().optional(),
4671
- pagination: z26.object({
4672
- page: z26.coerce.number().int().positive(),
4673
- limit: z26.coerce.number().int().positive()
5256
+ import { z as z27 } from "zod";
5257
+ var searchSchema = z27.object({
5258
+ search: z27.string().optional(),
5259
+ pagination: z27.object({
5260
+ page: z27.coerce.number().int().positive(),
5261
+ limit: z27.coerce.number().int().positive()
4674
5262
  }).optional(),
4675
- orderBy: z26.object({
4676
- field: z26.string(),
4677
- direction: z26.enum(["asc", "desc"])
5263
+ orderBy: z27.object({
5264
+ field: z27.string(),
5265
+ direction: z27.enum(["asc", "desc"])
4678
5266
  }).optional()
4679
5267
  });
4680
5268
 
@@ -7359,89 +7947,89 @@ var getMcpProviderMetadata = (providerName) => {
7359
7947
  };
7360
7948
 
7361
7949
  // ../../b4m-core/packages/common/dist/src/schemas/artifacts.js
7362
- import { z as z27 } from "zod";
7363
- var ArtifactStatusSchema = z27.enum(["draft", "review", "published", "archived", "deleted"]);
7364
- var VisibilitySchema = z27.enum(["private", "project", "organization", "public"]);
7365
- var ArtifactPermissionsSchema = z27.object({
7366
- canRead: z27.array(z27.string()),
7367
- canWrite: z27.array(z27.string()),
7368
- canDelete: z27.array(z27.string()),
7369
- isPublic: z27.boolean().default(false),
7370
- inheritFromProject: z27.boolean().default(true)
7371
- });
7372
- var BaseArtifactSchema = z27.object({
7373
- id: z27.string().uuid(),
7950
+ import { z as z28 } from "zod";
7951
+ var ArtifactStatusSchema = z28.enum(["draft", "review", "published", "archived", "deleted"]);
7952
+ var VisibilitySchema = z28.enum(["private", "project", "organization", "public"]);
7953
+ var ArtifactPermissionsSchema = z28.object({
7954
+ canRead: z28.array(z28.string()),
7955
+ canWrite: z28.array(z28.string()),
7956
+ canDelete: z28.array(z28.string()),
7957
+ isPublic: z28.boolean().default(false),
7958
+ inheritFromProject: z28.boolean().default(true)
7959
+ });
7960
+ var BaseArtifactSchema = z28.object({
7961
+ id: z28.string().uuid(),
7374
7962
  type: ArtifactTypeSchema,
7375
- title: z27.string().min(1).max(255),
7376
- description: z27.string().max(1e3).optional(),
7963
+ title: z28.string().min(1).max(255),
7964
+ description: z28.string().max(1e3).optional(),
7377
7965
  // Versioning
7378
- version: z27.number().int().positive().default(1),
7379
- versionTag: z27.string().max(100).optional(),
7380
- currentVersionId: z27.string().uuid().optional(),
7381
- parentVersionId: z27.string().uuid().optional(),
7966
+ version: z28.number().int().positive().default(1),
7967
+ versionTag: z28.string().max(100).optional(),
7968
+ currentVersionId: z28.string().uuid().optional(),
7969
+ parentVersionId: z28.string().uuid().optional(),
7382
7970
  // Timestamps
7383
- createdAt: z27.date(),
7384
- updatedAt: z27.date(),
7385
- publishedAt: z27.date().optional(),
7386
- deletedAt: z27.date().optional(),
7971
+ createdAt: z28.date(),
7972
+ updatedAt: z28.date(),
7973
+ publishedAt: z28.date().optional(),
7974
+ deletedAt: z28.date().optional(),
7387
7975
  // Ownership & Access
7388
- userId: z27.string(),
7389
- projectId: z27.string().optional(),
7390
- organizationId: z27.string().optional(),
7976
+ userId: z28.string(),
7977
+ projectId: z28.string().optional(),
7978
+ organizationId: z28.string().optional(),
7391
7979
  visibility: VisibilitySchema.default("private"),
7392
7980
  permissions: ArtifactPermissionsSchema,
7393
7981
  // Relationships
7394
- sourceQuestId: z27.string().optional(),
7395
- sessionId: z27.string().optional(),
7396
- parentArtifactId: z27.string().uuid().optional(),
7982
+ sourceQuestId: z28.string().optional(),
7983
+ sessionId: z28.string().optional(),
7984
+ parentArtifactId: z28.string().uuid().optional(),
7397
7985
  // Status
7398
7986
  status: ArtifactStatusSchema.default("draft"),
7399
- tags: z27.array(z27.string().max(50)).max(20).default([]),
7987
+ tags: z28.array(z28.string().max(50)).max(20).default([]),
7400
7988
  // Content
7401
- contentHash: z27.string(),
7402
- contentSize: z27.number().int().nonnegative(),
7989
+ contentHash: z28.string(),
7990
+ contentSize: z28.number().int().nonnegative(),
7403
7991
  // Metadata
7404
- metadata: z27.record(z27.unknown()).optional()
7992
+ metadata: z28.record(z28.unknown()).optional()
7405
7993
  });
7406
- var EnhancedArtifactMetadataSchema = z27.object({
7407
- language: z27.string().optional(),
7408
- dependencies: z27.array(z27.string()).optional(),
7409
- settings: z27.record(z27.unknown()).optional()
7994
+ var EnhancedArtifactMetadataSchema = z28.object({
7995
+ language: z28.string().optional(),
7996
+ dependencies: z28.array(z28.string()).optional(),
7997
+ settings: z28.record(z28.unknown()).optional()
7410
7998
  });
7411
7999
  var ReactArtifactV2Schema = BaseArtifactSchema.extend({
7412
- type: z27.literal("react"),
7413
- content: z27.string(),
8000
+ type: z28.literal("react"),
8001
+ content: z28.string(),
7414
8002
  metadata: EnhancedArtifactMetadataSchema.extend({
7415
- dependencies: z27.array(z27.string()),
7416
- props: z27.record(z27.unknown()).optional(),
7417
- hasDefaultExport: z27.boolean(),
7418
- errorBoundary: z27.boolean().default(true)
8003
+ dependencies: z28.array(z28.string()),
8004
+ props: z28.record(z28.unknown()).optional(),
8005
+ hasDefaultExport: z28.boolean(),
8006
+ errorBoundary: z28.boolean().default(true)
7419
8007
  })
7420
8008
  });
7421
8009
  var HtmlArtifactV2Schema = BaseArtifactSchema.extend({
7422
- type: z27.literal("html"),
7423
- content: z27.string(),
8010
+ type: z28.literal("html"),
8011
+ content: z28.string(),
7424
8012
  metadata: EnhancedArtifactMetadataSchema.extend({
7425
- allowedScripts: z27.array(z27.string()).default([]),
7426
- cspPolicy: z27.string().optional(),
7427
- sanitized: z27.boolean().default(false)
8013
+ allowedScripts: z28.array(z28.string()).default([]),
8014
+ cspPolicy: z28.string().optional(),
8015
+ sanitized: z28.boolean().default(false)
7428
8016
  })
7429
8017
  });
7430
8018
  var SvgArtifactV2Schema = BaseArtifactSchema.extend({
7431
- type: z27.literal("svg"),
7432
- content: z27.string(),
8019
+ type: z28.literal("svg"),
8020
+ content: z28.string(),
7433
8021
  metadata: EnhancedArtifactMetadataSchema.extend({
7434
- viewBox: z27.string().optional(),
7435
- width: z27.number().positive().optional(),
7436
- height: z27.number().positive().optional(),
7437
- sanitized: z27.boolean().default(false)
8022
+ viewBox: z28.string().optional(),
8023
+ width: z28.number().positive().optional(),
8024
+ height: z28.number().positive().optional(),
8025
+ sanitized: z28.boolean().default(false)
7438
8026
  })
7439
8027
  });
7440
8028
  var MermaidArtifactV2Schema = BaseArtifactSchema.extend({
7441
- type: z27.literal("mermaid"),
7442
- content: z27.string(),
8029
+ type: z28.literal("mermaid"),
8030
+ content: z28.string(),
7443
8031
  metadata: EnhancedArtifactMetadataSchema.extend({
7444
- chartType: z27.enum([
8032
+ chartType: z28.enum([
7445
8033
  "flowchart",
7446
8034
  "sequenceDiagram",
7447
8035
  "classDiagram",
@@ -7451,7 +8039,7 @@ var MermaidArtifactV2Schema = BaseArtifactSchema.extend({
7451
8039
  "pie",
7452
8040
  "mindmap"
7453
8041
  ]).optional(),
7454
- description: z27.string().optional()
8042
+ description: z28.string().optional()
7455
8043
  })
7456
8044
  });
7457
8045
  var ArtifactStatuses;
@@ -7479,39 +8067,39 @@ var validateMermaidArtifactV2 = (data) => {
7479
8067
  };
7480
8068
 
7481
8069
  // ../../b4m-core/packages/common/dist/src/schemas/questmaster.js
7482
- import { z as z28 } from "zod";
7483
- var QuestStatusSchema = z28.enum(["pending", "in-progress", "completed", "skipped"]);
7484
- var QuestSchema = z28.object({
7485
- id: z28.string().uuid(),
7486
- title: z28.string().min(1).max(255),
7487
- description: z28.string().max(1e3),
8070
+ import { z as z29 } from "zod";
8071
+ var QuestStatusSchema = z29.enum(["pending", "in-progress", "completed", "skipped"]);
8072
+ var QuestSchema = z29.object({
8073
+ id: z29.string().uuid(),
8074
+ title: z29.string().min(1).max(255),
8075
+ description: z29.string().max(1e3),
7488
8076
  status: QuestStatusSchema.default("pending"),
7489
- order: z28.number().int().nonnegative(),
7490
- dependencies: z28.array(z28.string().uuid()).optional(),
7491
- estimatedMinutes: z28.number().int().positive().optional(),
7492
- completedAt: z28.date().optional(),
7493
- completedBy: z28.string().optional(),
7494
- metadata: z28.record(z28.unknown()).optional()
8077
+ order: z29.number().int().nonnegative(),
8078
+ dependencies: z29.array(z29.string().uuid()).optional(),
8079
+ estimatedMinutes: z29.number().int().positive().optional(),
8080
+ completedAt: z29.date().optional(),
8081
+ completedBy: z29.string().optional(),
8082
+ metadata: z29.record(z29.unknown()).optional()
7495
8083
  });
7496
- var QuestResourceSchema = z28.object({
7497
- type: z28.enum(["documentation", "tutorial", "example", "tool"]),
7498
- title: z28.string().min(1).max(255),
7499
- url: z28.string().url(),
7500
- description: z28.string().max(500).optional()
7501
- });
7502
- var QuestMasterContentSchema = z28.object({
7503
- goal: z28.string().min(1).max(500),
7504
- quests: z28.array(QuestSchema).min(1),
7505
- totalSteps: z28.number().int().positive(),
7506
- estimatedDuration: z28.number().int().positive().optional(),
7507
- complexity: z28.enum(["low", "medium", "high"]),
7508
- category: z28.string().max(100).optional(),
7509
- prerequisites: z28.array(z28.string().max(255)).optional(),
7510
- completionCriteria: z28.array(z28.string().max(500)).optional(),
7511
- resources: z28.array(QuestResourceSchema).optional()
8084
+ var QuestResourceSchema = z29.object({
8085
+ type: z29.enum(["documentation", "tutorial", "example", "tool"]),
8086
+ title: z29.string().min(1).max(255),
8087
+ url: z29.string().url(),
8088
+ description: z29.string().max(500).optional()
8089
+ });
8090
+ var QuestMasterContentSchema = z29.object({
8091
+ goal: z29.string().min(1).max(500),
8092
+ quests: z29.array(QuestSchema).min(1),
8093
+ totalSteps: z29.number().int().positive(),
8094
+ estimatedDuration: z29.number().int().positive().optional(),
8095
+ complexity: z29.enum(["low", "medium", "high"]),
8096
+ category: z29.string().max(100).optional(),
8097
+ prerequisites: z29.array(z29.string().max(255)).optional(),
8098
+ completionCriteria: z29.array(z29.string().max(500)).optional(),
8099
+ resources: z29.array(QuestResourceSchema).optional()
7512
8100
  });
7513
8101
  var QuestMasterArtifactV2Schema = BaseArtifactSchema.extend({
7514
- type: z28.literal("questmaster"),
8102
+ type: z29.literal("questmaster"),
7515
8103
  content: QuestMasterContentSchema
7516
8104
  });
7517
8105
  var validateQuest = (data) => {
@@ -7528,13 +8116,13 @@ var safeParseQuestMasterArtifactV2 = (data) => {
7528
8116
  };
7529
8117
 
7530
8118
  // ../../b4m-core/packages/common/dist/src/schemas/curation.js
7531
- import { z as z29 } from "zod";
8119
+ import { z as z30 } from "zod";
7532
8120
  var CurationType;
7533
8121
  (function(CurationType2) {
7534
8122
  CurationType2["TRANSCRIPT"] = "transcript";
7535
8123
  CurationType2["EXECUTIVE_SUMMARY"] = "executive_summary";
7536
8124
  })(CurationType || (CurationType = {}));
7537
- var CurationTypeSchema = z29.nativeEnum(CurationType);
8125
+ var CurationTypeSchema = z30.nativeEnum(CurationType);
7538
8126
  var CurationArtifactType;
7539
8127
  (function(CurationArtifactType2) {
7540
8128
  CurationArtifactType2["CODE"] = "code";
@@ -7547,7 +8135,7 @@ var CurationArtifactType;
7547
8135
  CurationArtifactType2["DEEP_RESEARCH"] = "deep_research";
7548
8136
  CurationArtifactType2["IMAGE"] = "image";
7549
8137
  })(CurationArtifactType || (CurationArtifactType = {}));
7550
- var CurationArtifactTypeSchema = z29.enum([
8138
+ var CurationArtifactTypeSchema = z30.enum([
7551
8139
  "CODE",
7552
8140
  "REACT",
7553
8141
  "HTML",
@@ -7558,28 +8146,28 @@ var CurationArtifactTypeSchema = z29.enum([
7558
8146
  "DEEP_RESEARCH",
7559
8147
  "IMAGE"
7560
8148
  ]);
7561
- var ExportFormatSchema = z29.enum(["markdown", "txt", "html"]);
7562
- var CurationOptionsSchema = z29.object({
8149
+ var ExportFormatSchema = z30.enum(["markdown", "txt", "html"]);
8150
+ var CurationOptionsSchema = z30.object({
7563
8151
  /** Curation type: transcript (Option 1) or executive_summary (Option 2) */
7564
8152
  curationType: CurationTypeSchema.default(CurationType.TRANSCRIPT),
7565
8153
  /** Include code artifacts in the curated notebook */
7566
- includeCode: z29.boolean().default(true),
8154
+ includeCode: z30.boolean().default(true),
7567
8155
  /** Include diagrams (Mermaid, SVG) in the curated notebook */
7568
- includeDiagrams: z29.boolean().default(true),
8156
+ includeDiagrams: z30.boolean().default(true),
7569
8157
  /** Include data visualizations (Recharts) in the curated notebook */
7570
- includeDataViz: z29.boolean().default(true),
8158
+ includeDataViz: z30.boolean().default(true),
7571
8159
  /** Include QuestMaster plans in the curated notebook */
7572
- includeQuestMaster: z29.boolean().default(true),
8160
+ includeQuestMaster: z30.boolean().default(true),
7573
8161
  /** Include Deep Research findings in the curated notebook */
7574
- includeResearch: z29.boolean().default(true),
8162
+ includeResearch: z30.boolean().default(true),
7575
8163
  /** Include images in the curated notebook */
7576
- includeImages: z29.boolean().default(true),
8164
+ includeImages: z30.boolean().default(true),
7577
8165
  /** Token budget for processing (varies by curation type) */
7578
- tokenBudget: z29.number().optional(),
8166
+ tokenBudget: z30.number().optional(),
7579
8167
  /** Export format for the curated notebook */
7580
8168
  exportFormat: ExportFormatSchema.default("markdown"),
7581
8169
  /** Custom notebook name (optional, defaults to curated-notebook-{sessionId}) */
7582
- customNotebookName: z29.string().optional()
8170
+ customNotebookName: z30.string().optional()
7583
8171
  });
7584
8172
 
7585
8173
  // ../../b4m-core/packages/common/dist/src/utils/artifactHelpers.js
@@ -7838,6 +8426,7 @@ export {
7838
8426
  SvgArtifactSchema,
7839
8427
  MermaidArtifactSchema,
7840
8428
  RechartsArtifactSchema,
8429
+ LatticeArtifactSchema,
7841
8430
  MermaidChartMetadataSchema,
7842
8431
  ChatHistoryItemWithArtifactsSchema,
7843
8432
  ArtifactOperationSchema,
@@ -7896,6 +8485,9 @@ export {
7896
8485
  RapidReplyResponseStylesCommon,
7897
8486
  RapidReplyTransitionModes,
7898
8487
  RapidReplyFallbackBehaviors,
8488
+ calculateTaskValue,
8489
+ calculateResourceAllocations,
8490
+ detectResourceConflicts,
7899
8491
  SST_PLACEHOLDER_VALUE,
7900
8492
  NOT_CONFIGURED_PLACEHOLDER,
7901
8493
  isPlaceholderValue,
@@ -7919,6 +8511,9 @@ export {
7919
8511
  SpiderProgressUpdateAction,
7920
8512
  SpiderCompleteAction,
7921
8513
  SpiderErrorAction,
8514
+ PiHistoryProgressAction,
8515
+ PiHistoryCompleteAction,
8516
+ PiHistoryErrorAction,
7922
8517
  StreamedChatCompletionAction,
7923
8518
  StreamedRapidReplyAction,
7924
8519
  HeartbeatPongAction,
@@ -8016,6 +8611,67 @@ export {
8016
8611
  SlackEvents,
8017
8612
  InternalTeamMemberSchema,
8018
8613
  InternalTeamMemberListSchema,
8614
+ LatticeDataTypeSchema,
8615
+ LatticeEntityTypeSchema,
8616
+ LatticeRelationshipTypeSchema,
8617
+ LatticeRuleTypeSchema,
8618
+ LatticeOperationSchema,
8619
+ LatticeConditionOperatorSchema,
8620
+ LatticePeriodGrainSchema,
8621
+ LatticeNegativeFormatSchema,
8622
+ LatticeViewTypeSchema,
8623
+ LatticeModelTypeSchema,
8624
+ LatticeIntentTypeSchema,
8625
+ LatticeErrorTypeSchema,
8626
+ LatticeOperationTypeSchema,
8627
+ LatticeExportFormatSchema,
8628
+ LatticePrimitiveValueSchema,
8629
+ LatticeAttributeSchema,
8630
+ LatticeEntitySchema,
8631
+ LatticeRelationshipSchema,
8632
+ LatticeDataStoreSchema,
8633
+ LatticeInputSchema,
8634
+ LatticeOutputSchema,
8635
+ LatticeConditionSchema,
8636
+ LatticeRuleDefinitionSchema,
8637
+ LatticeRuleSchema,
8638
+ LatticeRulesetSchema,
8639
+ LatticeRulesStoreSchema,
8640
+ LatticeRowConfigSchema,
8641
+ LatticeColumnConfigSchema,
8642
+ LatticeFilterSchema,
8643
+ LatticeSortConfigSchema,
8644
+ LatticeGroupConfigSchema,
8645
+ LatticeFormatConfigSchema,
8646
+ LatticeViewConfigSchema,
8647
+ LatticeViewSchema,
8648
+ LatticeViewStoreSchema,
8649
+ LatticeModelSettingsSchema,
8650
+ LatticeHistoryOperationSchema,
8651
+ LatticeScenarioOverrideSchema,
8652
+ LatticeScenarioSchema,
8653
+ LatticeComputedValueSchema,
8654
+ LatticeComputedValuesSchema,
8655
+ LatticeCalculationStepSchema,
8656
+ LatticeCalculationChainSchema,
8657
+ LatticeModelSchema,
8658
+ LatticeExtractedEntitySchema,
8659
+ LatticeParsedIntentSchema,
8660
+ LatticeErrorSchema,
8661
+ CreateLatticeModelRequestSchema,
8662
+ UpdateLatticeModelRequestSchema,
8663
+ ComputeLatticeRequestSchema,
8664
+ ComputeLatticeResponseSchema,
8665
+ ExplainLatticeRequestSchema,
8666
+ ExplainLatticeResponseSchema,
8667
+ ExportLatticeRequestSchema,
8668
+ validateLatticeModel,
8669
+ validateLatticeEntity,
8670
+ validateLatticeRule,
8671
+ validateLatticeParsedIntent,
8672
+ safeParseLatticeModel,
8673
+ safeParseLatticeEntity,
8674
+ safeParseLatticeRule,
8019
8675
  PREDEFINED_USER_TAGS,
8020
8676
  isPredefinedTag,
8021
8677
  getPredefinedTags,