@bike4mind/cli 0.2.31-cli-update-command.19453 → 0.2.31-cli-update-command.19494

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-E77VWEKZ.js";
4
+ } from "./chunk-UVOOKS6R.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;
@@ -16,7 +16,7 @@ import {
16
16
  dayjsConfig_default,
17
17
  extractSnippetMeta,
18
18
  settingsMap
19
- } from "./chunk-E77VWEKZ.js";
19
+ } from "./chunk-UVOOKS6R.js";
20
20
  import {
21
21
  Logger
22
22
  } from "./chunk-OCYRD7D6.js";
@@ -12158,6 +12158,59 @@ function buildVoiceInstructions(baseInstructions, historyContext) {
12158
12158
  return `${baseInstructions}${historyContext}`;
12159
12159
  }
12160
12160
 
12161
+ // ../../b4m-core/packages/utils/dist/src/lambdaErrorHandler.js
12162
+ var isRegistered = false;
12163
+ function classifyError(error) {
12164
+ if (error instanceof TypeError) {
12165
+ if (error.message === "terminated" || error.message.includes("fetch failed")) {
12166
+ return "network_terminated";
12167
+ }
12168
+ }
12169
+ if (error instanceof Error) {
12170
+ if (error.name === "AbortError") {
12171
+ return "network_timeout";
12172
+ }
12173
+ const connectionErrors = ["ECONNRESET", "ETIMEDOUT", "ECONNREFUSED", "EPIPE", "ENOTFOUND"];
12174
+ if (connectionErrors.some((code) => error.message.includes(code))) {
12175
+ return "network_connection";
12176
+ }
12177
+ }
12178
+ return "unhandled_rejection";
12179
+ }
12180
+ function buildLogEntry(error, category) {
12181
+ return {
12182
+ error: error instanceof Error ? error.message : String(error),
12183
+ stack: error instanceof Error ? error.stack : void 0,
12184
+ category,
12185
+ functionName: process.env.AWS_LAMBDA_FUNCTION_NAME,
12186
+ stage: process.env.SEED_STAGE_NAME,
12187
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
12188
+ };
12189
+ }
12190
+ function registerLambdaErrorHandlers(logger) {
12191
+ if (isRegistered)
12192
+ return;
12193
+ isRegistered = true;
12194
+ const log = logger || console;
12195
+ process.on("unhandledRejection", (reason) => {
12196
+ const category = classifyError(reason);
12197
+ const isNetworkError = category.startsWith("network_");
12198
+ const logEntry = buildLogEntry(reason, category);
12199
+ if (isNetworkError) {
12200
+ log.warn("[Lambda] Network error (unhandled rejection)", logEntry);
12201
+ } else {
12202
+ log.error("[Lambda] Unhandled promise rejection", logEntry);
12203
+ }
12204
+ });
12205
+ process.on("uncaughtException", (error) => {
12206
+ const logEntry = buildLogEntry(error, "uncaught_exception");
12207
+ log.error("[Lambda] Uncaught exception", logEntry);
12208
+ });
12209
+ }
12210
+ function _resetLambdaErrorHandlers() {
12211
+ isRegistered = false;
12212
+ }
12213
+
12161
12214
  export {
12162
12215
  BaseStorage,
12163
12216
  S3Storage,
@@ -12295,5 +12348,7 @@ export {
12295
12348
  calculateRetryDelay,
12296
12349
  withRetry,
12297
12350
  formatVoiceHistory,
12298
- buildVoiceInstructions
12351
+ buildVoiceInstructions,
12352
+ registerLambdaErrorHandlers,
12353
+ _resetLambdaErrorHandlers
12299
12354
  };
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@bike4mind/cli",
6
- version: "0.2.31-cli-update-command.19453+23feeba8a",
6
+ version: "0.2.31-cli-update-command.19494+9f6c6af33",
7
7
  type: "module",
8
8
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9
9
  license: "UNLICENSED",
@@ -114,10 +114,10 @@ var package_default = {
114
114
  },
115
115
  devDependencies: {
116
116
  "@bike4mind/agents": "0.1.0",
117
- "@bike4mind/common": "2.52.1-cli-update-command.19453+23feeba8a",
118
- "@bike4mind/mcp": "1.31.1-cli-update-command.19453+23feeba8a",
119
- "@bike4mind/services": "2.50.1-cli-update-command.19453+23feeba8a",
120
- "@bike4mind/utils": "2.7.1-cli-update-command.19453+23feeba8a",
117
+ "@bike4mind/common": "2.52.1-cli-update-command.19494+9f6c6af33",
118
+ "@bike4mind/mcp": "1.31.1-cli-update-command.19494+9f6c6af33",
119
+ "@bike4mind/services": "2.50.1-cli-update-command.19494+9f6c6af33",
120
+ "@bike4mind/utils": "2.7.1-cli-update-command.19494+9f6c6af33",
121
121
  "@types/better-sqlite3": "^7.6.13",
122
122
  "@types/diff": "^5.0.9",
123
123
  "@types/jsonwebtoken": "^9.0.4",
@@ -138,7 +138,7 @@ var package_default = {
138
138
  optionalDependencies: {
139
139
  "@vscode/ripgrep": "^1.17.0"
140
140
  },
141
- gitHead: "23feeba8a369f883c1b5ce25e796e554ba5f0c7c"
141
+ gitHead: "9f6c6af332c93ee9f5cd315581c7b8d5acc0f1d8"
142
142
  };
143
143
 
144
144
  // src/utils/updateChecker.ts
@@ -7,11 +7,11 @@ import {
7
7
  getSettingsMap,
8
8
  getSettingsValue,
9
9
  secureParameters
10
- } from "./chunk-24JZFYBV.js";
10
+ } from "./chunk-3LGHTME3.js";
11
11
  import {
12
12
  KnowledgeType,
13
13
  SupportedFabFileMimeTypes
14
- } from "./chunk-E77VWEKZ.js";
14
+ } from "./chunk-UVOOKS6R.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/fabFileService/create.js
17
17
  import { z } from "zod";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  BadRequestError,
4
4
  secureParameters
5
- } from "./chunk-24JZFYBV.js";
5
+ } from "./chunk-3LGHTME3.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-E77VWEKZ.js";
15
+ } from "./chunk-UVOOKS6R.js";
16
16
 
17
17
  // ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
18
18
  import { z } from "zod";
@@ -6,12 +6,12 @@ import {
6
6
  getSettingsByNames,
7
7
  obfuscateApiKey,
8
8
  secureParameters
9
- } from "./chunk-24JZFYBV.js";
9
+ } from "./chunk-3LGHTME3.js";
10
10
  import {
11
11
  ApiKeyType,
12
12
  MementoTier,
13
13
  isSupportedEmbeddingModel
14
- } from "./chunk-E77VWEKZ.js";
14
+ } from "./chunk-UVOOKS6R.js";
15
15
 
16
16
  // ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
17
17
  import { z } from "zod";
@@ -1217,6 +1217,29 @@ var VoiceSessionSendTranscriptAction = z10.object({
1217
1217
  conversationItemId: z10.string(),
1218
1218
  timestamp: z10.coerce.date().optional()
1219
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
+ });
1220
1243
  var VoiceSessionEndedAction = z10.object({
1221
1244
  action: z10.literal("voice_session_ended"),
1222
1245
  userId: z10.string(),
@@ -1505,6 +1528,36 @@ var VoiceCreditsExhaustedAction = z10.object({
1505
1528
  creditsUsed: z10.number(),
1506
1529
  clientId: z10.string().optional()
1507
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
+ });
1508
1561
  var SessionCreatedAction = shareableDocumentSchema.extend({
1509
1562
  action: z10.literal("session.created"),
1510
1563
  id: z10.string(),
@@ -1539,7 +1592,9 @@ var MessageDataToServer = z10.discriminatedUnion("action", [
1539
1592
  DataUnsubscribeRequestAction,
1540
1593
  HeartbeatAction,
1541
1594
  VoiceSessionSendTranscriptAction,
1542
- VoiceSessionEndedAction
1595
+ VoiceSessionEndedAction,
1596
+ CliCompletionRequestAction,
1597
+ CliToolRequestAction
1543
1598
  ]);
1544
1599
  var MessageDataToClient = z10.discriminatedUnion("action", [
1545
1600
  DataSubscriptionUpdateAction,
@@ -1565,7 +1620,11 @@ var MessageDataToClient = z10.discriminatedUnion("action", [
1565
1620
  PiHistoryCompleteAction,
1566
1621
  PiHistoryErrorAction,
1567
1622
  SessionCreatedAction,
1568
- VoiceCreditsExhaustedAction
1623
+ VoiceCreditsExhaustedAction,
1624
+ CliCompletionChunkAction,
1625
+ CliCompletionDoneAction,
1626
+ CliCompletionErrorAction,
1627
+ CliToolResponseAction
1569
1628
  ]);
1570
1629
 
1571
1630
  // ../../b4m-core/packages/common/dist/src/schemas/cliCompletions.js
@@ -2449,6 +2508,8 @@ var SettingKeySchema = z21.enum([
2449
2508
  "githubMcpClientSecret",
2450
2509
  "atlassianClientId",
2451
2510
  "atlassianClientSecret",
2511
+ "qWorkUrl",
2512
+ "qWorkToken",
2452
2513
  // BRANDING RELATED SETTINGS
2453
2514
  "FacebookLink",
2454
2515
  "RedditLink",
@@ -2877,6 +2938,16 @@ var API_SERVICE_GROUPS = {
2877
2938
  { key: "atlassianClientSecret", order: 5 }
2878
2939
  ]
2879
2940
  },
2941
+ Q_WORK: {
2942
+ id: "qWorkAPIService",
2943
+ name: "Q/Work",
2944
+ description: "Q/Work integration settings",
2945
+ icon: "Handyman",
2946
+ settings: [
2947
+ { key: "qWorkUrl", order: 1 },
2948
+ { key: "qWorkToken", order: 2 }
2949
+ ]
2950
+ },
2880
2951
  SEARCH: {
2881
2952
  id: "searchAPIService",
2882
2953
  name: "Search Service",
@@ -3760,6 +3831,25 @@ var settingsMap = {
3760
3831
  order: 5,
3761
3832
  isSensitive: true
3762
3833
  }),
3834
+ qWorkUrl: makeStringSetting({
3835
+ key: "qWorkUrl",
3836
+ name: "Q/Work URL",
3837
+ defaultValue: "",
3838
+ description: "The base URL for the Q/Work API (for example: https://q.bike4mind.com).",
3839
+ category: "Tools",
3840
+ group: API_SERVICE_GROUPS.Q_WORK.id,
3841
+ order: 1
3842
+ }),
3843
+ qWorkToken: makeStringSetting({
3844
+ key: "qWorkToken",
3845
+ name: "Q/Work Token",
3846
+ defaultValue: "",
3847
+ description: "The bearer token used to authenticate requests to Q/Work.",
3848
+ category: "Tools",
3849
+ group: API_SERVICE_GROUPS.Q_WORK.id,
3850
+ order: 2,
3851
+ isSensitive: true
3852
+ }),
3763
3853
  EnableOllama: makeBooleanSetting({
3764
3854
  key: "EnableOllama",
3765
3855
  name: "Enable Ollama",
@@ -4143,12 +4233,12 @@ var settingsMap = {
4143
4233
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
4144
4234
  order: 18
4145
4235
  }),
4146
- // Optimization Canvasser Settings
4236
+ // OptiHashi Settings
4147
4237
  EnableQuantumCanvasser: makeBooleanSetting({
4148
4238
  key: "EnableQuantumCanvasser",
4149
- name: "Enable Optimization Canvasser",
4239
+ name: "Enable OptiHashi",
4150
4240
  defaultValue: false,
4151
- description: "Enable the Optimization Canvasser module for AI-driven optimization across classical and quantum solvers.",
4241
+ description: "Enable OptiHashi, the quantum optimizer module for AI-driven optimization across classical and quantum solvers.",
4152
4242
  category: "Experimental",
4153
4243
  group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
4154
4244
  order: 18
@@ -9340,12 +9430,12 @@ var SSE_DONE_SIGNAL = "data: [DONE]\n\n";
9340
9430
 
9341
9431
  // ../../b4m-core/packages/common/dist/src/navigation/viewRegistry.js
9342
9432
  var VIEW_REGISTRY = [
9343
- // ── Opti (Optimization Canvasser) ──────────────────────────────────────
9433
+ // ── OptiHashi (Quantum Optimizer) ──────────────────────────────────────
9344
9434
  {
9345
9435
  id: "opti.root",
9346
9436
  section: "opti",
9347
- label: "Optimization Home",
9348
- description: "The Optimization Canvasser landing page showing all 8 pattern family cards",
9437
+ label: "OptiHashi Home",
9438
+ description: "The OptiHashi Quantum Optimizer landing page showing all 8 pattern family cards",
9349
9439
  navigationType: "route",
9350
9440
  target: "/opti",
9351
9441
  keywords: ["optimization", "canvasser", "home", "patterns", "families"]
@@ -9413,13 +9503,13 @@ var VIEW_REGISTRY = [
9413
9503
  keywords: ["gantt", "chart", "visualization", "timeline", "schedule view"]
9414
9504
  },
9415
9505
  {
9416
- id: "opti.scheduling.qportal",
9506
+ id: "opti.scheduling.qwork",
9417
9507
  section: "opti",
9418
- label: "Q-Portal",
9419
- description: "Submit scheduling problems to quantum hardware via Q-Portal",
9508
+ label: "Q/Work",
9509
+ description: "View quantum job history and status from Q/Work",
9420
9510
  navigationType: "action",
9421
- target: "scheduling.qportal",
9422
- keywords: ["quantum", "q-portal", "hardware", "quantum computer", "submit", "quantum annealing"]
9511
+ target: "scheduling.qwork",
9512
+ keywords: ["quantum", "q/work", "qwork", "hardware", "quantum computer", "jobs", "status", "history"]
9423
9513
  },
9424
9514
  {
9425
9515
  id: "opti.routing",
@@ -10151,6 +10241,8 @@ export {
10151
10241
  DataUnsubscribeRequestAction,
10152
10242
  HeartbeatAction,
10153
10243
  VoiceSessionSendTranscriptAction,
10244
+ CliCompletionRequestAction,
10245
+ CliToolRequestAction,
10154
10246
  VoiceSessionEndedAction,
10155
10247
  DataSubscriptionUpdateAction,
10156
10248
  LLMStatusUpdateAction,
@@ -10175,6 +10267,10 @@ export {
10175
10267
  ImportHistoryJobProgressUpdateAction,
10176
10268
  ResearchModeStreamAction,
10177
10269
  VoiceCreditsExhaustedAction,
10270
+ CliCompletionChunkAction,
10271
+ CliCompletionDoneAction,
10272
+ CliCompletionErrorAction,
10273
+ CliToolResponseAction,
10178
10274
  SessionCreatedAction,
10179
10275
  MessageDataToServer,
10180
10276
  MessageDataToClient,
@@ -3,7 +3,7 @@ import {
3
3
  fetchLatestVersion,
4
4
  forceCheckForUpdate,
5
5
  package_default
6
- } from "../chunk-Q6YCIGC3.js";
6
+ } from "../chunk-4G6Y7DHE.js";
7
7
 
8
8
  // src/commands/doctorCommand.ts
9
9
  import { execSync } from "child_process";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  forceCheckForUpdate,
4
4
  package_default
5
- } from "../chunk-Q6YCIGC3.js";
5
+ } from "../chunk-4G6Y7DHE.js";
6
6
 
7
7
  // src/commands/updateCommand.ts
8
8
  import { execSync } from "child_process";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createFabFile,
4
4
  createFabFileSchema
5
- } from "./chunk-U4HDDXWT.js";
6
- import "./chunk-24JZFYBV.js";
7
- import "./chunk-E77VWEKZ.js";
5
+ } from "./chunk-E6SLQJIU.js";
6
+ import "./chunk-3LGHTME3.js";
7
+ import "./chunk-UVOOKS6R.js";
8
8
  import "./chunk-OCYRD7D6.js";
9
9
  export {
10
10
  createFabFile,