@stage-labs/metro 0.1.0-beta.56 → 0.1.0-beta.57

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.56",
3
+ "version": "0.1.0-beta.57",
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": {
@@ -100,18 +100,23 @@ export const currentTunnelUrl = (): string | null => liveUrl;
100
100
 
101
101
  export type Resolves = (host: string) => Promise<boolean>;
102
102
 
103
- const PUBLIC_RESOLVERS = ['1.1.1.1', '1.0.0.1'];
103
+ const PUBLIC_RESOLVERS = ['1.1.1.1', '8.8.8.8'];
104
104
  const RESOLVE_EVERY_MS = 3_000;
105
105
  const RESOLVE_GIVE_UP_MS = 180_000;
106
106
 
107
- export async function resolvesAtCloudflare(host: string): Promise<boolean> {
107
+ async function resolvesAt(server: string, host: string): Promise<boolean> {
108
108
  const resolver = new Resolver();
109
- resolver.setServers(PUBLIC_RESOLVERS);
110
- try {
111
- return (await resolver.resolve4(host)).length > 0;
112
- } catch {
113
- return false;
114
- }
109
+ resolver.setServers([server]);
110
+ const answers = await Promise.all([
111
+ resolver.resolve4(host).catch(() => []),
112
+ resolver.resolve6(host).catch(() => []),
113
+ ]);
114
+ return answers.some((a) => a.length > 0);
115
+ }
116
+
117
+ export async function resolvesAtCloudflare(host: string): Promise<boolean> {
118
+ const found = await Promise.all(PUBLIC_RESOLVERS.map((server) => resolvesAt(server, host)));
119
+ return found.some(Boolean);
115
120
  }
116
121
 
117
122
  async function untilResolvable(host: string, resolves: Resolves): Promise<boolean> {
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.1.0-beta.56"
2
+ "version": "0.1.0-beta.57"
3
3
  }