- Chat mode: AIUI loads in sandboxed iframe at /dashboard/chat with transparent bg - Mode switcher: Easy + Pro tabs only, Chat is a launcher button - Keyboard shortcuts: Cmd+1 (Easy), Cmd+2 (Pro), Cmd+3 (Chat), Cmd+M (cycle) - Directional transitions: chat slides from/to left, dashboard from/to right - Context broker: postMessage protocol for quarantined AIUI communication - AI permissions store: user-controlled toggles for data access categories - Settings UI: AI Data Access section with per-category toggles - AIUI container manifest and nginx proxy config for /aiui/ - Deploy script builds AIUI with /aiui/ base path - Overnight loop infrastructure (loop.sh, prepare.sh, plan.md, prompt.md) - Security hooks for autonomous overnight runs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9.6 KiB
Overnight Plan — AIUI ↔ Archy Full Integration
Format:
- [ ]= pending,- [x]= done. Make at least 30 attempts on any difficult task before moving on. Loop reads this file. Coordination: A separate AIUI agent handles AIUI-side changes. This plan covers Archy-side only.
Phase 1: Expand Protocol & Context Categories
The current protocol only has 5 categories (apps, system, network, wallet, files). We need to add media, search, and local AI categories so AIUI can access the node's full capabilities.
-
T1 — Expand
aiui-protocol.tswith new context categories. Add toAIContextCategorytype:'media'(local media libraries — films, songs, podcasts from Plex/Jellyfin/Navidrome),'search'(SearXNG metasearch on the node),'ai-local'(Ollama local LLM info — available models, status),'notes'(user notes/documents),'bitcoin'(Bitcoin Core chain info — block height, sync status, mempool). Add corresponding request/response types. Keep the existing 5 categories unchanged. -
T2 — Expand
aiPermissions.tswith new categories. Add entries toAI_PERMISSION_CATEGORIESfor each new category with user-friendly descriptions: media ("Local media libraries — film, music, podcast titles and metadata, no file paths"), search ("Web search via your private SearXNG instance"), ai-local ("Local AI models via Ollama — model names and availability"), notes ("Document and note titles — no contents"), bitcoin ("Bitcoin node status — block height, sync progress, mempool stats, no wallet keys"). All default OFF. -
T3 — Update
Settings.vueAI Data Access section. Add toggle rows for all new categories with appropriate SVG icons. Follow the existing pattern exactly — icon, label, description, toggle switch. Group them logically: Node Data (apps, system, network, bitcoin), Media & Files (media, files, notes), AI & Search (search, ai-local), Financial (wallet). -
TEST:P1 — Run
cd neode-ui && npm run type-check && npm run build. Fix all errors. Deploy:./scripts/deploy-to-target.sh --live.
Phase 2: Wire Real Data into ContextBroker
Currently wallet and files return placeholders. Wire up real data from stores and RPC for all categories.
-
T4 — Wire
appscategory with full data. Currently returns basic app list. Enhance to include: app version, health status, port/URL for launching, whether app has a web UI. Read fromuseAppStore().packagesanduseContainerStore(). Sanitize: strip internal IPs (replace with relative paths like/apps/btcpay-server/), strip env vars, strip volume paths. -
T5 — Wire
systemcategory with real metrics. Fetch fromrpcClient.call('server.metrics')andrpcClient.call('server.time'). Return: CPU usage %, RAM used/total, disk used/total, uptime, OS version. Sanitize: strip hostname, kernel version details, internal IPs. -
T6 — Wire
networkcategory with real data. Fetch peer count fromrpcClient.call('node-list-peers'). Return: peer count, Tor status (connected/not, but NOT the .onion address), whether Tailscale is active. Sanitize: strip all IPs, onion addresses, pubkeys. -
T7 — Wire
bitcoincategory (NEW). Fetch from Bitcoin Core RPC if the bitcoin-core package is installed and running. CheckuseAppStore().packagesfor bitcoin-core status. If running, call the backend RPC to get: block height, sync progress %, mempool size, network (mainnet/testnet). If not installed/stopped, return{ available: false, message: 'Bitcoin Core not running' }. Sanitize: no peer IPs, no wallet data. -
T8 — Wire
mediacategory (NEW). This is the content handshake. Check which media apps are installed (Plex, Jellyfin, Navidrome, Nextcloud). For each running media app, query its API through the backend to get library summaries: film count + recent titles, song/album count + recent, podcast count. Return a structured object:{ libraries: [{ source: 'plex', type: 'film', count: N, recent: [{title, year}] }] }. If no media apps installed, return{ available: false, libraries: [], message: 'No media apps installed. Install Plex or Jellyfin from the App Store.' }. Sanitize: no file paths, no internal URLs. -
T9 — Wire
filescategory with real data. If Nextcloud or the built-in file manager is available, list top-level folders and recent files (name + type + size, no contents). If Cloud storage route exists in the app, pull from that store. Return:{ folders: [{name, itemCount}], recentFiles: [{name, type, size, modified}] }. Sanitize: no absolute paths, no file contents. -
T10 — Wire
searchcategory (NEW). Check if SearXNG is installed and running. If yes, return{ available: true, engine: 'searxng', endpoint: '/apps/searxng/' }so AIUI knows it can proxy web searches through the node. If not, return{ available: false }. This tells AIUI whether to use its own search or the node's private search. -
T11 — Wire
ai-localcategory (NEW). Check if Ollama is installed and running. If yes, query for available models (model names, sizes, quantization). Return:{ available: true, models: [{name, size, quantization}] }. If not, return{ available: false }. This lets AIUI offer local AI as a provider option. -
T12 — Wire
walletcategory with real data. If LND is installed and running, fetch basic wallet info through backend RPC: confirmed balance (sats), channel count, total inbound/outbound capacity. If not running, return{ available: false }. Sanitize: NO private keys, NO seed phrases, NO channel IDs, NO peer pubkeys. Only aggregate numbers. -
T13 — Wire
notescategory (NEW). Check if any note-taking or document apps are installed (OnlyOffice, or built-in notes if they exist). List document titles and types (PDF, doc, note). No contents. Return:{ documents: [{title, type, modified}] }. If no note apps, return{ available: false }. -
TEST:P2 — Run
cd neode-ui && npm run type-check && npm run build. Fix all errors. Deploy:./scripts/deploy-to-target.sh --live. SSH to server and verify the deployed build loads.
Phase 3: Action Handlers
Expand the ContextBroker's action handling so AIUI can trigger real operations.
-
T14 — Add
launch-appaction. When AIUI requestsaction:requestwithaction: 'launch-app', return the app's web UI URL so AIUI can tell the user where to go (or Archy can open it). Validate appId exists and is running. -
T15 — Add
search-webaction. When AIUI requests a web search action, proxy it through SearXNG if available. Accept{ action: 'search-web', params: { query: '...' } }, call SearXNG API, return results. This lets AIUI do private web search through the node instead of external services. -
T16 — Add
install-appaction enhancement. The existing install action is basic. Enhance: validate app exists in marketplace, check if already installed, return progress status. Handle errors gracefully. -
TEST:P3 — Type-check, build, deploy. Verify on live server.
Phase 4: End-to-End Testing
Test the full integration by verifying the postMessage protocol works correctly between Archy and the deployed AIUI iframe.
-
T17 — Create integration test script. Write a test page or script that: loads the Chat view, verifies iframe loads AIUI, sends test context requests for each category, verifies responses come back with correct structure. Can be a simple HTML page at
/test-aiui.htmlor a Vue component at/dashboard/test-aiui. Log results to console. -
T18 — Test each context category end-to-end. For each of the 10 categories: enable permission in Settings, open Chat, verify AIUI receives the permission update, trigger a context request, verify data comes back. Document which categories return real data vs. placeholders (depends on what apps are installed on the server).
-
T19 — Test action handlers. Test
navigate,open-app,launch-app,search-webactions from within the AIUI iframe. Verify Archy responds correctly and performs the action. -
T20 — Test permission denial. Disable all permissions, open Chat, verify AIUI receives empty permissions list. Verify context requests return
{ permitted: false }. Verify AIUI handles this gracefully (should show "Enable X access in Settings" messages). -
TEST:P4 — Final build, deploy, verify all tests pass on live server.
Phase 5: UX Polish & Deploy
-
T21 — Add loading state to Chat.vue iframe. Show a glass-card loading indicator while AIUI iframe is loading. Listen for the
readypostMessage from AIUI to know when it's loaded, then hide the loader. Use existing glass styling. -
T22 — Add connection status indicator. Small pill/dot in the Chat close button area showing whether the ContextBroker has an active connection to AIUI (received
readymessage). Green dot = connected, no dot = loading. -
T23 — Final deploy and smoke test. Clean build both AIUI and Archy. Deploy both. Hard refresh on 192.168.1.228. Test: login → open chat → 3 panels animate in → close → panels animate out → dashboard returns. Verify all permissions toggles work in Settings. Verify Cmd+3 opens chat, Cmd+1/2 returns to dashboard.
-
TEST:FINAL — Run
cd neode-ui && npm run type-check && npm run build. Deploy with./scripts/deploy-to-target.sh --live. Also rebuild and deploy AIUI:cd /Users/dorian/Projects/AIUI && rm -rf .turbo packages/app/.turbo packages/core/.turbo packages/app/dist packages/core/dist && VITE_BASE_PATH=/aiui/ pnpm buildthensshpass -p 'EwPDR8q45l0Upx@' scp -o StrictHostKeyChecking=no -r /Users/dorian/Projects/AIUI/packages/app/dist/* archipelago@192.168.1.228:/opt/archipelago/aiui/. Verify at http://192.168.1.228.