@pinpatch/core 0.1.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,1240 @@
1
+ import { z } from 'zod';
2
+ import { Server } from 'node:http';
3
+ import express from 'express';
4
+
5
+ declare const PinStateSchema: z.ZodEnum<["idle", "queued", "running", "completed", "error", "cancelled", "timeout"]>;
6
+ type PinState = z.infer<typeof PinStateSchema>;
7
+ declare const ViewportSchema: z.ZodObject<{
8
+ width: z.ZodNumber;
9
+ height: z.ZodNumber;
10
+ }, "strip", z.ZodTypeAny, {
11
+ width: number;
12
+ height: number;
13
+ }, {
14
+ width: number;
15
+ height: number;
16
+ }>;
17
+ type Viewport = z.infer<typeof ViewportSchema>;
18
+ declare const BoundingBoxSchema: z.ZodObject<{
19
+ x: z.ZodNumber;
20
+ y: z.ZodNumber;
21
+ width: z.ZodNumber;
22
+ height: z.ZodNumber;
23
+ }, "strip", z.ZodTypeAny, {
24
+ width: number;
25
+ height: number;
26
+ x: number;
27
+ y: number;
28
+ }, {
29
+ width: number;
30
+ height: number;
31
+ x: number;
32
+ y: number;
33
+ }>;
34
+ type BoundingBox = z.infer<typeof BoundingBoxSchema>;
35
+ declare const ElementDescriptorSchema: z.ZodObject<{
36
+ tag: z.ZodString;
37
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
+ attributes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
40
+ boundingBox: z.ZodObject<{
41
+ x: z.ZodNumber;
42
+ y: z.ZodNumber;
43
+ width: z.ZodNumber;
44
+ height: z.ZodNumber;
45
+ }, "strip", z.ZodTypeAny, {
46
+ width: number;
47
+ height: number;
48
+ x: number;
49
+ y: number;
50
+ }, {
51
+ width: number;
52
+ height: number;
53
+ x: number;
54
+ y: number;
55
+ }>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ tag: string;
58
+ attributes: Record<string, string | null>;
59
+ boundingBox: {
60
+ width: number;
61
+ height: number;
62
+ x: number;
63
+ y: number;
64
+ };
65
+ role?: string | null | undefined;
66
+ text?: string | null | undefined;
67
+ }, {
68
+ tag: string;
69
+ attributes: Record<string, string | null>;
70
+ boundingBox: {
71
+ width: number;
72
+ height: number;
73
+ x: number;
74
+ y: number;
75
+ };
76
+ role?: string | null | undefined;
77
+ text?: string | null | undefined;
78
+ }>;
79
+ type ElementDescriptor = z.infer<typeof ElementDescriptorSchema>;
80
+ declare const UiChangePacketSchema: z.ZodObject<{
81
+ id: z.ZodString;
82
+ timestamp: z.ZodString;
83
+ url: z.ZodString;
84
+ viewport: z.ZodObject<{
85
+ width: z.ZodNumber;
86
+ height: z.ZodNumber;
87
+ }, "strip", z.ZodTypeAny, {
88
+ width: number;
89
+ height: number;
90
+ }, {
91
+ width: number;
92
+ height: number;
93
+ }>;
94
+ element: z.ZodObject<{
95
+ tag: z.ZodString;
96
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ attributes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
99
+ boundingBox: z.ZodObject<{
100
+ x: z.ZodNumber;
101
+ y: z.ZodNumber;
102
+ width: z.ZodNumber;
103
+ height: z.ZodNumber;
104
+ }, "strip", z.ZodTypeAny, {
105
+ width: number;
106
+ height: number;
107
+ x: number;
108
+ y: number;
109
+ }, {
110
+ width: number;
111
+ height: number;
112
+ x: number;
113
+ y: number;
114
+ }>;
115
+ }, "strip", z.ZodTypeAny, {
116
+ tag: string;
117
+ attributes: Record<string, string | null>;
118
+ boundingBox: {
119
+ width: number;
120
+ height: number;
121
+ x: number;
122
+ y: number;
123
+ };
124
+ role?: string | null | undefined;
125
+ text?: string | null | undefined;
126
+ }, {
127
+ tag: string;
128
+ attributes: Record<string, string | null>;
129
+ boundingBox: {
130
+ width: number;
131
+ height: number;
132
+ x: number;
133
+ y: number;
134
+ };
135
+ role?: string | null | undefined;
136
+ text?: string | null | undefined;
137
+ }>;
138
+ nearbyText: z.ZodArray<z.ZodString, "many">;
139
+ domSnippet: z.ZodString;
140
+ computedStyleSummary: z.ZodRecord<z.ZodString, z.ZodString>;
141
+ screenshotPath: z.ZodString;
142
+ userRequest: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ timestamp: string;
145
+ url: string;
146
+ viewport: {
147
+ width: number;
148
+ height: number;
149
+ };
150
+ id: string;
151
+ element: {
152
+ tag: string;
153
+ attributes: Record<string, string | null>;
154
+ boundingBox: {
155
+ width: number;
156
+ height: number;
157
+ x: number;
158
+ y: number;
159
+ };
160
+ role?: string | null | undefined;
161
+ text?: string | null | undefined;
162
+ };
163
+ nearbyText: string[];
164
+ domSnippet: string;
165
+ computedStyleSummary: Record<string, string>;
166
+ screenshotPath: string;
167
+ userRequest: string;
168
+ }, {
169
+ timestamp: string;
170
+ url: string;
171
+ viewport: {
172
+ width: number;
173
+ height: number;
174
+ };
175
+ id: string;
176
+ element: {
177
+ tag: string;
178
+ attributes: Record<string, string | null>;
179
+ boundingBox: {
180
+ width: number;
181
+ height: number;
182
+ x: number;
183
+ y: number;
184
+ };
185
+ role?: string | null | undefined;
186
+ text?: string | null | undefined;
187
+ };
188
+ nearbyText: string[];
189
+ domSnippet: string;
190
+ computedStyleSummary: Record<string, string>;
191
+ screenshotPath: string;
192
+ userRequest: string;
193
+ }>;
194
+ type UiChangePacket = z.infer<typeof UiChangePacketSchema>;
195
+ declare const TaskStatusSchema: z.ZodEnum<["created", "queued", "running", "completed", "error", "cancelled", "timeout"]>;
196
+ type TaskStatus = z.infer<typeof TaskStatusSchema>;
197
+ declare const TaskPinSchema: z.ZodObject<{
198
+ x: z.ZodNumber;
199
+ y: z.ZodNumber;
200
+ body: z.ZodString;
201
+ }, "strip", z.ZodTypeAny, {
202
+ x: number;
203
+ y: number;
204
+ body: string;
205
+ }, {
206
+ x: number;
207
+ y: number;
208
+ body: string;
209
+ }>;
210
+ declare const TaskRecordSchema: z.ZodObject<{
211
+ taskId: z.ZodString;
212
+ createdAt: z.ZodString;
213
+ updatedAt: z.ZodString;
214
+ status: z.ZodEnum<["created", "queued", "running", "completed", "error", "cancelled", "timeout"]>;
215
+ url: z.ZodString;
216
+ viewport: z.ZodObject<{
217
+ width: z.ZodNumber;
218
+ height: z.ZodNumber;
219
+ }, "strip", z.ZodTypeAny, {
220
+ width: number;
221
+ height: number;
222
+ }, {
223
+ width: number;
224
+ height: number;
225
+ }>;
226
+ pin: z.ZodObject<{
227
+ x: z.ZodNumber;
228
+ y: z.ZodNumber;
229
+ body: z.ZodString;
230
+ }, "strip", z.ZodTypeAny, {
231
+ x: number;
232
+ y: number;
233
+ body: string;
234
+ }, {
235
+ x: number;
236
+ y: number;
237
+ body: string;
238
+ }>;
239
+ uiChangePacket: z.ZodObject<{
240
+ id: z.ZodString;
241
+ timestamp: z.ZodString;
242
+ url: z.ZodString;
243
+ viewport: z.ZodObject<{
244
+ width: z.ZodNumber;
245
+ height: z.ZodNumber;
246
+ }, "strip", z.ZodTypeAny, {
247
+ width: number;
248
+ height: number;
249
+ }, {
250
+ width: number;
251
+ height: number;
252
+ }>;
253
+ element: z.ZodObject<{
254
+ tag: z.ZodString;
255
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
257
+ attributes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
258
+ boundingBox: z.ZodObject<{
259
+ x: z.ZodNumber;
260
+ y: z.ZodNumber;
261
+ width: z.ZodNumber;
262
+ height: z.ZodNumber;
263
+ }, "strip", z.ZodTypeAny, {
264
+ width: number;
265
+ height: number;
266
+ x: number;
267
+ y: number;
268
+ }, {
269
+ width: number;
270
+ height: number;
271
+ x: number;
272
+ y: number;
273
+ }>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ tag: string;
276
+ attributes: Record<string, string | null>;
277
+ boundingBox: {
278
+ width: number;
279
+ height: number;
280
+ x: number;
281
+ y: number;
282
+ };
283
+ role?: string | null | undefined;
284
+ text?: string | null | undefined;
285
+ }, {
286
+ tag: string;
287
+ attributes: Record<string, string | null>;
288
+ boundingBox: {
289
+ width: number;
290
+ height: number;
291
+ x: number;
292
+ y: number;
293
+ };
294
+ role?: string | null | undefined;
295
+ text?: string | null | undefined;
296
+ }>;
297
+ nearbyText: z.ZodArray<z.ZodString, "many">;
298
+ domSnippet: z.ZodString;
299
+ computedStyleSummary: z.ZodRecord<z.ZodString, z.ZodString>;
300
+ screenshotPath: z.ZodString;
301
+ userRequest: z.ZodString;
302
+ }, "strip", z.ZodTypeAny, {
303
+ timestamp: string;
304
+ url: string;
305
+ viewport: {
306
+ width: number;
307
+ height: number;
308
+ };
309
+ id: string;
310
+ element: {
311
+ tag: string;
312
+ attributes: Record<string, string | null>;
313
+ boundingBox: {
314
+ width: number;
315
+ height: number;
316
+ x: number;
317
+ y: number;
318
+ };
319
+ role?: string | null | undefined;
320
+ text?: string | null | undefined;
321
+ };
322
+ nearbyText: string[];
323
+ domSnippet: string;
324
+ computedStyleSummary: Record<string, string>;
325
+ screenshotPath: string;
326
+ userRequest: string;
327
+ }, {
328
+ timestamp: string;
329
+ url: string;
330
+ viewport: {
331
+ width: number;
332
+ height: number;
333
+ };
334
+ id: string;
335
+ element: {
336
+ tag: string;
337
+ attributes: Record<string, string | null>;
338
+ boundingBox: {
339
+ width: number;
340
+ height: number;
341
+ x: number;
342
+ y: number;
343
+ };
344
+ role?: string | null | undefined;
345
+ text?: string | null | undefined;
346
+ };
347
+ nearbyText: string[];
348
+ domSnippet: string;
349
+ computedStyleSummary: Record<string, string>;
350
+ screenshotPath: string;
351
+ userRequest: string;
352
+ }>;
353
+ screenshotPath: z.ZodString;
354
+ provider: z.ZodOptional<z.ZodEnum<["codex", "claude", "cursor"]>>;
355
+ model: z.ZodOptional<z.ZodString>;
356
+ latestSessionId: z.ZodOptional<z.ZodString>;
357
+ sessions: z.ZodArray<z.ZodString, "many">;
358
+ summary: z.ZodOptional<z.ZodString>;
359
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
360
+ errorCode: z.ZodOptional<z.ZodString>;
361
+ errorMessage: z.ZodOptional<z.ZodString>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout" | "created";
364
+ taskId: string;
365
+ changedFiles: string[];
366
+ createdAt: string;
367
+ updatedAt: string;
368
+ url: string;
369
+ viewport: {
370
+ width: number;
371
+ height: number;
372
+ };
373
+ pin: {
374
+ x: number;
375
+ y: number;
376
+ body: string;
377
+ };
378
+ screenshotPath: string;
379
+ uiChangePacket: {
380
+ timestamp: string;
381
+ url: string;
382
+ viewport: {
383
+ width: number;
384
+ height: number;
385
+ };
386
+ id: string;
387
+ element: {
388
+ tag: string;
389
+ attributes: Record<string, string | null>;
390
+ boundingBox: {
391
+ width: number;
392
+ height: number;
393
+ x: number;
394
+ y: number;
395
+ };
396
+ role?: string | null | undefined;
397
+ text?: string | null | undefined;
398
+ };
399
+ nearbyText: string[];
400
+ domSnippet: string;
401
+ computedStyleSummary: Record<string, string>;
402
+ screenshotPath: string;
403
+ userRequest: string;
404
+ };
405
+ sessions: string[];
406
+ summary?: string | undefined;
407
+ errorCode?: string | undefined;
408
+ errorMessage?: string | undefined;
409
+ provider?: "codex" | "claude" | "cursor" | undefined;
410
+ model?: string | undefined;
411
+ latestSessionId?: string | undefined;
412
+ }, {
413
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout" | "created";
414
+ taskId: string;
415
+ createdAt: string;
416
+ updatedAt: string;
417
+ url: string;
418
+ viewport: {
419
+ width: number;
420
+ height: number;
421
+ };
422
+ pin: {
423
+ x: number;
424
+ y: number;
425
+ body: string;
426
+ };
427
+ screenshotPath: string;
428
+ uiChangePacket: {
429
+ timestamp: string;
430
+ url: string;
431
+ viewport: {
432
+ width: number;
433
+ height: number;
434
+ };
435
+ id: string;
436
+ element: {
437
+ tag: string;
438
+ attributes: Record<string, string | null>;
439
+ boundingBox: {
440
+ width: number;
441
+ height: number;
442
+ x: number;
443
+ y: number;
444
+ };
445
+ role?: string | null | undefined;
446
+ text?: string | null | undefined;
447
+ };
448
+ nearbyText: string[];
449
+ domSnippet: string;
450
+ computedStyleSummary: Record<string, string>;
451
+ screenshotPath: string;
452
+ userRequest: string;
453
+ };
454
+ sessions: string[];
455
+ summary?: string | undefined;
456
+ changedFiles?: string[] | undefined;
457
+ errorCode?: string | undefined;
458
+ errorMessage?: string | undefined;
459
+ provider?: "codex" | "claude" | "cursor" | undefined;
460
+ model?: string | undefined;
461
+ latestSessionId?: string | undefined;
462
+ }>;
463
+ type TaskRecord = z.infer<typeof TaskRecordSchema>;
464
+ declare const SessionEventSchema: z.ZodObject<{
465
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
466
+ message: z.ZodString;
467
+ percent: z.ZodOptional<z.ZodNumber>;
468
+ timestamp: z.ZodString;
469
+ }, "strip", z.ZodTypeAny, {
470
+ message: string;
471
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
472
+ timestamp: string;
473
+ percent?: number | undefined;
474
+ }, {
475
+ message: string;
476
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
477
+ timestamp: string;
478
+ percent?: number | undefined;
479
+ }>;
480
+ type SessionEvent = z.infer<typeof SessionEventSchema>;
481
+ declare const SessionRecordSchema: z.ZodObject<{
482
+ sessionId: z.ZodString;
483
+ taskId: z.ZodString;
484
+ provider: z.ZodEnum<["codex", "claude", "cursor"]>;
485
+ model: z.ZodString;
486
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
487
+ dryRun: z.ZodBoolean;
488
+ startedAt: z.ZodString;
489
+ updatedAt: z.ZodString;
490
+ endedAt: z.ZodOptional<z.ZodString>;
491
+ events: z.ZodArray<z.ZodObject<{
492
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
493
+ message: z.ZodString;
494
+ percent: z.ZodOptional<z.ZodNumber>;
495
+ timestamp: z.ZodString;
496
+ }, "strip", z.ZodTypeAny, {
497
+ message: string;
498
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
499
+ timestamp: string;
500
+ percent?: number | undefined;
501
+ }, {
502
+ message: string;
503
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
504
+ timestamp: string;
505
+ percent?: number | undefined;
506
+ }>, "many">;
507
+ summary: z.ZodOptional<z.ZodString>;
508
+ changedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
509
+ errorCode: z.ZodOptional<z.ZodString>;
510
+ errorMessage: z.ZodOptional<z.ZodString>;
511
+ }, "strip", z.ZodTypeAny, {
512
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
513
+ taskId: string;
514
+ sessionId: string;
515
+ changedFiles: string[];
516
+ updatedAt: string;
517
+ provider: "codex" | "claude" | "cursor";
518
+ model: string;
519
+ dryRun: boolean;
520
+ startedAt: string;
521
+ events: {
522
+ message: string;
523
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
524
+ timestamp: string;
525
+ percent?: number | undefined;
526
+ }[];
527
+ summary?: string | undefined;
528
+ errorCode?: string | undefined;
529
+ errorMessage?: string | undefined;
530
+ endedAt?: string | undefined;
531
+ }, {
532
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
533
+ taskId: string;
534
+ sessionId: string;
535
+ updatedAt: string;
536
+ provider: "codex" | "claude" | "cursor";
537
+ model: string;
538
+ dryRun: boolean;
539
+ startedAt: string;
540
+ events: {
541
+ message: string;
542
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
543
+ timestamp: string;
544
+ percent?: number | undefined;
545
+ }[];
546
+ summary?: string | undefined;
547
+ changedFiles?: string[] | undefined;
548
+ errorCode?: string | undefined;
549
+ errorMessage?: string | undefined;
550
+ endedAt?: string | undefined;
551
+ }>;
552
+ type SessionRecord = z.infer<typeof SessionRecordSchema>;
553
+ declare const RuntimeLogLevelSchema: z.ZodEnum<["debug", "info", "warn", "error"]>;
554
+ declare const RuntimeLogEventSchema: z.ZodObject<{
555
+ timestamp: z.ZodString;
556
+ level: z.ZodEnum<["debug", "info", "warn", "error"]>;
557
+ component: z.ZodString;
558
+ taskId: z.ZodOptional<z.ZodString>;
559
+ sessionId: z.ZodOptional<z.ZodString>;
560
+ event: z.ZodString;
561
+ message: z.ZodString;
562
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ message: string;
565
+ timestamp: string;
566
+ level: "error" | "debug" | "info" | "warn";
567
+ component: string;
568
+ event: string;
569
+ taskId?: string | undefined;
570
+ sessionId?: string | undefined;
571
+ meta?: Record<string, unknown> | undefined;
572
+ }, {
573
+ message: string;
574
+ timestamp: string;
575
+ level: "error" | "debug" | "info" | "warn";
576
+ component: string;
577
+ event: string;
578
+ taskId?: string | undefined;
579
+ sessionId?: string | undefined;
580
+ meta?: Record<string, unknown> | undefined;
581
+ }>;
582
+ type RuntimeLogEvent = z.infer<typeof RuntimeLogEventSchema>;
583
+ declare const PinpatchConfigSchema: z.ZodObject<{
584
+ provider: z.ZodDefault<z.ZodEnum<["codex", "claude", "cursor"]>>;
585
+ model: z.ZodDefault<z.ZodString>;
586
+ target: z.ZodDefault<z.ZodNumber>;
587
+ debug: z.ZodDefault<z.ZodBoolean>;
588
+ bridgePort: z.ZodDefault<z.ZodNumber>;
589
+ proxyPort: z.ZodDefault<z.ZodNumber>;
590
+ }, "strip", z.ZodTypeAny, {
591
+ provider: "codex" | "claude" | "cursor";
592
+ model: string;
593
+ debug: boolean;
594
+ target: number;
595
+ bridgePort: number;
596
+ proxyPort: number;
597
+ }, {
598
+ provider?: "codex" | "claude" | "cursor" | undefined;
599
+ model?: string | undefined;
600
+ debug?: boolean | undefined;
601
+ target?: number | undefined;
602
+ bridgePort?: number | undefined;
603
+ proxyPort?: number | undefined;
604
+ }>;
605
+ type PinpatchConfig = z.infer<typeof PinpatchConfigSchema>;
606
+
607
+ declare const CreateTaskRequestSchema: z.ZodObject<{
608
+ sessionId: z.ZodString;
609
+ url: z.ZodString;
610
+ viewport: z.ZodObject<{
611
+ width: z.ZodNumber;
612
+ height: z.ZodNumber;
613
+ }, "strip", z.ZodTypeAny, {
614
+ width: number;
615
+ height: number;
616
+ }, {
617
+ width: number;
618
+ height: number;
619
+ }>;
620
+ pin: z.ZodObject<{
621
+ x: z.ZodNumber;
622
+ y: z.ZodNumber;
623
+ body: z.ZodString;
624
+ }, "strip", z.ZodTypeAny, {
625
+ x: number;
626
+ y: number;
627
+ body: string;
628
+ }, {
629
+ x: number;
630
+ y: number;
631
+ body: string;
632
+ }>;
633
+ uiChangePacket: z.ZodObject<{
634
+ id: z.ZodString;
635
+ timestamp: z.ZodString;
636
+ url: z.ZodString;
637
+ viewport: z.ZodObject<{
638
+ width: z.ZodNumber;
639
+ height: z.ZodNumber;
640
+ }, "strip", z.ZodTypeAny, {
641
+ width: number;
642
+ height: number;
643
+ }, {
644
+ width: number;
645
+ height: number;
646
+ }>;
647
+ element: z.ZodObject<{
648
+ tag: z.ZodString;
649
+ role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
650
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
651
+ attributes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNull]>>;
652
+ boundingBox: z.ZodObject<{
653
+ x: z.ZodNumber;
654
+ y: z.ZodNumber;
655
+ width: z.ZodNumber;
656
+ height: z.ZodNumber;
657
+ }, "strip", z.ZodTypeAny, {
658
+ width: number;
659
+ height: number;
660
+ x: number;
661
+ y: number;
662
+ }, {
663
+ width: number;
664
+ height: number;
665
+ x: number;
666
+ y: number;
667
+ }>;
668
+ }, "strip", z.ZodTypeAny, {
669
+ tag: string;
670
+ attributes: Record<string, string | null>;
671
+ boundingBox: {
672
+ width: number;
673
+ height: number;
674
+ x: number;
675
+ y: number;
676
+ };
677
+ role?: string | null | undefined;
678
+ text?: string | null | undefined;
679
+ }, {
680
+ tag: string;
681
+ attributes: Record<string, string | null>;
682
+ boundingBox: {
683
+ width: number;
684
+ height: number;
685
+ x: number;
686
+ y: number;
687
+ };
688
+ role?: string | null | undefined;
689
+ text?: string | null | undefined;
690
+ }>;
691
+ nearbyText: z.ZodArray<z.ZodString, "many">;
692
+ domSnippet: z.ZodString;
693
+ computedStyleSummary: z.ZodRecord<z.ZodString, z.ZodString>;
694
+ screenshotPath: z.ZodString;
695
+ userRequest: z.ZodString;
696
+ }, "strip", z.ZodTypeAny, {
697
+ timestamp: string;
698
+ url: string;
699
+ viewport: {
700
+ width: number;
701
+ height: number;
702
+ };
703
+ id: string;
704
+ element: {
705
+ tag: string;
706
+ attributes: Record<string, string | null>;
707
+ boundingBox: {
708
+ width: number;
709
+ height: number;
710
+ x: number;
711
+ y: number;
712
+ };
713
+ role?: string | null | undefined;
714
+ text?: string | null | undefined;
715
+ };
716
+ nearbyText: string[];
717
+ domSnippet: string;
718
+ computedStyleSummary: Record<string, string>;
719
+ screenshotPath: string;
720
+ userRequest: string;
721
+ }, {
722
+ timestamp: string;
723
+ url: string;
724
+ viewport: {
725
+ width: number;
726
+ height: number;
727
+ };
728
+ id: string;
729
+ element: {
730
+ tag: string;
731
+ attributes: Record<string, string | null>;
732
+ boundingBox: {
733
+ width: number;
734
+ height: number;
735
+ x: number;
736
+ y: number;
737
+ };
738
+ role?: string | null | undefined;
739
+ text?: string | null | undefined;
740
+ };
741
+ nearbyText: string[];
742
+ domSnippet: string;
743
+ computedStyleSummary: Record<string, string>;
744
+ screenshotPath: string;
745
+ userRequest: string;
746
+ }>;
747
+ screenshotPath: z.ZodString;
748
+ screenshotDataUrl: z.ZodOptional<z.ZodString>;
749
+ clientTaskId: z.ZodOptional<z.ZodString>;
750
+ }, "strip", z.ZodTypeAny, {
751
+ sessionId: string;
752
+ url: string;
753
+ viewport: {
754
+ width: number;
755
+ height: number;
756
+ };
757
+ pin: {
758
+ x: number;
759
+ y: number;
760
+ body: string;
761
+ };
762
+ screenshotPath: string;
763
+ uiChangePacket: {
764
+ timestamp: string;
765
+ url: string;
766
+ viewport: {
767
+ width: number;
768
+ height: number;
769
+ };
770
+ id: string;
771
+ element: {
772
+ tag: string;
773
+ attributes: Record<string, string | null>;
774
+ boundingBox: {
775
+ width: number;
776
+ height: number;
777
+ x: number;
778
+ y: number;
779
+ };
780
+ role?: string | null | undefined;
781
+ text?: string | null | undefined;
782
+ };
783
+ nearbyText: string[];
784
+ domSnippet: string;
785
+ computedStyleSummary: Record<string, string>;
786
+ screenshotPath: string;
787
+ userRequest: string;
788
+ };
789
+ screenshotDataUrl?: string | undefined;
790
+ clientTaskId?: string | undefined;
791
+ }, {
792
+ sessionId: string;
793
+ url: string;
794
+ viewport: {
795
+ width: number;
796
+ height: number;
797
+ };
798
+ pin: {
799
+ x: number;
800
+ y: number;
801
+ body: string;
802
+ };
803
+ screenshotPath: string;
804
+ uiChangePacket: {
805
+ timestamp: string;
806
+ url: string;
807
+ viewport: {
808
+ width: number;
809
+ height: number;
810
+ };
811
+ id: string;
812
+ element: {
813
+ tag: string;
814
+ attributes: Record<string, string | null>;
815
+ boundingBox: {
816
+ width: number;
817
+ height: number;
818
+ x: number;
819
+ y: number;
820
+ };
821
+ role?: string | null | undefined;
822
+ text?: string | null | undefined;
823
+ };
824
+ nearbyText: string[];
825
+ domSnippet: string;
826
+ computedStyleSummary: Record<string, string>;
827
+ screenshotPath: string;
828
+ userRequest: string;
829
+ };
830
+ screenshotDataUrl?: string | undefined;
831
+ clientTaskId?: string | undefined;
832
+ }>;
833
+ type CreateTaskRequest = z.infer<typeof CreateTaskRequestSchema>;
834
+ declare const CreateTaskResponseSchema: z.ZodObject<{
835
+ taskId: z.ZodString;
836
+ sessionId: z.ZodString;
837
+ status: z.ZodLiteral<"created">;
838
+ taskPath: z.ZodString;
839
+ eventsUrl: z.ZodString;
840
+ }, "strip", z.ZodTypeAny, {
841
+ status: "created";
842
+ taskId: string;
843
+ sessionId: string;
844
+ taskPath: string;
845
+ eventsUrl: string;
846
+ }, {
847
+ status: "created";
848
+ taskId: string;
849
+ sessionId: string;
850
+ taskPath: string;
851
+ eventsUrl: string;
852
+ }>;
853
+ type CreateTaskResponse = z.infer<typeof CreateTaskResponseSchema>;
854
+ declare const SubmitTaskRequestSchema: z.ZodObject<{
855
+ sessionId: z.ZodString;
856
+ provider: z.ZodEnum<["codex", "claude", "cursor"]>;
857
+ model: z.ZodString;
858
+ dryRun: z.ZodDefault<z.ZodBoolean>;
859
+ debug: z.ZodDefault<z.ZodBoolean>;
860
+ followUpBody: z.ZodOptional<z.ZodString>;
861
+ }, "strip", z.ZodTypeAny, {
862
+ sessionId: string;
863
+ provider: "codex" | "claude" | "cursor";
864
+ model: string;
865
+ dryRun: boolean;
866
+ debug: boolean;
867
+ followUpBody?: string | undefined;
868
+ }, {
869
+ sessionId: string;
870
+ provider: "codex" | "claude" | "cursor";
871
+ model: string;
872
+ dryRun?: boolean | undefined;
873
+ debug?: boolean | undefined;
874
+ followUpBody?: string | undefined;
875
+ }>;
876
+ type SubmitTaskRequest = z.infer<typeof SubmitTaskRequestSchema>;
877
+ declare const SubmitTaskResponseSchema: z.ZodObject<{
878
+ taskId: z.ZodString;
879
+ sessionId: z.ZodString;
880
+ status: z.ZodLiteral<"queued">;
881
+ acceptedAt: z.ZodString;
882
+ eventsUrl: z.ZodString;
883
+ }, "strip", z.ZodTypeAny, {
884
+ status: "queued";
885
+ taskId: string;
886
+ sessionId: string;
887
+ eventsUrl: string;
888
+ acceptedAt: string;
889
+ }, {
890
+ status: "queued";
891
+ taskId: string;
892
+ sessionId: string;
893
+ eventsUrl: string;
894
+ acceptedAt: string;
895
+ }>;
896
+ type SubmitTaskResponse = z.infer<typeof SubmitTaskResponseSchema>;
897
+ declare const SseProgressEventSchema: z.ZodObject<{
898
+ type: z.ZodLiteral<"progress">;
899
+ taskId: z.ZodString;
900
+ sessionId: z.ZodString;
901
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
902
+ message: z.ZodString;
903
+ percent: z.ZodOptional<z.ZodNumber>;
904
+ timestamp: z.ZodString;
905
+ }, "strip", z.ZodTypeAny, {
906
+ message: string;
907
+ type: "progress";
908
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
909
+ taskId: string;
910
+ sessionId: string;
911
+ timestamp: string;
912
+ percent?: number | undefined;
913
+ }, {
914
+ message: string;
915
+ type: "progress";
916
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
917
+ taskId: string;
918
+ sessionId: string;
919
+ timestamp: string;
920
+ percent?: number | undefined;
921
+ }>;
922
+ type SseProgressEvent = z.infer<typeof SseProgressEventSchema>;
923
+ declare const SseTerminalEventSchema: z.ZodObject<{
924
+ type: z.ZodLiteral<"terminal">;
925
+ taskId: z.ZodString;
926
+ sessionId: z.ZodString;
927
+ status: z.ZodEnum<["completed", "error", "cancelled", "timeout"]>;
928
+ summary: z.ZodString;
929
+ changedFiles: z.ZodArray<z.ZodString, "many">;
930
+ errorCode: z.ZodOptional<z.ZodString>;
931
+ errorMessage: z.ZodOptional<z.ZodString>;
932
+ timestamp: z.ZodString;
933
+ }, "strip", z.ZodTypeAny, {
934
+ type: "terminal";
935
+ status: "completed" | "error" | "cancelled" | "timeout";
936
+ taskId: string;
937
+ sessionId: string;
938
+ timestamp: string;
939
+ summary: string;
940
+ changedFiles: string[];
941
+ errorCode?: string | undefined;
942
+ errorMessage?: string | undefined;
943
+ }, {
944
+ type: "terminal";
945
+ status: "completed" | "error" | "cancelled" | "timeout";
946
+ taskId: string;
947
+ sessionId: string;
948
+ timestamp: string;
949
+ summary: string;
950
+ changedFiles: string[];
951
+ errorCode?: string | undefined;
952
+ errorMessage?: string | undefined;
953
+ }>;
954
+ type SseTerminalEvent = z.infer<typeof SseTerminalEventSchema>;
955
+ declare const SseHeartbeatEventSchema: z.ZodObject<{
956
+ type: z.ZodLiteral<"heartbeat">;
957
+ timestamp: z.ZodString;
958
+ }, "strip", z.ZodTypeAny, {
959
+ type: "heartbeat";
960
+ timestamp: string;
961
+ }, {
962
+ type: "heartbeat";
963
+ timestamp: string;
964
+ }>;
965
+ type SseHeartbeatEvent = z.infer<typeof SseHeartbeatEventSchema>;
966
+ declare const SseEventSchema: z.ZodUnion<[z.ZodObject<{
967
+ type: z.ZodLiteral<"progress">;
968
+ taskId: z.ZodString;
969
+ sessionId: z.ZodString;
970
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
971
+ message: z.ZodString;
972
+ percent: z.ZodOptional<z.ZodNumber>;
973
+ timestamp: z.ZodString;
974
+ }, "strip", z.ZodTypeAny, {
975
+ message: string;
976
+ type: "progress";
977
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
978
+ taskId: string;
979
+ sessionId: string;
980
+ timestamp: string;
981
+ percent?: number | undefined;
982
+ }, {
983
+ message: string;
984
+ type: "progress";
985
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
986
+ taskId: string;
987
+ sessionId: string;
988
+ timestamp: string;
989
+ percent?: number | undefined;
990
+ }>, z.ZodObject<{
991
+ type: z.ZodLiteral<"terminal">;
992
+ taskId: z.ZodString;
993
+ sessionId: z.ZodString;
994
+ status: z.ZodEnum<["completed", "error", "cancelled", "timeout"]>;
995
+ summary: z.ZodString;
996
+ changedFiles: z.ZodArray<z.ZodString, "many">;
997
+ errorCode: z.ZodOptional<z.ZodString>;
998
+ errorMessage: z.ZodOptional<z.ZodString>;
999
+ timestamp: z.ZodString;
1000
+ }, "strip", z.ZodTypeAny, {
1001
+ type: "terminal";
1002
+ status: "completed" | "error" | "cancelled" | "timeout";
1003
+ taskId: string;
1004
+ sessionId: string;
1005
+ timestamp: string;
1006
+ summary: string;
1007
+ changedFiles: string[];
1008
+ errorCode?: string | undefined;
1009
+ errorMessage?: string | undefined;
1010
+ }, {
1011
+ type: "terminal";
1012
+ status: "completed" | "error" | "cancelled" | "timeout";
1013
+ taskId: string;
1014
+ sessionId: string;
1015
+ timestamp: string;
1016
+ summary: string;
1017
+ changedFiles: string[];
1018
+ errorCode?: string | undefined;
1019
+ errorMessage?: string | undefined;
1020
+ }>, z.ZodObject<{
1021
+ type: z.ZodLiteral<"heartbeat">;
1022
+ timestamp: z.ZodString;
1023
+ }, "strip", z.ZodTypeAny, {
1024
+ type: "heartbeat";
1025
+ timestamp: string;
1026
+ }, {
1027
+ type: "heartbeat";
1028
+ timestamp: string;
1029
+ }>]>;
1030
+ type SseEvent = z.infer<typeof SseEventSchema>;
1031
+
1032
+ declare const ProviderNameSchema: z.ZodEnum<["codex", "claude", "cursor"]>;
1033
+ type ProviderName = z.infer<typeof ProviderNameSchema>;
1034
+ declare const ProviderProgressStatusSchema: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
1035
+ type ProviderProgressStatus = z.infer<typeof ProviderProgressStatusSchema>;
1036
+ declare const ProviderTerminalStatusSchema: z.ZodEnum<["completed", "error", "cancelled", "timeout"]>;
1037
+ type ProviderTerminalStatus = z.infer<typeof ProviderTerminalStatusSchema>;
1038
+ declare const ProviderProgressSchema: z.ZodObject<{
1039
+ taskId: z.ZodString;
1040
+ sessionId: z.ZodString;
1041
+ status: z.ZodEnum<["queued", "running", "completed", "error", "cancelled", "timeout"]>;
1042
+ message: z.ZodString;
1043
+ percent: z.ZodOptional<z.ZodNumber>;
1044
+ timestamp: z.ZodString;
1045
+ }, "strip", z.ZodTypeAny, {
1046
+ message: string;
1047
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
1048
+ taskId: string;
1049
+ sessionId: string;
1050
+ timestamp: string;
1051
+ percent?: number | undefined;
1052
+ }, {
1053
+ message: string;
1054
+ status: "queued" | "running" | "completed" | "error" | "cancelled" | "timeout";
1055
+ taskId: string;
1056
+ sessionId: string;
1057
+ timestamp: string;
1058
+ percent?: number | undefined;
1059
+ }>;
1060
+ type ProviderProgress = z.infer<typeof ProviderProgressSchema>;
1061
+ declare const ProviderResultSchema: z.ZodObject<{
1062
+ taskId: z.ZodString;
1063
+ sessionId: z.ZodString;
1064
+ status: z.ZodEnum<["completed", "error", "cancelled", "timeout"]>;
1065
+ summary: z.ZodString;
1066
+ changedFiles: z.ZodArray<z.ZodString, "many">;
1067
+ errorCode: z.ZodOptional<z.ZodString>;
1068
+ errorMessage: z.ZodOptional<z.ZodString>;
1069
+ }, "strip", z.ZodTypeAny, {
1070
+ status: "completed" | "error" | "cancelled" | "timeout";
1071
+ taskId: string;
1072
+ sessionId: string;
1073
+ summary: string;
1074
+ changedFiles: string[];
1075
+ errorCode?: string | undefined;
1076
+ errorMessage?: string | undefined;
1077
+ }, {
1078
+ status: "completed" | "error" | "cancelled" | "timeout";
1079
+ taskId: string;
1080
+ sessionId: string;
1081
+ summary: string;
1082
+ changedFiles: string[];
1083
+ errorCode?: string | undefined;
1084
+ errorMessage?: string | undefined;
1085
+ }>;
1086
+ type ProviderResult = z.infer<typeof ProviderResultSchema>;
1087
+ type ProviderTaskInput = {
1088
+ taskId: string;
1089
+ sessionId: string;
1090
+ task: TaskRecord;
1091
+ prompt: string;
1092
+ model: string;
1093
+ dryRun: boolean;
1094
+ debug: boolean;
1095
+ cwd: string;
1096
+ timeoutMs: number;
1097
+ };
1098
+ interface ProviderAdapter {
1099
+ name: ProviderName;
1100
+ submitTask(input: ProviderTaskInput, onProgress: (event: ProviderProgress) => void): Promise<ProviderResult>;
1101
+ cancelTask(taskId: string, sessionId: string): Promise<void>;
1102
+ }
1103
+ declare const ProviderErrorCodes: {
1104
+ readonly ProviderUnavailable: "PROVIDER_UNAVAILABLE";
1105
+ readonly ProviderNotEnabled: "PROVIDER_NOT_ENABLED";
1106
+ readonly ProviderTimeout: "PROVIDER_TIMEOUT";
1107
+ readonly ProcessFailed: "PROVIDER_PROCESS_FAILED";
1108
+ readonly ValidationFailed: "PROVIDER_VALIDATION_FAILED";
1109
+ readonly Unknown: "UNKNOWN";
1110
+ };
1111
+
1112
+ type ConfigOverrides = Partial<{
1113
+ provider: ProviderName;
1114
+ model: string;
1115
+ target: number;
1116
+ debug: boolean;
1117
+ bridgePort: number;
1118
+ proxyPort: number;
1119
+ }>;
1120
+ declare const DEFAULT_CONFIG: PinpatchConfig;
1121
+ declare const readConfigFile: (cwd: string) => Promise<Partial<PinpatchConfig>>;
1122
+ declare const resolveConfig: (cwd: string, overrides?: ConfigOverrides) => Promise<PinpatchConfig>;
1123
+ declare const ensureConfigFile: (cwd: string) => Promise<PinpatchConfig>;
1124
+ declare const getConfigPath: (cwd: string) => string;
1125
+
1126
+ type PruneResult = {
1127
+ removedLogs: number;
1128
+ removedSessions: number;
1129
+ };
1130
+ declare class ArtifactStore {
1131
+ readonly cwd: string;
1132
+ readonly rootDir: string;
1133
+ readonly tasksDir: string;
1134
+ readonly sessionsDir: string;
1135
+ readonly screenshotsDir: string;
1136
+ readonly runtimeDir: string;
1137
+ readonly logsDir: string;
1138
+ readonly configPath: string;
1139
+ constructor(cwd: string);
1140
+ ensureStructure(): Promise<void>;
1141
+ ensureGitignoreEntry(): Promise<void>;
1142
+ getTaskPath(taskId: string): string;
1143
+ getSessionPath(sessionId: string): string;
1144
+ getRelativePath(absolutePath: string): string;
1145
+ readConfig(): Promise<PinpatchConfig>;
1146
+ writeConfig(config: PinpatchConfig): Promise<void>;
1147
+ createTask(task: TaskRecord): Promise<TaskRecord>;
1148
+ getTask(taskId: string): Promise<TaskRecord | undefined>;
1149
+ updateTask(taskId: string, updater: (current: TaskRecord) => TaskRecord): Promise<TaskRecord>;
1150
+ listTasks(): Promise<TaskRecord[]>;
1151
+ createSession(session: SessionRecord): Promise<SessionRecord>;
1152
+ getSession(sessionId: string): Promise<SessionRecord | undefined>;
1153
+ updateSession(sessionId: string, updater: (current: SessionRecord) => SessionRecord): Promise<SessionRecord>;
1154
+ listSessions(): Promise<SessionRecord[]>;
1155
+ writeScreenshot(taskId: string, screenshotDataUrl: string): Promise<string>;
1156
+ appendLog(logPath: string, event: RuntimeLogEvent): Promise<void>;
1157
+ prune(options?: {
1158
+ logsOlderThanDays?: number;
1159
+ orphanSessionAgeHours?: number;
1160
+ }): Promise<PruneResult>;
1161
+ }
1162
+
1163
+ declare const nowIso: () => string;
1164
+ declare const generateSessionId: () => string;
1165
+ declare const generateTaskId: () => string;
1166
+
1167
+ declare class TaskEventBus {
1168
+ private readonly emitter;
1169
+ subscribe(taskId: string, sessionId: string, listener: (event: SseEvent) => void): () => void;
1170
+ publish(taskId: string, sessionId: string, event: SseEvent): void;
1171
+ }
1172
+
1173
+ type LogLevel = "debug" | "info" | "warn" | "error";
1174
+ type LoggerMeta = Record<string, unknown>;
1175
+ type Logger = {
1176
+ debug(message: string, details?: Omit<RuntimeLogEvent, "timestamp" | "level" | "message">): void;
1177
+ info(message: string, details?: Omit<RuntimeLogEvent, "timestamp" | "level" | "message">): void;
1178
+ warn(message: string, details?: Omit<RuntimeLogEvent, "timestamp" | "level" | "message">): void;
1179
+ error(message: string, details?: Omit<RuntimeLogEvent, "timestamp" | "level" | "message">): void;
1180
+ };
1181
+ declare const createLogger: (options: {
1182
+ store: ArtifactStore;
1183
+ debugEnabled: boolean;
1184
+ component: string;
1185
+ maxFileSizeBytes?: number;
1186
+ }) => Logger;
1187
+
1188
+ type TaskRunnerOptions = {
1189
+ cwd: string;
1190
+ store: ArtifactStore;
1191
+ logger: Logger;
1192
+ eventBus: TaskEventBus;
1193
+ getProviderAdapter(provider: ProviderName): ProviderAdapter | undefined;
1194
+ defaultTimeoutMs?: number;
1195
+ dryRunTimeoutMs?: number;
1196
+ };
1197
+ type RunTaskInput = {
1198
+ taskId: string;
1199
+ sessionId: string;
1200
+ provider: ProviderName;
1201
+ model: string;
1202
+ dryRun: boolean;
1203
+ debug: boolean;
1204
+ };
1205
+ declare class TaskRunner {
1206
+ private readonly cwd;
1207
+ private readonly store;
1208
+ private readonly logger;
1209
+ private readonly eventBus;
1210
+ private readonly getProviderAdapter;
1211
+ private readonly defaultTimeoutMs;
1212
+ private readonly dryRunTimeoutMs;
1213
+ private readonly inFlight;
1214
+ constructor(options: TaskRunnerOptions);
1215
+ private key;
1216
+ cancelTask(taskId: string, sessionId: string): Promise<void>;
1217
+ runTask(input: RunTaskInput): Promise<ProviderResult>;
1218
+ private buildPrompt;
1219
+ private persistTerminalState;
1220
+ }
1221
+
1222
+ type BridgeServerOptions = {
1223
+ cwd: string;
1224
+ port: number;
1225
+ store: ArtifactStore;
1226
+ logger: Logger;
1227
+ overlayScriptPath?: string;
1228
+ getProviderAdapter(provider: ProviderName): ProviderAdapter | undefined;
1229
+ };
1230
+ type BridgeServerHandle = {
1231
+ app: express.Express;
1232
+ server: Server;
1233
+ eventBus: TaskEventBus;
1234
+ taskRunner: TaskRunner;
1235
+ start(): Promise<void>;
1236
+ stop(): Promise<void>;
1237
+ };
1238
+ declare const createBridgeServer: (options: BridgeServerOptions) => BridgeServerHandle;
1239
+
1240
+ export { ArtifactStore, type BoundingBox, BoundingBoxSchema, type BridgeServerHandle, type BridgeServerOptions, type ConfigOverrides, type CreateTaskRequest, CreateTaskRequestSchema, type CreateTaskResponse, CreateTaskResponseSchema, DEFAULT_CONFIG, type ElementDescriptor, ElementDescriptorSchema, type LogLevel, type Logger, type LoggerMeta, type PinState, PinStateSchema, type PinpatchConfig, PinpatchConfigSchema, type ProviderAdapter, ProviderErrorCodes, type ProviderName, ProviderNameSchema, type ProviderProgress, ProviderProgressSchema, type ProviderProgressStatus, ProviderProgressStatusSchema, type ProviderResult, ProviderResultSchema, type ProviderTaskInput, type ProviderTerminalStatus, ProviderTerminalStatusSchema, type PruneResult, type RunTaskInput, type RuntimeLogEvent, RuntimeLogEventSchema, RuntimeLogLevelSchema, type SessionEvent, SessionEventSchema, type SessionRecord, SessionRecordSchema, type SseEvent, SseEventSchema, type SseHeartbeatEvent, SseHeartbeatEventSchema, type SseProgressEvent, SseProgressEventSchema, type SseTerminalEvent, SseTerminalEventSchema, type SubmitTaskRequest, SubmitTaskRequestSchema, type SubmitTaskResponse, SubmitTaskResponseSchema, TaskEventBus, TaskPinSchema, type TaskRecord, TaskRecordSchema, TaskRunner, type TaskRunnerOptions, type TaskStatus, TaskStatusSchema, type UiChangePacket, UiChangePacketSchema, type Viewport, ViewportSchema, createBridgeServer, createLogger, ensureConfigFile, generateSessionId, generateTaskId, getConfigPath, nowIso, readConfigFile, resolveConfig };