@bike4mind/cli 0.8.1 → 0.9.1

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.
@@ -825,7 +825,10 @@ const PurchaseTransaction = BaseCreditTransaction.extend({
825
825
  /**
826
826
  * Credits that are added to a user or organization through a subscription plan
827
827
  */
828
- const SubscriptionCreditTransaction = BaseCreditTransaction.extend({ type: z.literal("subscription") });
828
+ const SubscriptionCreditTransaction = BaseCreditTransaction.extend({
829
+ type: z.literal("subscription"),
830
+ stripePaymentIntentId: z.string().optional()
831
+ });
829
832
  /**
830
833
  * Credits received from another credit holder
831
834
  */
@@ -928,6 +931,11 @@ const CompletionApiUsageTransaction = BaseCreditTransaction.extend({
928
931
  inputTokens: z.number(),
929
932
  outputTokens: z.number()
930
933
  });
934
+ const SpeechToTextUsageTransaction = BaseCreditTransaction.extend({
935
+ type: z.literal("speech_to_text_usage"),
936
+ model: z.string(),
937
+ sessionId: z.string()
938
+ });
931
939
  const TransferCreditTransaction = BaseCreditTransaction.extend({
932
940
  type: z.literal("transfer_credit"),
933
941
  recipientId: z.string(),
@@ -945,6 +953,7 @@ z.discriminatedUnion("type", [
945
953
  RealtimeVoiceUsageTransaction,
946
954
  ToolUsageTransaction,
947
955
  CompletionApiUsageTransaction,
956
+ SpeechToTextUsageTransaction,
948
957
  TransferCreditTransaction,
949
958
  ReceivedCreditTransaction
950
959
  ]);
@@ -959,6 +968,7 @@ const CREDIT_DEDUCT_TRANSACTION_TYPES = [
959
968
  "realtime_voice_usage",
960
969
  "tool_usage",
961
970
  "completion_api_usage",
971
+ "speech_to_text_usage",
962
972
  "transfer_credit",
963
973
  "generic_deduct"
964
974
  ];
@@ -1310,13 +1320,23 @@ const CliCompletionRequestAction = z.object({
1310
1320
  "assistant",
1311
1321
  "system"
1312
1322
  ]),
1313
- content: z.union([z.string(), z.array(z.unknown())])
1323
+ content: z.union([z.string(), z.array(z.unknown())]),
1324
+ cache: z.boolean().optional()
1314
1325
  })),
1315
1326
  options: z.object({
1316
1327
  temperature: z.number().optional(),
1317
1328
  maxTokens: z.number().optional(),
1318
1329
  stream: z.boolean().optional(),
1319
- tools: z.array(z.unknown()).optional()
1330
+ tools: z.array(z.unknown()).optional(),
1331
+ response_format: z.discriminatedUnion("type", [z.object({ type: z.literal("text") }), z.object({
1332
+ type: z.literal("json_schema"),
1333
+ json_schema: z.object({
1334
+ name: z.string(),
1335
+ description: z.string().optional(),
1336
+ schema: z.record(z.string(), z.any()),
1337
+ strict: z.boolean().optional().default(true)
1338
+ })
1339
+ })]).optional()
1320
1340
  }).optional()
1321
1341
  });
1322
1342
  /**
@@ -1335,12 +1355,12 @@ const VoiceSessionEndedAction = z.object({
1335
1355
  model: z.string(),
1336
1356
  sessionId: z.string(),
1337
1357
  usage: z.object({
1338
- audioInputTokens: z.number(),
1339
- audioCachedInputTokens: z.number(),
1340
- audioOutputTokens: z.number(),
1341
- textInputTokens: z.number(),
1342
- textCachedInputTokens: z.number(),
1343
- textOutputTokens: z.number()
1358
+ audioInputTokens: z.number().min(0),
1359
+ audioCachedInputTokens: z.number().min(0),
1360
+ audioOutputTokens: z.number().min(0),
1361
+ textInputTokens: z.number().min(0),
1362
+ textCachedInputTokens: z.number().min(0),
1363
+ textOutputTokens: z.number().min(0)
1344
1364
  })
1345
1365
  });
1346
1366
  /**
@@ -2373,21 +2393,66 @@ z.discriminatedUnion("action", [
2373
2393
  DataLakeBatchProgressAction,
2374
2394
  CcAgentCommandAction
2375
2395
  ]);
2396
+ /**
2397
+ * Tool schema matching ICompletionOptionTools.toolSchema. The Zod surface only
2398
+ * covers wire-format fields (toolFn is server-side). Replaces the historical
2399
+ * z.array(z.any()) so client-side bugs (typos in name, missing type) surface
2400
+ * at parse time instead of failing silently inside the backend.
2401
+ *
2402
+ * Issue: https://github.com/MillionOnMars/lumina5/issues/8155
2403
+ */
2404
+ const CompletionToolSchema = z.object({
2405
+ toolSchema: z.object({
2406
+ name: z.string(),
2407
+ description: z.string(),
2408
+ parameters: z.object({
2409
+ type: z.literal("object"),
2410
+ properties: z.record(z.string(), z.any()).optional(),
2411
+ additionalProperties: z.boolean().optional(),
2412
+ required: z.array(z.string()).optional()
2413
+ }).passthrough(),
2414
+ strict: z.boolean().optional()
2415
+ }),
2416
+ _isMcpTool: z.boolean().optional()
2417
+ });
2418
+ /**
2419
+ * JSON Schema definition for structured output. The `schema` field is a full
2420
+ * JSON Schema document (we don't try to validate JSON Schema with Zod — that's
2421
+ * the caller's contract with the model). `strict: true` is the default, matching
2422
+ * OpenAI's strict-mode subset semantics.
2423
+ */
2424
+ const ResponseFormatSchema = z.discriminatedUnion("type", [z.object({ type: z.literal("text") }), z.object({
2425
+ type: z.literal("json_schema"),
2426
+ json_schema: z.object({
2427
+ name: z.string(),
2428
+ description: z.string().optional(),
2429
+ schema: z.record(z.string(), z.any()),
2430
+ strict: z.boolean().optional().default(true)
2431
+ })
2432
+ })]);
2433
+ /**
2434
+ * Wire-format message for /api/ai/v1/completions. The optional `cache: true`
2435
+ * flag is honored by Anthropic (translated to `cache_control: { type: 'ephemeral' }`
2436
+ * with the appropriate beta header) and silently ignored by other providers.
2437
+ */
2438
+ const CompletionMessageSchema = z.object({
2439
+ role: z.enum([
2440
+ "user",
2441
+ "assistant",
2442
+ "system"
2443
+ ]),
2444
+ content: z.union([z.string(), z.array(z.any())]),
2445
+ cache: z.boolean().optional()
2446
+ });
2376
2447
  z.object({
2377
2448
  model: z.string(),
2378
- messages: z.array(z.object({
2379
- role: z.enum([
2380
- "user",
2381
- "assistant",
2382
- "system"
2383
- ]),
2384
- content: z.union([z.string(), z.array(z.any())])
2385
- })),
2449
+ messages: z.array(CompletionMessageSchema),
2386
2450
  options: z.object({
2387
2451
  temperature: z.number().optional(),
2388
2452
  maxTokens: z.number().optional(),
2389
2453
  stream: z.boolean().optional(),
2390
- tools: z.array(z.any()).optional()
2454
+ tools: z.array(CompletionToolSchema).optional(),
2455
+ response_format: ResponseFormatSchema.optional()
2391
2456
  }).optional()
2392
2457
  });
2393
2458
  z$2.object({
@@ -7046,6 +7111,12 @@ const ResearchModeParamsSchema = z.object({
7046
7111
  enabled: z.boolean(),
7047
7112
  configurations: z.array(ResearchModeConfigurationSchema).max(4)
7048
7113
  });
7114
+ /**
7115
+ * Classifies a user's image-generation prompt as either a fresh request
7116
+ * or a continuation of the most recent generated image (refine/vary/edit).
7117
+ * Used to gate whether the prior session image is fed back as input.
7118
+ */
7119
+ const PromptIntentSchema = z.enum(["fresh", "continuation"]);
7049
7120
  OpenAIImageGenerationInput.extend({
7050
7121
  sessionId: z.string(),
7051
7122
  questId: z.string().optional(),
@@ -7055,10 +7126,14 @@ OpenAIImageGenerationInput.extend({
7055
7126
  aspect_ratio: z.string().optional(),
7056
7127
  fabFileIds: z.array(z.string()).prefault([]),
7057
7128
  tools: z.array(z.union([b4mLLMTools, z.string()])).optional(),
7129
+ /** Resolved by the API route's prompt resolver. Defaults to 'fresh' for first-turn or sessions with no prior image. */
7130
+ intent: PromptIntentSchema.optional(),
7058
7131
  promptEnhancement: z.object({
7059
7132
  originalPrompt: z.string(),
7060
7133
  enhancedPrompt: z.string(),
7061
- promptWasEnhanced: z.boolean()
7134
+ promptWasEnhanced: z.boolean(),
7135
+ /** Resolver intent — drives the banner's framing (continuation = "context applied" vs fresh = "enhanced"). */
7136
+ intent: PromptIntentSchema.optional()
7062
7137
  }).optional()
7063
7138
  }).extend({
7064
7139
  sessionId: z.string().optional(),
@@ -9502,4 +9577,4 @@ var ConfigStore = class {
9502
9577
  }
9503
9578
  };
9504
9579
  //#endregion
9505
- export { RechartsChartTypeList as $, ImageGenerationUsageTransaction as A, secureParameters as At, NotFoundError as B, FileEvents as C, getMcpProviderMetadata as Ct, GenericCreditAddTransaction as D, obfuscateApiKey as Dt, GenerateImageToolCallSchema as E, isGPTImageModel as Et, KnowledgeType as F, ProfileEvents as G, OpenAIImageGenerationInput as H, LLMEvents as I, PurchaseTransaction as J, ProjectEvents as K, MiscEvents as L, InboxEvents as M, validateNotebookPath as Mt, InviteEvents as N, CollectionType as Nt, GenericCreditDeductTransaction as O, resolveNavigationIntents as Ot, InviteType as P, ReceivedCreditTransaction as Q, ModalEvents as R, FeedbackEvents as S, getDataLakeTags as St, GEMINI_IMAGE_MODELS as T, isGPTImage2Model as Tt, Permission as U, OpenAIEmbeddingModel as V, PermissionDeniedError as W, REASONING_SUPPORTED_MODELS as X, QuestMasterParamsSchema as Y, RealtimeVoiceUsageTransaction as Z, CompletionApiUsageTransaction as _, VideoModels as _t, ApiKeyEvents as a, SessionEvents as at, FIXED_TEMPERATURE_MODELS as b, b4mLLMTools as bt, AppFileEvents as c, SupportedFabFileMimeTypes as ct, BFL_IMAGE_MODELS as d, TextGenerationUsageTransaction as dt, RegInviteEvents as et, BFL_SAFETY_TOLERANCE as f, ToolUsageTransaction as ft, ChatModels as g, VideoGenerationUsageTransaction as gt, ChatCompletionCreateInputSchema as h, VIDEO_SIZE_CONSTRAINTS as ht, AiEvents as i, ResearchTaskType as it, ImageModels as j, validateJupyterKernelName as jt, ImageEditUsageTransaction as k, sanitizeTelemetryError as kt, ArtifactTypeSchema as l, TagType as lt, CREDIT_DEDUCT_TRANSACTION_TYPES as m, UiNavigationEvents as mt, logger as n, ResearchTaskExecutionType as nt, ApiKeyScope as o, SpeechToTextModels as ot, BedrockEmbeddingModel as p, TransferCreditTransaction as pt, PromptMetaZodSchema as q, ALERT_THRESHOLDS as r, ResearchTaskPeriodicFrequencyType as rt, ApiKeyType as s, SubscriptionCreditTransaction as st, ConfigStore as t, ResearchModeParamsSchema as tt, AuthEvents as u, TaskScheduleHandler as ut, DashboardParamsSchema as v, VoyageAIEmbeddingModel as vt, FriendshipEvents as w, getViewById as wt, FavoriteDocumentType as x, getAccessibleDataLakes as xt, ElabsEvents as y, XAI_IMAGE_MODELS as yt, ModelBackend as z };
9580
+ export { ReceivedCreditTransaction as $, ImageGenerationUsageTransaction as A, resolveNavigationIntents as At, NotFoundError as B, FileEvents as C, getAccessibleDataLakes as Ct, GenericCreditAddTransaction as D, isGPTImage2Model as Dt, GenerateImageToolCallSchema as E, getViewById as Et, KnowledgeType as F, CollectionType as Ft, ProfileEvents as G, OpenAIImageGenerationInput as H, LLMEvents as I, PromptMetaZodSchema as J, ProjectEvents as K, MiscEvents as L, InboxEvents as M, secureParameters as Mt, InviteEvents as N, validateJupyterKernelName as Nt, GenericCreditDeductTransaction as O, isGPTImageModel as Ot, InviteType as P, validateNotebookPath as Pt, RealtimeVoiceUsageTransaction as Q, ModalEvents as R, FeedbackEvents as S, b4mLLMTools as St, GEMINI_IMAGE_MODELS as T, getMcpProviderMetadata as Tt, Permission as U, OpenAIEmbeddingModel as V, PermissionDeniedError as W, QuestMasterParamsSchema as X, PurchaseTransaction as Y, REASONING_SUPPORTED_MODELS as Z, CompletionApiUsageTransaction as _, VIDEO_SIZE_CONSTRAINTS as _t, ApiKeyEvents as a, ResearchTaskType as at, FIXED_TEMPERATURE_MODELS as b, VoyageAIEmbeddingModel as bt, AppFileEvents as c, SpeechToTextUsageTransaction as ct, BFL_IMAGE_MODELS as d, TagType as dt, RechartsChartTypeList as et, BFL_SAFETY_TOLERANCE as f, TaskScheduleHandler as ft, ChatModels as g, UiNavigationEvents as gt, ChatCompletionCreateInputSchema as h, TransferCreditTransaction as ht, AiEvents as i, ResearchTaskPeriodicFrequencyType as it, ImageModels as j, sanitizeTelemetryError as jt, ImageEditUsageTransaction as k, obfuscateApiKey as kt, ArtifactTypeSchema as l, SubscriptionCreditTransaction as lt, CREDIT_DEDUCT_TRANSACTION_TYPES as m, ToolUsageTransaction as mt, logger as n, ResearchModeParamsSchema as nt, ApiKeyScope as o, SessionEvents as ot, BedrockEmbeddingModel as p, TextGenerationUsageTransaction as pt, PromptIntentSchema as q, ALERT_THRESHOLDS as r, ResearchTaskExecutionType as rt, ApiKeyType as s, SpeechToTextModels as st, ConfigStore as t, RegInviteEvents as tt, AuthEvents as u, SupportedFabFileMimeTypes as ut, DashboardParamsSchema as v, VideoGenerationUsageTransaction as vt, FriendshipEvents as w, getDataLakeTags as wt, FavoriteDocumentType as x, XAI_IMAGE_MODELS as xt, ElabsEvents as y, VideoModels as yt, ModelBackend as z };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-BVKr0OXs.mjs";
2
+ import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-Dproz7j-.mjs";
3
3
  import { execSync } from "child_process";
4
4
  import { constants, existsSync, promises } from "fs";
5
5
  import { homedir } from "os";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, M as loadContextFiles, N as getApiUrl, O as McpManager, Q as CheckpointStore, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, q as buildSystemPrompt, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-DDoiKdgk.mjs";
3
- import { n as logger, t as ConfigStore } from "../ConfigStore-Bj1IOvWn.mjs";
2
+ import { C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, M as loadContextFiles, N as getApiUrl, O as McpManager, Q as CheckpointStore, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as ReActAgent, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, et as SessionStore, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, q as buildSystemPrompt, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-ICW0xW8W.mjs";
3
+ import { n as logger, t as ConfigStore } from "../ConfigStore-CAKSUXCi.mjs";
4
4
  import { t as DEFAULT_SANDBOX_CONFIG } from "../types-DBEjF9YS.mjs";
5
5
  import { t as createSandboxRuntime } from "../SandboxRuntimeAdapter-C1B4t20N.mjs";
6
6
  import { t as SandboxOrchestrator } from "../SandboxOrchestrator-BEW3rqYi.mjs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-Bj1IOvWn.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-CAKSUXCi.mjs";
3
3
  //#region src/commands/mcpCommand.ts
4
4
  /**
5
5
  * External MCP commands (b4m mcp list, b4m mcp add, etc.)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, i as forceCheckForUpdate } from "../updateChecker-BVKr0OXs.mjs";
2
+ import { a as version, i as forceCheckForUpdate } from "../updateChecker-Dproz7j-.mjs";
3
3
  import { execSync } from "child_process";
4
4
  //#region src/commands/updateCommand.ts
5
5
  /**