Commit Graph

314 Commits

Author SHA1 Message Date
Ashish Huddar ffef8d4a79 feat(web): mobile accordion layout — urgency-first kanban on mobile
Replace vertical kanban stacking on mobile (<=767px) with a single-open
accordion ordered Respond > Merge > Review > Pending > Working.
Auto-expands the most urgent non-empty section on load; empty sections
render as header-only rows (no dashed placeholder). Desktop layout is
unchanged. Added window.matchMedia stub to the Vitest setup file so
Dashboard unit tests pass in jsdom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:37:53 +05:30
Ashish Huddar 049ca42d85 fix(web): fix useMediaQuery hydration and add tests
Replace the lazy useState initializer that read window.matchMedia on
first render (causing SSR/client hydration mismatch) with a plain
false default; the existing useEffect already syncs the correct value
after mount. Adds a full vitest test suite covering all six specified
cases (SSR-safe default, match/no-match, number-to-query conversion,
change-event reactivity, and listener cleanup on unmount).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:33:57 +05:30
Ashish Huddar b74a212016 feat(web): add useMediaQuery hook for mobile detection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:29:40 +05:30
Ashish Huddar 8389085d61 fix(web): add Response to sw.js globals for ESLint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:13:30 +05:30
Ashish Huddar 73f796b93d fix(web): add fallback response when SW offline cache is evicted
caches.match() can return undefined under mobile storage pressure.
Fall back to a plain-text 503 response instead of passing undefined
to event.respondWith().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:12:01 +05:30
Ashish Huddar 402dc1f861 fix(web): fix mobile sidebar specificity and toggle close behavior
- Increase .project-sidebar--mobile-open specificity to (0,2,0) so it
  overrides .project-sidebar.project-sidebar--collapsed transform
- Make "Hide sidebar" and "Show project sidebar" buttons also call
  onMobileClose to dismiss the mobile drawer when toggling collapse

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:04:47 +05:30
Ashish Huddar 9128a793a2 fix(web): use globals comment for service worker ESLint compat
Replace unsupported eslint-env with globals comment for flat config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 07:56:07 +05:30
Ashish Huddar aa895cf9cd fix(web): add eslint serviceworker env to sw.js
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 07:55:04 +05:30
Ashish Huddar 4622be19cd feat(web): add PWA support and mobile flawlessness fixes
- Add web app manifest (manifest.ts) with dynamic project name, standalone display
- Add service worker (sw.js) with network-first strategy and offline fallback page
- Add PWA icons: apple-touch-icon (180x180), 192x192, 512x512 via shared renderer
- Add viewport meta with viewport-fit=cover for safe-area-inset support
- Add Apple Web App meta tags for iOS home screen installation
- Add theme-color meta for browser chrome coloring
- Extract shared icon-renderer.tsx to deduplicate icon generation logic
- Add ServiceWorkerRegistrar client component for SW registration
- Configure next.config.js with no-cache headers for service worker
- Add dvh fallbacks for 100vh usage (body, kanban-board, Terminal, DirectTerminal)
- Add safe-area-inset padding for mobile sidebar and dashboard main
- Add iOS auto-zoom prevention (16px font on inputs)
- Add -webkit-tap-highlight-color: transparent and text-size-adjust
- Add PWA standalone mode body padding for safe areas

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 07:53:34 +05:30
Ashish Huddar a4a86594c7 fix(web): add mobile backdrop to collapsed sidebar branch
The collapsed sidebar early-return path was missing the backdrop overlay
and close mechanism that the expanded branch had, making it impossible
to dismiss the mobile drawer by tapping outside.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 01:00:17 +05:30
Ashish Huddar 8fc778cf30 chore(web): add mobile-responsive layout for dashboard and session views
Add proper mobile breakpoints (768px, 480px) with structural layout changes:

- Sidebar: auto-hide on mobile with hamburger toggle and overlay drawer
- Dashboard hero: stack stats cards and controls vertically on mobile
- Kanban board: stack columns vertically instead of horizontal scroll
- Session cards: flexible height with 44px minimum touch targets
- Session detail: responsive header metadata and full-width terminal
- Global: phone-specific breakpoint (480px) for single-column layouts

Desktop layout remains completely unchanged.

Closes #633

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 00:55:37 +05:30
suraj_markup 4741ba2461
Merge pull request #528 from ashish921998/ashish/chore/kanban-redesign
feat(web): add light/dark mode theme toggle
2026-03-23 17:44:04 +05:30
Ashish Huddar 254d64de8f fix(web): use flat color for dark mode --card-merge-bg
The variable was a linear-gradient (an <image>), but it's used inside
color-mix() which only accepts <color> values. This made the entire
background declaration invalid, rendering merge-ready cards transparent
in dark mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:15:07 +05:30
Ashish Huddar 8e34695eec fix(web): use resolvedTheme in ThemeToggle for system theme support
Switches from theme to resolvedTheme so the toggle shows the correct
icon and toggles correctly even when theme is set to "system".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:03:38 +05:30
Ashish Huddar 0fe6340594 fix(web): show EmptyState when only done sessions exist
hasAnySessions now checks kanban-visible levels instead of all
displaySessions, so the board doesn't render empty columns when
every session is in the "done" state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:49:46 +05:30
Ashish Huddar f781be04b1 fix(web): remove unused imports to fix CI lint errors
Remove unused `ActivityDot` import and `humanizeStatus` function from
SessionDetail.tsx that caused lint, typecheck, and onboarding CI failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:54:11 +05:30
Ashish Huddar 6b7a8bd20c chore(web): design audit fixes — rename column, refine styles, fix terminal
- Rename "Merge Ready" kanban column to "Ready"
- Refine card design system and globals.css theme tokens
- Fix terminal scrollbar and theme handling in DirectTerminal
- Update SessionDetail layout
- Update tests to match component changes
- Add .gstack/ to .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:58:24 +05:30
Ashish Huddar 9ee1660dfa chore(web): refine card design, terminal scrollbar, and add card showcase
Flatten card shadows, add subtle borders, simplify SessionCard markup,
apply macOS-style auto-hide scrollbar to terminal, and add dev card
showcase page for visual testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:32:43 +05:30
suraj_markup a37a210977
Merge pull request #593 from suraj-markup/fix/resolve-project-cwd-matching
fix: auto-detect project from cwd in multi-project configs
2026-03-21 18:51:24 +05:30
suraj-markup 6d1055f412 fix: simplify cwd matching — remove redundant tilde expansion
loadConfig() already expands ~ in project paths via expandPaths(),
so manual replacement is unnecessary. Use resolve(proj.path) directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:08:15 +05:30
suraj-markup 36098efd0b fix: auto-detect project from cwd in multi-project configs
When multiple projects are configured and no project argument is given,
`ao start` and `ao stop` now match the current working directory against
project paths before erroring. This lets users run `ao start` from within
a project directory without specifying the project name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:02:42 +05:30
Ashish Huddar fb86167639 chore(web): remove unused Skeleton exports
Remove SkeletonBlock, ErrorState, DashboardSkeleton, and
SessionDetailSkeleton — none are imported anywhere in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:59:17 +05:30
Ashish Huddar 13dcbc8716 fix(web): move early return before hooks in ProjectSidebar
Fixes React Rules of Hooks violation where useMemo ran after a
conditional early return, causing inconsistent hook call counts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:34:57 +05:30
suraj-markup 0d6e26d104 fix: update package-version test to match 0.2.0 bump 2026-03-21 15:22:27 +05:30
Ashish Huddar 83f0c2ca46 test(web): update tests for kanban redesign
- Add useSearchParams mock to Dashboard test files
- Update SessionCard merge button text (Merge PR #N → Merge PR)
- Update AttentionZone tests for always-visible kanban columns
- Add missing sessions/activeSessionId props to ProjectSidebar tests
- Add missing issueTitle field to Dashboard empty state test mock

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:17:14 +05:30
Ashish Huddar 038620ffd1 fix(web): pre-landing review fixes
- Remove unnecessary !important on light mode background
- Add useMemo to ProjectSidebar session grouping (O(n*m) → O(n))
- Filter done sessions from sidebar nav (prevents empty board)
- Fix stale session param showing empty columns instead of empty state
- Add dark class to server-rendered HTML to prevent FOUC

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:17:06 +05:30
Ashish Huddar 28e6b96990 Merge remote-tracking branch 'origin/main' into ashish/chore/kanban-redesign 2026-03-21 13:13:16 +05:30
Ashish Huddar f24abc2145 Add collapsible project sidebar with bottom toggle 2026-03-21 11:49:39 +05:30
Ashish Huddar 4b171cd37b fix(web): wire up ThemeToggle with next-themes provider
- Install next-themes dependency
- Wrap app in ThemeProvider with class-based dark mode
- Remove hardcoded dark class from html element

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:06:41 +05:30
Ashish Huddar bfe100c543 chore(web): remove showcase page
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:03:53 +05:30
Ashish Huddar f9feb4bbf8 chore(web): kanban dashboard redesign — Linear-inspired design system
Redesign the kanban dashboard with a Linear-inspired aesthetic:
- New design tokens (neutral charcoal darks, white-alpha borders, muted status colors, indigo accent)
- Tighter spacing, visible column backgrounds, dark mode weight reduction
- Redesigned SessionCard, ProjectSidebar, and AttentionZone components
- Removed list view toggle, reordered columns (respond → merge → done)
- Added ThemeToggle, Skeleton/EmptyState components, and showcase page
- Exported CI_STATUS and getSizeLabel for component consumption

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:01:31 +05:30
github-actions[bot] c7d6634839 chore: version packages 2026-03-20 15:47:55 +00:00
suraj_markup a99aedf9a8
Merge pull request #537 from suraj-markup/feat/onboarding-improvements
feat: zero-friction onboarding — ao start does everything
2026-03-19 07:52:31 +05:30
suraj-markup 4fcdc674d4 Rename npm package from @composio/agent-orchestrator to @composio/ao
Users can now install with:
  npm install -g @composio/ao

Instead of the longer:
  npm install -g @composio/agent-orchestrator

- Rename packages/agent-orchestrator → packages/ao
- Update package.json name and directory field
- Update all references in README, SETUP.md, changeset config, and CLI error messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 02:17:02 +05:30
suraj_markup 178af32682
Merge pull request #463 from suraj-markup/feat/onboarding-improvements
feat: reduce onboarding friction — auto-init, add-project, dashboard publishing, error hardening
2026-03-19 01:21:34 +05:30
suraj_markup d3273a7938
Merge pull request #361 from Deepak7704/fix/metadata-hook-cd-prefix
fix(agent-claude-code): detect cd-prefixed gh/git commands and use relative hook path
2026-03-19 00:57:00 +05:30
suraj-markup 716be0cb74 Fix Bugbot review comments: tilde expansion, duplicate names, cross-platform detect
- Fix autoDetectProject path matching: expand ~ before comparing project
  paths to cwd, so `path: ~/my-repo` matches `/Users/user/my-repo`
- Fix addProjectToConfig: detect duplicate directory names and auto-suffix
  instead of silently overwriting existing project entries
- Fix agent detect() in all 4 plugins: replace `which` (Unix-only) with
  direct `--version` invocation for cross-platform compatibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:27:01 +05:30
suraj-markup 596913aa34 Fix review issues: busy-wait loops, lock race, import hygiene, typed errors
- Replace CPU-burning spin loops in running-state.ts with async setTimeout
  and jittered backoff; make all exports async
- Fix TOCTOU race in acquireLock by extracting tryAcquire helper with
  retry loop instead of force-remove-and-retry-once
- Hoist dynamic imports in addProjectToConfig/choice-2 to static imports
- Add try/finally around readline in detectAgentRuntime
- Validate session prefix uniqueness in "Start new orchestrator" menu
- Add ConfigNotFoundError class to @composio/ao-core, replace fragile
  string matching in ao start with instanceof check
- Fix setup.sh to recommend `ao start` instead of deprecated `ao init`
- Fix start-all.ts: resolve next binary with fallback, wait for children
  on SIGTERM instead of immediate process.exit

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 17:33:06 +05:30
suraj-markup 511d2b7fb9 Resolve remaining PR review comments
- Remove redundant project-existence check after autoDetectProject
- Wrap SIGTERM in try/catch for restart flow (dead process case)
- Remove unused setCallerContext export from caller-context.ts
- Fix unused vi import lint error in init.test.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:51:02 +05:30
suraj-markup 47a043ff6f Fix CI test hang: add missing mocks for new imports in start.test.ts
- Add vi.mock() for running-state, caller-context, detect-env,
  detect-agent, and project-detection modules imported by start.ts
- Without these mocks, vitest threads never exit (open handles)
- Remove init.test.ts test that triggered dynamic import of start.js
- Relax waitForPortAndOpen assertion (port resolution depends on
  full dashboard startup which is mocked out)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:41:55 +05:30
suraj-markup 09f757dd0e Fix PR review comments: spawn hint, dead code, detect import
- Fix spawn hint in start.ts to use new single-arg syntax
- Remove dead addProjectOnly() export (add-project fully deleted)
- Make detect-agent.ts handle both named and default export shapes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:14:42 +05:30
suraj-markup 030c669c37 Show friendly warning instead of hard error for old two-arg spawn syntax
When users run `ao spawn <project> <issue>`, show a yellow warning
explaining the new syntax (`ao spawn <issue>`) instead of Commander's
raw "too many arguments" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 14:32:35 +05:30
suraj-markup 44313f925d Remove two-arg support from ao spawn and batch-spawn
- spawn now takes only `[issue]` — project is always auto-detected
- batch-spawn now takes only `<issues...>` — no project prefix
- Commander rejects extra positional args automatically
- Update orchestrator prompt to remove projectId from spawn example
- Rewrite spawn tests to use auto-detected project (single project in config)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 14:29:14 +05:30
suraj-markup 79c2274bfe Fix remaining CI failures: init tests + direct-terminal-ws lint
- Rewrite init.test.ts to match simplified deprecated init command
  (old tests referenced removed --output, --auto, --smart flags)
- Add eslint-disable for consistent-type-imports in direct-terminal-ws.ts
  (node-pty is optional, must use import() type annotations)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 14:14:13 +05:30
suraj-markup a1a9966ed5 Fix CI failures: lint eqeqeq + test manifest displayName
- Change != null to !== undefined && !== null in caller-context.ts and
  session-manager.ts (3 locations) to satisfy eqeqeq lint rule
- Add displayName field to all 4 agent plugin test manifest assertions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:55:08 +05:30
suraj-markup 0b1bd49940 Address PR review comments: unused import, stop orphan, docs accuracy
- Remove unused getCallerType import from start.ts
- Fix ao stop orphaning dashboard: always run stopDashboard via lsof
  after killing parent PID, since SIGTERM may not propagate to child
- Revert spawn single-project special case back to always matching
  project ID (backward compat)
- Update README: replace ao init --interactive and ao add-project
  references with ao start equivalents, update spawn syntax

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:44:29 +05:30
suraj-markup 630586f66c Fix medium issues: lockfile, SIGTERM wait, config overwrite, spawn ambiguity
- Add advisory lockfile (O_EXCL) to running-state.ts to prevent TOCTOU
  race when multiple ao start processes run concurrently
- Wait up to 5s for old process to exit after SIGTERM in Override menu,
  escalate to SIGKILL if needed — prevents port conflict on restart
- Guard autoCreateConfig against overwriting existing config files —
  returns existing config instead of silently replacing it
- Fix spawn single-arg disambiguation: in single-project configs, always
  treat the arg as an issue ID (user never needs to specify project)
- Clean up running.json by deleting file instead of writing "null"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 05:57:26 +05:30
suraj-markup 694681f728 Fix review issues: ESM compat, prompt accuracy, port registration
- Replace require() with execFileSync in all 4 agent plugin detect()
  functions — fixes ReferenceError in ESM-only environments
- Remove non-existent -p flag from orchestrator prompt spawn/batch-spawn
  docs — prevents orchestrator agent from generating broken commands
- Return actual port from runStartup() and pass to register() — fixes
  running.json storing wrong port when auto-escalation picks a free port

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 05:49:53 +05:30
suraj-markup f3f81dad84 Simplify onboarding: absorb init + add-project into ao start
Reduces onboarding to `npm install -g @composio/ao && ao start`.

- Absorb init and add-project logic into `ao start` with auto-config
  creation, environment detection, and project type detection
- Add single-instance tracking via running.json with already-running
  interactive menu (human) and info+exit (agent)
- Add caller context detection (human/orchestrator/agent) via TTY and
  AO_CALLER_TYPE env var
- Add plugin-based agent runtime detection — no hardcoded binary paths,
  each plugin exports detect() and displayName
- Simplify `ao spawn` to just `ao spawn <issue>` with auto-detected
  project (backward compat: `ao spawn <project> <issue>` still works)
- Set AO_CALLER_TYPE, AO_PROJECT_ID, AO_CONFIG_PATH, AO_PORT env vars
  on all spawned sessions (worker, orchestrator, restore)
- Add `ao config-help` subcommand for config schema reference
- Deprecate `ao init` to thin wrapper, fully remove `ao add-project`
- Register/unregister in running.json on start/stop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 01:17:33 +05:30
deepak 367f1484c6 fix: use space-padded regex for cd-prefix stripping
Updates the cd-prefix stripping regex to require a space before the
delimiter (&& or ;). This allows paths containing & or ; characters
to be matched correctly while still finding the command separator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 11:24:46 +00:00