Commit Graph

21 Commits

Author SHA1 Message Date
YeonGyu-Kim 274df1f262 feat(team-mode): add team state store resume logic with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 79fb12e254 feat(team-mode): add team state store locks with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 1bec921a5a feat(team-mode): add team state store with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 48bac223d3 feat(team-mode): export team-registry barrel 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 2866d3276e feat(team-mode): add team registry validator with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim cf050dc63a feat(team-mode): add team spec input normalizer with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim de30721fdc feat(team-mode): add team registry loader with normalization tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim b2359c0a63 feat(team-mode): add team registry path utilities with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim a91023961c feat(team-mode): add team session registry with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 3a93cb776f test(team-mode): add integration test for team-mode lifecycle 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 8c4c4ff644 feat(team-mode): add caller team-lead resolution with tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 41d6e12f0d feat(team-mode): add member session resolution and routing logic 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 8a42d7fd69 feat(team-mode): add member guidance and parser utilities 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 783d70558b feat(team-mode): add core types, dependencies and type-level tests 2026-05-06 14:19:38 +09:00
YeonGyu-Kim 3ddc757b15 fix(bun-spawn-shim): eliminate globalThis.Bun top-level destructures for Electron/Node compat
Root cause: bun build --target bun inlines top-level
  var { spawn } = globalThis.Bun;
for every file that contains 'import { spawn } from "bun"'. On Node/Electron
where globalThis.Bun is undefined, this crashes with
  Cannot destructure property 'spawn' of 'globalThis.Bun' as it is undefined.
26 source files had this import; the bundled output had 25 top-level destructures.

Fix:
- Add src/shared/bun-spawn-shim.ts: a thin wrapper that
  - delegates to Bun.spawn/spawnSync when globalThis.Bun is present (real Bun)
  - falls back to static ESM imports of node:child_process otherwise
  - uses static 'import { spawn } from "node:child_process"' so Bun bundler
    does NOT emit any globalThis.Bun destructures for this module
- Replace all 26 'from "bun"' spawn/spawnSync imports with relative paths to shim
- Replace 4 direct Bun.spawn() call sites with shim's spawn()
- Remove src/electron-compat.ts and script/prepend-electron-shim.ts (no longer needed)
- Update src/electron-compat.test.ts to assert 0 top-level globalThis.Bun destructures

Verification: grep -c '} = globalThis.Bun;' dist/index.js → 0 (was 25)
All 5921 tests pass (1 pre-existing timeout failure unrelated to this change).

Fixes #3797
2026-05-05 22:41:45 +09:00
YeonGyu-Kim 4e763fb0cb test(team-mode/team-worktree): use named tmpdir import to avoid mock leak
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-04 16:30:23 +09:00
YeonGyu-Kim 6a8bdcaa25 feat(team-mode): add resolveCallerTeamLead helper
🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
2026-05-04 01:43:55 +09:00
YeonGyu-Kim f8a1a11bb7 fix(team-mode): refactor layout to use testable spawn-process helper
The existing layout.test.ts relied on mock.module("bun", ...) registered
at the top level, but test-setup.ts calls mock.restore() + restoreModuleMocks()
in afterEach, so every test except the first one lost its mocks. CI has
been red on this file since e303feef.

Two changes:

1. layout.ts now imports spawn from the existing spawn-process helper
   instead of "bun" directly, matching the pattern established for
   closeTmuxPane and killTmuxSessionIfExists. This does not change
   runtime behavior - spawn-process just re-exports Bun's spawn.

2. layout.test.ts registers module mocks inside beforeEach and uses the
   ?test=UUID cache-busting dynamic-import pattern so the mocks apply
   on every test run, not just the first.

All 4 layout.test.ts cases now pass.
2026-04-18 19:42:19 +09:00
YeonGyu-Kim e303feefd2 feat(team-mode): add team-layout-tmux for focus+grid pane visualization
Introduce a dedicated module that builds the two-window tmux layout team-mode relies on:
- "focus" window uses main-vertical for the lead-centric view
- "grid" window uses tiled so every member pane is visible at once

createTeamLayout spawns omo-team-<teamRunId>, registers pane titles with
color-coded labels, and returns the focus/grid window IDs plus a
pane-by-member map. removeTeamLayout tears the session down idempotently.
canVisualize short-circuits when TMUX is unset so callers degrade
gracefully outside a tmux context.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 18:33:58 +09:00
YeonGyu-Kim f1268c0448 feat(team-mode): add worktree manager (optional per-member isolation) 2026-04-18 03:10:25 +09:00
YeonGyu-Kim b00e22c2b8 feat(team-mode): add core types (discriminatedUnion for members, D-41/D-42)
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-18 03:10:25 +09:00