@openscout/scout 0.2.16 → 0.2.17

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/main.mjs CHANGED
@@ -5441,6 +5441,12 @@ function findGlobalRuntimeDir() {
5441
5441
  const bunCandidate = join7(homedir4(), ".bun", "node_modules", "@openscout", "runtime");
5442
5442
  if (isInstalledRuntimePackageDir(bunCandidate))
5443
5443
  return bunCandidate;
5444
+ const bunGlobalCandidate = join7(homedir4(), ".bun", "install", "global", "node_modules", "@openscout", "runtime");
5445
+ if (isInstalledRuntimePackageDir(bunGlobalCandidate))
5446
+ return bunGlobalCandidate;
5447
+ const bunScoutNested = join7(homedir4(), ".bun", "install", "global", "node_modules", "@openscout", "scout", "node_modules", "@openscout", "runtime");
5448
+ if (isInstalledRuntimePackageDir(bunScoutNested))
5449
+ return bunScoutNested;
5444
5450
  return null;
5445
5451
  }
5446
5452
  function findWorkspaceRuntimeDir(startDir) {
@@ -8928,6 +8934,8 @@ var init_down = __esm(async () => {
8928
8934
  import { spawn as spawn3 } from "node:child_process";
8929
8935
  import { basename as basename5, dirname as dirname6, join as join10 } from "node:path";
8930
8936
  import { existsSync as existsSync6 } from "node:fs";
8937
+ import { fileURLToPath as fileURLToPath5 } from "node:url";
8938
+ import { homedir as homedir5 } from "node:os";
8931
8939
  function tryWhich(executableName) {
8932
8940
  const pathEnv = process.env.PATH ?? "";
8933
8941
  const sep = process.platform === "win32" ? ";" : ":";
@@ -8948,6 +8956,23 @@ function tryWhich(executableName) {
8948
8956
  }
8949
8957
  return null;
8950
8958
  }
8959
+ function findNodeModulesRuntimeBin() {
8960
+ const runtimeBinRel = join10("node_modules", "@openscout", "runtime", "bin", "openscout-runtime.mjs");
8961
+ let dir = dirname6(fileURLToPath5(import.meta.url));
8962
+ for (let i = 0;i < 24; i++) {
8963
+ const candidate = join10(dir, runtimeBinRel);
8964
+ if (existsSync6(candidate))
8965
+ return candidate;
8966
+ const parent = dirname6(dir);
8967
+ if (parent === dir)
8968
+ break;
8969
+ dir = parent;
8970
+ }
8971
+ const bunGlobal = join10(homedir5(), ".bun", "install", "global", "node_modules", "@openscout", "runtime", "bin", "openscout-runtime.mjs");
8972
+ if (existsSync6(bunGlobal))
8973
+ return bunGlobal;
8974
+ return null;
8975
+ }
8951
8976
  function findMonorepoOpenscoutRuntimeBin() {
8952
8977
  let dir = process.cwd();
8953
8978
  for (let i = 0;i < 24; i++) {
@@ -9004,6 +9029,10 @@ function resolveRuntimeServiceEntrypoint() {
9004
9029
  if (onPath) {
9005
9030
  return onPath;
9006
9031
  }
9032
+ const fromNodeModules = findNodeModulesRuntimeBin();
9033
+ if (fromNodeModules) {
9034
+ return fromNodeModules;
9035
+ }
9007
9036
  const monorepo = findMonorepoOpenscoutRuntimeBin();
9008
9037
  if (monorepo) {
9009
9038
  return monorepo;
@@ -9121,7 +9150,7 @@ var init_service3 = __esm(() => {
9121
9150
  // ../../apps/desktop/src/shared/paths.ts
9122
9151
  import { existsSync as existsSync7, readFileSync as readFileSync3 } from "node:fs";
9123
9152
  import { dirname as dirname7, join as join11, resolve as resolve7 } from "node:path";
9124
- import { fileURLToPath as fileURLToPath5 } from "node:url";
9153
+ import { fileURLToPath as fileURLToPath6 } from "node:url";
9125
9154
  function looksLikeWorkspaceRoot(candidate) {
9126
9155
  const packageJsonPath = join11(candidate, "package.json");
9127
9156
  if (!existsSync7(packageJsonPath)) {
@@ -9175,7 +9204,7 @@ function findMatchingAncestor(startDirectory, predicate) {
9175
9204
  }
9176
9205
  }
9177
9206
  function defaultModuleDirectory() {
9178
- return dirname7(fileURLToPath5(import.meta.url));
9207
+ return dirname7(fileURLToPath6(import.meta.url));
9179
9208
  }
9180
9209
  function uniqueResolutionStarts(options) {
9181
9210
  const starts = [
@@ -9578,10 +9607,10 @@ var init_env = __esm(async () => {
9578
9607
 
9579
9608
  // ../../apps/desktop/src/core/pairing/runtime/config.ts
9580
9609
  import { existsSync as existsSync9, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
9581
- import { homedir as homedir5 } from "node:os";
9610
+ import { homedir as homedir6 } from "node:os";
9582
9611
  import path from "node:path";
9583
9612
  function pairingPaths() {
9584
- const rootDir = path.join(homedir5(), ".scout/pairing");
9613
+ const rootDir = path.join(homedir6(), ".scout/pairing");
9585
9614
  return {
9586
9615
  rootDir,
9587
9616
  configPath: path.join(rootDir, "config.json"),
@@ -11683,7 +11712,7 @@ var init_noise = __esm(() => {
11683
11712
  // ../../apps/desktop/src/core/pairing/runtime/security/identity.ts
11684
11713
  import { existsSync as existsSync10, mkdirSync as mkdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
11685
11714
  import { join as join13 } from "path";
11686
- import { homedir as homedir6 } from "os";
11715
+ import { homedir as homedir7 } from "os";
11687
11716
  function loadOrCreateIdentity() {
11688
11717
  if (existsSync10(IDENTITY_FILE)) {
11689
11718
  return loadIdentity();
@@ -11745,7 +11774,7 @@ function hexToBytes2(hex) {
11745
11774
  var PAIRING_DIR, IDENTITY_FILE, TRUSTED_PEERS_FILE, QR_VERSION = 1, QR_EXPIRY_MS;
11746
11775
  var init_identity = __esm(() => {
11747
11776
  init_noise();
11748
- PAIRING_DIR = join13(homedir6(), ".scout/pairing");
11777
+ PAIRING_DIR = join13(homedir7(), ".scout/pairing");
11749
11778
  IDENTITY_FILE = join13(PAIRING_DIR, "identity.json");
11750
11779
  TRUSTED_PEERS_FILE = join13(PAIRING_DIR, "trusted-peers.json");
11751
11780
  QR_EXPIRY_MS = 5 * 60 * 1000;
@@ -12362,7 +12391,7 @@ Referenced files: ${prompt.files.join(", ")}` });
12362
12391
  });
12363
12392
 
12364
12393
  // ../../apps/desktop/src/core/pairing/runtime/adapters/codex.ts
12365
- import { homedir as homedir7 } from "node:os";
12394
+ import { homedir as homedir8 } from "node:os";
12366
12395
  import { join as join14 } from "node:path";
12367
12396
  var CodexAdapter, createAdapter2 = (config) => new CodexAdapter(config);
12368
12397
  var init_codex = __esm(() => {
@@ -12463,7 +12492,7 @@ var init_codex = __esm(() => {
12463
12492
  this.setStatus("closed");
12464
12493
  }
12465
12494
  get codexOptions() {
12466
- const runtimeRoot = join14(homedir7(), ".scout/pairing", "codex", this.session.id);
12495
+ const runtimeRoot = join14(homedir8(), ".scout/pairing", "codex", this.session.id);
12467
12496
  return {
12468
12497
  agentName: this.session.name,
12469
12498
  sessionId: this.session.id,
@@ -13937,7 +13966,7 @@ class StateTracker {
13937
13966
  // ../../apps/desktop/src/core/pairing/runtime/bridge/log.ts
13938
13967
  import { appendFileSync, mkdirSync as mkdirSync6 } from "fs";
13939
13968
  import { join as join15 } from "path";
13940
- import { homedir as homedir8 } from "os";
13969
+ import { homedir as homedir9 } from "os";
13941
13970
  function write(level, category, message, data) {
13942
13971
  const ts = new Date().toISOString().slice(11, 23);
13943
13972
  const lvl = level.toUpperCase().padEnd(5);
@@ -13953,7 +13982,7 @@ function write(level, category, message, data) {
13953
13982
  }
13954
13983
  var LOG_DIR, LOG_FILE, log;
13955
13984
  var init_log = __esm(() => {
13956
- LOG_DIR = join15(homedir8(), ".scout/pairing");
13985
+ LOG_DIR = join15(homedir9(), ".scout/pairing");
13957
13986
  LOG_FILE = join15(LOG_DIR, "bridge.log");
13958
13987
  mkdirSync6(LOG_DIR, { recursive: true });
13959
13988
  log = {
@@ -14119,7 +14148,7 @@ var init_bridge = __esm(() => {
14119
14148
  // ../../apps/desktop/src/core/pairing/runtime/bridge/config.ts
14120
14149
  import { existsSync as existsSync12, readFileSync as readFileSync7 } from "fs";
14121
14150
  import { join as join16 } from "path";
14122
- import { homedir as homedir9 } from "os";
14151
+ import { homedir as homedir10 } from "os";
14123
14152
  function loadConfigFile() {
14124
14153
  if (!existsSync12(CONFIG_FILE)) {
14125
14154
  return {};
@@ -14182,17 +14211,17 @@ var init_config2 = __esm(() => {
14182
14211
  port: 7888,
14183
14212
  secure: true
14184
14213
  };
14185
- CONFIG_DIR = join16(homedir9(), ".scout/pairing");
14214
+ CONFIG_DIR = join16(homedir10(), ".scout/pairing");
14186
14215
  CONFIG_FILE = join16(CONFIG_DIR, "config.json");
14187
14216
  });
14188
14217
 
14189
14218
  // ../../apps/desktop/src/core/pairing/runtime/bridge/fileserver.ts
14190
14219
  import { isAbsolute as isAbsolute2 } from "path";
14191
- import { homedir as homedir10 } from "os";
14220
+ import { homedir as homedir11 } from "os";
14192
14221
  function isAllowedPath(filePath) {
14193
14222
  if (!isAbsolute2(filePath))
14194
14223
  return false;
14195
- const relToHome = filePath.slice(homedir10().length + 1);
14224
+ const relToHome = filePath.slice(homedir11().length + 1);
14196
14225
  if (relToHome.startsWith(".") && !relToHome.startsWith(".claude") && !relToHome.startsWith(".scout/pairing")) {
14197
14226
  return false;
14198
14227
  }
@@ -14251,7 +14280,7 @@ function serveFile(url) {
14251
14280
  }
14252
14281
  var ALLOWED_ROOTS;
14253
14282
  var init_fileserver = __esm(() => {
14254
- ALLOWED_ROOTS = [homedir10(), "/tmp"];
14283
+ ALLOWED_ROOTS = [homedir11(), "/tmp"];
14255
14284
  });
14256
14285
 
14257
14286
  // ../../apps/desktop/src/core/mobile/service.ts
@@ -14781,7 +14810,7 @@ var init_service4 = __esm(async () => {
14781
14810
  import { readdirSync, readFileSync as readFileSync8, realpathSync, statSync as statSync2 } from "fs";
14782
14811
  import { execSync as execSync2 } from "child_process";
14783
14812
  import { basename as basename7, isAbsolute as isAbsolute3, join as join17, relative as relative2 } from "path";
14784
- import { homedir as homedir11 } from "os";
14813
+ import { homedir as homedir12 } from "os";
14785
14814
  async function handleRPC(bridge, req, deviceId) {
14786
14815
  const rpcStart = Date.now();
14787
14816
  const paramsSnippet = summarizeRPCParams(req.method, req.params);
@@ -15192,12 +15221,12 @@ function resolveMobileCurrentDirectory() {
15192
15221
  }
15193
15222
  }
15194
15223
  function resolveWorkspaceRoot(root) {
15195
- const expandedRoot = root.replace(/^~/, homedir11());
15224
+ const expandedRoot = root.replace(/^~/, homedir12());
15196
15225
  return realpathSync(expandedRoot);
15197
15226
  }
15198
15227
  function resolveWorkspacePath(root, requestedPath) {
15199
15228
  const normalizedRoot = resolveWorkspaceRoot(root);
15200
- const expandedPath = requestedPath?.replace(/^~/, homedir11());
15229
+ const expandedPath = requestedPath?.replace(/^~/, homedir12());
15201
15230
  const candidate = expandedPath ? isAbsolute3(expandedPath) ? expandedPath : join17(normalizedRoot, expandedPath) : normalizedRoot;
15202
15231
  const resolvedCandidate = realpathSync(candidate);
15203
15232
  const rel = relative2(normalizedRoot, resolvedCandidate);
@@ -15236,7 +15265,7 @@ function listDirectories(dirPath) {
15236
15265
  return entries.sort((a, b) => a.name.localeCompare(b.name));
15237
15266
  }
15238
15267
  async function discoverSessionFiles(maxAgeDays, limit) {
15239
- const home = homedir11();
15268
+ const home = homedir12();
15240
15269
  const results = [];
15241
15270
  const searchPaths = [
15242
15271
  { pattern: `${home}/.claude/projects`, agent: "claude-code" },
@@ -30142,10 +30171,10 @@ var init_zod = __esm(() => {
30142
30171
 
30143
30172
  // ../../apps/desktop/src/server/db-queries.ts
30144
30173
  import { Database } from "bun:sqlite";
30145
- import { homedir as homedir12 } from "node:os";
30174
+ import { homedir as homedir13 } from "node:os";
30146
30175
  import { join as join18 } from "node:path";
30147
30176
  function resolveDbPath() {
30148
- const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join18(homedir12(), ".openscout", "control-plane");
30177
+ const controlHome = process.env.OPENSCOUT_CONTROL_HOME ?? join18(homedir13(), ".openscout", "control-plane");
30149
30178
  return join18(controlHome, "control-plane.sqlite");
30150
30179
  }
30151
30180
  function db() {
@@ -30307,14 +30336,14 @@ function queryMobileWorkspaces(limit = 50) {
30307
30336
  }
30308
30337
  var _db = null, HOME;
30309
30338
  var init_db_queries = __esm(() => {
30310
- HOME = homedir12();
30339
+ HOME = homedir13();
30311
30340
  });
30312
30341
 
30313
30342
  // ../../apps/desktop/src/core/pairing/runtime/bridge/router.ts
30314
30343
  import { readFileSync as readFileSync9, readdirSync as readdirSync2, realpathSync as realpathSync2, statSync as statSync3 } from "fs";
30315
30344
  import { execSync as execSync3 } from "child_process";
30316
30345
  import { basename as basename8, isAbsolute as isAbsolute4, join as join19, relative as relative3 } from "path";
30317
- import { homedir as homedir13 } from "os";
30346
+ import { homedir as homedir14 } from "os";
30318
30347
  function resolveMobileCurrentDirectory2() {
30319
30348
  const config2 = resolveConfig();
30320
30349
  const configuredRoot = config2.workspace?.root;
@@ -30327,12 +30356,12 @@ function resolveMobileCurrentDirectory2() {
30327
30356
  }
30328
30357
  }
30329
30358
  function resolveWorkspaceRoot2(root) {
30330
- const expandedRoot = root.replace(/^~/, homedir13());
30359
+ const expandedRoot = root.replace(/^~/, homedir14());
30331
30360
  return realpathSync2(expandedRoot);
30332
30361
  }
30333
30362
  function resolveWorkspacePath2(root, requestedPath) {
30334
30363
  const normalizedRoot = resolveWorkspaceRoot2(root);
30335
- const expandedPath = requestedPath?.replace(/^~/, homedir13());
30364
+ const expandedPath = requestedPath?.replace(/^~/, homedir14());
30336
30365
  const candidate = expandedPath ? isAbsolute4(expandedPath) ? expandedPath : join19(normalizedRoot, expandedPath) : normalizedRoot;
30337
30366
  const resolvedCandidate = realpathSync2(candidate);
30338
30367
  const rel = relative3(normalizedRoot, resolvedCandidate);
@@ -30387,7 +30416,7 @@ function detectAgent2(filePath) {
30387
30416
  return "unknown";
30388
30417
  }
30389
30418
  async function discoverSessionFiles2(maxAgeDays, limit) {
30390
- const home = homedir13();
30419
+ const home = homedir14();
30391
30420
  const results = [];
30392
30421
  const searchPaths = [
30393
30422
  { pattern: `${home}/.claude/projects`, agent: "claude-code" },
@@ -34969,14 +34998,14 @@ var init_observable = __esm(() => {
34969
34998
 
34970
34999
  // ../../apps/desktop/src/core/pairing/runtime/bridge/server-trpc.ts
34971
35000
  import { realpathSync as realpathSync3 } from "fs";
34972
- import { homedir as homedir14 } from "os";
35001
+ import { homedir as homedir15 } from "os";
34973
35002
  function resolveCurrentDirectory() {
34974
35003
  try {
34975
35004
  const config2 = resolveConfig();
34976
35005
  const configuredRoot = config2.workspace?.root;
34977
35006
  if (!configuredRoot)
34978
35007
  return process.cwd();
34979
- const expanded = configuredRoot.replace(/^~/, homedir14());
35008
+ const expanded = configuredRoot.replace(/^~/, homedir15());
34980
35009
  return realpathSync3(expanded);
34981
35010
  } catch {
34982
35011
  return process.cwd();
@@ -35392,7 +35421,7 @@ var init_server_trpc = __esm(async () => {
35392
35421
  });
35393
35422
 
35394
35423
  // ../../apps/desktop/src/core/pairing/runtime/runtime.ts
35395
- import { homedir as homedir15 } from "node:os";
35424
+ import { homedir as homedir16 } from "node:os";
35396
35425
  function createPairingAdapterRegistry(configAdapters) {
35397
35426
  const adapters = {
35398
35427
  "claude-code": createAdapter,
@@ -35469,7 +35498,7 @@ async function autoStartConfiguredSessions(bridge, sessions3) {
35469
35498
  try {
35470
35499
  const session = await bridge.createSession(entry.adapter, {
35471
35500
  name: entry.name,
35472
- cwd: entry.cwd?.replace(/^~/, homedir15()),
35501
+ cwd: entry.cwd?.replace(/^~/, homedir16()),
35473
35502
  options: entry.options
35474
35503
  });
35475
35504
  console.log(`[bridge] session started: ${session.name} (${entry.adapter})`);
@@ -35745,7 +35774,7 @@ var BRIDGE_ABSENCE_GRACE_MS = 30000, ROOM_IDLE_TIMEOUT_MS = 60000;
35745
35774
  // ../../apps/desktop/src/core/pairing/runtime/relay-runtime.ts
35746
35775
  import { execSync as execSync4 } from "node:child_process";
35747
35776
  import { existsSync as existsSync13, mkdirSync as mkdirSync8, readdirSync as readdirSync3 } from "node:fs";
35748
- import { homedir as homedir16 } from "node:os";
35777
+ import { homedir as homedir17 } from "node:os";
35749
35778
  import { join as join20 } from "node:path";
35750
35779
  function findStoredCerts() {
35751
35780
  if (!existsSync13(PAIRING_DIR2)) {
@@ -35865,7 +35894,7 @@ function startManagedRelay(port = 7889) {
35865
35894
  var PAIRING_DIR2;
35866
35895
  var init_relay_runtime = __esm(() => {
35867
35896
  init_log2();
35868
- PAIRING_DIR2 = join20(homedir16(), ".scout/pairing");
35897
+ PAIRING_DIR2 = join20(homedir17(), ".scout/pairing");
35869
35898
  });
35870
35899
 
35871
35900
  // ../../node_modules/.bun/uqr@0.1.3/node_modules/uqr/dist/index.mjs
@@ -36838,7 +36867,7 @@ __export(exports_server, {
36838
36867
  import { spawn as spawn4 } from "node:child_process";
36839
36868
  import { existsSync as existsSync14 } from "node:fs";
36840
36869
  import { dirname as dirname8, join as join21 } from "node:path";
36841
- import { fileURLToPath as fileURLToPath6 } from "node:url";
36870
+ import { fileURLToPath as fileURLToPath7 } from "node:url";
36842
36871
  function renderServerCommandHelp() {
36843
36872
  return [
36844
36873
  "scout server — desktop web UI (Bun runtime)",
@@ -36866,24 +36895,24 @@ function renderServerCommandHelp() {
36866
36895
  `);
36867
36896
  }
36868
36897
  function resolveScoutWebServerEntry() {
36869
- const mainDir = dirname8(fileURLToPath6(import.meta.url));
36898
+ const mainDir = dirname8(fileURLToPath7(import.meta.url));
36870
36899
  const bundled = join21(mainDir, "scout-web-server.mjs");
36871
36900
  if (existsSync14(bundled)) {
36872
36901
  return bundled;
36873
36902
  }
36874
- const source = fileURLToPath6(new URL("../../server/index.ts", import.meta.url));
36903
+ const source = fileURLToPath7(new URL("../../server/index.ts", import.meta.url));
36875
36904
  if (existsSync14(source)) {
36876
36905
  return source;
36877
36906
  }
36878
36907
  throw new ScoutCliError("Could not find Scout web server entry. Rebuild @openscout/scout or run from the OpenScout repository.");
36879
36908
  }
36880
36909
  function resolveScoutControlPlaneWebServerEntry() {
36881
- const mainDir = dirname8(fileURLToPath6(import.meta.url));
36910
+ const mainDir = dirname8(fileURLToPath7(import.meta.url));
36882
36911
  const bundled = join21(mainDir, "scout-control-plane-web.mjs");
36883
36912
  if (existsSync14(bundled)) {
36884
36913
  return bundled;
36885
36914
  }
36886
- const source = fileURLToPath6(new URL("../../server/control-plane-index.ts", import.meta.url));
36915
+ const source = fileURLToPath7(new URL("../../server/control-plane-index.ts", import.meta.url));
36887
36916
  if (existsSync14(source)) {
36888
36917
  return source;
36889
36918
  }
@@ -37315,7 +37344,7 @@ function findScoutCommandRegistration(name) {
37315
37344
  }
37316
37345
 
37317
37346
  // ../../apps/desktop/src/cli/help.ts
37318
- function renderScoutHelp(version2 = "0.2.16") {
37347
+ function renderScoutHelp(version2 = "0.2.17") {
37319
37348
  const commandLines = listScoutPrimaryCommands().map((command) => ` ${command.name.padEnd(12, " ")} ${command.summary}`).join(`
37320
37349
  `);
37321
37350
  const deprecatedLines = listScoutDeprecatedCommands().map((command) => ` ${command.name.padEnd(12, " ")} ${command.summary}`).join(`
@@ -37353,7 +37382,7 @@ function renderScoutHelp(version2 = "0.2.16") {
37353
37382
  init_options();
37354
37383
 
37355
37384
  // ../../apps/desktop/src/shared/product.ts
37356
- var SCOUT_APP_VERSION = "0.2.16";
37385
+ var SCOUT_APP_VERSION = "0.2.17";
37357
37386
 
37358
37387
  // ../../apps/desktop/src/cli/main.ts
37359
37388
  async function main2() {
@@ -4141,6 +4141,12 @@ function findGlobalRuntimeDir() {
4141
4141
  const bunCandidate = join8(homedir5(), ".bun", "node_modules", "@openscout", "runtime");
4142
4142
  if (isInstalledRuntimePackageDir(bunCandidate))
4143
4143
  return bunCandidate;
4144
+ const bunGlobalCandidate = join8(homedir5(), ".bun", "install", "global", "node_modules", "@openscout", "runtime");
4145
+ if (isInstalledRuntimePackageDir(bunGlobalCandidate))
4146
+ return bunGlobalCandidate;
4147
+ const bunScoutNested = join8(homedir5(), ".bun", "install", "global", "node_modules", "@openscout", "scout", "node_modules", "@openscout", "runtime");
4148
+ if (isInstalledRuntimePackageDir(bunScoutNested))
4149
+ return bunScoutNested;
4144
4150
  return null;
4145
4151
  }
4146
4152
  function findWorkspaceRuntimeDir(startDir) {
@@ -4760,9 +4760,9 @@ function buildCollaborationContractPrompt(agentId) {
4760
4760
  // packages/runtime/src/broker-service.ts
4761
4761
  import { spawnSync } from "child_process";
4762
4762
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "fs";
4763
- import { homedir as homedir4 } from "os";
4763
+ import { homedir as homedir5 } from "os";
4764
4764
  import { basename as basename3, dirname as dirname5, join as join8, resolve as resolve3 } from "path";
4765
- import { fileURLToPath as fileURLToPath3 } from "url";
4765
+ import { fileURLToPath as fileURLToPath4 } from "url";
4766
4766
  function buildDefaultBrokerUrl(host = DEFAULT_BROKER_HOST, port = DEFAULT_BROKER_PORT) {
4767
4767
  return `http://${host}:${port}`;
4768
4768
  }
@@ -4776,16 +4776,22 @@ function runtimePackageDir() {
4776
4776
  const fromCwd = findWorkspaceRuntimeDir(process.cwd());
4777
4777
  if (fromCwd)
4778
4778
  return fromCwd;
4779
- const moduleDir = dirname5(fileURLToPath3(import.meta.url));
4779
+ const moduleDir = dirname5(fileURLToPath4(import.meta.url));
4780
4780
  return resolve3(moduleDir, "..");
4781
4781
  }
4782
4782
  function isInstalledRuntimePackageDir(candidate) {
4783
4783
  return existsSync4(join8(candidate, "package.json")) && existsSync4(join8(candidate, "bin", "openscout-runtime.mjs"));
4784
4784
  }
4785
4785
  function findGlobalRuntimeDir() {
4786
- const bunCandidate = join8(homedir4(), ".bun", "node_modules", "@openscout", "runtime");
4786
+ const bunCandidate = join8(homedir5(), ".bun", "node_modules", "@openscout", "runtime");
4787
4787
  if (isInstalledRuntimePackageDir(bunCandidate))
4788
4788
  return bunCandidate;
4789
+ const bunGlobalCandidate = join8(homedir5(), ".bun", "install", "global", "node_modules", "@openscout", "runtime");
4790
+ if (isInstalledRuntimePackageDir(bunGlobalCandidate))
4791
+ return bunGlobalCandidate;
4792
+ const bunScoutNested = join8(homedir5(), ".bun", "install", "global", "node_modules", "@openscout", "scout", "node_modules", "@openscout", "runtime");
4793
+ if (isInstalledRuntimePackageDir(bunScoutNested))
4794
+ return bunScoutNested;
4789
4795
  return null;
4790
4796
  }
4791
4797
  function findWorkspaceRuntimeDir(startDir) {
@@ -4816,7 +4822,7 @@ function resolveBunExecutable() {
4816
4822
  return candidate;
4817
4823
  }
4818
4824
  }
4819
- const homeBun = join8(homedir4(), ".bun", "bin", "bun");
4825
+ const homeBun = join8(homedir5(), ".bun", "bin", "bun");
4820
4826
  if (existsSync4(homeBun)) {
4821
4827
  return homeBun;
4822
4828
  }
@@ -4865,7 +4871,7 @@ function resolveBrokerServiceConfig() {
4865
4871
  const brokerHost = process.env.OPENSCOUT_BROKER_HOST ?? DEFAULT_BROKER_HOST;
4866
4872
  const brokerPort = Number.parseInt(process.env.OPENSCOUT_BROKER_PORT ?? String(DEFAULT_BROKER_PORT), 10);
4867
4873
  const brokerUrl = process.env.OPENSCOUT_BROKER_URL ?? buildDefaultBrokerUrl(brokerHost, brokerPort);
4868
- const launchAgentPath = join8(homedir4(), "Library", "LaunchAgents", `${label}.plist`);
4874
+ const launchAgentPath = join8(homedir5(), "Library", "LaunchAgents", `${label}.plist`);
4869
4875
  return {
4870
4876
  label,
4871
4877
  mode,
@@ -4894,7 +4900,7 @@ function renderLaunchAgentPlist(config) {
4894
4900
  OPENSCOUT_CONTROL_HOME: config.controlHome,
4895
4901
  OPENSCOUT_BROKER_SERVICE_MODE: config.mode,
4896
4902
  OPENSCOUT_BROKER_SERVICE_LABEL: config.label,
4897
- HOME: homedir4(),
4903
+ HOME: homedir5(),
4898
4904
  PATH: launchPath,
4899
4905
  ...collectOptionalEnvVars([
4900
4906
  "OPENSCOUT_MESH_ID",
@@ -4956,7 +4962,7 @@ function collectOptionalEnvVars(keys) {
4956
4962
  function resolveLaunchAgentPATH() {
4957
4963
  const entries = [
4958
4964
  ...(process.env.PATH ?? "").split(":").filter(Boolean),
4959
- join8(homedir4(), ".bun", "bin"),
4965
+ join8(homedir5(), ".bun", "bin"),
4960
4966
  "/opt/homebrew/bin",
4961
4967
  "/usr/local/bin",
4962
4968
  "/usr/bin",
@@ -5227,7 +5233,7 @@ var DEFAULT_BROKER_HOST = "127.0.0.1", DEFAULT_BROKER_PORT = 65535, BROKER_SERVI
5227
5233
  var init_broker_service = __esm(async () => {
5228
5234
  init_support_paths();
5229
5235
  DEFAULT_BROKER_URL = buildDefaultBrokerUrl();
5230
- if (process.argv[1] && fileURLToPath3(import.meta.url) === process.argv[1]) {
5236
+ if (process.argv[1] && fileURLToPath4(import.meta.url) === process.argv[1]) {
5231
5237
  await main();
5232
5238
  }
5233
5239
  });
@@ -5247,7 +5253,7 @@ import { execFileSync as execFileSync3, execSync } from "child_process";
5247
5253
  import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
5248
5254
  import { mkdir as mkdir5, rm as rm4, stat as stat3, writeFile as writeFile5 } from "fs/promises";
5249
5255
  import { basename as basename4, dirname as dirname6, join as join9, resolve as resolve4 } from "path";
5250
- import { fileURLToPath as fileURLToPath4 } from "url";
5256
+ import { fileURLToPath as fileURLToPath5 } from "url";
5251
5257
  function resolveRelayHub() {
5252
5258
  return resolveOpenScoutSupportPaths().relayHubDirectory;
5253
5259
  }
@@ -6381,7 +6387,7 @@ var init_local_agents = __esm(async () => {
6381
6387
  init_local_agent_template();
6382
6388
  await init_broker_service();
6383
6389
  BUILT_IN_LOCAL_AGENT_IDS = new Set(["scout", "builder", "reviewer", "research"]);
6384
- MODULE_DIRECTORY = dirname6(fileURLToPath4(import.meta.url));
6390
+ MODULE_DIRECTORY = dirname6(fileURLToPath5(import.meta.url));
6385
6391
  OPENSCOUT_REPO_ROOT = resolve4(MODULE_DIRECTORY, "..", "..", "..");
6386
6392
  DEFAULT_LOCAL_AGENT_CAPABILITIES = ["chat", "invoke", "deliver"];
6387
6393
  SUPPORTED_LOCAL_AGENT_HARNESSES = ["claude", "codex"];
@@ -6389,7 +6395,7 @@ var init_local_agents = __esm(async () => {
6389
6395
 
6390
6396
  // apps/desktop/src/server/create-scout-web-server.ts
6391
6397
  import { dirname as dirname9, resolve as resolve7 } from "path";
6392
- import { fileURLToPath as fileURLToPath6 } from "url";
6398
+ import { fileURLToPath as fileURLToPath7 } from "url";
6393
6399
 
6394
6400
  // node_modules/.bun/hono@4.12.10/node_modules/hono/dist/compose.js
6395
6401
  var compose = (middleware, onError, onNotFound) => {
@@ -7934,7 +7940,7 @@ init_setup();
7934
7940
 
7935
7941
  // apps/desktop/src/shared/product.ts
7936
7942
  var SCOUT_PRODUCT_NAME = "Scout";
7937
- var SCOUT_APP_VERSION = "0.2.16";
7943
+ var SCOUT_APP_VERSION = "0.2.17";
7938
7944
 
7939
7945
  // apps/desktop/src/shared/surface-capabilities.ts
7940
7946
  function resolveScoutSurfaceCapabilities(surface) {
@@ -7982,6 +7988,8 @@ import path3 from "path";
7982
7988
  import { spawn } from "child_process";
7983
7989
  import { basename as basename2, dirname as dirname4, join as join5 } from "path";
7984
7990
  import { existsSync as existsSync3 } from "fs";
7991
+ import { fileURLToPath as fileURLToPath3 } from "url";
7992
+ import { homedir as homedir4 } from "os";
7985
7993
  function tryWhich(executableName) {
7986
7994
  const pathEnv = process.env.PATH ?? "";
7987
7995
  const sep = process.platform === "win32" ? ";" : ":";
@@ -8002,6 +8010,23 @@ function tryWhich(executableName) {
8002
8010
  }
8003
8011
  return null;
8004
8012
  }
8013
+ function findNodeModulesRuntimeBin() {
8014
+ const runtimeBinRel = join5("node_modules", "@openscout", "runtime", "bin", "openscout-runtime.mjs");
8015
+ let dir = dirname4(fileURLToPath3(import.meta.url));
8016
+ for (let i = 0;i < 24; i++) {
8017
+ const candidate = join5(dir, runtimeBinRel);
8018
+ if (existsSync3(candidate))
8019
+ return candidate;
8020
+ const parent = dirname4(dir);
8021
+ if (parent === dir)
8022
+ break;
8023
+ dir = parent;
8024
+ }
8025
+ const bunGlobal = join5(homedir4(), ".bun", "install", "global", "node_modules", "@openscout", "runtime", "bin", "openscout-runtime.mjs");
8026
+ if (existsSync3(bunGlobal))
8027
+ return bunGlobal;
8028
+ return null;
8029
+ }
8005
8030
  function findMonorepoOpenscoutRuntimeBin() {
8006
8031
  let dir = process.cwd();
8007
8032
  for (let i = 0;i < 24; i++) {
@@ -8058,6 +8083,10 @@ function resolveRuntimeServiceEntrypoint() {
8058
8083
  if (onPath) {
8059
8084
  return onPath;
8060
8085
  }
8086
+ const fromNodeModules = findNodeModulesRuntimeBin();
8087
+ if (fromNodeModules) {
8088
+ return fromNodeModules;
8089
+ }
8061
8090
  const monorepo = findMonorepoOpenscoutRuntimeBin();
8062
8091
  if (monorepo) {
8063
8092
  return monorepo;
@@ -8638,7 +8667,7 @@ import path2 from "path";
8638
8667
 
8639
8668
  // apps/desktop/src/app/desktop/shell-utils.ts
8640
8669
  import { execFileSync as execFileSync4 } from "child_process";
8641
- import { homedir as homedir5 } from "os";
8670
+ import { homedir as homedir6 } from "os";
8642
8671
  import path from "path";
8643
8672
  function normalizeTimestamp(value) {
8644
8673
  if (!value)
@@ -8689,15 +8718,15 @@ function formatDateTimeLabel(value) {
8689
8718
  function compactHomePath2(value) {
8690
8719
  if (!value)
8691
8720
  return null;
8692
- const home = homedir5();
8721
+ const home = homedir6();
8693
8722
  return value.startsWith(home) ? value.replace(home, "~") : value;
8694
8723
  }
8695
8724
  function expandHomePath4(value) {
8696
8725
  if (value === "~") {
8697
- return homedir5();
8726
+ return homedir6();
8698
8727
  }
8699
8728
  if (value.startsWith("~/")) {
8700
- return path.join(homedir5(), value.slice(2));
8729
+ return path.join(homedir6(), value.slice(2));
8701
8730
  }
8702
8731
  return value;
8703
8732
  }
@@ -11625,7 +11654,7 @@ import path5 from "path";
11625
11654
  // apps/desktop/src/shared/paths.ts
11626
11655
  import { existsSync as existsSync7, readFileSync as readFileSync4 } from "fs";
11627
11656
  import { dirname as dirname7, join as join10, resolve as resolve5 } from "path";
11628
- import { fileURLToPath as fileURLToPath5 } from "url";
11657
+ import { fileURLToPath as fileURLToPath6 } from "url";
11629
11658
  function looksLikeWorkspaceRoot(candidate) {
11630
11659
  const packageJsonPath = join10(candidate, "package.json");
11631
11660
  if (!existsSync7(packageJsonPath)) {
@@ -11679,7 +11708,7 @@ function findMatchingAncestor(startDirectory, predicate) {
11679
11708
  }
11680
11709
  }
11681
11710
  function defaultModuleDirectory() {
11682
- return dirname7(fileURLToPath5(import.meta.url));
11711
+ return dirname7(fileURLToPath6(import.meta.url));
11683
11712
  }
11684
11713
  function uniqueResolutionStarts(options) {
11685
11714
  const starts = [
@@ -11744,7 +11773,7 @@ import {
11744
11773
  unlinkSync,
11745
11774
  writeFileSync as writeFileSync3
11746
11775
  } from "fs";
11747
- import { homedir as homedir6 } from "os";
11776
+ import { homedir as homedir7 } from "os";
11748
11777
  import { join as join11 } from "path";
11749
11778
 
11750
11779
  // apps/desktop/src/core/pairing/runtime/protocol/approval-normalization.ts
@@ -11829,7 +11858,7 @@ var SCOUT_PAIRING_RUNTIME_SCRIPT = "pair-supervisor.ts";
11829
11858
  var SCOUT_PAIRING_BRIDGE_CONNECT_TIMEOUT_MS = 1500;
11830
11859
  var SCOUT_PAIRING_BRIDGE_REQUEST_TIMEOUT_MS = 2500;
11831
11860
  function resolveScoutPairingPaths() {
11832
- const rootDir = join11(homedir6(), SCOUT_PAIRING_HOME_DIRECTORY);
11861
+ const rootDir = join11(homedir7(), SCOUT_PAIRING_HOME_DIRECTORY);
11833
11862
  return {
11834
11863
  rootDir,
11835
11864
  configPath: join11(rootDir, SCOUT_PAIRING_CONFIG_FILE),
@@ -12211,12 +12240,12 @@ function resolveScoutBunExecutable() {
12211
12240
  }
12212
12241
  const pathEntries = (process.env.PATH ?? "").split(":").filter(Boolean);
12213
12242
  const commonDirectories = [
12214
- join11(homedir6(), ".bun", "bin"),
12243
+ join11(homedir7(), ".bun", "bin"),
12215
12244
  "/opt/homebrew/bin",
12216
12245
  "/usr/local/bin"
12217
12246
  ];
12218
12247
  for (const directory of [...pathEntries, ...commonDirectories]) {
12219
- const candidate = join11(directory.replace(/^~(?=$|\/)/, homedir6()), "bun");
12248
+ const candidate = join11(directory.replace(/^~(?=$|\/)/, homedir7()), "bun");
12220
12249
  if (isExecutable2(candidate)) {
12221
12250
  return candidate;
12222
12251
  }
@@ -12449,7 +12478,7 @@ init_support_paths();
12449
12478
  await init_local_agents();
12450
12479
  import { spawn as spawn5 } from "child_process";
12451
12480
  import { existsSync as existsSync9 } from "fs";
12452
- import { homedir as homedir7 } from "os";
12481
+ import { homedir as homedir8 } from "os";
12453
12482
  import path4 from "path";
12454
12483
 
12455
12484
  // apps/desktop/src/core/telegram/bindings.ts
@@ -12578,12 +12607,12 @@ function resolveScoutElectronScoutExecutable() {
12578
12607
  }
12579
12608
  const pathEntries = (process.env.PATH ?? "").split(":").filter(Boolean);
12580
12609
  const commonDirectories = [
12581
- path4.join(homedir7(), ".bun", "bin"),
12610
+ path4.join(homedir8(), ".bun", "bin"),
12582
12611
  "/opt/homebrew/bin",
12583
12612
  "/usr/local/bin"
12584
12613
  ];
12585
12614
  for (const directory of [...pathEntries, ...commonDirectories]) {
12586
- const candidate = path4.join(directory.replace(/^~(?=$|\/)/, homedir7()), SCOUT_ELECTRON_OPENER);
12615
+ const candidate = path4.join(directory.replace(/^~(?=$|\/)/, homedir8()), SCOUT_ELECTRON_OPENER);
12587
12616
  if (isExecutable3(candidate)) {
12588
12617
  return candidate;
12589
12618
  }
@@ -15580,7 +15609,7 @@ function registerScoutWebAssets(app, options) {
15580
15609
 
15581
15610
  // apps/desktop/src/server/create-scout-web-server.ts
15582
15611
  function defaultMonorepoStaticClientRoot(moduleUrl = import.meta.url) {
15583
- return resolve7(dirname9(fileURLToPath6(moduleUrl)), "../../../../packages/electron-app/dist/client");
15612
+ return resolve7(dirname9(fileURLToPath7(moduleUrl)), "../../../../packages/electron-app/dist/client");
15584
15613
  }
15585
15614
  function parseOptionalPositiveInt(value, fallback) {
15586
15615
  if (typeof value !== "string" || value.trim().length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openscout/scout",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "Published Scout package that installs the `scout` command",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -22,6 +22,6 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@openscout/runtime": "0.2.16"
25
+ "@openscout/runtime": "0.2.17"
26
26
  }
27
27
  }