@delt/claude-alarm 1.1.1 → 1.3.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/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ interface SessionInfo {
29
29
  peerName?: string;
30
30
  agentKind?: AgentKind;
31
31
  title?: string;
32
+ closable?: boolean;
32
33
  }
33
34
  /** Messages sent between channel server and hub */
34
35
  type ChannelMessage = {
@@ -71,6 +72,12 @@ type ChannelMessage = {
71
72
  mimeType: string;
72
73
  originalName?: string;
73
74
  content?: string;
75
+ source?: MessageSource;
76
+ } | {
77
+ type: 'upload_rejected';
78
+ sessionId: string;
79
+ reason: string;
80
+ withText: boolean;
74
81
  } | {
75
82
  type: 'sessions_list';
76
83
  sessions: SessionInfo[];
@@ -118,10 +125,51 @@ type ChannelMessage = {
118
125
  } | {
119
126
  type: 'permission_pending';
120
127
  requests: PendingChoiceRequest[];
128
+ } | {
129
+ type: 'codex_adapters';
130
+ adapters: CodexAdapterInfo[];
131
+ } | {
132
+ type: 'codex_close';
133
+ sessionId: string;
121
134
  } | {
122
135
  type: 'error';
123
136
  message: string;
124
137
  };
138
+ interface CodexAdapterInfo {
139
+ id: string;
140
+ host: string;
141
+ ready: boolean;
142
+ isLocal: boolean;
143
+ }
144
+ type CodexCall = {
145
+ kind: 'folders';
146
+ } | {
147
+ kind: 'create';
148
+ cwd: string;
149
+ };
150
+ /** Messages on the per-adapter socket between the Codex adapter and the hub */
151
+ type CodexLinkMessage = {
152
+ type: 'adapter_hello';
153
+ adapter: {
154
+ id: string;
155
+ host: string;
156
+ ready: boolean;
157
+ };
158
+ } | {
159
+ type: 'adapter_call';
160
+ requestId: string;
161
+ call: CodexCall;
162
+ } | {
163
+ type: 'adapter_result';
164
+ requestId: string;
165
+ ok: true;
166
+ data: unknown;
167
+ } | {
168
+ type: 'adapter_result';
169
+ requestId: string;
170
+ ok: false;
171
+ error: string;
172
+ };
125
173
  type NotifyLevel = 'info' | 'warning' | 'error' | 'success';
126
174
  /** Webhook configuration */
127
175
  interface WebhookConfig {
@@ -184,7 +232,14 @@ declare class HubServer {
184
232
  private token?;
185
233
  private codexEnabled;
186
234
  private codexSupervisor?;
187
- constructor(config?: Partial<AppConfig>);
235
+ private wssCodex;
236
+ private codexAdapters;
237
+ private codexAlive;
238
+ private codexCallTimeoutMs;
239
+ private codexCalls;
240
+ constructor(config?: Partial<AppConfig>, options?: {
241
+ codexCallTimeoutMs?: number;
242
+ });
188
243
  start(): Promise<void>;
189
244
  stop(): Promise<void>;
190
245
  private handleHttp;
@@ -194,6 +249,13 @@ declare class HubServer {
194
249
  private handleApiNotify;
195
250
  private handleChannelConnection;
196
251
  private handleChannelMessage;
252
+ private handleCodexConnection;
253
+ private callCodexAdapter;
254
+ private handleCodexFolders;
255
+ private handleCodexCreate;
256
+ private handleCodexClose;
257
+ private codexAdapterList;
258
+ private broadcastCodexAdapters;
197
259
  private handleDashboardConnection;
198
260
  private forwardPermissionResponse;
199
261
  private resolveChoice;
@@ -266,11 +328,13 @@ declare class TelegramBot {
266
328
  private choiceTokens;
267
329
  private choiceMessages;
268
330
  getSessions?: () => SessionInfo[];
269
- private pendingMessages;
331
+ private latestSelection;
332
+ private selections;
270
333
  constructor(config: TelegramConfig);
271
334
  private get apiUrl();
272
335
  /** Send a notification message to Telegram */
273
336
  sendNotification(sessionId: string, _sessionLabel: string, title: string, message: string): Promise<void>;
337
+ private fitNotification;
274
338
  /** Send a text message to the configured chat */
275
339
  private sendMessage;
276
340
  /** Start long polling for incoming messages */
@@ -283,6 +347,7 @@ declare class TelegramBot {
283
347
  private deliverToSession;
284
348
  private deliverPhotoToSession;
285
349
  private deliverPhotoToSessionByFileId;
350
+ private photoNotDelivered;
286
351
  private pendingSession;
287
352
  private getLabel;
288
353
  /** Send a permission request with inline buttons */
@@ -295,6 +360,8 @@ declare class TelegramBot {
295
360
  private handleCallbackQuery;
296
361
  private handleSessionSelectCallback;
297
362
  private answerCallbackQuery;
363
+ private expire;
364
+ private removeButtons;
298
365
  private editMessageText;
299
366
  private escHtml;
300
367
  private static readonly LANG_BY_EXT;
@@ -355,7 +422,8 @@ declare const CODEX_PID_FILE: string;
355
422
  declare const CODEX_LOG_FILE: string;
356
423
  declare const WS_PATH_CHANNEL = "/ws/channel";
357
424
  declare const WS_PATH_DASHBOARD = "/ws/dashboard";
425
+ declare const WS_PATH_CODEX = "/ws/codex";
358
426
  declare const CHANNEL_SERVER_NAME = "claude-alarm";
359
427
  declare const CHANNEL_SERVER_VERSION = "0.1.0";
360
428
 
361
- 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 PendingChoiceRequest, type PermissionChoice, type SessionInfo, SessionManager, type SessionStatus, type TelegramConfig, UPLOADS_DIR, WS_PATH_CHANNEL, WS_PATH_DASHBOARD, type WebhookConfig, loadConfig, logger, saveConfig, setupMcpConfig };
429
+ export { type AgentKind, type AppConfig, CHANNEL_SERVER_NAME, CHANNEL_SERVER_VERSION, CODEX_LOG_FILE, CODEX_PID_FILE, CONFIG_DIR, CONFIG_FILE, type ChannelMessage, type CodexAdapterInfo, type CodexCall, type CodexConfig, type CodexLinkMessage, DEFAULT_HUB_HOST, DEFAULT_HUB_PORT, HubClient, HubServer, type HubStatus, LOG_FILE, type MessageSource, Notifier, type NotifyLevel, PID_FILE, type PendingChoiceRequest, type PermissionChoice, type SessionInfo, SessionManager, type SessionStatus, type TelegramConfig, UPLOADS_DIR, WS_PATH_CHANNEL, WS_PATH_CODEX, WS_PATH_DASHBOARD, type WebhookConfig, loadConfig, logger, saveConfig, setupMcpConfig };