@getmarrow/install 0.1.0 → 0.1.1
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 +13 -0
- package/package.json +1 -1
- package/src/installer.js +24 -3
package/README.md
CHANGED
|
@@ -7,8 +7,15 @@ Use it when you want Marrow to detect the local agent/runtime environment and wi
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @getmarrow/install --dry-run
|
|
9
9
|
npx @getmarrow/install --yes
|
|
10
|
+
npx @getmarrow/install doctor
|
|
10
11
|
```
|
|
11
12
|
|
|
13
|
+
## What's New in v0.1.1
|
|
14
|
+
|
|
15
|
+
- `doctor` / `--doctor` checks whether Marrow is active without writing files.
|
|
16
|
+
- Generated SDK passive runtime enables workflow gates and value summaries by default.
|
|
17
|
+
- Doctor output reports missing env, missing hooks/config, self-test state, and recommended fix.
|
|
18
|
+
|
|
12
19
|
## What It Detects
|
|
13
20
|
|
|
14
21
|
- OpenClaw-style workspaces
|
|
@@ -53,6 +60,12 @@ Skip self-test:
|
|
|
53
60
|
npx @getmarrow/install --yes --no-self-test
|
|
54
61
|
```
|
|
55
62
|
|
|
63
|
+
Doctor check:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install doctor
|
|
67
|
+
```
|
|
68
|
+
|
|
56
69
|
## Trust Model
|
|
57
70
|
|
|
58
71
|
This package is intended to be open source and auditable. It prints every file it will touch, requires `--yes` to write, does not store API keys in project files, and supports MCP-only, SDK-only, both, and markdown-only setups.
|
package/package.json
CHANGED
package/src/installer.js
CHANGED
|
@@ -11,6 +11,7 @@ function parseArgs(argv) {
|
|
|
11
11
|
cwd: process.cwd(),
|
|
12
12
|
yes: false,
|
|
13
13
|
dryRun: false,
|
|
14
|
+
doctor: false,
|
|
14
15
|
mode: 'auto',
|
|
15
16
|
apiKey: process.env.MARROW_API_KEY || '',
|
|
16
17
|
baseUrl: process.env.MARROW_BASE_URL || DEFAULT_BASE_URL,
|
|
@@ -23,6 +24,7 @@ function parseArgs(argv) {
|
|
|
23
24
|
const arg = argv[i];
|
|
24
25
|
if (arg === '--yes' || arg === '-y') options.yes = true;
|
|
25
26
|
else if (arg === '--dry-run') options.dryRun = true;
|
|
27
|
+
else if (arg === '--doctor' || arg === 'doctor' || arg === 'check') options.doctor = true;
|
|
26
28
|
else if (arg === '--json') options.json = true;
|
|
27
29
|
else if (arg === '--no-self-test') options.selfTest = false;
|
|
28
30
|
else if (arg === '--self-test') options.selfTest = true;
|
|
@@ -56,11 +58,13 @@ function usage() {
|
|
|
56
58
|
return `Usage:
|
|
57
59
|
npx @getmarrow/install --dry-run
|
|
58
60
|
npx @getmarrow/install --yes
|
|
61
|
+
npx @getmarrow/install doctor
|
|
59
62
|
npx @getmarrow/install --mcp --yes
|
|
60
63
|
npx @getmarrow/install --sdk --yes
|
|
61
64
|
|
|
62
65
|
Options:
|
|
63
66
|
--dry-run Print planned changes without writing
|
|
67
|
+
--doctor Check install health without writing
|
|
64
68
|
--yes, -y Write detected config files
|
|
65
69
|
--mode <mode> auto, mcp, sdk, both, or md
|
|
66
70
|
--key <key> Marrow API key for self-test. Prefer MARROW_API_KEY because CLI args can appear in process listings.
|
|
@@ -163,8 +167,9 @@ if (apiKey && !globalThis.__MARROW_PASSIVE_RUNTIME__) {
|
|
|
163
167
|
});
|
|
164
168
|
|
|
165
169
|
const runtime = marrow.createPassiveRuntime({
|
|
166
|
-
includeValueReport: process.env.MARROW_PASSIVE_VALUE_REPORT
|
|
170
|
+
includeValueReport: process.env.MARROW_PASSIVE_VALUE_REPORT !== 'false',
|
|
167
171
|
valueReportPeriod: process.env.MARROW_VALUE_REPORT_PERIOD || '7d',
|
|
172
|
+
useWorkflowGate: process.env.MARROW_WORKFLOW_GATE !== 'false',
|
|
168
173
|
});
|
|
169
174
|
|
|
170
175
|
runtime.install();
|
|
@@ -179,6 +184,8 @@ MARROW_BASE_URL=${DEFAULT_BASE_URL}
|
|
|
179
184
|
MARROW_FLEET_AGENT_ID=agent-or-fleet-id
|
|
180
185
|
MARROW_ENFORCEMENT_MODE=auto
|
|
181
186
|
MARROW_PASSIVE_BRIEF=auto
|
|
187
|
+
MARROW_PASSIVE_VALUE_REPORT=true
|
|
188
|
+
MARROW_WORKFLOW_GATE=true
|
|
182
189
|
`;
|
|
183
190
|
}
|
|
184
191
|
|
|
@@ -337,7 +344,7 @@ function applyPlan(plan, options) {
|
|
|
337
344
|
|
|
338
345
|
const changed = before !== after;
|
|
339
346
|
changes.push({ path: write.path, label: write.label, changed });
|
|
340
|
-
if (changed && options.yes && !options.dryRun) {
|
|
347
|
+
if (changed && options.yes && !options.dryRun && !options.doctor) {
|
|
341
348
|
fs.mkdirSync(path.dirname(write.path), { recursive: true });
|
|
342
349
|
fs.writeFileSync(write.path, after);
|
|
343
350
|
}
|
|
@@ -432,6 +439,14 @@ function printReport(report) {
|
|
|
432
439
|
process.stdout.write(`- health: ${report.selfTest.health || 'unknown'}\n`);
|
|
433
440
|
}
|
|
434
441
|
|
|
442
|
+
if (report.writeMode === 'doctor') {
|
|
443
|
+
process.stdout.write('\nDoctor:\n');
|
|
444
|
+
process.stdout.write(`- Marrow active: ${report.doctor.active ? 'yes' : 'no'}\n`);
|
|
445
|
+
process.stdout.write(`- missing env: ${report.doctor.missingEnv.length ? report.doctor.missingEnv.join(', ') : 'none'}\n`);
|
|
446
|
+
process.stdout.write(`- missing hooks/config: ${report.doctor.missingHooks.length ? report.doctor.missingHooks.join('; ') : 'none'}\n`);
|
|
447
|
+
if (report.doctor.recommendedFix) process.stdout.write(`- recommended fix: ${report.doctor.recommendedFix}\n`);
|
|
448
|
+
}
|
|
449
|
+
|
|
435
450
|
if (report.writeMode === 'dry-run') {
|
|
436
451
|
process.stdout.write('\nRun with --yes to write these changes.\n');
|
|
437
452
|
}
|
|
@@ -447,7 +462,7 @@ function printReport(report) {
|
|
|
447
462
|
async function install(options) {
|
|
448
463
|
const detection = detectEnvironment(options.cwd);
|
|
449
464
|
const plan = buildPlan(detection, options);
|
|
450
|
-
const writeMode = options.yes && !options.dryRun ? 'write' : 'dry-run';
|
|
465
|
+
const writeMode = options.doctor ? 'doctor' : options.yes && !options.dryRun ? 'write' : 'dry-run';
|
|
451
466
|
const changes = applyPlan(plan, options);
|
|
452
467
|
const selfTest = await runSelfTest(options).catch((error) => ({
|
|
453
468
|
skipped: false,
|
|
@@ -469,6 +484,12 @@ async function install(options) {
|
|
|
469
484
|
mcpConfig: detection.mcpConfig,
|
|
470
485
|
},
|
|
471
486
|
changes,
|
|
487
|
+
doctor: {
|
|
488
|
+
active: Boolean(!selfTest.skipped && selfTest.active),
|
|
489
|
+
missingEnv: options.apiKey ? [] : ['MARROW_API_KEY'],
|
|
490
|
+
missingHooks: changes.filter((change) => change.changed).map((change) => change.label),
|
|
491
|
+
recommendedFix: selfTest.recommended_fix || (!options.apiKey ? 'Set MARROW_API_KEY, then run npx @getmarrow/install doctor.' : null),
|
|
492
|
+
},
|
|
472
493
|
selfTest,
|
|
473
494
|
warnings: options.keyFromArg
|
|
474
495
|
? ['Avoid --key in shared shells because command-line arguments can be visible in process listings. Prefer MARROW_API_KEY in your environment or secret manager.']
|