@bike4mind/cli 0.2.31-cli-update-command.19462 → 0.2.31-conard-help-dashboard-feedback.19491
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 +0 -48
- package/dist/{artifactExtractor-22AVFN7A.js → artifactExtractor-Z6CL6QFN.js} +1 -1
- package/dist/{chunk-DEW32L4X.js → chunk-2LLA4MTN.js} +2 -2
- package/dist/{chunk-E77VWEKZ.js → chunk-GE7Q64MS.js} +120 -13
- package/dist/{chunk-24JZFYBV.js → chunk-RI45VJW3.js} +57 -2
- package/dist/{chunk-6HWTNX47.js → chunk-T67NGQW6.js} +2 -2
- package/dist/{chunk-U4HDDXWT.js → chunk-ZOWCX4MQ.js} +2 -2
- package/dist/{create-LTISVVKL.js → create-JNUW7ICC.js} +3 -3
- package/dist/index.js +1039 -49
- package/dist/{llmMarkdownGenerator-DF7EFQZW.js → llmMarkdownGenerator-KGA4HTQN.js} +1 -1
- package/dist/{markdownGenerator-6TAH7OEH.js → markdownGenerator-ERG7FI5H.js} +1 -1
- package/dist/{mementoService-BY5ACS3K.js → mementoService-I56R5DNA.js} +3 -3
- package/dist/{src-C5QSTGEZ.js → src-EMANOLFK.js} +6 -2
- package/dist/{src-ZXFQ5Y4O.js → src-IAR65K73.js} +15 -1
- package/dist/{subtractCredits-V645IMXQ.js → subtractCredits-3MEQF5CV.js} +3 -3
- package/package.json +6 -6
- package/dist/chunk-FZXNUST6.js +0 -244
- package/dist/commands/doctorCommand.js +0 -87
- package/dist/commands/updateCommand.js +0 -42
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findMostSimilarMemento,
|
|
4
4
|
getRelevantMementos
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-T67NGQW6.js";
|
|
6
|
+
import "./chunk-RI45VJW3.js";
|
|
7
|
+
import "./chunk-GE7Q64MS.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
findMostSimilarMemento,
|
|
@@ -65,6 +65,7 @@ import {
|
|
|
65
65
|
VoyageAIEmbeddingProvider,
|
|
66
66
|
XAIBackend,
|
|
67
67
|
XAIImageService,
|
|
68
|
+
_resetLambdaErrorHandlers,
|
|
68
69
|
aiImageService,
|
|
69
70
|
aiVideoService,
|
|
70
71
|
buildAndSortMessages,
|
|
@@ -125,6 +126,7 @@ import {
|
|
|
125
126
|
parseQuestPlanFunctionCall,
|
|
126
127
|
processFabFilesServer,
|
|
127
128
|
processUrlsFromPrompt,
|
|
129
|
+
registerLambdaErrorHandlers,
|
|
128
130
|
secureParameters,
|
|
129
131
|
sendToConnection,
|
|
130
132
|
shouldTriggerFallback,
|
|
@@ -137,12 +139,12 @@ import {
|
|
|
137
139
|
validateUrlForFetch,
|
|
138
140
|
warmUpSettingsCache,
|
|
139
141
|
withRetry
|
|
140
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-RI45VJW3.js";
|
|
141
143
|
import {
|
|
142
144
|
buildRateLimitLogEntry,
|
|
143
145
|
isNearLimit,
|
|
144
146
|
parseRateLimitHeaders
|
|
145
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-GE7Q64MS.js";
|
|
146
148
|
import {
|
|
147
149
|
Logger,
|
|
148
150
|
NotificationDeduplicator,
|
|
@@ -219,6 +221,7 @@ export {
|
|
|
219
221
|
VoyageAIEmbeddingProvider,
|
|
220
222
|
XAIBackend,
|
|
221
223
|
XAIImageService,
|
|
224
|
+
_resetLambdaErrorHandlers,
|
|
222
225
|
aiImageService,
|
|
223
226
|
aiVideoService,
|
|
224
227
|
buildAndSortMessages,
|
|
@@ -286,6 +289,7 @@ export {
|
|
|
286
289
|
postMessageToSlack,
|
|
287
290
|
processFabFilesServer,
|
|
288
291
|
processUrlsFromPrompt,
|
|
292
|
+
registerLambdaErrorHandlers,
|
|
289
293
|
secureParameters,
|
|
290
294
|
sendToConnection,
|
|
291
295
|
shouldTriggerFallback,
|
|
@@ -42,6 +42,12 @@ import {
|
|
|
42
42
|
ChatModels,
|
|
43
43
|
CitableSourceSchema,
|
|
44
44
|
ClaudeArtifactMimeTypes,
|
|
45
|
+
CliCompletionChunkAction,
|
|
46
|
+
CliCompletionDoneAction,
|
|
47
|
+
CliCompletionErrorAction,
|
|
48
|
+
CliCompletionRequestAction,
|
|
49
|
+
CliToolRequestAction,
|
|
50
|
+
CliToolResponseAction,
|
|
45
51
|
CollectionType,
|
|
46
52
|
CompletionApiUsageTransaction,
|
|
47
53
|
CompletionRequestSchema,
|
|
@@ -101,6 +107,7 @@ import {
|
|
|
101
107
|
GenericCreditDeductTransaction,
|
|
102
108
|
HeartbeatAction,
|
|
103
109
|
HeartbeatPongAction,
|
|
110
|
+
HelpEvents,
|
|
104
111
|
HtmlArtifactSchema,
|
|
105
112
|
HtmlArtifactV2Schema,
|
|
106
113
|
IMAGE_MODELS,
|
|
@@ -440,7 +447,7 @@ import {
|
|
|
440
447
|
validateReactArtifactV2,
|
|
441
448
|
validateSvgArtifactV2,
|
|
442
449
|
wikiMarkupToAdf
|
|
443
|
-
} from "./chunk-
|
|
450
|
+
} from "./chunk-GE7Q64MS.js";
|
|
444
451
|
export {
|
|
445
452
|
ALL_IMAGE_MODELS,
|
|
446
453
|
ALL_IMAGE_SIZES,
|
|
@@ -485,6 +492,12 @@ export {
|
|
|
485
492
|
ChatModels,
|
|
486
493
|
CitableSourceSchema,
|
|
487
494
|
ClaudeArtifactMimeTypes,
|
|
495
|
+
CliCompletionChunkAction,
|
|
496
|
+
CliCompletionDoneAction,
|
|
497
|
+
CliCompletionErrorAction,
|
|
498
|
+
CliCompletionRequestAction,
|
|
499
|
+
CliToolRequestAction,
|
|
500
|
+
CliToolResponseAction,
|
|
488
501
|
CollectionType,
|
|
489
502
|
CompletionApiUsageTransaction,
|
|
490
503
|
CompletionRequestSchema,
|
|
@@ -544,6 +557,7 @@ export {
|
|
|
544
557
|
GenericCreditDeductTransaction,
|
|
545
558
|
HeartbeatAction,
|
|
546
559
|
HeartbeatPongAction,
|
|
560
|
+
HelpEvents,
|
|
547
561
|
HtmlArtifactSchema,
|
|
548
562
|
HtmlArtifactV2Schema,
|
|
549
563
|
IMAGE_MODELS,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
SubtractCreditsSchema,
|
|
4
4
|
subtractCredits
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-2LLA4MTN.js";
|
|
6
|
+
import "./chunk-RI45VJW3.js";
|
|
7
|
+
import "./chunk-GE7Q64MS.js";
|
|
8
8
|
import "./chunk-OCYRD7D6.js";
|
|
9
9
|
export {
|
|
10
10
|
SubtractCreditsSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.2.31-
|
|
3
|
+
"version": "0.2.31-conard-help-dashboard-feedback.19491+0c31a8d90",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@bike4mind/agents": "0.1.0",
|
|
114
|
-
"@bike4mind/common": "2.52.1-
|
|
115
|
-
"@bike4mind/mcp": "1.31.1-
|
|
116
|
-
"@bike4mind/services": "2.50.1-
|
|
117
|
-
"@bike4mind/utils": "2.7.1-
|
|
114
|
+
"@bike4mind/common": "2.52.1-conard-help-dashboard-feedback.19491+0c31a8d90",
|
|
115
|
+
"@bike4mind/mcp": "1.31.1-conard-help-dashboard-feedback.19491+0c31a8d90",
|
|
116
|
+
"@bike4mind/services": "2.50.1-conard-help-dashboard-feedback.19491+0c31a8d90",
|
|
117
|
+
"@bike4mind/utils": "2.7.1-conard-help-dashboard-feedback.19491+0c31a8d90",
|
|
118
118
|
"@types/better-sqlite3": "^7.6.13",
|
|
119
119
|
"@types/diff": "^5.0.9",
|
|
120
120
|
"@types/jsonwebtoken": "^9.0.4",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"optionalDependencies": {
|
|
136
136
|
"@vscode/ripgrep": "^1.17.0"
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "0c31a8d90e2c427c0e8477916590d72fb3d88d13"
|
|
139
139
|
}
|
package/dist/chunk-FZXNUST6.js
DELETED
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// package.json
|
|
4
|
-
var package_default = {
|
|
5
|
-
name: "@bike4mind/cli",
|
|
6
|
-
version: "0.2.31-cli-update-command.19462+756a8d3f7",
|
|
7
|
-
type: "module",
|
|
8
|
-
description: "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
9
|
-
license: "UNLICENSED",
|
|
10
|
-
author: "Bike4Mind",
|
|
11
|
-
repository: {
|
|
12
|
-
type: "git",
|
|
13
|
-
url: "git+https://github.com/bike4mind/lumina5.git"
|
|
14
|
-
},
|
|
15
|
-
homepage: "https://github.com/bike4mind/lumina5#readme",
|
|
16
|
-
bugs: "https://github.com/bike4mind/lumina5/issues",
|
|
17
|
-
publishConfig: {
|
|
18
|
-
access: "public"
|
|
19
|
-
},
|
|
20
|
-
keywords: [
|
|
21
|
-
"cli",
|
|
22
|
-
"ai",
|
|
23
|
-
"bike4mind",
|
|
24
|
-
"agent",
|
|
25
|
-
"mcp",
|
|
26
|
-
"react-agent"
|
|
27
|
-
],
|
|
28
|
-
bin: {
|
|
29
|
-
b4m: "./bin/bike4mind-cli.mjs",
|
|
30
|
-
bike4mind: "./bin/bike4mind-cli.mjs"
|
|
31
|
-
},
|
|
32
|
-
files: [
|
|
33
|
-
"dist",
|
|
34
|
-
"bin"
|
|
35
|
-
],
|
|
36
|
-
scripts: {
|
|
37
|
-
dev: "tsx src/index.tsx",
|
|
38
|
-
build: "tsup",
|
|
39
|
-
typecheck: "tsc --noEmit",
|
|
40
|
-
test: "vitest run",
|
|
41
|
-
"test:watch": "vitest",
|
|
42
|
-
start: "node dist/index.js",
|
|
43
|
-
prepublishOnly: "pnpm build",
|
|
44
|
-
postinstall: `node -e "try { require('better-sqlite3') } catch(e) { if(e.message.includes('bindings')) { console.log('\\n\u26A0\uFE0F Rebuilding better-sqlite3 native bindings...'); require('child_process').execSync('pnpm rebuild better-sqlite3', {stdio:'inherit'}) } }"`
|
|
45
|
-
},
|
|
46
|
-
dependencies: {
|
|
47
|
-
"@anthropic-ai/sdk": "^0.71.2",
|
|
48
|
-
"@aws-sdk/client-apigatewaymanagementapi": "3.654.0",
|
|
49
|
-
"@aws-sdk/client-bedrock-runtime": "3.654.0",
|
|
50
|
-
"@aws-sdk/client-cloudwatch": "3.654.0",
|
|
51
|
-
"@aws-sdk/client-lambda": "3.654.0",
|
|
52
|
-
"@aws-sdk/client-s3": "3.654.0",
|
|
53
|
-
"@aws-sdk/client-sqs": "3.654.0",
|
|
54
|
-
"@aws-sdk/client-transcribe": "3.654.0",
|
|
55
|
-
"@aws-sdk/credential-provider-node": "3.654.0",
|
|
56
|
-
"@aws-sdk/node-http-handler": "^3.374.0",
|
|
57
|
-
"@aws-sdk/s3-request-presigner": "3.654.0",
|
|
58
|
-
"@casl/ability": "^6.5.0",
|
|
59
|
-
"@google/genai": "^1.27.0",
|
|
60
|
-
"@google/generative-ai": "^0.21.0",
|
|
61
|
-
"@joplin/turndown-plugin-gfm": "^1.0.62",
|
|
62
|
-
"@mendable/firecrawl-js": "^1.29.3",
|
|
63
|
-
"@modelcontextprotocol/sdk": "1.20.1",
|
|
64
|
-
"@octokit/rest": "^22.0.0",
|
|
65
|
-
"@opensearch-project/opensearch": "2.11.0",
|
|
66
|
-
"async-mutex": "^0.5.0",
|
|
67
|
-
axios: "^1.13.2",
|
|
68
|
-
bcryptjs: "^2.4.3",
|
|
69
|
-
"better-sqlite3": "^12.5.0",
|
|
70
|
-
cheerio: "1.0.0-rc.12",
|
|
71
|
-
"cli-highlight": "^2.1.11",
|
|
72
|
-
"csv-parse": "^5.5.6",
|
|
73
|
-
dayjs: "^1.11.13",
|
|
74
|
-
diff: "^8.0.2",
|
|
75
|
-
dotenv: "^16.3.1",
|
|
76
|
-
"eventsource-parser": "^3.0.6",
|
|
77
|
-
"file-type": "^18.7.0",
|
|
78
|
-
"fuse.js": "^7.1.0",
|
|
79
|
-
glob: "^13.0.0",
|
|
80
|
-
"gray-matter": "^4.0.3",
|
|
81
|
-
ink: "^6.5.1",
|
|
82
|
-
"ink-select-input": "^6.2.0",
|
|
83
|
-
"ink-spinner": "^5.0.0",
|
|
84
|
-
"ink-text-input": "^6.0.0",
|
|
85
|
-
jsonwebtoken: "^9.0.2",
|
|
86
|
-
lodash: "^4.17.21",
|
|
87
|
-
mammoth: "^1.11.0",
|
|
88
|
-
marked: "^15.0.11",
|
|
89
|
-
mathjs: "^14.2.0",
|
|
90
|
-
"mime-types": "^2.1.35",
|
|
91
|
-
mongoose: "^8.8.3",
|
|
92
|
-
ollama: "^0.5.12",
|
|
93
|
-
open: "^11.0.0",
|
|
94
|
-
openai: "^6.18.0",
|
|
95
|
-
"p-limit": "^6.2.0",
|
|
96
|
-
picomatch: "^4.0.3",
|
|
97
|
-
qrcode: "^1.5.4",
|
|
98
|
-
react: "^19.2.3",
|
|
99
|
-
sharp: "^0.34.5",
|
|
100
|
-
speakeasy: "^2.0.0",
|
|
101
|
-
tiktoken: "^1.0.16",
|
|
102
|
-
"tree-sitter-wasms": "^0.1.13",
|
|
103
|
-
turndown: "^7.2.0",
|
|
104
|
-
unpdf: "^0.10.0",
|
|
105
|
-
uuid: "^9.0.1",
|
|
106
|
-
voyageai: "^0.0.4",
|
|
107
|
-
"web-tree-sitter": "0.25.10",
|
|
108
|
-
xlsx: "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
|
|
109
|
-
yargs: "^17.7.2",
|
|
110
|
-
yauzl: "^3.1.3",
|
|
111
|
-
zod: "^3.25.76",
|
|
112
|
-
"zod-validation-error": "^1.5.0",
|
|
113
|
-
zustand: "^4.5.4"
|
|
114
|
-
},
|
|
115
|
-
devDependencies: {
|
|
116
|
-
"@bike4mind/agents": "0.1.0",
|
|
117
|
-
"@bike4mind/common": "2.52.1-cli-update-command.19462+756a8d3f7",
|
|
118
|
-
"@bike4mind/mcp": "1.31.1-cli-update-command.19462+756a8d3f7",
|
|
119
|
-
"@bike4mind/services": "2.50.1-cli-update-command.19462+756a8d3f7",
|
|
120
|
-
"@bike4mind/utils": "2.7.1-cli-update-command.19462+756a8d3f7",
|
|
121
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
122
|
-
"@types/diff": "^5.0.9",
|
|
123
|
-
"@types/jsonwebtoken": "^9.0.4",
|
|
124
|
-
"@types/node": "^22.9.0",
|
|
125
|
-
"@types/picomatch": "^4.0.2",
|
|
126
|
-
"@types/react": "^19.2.7",
|
|
127
|
-
"@types/uuid": "^9.0.7",
|
|
128
|
-
"@types/yargs": "^17.0.32",
|
|
129
|
-
fdir: "^6.5.0",
|
|
130
|
-
fzf: "^0.5.2",
|
|
131
|
-
ignore: "^7.0.5",
|
|
132
|
-
"ink-testing-library": "^4.0.0",
|
|
133
|
-
tsup: "^8.5.1",
|
|
134
|
-
tsx: "^4.21.0",
|
|
135
|
-
typescript: "^5.9.3",
|
|
136
|
-
vitest: "^3.2.4"
|
|
137
|
-
},
|
|
138
|
-
optionalDependencies: {
|
|
139
|
-
"@vscode/ripgrep": "^1.17.0"
|
|
140
|
-
},
|
|
141
|
-
gitHead: "756a8d3f7ab2aea0a86e81cb2f983eb6dae453c1"
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// src/utils/updateChecker.ts
|
|
145
|
-
import { promises as fs } from "fs";
|
|
146
|
-
import path from "path";
|
|
147
|
-
import { homedir } from "os";
|
|
148
|
-
import axios from "axios";
|
|
149
|
-
var CACHE_FILE = path.join(homedir(), ".bike4mind", "update-check.json");
|
|
150
|
-
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
151
|
-
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@bike4mind/cli/latest";
|
|
152
|
-
var FETCH_TIMEOUT_MS = 5e3;
|
|
153
|
-
function compareSemver(a, b) {
|
|
154
|
-
const partsA = a.split(".").map(Number);
|
|
155
|
-
const partsB = b.split(".").map(Number);
|
|
156
|
-
for (let i = 0; i < 3; i++) {
|
|
157
|
-
const segA = partsA[i] ?? 0;
|
|
158
|
-
const segB = partsB[i] ?? 0;
|
|
159
|
-
if (segA < segB) return -1;
|
|
160
|
-
if (segA > segB) return 1;
|
|
161
|
-
}
|
|
162
|
-
return 0;
|
|
163
|
-
}
|
|
164
|
-
async function fetchLatestVersion() {
|
|
165
|
-
try {
|
|
166
|
-
const response = await axios.get(NPM_REGISTRY_URL, {
|
|
167
|
-
timeout: FETCH_TIMEOUT_MS,
|
|
168
|
-
headers: { Accept: "application/json" }
|
|
169
|
-
});
|
|
170
|
-
const version = response.data?.version;
|
|
171
|
-
return typeof version === "string" ? version : null;
|
|
172
|
-
} catch {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
async function readCache() {
|
|
177
|
-
try {
|
|
178
|
-
const data = await fs.readFile(CACHE_FILE, "utf-8");
|
|
179
|
-
const parsed = JSON.parse(data);
|
|
180
|
-
if (parsed && typeof parsed.lastChecked === "string" && typeof parsed.latestVersion === "string") {
|
|
181
|
-
return parsed;
|
|
182
|
-
}
|
|
183
|
-
return null;
|
|
184
|
-
} catch {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function writeCache(cache) {
|
|
189
|
-
try {
|
|
190
|
-
await fs.mkdir(path.dirname(CACHE_FILE), { recursive: true });
|
|
191
|
-
await fs.writeFile(CACHE_FILE, JSON.stringify(cache, null, 2), "utf-8");
|
|
192
|
-
} catch {
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
async function checkForUpdate(currentVersion) {
|
|
196
|
-
try {
|
|
197
|
-
const cache = await readCache();
|
|
198
|
-
if (cache && cache.currentVersion === currentVersion) {
|
|
199
|
-
const age = Date.now() - new Date(cache.lastChecked).getTime();
|
|
200
|
-
if (age < CACHE_TTL_MS) {
|
|
201
|
-
return {
|
|
202
|
-
currentVersion,
|
|
203
|
-
latestVersion: cache.latestVersion,
|
|
204
|
-
updateAvailable: compareSemver(cache.latestVersion, currentVersion) > 0
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
const latestVersion = await fetchLatestVersion();
|
|
209
|
-
if (!latestVersion) return null;
|
|
210
|
-
await writeCache({
|
|
211
|
-
lastChecked: (/* @__PURE__ */ new Date()).toISOString(),
|
|
212
|
-
latestVersion,
|
|
213
|
-
currentVersion
|
|
214
|
-
});
|
|
215
|
-
return {
|
|
216
|
-
currentVersion,
|
|
217
|
-
latestVersion,
|
|
218
|
-
updateAvailable: compareSemver(latestVersion, currentVersion) > 0
|
|
219
|
-
};
|
|
220
|
-
} catch {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
async function forceCheckForUpdate(currentVersion) {
|
|
225
|
-
const latestVersion = await fetchLatestVersion();
|
|
226
|
-
if (!latestVersion) return null;
|
|
227
|
-
await writeCache({
|
|
228
|
-
lastChecked: (/* @__PURE__ */ new Date()).toISOString(),
|
|
229
|
-
latestVersion,
|
|
230
|
-
currentVersion
|
|
231
|
-
});
|
|
232
|
-
return {
|
|
233
|
-
currentVersion,
|
|
234
|
-
latestVersion,
|
|
235
|
-
updateAvailable: compareSemver(latestVersion, currentVersion) > 0
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export {
|
|
240
|
-
package_default,
|
|
241
|
-
fetchLatestVersion,
|
|
242
|
-
checkForUpdate,
|
|
243
|
-
forceCheckForUpdate
|
|
244
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
fetchLatestVersion,
|
|
4
|
-
forceCheckForUpdate,
|
|
5
|
-
package_default
|
|
6
|
-
} from "../chunk-FZXNUST6.js";
|
|
7
|
-
|
|
8
|
-
// src/commands/doctorCommand.ts
|
|
9
|
-
import { execSync } from "child_process";
|
|
10
|
-
import { existsSync, constants } from "fs";
|
|
11
|
-
import { promises as fsPromises } from "fs";
|
|
12
|
-
import path from "path";
|
|
13
|
-
import { homedir } from "os";
|
|
14
|
-
async function handleDoctorCommand() {
|
|
15
|
-
console.log("B4M CLI Doctor\n");
|
|
16
|
-
console.log("Running diagnostics...\n");
|
|
17
|
-
const results = [];
|
|
18
|
-
const nodeVersion = process.version;
|
|
19
|
-
const nodeMajor = parseInt(nodeVersion.slice(1).split(".")[0], 10);
|
|
20
|
-
if (nodeMajor >= 18) {
|
|
21
|
-
results.push({ name: "Node.js version", status: "pass", message: `${nodeVersion} (>= 18 required)` });
|
|
22
|
-
} else {
|
|
23
|
-
results.push({
|
|
24
|
-
name: "Node.js version",
|
|
25
|
-
status: "fail",
|
|
26
|
-
message: `${nodeVersion} (>= 18 required, please upgrade)`
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const latestVersion = await fetchLatestVersion();
|
|
30
|
-
if (latestVersion) {
|
|
31
|
-
results.push({ name: "NPM registry", status: "pass", message: `Accessible (latest: v${latestVersion})` });
|
|
32
|
-
} else {
|
|
33
|
-
results.push({ name: "NPM registry", status: "fail", message: "Not accessible \u2014 check your internet connection" });
|
|
34
|
-
}
|
|
35
|
-
const currentVersion = package_default.version;
|
|
36
|
-
const updateResult = await forceCheckForUpdate(currentVersion);
|
|
37
|
-
if (updateResult) {
|
|
38
|
-
if (updateResult.updateAvailable) {
|
|
39
|
-
results.push({
|
|
40
|
-
name: "Version",
|
|
41
|
-
status: "warn",
|
|
42
|
-
message: `v${currentVersion} installed, v${updateResult.latestVersion} available. Run: b4m update`
|
|
43
|
-
});
|
|
44
|
-
} else {
|
|
45
|
-
results.push({ name: "Version", status: "pass", message: `v${currentVersion} (latest)` });
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
const npmPrefix = execSync("npm config get prefix", { encoding: "utf-8", timeout: 1e4 }).trim();
|
|
50
|
-
try {
|
|
51
|
-
await fsPromises.access(npmPrefix, constants.W_OK);
|
|
52
|
-
results.push({ name: "Global npm path", status: "pass", message: `${npmPrefix} (writable)` });
|
|
53
|
-
} catch {
|
|
54
|
-
results.push({
|
|
55
|
-
name: "Global npm path",
|
|
56
|
-
status: "warn",
|
|
57
|
-
message: `${npmPrefix} (not writable \u2014 may need sudo for updates)`
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
} catch {
|
|
61
|
-
results.push({ name: "Global npm path", status: "warn", message: "Could not determine npm prefix" });
|
|
62
|
-
}
|
|
63
|
-
const configFile = path.join(homedir(), ".bike4mind", "config.json");
|
|
64
|
-
if (existsSync(configFile)) {
|
|
65
|
-
results.push({ name: "Config file", status: "pass", message: configFile });
|
|
66
|
-
} else {
|
|
67
|
-
results.push({ name: "Config file", status: "warn", message: `Not found at ${configFile}` });
|
|
68
|
-
}
|
|
69
|
-
console.log("Results:\n");
|
|
70
|
-
for (const result of results) {
|
|
71
|
-
const icon = result.status === "pass" ? "\x1B[32m\u2713\x1B[0m" : result.status === "warn" ? "\x1B[33m!\x1B[0m" : "\x1B[31m\u2717\x1B[0m";
|
|
72
|
-
console.log(` ${icon} ${result.name}: ${result.message}`);
|
|
73
|
-
}
|
|
74
|
-
const failures = results.filter((r) => r.status === "fail");
|
|
75
|
-
const warnings = results.filter((r) => r.status === "warn");
|
|
76
|
-
console.log("");
|
|
77
|
-
if (failures.length > 0) {
|
|
78
|
-
console.log(`${failures.length} issue(s) found.`);
|
|
79
|
-
} else if (warnings.length > 0) {
|
|
80
|
-
console.log(`All checks passed with ${warnings.length} warning(s).`);
|
|
81
|
-
} else {
|
|
82
|
-
console.log("All checks passed.");
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
handleDoctorCommand
|
|
87
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
forceCheckForUpdate,
|
|
4
|
-
package_default
|
|
5
|
-
} from "../chunk-FZXNUST6.js";
|
|
6
|
-
|
|
7
|
-
// src/commands/updateCommand.ts
|
|
8
|
-
import { execSync } from "child_process";
|
|
9
|
-
async function handleUpdateCommand() {
|
|
10
|
-
const currentVersion = package_default.version;
|
|
11
|
-
console.log(`Current version: v${currentVersion}`);
|
|
12
|
-
console.log("Checking for updates...\n");
|
|
13
|
-
const result = await forceCheckForUpdate(currentVersion);
|
|
14
|
-
if (!result) {
|
|
15
|
-
console.error("Failed to check for updates. Check your internet connection.");
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
if (!result.updateAvailable) {
|
|
19
|
-
console.log(`Already on the latest version (v${currentVersion}).`);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
console.log(`Update available: v${currentVersion} \u2192 v${result.latestVersion}
|
|
23
|
-
`);
|
|
24
|
-
console.log("Installing update...\n");
|
|
25
|
-
try {
|
|
26
|
-
execSync("npm install -g @bike4mind/cli@latest", {
|
|
27
|
-
stdio: "inherit",
|
|
28
|
-
timeout: 12e4
|
|
29
|
-
});
|
|
30
|
-
console.log(`
|
|
31
|
-
Successfully updated to v${result.latestVersion}.`);
|
|
32
|
-
} catch {
|
|
33
|
-
console.error("\nUpdate failed. Try running manually:");
|
|
34
|
-
console.error(" npm install -g @bike4mind/cli@latest");
|
|
35
|
-
console.error("\nIf you get permission errors, try:");
|
|
36
|
-
console.error(" sudo npm install -g @bike4mind/cli@latest");
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
handleUpdateCommand
|
|
42
|
-
};
|