@newrelic/preflight 1.0.6 → 1.0.7
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/README.md +6 -4
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -5
- package/dist/config.js.map +1 -1
- package/dist/dashboard/routes/api-handler.d.ts.map +1 -1
- package/dist/dashboard/routes/api-handler.js +3 -0
- package/dist/dashboard/routes/api-handler.js.map +1 -1
- package/dist/install/cli.d.ts.map +1 -1
- package/dist/install/cli.js +272 -74
- package/dist/install/cli.js.map +1 -1
- package/dist/install/diagnostics.d.ts.map +1 -1
- package/dist/install/diagnostics.js +224 -159
- package/dist/install/diagnostics.js.map +1 -1
- package/dist/install/json-utils.d.ts +1 -0
- package/dist/install/json-utils.d.ts.map +1 -1
- package/dist/install/json-utils.js +3 -0
- package/dist/install/json-utils.js.map +1 -1
- package/dist/install/schedule.d.ts +15 -2
- package/dist/install/schedule.d.ts.map +1 -1
- package/dist/install/schedule.js +122 -19
- package/dist/install/schedule.js.map +1 -1
- package/dist/install/setup-wizard.d.ts.map +1 -1
- package/dist/install/setup-wizard.js +4 -2
- package/dist/install/setup-wizard.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,238 +1,303 @@
|
|
|
1
1
|
import { accessSync, constants, existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { platform } from 'node:os';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { createLogger } from '../shared/index.js';
|
|
4
5
|
import { validateConfigFile, DEFAULT_STORAGE_PATH } from '../config.js';
|
|
5
|
-
import { getDashboardDaemonStatus } from './schedule.js';
|
|
6
|
+
import { getDashboardDaemonStatus, findExecutableNodeDir } from './schedule.js';
|
|
6
7
|
import { detectSettingsPath, entryContainsNrObserve } from './install-helper.js';
|
|
7
8
|
import { isWsl, resolveWindowsHome } from './platform.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const configPath = opts?.configPath ?? resolve(DEFAULT_STORAGE_PATH, 'config.json');
|
|
11
|
-
const storagePath = opts?.storagePath ?? DEFAULT_STORAGE_PATH;
|
|
12
|
-
const checks = [];
|
|
13
|
-
// Pre-read config once for mode detection; validateConfigFile also reads internally.
|
|
14
|
-
const configRaw = readJsonFile(configPath);
|
|
15
|
-
const mode = typeof configRaw.mode === 'string' ? configRaw.mode : 'cloud';
|
|
16
|
-
// --- Check 1: Config valid ---
|
|
9
|
+
const logger = createLogger('diagnostics');
|
|
10
|
+
function checkConfigValid(configPath, runtimeStoragePath) {
|
|
17
11
|
const validation = validateConfigFile(configPath);
|
|
12
|
+
// Prioritise the caller's runtime-resolved value (env-var-wins, matching
|
|
13
|
+
// loadMcpConfig priority) over the file value so the Storage writable check
|
|
14
|
+
// tests the same path the MCP server actually writes to. Falls back to the
|
|
15
|
+
// file value, then the default. Use || (not ??) so an empty string is treated
|
|
16
|
+
// like a missing value and falls through to the next tier.
|
|
17
|
+
const storagePath = runtimeStoragePath || validation.storagePath || DEFAULT_STORAGE_PATH;
|
|
18
|
+
const effectiveMode = validation.mode ?? 'cloud';
|
|
19
|
+
const licenseKeyEnv = process.env.NEW_RELIC_LICENSE_KEY;
|
|
20
|
+
// Use .trim() so a whitespace-only value (e.g. ' ') is treated as absent,
|
|
21
|
+
// preventing a false-positive NR reachability result when the key is invalid.
|
|
22
|
+
const hasLicenseKey = validation.hasLicenseKey || Boolean(licenseKeyEnv?.trim());
|
|
23
|
+
// Only skip the NR check for structural problems (no file, or file is unparseable).
|
|
24
|
+
// Zod type errors on unrelated fields do not affect reachability — the derived
|
|
25
|
+
// effectiveMode and hasLicenseKey values below still hold even when other fields
|
|
26
|
+
// fail validation, so the check can run and surface connectivity issues in parallel.
|
|
27
|
+
const nrSkipReason = !validation.fileExists
|
|
28
|
+
? 'Skipped (no config file — run preflight setup first)'
|
|
29
|
+
: validation.malformed
|
|
30
|
+
? 'Skipped (config could not be parsed — fix issues above first)'
|
|
31
|
+
: effectiveMode === 'local'
|
|
32
|
+
? 'Skipped (mode: local)'
|
|
33
|
+
: !hasLicenseKey
|
|
34
|
+
? licenseKeyEnv !== undefined
|
|
35
|
+
? 'Skipped (NEW_RELIC_LICENSE_KEY is set but empty or blank — add a valid key)'
|
|
36
|
+
: 'Skipped (licenseKey not configured — set NEW_RELIC_LICENSE_KEY or add to config)'
|
|
37
|
+
: null;
|
|
38
|
+
let check;
|
|
18
39
|
if (!validation.fileExists) {
|
|
19
|
-
|
|
40
|
+
check = {
|
|
20
41
|
check: 'Config valid',
|
|
21
42
|
status: 'warn',
|
|
22
43
|
detail: `No config file at ${configPath} — defaults will apply.`,
|
|
23
44
|
fix: 'preflight setup',
|
|
24
|
-
}
|
|
45
|
+
};
|
|
25
46
|
}
|
|
26
47
|
else if (validation.errors.length > 0) {
|
|
27
|
-
|
|
48
|
+
check = {
|
|
28
49
|
check: 'Config valid',
|
|
29
50
|
status: 'fail',
|
|
30
51
|
detail: validation.errors.join('; '),
|
|
31
52
|
fix: 'Fix the fields listed above, then restart.',
|
|
32
|
-
}
|
|
53
|
+
};
|
|
33
54
|
}
|
|
34
55
|
else if (validation.warnings.length > 0) {
|
|
35
|
-
|
|
56
|
+
check = {
|
|
36
57
|
check: 'Config valid',
|
|
37
58
|
status: 'warn',
|
|
38
59
|
detail: validation.warnings.join('; '),
|
|
39
|
-
}
|
|
60
|
+
};
|
|
40
61
|
}
|
|
41
62
|
else {
|
|
42
|
-
|
|
63
|
+
check = {
|
|
43
64
|
check: 'Config valid',
|
|
44
65
|
status: 'ok',
|
|
45
66
|
detail: `Config loaded from ${configPath}`,
|
|
46
|
-
}
|
|
67
|
+
};
|
|
47
68
|
}
|
|
48
|
-
|
|
69
|
+
return {
|
|
70
|
+
check,
|
|
71
|
+
context: { storagePath, nrSkipReason },
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function checkDaemon() {
|
|
49
75
|
if (platform() !== 'darwin') {
|
|
50
|
-
|
|
51
|
-
check: 'Daemon installed',
|
|
52
|
-
status: 'skip',
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
checks.push({
|
|
56
|
-
check: 'Daemon node path',
|
|
57
|
-
status: 'skip',
|
|
58
|
-
detail: 'Daemon management is macOS-only.',
|
|
59
|
-
});
|
|
76
|
+
return [
|
|
77
|
+
{ check: 'Daemon installed', status: 'skip', detail: 'Daemon management is macOS-only.' },
|
|
78
|
+
{ check: 'Daemon node path', status: 'skip', detail: 'Daemon management is macOS-only.' },
|
|
79
|
+
];
|
|
60
80
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
81
|
+
const daemonStatus = getDashboardDaemonStatus();
|
|
82
|
+
if (!daemonStatus.installed) {
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
65
85
|
check: 'Daemon installed',
|
|
66
|
-
status: '
|
|
67
|
-
detail: 'com.preflight.dashboard.plist not found
|
|
68
|
-
fix: 'preflight install
|
|
69
|
-
}
|
|
70
|
-
|
|
86
|
+
status: 'warn',
|
|
87
|
+
detail: 'com.preflight.dashboard.plist not found — dashboard will only run when Claude Code is open.',
|
|
88
|
+
fix: 'preflight setup (optional: install the always-on background daemon)',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
71
91
|
check: 'Daemon node path',
|
|
72
92
|
status: 'skip',
|
|
73
93
|
detail: 'Daemon not installed — install first.',
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
if (!daemonStatus.readable) {
|
|
98
|
+
return [
|
|
99
|
+
{
|
|
78
100
|
check: 'Daemon installed',
|
|
79
|
-
status: '
|
|
80
|
-
detail: 'com.preflight.dashboard.plist found',
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const plistDirs = plistPathValue.split(':').map(stripTrailingSlash);
|
|
90
|
-
const nodeDir = stripTrailingSlash(dirname(process.execPath));
|
|
91
|
-
if (plistDirs.includes(nodeDir)) {
|
|
92
|
-
checks.push({
|
|
93
|
-
check: 'Daemon node path',
|
|
94
|
-
status: 'ok',
|
|
95
|
-
detail: `${nodeDir} in plist PATH`,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
checks.push({
|
|
100
|
-
check: 'Daemon node path',
|
|
101
|
-
status: 'fail',
|
|
102
|
-
detail: `Node directory ${nodeDir} missing from plist PATH`,
|
|
103
|
-
fix: 'preflight install --daemon',
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
checks.push({
|
|
109
|
-
check: 'Daemon node path',
|
|
110
|
-
status: 'warn',
|
|
111
|
-
detail: 'Could not read plist to verify node path',
|
|
112
|
-
fix: 'preflight install --daemon',
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
101
|
+
status: 'warn',
|
|
102
|
+
detail: 'com.preflight.dashboard.plist found but could not be read',
|
|
103
|
+
fix: 'preflight uninstall --daemon, then preflight setup (answer Y to the daemon prompt)',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
check: 'Daemon node path',
|
|
107
|
+
status: 'skip',
|
|
108
|
+
detail: 'Plist unreadable — daemon status could not be verified.',
|
|
109
|
+
},
|
|
110
|
+
];
|
|
116
111
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
112
|
+
const installedCheck = {
|
|
113
|
+
check: 'Daemon installed',
|
|
114
|
+
status: 'ok',
|
|
115
|
+
detail: 'com.preflight.dashboard.plist found',
|
|
116
|
+
};
|
|
117
|
+
if (!daemonStatus.envPath) {
|
|
118
|
+
return [
|
|
119
|
+
installedCheck,
|
|
120
|
+
{
|
|
121
|
+
check: 'Daemon node path',
|
|
122
|
+
status: 'warn',
|
|
123
|
+
detail: 'Daemon plist predates node-path injection — node upgrades may break it',
|
|
124
|
+
fix: 'preflight uninstall --daemon, then preflight setup (answer Y to the daemon prompt)',
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
const plistDirs = daemonStatus.envPath.split(':').filter(Boolean);
|
|
129
|
+
const { dir: nodeDir, hasNonExecutable } = findExecutableNodeDir(plistDirs);
|
|
130
|
+
let nodePathCheck;
|
|
131
|
+
if (nodeDir !== null) {
|
|
132
|
+
nodePathCheck = {
|
|
133
|
+
check: 'Daemon node path',
|
|
134
|
+
status: 'ok',
|
|
135
|
+
detail: 'node binary found in plist PATH',
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
else if (hasNonExecutable) {
|
|
139
|
+
nodePathCheck = {
|
|
140
|
+
check: 'Daemon node path',
|
|
141
|
+
status: 'fail',
|
|
142
|
+
detail: 'node binary found in plist PATH but is not executable',
|
|
143
|
+
fix: 'Check node permissions (chmod +x <node>), or reinstall: preflight uninstall --daemon && preflight setup',
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
nodePathCheck = {
|
|
148
|
+
check: 'Daemon node path',
|
|
149
|
+
status: 'fail',
|
|
150
|
+
detail: 'No executable node binary found in plist PATH dirs',
|
|
151
|
+
fix: 'preflight uninstall --daemon, then preflight setup (answer Y to the daemon prompt)',
|
|
152
|
+
};
|
|
125
153
|
}
|
|
154
|
+
return [installedCheck, nodePathCheck];
|
|
155
|
+
}
|
|
156
|
+
function checkHooksWired(settingsPaths) {
|
|
126
157
|
const anyPathExists = settingsPaths.some(existsSync);
|
|
127
158
|
let hooksPre = false;
|
|
128
159
|
let hooksPost = false;
|
|
160
|
+
const parseErrorPaths = [];
|
|
161
|
+
let anyParsed = false;
|
|
129
162
|
for (const sp of settingsPaths) {
|
|
130
163
|
if (!existsSync(sp))
|
|
131
164
|
continue;
|
|
132
165
|
try {
|
|
133
166
|
const settings = JSON.parse(readFileSync(sp, 'utf-8'));
|
|
167
|
+
anyParsed = true;
|
|
134
168
|
const hooks = settings.hooks;
|
|
135
169
|
if (Array.isArray(hooks?.PreToolUse))
|
|
136
170
|
hooksPre ||= hooks.PreToolUse.some(entryContainsNrObserve);
|
|
137
171
|
if (Array.isArray(hooks?.PostToolUse))
|
|
138
172
|
hooksPost ||= hooks.PostToolUse.some(entryContainsNrObserve);
|
|
139
173
|
}
|
|
140
|
-
catch {
|
|
141
|
-
|
|
174
|
+
catch (err) {
|
|
175
|
+
logger.debug('settings file could not be parsed — treating as not wired', { err, path: sp });
|
|
176
|
+
parseErrorPaths.push(sp);
|
|
142
177
|
}
|
|
143
178
|
}
|
|
144
179
|
if (!anyPathExists) {
|
|
145
|
-
|
|
180
|
+
return {
|
|
146
181
|
check: 'Hooks wired',
|
|
147
182
|
status: 'fail',
|
|
148
183
|
detail: `Settings file not found: ${settingsPaths.join(' or ')}`,
|
|
149
184
|
fix: 'preflight install',
|
|
150
|
-
}
|
|
185
|
+
};
|
|
151
186
|
}
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
.join(' and ');
|
|
156
|
-
checks.push({
|
|
187
|
+
if (hooksPre && hooksPost) {
|
|
188
|
+
const malformedNote = parseErrorPaths.length > 0 ? `; ${parseErrorPaths.join(' and ')} could not be parsed` : '';
|
|
189
|
+
return {
|
|
157
190
|
check: 'Hooks wired',
|
|
158
|
-
status: '
|
|
159
|
-
detail:
|
|
160
|
-
|
|
161
|
-
|
|
191
|
+
status: parseErrorPaths.length > 0 ? 'warn' : 'ok',
|
|
192
|
+
detail: `PreToolUse and PostToolUse hooks found${malformedNote}`,
|
|
193
|
+
...(parseErrorPaths.length > 0 && {
|
|
194
|
+
fix: 'Fix or delete the malformed file(s), then run: preflight install',
|
|
195
|
+
}),
|
|
196
|
+
};
|
|
162
197
|
}
|
|
163
|
-
|
|
164
|
-
|
|
198
|
+
if (!anyParsed) {
|
|
199
|
+
const plural = parseErrorPaths.length > 1 ? 'files' : 'file';
|
|
200
|
+
return {
|
|
165
201
|
check: 'Hooks wired',
|
|
166
|
-
status: '
|
|
167
|
-
detail:
|
|
168
|
-
|
|
202
|
+
status: 'fail',
|
|
203
|
+
detail: `Settings ${plural} could not be parsed (malformed JSON): ${parseErrorPaths.join(' and ')}`,
|
|
204
|
+
fix: 'Fix or delete the malformed file(s), then run: preflight install',
|
|
205
|
+
};
|
|
169
206
|
}
|
|
170
|
-
|
|
207
|
+
const missing = [!hooksPre && 'PreToolUse', !hooksPost && 'PostToolUse']
|
|
208
|
+
.filter(Boolean)
|
|
209
|
+
.join(' and ');
|
|
210
|
+
const searched = settingsPaths.filter(existsSync).join(' or ');
|
|
211
|
+
const malformedNote = parseErrorPaths.length > 0 ? `; ${parseErrorPaths.join(' and ')} could not be parsed` : '';
|
|
212
|
+
return {
|
|
213
|
+
check: 'Hooks wired',
|
|
214
|
+
status: 'fail',
|
|
215
|
+
detail: `${missing} not found in ${searched}${malformedNote}`,
|
|
216
|
+
fix: 'preflight install',
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function checkStorageWritable(storagePath) {
|
|
171
220
|
try {
|
|
172
221
|
accessSync(storagePath, constants.W_OK);
|
|
173
|
-
|
|
174
|
-
check: 'Storage writable',
|
|
175
|
-
status: 'ok',
|
|
176
|
-
detail: `${storagePath} is writable`,
|
|
177
|
-
});
|
|
222
|
+
return { check: 'Storage writable', status: 'ok', detail: `${storagePath} is writable` };
|
|
178
223
|
}
|
|
179
224
|
catch {
|
|
180
225
|
if (!existsSync(storagePath)) {
|
|
181
|
-
|
|
226
|
+
return {
|
|
182
227
|
check: 'Storage writable',
|
|
183
228
|
status: 'fail',
|
|
184
229
|
detail: `Directory not found: ${storagePath}`,
|
|
185
230
|
fix: `mkdir -p ${storagePath} && chmod 700 ${storagePath}`,
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
checks.push({
|
|
190
|
-
check: 'Storage writable',
|
|
191
|
-
status: 'fail',
|
|
192
|
-
detail: `Directory exists but is not writable: ${storagePath}`,
|
|
193
|
-
fix: `chmod 700 ${storagePath}`,
|
|
194
|
-
});
|
|
231
|
+
};
|
|
195
232
|
}
|
|
233
|
+
return {
|
|
234
|
+
check: 'Storage writable',
|
|
235
|
+
status: 'fail',
|
|
236
|
+
detail: `Directory exists but is not writable: ${storagePath}`,
|
|
237
|
+
fix: `chmod 700 ${storagePath}`,
|
|
238
|
+
};
|
|
196
239
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
status: 'skip',
|
|
202
|
-
detail: 'Skipped (mode: local)',
|
|
203
|
-
});
|
|
240
|
+
}
|
|
241
|
+
async function checkNrReachable(skipReason) {
|
|
242
|
+
if (skipReason !== null) {
|
|
243
|
+
return { check: 'NR reachable', status: 'skip', detail: skipReason };
|
|
204
244
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
catch (err) {
|
|
220
|
-
const isTimeout = err instanceof Error && err.name === 'AbortError';
|
|
221
|
-
checks.push({
|
|
245
|
+
const controller = new AbortController();
|
|
246
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
247
|
+
try {
|
|
248
|
+
const response = await fetch('https://insights-collector.newrelic.com', {
|
|
249
|
+
method: 'HEAD',
|
|
250
|
+
signal: controller.signal,
|
|
251
|
+
});
|
|
252
|
+
// 401/403 indicate the endpoint is reachable but rejected the credentials.
|
|
253
|
+
// Other 4xx (404, 405, etc.) just mean the HEAD / path has no handler —
|
|
254
|
+
// the endpoint is reachable and a 404 here is unrelated to the licenseKey.
|
|
255
|
+
if (response.status === 401 || response.status === 403) {
|
|
256
|
+
return {
|
|
222
257
|
check: 'NR reachable',
|
|
223
|
-
status: '
|
|
224
|
-
detail:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
fix: isTimeout
|
|
228
|
-
? 'Check for a slow proxy or firewall blocking HTTPS.'
|
|
229
|
-
: 'Check network connectivity and that licenseKey is valid.',
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
finally {
|
|
233
|
-
clearTimeout(timeout);
|
|
258
|
+
status: 'warn',
|
|
259
|
+
detail: `insights-collector.newrelic.com replied with HTTP ${response.status} — endpoint is reachable but rejected the request`,
|
|
260
|
+
fix: 'Verify that licenseKey is correct and has Ingest permissions.',
|
|
261
|
+
};
|
|
234
262
|
}
|
|
263
|
+
return {
|
|
264
|
+
check: 'NR reachable',
|
|
265
|
+
status: 'ok',
|
|
266
|
+
detail: 'insights-collector.newrelic.com reachable',
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
catch (err) {
|
|
270
|
+
const isTimeout = err instanceof Error && err.name === 'AbortError';
|
|
271
|
+
return {
|
|
272
|
+
check: 'NR reachable',
|
|
273
|
+
status: 'fail',
|
|
274
|
+
detail: isTimeout
|
|
275
|
+
? 'Request timed out after 5 s — endpoint may be reachable but slow'
|
|
276
|
+
: 'Could not reach insights-collector.newrelic.com',
|
|
277
|
+
fix: isTimeout
|
|
278
|
+
? 'Check for a slow proxy or firewall blocking HTTPS.'
|
|
279
|
+
: 'Check network connectivity and that licenseKey is valid.',
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
clearTimeout(timeout);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
export async function runDiagnostics(opts) {
|
|
287
|
+
const configPath = opts?.configPath ?? resolve(DEFAULT_STORAGE_PATH, 'config.json');
|
|
288
|
+
const { check: configCheck, context } = checkConfigValid(configPath, opts?.storagePath);
|
|
289
|
+
const settingsPaths = [detectSettingsPath('user')];
|
|
290
|
+
if (isWsl()) {
|
|
291
|
+
const winHome = resolveWindowsHome();
|
|
292
|
+
if (winHome)
|
|
293
|
+
settingsPaths.push(detectSettingsPath('user', winHome));
|
|
235
294
|
}
|
|
236
|
-
return
|
|
295
|
+
return [
|
|
296
|
+
configCheck,
|
|
297
|
+
...checkDaemon(),
|
|
298
|
+
checkHooksWired(settingsPaths),
|
|
299
|
+
checkStorageWritable(context.storagePath),
|
|
300
|
+
await checkNrReachable(context.nrSkipReason),
|
|
301
|
+
];
|
|
237
302
|
}
|
|
238
303
|
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/install/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/install/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;AAkB3C,SAAS,gBAAgB,CACvB,UAAkB,EAClB,kBAAsC;IAEtC,MAAM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,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;IAExF,MAAM,aAAa,GAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,IAAI,KAAK,EAAE,EAAE,CAAC;QACZ,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;QACrC,IAAI,OAAO;YAAE,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,OAAO;QACL,WAAW;QACX,GAAG,WAAW,EAAE;QAChB,eAAe,CAAC,aAAa,CAAC;QAC9B,oBAAoB,CAAC,OAAO,CAAC,WAAW,CAAC;QACzC,MAAM,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAC;KAC7C,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function errMsg(err: unknown): string;
|
|
1
2
|
export declare function readJsonFile(path: string): Record<string, unknown>;
|
|
2
3
|
export declare function readJsonFileStrict(path: string): Record<string, unknown>;
|
|
3
4
|
export declare function writeJsonFile(path: string, data: Record<string, unknown>, additionalAllowedBase?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-utils.d.ts","sourceRoot":"","sources":["../../src/install/json-utils.ts"],"names":[],"mappings":"AAYA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMlE;AAMD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAcxE;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,CAsDN"}
|
|
1
|
+
{"version":3,"file":"json-utils.d.ts","sourceRoot":"","sources":["../../src/install/json-utils.ts"],"names":[],"mappings":"AAYA,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMlE;AAMD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAcxE;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,CAsDN"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, unlinkSync, realpathSync, } from 'node:fs';
|
|
2
2
|
import { basename, dirname, resolve, sep } from 'node:path';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
|
+
export function errMsg(err) {
|
|
5
|
+
return err instanceof Error ? err.message : String(err);
|
|
6
|
+
}
|
|
4
7
|
export function readJsonFile(path) {
|
|
5
8
|
try {
|
|
6
9
|
return JSON.parse(readFileSync(path, 'utf-8'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/install/json-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,C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G,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1E,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,0EAA0E;QAC1E,gEAAgE;QAChE,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,GAAG,CAAC;gBAAE,UAAU,CAAC,GAAG,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
export declare function unescapeXml(s: string): string;
|
|
2
|
+
export declare function plistPath(): string;
|
|
3
|
+
export declare function dashboardPlistPath(): string;
|
|
4
|
+
export interface FindExecutableNodeDirResult {
|
|
5
|
+
readonly dir: string | null;
|
|
6
|
+
/** True if a `node` binary was found in one of the dirs but lacked execute permission. */
|
|
7
|
+
readonly hasNonExecutable: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function findExecutableNodeDir(dirs: string[]): FindExecutableNodeDirResult;
|
|
1
10
|
export declare function resolveNodeDir(): string;
|
|
2
11
|
export interface ScheduleStatus {
|
|
3
12
|
readonly installed: boolean;
|
|
13
|
+
readonly readable: boolean;
|
|
4
14
|
readonly hour?: number;
|
|
5
15
|
readonly minute?: number;
|
|
6
16
|
readonly binaryPath?: string;
|
|
7
17
|
}
|
|
8
18
|
export declare function installSchedule(binaryPath: string, hour: number, minute: number): void;
|
|
9
|
-
export declare function removeSchedule():
|
|
19
|
+
export declare function removeSchedule(): boolean;
|
|
10
20
|
export declare function getScheduleStatus(): ScheduleStatus;
|
|
11
21
|
export interface DashboardDaemonStatus {
|
|
12
22
|
readonly installed: boolean;
|
|
23
|
+
readonly readable: boolean;
|
|
13
24
|
readonly binaryPath?: string;
|
|
25
|
+
/** Decoded PATH value from the plist EnvironmentVariables. Absent on older plists that predate node-path injection. */
|
|
26
|
+
readonly envPath?: string;
|
|
14
27
|
}
|
|
15
28
|
export declare function installDashboardDaemon(binaryPath: string): void;
|
|
16
|
-
export declare function removeDashboardDaemon():
|
|
29
|
+
export declare function removeDashboardDaemon(): boolean;
|
|
17
30
|
export declare function getDashboardDaemonStatus(): DashboardDaemonStatus;
|
|
18
31
|
export declare function resolveBinaryPath(): string | null;
|
|
19
32
|
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/install/schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/install/schedule.ts"],"names":[],"mappings":"AA4BA,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO7C;AAKD,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAUD,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,2BAA2B,CA0BjF;AAcD,wBAAgB,cAAc,IAAI,MAAM,CAiBvC;AAoCD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAA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