@delt/claude-alarm 0.9.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/dist/channel/server.js +41 -22
- package/dist/channel/server.js.map +1 -1
- package/dist/cli.js +460 -145
- package/dist/cli.js.map +1 -1
- package/dist/codex/main.js +774 -0
- package/dist/codex/main.js.map +1 -0
- package/dist/dashboard/index.html +44 -37
- package/dist/hub/server.js +292 -93
- package/dist/hub/server.js.map +1 -1
- package/dist/index.d.ts +28 -2
- package/dist/index.js +338 -120
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/dashboard/index.html +44 -37
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Session status */
|
|
2
2
|
type SessionStatus = 'idle' | 'working' | 'waiting_input';
|
|
3
|
+
type AgentKind = 'claude' | 'codex';
|
|
4
|
+
type MessageSource = 'dashboard' | 'telegram' | 'api';
|
|
3
5
|
/** Session info tracked by the hub */
|
|
4
6
|
interface SessionInfo {
|
|
5
7
|
id: string;
|
|
@@ -12,6 +14,8 @@ interface SessionInfo {
|
|
|
12
14
|
channelEnabled?: boolean;
|
|
13
15
|
isLocal?: boolean;
|
|
14
16
|
peerName?: string;
|
|
17
|
+
agentKind?: AgentKind;
|
|
18
|
+
title?: string;
|
|
15
19
|
}
|
|
16
20
|
/** Messages sent between channel server and hub */
|
|
17
21
|
type ChannelMessage = {
|
|
@@ -39,6 +43,7 @@ type ChannelMessage = {
|
|
|
39
43
|
type: 'message_to_session';
|
|
40
44
|
sessionId: string;
|
|
41
45
|
content: string;
|
|
46
|
+
source?: MessageSource;
|
|
42
47
|
} | {
|
|
43
48
|
type: 'image_upload';
|
|
44
49
|
sessionId: string;
|
|
@@ -107,6 +112,11 @@ interface TelegramConfig {
|
|
|
107
112
|
chatId: string;
|
|
108
113
|
enabled: boolean;
|
|
109
114
|
}
|
|
115
|
+
/** Codex adapter configuration */
|
|
116
|
+
interface CodexConfig {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
command?: string;
|
|
119
|
+
}
|
|
110
120
|
/** App configuration stored in ~/.claude-alarm/config.json */
|
|
111
121
|
interface AppConfig {
|
|
112
122
|
hub: {
|
|
@@ -120,6 +130,7 @@ interface AppConfig {
|
|
|
120
130
|
};
|
|
121
131
|
webhooks: WebhookConfig[];
|
|
122
132
|
telegram?: TelegramConfig;
|
|
133
|
+
codex?: CodexConfig;
|
|
123
134
|
}
|
|
124
135
|
/** Hub status response */
|
|
125
136
|
interface HubStatus {
|
|
@@ -143,14 +154,18 @@ declare class HubServer {
|
|
|
143
154
|
private telegramBot?;
|
|
144
155
|
private heartbeatInterval?;
|
|
145
156
|
private channelAlive;
|
|
157
|
+
private socketOwners;
|
|
146
158
|
private host;
|
|
147
159
|
private port;
|
|
148
160
|
private token?;
|
|
161
|
+
private codexEnabled;
|
|
162
|
+
private codexSupervisor?;
|
|
149
163
|
constructor(config?: Partial<AppConfig>);
|
|
150
164
|
start(): Promise<void>;
|
|
151
165
|
stop(): Promise<void>;
|
|
152
166
|
private handleHttp;
|
|
153
167
|
private serveDashboard;
|
|
168
|
+
private handleLogin;
|
|
154
169
|
private handleApiSend;
|
|
155
170
|
private handleApiNotify;
|
|
156
171
|
private handleChannelConnection;
|
|
@@ -163,10 +178,13 @@ declare class HubServer {
|
|
|
163
178
|
private handleTelegramSave;
|
|
164
179
|
private handleTelegramTest;
|
|
165
180
|
private handleTelegramDetect;
|
|
181
|
+
private startCodexAdapter;
|
|
166
182
|
private startHeartbeat;
|
|
167
183
|
private cleanupUploads;
|
|
168
184
|
private getSessionLabel;
|
|
169
185
|
private jsonResponse;
|
|
186
|
+
private authorized;
|
|
187
|
+
private rejectUpgrade;
|
|
170
188
|
private isLocalRequest;
|
|
171
189
|
private readBody;
|
|
172
190
|
}
|
|
@@ -178,16 +196,20 @@ declare class HubClient {
|
|
|
178
196
|
private hubPort;
|
|
179
197
|
private token?;
|
|
180
198
|
private getPeerName;
|
|
199
|
+
private getRegistration;
|
|
181
200
|
private ws;
|
|
182
201
|
private reconnectTimer;
|
|
183
202
|
private messageHandlers;
|
|
184
203
|
private queue;
|
|
185
204
|
private connected;
|
|
186
|
-
|
|
205
|
+
private closed;
|
|
206
|
+
constructor(sessionId: string, sessionName: string, hubHost?: string, hubPort?: number, token?: string | undefined, getPeerName?: () => string | undefined, getRegistration?: () => Partial<SessionInfo>);
|
|
187
207
|
connect(): void;
|
|
188
208
|
send(msg: ChannelMessage): void;
|
|
189
209
|
onMessage(handler: (msg: ChannelMessage) => void): void;
|
|
190
210
|
disconnect(): void;
|
|
211
|
+
reregister(): void;
|
|
212
|
+
private registration;
|
|
191
213
|
private scheduleReconnect;
|
|
192
214
|
}
|
|
193
215
|
|
|
@@ -201,6 +223,7 @@ declare class SessionManager {
|
|
|
201
223
|
get(sessionId: string): SessionInfo | undefined;
|
|
202
224
|
getAll(): SessionInfo[];
|
|
203
225
|
count(): number;
|
|
226
|
+
private baseName;
|
|
204
227
|
}
|
|
205
228
|
|
|
206
229
|
declare class TelegramBot {
|
|
@@ -230,6 +253,7 @@ declare class TelegramBot {
|
|
|
230
253
|
private deliverToSession;
|
|
231
254
|
private deliverPhotoToSession;
|
|
232
255
|
private deliverPhotoToSessionByFileId;
|
|
256
|
+
private pendingSession;
|
|
233
257
|
private getLabel;
|
|
234
258
|
/** Send a permission request with inline buttons */
|
|
235
259
|
sendPermissionRequest(sessionId: string, sessionLabel: string, requestId: string, toolName: string, description: string, inputPreview: string): Promise<void>;
|
|
@@ -292,9 +316,11 @@ declare const CONFIG_FILE: string;
|
|
|
292
316
|
declare const PID_FILE: string;
|
|
293
317
|
declare const LOG_FILE: string;
|
|
294
318
|
declare const UPLOADS_DIR: string;
|
|
319
|
+
declare const CODEX_PID_FILE: string;
|
|
320
|
+
declare const CODEX_LOG_FILE: string;
|
|
295
321
|
declare const WS_PATH_CHANNEL = "/ws/channel";
|
|
296
322
|
declare const WS_PATH_DASHBOARD = "/ws/dashboard";
|
|
297
323
|
declare const CHANNEL_SERVER_NAME = "claude-alarm";
|
|
298
324
|
declare const CHANNEL_SERVER_VERSION = "0.1.0";
|
|
299
325
|
|
|
300
|
-
export { type AppConfig, CHANNEL_SERVER_NAME, CHANNEL_SERVER_VERSION, CONFIG_DIR, CONFIG_FILE, type ChannelMessage, DEFAULT_HUB_HOST, DEFAULT_HUB_PORT, HubClient, HubServer, type HubStatus, LOG_FILE, Notifier, type NotifyLevel, PID_FILE, type SessionInfo, SessionManager, type SessionStatus, type TelegramConfig, UPLOADS_DIR, WS_PATH_CHANNEL, WS_PATH_DASHBOARD, type WebhookConfig, loadConfig, logger, saveConfig, setupMcpConfig };
|
|
326
|
+
export { type AgentKind, type AppConfig, CHANNEL_SERVER_NAME, CHANNEL_SERVER_VERSION, CODEX_LOG_FILE, CODEX_PID_FILE, CONFIG_DIR, CONFIG_FILE, type ChannelMessage, type CodexConfig, DEFAULT_HUB_HOST, DEFAULT_HUB_PORT, HubClient, HubServer, type HubStatus, LOG_FILE, type MessageSource, Notifier, type NotifyLevel, PID_FILE, type SessionInfo, SessionManager, type SessionStatus, type TelegramConfig, UPLOADS_DIR, WS_PATH_CHANNEL, WS_PATH_DASHBOARD, type WebhookConfig, loadConfig, logger, saveConfig, setupMcpConfig };
|