@sjawhar/opencode-legion-envoy 8.25.0 → 8.26.0
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/dispatch.js +14 -4
- package/dist/src/server.js +22 -5
- package/package.json +1 -1
package/dist/dispatch.js
CHANGED
|
@@ -19342,8 +19342,14 @@ function dispatchSettings(env, config2) {
|
|
|
19342
19342
|
|
|
19343
19343
|
// ../envoy-client/src/envoy-settings.ts
|
|
19344
19344
|
var DEFAULT_ENVOY_URL = "http://127.0.0.1:9020";
|
|
19345
|
-
var DEFAULT_HEARTBEAT_MS =
|
|
19346
|
-
var
|
|
19345
|
+
var DEFAULT_HEARTBEAT_MS = 90000;
|
|
19346
|
+
var MIN_PASS_DEADLINE_MS = 30000;
|
|
19347
|
+
var MIN_INTERVAL_MS = 25;
|
|
19348
|
+
var MAX_INTERVAL_MS = 2147483647;
|
|
19349
|
+
function namedInterval(raw) {
|
|
19350
|
+
const parsed = Number(raw);
|
|
19351
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
|
|
19352
|
+
}
|
|
19347
19353
|
function natsSeedFromEnvironment(env) {
|
|
19348
19354
|
const { NATS_NKEY_SEED_FILE: file2, NATS_NKEY_SEED: plain } = env;
|
|
19349
19355
|
if (file2 !== undefined) {
|
|
@@ -19430,13 +19436,17 @@ function envoySettings(env, config2, options = {}) {
|
|
|
19430
19436
|
inbound = { off: messageFor(error48) };
|
|
19431
19437
|
}
|
|
19432
19438
|
}
|
|
19433
|
-
const
|
|
19439
|
+
const namedHeartbeatMs = namedInterval(env.ENVOY_HEARTBEAT_MS);
|
|
19440
|
+
const heartbeatMs = namedHeartbeatMs === undefined ? DEFAULT_HEARTBEAT_MS : Math.min(Math.max(namedHeartbeatMs, MIN_INTERVAL_MS), MAX_INTERVAL_MS);
|
|
19441
|
+
const namedPassDeadlineMs = namedInterval(env.ENVOY_PASS_DEADLINE_MS);
|
|
19434
19442
|
return {
|
|
19435
19443
|
enabled: true,
|
|
19436
19444
|
url: normalizeEnvoyUrl(url2),
|
|
19437
19445
|
token,
|
|
19438
19446
|
inbound,
|
|
19439
|
-
heartbeatMs
|
|
19447
|
+
heartbeatMs,
|
|
19448
|
+
passDeadlineMs: Math.min(Math.max(namedPassDeadlineMs ?? MIN_PASS_DEADLINE_MS, heartbeatMs), MAX_INTERVAL_MS),
|
|
19449
|
+
passDeadlineRaisedFrom: namedPassDeadlineMs !== undefined && namedPassDeadlineMs < heartbeatMs ? namedPassDeadlineMs : undefined
|
|
19440
19450
|
};
|
|
19441
19451
|
}
|
|
19442
19452
|
function normalizeEnvoyUrl(value) {
|
package/dist/src/server.js
CHANGED
|
@@ -14975,8 +14975,14 @@ function dispatchSettings(env, config2) {
|
|
|
14975
14975
|
|
|
14976
14976
|
// ../envoy-client/src/envoy-settings.ts
|
|
14977
14977
|
var DEFAULT_ENVOY_URL = "http://127.0.0.1:9020";
|
|
14978
|
-
var DEFAULT_HEARTBEAT_MS =
|
|
14979
|
-
var
|
|
14978
|
+
var DEFAULT_HEARTBEAT_MS = 90000;
|
|
14979
|
+
var MIN_PASS_DEADLINE_MS = 30000;
|
|
14980
|
+
var MIN_INTERVAL_MS = 25;
|
|
14981
|
+
var MAX_INTERVAL_MS = 2147483647;
|
|
14982
|
+
function namedInterval(raw) {
|
|
14983
|
+
const parsed = Number(raw);
|
|
14984
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
|
|
14985
|
+
}
|
|
14980
14986
|
function natsSeedFromEnvironment(env) {
|
|
14981
14987
|
const { NATS_NKEY_SEED_FILE: file2, NATS_NKEY_SEED: plain } = env;
|
|
14982
14988
|
if (file2 !== undefined) {
|
|
@@ -15063,13 +15069,17 @@ function envoySettings(env, config2, options = {}) {
|
|
|
15063
15069
|
inbound = { off: messageFor(error48) };
|
|
15064
15070
|
}
|
|
15065
15071
|
}
|
|
15066
|
-
const
|
|
15072
|
+
const namedHeartbeatMs = namedInterval(env.ENVOY_HEARTBEAT_MS);
|
|
15073
|
+
const heartbeatMs = namedHeartbeatMs === undefined ? DEFAULT_HEARTBEAT_MS : Math.min(Math.max(namedHeartbeatMs, MIN_INTERVAL_MS), MAX_INTERVAL_MS);
|
|
15074
|
+
const namedPassDeadlineMs = namedInterval(env.ENVOY_PASS_DEADLINE_MS);
|
|
15067
15075
|
return {
|
|
15068
15076
|
enabled: true,
|
|
15069
15077
|
url: normalizeEnvoyUrl(url2),
|
|
15070
15078
|
token,
|
|
15071
15079
|
inbound,
|
|
15072
|
-
heartbeatMs
|
|
15080
|
+
heartbeatMs,
|
|
15081
|
+
passDeadlineMs: Math.min(Math.max(namedPassDeadlineMs ?? MIN_PASS_DEADLINE_MS, heartbeatMs), MAX_INTERVAL_MS),
|
|
15082
|
+
passDeadlineRaisedFrom: namedPassDeadlineMs !== undefined && namedPassDeadlineMs < heartbeatMs ? namedPassDeadlineMs : undefined
|
|
15073
15083
|
};
|
|
15074
15084
|
}
|
|
15075
15085
|
function normalizeEnvoyUrl(value) {
|
|
@@ -15114,6 +15124,9 @@ function startNotice(config2, dispatch, envoy, nats) {
|
|
|
15114
15124
|
if (envoy.enabled && nats && "off" in envoy.inbound) {
|
|
15115
15125
|
parts.push(`Envoy's inbound messages are off: ${envoy.inbound.off}; the Envoy tools still work`);
|
|
15116
15126
|
}
|
|
15127
|
+
if (envoy.enabled && envoy.passDeadlineRaisedFrom !== undefined) {
|
|
15128
|
+
parts.push(`Envoy's pass deadline is ${envoy.passDeadlineMs} ms, not the ${envoy.passDeadlineRaisedFrom} ms ENVOY_PASS_DEADLINE_MS names: a deadline inside one ${envoy.heartbeatMs} ms heartbeat interval would abandon every pass before the next tick, so the registration refresh the heartbeat posts for a stalled pass would never run`);
|
|
15129
|
+
}
|
|
15117
15130
|
return parts.length === 0 ? null : parts.join("; ");
|
|
15118
15131
|
}
|
|
15119
15132
|
function sessionSettings(file2, env, options) {
|
|
@@ -15124,7 +15137,11 @@ function sessionSettings(file2, env, options) {
|
|
|
15124
15137
|
const config2 = readEnvoyConfig(file2.path, env, options);
|
|
15125
15138
|
const dispatch = dispatchSettings(env, config2);
|
|
15126
15139
|
const envoy = envoySettings(env, config2, { nats: options.nats });
|
|
15127
|
-
return {
|
|
15140
|
+
return {
|
|
15141
|
+
dispatch,
|
|
15142
|
+
envoy,
|
|
15143
|
+
notice: startNotice(config2, dispatch, envoy, options.nats !== false)
|
|
15144
|
+
};
|
|
15128
15145
|
}
|
|
15129
15146
|
|
|
15130
15147
|
// ../envoy-client/src/dispatch-command.ts
|