Commit graph

1316 commits

Author SHA1 Message Date
Naiyuan Qing
8684156ffc
Merge pull request #140 from multica-ai/NevilleQingNY/fix-resizable-panels
feat: resizable sidebar, issue detail rewrite, package consolidation
2026-03-26 17:43:40 +08:00
Naiyuan Qing
939415db92 fix: resolve merge conflict in login page, adopt main's CLI auth flow
Take main's improved login page with extracted validateCliCallback
helper and cli_confirm step for existing sessions. Update import
from @multica/types to @/shared/types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:42:55 +08:00
Naiyuan Qing
8366e91b95 fix(auth): restore email verification login flow from main
The frontend ApiClient had a non-existent `/auth/login` endpoint.
Restored the two-step `sendCode` + `verifyCode` flow matching the
backend, including OTP input UI and CLI browser login callback support.
Also restored `IF NOT EXISTS` in migration 012 to prevent failures on
databases where the column already exists.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:40:54 +08:00
LinYushen
e9ae04012d
Merge pull request #139 from multica-ai/refactor/remove-repos-root
refactor(daemon): multi-workspace support, remove pairing, CLI auth
2026-03-26 17:40:32 +08:00
yushen
e263064e87 fix(daemon): remove dead code and improve UX feedback
Remove unused ListWorkspaces/Workspace from daemon client, add log when
default workspace is set implicitly, document token reload limitation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:32:37 +08:00
yushen
e4a905c841 fix(daemon): improve error handling in auth and workspace loading
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:22:12 +08:00
yushen
852d18ca19 fix(web): add null checks for CLI auth callback and token
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:22:08 +08:00
Jiayuan Zhang
6fd0e2b319
Merge pull request #141 from multica-ai/forrestchang/fix-012-migration
fix(db): make inbox_actor migration idempotent
2026-03-26 17:21:46 +08:00
Naiyuan Qing
f70b34a50f fix: resolve merge conflicts with main, preserve PAT functionality
- Resolve conflicts in CLAUDE.md, client.ts, settings/page.tsx
- Migrate PAT types and API methods to @/shared/types + @/shared/api architecture
- Restore simplified login flow (login page, auth store, tests)
- Fix issue detail comment submit test (use fireEvent + useRef for mock)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:19:24 +08:00
Jiayuan
fa6b5b5ba3 fix(db): make inbox_actor migration idempotent
The renumbered 012_inbox_actor migration fails on databases where the
old 009_inbox_actor was already applied, since actor_type and actor_id
columns already exist. Use IF NOT EXISTS to handle both cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 17:17:23 +08:00
yushen
12dec9f122 fix(daemon): add reload guard and atomic config writes
- Prevent concurrent reloadWorkspaces with a dedicated mutex
- SaveCLIConfig now writes to a temp file then renames for atomicity,
  preventing partial reads by the daemon's config watcher

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:11:15 +08:00
yushen
1e2ffddb72 docs: restore ~/.local/bin path option in README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:05:29 +08:00
yushen
3cf42e1913 docs: add brew install instructions to README
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:04:11 +08:00
yushen
ebda7eb9a8 docs: update README with CLI usage and remove outdated pairing docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:02:54 +08:00
yushen
844522ab1c refactor(cli): split workspace list and daemon watch commands
- `multica workspace list` — list all user workspaces from API (with
  watching indicator)
- `multica watch <id>` — add workspace to daemon watch list (top-level)
- `multica unwatch <id>` — remove from watch list (top-level)
- `multica watches` — show current daemon watch list (top-level)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:56:03 +08:00
yushen
4210fe69f4 feat(daemon): multi-workspace support with hot-reload
- Add `multica workspace watch/unwatch/list` CLI commands
- Daemon watches multiple workspaces from config's `watched_workspaces`
- Registers runtimes per workspace, polls all runtime IDs in round-robin
- Hot-reload: daemon detects config file changes every 5s and
  adds/removes workspaces without restart
- Remove `--workspace-id` flag from daemon (workspace selection is now
  purely config-driven via `multica workspace watch`)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:52:22 +08:00
Naiyuan Qing
2cf088ddf6 feat: resizable sidebar, issue detail rewrite, package consolidation
- Add drag-to-resize sidebar with localStorage persistence
- Rewrite issue detail page with Tiptap rich text editor, due date picker, acceptance criteria
- Redesign create-issue modal with pill-based property toolbar and expand/collapse
- Consolidate @multica/sdk and @multica/types into apps/web/shared/
- Simplify auth: remove verification codes, PATs, email service (dev-only login)
- Add 401 unauthorized handler to redirect expired sessions to login
- Fix due date format to send full RFC3339 timestamps
- Increase description editor debounce to 1500ms
- Remove arbitrary Tailwind values in create-issue modal
- Renumber migrations (inbox_actor 012→009), remove unused migrations
- UI polish across agents, settings, inbox, knowledge-base pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:47:04 +08:00
yushen
b9d2b88852 refactor(daemon): remove pairing flow, use CLI auth token instead
The daemon now reads the auth token from ~/.multica/config.json (set by
`multica auth login`) instead of requiring a browser-based pairing flow.
If not authenticated, it logs a message and exits.

Workspace ID is auto-resolved from the user's workspaces when not
explicitly set via flag/env.

Removed: daemon.json, pairing session flow, --config-path flag,
PairingSession type, PersistedConfig, LoadWorkspaceIDFromDaemonConfig.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:39:57 +08:00
yushen
669b18e1c9 feat(auth): skip email verification for CLI login when already authenticated
When the browser has an existing valid session and the login page is
opened with cli_callback, show a one-click "Authorize CLI" confirmation
instead of requiring email verification again.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:33:49 +08:00
yushen
7b4a73c989 refactor(daemon): remove global ReposRoot, use per-task RepoPath from server
ReposRoot was a daemon-level config that locked all tasks to a single
git repo. Replace with RepoPath in TaskContext so the server can specify
the repo per task. When not provided, daemon falls back to directory mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 16:04:33 +08:00
LinYushen
aa3f927a37
Merge pull request #138 from multica-ai/feat/cli-browser-login
feat(auth): browser-based CLI login
2026-03-26 15:46:18 +08:00
yushen
072ee83ee8 fix(db): renumber inbox_actor migration to resolve 009 conflict
009_inbox_actor conflicted with 009_verification_code, causing
actor_type/actor_id columns to never be added and /api/inbox to 500.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:44:10 +08:00
yushen
de1b7e3377 fix(auth): reduce verification code rate limit from 60s to 10s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:44:05 +08:00
yushen
de322f7a51 fix(auth): improve CLI login callback page to match frontend design
Replace bare HTML with a styled card layout featuring dark/light mode
support, Multica brand icon, and auto-close behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:44:01 +08:00
yushen
fb2e286cfe test(cli): add unit tests for PostJSON API client method
Cover success response, error status codes, nil output, and workspace
header propagation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:04:50 +08:00
yushen
b9a4fa1a6d fix(auth): add CSRF state param, scheme validation, and .envrc to gitignore
Add state parameter to CLI browser login flow for CSRF protection — CLI
generates a random state, frontend passes it through, CLI verifies on
callback. Also restrict cli_callback to http: scheme only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:04:46 +08:00
yushen
788ba502f6 fix(auth): validate cli_callback to localhost and URL-encode callback param
- Prevent open redirect / JWT theft by only allowing localhost/127.0.0.1
  as cli_callback hostname
- URL-encode the callback URL in the login query string
- Simplify resolveAppURL to use os.Getenv directly (no phantom flag)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:55:03 +08:00
yushen
feb62ae0f8 feat(auth): add browser-based CLI login flow
`multica auth login` now opens the browser for email verification,
receives the JWT via localhost callback, and exchanges it for a PAT.
The legacy PAT-paste flow is preserved via `--token` flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:51:41 +08:00
LinYushen
5c9c2f69fd
feat(auth): email verification login and personal access tokens
* feat(auth): add email verification login flow with 401 auto-redirect

Replace the old OAuth-based login with email verification codes:
- Backend: send-code / verify-code endpoints, verification_codes table (migration 009), rate limiting, Resend email service
- Frontend: two-step login UI (email → 6-digit OTP), auth store with sendCode/verifyCode
- SDK: ApiClient gains onUnauthorized callback; 401 responses auto-clear token and redirect to /login
- Fix login button staying disabled due to global isLoading state

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): add brute-force protection, redirect loop guard, and expired code cleanup

- VerifyCode: increment attempts on wrong code, reject after 5 failed tries (migration 010)
- onUnauthorized: skip redirect if already on /login to prevent infinite loops
- SendCode: best-effort cleanup of expired verification codes older than 1 hour

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(auth): add master verification code for non-production environments

Allow code "888888" to bypass email verification in non-production
environments to simplify development and testing workflows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(auth): add personal access tokens for CLI and API authentication

Add full-stack PAT support: users create tokens in Settings, CLI authenticates
via `multica auth login`. Server stores SHA-256 hashes only. Auth middleware
extended to accept both JWTs and PATs (distinguished by `mul_` prefix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:32:30 +08:00
Naiyuan Qing
a997bcfec0
Merge pull request #136 from multica-ai/NevilleQingNY/logging-and-ui-polish
feat: logging, UI polish, and issues page rewrite
2026-03-26 12:40:56 +08:00
Naiyuan Qing
9ff19214de test(issues): update page tests for new component structure
Update mocks for useIssueViewStore, view-store, dnd-kit, and
workspace breadcrumb. Adjust assertions for DropdownMenu-based
filters and multi-select state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:39:55 +08:00
Naiyuan Qing
bc39abc6ed feat: inbox actor tracking, issue detail extraction, UI polish
- Add actor_type/actor_id to inbox items for proper attribution
- Extract issue detail into features/issues/components/issue-detail.tsx
- Inbox page and store updates for actor-based notifications
- Sidebar, layout, and actor-avatar refinements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:36:12 +08:00
Naiyuan Qing
586a4916d1 feat(issues): rewrite issues page with component decomposition and persisted filters
- Decompose monolithic 472-line page.tsx into focused components:
  board-card, board-column, board-view, list-row, list-view,
  issues-header, issues-page
- Add view-store with Zustand persist for viewMode and multi-select
  status/priority filters
- Fix kanban DnD with pointerWithin + closestCenter collision detection
- Add workspace breadcrumb header and Linear-style filter dropdowns
  using DropdownMenu with CheckboxItem for multi-select
- Status filter hides kanban columns, priority filter hides cards
- Drop target highlight with bg-accent

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 12:36:01 +08:00
Naiyuan Qing
655aa40732 feat: issue detail extraction, inbox enhancements, misc UI polish
- Extract IssueDetail into reusable component
- Inbox: add body/type fields, bulk actions, read state
- Pages: consistent layout patterns
- Workspace avatar, markdown, realtime sync improvements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:57:58 +08:00
Naiyuan Qing
59816b807b feat(ui): Linear-style status icons with progress circle base
Refactor status icons to use a shared ProgressCircle SVG base with
pie-arc fill. Backlog, Todo, InProgress, InReview, Done, Cancelled,
Blocked all use the unified component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:57:42 +08:00
Naiyuan Qing
459d9745b9 feat(ui): route persistence, sidebar active fix, header spacing
- Persist last visited path via Zustand persist, restore on login/root
- Sidebar: exact match for active state (issue detail no longer highlights Issues)
- Sidebar header: increase vertical padding
- Inbox unread count: simplified to text-xs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:57:32 +08:00
Naiyuan Qing
8983a9fefa feat(logging): add structured logging across server and SDK
Replace raw fmt/log calls with structured slog logger (Go) and
console-based logger (TypeScript). Add request logging middleware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 10:57:11 +08:00
Jiayuan Zhang
6da87dd725
Merge pull request #135 from multica-ai/forrestchang/rename-super-mutica
chore: rename super-multica references to multica
2026-03-25 21:09:11 +08:00
Jiayuan
1988c45fb0 chore: rename super-multica references to multica
The project was previously called "super-multica" but has been renamed
to "multica". Update all remaining references in docker-compose, goreleaser,
README, and local development docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 21:01:39 +08:00
Naiyuan Qing
ade113975d
Merge pull request #255 from multica-ai/NevilleQingNY/ui-ux-fixes
feat(ui): UI/UX polish — layout, sidebar, button fixes
2026-03-25 18:54:29 +08:00
Naiyuan Qing
6535efdd97 feat(ui): UI/UX polish — layout, sidebar, button, theme improvements
- Fix global scrollbar overflow by removing h-svh from html element
- Add h-full overflow-hidden to html/body for proper app-like layout
- Fix default button variant: add shadow-sm and hover:bg-primary/90
- Update sidebar create-issue button to bg-background with shadow
- Add WorkspaceAvatar component and search/new-issue actions to sidebar header
- Improve theme provider with TooltipProvider wrapper
- Polish various page layouts, pickers, modals, and code block styling
- Clean up custom.css unused styles

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:53:14 +08:00
yushen
2d53afe471 fix(release): remove before hook that fails in CI
GoReleaser hooks execute commands directly without a shell, so `cd`
(a shell builtin) fails. The hook is unnecessary since go.mod should
already be tidy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:46:55 +08:00
yushen
a5aedf5dfe fix(test): gracefully skip DB tests when database is unreachable
pgxpool.New is lazy and doesn't connect immediately. Add pool.Ping()
after creation so CI environments without PostgreSQL skip cleanly
instead of failing with os.Exit(1).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:44:36 +08:00
LinYushen
04997b4011
Merge pull request #254 from multica-ai/feat/homebrew-release
feat(release): add GoReleaser config and Homebrew tap support
2026-03-25 17:39:07 +08:00
yushen
3b3d2c48b9 refactor(release): rename multica-cli to multica
Rename the binary and all references from multica-cli to multica for a
cleaner command-line experience.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:34:29 +08:00
yushen
22f1005537 fix(release): add test step, fix checkout version, improve brew formula
- Fix actions/checkout@v6 → v4 (v6 doesn't exist)
- Add Go test step before GoReleaser to prevent shipping broken binaries
- Add license and test block to Homebrew formula

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:32:47 +08:00
yushen
4c4f6c4a60 fix(release): use brews instead of homebrew_casks for CLI formula
homebrew_casks is for macOS .app bundles; brews is the correct
GoReleaser v2 key for CLI binaries. Also read Go version from go.mod
instead of hardcoding it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:26:34 +08:00
Naiyuan Qing
f150b39f1e
Merge pull request #253 from multica-ai/NevilleQingNY/review-fixes-acceptance
feat: event bus, WS isolation, global stores, inbox notifications, board polish
2026-03-25 17:22:15 +08:00
yushen
872d2d10bd fix(release): match Go version to go.mod (1.26)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:21:23 +08:00
Naiyuan Qing
97fa09156d fix(test): register event bus listeners in integration test setup
TestWebSocketIntegration was timing out because registerListeners()
was never called — events published via bus had no listeners, so
WS broadcasts never happened.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:19:58 +08:00