@seedprotocol/gateway-hyper 0.7.5-next.871.g8788c94 → 0.7.6-next.957.g6bb7768

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/dist/bin.js CHANGED
@@ -1,14 +1,24 @@
1
1
  #!/usr/bin/env node
2
- import { i as e, s as t } from "./src-CnXam5V8.js";
2
+ import { r as e, u as t } from "./src-qIlmrs1H.js";
3
3
  import n from "node:path";
4
4
  import r from "node:process";
5
5
  import { parseArgs as i } from "node:util";
6
6
  //#region src/bin.ts
7
- var a = "Usage:\n seed-gateway serve [--upstream http://127.0.0.1:80] [--key-file <path>]\n Operator: accept Hyper connections and proxy them to a local upstream (Traefik).\n Default --key-file: ./.seed/gateway-tunnel/operator.key.json (created on first run).\n\n seed-gateway connect <key> [--host 127.0.0.1] [--port 1984]\n Client: dial an operator key and expose a localhost HTTP sidecar.";
7
+ var a = "Usage:\n seed-gateway serve [--upstream http://127.0.0.1:80] [--key-file <path>] [--upstream-timeout-ms 30000]\n Operator: accept Hyper connections and proxy them to a local upstream (Traefik).\n Default --key-file: ./.seed/gateway-tunnel/operator.key.json (created on first run).\n Answers 504 when the upstream is idle for --upstream-timeout-ms (0 disables).\n\n seed-gateway connect <key> [--host 127.0.0.1] [--port 1984] [--request-timeout-ms 60000]\n Client: dial an operator key and expose a localhost HTTP sidecar.\n Abandons a request and reconnects when the tunnel is idle for --request-timeout-ms.\n [--max-streams 4] opens up to that many streams to the operator, one request each.";
8
8
  function o(e) {
9
9
  console.error(`[Seed Protocol] ${e}`), console.error(a), r.exit(1);
10
10
  }
11
- function s() {
11
+ function s(e, t) {
12
+ if (e === void 0) return;
13
+ let n = Number(e);
14
+ return (!Number.isInteger(n) || n < 0) && o(`${t} must be a whole number of milliseconds`), n;
15
+ }
16
+ function c(e, t) {
17
+ if (e === void 0) return;
18
+ let n = Number(e);
19
+ return (!Number.isInteger(n) || n < 1) && o(`${t} must be a whole number of at least 1`), n;
20
+ }
21
+ function l() {
12
22
  return new Promise((e) => {
13
23
  let t = () => {
14
24
  r.off("SIGINT", t), r.off("SIGTERM", t), e();
@@ -16,14 +26,14 @@ function s() {
16
26
  r.on("SIGINT", t), r.on("SIGTERM", t);
17
27
  });
18
28
  }
19
- async function c(r) {
20
- let [c, ...l] = r;
21
- if (!c || c === "--help" || c === "-h" || c === "help") {
29
+ async function u(r) {
30
+ let [u, ...d] = r;
31
+ if (!u || u === "--help" || u === "-h" || u === "help") {
22
32
  console.log(a);
23
33
  return;
24
34
  }
25
- let { values: u, positionals: d } = i({
26
- args: l,
35
+ let { values: f, positionals: p } = i({
36
+ args: d,
27
37
  allowPositionals: !0,
28
38
  options: {
29
39
  upstream: {
@@ -41,29 +51,35 @@ async function c(r) {
41
51
  port: {
42
52
  type: "string",
43
53
  default: "1984"
44
- }
54
+ },
55
+ "upstream-timeout-ms": { type: "string" },
56
+ "request-timeout-ms": { type: "string" },
57
+ "max-streams": { type: "string" }
45
58
  }
46
59
  });
47
- if (c === "serve") {
48
- let e = u.upstream.trim(), r = n.resolve(u["key-file"]);
60
+ if (u === "serve") {
61
+ let e = f.upstream.trim(), r = n.resolve(f["key-file"]);
49
62
  console.log(`[Seed Protocol] Gateway tunnel upstream: ${e}`), console.log(`[Seed Protocol] Operator key file: ${r}`);
50
63
  let i = await t({
51
64
  upstream: e,
52
- keyFile: r
65
+ keyFile: r,
66
+ upstreamTimeoutMs: s(f["upstream-timeout-ms"], "--upstream-timeout-ms")
53
67
  });
54
- console.log(`[Seed Protocol] Operator key (z32): ${i.key}`), console.log("[Seed Protocol] Share this key with SDK users (gatewayHyperKey)."), console.log("[Seed Protocol] Press Ctrl+C to stop."), await s(), await i.close(), console.log("[Seed Protocol] Gateway tunnel stopped.");
55
- } else if (c === "connect") {
56
- let t = d[0];
68
+ console.log(`[Seed Protocol] Operator key (z32): ${i.key}`), console.log("[Seed Protocol] Share this key with SDK users (gatewayHyperKey)."), console.log("[Seed Protocol] Press Ctrl+C to stop."), await l(), await i.close(), console.log("[Seed Protocol] Gateway tunnel stopped.");
69
+ } else if (u === "connect") {
70
+ let t = p[0];
57
71
  t || o("seed-gateway connect requires an operator public key (z32 or hex)"), console.log(`[Seed Protocol] Connecting to operator ${t}`);
58
72
  let n = await e({
59
73
  key: t,
60
- host: u.host,
61
- port: parseInt(u.port, 10) || 1984
74
+ host: f.host,
75
+ port: parseInt(f.port, 10) || 1984,
76
+ requestTimeoutMs: s(f["request-timeout-ms"], "--request-timeout-ms"),
77
+ maxStreams: c(f["max-streams"], "--max-streams")
62
78
  });
63
- console.log(`[Seed Protocol] Local sidecar: ${n.baseUrl}`), console.log("[Seed Protocol] Point SDK transport=hyper or hybrid at this URL (default sidecar port 1984)."), console.log("[Seed Protocol] Press Ctrl+C to stop."), await s(), await n.close(), console.log("[Seed Protocol] Gateway sidecar stopped.");
64
- } else o(`Unknown command: ${c}`);
79
+ console.log(`[Seed Protocol] Local sidecar: ${n.baseUrl}`), console.log("[Seed Protocol] Point SDK transport=hyper or hybrid at this URL (default sidecar port 1984)."), console.log("[Seed Protocol] Press Ctrl+C to stop."), await l(), await n.close(), console.log("[Seed Protocol] Gateway sidecar stopped.");
80
+ } else o(`Unknown command: ${u}`);
65
81
  }
66
- c(r.argv.slice(2)).catch((e) => {
82
+ u(r.argv.slice(2)).catch((e) => {
67
83
  console.error("[Seed Protocol]", e instanceof Error ? e.message : e), r.exit(1);
68
84
  });
69
85
  //#endregion
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","names":["connectTunnel","serveTunnel","path","process","USAGE","fail","message","waitForSignal","onStop","resolve","main","command","rest","argv","parseArgs","upstream","values","keyFile","session","key","positionals","err"],"sources":["../src/bin.ts"],"sourcesContent":["/**\n * `seed-gateway serve|connect` — HTTP tunnel to Seed gateway + upload API infrastructure over HyperDHT.\n * Run under Node (Holepunch natives may crash under Bun).\n */\nimport path from 'node:path'\nimport process from 'node:process'\nimport { parseArgs } from 'node:util'\nimport { connectTunnel, serveTunnel } from './index'\n\nconst USAGE = `Usage:\n seed-gateway serve [--upstream http://127.0.0.1:80] [--key-file <path>]\n Operator: accept Hyper connections and proxy them to a local upstream (Traefik).\n Default --key-file: ./.seed/gateway-tunnel/operator.key.json (created on first run).\n\n seed-gateway connect <key> [--host 127.0.0.1] [--port 1984]\n Client: dial an operator key and expose a localhost HTTP sidecar.`\n\nfunction fail(message: string): never {\n console.error(`[Seed Protocol] ${message}`)\n console.error(USAGE)\n process.exit(1)\n}\n\nfunction waitForSignal(): Promise<void> {\n return new Promise((resolve) => {\n const onStop = () => {\n process.off('SIGINT', onStop)\n process.off('SIGTERM', onStop)\n resolve()\n }\n process.on('SIGINT', onStop)\n process.on('SIGTERM', onStop)\n })\n}\n\nasync function main(argv: string[]): Promise<void> {\n const [command, ...rest] = argv\n if (!command || command === '--help' || command === '-h' || command === 'help') {\n console.log(USAGE)\n return\n }\n\n const { values, positionals } = parseArgs({\n args: rest,\n allowPositionals: true,\n options: {\n upstream: { type: 'string', default: 'http://127.0.0.1:80' },\n 'key-file': {\n type: 'string',\n default: path.join('.seed', 'gateway-tunnel', 'operator.key.json'),\n },\n host: { type: 'string', default: '127.0.0.1' },\n port: { type: 'string', default: '1984' },\n },\n })\n\n if (command === 'serve') {\n const upstream = values.upstream.trim()\n const keyFile = path.resolve(values['key-file'])\n console.log(`[Seed Protocol] Gateway tunnel upstream: ${upstream}`)\n console.log(`[Seed Protocol] Operator key file: ${keyFile}`)\n\n const session = await serveTunnel({ upstream, keyFile })\n console.log(`[Seed Protocol] Operator key (z32): ${session.key}`)\n console.log('[Seed Protocol] Share this key with SDK users (gatewayHyperKey).')\n console.log('[Seed Protocol] Press Ctrl+C to stop.')\n await waitForSignal()\n await session.close()\n console.log('[Seed Protocol] Gateway tunnel stopped.')\n return\n }\n\n if (command === 'connect') {\n const key = positionals[0]\n if (!key) fail('seed-gateway connect requires an operator public key (z32 or hex)')\n\n console.log(`[Seed Protocol] Connecting to operator ${key}`)\n const session = await connectTunnel({\n key,\n host: values.host,\n port: parseInt(values.port, 10) || 1984,\n })\n console.log(`[Seed Protocol] Local sidecar: ${session.baseUrl}`)\n console.log(\n '[Seed Protocol] Point SDK transport=hyper or hybrid at this URL (default sidecar port 1984).',\n )\n console.log('[Seed Protocol] Press Ctrl+C to stop.')\n await waitForSignal()\n await session.close()\n console.log('[Seed Protocol] Gateway sidecar stopped.')\n return\n }\n\n fail(`Unknown command: ${command}`)\n}\n\nmain(process.argv.slice(2)).catch((err) => {\n console.error('[Seed Protocol]', err instanceof Error ? err.message : err)\n process.exit(1)\n})\n"],"mappings":";;;;;;AASA,IAAMI,IAAQ;AAQd,SAASC,EAAK,GAAwB;CAGpC,AAFA,QAAQ,MAAM,mBAAmBC,GAAS,GAC1C,QAAQ,MAAMF,CAAK,GACnBD,EAAQ,KAAK,CAAC;AAChB;AAEA,SAASI,IAA+B;CACtC,OAAO,IAAI,SAAS,MAAY;EAC9B,IAAMC,UAAe;GAGnB,AAFAL,EAAQ,IAAI,UAAUK,CAAM,GAC5BL,EAAQ,IAAI,WAAWK,CAAM,GAC7BC,EAAQ;EACV;EAEA,AADAN,EAAQ,GAAG,UAAUK,CAAM,GAC3BL,EAAQ,GAAG,WAAWK,CAAM;CAC9B,CAAC;AACH;AAEA,eAAeE,EAAK,GAA+B;CACjD,IAAM,CAACC,GAAS,GAAGC,KAAQC;CAC3B,IAAI,CAACF,KAAWA,MAAY,YAAYA,MAAY,QAAQA,MAAY,QAAQ;EAC9E,QAAQ,IAAIP,CAAK;EACjB;CACF;CAEA,IAAM,EAAE,WAAQ,mBAAgBU,EAAU;EACxC,MAAMF;EACN,kBAAkB;EAClB,SAAS;GACP,UAAU;IAAE,MAAM;IAAU,SAAS;GAAsB;GAC3D,YAAY;IACV,MAAM;IACN,SAASV,EAAK,KAAK,SAAS,kBAAkB,mBAAmB;GACnE;GACA,MAAM;IAAE,MAAM;IAAU,SAAS;GAAY;GAC7C,MAAM;IAAE,MAAM;IAAU,SAAS;GAAO;EAC1C;CACF,CAAC;CAED,IAAIS,MAAY,SAAS;EACvB,IAAMI,IAAWC,EAAO,SAAS,KAAK,GAChCC,IAAUf,EAAK,QAAQc,EAAO,WAAW;EAE/C,AADA,QAAQ,IAAI,4CAA4CD,GAAU,GAClE,QAAQ,IAAI,sCAAsCE,GAAS;EAE3D,IAAMC,IAAU,MAAMjB,EAAY;GAAE;GAAU;EAAQ,CAAC;EAMvD,AALA,QAAQ,IAAI,uCAAuCiB,EAAQ,KAAK,GAChE,QAAQ,IAAI,kEAAkE,GAC9E,QAAQ,IAAI,uCAAuC,GACnD,MAAMX,EAAc,GACpB,MAAMW,EAAQ,MAAM,GACpB,QAAQ,IAAI,yCAAyC;CAEvD,OAEA,IAAIP,MAAY,WAAW;EACzB,IAAMQ,IAAMC,EAAY;EAGxB,AAFKD,KAAKd,EAAK,mEAAmE,GAElF,QAAQ,IAAI,0CAA0Cc,GAAK;EAC3D,IAAMD,IAAU,MAAMlB,EAAc;GAClC;GACA,MAAMgB,EAAO;GACb,MAAM,SAASA,EAAO,MAAM,EAAE,KAAK;EACrC,CAAC;EAQD,AAPA,QAAQ,IAAI,kCAAkCE,EAAQ,SAAS,GAC/D,QAAQ,IACN,8FACF,GACA,QAAQ,IAAI,uCAAuC,GACnD,MAAMX,EAAc,GACpB,MAAMW,EAAQ,MAAM,GACpB,QAAQ,IAAI,0CAA0C;CAExD,OAEA,EAAK,oBAAoBP,GAAS;AACpC;AAEAD,EAAKP,EAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,MAAQ;CAEzC,AADA,QAAQ,MAAM,mBAAmBkB,aAAe,QAAQA,EAAI,UAAUA,CAAG,GACzElB,EAAQ,KAAK,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"bin.js","names":["connectTunnel","serveTunnel","path","process","USAGE","fail","message","parseMs","value","ms","flag","parseCount","count","waitForSignal","onStop","resolve","main","command","rest","argv","parseArgs","upstream","values","keyFile","session","key","positionals","err"],"sources":["../src/bin.ts"],"sourcesContent":["/**\n * `seed-gateway serve|connect` — HTTP tunnel to Seed gateway + upload API infrastructure over HyperDHT.\n * Run under Node (Holepunch natives may crash under Bun).\n */\nimport path from 'node:path'\nimport process from 'node:process'\nimport { parseArgs } from 'node:util'\nimport { connectTunnel, serveTunnel } from './index'\n\nconst USAGE = `Usage:\n seed-gateway serve [--upstream http://127.0.0.1:80] [--key-file <path>] [--upstream-timeout-ms 30000]\n Operator: accept Hyper connections and proxy them to a local upstream (Traefik).\n Default --key-file: ./.seed/gateway-tunnel/operator.key.json (created on first run).\n Answers 504 when the upstream is idle for --upstream-timeout-ms (0 disables).\n\n seed-gateway connect <key> [--host 127.0.0.1] [--port 1984] [--request-timeout-ms 60000]\n Client: dial an operator key and expose a localhost HTTP sidecar.\n Abandons a request and reconnects when the tunnel is idle for --request-timeout-ms.\n [--max-streams 4] opens up to that many streams to the operator, one request each.`\n\nfunction fail(message: string): never {\n console.error(`[Seed Protocol] ${message}`)\n console.error(USAGE)\n process.exit(1)\n}\n\nfunction parseMs(value: string | undefined, flag: string): number | undefined {\n if (value === undefined) return undefined\n const ms = Number(value)\n if (!Number.isInteger(ms) || ms < 0) fail(`${flag} must be a whole number of milliseconds`)\n return ms\n}\n\nfunction parseCount(value: string | undefined, flag: string): number | undefined {\n if (value === undefined) return undefined\n const count = Number(value)\n if (!Number.isInteger(count) || count < 1) fail(`${flag} must be a whole number of at least 1`)\n return count\n}\n\nfunction waitForSignal(): Promise<void> {\n return new Promise((resolve) => {\n const onStop = () => {\n process.off('SIGINT', onStop)\n process.off('SIGTERM', onStop)\n resolve()\n }\n process.on('SIGINT', onStop)\n process.on('SIGTERM', onStop)\n })\n}\n\nasync function main(argv: string[]): Promise<void> {\n const [command, ...rest] = argv\n if (!command || command === '--help' || command === '-h' || command === 'help') {\n console.log(USAGE)\n return\n }\n\n const { values, positionals } = parseArgs({\n args: rest,\n allowPositionals: true,\n options: {\n upstream: { type: 'string', default: 'http://127.0.0.1:80' },\n 'key-file': {\n type: 'string',\n default: path.join('.seed', 'gateway-tunnel', 'operator.key.json'),\n },\n host: { type: 'string', default: '127.0.0.1' },\n port: { type: 'string', default: '1984' },\n 'upstream-timeout-ms': { type: 'string' },\n 'request-timeout-ms': { type: 'string' },\n 'max-streams': { type: 'string' },\n },\n })\n\n if (command === 'serve') {\n const upstream = values.upstream.trim()\n const keyFile = path.resolve(values['key-file'])\n console.log(`[Seed Protocol] Gateway tunnel upstream: ${upstream}`)\n console.log(`[Seed Protocol] Operator key file: ${keyFile}`)\n\n const session = await serveTunnel({\n upstream,\n keyFile,\n upstreamTimeoutMs: parseMs(values['upstream-timeout-ms'], '--upstream-timeout-ms'),\n })\n console.log(`[Seed Protocol] Operator key (z32): ${session.key}`)\n console.log('[Seed Protocol] Share this key with SDK users (gatewayHyperKey).')\n console.log('[Seed Protocol] Press Ctrl+C to stop.')\n await waitForSignal()\n await session.close()\n console.log('[Seed Protocol] Gateway tunnel stopped.')\n return\n }\n\n if (command === 'connect') {\n const key = positionals[0]\n if (!key) fail('seed-gateway connect requires an operator public key (z32 or hex)')\n\n console.log(`[Seed Protocol] Connecting to operator ${key}`)\n const session = await connectTunnel({\n key,\n host: values.host,\n port: parseInt(values.port, 10) || 1984,\n requestTimeoutMs: parseMs(values['request-timeout-ms'], '--request-timeout-ms'),\n maxStreams: parseCount(values['max-streams'], '--max-streams'),\n })\n console.log(`[Seed Protocol] Local sidecar: ${session.baseUrl}`)\n console.log(\n '[Seed Protocol] Point SDK transport=hyper or hybrid at this URL (default sidecar port 1984).',\n )\n console.log('[Seed Protocol] Press Ctrl+C to stop.')\n await waitForSignal()\n await session.close()\n console.log('[Seed Protocol] Gateway sidecar stopped.')\n return\n }\n\n fail(`Unknown command: ${command}`)\n}\n\nmain(process.argv.slice(2)).catch((err) => {\n console.error('[Seed Protocol]', err instanceof Error ? err.message : err)\n process.exit(1)\n})\n"],"mappings":";;;;;;AASA,IAAMI,IAAQ;AAWd,SAASC,EAA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I,UAAUA,CAAG,GACzExB,EAAQ,KAAK,CAAC;AAChB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,7 +3,10 @@ export { serveTunnel } from './tunnel/serve';
3
3
  export { connectTunnel, localGatewayUrl } from './tunnel/connect';
4
4
  export { createGatewayProxy } from './tunnel/proxyApp';
5
5
  export { stripMountPath } from './tunnel/mountPath';
6
- export { createTunnelSession } from './tunnel/session';
6
+ export { createTunnelSession, DEFAULT_CONNECT_TIMEOUT_MS, DEFAULT_MAX_STREAMS, DEFAULT_REQUEST_TIMEOUT_MS, } from './tunnel/session';
7
+ export type { TunnelRequestOptions, TunnelSession, TunnelSessionOptions } from './tunnel/session';
8
+ export { DEFAULT_UPSTREAM_TIMEOUT_MS } from './tunnel/proxy';
9
+ export { TunnelConnectTimeoutError, TunnelTimeoutError, UpstreamTimeoutError, } from './tunnel/errors';
7
10
  export { writeFrame, readFrame, writeTunnelRequest, readTunnelRequest, writeTunnelResponse, readTunnelResponse, flattenRequestHeaders, filterResponseHeaders, MAX_FRAME_BYTES, } from './tunnel/protocol';
8
11
  export type { TunnelMeta, TunnelResponseMeta, ServeTunnelOptions, ServeTunnelResult, ConnectTunnelOptions, ConnectTunnelResult, OperatorKeyPair, CreateGatewayProxyOptions, GatewayProxy, } from './types';
9
12
  export { DEFAULT_SEED_GATEWAY_HYPER_KEY } from './constants';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAA;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,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B,CAAA;AAE1B,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,YAAY,GACb,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { t as DEFAULT_SEED_GATEWAY_HYPER_KEY, c as MAX_FRAME_BYTES, i as connectTunnel, n as createGatewayProxy, o as createTunnelSession, _ as decodePublicKey, v as encodePublicKeyZ32, l as filterResponseHeaders, u as flattenRequestHeaders, y as loadOrCreateOperatorKeypair, a as localGatewayUrl, d as readFrame, f as readTunnelRequest, p as readTunnelResponse, s as serveTunnel, r as stripMountPath, m as writeFrame, h as writeTunnelRequest, g as writeTunnelResponse } from "./src-CnXam5V8.js";
1
+ export { a as DEFAULT_CONNECT_TIMEOUT_MS, o as DEFAULT_MAX_STREAMS, s as DEFAULT_REQUEST_TIMEOUT_MS, t as DEFAULT_SEED_GATEWAY_HYPER_KEY, d as DEFAULT_UPSTREAM_TIMEOUT_MS, h as MAX_FRAME_BYTES, f as TunnelConnectTimeoutError, p as TunnelTimeoutError, m as UpstreamTimeoutError, r as connectTunnel, n as createGatewayProxy, c as createTunnelSession, w as decodePublicKey, T as encodePublicKeyZ32, g as filterResponseHeaders, _ as flattenRequestHeaders, E as loadOrCreateOperatorKeypair, i as localGatewayUrl, v as readFrame, y as readTunnelRequest, b as readTunnelResponse, u as serveTunnel, l as stripMountPath, x as writeFrame, S as writeTunnelRequest, C as writeTunnelResponse } from "./src-qIlmrs1H.js";