///
declare namespace NodeJS {
interface ProcessEnv {
/**
* The built directory structure
*
* ```tree
* ├─┬─┬ dist
* │ │ └── index.html
* │ │
* │ ├─┬ dist-electron
* │ │ ├── main.js
* │ │ └── preload.js
* │
* ```
*/
APP_ROOT: string
/** /dist/ or /public/ */
VITE_PUBLIC: string
}
}
// ============================================================================
// ElectronAPI type definitions
// ============================================================================
interface HubStatus {
hubId: string
status: string
agentCount: number
gatewayConnected: boolean
gatewayUrl?: string
defaultAgent?: {
agentId: string
status: string
} | null
}
interface AgentInfo {
agentId: string
status: string
}
interface ToolInfo {
name: string
group: string
enabled: boolean
}
interface SkillInfo {
id: string
name: string
description: string
version: string
enabled: boolean
source: 'bundled' | 'global' | 'profile'
triggers: string[]
}
interface SkillAddResult {
ok: boolean
message: string
path?: string
skills?: string[]
}
interface ElectronAPI {
hub: {
init: () => Promise
getStatus: () => Promise
getAgentInfo: () => Promise
info: () => Promise
reconnect: (url: string) => Promise
listAgents: () => Promise
createAgent: (id?: string) => Promise
getAgent: (id: string) => Promise
closeAgent: (id: string) => Promise
sendMessage: (agentId: string, content: string) => Promise
}
tools: {
list: () => Promise
toggle: (name: string) => Promise
setStatus: (name: string, enabled: boolean) => Promise
active: () => Promise
reload: () => Promise
}
skills: {
list: () => Promise
get: (id: string) => Promise
toggle: (id: string) => Promise
setStatus: (id: string, enabled: boolean) => Promise
reload: () => Promise
add: (source: string, options?: { name?: string; force?: boolean }) => Promise
remove: (name: string) => Promise
}
agent: {
status: () => Promise
}
}
// Used in Renderer process, expose in `preload.ts`
interface Window {
ipcRenderer: import('electron').IpcRenderer
electronAPI: ElectronAPI
}