@stage-labs/metro 0.1.0-beta.89 → 0.1.0-beta.90
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 +1 -1
- package/runtime/node_modules/@metro-labs/daemon/src/connectors/cli-api.ts +2 -2
- package/runtime/node_modules/@metro-labs/daemon/src/connectors/plugin-sync.ts +2 -2
- package/runtime/node_modules/@metro-labs/daemon/src/files/attach-serve.ts +3 -3
- package/runtime/runtime.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stage-labs/metro",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.90",
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
2
|
import { errMsg, log } from '@metro-labs/core/log';
|
|
3
3
|
import { cors, sendJson, type AgentIdentity } from '@metro-labs/http/api-http';
|
|
4
|
-
import {
|
|
4
|
+
import { loopbackBase } from '../files/attach-serve.js';
|
|
5
5
|
import { relayServersJson, type RelayServerEntry } from './json.js';
|
|
6
6
|
import { agentIdForKey } from '../agents/keys.js';
|
|
7
7
|
|
|
@@ -53,7 +53,7 @@ export function handleLocalCliRequest(
|
|
|
53
53
|
.connectorEntries(who.agentId)
|
|
54
54
|
.then((entries) => {
|
|
55
55
|
const agent = deps.agentName(who.agentId) ?? '';
|
|
56
|
-
sendJson(req, res, 200, { json: relayServersJson(entries,
|
|
56
|
+
sendJson(req, res, 200, { json: relayServersJson(entries, loopbackBase(), keyOf(req)), agent });
|
|
57
57
|
})
|
|
58
58
|
.catch((err: unknown) => {
|
|
59
59
|
log.warn({ err: errMsg(err) }, 'local cli: request failed');
|
|
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, renameSync, writeFileSync } from
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { errMsg, log } from '@metro-labs/core/log';
|
|
4
4
|
import { claudeDir } from '../claude/files.js';
|
|
5
|
-
import {
|
|
5
|
+
import { loopbackBase } from '../files/attach-serve.js';
|
|
6
6
|
import { readLocalConnectors, type LocalConnectorRow } from './store.js';
|
|
7
7
|
|
|
8
8
|
const MARKER = join('bin', 'metro-plugin.mjs');
|
|
@@ -76,7 +76,7 @@ export interface PluginSyncOptions {
|
|
|
76
76
|
export function syncPluginServers(opts: PluginSyncOptions = {}): number {
|
|
77
77
|
const files = installedPluginFiles(opts.dir ?? claudeDir());
|
|
78
78
|
if (files.length === 0) return 0;
|
|
79
|
-
const base = opts.base ??
|
|
79
|
+
const base = opts.base ?? loopbackBase();
|
|
80
80
|
const rows = opts.agents === undefined ? readLocalConnectors() : readLocalConnectors(opts.agents);
|
|
81
81
|
const servers = pluginServers(rows, base);
|
|
82
82
|
const text = `${JSON.stringify(servers, null, 2)}\n`;
|
|
@@ -30,15 +30,15 @@ export function publicBaseUrl(): string | null {
|
|
|
30
30
|
return currentTunnelUrl();
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
export const loopbackBase = (): string => `http://127.0.0.1:${String(webhookPort())}`;
|
|
34
34
|
|
|
35
|
-
export const publicBaseOrDefault = (): string => publicBaseUrl() ??
|
|
35
|
+
export const publicBaseOrDefault = (): string => publicBaseUrl() ?? loopbackBase();
|
|
36
36
|
|
|
37
37
|
export function attachmentUrl(
|
|
38
38
|
pathOrName: string,
|
|
39
39
|
agentId: string,
|
|
40
40
|
): string | null {
|
|
41
|
-
const base = publicBaseUrl() ??
|
|
41
|
+
const base = publicBaseUrl() ?? loopbackBase();
|
|
42
42
|
if (!base) return null;
|
|
43
43
|
const name = pathOrName.split('/').pop();
|
|
44
44
|
if (!name || !resolveCachedAttachment(name)) return null;
|
package/runtime/runtime.json
CHANGED