@stage-labs/metro 0.1.0-beta.113 → 0.1.0-beta.114

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": "@stage-labs/metro",
3
- "version": "0.1.0-beta.113",
3
+ "version": "0.1.0-beta.114",
4
4
  "description": "The metro command line. Sign in once per machine, then hand your MCP connector list to Claude Code without the credentials touching disk, argv or shell history.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro",
3
- "version": "0.1.0-beta.113",
3
+ "version": "0.1.0-beta.114",
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, the standing rules loaded at each session start, and a refresh skill for when the daemon could not keep the server list current. No vendor credential ever sits in a config file.",
5
5
  "author": {
6
6
  "name": "Bonustrack",
@@ -58,11 +58,16 @@ function pluginRootsUnder(dir: string, depth: number, out: string[]): void {
58
58
  pluginRootsUnder(join(dir, entry.name), depth - 1, out);
59
59
  }
60
60
 
61
- export function installedPluginFiles(dir = claudeDir()): string[] {
62
- const root = join(dir, 'plugins');
63
- if (!existsSync(root)) return [];
61
+ export function stagedPluginDir(env: NodeJS.ProcessEnv = process.env): string | null {
62
+ const store = env.METRO_RUNTIME_STORE?.trim() ?? '';
63
+ return store === '' ? null : join(store, 'marketplace', 'plugin');
64
+ }
65
+
66
+ export function installedPluginFiles(dir = claudeDir(), staged = stagedPluginDir()): string[] {
64
67
  const roots: string[] = [];
65
- pluginRootsUnder(root, SEARCH_DEPTH, roots);
68
+ const root = join(dir, 'plugins');
69
+ if (existsSync(root)) pluginRootsUnder(root, SEARCH_DEPTH, roots);
70
+ if (staged !== null && existsSync(join(staged, MARKER)) && !roots.includes(staged)) roots.push(staged);
66
71
  return roots.map((found) => join(found, FILE));
67
72
  }
68
73
 
@@ -84,14 +89,21 @@ export interface PluginSyncOptions {
84
89
  dir?: string;
85
90
  base?: string;
86
91
  agents?: string;
92
+ staged?: string | null;
87
93
  }
88
94
 
95
+ function filesFor(opts: PluginSyncOptions): string[] {
96
+ const staged = opts.staged === undefined ? stagedPluginDir() : opts.staged;
97
+ return installedPluginFiles(opts.dir ?? claudeDir(), staged);
98
+ }
99
+
100
+ const rowsFor = (agents?: string): LocalConnectorRow[] =>
101
+ agents === undefined ? readLocalConnectors() : readLocalConnectors(agents);
102
+
89
103
  export function syncPluginServers(opts: PluginSyncOptions = {}): number {
90
- const files = installedPluginFiles(opts.dir ?? claudeDir());
104
+ const files = filesFor(opts);
91
105
  if (files.length === 0) return 0;
92
- const base = opts.base ?? loopbackBase();
93
- const rows = opts.agents === undefined ? readLocalConnectors() : readLocalConnectors(opts.agents);
94
- const servers = pluginServers(rows, base);
106
+ const servers = pluginServers(rowsFor(opts.agents), opts.base ?? loopbackBase());
95
107
  const text = `${JSON.stringify(servers, null, 2)}\n`;
96
108
  let written = 0;
97
109
  for (const file of files) {
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.1.0-beta.113"
2
+ "version": "0.1.0-beta.114"
3
3
  }