@getmarrow/install 0.1.21 → 0.1.23
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 +16 -9
- package/package.json +1 -1
- package/src/governed-runner.js +39 -0
- package/src/installer.js +37 -1
package/README.md
CHANGED
|
@@ -11,18 +11,17 @@ npx @getmarrow/install --repair
|
|
|
11
11
|
npx @getmarrow/install doctor
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
## What's New in v0.1.
|
|
14
|
+
## What's New in v0.1.23
|
|
15
15
|
|
|
16
|
-
v0.1.
|
|
16
|
+
v0.1.23 improves attribution quality so Marrow can produce cleaner per-agent, per-harness, and per-workflow value reports.
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- Marrow does not store prompts, completions, tool stdout/stderr, plaintext API keys, or raw model output for this feature.
|
|
23
|
-
- Disable only when required with `MARROW_PASSIVE_TOKEN_USAGE=false`.
|
|
18
|
+
- Installer self-tests and governed runner calls attach `source_meta.channel`, `source_meta.client`, and inferred workflow intent by default.
|
|
19
|
+
- Generated passive runtime keeps using SDK defaults for `agent_id`, harness/client, source channel, and user intent attribution.
|
|
20
|
+
- Set `MARROW_CLIENT`, `MARROW_HARNESS`, or `MARROW_AGENT_CLIENT` to labels such as `codex`, `claude-code`, `cursor`, `gemini`, `qwen`, `opencode`, `hermes`, `openclaw`, or `custom`.
|
|
21
|
+
- Invalid or unknown client labels fall back to `custom` instead of breaking onboarding.
|
|
22
|
+
- Marrow still does not store prompts, completions, tool stdout/stderr, plaintext API keys, or raw model output for this feature.
|
|
24
23
|
|
|
25
|
-
Business value:
|
|
24
|
+
Business value: dashboards and reports can show which agents, harnesses, and workflow types are improving instead of grouping too much work into "unknown."
|
|
26
25
|
|
|
27
26
|
## Governed Runner
|
|
28
27
|
|
|
@@ -87,6 +86,14 @@ Use the lower-level packages only when you need direct control:
|
|
|
87
86
|
|
|
88
87
|
The three packages are not three competing onboarding paths. `@getmarrow/install` is the front door; SDK and MCP are the implementation paths underneath it.
|
|
89
88
|
|
|
89
|
+
For cleaner attribution, set an agent id and optional client label before install:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export MARROW_FLEET_AGENT_ID=codex-deploy-agent
|
|
93
|
+
export MARROW_CLIENT=codex
|
|
94
|
+
npx @getmarrow/install --yes
|
|
95
|
+
```
|
|
96
|
+
|
|
90
97
|
## Agent Value Proof Quickstart
|
|
91
98
|
|
|
92
99
|
One command should prove Marrow is active and useful:
|
package/package.json
CHANGED
package/src/governed-runner.js
CHANGED
|
@@ -9,6 +9,36 @@ const DEFAULT_BASE_URL = 'https://api.getmarrow.ai';
|
|
|
9
9
|
const HIGH_RISK_TERMS = /\b(deploy|prod|production|publish|release|merge|migration|migrate|secret|token|key|cloudflare|wrangler|npm publish|gh pr merge|git push|terraform apply|kubectl apply|delete|destroy|drop)\b/i;
|
|
10
10
|
const GOVERN_TUI_ROW_COUNT = 7;
|
|
11
11
|
const FLEET_TUI_ROW_COUNT = 11;
|
|
12
|
+
const SOURCE_CLIENTS = new Set(['claude-code', 'cursor', 'windsurf', 'openclaw', 'codex', 'gemini', 'grok', 'deepseek', 'qwen', 'kimi', 'minimax', 'cline', 'opencode', 'hermes', 'glm', 'custom', 'unknown']);
|
|
13
|
+
|
|
14
|
+
function sourceClient() {
|
|
15
|
+
const raw = String(process.env.MARROW_CLIENT || process.env.MARROW_HARNESS || process.env.MARROW_AGENT_CLIENT || '').trim().toLowerCase().replace(/\s+/g, '-').replace(/^@/, '');
|
|
16
|
+
const aliases = {
|
|
17
|
+
claude: 'claude-code',
|
|
18
|
+
claude_code: 'claude-code',
|
|
19
|
+
'claude-code': 'claude-code',
|
|
20
|
+
cursor: 'cursor',
|
|
21
|
+
windsurf: 'windsurf',
|
|
22
|
+
openclaw: 'openclaw',
|
|
23
|
+
codex: 'codex',
|
|
24
|
+
'openai-codex': 'codex',
|
|
25
|
+
gemini: 'gemini',
|
|
26
|
+
google: 'gemini',
|
|
27
|
+
grok: 'grok',
|
|
28
|
+
deepseek: 'deepseek',
|
|
29
|
+
qwen: 'qwen',
|
|
30
|
+
kimi: 'kimi',
|
|
31
|
+
minimax: 'minimax',
|
|
32
|
+
cline: 'cline',
|
|
33
|
+
opencode: 'opencode',
|
|
34
|
+
'open-code': 'opencode',
|
|
35
|
+
hermes: 'hermes',
|
|
36
|
+
'hermes-agent': 'hermes',
|
|
37
|
+
glm: 'glm',
|
|
38
|
+
};
|
|
39
|
+
return aliases[raw] || (SOURCE_CLIENTS.has(raw) ? raw : 'custom');
|
|
40
|
+
}
|
|
41
|
+
|
|
12
42
|
function usage() {
|
|
13
43
|
return `Usage:
|
|
14
44
|
npx @getmarrow/install run --agent deploy-agent -- npm test
|
|
@@ -283,6 +313,7 @@ function headers(options) {
|
|
|
283
313
|
'Content-Type': 'application/json',
|
|
284
314
|
'X-Marrow-Agent-Id': options.agentId,
|
|
285
315
|
'X-Marrow-Session-Id': options.sessionId,
|
|
316
|
+
'X-Marrow-Client': sourceClient(),
|
|
286
317
|
'User-Agent': '@getmarrow/install governed-runner',
|
|
287
318
|
};
|
|
288
319
|
return h;
|
|
@@ -449,6 +480,11 @@ async function createDecision(options, action, type) {
|
|
|
449
480
|
profile: options.profile,
|
|
450
481
|
governed: true,
|
|
451
482
|
},
|
|
483
|
+
source_meta: {
|
|
484
|
+
channel: 'cli',
|
|
485
|
+
client: sourceClient(),
|
|
486
|
+
user_intent: type === 'deploy' ? 'deploy' : 'operate',
|
|
487
|
+
},
|
|
452
488
|
});
|
|
453
489
|
}
|
|
454
490
|
|
|
@@ -688,10 +724,13 @@ function normalizeFixCommands(status, capacity) {
|
|
|
688
724
|
add(status.route_contract?.exact_fix);
|
|
689
725
|
add(status.auto_outcome_closure?.exact_fix);
|
|
690
726
|
add(status.capture_coverage?.exact_fix);
|
|
727
|
+
add(status.token_capture?.exact_fix);
|
|
728
|
+
add(status.token_capture?.fix_command, true);
|
|
691
729
|
add(capacity.exact_next_action, true);
|
|
692
730
|
add(capacity.next_action, true);
|
|
693
731
|
if (listValue(status.missed_hooks, status.degraded_hooks).length) add('npx @getmarrow/install --repair');
|
|
694
732
|
if (status.auto_outcome_closure?.status === 'degraded') add('npx @getmarrow/install --repair');
|
|
733
|
+
if (status.token_capture?.detected === false) add('npx @getmarrow/install --repair');
|
|
695
734
|
return commands.slice(0, 6);
|
|
696
735
|
}
|
|
697
736
|
|
package/src/installer.js
CHANGED
|
@@ -6,6 +6,35 @@ const crypto = require('node:crypto');
|
|
|
6
6
|
const DEFAULT_BASE_URL = 'https://api.getmarrow.ai';
|
|
7
7
|
const MARROW_BLOCK_START = '<!-- marrow:passive-start -->';
|
|
8
8
|
const MARROW_BLOCK_END = '<!-- marrow:passive-end -->';
|
|
9
|
+
const SOURCE_CLIENTS = new Set(['claude-code', 'cursor', 'windsurf', 'openclaw', 'codex', 'gemini', 'grok', 'deepseek', 'qwen', 'kimi', 'minimax', 'cline', 'opencode', 'hermes', 'glm', 'custom', 'unknown']);
|
|
10
|
+
|
|
11
|
+
function sourceClient() {
|
|
12
|
+
const raw = String(process.env.MARROW_CLIENT || process.env.MARROW_HARNESS || process.env.MARROW_AGENT_CLIENT || '').trim().toLowerCase().replace(/\s+/g, '-').replace(/^@/, '');
|
|
13
|
+
const aliases = {
|
|
14
|
+
claude: 'claude-code',
|
|
15
|
+
claude_code: 'claude-code',
|
|
16
|
+
'claude-code': 'claude-code',
|
|
17
|
+
cursor: 'cursor',
|
|
18
|
+
windsurf: 'windsurf',
|
|
19
|
+
openclaw: 'openclaw',
|
|
20
|
+
codex: 'codex',
|
|
21
|
+
'openai-codex': 'codex',
|
|
22
|
+
gemini: 'gemini',
|
|
23
|
+
google: 'gemini',
|
|
24
|
+
grok: 'grok',
|
|
25
|
+
deepseek: 'deepseek',
|
|
26
|
+
qwen: 'qwen',
|
|
27
|
+
kimi: 'kimi',
|
|
28
|
+
minimax: 'minimax',
|
|
29
|
+
cline: 'cline',
|
|
30
|
+
opencode: 'opencode',
|
|
31
|
+
'open-code': 'opencode',
|
|
32
|
+
hermes: 'hermes',
|
|
33
|
+
'hermes-agent': 'hermes',
|
|
34
|
+
glm: 'glm',
|
|
35
|
+
};
|
|
36
|
+
return aliases[raw] || (SOURCE_CLIENTS.has(raw) ? raw : 'custom');
|
|
37
|
+
}
|
|
9
38
|
|
|
10
39
|
function parseArgs(argv) {
|
|
11
40
|
const options = {
|
|
@@ -291,7 +320,7 @@ Marrow should run passively after install:
|
|
|
291
320
|
Required environment:
|
|
292
321
|
|
|
293
322
|
- \`MARROW_API_KEY\`
|
|
294
|
-
- Optional: \`MARROW_BASE_URL\`, \`MARROW_FLEET_AGENT_ID\`
|
|
323
|
+
- Optional: \`MARROW_BASE_URL\`, \`MARROW_FLEET_AGENT_ID\`, \`MARROW_CLIENT\`
|
|
295
324
|
- Optional: \`MARROW_PASSIVE_TOKEN_USAGE=false\` disables compact provider usage capture when needed.
|
|
296
325
|
${MARROW_BLOCK_END}`;
|
|
297
326
|
}
|
|
@@ -330,6 +359,7 @@ function envExample() {
|
|
|
330
359
|
return `MARROW_API_KEY=mrw_live_replace_me
|
|
331
360
|
MARROW_BASE_URL=${DEFAULT_BASE_URL}
|
|
332
361
|
MARROW_FLEET_AGENT_ID=agent-or-fleet-id
|
|
362
|
+
MARROW_CLIENT=codex
|
|
333
363
|
MARROW_ENFORCEMENT_MODE=auto
|
|
334
364
|
MARROW_PASSIVE_BRIEF=auto
|
|
335
365
|
MARROW_PASSIVE_VALUE_REPORT=true
|
|
@@ -565,6 +595,7 @@ async function runSelfTest(options) {
|
|
|
565
595
|
authorization: `Bearer ${options.apiKey}`,
|
|
566
596
|
'content-type': 'application/json',
|
|
567
597
|
'x-marrow-session-id': `install-${Date.now()}`,
|
|
598
|
+
'x-marrow-client': sourceClient(),
|
|
568
599
|
};
|
|
569
600
|
if (options.agentId) headers['x-marrow-agent-id'] = options.agentId;
|
|
570
601
|
|
|
@@ -575,6 +606,11 @@ async function runSelfTest(options) {
|
|
|
575
606
|
body: JSON.stringify({
|
|
576
607
|
type: 'process',
|
|
577
608
|
action: 'Marrow passive install self-test: verify SDK/MCP hooks can record a harmless setup event',
|
|
609
|
+
source_meta: {
|
|
610
|
+
channel: 'cli',
|
|
611
|
+
client: sourceClient(),
|
|
612
|
+
user_intent: 'operate',
|
|
613
|
+
},
|
|
578
614
|
}),
|
|
579
615
|
});
|
|
580
616
|
|