@bike4mind/cli 0.2.1-epic-lattice.17016 → 0.2.1-feat-cli-usage-command.17001

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-ZMZK7YVU.js";
4
+ } from "./chunk-WR6YZRQV.js";
5
5
  import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-7JFN4F7V.js";
5
+ } from "./chunk-U3GPYBTD.js";
6
6
  import {
7
7
  GenericCreditDeductTransaction,
8
8
  ImageEditUsageTransaction,
@@ -10,7 +10,7 @@ import {
10
10
  RealtimeVoiceUsageTransaction,
11
11
  TextGenerationUsageTransaction,
12
12
  TransferCreditTransaction
13
- } from "./chunk-ZMZK7YVU.js";
13
+ } from "./chunk-WR6YZRQV.js";
14
14
 
15
15
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
16
16
  import { z } from "zod";
@@ -22,12 +22,20 @@ var SubtractCreditsSchema = z.discriminatedUnion("type", [
22
22
  ImageEditUsageTransaction.omit({ createdAt: true, updatedAt: true }),
23
23
  TransferCreditTransaction.omit({ createdAt: true, updatedAt: true })
24
24
  ]);
25
- async function subtractCredits(parameters, { db, creditHolderMethods }) {
25
+ async function subtractCredits(parameters, { db, creditHolderMethods, skipBalanceUpdate, currentCreditHolder }) {
26
26
  const params = secureParameters(parameters, SubtractCreditsSchema);
27
27
  const { ownerId, ownerType, credits, type, description, metadata } = params;
28
- const updatedEntity = await creditHolderMethods.incrementCredits(ownerId, -credits);
29
- if (!updatedEntity) {
30
- throw new BadRequestError("Failed to update credits");
28
+ let updatedEntity;
29
+ if (skipBalanceUpdate) {
30
+ if (!currentCreditHolder) {
31
+ throw new BadRequestError("currentCreditHolder is required when skipBalanceUpdate is true");
32
+ }
33
+ updatedEntity = currentCreditHolder;
34
+ } else {
35
+ updatedEntity = await creditHolderMethods.incrementCredits(ownerId, -credits);
36
+ if (!updatedEntity) {
37
+ throw new BadRequestError("Failed to update credits");
38
+ }
31
39
  }
32
40
  if (type === "generic_deduct") {
33
41
  await db.creditTransactions.createTransaction("generic_deduct", {
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-7JFN4F7V.js";
10
+ } from "./chunk-U3GPYBTD.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-ZMZK7YVU.js";
14
+ } from "./chunk-WR6YZRQV.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-7JFN4F7V.js";
9
+ } from "./chunk-U3GPYBTD.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-ZMZK7YVU.js";
14
+ } from "./chunk-WR6YZRQV.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -16,7 +16,7 @@ import {
16
16
  dayjsConfig_default,
17
17
  extractSnippetMeta,
18
18
  settingsMap
19
- } from "./chunk-ZMZK7YVU.js";
19
+ } from "./chunk-WR6YZRQV.js";
20
20
 
21
21
  // ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
22
22
  import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
@@ -224,7 +224,7 @@ var ChoiceEndReason;
224
224
  // ../../b4m-core/packages/utils/dist/src/llm/toolStreamingHelper.js
225
225
  async function handleToolResultStreaming(toolName, toolResult, streamCallback) {
226
226
  const resultString = toolResult.toString();
227
- const shouldStream = toolName === "recharts" || resultString.includes("<artifact") || resultString.includes('type="application/vnd.ant.') || resultString.includes('type="application/vnd.b4m.');
227
+ const shouldStream = toolName === "recharts" || resultString.includes("<artifact") || resultString.includes('type="application/vnd.ant.');
228
228
  if (shouldStream) {
229
229
  await streamCallback([resultString]);
230
230
  }
@@ -9708,8 +9708,6 @@ function mapMimeTypeToArtifactType(mimeType) {
9708
9708
  case ClaudeArtifactMimeTypes.MARKDOWN:
9709
9709
  return "code";
9710
9710
  // Treat markdown as code for now
9711
- case ClaudeArtifactMimeTypes.LATTICE:
9712
- return "lattice";
9713
9711
  default:
9714
9712
  if (mimeType.includes("javascript") || mimeType.includes("jsx")) {
9715
9713
  return "react";