storyforge 0.4.14 → 0.4.16
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.
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
// src/bridge-poller.ts
|
|
7
7
|
import { spawn, spawnSync } from "child_process";
|
|
8
8
|
import * as crypto from "crypto";
|
|
9
|
-
var HEARTBEAT_INTERVAL_MS =
|
|
10
|
-
var POLL_INTERVAL_MS =
|
|
9
|
+
var HEARTBEAT_INTERVAL_MS = 6e4;
|
|
10
|
+
var POLL_INTERVAL_MS = 8e3;
|
|
11
11
|
var CLI_TIMEOUT_MS = Number(process.env.SCRIPT_GEN_TIMEOUT_MS) || 20 * 60 * 1e3;
|
|
12
12
|
var BridgePoller = class {
|
|
13
13
|
baseUrl;
|
|
@@ -66,7 +66,7 @@ var BridgePoller = class {
|
|
|
66
66
|
clientVersion: this.clientVersion,
|
|
67
67
|
instanceId: this.instanceId
|
|
68
68
|
}),
|
|
69
|
-
signal: AbortSignal.timeout(
|
|
69
|
+
signal: AbortSignal.timeout(45e3)
|
|
70
70
|
});
|
|
71
71
|
if (!resp.ok) {
|
|
72
72
|
const text = await resp.text().catch(() => "");
|
|
@@ -87,7 +87,7 @@ var BridgePoller = class {
|
|
|
87
87
|
"Content-Type": "application/json"
|
|
88
88
|
},
|
|
89
89
|
body: JSON.stringify({ instanceId: this.instanceId, limit: 3 }),
|
|
90
|
-
signal: AbortSignal.timeout(
|
|
90
|
+
signal: AbortSignal.timeout(45e3)
|
|
91
91
|
});
|
|
92
92
|
if (!resp.ok) {
|
|
93
93
|
if (resp.status === 401) {
|
|
@@ -160,7 +160,7 @@ var BridgePoller = class {
|
|
|
160
160
|
"Content-Type": "application/json"
|
|
161
161
|
},
|
|
162
162
|
body: JSON.stringify({ jobId, ...body }),
|
|
163
|
-
signal: AbortSignal.timeout(
|
|
163
|
+
signal: AbortSignal.timeout(45e3)
|
|
164
164
|
});
|
|
165
165
|
if (!resp.ok) {
|
|
166
166
|
const text = await resp.text().catch(() => "");
|
package/dist/index.js
CHANGED
|
@@ -866,8 +866,16 @@ async function devCommand(options) {
|
|
|
866
866
|
const pathname = url.pathname;
|
|
867
867
|
if (pathname === "/api/cli-usage") {
|
|
868
868
|
try {
|
|
869
|
+
const cached = global.__forgeCliUsageCache;
|
|
870
|
+
const now = Date.now();
|
|
871
|
+
if (cached && now - cached.at < 3e4) {
|
|
872
|
+
res.writeHead(200, { ...CORS_HEADERS, "Content-Type": "application/json" });
|
|
873
|
+
res.end(JSON.stringify(cached.data));
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
869
876
|
const { gatherCliUsage } = await import("./cli-usage-OFFQXJQN.js");
|
|
870
877
|
const report = await gatherCliUsage();
|
|
878
|
+
global.__forgeCliUsageCache = { at: now, data: report };
|
|
871
879
|
res.writeHead(200, { ...CORS_HEADERS, "Content-Type": "application/json" });
|
|
872
880
|
res.end(JSON.stringify(report));
|
|
873
881
|
} catch (err) {
|
|
@@ -1596,7 +1604,7 @@ Return ONLY the complete updated TSX. No markdown fences, no explanation.`;
|
|
|
1596
1604
|
return "0.0.0";
|
|
1597
1605
|
})();
|
|
1598
1606
|
void (async () => {
|
|
1599
|
-
const { BridgePoller } = await import("./bridge-poller-
|
|
1607
|
+
const { BridgePoller } = await import("./bridge-poller-MCXVVFXL.js");
|
|
1600
1608
|
const poller = new BridgePoller({ baseUrl: bridgeUrl, token: bridgeToken, clientVersion: `storyforge ${pkgVersion}` });
|
|
1601
1609
|
poller.start();
|
|
1602
1610
|
})();
|