instar 1.2.34 → 1.2.36
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +20 -67
- package/dist/commands/server.js.map +1 -1
- package/dist/tunnel/CloudflareNamedProvider.d.ts +51 -0
- package/dist/tunnel/CloudflareNamedProvider.d.ts.map +1 -0
- package/dist/tunnel/CloudflareNamedProvider.js +258 -0
- package/dist/tunnel/CloudflareNamedProvider.js.map +1 -0
- package/dist/tunnel/CloudflareQuickProvider.d.ts +48 -0
- package/dist/tunnel/CloudflareQuickProvider.d.ts.map +1 -0
- package/dist/tunnel/CloudflareQuickProvider.js +201 -0
- package/dist/tunnel/CloudflareQuickProvider.js.map +1 -0
- package/dist/tunnel/TunnelLifecycle.d.ts +190 -0
- package/dist/tunnel/TunnelLifecycle.d.ts.map +1 -0
- package/dist/tunnel/TunnelLifecycle.js +222 -0
- package/dist/tunnel/TunnelLifecycle.js.map +1 -0
- package/dist/tunnel/TunnelManager.d.ts +99 -62
- package/dist/tunnel/TunnelManager.d.ts.map +1 -1
- package/dist/tunnel/TunnelManager.js +340 -395
- package/dist/tunnel/TunnelManager.js.map +1 -1
- package/dist/tunnel/TunnelNotifier.d.ts +110 -0
- package/dist/tunnel/TunnelNotifier.d.ts.map +1 -0
- package/dist/tunnel/TunnelNotifier.js +268 -0
- package/dist/tunnel/TunnelNotifier.js.map +1 -0
- package/dist/tunnel/TunnelProvider.d.ts +80 -0
- package/dist/tunnel/TunnelProvider.d.ts.map +1 -0
- package/dist/tunnel/TunnelProvider.js +28 -0
- package/dist/tunnel/TunnelProvider.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.2.35.md +96 -0
- package/upgrades/1.2.36.md +111 -0
- package/upgrades/side-effects/tunnel-failure-resilience.md +118 -0
- package/upgrades/side-effects/tunnel-manager-rewrite.md +129 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkQH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiqDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4gLtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -6758,75 +6758,28 @@ export async function startServer(options) {
|
|
|
6758
6758
|
catch { /* best-effort */ }
|
|
6759
6759
|
console.log('[Housekeeping] Periodic cleanup completed');
|
|
6760
6760
|
}, HOUSEKEEPING_INTERVAL_MS);
|
|
6761
|
-
// Start tunnel AFTER server is listening
|
|
6761
|
+
// Start tunnel AFTER server is listening.
|
|
6762
|
+
//
|
|
6763
|
+
// The TunnelManager is now the single owner of the detect → attempt →
|
|
6764
|
+
// fall-back → notify lifecycle (per
|
|
6765
|
+
// specs/dev-infrastructure/tunnel-failure-resilience.md). The old
|
|
6766
|
+
// startup-retry ladder + background-retry scheduler + Lifeline
|
|
6767
|
+
// failure message that used to live here are RETIRED; the manager
|
|
6768
|
+
// handles backoff internally, schedules the post-exhausted self-heal
|
|
6769
|
+
// retry, and (once the notifier sink is wired in the next PR of the
|
|
6770
|
+
// chain) emits user-facing messages via the two-channel notifier.
|
|
6771
|
+
//
|
|
6772
|
+
// Failure on initial start is non-fatal: the manager keeps trying
|
|
6773
|
+
// in the background, and the post-exhausted retry timer keeps the
|
|
6774
|
+
// agent recoverable without requiring a server restart.
|
|
6762
6775
|
if (tunnel) {
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
6767
|
-
try {
|
|
6768
|
-
const tunnelUrl = await tunnel.start();
|
|
6769
|
-
console.log(pc.green(` Tunnel active: ${pc.bold(tunnelUrl)}`));
|
|
6770
|
-
tunnelStarted = true;
|
|
6771
|
-
break;
|
|
6772
|
-
}
|
|
6773
|
-
catch (err) {
|
|
6774
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
6775
|
-
if (attempt < maxRetries) {
|
|
6776
|
-
const delay = Math.min(15_000 * Math.pow(2, attempt - 1), 120_000); // 15s, 30s, 60s, 120s
|
|
6777
|
-
console.log(pc.yellow(` Tunnel failed (attempt ${attempt}/${maxRetries}): ${msg}`));
|
|
6778
|
-
console.log(pc.yellow(` Retrying in ${delay / 1000}s...`));
|
|
6779
|
-
await new Promise(r => setTimeout(r, delay));
|
|
6780
|
-
}
|
|
6781
|
-
else {
|
|
6782
|
-
console.error(pc.red(` Tunnel failed after ${maxRetries} attempts: ${msg}`));
|
|
6783
|
-
}
|
|
6784
|
-
}
|
|
6776
|
+
try {
|
|
6777
|
+
const tunnelUrl = await tunnel.start();
|
|
6778
|
+
console.log(pc.green(` Tunnel active: ${pc.bold(tunnelUrl)}`));
|
|
6785
6779
|
}
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
console.log(pc.yellow(` Will retry tunnel in ${retryIntervals[0]} minutes...`));
|
|
6790
|
-
const scheduleRetry = (index) => {
|
|
6791
|
-
if (index >= retryIntervals.length)
|
|
6792
|
-
return;
|
|
6793
|
-
setTimeout(async () => {
|
|
6794
|
-
try {
|
|
6795
|
-
const tunnelUrl = await tunnel.start();
|
|
6796
|
-
console.log(pc.green(`[tunnel] Connected: ${tunnelUrl}`));
|
|
6797
|
-
if (tunnelUrl) {
|
|
6798
|
-
const tunnelType = (config.tunnel?.type || 'quick');
|
|
6799
|
-
if (telegram) {
|
|
6800
|
-
await telegram.broadcastDashboardUrl(tunnelUrl, tunnelType).catch(() => { });
|
|
6801
|
-
}
|
|
6802
|
-
if (_slackAdapter) {
|
|
6803
|
-
await _slackAdapter.broadcastDashboardUrl(tunnelUrl).catch(() => { });
|
|
6804
|
-
}
|
|
6805
|
-
}
|
|
6806
|
-
}
|
|
6807
|
-
catch (retryErr) {
|
|
6808
|
-
const msg = retryErr instanceof Error ? retryErr.message : String(retryErr);
|
|
6809
|
-
console.error(`[tunnel] Retry failed: ${msg}`);
|
|
6810
|
-
if (index + 1 < retryIntervals.length) {
|
|
6811
|
-
console.log(`[tunnel] Will retry in ${retryIntervals[index + 1]} minutes...`);
|
|
6812
|
-
scheduleRetry(index + 1);
|
|
6813
|
-
}
|
|
6814
|
-
else {
|
|
6815
|
-
console.error('[tunnel] All retries exhausted. Tunnel unavailable until server restart.');
|
|
6816
|
-
if (telegram) {
|
|
6817
|
-
try {
|
|
6818
|
-
const lifelineId = telegram.getLifelineTopicId?.();
|
|
6819
|
-
if (lifelineId) {
|
|
6820
|
-
await telegram.sendToTopic(lifelineId, '⚠️ Tunnel failed after all retries. Dashboard link is unavailable until the server is restarted.').catch(() => { });
|
|
6821
|
-
}
|
|
6822
|
-
}
|
|
6823
|
-
catch { /* best-effort notification */ }
|
|
6824
|
-
}
|
|
6825
|
-
}
|
|
6826
|
-
}
|
|
6827
|
-
}, retryIntervals[index] * 60_000);
|
|
6828
|
-
};
|
|
6829
|
-
scheduleRetry(0);
|
|
6780
|
+
catch (err) {
|
|
6781
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
6782
|
+
console.error(pc.red(` Tunnel start failed (manager will keep retrying in background): ${msg}`));
|
|
6830
6783
|
}
|
|
6831
6784
|
}
|
|
6832
6785
|
// ── Dashboard Topic: always-available link ──────────────────────────
|