openmausbot 0.1.75 → 0.1.76

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 (39) hide show
  1. package/dist/assets/index-BtT047dk.css +1 -0
  2. package/dist/assets/{index-BTlyRwLl.js → index-C6blGSq5.js} +1 -1
  3. package/dist/assets/index-fKXFpB_J.js +305 -0
  4. package/dist/index.html +2 -2
  5. package/dist-server/companion/src/routes.js +6 -2
  6. package/dist-server/drivers/agents-proxy.js +133 -11
  7. package/dist-server/index.js +2602 -869
  8. package/dist-server/mcp-gate.js +28 -18
  9. package/dist-server/openmausbot.js +202 -120
  10. package/dist-server/pair-cli.js +202 -120
  11. package/dist-server/server/agent-tool-policy.js +1 -0
  12. package/dist-server/server/atomic.js +37 -1
  13. package/dist-server/server/bot-overview.js +5 -1
  14. package/dist-server/server/chief-of-staff.js +17 -12
  15. package/dist-server/server/delegations.js +177 -63
  16. package/dist-server/server/drivers/acp/hermes.js +21 -3
  17. package/dist-server/server/drivers/agents-proxy.js +113 -10
  18. package/dist-server/server/drivers/claude.js +31 -14
  19. package/dist-server/server/drivers/openai-chat.js +90 -67
  20. package/dist-server/server/drivers/openai-compat.js +9 -1
  21. package/dist-server/server/drivers/pi.js +18 -3
  22. package/dist-server/server/env-path.js +18 -17
  23. package/dist-server/server/index.js +1112 -312
  24. package/dist-server/server/message-db.js +21 -0
  25. package/dist-server/server/peer-roster.js +48 -9
  26. package/dist-server/server/procs.js +19 -3
  27. package/dist-server/server/room-handoffs.js +237 -0
  28. package/dist-server/server/section-context.js +64 -14
  29. package/dist-server/server/store.js +247 -8
  30. package/dist-server/server/surface.js +16 -5
  31. package/dist-server/server/team-backup.js +17 -1
  32. package/dist-server/server/team-setup-requests.js +252 -0
  33. package/dist-server/server/turn-dispatch-guard.js +31 -3
  34. package/dist-server/shared/approval-mode.js +7 -0
  35. package/dist-server/shared/team-backup.js +1 -0
  36. package/dist-server/shared/team-setup.js +1 -0
  37. package/package.json +1 -1
  38. package/dist/assets/index-CeMbvsgx.js +0 -305
  39. package/dist/assets/index-DH7Zax6L.css +0 -1
@@ -207,8 +207,8 @@ function isFile(p) {
207
207
  }
208
208
  }
209
209
  /** PATHEXT-aware `which`. A path-ish cli is probed where it points. */
210
- function whichWin(cli) {
211
- const exts = (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
210
+ function whichWin(cli, env) {
211
+ const exts = ((env ?? process.env).PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
212
212
  // an extensionless name is not runnable on Windows, so PATHEXT wins over
213
213
  // the bare file — npm installs both `claude` (a sh script) and `claude.cmd`
214
214
  const probe = (base) => {
@@ -217,7 +217,8 @@ function whichWin(cli) {
217
217
  };
218
218
  if (/[\\/]/.test(cli) || /^[a-zA-Z]:/.test(cli))
219
219
  return probe(cli);
220
- for (const dir of augmentedPath().split(delimiter)) {
220
+ const path = env ? (env.PATH ?? env.Path ?? "") : augmentedPath();
221
+ for (const dir of path.split(delimiter)) {
221
222
  if (!dir)
222
223
  continue;
223
224
  const hit = probe(join(dir, cli));
@@ -229,20 +230,20 @@ function whichWin(cli) {
229
230
  /** node.exe to run a script with: the one npm's shim would pick, else PATH,
230
231
  * else this executable only when it really is Node. In a packaged app,
231
232
  * process.execPath is Electron and must never be mistaken for node.exe. */
232
- function nodeExe(near) {
233
+ function nodeExe(near, env) {
233
234
  const local = join(near, "node.exe");
234
235
  if (isFile(local))
235
236
  return local;
236
237
  // Ask for the executable explicitly so a custom PATHEXT ordering cannot
237
238
  // make a stray node.cmd hide the real node.exe beside it.
238
- const onPath = whichWin("node.exe");
239
+ const onPath = whichWin("node.exe", env);
239
240
  if (onPath && extname(onPath).toLowerCase() === ".exe")
240
241
  return onPath;
241
242
  return process.versions.electron ? null : process.execPath;
242
243
  }
243
244
  /** npm/pnpm .cmd shims all spell their target as "%dp0%\..." (or
244
245
  * "%~dp0\..."). Whatever of those exists on disk is what the shim runs. */
245
- function parseCmdShim(shim) {
246
+ function parseCmdShim(shim, env) {
246
247
  let text;
247
248
  try {
248
249
  text = readFileSync(shim, "utf8");
@@ -256,7 +257,7 @@ function parseCmdShim(shim) {
256
257
  .filter((p) => isFile(p) && basename(p).toLowerCase() !== "node.exe");
257
258
  const script = targets.find((p) => /\.[cm]?js$/i.test(p));
258
259
  if (script) {
259
- const node = nodeExe(dir);
260
+ const node = nodeExe(dir, env);
260
261
  if (node)
261
262
  return { command: node, args: [script] };
262
263
  }
@@ -265,7 +266,7 @@ function parseCmdShim(shim) {
265
266
  }
266
267
  /** `#!/usr/bin/env node` → `node <script>`. Only node: nothing else has a
267
268
  * meaningful Windows equivalent worth guessing at. */
268
- function parseNodeShebang(file) {
269
+ function parseNodeShebang(file, env) {
269
270
  let head = "";
270
271
  let fd = null;
271
272
  try {
@@ -289,7 +290,7 @@ function parseNodeShebang(file) {
289
290
  }
290
291
  if (!/^#!.*\bnode(\.exe)?\b/.test(head))
291
292
  return null;
292
- const node = nodeExe(dirname(file));
293
+ const node = nodeExe(dirname(file), env);
293
294
  return node ? { command: node, args: [file] } : null;
294
295
  }
295
296
  /**
@@ -297,31 +298,31 @@ function parseNodeShebang(file) {
297
298
  * everywhere but win32 — POSIX already resolves PATH and #! itself.
298
299
  */
299
300
  /** Resolve a single command word (no tokenizer) — the platform spawn rules. */
300
- function resolveWord(cli, args) {
301
+ function resolveWord(cli, args, env) {
301
302
  if (process.platform !== "win32")
302
303
  return { command: cli, args };
303
- const file = whichWin(cli);
304
+ const file = whichWin(cli, env);
304
305
  // not found: hand back the name so spawn reports its own ENOENT
305
306
  if (!file)
306
307
  return { command: cli, args };
307
308
  const ext = extname(file).toLowerCase();
308
309
  if (ext === ".cmd" || ext === ".bat") {
309
- const direct = parseCmdShim(file);
310
+ const direct = parseCmdShim(file, env);
310
311
  return direct ? { command: direct.command, args: [...direct.args, ...args] } : { command: file, args };
311
312
  }
312
313
  if (ext === ".exe" || ext === ".com")
313
314
  return { command: file, args };
314
- const viaNode = parseNodeShebang(file);
315
+ const viaNode = parseNodeShebang(file, env);
315
316
  return viaNode ? { command: viaNode.command, args: [...viaNode.args, ...args] } : { command: file, args };
316
317
  }
317
- export function resolveCliSpawn(cli, args) {
318
+ export function resolveCliSpawn(cli, args, env) {
318
319
  // An EXISTING FILE wins over the tokenizer: paths with spaces come from
319
320
  // our own candidate list unquoted ("/Applications/My Tools/claude"), and
320
321
  // splitting those would shred them. Only a bare word (no spaces) or an
321
322
  // explicitly-quoted/wrapper string reaches the split below.
322
323
  const trimmed = cli.trim();
323
324
  if (trimmed.includes(" ") && existsSync(trimmed))
324
- return resolveWord(trimmed, args);
325
+ return resolveWord(trimmed, args, env);
325
326
  // A `cli` value may carry fixed leading arguments — wrapper scripts like
326
327
  // `/usr/local/bin/ag claude agp` are one string in the Engines panel. ONE
327
328
  // tokenizer pass, then resolve the head directly (never re-tokenized: a
@@ -335,7 +336,7 @@ export function resolveCliSpawn(cli, args) {
335
336
  // empty input → hand the raw string to spawn so IT reports the ENOENT
336
337
  if (!head)
337
338
  return { command: cli, args };
338
- return resolveWord(head, [...fixed, ...args]);
339
+ return resolveWord(head, [...fixed, ...args], env);
339
340
  }
340
- return resolveWord(cli, args);
341
+ return resolveWord(cli, args, env);
341
342
  }