@delt/claude-alarm 0.9.1 → 1.0.1

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/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 {
@@ -147,6 +158,8 @@ declare class HubServer {
147
158
  private host;
148
159
  private port;
149
160
  private token?;
161
+ private codexEnabled;
162
+ private codexSupervisor?;
150
163
  constructor(config?: Partial<AppConfig>);
151
164
  start(): Promise<void>;
152
165
  stop(): Promise<void>;
@@ -165,6 +178,7 @@ declare class HubServer {
165
178
  private handleTelegramSave;
166
179
  private handleTelegramTest;
167
180
  private handleTelegramDetect;
181
+ private startCodexAdapter;
168
182
  private startHeartbeat;
169
183
  private cleanupUploads;
170
184
  private getSessionLabel;
@@ -182,16 +196,20 @@ declare class HubClient {
182
196
  private hubPort;
183
197
  private token?;
184
198
  private getPeerName;
199
+ private getRegistration;
185
200
  private ws;
186
201
  private reconnectTimer;
187
202
  private messageHandlers;
188
203
  private queue;
189
204
  private connected;
190
- constructor(sessionId: string, sessionName: string, hubHost?: string, hubPort?: number, token?: string | undefined, getPeerName?: () => string | undefined);
205
+ private closed;
206
+ constructor(sessionId: string, sessionName: string, hubHost?: string, hubPort?: number, token?: string | undefined, getPeerName?: () => string | undefined, getRegistration?: () => Partial<SessionInfo>);
191
207
  connect(): void;
192
208
  send(msg: ChannelMessage): void;
193
209
  onMessage(handler: (msg: ChannelMessage) => void): void;
194
210
  disconnect(): void;
211
+ reregister(): void;
212
+ private registration;
195
213
  private scheduleReconnect;
196
214
  }
197
215
 
@@ -205,6 +223,7 @@ declare class SessionManager {
205
223
  get(sessionId: string): SessionInfo | undefined;
206
224
  getAll(): SessionInfo[];
207
225
  count(): number;
226
+ private baseName;
208
227
  }
209
228
 
210
229
  declare class TelegramBot {
@@ -234,6 +253,7 @@ declare class TelegramBot {
234
253
  private deliverToSession;
235
254
  private deliverPhotoToSession;
236
255
  private deliverPhotoToSessionByFileId;
256
+ private pendingSession;
237
257
  private getLabel;
238
258
  /** Send a permission request with inline buttons */
239
259
  sendPermissionRequest(sessionId: string, sessionLabel: string, requestId: string, toolName: string, description: string, inputPreview: string): Promise<void>;
@@ -296,9 +316,11 @@ declare const CONFIG_FILE: string;
296
316
  declare const PID_FILE: string;
297
317
  declare const LOG_FILE: string;
298
318
  declare const UPLOADS_DIR: string;
319
+ declare const CODEX_PID_FILE: string;
320
+ declare const CODEX_LOG_FILE: string;
299
321
  declare const WS_PATH_CHANNEL = "/ws/channel";
300
322
  declare const WS_PATH_DASHBOARD = "/ws/dashboard";
301
323
  declare const CHANNEL_SERVER_NAME = "claude-alarm";
302
324
  declare const CHANNEL_SERVER_VERSION = "0.1.0";
303
325
 
304
- 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 };