@stage-labs/metro 0.1.0-beta.211 → 0.1.0-beta.212
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.212",
|
|
4
4
|
"description": "Metro for Claude Code, installed by the metro daemon on this machine: every connector the agent holds as its own MCP server relayed through the daemon, the orchestrator-only guard on the main thread, and the standing rules loaded at each session start. No vendor credential ever sits in a config file.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bonustrack",
|
|
@@ -154,10 +154,6 @@ function capturePane(tmux: string): string {
|
|
|
154
154
|
return run.error === undefined && run.status === 0 ? run.stdout : '';
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
const MCP_MISSING = 'no MCP server configured with that name';
|
|
158
|
-
const RELAUNCH_MAX = 3;
|
|
159
|
-
let relaunches = 0;
|
|
160
|
-
|
|
161
157
|
function noteLaunchLines(pane: string, seen: Set<string>): void {
|
|
162
158
|
for (const line of pane.split('\n').map((l) => l.trim()))
|
|
163
159
|
if (line.startsWith('metro claude:') && !seen.has(line)) {
|
|
@@ -166,26 +162,12 @@ function noteLaunchLines(pane: string, seen: Set<string>): void {
|
|
|
166
162
|
}
|
|
167
163
|
}
|
|
168
164
|
|
|
169
|
-
function relaunchWithoutMcp(tmux: string): void {
|
|
170
|
-
if (relaunches >= RELAUNCH_MAX) {
|
|
171
|
-
log.error('claude-session: Claude Code keeps starting without the metro MCP server, so channel messages cannot reach it; see the metro claude lines above');
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
relaunches += 1;
|
|
175
|
-
log.warn({ attempt: relaunches }, 'claude-session: Claude Code started without the metro MCP server, so channel messages cannot reach it; restarting the session');
|
|
176
|
-
spawnSync(...asAgent(tmux, ['kill-session', '-t', SESSION_NAME]), { stdio: 'ignore' });
|
|
177
|
-
}
|
|
178
|
-
|
|
179
165
|
function confirmChannels(tmux: string, until: number): void {
|
|
180
166
|
const seen = new Set<string>();
|
|
181
167
|
let confirmed = false;
|
|
182
168
|
const tick = (): void => {
|
|
183
169
|
const pane = capturePane(tmux);
|
|
184
170
|
noteLaunchLines(pane, seen);
|
|
185
|
-
if (pane.includes(MCP_MISSING) && pane.includes('server:metro')) {
|
|
186
|
-
relaunchWithoutMcp(tmux);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
171
|
if (!confirmed && pane.includes(WARNING) && pane.includes('server:metro')) {
|
|
190
172
|
spawnSync(...asAgent(tmux, ['send-keys', '-t', SESSION_NAME, 'Enter']), { stdio: 'ignore' });
|
|
191
173
|
log.info('claude-session: confirmed the development channels dialog for server:metro');
|
package/runtime/runtime.json
CHANGED