@bike4mind/cli 0.10.2 → 0.10.3

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.
@@ -8408,6 +8408,39 @@ function sanitizeTelemetryError(error, maxLength = MAX_ERROR_LENGTH) {
8408
8408
  if (sanitized.length > maxLength) sanitized = sanitized.substring(0, maxLength - 3) + "...";
8409
8409
  return sanitized;
8410
8410
  }
8411
+ /**
8412
+ * Trigger-word validation, shared between client form and server agent
8413
+ * endpoints so the validation rules can't drift.
8414
+ *
8415
+ * Rules (GitHub-handle style):
8416
+ * - Must start with `@`
8417
+ * - Followed by 1–31 chars of alphanumeric, hyphens, or underscores
8418
+ * - May not start or end with a hyphen
8419
+ * - Total length 2–32 chars (including the `@`)
8420
+ *
8421
+ * Why these rules: the chat-side mention parser (`detectAgentMentions`)
8422
+ * matches `[a-zA-Z0-9_](?:[a-zA-Z0-9_-]*[a-zA-Z0-9_])?`. Any trigger word
8423
+ * the agent form lets through but the parser can't read is a silent
8424
+ * routing failure with no user feedback. Validating at save time closes
8425
+ * that gap.
8426
+ */
8427
+ const TRIGGER_WORD_BODY = /^[a-zA-Z0-9_](?:[a-zA-Z0-9_-]{0,30}[a-zA-Z0-9_])?$/;
8428
+ const TRIGGER_WORD_ERROR_MESSAGE = "Trigger words must start with @ followed by 1–31 letters, numbers, underscores, or hyphens, and may not start or end with a hyphen.";
8429
+ /**
8430
+ * Validate a single trigger word (the full `@handle` form).
8431
+ */
8432
+ const triggerWordSchema = z.string().min(2, TRIGGER_WORD_ERROR_MESSAGE).max(32, TRIGGER_WORD_ERROR_MESSAGE).refine((value) => value.startsWith("@") && TRIGGER_WORD_BODY.test(value.slice(1)), TRIGGER_WORD_ERROR_MESSAGE);
8433
+ z.array(triggerWordSchema).max(20, "Up to 20 trigger words allowed.").transform((words) => {
8434
+ const seen = /* @__PURE__ */ new Set();
8435
+ const out = [];
8436
+ for (const word of words) {
8437
+ const key = word.toLowerCase();
8438
+ if (seen.has(key)) continue;
8439
+ seen.add(key);
8440
+ out.push(word);
8441
+ }
8442
+ return out;
8443
+ });
8411
8444
  const VIEW_REGISTRY = [
8412
8445
  {
8413
8446
  id: "opti.root",
@@ -9324,6 +9357,10 @@ const VIEW_REGISTRY = [
9324
9357
  function getViewById(viewId) {
9325
9358
  return VIEW_REGISTRY.find((v) => v.id === viewId);
9326
9359
  }
9360
+ Array.from(new Set(VIEW_REGISTRY.filter((v) => v.navigationType === "route" && v.target.startsWith("/") && v.target !== "/").map((v) => {
9361
+ const [, top] = v.target.split("/");
9362
+ return `/${top}`;
9363
+ })));
9327
9364
  /**
9328
9365
  * Resolve an array of viewIds + reasons into hydrated NavigationIntents.
9329
9366
  * Skips unknown IDs and respects admin filtering.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-BX6XcTa1.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-tjtx9TU6.mjs";
3
3
  //#region src/commands/apiCommand.ts
4
4
  /**
5
5
  * External API config command (--api-url / --reset-api)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-DdgysXM8.mjs";
2
+ import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-CS84T-KX.mjs";
3
3
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
4
4
  import { execSync } from "child_process";
5
5
  import { constants, existsSync, promises } from "fs";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { $ as SessionStore, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, J as isReadOnlyTool, K as buildSystemPrompt, M as loadContextFiles, N as getApiUrl, O as McpManager, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as CustomCommandStore, Y as ReActAgent, Z as CheckpointStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-t-9dtjjl.mjs";
3
- import { n as logger, t as ConfigStore } from "../ConfigStore-BX6XcTa1.mjs";
2
+ import { $ as SessionStore, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, I as generateCliTools, J as isReadOnlyTool, K as buildSystemPrompt, M as loadContextFiles, N as getApiUrl, O as McpManager, S as ApiClient, T as FallbackLlmBackend, W as setWebSocketToolExecutor, X as CustomCommandStore, Y as ReActAgent, Z as CheckpointStore, _ as createAgentDelegateTool, b as createSkillTool, d as createFindDefinitionTool, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, m as createCoordinateTaskTool, p as createWriteTodosTool, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, y as SubagentOrchestrator } from "../tools-DyWEu4_d.mjs";
3
+ import { n as logger, t as ConfigStore } from "../ConfigStore-tjtx9TU6.mjs";
4
4
  import { t as DEFAULT_SANDBOX_CONFIG } from "../types-LyRNHOiS.mjs";
5
5
  import { t as createSandboxRuntime } from "../SandboxRuntimeAdapter-ChGlxSGQ.mjs";
6
6
  import { t as SandboxOrchestrator } from "../SandboxOrchestrator-BoINxbX4.mjs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as ConfigStore } from "../ConfigStore-BX6XcTa1.mjs";
2
+ import { t as ConfigStore } from "../ConfigStore-tjtx9TU6.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-DdgysXM8.mjs";
2
+ import { a as version, i as forceCheckForUpdate } from "../updateChecker-CS84T-KX.mjs";
3
3
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
4
4
  import { execSync } from "child_process";
5
5
  //#region src/commands/updateCommand.ts
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { $ as SessionStore, A as formatStep, B as DEFAULT_RETRY_CONFIG, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, G as getPlanModeFilePath, H as clearFeatureModuleTools, I as generateCliTools, J as isReadOnlyTool, K as buildSystemPrompt, L as ALWAYS_DENIED_FOR_AGENTS, M as loadContextFiles, N as getApiUrl, O as McpManager, P as getEnvironmentName, Q as CommandHistoryStore, R as DEFAULT_AGENT_MODEL, S as ApiClient, T as FallbackLlmBackend, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as CustomCommandStore, Y as ReActAgent, Z as CheckpointStore, _ as createAgentDelegateTool, a as createBlockerTools, at as formatFileSize, b as createSkillTool, c as createDecisionStore, d as createFindDefinitionTool, et as OAuthClient, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, i as createBlockerStore, it as mergeCommands, j as extractCompactInstructions, k as substituteArguments, l as formatDecisionsOutput, m as createCoordinateTaskTool, n as createReviewGateTool, nt as processFileReferences, o as formatBlockersOutput, ot as searchFiles, p as createWriteTodosTool, q as buildSkillsPromptSection, r as formatReviewGatesOutput, rt as searchCommands, s as createDecisionLogTool, st as warmFileCache, t as createReviewGateStore, tt as hasFileReferences, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, x as parseAgentConfig, y as SubagentOrchestrator, z as DEFAULT_MAX_ITERATIONS } from "./tools-t-9dtjjl.mjs";
2
+ import { $ as SessionStore, A as formatStep, B as DEFAULT_RETRY_CONFIG, C as WebSocketToolExecutor, D as ServerLlmBackend, E as WebSocketLlmBackend, F as PermissionManager, G as getPlanModeFilePath, H as clearFeatureModuleTools, I as generateCliTools, J as isReadOnlyTool, K as buildSystemPrompt, L as ALWAYS_DENIED_FOR_AGENTS, M as loadContextFiles, N as getApiUrl, O as McpManager, P as getEnvironmentName, Q as CommandHistoryStore, R as DEFAULT_AGENT_MODEL, S as ApiClient, T as FallbackLlmBackend, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as CustomCommandStore, Y as ReActAgent, Z as CheckpointStore, _ as createAgentDelegateTool, a as createBlockerTools, at as formatFileSize, b as createSkillTool, c as createDecisionStore, d as createFindDefinitionTool, et as OAuthClient, f as createTodoStore, g as BackgroundAgentManager, h as createBackgroundAgentTools, i as createBlockerStore, it as mergeCommands, j as extractCompactInstructions, k as substituteArguments, l as formatDecisionsOutput, m as createCoordinateTaskTool, n as createReviewGateTool, nt as processFileReferences, o as formatBlockersOutput, ot as searchFiles, p as createWriteTodosTool, q as buildSkillsPromptSection, r as formatReviewGatesOutput, rt as searchCommands, s as createDecisionLogTool, st as warmFileCache, t as createReviewGateStore, tt as hasFileReferences, u as createGetFileStructureTool, v as AgentStore, w as WebSocketConnectionManager, x as parseAgentConfig, y as SubagentOrchestrator, z as DEFAULT_MAX_ITERATIONS } from "./tools-DyWEu4_d.mjs";
3
3
  import { n as useCliStore, t as selectActiveBackgroundAgents } from "./store-DV5s-qni.mjs";
4
- import { Ht as validateNotebookPath$1, Vt as validateJupyterKernelName, g as ChatModels, m as CREDIT_DEDUCT_TRANSACTION_TYPES, n as logger, t as ConfigStore } from "./ConfigStore-BX6XcTa1.mjs";
5
- import { a as version, t as checkForUpdate } from "./updateChecker-DdgysXM8.mjs";
4
+ import { Ht as validateNotebookPath$1, Vt as validateJupyterKernelName, g as ChatModels, m as CREDIT_DEDUCT_TRANSACTION_TYPES, n as logger, t as ConfigStore } from "./ConfigStore-tjtx9TU6.mjs";
5
+ import { a as version, t as checkForUpdate } from "./updateChecker-CS84T-KX.mjs";
6
6
  import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
7
7
  import { Box, Static, Text, render, useApp, useInput, usePaste, useStdout } from "ink";
8
8
  import { execSync } from "child_process";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as PromptMetaZodSchema, A as GenericCreditDeductTransaction, At as getDataLakeTags, B as KnowledgeType, Bt as settingsMap, C as FeedbackEvents, Ct as VIDEO_SIZE_CONSTRAINTS, D as GEMINI_IMAGE_MODELS, Dt as b4mLLMTools, E as FriendshipEvents, Et as XAI_IMAGE_MODELS, F as ImageModels, Ft as isZodError, G as NotFoundError, Gt as isNearLimit, H as MiscEvents, I as InboxEvents, It as obfuscateApiKey, J as Permission, K as OpenAIEmbeddingModel, Kt as parseRateLimitHeaders, L as InternalServerError, Lt as resolveNavigationIntents, M as HttpStatus, Mt as getViewById, N as ImageEditUsageTransaction, Nt as isGPTImage2Model, O as GenerateImageToolCallSchema, Ot as dayjsConfig_default, P as ImageGenerationUsageTransaction, Pt as isGPTImageModel, Q as PromptIntentSchema, R as InviteEvents, Rt as sanitizeTelemetryError, S as FavoriteDocumentType, St as UnprocessableEntityError, T as ForbiddenError, Tt as VideoModels, U as ModalEvents, Ut as buildRateLimitLogEntry, V as LLMEvents, W as ModelBackend, Wt as extractSnippetMeta, X as ProfileEvents, Y as PermissionDeniedError, Z as ProjectEvents, _ as ClaudeArtifactMimeTypes, _t as TooManyRequestsError, a as ApiKeyEvents, at as RegInviteEvents, b as DashboardParamsSchema, bt as UiNavigationEvents, c as AppFileEvents, ct as ResearchTaskPeriodicFrequencyType, d as BFL_IMAGE_MODELS, dt as SpeechToTextUsageTransaction, et as PurchaseTransaction, f as BFL_SAFETY_TOLERANCE, ft as SubscriptionCreditTransaction, g as ChatModels, gt as TextGenerationUsageTransaction, h as ChatCompletionCreateInputSchema, ht as TaskScheduleHandler, i as AiEvents, it as RechartsChartTypeList, j as HTTPError, jt as getMcpProviderMetadata, k as GenericCreditAddTransaction, kt as getAccessibleDataLakes, l as ArtifactTypeSchema, lt as ResearchTaskType, mt as TagType, n as logger, nt as RealtimeVoiceUsageTransaction, o as ApiKeyScope, ot as ResearchModeParamsSchema, p as BadRequestError, pt as SupportedFabFileMimeTypes, q as OpenAIImageGenerationInput, qt as CollectionType, r as ALERT_THRESHOLDS, rt as ReceivedCreditTransaction, s as ApiKeyType, st as ResearchTaskExecutionType, t as ConfigStore, tt as QuestMasterParamsSchema, u as AuthEvents, ut as SessionEvents, v as CompletionApiUsageTransaction, vt as ToolUsageTransaction, w as FileEvents, wt as VideoGenerationUsageTransaction, x as ElabsEvents, xt as UnauthorizedError, y as CorruptedFileError, yt as TransferCreditTransaction, z as InviteType, zt as secureParameters } from "./ConfigStore-BX6XcTa1.mjs";
2
+ import { $ as PromptMetaZodSchema, A as GenericCreditDeductTransaction, At as getDataLakeTags, B as KnowledgeType, Bt as settingsMap, C as FeedbackEvents, Ct as VIDEO_SIZE_CONSTRAINTS, D as GEMINI_IMAGE_MODELS, Dt as b4mLLMTools, E as FriendshipEvents, Et as XAI_IMAGE_MODELS, F as ImageModels, Ft as isZodError, G as NotFoundError, Gt as isNearLimit, H as MiscEvents, I as InboxEvents, It as obfuscateApiKey, J as Permission, K as OpenAIEmbeddingModel, Kt as parseRateLimitHeaders, L as InternalServerError, Lt as resolveNavigationIntents, M as HttpStatus, Mt as getViewById, N as ImageEditUsageTransaction, Nt as isGPTImage2Model, O as GenerateImageToolCallSchema, Ot as dayjsConfig_default, P as ImageGenerationUsageTransaction, Pt as isGPTImageModel, Q as PromptIntentSchema, R as InviteEvents, Rt as sanitizeTelemetryError, S as FavoriteDocumentType, St as UnprocessableEntityError, T as ForbiddenError, Tt as VideoModels, U as ModalEvents, Ut as buildRateLimitLogEntry, V as LLMEvents, W as ModelBackend, Wt as extractSnippetMeta, X as ProfileEvents, Y as PermissionDeniedError, Z as ProjectEvents, _ as ClaudeArtifactMimeTypes, _t as TooManyRequestsError, a as ApiKeyEvents, at as RegInviteEvents, b as DashboardParamsSchema, bt as UiNavigationEvents, c as AppFileEvents, ct as ResearchTaskPeriodicFrequencyType, d as BFL_IMAGE_MODELS, dt as SpeechToTextUsageTransaction, et as PurchaseTransaction, f as BFL_SAFETY_TOLERANCE, ft as SubscriptionCreditTransaction, g as ChatModels, gt as TextGenerationUsageTransaction, h as ChatCompletionCreateInputSchema, ht as TaskScheduleHandler, i as AiEvents, it as RechartsChartTypeList, j as HTTPError, jt as getMcpProviderMetadata, k as GenericCreditAddTransaction, kt as getAccessibleDataLakes, l as ArtifactTypeSchema, lt as ResearchTaskType, mt as TagType, n as logger, nt as RealtimeVoiceUsageTransaction, o as ApiKeyScope, ot as ResearchModeParamsSchema, p as BadRequestError, pt as SupportedFabFileMimeTypes, q as OpenAIImageGenerationInput, qt as CollectionType, r as ALERT_THRESHOLDS, rt as ReceivedCreditTransaction, s as ApiKeyType, st as ResearchTaskExecutionType, t as ConfigStore, tt as QuestMasterParamsSchema, u as AuthEvents, ut as SessionEvents, v as CompletionApiUsageTransaction, vt as ToolUsageTransaction, w as FileEvents, wt as VideoGenerationUsageTransaction, x as ElabsEvents, xt as UnauthorizedError, y as CorruptedFileError, yt as TransferCreditTransaction, z as InviteType, zt as secureParameters } from "./ConfigStore-tjtx9TU6.mjs";
3
3
  import { a as isUserLockedOut, c as userCanDisableMFA, d as userRequiresMFA, f as verifyBackupCode, i as getLockoutTimeRemaining, l as userEligibleForMFA, n as generateBackupCodes, o as recordFailedAttempt, p as verifyTOTPToken, r as generateTOTPSetup, s as shouldResetFailedAttempts, t as clearFailedAttempts, u as userHasMFAConfigured } from "./utils-PpNti-tY.mjs";
4
4
  import { n as isPathAllowed, t as assertPathAllowed } from "./pathValidation-D8tjkQXE-1HwvsuYT.mjs";
5
5
  import { execFile, execFileSync, spawn } from "child_process";
@@ -4,7 +4,7 @@ import { homedir } from "os";
4
4
  import path from "path";
5
5
  import axios from "axios";
6
6
  //#region package.json
7
- var version = "0.10.2";
7
+ var version = "0.10.3";
8
8
  //#endregion
9
9
  //#region src/utils/updateChecker.ts
10
10
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -107,8 +107,8 @@
107
107
  "zod": "^4.4.3",
108
108
  "zod-validation-error": "^5.0.0",
109
109
  "zustand": "^5.0.13",
110
- "@bike4mind/fab-pipeline": "0.2.5",
111
- "@bike4mind/llm-adapters": "0.3.0",
110
+ "@bike4mind/fab-pipeline": "0.2.6",
111
+ "@bike4mind/llm-adapters": "0.3.1",
112
112
  "@bike4mind/observability": "0.1.0"
113
113
  },
114
114
  "devDependencies": {
@@ -124,11 +124,11 @@
124
124
  "tsx": "^4.22.3",
125
125
  "typescript": "^5.9.3",
126
126
  "vitest": "^4.1.7",
127
- "@bike4mind/agents": "0.11.4",
128
- "@bike4mind/common": "2.104.0",
129
- "@bike4mind/mcp": "1.37.18",
130
- "@bike4mind/services": "2.91.0",
131
- "@bike4mind/utils": "2.23.6"
127
+ "@bike4mind/agents": "0.11.5",
128
+ "@bike4mind/common": "2.104.1",
129
+ "@bike4mind/mcp": "1.37.19",
130
+ "@bike4mind/services": "2.91.1",
131
+ "@bike4mind/utils": "2.23.7"
132
132
  },
133
133
  "optionalDependencies": {
134
134
  "@vscode/ripgrep": "^1.18.0"