@bike4mind/cli 0.2.29-feat-cli-sandbox.18843 → 0.2.29-feat-cli-websocket-streaming.18841

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-5GSDPBTM.js";
4
+ } from "./chunk-KPOK6V6E.js";
5
5
 
6
6
  // ../../b4m-core/packages/services/dist/src/notebookCurationService/artifactExtractor.js
7
7
  var ARTIFACT_TAG_REGEX = /<artifact\s+(.*?)>([\s\S]*?)<\/artifact>/gi;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-S7BPPS33.js";
5
+ } from "./chunk-TY6Z2UV2.js";
6
6
  import {
7
7
  CompletionApiUsageTransaction,
8
8
  GenericCreditDeductTransaction,
@@ -12,7 +12,7 @@ import {
12
12
  TextGenerationUsageTransaction,
13
13
  TransferCreditTransaction,
14
14
  VideoGenerationUsageTransaction
15
- } from "./chunk-5GSDPBTM.js";
15
+ } from "./chunk-KPOK6V6E.js";
16
16
 
17
17
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
18
18
  import { z } from "zod";
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-S7BPPS33.js";
10
+ } from "./chunk-TY6Z2UV2.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-5GSDPBTM.js";
14
+ } from "./chunk-KPOK6V6E.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -1012,6 +1012,29 @@ var VoiceSessionSendTranscriptAction = z10.object({
1012
1012
  conversationItemId: z10.string(),
1013
1013
  timestamp: z10.coerce.date().optional()
1014
1014
  });
1015
+ var CliCompletionRequestAction = z10.object({
1016
+ action: z10.literal("cli_completion_request"),
1017
+ accessToken: z10.string(),
1018
+ requestId: z10.string().uuid(),
1019
+ model: z10.string(),
1020
+ messages: z10.array(z10.object({
1021
+ role: z10.enum(["user", "assistant", "system"]),
1022
+ content: z10.union([z10.string(), z10.array(z10.unknown())])
1023
+ })),
1024
+ options: z10.object({
1025
+ temperature: z10.number().optional(),
1026
+ maxTokens: z10.number().optional(),
1027
+ stream: z10.boolean().optional(),
1028
+ tools: z10.array(z10.unknown()).optional()
1029
+ }).optional()
1030
+ });
1031
+ var CliToolRequestAction = z10.object({
1032
+ action: z10.literal("cli_tool_request"),
1033
+ accessToken: z10.string(),
1034
+ requestId: z10.string().uuid(),
1035
+ toolName: z10.string(),
1036
+ input: z10.record(z10.unknown())
1037
+ });
1015
1038
  var VoiceSessionEndedAction = z10.object({
1016
1039
  action: z10.literal("voice_session_ended"),
1017
1040
  userId: z10.string(),
@@ -1258,6 +1281,36 @@ var ResearchModeStreamAction = z10.object({
1258
1281
  completionInfo: z10.any().optional()
1259
1282
  }).optional()
1260
1283
  });
1284
+ var CliCompletionChunkAction = z10.object({
1285
+ action: z10.literal("cli_completion_chunk"),
1286
+ requestId: z10.string(),
1287
+ chunk: z10.object({
1288
+ type: z10.enum(["content", "tool_use"]),
1289
+ text: z10.string(),
1290
+ tools: z10.array(z10.unknown()).optional(),
1291
+ usage: z10.object({
1292
+ inputTokens: z10.number().optional(),
1293
+ outputTokens: z10.number().optional()
1294
+ }).optional(),
1295
+ thinking: z10.array(z10.unknown()).optional()
1296
+ })
1297
+ });
1298
+ var CliCompletionDoneAction = z10.object({
1299
+ action: z10.literal("cli_completion_done"),
1300
+ requestId: z10.string()
1301
+ });
1302
+ var CliCompletionErrorAction = z10.object({
1303
+ action: z10.literal("cli_completion_error"),
1304
+ requestId: z10.string(),
1305
+ error: z10.string()
1306
+ });
1307
+ var CliToolResponseAction = z10.object({
1308
+ action: z10.literal("cli_tool_response"),
1309
+ requestId: z10.string(),
1310
+ success: z10.boolean(),
1311
+ content: z10.unknown().optional(),
1312
+ error: z10.string().optional()
1313
+ });
1261
1314
  var SessionCreatedAction = shareableDocumentSchema.extend({
1262
1315
  action: z10.literal("session.created"),
1263
1316
  id: z10.string(),
@@ -1292,7 +1345,9 @@ var MessageDataToServer = z10.discriminatedUnion("action", [
1292
1345
  DataUnsubscribeRequestAction,
1293
1346
  HeartbeatAction,
1294
1347
  VoiceSessionSendTranscriptAction,
1295
- VoiceSessionEndedAction
1348
+ VoiceSessionEndedAction,
1349
+ CliCompletionRequestAction,
1350
+ CliToolRequestAction
1296
1351
  ]);
1297
1352
  var MessageDataToClient = z10.discriminatedUnion("action", [
1298
1353
  DataSubscriptionUpdateAction,
@@ -1314,7 +1369,11 @@ var MessageDataToClient = z10.discriminatedUnion("action", [
1314
1369
  SpiderProgressUpdateAction,
1315
1370
  SpiderCompleteAction,
1316
1371
  SpiderErrorAction,
1317
- SessionCreatedAction
1372
+ SessionCreatedAction,
1373
+ CliCompletionChunkAction,
1374
+ CliCompletionDoneAction,
1375
+ CliCompletionErrorAction,
1376
+ CliToolResponseAction
1318
1377
  ]);
1319
1378
 
1320
1379
  // ../../b4m-core/packages/common/dist/src/schemas/cliCompletions.js
@@ -7926,6 +7985,8 @@ export {
7926
7985
  DataUnsubscribeRequestAction,
7927
7986
  HeartbeatAction,
7928
7987
  VoiceSessionSendTranscriptAction,
7988
+ CliCompletionRequestAction,
7989
+ CliToolRequestAction,
7929
7990
  VoiceSessionEndedAction,
7930
7991
  DataSubscriptionUpdateAction,
7931
7992
  LLMStatusUpdateAction,
@@ -7946,6 +8007,10 @@ export {
7946
8007
  UpdateResearchTaskStatusAction,
7947
8008
  ImportHistoryJobProgressUpdateAction,
7948
8009
  ResearchModeStreamAction,
8010
+ CliCompletionChunkAction,
8011
+ CliCompletionDoneAction,
8012
+ CliCompletionErrorAction,
8013
+ CliToolResponseAction,
7949
8014
  SessionCreatedAction,
7950
8015
  MessageDataToServer,
7951
8016
  MessageDataToClient,
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- DEFAULT_SANDBOX_CONFIG
4
- } from "./chunk-W4TCH4ZT.js";
5
2
 
6
3
  // src/utils/Logger.ts
7
4
  import fs from "fs/promises";
@@ -265,41 +262,6 @@ import path2 from "path";
265
262
  import { homedir } from "os";
266
263
  import { v4 as uuidv4 } from "uuid";
267
264
  import { z } from "zod";
268
- var SandboxFilesystemSchema = z.object({
269
- allowedReadPaths: z.array(z.string()).default(DEFAULT_SANDBOX_CONFIG.filesystem.allowedReadPaths),
270
- deniedPaths: z.array(z.string()).default(DEFAULT_SANDBOX_CONFIG.filesystem.deniedPaths),
271
- writeOnlyToWorkingDir: z.boolean().default(true)
272
- });
273
- var SandboxPlatformSchema = z.object({
274
- linux: z.object({
275
- runtime: z.literal("bubblewrap").default("bubblewrap"),
276
- seccompProfile: z.string().optional()
277
- }).default({ runtime: "bubblewrap" }),
278
- macos: z.object({
279
- runtime: z.literal("seatbelt").default("seatbelt"),
280
- profileTemplate: z.string().default("default")
281
- }).default({ runtime: "seatbelt", profileTemplate: "default" })
282
- });
283
- var SandboxConfigSchema = z.object({
284
- enabled: z.boolean().default(false),
285
- mode: z.enum(["disabled", "auto-allow", "permissions"]).default("disabled"),
286
- filesystem: SandboxFilesystemSchema.default(DEFAULT_SANDBOX_CONFIG.filesystem),
287
- excludedCommands: z.array(z.string()).default(DEFAULT_SANDBOX_CONFIG.excludedCommands),
288
- allowUnsandboxedCommands: z.boolean().default(true),
289
- platform: SandboxPlatformSchema.default(DEFAULT_SANDBOX_CONFIG.platform)
290
- });
291
- var PartialSandboxConfigSchema = z.object({
292
- enabled: z.boolean().optional(),
293
- mode: z.enum(["disabled", "auto-allow", "permissions"]).optional(),
294
- filesystem: z.object({
295
- allowedReadPaths: z.array(z.string()).optional(),
296
- deniedPaths: z.array(z.string()).optional(),
297
- writeOnlyToWorkingDir: z.boolean().optional()
298
- }).optional(),
299
- excludedCommands: z.array(z.string()).optional(),
300
- allowUnsandboxedCommands: z.boolean().optional(),
301
- platform: SandboxPlatformSchema.optional()
302
- }).optional();
303
265
  var AuthTokensSchema = z.object({
304
266
  accessToken: z.string(),
305
267
  refreshToken: z.string(),
@@ -374,8 +336,7 @@ var CliConfigSchema = z.object({
374
336
  disabled: z.array(z.string()),
375
337
  config: z.record(z.any())
376
338
  }),
377
- trustedTools: z.array(z.string()).optional().default([]),
378
- sandbox: SandboxConfigSchema.optional()
339
+ trustedTools: z.array(z.string()).optional().default([])
379
340
  });
380
341
  var ProjectConfigSchema = z.object({
381
342
  tools: z.object({
@@ -393,8 +354,7 @@ var ProjectConfigSchema = z.object({
393
354
  theme: z.enum(["light", "dark"]).optional(),
394
355
  exportFormat: z.enum(["markdown", "json"]).optional(),
395
356
  enableSkillTool: z.boolean().optional()
396
- }).optional(),
397
- sandbox: PartialSandboxConfigSchema
357
+ }).optional()
398
358
  });
399
359
  var ProjectLocalConfigSchema = z.object({
400
360
  trustedTools: z.array(z.string()).optional(),
@@ -411,8 +371,7 @@ var ProjectLocalConfigSchema = z.object({
411
371
  exportFormat: z.enum(["markdown", "json"]).optional(),
412
372
  enableSkillTool: z.boolean().optional()
413
373
  }).optional(),
414
- mcpServers: McpServersSchema.optional(),
415
- sandbox: PartialSandboxConfigSchema
374
+ mcpServers: McpServersSchema.optional()
416
375
  });
417
376
  var DEFAULT_CONFIG = {
418
377
  version: "0.1.0",
@@ -537,21 +496,6 @@ function mergeMcpServers(...serverArrays) {
537
496
  }
538
497
  return Array.from(serverMap.values());
539
498
  }
540
- function mergeSandboxConfig(base, override) {
541
- const resolved = base ?? DEFAULT_SANDBOX_CONFIG;
542
- if (!override) return resolved;
543
- return {
544
- enabled: override.enabled ?? resolved.enabled,
545
- mode: override.mode ?? resolved.mode,
546
- filesystem: {
547
- ...resolved.filesystem,
548
- ...override.filesystem ?? {}
549
- },
550
- excludedCommands: override.excludedCommands ?? resolved.excludedCommands,
551
- allowUnsandboxedCommands: override.allowUnsandboxedCommands ?? resolved.allowUnsandboxedCommands,
552
- platform: override.platform ?? resolved.platform
553
- };
554
- }
555
499
  function mergeConfigs(global, project, local) {
556
500
  const merged = { ...global };
557
501
  if (project) {
@@ -578,9 +522,6 @@ function mergeConfigs(global, project, local) {
578
522
  if (project.mcpServers) {
579
523
  merged.mcpServers = mergeMcpServers(merged.mcpServers, project.mcpServers);
580
524
  }
581
- if (project.sandbox) {
582
- merged.sandbox = mergeSandboxConfig(merged.sandbox, project.sandbox);
583
- }
584
525
  }
585
526
  if (local) {
586
527
  if (local.trustedTools) {
@@ -602,9 +543,6 @@ function mergeConfigs(global, project, local) {
602
543
  if (local.mcpServers) {
603
544
  merged.mcpServers = mergeMcpServers(merged.mcpServers, local.mcpServers);
604
545
  }
605
- if (local.sandbox) {
606
- merged.sandbox = mergeSandboxConfig(merged.sandbox, local.sandbox);
607
- }
608
546
  }
609
547
  return merged;
610
548
  }
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-S7BPPS33.js";
9
+ } from "./chunk-TY6Z2UV2.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-5GSDPBTM.js";
14
+ } from "./chunk-KPOK6V6E.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -15,7 +15,7 @@ import {
15
15
  dayjsConfig_default,
16
16
  extractSnippetMeta,
17
17
  settingsMap
18
- } from "./chunk-5GSDPBTM.js";
18
+ } from "./chunk-KPOK6V6E.js";
19
19
  import {
20
20
  Logger
21
21
  } from "./chunk-OCYRD7D6.js";
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConfigStore
4
- } from "../chunk-JWEG53NG.js";
5
- import "../chunk-W4TCH4ZT.js";
4
+ } from "../chunk-LBTTUQJM.js";
6
5
 
7
6
  // src/commands/mcpCommand.ts
8
7
  async function handleMcpCommand(subcommand, argv) {
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-ELTTBWAQ.js";
6
- import "./chunk-S7BPPS33.js";
7
- import "./chunk-5GSDPBTM.js";
5
+ } from "./chunk-EC2VEDD2.js";
6
+ import "./chunk-TY6Z2UV2.js";
7
+ import "./chunk-KPOK6V6E.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,