agent-console-server 3.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.
@@ -0,0 +1,902 @@
1
+ import { z } from "zod";
2
+ import { ItemEntityType } from "@esposter/shared";
3
+ //#region src/models/command/AttachmentMediaType.d.ts
4
+ declare enum AttachmentMediaType {
5
+ Gif = "image/gif",
6
+ Jpeg = "image/jpeg",
7
+ Pdf = "application/pdf",
8
+ Png = "image/png",
9
+ Text = "text/plain",
10
+ Webp = "image/webp"
11
+ }
12
+ declare const attachmentMediaTypeSchema: z.ZodEnum<typeof AttachmentMediaType>;
13
+ //#endregion
14
+ //#region src/models/command/Attachment.d.ts
15
+ interface Attachment {
16
+ data: string;
17
+ mediaType: AttachmentMediaType;
18
+ name: string;
19
+ }
20
+ declare const attachmentSchema: z.ZodObject<{
21
+ data: z.ZodString;
22
+ mediaType: typeof attachmentMediaTypeSchema;
23
+ name: z.ZodString;
24
+ }>;
25
+ //#endregion
26
+ //#region src/models/command/CommandType.d.ts
27
+ declare enum CommandType {
28
+ CloseSession = "CloseSession",
29
+ CreateSession = "CreateSession",
30
+ Fork = "Fork",
31
+ Interrupt = "Interrupt",
32
+ ListSessions = "ListSessions",
33
+ PermissionVerdict = "PermissionVerdict",
34
+ Prompt = "Prompt",
35
+ Resume = "Resume",
36
+ ResumeAt = "ResumeAt",
37
+ RewindFiles = "RewindFiles",
38
+ SetModel = "SetModel",
39
+ SetPermissionMode = "SetPermissionMode",
40
+ SlashCommand = "SlashCommand"
41
+ }
42
+ declare const commandTypeSchema: z.ZodEnum<typeof CommandType>;
43
+ //#endregion
44
+ //#region src/models/command/BaseCommand.d.ts
45
+ interface BaseCommand<T extends CommandType> extends ItemEntityType<T> {
46
+ id: string;
47
+ }
48
+ declare const createBaseCommandSchema: <T extends z.ZodType<CommandType>>(typeSchema: T) => z.ZodObject<{
49
+ id: z.ZodString;
50
+ type: T;
51
+ }>;
52
+ //#endregion
53
+ //#region src/models/command/SessionId.d.ts
54
+ interface SessionId {
55
+ sessionId: string;
56
+ }
57
+ declare const sessionIdSchema: z.ZodObject<{
58
+ sessionId: z.ZodString;
59
+ }>;
60
+ //#endregion
61
+ //#region src/models/command/CloseSessionCommand.d.ts
62
+ interface CloseSessionCommand extends BaseCommand<CommandType.CloseSession>, SessionId {}
63
+ declare const closeSessionCommandSchema: z.ZodObject<{
64
+ id: z.ZodString;
65
+ sessionId: z.ZodString;
66
+ type: z.ZodLiteral<CommandType.CloseSession>;
67
+ }>;
68
+ //#endregion
69
+ //#region src/models/command/CreateSessionCommand.d.ts
70
+ interface CreateSessionCommand extends BaseCommand<CommandType.CreateSession> {
71
+ cwd: string;
72
+ }
73
+ declare const createSessionCommandSchema: z.ZodObject<{
74
+ cwd: z.ZodString;
75
+ id: z.ZodString;
76
+ type: z.ZodLiteral<CommandType.CreateSession>;
77
+ }>;
78
+ //#endregion
79
+ //#region src/models/command/ForkCommand.d.ts
80
+ interface ForkCommand extends BaseCommand<CommandType.Fork>, SessionId {
81
+ messageUuid: string;
82
+ }
83
+ declare const forkCommandSchema: z.ZodObject<{
84
+ id: z.ZodString;
85
+ messageUuid: z.ZodString;
86
+ sessionId: z.ZodString;
87
+ type: z.ZodLiteral<CommandType.Fork>;
88
+ }>;
89
+ //#endregion
90
+ //#region src/models/command/InterruptCommand.d.ts
91
+ interface InterruptCommand extends BaseCommand<CommandType.Interrupt>, SessionId {}
92
+ declare const interruptCommandSchema: z.ZodObject<{
93
+ id: z.ZodString;
94
+ sessionId: z.ZodString;
95
+ type: z.ZodLiteral<CommandType.Interrupt>;
96
+ }>;
97
+ //#endregion
98
+ //#region src/models/command/ListSessionsCommand.d.ts
99
+ interface ListSessionsCommand extends BaseCommand<CommandType.ListSessions> {}
100
+ declare const listSessionsCommandSchema: z.ZodObject<{
101
+ id: z.ZodString;
102
+ type: z.ZodLiteral<CommandType.ListSessions>;
103
+ }>;
104
+ //#endregion
105
+ //#region src/models/command/PermissionBehavior.d.ts
106
+ declare enum PermissionBehavior {
107
+ Allow = "Allow",
108
+ AllowAlways = "AllowAlways",
109
+ Deny = "Deny"
110
+ }
111
+ declare const permissionBehaviorSchema: z.ZodEnum<typeof PermissionBehavior>;
112
+ //#endregion
113
+ //#region src/models/command/PermissionVerdictCommand.d.ts
114
+ interface PermissionVerdictCommand extends BaseCommand<CommandType.PermissionVerdict>, SessionId {
115
+ behavior: PermissionBehavior;
116
+ message: string;
117
+ requestId: string;
118
+ }
119
+ declare const permissionVerdictCommandSchema: z.ZodObject<{
120
+ behavior: typeof permissionBehaviorSchema;
121
+ id: z.ZodString;
122
+ message: z.ZodString;
123
+ requestId: z.ZodString;
124
+ sessionId: z.ZodString;
125
+ type: z.ZodLiteral<CommandType.PermissionVerdict>;
126
+ }>;
127
+ //#endregion
128
+ //#region src/models/command/PromptCommand.d.ts
129
+ interface PromptCommand extends BaseCommand<CommandType.Prompt>, SessionId {
130
+ attachments: Attachment[];
131
+ text: string;
132
+ }
133
+ declare const promptCommandSchema: z.ZodObject<{
134
+ attachments: z.ZodArray<typeof attachmentSchema>;
135
+ id: z.ZodString;
136
+ sessionId: z.ZodString;
137
+ text: z.ZodString;
138
+ type: z.ZodLiteral<CommandType.Prompt>;
139
+ }>;
140
+ //#endregion
141
+ //#region src/models/command/ResumeAtCommand.d.ts
142
+ interface ResumeAtCommand extends BaseCommand<CommandType.ResumeAt>, SessionId {
143
+ messageUuid: string;
144
+ }
145
+ declare const resumeAtCommandSchema: z.ZodObject<{
146
+ id: z.ZodString;
147
+ messageUuid: z.ZodString;
148
+ sessionId: z.ZodString;
149
+ type: z.ZodLiteral<CommandType.ResumeAt>;
150
+ }>;
151
+ //#endregion
152
+ //#region src/models/command/ResumeCommand.d.ts
153
+ interface ResumeCommand extends BaseCommand<CommandType.Resume>, SessionId {}
154
+ declare const resumeCommandSchema: z.ZodObject<{
155
+ id: z.ZodString;
156
+ sessionId: z.ZodString;
157
+ type: z.ZodLiteral<CommandType.Resume>;
158
+ }>;
159
+ //#endregion
160
+ //#region src/models/command/RewindFilesCommand.d.ts
161
+ interface RewindFilesCommand extends BaseCommand<CommandType.RewindFiles>, SessionId {
162
+ messageUuid: string;
163
+ }
164
+ declare const rewindFilesCommandSchema: z.ZodObject<{
165
+ id: z.ZodString;
166
+ messageUuid: z.ZodString;
167
+ sessionId: z.ZodString;
168
+ type: z.ZodLiteral<CommandType.RewindFiles>;
169
+ }>;
170
+ //#endregion
171
+ //#region src/models/command/SetModelCommand.d.ts
172
+ interface SetModelCommand extends BaseCommand<CommandType.SetModel>, SessionId {
173
+ model: string;
174
+ }
175
+ declare const setModelCommandSchema: z.ZodObject<{
176
+ id: z.ZodString;
177
+ model: z.ZodString;
178
+ sessionId: z.ZodString;
179
+ type: z.ZodLiteral<CommandType.SetModel>;
180
+ }>;
181
+ //#endregion
182
+ //#region src/models/session/PermissionMode.d.ts
183
+ declare enum PermissionMode {
184
+ AcceptEdits = "acceptEdits",
185
+ Auto = "auto",
186
+ BypassPermissions = "bypassPermissions",
187
+ Default = "default",
188
+ DontAsk = "dontAsk",
189
+ Plan = "plan"
190
+ }
191
+ declare const permissionModeSchema: z.ZodEnum<typeof PermissionMode>;
192
+ //#endregion
193
+ //#region src/models/command/SetPermissionModeCommand.d.ts
194
+ interface SetPermissionModeCommand extends BaseCommand<CommandType.SetPermissionMode>, SessionId {
195
+ permissionMode: PermissionMode;
196
+ }
197
+ declare const setPermissionModeCommandSchema: z.ZodObject<{
198
+ id: z.ZodString;
199
+ permissionMode: typeof permissionModeSchema;
200
+ sessionId: z.ZodString;
201
+ type: z.ZodLiteral<CommandType.SetPermissionMode>;
202
+ }>;
203
+ //#endregion
204
+ //#region src/models/command/SlashCommandCommand.d.ts
205
+ interface SlashCommandCommand extends BaseCommand<CommandType.SlashCommand>, SessionId {
206
+ arguments: string;
207
+ name: string;
208
+ }
209
+ declare const slashCommandCommandSchema: z.ZodObject<{
210
+ arguments: z.ZodString;
211
+ id: z.ZodString;
212
+ name: z.ZodString;
213
+ sessionId: z.ZodString;
214
+ type: z.ZodLiteral<CommandType.SlashCommand>;
215
+ }>;
216
+ //#endregion
217
+ //#region src/models/command/Command.d.ts
218
+ type Command = CloseSessionCommand | CreateSessionCommand | ForkCommand | InterruptCommand | ListSessionsCommand | PermissionVerdictCommand | PromptCommand | ResumeAtCommand | ResumeCommand | RewindFilesCommand | SetModelCommand | SetPermissionModeCommand | SlashCommandCommand;
219
+ declare const commandSchema: z.ZodDiscriminatedUnion<[typeof closeSessionCommandSchema, typeof createSessionCommandSchema, typeof forkCommandSchema, typeof interruptCommandSchema, typeof listSessionsCommandSchema, typeof permissionVerdictCommandSchema, typeof promptCommandSchema, typeof resumeAtCommandSchema, typeof resumeCommandSchema, typeof rewindFilesCommandSchema, typeof setModelCommandSchema, typeof setPermissionModeCommandSchema, typeof slashCommandCommandSchema], "type">;
220
+ //#endregion
221
+ //#region src/models/event/AgentEventType.d.ts
222
+ declare enum AgentEventType {
223
+ AssistantMessage = "AssistantMessage",
224
+ Capabilities = "Capabilities",
225
+ CommandOutput = "CommandOutput",
226
+ Compaction = "Compaction",
227
+ ContextUsage = "ContextUsage",
228
+ FileRewind = "FileRewind",
229
+ Hook = "Hook",
230
+ HostError = "HostError",
231
+ PermissionRequest = "PermissionRequest",
232
+ PermissionResolution = "PermissionResolution",
233
+ RateLimit = "RateLimit",
234
+ SessionInit = "SessionInit",
235
+ SessionSettings = "SessionSettings",
236
+ SessionState = "SessionState",
237
+ StreamDelta = "StreamDelta",
238
+ Subagent = "Subagent",
239
+ Thinking = "Thinking",
240
+ TodoUpdate = "TodoUpdate",
241
+ ToolProgress = "ToolProgress",
242
+ ToolResult = "ToolResult",
243
+ ToolUse = "ToolUse",
244
+ TurnResult = "TurnResult",
245
+ TurnUsage = "TurnUsage",
246
+ Unknown = "Unknown",
247
+ UserMessage = "UserMessage"
248
+ }
249
+ declare const agentEventTypeSchema: z.ZodEnum<typeof AgentEventType>;
250
+ //#endregion
251
+ //#region src/models/event/BaseAgentEvent.d.ts
252
+ interface BaseAgentEvent<T extends AgentEventType> extends ItemEntityType<T> {
253
+ createdAt: Date;
254
+ id: string;
255
+ }
256
+ declare const createBaseAgentEventSchema: <T extends z.ZodType<AgentEventType>>(typeSchema: T) => z.ZodObject<{
257
+ createdAt: z.ZodCoercedDate;
258
+ id: z.ZodString;
259
+ type: T;
260
+ }>;
261
+ //#endregion
262
+ //#region src/models/event/MessageUuid.d.ts
263
+ interface MessageUuid {
264
+ messageUuid: string;
265
+ }
266
+ declare const messageUuidSchema: z.ZodObject<{
267
+ messageUuid: z.ZodString;
268
+ }>;
269
+ //#endregion
270
+ //#region src/models/event/ParentToolUseId.d.ts
271
+ interface ParentToolUseId {
272
+ parentToolUseId: string;
273
+ }
274
+ declare const parentToolUseIdSchema: z.ZodObject<{
275
+ parentToolUseId: z.ZodString;
276
+ }>;
277
+ //#endregion
278
+ //#region src/models/event/AssistantMessageEvent.d.ts
279
+ interface AssistantMessageEvent extends BaseAgentEvent<AgentEventType.AssistantMessage>, MessageUuid, ParentToolUseId {
280
+ text: string;
281
+ }
282
+ declare const assistantMessageEventSchema: z.ZodObject<{
283
+ createdAt: z.ZodCoercedDate;
284
+ id: z.ZodString;
285
+ messageUuid: z.ZodString;
286
+ parentToolUseId: z.ZodString;
287
+ text: z.ZodString;
288
+ type: z.ZodLiteral<AgentEventType.AssistantMessage>;
289
+ }>;
290
+ //#endregion
291
+ //#region src/models/event/Model.d.ts
292
+ interface Model {
293
+ description: string;
294
+ displayName: string;
295
+ value: string;
296
+ }
297
+ declare const modelSchema: z.ZodObject<{
298
+ description: z.ZodString;
299
+ displayName: z.ZodString;
300
+ value: z.ZodString;
301
+ }>;
302
+ //#endregion
303
+ //#region src/models/event/SlashCommand.d.ts
304
+ interface SlashCommand {
305
+ argumentHint: string;
306
+ description: string;
307
+ name: string;
308
+ }
309
+ declare const slashCommandSchema: z.ZodObject<{
310
+ argumentHint: z.ZodString;
311
+ description: z.ZodString;
312
+ name: z.ZodString;
313
+ }>;
314
+ //#endregion
315
+ //#region src/models/event/CapabilitiesEvent.d.ts
316
+ interface CapabilitiesEvent extends BaseAgentEvent<AgentEventType.Capabilities> {
317
+ commands: SlashCommand[];
318
+ models: Model[];
319
+ }
320
+ declare const capabilitiesEventSchema: z.ZodObject<{
321
+ commands: z.ZodArray<typeof slashCommandSchema>;
322
+ createdAt: z.ZodCoercedDate;
323
+ id: z.ZodString;
324
+ models: z.ZodArray<typeof modelSchema>;
325
+ type: z.ZodLiteral<AgentEventType.Capabilities>;
326
+ }>;
327
+ //#endregion
328
+ //#region src/models/event/CommandOutputEvent.d.ts
329
+ interface CommandOutputEvent extends BaseAgentEvent<AgentEventType.CommandOutput> {
330
+ content: string;
331
+ }
332
+ declare const commandOutputEventSchema: z.ZodObject<{
333
+ content: z.ZodString;
334
+ createdAt: z.ZodCoercedDate;
335
+ id: z.ZodString;
336
+ type: z.ZodLiteral<AgentEventType.CommandOutput>;
337
+ }>;
338
+ //#endregion
339
+ //#region src/models/event/CompactionTrigger.d.ts
340
+ declare enum CompactionTrigger {
341
+ Auto = "auto",
342
+ Manual = "manual"
343
+ }
344
+ declare const compactionTriggerSchema: z.ZodEnum<typeof CompactionTrigger>;
345
+ //#endregion
346
+ //#region src/models/event/CompactionEvent.d.ts
347
+ interface CompactionEvent extends BaseAgentEvent<AgentEventType.Compaction> {
348
+ postTokens: number;
349
+ preTokens: number;
350
+ trigger: CompactionTrigger;
351
+ }
352
+ declare const compactionEventSchema: z.ZodObject<{
353
+ createdAt: z.ZodCoercedDate;
354
+ id: z.ZodString;
355
+ postTokens: z.ZodInt;
356
+ preTokens: z.ZodInt;
357
+ trigger: typeof compactionTriggerSchema;
358
+ type: z.ZodLiteral<AgentEventType.Compaction>;
359
+ }>;
360
+ //#endregion
361
+ //#region src/models/event/ContextUsageEvent.d.ts
362
+ interface ContextUsageEvent extends BaseAgentEvent<AgentEventType.ContextUsage> {
363
+ autoCompactThreshold: number;
364
+ isAutoCompactEnabled: boolean;
365
+ maxTokens: number;
366
+ percentage: number;
367
+ totalTokens: number;
368
+ }
369
+ declare const contextUsageEventSchema: z.ZodObject<{
370
+ autoCompactThreshold: z.ZodInt;
371
+ createdAt: z.ZodCoercedDate;
372
+ id: z.ZodString;
373
+ isAutoCompactEnabled: z.ZodBoolean;
374
+ maxTokens: z.ZodInt;
375
+ percentage: z.ZodNumber;
376
+ totalTokens: z.ZodInt;
377
+ type: z.ZodLiteral<AgentEventType.ContextUsage>;
378
+ }>;
379
+ //#endregion
380
+ //#region src/models/event/FileRewindEvent.d.ts
381
+ interface FileRewindEvent extends BaseAgentEvent<AgentEventType.FileRewind>, MessageUuid {
382
+ deletions: number;
383
+ filePaths: string[];
384
+ insertions: number;
385
+ }
386
+ declare const fileRewindEventSchema: z.ZodObject<{
387
+ createdAt: z.ZodCoercedDate;
388
+ deletions: z.ZodInt;
389
+ filePaths: z.ZodArray<z.ZodString>;
390
+ id: z.ZodString;
391
+ insertions: z.ZodInt;
392
+ messageUuid: z.ZodString;
393
+ type: z.ZodLiteral<AgentEventType.FileRewind>;
394
+ }>;
395
+ //#endregion
396
+ //#region src/models/event/HookPhase.d.ts
397
+ declare enum HookPhase {
398
+ Progress = "Progress",
399
+ Response = "Response",
400
+ Started = "Started"
401
+ }
402
+ declare const hookPhaseSchema: z.ZodEnum<typeof HookPhase>;
403
+ //#endregion
404
+ //#region src/models/event/HookEvent.d.ts
405
+ interface HookEvent extends BaseAgentEvent<AgentEventType.Hook> {
406
+ exitCode: number;
407
+ hookEvent: string;
408
+ hookId: string;
409
+ hookName: string;
410
+ outcome: string;
411
+ output: string;
412
+ phase: HookPhase;
413
+ stderr: string;
414
+ stdout: string;
415
+ }
416
+ declare const hookEventSchema: z.ZodObject<{
417
+ createdAt: z.ZodCoercedDate;
418
+ exitCode: z.ZodInt;
419
+ hookEvent: z.ZodString;
420
+ hookId: z.ZodString;
421
+ hookName: z.ZodString;
422
+ id: z.ZodString;
423
+ outcome: z.ZodString;
424
+ output: z.ZodString;
425
+ phase: typeof hookPhaseSchema;
426
+ stderr: z.ZodString;
427
+ stdout: z.ZodString;
428
+ type: z.ZodLiteral<AgentEventType.Hook>;
429
+ }>;
430
+ //#endregion
431
+ //#region src/models/event/HostErrorEvent.d.ts
432
+ interface HostErrorEvent extends BaseAgentEvent<AgentEventType.HostError> {
433
+ message: string;
434
+ }
435
+ declare const hostErrorEventSchema: z.ZodObject<{
436
+ createdAt: z.ZodCoercedDate;
437
+ id: z.ZodString;
438
+ message: z.ZodString;
439
+ type: z.ZodLiteral<AgentEventType.HostError>;
440
+ }>;
441
+ //#endregion
442
+ //#region src/models/event/PermissionRequestEvent.d.ts
443
+ interface PermissionRequestEvent extends BaseAgentEvent<AgentEventType.PermissionRequest> {
444
+ blockedPath: string;
445
+ decisionReason: string;
446
+ hasSuggestions: boolean;
447
+ input: Record<string, unknown>;
448
+ requestId: string;
449
+ title: string;
450
+ toolName: string;
451
+ toolUseId: string;
452
+ }
453
+ declare const permissionRequestEventSchema: z.ZodObject<{
454
+ blockedPath: z.ZodString;
455
+ createdAt: z.ZodCoercedDate;
456
+ decisionReason: z.ZodString;
457
+ hasSuggestions: z.ZodBoolean;
458
+ id: z.ZodString;
459
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
460
+ requestId: z.ZodString;
461
+ title: z.ZodString;
462
+ toolName: z.ZodString;
463
+ toolUseId: z.ZodString;
464
+ type: z.ZodLiteral<AgentEventType.PermissionRequest>;
465
+ }>;
466
+ //#endregion
467
+ //#region src/models/event/PermissionResolutionEvent.d.ts
468
+ interface PermissionResolutionEvent extends BaseAgentEvent<AgentEventType.PermissionResolution> {
469
+ behavior: PermissionBehavior;
470
+ requestId: string;
471
+ }
472
+ declare const permissionResolutionEventSchema: z.ZodObject<{
473
+ behavior: typeof permissionBehaviorSchema;
474
+ createdAt: z.ZodCoercedDate;
475
+ id: z.ZodString;
476
+ requestId: z.ZodString;
477
+ type: z.ZodLiteral<AgentEventType.PermissionResolution>;
478
+ }>;
479
+ //#endregion
480
+ //#region src/models/event/RateLimitEvent.d.ts
481
+ interface RateLimitEvent extends BaseAgentEvent<AgentEventType.RateLimit> {
482
+ rateLimitType: string;
483
+ resetsAt?: Date;
484
+ status: string;
485
+ utilization?: number;
486
+ }
487
+ declare const rateLimitEventSchema: z.ZodObject<{
488
+ createdAt: z.ZodCoercedDate;
489
+ id: z.ZodString;
490
+ rateLimitType: z.ZodString;
491
+ resetsAt: z.ZodOptional<z.ZodCoercedDate>;
492
+ status: z.ZodString;
493
+ type: z.ZodLiteral<AgentEventType.RateLimit>;
494
+ utilization: z.ZodOptional<z.ZodNumber>;
495
+ }>;
496
+ //#endregion
497
+ //#region src/models/event/McpServer.d.ts
498
+ interface McpServer {
499
+ name: string;
500
+ status: string;
501
+ }
502
+ declare const mcpServerSchema: z.ZodObject<{
503
+ name: z.ZodString;
504
+ status: z.ZodString;
505
+ }>;
506
+ //#endregion
507
+ //#region src/models/event/SessionInitEvent.d.ts
508
+ interface SessionInitEvent extends BaseAgentEvent<AgentEventType.SessionInit> {
509
+ agents: string[];
510
+ claudeCodeVersion: string;
511
+ cwd: string;
512
+ mcpServers: McpServer[];
513
+ model: string;
514
+ outputStyle: string;
515
+ permissionMode: PermissionMode;
516
+ plugins: string[];
517
+ skills: string[];
518
+ slashCommands: string[];
519
+ tools: string[];
520
+ }
521
+ declare const sessionInitEventSchema: z.ZodObject<{
522
+ agents: z.ZodArray<z.ZodString>;
523
+ claudeCodeVersion: z.ZodString;
524
+ createdAt: z.ZodCoercedDate;
525
+ cwd: z.ZodString;
526
+ id: z.ZodString;
527
+ mcpServers: z.ZodArray<typeof mcpServerSchema>;
528
+ model: z.ZodString;
529
+ outputStyle: z.ZodString;
530
+ permissionMode: typeof permissionModeSchema;
531
+ plugins: z.ZodArray<z.ZodString>;
532
+ skills: z.ZodArray<z.ZodString>;
533
+ slashCommands: z.ZodArray<z.ZodString>;
534
+ tools: z.ZodArray<z.ZodString>;
535
+ type: z.ZodLiteral<AgentEventType.SessionInit>;
536
+ }>;
537
+ //#endregion
538
+ //#region src/models/event/SessionSettingsEvent.d.ts
539
+ interface SessionSettingsEvent extends BaseAgentEvent<AgentEventType.SessionSettings> {
540
+ model: string;
541
+ permissionMode: PermissionMode;
542
+ }
543
+ declare const sessionSettingsEventSchema: z.ZodObject<{
544
+ createdAt: z.ZodCoercedDate;
545
+ id: z.ZodString;
546
+ model: z.ZodString;
547
+ permissionMode: typeof permissionModeSchema;
548
+ type: z.ZodLiteral<AgentEventType.SessionSettings>;
549
+ }>;
550
+ //#endregion
551
+ //#region src/models/session/SessionState.d.ts
552
+ declare enum SessionState {
553
+ Closed = "Closed",
554
+ Compacting = "Compacting",
555
+ Idle = "Idle",
556
+ RequiresAction = "RequiresAction",
557
+ Running = "Running"
558
+ }
559
+ declare const sessionStateSchema: z.ZodEnum<typeof SessionState>;
560
+ //#endregion
561
+ //#region src/models/event/SessionStateEvent.d.ts
562
+ interface SessionStateEvent extends BaseAgentEvent<AgentEventType.SessionState> {
563
+ state: SessionState;
564
+ }
565
+ declare const sessionStateEventSchema: z.ZodObject<{
566
+ createdAt: z.ZodCoercedDate;
567
+ id: z.ZodString;
568
+ state: typeof sessionStateSchema;
569
+ type: z.ZodLiteral<AgentEventType.SessionState>;
570
+ }>;
571
+ //#endregion
572
+ //#region src/models/event/StreamDeltaEvent.d.ts
573
+ interface StreamDeltaEvent extends BaseAgentEvent<AgentEventType.StreamDelta> {
574
+ blockId: string;
575
+ isThinking: boolean;
576
+ text: string;
577
+ }
578
+ declare const streamDeltaEventSchema: z.ZodObject<{
579
+ blockId: z.ZodString;
580
+ createdAt: z.ZodCoercedDate;
581
+ id: z.ZodString;
582
+ isThinking: z.ZodBoolean;
583
+ text: z.ZodString;
584
+ type: z.ZodLiteral<AgentEventType.StreamDelta>;
585
+ }>;
586
+ //#endregion
587
+ //#region src/models/event/SubagentStatus.d.ts
588
+ declare enum SubagentStatus {
589
+ Completed = "Completed",
590
+ Failed = "Failed",
591
+ Running = "Running",
592
+ Started = "Started",
593
+ Stopped = "Stopped"
594
+ }
595
+ declare const subagentStatusSchema: z.ZodEnum<typeof SubagentStatus>;
596
+ //#endregion
597
+ //#region src/models/event/SubagentEvent.d.ts
598
+ interface SubagentEvent extends BaseAgentEvent<AgentEventType.Subagent> {
599
+ description: string;
600
+ durationMs: number;
601
+ lastToolName: string;
602
+ status: SubagentStatus;
603
+ subagentType: string;
604
+ summary: string;
605
+ taskId: string;
606
+ toolUseId: string;
607
+ toolUses: number;
608
+ totalTokens: number;
609
+ }
610
+ declare const subagentEventSchema: z.ZodObject<{
611
+ createdAt: z.ZodCoercedDate;
612
+ description: z.ZodString;
613
+ durationMs: z.ZodNumber;
614
+ id: z.ZodString;
615
+ lastToolName: z.ZodString;
616
+ status: typeof subagentStatusSchema;
617
+ subagentType: z.ZodString;
618
+ summary: z.ZodString;
619
+ taskId: z.ZodString;
620
+ toolUseId: z.ZodString;
621
+ toolUses: z.ZodInt;
622
+ totalTokens: z.ZodInt;
623
+ type: z.ZodLiteral<AgentEventType.Subagent>;
624
+ }>;
625
+ //#endregion
626
+ //#region src/models/event/ThinkingEvent.d.ts
627
+ interface ThinkingEvent extends BaseAgentEvent<AgentEventType.Thinking>, MessageUuid, ParentToolUseId {
628
+ thinking: string;
629
+ }
630
+ declare const thinkingEventSchema: z.ZodObject<{
631
+ createdAt: z.ZodCoercedDate;
632
+ id: z.ZodString;
633
+ messageUuid: z.ZodString;
634
+ parentToolUseId: z.ZodString;
635
+ thinking: z.ZodString;
636
+ type: z.ZodLiteral<AgentEventType.Thinking>;
637
+ }>;
638
+ //#endregion
639
+ //#region src/models/event/TodoStatus.d.ts
640
+ declare enum TodoStatus {
641
+ Completed = "completed",
642
+ InProgress = "in_progress",
643
+ Pending = "pending"
644
+ }
645
+ declare const todoStatusSchema: z.ZodEnum<typeof TodoStatus>;
646
+ //#endregion
647
+ //#region src/models/event/Todo.d.ts
648
+ interface Todo {
649
+ activeForm: string;
650
+ content: string;
651
+ id: string;
652
+ status: TodoStatus;
653
+ }
654
+ declare const todoSchema: z.ZodObject<{
655
+ activeForm: z.ZodString;
656
+ content: z.ZodString;
657
+ id: z.ZodString;
658
+ status: typeof todoStatusSchema;
659
+ }>;
660
+ //#endregion
661
+ //#region src/models/event/TodoUpdateEvent.d.ts
662
+ interface TodoUpdateEvent extends BaseAgentEvent<AgentEventType.TodoUpdate> {
663
+ todos: Todo[];
664
+ }
665
+ declare const todoUpdateEventSchema: z.ZodObject<{
666
+ createdAt: z.ZodCoercedDate;
667
+ id: z.ZodString;
668
+ todos: z.ZodArray<typeof todoSchema>;
669
+ type: z.ZodLiteral<AgentEventType.TodoUpdate>;
670
+ }>;
671
+ //#endregion
672
+ //#region src/models/event/ToolProgressEvent.d.ts
673
+ interface ToolProgressEvent extends BaseAgentEvent<AgentEventType.ToolProgress>, ParentToolUseId {
674
+ elapsedSeconds: number;
675
+ toolUseId: string;
676
+ }
677
+ declare const toolProgressEventSchema: z.ZodObject<{
678
+ createdAt: z.ZodCoercedDate;
679
+ elapsedSeconds: z.ZodNumber;
680
+ id: z.ZodString;
681
+ parentToolUseId: z.ZodString;
682
+ toolUseId: z.ZodString;
683
+ type: z.ZodLiteral<AgentEventType.ToolProgress>;
684
+ }>;
685
+ //#endregion
686
+ //#region src/models/event/ToolResultEvent.d.ts
687
+ interface ToolResultEvent extends BaseAgentEvent<AgentEventType.ToolResult>, ParentToolUseId {
688
+ content: string;
689
+ isError: boolean;
690
+ originalText?: string;
691
+ toolUseId: string;
692
+ }
693
+ declare const toolResultEventSchema: z.ZodObject<{
694
+ content: z.ZodString;
695
+ createdAt: z.ZodCoercedDate;
696
+ id: z.ZodString;
697
+ isError: z.ZodBoolean;
698
+ originalText: z.ZodOptional<z.ZodString>;
699
+ parentToolUseId: z.ZodString;
700
+ toolUseId: z.ZodString;
701
+ type: z.ZodLiteral<AgentEventType.ToolResult>;
702
+ }>;
703
+ //#endregion
704
+ //#region src/models/event/ToolUseEvent.d.ts
705
+ interface ToolUseEvent extends BaseAgentEvent<AgentEventType.ToolUse>, MessageUuid, ParentToolUseId {
706
+ input: Record<string, unknown>;
707
+ name: string;
708
+ toolUseId: string;
709
+ }
710
+ declare const toolUseEventSchema: z.ZodObject<{
711
+ createdAt: z.ZodCoercedDate;
712
+ id: z.ZodString;
713
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
714
+ messageUuid: z.ZodString;
715
+ name: z.ZodString;
716
+ parentToolUseId: z.ZodString;
717
+ toolUseId: z.ZodString;
718
+ type: z.ZodLiteral<AgentEventType.ToolUse>;
719
+ }>;
720
+ //#endregion
721
+ //#region src/models/event/TokenUsage.d.ts
722
+ interface TokenUsage {
723
+ cacheCreationInputTokens: number;
724
+ cacheReadInputTokens: number;
725
+ inputTokens: number;
726
+ outputTokens: number;
727
+ }
728
+ declare const tokenUsageSchema: z.ZodObject<{
729
+ cacheCreationInputTokens: z.ZodInt;
730
+ cacheReadInputTokens: z.ZodInt;
731
+ inputTokens: z.ZodInt;
732
+ outputTokens: z.ZodInt;
733
+ }>;
734
+ //#endregion
735
+ //#region src/models/event/TurnResultEvent.d.ts
736
+ interface TurnResultEvent extends BaseAgentEvent<AgentEventType.TurnResult> {
737
+ durationApiMs: number;
738
+ durationMs: number;
739
+ errors: string[];
740
+ isError: boolean;
741
+ numTurns: number;
742
+ result: string;
743
+ subtype: string;
744
+ totalCostUsd: number;
745
+ usage: TokenUsage;
746
+ }
747
+ declare const turnResultEventSchema: z.ZodObject<{
748
+ createdAt: z.ZodCoercedDate;
749
+ durationApiMs: z.ZodNumber;
750
+ durationMs: z.ZodNumber;
751
+ errors: z.ZodArray<z.ZodString>;
752
+ id: z.ZodString;
753
+ isError: z.ZodBoolean;
754
+ numTurns: z.ZodInt;
755
+ result: z.ZodString;
756
+ subtype: z.ZodString;
757
+ totalCostUsd: z.ZodNumber;
758
+ type: z.ZodLiteral<AgentEventType.TurnResult>;
759
+ usage: typeof tokenUsageSchema;
760
+ }>;
761
+ //#endregion
762
+ //#region src/models/event/TurnUsageEvent.d.ts
763
+ interface TurnUsageEvent extends BaseAgentEvent<AgentEventType.TurnUsage> {
764
+ outputTokens: number;
765
+ }
766
+ declare const turnUsageEventSchema: z.ZodObject<{
767
+ createdAt: z.ZodCoercedDate;
768
+ id: z.ZodString;
769
+ outputTokens: z.ZodInt;
770
+ type: z.ZodLiteral<AgentEventType.TurnUsage>;
771
+ }>;
772
+ //#endregion
773
+ //#region src/models/event/UnknownEvent.d.ts
774
+ interface UnknownEvent extends BaseAgentEvent<AgentEventType.Unknown> {
775
+ raw: string;
776
+ sdkType: string;
777
+ }
778
+ declare const unknownEventSchema: z.ZodObject<{
779
+ createdAt: z.ZodCoercedDate;
780
+ id: z.ZodString;
781
+ raw: z.ZodString;
782
+ sdkType: z.ZodString;
783
+ type: z.ZodLiteral<AgentEventType.Unknown>;
784
+ }>;
785
+ //#endregion
786
+ //#region src/models/event/UserMessageEvent.d.ts
787
+ interface UserMessageEvent extends BaseAgentEvent<AgentEventType.UserMessage>, MessageUuid, ParentToolUseId {
788
+ attachmentCount: number;
789
+ text: string;
790
+ }
791
+ declare const userMessageEventSchema: z.ZodObject<{
792
+ attachmentCount: z.ZodInt;
793
+ createdAt: z.ZodCoercedDate;
794
+ id: z.ZodString;
795
+ messageUuid: z.ZodString;
796
+ parentToolUseId: z.ZodString;
797
+ text: z.ZodString;
798
+ type: z.ZodLiteral<AgentEventType.UserMessage>;
799
+ }>;
800
+ //#endregion
801
+ //#region src/models/event/AgentEvent.d.ts
802
+ type AgentEvent = AssistantMessageEvent | CapabilitiesEvent | CommandOutputEvent | CompactionEvent | ContextUsageEvent | FileRewindEvent | HookEvent | HostErrorEvent | PermissionRequestEvent | PermissionResolutionEvent | RateLimitEvent | SessionInitEvent | SessionSettingsEvent | SessionStateEvent | StreamDeltaEvent | SubagentEvent | ThinkingEvent | TodoUpdateEvent | ToolProgressEvent | ToolResultEvent | ToolUseEvent | TurnResultEvent | TurnUsageEvent | UnknownEvent | UserMessageEvent;
803
+ declare const agentEventSchema: z.ZodDiscriminatedUnion<[typeof assistantMessageEventSchema, typeof capabilitiesEventSchema, typeof commandOutputEventSchema, typeof compactionEventSchema, typeof contextUsageEventSchema, typeof fileRewindEventSchema, typeof hookEventSchema, typeof hostErrorEventSchema, typeof permissionRequestEventSchema, typeof permissionResolutionEventSchema, typeof rateLimitEventSchema, typeof sessionInitEventSchema, typeof sessionSettingsEventSchema, typeof sessionStateEventSchema, typeof streamDeltaEventSchema, typeof subagentEventSchema, typeof thinkingEventSchema, typeof todoUpdateEventSchema, typeof toolProgressEventSchema, typeof toolResultEventSchema, typeof toolUseEventSchema, typeof turnResultEventSchema, typeof turnUsageEventSchema, typeof unknownEventSchema, typeof userMessageEventSchema], "type">;
804
+ //#endregion
805
+ //#region src/models/event/EphemeralAgentEventTypes.d.ts
806
+ declare const EphemeralAgentEventTypes: readonly AgentEventType[];
807
+ //#endregion
808
+ //#region src/models/server/ServerMessageType.d.ts
809
+ declare enum ServerMessageType {
810
+ CommandError = "CommandError",
811
+ Events = "Events",
812
+ SessionOpened = "SessionOpened",
813
+ SessionReset = "SessionReset",
814
+ Sessions = "Sessions"
815
+ }
816
+ declare const serverMessageTypeSchema: z.ZodEnum<typeof ServerMessageType>;
817
+ //#endregion
818
+ //#region src/models/server/BaseServerMessage.d.ts
819
+ interface BaseServerMessage<T extends ServerMessageType> extends ItemEntityType<T> {}
820
+ declare const createBaseServerMessageSchema: <T extends z.ZodType<ServerMessageType>>(typeSchema: T) => z.ZodObject<{
821
+ type: T;
822
+ }>;
823
+ //#endregion
824
+ //#region src/models/server/CommandErrorMessage.d.ts
825
+ interface CommandErrorMessage extends BaseServerMessage<ServerMessageType.CommandError> {
826
+ commandId: string;
827
+ message: string;
828
+ }
829
+ declare const commandErrorMessageSchema: z.ZodObject<{
830
+ commandId: z.ZodString;
831
+ message: z.ZodString;
832
+ type: z.ZodLiteral<ServerMessageType.CommandError>;
833
+ }>;
834
+ //#endregion
835
+ //#region src/models/server/EventsMessage.d.ts
836
+ interface EventsMessage extends BaseServerMessage<ServerMessageType.Events> {
837
+ events: AgentEvent[];
838
+ sessionId: string;
839
+ }
840
+ declare const eventsMessageSchema: z.ZodObject<{
841
+ events: z.ZodArray<typeof agentEventSchema>;
842
+ sessionId: z.ZodString;
843
+ type: z.ZodLiteral<ServerMessageType.Events>;
844
+ }>;
845
+ //#endregion
846
+ //#region src/models/server/SessionOpenedMessage.d.ts
847
+ interface SessionOpenedMessage extends BaseServerMessage<ServerMessageType.SessionOpened> {
848
+ commandId: string;
849
+ sessionId: string;
850
+ }
851
+ declare const sessionOpenedMessageSchema: z.ZodObject<{
852
+ commandId: z.ZodString;
853
+ sessionId: z.ZodString;
854
+ type: z.ZodLiteral<ServerMessageType.SessionOpened>;
855
+ }>;
856
+ //#endregion
857
+ //#region src/models/server/SessionResetMessage.d.ts
858
+ interface SessionResetMessage extends BaseServerMessage<ServerMessageType.SessionReset> {
859
+ sessionId: string;
860
+ }
861
+ declare const sessionResetMessageSchema: z.ZodObject<{
862
+ sessionId: z.ZodString;
863
+ type: z.ZodLiteral<ServerMessageType.SessionReset>;
864
+ }>;
865
+ //#endregion
866
+ //#region src/models/session/SessionSummary.d.ts
867
+ interface SessionSummary {
868
+ cwd: string;
869
+ id: string;
870
+ lastActivityAt: Date;
871
+ state: SessionState;
872
+ title: string;
873
+ }
874
+ declare const sessionSummarySchema: z.ZodObject<{
875
+ cwd: z.ZodString;
876
+ id: z.ZodString;
877
+ lastActivityAt: z.ZodCoercedDate;
878
+ state: typeof sessionStateSchema;
879
+ title: z.ZodString;
880
+ }>;
881
+ //#endregion
882
+ //#region src/models/server/SessionsMessage.d.ts
883
+ interface SessionsMessage extends BaseServerMessage<ServerMessageType.Sessions> {
884
+ sessions: SessionSummary[];
885
+ }
886
+ declare const sessionsMessageSchema: z.ZodObject<{
887
+ sessions: z.ZodArray<typeof sessionSummarySchema>;
888
+ type: z.ZodLiteral<ServerMessageType.Sessions>;
889
+ }>;
890
+ //#endregion
891
+ //#region src/models/server/ServerMessage.d.ts
892
+ type ServerMessage = CommandErrorMessage | EventsMessage | SessionOpenedMessage | SessionResetMessage | SessionsMessage;
893
+ declare const serverMessageSchema: z.ZodDiscriminatedUnion<[typeof commandErrorMessageSchema, typeof eventsMessageSchema, typeof sessionOpenedMessageSchema, typeof sessionResetMessageSchema, typeof sessionsMessageSchema], "type">;
894
+ //#endregion
895
+ //#region src/services/constants.d.ts
896
+ declare const DEFAULT_APP_ORIGIN = "https://esposter.com";
897
+ declare const DEFAULT_HOSTNAME = "127.0.0.1";
898
+ declare const DEFAULT_PORT = 7437;
899
+ declare const PAIRING_HASH_PARAMETER = "host";
900
+ declare const TOKEN_QUERY_PARAMETER = "token";
901
+ //#endregion
902
+ export { SubagentStatus as $, SlashCommandCommand as $t, unknownEventSchema as A, sessionIdSchema as An, compactionEventSchema as At, toolResultEventSchema as B, modelSchema as Bt, serverMessageTypeSchema as C, ForkCommand as Cn, HookPhase as Ct, UserMessageEvent as D, CloseSessionCommand as Dn, ContextUsageEvent as Dt, agentEventSchema as E, createSessionCommandSchema as En, fileRewindEventSchema as Et, TokenUsage as F, Attachment as Fn, CapabilitiesEvent as Ft, Todo as G, MessageUuid as Gt, toolProgressEventSchema as H, assistantMessageEventSchema as Ht, tokenUsageSchema as I, attachmentSchema as In, capabilitiesEventSchema as It, todoStatusSchema as J, createBaseAgentEventSchema as Jt, todoSchema as K, messageUuidSchema as Kt, ToolUseEvent as L, AttachmentMediaType as Ln, SlashCommand as Lt, turnUsageEventSchema as M, createBaseCommandSchema as Mn, compactionTriggerSchema as Mt, TurnResultEvent as N, CommandType as Nn, CommandOutputEvent as Nt, userMessageEventSchema as O, closeSessionCommandSchema as On, contextUsageEventSchema as Ot, turnResultEventSchema as P, commandTypeSchema as Pn, commandOutputEventSchema as Pt, subagentEventSchema as Q, commandSchema as Qt, toolUseEventSchema as R, attachmentMediaTypeSchema as Rn, slashCommandSchema as Rt, ServerMessageType as S, interruptCommandSchema as Sn, hookEventSchema as St, AgentEvent as T, CreateSessionCommand as Tn, FileRewindEvent as Tt, TodoUpdateEvent as U, ParentToolUseId as Ut, ToolProgressEvent as V, AssistantMessageEvent as Vt, todoUpdateEventSchema as W, parentToolUseIdSchema as Wt, thinkingEventSchema as X, agentEventTypeSchema as Xt, ThinkingEvent as Y, AgentEventType as Yt, SubagentEvent as Z, Command as Zt, eventsMessageSchema as _, PermissionBehavior as _n, PermissionRequestEvent as _t, TOKEN_QUERY_PARAMETER as a, SetModelCommand as an, SessionState as at, BaseServerMessage as b, listSessionsCommandSchema as bn, hostErrorEventSchema as bt, SessionsMessage as c, rewindFilesCommandSchema as cn, sessionSettingsEventSchema as ct, sessionSummarySchema as d, ResumeAtCommand as dn, McpServer as dt, slashCommandCommandSchema as en, subagentStatusSchema as et, SessionResetMessage as f, resumeAtCommandSchema as fn, mcpServerSchema as ft, EventsMessage as g, permissionVerdictCommandSchema as gn, permissionResolutionEventSchema as gt, sessionOpenedMessageSchema as h, PermissionVerdictCommand as hn, PermissionResolutionEvent as ht, PAIRING_HASH_PARAMETER as i, permissionModeSchema as in, sessionStateEventSchema as it, TurnUsageEvent as j, BaseCommand as jn, CompactionTrigger as jt, UnknownEvent as k, SessionId as kn, CompactionEvent as kt, sessionsMessageSchema as l, ResumeCommand as ln, SessionInitEvent as lt, SessionOpenedMessage as m, promptCommandSchema as mn, rateLimitEventSchema as mt, DEFAULT_HOSTNAME as n, setPermissionModeCommandSchema as nn, streamDeltaEventSchema as nt, ServerMessage as o, setModelCommandSchema as on, sessionStateSchema as ot, sessionResetMessageSchema as p, PromptCommand as pn, RateLimitEvent as pt, TodoStatus as q, BaseAgentEvent as qt, DEFAULT_PORT as r, PermissionMode as rn, SessionStateEvent as rt, serverMessageSchema as s, RewindFilesCommand as sn, SessionSettingsEvent as st, DEFAULT_APP_ORIGIN as t, SetPermissionModeCommand as tn, StreamDeltaEvent as tt, SessionSummary as u, resumeCommandSchema as un, sessionInitEventSchema as ut, CommandErrorMessage as v, permissionBehaviorSchema as vn, permissionRequestEventSchema as vt, EphemeralAgentEventTypes as w, forkCommandSchema as wn, hookPhaseSchema as wt, createBaseServerMessageSchema as x, InterruptCommand as xn, HookEvent as xt, commandErrorMessageSchema as y, ListSessionsCommand as yn, HostErrorEvent as yt, ToolResultEvent as z, Model as zt };