Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

Merge remote-tracking branch 'origin/main' into feat/telegram-channel

Naiyuan Qing23905daaa1cc
diff --cc apps/desktop/electron/electron-env.d.ts
index 98b087accd,4baf763e87..5050eed028
--- a/apps/desktop/electron/electron-env.d.ts
+++ b/apps/desktop/electron/electron-env.d.ts
@@@ -197,15 -190,17 +197,25 @@@ interface ElectronAPI
saveApiKey: (providerId: string, apiKey: string) => Promise<{ ok: boolean; error?: string }>
importOAuth: (providerId: string) => Promise<{ ok: boolean; expiresAt?: number; error?: string }>
}
- cron: {
- list: () => Promise<unknown[]>
- toggle: (jobId: string) => Promise<{ ok: boolean }>
- remove: (jobId: string) => Promise<{ ok: boolean }>
- }
- heartbeat: {
- last: () => Promise<unknown>
- setEnabled: (enabled: boolean) => Promise<{ ok: boolean; enabled?: boolean; error?: string }>
- wake: (reason?: string) => Promise<{ ok: boolean; result?: unknown; error?: string }>
- }
- localChat: {
+ channels: {
+ listStates: () => Promise<ChannelAccountStateInfo[]>
+ getConfig: () => Promise<Record<string, Record<string, Record<string, unknown>> | undefined>>
+ saveToken: (channelId: string, accountId: string, token: string) => Promise<{ ok: boolean; error?: string }>
+ removeToken: (channelId: string, accountId: string) => Promise<{ ok: boolean; error?: string }>
+ stop: (channelId: string, accountId: string) => Promise<{ ok: boolean; error?: string }>
+ start: (channelId: string, accountId: string) => Promise<{ ok: boolean; error?: string }>
+ }
++ cron: {
++ list: () => Promise<unknown[]>
++ toggle: (jobId: string) => Promise<{ ok: boolean }>
++ remove: (jobId: string) => Promise<{ ok: boolean }>
++ }
++ heartbeat: {
++ last: () => Promise<unknown>
++ setEnabled: (enabled: boolean) => Promise<{ ok: boolean; enabled?: boolean; error?: string }>
++ wake: (reason?: string) => Promise<{ ok: boolean; result?: unknown; error?: string }>
++ }
+ localChat: {
subscribe: (agentId: string) => Promise<{ ok?: boolean; error?: string; alreadySubscribed?: boolean }>
unsubscribe: (agentId: string) => Promise<{ ok: boolean }>
getHistory: (agentId: string, options?: { offset?: number; limit?: number }) => Promise<{ messages: unknown[]; total: number; offset: number; limit: number }>
diff --cc apps/desktop/electron/ipc/index.ts
index 7c7c596e18,a528e74a70..b733a320d9
--- a/apps/desktop/electron/ipc/index.ts
+++ b/apps/desktop/electron/ipc/index.ts
@@@ -6,14 -6,16 +6,18 @@@ export { registerSkillsIpcHandlers } fr
export { registerHubIpcHandlers, cleanupHub, initializeHub, setupDeviceConfirmation } from './hub.js'
export { registerProfileIpcHandlers } from './profile.js'
export { registerProviderIpcHandlers } from './provider.js'
+export { registerChannelsIpcHandlers } from './channels.js'
+ export { registerCronIpcHandlers } from './cron.js'
+ export { registerHeartbeatIpcHandlers } from './heartbeat.js'
import { registerAgentIpcHandlers, cleanupAgent } from './agent.js'
import { registerSkillsIpcHandlers } from './skills.js'
import { registerHubIpcHandlers, cleanupHub, initializeHub } from './hub.js'
import { registerProfileIpcHandlers } from './profile.js'
import { registerProviderIpcHandlers } from './provider.js'
+import { registerChannelsIpcHandlers } from './channels.js'
+ import { registerCronIpcHandlers } from './cron.js'
+ import { registerHeartbeatIpcHandlers } from './heartbeat.js'
/**
* Register all IPC handlers.
@@@ -25,7 -27,8 +29,9 @@@ export function registerAllIpcHandlers(
registerSkillsIpcHandlers()
registerProfileIpcHandlers()
registerProviderIpcHandlers()
+ registerChannelsIpcHandlers()
+ registerCronIpcHandlers()
+ registerHeartbeatIpcHandlers()
}
/**
diff --cc apps/desktop/electron/preload.ts
index 6c963a94e4,053135455c..de7a78fac0
--- a/apps/desktop/electron/preload.ts
+++ b/apps/desktop/electron/preload.ts
@@@ -201,26 -201,19 +201,39 @@@ const electronAPI =
ipcRenderer.invoke('provider:importOAuth', providerId),
},
+ // Channel management (Telegram, Discord, etc.)
+ channels: {
+ /** List all channel account states */
+ listStates: () => ipcRenderer.invoke('channels:listStates'),
+ /** Get channels config from credentials.json5 */
+ getConfig: () => ipcRenderer.invoke('channels:getConfig'),
+ /** Save a channel token and start the bot immediately */
+ saveToken: (channelId: string, accountId: string, token: string) =>
+ ipcRenderer.invoke('channels:saveToken', channelId, accountId, token),
+ /** Remove a channel token and stop the bot */
+ removeToken: (channelId: string, accountId: string) =>
+ ipcRenderer.invoke('channels:removeToken', channelId, accountId),
+ /** Stop a channel account */
+ stop: (channelId: string, accountId: string) =>
+ ipcRenderer.invoke('channels:stop', channelId, accountId),
+ /** Start a channel account from saved config */
+ start: (channelId: string, accountId: string) =>
+ ipcRenderer.invoke('channels:start', channelId, accountId),
+ },
+
+ // Cron jobs management
- cron: {
- list: () => ipcRenderer.invoke('cron:list'),
- toggle: (jobId: string) => ipcRenderer.invoke('cron:toggle', jobId),
- remove: (jobId: string) => ipcRenderer.invoke('cron:remove', jobId),
- },
-
- heartbeat: {
- last: () => ipcRenderer.invoke('heartbeat:last'),
- setEnabled: (enabled: boolean) => ipcRenderer.invoke('heartbeat:setEnabled', enabled),
- wake: (reason?: string) => ipcRenderer.invoke('heartbeat:wake', reason),
- },
++ cron: {
++ list: () => ipcRenderer.invoke('cron:list'),
++ toggle: (jobId: string) => ipcRenderer.invoke('cron:toggle', jobId),
++ remove: (jobId: string) => ipcRenderer.invoke('cron:remove', jobId),
++ },
++
++ heartbeat: {
++ last: () => ipcRenderer.invoke('heartbeat:last'),
++ setEnabled: (enabled: boolean) => ipcRenderer.invoke('heartbeat:setEnabled', enabled),
++ wake: (reason?: string) => ipcRenderer.invoke('heartbeat:wake', reason),
++ },
+
// Local chat (direct IPC, no Gateway required)
localChat: {
/** Subscribe to agent events for local direct chat */
diff --cc apps/desktop/src/App.tsx
index ac89454e95,48cc488309..bdc50f7ad4
--- a/apps/desktop/src/App.tsx
+++ b/apps/desktop/src/App.tsx
@@@ -1,10 -1,9 +1,11 @@@
import { createHashRouter, RouterProvider } from 'react-router-dom'
import Layout from './pages/layout'
import HomePage from './pages/home'
+import ChatPage from './pages/chat'
import ToolsPage from './pages/tools'
import SkillsPage from './pages/skills'
+import ChannelsPage from './pages/channels'
+ import CronsPage from './pages/crons'
const router = createHashRouter([
{
@@@ -12,10 -11,10 +13,11 @@@
element: <Layout />,
children: [
{ index: true, element: <HomePage /> },
- { path: 'chat' },
+ { path: 'chat', element: <ChatPage /> },
{ path: 'tools', element: <ToolsPage /> },
{ path: 'skills', element: <SkillsPage /> },
+ { path: 'channels', element: <ChannelsPage /> },
+ { path: 'crons', element: <CronsPage /> },
],
},
])
diff --cc apps/desktop/src/pages/layout.tsx
index 47e5af0d1c,7cb021a0f8..4f3e38677a
--- a/apps/desktop/src/pages/layout.tsx
+++ b/apps/desktop/src/pages/layout.tsx
@@@ -8,7 -8,7 +8,8 @@@ import
CodeIcon,
PlugIcon,
Comment01Icon,
+ Share08Icon,
+ Time04Icon,
} from '@hugeicons/core-free-icons'
import { cn } from '@multica/ui/lib/utils'
import { DeviceConfirmDialog } from '../components/device-confirm-dialog'
@@@ -19,7 -19,7 +20,8 @@@ const tabs =
{ path: '/chat', label: 'Chat', icon: Comment01Icon },
{ path: '/tools', label: 'Tools', icon: CodeIcon },
{ path: '/skills', label: 'Skills', icon: PlugIcon },
+ { path: '/channels', label: 'Channels', icon: Share08Icon },
+ { path: '/crons', label: 'Cron', icon: Time04Icon },
]
export default function Layout() {
diff --cc docs/mobile/app-store-submission-guide.md
index c5da7cdc8b,c5da7cdc8b..0000000000
deleted file mode 100644,100644
--- a/docs/mobile/app-store-submission-guide.md
+++ /dev/null
@@@ -1,234 -1,234 +1,0 @@@
--# App Store Submission Guide
--
--Complete guide for publishing the Expo React Native app to Apple App Store and Google Play Store.
--
--## 1. Prerequisites
--
--### Accounts & Fees
--
--| Platform | Cost | Notes |
--|----------|------|-------|
--| Apple Developer Program | $99/year | Required for App Store distribution |
--| Google Play Console | $25 one-time | Developer registration |
--| Expo Account | Free (paid plans available) | Required for EAS Build/Submit |
--
--- Apple Developer account review: 1-2 days
--- Google Play developer account review: days to weeks
--
--### Tools
--
--```bash
--npm install -g eas-cli
--eas login
--eas whoami # verify login
--```
--
--## 2. Project Configuration
--
--### Initialize EAS
--
--```bash
--eas build:configure
--```
--
--Generates `eas.json` with three build profiles: `development`, `preview`, `production`.
--
--### Key `app.json` / `app.config.ts` Fields
--
--```jsonc
--{
-- "name": "Multica",
-- "slug": "multica",
-- "version": "1.0.0",
-- "ios": {
-- "bundleIdentifier": "com.multica.app",
-- "buildNumber": "1" // increment on each submission
-- },
-- "android": {
-- "package": "com.multica.app",
-- "versionCode": 1 // increment on each submission
-- },
-- "icon": "./assets/icon.png", // 1024x1024 PNG
-- "splash": {
-- "image": "./assets/splash.png"
-- }
--}
--```
--
--## 3. App Signing & Credentials
--
--### iOS
--
--- EAS auto-manages credentials (recommended): Distribution Certificate + Provisioning Profile
--- Or create manually in Apple Developer Portal
--
--### Android
--
--- EAS auto-generates Keystore (recommended), stored securely on EAS servers
--- **Back up Keystore** — losing it means you cannot update the published app
--- Play Store requires AAB (Android App Bundle) format
--
--## 4. Production Build
--
--```bash
--# iOS
--eas build --platform ios --profile production
--
--# Android
--eas build --platform android --profile production
--
--# Both
--eas build --platform all --profile production
--```
--
--Builds run in Expo cloud — no local Xcode or Android Studio needed.
--
--## 5. Store Listing Preparation
--
--### Required for Both Platforms
--
--#### Privacy Policy
--
--- **Mandatory** — must be a publicly accessible URL
--- Must clearly state:
-- - What data the app collects and how
-- - Whether data is shared with third parties
-- - Data retention and deletion policies
-- - How users can request data deletion
--- **2025 rule**: If data is sent to third-party AI, must disclose explicitly and obtain user consent
--- Tools: Termly, PrivacyPolicies.com, or custom page
--
--#### App Screenshots
--
--- **iOS**: Multiple sizes required (6.7", 6.5", 5.5" iPhone + iPad)
--- **Android**: 2-8 screenshots
--- Must accurately reflect current app interface
--
--#### App Icon
--
--- 1024x1024 high-resolution PNG
--- No alpha/transparency for iOS
--
--#### App Description
--
--- Short description (≤80 chars for Google Play)
--- Full description
--
--#### Support URL
--
--- A link where users can get help
--
--#### Account Deletion
--
--- If the app supports registration, users **must** be able to delete their account and data in-app
--- Both Apple and Google require this
--
--### Apple App Store Connect — Additional Requirements
--
--| Item | Details |
--|------|---------|
--| Privacy Nutrition Labels | Fill out data collection practices per category in App Store Connect |
--| App Review Information | Reviewer contact info, demo/test account credentials |
--| Content Rating | Age classification |
--| Export Compliance | Encryption usage declaration |
--| Info.plist Permission Strings | Clear purpose description for each permission (camera, location, etc.) |
--
--### Google Play Console — Additional Requirements
--
--| Item | Details |
--|------|---------|
--| Data Safety Form | Detail data collection and sharing (required even if no data is collected) |
--| Content Rating Questionnaire | IARC rating questionnaire |
--| Target Audience | Declare if the app targets children |
--| First Upload | Must be done manually via Play Console (Google Play API limitation) |
--
--## 6. Submit to Stores
--
--### Apple App Store
--
--```bash
--eas submit --platform ios
--```
--
--This uploads the build to **App Store Connect / TestFlight**. Then you must:
--
--1. Log into App Store Connect
--2. Select the uploaded build
--3. Associate it with a version
--4. Fill in all metadata, screenshots, privacy labels
--5. Submit for App Review
--
--### Google Play Store
--
--```bash
--eas submit --platform android
--```
--
--**First time**: Must upload AAB manually in Play Console.
--
--After initial upload:
--1. Navigate to Production → Create new release
--2. Upload AAB or use the EAS-submitted build
--3. Fill in description, screenshots, data safety form
--4. Submit for review
--
--### Auto-Submit (Optional)
--
--```bash
--eas build --platform all --profile production --auto-submit
--```
--
--## 7. App Review
--
--| | Apple | Google |
--|---|---|---|
--| Review time | Typically 24-48 hours | Hours to 7 days |
--| Common rejections | Incomplete features, misleading screenshots, missing privacy policy, unclear permission strings | Data safety form mismatch, policy violations |
--| After rejection | Fix issues, resubmit | Fix issues, resubmit |
--
--## 8. Post-Launch
--
--### OTA Updates (No Re-Review Needed)
--
--```bash
--eas update --branch production
--```
--
--- Only for JS/asset-level changes
--- Native code changes still require a new build + review
--
--### CI/CD Automation
--
--Create `.eas/workflows/build-and-submit.yml` to auto-build and submit on push to main.
--
--### Google Service Account Key (for Automated Android Submissions)
--
--1. Go to EAS dashboard → Credentials → Android
--2. Click Application identifier → Service Credentials
--3. Add Google Service Account Key
--
--## 9. Checklist
--
--- [ ] Register Apple Developer + Google Play Console accounts
--- [ ] Configure `app.json` and `eas.json`
--- [ ] Prepare app icon, splash screen, screenshots
--- [ ] Write and host privacy policy URL
--- [ ] Implement in-app account deletion (if registration exists)
--- [ ] Add Info.plist permission descriptions (iOS)
--- [ ] Run `eas build --platform all --profile production`
--- [ ] Create app in App Store Connect, fill metadata + privacy labels
--- [ ] Create app in Google Play Console, fill data safety form, manual first AAB upload
--- [ ] `eas submit` or submit manually for review
--- [ ] Wait for review approval → live
--- [ ] Set up `eas update` for OTA updates
--
--## References
--
--- [Expo: Submit to App Stores](https://docs.expo.dev/deploy/submit-to-app-stores/)
--- [Expo: EAS Submit](https://docs.expo.dev/submit/introduction/)
--- [Expo: Build Your Project](https://docs.expo.dev/deploy/build-project/)
--- [Expo: App Stores Best Practices](https://docs.expo.dev/distribution/app-stores/)
--- [Apple App Review Guidelines](https://developer.apple.com/app-store/review/guidelines/)
--- [Apple App Privacy Details](https://developer.apple.com/app-store/app-privacy-details/)
--- [Google Play Data Safety](https://support.google.com/googleplay/android-developer/answer/10787469)
--- [Google Play Developer Policy Center](https://play.google/developer-content-policy/)
diff --cc docs/mobile/guide.md
index 0000000000,0000000000..5940c10896
new file mode 100644
--- /dev/null
+++ b/docs/mobile/guide.md
@@@ -1,0 -1,0 +1,497 @@@
++# Mobile Development Guide
++
++Complete lifecycle guide for developing, testing, and publishing the Expo React Native app — from first line of code to App Store / Google Play.
++
++## Overview
++
++```
++Phase 1: Environment Setup You are here if starting fresh
++ ↓
++Phase 2: Development & Testing Daily work loop
++ ↓
++Phase 3: Pre-Release Preparation Before your first submission
++ ↓
++Phase 4: Build & Submit Ship to stores
++ ↓
++Phase 5: Post-Launch Maintain and update
++```
++
++---
++
++## Phase 1: Environment Setup
++
++### 1.1 Required Software
++
++| Tool | Purpose | Install |
++|------|---------|---------|
++| **Node.js** (LTS) | JS runtime | `brew install node` or [nodejs.org](https://nodejs.org) |
++| **pnpm** | Package manager | `corepack enable && corepack prepare pnpm@latest --activate` |
++| **Xcode** | iOS build toolchain | Mac App Store (free) |
++| **Xcode Command Line Tools** | Compilers, simulators | `xcode-select --install` |
++| **CocoaPods** | iOS dependency manager | `sudo gem install cocoapods` |
++| **Android Studio** | Android emulator + SDK (optional, iOS-first) | [developer.android.com](https://developer.android.com/studio) |
++| **EAS CLI** | Expo build & submit | `npm install -g eas-cli` |
++| **Expo CLI** | Dev server | Bundled with `npx expo` |
++
++### 1.2 Xcode First-Time Setup
++
++1. Open Xcode at least once to accept the license and install components
++2. **Add your Apple ID** (free account is enough for development):
++ - Xcode → Settings → Accounts → `+` → Apple ID
++ - This creates a "Personal Team" for free code signing
++3. Verify simulators are installed:
++ - Xcode → Settings → Components → download an iOS Simulator runtime
++
++### 1.3 iPhone First-Time Setup (for Real Device Testing)
++
++1. **Enable Developer Mode** (required on iOS 16+):
++ - Settings → Privacy & Security → Developer Mode → ON
++ - Device will restart
++2. Connect iPhone to Mac via USB/USB-C cable
++3. When prompted "Trust This Computer?" → tap Trust
++
++### 1.4 Project Setup
++
++```bash
++# Install dependencies
++pnpm install
++
++# Generate native project files (creates ios/ and android/ directories)
++npx expo prebuild
++
++# Initialize EAS configuration (creates eas.json)
++eas build:configure
++```
++
++### 1.5 Expo Account
++
++```bash
++# Create account at expo.dev, then:
++eas login
++eas whoami # verify
++```
++
++**No paid accounts needed at this stage.** Free Apple ID + free Expo account is enough for development.
++
++---
++
++## Phase 2: Development & Testing
++
++### 2.1 Running on iOS Simulator
++
++```bash
++# Start the app in iOS simulator (no real device needed)
++npx expo run:ios
++```
++
++- Fastest iteration loop — code changes hot-reload instantly
++- Good for: UI layout, navigation, business logic, API calls
++- **Cannot test**: camera, barcode scanner, real push notifications, biometrics
++
++### 2.2 Running on Real iPhone
++
++```bash
++# Connect iPhone via USB, then:
++npx expo run:ios --device
++```
++
++Expo CLI will:
++1. Detect your connected device
++2. Sign the app with your Personal Team (free Apple ID)
++3. Build, install, and launch the app
++
++**First time only**: After installation, go to:
++- Settings → General → VPN & Device Management → Trust your developer certificate
++
++#### Free Signing Limitations
++
++| Limitation | Detail |
++|-----------|--------|
++| 7-day expiry | App stops launching after 7 days — just re-run `npx expo run:ios --device` |
++| 3 devices max | Can register up to 3 test devices per Apple ID |
++| Some entitlements unavailable | Push notifications, Apple Pay, iCloud require paid account |
++| Cannot distribute to others | Only works on your own registered devices |
++
++**Camera, barcode scanner, GPS, sensors all work fine with free signing.**
++
++### 2.3 Daily Development Workflow
++
++```
++First time (or after native config changes):
++ npx expo prebuild Generate/update native projects
++ npx expo run:ios --device Build and install on device
++
++Every day after that:
++ npx expo start --dev-client Start dev server only (no rebuild)
++ → Open the app on device It connects automatically
++ → Edit code, save Hot-reload updates instantly
++```
++
++**When do you need to rebuild?**
++
++| Change | Rebuild needed? |
++|--------|----------------|
++| JS/TS code, React components | No — hot-reload |
++| Styles, images, assets | No — hot-reload |
++| Added new Expo SDK module | **Yes** — `npx expo prebuild && npx expo run:ios --device` |
++| Changed `app.json` permissions | **Yes** — rebuild |
++| Updated native dependency | **Yes** — rebuild |
++| Upgraded Expo SDK version | **Yes** — rebuild |
++
++### 2.4 Testing Native Features (Camera, Scanner)
++
++| Feature | Simulator | Real Device |
++|---------|-----------|-------------|
++| Camera preview | Not available | Works |
++| Barcode / QR scan | Not available | Works |
++| GPS location | Simulated location via Xcode menu | Real GPS |
++| Push notifications | Not available | Requires paid Apple Developer account |
++| Haptic feedback | Not available | Works |
++| Device sensors (accelerometer, gyroscope) | Not available | Works |
++
++For camera/scanner features, **always test on a real device**.
++
++### 2.5 Debugging Tools
++
++#### Developer Menu
++
++Press `m` in the terminal (or shake the device) to open:
++- Toggle Performance Monitor
++- Toggle Element Inspector
++- Open React Native DevTools
++
++#### React Native DevTools
++
++The primary debugging tool (replaced Chrome DevTools since RN 0.76):
++
++| Tab | Use |
++|-----|-----|
++| Console | View logs, execute JS in app context |
++| Sources | Set breakpoints, step through code |
++| Network | Inspect API requests (Expo only) |
++| Components | Inspect React component tree and props |
++| Profiler | Measure render performance |
++
++#### VS Code Integration
++
++Install the **Expo Tools** extension for:
++- Breakpoint debugging directly in VS Code
++- `app.json` / `app.config.ts` IntelliSense
++
++#### Native Crash Debugging
++
++For crashes in native modules (not JS):
++- **iOS**: Open Xcode → Window → Devices and Simulators → View Device Logs
++- **Android**: `adb logcat` in terminal
++
++---
++
++## Phase 3: Pre-Release Preparation
++
++**This is when you need to start spending money.**
++
++### 3.1 Accounts & Fees
++
++| Platform | Cost | Registration Time | Required For |
++|----------|------|-------------------|--------------|
++| **Apple Developer Program** | $99/year | 1-2 days review | App Store distribution |
++| **Google Play Console** | $25 one-time | Days to weeks review | Play Store distribution |
++| **Expo Account** | Free tier sufficient | Instant | EAS Build & Submit |
++
++Register early — account review takes time, especially Google.
++
++### 3.2 App Configuration
++
++Update `app.json` or `app.config.ts`:
++
++```jsonc
++{
++ "name": "Multica",
++ "slug": "multica",
++ "version": "1.0.0",
++ "ios": {
++ "bundleIdentifier": "com.multica.app",
++ "buildNumber": "1", // increment each submission
++ "infoPlist": {
++ "NSCameraUsageDescription": "Used to scan QR codes and take photos",
++ "NSPhotoLibraryUsageDescription": "Used to save scanned images"
++ }
++ },
++ "android": {
++ "package": "com.multica.app",
++ "versionCode": 1, // increment each submission
++ "permissions": ["CAMERA"]
++ },
++ "icon": "./assets/icon.png", // 1024x1024 PNG, no transparency
++ "splash": {
++ "image": "./assets/splash.png"
++ }
++}
++```
++
++### 3.3 EAS Build Profiles
++
++`eas.json`:
++
++```json
++{
++ "cli": { "version": ">= 10.0.0" },
++ "build": {
++ "development": {
++ "developmentClient": true,
++ "distribution": "internal"
++ },
++ "preview": {
++ "distribution": "internal"
++ },
++ "production": {}
++ },
++ "submit": {
++ "production": {}
++ }
++}
++```
++
++### 3.4 App Signing & Credentials
++
++#### iOS
++
++EAS auto-manages credentials (recommended):
++- Distribution Certificate
++- Provisioning Profile
++- Or create manually in [Apple Developer Portal](https://developer.apple.com)
++
++#### Android
++
++- EAS auto-generates Keystore, stored securely on EAS servers
++- **Back up your Keystore** — losing it means you can never update the published app
++- Play Store requires AAB (Android App Bundle) format
++
++### 3.5 Required Assets
++
++| Asset | Spec |
++|-------|------|
++| **App Icon** | 1024x1024 PNG, no alpha/transparency (iOS) |
++| **Splash Screen** | Platform-appropriate sizes |
++| **iOS Screenshots** | 6.7", 6.5", 5.5" iPhone sizes + iPad (if universal) |
++| **Android Screenshots** | 2-8 screenshots |
++
++### 3.6 Required Metadata
++
++#### Both Platforms
++
++| Item | Notes |
++|------|-------|
++| **Privacy Policy URL** | Publicly accessible. Must disclose data collection, third-party sharing, AI usage, deletion rights |
++| **App Description** | Short (≤80 chars for Google) + full description |
++| **Support URL** | Where users can get help |
++| **Account Deletion** | If app has registration, must support in-app account + data deletion |
++
++#### Apple App Store Connect
++
++| Item | Details |
++|------|---------|
++| Privacy Nutrition Labels | Data collection practices per category |
++| App Review Information | Reviewer contact info, demo/test account |
++| Content Rating | Age classification |
++| Export Compliance | Encryption usage declaration |
++| Info.plist Permission Strings | Clear purpose description for each permission |
++
++#### Google Play Console
++
++| Item | Details |
++|------|---------|
++| Data Safety Form | Required even if no data is collected |
++| Content Rating Questionnaire | IARC rating |
++| Target Audience | Must declare if targeting children |
++| First Upload | Must upload AAB manually (Google API limitation) |
++
++---
++
++## Phase 4: Build & Submit
++
++### 4.1 Production Build
++
++```bash
++# iOS
++eas build --platform ios --profile production
++
++# Android
++eas build --platform android --profile production
++
++# Both platforms
++eas build --platform all --profile production
++```
++
++Builds run in Expo cloud — no local Xcode or Android Studio needed for production builds.
++
++### 4.2 Submit to Apple App Store
++
++```bash
++eas submit --platform ios
++```
++
++This uploads the build to **App Store Connect / TestFlight**. Then:
++
++1. Log into [App Store Connect](https://appstoreconnect.apple.com)
++2. Select the uploaded build
++3. Associate it with a version
++4. Fill in all metadata, screenshots, privacy nutrition labels
++5. Submit for App Review
++
++### 4.3 Submit to Google Play Store
++
++```bash
++eas submit --platform android
++```
++
++**First time**: Must upload AAB manually in [Play Console](https://play.google.com/console).
++
++After initial upload:
++1. Navigate to Production → Create new release
++2. Upload AAB or use the EAS-submitted build
++3. Fill in description, screenshots, data safety form
++4. Submit for review
++
++### 4.4 Auto-Submit (Optional)
++
++Build and submit in one step:
++
++```bash
++eas build --platform all --profile production --auto-submit
++```
++
++### 4.5 App Review
++
++| | Apple | Google |
++|---|---|---|
++| Review time | Typically 24-48 hours | Hours to 7 days |
++| Common rejections | Incomplete features, misleading screenshots, missing privacy policy, unclear permission strings | Data safety form mismatch, policy violations |
++| After rejection | Fix issues, resubmit | Fix issues, resubmit |
++
++---
++
++## Phase 5: Post-Launch
++
++### 5.1 OTA Updates (No Re-Review)
++
++For JS/asset-only changes, push updates without going through App Review:
++
++```bash
++eas update --branch production
++```
++
++- Instant delivery to users — no store review
++- Only works for JavaScript and asset changes
++- **Native code changes still require a new build + review**
++
++### 5.2 Version Bumping
++
++For each new store submission:
++- iOS: increment `buildNumber` in `app.json`
++- Android: increment `versionCode` in `app.json`
++- Bump `version` for user-visible version changes
++
++### 5.3 CI/CD Automation
++
++Create `.eas/workflows/build-and-submit.yml` to auto-build and submit on push to main.
++
++#### Google Service Account Key (Automated Android Submissions)
++
++1. EAS dashboard → Credentials → Android
++2. Click Application identifier → Service Credentials
++3. Add Google Service Account Key
++
++---
++
++## Quick Reference
++
++### Common Commands
++
++```bash
++# Development
++npx expo prebuild # Generate native projects
++npx expo run:ios # Run on iOS simulator
++npx expo run:ios --device # Run on connected iPhone
++npx expo start --dev-client # Start dev server (after initial install)
++
++# Building
++eas build --platform ios --profile development # Dev build (for device testing)
++eas build --platform ios --profile production # Production build
++eas build --platform all --profile production # Both platforms
++
++# Submitting
++eas submit --platform ios # Submit to App Store
++eas submit --platform android # Submit to Play Store
++
++# OTA Updates
++eas update --branch production # Push JS update to users
++```
++
++### Cost Summary
++
++| Phase | Cost |
++|-------|------|
++| Development + local testing | **Free** (free Apple ID + Xcode) |
++| EAS cloud builds | Free tier: 30 iOS + 30 Android builds/month |
++| App Store submission | **$99/year** (Apple Developer Program) |
++| Play Store submission | **$25 one-time** (Google Play Console) |
++
++---
++
++## Master Checklist
++
++### Development Phase
++- [ ] Install Node.js, pnpm, Xcode, EAS CLI
++- [ ] Add Apple ID to Xcode (Settings → Accounts)
++- [ ] Enable Developer Mode on iPhone
++- [ ] Run `npx expo prebuild`
++- [ ] Test on simulator: `npx expo run:ios`
++- [ ] Test on real device: `npx expo run:ios --device`
++- [ ] Trust developer certificate on device
++- [ ] Verify camera/scanner functionality on real device
++
++### Pre-Release Phase
++- [ ] Register Apple Developer Program ($99/year)
++- [ ] Register Google Play Console ($25)
++- [ ] Configure `app.json` (bundleIdentifier, permissions, icon, splash)
++- [ ] Configure `eas.json` build profiles
++- [ ] Prepare app icon (1024x1024 PNG)
++- [ ] Prepare splash screen
++- [ ] Take App Store screenshots (all required sizes)
++- [ ] Write and host privacy policy URL
++- [ ] Write app description (short + full)
++- [ ] Set up support URL
++- [ ] Implement in-app account deletion (if registration exists)
++
++### Submission Phase
++- [ ] Run `eas build --platform all --profile production`
++- [ ] iOS: `eas submit --platform ios`
++- [ ] iOS: Fill metadata + privacy labels in App Store Connect
++- [ ] iOS: Submit for App Review
++- [ ] Android: Upload first AAB manually in Play Console
++- [ ] Android: `eas submit --platform android`
++- [ ] Android: Fill data safety form + metadata in Play Console
++- [ ] Android: Submit for review
++- [ ] Wait for review approval → app goes live
++
++### Post-Launch Phase
++- [ ] Set up `eas update` for OTA updates
++- [ ] Set up CI/CD workflow (optional)
++- [ ] Configure Google Service Account Key for automated Android submissions (optional)
++
++---
++
++## References
++
++- [Expo: Getting Started](https://docs.expo.dev/get-started/introduction/)
++- [Expo: Development Builds](https://docs.expo.dev/develop/development-builds/introduction/)
++- [Expo: Local App Development](https://docs.expo.dev/guides/local-app-development/)
++- [Expo: Debugging Tools](https://docs.expo.dev/debugging/tools/)
++- [Expo: Submit to App Stores](https://docs.expo.dev/deploy/submit-to-app-stores/)
++- [Expo: EAS Submit](https://docs.expo.dev/submit/introduction/)
++- [Expo: EAS Update](https://docs.expo.dev/eas-update/introduction/)
++- [Apple App Review Guidelines](https://developer.apple.com/app-store/review/guidelines/)
++- [Apple App Privacy Details](https://developer.apple.com/app-store/app-privacy-details/)
++- [Google Play Data Safety](https://support.google.com/googleplay/android-developer/answer/10787469)
++- [Google Play Developer Policy Center](https://play.google/developer-content-policy/)
diff --cc package.json
index e5d4d86356,ec334f55ea..72b0a54f89
--- a/package.json
+++ b/package.json
@@@ -60,8 -60,8 +60,9 @@@
"@nestjs/serve-static": "^5.0.4",
"@nestjs/websockets": "^11.1.12",
"@sinclair/typebox": "^0.34.41",
+ "croner": "^10.0.1",
"fast-glob": "^3.3.3",
+ "grammy": "^1.39.3",
"json5": "^2.2.3",
"linkedom": "^0.18.12",
"nestjs-pino": "^4.5.0",
diff --cc src/agent/async-agent.ts
index 29ad163161,0f7f7d8840..1490f09428
--- a/src/agent/async-agent.ts
+++ b/src/agent/async-agent.ts
@@@ -37,12 -49,8 +49,13 @@@ export class AsyncAgent
/** Write message to agent (non-blocking, serialized queue) */
write(content: string): void {
+ this.enqueue(() => this.agent.run(content));
+ }
+
+ /** Enqueue an agent run, handling errors and session flush */
+ private enqueue(runFn: () => ReturnType<Agent["run"]>): void {
if (this._closed) throw new Error("Agent is closed");
+ this.pendingWrites += 1;
this.queue = this.queue
.then(async () => {
@@@ -60,9 -66,48 +73,50 @@@
})
.catch((err) => {
const message = err instanceof Error ? err.message : String(err);
+ console.error(`[AsyncAgent] Agent run exception: ${message}`);
this.channel.send({ id: uuidv7(), content: `[error] ${message}` });
+ this.agent.emitMulticaEvent({ type: "agent_error", error: message });
+ })
+ .finally(() => {
+ this.pendingWrites = Math.max(0, this.pendingWrites - 1);
+ });
+ }
+
+ /**
+ * Write an internal message to agent (non-blocking, serialized queue).
+ * Messages are persisted with `internal: true` and rolled back from
+ * in-memory state. Events are suppressed from the real-time stream by default.
+ */
+ writeInternal(content: string, options?: WriteInternalOptions): void {
+ if (this._closed) throw new Error("Agent is closed");
+ const forwardAssistant = options?.forwardAssistant === true;
+ const persistResponse = options?.persistResponse === true;
+
+ this.queue = this.queue
+ .then(async () => {
+ if (this._closed) return;
+ const prevForward = this.forwardInternalAssistant;
+ this.forwardInternalAssistant = forwardAssistant;
+ try {
+ const result = await this.agent.runInternal(content);
+ await this.agent.flushSession();
+ if (result.error) {
+ // Internal run errors are for diagnostics only; do not leak to user stream.
+ console.error(`[AsyncAgent] Internal run error: ${result.error}`);
+ }
+ // Persist the LLM summary so it remains in parent context for future turns
+ if (persistResponse && result.text?.trim() && result.text.trim() !== "NO_REPLY") {
+ this.agent.persistAssistantSummary(result.text.trim());
+ await this.agent.flushSession();
+ }
+ } finally {
+ this.forwardInternalAssistant = prevForward;
+ }
+ })
+ .catch((err) => {
+ const message = err instanceof Error ? err.message : String(err);
+ // Internal run exceptions are for diagnostics only; do not leak to user stream.
+ console.error(`[AsyncAgent] Internal run failed: ${message}`);
});
}
diff --cc src/hub/hub.ts
index 71f2212789,9d173dbf08..ef6192285c
--- a/src/hub/hub.ts
+++ b/src/hub/hub.ts
@@@ -30,7 -33,20 +33,21 @@@ import { evaluateCommandSafety, require
import { addAllowlistEntry, recordAllowlistUse, matchAllowlist } from "../agent/tools/exec-allowlist.js";
import type { ExecApprovalCallback, ExecApprovalConfig, ApprovalResult, ExecApprovalRequest } from "../agent/tools/exec-approval-types.js";
import { readProfileConfig, writeProfileConfig } from "../agent/profile/storage.js";
+import { ChannelManager, initChannels } from "../channels/index.js";
+ import { getCronService, shutdownCronService, executeCronJob } from "../cron/index.js";
+ import {
+ getLastHeartbeatEvent,
+ onHeartbeatEvent,
+ requestHeartbeatNow,
+ runHeartbeatOnce,
+ setHeartbeatsEnabled,
+ startHeartbeatRunner,
+ type HeartbeatEventPayload,
+ type HeartbeatRunResult,
+ type HeartbeatRunner,
+ } from "../heartbeat/index.js";
+ import { enqueueSystemEvent } from "../heartbeat/system-events.js";
+ import { isHeartbeatAckEvent } from "./heartbeat-filter.js";
export class Hub {
private readonly agents = new Map<string, AsyncAgent>();
@@@ -105,19 -132,44 +134,55 @@@
this.client = this.createClient(this.url);
this.client.connect();
this.restoreAgents();
+
+ // Initialize channel plugin system
+ console.log("[Hub] Initializing channel system...");
+ initChannels();
+ this.channelManager = new ChannelManager(this);
+ void this.channelManager.startAll().then(() => {
+ console.log("[Hub] Channel system started");
+ }).catch((err) => {
+ const msg = err instanceof Error ? err.message : String(err);
+ console.error(`[Hub] Channel system failed to start: ${msg}`);
+ });
}
+ /** Initialize cron service with executor */
+ private initCronService(): void {
+ const cronService = getCronService();
+ cronService.setExecutor(executeCronJob);
+ cronService.start().catch((err) => {
+ console.error("[Hub] Failed to start cron service:", err);
+ });
+ console.log("[Hub] Cron service initialized");
+ }
+
+ /** Initialize heartbeat runner + event fanout. */
+ private initHeartbeatService(): void {
+ this.heartbeatRunner = startHeartbeatRunner({
+ getAgent: () => this.getDefaultAgent(),
+ logger: console,
+ });
+
+ this.heartbeatUnsubscribe = onHeartbeatEvent((event) => {
+ for (const listener of this.heartbeatListeners) {
+ try {
+ listener(event);
+ } catch {
+ // Keep fanout resilient against listener errors.
+ }
+ }
+ });
+
+ console.log("[Hub] Heartbeat service initialized");
+ }
+
+ private getDefaultAgent(): AsyncAgent | null {
+ const first = this.listAgents()[0];
+ if (!first) return null;
+ return this.getAgent(first) ?? null;
+ }
+
/** Restore agents from persistent storage */
private restoreAgents(): void {
const records = loadAgentRecords();
@@@ -327,12 -387,26 +401,26 @@@
content: item.content,
});
} else {
+ const suppressForAgent = this.suppressedStreamAgents.has(agent.sessionId);
+
+ // Suppress all user-visible stream events during silent heartbeat runs.
+ if (suppressForAgent) {
+ if (item.type === "message_start") {
+ this.beginStream(agent.sessionId, item);
+ } else if (item.type === "message_end") {
+ const streamId = this.getActiveStreamId(agent.sessionId, item);
+ this.pendingAssistantStarts.delete(streamId);
+ this.endStream(agent.sessionId);
+ }
+ continue;
+ }
+
- // Compaction events: forward with synthetic streamId (no stream tracking)
- const isCompactionEvent =
- item.type === "compaction_start" || item.type === "compaction_end";
- if (isCompactionEvent) {
+ // Passthrough events: forward with synthetic streamId (no stream tracking)
+ const isPassthroughEvent =
+ item.type === "compaction_start" || item.type === "compaction_end" || item.type === "agent_error";
+ if (isPassthroughEvent) {
this.client.send(targetDeviceId, StreamAction, {
- streamId: `compaction:${agent.sessionId}`,
+ streamId: `system:${agent.sessionId}`,
agentId: agent.sessionId,
event: item,
});
@@@ -522,9 -693,14 +707,17 @@@
}
shutdown(): void {
+ // Stop all channel connections
+ this.channelManager.stopAll();
+
+ // Stop cron service
+ shutdownCronService();
+ this.heartbeatRunner?.stop();
+ this.heartbeatRunner = null;
+ this.heartbeatUnsubscribe?.();
+ this.heartbeatUnsubscribe = null;
+ this.heartbeatListeners.clear();
+
// Finalize subagent registry before closing agents
shutdownSubagentRegistry();
diff --cc ~/.super-multica/channels.json5
index 0000000000,0000000000..e69de29bb2
new file mode 100644
--- /dev/null
+++ b/~/.super-multica/channels.json5