feat: AIUI chat mode integration with iframe, context broker, overnight loop
- 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>
This commit is contained in:
87
neode-ui/src/types/aiui-protocol.ts
Normal file
87
neode-ui/src/types/aiui-protocol.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* AIUI ↔ Archy postMessage Protocol
|
||||
*
|
||||
* AIUI (iframe) communicates with Archy (host) via structured messages.
|
||||
* Archy acts as a context broker — AIUI never directly accesses node data.
|
||||
*/
|
||||
|
||||
/** Data categories that AIUI can request access to */
|
||||
export type AIContextCategory = 'apps' | 'system' | 'network' | 'wallet' | 'files'
|
||||
|
||||
/** Actions AIUI can request Archy to perform */
|
||||
export type AIActionType = 'install-app' | 'open-app' | 'navigate'
|
||||
|
||||
// ─── AIUI → Archy (Requests) ───────────────────────────────────────────────
|
||||
|
||||
export interface AIUIContextRequest {
|
||||
type: 'context:request'
|
||||
id: string
|
||||
category: AIContextCategory
|
||||
query?: string
|
||||
}
|
||||
|
||||
export interface AIUIActionRequest {
|
||||
type: 'action:request'
|
||||
id: string
|
||||
action: AIActionType
|
||||
params: Record<string, string>
|
||||
}
|
||||
|
||||
export interface AIUIReadyMessage {
|
||||
type: 'ready'
|
||||
}
|
||||
|
||||
export interface AIUIThemeRequest {
|
||||
type: 'theme:request'
|
||||
}
|
||||
|
||||
export type AIUIRequest =
|
||||
| AIUIContextRequest
|
||||
| AIUIActionRequest
|
||||
| AIUIReadyMessage
|
||||
| AIUIThemeRequest
|
||||
|
||||
// ─── Archy → AIUI (Responses) ──────────────────────────────────────────────
|
||||
|
||||
export interface ArchyContextResponse {
|
||||
type: 'context:response'
|
||||
id: string
|
||||
data: unknown
|
||||
permitted: boolean
|
||||
}
|
||||
|
||||
export interface ArchyActionResponse {
|
||||
type: 'action:response'
|
||||
id: string
|
||||
success: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface ArchyThemeResponse {
|
||||
type: 'theme:response'
|
||||
theme: {
|
||||
accent: string
|
||||
mode: 'dark'
|
||||
}
|
||||
}
|
||||
|
||||
export interface ArchyPermissionsUpdate {
|
||||
type: 'permissions:update'
|
||||
categories: AIContextCategory[]
|
||||
}
|
||||
|
||||
export type ArchyResponse =
|
||||
| ArchyContextResponse
|
||||
| ArchyActionResponse
|
||||
| ArchyThemeResponse
|
||||
| ArchyPermissionsUpdate
|
||||
|
||||
// ─── All messages ───────────────────────────────────────────────────────────
|
||||
|
||||
export type AIUIMessage = AIUIRequest | ArchyResponse
|
||||
|
||||
/** Protocol version for compatibility checks */
|
||||
export const AIUI_PROTOCOL_VERSION = '1.0.0'
|
||||
|
||||
/** Message origin prefix used for validation */
|
||||
export const AIUI_MESSAGE_PREFIX = 'aiui:'
|
||||
Reference in New Issue
Block a user