@getmarrow/install 0.1.46 → 0.1.48

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 CHANGED
@@ -91,7 +91,21 @@ npx @getmarrow/install controller stop
91
91
 
92
92
  Persistent controller lifecycle is currently Linux-only. On macOS or Windows, activation still installs and verifies the supported hooks without starting or signaling a background process; run `npx @getmarrow/install sidecar` under an owner-managed service and pass `--no-controller`. The controller does not silently upgrade packages, change governance policy, rotate credentials, or modify unrelated project configuration.
93
93
 
94
- ## What's New in v0.1.46
94
+ ## What's New in v0.1.48
95
+
96
+ v0.1.48 pins MCP `3.9.72` and SDK `3.7.61`. The SDK keeps passive capture enabled without intercepting its own Marrow control-plane requests, while every generated MCP setup and repair command now uses the supported MCP release.
97
+
98
+ ## Previous: v0.1.47
99
+
100
+ v0.1.47 makes activate honest about reload and the first capture path:
101
+
102
+ - after writing MCP or hooks, activate reports that this process is not live until harness restart and `doctor --self-test`;
103
+ - first capture is Claude native hooks, Cursor on-demand `marrow_agent_runtime`, or the Codex/Grok governed runner;
104
+ - generated MCP setup, launch, and certified hook commands pin the release current at that time;
105
+ - SDK detection and operator-approved upgrade rules pinned the release current at that time;
106
+ - empty token savings stay zero until observed model usage lands.
107
+
108
+ ## Previous: v0.1.46
95
109
 
96
110
  v0.1.46 makes default install cover every workspace honestly:
97
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmarrow/install",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "description": "Universal installer and governed runner for Marrow agent fleets.",
5
5
  "bin": {
6
6
  "marrow-install": "bin/marrow-install.js"
@@ -0,0 +1,73 @@
1
+ function wroteHarnessConfig(changes = []) {
2
+ return (changes || []).some((change) => {
3
+ if (!change || !(change.applied || change.changed)) return false;
4
+ return /MCP|hook|Claude|Cursor|Agent instructions|SDK passive/i.test(String(change.label || ''));
5
+ });
6
+ }
7
+
8
+ function harnessReloadPlan(detection = {}, changes = []) {
9
+ const clients = [];
10
+ if (detection.claudeCode) {
11
+ clients.push({
12
+ client: 'claude-code',
13
+ restart: 'Restart Claude Code so native hooks and MCP load.',
14
+ });
15
+ }
16
+ if (detection.cursor) {
17
+ clients.push({
18
+ client: 'cursor',
19
+ restart: 'Restart Cursor so project MCP loads.',
20
+ });
21
+ }
22
+ if (detection.codex) {
23
+ clients.push({
24
+ client: 'codex',
25
+ restart: 'Start a new Codex or Grok session so AGENTS.md and MCP config load.',
26
+ });
27
+ }
28
+ if (clients.length === 0) {
29
+ clients.push({
30
+ client: 'mcp',
31
+ restart: 'Restart the owning MCP host so marrow-mcp loads.',
32
+ });
33
+ }
34
+ const required = wroteHarnessConfig(changes);
35
+ return {
36
+ required,
37
+ live_in_this_process: !required,
38
+ prove_command: 'npx @getmarrow/install@latest doctor --self-test',
39
+ clients,
40
+ instruction: clients.map((entry) => entry.restart).join(' '),
41
+ };
42
+ }
43
+
44
+ function firstCapturePath(detection = {}, agentId) {
45
+ const id = String(agentId || '').trim() || '<agent-id>';
46
+ if (detection.claudeCode) {
47
+ return {
48
+ client: 'claude-code',
49
+ capability_level: 'native_hooks',
50
+ command: null,
51
+ instruction: 'After restart, Claude native hooks capture the next prompt, tool, and session-end automatically.',
52
+ };
53
+ }
54
+ if (detection.cursor) {
55
+ return {
56
+ client: 'cursor',
57
+ capability_level: 'mcp',
58
+ command: 'marrow_agent_runtime',
59
+ instruction: 'After restart, call marrow_agent_runtime before the next deploy, merge, or publish. Before the session ends, call marrow_session_end. Cursor MCP tools are on demand.',
60
+ };
61
+ }
62
+ return {
63
+ client: detection.codex ? 'codex' : 'governed_wrapper',
64
+ capability_level: 'governed_wrapper',
65
+ command: `npx @getmarrow/install run --agent ${id} -- -- <command>`,
66
+ instruction: 'Wrap the next deploy, merge, or publish with the governed runner. Codex and Grok do not intercept tools natively. Before the session ends, call marrow_session_end or marrow_commit. Do not invent token counts.',
67
+ };
68
+ }
69
+
70
+ module.exports = {
71
+ harnessReloadPlan,
72
+ firstCapturePath,
73
+ };
@@ -29,6 +29,7 @@ const {
29
29
  } = require('./installer');
30
30
 
31
31
  const DEFAULT_BASE_URL = 'https://api.getmarrow.ai';
32
+ const MCP_SETUP_COMMAND = `npx -y --package=${ADAPTER_PROVENANCE.mcp.package}@${ADAPTER_PROVENANCE.mcp.version} marrow-mcp setup`;
32
33
  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;
33
34
  const PROTECTED_COMMAND_PATTERNS = [
34
35
  /\b(?:npm|pnpm|yarn)(?:\s+npm)?\b[\s\S]{0,8192}\b(?:publish|unpublish|deprecate|access|owner|team|token|login|logout|profile\s+(?:set|enable-2fa|disable-2fa)|dist-tag|tag\s+(?:add|remove))\b/i,
@@ -1395,11 +1396,11 @@ const GENERIC_GOVERNED_COMMAND = 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/ins
1395
1396
  function localSupportedHarnesses() {
1396
1397
  const harnesses = [
1397
1398
  { display_name: 'OpenAI Codex', client_label: 'codex', category: 'agent_harness', support_level: 'governed_runner', install_command: 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install run --agent codex-prod -- codex' },
1398
- { display_name: 'Claude Code', client_label: 'claude-code', category: 'agent_harness', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1399
- { display_name: 'Cursor', client_label: 'cursor', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1400
- { display_name: 'Cursor Composer', client_label: 'composer', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1401
- { display_name: 'Windsurf', client_label: 'windsurf', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1402
- { display_name: 'Cline', client_label: 'cline', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1399
+ { display_name: 'Claude Code', client_label: 'claude-code', category: 'agent_harness', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1400
+ { display_name: 'Cursor', client_label: 'cursor', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1401
+ { display_name: 'Cursor Composer', client_label: 'composer', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1402
+ { display_name: 'Windsurf', client_label: 'windsurf', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1403
+ { display_name: 'Cline', client_label: 'cline', category: 'ide_agent', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1403
1404
  { display_name: 'OpenCode', client_label: 'opencode', category: 'agent_harness', support_level: 'governed_runner', install_command: 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install run --agent opencode-prod -- opencode' },
1404
1405
  { display_name: 'Hermes Agent', client_label: 'hermes', category: 'agent_harness', support_level: 'first_class_addon', install_command: 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install hermes' },
1405
1406
  { display_name: 'OpenClaw', client_label: 'openclaw', category: 'agent_harness', support_level: 'first_class_addon', install_command: 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install openclaw' },
@@ -1410,7 +1411,7 @@ function localSupportedHarnesses() {
1410
1411
  { display_name: 'Kimi', client_label: 'kimi', category: 'model_cli', support_level: 'governed_runner', install_command: GENERIC_GOVERNED_COMMAND },
1411
1412
  { display_name: 'MiniMax', client_label: 'minimax', category: 'model_cli', support_level: 'governed_runner', install_command: GENERIC_GOVERNED_COMMAND },
1412
1413
  { display_name: 'GLM', client_label: 'glm', category: 'model_cli', support_level: 'governed_runner', install_command: GENERIC_GOVERNED_COMMAND },
1413
- { display_name: 'MCP-compatible clients', client_label: 'mcp', category: 'mcp_client', support_level: 'native_mcp_or_sdk', install_command: 'MARROW_API_KEY=mrw_live_xxx npx -y --package=@getmarrow/mcp@latest marrow-mcp setup' },
1414
+ { display_name: 'MCP-compatible clients', client_label: 'mcp', category: 'mcp_client', support_level: 'native_mcp_or_sdk', install_command: `MARROW_API_KEY=mrw_live_xxx ${MCP_SETUP_COMMAND}` },
1414
1415
  { display_name: 'CI scripts and deploy runners', client_label: 'ci', category: 'ci_runner', support_level: 'governed_runner', install_command: 'MARROW_API_KEY=mrw_live_xxx npx @getmarrow/install run --agent ci-release --profile production --policy enforce -- <ci-or-deploy-command>' },
1415
1416
  { display_name: 'Custom shell/API harness', client_label: 'custom', category: 'custom_runner', support_level: 'event_contract', install_command: 'POST /v1/agent/integrations/events with harness, event_type, agent_id, and action' },
1416
1417
  ];
package/src/installer.js CHANGED
@@ -4,15 +4,16 @@ const os = require('node:os');
4
4
  const crypto = require('node:crypto');
5
5
  const { version: INSTALLER_ADAPTER_VERSION } = require('../package.json');
6
6
  const { controllerStatus, controllerSupportedPlatform, ensureGovernanceController } = require('./controller-manager');
7
+ const { firstCapturePath, harnessReloadPlan } = require('./first-hour');
7
8
 
8
9
  const DEFAULT_BASE_URL = 'https://api.getmarrow.ai';
9
10
  const MARROW_BLOCK_START = '<!-- marrow:passive-start -->';
10
11
  const MARROW_BLOCK_END = '<!-- marrow:passive-end -->';
11
- const MCP_ADAPTER_VERSION = '3.9.64';
12
- const MCP_ADAPTER_SOURCE_SHA = 'ed8293165247e89161045c7fbf68aeee4d51c6da';
13
- const MCP_ADAPTER_INTEGRITY = 'sha512-D654txYXhEciNl3xqm3o5TdH8S3rkPfuVcnoQqSjc1dqAGKbq90BuyZqcUVMxO6dkSbQ3QS++Sg++zhySqSN/w==';
14
- const SDK_ADAPTER_VERSION = '3.7.59';
15
- const SDK_ADAPTER_INTEGRITY = 'sha512-Ba4kqOYP1tEfMoiz4ddrOP86Q5Q1ANDQpZ8rvDJwh5BLaSVKamSbyOUAQ9lNSt7S5IzlhhTHO5HrOQq35xahDg==';
12
+ const MCP_ADAPTER_VERSION = '3.9.72';
13
+ const MCP_ADAPTER_SOURCE_SHA = '5203f96388849dfda12cb05d476b36b542639e16';
14
+ const MCP_ADAPTER_INTEGRITY = 'sha512-FTs9ORn4WVwDIeJEjovriDK4X8WZVSGbbe8iz6GGYFy62jBRJOXOZ4aW8B4Ll+10i71o8RcEBJ0Px38Pc6v/qw==';
15
+ const SDK_ADAPTER_VERSION = '3.7.61';
16
+ const SDK_ADAPTER_INTEGRITY = 'sha512-1dXf/Px4mMN4lOehrRkBOF/dC6N9kjQ5R4eb8ohAACx5CvLTS32zSTelfMNjnRcdOknSKMjLnbh7aGFhulVo/Q==';
16
17
  const SDK_ADAPTER_TARBALL = `https://registry.npmjs.org/@getmarrow/sdk/-/sdk-${SDK_ADAPTER_VERSION}.tgz`;
17
18
  const MCP_PACKAGE_SPEC = `@getmarrow/mcp@${MCP_ADAPTER_VERSION}`;
18
19
  const ADAPTER_PROVENANCE = Object.freeze({
@@ -619,11 +620,15 @@ function passiveInstructions() {
619
620
 
620
621
  Marrow should run passively after install:
621
622
 
622
- - Use MCP plus these instructions in every workspace: \`npx -y --package=@getmarrow/mcp@latest marrow-mcp setup\`.
623
+ - Use MCP plus these instructions in every workspace: \`npx -y --package=${MCP_PACKAGE_SPEC} marrow-mcp setup\`.
623
624
  - Use SDK passive runtime in owned Node processes: \`createPassiveRuntime().install()\`.
624
625
  - Native Claude hooks install only when \`.claude\` is present. Cursor, Composer, Cline, and Windsurf get MCP tools on demand. Codex, Grok, Gemini, and similar CLI harnesses use the governed wrapper. Hermes, OpenClaw, and custom hosts need a bounded event adapter.
625
626
  - Keep passive token/model usage proof enabled. Empty savings stay zero until observed model usage lands. Do not invent token, cost, or time savings.
626
627
  - Before risky work, use Marrow's decision brief or passive prompt hook.
628
+ - After activate writes MCP or hooks, restart this harness, then run \`npx @getmarrow/install@latest doctor --self-test\`. Do not claim Marrow is live in a process that has not reloaded.
629
+ - First turn: tell the owner the gate is live and empty savings are honest. The next deploy, merge, or publish must go through Marrow.
630
+ - Cursor, Composer, Cline, and Windsurf: call \`marrow_agent_runtime\` before those actions. Codex, Grok, Gemini, and similar CLIs: wrap them with \`npx @getmarrow/install run --agent <agent-id> -- -- <command>\`.
631
+ - Before the session ends, close open work with session-end auto-commit or \`marrow_commit\`. Record model usage only when the host response includes counts.
627
632
  - After meaningful work, record the outcome so future agents learn from it.
628
633
  - After Marrow blocks, warns, or requires review, use the decision trace receipt to tell the operator what changed and which recorded workflow or proof is required. Stay quiet for routine low-risk work.
629
634
  - Check health with \`marrow_agent_status\` or \`GET /v1/agent/status\`.
@@ -1707,6 +1712,21 @@ function printReport(report) {
1707
1712
  }
1708
1713
  }
1709
1714
 
1715
+ if (report.harnessReload) {
1716
+ process.stdout.write('\nHarness reload:\n');
1717
+ process.stdout.write(`- required: ${report.harnessReload.required ? 'yes' : 'no'}\n`);
1718
+ process.stdout.write(`- live in this process: ${report.harnessReload.live_in_this_process ? 'yes' : 'no'}\n`);
1719
+ if (report.harnessReload.instruction) process.stdout.write(`- restart: ${report.harnessReload.instruction}\n`);
1720
+ if (report.harnessReload.prove_command) process.stdout.write(`- prove after restart: ${report.harnessReload.prove_command}\n`);
1721
+ }
1722
+ if (report.firstCapture) {
1723
+ process.stdout.write('\nFirst capture:\n');
1724
+ process.stdout.write(`- client: ${report.firstCapture.client}\n`);
1725
+ process.stdout.write(`- capability: ${report.firstCapture.capability_level}\n`);
1726
+ if (report.firstCapture.command) process.stdout.write(`- command: ${report.firstCapture.command}\n`);
1727
+ process.stdout.write(`- ${report.firstCapture.instruction}\n`);
1728
+ }
1729
+
1710
1730
  if (report.remediation) {
1711
1731
  process.stdout.write('\nRemediation:\n');
1712
1732
  process.stdout.write(`- attempted: ${report.remediation.attempted ? 'yes' : 'no'}\n`);
@@ -1744,8 +1764,14 @@ function printReport(report) {
1744
1764
  if (report.controller?.exact_fix) process.stdout.write(`- exact fix: ${report.controller.exact_fix}\n`);
1745
1765
 
1746
1766
  if (report.writeMode === 'doctor') {
1767
+ const liveHere = !report.harnessReload?.required;
1768
+ const activeLabel = report.doctor.active && liveHere
1769
+ ? 'yes'
1770
+ : report.doctor.active
1771
+ ? 'server confirmed, restart required'
1772
+ : 'no';
1747
1773
  process.stdout.write('\nDoctor:\n');
1748
- process.stdout.write(`- Marrow active: ${report.doctor.active ? 'yes' : 'no'}\n`);
1774
+ process.stdout.write(`- Marrow active: ${activeLabel}\n`);
1749
1775
  process.stdout.write(`- missing env: ${report.doctor.missingEnv.length ? report.doctor.missingEnv.join(', ') : 'none'}\n`);
1750
1776
  if (report.doctor.envHints.length) process.stdout.write(`- possible env files: ${report.doctor.envHints.join(', ')}\n`);
1751
1777
  process.stdout.write(`- missing hooks/config: ${report.doctor.missingHooks.length ? report.doctor.missingHooks.join('; ') : 'none'}\n`);
@@ -1909,6 +1935,8 @@ async function install(options) {
1909
1935
  receipt: selfTest.activation_receipt || null,
1910
1936
  profile,
1911
1937
  },
1938
+ harnessReload: harnessReloadPlan(detection, changes),
1939
+ firstCapture: firstCapturePath(detection, options.agentId),
1912
1940
  changes,
1913
1941
  doctor: {
1914
1942
  active: Boolean(!selfTest.skipped && selfTest.active),
@@ -1980,4 +2008,6 @@ module.exports = {
1980
2008
  ADAPTER_PROVENANCE,
1981
2009
  HARNESS_CAPABILITY_REGISTRY,
1982
2010
  defaultHarnessInstallMatrix,
2011
+ harnessReloadPlan,
2012
+ firstCapturePath,
1983
2013
  };