Commit graph

15 commits

Author SHA1 Message Date
Naiyuan Qing
3622f82a7b feat(gateway): add auto-connect, hub discovery via list-devices
- Add LIST_DEVICES event and "hub" device type to SDK
- Add listDevices() method to GatewayClient
- Add handleListDevices handler in Gateway
- Change Hub deviceType from "client" to "hub"
- Refactor gateway store: auto-connect WS, separate hubId selection
- Hub-init: auto-connect on mount, discover hubs on registered
- Hub-sidebar: show discovered hubs list with connect/disconnect UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:13:40 +08:00
Naiyuan Qing
3d7b13555f refactor(sdk): unify gateway-sdk into @multica/sdk package
Sync latest code from src/shared/gateway-sdk/ into packages/sdk/,
update all backend imports to use @multica/sdk, and remove the
duplicate src/shared/gateway-sdk/ directory.

- Translate Chinese comments to English in SDK source
- Fix package.json exports with default condition
- Add @multica/sdk as workspace dependency for backend
- Update imports in gateway, test-client, and hub

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:43:52 +08:00
yushen
d9ba793fee fix(gateway): extract content from payload in received messages
Display payload.content instead of raw JSON when the payload
is an object with a content field.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:46:30 +08:00
yushen
7775ba5ca9 fix(gateway): stack target fields vertically for mobile
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:43:22 +08:00
yushen
e35aa95690 chore(gateway): rename client from Geneva to Multica
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:41:48 +08:00
yushen
25d447afc6 feat(gateway): polish PWA client UI for mobile
- Move disconnect button into header as a compact X icon
- Add app logo to header and setup screen
- Truncate device ID with tap-to-copy
- Collapsible target bar with smart label summary
- Empty state illustration when no messages
- Pulsing status dot animation for live connection
- Rounded send button, chat-bubble message input
- Glassmorphism header/compose bar with backdrop blur
- Auto-open target bar when targets not set
- Auto-collapse target bar after first send

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:39:31 +08:00
yushen
0f8db7083c fix(gateway): serve PWA client under /client subpath
Move static files from / to /client to avoid conflicts with
WebSocket and existing HTTP endpoints. Update manifest, service
worker, and HTML asset references accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:35:40 +08:00
yushen
5f2cc06111 fix(gateway): fix Dockerfile build and copy static assets
- Replace `pnpm build` (turbo recursion) with direct `tsc` invocation
- Copy gateway/public static assets into dist for PWA serving

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:32:01 +08:00
yushen
1ddde840de chore(gateway): use provided PNG icon for PWA
Replace generated SVG icon with the provided PNG icon across
manifest, HTML, and service worker precache.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:27:45 +08:00
yushen
566f14f8ac feat(gateway): add PWA mobile client
Add a mobile-first PWA client served from the Gateway, mirroring the
console demo client functionality with enhanced mobile UX:
- Chat-bubble style messaging UI with safe-area support
- PWA manifest, service worker, and SVG icon
- ServeStaticModule added to Gateway for static file serving

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:24:28 +08:00
Jiayuan
3a435aac8a
docs: translate comments from Chinese to English (#15)
Translate all comments, JSDoc strings, and documentation text from Chinese to English across 19 files for improved accessibility and consistency with the broader developer community.

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-30 04:01:14 +08:00
yushen
dcca9333ab Add Hub Console with agent management and message routing
Implement Hub that auto-connects to Gateway, manages agents via REST API,
and routes WebSocket messages to agents by payload.agentId with echo responses
sent back to the original sender.

- Add Hub with GatewayClient auto-connect, agent CRUD, and message routing
- Add Console (NestJS) with REST API and static pages (management + demo client)
- Switch Gateway registration from explicit event to query-based on connect
- Remove deprecated types (RegisterPayload, metadata, SendMessagePayload)
- Add @nestjs/serve-static for serving console UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 16:14:29 +08:00
yushen
2ea7938444 Add Docker support for Gateway and SDK documentation
- Add Dockerfile and build script for Gateway containerization
- Add USAGE.md documenting SDK usage for Client/Agent implementations
- Move socket.io-client to production dependencies (required by SDK)
- Remove redundant timestamp field from RoutedMessage (UUID v7 contains timestamp)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 17:56:22 +08:00
yushen
7d94b40a11 Implement WebSocket Gateway with NestJS and client SDK
- Add NestJS WebSocket Gateway with Socket.IO for real-time communication
- Create client SDK (GatewayClient) supporting both browser and Node.js
- Implement device registration and point-to-point message routing
- Add action types: request/response (RPC), stream (for chat messages)
- Integrate Pino logger for structured logging
- Configure heartbeat detection (pingInterval/pingTimeout)
- Use UUID v7 for time-ordered message IDs

Gateway features:
- Device registration with deviceId and deviceType (client/agent)
- Message routing between devices via Gateway
- HTTP API endpoints (/ping, /broadcast)
- Auto-reconnect support in client SDK

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:46:51 +08:00
yushen
6b34ddc3dc Initial project setup with multi-component architecture
- Initialize TypeScript project with pnpm
- Create agent, gateway, client, and shared modules
- Configure ESM with strict TypeScript settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 14:08:34 +08:00