@bike4mind/cli 0.10.2 → 0.11.0

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.
@@ -987,6 +987,13 @@ let CreditHolderType = /* @__PURE__ */ function(CreditHolderType) {
987
987
  CreditHolderType["Agent"] = "Agent";
988
988
  return CreditHolderType;
989
989
  }({});
990
+ const COMPLETION_SOURCES = [
991
+ "web",
992
+ "cli",
993
+ "api",
994
+ "agent",
995
+ "system"
996
+ ];
990
997
  let CreditPurchaseStatus = /* @__PURE__ */ function(CreditPurchaseStatus) {
991
998
  CreditPurchaseStatus["Completed"] = "completed";
992
999
  CreditPurchaseStatus["Pending"] = "pending";
@@ -1003,6 +1010,12 @@ const BaseCreditTransaction = z.object({
1003
1010
  credits: z.number(),
1004
1011
  description: z.string().optional(),
1005
1012
  metadata: z.record(z.string(), z.any()).optional(),
1013
+ /**
1014
+ * Where this transaction originated — used to break down usage in reports.
1015
+ * Optional because legacy rows (and non-completion transactions like
1016
+ * purchases/refunds) may not have it set. See CompletionSource in analytics.ts.
1017
+ */
1018
+ source: z.enum(COMPLETION_SOURCES).optional(),
1006
1019
  createdAt: z.date(),
1007
1020
  updatedAt: z.date()
1008
1021
  });
@@ -3644,6 +3657,8 @@ z.enum([
3644
3657
  "EnableLatticeDefault",
3645
3658
  "EnableDataLakes",
3646
3659
  "EnableDataLakesDefault",
3660
+ "EnableBriefcase",
3661
+ "EnableBriefcaseDefault",
3647
3662
  "RapidReplySettings",
3648
3663
  "EnableResearchEngine",
3649
3664
  "EnableResearchEngineDefault",
@@ -4615,6 +4630,14 @@ const API_SERVICE_GROUPS = {
4615
4630
  key: "EnableArtifactsDefault",
4616
4631
  order: 21
4617
4632
  },
4633
+ {
4634
+ key: "EnableBriefcase",
4635
+ order: 25
4636
+ },
4637
+ {
4638
+ key: "EnableBriefcaseDefault",
4639
+ order: 26
4640
+ },
4618
4641
  {
4619
4642
  key: "EnableBmPi",
4620
4643
  order: 30
@@ -5035,6 +5058,25 @@ const settingsMap = {
5035
5058
  order: 89,
5036
5059
  dependsOn: "EnableDataLakes"
5037
5060
  }),
5061
+ EnableBriefcase: makeBooleanSetting({
5062
+ key: "EnableBriefcase",
5063
+ name: "Enable Briefcase",
5064
+ defaultValue: false,
5065
+ description: "Server-side gate for the Briefcase capability (one-click AI prompt catalog). Off by default — turn on to expose the briefcase APIs and launcher panel.",
5066
+ category: "Experimental",
5067
+ group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
5068
+ order: 86
5069
+ }),
5070
+ EnableBriefcaseDefault: makeBooleanSetting({
5071
+ key: "EnableBriefcaseDefault",
5072
+ name: "Briefcase: On by default for users",
5073
+ defaultValue: false,
5074
+ description: "When enabled, Briefcase is active for users who have never explicitly toggled it.",
5075
+ category: "Experimental",
5076
+ group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
5077
+ order: 87,
5078
+ dependsOn: "EnableBriefcase"
5079
+ }),
5038
5080
  EnableQuestMaster: makeBooleanSetting({
5039
5081
  key: "EnableQuestMaster",
5040
5082
  name: "Enable Quest Master",
@@ -7755,6 +7797,55 @@ z$1.object({
7755
7797
  skip: z$1.array(z$1.string())
7756
7798
  })
7757
7799
  });
7800
+ z.enum([
7801
+ "inject",
7802
+ "auto-fire",
7803
+ "hidden"
7804
+ ]);
7805
+ /**
7806
+ * Modes acceptable at AUTHORING time. 'hidden' is intentionally excluded until
7807
+ * the host has true hidden-send support — accepting it would persist a value
7808
+ * that silently behaves as 'auto-fire' (a surprising downgrade). It stays in
7809
+ * ExecutionModeSchema/the stored enum for forward-compat.
7810
+ */
7811
+ const AuthorableExecutionModeSchema = z.enum(["inject", "auto-fire"]);
7812
+ /**
7813
+ * Tools a prompt may require — constrained to the host's closed tool set, MINUS
7814
+ * integration-gated tools that act on the caller's own credentials/account. A
7815
+ * shared system prompt must not be able to inject e.g. blog-publishing into a
7816
+ * non-author's session via requiredTools. (Per-user entitlement of the remaining
7817
+ * tools is still the chat pipeline's responsibility — see follow-up note in the
7818
+ * briefcase blueprint; this allowlist is the storage-layer floor.)
7819
+ */
7820
+ const BRIEFCASE_DISALLOWED_TOOLS = [
7821
+ "blog_publish",
7822
+ "blog_edit",
7823
+ "blog_draft"
7824
+ ];
7825
+ const BriefcaseRequiredToolsSchema = z.array(b4mLLMTools.refine((t) => !BRIEFCASE_DISALLOWED_TOOLS.includes(t), "This tool is not permitted in a briefcase prompt")).max(16);
7826
+ z.string().regex(/^[a-f0-9]{24}$/i, "Invalid prompt id");
7827
+ const PROMPT_TEXT_MAX = 16e3;
7828
+ const TAGS_MAX = 20;
7829
+ z.object({
7830
+ type: z.string().min(1).max(100),
7831
+ name: z.string().min(1).max(200),
7832
+ description: z.string().max(500).optional(),
7833
+ promptText: z.string().min(1).max(PROMPT_TEXT_MAX),
7834
+ tags: z.array(z.string().min(1).max(50)).max(TAGS_MAX).optional(),
7835
+ executionMode: AuthorableExecutionModeSchema.optional(),
7836
+ requiredTools: BriefcaseRequiredToolsSchema.optional()
7837
+ }).partial();
7838
+ /**
7839
+ * One catalog sub-query. Exactly one selector is used, in precedence order:
7840
+ * `personal` (resolved to the caller server-side) > `tags` > `type`.
7841
+ */
7842
+ const PromptBatchQuerySchema = z.object({
7843
+ key: z.string().min(1).max(100),
7844
+ tags: z.array(z.string().min(1).max(50)).max(TAGS_MAX).optional(),
7845
+ type: z.string().max(100).optional(),
7846
+ personal: z.boolean().optional()
7847
+ });
7848
+ z.object({ queries: z.array(PromptBatchQuerySchema).min(1).max(32).refine((qs) => new Set(qs.map((q) => q.key)).size === qs.length, { message: "Batch query keys must be unique" }) });
7758
7849
  const DATA_LAKES = [{
7759
7850
  id: "ionq-sales",
7760
7851
  name: "IonQ Sales Intelligence",
@@ -8197,6 +8288,175 @@ BaseArtifactSchema.extend({
8197
8288
  lastExecutionTime: z.number().optional()
8198
8289
  })
8199
8290
  });
8291
+ /**
8292
+ * Published-artifact schemas — the B4M instantiation of the `artifact-publishing`
8293
+ * blueprint (MillionOnMars/blueprints, extracted from Polaris Publish v1).
8294
+ *
8295
+ * The blueprint expresses scope/visibility as open string vocabularies; B4M
8296
+ * binds them to its own enums:
8297
+ * scope tier ∈ { user, project, organization }
8298
+ * visibility ∈ { private, project, organization, public } (ordered ladder)
8299
+ *
8300
+ * Unlike Polaris (bundles only), B4M publishes three SOURCE kinds through one
8301
+ * record: a rich HTML `bundle`, a chat `reply`, or a `fabfile`. The `source`
8302
+ * discriminator records provenance; `bundle` artifacts get the full
8303
+ * upload→validate→serve pipeline, while `reply`/`fabfile` are server-rendered
8304
+ * viewer pages.
8305
+ */
8306
+ const PublishScopeTierSchema = z.enum([
8307
+ "user",
8308
+ "project",
8309
+ "organization"
8310
+ ]);
8311
+ const PublishSourceKindSchema = z.enum([
8312
+ "bundle",
8313
+ "reply",
8314
+ "fabfile"
8315
+ ]);
8316
+ const PublishSourceSchema = z.object({
8317
+ kind: PublishSourceKindSchema,
8318
+ /** Set when kind === 'bundle' and the bundle was generated from a B4M artifact. */
8319
+ artifactId: z.string().optional(),
8320
+ /** Set when kind === 'reply'. */
8321
+ sessionId: z.string().optional(),
8322
+ messageId: z.string().optional(),
8323
+ /** Set when kind === 'fabfile'. */
8324
+ fabFileId: z.string().optional()
8325
+ });
8326
+ const ArtifactFileSchema = z.object({
8327
+ path: z.string(),
8328
+ size: z.int().nonnegative(),
8329
+ mimeType: z.string(),
8330
+ sha256: z.string()
8331
+ });
8332
+ const ArtifactVersionMetaSchema = z.object({
8333
+ publishedAt: z.date(),
8334
+ publishedBy: z.string(),
8335
+ size: z.object({
8336
+ totalBytes: z.int().nonnegative(),
8337
+ fileCount: z.int().nonnegative()
8338
+ }),
8339
+ sha256Index: z.string()
8340
+ });
8341
+ /** Reserved slugs — must include every tier URL token so a slug can't shadow routing. */
8342
+ const RESERVED_SLUGS = [
8343
+ "api",
8344
+ "admin",
8345
+ "static",
8346
+ "p",
8347
+ "u",
8348
+ "o",
8349
+ "pj",
8350
+ "r",
8351
+ "f",
8352
+ "a",
8353
+ "_next",
8354
+ "health"
8355
+ ];
8356
+ const SlugSchema = z.string().min(3).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "slug must be lowercase kebab-case").refine((s) => !RESERVED_SLUGS.includes(s), { message: "slug is reserved" });
8357
+ const PUBLISH_LIMITS = {
8358
+ maxFiles: 50,
8359
+ maxBundleBytes: 50 * 1024 * 1024,
8360
+ maxFileBytes: 10 * 1024 * 1024
8361
+ };
8362
+ z.object({
8363
+ /** Short opaque id for short URLs (`/p/r/{publicId}`, `/p/f/{publicId}`) and lookups. */
8364
+ publicId: z.string(),
8365
+ tier: PublishScopeTierSchema,
8366
+ scopeId: z.string(),
8367
+ slug: SlugSchema,
8368
+ title: z.string().min(1).max(200),
8369
+ description: z.string().max(1e3).optional(),
8370
+ visibility: VisibilitySchema.prefault("private"),
8371
+ /** Group id a viewer must belong to when gated cross-scope. */
8372
+ gatedToGroupId: z.string().optional(),
8373
+ ownerId: z.string(),
8374
+ lastPublishedBy: z.string().optional(),
8375
+ source: PublishSourceSchema,
8376
+ /** Canonical blob prefix '{tier}/{scopeId}/{slug}/'. Empty for non-bundle sources. */
8377
+ storageKeyPrefix: z.string(),
8378
+ size: z.object({
8379
+ totalBytes: z.int().nonnegative(),
8380
+ fileCount: z.int().nonnegative()
8381
+ }),
8382
+ sha256Index: z.string().optional(),
8383
+ manifest: z.array(ArtifactFileSchema).prefault([]),
8384
+ declaredApiEndpoints: z.array(z.string()).prefault([]),
8385
+ /** Rendered body snapshot for reply/fabfile viewer pages (markdown or text). */
8386
+ renderedBody: z.string().optional(),
8387
+ publishedAt: z.date(),
8388
+ previousVersionMeta: ArtifactVersionMetaSchema.optional(),
8389
+ viewCount: z.int().nonnegative().prefault(0),
8390
+ createdAt: z.date(),
8391
+ updatedAt: z.date(),
8392
+ deletedAt: z.date().nullish(),
8393
+ deletedBy: z.string().nullish()
8394
+ });
8395
+ const ValidationViolationTypeSchema = z.enum([
8396
+ "csp_violation",
8397
+ "forbidden_pattern",
8398
+ "forbidden_iframe",
8399
+ "invalid_asset_url",
8400
+ "missing_index",
8401
+ "size_exceeded",
8402
+ "invalid_mime_type",
8403
+ "invalid_path"
8404
+ ]);
8405
+ z.object({
8406
+ type: ValidationViolationTypeSchema,
8407
+ message: z.string(),
8408
+ file: z.string().optional(),
8409
+ line: z.int().optional()
8410
+ });
8411
+ const FileDescriptorSchema = z.object({
8412
+ path: z.string(),
8413
+ size: z.int().nonnegative(),
8414
+ mimeType: z.string()
8415
+ });
8416
+ z.object({
8417
+ tier: PublishScopeTierSchema,
8418
+ scopeId: z.string(),
8419
+ slug: SlugSchema,
8420
+ title: z.string().min(1).max(200),
8421
+ description: z.string().max(1e3).optional(),
8422
+ visibility: VisibilitySchema.optional(),
8423
+ gatedToGroupId: z.string().optional(),
8424
+ source: PublishSourceSchema.optional(),
8425
+ files: z.array(FileDescriptorSchema).min(1).max(PUBLISH_LIMITS.maxFiles)
8426
+ });
8427
+ z.object({
8428
+ draftId: z.uuid(),
8429
+ uploadUrls: z.array(z.object({
8430
+ path: z.string(),
8431
+ url: z.string(),
8432
+ expiresAt: z.string()
8433
+ }))
8434
+ });
8435
+ z.object({ draftId: z.uuid() });
8436
+ z.object({
8437
+ sessionId: z.string(),
8438
+ messageId: z.string(),
8439
+ title: z.string().min(1).max(200).optional(),
8440
+ visibility: VisibilitySchema.optional(),
8441
+ tier: PublishScopeTierSchema.prefault("user"),
8442
+ scopeId: z.string().optional()
8443
+ });
8444
+ z.object({
8445
+ fabFileId: z.string(),
8446
+ title: z.string().min(1).max(200).optional(),
8447
+ visibility: VisibilitySchema.optional(),
8448
+ tier: PublishScopeTierSchema.prefault("user"),
8449
+ scopeId: z.string().optional()
8450
+ });
8451
+ z.object({
8452
+ publicId: z.string(),
8453
+ url: z.string(),
8454
+ tier: PublishScopeTierSchema,
8455
+ scopeId: z.string(),
8456
+ slug: z.string(),
8457
+ visibility: VisibilitySchema,
8458
+ publishedAt: z.string()
8459
+ });
8200
8460
  const QuestStatusSchema = z.enum([
8201
8461
  "pending",
8202
8462
  "in-progress",
@@ -8408,6 +8668,39 @@ function sanitizeTelemetryError(error, maxLength = MAX_ERROR_LENGTH) {
8408
8668
  if (sanitized.length > maxLength) sanitized = sanitized.substring(0, maxLength - 3) + "...";
8409
8669
  return sanitized;
8410
8670
  }
8671
+ /**
8672
+ * Trigger-word validation, shared between client form and server agent
8673
+ * endpoints so the validation rules can't drift.
8674
+ *
8675
+ * Rules (GitHub-handle style):
8676
+ * - Must start with `@`
8677
+ * - Followed by 1–31 chars of alphanumeric, hyphens, or underscores
8678
+ * - May not start or end with a hyphen
8679
+ * - Total length 2–32 chars (including the `@`)
8680
+ *
8681
+ * Why these rules: the chat-side mention parser (`detectAgentMentions`)
8682
+ * matches `[a-zA-Z0-9_](?:[a-zA-Z0-9_-]*[a-zA-Z0-9_])?`. Any trigger word
8683
+ * the agent form lets through but the parser can't read is a silent
8684
+ * routing failure with no user feedback. Validating at save time closes
8685
+ * that gap.
8686
+ */
8687
+ const TRIGGER_WORD_BODY = /^[a-zA-Z0-9_](?:[a-zA-Z0-9_-]{0,30}[a-zA-Z0-9_])?$/;
8688
+ 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.";
8689
+ /**
8690
+ * Validate a single trigger word (the full `@handle` form).
8691
+ */
8692
+ 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);
8693
+ z.array(triggerWordSchema).max(20, "Up to 20 trigger words allowed.").transform((words) => {
8694
+ const seen = /* @__PURE__ */ new Set();
8695
+ const out = [];
8696
+ for (const word of words) {
8697
+ const key = word.toLowerCase();
8698
+ if (seen.has(key)) continue;
8699
+ seen.add(key);
8700
+ out.push(word);
8701
+ }
8702
+ return out;
8703
+ });
8411
8704
  const VIEW_REGISTRY = [
8412
8705
  {
8413
8706
  id: "opti.root",
@@ -9324,6 +9617,10 @@ const VIEW_REGISTRY = [
9324
9617
  function getViewById(viewId) {
9325
9618
  return VIEW_REGISTRY.find((v) => v.id === viewId);
9326
9619
  }
9620
+ Array.from(new Set(VIEW_REGISTRY.filter((v) => v.navigationType === "route" && v.target.startsWith("/") && v.target !== "/").map((v) => {
9621
+ const [, top] = v.target.split("/");
9622
+ return `/${top}`;
9623
+ })));
9327
9624
  /**
9328
9625
  * Resolve an array of viewIds + reasons into hydrated NavigationIntents.
9329
9626
  * 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-Bku1XvrD.mjs";
3
3
  //#region src/commands/apiCommand.ts
4
4
  /**
5
5
  * External API config command (--api-url / --reset-api)
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, n as compareSemver, r as fetchLatestVersion } from "../updateChecker-DdgysXM8.mjs";
2
+ import { t as version } from "../package-CVajrVMD.mjs";
3
+ import { n as compareSemver, r as fetchLatestVersion } from "../updateChecker-D67NPlS5.mjs";
3
4
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
4
5
  import { execSync } from "child_process";
5
6
  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-Ddni4Pbz.mjs";
3
+ import { n as logger, t as ConfigStore } from "../ConfigStore-Bku1XvrD.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-Bku1XvrD.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,6 @@
1
1
  #!/usr/bin/env node
2
- import { a as version, i as forceCheckForUpdate } from "../updateChecker-DdgysXM8.mjs";
2
+ import { t as version } from "../package-CVajrVMD.mjs";
3
+ import { i as forceCheckForUpdate } from "../updateChecker-D67NPlS5.mjs";
3
4
  import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
4
5
  import { execSync } from "child_process";
5
6
  //#region src/commands/updateCommand.ts
package/dist/index.mjs CHANGED
@@ -1,8 +1,9 @@
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-Ddni4Pbz.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-Bku1XvrD.mjs";
5
+ import { t as version } from "./package-CVajrVMD.mjs";
6
+ import { t as checkForUpdate } from "./updateChecker-D67NPlS5.mjs";
6
7
  import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
7
8
  import { Box, Static, Text, render, useApp, useInput, usePaste, useStdout } from "ink";
8
9
  import { execSync } from "child_process";
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ //#region package.json
3
+ var version = "0.11.0";
4
+ //#endregion
5
+ export { version as t };
@@ -1,7 +1,8 @@
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-Bku1XvrD.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
+ import { t as version } from "./package-CVajrVMD.mjs";
5
6
  import { execFile, execFileSync, spawn } from "child_process";
6
7
  import crypto, { createHash, randomBytes } from "crypto";
7
8
  import { existsSync, promises, readFileSync, readdirSync, rmSync, statSync, unlinkSync, writeFileSync } from "fs";
@@ -24436,6 +24437,7 @@ var WebSocketToolExecutor = class {
24436
24437
  };
24437
24438
  //#endregion
24438
24439
  //#region src/auth/ApiClient.ts
24440
+ const USER_AGENT = `b4m-cli/${version}`;
24439
24441
  /**
24440
24442
  * Authenticated API client for B4M services
24441
24443
  * Automatically injects access tokens from ConfigStore
@@ -24446,7 +24448,11 @@ var ApiClient = class {
24446
24448
  this.oauthClient = new OAuthClient(baseURL);
24447
24449
  this.client = axios.create({
24448
24450
  baseURL,
24449
- headers: { "Content-Type": "application/json" }
24451
+ headers: {
24452
+ "Content-Type": "application/json",
24453
+ "User-Agent": USER_AGENT,
24454
+ "X-B4M-Client": USER_AGENT
24455
+ }
24450
24456
  });
24451
24457
  this.client.interceptors.request.use(async (config) => {
24452
24458
  const tokens = await this.configStore.getAuthTokens();
@@ -3,9 +3,6 @@ import { promises } from "fs";
3
3
  import { homedir } from "os";
4
4
  import path from "path";
5
5
  import axios from "axios";
6
- //#region package.json
7
- var version = "0.10.2";
8
- //#endregion
9
6
  //#region src/utils/updateChecker.ts
10
7
  /**
11
8
  * Update checker utility for B4M CLI
@@ -117,4 +114,4 @@ async function forceCheckForUpdate(currentVersion) {
117
114
  };
118
115
  }
119
116
  //#endregion
120
- export { version as a, forceCheckForUpdate as i, compareSemver as n, fetchLatestVersion as r, checkForUpdate as t };
117
+ export { forceCheckForUpdate as i, compareSemver as n, fetchLatestVersion as r, checkForUpdate as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
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.7",
111
+ "@bike4mind/llm-adapters": "0.3.2",
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.6",
128
+ "@bike4mind/common": "2.105.0",
129
+ "@bike4mind/mcp": "1.37.20",
130
+ "@bike4mind/services": "2.92.0",
131
+ "@bike4mind/utils": "2.23.8"
132
132
  },
133
133
  "optionalDependencies": {
134
134
  "@vscode/ripgrep": "^1.18.0"