@bike4mind/cli 0.2.31-b4m-cli-undo-command.19493 → 0.2.31-b4m-cli-undo-command.19534
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/bin/bike4mind-cli.mjs +48 -0
- package/dist/{artifactExtractor-Z6CL6QFN.js → artifactExtractor-T6NJ7V7P.js} +1 -1
- package/dist/{chunk-LBTTUQJM.js → chunk-32PKF3N7.js} +16 -15
- package/dist/{chunk-RI45VJW3.js → chunk-3SPW5FYJ.js} +3 -3
- package/dist/{chunk-ZOWCX4MQ.js → chunk-ERV5G6MX.js} +3 -3
- package/dist/{chunk-2LLA4MTN.js → chunk-F4PXVLZX.js} +2 -2
- package/dist/{chunk-T67NGQW6.js → chunk-JWJF6O4L.js} +3 -3
- package/dist/{chunk-GE7Q64MS.js → chunk-NI22LIK3.js} +167 -165
- package/dist/{chunk-OCYRD7D6.js → chunk-PFBYGCOW.js} +109 -31
- package/dist/chunk-WVFOWKNW.js +244 -0
- package/dist/commands/doctorCommand.js +87 -0
- package/dist/commands/mcpCommand.js +1 -1
- package/dist/commands/updateCommand.js +42 -0
- package/dist/create-XOEMSBER.js +12 -0
- package/dist/index.js +161 -284
- package/dist/{llmMarkdownGenerator-KGA4HTQN.js → llmMarkdownGenerator-NPX7ULSW.js} +1 -1
- package/dist/{markdownGenerator-ERG7FI5H.js → markdownGenerator-TVJ2RQXC.js} +1 -1
- package/dist/{mementoService-I56R5DNA.js → mementoService-HGH2XVLM.js} +4 -4
- package/dist/{notificationDeduplicator-UTHJHMSZ.js → notificationDeduplicator-HUC53NEW.js} +1 -1
- package/dist/{src-IAR65K73.js → src-2BRBILH7.js} +1 -1
- package/dist/{src-EMANOLFK.js → src-JZ6OHGTX.js} +3 -3
- package/dist/{subtractCredits-3MEQF5CV.js → subtractCredits-4VIHTUR4.js} +4 -4
- package/package.json +9 -9
- package/dist/create-JNUW7ICC.js +0 -12
package/bin/bike4mind-cli.mjs
CHANGED
|
@@ -88,6 +88,8 @@ const argv = await yargs(hideBin(process.argv))
|
|
|
88
88
|
})
|
|
89
89
|
.demandCommand(1, 'You must provide a subcommand (list, add, remove, enable, disable)');
|
|
90
90
|
})
|
|
91
|
+
.command('update', 'Check for and install CLI updates')
|
|
92
|
+
.command('doctor', 'Run diagnostic checks on CLI installation')
|
|
91
93
|
.help()
|
|
92
94
|
.alias('help', 'h')
|
|
93
95
|
.version()
|
|
@@ -149,6 +151,52 @@ if (argv._[0] === 'mcp') {
|
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
|
|
154
|
+
// Handle update command (external command)
|
|
155
|
+
if (argv._[0] === 'update') {
|
|
156
|
+
try {
|
|
157
|
+
let handleUpdateCommand;
|
|
158
|
+
|
|
159
|
+
if (isDev) {
|
|
160
|
+
const { register } = require('tsx/esm/api');
|
|
161
|
+
register();
|
|
162
|
+
const module = await import('../src/commands/updateCommand.ts');
|
|
163
|
+
handleUpdateCommand = module.handleUpdateCommand;
|
|
164
|
+
} else {
|
|
165
|
+
const module = await import('../dist/commands/updateCommand.js');
|
|
166
|
+
handleUpdateCommand = module.handleUpdateCommand;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
await handleUpdateCommand();
|
|
170
|
+
process.exit(0);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
console.error('Error:', error.message);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Handle doctor command (external command)
|
|
178
|
+
if (argv._[0] === 'doctor') {
|
|
179
|
+
try {
|
|
180
|
+
let handleDoctorCommand;
|
|
181
|
+
|
|
182
|
+
if (isDev) {
|
|
183
|
+
const { register } = require('tsx/esm/api');
|
|
184
|
+
register();
|
|
185
|
+
const module = await import('../src/commands/doctorCommand.ts');
|
|
186
|
+
handleDoctorCommand = module.handleDoctorCommand;
|
|
187
|
+
} else {
|
|
188
|
+
const module = await import('../dist/commands/doctorCommand.js');
|
|
189
|
+
handleDoctorCommand = module.handleDoctorCommand;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
await handleDoctorCommand();
|
|
193
|
+
process.exit(0);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.error('Error:', error.message);
|
|
196
|
+
process.exit(1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
152
200
|
if (isDev) {
|
|
153
201
|
// Show dev mode indicator for developers
|
|
154
202
|
console.log('🔧 Running in development mode (using TypeScript source)\n');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CurationArtifactType
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NI22LIK3.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;
|
|
@@ -269,24 +269,25 @@ var AuthTokensSchema = z.object({
|
|
|
269
269
|
userId: z.string()
|
|
270
270
|
});
|
|
271
271
|
var ApiConfigSchema = z.object({
|
|
272
|
-
customUrl: z.
|
|
272
|
+
customUrl: z.url().optional()
|
|
273
273
|
});
|
|
274
274
|
var McpServerSchema = z.object({
|
|
275
275
|
name: z.string(),
|
|
276
276
|
command: z.string().optional(),
|
|
277
277
|
args: z.array(z.string()).optional(),
|
|
278
|
-
env: z.record(z.string()).
|
|
279
|
-
enabled: z.boolean().
|
|
278
|
+
env: z.record(z.string(), z.string()).prefault({}),
|
|
279
|
+
enabled: z.boolean().prefault(true)
|
|
280
280
|
});
|
|
281
281
|
var McpServersSchema = z.union([
|
|
282
282
|
// Array format (B4M native)
|
|
283
283
|
z.array(McpServerSchema),
|
|
284
284
|
// Object format (portable - compatible with Claude Code)
|
|
285
285
|
z.record(
|
|
286
|
+
z.string(),
|
|
286
287
|
z.object({
|
|
287
288
|
command: z.string().optional(),
|
|
288
289
|
args: z.array(z.string()).optional(),
|
|
289
|
-
env: z.record(z.string()).optional(),
|
|
290
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
290
291
|
enabled: z.boolean().optional()
|
|
291
292
|
})
|
|
292
293
|
)
|
|
@@ -325,24 +326,24 @@ var CliConfigSchema = z.object({
|
|
|
325
326
|
maxTokens: z.number(),
|
|
326
327
|
temperature: z.number(),
|
|
327
328
|
autoSave: z.boolean(),
|
|
328
|
-
autoCompact: z.boolean().optional().
|
|
329
|
+
autoCompact: z.boolean().optional().prefault(true),
|
|
329
330
|
theme: z.enum(["light", "dark"]),
|
|
330
331
|
exportFormat: z.enum(["markdown", "json"]),
|
|
331
|
-
maxIterations: z.number().nullable().
|
|
332
|
-
enableSkillTool: z.boolean().optional().
|
|
332
|
+
maxIterations: z.number().nullable().prefault(10),
|
|
333
|
+
enableSkillTool: z.boolean().optional().prefault(true)
|
|
333
334
|
}),
|
|
334
335
|
tools: z.object({
|
|
335
336
|
enabled: z.array(z.string()),
|
|
336
337
|
disabled: z.array(z.string()),
|
|
337
|
-
config: z.record(z.any())
|
|
338
|
+
config: z.record(z.string(), z.any())
|
|
338
339
|
}),
|
|
339
|
-
trustedTools: z.array(z.string()).optional().
|
|
340
|
+
trustedTools: z.array(z.string()).optional().prefault([])
|
|
340
341
|
});
|
|
341
342
|
var ProjectConfigSchema = z.object({
|
|
342
343
|
tools: z.object({
|
|
343
344
|
enabled: z.array(z.string()).optional(),
|
|
344
345
|
denied: z.array(z.string()).optional(),
|
|
345
|
-
config: z.record(z.any()).optional()
|
|
346
|
+
config: z.record(z.string(), z.any()).optional()
|
|
346
347
|
}).optional(),
|
|
347
348
|
defaultModel: z.string().optional(),
|
|
348
349
|
mcpServers: McpServersSchema.optional(),
|
|
@@ -432,7 +433,7 @@ async function loadProjectConfig(projectDir) {
|
|
|
432
433
|
return null;
|
|
433
434
|
}
|
|
434
435
|
if (error instanceof z.ZodError) {
|
|
435
|
-
console.error("Project config validation error:", error.
|
|
436
|
+
console.error("Project config validation error:", error.issues);
|
|
436
437
|
return null;
|
|
437
438
|
}
|
|
438
439
|
console.error("Failed to load project config:", error);
|
|
@@ -455,7 +456,7 @@ async function loadProjectLocalConfig(projectDir) {
|
|
|
455
456
|
return null;
|
|
456
457
|
}
|
|
457
458
|
if (error instanceof z.ZodError) {
|
|
458
|
-
console.error("Project local config validation error:", error.
|
|
459
|
+
console.error("Project local config validation error:", error.issues);
|
|
459
460
|
return null;
|
|
460
461
|
}
|
|
461
462
|
console.error("Failed to load project local config:", error);
|
|
@@ -478,7 +479,7 @@ async function loadMcpJsonConfig(projectDir) {
|
|
|
478
479
|
return null;
|
|
479
480
|
}
|
|
480
481
|
if (error instanceof z.ZodError) {
|
|
481
|
-
console.error(".mcp.json validation error:", error.
|
|
482
|
+
console.error(".mcp.json validation error:", error.issues);
|
|
482
483
|
return null;
|
|
483
484
|
}
|
|
484
485
|
console.error("Failed to load .mcp.json:", error);
|
|
@@ -620,7 +621,7 @@ var ConfigStore = class {
|
|
|
620
621
|
if (error.code === "ENOENT") {
|
|
621
622
|
globalConfig = { ...DEFAULT_CONFIG };
|
|
622
623
|
} else if (error instanceof z.ZodError) {
|
|
623
|
-
console.error("Global config validation error:", error.
|
|
624
|
+
console.error("Global config validation error:", error.issues);
|
|
624
625
|
console.error("Using default configuration");
|
|
625
626
|
globalConfig = { ...DEFAULT_CONFIG };
|
|
626
627
|
} else {
|
|
@@ -657,7 +658,7 @@ var ConfigStore = class {
|
|
|
657
658
|
return this.reset();
|
|
658
659
|
}
|
|
659
660
|
if (error instanceof z.ZodError) {
|
|
660
|
-
console.error("Config validation error:", error.
|
|
661
|
+
console.error("Config validation error:", error.issues);
|
|
661
662
|
console.error("Resetting to default configuration");
|
|
662
663
|
return this.reset();
|
|
663
664
|
}
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
dayjsConfig_default,
|
|
17
17
|
extractSnippetMeta,
|
|
18
18
|
settingsMap
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NI22LIK3.js";
|
|
20
20
|
import {
|
|
21
21
|
Logger
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-PFBYGCOW.js";
|
|
23
23
|
|
|
24
24
|
// ../../b4m-core/packages/utils/dist/src/storage/S3Storage.js
|
|
25
25
|
import { S3Client, PutObjectCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand } from "@aws-sdk/client-s3";
|
|
@@ -7791,7 +7791,7 @@ function secureParameters(params, schema) {
|
|
|
7791
7791
|
return schema.parse(params);
|
|
7792
7792
|
} catch (e) {
|
|
7793
7793
|
if (isZodError(e)) {
|
|
7794
|
-
throw new UnprocessableEntityError(e.
|
|
7794
|
+
throw new UnprocessableEntityError(e.issues.map((err) => `${err.path.join(".")}: ${err.message}`).join(", "));
|
|
7795
7795
|
}
|
|
7796
7796
|
throw new InternalServerError();
|
|
7797
7797
|
}
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
getSettingsMap,
|
|
8
8
|
getSettingsValue,
|
|
9
9
|
secureParameters
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3SPW5FYJ.js";
|
|
11
11
|
import {
|
|
12
12
|
KnowledgeType,
|
|
13
13
|
SupportedFabFileMimeTypes
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NI22LIK3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/fabFileService/create.js
|
|
17
17
|
import { z } from "zod";
|
|
@@ -20,7 +20,7 @@ var createFabFileSchema = z.object({
|
|
|
20
20
|
fileName: z.string(),
|
|
21
21
|
mimeType: z.string(),
|
|
22
22
|
fileSize: z.number(),
|
|
23
|
-
type: z.
|
|
23
|
+
type: z.enum(KnowledgeType),
|
|
24
24
|
content: z.union([z.string(), z.instanceof(Buffer)]).optional(),
|
|
25
25
|
organizationId: z.string().optional(),
|
|
26
26
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
BadRequestError,
|
|
4
4
|
secureParameters
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3SPW5FYJ.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-
|
|
15
|
+
} from "./chunk-NI22LIK3.js";
|
|
16
16
|
|
|
17
17
|
// ../../b4m-core/packages/services/dist/src/creditService/subtractCredits.js
|
|
18
18
|
import { z } from "zod";
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
getSettingsByNames,
|
|
7
7
|
obfuscateApiKey,
|
|
8
8
|
secureParameters
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3SPW5FYJ.js";
|
|
10
10
|
import {
|
|
11
11
|
ApiKeyType,
|
|
12
12
|
MementoTier,
|
|
13
13
|
isSupportedEmbeddingModel
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NI22LIK3.js";
|
|
15
15
|
|
|
16
16
|
// ../../b4m-core/packages/services/dist/src/apiKeyService/get.js
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
var getApiKeySchema = z.object({
|
|
19
|
-
type: z.
|
|
19
|
+
type: z.enum(ApiKeyType),
|
|
20
20
|
nullIfMissing: z.boolean().optional(),
|
|
21
21
|
obfuscate: z.boolean().optional(),
|
|
22
22
|
demoKeyName: z.string().optional()
|