Commit graph

1354 commits

Author SHA1 Message Date
LinYushen
6d2a0b45d2
refactor: decouple task lifecycle from issue status (#151)
* refactor: decouple task lifecycle from issue status, add daemon health server

- Remove automatic issue status changes from StartTask (in_progress),
  CompleteTask (in_review), and FailTask (blocked) in task service.
  Issue status is now fully managed by the agent via `multica issue status`.
- Update agent prompt and meta skill to instruct agents to manage issue
  status themselves (in_progress → done/in_review/blocked).
- Add daemon health HTTP server on 127.0.0.1:19514 with /health endpoint
  exposing pid, uptime, agents, and workspaces. Fail fast if port is taken
  (another daemon already running).
- Update `multica status` to check both server and daemon health.
- Add Save button to repos section in workspace settings UI.

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

* refactor(daemon): simplify prompt, fix runtime config path, improve task error logging

- Slim down BuildPrompt to a minimal hint; detailed workflow now lives in CLAUDE.md/AGENTS.md
- Write CLAUDE.md to workDir root instead of .claude/CLAUDE.md
- Fix git-exclude pattern (.claude → CLAUDE.md)
- Decouple task queue reconciliation from issue status changes (agents manage status via CLI)
- Add diagnostic logging when CompleteTask/FailTask fail due to unexpected task state

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

* fix(task): use task_completed/task_failed inbox notification types

FailTask was sending "agent_blocked" which conflates agent crash with
issue-level blocked status. Align notification types with the new
decoupled model: task_completed and task_failed. Update frontend types
and labels accordingly.

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-27 18:30:21 +08:00
LinYushen
8bd476f47c
Merge pull request #150 from multica-ai/fix/pr-149-review-fixes
fix: address PR #149 review findings
2026-03-27 16:19:47 +08:00
yushen
4d8b2edb2d fix: address PR #149 review findings
- Replace custom contains/searchString with strings.Contains in tests
- Fix variable shadow (r -> reposJSON) in workspace handler
- Wire daemon auth token + server URL into spawned agent env vars
- Remove unused CreateAgentTaskWithContext query (dead code after refactor)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:15:58 +08:00
LinYushen
327973be08
Merge pull request #149 from multica-ai/feat/cli-issue-commands
feat(cli): add issue management commands
2026-03-27 16:12:03 +08:00
yushen
bae2926370 feat(web): add repos management UI to workspace settings
Add a Repositories section to workspace settings where admins can
add/remove GitHub repo URLs with descriptions. Agents use these repos
to clone and work on code.

- Add WorkspaceRepo type and export from shared/types
- Update API client updateWorkspace to accept repos
- Add repos section in workspace-tab.tsx with add/remove UI
- Fix test helpers to include repos field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 16:05:54 +08:00
yushen
83111761db feat(workspace): add repos JSONB field for GitHub repository URLs
Add a `repos` JSONB column to the workspace table for storing
associated repository URLs and descriptions. This enables the daemon
to clone repos and set up git worktrees for agent task execution.

Structure: [{"url": "https://github.com/org/repo", "description": "..."}]

- Migration 014: adds repos column with default '[]'
- UpdateWorkspace query: supports updating repos
- Workspace API: returns repos in GET, accepts in PUT

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:49:30 +08:00
yushen
1deae2a1e9 refactor(daemon): remove context snapshot, let agent fetch data via CLI
Replace the frozen context snapshot pattern with a CLI-driven approach:
agents now use `multica` CLI commands to fetch issue details, comments,
and workspace context on demand, always getting the latest data.

- Remove buildContextSnapshot and snapshot generation from enqueue
- Claim endpoint now returns fresh agent name + skills from DB
- Daemon resolves provider from local runtimeIndex, not snapshot
- Prompt instructs agent to use `multica issue get` / `comment list`
- Meta skill (CLAUDE.md/AGENTS.md) documents all available CLI commands
- Skills still injected as filesystem files (static agent config)
- Simplify daemon types: remove TaskContext/IssueContext/RuntimeContext

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:31:22 +08:00
yushen
6733262a63 test(cli): add unit tests for issue command helpers
Tests for truncateID, formatAssignee, resolveAssignee (6 cases),
and validIssueStatuses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:12:20 +08:00
yushen
673ba09baf fix(cli): rune-safe truncateID, consistent client construction, add --output to status cmd
- Make truncateID use rune counting instead of byte length for unicode safety
- Refactor workspaceGet and workspaceMembers to use newAPIClient helper
  for consistent server-URL validation
- Add --output flag to issueStatusCmd for JSON output support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:12:16 +08:00
yushen
4a62b98c9a feat(cli): add workspace get and members commands
Expose workspace details (including context field) and member listing
via the CLI so agents can dynamically query workspace context instead
of relying on static snapshots.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:54:40 +08:00
yushen
daecf7985c fix(cli): propagate API errors in resolveAssignee and fix rune-safe truncation
- resolveAssignee now reports actual API errors instead of silently
  falling through to "not found" when both member/agent fetches fail
- Comment content truncation uses rune count for correct CJK handling
- Remove unnecessary _ = aType discard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 13:38:11 +08:00
yushen
765ba8e380 feat(cli): add issue management commands
Add `multica issue` command group with subcommands for full issue
lifecycle management: list, get, create, update, assign, status,
and comment operations. Includes assignee resolution by name across
both workspace members and agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:33:53 +08:00
yushen
568b5f3a8f docs: update CLAUDE.md with logging, CI, and CLI details
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 12:33:38 +08:00
Jiayuan Zhang
da2f794a1b
Merge pull request #148 from multica-ai/forrestchang/rm-agent-skills
chore: remove .agents/skills directory
2026-03-27 03:35:10 +08:00
Jiayuan
e07e294623 chore: remove .agents/skills directory
Remove all Claude Code skills (ui-ux-pro-max, shadcn, frontend-design,
web-design-guidelines) from the .agents directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 03:34:21 +08:00
Jiayuan Zhang
7e74c7b18c
Merge pull request #147 from multica-ai/feat/add-claude-skills
feat: add Claude Code skills for UI/UX development
2026-03-27 00:42:07 +08:00
Jiayuan
acf9c625eb feat: add Claude Code skills for UI/UX development
Add four Claude Code skills to enhance frontend development workflow:
- frontend-design: production-grade frontend interfaces
- shadcn: shadcn/ui component management
- ui-ux-pro-max: comprehensive UI/UX design intelligence
- web-design-guidelines: Web Interface Guidelines compliance

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 00:40:16 +08:00
Jiayuan Zhang
a6e9bb1f61
Merge pull request #146 from multica-ai/forrestchang/rm-knowledge-base
Remove knowledge base module and fix worktree port conflicts
2026-03-26 21:00:10 +08:00
Jiayuan
c1fc5c7bca chore(web): remove knowledge base module and fix worktree port conflicts
Remove the frontend-only knowledge base page, sidebar nav entry, and
unused BookOpen import. Fix setup-worktree to always generate unique
ports via init-worktree-env.sh instead of skipping when .env.worktree
already exists with default ports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 20:57:14 +08:00
Naiyuan Qing
88de467094
Merge pull request #145 from multica-ai/NevilleQingNY/rm-monorepo
Remove monorepo tooling, settings redesign, and UI improvements
2026-03-26 19:32:13 +08:00
Naiyuan Qing
488b41fc5e fix(test): update issues page test for empty state behavior change
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:30:59 +08:00
Naiyuan Qing
5696b78a26 fix(web): show empty board/list view when no issues match filters
Previously the entire view was replaced with "No matching issues" text.
Now the board columns or list view render even when empty.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:29:00 +08:00
Naiyuan Qing
46708e8948 fix(web): resolve duplicate tiptap Link extension warning
Disable Link in StarterKit since it's configured separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:27:30 +08:00
Naiyuan Qing
395814b16a fix(test): update daemon tests after removing acceptance_criteria/context_refs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:26:35 +08:00
Naiyuan Qing
a500001093 refactor: remove acceptance_criteria and context_refs from issues
These fields were unused in practice. Removed from frontend types,
issue detail UI, backend handlers, daemon prompt/context, protocol
messages, SQL queries, and tests. DB columns retained with defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:24:34 +08:00
Naiyuan Qing
4052017c7a feat: settings redesign, rich text mentions, inbox listeners, and UI polish
- Refactor settings page into tabbed components (general, workspace, members, tokens, account)
- Move settings link from dropdown to sidebar nav
- Add @mention suggestions in rich text editor
- Expand inbox listeners with enhanced event handling
- Improve board column, issue detail, and create issue modal UX
- Update markdown rendering and code block styling
- Polish skills page layout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:17:14 +08:00
Jiayuan Zhang
aeccd0ab51
Merge pull request #144 from multica-ai/forrestchang/local-runtime-tab
feat(runtimes): add Runtimes tab with usage tracking and connection test
2026-03-26 18:45:40 +08:00
Jiayuan
6ee034c6e9 merge: resolve conflicts after merging main
Adapt runtime features (usage tracking, ping, heartbeat) to main's
multi-workspace architecture. Update frontend imports from @multica/types
to @/shared/types after the package consolidation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 18:37:56 +08:00
yushen
87b482e73c refactor(cli): move watch/unwatch under workspace subcommand
Reduces top-level command clutter by nesting watch/unwatch as workspace
subcommands. Removes redundant `watches` command since `workspace list`
already shows watched status.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:28:44 +08:00
Jiayuan
903fbee55d feat(runtimes): add Runtimes tab with usage tracking and connection test
Add a new "Runtimes" sidebar tab to manage local agent runtimes with three
main capabilities: runtime status overview, token usage tracking (reading
Claude Code and Codex CLI local JSONL logs via daemon), and an interactive
connection test that sends a ping through the daemon to verify end-to-end
agent CLI connectivity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 18:28:36 +08:00
Jiayuan Zhang
8a1067e2aa
Merge pull request #143 from multica-ai/forrestchang/import-skill
feat(skills): add skill import from ClawHub and Skills.sh
2026-03-26 18:27:33 +08:00
Jiayuan
eeb4fee1b6 Merge remote-tracking branch 'origin/main' into forrestchang/import-skill 2026-03-26 18:23:59 +08:00
Jiayuan
9bc0366662 feat(skills): add skill import from ClawHub and Skills.sh
Support importing skills from external sources (clawhub.ai and skills.sh)
via a new POST /api/skills/import endpoint. The backend auto-detects the
source from the URL, fetches skill metadata and files, and creates the
skill in the workspace. The frontend CreateSkillDialog now has two tabs:
Create (manual) and Import (paste URL with source auto-detection badge).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 18:21:28 +08:00
Naiyuan Qing
82bd10c424
Merge pull request #142 from multica-ai/NevilleQingNY/rm-monorepo
refactor: remove unused monorepo tooling
2026-03-26 18:06:47 +08:00
Naiyuan Qing
a3d20d3644 fix(test): update login tests to match email verification flow
The login page was changed to email+OTP but tests still expected
the old name+email+password form.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:05:23 +08:00
Naiyuan Qing
26d3ecd06d fix(ci): replace turbo commands with direct pnpm calls
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 18:01:24 +08:00
Naiyuan Qing
a882df14b4 chore: update pnpm-lock.yaml after removing turbo
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:59:32 +08:00
Naiyuan Qing
d1f73bf7fc refactor: remove unused monorepo tooling
Delete packages/ui and packages/utils (zero imports from apps/web),
remove Turborepo, inline tsconfig.base.json into web's tsconfig,
and simplify root scripts to use pnpm --filter directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 17:57:11 +08:00
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