@openscout/scout 0.2.109 → 0.2.110
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/README.md +206 -122
- package/bin/scoutd +0 -0
- package/dist/build-manifest.json +3 -3
- package/dist/chat.mjs +211 -30
- package/dist/client/assets/{conversation-motion-features-PYM3Yx_M.js → conversation-motion-features-BeAplMGv.js} +1 -1
- package/dist/client/assets/index-CMbTY75G.js +91 -0
- package/dist/client/assets/index-DYfh8pn_.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/main.mjs +7628 -3047
- package/dist/node/main.mjs +671 -115
- package/dist/openscout-terminal-relay.mjs +12 -3
- package/dist/pairing-runtime-controller.mjs +17539 -6059
- package/dist/runtime/base-daemon.mjs +410 -54
- package/dist/runtime/broker-daemon.mjs +67463 -52744
- package/dist/runtime/broker-process-manager.mjs +41 -14
- package/dist/runtime/mesh-discover.mjs +39 -13
- package/dist/scout-control-plane-web.mjs +80047 -58867
- package/dist/statusline.mjs +10 -3
- package/dist/update-helper.mjs +1105 -69
- package/package.json +2 -2
- package/server.json +2 -2
- package/dist/client/assets/index-DGR8nSEY.js +0 -88
- package/dist/client/assets/index-rA7f7Rt0.css +0 -1
|
@@ -5,7 +5,7 @@ import "reflect-metadata";
|
|
|
5
5
|
import { spawn as spawn2, spawnSync } from "child_process";
|
|
6
6
|
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
7
7
|
import { homedir as homedir5, networkInterfaces } from "os";
|
|
8
|
-
import { basename as basename2, dirname as
|
|
8
|
+
import { basename as basename2, dirname as dirname4, join as join5, resolve as resolve2 } from "path";
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
10
|
|
|
11
11
|
// packages/runtime/src/broker-api.ts
|
|
@@ -171,6 +171,15 @@ async function requestBrokerWire(baseUrl, path, options) {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
class ScoutBrokerHttpError extends Error {
|
|
176
|
+
status;
|
|
177
|
+
constructor(status, path, body) {
|
|
178
|
+
super(`${path} returned ${status}: ${body}`);
|
|
179
|
+
this.status = status;
|
|
180
|
+
this.name = "ScoutBrokerHttpError";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
174
183
|
async function requestScoutBrokerJsonWithTrace(baseUrl, path, options = {}) {
|
|
175
184
|
const { response, trace } = await requestBrokerWire(baseUrl, path, options);
|
|
176
185
|
let parsed;
|
|
@@ -187,7 +196,7 @@ async function requestScoutBrokerJsonWithTrace(baseUrl, path, options = {}) {
|
|
|
187
196
|
if (parsedJson && options.acceptErrorJson?.(parsed)) {
|
|
188
197
|
return { value: parsed, trace };
|
|
189
198
|
}
|
|
190
|
-
throw new
|
|
199
|
+
throw new ScoutBrokerHttpError(response.status, path, response.text);
|
|
191
200
|
}
|
|
192
201
|
if (parsedJson) {
|
|
193
202
|
return { value: parsed, trace };
|
|
@@ -459,11 +468,18 @@ class NodeSqliteDatabaseAdapter {
|
|
|
459
468
|
|
|
460
469
|
// packages/runtime/src/support-paths.ts
|
|
461
470
|
import { homedir } from "os";
|
|
462
|
-
import { join } from "path";
|
|
471
|
+
import { dirname, join } from "path";
|
|
463
472
|
var OPENSCOUT_RPC_CUTOVER_MARKER = "rpc-runtime-cutover-v1";
|
|
473
|
+
function defaultOpenScoutSupportDirectory(home = homedir()) {
|
|
474
|
+
if (process.platform === "darwin") {
|
|
475
|
+
return join(home, "Library", "Application Support", "OpenScout");
|
|
476
|
+
}
|
|
477
|
+
const xdgDataHome = process.env.XDG_DATA_HOME?.trim();
|
|
478
|
+
return join(xdgDataHome || join(home, ".local", "share"), "openscout");
|
|
479
|
+
}
|
|
464
480
|
function resolveOpenScoutSupportPaths() {
|
|
465
481
|
const home = homedir();
|
|
466
|
-
const supportDirectory = process.env.OPENSCOUT_SUPPORT_DIRECTORY ??
|
|
482
|
+
const supportDirectory = process.env.OPENSCOUT_SUPPORT_DIRECTORY ?? defaultOpenScoutSupportDirectory(home);
|
|
467
483
|
const logsDirectory = join(supportDirectory, "logs");
|
|
468
484
|
const runtimeDirectory = join(supportDirectory, "runtime");
|
|
469
485
|
const catalogDirectory = join(supportDirectory, "catalog");
|
|
@@ -1897,7 +1913,7 @@ import {
|
|
|
1897
1913
|
writeFileSync
|
|
1898
1914
|
} from "fs";
|
|
1899
1915
|
import { homedir as homedir3, hostname as osHostname } from "os";
|
|
1900
|
-
import { dirname, join as join3 } from "path";
|
|
1916
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
1901
1917
|
|
|
1902
1918
|
// packages/runtime/src/node-identity.ts
|
|
1903
1919
|
var NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -2022,7 +2038,7 @@ function resolveBrokerPort() {
|
|
|
2022
2038
|
// packages/runtime/src/tool-resolution.ts
|
|
2023
2039
|
import { accessSync, constants, existsSync as existsSync4 } from "fs";
|
|
2024
2040
|
import { homedir as homedir4 } from "os";
|
|
2025
|
-
import { basename, dirname as
|
|
2041
|
+
import { basename, dirname as dirname3, join as join4, resolve } from "path";
|
|
2026
2042
|
var DEFAULT_COMMON_EXECUTABLE_DIRECTORIES = [
|
|
2027
2043
|
join4(homedir4(), ".bun", "bin"),
|
|
2028
2044
|
"/opt/homebrew/bin",
|
|
@@ -2152,7 +2168,7 @@ function readPersistedAdvertiseScope(supportDirectory) {
|
|
|
2152
2168
|
}
|
|
2153
2169
|
function writePersistedAdvertiseScope(scope, supportDirectory) {
|
|
2154
2170
|
const path = meshBindConfigPath(supportDirectory);
|
|
2155
|
-
mkdirSync2(
|
|
2171
|
+
mkdirSync2(dirname4(path), { recursive: true });
|
|
2156
2172
|
const payload = { version: 1, advertiseScope: scope };
|
|
2157
2173
|
const tmp = `${path}.${process.pid}.tmp`;
|
|
2158
2174
|
writeFileSync2(tmp, `${JSON.stringify(payload, null, 2)}
|
|
@@ -2328,7 +2344,7 @@ function runtimePackageDir() {
|
|
|
2328
2344
|
const fromGlobal = findGlobalRuntimeDir();
|
|
2329
2345
|
if (fromGlobal)
|
|
2330
2346
|
return fromGlobal;
|
|
2331
|
-
const moduleDir =
|
|
2347
|
+
const moduleDir = dirname4(fileURLToPath(import.meta.url));
|
|
2332
2348
|
return resolve2(moduleDir, "..");
|
|
2333
2349
|
}
|
|
2334
2350
|
function isInstalledRuntimePackageDir(candidate) {
|
|
@@ -2362,7 +2378,7 @@ function findGlobalRuntimeDir() {
|
|
|
2362
2378
|
return null;
|
|
2363
2379
|
}
|
|
2364
2380
|
function findBundledRuntimeDir() {
|
|
2365
|
-
const moduleDir =
|
|
2381
|
+
const moduleDir = dirname4(fileURLToPath(import.meta.url));
|
|
2366
2382
|
return resolveBundledRuntimeDirFromModuleDir(moduleDir);
|
|
2367
2383
|
}
|
|
2368
2384
|
function resolveBundledRuntimeDirFromModuleDir(moduleDir) {
|
|
@@ -2381,7 +2397,7 @@ function resolveBundledRuntimeDirFromModuleDir(moduleDir) {
|
|
|
2381
2397
|
return null;
|
|
2382
2398
|
}
|
|
2383
2399
|
function resolveSourceWorkspaceRuntimeDir(bundledPackageDir) {
|
|
2384
|
-
const packagesDir =
|
|
2400
|
+
const packagesDir = dirname4(bundledPackageDir);
|
|
2385
2401
|
if (resolve2(packagesDir, "cli") !== resolve2(bundledPackageDir))
|
|
2386
2402
|
return null;
|
|
2387
2403
|
const runtimeDir = join5(packagesDir, "runtime");
|
|
@@ -2404,7 +2420,7 @@ function findWorkspaceRuntimeDir(startDir) {
|
|
|
2404
2420
|
if (existsSync5(join5(candidate, "package.json")) && existsSync5(join5(candidate, "src"))) {
|
|
2405
2421
|
return candidate;
|
|
2406
2422
|
}
|
|
2407
|
-
const parent =
|
|
2423
|
+
const parent = dirname4(current);
|
|
2408
2424
|
if (parent === current)
|
|
2409
2425
|
return null;
|
|
2410
2426
|
current = parent;
|
|
@@ -2451,7 +2467,7 @@ function resolveBrokerServiceConfig() {
|
|
|
2451
2467
|
const serviceAdapter = resolveBrokerServiceAdapter();
|
|
2452
2468
|
const uid = typeof process.getuid === "function" ? process.getuid() : Number.parseInt(process.env.UID ?? "0", 10);
|
|
2453
2469
|
const supportPaths = resolveOpenScoutSupportPaths();
|
|
2454
|
-
const defaultSupportDir =
|
|
2470
|
+
const defaultSupportDir = defaultOpenScoutSupportDirectory();
|
|
2455
2471
|
const supportDirectory = isTmpPath(supportPaths.supportDirectory) ? defaultSupportDir : supportPaths.supportDirectory;
|
|
2456
2472
|
const runtimeDirectory = join5(supportDirectory, "runtime");
|
|
2457
2473
|
const logsDirectory = join5(supportDirectory, "logs", "broker");
|
|
@@ -2510,7 +2526,7 @@ function findWorkspaceRootFromRuntimeDir(runtimePackageDir2) {
|
|
|
2510
2526
|
if (existsSync5(join5(current, "Cargo.toml")) && existsSync5(join5(current, "crates", "scoutd", "Cargo.toml"))) {
|
|
2511
2527
|
return current;
|
|
2512
2528
|
}
|
|
2513
|
-
const parent =
|
|
2529
|
+
const parent = dirname4(current);
|
|
2514
2530
|
if (parent === current)
|
|
2515
2531
|
return null;
|
|
2516
2532
|
current = parent;
|
|
@@ -2520,7 +2536,12 @@ function workspaceScoutdAllowed() {
|
|
|
2520
2536
|
const raw = process.env.OPENSCOUT_ALLOW_WORKSPACE_SCOUTD?.trim().toLowerCase();
|
|
2521
2537
|
return raw === "1" || raw === "true" || raw === "yes" || raw === "on";
|
|
2522
2538
|
}
|
|
2539
|
+
function nativeSupervisorNotApplicableDetail(platform = process.platform) {
|
|
2540
|
+
return platform === "linux" ? "native supervisor: not applicable on linux" : `native supervisor: not applicable on ${platform}`;
|
|
2541
|
+
}
|
|
2523
2542
|
function resolveScoutdCommand(config = resolveBrokerServiceConfig()) {
|
|
2543
|
+
if (process.platform !== "darwin")
|
|
2544
|
+
return null;
|
|
2524
2545
|
const explicit = resolveEnvExecutable(process.env.OPENSCOUT_SCOUTD_BIN);
|
|
2525
2546
|
if (explicit) {
|
|
2526
2547
|
return { path: explicit, source: "env" };
|
|
@@ -2533,7 +2554,7 @@ function resolveScoutdCommand(config = resolveBrokerServiceConfig()) {
|
|
|
2533
2554
|
workspaceRoot ? join5(workspaceRoot, "packages", "cli", "bin", "scoutd") : null,
|
|
2534
2555
|
workspaceRoot ? join5(workspaceRoot, "packages", "runtime", "bin", "scoutd") : null,
|
|
2535
2556
|
join5(config.runtimeDirectory, "scoutd"),
|
|
2536
|
-
join5(
|
|
2557
|
+
join5(dirname4(config.runtimePackageDir), "scout", "bin", "scoutd")
|
|
2537
2558
|
];
|
|
2538
2559
|
for (const candidate of packageCandidates) {
|
|
2539
2560
|
const resolved = executableCandidate(candidate);
|
|
@@ -2663,6 +2684,8 @@ function normalizeNativeServiceStatus(input, config) {
|
|
|
2663
2684
|
reachable: healthReachable,
|
|
2664
2685
|
ok: healthOk,
|
|
2665
2686
|
checkedAt: readNumber2(healthRecord.checkedAt) ?? Date.now(),
|
|
2687
|
+
state: readString2(healthRecord.state),
|
|
2688
|
+
durationMs: readNumber2(healthRecord.durationMs),
|
|
2666
2689
|
transport: healthTransport,
|
|
2667
2690
|
socketPath: config.brokerSocketPath,
|
|
2668
2691
|
...healthSocketFallbackError ? { socketFallbackError: healthSocketFallbackError } : {},
|
|
@@ -2774,6 +2797,9 @@ async function runScoutdServiceCommand(command, config, timeoutMs = SCOUTD_DEFAU
|
|
|
2774
2797
|
}
|
|
2775
2798
|
const scoutd = resolveScoutdCommand(config);
|
|
2776
2799
|
if (!scoutd) {
|
|
2800
|
+
if (process.platform !== "darwin") {
|
|
2801
|
+
throw new Error(nativeSupervisorNotApplicableDetail());
|
|
2802
|
+
}
|
|
2777
2803
|
throw new Error("Unable to locate scoutd for broker service management. Build scoutd with `npm run scoutd:build`, install a package that includes scoutd, or set OPENSCOUT_SCOUTD_BIN.");
|
|
2778
2804
|
}
|
|
2779
2805
|
const stdout = await runScoutdJson(scoutd.path, command, nativeServiceEnvironment(config, scoutd.path), timeoutMs);
|
|
@@ -3050,6 +3076,7 @@ export {
|
|
|
3050
3076
|
resolveBrokerHost,
|
|
3051
3077
|
resolveAdvertiseScope,
|
|
3052
3078
|
readPersistedAdvertiseScope,
|
|
3079
|
+
nativeSupervisorNotApplicableDetail,
|
|
3053
3080
|
meshBindConfigPath,
|
|
3054
3081
|
isLoopbackHost,
|
|
3055
3082
|
isBrokerServiceEntrypoint,
|
|
@@ -5,7 +5,7 @@ import "reflect-metadata";
|
|
|
5
5
|
import { spawn as spawn2, spawnSync } from "child_process";
|
|
6
6
|
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
7
7
|
import { homedir as homedir5, networkInterfaces } from "os";
|
|
8
|
-
import { basename as basename2, dirname as
|
|
8
|
+
import { basename as basename2, dirname as dirname4, join as join5, resolve as resolve2 } from "path";
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
10
|
|
|
11
11
|
// packages/runtime/src/broker-api.ts
|
|
@@ -171,6 +171,15 @@ async function requestBrokerWire(baseUrl, path, options) {
|
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
class ScoutBrokerHttpError extends Error {
|
|
176
|
+
status;
|
|
177
|
+
constructor(status, path, body) {
|
|
178
|
+
super(`${path} returned ${status}: ${body}`);
|
|
179
|
+
this.status = status;
|
|
180
|
+
this.name = "ScoutBrokerHttpError";
|
|
181
|
+
}
|
|
182
|
+
}
|
|
174
183
|
async function requestScoutBrokerJsonWithTrace(baseUrl, path, options = {}) {
|
|
175
184
|
const { response, trace } = await requestBrokerWire(baseUrl, path, options);
|
|
176
185
|
let parsed;
|
|
@@ -187,7 +196,7 @@ async function requestScoutBrokerJsonWithTrace(baseUrl, path, options = {}) {
|
|
|
187
196
|
if (parsedJson && options.acceptErrorJson?.(parsed)) {
|
|
188
197
|
return { value: parsed, trace };
|
|
189
198
|
}
|
|
190
|
-
throw new
|
|
199
|
+
throw new ScoutBrokerHttpError(response.status, path, response.text);
|
|
191
200
|
}
|
|
192
201
|
if (parsedJson) {
|
|
193
202
|
return { value: parsed, trace };
|
|
@@ -459,11 +468,18 @@ class NodeSqliteDatabaseAdapter {
|
|
|
459
468
|
|
|
460
469
|
// packages/runtime/src/support-paths.ts
|
|
461
470
|
import { homedir } from "os";
|
|
462
|
-
import { join } from "path";
|
|
471
|
+
import { dirname, join } from "path";
|
|
463
472
|
var OPENSCOUT_RPC_CUTOVER_MARKER = "rpc-runtime-cutover-v1";
|
|
473
|
+
function defaultOpenScoutSupportDirectory(home = homedir()) {
|
|
474
|
+
if (process.platform === "darwin") {
|
|
475
|
+
return join(home, "Library", "Application Support", "OpenScout");
|
|
476
|
+
}
|
|
477
|
+
const xdgDataHome = process.env.XDG_DATA_HOME?.trim();
|
|
478
|
+
return join(xdgDataHome || join(home, ".local", "share"), "openscout");
|
|
479
|
+
}
|
|
464
480
|
function resolveOpenScoutSupportPaths() {
|
|
465
481
|
const home = homedir();
|
|
466
|
-
const supportDirectory = process.env.OPENSCOUT_SUPPORT_DIRECTORY ??
|
|
482
|
+
const supportDirectory = process.env.OPENSCOUT_SUPPORT_DIRECTORY ?? defaultOpenScoutSupportDirectory(home);
|
|
467
483
|
const logsDirectory = join(supportDirectory, "logs");
|
|
468
484
|
const runtimeDirectory = join(supportDirectory, "runtime");
|
|
469
485
|
const catalogDirectory = join(supportDirectory, "catalog");
|
|
@@ -1897,7 +1913,7 @@ import {
|
|
|
1897
1913
|
writeFileSync
|
|
1898
1914
|
} from "fs";
|
|
1899
1915
|
import { homedir as homedir3, hostname as osHostname } from "os";
|
|
1900
|
-
import { dirname, join as join3 } from "path";
|
|
1916
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
1901
1917
|
|
|
1902
1918
|
// packages/runtime/src/node-identity.ts
|
|
1903
1919
|
var NODE_CARD_TTL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -2006,7 +2022,7 @@ function resolveBrokerPort() {
|
|
|
2006
2022
|
// packages/runtime/src/tool-resolution.ts
|
|
2007
2023
|
import { accessSync, constants, existsSync as existsSync4 } from "fs";
|
|
2008
2024
|
import { homedir as homedir4 } from "os";
|
|
2009
|
-
import { basename, dirname as
|
|
2025
|
+
import { basename, dirname as dirname3, join as join4, resolve } from "path";
|
|
2010
2026
|
var DEFAULT_COMMON_EXECUTABLE_DIRECTORIES = [
|
|
2011
2027
|
join4(homedir4(), ".bun", "bin"),
|
|
2012
2028
|
"/opt/homebrew/bin",
|
|
@@ -2259,7 +2275,7 @@ function runtimePackageDir() {
|
|
|
2259
2275
|
const fromGlobal = findGlobalRuntimeDir();
|
|
2260
2276
|
if (fromGlobal)
|
|
2261
2277
|
return fromGlobal;
|
|
2262
|
-
const moduleDir =
|
|
2278
|
+
const moduleDir = dirname4(fileURLToPath(import.meta.url));
|
|
2263
2279
|
return resolve2(moduleDir, "..");
|
|
2264
2280
|
}
|
|
2265
2281
|
function isInstalledRuntimePackageDir(candidate) {
|
|
@@ -2293,7 +2309,7 @@ function findGlobalRuntimeDir() {
|
|
|
2293
2309
|
return null;
|
|
2294
2310
|
}
|
|
2295
2311
|
function findBundledRuntimeDir() {
|
|
2296
|
-
const moduleDir =
|
|
2312
|
+
const moduleDir = dirname4(fileURLToPath(import.meta.url));
|
|
2297
2313
|
return resolveBundledRuntimeDirFromModuleDir(moduleDir);
|
|
2298
2314
|
}
|
|
2299
2315
|
function resolveBundledRuntimeDirFromModuleDir(moduleDir) {
|
|
@@ -2312,7 +2328,7 @@ function resolveBundledRuntimeDirFromModuleDir(moduleDir) {
|
|
|
2312
2328
|
return null;
|
|
2313
2329
|
}
|
|
2314
2330
|
function resolveSourceWorkspaceRuntimeDir(bundledPackageDir) {
|
|
2315
|
-
const packagesDir =
|
|
2331
|
+
const packagesDir = dirname4(bundledPackageDir);
|
|
2316
2332
|
if (resolve2(packagesDir, "cli") !== resolve2(bundledPackageDir))
|
|
2317
2333
|
return null;
|
|
2318
2334
|
const runtimeDir = join5(packagesDir, "runtime");
|
|
@@ -2335,7 +2351,7 @@ function findWorkspaceRuntimeDir(startDir) {
|
|
|
2335
2351
|
if (existsSync5(join5(candidate, "package.json")) && existsSync5(join5(candidate, "src"))) {
|
|
2336
2352
|
return candidate;
|
|
2337
2353
|
}
|
|
2338
|
-
const parent =
|
|
2354
|
+
const parent = dirname4(current);
|
|
2339
2355
|
if (parent === current)
|
|
2340
2356
|
return null;
|
|
2341
2357
|
current = parent;
|
|
@@ -2382,7 +2398,7 @@ function resolveBrokerServiceConfig() {
|
|
|
2382
2398
|
const serviceAdapter = resolveBrokerServiceAdapter();
|
|
2383
2399
|
const uid = typeof process.getuid === "function" ? process.getuid() : Number.parseInt(process.env.UID ?? "0", 10);
|
|
2384
2400
|
const supportPaths = resolveOpenScoutSupportPaths();
|
|
2385
|
-
const defaultSupportDir =
|
|
2401
|
+
const defaultSupportDir = defaultOpenScoutSupportDirectory();
|
|
2386
2402
|
const supportDirectory = isTmpPath(supportPaths.supportDirectory) ? defaultSupportDir : supportPaths.supportDirectory;
|
|
2387
2403
|
const runtimeDirectory = join5(supportDirectory, "runtime");
|
|
2388
2404
|
const logsDirectory = join5(supportDirectory, "logs", "broker");
|
|
@@ -2441,7 +2457,7 @@ function findWorkspaceRootFromRuntimeDir(runtimePackageDir2) {
|
|
|
2441
2457
|
if (existsSync5(join5(current, "Cargo.toml")) && existsSync5(join5(current, "crates", "scoutd", "Cargo.toml"))) {
|
|
2442
2458
|
return current;
|
|
2443
2459
|
}
|
|
2444
|
-
const parent =
|
|
2460
|
+
const parent = dirname4(current);
|
|
2445
2461
|
if (parent === current)
|
|
2446
2462
|
return null;
|
|
2447
2463
|
current = parent;
|
|
@@ -2451,7 +2467,12 @@ function workspaceScoutdAllowed() {
|
|
|
2451
2467
|
const raw = process.env.OPENSCOUT_ALLOW_WORKSPACE_SCOUTD?.trim().toLowerCase();
|
|
2452
2468
|
return raw === "1" || raw === "true" || raw === "yes" || raw === "on";
|
|
2453
2469
|
}
|
|
2470
|
+
function nativeSupervisorNotApplicableDetail(platform = process.platform) {
|
|
2471
|
+
return platform === "linux" ? "native supervisor: not applicable on linux" : `native supervisor: not applicable on ${platform}`;
|
|
2472
|
+
}
|
|
2454
2473
|
function resolveScoutdCommand(config = resolveBrokerServiceConfig()) {
|
|
2474
|
+
if (process.platform !== "darwin")
|
|
2475
|
+
return null;
|
|
2455
2476
|
const explicit = resolveEnvExecutable(process.env.OPENSCOUT_SCOUTD_BIN);
|
|
2456
2477
|
if (explicit) {
|
|
2457
2478
|
return { path: explicit, source: "env" };
|
|
@@ -2464,7 +2485,7 @@ function resolveScoutdCommand(config = resolveBrokerServiceConfig()) {
|
|
|
2464
2485
|
workspaceRoot ? join5(workspaceRoot, "packages", "cli", "bin", "scoutd") : null,
|
|
2465
2486
|
workspaceRoot ? join5(workspaceRoot, "packages", "runtime", "bin", "scoutd") : null,
|
|
2466
2487
|
join5(config.runtimeDirectory, "scoutd"),
|
|
2467
|
-
join5(
|
|
2488
|
+
join5(dirname4(config.runtimePackageDir), "scout", "bin", "scoutd")
|
|
2468
2489
|
];
|
|
2469
2490
|
for (const candidate of packageCandidates) {
|
|
2470
2491
|
const resolved = executableCandidate(candidate);
|
|
@@ -2594,6 +2615,8 @@ function normalizeNativeServiceStatus(input, config) {
|
|
|
2594
2615
|
reachable: healthReachable,
|
|
2595
2616
|
ok: healthOk,
|
|
2596
2617
|
checkedAt: readNumber2(healthRecord.checkedAt) ?? Date.now(),
|
|
2618
|
+
state: readString2(healthRecord.state),
|
|
2619
|
+
durationMs: readNumber2(healthRecord.durationMs),
|
|
2597
2620
|
transport: healthTransport,
|
|
2598
2621
|
socketPath: config.brokerSocketPath,
|
|
2599
2622
|
...healthSocketFallbackError ? { socketFallbackError: healthSocketFallbackError } : {},
|
|
@@ -2705,6 +2728,9 @@ async function runScoutdServiceCommand(command, config, timeoutMs = SCOUTD_DEFAU
|
|
|
2705
2728
|
}
|
|
2706
2729
|
const scoutd = resolveScoutdCommand(config);
|
|
2707
2730
|
if (!scoutd) {
|
|
2731
|
+
if (process.platform !== "darwin") {
|
|
2732
|
+
throw new Error(nativeSupervisorNotApplicableDetail());
|
|
2733
|
+
}
|
|
2708
2734
|
throw new Error("Unable to locate scoutd for broker service management. Build scoutd with `npm run scoutd:build`, install a package that includes scoutd, or set OPENSCOUT_SCOUTD_BIN.");
|
|
2709
2735
|
}
|
|
2710
2736
|
const stdout = await runScoutdJson(scoutd.path, command, nativeServiceEnvironment(config, scoutd.path), timeoutMs);
|