trantor 0.17.52 → 0.17.53

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.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + context-handoff for independent AI coding agents (Claude, Codex, Gemini, …)",
9
- "version": "0.17.52"
9
+ "version": "0.17.53"
10
10
  },
11
11
  "plugins": [
12
12
  {
13
13
  "name": "trantor",
14
14
  "source": "./",
15
15
  "description": "The hub-world for AI agent crews. Say \"fire up the crew\" and Claude becomes the architect: a plan-aware Advisor routes the work (solo / cheap inline calls / live crew of Codex, GLM, Kimi & DeepSeek in their own terminal windows), a Kanban/flow command center with a testing gate tracks it, and an economics brain (Scrooge) keeps the receipts. Includes the relay MCP, a SessionStart auto-discovery hook, and a PreCompact context-handoff so a fresh session can take over a full window instead of compacting.",
16
- "version": "0.17.52",
16
+ "version": "0.17.53",
17
17
  "author": {
18
18
  "name": "Sasha Bogojevic"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.17.52",
3
+ "version": "0.17.53",
4
4
  "description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
5
5
  "mcpServers": {
6
6
  "relay": {
package/bin/crew.sh CHANGED
@@ -368,12 +368,17 @@ spawn_cmux() { # $@ = specs
368
368
  echo " ~/.config/cmux/cmux.json (cmux auto-reloads). —"
369
369
  spawn_cmux_applescript "$@"; return
370
370
  fi
371
- local first=1 SPEC wsid="" surf="" i=0
372
- local dirs=(down right down right down right down right)
371
+ # Grid tiling: COLS = ceil(sqrt(N)) → 2 seats side-by-side, 4 = 2×2, 6 = 3×2. Row 0 is built with
372
+ # RIGHT splits off the previous column; each later row splits DOWN from the pane directly above it.
373
+ # Every split TARGETS a recorded surface id (--surface) — never "whatever pane happens to be focused",
374
+ # which is what produced the old staircase layout.
375
+ local N=$# COLS=1; while [ $(( COLS * COLS )) -lt "$N" ]; do COLS=$(( COLS + 1 )); done
376
+ local SPEC wsid="" surf="" i=0
377
+ local surfs=()
373
378
  for SPEC in "$@"; do
374
379
  resolve_spec "$SPEC"
375
380
  local cmd launcher; cmd="$(RUN_CMD)"; launcher="$(_seat_launcher "$AGENT" "$cmd")"
376
- if [ "$first" = "1" ]; then
381
+ if [ "$i" = "0" ]; then
377
382
  if [ "$DRY" = "1" ]; then
378
383
  echo "[dry] cmux: new-workspace (cwd $DIR) --command 'bash $launcher' → rename 'trantor:$PROJ'"
379
384
  wsid="%DRYWS"; surf="%DRYT0"
@@ -384,16 +389,19 @@ spawn_cmux() { # $@ = specs
384
389
  surf="$(_cmux list-pane-surfaces --workspace "$wsid" --id-format uuids --json 2>/dev/null | node -e 'let d="";process.stdin.on("data",c=>d+=c).on("end",()=>{try{const o=JSON.parse(d.slice(d.search(/[\[{]/)));const a=o.surfaces||o.panes||o||[];const s=Array.isArray(a)?a[0]:null;process.stdout.write((s&&(s.id||s.surface_id))||"")}catch(e){}})')"
385
390
  fi
386
391
  record_state "$PROJ" "cmuxws" "__ws__" "$wsid"
387
- first=0
388
392
  else
389
- local dir="${dirs[$(( i % ${#dirs[@]} ))]}"
393
+ local dir target
394
+ if [ $(( i / COLS )) = "0" ]; then dir="right"; target="${surfs[$(( i - 1 ))]}"
395
+ else dir="down"; target="${surfs[$(( i - COLS ))]}"; fi
390
396
  if [ "$DRY" = "1" ]; then
391
- echo "[dry] cmux: new-split $dir + send 'bash $launcher'"; surf="%DRYT$i"
397
+ echo "[dry] cmux: new-split $dir --surface ${target:-<focused>} + send 'bash $launcher'"; surf="%DRYT$i"
392
398
  else
393
- surf="$(_cmux new-split "$dir" --workspace "$wsid" --id-format uuids --json 2>/dev/null | _cmux_surf_json)"
399
+ local tflag=(); [ -n "$target" ] && [ "${target#\%DRY}" = "$target" ] && tflag=(--surface "$target")
400
+ surf="$(_cmux new-split "$dir" --workspace "$wsid" "${tflag[@]}" --id-format uuids --json 2>/dev/null | _cmux_surf_json)"
394
401
  [ -n "$surf" ] && { _cmux send --surface "$surf" "bash $launcher" >/dev/null 2>&1; _cmux send-key --surface "$surf" enter >/dev/null 2>&1; }
395
402
  fi
396
403
  fi
404
+ surfs+=("$surf")
397
405
  record_state "$PROJ" "cmux" "$AGENT" "$surf"
398
406
  echo " → $AGENT seat in cmux workspace ($PROJ)"
399
407
  i=$(( i + 1 ))
@@ -404,12 +412,15 @@ spawn_cmux() { # $@ = specs
404
412
 
405
413
  # AppleScript fallback (cmux control socket off): same one-tab-per-project layout, minus native sidebar status.
406
414
  spawn_cmux_applescript() { # $@ = specs
407
- local first=1 SPEC tabid="" termid="" i=0
408
- local dirs=(down right down right down right down right)
415
+ # Same grid math as spawn_cmux: COLS = ceil(sqrt(N)); row 0 splits RIGHT off the previous column,
416
+ # later rows split DOWN from the terminal directly above — targeted by stable terminal id.
417
+ local N=$# COLS=1; while [ $(( COLS * COLS )) -lt "$N" ]; do COLS=$(( COLS + 1 )); done
418
+ local SPEC tabid="" termid="" i=0
419
+ local terms=()
409
420
  for SPEC in "$@"; do
410
421
  resolve_spec "$SPEC"
411
422
  local cmd launcher; cmd="$(RUN_CMD)"; launcher="$(_seat_launcher "$AGENT" "$cmd")"
412
- if [ "$first" = "1" ]; then
423
+ if [ "$i" = "0" ]; then
413
424
  if [ "$DRY" = "1" ]; then
414
425
  echo "[dry] cmux(AppleScript): new tab (trantor:$PROJ) + run 'bash $launcher'"; tabid="%DRYTAB"; termid="%DRYT0"
415
426
  else
@@ -431,11 +442,12 @@ OSA
431
442
  tabid="${out%%|*}"; termid="${out##*|}"
432
443
  fi
433
444
  record_state "$PROJ" "cmuxws" "__ws__" "$tabid"
434
- first=0
435
445
  else
436
- local dir="${dirs[$(( i % ${#dirs[@]} ))]}"
446
+ local dir target
447
+ if [ $(( i / COLS )) = "0" ]; then dir="right"; target="${terms[$(( i - 1 ))]}"
448
+ else dir="down"; target="${terms[$(( i - COLS ))]}"; fi
437
449
  if [ "$DRY" = "1" ]; then
438
- echo "[dry] cmux(AppleScript): split $dir + run 'bash $launcher'"; termid="%DRYT$i"
450
+ echo "[dry] cmux(AppleScript): split $dir from ${target:-<focused>} + run 'bash $launcher'"; termid="%DRYT$i"
439
451
  else
440
452
  termid="$(osascript 2>/dev/null <<OSA
441
453
  tell application "cmux"
@@ -446,7 +458,12 @@ tell application "cmux"
446
458
  end repeat
447
459
  end repeat
448
460
  if theTab is missing value then return "ERR"
449
- set newterm to (split (focused terminal of theTab) direction $dir)
461
+ set srcTerm to missing value
462
+ repeat with tm in terminals of theTab
463
+ if (id of tm) is "$target" then set srcTerm to tm
464
+ end repeat
465
+ if srcTerm is missing value then set srcTerm to (focused terminal of theTab)
466
+ set newterm to (split srcTerm direction $dir)
450
467
  delay 0.25
451
468
  input text ("bash $launcher" & return) to newterm
452
469
  return (id of newterm)
@@ -455,6 +472,7 @@ OSA
455
472
  )"
456
473
  fi
457
474
  fi
475
+ terms+=("$termid")
458
476
  record_state "$PROJ" "cmux" "$AGENT" "$termid"
459
477
  echo " → $AGENT seat in cmux workspace ($PROJ)"
460
478
  i=$(( i + 1 ))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.17.52",
3
+ "version": "0.17.53",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"