Commit graph

153 commits

Author SHA1 Message Date
Naiyuan Qing
30a1fd02b8 feat(console): enable CORS for cross-origin web app requests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:40:38 +08:00
Naiyuan Qing
cdcce47141 feat(ui): add brand icon and artistic font to sidebar header
- Display Multica icon alongside brand name in sidebar header
- Use Playfair Display serif font for an artistic brand feel
- Expose --font-brand CSS variable from layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:35:48 +08:00
Naiyuan Qing
db9d7ab2d7 feat(web): replace default Next.js branding with Multica icon
- Copy brand icon from gateway to web app/icon.png and public/icon.png
- Remove default favicon.ico and placeholder SVGs
- Update metadata title and description

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:31:41 +08:00
Naiyuan Qing
8018290fba fix(ui): add semantic colors to sonner toast icons
success → emerald-500, info → blue-500, warning → amber-500,
error → red-500, loading → muted-foreground.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:22:27 +08:00
Naiyuan Qing
9af889a9bb fix(web): import toast from @multica/ui instead of bare sonner
sonner is a dependency of @multica/ui, not web. Re-export toast from
the ui sonner module and update the import path in chat.tsx.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:21:24 +08:00
Naiyuan Qing
0975510956 feat(web): show full deviceId with copy button and toast feedback
Display full UUID instead of truncated 8-char slice. Add ghost button
with copy icon that writes deviceId to clipboard, switches to checkmark
for 2s, and shows a sonner toast confirmation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:19:57 +08:00
Naiyuan Qing
5f367fb6b7 fix(web): replace Zustand device store with local useDeviceId hook
Move device ID logic from @multica/store (Zustand persist) into a
simple useDeviceId hook in the web app. SSR returns empty string,
client reads/writes localStorage directly — no hydration mismatch,
no suppressHydrationWarning needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:16:54 +08:00
Naiyuan Qing
7d326695c1 feat(web): add scroll fade hint effect to chat message list
Use CSS mask-image gradients to hint at scrollable overflow in the chat
area. Adds useScrollFade hook that dynamically applies top/bottom fade
based on scroll position via scroll events and ResizeObserver.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:14:19 +08:00
Naiyuan Qing
047de2b431 fix(web): suppress deviceId hydration mismatch warning
Zustand persist generates a new deviceId on the server (no localStorage),
then hydrates a different value from localStorage on the client. Add
suppressHydrationWarning to the deviceId span since this mismatch is expected.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 22:04:57 +08:00
Naiyuan Qing
456d9c5429 docs: rewrite CLAUDE.md with project architecture and commands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:50:12 +08:00
Naiyuan Qing
1a1c3ec086 fix: auto-load .env via --env-file flag in all tsx scripts
Eliminates the need to manually `source .env` before running dev
services. This fixes `pnpm dev` where concurrently couldn't source
.env for the console process.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:50:07 +08:00
Naiyuan Qing
905e8c8ae3 fix(ui): remove Shiki span background-color causing unwanted highlights
The dual-theme CSS applied background-color to .shiki span elements,
which picked up token-level bg variables from github-dark/light themes
and created visible purple/blue highlights on code lines.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:48:29 +08:00
Naiyuan Qing
10dbacc693 chore: add concurrently to run all services with pnpm dev
`pnpm dev` now starts gateway (3000), console (4000) and web (3001)
in parallel with colored labels.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:31:53 +08:00
Naiyuan Qing
2a1e5f0343 feat(web): add SidebarTrigger to Chat header
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:24:47 +08:00
Naiyuan Qing
88d2e9340b feat(ui): add light/dark theme toggle in sidebar
Add next-themes integration with a ThemeProvider wrapper and a
ThemeToggle dropdown (Light / Dark / System) in the sidebar footer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:21:31 +08:00
Naiyuan Qing
4375a6662b chore(web): set dev port to 3001 to avoid gateway conflict
Gateway occupies port 3000, so the Next.js dev server now
runs on port 3001.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:20:06 +08:00
Naiyuan Qing
e3643514d4 refactor(web): move sidebar layout shell to layout.tsx
Lift AppSidebar, SidebarInset and SidebarTrigger into the root layout
so page.tsx only contains page-specific content.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:09:06 +08:00
Naiyuan Qing
ffaed12048 feat(ui): add global scrollbar styling with light/dark support
Thin 6px scrollbars with transparent tracks and themed thumbs using
CSS standard properties + WebKit pseudo-elements for max compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:09:05 +08:00
Naiyuan Qing
1ec6221664 feat(web): add Chat page component placeholder
Create empty Chat component and wire it into the main page,
replacing the previous mock Markdown/ChatInput content.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:05:10 +08:00
Naiyuan Qing
f348d91c18 feat(ui): add Spinner component from multica
Port the SpinKit Grid 3x3 spinner as a shared UI component.
Uses currentColor and em sizing for flexible theming and scaling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 21:01:48 +08:00
Naiyuan Qing
01790a57d2 refactor(ui): extract AppSidebar into shared UI component
Move sidebar markup from page.tsx into a reusable AppSidebar component
in packages/ui for cross-app reuse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:57:57 +08:00
Naiyuan Qing
4036463d6c feat(web): add sidebar layout
Wrap layout in SidebarProvider, restructure page into left
sidebar navigation + right SidebarInset content area.
Add use-mobile hook via shadcn for responsive behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:40:35 +08:00
Naiyuan Qing
9b87cd789e feat(ui): add Markdown rendering components
Add CodeBlock, Markdown, StreamingMarkdown components with
Shiki syntax highlighting, GFM support, and linkify utility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 20:40:27 +08:00
Jiang Bohan
2a96fc9227 fix(autocomplete): Tab completes selected suggestion to input
- First Tab: highlights first suggestion
- Second Tab: completes highlighted suggestion to input with trailing space
- Use arrow keys to navigate between suggestions
2026-01-30 17:49:12 +08:00
Jiang Bohan
ce314105af docs: add custom skill creation section to README 2026-01-30 17:45:27 +08:00
Jiang Bohan
dc2c369ca9 docs(skill-creator): explicitly state no .skill packaging needed 2026-01-30 17:43:59 +08:00
Jiang Bohan
66cb3e5a93 refactor(skill-creator): use direct bash commands instead of Python script
Simplify skill creation by using mkdir + cat instead of init_skill.py
to avoid path resolution issues between bundled and managed directories
2026-01-30 17:39:52 +08:00
Jiang Bohan
f19e51da31 feat(skill-creator): add init_skill.py script for reliable skill creation
- Add init_skill.py that always creates skills in ~/.super-multica/skills/
- Restructure SKILL.md with step-by-step creation process
- Make script usage mandatory to prevent skills in wrong directories
- Support --description, --emoji, --tag, --resources options
2026-01-30 17:39:03 +08:00
Jiang Bohan
b2d281c29d docs(skill-creator): emphasize correct skill directory path 2026-01-30 17:34:35 +08:00
Jiang Bohan
5562fbe7d7 docs(skill-creator): add progressive disclosure section 2026-01-30 17:26:49 +08:00
Jiang Bohan
c1cbdacf40 feat(skills): add skill-creator meta-skill for self-extension
Add a bundled skill that teaches the agent how to create, edit, and
manage custom skills. This enables the agent to extend its own
capabilities by writing new SKILL.md files.

Features:
- Complete SKILL.md format reference
- Examples for creating translation and code formatter skills
- Best practices for skill development
- Script inclusion guidance
- Skill precedence explanation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:22:25 +08:00
Jiang Bohan
423bb6e5a6 docs: add language switch and update root README skills section
- Add English/Chinese language switch links to skills READMEs
- Update root README.md with new skills features and CLI examples
- Link to full skills documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:10:01 +08:00
Bohan Jiang
20b45c0bcf
Merge pull request #36 from multica-ai/feat/skills-system
feat(skills): complete skills system implementation
2026-01-30 17:07:12 +08:00
Jiang Bohan
8974f52669 docs(skills): add plugin system docs and Chinese translation
- Document plugin system in Loading & Precedence section
- Add guidance on when to use plugins vs `add` command
- Create README.zh-CN.md with full Chinese translation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:03:39 +08:00
Jiang Bohan
8c2f8add76 feat(skills): add plugin system for npm package discovery
- Add plugin.ts with manifest loading and plugin discovery
- Scan node_modules for packages with multica.plugin.json
- Auto-discover and load skills from installed npm packages
- Integrate plugin skills into SkillManager via loader.ts
- Add workspaceDir and pluginPaths options to SkillManagerOptions
- Export plugin types and functions from index.ts

This enables users to install skill packages via npm and have them
automatically discovered without running `skills add`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:48:36 +08:00
Jiang Bohan
a07e3ae280 docs(skills): add documentation for diagnostics and serialization
Document new Phase 5 features:
- Status diagnostics with diagnostic types table
- Async serialization API and utilities
- Updated troubleshooting section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:23 +08:00
Jiang Bohan
3f1566694d chore(skills): export new diagnostics and serialize modules
Export checkEligibilityDetailed, DiagnosticItem, serialize, and
related utilities from skills index.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:19 +08:00
Jiang Bohan
7ddf4f76a3 refactor(skills): add serialization to add/remove/install operations
Apply async serialization to prevent concurrent operations:
- addSkill: serialized by target skill name
- removeSkill: serialized by skill name
- installSkill: serialized by skill ID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:14 +08:00
Jiang Bohan
ac7c124109 feat(cli): enhance status command with rich diagnostics
Improve skills:cli status command with:
- Summary view grouping ineligible skills by issue type
- Detailed view showing requirements checklist and diagnostics
- Color-coded output for better readability
- Quick actions section with actionable hints
- Support for verbose mode (-v) for additional details

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:10 +08:00
Jiang Bohan
deb96496e7 feat(skills): add detailed eligibility diagnostics with hints
Enhance eligibility checking to provide detailed diagnostics including:
- Diagnostic type categorization (binary, env, platform, config)
- Actionable hints for resolving issues
- Platform-specific install suggestions for common tools
- API key source hints for well-known services

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:06 +08:00
Jiang Bohan
3bd85b63a4 feat(skills): add async serialization for concurrent operations
Add serialize module to prevent concurrent operations from corrupting
files when multiple add/remove/install operations run simultaneously.

- Queue-based serialization by key
- Utility functions: isProcessing, getQueueLength, waitForKey, waitForAll
- Standard SerializeKeys for common operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:33:01 +08:00
Jiang Bohan
84f5c69b10 feat(cli): add real-time autocomplete dropdown for commands
Implement autocomplete input with visual dropdown suggestions:
- Shows matching commands as you type /
- Use arrow keys or Tab to navigate suggestions
- Enter to select, Escape to dismiss
- Displays command descriptions alongside names

No external dependencies - uses raw terminal control codes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:20:17 +08:00
Jiang Bohan
40b680266a docs(skills): add skill invocation documentation
Document Phase 4 skill invocation features:
- User invocation via slash commands
- Tab completion usage
- Invocation control frontmatter fields
- Command dispatch configuration
- Command name normalization rules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:11:23 +08:00
Jiang Bohan
ac6f8fb493 feat(cli): add tab completion for skill commands
Integrate SkillManager with interactive CLI:
- Tab completion for /command prefixes
- Combined completion for built-in and skill commands
- Skill invocation handling with instructions context
- Updated /help to display available skill commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:11:19 +08:00
Jiang Bohan
4e10ee7e15 feat(skills): extend SkillManager with invocation methods
Add invocation capabilities to SkillManager:
- getSkillCommands: get user-invocable skill command specs
- resolveCommand: match user input to skill invocation
- getCompletions: get tab completions for command prefix
- buildModelSkillsPrompt: build prompt excluding user-only skills

Export invoke module functions for external use.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:11:13 +08:00
Jiang Bohan
42e2943999 feat(skills): add invoke module for skill commands
Implement skill command invocation system:
- resolveInvocationPolicy: get skill's invocation settings
- isUserInvocable/isModelInvocable: check invocation eligibility
- sanitizeCommandName: normalize skill names for commands
- buildSkillCommands: generate command specs from skills
- findSkillCommand: match command by name or skill ID
- resolveSkillInvocation: parse user input to skill invocation
- getCommandCompletions: tab completion for skill commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:11:07 +08:00
Jiang Bohan
8fbd72c329 feat(skills): add invocation types and parser support
Add types for skill invocation control:
- SkillInvocationPolicy for user-invocable/model-invocable flags
- SkillCommandSpec for command specifications
- SkillCommandDispatch for tool dispatch configuration
- SkillInvocationResult for resolved command results

Update parser to handle frontmatter fields:
- user-invocable (kebab-case, camelCase, snake_case)
- disable-model-invocation
- command-dispatch, command-tool, command-arg-mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:10:59 +08:00
LinYushen
916223db6f
Merge pull request #34 from multica-ai/copy-env-local
refactor(hub): rename Device ID to Hub ID in console layer
2026-01-30 16:10:16 +08:00
yushen
eb4ce85602 refactor(hub): rename Device ID to Hub ID in console layer
Rename the business-layer concept from "Device ID" to "Hub ID" for
better user comprehension. The underlying network transport layer
still uses deviceId — Hub ID is passed as the deviceId value.

- Rename device.ts → hub-identity.ts, getDeviceId → getHubId
- Storage file: ~/.super-multica/device-id → ~/.super-multica/hub-id
- Hub property: deviceId → hubId
- API response field: deviceId → hubId
- Console UI label: "Device ID" → "Hub ID"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 16:02:00 +08:00
Jiayuan
a3e9fb60eb
Merge pull request #32 from multica-ai/forrestchang/cli-build-bin
feat(cli): add binary build support
2026-01-30 15:58:40 +08:00