@pleri/olam-cli 0.1.102 → 0.1.103

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.
@@ -5,6 +5,6 @@
5
5
  "host-cp": "sha256:9af7f646a39eac1d68bf8de80a450fa531da0c73f082d2724429a01e2704e796",
6
6
  "mcp-auth": "sha256:5da67023e96f685589676b191105fa260eaa0199ef1af43e7a63f982880c7bf7",
7
7
  "$schema_version": 1,
8
- "$published_version": "0.1.102",
8
+ "$published_version": "0.1.103",
9
9
  "$registry": "ghcr.io/pleri"
10
10
  }
package/dist/index.js CHANGED
@@ -10218,6 +10218,34 @@ var init_bootstrap_hooks = __esm({
10218
10218
  });
10219
10219
 
10220
10220
  // ../core/dist/world/tmux-supervisor.js
10221
+ function injectBindAll(start) {
10222
+ let result = start;
10223
+ const userBoundRails = /(^|\s)(-b|--binding)(\s+|=)\S+/.test(start);
10224
+ const userBoundNext = /(^|\s)(-H|--hostname)(\s+|=)\S+/.test(start);
10225
+ const userBoundVite = /(^|\s)--host(\s+\S+|=\S+)/.test(start);
10226
+ const userBoundGunicorn = /(^|\s)(-h|--bind)(\s+|=)\S+/.test(start);
10227
+ const userHostEnv = /(^|\s)HOST=\S+/.test(start);
10228
+ const anyUserBound = userBoundRails || userBoundNext || userBoundVite || userBoundGunicorn;
10229
+ if (!userHostEnv && !anyUserBound) {
10230
+ result = `HOST=0.0.0.0 ${result}`;
10231
+ }
10232
+ if (!userBoundRails && /\brails\s+s(?:erver)?\b/.test(start)) {
10233
+ result = `${result} -b 0.0.0.0`;
10234
+ }
10235
+ if (!userBoundNext && /\bnext\s+dev\b/.test(start)) {
10236
+ result = `${result} -H 0.0.0.0`;
10237
+ }
10238
+ if (!userBoundVite && /\b(?:^|\s|=)vite\b/.test(start)) {
10239
+ result = `${result} --host 0.0.0.0`;
10240
+ }
10241
+ if (!userBoundVite && /\b(?:flask\s+run|uvicorn|hypercorn)\b/.test(start)) {
10242
+ result = `${result} --host 0.0.0.0`;
10243
+ }
10244
+ if (!userBoundGunicorn && /\bgunicorn\b/.test(start)) {
10245
+ result = `${result} --bind 0.0.0.0`;
10246
+ }
10247
+ return result;
10248
+ }
10221
10249
  async function startSupervisedApps(containerName, worldId, repos, exec, options = {}) {
10222
10250
  if (!SAFE_IDENT2.test(containerName)) {
10223
10251
  throw new Error(`containerName "${containerName}" must match ${SAFE_IDENT2} (defensive guard)`);
@@ -10253,7 +10281,7 @@ async function startSupervisedApps(containerName, worldId, repos, exec, options
10253
10281
  windowsExisting.push(repo.name);
10254
10282
  continue;
10255
10283
  }
10256
- const expandedStart = repo.start.replace(/\$\{?PORT\}?/g, String(repo.hostPort));
10284
+ const expandedStart = injectBindAll(repo.start).replace(/\$\{?PORT\}?/g, String(repo.hostPort));
10257
10285
  const startCmd = `cd ${shellQuote2(repo.dir)} && exec ${expandedStart}`;
10258
10286
  exec(containerName, `tmux new-window -t ${sessionName} -n ${repo.name} -d ${shellQuote2(startCmd)}`);
10259
10287
  windowsCreated.push(repo.name);
@@ -31318,6 +31318,34 @@ async function runSeedHooks(seeds, containerName, servicePortMap, exec) {
31318
31318
  }
31319
31319
 
31320
31320
  // ../core/dist/world/tmux-supervisor.js
31321
+ function injectBindAll(start) {
31322
+ let result = start;
31323
+ const userBoundRails = /(^|\s)(-b|--binding)(\s+|=)\S+/.test(start);
31324
+ const userBoundNext = /(^|\s)(-H|--hostname)(\s+|=)\S+/.test(start);
31325
+ const userBoundVite = /(^|\s)--host(\s+\S+|=\S+)/.test(start);
31326
+ const userBoundGunicorn = /(^|\s)(-h|--bind)(\s+|=)\S+/.test(start);
31327
+ const userHostEnv = /(^|\s)HOST=\S+/.test(start);
31328
+ const anyUserBound = userBoundRails || userBoundNext || userBoundVite || userBoundGunicorn;
31329
+ if (!userHostEnv && !anyUserBound) {
31330
+ result = `HOST=0.0.0.0 ${result}`;
31331
+ }
31332
+ if (!userBoundRails && /\brails\s+s(?:erver)?\b/.test(start)) {
31333
+ result = `${result} -b 0.0.0.0`;
31334
+ }
31335
+ if (!userBoundNext && /\bnext\s+dev\b/.test(start)) {
31336
+ result = `${result} -H 0.0.0.0`;
31337
+ }
31338
+ if (!userBoundVite && /\b(?:^|\s|=)vite\b/.test(start)) {
31339
+ result = `${result} --host 0.0.0.0`;
31340
+ }
31341
+ if (!userBoundVite && /\b(?:flask\s+run|uvicorn|hypercorn)\b/.test(start)) {
31342
+ result = `${result} --host 0.0.0.0`;
31343
+ }
31344
+ if (!userBoundGunicorn && /\bgunicorn\b/.test(start)) {
31345
+ result = `${result} --bind 0.0.0.0`;
31346
+ }
31347
+ return result;
31348
+ }
31321
31349
  var PortInUseError = class extends Error {
31322
31350
  port;
31323
31351
  repo;
@@ -31366,7 +31394,7 @@ async function startSupervisedApps(containerName, worldId, repos, exec, options
31366
31394
  windowsExisting.push(repo.name);
31367
31395
  continue;
31368
31396
  }
31369
- const expandedStart = repo.start.replace(/\$\{?PORT\}?/g, String(repo.hostPort));
31397
+ const expandedStart = injectBindAll(repo.start).replace(/\$\{?PORT\}?/g, String(repo.hostPort));
31370
31398
  const startCmd = `cd ${shellQuote2(repo.dir)} && exec ${expandedStart}`;
31371
31399
  exec(containerName, `tmux new-window -t ${sessionName} -n ${repo.name} -d ${shellQuote2(startCmd)}`);
31372
31400
  windowsCreated.push(repo.name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pleri/olam-cli",
3
- "version": "0.1.102",
3
+ "version": "0.1.103",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "olam": "./bin/olam.cjs"