@openscout/scout 0.2.73 → 0.2.74

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.
Files changed (52) hide show
  1. package/bin/scoutd +0 -0
  2. package/dist/build-manifest.json +9 -0
  3. package/dist/client/assets/{RepoDiffViewer-D8gg36W3.js → RepoDiffViewer-CTXJvjIL.js} +1 -1
  4. package/dist/client/assets/{addon-fit-D4KdY-pj.js → addon-fit-3IrvLm2n.js} +1 -1
  5. package/dist/client/assets/{addon-webgl-Bo_tmKBp.js → addon-webgl-BgxIDUI-.js} +1 -1
  6. package/dist/client/assets/{arc.es-D0gujIKy.js → arc.es-Bh8P_xre.js} +1 -1
  7. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  8. package/dist/client/assets/cpp-DIPi6g--.js +1 -0
  9. package/dist/client/assets/css-CLj8gQPS.js +1 -0
  10. package/dist/client/assets/dart-bE4Kk8sk.js +1 -0
  11. package/dist/client/assets/docker-BcOcwvcX.js +1 -0
  12. package/dist/client/assets/{embed-entry-CUVNwyB_.js → embed-entry-wAEtYUEM.js} +1 -1
  13. package/dist/client/assets/go-C27-OAKa.js +1 -0
  14. package/dist/client/assets/html-pp8916En.js +1 -0
  15. package/dist/client/assets/index-BK3mRYyN.js +272 -0
  16. package/dist/client/assets/index-Dm1ZQS9G.css +1 -0
  17. package/dist/client/assets/java-CylS5w8V.js +1 -0
  18. package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
  19. package/dist/client/assets/json-Cp-IABpG.js +1 -0
  20. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  21. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  22. package/dist/client/assets/make-CHLpvVh8.js +1 -0
  23. package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
  24. package/dist/client/assets/objective-c-DXmwc3jG.js +1 -0
  25. package/dist/client/assets/proto-C7zT0LnQ.js +1 -0
  26. package/dist/client/assets/python-B6aJPvgy.js +1 -0
  27. package/dist/client/assets/ruby-B13GW9FM.js +1 -0
  28. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  29. package/dist/client/assets/scss-D5BDwBP9.js +1 -0
  30. package/dist/client/assets/shellscript-Yzrsuije.js +1 -0
  31. package/dist/client/assets/sql-CRqJ_cUM.js +1 -0
  32. package/dist/client/assets/swift-D82vCrfD.js +1 -0
  33. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  34. package/dist/client/assets/tsx-COt5Ahok.js +1 -0
  35. package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
  36. package/dist/client/assets/wasm-CG6Dc4jp.js +1 -0
  37. package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
  38. package/dist/client/assets/{xterm-RfflDFod.js → xterm-CoGJTxj9.js} +1 -1
  39. package/dist/client/assets/yaml-Buea-lGh.js +1 -0
  40. package/dist/client/index.html +2 -2
  41. package/dist/main.mjs +887 -584
  42. package/dist/node/main.mjs +115 -1
  43. package/dist/pairing-runtime-controller.mjs +2525 -895
  44. package/dist/runtime/base-daemon.mjs +77 -20
  45. package/dist/runtime/broker-daemon.mjs +1403 -705
  46. package/dist/runtime/broker-process-manager.mjs +29 -0
  47. package/dist/runtime/mesh-discover.mjs +29 -0
  48. package/dist/scout-control-plane-web.mjs +2970 -1116
  49. package/dist/scout-web-server.mjs +2970 -1116
  50. package/package.json +1 -1
  51. package/dist/client/assets/index-CRkjiso5.js +0 -257
  52. package/dist/client/assets/index-D_RX2cRb.css +0 -1
@@ -2226,6 +2226,29 @@ function readNumber2(value) {
2226
2226
  function readHealthTransport(value) {
2227
2227
  return value === "unix_socket" || value === "http" || value === "in_process" ? value : undefined;
2228
2228
  }
2229
+ function readRuntimeFreshness(value) {
2230
+ if (!isRecord3(value))
2231
+ return;
2232
+ const state = readString2(value.state);
2233
+ const basis = readString2(value.basis);
2234
+ const detail = readString2(value.detail);
2235
+ if (!state || !basis || !detail)
2236
+ return;
2237
+ return {
2238
+ state,
2239
+ intentional: readBoolean(value.intentional) ?? false,
2240
+ basis,
2241
+ artifactCommit: readString2(value.artifactCommit) ?? null,
2242
+ expectedCommit: readString2(value.expectedCommit) ?? null,
2243
+ pin: readString2(value.pin) ?? null,
2244
+ pinReason: readString2(value.pinReason) ?? null,
2245
+ manifestPath: readString2(value.manifestPath) ?? null,
2246
+ version: readString2(value.version) ?? null,
2247
+ builtAt: readString2(value.builtAt) ?? null,
2248
+ sourceDirty: readBoolean(value.sourceDirty) ?? null,
2249
+ detail
2250
+ };
2251
+ }
2229
2252
  function normalizeNativeServiceStatus(input, config) {
2230
2253
  const healthRecord = isRecord3(input.health) ? input.health : {};
2231
2254
  const healthReachable = readBoolean(healthRecord.reachable) ?? readBoolean(input.reachable) ?? false;
@@ -2241,6 +2264,7 @@ function normalizeNativeServiceStatus(input, config) {
2241
2264
  const stdoutLogPath = readString2(input.stdoutLogPath) ?? config.stdoutLogPath;
2242
2265
  const stderrLogPath = readString2(input.stderrLogPath) ?? config.stderrLogPath;
2243
2266
  const lastLogLine = readString2(input.lastLogLine) ?? (healthReachable ? readLastLogLine([stdoutLogPath, stderrLogPath]) : readLastLogLine([stderrLogPath, stdoutLogPath]));
2267
+ const runtimeFreshness = readRuntimeFreshness(input.runtimeFreshness);
2244
2268
  return {
2245
2269
  label: readString2(input.label) ?? config.label,
2246
2270
  mode: readString2(input.mode) ?? config.mode,
@@ -2275,6 +2299,7 @@ function normalizeNativeServiceStatus(input, config) {
2275
2299
  ...isRecord3(healthRecord.services) ? { services: healthRecord.services } : {},
2276
2300
  error: healthError
2277
2301
  },
2302
+ ...runtimeFreshness ? { runtimeFreshness } : {},
2278
2303
  lastLogLine
2279
2304
  };
2280
2305
  }
@@ -2579,8 +2604,12 @@ function formatBrokerServiceStatus(status) {
2579
2604
  `reachable: ${status.reachable ? "yes" : "no"}`,
2580
2605
  `health: ${status.health.ok ? "ok" : status.health.error ?? "unreachable"}`,
2581
2606
  `health transport: ${status.health.transport ?? "unknown"}`,
2607
+ `runtime freshness: ${status.runtimeFreshness?.state ?? "unavailable"}`,
2582
2608
  `logs: ${status.stdoutLogPath}`
2583
2609
  ];
2610
+ if (status.runtimeFreshness) {
2611
+ lines.push(`runtime freshness detail: ${status.runtimeFreshness.detail}`);
2612
+ }
2584
2613
  if (status.health.socketFallbackError) {
2585
2614
  lines.push(`socket fallback: ${status.health.socketFallbackError}`);
2586
2615
  }
@@ -2934,6 +2963,7 @@ var RESTART_MAX_DELAY_MS = 30000;
2934
2963
  var BROKER_HEALTH_TIMEOUT_MS = 30000;
2935
2964
  var BROKER_HEALTH_POLL_MS = 250;
2936
2965
  var CHILD_SHUTDOWN_TIMEOUT_MS = 12000;
2966
+ var WEB_START_RETRY_MS = 5000;
2937
2967
  var MENU_BUNDLE_ID = "app.openscout.scout.menu";
2938
2968
  var MENU_PROCESS_NAME = "ScoutMenu";
2939
2969
  var PROCESS_NAME = "scout-base";
@@ -2949,6 +2979,8 @@ var brokerRestartDelayMs = RESTART_MIN_DELAY_MS;
2949
2979
  var edgeRestartDelayMs = RESTART_MIN_DELAY_MS;
2950
2980
  var supervisedWebPid = null;
2951
2981
  var baseKeepAlive = null;
2982
+ var webStartRetryTimer = null;
2983
+ var webStartInFlight = false;
2952
2984
  var config = resolveBrokerServiceConfig();
2953
2985
  var brokerControlUrl = buildLocalBrokerControlUrl(config.brokerHost, config.brokerPort);
2954
2986
  function log(message, details) {
@@ -3207,33 +3239,54 @@ async function startWebWhenBrokerIsReady() {
3207
3239
  if (process.env.OPENSCOUT_BASE_START_WEB === "0") {
3208
3240
  return;
3209
3241
  }
3210
- if (!await waitForBrokerHealth()) {
3211
- warn("broker did not become healthy before web startup timeout");
3242
+ if (webStartInFlight) {
3212
3243
  return;
3213
3244
  }
3245
+ webStartInFlight = true;
3214
3246
  try {
3215
- const edgeConfig = resolveEdgeConfig();
3216
- const scheme = forwardedProtoForEdgeScheme(edgeConfig.scheme);
3217
- const response = await fetch(new URL("/v1/web/start", brokerControlUrl), {
3218
- method: "POST",
3219
- headers: {
3220
- accept: "application/json",
3221
- "x-forwarded-host": edgeConfig.portalHost,
3222
- "x-forwarded-proto": scheme
3223
- },
3224
- signal: AbortSignal.timeout(15000)
3225
- });
3226
- const body = await response.json();
3227
- supervisedWebPid = typeof body.pid === "number" ? body.pid : resolvePortListenerPid(Number.parseInt(process.env.OPENSCOUT_WEB_PORT ?? "", 10) || resolveWebPort());
3228
- if (!response.ok || body.ok !== true) {
3229
- warn("web server did not report healthy", body.error ?? response.statusText);
3247
+ if (!await waitForBrokerHealth()) {
3248
+ warn("broker did not become healthy before web startup timeout");
3249
+ scheduleWebStartRetry();
3230
3250
  return;
3231
3251
  }
3232
- log("web server ready", { pid: supervisedWebPid });
3233
- } catch (error) {
3234
- warn("web server startup failed", error instanceof Error ? error.message : String(error));
3252
+ try {
3253
+ const edgeConfig = resolveEdgeConfig();
3254
+ const scheme = forwardedProtoForEdgeScheme(edgeConfig.scheme);
3255
+ const response = await fetch(new URL("/v1/web/start", brokerControlUrl), {
3256
+ method: "POST",
3257
+ headers: {
3258
+ accept: "application/json",
3259
+ "x-forwarded-host": edgeConfig.portalHost,
3260
+ "x-forwarded-proto": scheme
3261
+ },
3262
+ signal: AbortSignal.timeout(15000)
3263
+ });
3264
+ const body = await response.json();
3265
+ supervisedWebPid = typeof body.pid === "number" ? body.pid : resolvePortListenerPid(Number.parseInt(process.env.OPENSCOUT_WEB_PORT ?? "", 10) || resolveWebPort());
3266
+ if (!response.ok || body.ok !== true) {
3267
+ warn("web server did not report healthy", body.error ?? response.statusText);
3268
+ scheduleWebStartRetry();
3269
+ return;
3270
+ }
3271
+ log("web server ready", { pid: supervisedWebPid });
3272
+ } catch (error) {
3273
+ warn("web server startup failed", error instanceof Error ? error.message : String(error));
3274
+ scheduleWebStartRetry();
3275
+ }
3276
+ } finally {
3277
+ webStartInFlight = false;
3235
3278
  }
3236
3279
  }
3280
+ function scheduleWebStartRetry() {
3281
+ if (shuttingDown || webStartRetryTimer || process.env.OPENSCOUT_BASE_START_WEB === "0") {
3282
+ return;
3283
+ }
3284
+ webStartRetryTimer = setTimeout(() => {
3285
+ webStartRetryTimer = null;
3286
+ startWebWhenBrokerIsReady();
3287
+ }, WEB_START_RETRY_MS);
3288
+ webStartRetryTimer.unref();
3289
+ }
3237
3290
  function resolvePortListenerPid(port) {
3238
3291
  const result = spawnSync2("lsof", ["-nP", `-iTCP:${port}`, "-sTCP:LISTEN", "-t"], {
3239
3292
  encoding: "utf8"
@@ -3337,6 +3390,10 @@ async function shutdown(exitCode = 0) {
3337
3390
  clearInterval(baseKeepAlive);
3338
3391
  baseKeepAlive = null;
3339
3392
  }
3393
+ if (webStartRetryTimer) {
3394
+ clearTimeout(webStartRetryTimer);
3395
+ webStartRetryTimer = null;
3396
+ }
3340
3397
  stopSupervisedWeb();
3341
3398
  stopMenuBarApp();
3342
3399
  const activeCaddyProcess = caddyProcess;