borgmcp 2.14.2 → 2.16.0

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.
Files changed (124) hide show
  1. package/dist/agent-runtime.d.ts +5 -0
  2. package/dist/agent-runtime.d.ts.map +1 -1
  3. package/dist/agent-runtime.js +14 -0
  4. package/dist/agent-runtime.js.map +1 -1
  5. package/dist/assimilate-cmd.d.ts +5 -0
  6. package/dist/assimilate-cmd.d.ts.map +1 -1
  7. package/dist/assimilate-cmd.js +53 -14
  8. package/dist/assimilate-cmd.js.map +1 -1
  9. package/dist/assimilate-deps.d.ts.map +1 -1
  10. package/dist/assimilate-deps.js +19 -4
  11. package/dist/assimilate-deps.js.map +1 -1
  12. package/dist/bare-launch-menu.d.ts +8 -0
  13. package/dist/bare-launch-menu.d.ts.map +1 -1
  14. package/dist/bare-launch-menu.js +12 -0
  15. package/dist/bare-launch-menu.js.map +1 -1
  16. package/dist/claude.d.ts.map +1 -1
  17. package/dist/claude.js +28 -40
  18. package/dist/claude.js.map +1 -1
  19. package/dist/cleanup-cmd.d.ts.map +1 -1
  20. package/dist/cleanup-cmd.js +2 -2
  21. package/dist/cleanup-cmd.js.map +1 -1
  22. package/dist/cli-tool-approval.d.ts.map +1 -1
  23. package/dist/cli-tool-approval.js +3 -2
  24. package/dist/cli-tool-approval.js.map +1 -1
  25. package/dist/codex-remote.d.ts.map +1 -1
  26. package/dist/codex-remote.js +4 -3
  27. package/dist/codex-remote.js.map +1 -1
  28. package/dist/config-utils.d.ts +16 -1
  29. package/dist/config-utils.d.ts.map +1 -1
  30. package/dist/config-utils.js +176 -17
  31. package/dist/config-utils.js.map +1 -1
  32. package/dist/credential-paths.d.ts.map +1 -1
  33. package/dist/credential-paths.js +2 -3
  34. package/dist/credential-paths.js.map +1 -1
  35. package/dist/cubes.d.ts +6 -1
  36. package/dist/cubes.d.ts.map +1 -1
  37. package/dist/cubes.js +9 -4
  38. package/dist/cubes.js.map +1 -1
  39. package/dist/foreign-path-reminder.d.ts +12 -0
  40. package/dist/foreign-path-reminder.d.ts.map +1 -0
  41. package/dist/foreign-path-reminder.js +122 -0
  42. package/dist/foreign-path-reminder.js.map +1 -0
  43. package/dist/launch-access.d.ts +22 -0
  44. package/dist/launch-access.d.ts.map +1 -0
  45. package/dist/launch-access.js +27 -0
  46. package/dist/launch-access.js.map +1 -0
  47. package/dist/launch-all-deps.d.ts.map +1 -1
  48. package/dist/launch-all-deps.js +2 -2
  49. package/dist/launch-all-deps.js.map +1 -1
  50. package/dist/lifecycle-log-guard.js +2 -2
  51. package/dist/lifecycle-log-guard.js.map +1 -1
  52. package/dist/local-server-cursor.js +2 -2
  53. package/dist/local-server-cursor.js.map +1 -1
  54. package/dist/opencode-plugin.js +2 -2
  55. package/dist/opencode-plugin.js.map +1 -1
  56. package/dist/parse-assimilate-args.d.ts.map +1 -1
  57. package/dist/parse-assimilate-args.js +6 -1
  58. package/dist/parse-assimilate-args.js.map +1 -1
  59. package/dist/private-root.d.ts +17 -0
  60. package/dist/private-root.d.ts.map +1 -1
  61. package/dist/private-root.js +62 -2
  62. package/dist/private-root.js.map +1 -1
  63. package/dist/regen-format.js +1 -1
  64. package/dist/regen-format.js.map +1 -1
  65. package/dist/resolved-cli-config.d.ts +16 -0
  66. package/dist/resolved-cli-config.d.ts.map +1 -0
  67. package/dist/resolved-cli-config.js +26 -0
  68. package/dist/resolved-cli-config.js.map +1 -0
  69. package/dist/seat-store.d.ts.map +1 -1
  70. package/dist/seat-store.js +4 -3
  71. package/dist/seat-store.js.map +1 -1
  72. package/dist/seats.d.ts.map +1 -1
  73. package/dist/seats.js +2 -2
  74. package/dist/seats.js.map +1 -1
  75. package/dist/self-path.d.ts +2 -0
  76. package/dist/self-path.d.ts.map +1 -1
  77. package/dist/self-path.js +4 -0
  78. package/dist/self-path.js.map +1 -1
  79. package/dist/server-trust.d.ts.map +1 -1
  80. package/dist/server-trust.js +3 -3
  81. package/dist/server-trust.js.map +1 -1
  82. package/dist/setup-confirm.d.ts +1 -1
  83. package/dist/setup-confirm.js +1 -1
  84. package/dist/setup-selection.d.ts +38 -0
  85. package/dist/setup-selection.d.ts.map +1 -0
  86. package/dist/setup-selection.js +51 -0
  87. package/dist/setup-selection.js.map +1 -0
  88. package/dist/setup.js +80 -21
  89. package/dist/setup.js.map +1 -1
  90. package/dist/stream-owner.js +2 -2
  91. package/dist/stream-owner.js.map +1 -1
  92. package/docs/EXTRACTION_PROVENANCE.md +3 -3
  93. package/docs/LOCAL_SERVER.md +23 -0
  94. package/docs/RELEASING.md +130 -282
  95. package/package.json +9 -9
  96. package/src/agent-runtime.ts +17 -0
  97. package/src/assimilate-cmd.ts +73 -14
  98. package/src/assimilate-deps.ts +23 -3
  99. package/src/bare-launch-menu.ts +17 -0
  100. package/src/claude.ts +31 -37
  101. package/src/cleanup-cmd.ts +2 -2
  102. package/src/cli-tool-approval.ts +3 -2
  103. package/src/codex-remote.ts +4 -2
  104. package/src/config-utils.ts +186 -18
  105. package/src/credential-paths.ts +2 -3
  106. package/src/cubes.ts +9 -4
  107. package/src/foreign-path-reminder.ts +141 -0
  108. package/src/launch-access.ts +40 -0
  109. package/src/launch-all-deps.ts +2 -2
  110. package/src/lifecycle-log-guard.ts +2 -2
  111. package/src/local-server-cursor.ts +2 -2
  112. package/src/opencode-plugin.ts +2 -2
  113. package/src/parse-assimilate-args.ts +7 -1
  114. package/src/private-root.ts +62 -2
  115. package/src/regen-format.ts +1 -1
  116. package/src/resolved-cli-config.ts +40 -0
  117. package/src/seat-store.ts +4 -3
  118. package/src/seats.ts +2 -2
  119. package/src/self-path.ts +5 -0
  120. package/src/server-trust.ts +3 -3
  121. package/src/setup-confirm.ts +1 -1
  122. package/src/setup-selection.ts +87 -0
  123. package/src/setup.ts +98 -24
  124. package/src/stream-owner.ts +2 -2
@@ -22,7 +22,7 @@ The extraction copied the monorepo's `client/src/` production boundary and top-l
22
22
  recovery, `2.0.2`, `2.0.3`, `2.0.4`, `2.0.5`, and `2.0.6` successors were
23
23
  published and registry-verified. The immutable `2.0.7` workflow failed before
24
24
  package creation or npm publication. The `2.0.8`, `2.0.9`, `2.0.10`, `2.0.11`,
25
- `2.1.0`, and `2.1.1` successors were published, and `2.2.0` was subsequently published, and `2.3.0` was subsequently published, and `2.4.0` was subsequently published, and `2.4.1` was subsequently published, and `2.5.0` was subsequently published, and `2.6.0` was subsequently published, and `2.6.1` was subsequently published, and `2.7.0` was subsequently published, and `2.7.1` was subsequently published, and `2.7.2` was subsequently published, and `2.7.3` was subsequently published, and `2.8.0` was subsequently published, and `2.9.0` was subsequently published, and `2.10.0` was subsequently published, and the immutable `2.10.1` release attempt failed before artifact creation or publication. The `2.10.2`, `2.11.0`, `2.12.1`, and `2.13.0` successors were published; the immutable `2.12.0` attempt failed before artifact creation or publication and was superseded by `2.12.1`. The current release identity is `2.14.2`. Extraction and
25
+ `2.1.0`, and `2.1.1` successors were published, and `2.2.0` was subsequently published, and `2.3.0` was subsequently published, and `2.4.0` was subsequently published, and `2.4.1` was subsequently published, and `2.5.0` was subsequently published, and `2.6.0` was subsequently published, and `2.6.1` was subsequently published, and `2.7.0` was subsequently published, and `2.7.1` was subsequently published, and `2.7.2` was subsequently published, and `2.7.3` was subsequently published, and `2.8.0` was subsequently published, and `2.9.0` was subsequently published, and `2.10.0` was subsequently published, and the immutable `2.10.1` release attempt failed before artifact creation or publication. The `2.10.2`, `2.11.0`, `2.12.1`, and `2.13.0` successors were published; the immutable `2.12.0` attempt failed before artifact creation or publication and was superseded by `2.12.1`. The current release identity is `2.16.0`. Extraction and
26
26
  versioning do not authorize publication.
27
27
 
28
28
  ## Review Holds
@@ -47,6 +47,6 @@ client `borgmcp@2.10.0` line. Its annotated tag object
47
47
  `sha512-lOxIPg3WcjSBte46iTM7SAFVN6Y0b2oizOKAJ9Q1EijBdOlmsh/cQlpUIaa8F2UJPaTDFsXy3M64gpGs6XgKzA==`
48
48
  in the `borgmcp-server-0.9.0-release` registry decision. That server and its
49
49
  client line pin historical `borgmcp-shared` version `0.8.1` and remain
50
- immutable. Client `borgmcp@2.14.1` is published. The immutable `v2.0.7`
51
- attempt failed before publication and remains preserved. The current release identity and publication gate remain governed by the reviewed `v2.14.2` source, a fresh annotated tag, and
50
+ immutable. Client `borgmcp@2.15.0` is published. The immutable `v2.0.7`
51
+ attempt failed before publication and remains preserved. The current release identity and publication gate remain governed by the reviewed `v2.16.0` source, a fresh annotated tag, and
52
52
  the exact-artifact and protected-publication gates.
@@ -65,6 +65,15 @@ the first owner record there, so bare `borg assimilate` can use it without an
65
65
  invitation prompt. Use `borg server invite` explicitly when another client or
66
66
  device needs a single-use invitation; its output is owned by the server.
67
67
 
68
+ For an isolated verification or disposable local run, set `BORG_STATE_ROOT` to
69
+ an absolute canonical directory path whose existing ancestors traverse no
70
+ symlinks. On macOS, use the canonical `/private/tmp/...` spelling rather than
71
+ the `/tmp/...` symlink. It replaces the effective home root for all
72
+ Borg-owned state and agent configuration paths, including credentials, seats,
73
+ worktrees, and hooks. Native agent registration commands also resolve their
74
+ config roots under this directory. Harnesses that invoke a native agent should
75
+ set `HOME` to the same directory so the agent itself uses the isolated config.
76
+
68
77
  Status reports only runtime evidence supplied by the server: running/stopped
69
78
  state, exact running artifact and immutable build identity when available,
70
79
  endpoint, process mode, and data-identity availability. If the running build
@@ -148,6 +157,20 @@ local opt-out for launch orientation messaging; setting it does not activate
148
157
  Borg tools or change server authorization. OpenCode has no launch-reminder
149
158
  surface.
150
159
 
160
+ Each assimilated seat also receives a disposable scratch root at
161
+ `~/.borg/scratch/<seat>/`. Borg pre-authorizes exactly the launched worktree and
162
+ that seat's scratch root: Claude Code uses the worktree's
163
+ `.claude/settings.local.json`, OpenCode uses the worktree's
164
+ `.opencode/opencode.json`, and Codex receives native `--add-dir` flags at
165
+ launch. Use the scratch root for detached review checkouts, clean-environment
166
+ rigs, unpacked artifacts, and fake-home directories; nothing durable belongs
167
+ there. For a rig, follow the named workspace, npm manifest-anchor, container
168
+ label, listing, and teardown convention in
169
+ [`docs/RELEASING.md`](RELEASING.md#clean-environment-rig-lifecycle) before
170
+ delivering a verification result. Claude Code and Codex may also print a
171
+ non-blocking reminder when a tool targets a path outside those two roots. The
172
+ permission layer remains the enforcement mechanism.
173
+
151
174
  ## Updating Borg
152
175
 
153
176
  For an npm-global installation, use the whole-product command:
package/docs/RELEASING.md CHANGED
@@ -4,220 +4,11 @@ The GitHub Actions workflow publishes one immutable, reviewed `borgmcp` version
4
4
  from a protected annotated tag. The protected publish job uses npm Trusted
5
5
  Publishing; no long-lived npm token is stored or exposed.
6
6
 
7
- ## Immutable Release Evidence
8
-
9
- The existing lightweight `v2.0.0` tag points to
10
- `90a078264f4d61c0140ad0a30357a4df42c34ab0`. Immutable workflow run
11
- `29693915689` rejected it at annotated-tag verification and failed before package
12
- creation or npm publication; the publish job was skipped and
13
- `borgmcp@2.0.0` remains absent from npm. Never delete, move, replace, reuse, or
14
- rerun that tag or run.
15
-
16
- The annotated `v2.0.1` tag object
17
- `def12ee40af665fc6c3af4873a7d566b3f844fc1` peels to protected-main commit
18
- `b30fc54a4d73bda98db4630864cca796c8923dd9`. Workflow run `29748931957`
19
- successfully published that exact source as `borgmcp@2.0.1`; the registry records
20
- integrity
21
- `sha512-Ah8IY2izZ774gYLKthRL9lfrV+JBk2o9HSlrWUplyZgoGqwVjVboHNon0hWWF5i/fObiCGikFOMY6qZ+vaeyCw==`.
22
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
23
- must use a fresh unused identity and requires the complete release gate again.
24
-
25
- The annotated `v2.0.2` tag object
26
- `a1fc1f8f05c3f1b4d7ccbef86e244955642165b5` peels to protected-main commit
27
- `aced84956fdf41315904c8901e50a345f628152c`. Workflow run `29840120451`
28
- successfully published that exact source as `borgmcp@2.0.2`; the registry records
29
- integrity
30
- `sha512-w0O0t/2wzeJpXEqb4jQGuqZeavEkfFKdz6poRT8q1TxDKHTlOlwo3auctE+X1kWU2s5JkSDcUiUdQdyLwu84IA==`.
31
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
32
- must use a fresh unused identity and requires the complete release gate again.
33
-
34
- The annotated `v2.0.3` tag object
35
- `47701127cbdba6499595ef0529de264b00a61840` peels to protected-main commit
36
- `3e44e9c439c036850c6a9226d02876f4883501d9`. Workflow run `29851751102`
37
- successfully published that exact source as `borgmcp@2.0.3`; the registry records
38
- integrity
39
- `sha512-3Iy4BSB+yq8F75w/gWiEU7D+mKCYYa5mIsn/iC/byy5CK/QsAWg10KgsBI3GlDBZul1CD3Qq+zpmVeK2qpIE1A==`.
40
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
41
- must use a fresh unused identity and requires the complete release gate again.
42
-
43
- The annotated `v2.0.4` tag object
44
- `f86c5b81b77afa7ebd080b508831f1dc39c403e2` peels to protected-main commit
45
- `57a26139a11b47bc5f1d7234bc69e2a2a75954b3`. Workflow run `29925624599`, attempt 1,
46
- successfully published that exact source as `borgmcp@2.0.4`; the registry records integrity
47
- `sha512-xuGxMQ9FZTQN4KP/wGlJqI4LgxP2aKpeykbakjfXHPeUzmNHvkN0YtcenzlSvHsObnpQgMfsy7TNy+YrPkk65g==`.
48
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
49
- uses the unused `v2.0.5` identity from a fresh reviewed protected-main commit
50
- and requires the complete release gate again.
51
-
52
- The annotated `v2.0.5` tag object
53
- `242ed67fec00701f4eb332302e60dff84c0368f7` peels to protected-main commit
54
- `a18a169ec96c5e3194b3bd3edc9e84002c4bc7a3`. Workflow run `29955861508`, attempt 1,
55
- successfully published that exact source as `borgmcp@2.0.5`; the registry records integrity
56
- `sha512-pMqovKzUu0Mdru2YJULj3XkHSeiT/PuCAjwCQ2Sg/mmF299tZE80qvca6GCNCLjhYEWWIuXmssuxK7wePKqxdw==`.
57
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
58
- uses the unused `v2.0.6` identity from a fresh reviewed protected-main commit
59
- and requires the complete release gate again.
60
-
61
- The annotated `v2.0.6` tag object
62
- `b41d312efc9f8d1ed63021812d8165b00011e8d8` peels to protected-main commit
63
- `5fd9048e4c22e4478160e3a25654837b5a33d8bb`. Workflow run `29982288768`, attempt 1,
64
- successfully published that exact source as `borgmcp@2.0.6`; the registry records integrity
65
- `sha512-WDX4tmk46I6Tvb/Gz1XlD/9PbIgOe72rRDCjV+/lw6KnAxWW0S25LT1DgifotI9LQv7LLAok8WkjucDDTTQ+pw==`.
66
- Never move, replace, reuse, or rerun that tag or workflow.
67
-
68
- The annotated `v2.0.7` tag object
69
- `bf41d5a70d7df11930a3124feda72835ae903522` peels to protected-main commit
70
- `85f7c45cffdd449a6de4a52608453b6680492221`. Workflow run `30009042758`,
71
- attempt 1, received registry metadata HTTP 504 for
72
- `@esbuild/openbsd-arm64@0.28.1` and failed before package creation or npm
73
- publication. The publish and registry-verification jobs were skipped, and
74
- `borgmcp@2.0.7` remains absent from npm. Never delete, move, replace, reuse, or
75
- rerun that tag, version, or workflow. The next candidate uses the unused
76
- `v2.0.8` identity from a fresh reviewed protected-main commit and requires the
77
- complete release gate again.
78
-
79
- The annotated `v2.0.8` tag object
80
- `7b5a4929534abfa97a65e278df230adfdb842d8f` peels to protected-main commit
81
- `8bc796d8fc4e307dca593138fb080984662c7d62`. Workflow run `30012098601`, attempt 1,
82
- successfully published that exact source as `borgmcp@2.0.8`; the registry records integrity
83
- `sha512-az1IKG4VNwAF/8PKEVK88gdRoFFBqgtl6ObXX+CcJadavNqkwJ9UFeP8LOJ2js911mIiXEm8c4xDf6MnO0GOng==`.
84
- Never move, replace, reuse, or rerun that tag or workflow. Its successor used
85
- the fresh `v2.0.9` identity from a reviewed protected-main commit and passed the
86
- complete release gate.
87
-
88
- The annotated `v2.0.9` tag object
89
- `3a88bb4f46143789803a4e57f52b94d762f1ca9b` peels to protected-main commit
90
- `18084fc486a041f3438f584a97d218c01a5e0399`. Workflow run `30047299013`, attempt 1,
91
- successfully published that exact source as `borgmcp@2.0.9`; the registry records integrity
92
- `sha512-lf0TZ8ZcpHv/Nt3LkY/IGxkUFkg3weavF+rLv6xLImDDhLIaZly1y8jUdo3UuheQVhrLnLcxoz37Myr4mPx9lg==`.
93
- Never move, replace, reuse, or rerun that tag or workflow.
94
-
95
- The annotated `v2.0.10` tag object
96
- `31ae3c19ac4e04fac33269459a460d5316cce730` peels to protected-main commit
97
- `3f7003b65eadc74cd949857e831e1181a1aad2ff`. Workflow run `30063538271`, attempt 1,
98
- successfully published that exact source as `borgmcp@2.0.10`; the registry records integrity
99
- `sha512-BkFrq75mF7ih0/7Z7RsXsJYo43qNs4ng7tSnvcFCl3k6r+ex1FvTkah0+KQNinDSrv6a+HLWahUe8875so8zew==`.
100
- Never move, replace, reuse, or rerun that tag or workflow.
101
-
102
- The annotated `v2.0.11` tag object
103
- `fb95f4278137d1d7871d945c467eb33984abe1c4` peels to protected-main commit
104
- `0676d93d3e8a64ba583e95f164d122b39687b53a`. Workflow run `30073844074`, attempt 1,
105
- successfully published that exact source as `borgmcp@2.0.11`; the registry records integrity
106
- `sha512-429njJ7HVmWhpm8E71RoLzG57Qehy3RSxEzs6fQofVoOIiZXnK4QQDwbQe9MPfhKifbvVN5lGcDKtKAjuC76ww==`.
107
- Never move, replace, reuse, or rerun that tag or workflow.
108
-
109
- The annotated `v2.1.0` tag object
110
- `e0b189bb0dd1f1b12369ab81870113925e1afc41` peels to protected-main commit
111
- `10f18e4010c9c518c0ea2184d42ed5388642a53f`. Workflow run `30166498938`, attempt 1,
112
- successfully published that exact source as `borgmcp@2.1.0`; the same-run artifact report records integrity
113
- `sha512-Gm9n69y3C0feNDYRPEOnShLCscQJ/BoylcRMH+sDDQJmdcbjY8+U6dDTcFv3w+uH5P/IVwJydB8TGRHPXL0FQA==`.
114
- Never move, replace, reuse, or rerun that tag or workflow.
115
-
116
- The annotated `v2.1.1` tag object
117
- `aa8d772c4791b2da16d702d5d78e5b3c365796c4` peels to protected-main commit
118
- `db0a6a76744928e0067eb03b8a236076c56ae758`. Workflow run `30174878044`, attempt 1,
119
- successfully published that exact source as `borgmcp@2.1.1`; the same-run artifact report records integrity
120
- `sha512-nZJ3i6LBIj/4743mqVRJTUH3YGmC8HfC/NuQb7eOv+/K/dyBogDnwZ3opiZiZSe4LE5CXuG72Sip7cPRoCoZrA==`.
121
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.2.0` tag object
122
- `edf12fcd4c56eb0ad59917269aaeee223b36bd53` peels to protected-main commit
123
- `db4f374e88c24dadee47d5400537890cad1e5f40`. Workflow run `30195666955`, attempt 1,
124
- successfully published that exact source as `borgmcp@2.2.0`; the same-run artifact report records integrity
125
- `sha512-Pi3rpQH6f+V67OPoRIwyKjOFrCJ5y/39knCayExBmnMC5Urb8m+m9UQVNV7cWMuhd3S3WMM6JOkgcIYOVhWnxg==`.
126
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.3.0` tag object
127
- `24b1f8622a0a0b542dbac26c70662f5b499d3426` peels to protected-main commit
128
- `9e708b7233486abdcd7fbc893a2d5bc818241d87`. Workflow run `30218208664`, attempt 1,
129
- successfully published that exact source as `borgmcp@2.3.0`; the same-run artifact report records integrity
130
- `sha512-xyiyC/HXvWnSiii621WdA4qBKehmBzZSaLGN6PZvf82FQUqVONrRyhl1SmOLzPlPXX9boNKSA1EuaVJrtUv6zA==`.
131
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.4.0` tag object
132
- `55458a1c38a670d3e15f8b19909afea195a146ce` peels to protected-main commit
133
- `3882c22d7e8eca34a2213a4e2e4b1bf10dce8fe3`. Workflow run `30246632666`, attempt 1,
134
- successfully published that exact source as `borgmcp@2.4.0`; the same-run artifact report records integrity
135
- `sha512-dQ4jXxmubhtXhIxObTegYYMrgPVk2mZXNHFfV4MRwRWKr1TpQ4xXdmp3Qb89vOOOORvZlux6GNNS5kjy3wDvZw==`.
136
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.4.1` tag object
137
- `1e42aac25fc5368f16334a1eb48ffd0524a3fe7f` peels to protected-main commit
138
- `6b3b5d3c2c008888e55dd88485dafcb623ef9e17`. Workflow run `30282532108`, attempt 1,
139
- successfully published that exact source as `borgmcp@2.4.1`; the same-run artifact report records integrity
140
- `sha512-/tMVjZYqXQrZNPoZHjhpaS02e4Qju752sV+BLf9ML7yFmIf6DhzfItj9hDj/3+ORm6GK3aS4Fz4JmiWDxworZg==`.
141
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.5.0` tag object
142
- `23132a4d71d42f59fd08bab66f0fe3da0114a15a` peels to protected-main commit
143
- `771dd6e78e26744180b2470374790d0e91aad7d7`. Workflow run `30349154152`, attempt 1,
144
- successfully published that exact source as `borgmcp@2.5.0`; the same-run artifact report records integrity
145
- `sha512-BQ5vxtmxqD9V+dmPuGQaog8Ip+K+hbnCxmjZt0zX2v354x7gUZtIt5zmP3HTNe4A5rmO9sp4qvv7XA4gcAGNrg==`.
146
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.6.0` tag object
147
- `c8598e1a1852a3690f53f7089a8342b53e2191da` peels to protected-main commit
148
- `ef90006de0005e2fe2b35d36907a4656352e4abf`. Workflow run `30421261350`, attempt 1,
149
- successfully published that exact source as `borgmcp@2.6.0`; the same-run artifact report records integrity
150
- `sha512-KvJ5kuyMXH6Vd9tImV0zvXWhSj2Y68r09mAO3TqhsGAQM2XERcBPeEmrdp6VI1Z3KYMPjdg0bRvRW7CGonFl9w==`.
151
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.6.1` tag object
152
- `e65b9d43c4a5a7c12a4fafc6e3f1024f6d99c023` peels to protected-main commit
153
- `902847186f5c4fc00f3610ee027e8f929b977670`. Workflow run `30427148267`, attempt 1,
154
- successfully published that exact source as `borgmcp@2.6.1`; the same-run artifact report records integrity
155
- `sha512-N0NIsD2D39d98vvjMkcFwMSn/UXHuHMdMTcuk3awfo6t5FHyd7BYhBsQXhpDuvdJK/02S8g0OdvfHUb827siYQ==`.
156
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.7.0` tag object
157
- `a9a7f75114548b6c383168164f0f59bb05c02b85` peels to protected-main commit
158
- `a8d3c572dee3b90cf2a898768c45a1f46270fe11`. Workflow run `30440435955`, attempt 1,
159
- successfully published that exact source as `borgmcp@2.7.0`; the same-run artifact report records integrity
160
- `sha512-qn7ljuq/UwYzQJ5pWliLqD7Q5mlwk287ObOXbSV5FOcs+JdoXjFlb9NVC6bFoQzjHaWixCX600EAEtRZ0UeNPw==`.
161
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.7.1` tag object
162
- `fc308b52393edf0ed8299490980207840a69c157` peels to protected-main commit
163
- `41091978bfe02831863de26e75fdf3bb48d4b038`. Workflow run `30463299198`, attempt 1,
164
- successfully published that exact source as `borgmcp@2.7.1`; the same-run artifact report records integrity
165
- `sha512-hgxKTCAocbTsBV/YHIegn/jlG9a9YwdbOHD3s5mL+CsN61/5m180rvGJ8+RlNRd5Sdk408phc+QW2Li46tmTMg==`.
166
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.7.2` tag object
167
- `0b16c38da15090a49b285e687fae45381f0f6812` peels to protected-main commit
168
- `52b8a54565f548560dd674d689e0b841e2d8590d`. Workflow run `30491774435`, attempt 1,
169
- successfully published that exact source as `borgmcp@2.7.2`; the same-run artifact report records integrity
170
- `sha512-j/OKr5FzhnDbnLn4pNadbi6XQwR6hcmlfSQHuDsy696KYroL1UagIzelpLJXR+uR/T6FKbD2Zdphr/s81l1Rfw==`.
171
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.7.3` tag object
172
- `b084eb3d2177fc93aa87ca58efde402542b90b8f` peels to protected-main commit
173
- `83fadd1b308f2b770ce0d8da6a3b61183ec94f8d`. Workflow run `30618377765`, attempt 1,
174
- successfully published that exact source as `borgmcp@2.7.3`; the same-run artifact report records integrity
175
- `sha512-Jb+Kg/+H3cPU34JX7eFV3gEO/PzdfJEruNU1mJwYlQZKG7TMfrLJzwghDzxmlMupHJHL3rzAVZ224wioM/pclg==`.
176
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.8.0` tag object
177
- `576e2401a83537662ef0d5f7b0d03d6101b15c54` peels to protected-main commit
178
- `ad40e93ee9b1ff2801119c1c763ad526974ae2a6`. Workflow run `30639790368`, attempt 1,
179
- successfully published that exact source as `borgmcp@2.8.0`; the same-run artifact report records integrity
180
- `sha512-hKNyWwVg/8WJ/qcqaNjZVylMw2UzgFEhE7sAJmWy/BjNU4lEa6ox8N7SdbEt8hhKsySMxt+YTFbNFitRtf9u3g==`.
181
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.9.0` tag object
182
- `26df119da33e914f857f820e68df6e887afed949` peels to protected-main commit
183
- `895f12065c09ec5c0a35f770f26ec89f36f2feaa`. Workflow run `30695501563`, attempt 1,
184
- successfully published that exact source as `borgmcp@2.9.0`; the same-run artifact report records integrity
185
- `sha512-e10KK//zAP6xRDtUjCrLqzVyeX5zd/39JD4LksBhNVL0ZIGthu5ZLahPMrcCjGl6lZQHNTCo8Tez5c1jmThgGQ==`.
186
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.10.0` tag object
187
- `83bd13fe9943c980760db6ecdbcef0d8c413cee0` peels to protected-main commit
188
- `c5d3d2cbe85644d402dfd82ce108dceca3a913a1`. Workflow run `30764262636`, attempt 1,
189
- successfully published that exact source as `borgmcp@2.10.0`; the same-run artifact report records integrity
190
- `sha512-YUVxWevAToQYwu/MDV2r9TrKnaZxpYiEitmLtr7OekfyE0+XZnkyHmL1gSk04JAiYquzv6ZyTRDYMnjQzS5GxA==`.
191
- Never move, replace, reuse, or rerun that tag or workflow. FAILED-SUPERSEDED release record: The annotated `v2.10.1` tag object
192
- `afee30802629d0f838b2446efd2241ff01964af2` peels to protected-main commit
193
- `fcecd75211107994ccd0df0bf4093240f83de9b2`. Workflow run `30766475027`, attempt 1, concluded `failure`
194
- during verification before artifact creation or publication. Verify job `91545993819` records the release
195
- artifact build, verification, exercise, and upload steps as skipped; publish job `91546125556` was skipped.
196
- Registry verification found no published `borgmcp@2.10.1` package, so no published npm artifact or SRI
197
- exists for that version as of this check.
198
- Never delete, move, replace, reuse, or rerun that tag, version, or workflow. The annotated `v2.10.2` tag object
199
- `3655b212c12617aa08cf76747a3b65a73b78e5cc` peels to protected-main commit
200
- `bb8ff57162efdc777bb92f5e1f9d31aaf293d3c6`. Workflow run `30768860612`, attempt 1,
201
- successfully published that exact source as `borgmcp@2.10.2`; the same-run artifact report records integrity
202
- `sha512-uNeDidPLxZDe0E/RnQ35zaAMZwHcBbdpHrk+McQuV4lyBxoMSdf+MlBDHv7usijCtOBAUf+exlR/l4F9wVtvZg==`.
203
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.13.0` tag object
204
- `67a2fd7bf76299dccc94a3260ddfd4b688eacaa1` peels to protected-main commit
205
- `fc5e4d9299210b70f979c7d39130a9c12ea265ea`. Workflow run `30894287863`, attempt 1,
206
- successfully published that exact source as `borgmcp@2.13.0`; the same-run artifact report records integrity
207
- `sha512-YuF3NwY5iBRVKhgdRiK+3GX+6O8O7S/V9g+XYN/1A0so9RLIYoQWpS91qJewqGQ59nyIARjRmk2wKhK8ODxU0Q==`.
208
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.14.0` tag object
209
- `eb9d5cb14b08b1a2eb6d48b2492acbc6cecb7bef` peels to protected-main commit
210
- `4dd92bcbac26f460a4f137f766992e8f93843576`. Workflow run `30929322201`, attempt 1,
211
- successfully published that exact source as `borgmcp@2.14.0`; the same-run artifact report records integrity
212
- `sha512-haKgpQbcbaRya1XqYQaOy7yZiHMxeP8QO3fr7ahHaYDNYrDvlGmXNlW9VMtqnRJ9mtVDC5UTkeuQmCRJMzF/Tg==`.
213
- Never move, replace, reuse, or rerun that tag or workflow. The annotated `v2.14.1` tag object
214
- `c1c8b526dcc31259f6b821f0a6fdd0017a42435c` peels to protected-main commit
215
- `3de4cbf2e5adf6883334fe4e9b7aa1f43868daae`. Workflow run `30943397747`, attempt 1,
216
- successfully published that exact source as `borgmcp@2.14.1`; the same-run artifact report records integrity
217
- `sha512-VqkOp3jo/KnzgusCk98TFj/U8U7Q/gt8agvIbjiSWrV0lIHnsD+A+7w3C+GMQeyA08KXxRuZDF3No9sDomqMTQ==`.
218
- Never move, replace, reuse, or rerun that tag or workflow. The next candidate
219
- uses the unused `v2.14.2` identity from a fresh reviewed protected-main commit
220
- and requires the complete release gate again.
7
+ ## Release Integrity
8
+
9
+ Release provenance is established by protected annotated tags, GitHub build
10
+ provenance, and npm Trusted Publishing. Tags and publication workflows are
11
+ immutable: never move, replace, reuse, or rerun them.
221
12
 
222
13
  ## Release Prerequisites
223
14
 
@@ -246,76 +37,11 @@ Before creating the release tag, independently verify all of these conditions:
246
37
  machine-checkable. A release tag created before they are resolved fails before
247
38
  dependency installation or publication.
248
39
 
249
- ### Release identity preparation
250
-
251
- Prepare the next stable identity only from a clean protected-main checkout. The
252
- command requires evidence for the version being superseded because a workflow
253
- run and artifact integrity cannot be derived from the repository tree:
254
-
255
- ```sh
256
- npm run release:prepare -- 2.3.0 \
257
- --workflow-run-id 30195666955 \
258
- --workflow-run-attempt 1 \
259
- --artifact-integrity 'sha512-...'
260
- ```
261
-
262
- The command independently verifies the annotated tag, its peeled commit, the
263
- exact successful tag-workflow attempt, and npm artifact integrity before writing
264
- anything. It then deterministically updates only the manifest version, the two
265
- root lockfile version fields, the extraction ledger, this document's immutable
266
- release record, and the release-lane current-version/evidence assertions.
267
-
268
- When the superseded tag's attempt failed before artifact creation or publication,
269
- prepare the fresh recovery identity with `--workflow-conclusion failure` and omit
270
- `--artifact-integrity` entirely. The preparer verifies the annotated tag and exact
271
- failed workflow attempt, writes a canonical failed-superseded record stating that
272
- the artifact build, verification, exercise, upload, and publish phases were all
273
- skipped, and separately re-verifies the last published release as the artifact
274
- provenance anchor. It also reads the authoritative registry version list before
275
- writing the time-bounded fact that no published npm artifact or SRI exists for
276
- the failed version. This recovery-time absence check is required before preparing
277
- the replacement identity; it is not the prohibited post-publication readback of
278
- the newly published release. A failed record carrying an SRI, a failed run whose
279
- artifact or publish phase ran, a failed version present in the registry, or a
280
- successful record without an SRI is invalid. Failed tags and workflow attempts
281
- stay immutable and must never be moved, reused, or rerun.
282
-
283
- ```sh
284
- npm run release:prepare -- 2.10.2 \
285
- --workflow-run-id 30766475027 \
286
- --workflow-run-attempt 1 \
287
- --workflow-conclusion failure
288
- ```
40
+ ### Release branches
289
41
 
290
42
  Release branches use the `release/` prefix and enter protected `main` through a
291
- pull request. A direct push only updates the staging branch; it does
292
- not produce a release-identity verdict and grants no review skip, merge
293
- authority, or release authority.
294
-
295
- For a pull request from a same-repository `release/` branch, the dedicated
296
- release-identity workflow is loaded from the exact protected base commit. It
297
- checks out that base, fetches the exact candidate commit into the Git object
298
- database without checking it out, and invokes the base commit's verifier with
299
- explicit base and candidate SHAs. It does not install or execute candidate
300
- dependencies, package scripts, workflow code, actions, or verifier code. The
301
- candidate is treated only as Git tree and blob data.
302
-
303
- To reproduce the classification locally, resolve and pass exact commit SHAs:
304
-
305
- ```sh
306
- base_sha=$(git rev-parse origin/main)
307
- candidate_sha=$(git rev-parse HEAD)
308
- npm run verify:release-identity -- --base "$base_sha" --candidate "$candidate_sha"
309
- ```
310
-
311
- The verifier rechecks the recorded provenance against GitHub, npm, and Git. It
312
- reconstructs the expected tree in a temporary Git index and requires exact tree
313
- equality, exact changed paths, and exact per-file shapes. The release-identity
314
- allowlist must remain byte-identical. The generated no-cloud occurrence allowlist
315
- must also remain byte-identical; any source-line renumbering makes the commit a
316
- code change rather than a release-identity change. A commit the classifier
317
- rejects follows the full code review chain and must never be manually declared
318
- identity-only.
43
+ pull request. Direct pushes only update staging branches; publication still
44
+ requires the complete protected release gate.
319
45
 
320
46
  ## Repository Controls
321
47
 
@@ -340,6 +66,128 @@ Before preparing a candidate, independently verify:
340
66
 
341
67
  ## Release Workflow
342
68
 
69
+ ### Clean-environment rig lifecycle
70
+
71
+ Every clean-environment verification rig has an explicit identity and an
72
+ explicit end-of-life. Keep filesystem workspaces under the seat's disposable
73
+ `~/.borg/scratch/<seat>/` root, and give each workspace a name beginning with
74
+ `borg-rig-` followed by the seat, purpose, and a unique suffix. Before the
75
+ first command that can create files, anchor the rig as its own npm project:
76
+
77
+ ```sh
78
+ BORG_SEAT_LABEL="${BORG_SEAT_LABEL:?set the seat label}"
79
+ BORG_SCRATCH_ROOT="${BORG_SCRATCH_ROOT:-$HOME/.borg/scratch/$BORG_SEAT_LABEL}"
80
+ RIG_NONCE="${RIG_NONCE:-$(date +%Y%m%d%H%M%S)-$$}"
81
+ RIG_ID="borg-rig-${BORG_SEAT_LABEL}-release-${RIG_NONCE}"
82
+ RIG_ROOT="$BORG_SCRATCH_ROOT/$RIG_ID"
83
+ mkdir -p "$RIG_ROOT"
84
+ printf '%s\n' '{"private":true}' > "$RIG_ROOT/package.json"
85
+ ```
86
+
87
+ The manifest anchor is required before any `npm install`, `npm update`, or
88
+ other npm command. Without it, npm can walk up from an empty scratch directory
89
+ and write the operator's `package.json` instead of creating project-local
90
+ state. The committed `release:exercise` follows this rule for its temporary
91
+ consumer; other QA scripts and manual rigs must do the same.
92
+
93
+ The system temporary root is shared with the whole machine, so an unbounded
94
+ listing there is not an inspectable cleanup check. Bound that leg by the
95
+ invoking user and the run-window markers, which select directories whose
96
+ timestamps fall within this run window without requiring a prefix inventory.
97
+ New `mkdtemp` prefixes therefore require no documentation change. Keep both
98
+ time predicates and the ownership predicate: removing the run-window bound
99
+ turns a populated shared temp root back into an uninspectable listing.
100
+
101
+ On a machine where several runs share one user account, this listing can
102
+ include another run's live workspace. Removal is scoped to paths created by
103
+ this run; anything else in the output is reported, not deleted. Unrelated
104
+ same-user temporary directories created during the window can therefore
105
+ appear in the result, so never remove a path merely because this listing found
106
+ it.
107
+
108
+ ```sh
109
+ TEMP_ROOT="${TMPDIR:-/tmp}"
110
+ TEMP_OWNER="$(id -un)"
111
+ TEMP_SCAN_START="$TEMP_ROOT/.${RIG_ID}-temp-scan-start"
112
+ TEMP_SCAN_END="$TEMP_ROOT/.${RIG_ID}-temp-scan-end"
113
+
114
+ list_recent_owned_temp_rigs() {
115
+ find "$TEMP_ROOT" -mindepth 1 -prune \
116
+ -type d \
117
+ -user "$TEMP_OWNER" \
118
+ -newer "$TEMP_SCAN_START" \
119
+ ! -newer "$TEMP_SCAN_END" \
120
+ -print
121
+ }
122
+
123
+ touch "$TEMP_SCAN_START"
124
+ ```
125
+
126
+ Container-backed rigs use the same `RIG_ID` as the container name and carry
127
+ both labels below. `--rm` is preferred; a runtime without automatic removal
128
+ must remove the exact `RIG_ID` in its cleanup path and retain the labels for a
129
+ bounded sweep:
130
+
131
+ ```sh
132
+ RIG_IMAGE="${RIG_IMAGE:?set the rig image}"
133
+ docker run --rm \
134
+ --name "$RIG_ID" \
135
+ --label borg-rig=1 \
136
+ --label "borg-rig-owner=$BORG_SEAT_LABEL" \
137
+ "$RIG_IMAGE"
138
+ ```
139
+
140
+ Register the exact-target cleanup before launching the rig:
141
+
142
+ ```sh
143
+ cleanup_done=0
144
+ cleanup() {
145
+ [ "$cleanup_done" -eq 0 ] || return
146
+ cleanup_done=1
147
+ trap - EXIT HUP INT TERM
148
+ docker container rm --force "$RIG_ID" >/dev/null 2>&1 || true
149
+ rm -rf -- "$RIG_ROOT"
150
+ if [ -e "$TEMP_SCAN_START" ]; then
151
+ touch "$TEMP_SCAN_END"
152
+ list_recent_owned_temp_rigs
153
+ fi
154
+ rm -f -- "$TEMP_SCAN_START" "$TEMP_SCAN_END"
155
+ }
156
+ trap cleanup EXIT
157
+ trap 'exit 129' HUP
158
+ trap 'exit 130' INT
159
+ trap 'exit 143' TERM
160
+ ```
161
+
162
+ List before starting and after cleanup. The filters distinguish this seat's
163
+ rigs from unrelated containers on a shared host:
164
+
165
+ ```sh
166
+ docker container ls --all \
167
+ --filter label=borg-rig=1 \
168
+ --filter "label=borg-rig-owner=${BORG_SEAT_LABEL:?}" \
169
+ --format '{{.ID}}\t{{.Names}}\t{{.Status}}'
170
+ find "$BORG_SCRATCH_ROOT" -mindepth 1 -print
171
+ find "$BORG_SCRATCH_ROOT" -name 'borg-rig-*' -print
172
+ ```
173
+
174
+ The unfiltered filesystem listings expose legacy names as well as conforming
175
+ rigs. The bounded temporary-directory function covers tools that use `mkdtemp`
176
+ instead of the seat scratch root. Run the container and scratch listings before
177
+ launch and again from the cleanup path; the temporary-directory function runs
178
+ after cleanup, between the start and end markers. Inspect its results and do
179
+ not remove unrelated temporary files.
180
+
181
+ Register cleanup before launching any process, run it on success and failure,
182
+ and do not deliver a verdict until the container listing, both scratch listings,
183
+ and the bounded temporary-directory listing show no rig owned by the seat from
184
+ this run. For a non-`--rm` container runtime,
185
+ remove only the named rig or the same owner label; never prune unrelated
186
+ containers. A completed verification
187
+ therefore implies zero running or stopped rig containers and no rig workspace
188
+ created by this run left in either the seat scratch root or the system temporary
189
+ directory.
190
+
343
191
  ### Pre-tag composed exercise
344
192
 
345
193
  Before creating a release tag, exercise the packed client against the selected
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "borgmcp",
3
- "version": "2.14.2",
3
+ "version": "2.16.0",
4
4
  "description": "Coordinate AI coding agents in shared cubes. Works with Claude Code, Codex, and OpenCode.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,27 +19,27 @@
19
19
  "borg-regen": "./dist/regen.js",
20
20
  "borg-clear-rewake": "./dist/clear-rewake.js",
21
21
  "borg-log-audit": "./dist/log-audit.js",
22
+ "borg-foreign-path-reminder": "./dist/foreign-path-reminder.js",
22
23
  "borg-inbox-monitor": "./dist/inbox-monitor.js"
23
24
  },
24
25
  "scripts": {
25
26
  "clean": "node scripts/clean.mjs",
26
- "build": "npm run clean && tsc -p tsconfig.json && node scripts/set-bin-mode.mjs",
27
- "check": "tsc -p tsconfig.json --noEmit",
28
- "dev": "tsc -p tsconfig.json --watch",
27
+ "preflight:node": "node scripts/node-preflight.mjs",
28
+ "build": "npm run preflight:node && npm run clean && tsc -p tsconfig.json && node scripts/set-bin-mode.mjs",
29
+ "check": "npm run preflight:node && tsc -p tsconfig.json --noEmit",
30
+ "dev": "npm run preflight:node && tsc -p tsconfig.json --watch",
29
31
  "start": "node dist/index.js",
30
32
  "test": "npm run test:unit && npm run test:release",
31
- "test:unit": "vitest run --config vitest.config.ts",
32
- "test:release": "node --test test/release-lane.test.mjs test/release-identity.test.mjs",
33
+ "test:unit": "npm run preflight:node && vitest run --config vitest.config.ts",
34
+ "test:release": "npm run preflight:node && node --test test/release-lane.test.mjs",
33
35
  "onboarding:smoke": "node scripts/onboarding-smoke.mjs",
34
- "release:prepare": "node scripts/release-identity.mjs prepare",
35
36
  "release:exercise": "npm run build && node scripts/release-exercise.mjs",
36
37
  "release:check": "npm run verify:public-source && npm run verify:release && npm run verify:lock && npm run check && npm test && npm run build && npm run onboarding:smoke && npm run verify:package",
37
38
  "verify:artifact": "node scripts/verify-packed-artifact.mjs",
38
39
  "verify:public-source": "node scripts/verify-public-source.mjs",
39
40
  "verify:package": "node scripts/verify-local-package.mjs",
40
41
  "verify:release": "node scripts/verify-release-readiness.mjs",
41
- "verify:lock": "node scripts/verify-lock-registry.mjs",
42
- "verify:release-identity": "node scripts/release-identity.mjs verify"
42
+ "verify:lock": "node scripts/verify-lock-registry.mjs"
43
43
  },
44
44
  "files": [
45
45
  "dist",
@@ -5,6 +5,8 @@
5
5
  * agent_kind without re-assimilating.
6
6
  */
7
7
 
8
+ import { BORG_STATE_ROOT_ENV } from './private-root.js';
9
+
8
10
  export type AgentKind = 'claude' | 'codex' | 'opencode';
9
11
 
10
12
  /** Pinned into MCP-child environments by Borg launch paths. */
@@ -74,3 +76,18 @@ export function codexRemoteWakeConfigArgs(enabled: boolean = true): string[] {
74
76
  `mcp_servers.borg.env.${BORG_CODEX_REMOTE_WAKE_ENV}="${enabled ? '1' : '0'}"`,
75
77
  ];
76
78
  }
79
+
80
+ /**
81
+ * Codex MCP children do not inherit the wrapper environment. Pin the explicit
82
+ * Borg state root into the per-launch child environment when one is active.
83
+ */
84
+ export function codexStateRootConfigArgs(
85
+ env: NodeJS.ProcessEnv = process.env
86
+ ): string[] {
87
+ const stateRoot = env[BORG_STATE_ROOT_ENV];
88
+ if (stateRoot === undefined) return [];
89
+ return [
90
+ '-c',
91
+ `mcp_servers.borg.env.${BORG_STATE_ROOT_ENV}=${JSON.stringify(stateRoot)}`,
92
+ ];
93
+ }