@bike4mind/cli 0.17.1 → 0.18.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.
- package/LICENSE +116 -0
- package/README.md +5 -2
- package/dist/{BackgroundAgentManager-C5HEirFN.mjs → BackgroundAgentManager-ChmoEU9H.mjs} +214 -121
- package/dist/{ConfigStore-gV8aHo9b.mjs → ConfigStore-yJU1dxpP.mjs} +150 -23
- package/dist/commands/apiCommand.mjs +4 -3
- package/dist/commands/doctorCommand.mjs +1 -1
- package/dist/commands/envCommand.mjs +1 -1
- package/dist/commands/headlessCommand.mjs +2 -2
- package/dist/commands/mcpCommand.mjs +1 -1
- package/dist/commands/updateCommand.mjs +1 -1
- package/dist/index.mjs +7 -6
- package/dist/{package-Dzetdo6D.mjs → package-B3f78bSl.mjs} +1 -1
- package/dist/utils-CLjLKvqQ.mjs +3 -0
- package/dist/{utils-PpNti-tY.mjs → utils-fqhJmuB8.mjs} +2 -2
- package/package.json +8 -8
- package/dist/utils-BGtSXfce.mjs +0 -3
|
@@ -21,8 +21,8 @@ let CollectionType = /* @__PURE__ */ function(CollectionType) {
|
|
|
21
21
|
CollectionType["AI_IMAGE"] = "ai_image";
|
|
22
22
|
return CollectionType;
|
|
23
23
|
}({});
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
process.env.APP_NAME;
|
|
25
|
+
process.env.WEBSITE_URL;
|
|
26
26
|
const extractSnippetMeta = (content) => {
|
|
27
27
|
const snippetRegex = /<!--snippet-meta\s*(\{[\s\S]*?\})\s*-->[\n\s]*([\s\S]*?)(?=<!--snippet-meta|$)/g;
|
|
28
28
|
const sections = [];
|
|
@@ -1279,6 +1279,26 @@ let TagType = /* @__PURE__ */ function(TagType) {
|
|
|
1279
1279
|
TagType["SESSION"] = "session";
|
|
1280
1280
|
return TagType;
|
|
1281
1281
|
}({});
|
|
1282
|
+
/**
|
|
1283
|
+
* SRE Agent Trio — Shared Types
|
|
1284
|
+
*
|
|
1285
|
+
* Types for the autonomous SRE pipeline:
|
|
1286
|
+
* Sentinel (error intake) → Diagnostician (LLM analysis) → Surgeon (automated fix)
|
|
1287
|
+
*/
|
|
1288
|
+
let SreClassification = /* @__PURE__ */ function(SreClassification) {
|
|
1289
|
+
SreClassification["HIGH"] = "HIGH";
|
|
1290
|
+
SreClassification["MEDIUM"] = "MEDIUM";
|
|
1291
|
+
SreClassification["LOW"] = "LOW";
|
|
1292
|
+
SreClassification["SKIP"] = "SKIP";
|
|
1293
|
+
return SreClassification;
|
|
1294
|
+
}({});
|
|
1295
|
+
let SreSourceType = /* @__PURE__ */ function(SreSourceType) {
|
|
1296
|
+
SreSourceType["CLOUDWATCH"] = "CLOUDWATCH";
|
|
1297
|
+
SreSourceType["GITHUB_ISSUE"] = "GITHUB_ISSUE";
|
|
1298
|
+
return SreSourceType;
|
|
1299
|
+
}({});
|
|
1300
|
+
/** Default repo slug used for backward compatibility with existing data */
|
|
1301
|
+
const SRE_DEFAULT_REPO_SLUG = "MillionOnMars/lumina5";
|
|
1282
1302
|
const SRE_BLOCKED_FILE_DEFAULTS = [
|
|
1283
1303
|
"infra/**",
|
|
1284
1304
|
"*.secret*",
|
|
@@ -1322,8 +1342,8 @@ const SreRepoConfigSchema = z.object({
|
|
|
1322
1342
|
maxFixesPerDay: z.number().min(0).default(5),
|
|
1323
1343
|
/** Max revision attempts before escalating to human */
|
|
1324
1344
|
maxRevisions: z.number().int().min(0).max(10).default(2),
|
|
1325
|
-
/** Max CI retry attempts before permanently failing (typecheck/apply-fix failures) */
|
|
1326
|
-
maxCiRetries: z.number().int().min(0).max(3).default(
|
|
1345
|
+
/** Max CI retry attempts before permanently failing (typecheck/apply-fix/test failures) */
|
|
1346
|
+
maxCiRetries: z.number().int().min(0).max(3).default(2),
|
|
1327
1347
|
/** Log actions without dispatching */
|
|
1328
1348
|
dryRun: z.boolean().default(false),
|
|
1329
1349
|
/** Comma-separated GitHub usernames to request as PR reviewers */
|
|
@@ -1461,6 +1481,67 @@ const SreAgentConfigSchema = z.preprocess((raw) => {
|
|
|
1461
1481
|
return { repos: legacyRepo ? [legacyRepo] : [] };
|
|
1462
1482
|
}, z.object({ repos: z.array(SreRepoConfigSchema).default([]) }));
|
|
1463
1483
|
/**
|
|
1484
|
+
* Diagnosis payload as carried on the wire (revision requests embed it).
|
|
1485
|
+
* Named distinctly from `SreDiagnosisSchema` in @bike4mind/services (which validates
|
|
1486
|
+
* raw LLM output with min/max bounds + escalate fields) — this is the transport shape.
|
|
1487
|
+
*/
|
|
1488
|
+
const SreWireDiagnosisSchema = z.object({
|
|
1489
|
+
rootCause: z.string(),
|
|
1490
|
+
proposedFix: z.string(),
|
|
1491
|
+
confidence: z.number(),
|
|
1492
|
+
riskAssessment: z.string(),
|
|
1493
|
+
affectedFiles: z.array(z.object({
|
|
1494
|
+
filePath: z.string(),
|
|
1495
|
+
before: z.string(),
|
|
1496
|
+
after: z.string(),
|
|
1497
|
+
kind: z.enum([
|
|
1498
|
+
"insert",
|
|
1499
|
+
"replace",
|
|
1500
|
+
"create"
|
|
1501
|
+
]).default("replace")
|
|
1502
|
+
})).max(15),
|
|
1503
|
+
toolCalls: z.array(z.object({
|
|
1504
|
+
tool: z.string(),
|
|
1505
|
+
input: z.record(z.string(), z.unknown()),
|
|
1506
|
+
output: z.string()
|
|
1507
|
+
})).optional()
|
|
1508
|
+
});
|
|
1509
|
+
/** Analysis job payload (Sentinel → Diagnostician). */
|
|
1510
|
+
const SreEventPayloadSchema = z.object({
|
|
1511
|
+
source: z.nativeEnum(SreSourceType),
|
|
1512
|
+
fingerprint: z.string(),
|
|
1513
|
+
repoSlug: z.string().default(SRE_DEFAULT_REPO_SLUG),
|
|
1514
|
+
classification: z.nativeEnum(SreClassification),
|
|
1515
|
+
errorMessage: z.string(),
|
|
1516
|
+
stackTrace: z.string().optional(),
|
|
1517
|
+
functionName: z.string().optional(),
|
|
1518
|
+
logGroup: z.string().optional(),
|
|
1519
|
+
issueNumber: z.number().optional(),
|
|
1520
|
+
issueUrl: z.string().optional(),
|
|
1521
|
+
labels: z.array(z.string()).optional(),
|
|
1522
|
+
affectedUserIds: z.array(z.string()).optional(),
|
|
1523
|
+
dryRun: z.boolean().optional(),
|
|
1524
|
+
triggerAction: z.enum([
|
|
1525
|
+
"opened",
|
|
1526
|
+
"labeled",
|
|
1527
|
+
"reopened"
|
|
1528
|
+
]).optional()
|
|
1529
|
+
});
|
|
1530
|
+
/** Revision job payload (PullRequestReviewHandler → Diagnostician re-run). */
|
|
1531
|
+
const SreRevisionRequestSchema = z.object({
|
|
1532
|
+
trackingId: z.string(),
|
|
1533
|
+
fingerprint: z.string(),
|
|
1534
|
+
repoSlug: z.string().default(SRE_DEFAULT_REPO_SLUG),
|
|
1535
|
+
branchName: z.string(),
|
|
1536
|
+
prNumber: z.number(),
|
|
1537
|
+
reviewBody: z.string().optional(),
|
|
1538
|
+
originalDiagnosis: SreWireDiagnosisSchema,
|
|
1539
|
+
source: z.nativeEnum(SreSourceType),
|
|
1540
|
+
issueNumber: z.number().optional(),
|
|
1541
|
+
ciFailureOutput: z.string().optional()
|
|
1542
|
+
});
|
|
1543
|
+
z.discriminatedUnion("jobType", [SreEventPayloadSchema.extend({ jobType: z.literal("analysis") }), SreRevisionRequestSchema.extend({ jobType: z.literal("revision") })]);
|
|
1544
|
+
/**
|
|
1464
1545
|
* Configuration schema for the SecOps Triage feature.
|
|
1465
1546
|
*
|
|
1466
1547
|
* Controls automatic GitHub issue creation for critical/high ZAP scan findings.
|
|
@@ -3817,6 +3898,8 @@ z.enum([
|
|
|
3817
3898
|
"EnableArtifactsDefault",
|
|
3818
3899
|
"EnableAgents",
|
|
3819
3900
|
"EnableAgentsDefault",
|
|
3901
|
+
"EnableAgentMode",
|
|
3902
|
+
"EnableAgentModeDefault",
|
|
3820
3903
|
"EnableRapidReply",
|
|
3821
3904
|
"EnableRapidReplyDefault",
|
|
3822
3905
|
"EnableLattice",
|
|
@@ -3978,7 +4061,10 @@ const OrchestrationDefaultsSchema = z.object({
|
|
|
3978
4061
|
"sunrise_sunset",
|
|
3979
4062
|
"planet_visibility",
|
|
3980
4063
|
"code_execute",
|
|
3981
|
-
"coordinate_task"
|
|
4064
|
+
"coordinate_task",
|
|
4065
|
+
"image_generation",
|
|
4066
|
+
"edit_image",
|
|
4067
|
+
"excel_generation"
|
|
3982
4068
|
]),
|
|
3983
4069
|
/**
|
|
3984
4070
|
* Tool names explicitly forbidden. Enforced as a final subtraction in
|
|
@@ -4005,10 +4091,7 @@ const OrchestrationDefaultsSchema = z.object({
|
|
|
4005
4091
|
"lattice_create_model",
|
|
4006
4092
|
"lattice_add_entity",
|
|
4007
4093
|
"lattice_set_value",
|
|
4008
|
-
"lattice_create_rule"
|
|
4009
|
-
"image_generation",
|
|
4010
|
-
"edit_image",
|
|
4011
|
-
"excel_generation"
|
|
4094
|
+
"lattice_create_rule"
|
|
4012
4095
|
]),
|
|
4013
4096
|
/** Per-thoroughness iteration ceiling. Matches `IAgent.maxIterations`. */
|
|
4014
4097
|
maxIterations: z.object({
|
|
@@ -4884,6 +4967,14 @@ const API_SERVICE_GROUPS = {
|
|
|
4884
4967
|
key: "enableAgentProactiveMessages",
|
|
4885
4968
|
order: 12
|
|
4886
4969
|
},
|
|
4970
|
+
{
|
|
4971
|
+
key: "EnableAgentMode",
|
|
4972
|
+
order: 15
|
|
4973
|
+
},
|
|
4974
|
+
{
|
|
4975
|
+
key: "EnableAgentModeDefault",
|
|
4976
|
+
order: 16
|
|
4977
|
+
},
|
|
4887
4978
|
{
|
|
4888
4979
|
key: "EnableArtifacts",
|
|
4889
4980
|
order: 20
|
|
@@ -5446,6 +5537,25 @@ const settingsMap = {
|
|
|
5446
5537
|
order: 11,
|
|
5447
5538
|
dependsOn: "EnableAgents"
|
|
5448
5539
|
}),
|
|
5540
|
+
EnableAgentMode: makeBooleanSetting({
|
|
5541
|
+
key: "EnableAgentMode",
|
|
5542
|
+
name: "Enable Agent Mode (Smart Routing)",
|
|
5543
|
+
defaultValue: true,
|
|
5544
|
+
description: "Whether the Agent Mode / Smart Routing feature is available to users. When enabled, users can opt in via the Beta Features tab to have complex prompts automatically routed to multi-step agents. Set to off to hide the feature org-wide.",
|
|
5545
|
+
category: "Experimental",
|
|
5546
|
+
group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
|
|
5547
|
+
order: 15
|
|
5548
|
+
}),
|
|
5549
|
+
EnableAgentModeDefault: makeBooleanSetting({
|
|
5550
|
+
key: "EnableAgentModeDefault",
|
|
5551
|
+
name: "Agent Mode: On by default for users",
|
|
5552
|
+
defaultValue: false,
|
|
5553
|
+
description: "When enabled, Agent Mode / Smart Routing is active for users who have never explicitly toggled it. Leave off for an opt-in rollout.",
|
|
5554
|
+
category: "Experimental",
|
|
5555
|
+
group: API_SERVICE_GROUPS.EXPERIMENTAL.id,
|
|
5556
|
+
order: 16,
|
|
5557
|
+
dependsOn: "EnableAgentMode"
|
|
5558
|
+
}),
|
|
5449
5559
|
EnableRapidReply: makeBooleanSetting({
|
|
5450
5560
|
key: "EnableRapidReply",
|
|
5451
5561
|
name: "Enable Rapid Reply",
|
|
@@ -5544,7 +5654,7 @@ const settingsMap = {
|
|
|
5544
5654
|
tagLineMain: makeStringSetting({
|
|
5545
5655
|
key: "tagLineMain",
|
|
5546
5656
|
name: "Tag Line Main",
|
|
5547
|
-
defaultValue: "
|
|
5657
|
+
defaultValue: process.env.NEXT_PUBLIC_APP_NAME || process.env.APP_NAME || "",
|
|
5548
5658
|
description: "The main tag line to display on the app.",
|
|
5549
5659
|
category: "Branding",
|
|
5550
5660
|
group: API_SERVICE_GROUPS.BRANDING.id,
|
|
@@ -6190,7 +6300,7 @@ const settingsMap = {
|
|
|
6190
6300
|
key: "qWorkUrl",
|
|
6191
6301
|
name: "Q/Work URL",
|
|
6192
6302
|
defaultValue: "",
|
|
6193
|
-
description: "The base URL for the Q/Work API (for example: https://q.
|
|
6303
|
+
description: "The base URL for the Q/Work API (for example: https://q.your-deployment.example.com).",
|
|
6194
6304
|
category: "Tools",
|
|
6195
6305
|
group: API_SERVICE_GROUPS.Q_WORK.id,
|
|
6196
6306
|
order: 1
|
|
@@ -9318,7 +9428,7 @@ z.array(triggerWordSchema).max(20, "Up to 20 trigger words allowed.").transform(
|
|
|
9318
9428
|
const key = word.toLowerCase();
|
|
9319
9429
|
if (seen.has(key)) continue;
|
|
9320
9430
|
seen.add(key);
|
|
9321
|
-
out.push(
|
|
9431
|
+
out.push(key);
|
|
9322
9432
|
}
|
|
9323
9433
|
return out;
|
|
9324
9434
|
});
|
|
@@ -10329,24 +10439,41 @@ dayjs.extend(localizedFormat);
|
|
|
10329
10439
|
var dayjsConfig_default = dayjs;
|
|
10330
10440
|
//#endregion
|
|
10331
10441
|
//#region src/utils/apiUrl.ts
|
|
10332
|
-
/**
|
|
10333
|
-
|
|
10442
|
+
/**
|
|
10443
|
+
* Default service endpoint, baked in at build time via tsdown's `env` option
|
|
10444
|
+
* (see `apps/cli/tsdown.config.ts`). The hosted publisher builds with its own
|
|
10445
|
+
* service as the default; a fork sets `B4M_DEFAULT_API_URL` to publish under a
|
|
10446
|
+
* different brand, so a fork's bundle never embeds the upstream brand literal.
|
|
10447
|
+
* Empty when unset — the user then supplies an endpoint via `/set-api` or the
|
|
10448
|
+
* `--dev` flag. (open-core, issue #9392)
|
|
10449
|
+
*/
|
|
10450
|
+
function getDefaultApiUrl() {
|
|
10451
|
+
return "";
|
|
10452
|
+
}
|
|
10334
10453
|
/** Local development server the `--dev` flag points the CLI at. */
|
|
10335
10454
|
const LOCAL_DEV_URL = "http://localhost:3001";
|
|
10336
10455
|
/**
|
|
10456
|
+
* Marketing/credits page shown when the user runs out of credits. Build-time
|
|
10457
|
+
* injected like {@link getDefaultApiUrl}; empty for an unbranded fork, in which
|
|
10458
|
+
* case the "purchase more credits" line is omitted entirely. (open-core #9392)
|
|
10459
|
+
*/
|
|
10460
|
+
function getCreditsUrl() {
|
|
10461
|
+
return "";
|
|
10462
|
+
}
|
|
10463
|
+
/**
|
|
10337
10464
|
* Resolve API URL based on configuration
|
|
10338
|
-
* Returns custom URL if set, otherwise
|
|
10465
|
+
* Returns custom URL if set, otherwise the build-time default service.
|
|
10339
10466
|
*/
|
|
10340
10467
|
function getApiUrl(configApiConfig) {
|
|
10341
10468
|
if (configApiConfig?.customUrl) return configApiConfig.customUrl;
|
|
10342
|
-
return
|
|
10469
|
+
return getDefaultApiUrl();
|
|
10343
10470
|
}
|
|
10344
10471
|
/**
|
|
10345
10472
|
* Get human-readable API type name
|
|
10346
10473
|
*/
|
|
10347
10474
|
function getEnvironmentName(configApiConfig) {
|
|
10348
10475
|
const url = configApiConfig?.customUrl;
|
|
10349
|
-
if (!url) return "Production";
|
|
10476
|
+
if (!url) return getDefaultApiUrl() ? "Production" : "Unconfigured";
|
|
10350
10477
|
if (/^https?:\/\/(localhost|127\.0\.0\.1)(:|\/|$)/i.test(url)) return "Local Dev";
|
|
10351
10478
|
return "Self-Hosted";
|
|
10352
10479
|
}
|
|
@@ -11329,8 +11456,8 @@ var ConfigStore = class {
|
|
|
11329
11456
|
return (await this.load()).apiConfig;
|
|
11330
11457
|
}
|
|
11331
11458
|
/**
|
|
11332
|
-
* Set custom API URL for self-hosted
|
|
11333
|
-
* Pass null to reset to
|
|
11459
|
+
* Set custom API URL for a self-hosted instance.
|
|
11460
|
+
* Pass null to reset to the build-time default service.
|
|
11334
11461
|
*/
|
|
11335
11462
|
async setCustomApiUrl(url) {
|
|
11336
11463
|
const config = await this.load();
|
|
@@ -11344,7 +11471,7 @@ var ConfigStore = class {
|
|
|
11344
11471
|
* return to an environment you've already authenticated.
|
|
11345
11472
|
*
|
|
11346
11473
|
* Targets:
|
|
11347
|
-
* - 'prod' →
|
|
11474
|
+
* - 'prod' → the build-time default service (clears customUrl)
|
|
11348
11475
|
* - 'dev' → local dev server (http://localhost:3001)
|
|
11349
11476
|
* - { customUrl: '…' } → arbitrary self-hosted URL
|
|
11350
11477
|
*
|
|
@@ -11354,11 +11481,11 @@ var ConfigStore = class {
|
|
|
11354
11481
|
*/
|
|
11355
11482
|
async switchApiEnvironment(target) {
|
|
11356
11483
|
const config = await this.load();
|
|
11357
|
-
const prevKey = normalizeEnvKey(config.apiConfig?.customUrl ||
|
|
11484
|
+
const prevKey = normalizeEnvKey(config.apiConfig?.customUrl || getDefaultApiUrl());
|
|
11358
11485
|
let newUrl;
|
|
11359
11486
|
let newApiConfig;
|
|
11360
11487
|
if (target === "prod") {
|
|
11361
|
-
newUrl =
|
|
11488
|
+
newUrl = getDefaultApiUrl();
|
|
11362
11489
|
newApiConfig = void 0;
|
|
11363
11490
|
} else if (target === "dev") {
|
|
11364
11491
|
newUrl = LOCAL_DEV_URL;
|
|
@@ -11505,4 +11632,4 @@ var ConfigStore = class {
|
|
|
11505
11632
|
}
|
|
11506
11633
|
};
|
|
11507
11634
|
//#endregion
|
|
11508
|
-
export {
|
|
11635
|
+
export { PermissionDeniedError as $, extractSnippetMeta as $t, FriendshipEvents as A, XAI_IMAGE_MODELS as At, InboxEvents as B, isZodError as Bt, CorruptedFileError as C, TransferCreditTransaction as Ct, FeedbackEvents as D, VIDEO_SIZE_CONSTRAINTS as Dt, FavoriteDocumentType as E, UnprocessableEntityError as Et, HTTPError as F, getViewById as Ft, LLMEvents as G, sanitizeTelemetryError as Gt, InviteEvents as H, obfuscateApiKey as Ht, HttpStatus as I, isGPTImage2Model as It, ModelBackend as J, substituteArguments as Jt, MiscEvents as K, secureParameters as Kt, ImageEditUsageTransaction as L, isGPTImageModel as Lt, GenerateImageToolCallSchema as M, dayjsConfig_default as Mt, GenericCreditAddTransaction as N, getAccessibleDataLakes as Nt, FileEvents as O, VideoGenerationUsageTransaction as Ot, GenericCreditDeductTransaction as P, getMcpProviderMetadata as Pt, Permission as Q, buildRateLimitLogEntry as Qt, ImageGenerationUsageTransaction as R, isModelAccessible as Rt, CompletionApiUsageTransaction as S, ToolUsageTransaction as St, ElabsEvents as T, UnauthorizedError as Tt, InviteType as U, parseSkillArguments as Ut, InternalServerError as V, mapMimeTypeToArtifactType as Vt, KnowledgeType as W, resolveNavigationIntents as Wt, OpenAIEmbeddingModel as X, validateJupyterKernelName as Xt, NotFoundError as Y, toDataLakeConfig as Yt, OpenAIImageGenerationInput as Z, validateNotebookPath as Zt, BadRequestError as _, SupportedFabFileMimeTypes as _t, getDefaultApiUrl as a, QuestMasterParamsSchema as at, ChatModels as b, TextGenerationUsageTransaction as bt, AiEvents as c, RechartsChartTypeList as ct, ApiKeyType as d, ResearchTaskExecutionType as dt, isNearLimit as en, ProfileEvents as et, AppFileEvents as f, ResearchTaskPeriodicFrequencyType as ft, BFL_SAFETY_TOLERANCE as g, SubscriptionCreditTransaction as gt, BFL_IMAGE_MODELS as h, SpeechToTextUsageTransaction as ht, getCreditsUrl as i, PurchaseTransaction as it, GEMINI_IMAGE_MODELS as j, b4mLLMTools as jt, ForbiddenError as k, VideoModels as kt, ApiKeyEvents as l, RegInviteEvents as lt, AuthEvents as m, SessionEvents as mt, logger as n, CollectionType as nn, PromptIntentSchema as nt, getEnvironmentName as o, RealtimeVoiceUsageTransaction as ot, ArtifactTypeSchema as p, ResearchTaskType as pt, ModalEvents as q, settingsMap as qt, getApiUrl as r, PromptMetaZodSchema as rt, ALERT_THRESHOLDS as s, ReceivedCreditTransaction as st, ConfigStore as t, parseRateLimitHeaders as tn, ProjectEvents as tt, ApiKeyScope as u, ResearchModeParamsSchema as ut, CREDIT_DEDUCT_TRANSACTION_TYPES as v, TagType as vt, DashboardParamsSchema as w, UiNavigationEvents as wt, ClaudeArtifactMimeTypes as x, TooManyRequestsError as xt, ChatCompletionCreateInputSchema as y, TaskScheduleHandler as yt, ImageModels as z, isSupportedEmbeddingModel as zt };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as ConfigStore } from "../ConfigStore-
|
|
2
|
+
import { a as getDefaultApiUrl, t as ConfigStore } from "../ConfigStore-yJU1dxpP.mjs";
|
|
3
3
|
//#region src/commands/apiCommand.ts
|
|
4
4
|
/**
|
|
5
5
|
* External API config command (--api-url / --reset-api)
|
|
6
6
|
* Runs outside the interactive CLI session, before any auth flow.
|
|
7
7
|
*
|
|
8
|
-
* - `--reset-api`: clears customUrl, falling back to the
|
|
8
|
+
* - `--reset-api`: clears customUrl, falling back to the build-time default service
|
|
9
9
|
* - `--api-url <url>`: sets a custom API URL (e.g. http://localhost:3000)
|
|
10
10
|
*
|
|
11
11
|
* Both clear auth tokens because they're bound to the old origin, and both
|
|
@@ -37,7 +37,8 @@ async function handleApiCommand(options) {
|
|
|
37
37
|
}
|
|
38
38
|
await configStore.setCustomApiUrl(null);
|
|
39
39
|
await configStore.clearAuthTokens();
|
|
40
|
-
|
|
40
|
+
const defaultUrl = getDefaultApiUrl();
|
|
41
|
+
console.log(`\n✅ API URL reset to the default service${defaultUrl ? ` (${defaultUrl})` : ""}`);
|
|
41
42
|
console.log("🔓 Authentication cleared");
|
|
42
43
|
console.log("💡 Run `b4m` to authenticate.\n");
|
|
43
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as version } from "../package-
|
|
2
|
+
import { t as version } from "../package-B3f78bSl.mjs";
|
|
3
3
|
import { a as fetchLatestVersion, c as isNpmPrefixWritable, i as compareSemver } from "../updateChecker-C8xsNY2L.mjs";
|
|
4
4
|
import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
|
|
5
5
|
import { execSync } from "child_process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as createCoordinateTaskTool, D as FallbackLlmBackend, E as ApiClient, F as generateCliTools, G as ReActAgent, N as loadContextFiles, O as ServerLlmBackend, P as PermissionManager, Q as CheckpointStore, T as createAgentDelegateTool, W as setWebSocketToolExecutor, X as RemoteSkillSource, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createGetFileStructureTool, a as WebSocketToolExecutor, b as createWriteTodosTool, et as SessionStore, i as McpManager, n as SubagentOrchestrator, o as WebSocketConnectionManager, q as buildSystemPrompt, r as AgentStore, s as WebSocketLlmBackend, t as BackgroundAgentManager, v as createFindDefinitionTool, w as createBackgroundAgentTools, x as createSkillTool, y as createTodoStore } from "../BackgroundAgentManager-
|
|
3
|
-
import { n as logger, r as getApiUrl, t as ConfigStore } from "../ConfigStore-
|
|
2
|
+
import { C as createCoordinateTaskTool, D as FallbackLlmBackend, E as ApiClient, F as generateCliTools, G as ReActAgent, N as loadContextFiles, O as ServerLlmBackend, P as PermissionManager, Q as CheckpointStore, T as createAgentDelegateTool, W as setWebSocketToolExecutor, X as RemoteSkillSource, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createGetFileStructureTool, a as WebSocketToolExecutor, b as createWriteTodosTool, et as SessionStore, i as McpManager, n as SubagentOrchestrator, o as WebSocketConnectionManager, q as buildSystemPrompt, r as AgentStore, s as WebSocketLlmBackend, t as BackgroundAgentManager, v as createFindDefinitionTool, w as createBackgroundAgentTools, x as createSkillTool, y as createTodoStore } from "../BackgroundAgentManager-ChmoEU9H.mjs";
|
|
3
|
+
import { n as logger, r as getApiUrl, t as ConfigStore } from "../ConfigStore-yJU1dxpP.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 version } from "../package-
|
|
2
|
+
import { t as version } from "../package-B3f78bSl.mjs";
|
|
3
3
|
import { c as isNpmPrefixWritable, l as setAutoUpdatePreference, n as REEXEC_GUARD_ENV, o as forceCheckForUpdate, r as checkForUpdate, s as getAutoUpdatePreference, t as INSTALL_CMD, u as shouldAttemptAutoUpdate } from "../updateChecker-C8xsNY2L.mjs";
|
|
4
4
|
import { t as checkRipgrep } from "../ripgrepCheck-BmkyTK2i.mjs";
|
|
5
5
|
import { execSync, spawnSync } from "child_process";
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as CommandHistoryStore, A as substituteArguments, B as DEFAULT_RETRY_CONFIG, C as createCoordinateTaskTool, D as FallbackLlmBackend, E as ApiClient, F as generateCliTools, G as ReActAgent, H as clearFeatureModuleTools, I as getProcessHooks, J as buildSkillsPromptSection, K as getPlanModeFilePath, L as ALWAYS_DENIED_FOR_AGENTS, M as extractCompactInstructions, N as loadContextFiles, O as ServerLlmBackend, P as PermissionManager, Q as CheckpointStore, R as DEFAULT_AGENT_MODEL, S as parseAgentConfig, T as createAgentDelegateTool, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as RemoteSkillSource, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createGetFileStructureTool, a as WebSocketToolExecutor, at as mergeCommands, b as createWriteTodosTool, c as createReviewGateStore, ct as warmFileCache, d as createBlockerStore, et as SessionStore, f as createBlockerTools, g as formatDecisionsOutput, h as createDecisionStore, i as McpManager, it as searchCommands, j as formatStep, k as isTransientNetworkError, l as createReviewGateTool, m as createDecisionLogTool, n as SubagentOrchestrator, nt as hasFileReferences, o as WebSocketConnectionManager, ot as formatFileSize, p as formatBlockersOutput, q as buildSystemPrompt, r as AgentStore, rt as processFileReferences, s as WebSocketLlmBackend, st as searchFiles, t as BackgroundAgentManager, tt as OAuthClient, u as formatReviewGatesOutput, v as createFindDefinitionTool, w as createBackgroundAgentTools, x as createSkillTool, y as createTodoStore, z as DEFAULT_MAX_ITERATIONS } from "./BackgroundAgentManager-
|
|
2
|
+
import { $ as CommandHistoryStore, A as substituteArguments, B as DEFAULT_RETRY_CONFIG, C as createCoordinateTaskTool, D as FallbackLlmBackend, E as ApiClient, F as generateCliTools, G as ReActAgent, H as clearFeatureModuleTools, I as getProcessHooks, J as buildSkillsPromptSection, K as getPlanModeFilePath, L as ALWAYS_DENIED_FOR_AGENTS, M as extractCompactInstructions, N as loadContextFiles, O as ServerLlmBackend, P as PermissionManager, Q as CheckpointStore, R as DEFAULT_AGENT_MODEL, S as parseAgentConfig, T as createAgentDelegateTool, U as registerFeatureModuleTools, V as DEFAULT_THOROUGHNESS, W as setWebSocketToolExecutor, X as RemoteSkillSource, Y as isReadOnlyTool, Z as CustomCommandStore, _ as createGetFileStructureTool, a as WebSocketToolExecutor, at as mergeCommands, b as createWriteTodosTool, c as createReviewGateStore, ct as warmFileCache, d as createBlockerStore, et as SessionStore, f as createBlockerTools, g as formatDecisionsOutput, h as createDecisionStore, i as McpManager, it as searchCommands, j as formatStep, k as isTransientNetworkError, l as createReviewGateTool, m as createDecisionLogTool, n as SubagentOrchestrator, nt as hasFileReferences, o as WebSocketConnectionManager, ot as formatFileSize, p as formatBlockersOutput, q as buildSystemPrompt, r as AgentStore, rt as processFileReferences, s as WebSocketLlmBackend, st as searchFiles, t as BackgroundAgentManager, tt as OAuthClient, u as formatReviewGatesOutput, v as createFindDefinitionTool, w as createBackgroundAgentTools, x as createSkillTool, y as createTodoStore, z as DEFAULT_MAX_ITERATIONS } from "./BackgroundAgentManager-ChmoEU9H.mjs";
|
|
3
3
|
import { n as useCliStore, t as selectActiveBackgroundAgents } from "./store-DV5s-qni.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { t as version } from "./package-
|
|
4
|
+
import { Xt as validateJupyterKernelName, Zt as validateNotebookPath$1, b as ChatModels, i as getCreditsUrl, n as logger, o as getEnvironmentName, r as getApiUrl, t as ConfigStore, v as CREDIT_DEDUCT_TRANSACTION_TYPES } from "./ConfigStore-yJU1dxpP.mjs";
|
|
5
|
+
import { t as version } from "./package-B3f78bSl.mjs";
|
|
6
6
|
import { r as checkForUpdate } from "./updateChecker-C8xsNY2L.mjs";
|
|
7
7
|
import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
8
8
|
import { Box, Static, Text, render, useApp, useInput, usePaste, useStdout } from "ink";
|
|
@@ -8139,7 +8139,7 @@ Multi-line Input:
|
|
|
8139
8139
|
console.log("Connect to a self-hosted Bike4Mind instance.");
|
|
8140
8140
|
console.log("");
|
|
8141
8141
|
console.log("Example:");
|
|
8142
|
-
console.log(" /set-api https://
|
|
8142
|
+
console.log(" /set-api https://app.your-instance.example.com");
|
|
8143
8143
|
console.log("");
|
|
8144
8144
|
return;
|
|
8145
8145
|
}
|
|
@@ -8147,7 +8147,7 @@ Multi-line Input:
|
|
|
8147
8147
|
new URL(url);
|
|
8148
8148
|
} catch {
|
|
8149
8149
|
console.log(`\n❌ Invalid URL: ${url}`);
|
|
8150
|
-
console.log("Please provide a valid HTTPS URL (e.g., https://
|
|
8150
|
+
console.log("Please provide a valid HTTPS URL (e.g., https://app.your-instance.example.com)\n");
|
|
8151
8151
|
return;
|
|
8152
8152
|
}
|
|
8153
8153
|
await state.configStore.setCustomApiUrl(url);
|
|
@@ -8569,7 +8569,8 @@ Multi-line Input:
|
|
|
8569
8569
|
console.log(`Days Remaining: ${daysRemainingStr}`);
|
|
8570
8570
|
if (currentCredits === 0) {
|
|
8571
8571
|
console.log("\n⚠️ You have no credits remaining.");
|
|
8572
|
-
|
|
8572
|
+
const creditsUrl = getCreditsUrl();
|
|
8573
|
+
if (creditsUrl) console.log(`💡 Visit ${creditsUrl} to purchase more credits.\n`);
|
|
8573
8574
|
break;
|
|
8574
8575
|
}
|
|
8575
8576
|
if (sortedModels.length > 0) {
|
|
@@ -13,8 +13,8 @@ process.emitWarning = originalEmitWarning;
|
|
|
13
13
|
* Generate TOTP setup data including secret and QR code
|
|
14
14
|
* Using the same implementation as polaris
|
|
15
15
|
*/
|
|
16
|
-
async function generateTOTPSetup(userEmail, appName = "
|
|
17
|
-
const secret = speakeasy.generateSecret({ name: `${appName} (${userEmail})` });
|
|
16
|
+
async function generateTOTPSetup(userEmail, appName = process.env.APP_NAME || "") {
|
|
17
|
+
const secret = speakeasy.generateSecret({ name: appName ? `${appName} (${userEmail})` : userEmail });
|
|
18
18
|
const qrCodeUrl = await QRCode.toDataURL(secret.otpauth_url);
|
|
19
19
|
return {
|
|
20
20
|
secret: secret.base32,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.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.4.
|
|
111
|
-
"@bike4mind/llm-adapters": "0.
|
|
110
|
+
"@bike4mind/fab-pipeline": "0.4.4",
|
|
111
|
+
"@bike4mind/llm-adapters": "0.6.2",
|
|
112
112
|
"@bike4mind/observability": "0.2.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.9",
|
|
127
|
-
"@bike4mind/agents": "0.16.
|
|
128
|
-
"@bike4mind/common": "2.
|
|
129
|
-
"@bike4mind/mcp": "1.39.
|
|
130
|
-
"@bike4mind/services": "2.
|
|
131
|
-
"@bike4mind/utils": "2.25.
|
|
127
|
+
"@bike4mind/agents": "0.16.4",
|
|
128
|
+
"@bike4mind/common": "2.116.0",
|
|
129
|
+
"@bike4mind/mcp": "1.39.4",
|
|
130
|
+
"@bike4mind/services": "2.99.1",
|
|
131
|
+
"@bike4mind/utils": "2.25.4"
|
|
132
132
|
},
|
|
133
133
|
"optionalDependencies": {
|
|
134
134
|
"@vscode/ripgrep": "^1.18.0"
|
package/dist/utils-BGtSXfce.mjs
DELETED