-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChittyChat.app.js
More file actions
132 lines (110 loc) · 3.59 KB
/
ChittyChat.app.js
File metadata and controls
132 lines (110 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/usr/bin/env node
/**
* ChittyChat Native macOS Application Entry Point
* Integrates with ChittyOS Standard Framework for native deployment
*/
import { ChittyChatUniversalApp } from './src/native/ChittyChatApp.js';
import { ChittyOSFramework } from '@chittyos/standard-installer';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
class ChittyChatNativeApp {
constructor() {
this.appName = 'ChittyChat';
this.appVersion = '1.0.0';
this.appDirectory = __dirname;
this.framework = new ChittyOSFramework({
appName: this.appName,
appPath: this.appDirectory,
enableNativeIntegration: true,
enableMenuBar: true,
enableSystemTray: true
});
}
async initialize() {
console.log(`🚀 Initializing ${this.appName} v${this.appVersion}`);
// Register with ChittyOS ecosystem
await this.framework.registerApp({
name: this.appName,
type: 'ai-coordination',
capabilities: [
'notion-sync',
'ai-agents',
'multi-tenant',
'database-branching',
'vector-search'
],
endpoints: {
ai: 'agents.chitty.cc',
unified: 'unified.chitty.cc',
local: 'localhost:3006'
}
});
// Setup native macOS integration
await this.setupNativeIntegration();
// Initialize services
await this.initializeServices();
console.log('✅ ChittyChat Native App initialized successfully');
}
async setupNativeIntegration() {
// Create native application bundle structure
await this.framework.createAppBundle({
bundleIdentifier: 'cc.chitty.chittychat',
displayName: 'ChittyChat AI Coordination',
iconPath: './assets/chittychat-icon.icns',
category: 'productivity'
});
// Setup menu bar integration
await this.framework.setupMenuBar({
title: 'ChittyChat',
icon: './assets/menubar-icon.png',
menu: [
{ label: 'Open Dashboard', action: 'openDashboard' },
{ label: 'AI Agents', action: 'openAgents' },
{ label: 'Notion Sync', action: 'openNotionSync' },
{ type: 'separator' },
{ label: 'Settings', action: 'openSettings' },
{ label: 'Quit', action: 'quit' }
]
});
// Setup system tray
await this.framework.setupSystemTray({
icon: './assets/tray-icon.png',
tooltip: 'ChittyChat AI Coordination'
});
}
async initializeServices() {
const app = new ChittyChatUniversalApp({
mode: 'native',
dataPath: this.framework.getDataPath(),
configPath: this.framework.getConfigPath(),
logPath: this.framework.getLogPath()
});
await app.initialize();
// Register native handlers
this.framework.on('openDashboard', () => app.openDashboard());
this.framework.on('openAgents', () => app.openAgentsPanel());
this.framework.on('openNotionSync', () => app.openNotionSync());
this.framework.on('openSettings', () => app.openSettings());
return app;
}
async start() {
try {
await this.initialize();
// Start the native application
await this.framework.start();
console.log('🎯 ChittyChat Native App is running');
console.log('📱 Access via menu bar or system tray');
} catch (error) {
console.error('❌ Failed to start ChittyChat Native App:', error);
process.exit(1);
}
}
}
// Start the native application
if (import.meta.url === `file://${process.argv[1]}`) {
const app = new ChittyChatNativeApp();
app.start();
}
export default ChittyChatNativeApp;