@bike4mind/cli 0.2.31-fix-session-context-comingling.19434 → 0.2.31-fix-cli-ws-review-feedback.19473

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  HydrationEngine,
4
4
  createHydrationEngine
5
- } from "./chunk-RUI6HNLO.js";
5
+ } from "./chunk-GQGOWACU.js";
6
6
  export {
7
7
  HydrationEngine,
8
8
  createHydrationEngine
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CurationArtifactType
4
- } from "./chunk-N4G2MB3M.js";
4
+ } from "./chunk-2HFZJMGD.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;
@@ -326,6 +326,8 @@ var b4mLLMTools = z5.enum([
326
326
  // Knowledge base search
327
327
  "search_knowledge_base",
328
328
  "retrieve_knowledge_content",
329
+ // Agent delegation
330
+ "delegate_to_agent",
329
331
  // Quantum optimization tools
330
332
  "quantum_schedule",
331
333
  "quantum_formulate",
@@ -1215,6 +1217,29 @@ var VoiceSessionSendTranscriptAction = z10.object({
1215
1217
  conversationItemId: z10.string(),
1216
1218
  timestamp: z10.coerce.date().optional()
1217
1219
  });
1220
+ var CliCompletionRequestAction = z10.object({
1221
+ action: z10.literal("cli_completion_request"),
1222
+ accessToken: z10.string(),
1223
+ requestId: z10.string().uuid(),
1224
+ model: z10.string(),
1225
+ messages: z10.array(z10.object({
1226
+ role: z10.enum(["user", "assistant", "system"]),
1227
+ content: z10.union([z10.string(), z10.array(z10.unknown())])
1228
+ })),
1229
+ options: z10.object({
1230
+ temperature: z10.number().optional(),
1231
+ maxTokens: z10.number().optional(),
1232
+ stream: z10.boolean().optional(),
1233
+ tools: z10.array(z10.unknown()).optional()
1234
+ }).optional()
1235
+ });
1236
+ var CliToolRequestAction = z10.object({
1237
+ action: z10.literal("cli_tool_request"),
1238
+ accessToken: z10.string(),
1239
+ requestId: z10.string().uuid(),
1240
+ toolName: z10.string(),
1241
+ input: z10.record(z10.unknown())
1242
+ });
1218
1243
  var VoiceSessionEndedAction = z10.object({
1219
1244
  action: z10.literal("voice_session_ended"),
1220
1245
  userId: z10.string(),
@@ -1503,6 +1528,36 @@ var VoiceCreditsExhaustedAction = z10.object({
1503
1528
  creditsUsed: z10.number(),
1504
1529
  clientId: z10.string().optional()
1505
1530
  });
1531
+ var CliCompletionChunkAction = z10.object({
1532
+ action: z10.literal("cli_completion_chunk"),
1533
+ requestId: z10.string(),
1534
+ chunk: z10.object({
1535
+ type: z10.enum(["content", "tool_use"]),
1536
+ text: z10.string(),
1537
+ tools: z10.array(z10.unknown()).optional(),
1538
+ usage: z10.object({
1539
+ inputTokens: z10.number().optional(),
1540
+ outputTokens: z10.number().optional()
1541
+ }).optional(),
1542
+ thinking: z10.array(z10.unknown()).optional()
1543
+ })
1544
+ });
1545
+ var CliCompletionDoneAction = z10.object({
1546
+ action: z10.literal("cli_completion_done"),
1547
+ requestId: z10.string()
1548
+ });
1549
+ var CliCompletionErrorAction = z10.object({
1550
+ action: z10.literal("cli_completion_error"),
1551
+ requestId: z10.string(),
1552
+ error: z10.string()
1553
+ });
1554
+ var CliToolResponseAction = z10.object({
1555
+ action: z10.literal("cli_tool_response"),
1556
+ requestId: z10.string(),
1557
+ success: z10.boolean(),
1558
+ content: z10.unknown().optional(),
1559
+ error: z10.string().optional()
1560
+ });
1506
1561
  var SessionCreatedAction = shareableDocumentSchema.extend({
1507
1562
  action: z10.literal("session.created"),
1508
1563
  id: z10.string(),
@@ -1537,7 +1592,9 @@ var MessageDataToServer = z10.discriminatedUnion("action", [
1537
1592
  DataUnsubscribeRequestAction,
1538
1593
  HeartbeatAction,
1539
1594
  VoiceSessionSendTranscriptAction,
1540
- VoiceSessionEndedAction
1595
+ VoiceSessionEndedAction,
1596
+ CliCompletionRequestAction,
1597
+ CliToolRequestAction
1541
1598
  ]);
1542
1599
  var MessageDataToClient = z10.discriminatedUnion("action", [
1543
1600
  DataSubscriptionUpdateAction,
@@ -1563,7 +1620,11 @@ var MessageDataToClient = z10.discriminatedUnion("action", [
1563
1620
  PiHistoryCompleteAction,
1564
1621
  PiHistoryErrorAction,
1565
1622
  SessionCreatedAction,
1566
- VoiceCreditsExhaustedAction
1623
+ VoiceCreditsExhaustedAction,
1624
+ CliCompletionChunkAction,
1625
+ CliCompletionDoneAction,
1626
+ CliCompletionErrorAction,
1627
+ CliToolResponseAction
1567
1628
  ]);
1568
1629
 
1569
1630
  // ../../b4m-core/packages/common/dist/src/schemas/cliCompletions.js
@@ -9373,7 +9434,16 @@ var VIEW_REGISTRY = [
9373
9434
  description: "Configure which solvers to race \u2014 greedy, simulated annealing, tabu search, genetic algorithm, ant colony",
9374
9435
  navigationType: "action",
9375
9436
  target: "scheduling.solvers",
9376
- keywords: ["solvers", "tabu", "simulated annealing", "genetic algorithm", "ant colony", "greedy", "solver race", "configure solvers"]
9437
+ keywords: [
9438
+ "solvers",
9439
+ "tabu",
9440
+ "simulated annealing",
9441
+ "genetic algorithm",
9442
+ "ant colony",
9443
+ "greedy",
9444
+ "solver race",
9445
+ "configure solvers"
9446
+ ]
9377
9447
  },
9378
9448
  {
9379
9449
  id: "opti.scheduling.results",
@@ -9382,7 +9452,15 @@ var VIEW_REGISTRY = [
9382
9452
  description: "View solver race results \u2014 progress, best schedule, makespan comparison, utilization",
9383
9453
  navigationType: "action",
9384
9454
  target: "scheduling.results",
9385
- keywords: ["results", "race results", "makespan", "comparison", "best schedule", "utilization", "solver comparison"]
9455
+ keywords: [
9456
+ "results",
9457
+ "race results",
9458
+ "makespan",
9459
+ "comparison",
9460
+ "best schedule",
9461
+ "utilization",
9462
+ "solver comparison"
9463
+ ]
9386
9464
  },
9387
9465
  {
9388
9466
  id: "opti.scheduling.gantt",
@@ -10132,6 +10210,8 @@ export {
10132
10210
  DataUnsubscribeRequestAction,
10133
10211
  HeartbeatAction,
10134
10212
  VoiceSessionSendTranscriptAction,
10213
+ CliCompletionRequestAction,
10214
+ CliToolRequestAction,
10135
10215
  VoiceSessionEndedAction,
10136
10216
  DataSubscriptionUpdateAction,
10137
10217
  LLMStatusUpdateAction,
@@ -10156,6 +10236,10 @@ export {
10156
10236
  ImportHistoryJobProgressUpdateAction,
10157
10237
  ResearchModeStreamAction,
10158
10238
  VoiceCreditsExhaustedAction,
10239
+ CliCompletionChunkAction,
10240
+ CliCompletionDoneAction,
10241
+ CliCompletionErrorAction,
10242
+ CliToolResponseAction,
10159
10243
  SessionCreatedAction,
10160
10244
  MessageDataToServer,
10161
10245
  MessageDataToClient,
@@ -595,12 +595,13 @@ var HydrationEngine = class {
595
595
  return numericInputs[0] / numericInputs[1];
596
596
  case "ABS":
597
597
  return numericInputs.length > 0 ? Math.abs(numericInputs[0]) : 0;
598
- case "ROUND":
598
+ case "ROUND": {
599
599
  if (numericInputs.length === 0)
600
600
  return 0;
601
601
  const decimals = numericInputs[1] ?? 0;
602
602
  const factor = Math.pow(10, decimals);
603
603
  return Math.round(numericInputs[0] * factor) / factor;
604
+ }
604
605
  case "FLOOR":
605
606
  return numericInputs.length > 0 ? Math.floor(numericInputs[0]) : 0;
606
607
  case "CEIL":
@@ -624,12 +625,13 @@ var HydrationEngine = class {
624
625
  return numericInputs.length > 0 ? Math.max(...numericInputs) : 0;
625
626
  case "COUNT":
626
627
  return inputs.filter((v) => v !== null).length;
627
- case "MEDIAN":
628
+ case "MEDIAN": {
628
629
  if (numericInputs.length === 0)
629
630
  return 0;
630
631
  const sorted = [...numericInputs].sort((a, b) => a - b);
631
632
  const mid = Math.floor(sorted.length / 2);
632
633
  return sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
634
+ }
633
635
  // Logical
634
636
  case "IF":
635
637
  return inputs[0] ? inputs[1] : inputs[2];
@@ -649,13 +651,14 @@ var HydrationEngine = class {
649
651
  return inputs.length >= 2 && inputs[0] >= inputs[1];
650
652
  case "LESS_THAN_OR_EQUAL":
651
653
  return inputs.length >= 2 && inputs[0] <= inputs[1];
652
- case "BETWEEN":
654
+ case "BETWEEN": {
653
655
  if (inputs.length < 3)
654
656
  return false;
655
657
  const val = inputs[0];
656
658
  const min = inputs[1];
657
659
  const max = inputs[2];
658
660
  return val >= min && val <= max;
661
+ }
659
662
  // Financial
660
663
  case "PERCENT_OF":
661
664
  if (numericInputs.length < 2 || numericInputs[1] === 0)
@@ -714,11 +717,12 @@ var HydrationEngine = class {
714
717
  case "REFERENCE":
715
718
  return inputs[0];
716
719
  // Pass through
717
- case "LOOKUP":
720
+ case "LOOKUP": {
718
721
  if (inputs.length < 2)
719
722
  return null;
720
723
  const index = inputs[0];
721
724
  return inputs[Math.min(index + 1, inputs.length - 1)];
725
+ }
722
726
  default:
723
727
  context.errors.push({
724
728
  type: "INVALID_OPERATION",
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-GGGK7ASE.js";
10
+ } from "./chunk-SYJA4DXH.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-N4G2MB3M.js";
14
+ } from "./chunk-2HFZJMGD.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-GGGK7ASE.js";
9
+ } from "./chunk-SYJA4DXH.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-N4G2MB3M.js";
14
+ } from "./chunk-2HFZJMGD.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-N4G2MB3M.js";
19
+ } from "./chunk-2HFZJMGD.js";
20
20
  import {
21
21
  Logger
22
22
  } from "./chunk-OCYRD7D6.js";
@@ -11757,6 +11757,9 @@ function findAutomaticFallback(originalModel, availableModels, apiKeyTable, logg
11757
11757
  "gemini-2.5-flash-preview-05-20": ["claude-3-5-haiku-20241022", "gpt-4o-mini", "claude-3-haiku-20240307"],
11758
11758
  "gemini-1.5-pro": ["claude-3-5-sonnet-20241022", "gpt-4o", "claude-3-opus-20240229"],
11759
11759
  "gemini-1.5-flash": ["claude-3-5-haiku-20241022", "gpt-4o-mini", "claude-3-haiku-20240307"],
11760
+ // Claude 4.5/4.6 Opus models fallback to Sonnet 4.5
11761
+ "claude-opus-4-5-20251101": ["claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001"],
11762
+ "claude-opus-4-6": ["claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001"],
11760
11763
  // Claude models fallback to other Claude models or GPT
11761
11764
  "claude-3-5-sonnet-20241022": ["claude-3-opus-20240229", "gpt-4o", "claude-3-sonnet-20240229"],
11762
11765
  "claude-3-opus-20240229": ["claude-3-5-sonnet-20241022", "gpt-4o", "claude-3-sonnet-20240229"],
@@ -11766,7 +11769,7 @@ function findAutomaticFallback(originalModel, availableModels, apiKeyTable, logg
11766
11769
  };
11767
11770
  const preferences = fallbackPreferences[originalModel.id] || [];
11768
11771
  if (preferences.length === 0) {
11769
- preferences.push("claude-3-5-sonnet-20241022", "gpt-4o", "claude-3-haiku-20240307");
11772
+ preferences.push("claude-sonnet-4-5-20250929", "gpt-5", "claude-haiku-4-5-20251001");
11770
11773
  }
11771
11774
  for (const modelId of preferences) {
11772
11775
  const fallbackModel = availableModels.find((m) => m.id === modelId);
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-GGGK7ASE.js";
5
+ } from "./chunk-SYJA4DXH.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-N4G2MB3M.js";
15
+ } from "./chunk-2HFZJMGD.js";
16
16
 
17
17
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
18
18
  import { z } from "zod";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-L2Q5ZSRV.js";
6
- import "./chunk-GGGK7ASE.js";
7
- import "./chunk-N4G2MB3M.js";
5
+ } from "./chunk-NIWN4JNK.js";
6
+ import "./chunk-SYJA4DXH.js";
7
+ import "./chunk-2HFZJMGD.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,