@poncho-ai/cli 0.21.13 → 0.22.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,2074 @@
1
+ import {
2
+ consumeFirstRunIntro,
3
+ inferConversationTitle,
4
+ resolveHarnessEnvironment
5
+ } from "./chunk-I4FRCKEB.js";
6
+
7
+ // src/run-interactive-ink.ts
8
+ import * as readline from "readline";
9
+ import { readFile } from "fs/promises";
10
+ import { resolve, basename } from "path";
11
+ import { stdout } from "process";
12
+ import {
13
+ parseAgentFile
14
+ } from "@poncho-ai/harness";
15
+
16
+ // src/mascot.ts
17
+ var renderTruecolor = (r, g, b, text) => `\x1B[38;2;${r};${g};${b}m${text}`;
18
+ var colorizedMascot = [
19
+ [
20
+ [30, 30, 30, " "]
21
+ ],
22
+ [
23
+ [30, 30, 30, " "]
24
+ ],
25
+ [
26
+ [30, 30, 30, " "],
27
+ [29, 29, 29, " "],
28
+ [28, 28, 28, " "],
29
+ [25, 25, 25, " "],
30
+ [20, 20, 20, " "],
31
+ [16, 16, 16, " "],
32
+ [19, 20, 20, " "],
33
+ [26, 29, 30, " "],
34
+ [36, 40, 41, "."],
35
+ [44, 50, 51, "."],
36
+ [50, 56, 58, "."],
37
+ [52, 60, 62, "::"],
38
+ [48, 55, 57, "."],
39
+ [43, 48, 50, "."],
40
+ [35, 39, 40, "."],
41
+ [26, 28, 29, " "],
42
+ [19, 20, 20, " "],
43
+ [16, 17, 17, " "],
44
+ [20, 20, 20, " "],
45
+ [25, 25, 25, " "],
46
+ [28, 28, 28, " "],
47
+ [29, 29, 29, " "],
48
+ [30, 30, 30, " "]
49
+ ],
50
+ [
51
+ [30, 30, 30, " "],
52
+ [29, 29, 29, " "],
53
+ [27, 27, 27, " "],
54
+ [21, 21, 21, " "],
55
+ [18, 19, 19, " "],
56
+ [37, 41, 42, "."],
57
+ [69, 78, 81, ":"],
58
+ [96, 108, 112, "-"],
59
+ [114, 130, 134, "="],
60
+ [138, 143, 132, "="],
61
+ [165, 149, 107, "+"],
62
+ [175, 162, 114, "+"],
63
+ [163, 156, 121, "+"],
64
+ [165, 160, 128, "+"],
65
+ [166, 162, 131, "+"],
66
+ [168, 168, 142, "+"],
67
+ [167, 172, 153, "+"],
68
+ [164, 174, 165, "+"],
69
+ [160, 178, 178, "*"],
70
+ [159, 180, 184, "*"],
71
+ [157, 178, 184, "*"],
72
+ [152, 172, 178, "+"],
73
+ [140, 158, 163, "+"],
74
+ [120, 135, 139, "="],
75
+ [99, 111, 115, "-"],
76
+ [70, 78, 81, ":"],
77
+ [36, 40, 41, "."],
78
+ [18, 19, 19, " "],
79
+ [21, 21, 21, " "],
80
+ [27, 27, 27, " "],
81
+ [29, 29, 29, " "],
82
+ [30, 30, 30, " "]
83
+ ],
84
+ [
85
+ [30, 30, 30, " "],
86
+ [29, 29, 29, " "],
87
+ [26, 26, 26, " "],
88
+ [18, 19, 19, " "],
89
+ [27, 30, 31, "."],
90
+ [71, 81, 84, ":"],
91
+ [114, 129, 134, "="],
92
+ [145, 162, 169, "+"],
93
+ [154, 172, 179, "+"],
94
+ [154, 168, 169, "+"],
95
+ [155, 146, 125, "+"],
96
+ [175, 137, 82, "+"],
97
+ [205, 154, 56, "+"],
98
+ [232, 181, 47, "*"],
99
+ [245, 199, 55, "*"],
100
+ [247, 209, 73, "#"],
101
+ [248, 217, 90, "#"],
102
+ [245, 217, 100, "#"],
103
+ [239, 212, 106, "#"],
104
+ [235, 211, 112, "#"],
105
+ [236, 215, 118, "#"],
106
+ [229, 208, 115, "#"],
107
+ [212, 197, 128, "*"],
108
+ [180, 178, 144, "*"],
109
+ [161, 171, 165, "+"],
110
+ [164, 182, 187, "*"],
111
+ [164, 183, 189, "**"],
112
+ [166, 186, 191, "*"],
113
+ [161, 182, 185, "*"],
114
+ [133, 155, 149, "+"],
115
+ [87, 110, 91, "-"],
116
+ [45, 60, 46, "."],
117
+ [19, 22, 19, " "],
118
+ [19, 19, 19, " "],
119
+ [27, 27, 27, " "],
120
+ [29, 29, 29, " "],
121
+ [30, 30, 30, " "]
122
+ ],
123
+ [
124
+ [30, 30, 30, " "],
125
+ [29, 29, 29, " "],
126
+ [24, 24, 24, " "],
127
+ [18, 20, 19, " "],
128
+ [59, 69, 66, ":"],
129
+ [123, 142, 145, "="],
130
+ [158, 179, 185, "*"],
131
+ [159, 180, 187, "*"],
132
+ [159, 179, 186, "*"],
133
+ [160, 173, 174, "+"],
134
+ [161, 144, 113, "+"],
135
+ [190, 137, 64, "+"],
136
+ [210, 148, 50, "+"],
137
+ [228, 174, 52, "*"],
138
+ [240, 188, 49, "*"],
139
+ [244, 192, 47, "*"],
140
+ [245, 195, 46, "*"],
141
+ [246, 202, 61, "#"],
142
+ [245, 209, 81, "#"],
143
+ [246, 213, 87, "#"],
144
+ [246, 213, 89, "#"],
145
+ [247, 212, 83, "#"],
146
+ [239, 202, 76, "#"],
147
+ [237, 202, 80, "#"],
148
+ [245, 211, 85, "#"],
149
+ [243, 213, 96, "#"],
150
+ [224, 202, 114, "#"],
151
+ [184, 178, 136, "*"],
152
+ [169, 182, 176, "*"],
153
+ [173, 194, 198, "*"],
154
+ [161, 183, 184, "*"],
155
+ [129, 158, 140, "+"],
156
+ [116, 150, 120, "="],
157
+ [110, 146, 111, "="],
158
+ [106, 142, 106, "="],
159
+ [109, 143, 97, "="],
160
+ [79, 107, 70, "-"],
161
+ [35, 47, 32, "."],
162
+ [16, 18, 15, " "],
163
+ [24, 24, 24, " "],
164
+ [29, 29, 29, " "],
165
+ [30, 30, 30, " "]
166
+ ],
167
+ [
168
+ [30, 30, 30, " "],
169
+ [29, 29, 29, " "],
170
+ [25, 25, 25, " "],
171
+ [15, 17, 14, " "],
172
+ [64, 79, 52, ":"],
173
+ [119, 147, 97, "="],
174
+ [145, 175, 133, "+"],
175
+ [172, 200, 193, "*"],
176
+ [182, 207, 210, "#"],
177
+ [179, 203, 207, "*"],
178
+ [175, 184, 179, "*"],
179
+ [173, 137, 91, "+"],
180
+ [200, 135, 53, "+"],
181
+ [211, 151, 55, "+"],
182
+ [229, 172, 46, "*"],
183
+ [228, 177, 48, "*"],
184
+ [240, 191, 46, "*"],
185
+ [238, 193, 57, "*"],
186
+ [237, 194, 61, "*"],
187
+ [242, 192, 45, "*"],
188
+ [242, 193, 46, "*"],
189
+ [242, 194, 48, "*"],
190
+ [243, 195, 52, "*"],
191
+ [243, 195, 54, "*"],
192
+ [241, 192, 53, "*"],
193
+ [230, 181, 51, "*"],
194
+ [228, 179, 53, "*"],
195
+ [233, 185, 58, "*"],
196
+ [234, 185, 58, "*"],
197
+ [234, 193, 80, "*"],
198
+ [204, 183, 113, "*"],
199
+ [181, 188, 171, "*"],
200
+ [155, 178, 173, "*"],
201
+ [116, 148, 127, "="],
202
+ [100, 135, 104, "="],
203
+ [99, 133, 99, "="],
204
+ [95, 130, 98, "="],
205
+ [95, 132, 95, "="],
206
+ [101, 139, 93, "="],
207
+ [97, 135, 90, "="],
208
+ [75, 109, 73, "-"],
209
+ [35, 53, 36, "."],
210
+ [14, 16, 14, " "],
211
+ [25, 25, 25, " "],
212
+ [29, 29, 29, " "],
213
+ [30, 30, 30, " "]
214
+ ],
215
+ [
216
+ [30, 30, 30, " "],
217
+ [29, 29, 29, " "],
218
+ [28, 28, 28, " "],
219
+ [15, 16, 16, " "],
220
+ [25, 37, 29, "."],
221
+ [71, 101, 76, "-"],
222
+ [96, 130, 94, "="],
223
+ [119, 149, 109, "="],
224
+ [152, 179, 152, "+"],
225
+ [186, 208, 207, "#"],
226
+ [192, 212, 217, "#"],
227
+ [184, 198, 198, "*"],
228
+ [176, 156, 124, "+"],
229
+ [204, 145, 69, "+"],
230
+ [203, 132, 47, "+"],
231
+ [210, 142, 42, "+"],
232
+ [213, 150, 43, "+"],
233
+ [208, 145, 43, "+"],
234
+ [219, 157, 44, "+"],
235
+ [215, 155, 44, "+"],
236
+ [210, 154, 42, "+"],
237
+ [224, 172, 43, "*"],
238
+ [235, 186, 49, "*"],
239
+ [234, 185, 50, "*"],
240
+ [235, 187, 50, "*"],
241
+ [241, 195, 54, "*"],
242
+ [246, 205, 67, "#"],
243
+ [248, 215, 86, "#"],
244
+ [249, 223, 105, "#"],
245
+ [249, 229, 121, "#"],
246
+ [247, 227, 123, "#"],
247
+ [246, 224, 117, "#"],
248
+ [244, 219, 107, "#"],
249
+ [237, 207, 93, "#"],
250
+ [220, 191, 92, "*"],
251
+ [202, 189, 109, "*"],
252
+ [167, 164, 107, "+"],
253
+ [121, 132, 87, "="],
254
+ [102, 132, 97, "="],
255
+ [92, 129, 94, "="],
256
+ [82, 119, 88, "-"],
257
+ [80, 120, 86, "-"],
258
+ [84, 125, 85, "-"],
259
+ [90, 129, 86, "-"],
260
+ [72, 104, 71, "-"],
261
+ [23, 34, 24, "."],
262
+ [17, 18, 17, " "],
263
+ [27, 27, 27, " "],
264
+ [30, 30, 30, " "]
265
+ ],
266
+ [
267
+ [30, 30, 30, " "],
268
+ [29, 29, 29, " "],
269
+ [26, 26, 26, " "],
270
+ [10, 11, 8, " "],
271
+ [80, 103, 64, "-"],
272
+ [111, 144, 96, "="],
273
+ [92, 125, 92, "-"],
274
+ [105, 138, 102, "="],
275
+ [141, 173, 145, "+"],
276
+ [182, 208, 203, "#"],
277
+ [193, 217, 219, "#"],
278
+ [196, 218, 223, "#"],
279
+ [192, 201, 192, "*"],
280
+ [183, 143, 91, "+"],
281
+ [203, 141, 64, "+"],
282
+ [200, 130, 45, "="],
283
+ [199, 128, 40, "="],
284
+ [195, 128, 38, "="],
285
+ [209, 146, 43, "+"],
286
+ [229, 175, 47, "*"],
287
+ [240, 190, 47, "*"],
288
+ [244, 197, 48, "*"],
289
+ [245, 199, 49, "*"],
290
+ [244, 203, 59, "#"],
291
+ [237, 197, 68, "*"],
292
+ [218, 172, 60, "*"],
293
+ [179, 136, 47, "="],
294
+ [136, 104, 42, "-"],
295
+ [102, 81, 38, ":"],
296
+ [80, 67, 35, ":"],
297
+ [71, 60, 36, ":"],
298
+ [68, 58, 37, ":"],
299
+ [72, 61, 43, ":"],
300
+ [91, 79, 63, ":"],
301
+ [123, 109, 97, "-"],
302
+ [136, 120, 110, "="],
303
+ [133, 96, 64, "-"],
304
+ [147, 85, 30, "-"],
305
+ [158, 93, 32, "-"],
306
+ [152, 94, 36, "-"],
307
+ [153, 112, 51, "="],
308
+ [129, 116, 65, "="],
309
+ [82, 108, 78, "-"],
310
+ [64, 105, 79, "-"],
311
+ [60, 103, 78, "-"],
312
+ [59, 98, 76, ":"],
313
+ [56, 95, 83, ":"],
314
+ [27, 52, 46, "."],
315
+ [10, 14, 13, " "],
316
+ [26, 26, 26, " "],
317
+ [29, 29, 29, " "],
318
+ [30, 30, 30, " "]
319
+ ],
320
+ [
321
+ [30, 30, 30, " "],
322
+ [29, 29, 29, " "],
323
+ [24, 24, 24, " "],
324
+ [11, 14, 10, " "],
325
+ [74, 104, 69, "-"],
326
+ [104, 135, 96, "="],
327
+ [105, 141, 94, "="],
328
+ [100, 135, 95, "="],
329
+ [107, 143, 101, "="],
330
+ [120, 156, 106, "="],
331
+ [134, 165, 119, "+"],
332
+ [151, 177, 148, "+"],
333
+ [190, 214, 213, "#"],
334
+ [195, 200, 189, "*"],
335
+ [181, 129, 71, "="],
336
+ [195, 127, 48, "="],
337
+ [203, 134, 46, "+"],
338
+ [214, 151, 50, "+"],
339
+ [229, 173, 49, "*"],
340
+ [234, 184, 51, "*"],
341
+ [222, 170, 47, "*"],
342
+ [180, 130, 37, "="],
343
+ [117, 84, 29, "-"],
344
+ [68, 56, 28, "."],
345
+ [41, 37, 25, "."],
346
+ [23, 25, 23, " "],
347
+ [14, 21, 24, " "],
348
+ [11, 20, 25, " "],
349
+ [11, 22, 27, " "],
350
+ [15, 27, 32, " "],
351
+ [20, 32, 36, "."],
352
+ [24, 36, 39, "."],
353
+ [34, 46, 49, "."],
354
+ [42, 54, 57, "."],
355
+ [55, 68, 70, ":"],
356
+ [48, 60, 61, "."],
357
+ [40, 49, 53, "."],
358
+ [90, 94, 100, "-"],
359
+ [122, 89, 68, "-"],
360
+ [147, 81, 32, "-"],
361
+ [163, 92, 30, "-"],
362
+ [168, 96, 31, "-"],
363
+ [168, 98, 28, "-"],
364
+ [140, 105, 48, "-"],
365
+ [74, 97, 74, "-"],
366
+ [50, 93, 79, ":"],
367
+ [48, 81, 70, ":"],
368
+ [52, 78, 70, ":"],
369
+ [46, 82, 71, ":"],
370
+ [37, 56, 47, "."],
371
+ [9, 10, 9, " "],
372
+ [25, 25, 25, " "],
373
+ [29, 29, 29, " "],
374
+ [30, 30, 30, " "]
375
+ ],
376
+ [
377
+ [30, 30, 30, " "],
378
+ [25, 25, 25, " "],
379
+ [7, 10, 7, " "],
380
+ [56, 87, 64, ":"],
381
+ [81, 115, 76, "-"],
382
+ [114, 147, 95, "="],
383
+ [108, 141, 86, "="],
384
+ [108, 143, 85, "="],
385
+ [110, 143, 91, "="],
386
+ [111, 145, 88, "="],
387
+ [115, 146, 92, "="],
388
+ [126, 155, 105, "="],
389
+ [150, 163, 121, "+"],
390
+ [180, 146, 99, "+"],
391
+ [199, 132, 57, "+"],
392
+ [207, 138, 48, "+"],
393
+ [209, 145, 45, "+"],
394
+ [178, 127, 54, "="],
395
+ [143, 116, 86, "="],
396
+ [134, 123, 118, "="],
397
+ [94, 92, 96, "-"],
398
+ [25, 32, 34, "."],
399
+ [11, 22, 27, " "],
400
+ [12, 23, 28, " "],
401
+ [13, 26, 29, " "],
402
+ [15, 28, 32, " "],
403
+ [16, 31, 35, " "],
404
+ [18, 34, 38, "."],
405
+ [22, 38, 43, "."],
406
+ [26, 44, 48, "."],
407
+ [30, 48, 51, "."],
408
+ [33, 49, 52, "."],
409
+ [35, 51, 54, "."],
410
+ [37, 52, 55, "."],
411
+ [44, 59, 61, "."],
412
+ [57, 71, 72, ":"],
413
+ [55, 67, 68, ":"],
414
+ [61, 70, 71, ":"],
415
+ [143, 147, 147, "+"],
416
+ [151, 132, 110, "="],
417
+ [179, 119, 47, "="],
418
+ [194, 125, 36, "="],
419
+ [132, 105, 51, "-"],
420
+ [72, 96, 74, "-"],
421
+ [54, 89, 77, ":"],
422
+ [61, 87, 76, ":"],
423
+ [60, 74, 64, ":"],
424
+ [63, 66, 57, ":"],
425
+ [52, 83, 72, ":"],
426
+ [47, 88, 76, ":"],
427
+ [41, 59, 50, "."],
428
+ [8, 10, 9, " "],
429
+ [26, 26, 26, " "],
430
+ [29, 29, 29, " "],
431
+ [30, 30, 30, " "]
432
+ ],
433
+ [
434
+ [30, 30, 30, " "],
435
+ [8, 9, 8, " "],
436
+ [45, 64, 46, "."],
437
+ [60, 92, 73, ":"],
438
+ [67, 87, 67, ":"],
439
+ [72, 100, 66, "-"],
440
+ [87, 119, 79, "-"],
441
+ [92, 125, 83, "-"],
442
+ [95, 127, 84, "-"],
443
+ [107, 137, 91, "="],
444
+ [102, 129, 88, "="],
445
+ [128, 129, 83, "="],
446
+ [190, 139, 77, "+"],
447
+ [196, 131, 54, "="],
448
+ [157, 107, 51, "="],
449
+ [118, 96, 77, "-"],
450
+ [104, 99, 99, "-"],
451
+ [113, 114, 120, "="],
452
+ [143, 148, 155, "+"],
453
+ [200, 208, 210, "#"],
454
+ [143, 149, 149, "+"],
455
+ [13, 23, 25, " "],
456
+ [11, 23, 26, " "],
457
+ [14, 30, 34, " "],
458
+ [23, 61, 66, "."],
459
+ [47, 120, 125, "-"],
460
+ [54, 136, 140, "-"],
461
+ [32, 80, 85, ":"],
462
+ [21, 43, 48, "."],
463
+ [22, 39, 44, "."],
464
+ [23, 39, 46, "."],
465
+ [25, 40, 46, "."],
466
+ [26, 43, 47, "."],
467
+ [38, 82, 85, ":"],
468
+ [72, 165, 167, "="],
469
+ [90, 202, 203, "+"],
470
+ [62, 135, 137, "="],
471
+ [42, 71, 73, ":"],
472
+ [122, 129, 128, "="],
473
+ [155, 163, 163, "+"],
474
+ [151, 154, 148, "+"],
475
+ [170, 182, 178, "*"],
476
+ [145, 172, 168, "+"],
477
+ [143, 173, 171, "+"],
478
+ [98, 135, 127, "="],
479
+ [69, 109, 99, "-"],
480
+ [68, 105, 93, "-"],
481
+ [85, 106, 97, "-"],
482
+ [84, 90, 79, "-"],
483
+ [124, 141, 136, "="],
484
+ [134, 146, 143, "+"],
485
+ [52, 49, 45, "."],
486
+ [14, 14, 13, " "],
487
+ [28, 28, 28, " "],
488
+ [30, 30, 30, " "]
489
+ ],
490
+ [
491
+ [30, 30, 30, " "],
492
+ [17, 17, 17, " "],
493
+ [27, 31, 24, "."],
494
+ [63, 90, 69, ":"],
495
+ [75, 90, 70, ":"],
496
+ [75, 86, 62, ":"],
497
+ [68, 96, 65, ":"],
498
+ [74, 105, 77, "-"],
499
+ [79, 112, 82, "-"],
500
+ [89, 121, 91, "-"],
501
+ [110, 136, 112, "="],
502
+ [145, 137, 107, "="],
503
+ [177, 114, 48, "="],
504
+ [144, 74, 25, "-"],
505
+ [123, 71, 41, ":"],
506
+ [101, 101, 106, "-"],
507
+ [126, 131, 139, "="],
508
+ [148, 155, 162, "+"],
509
+ [161, 172, 175, "+"],
510
+ [174, 185, 187, "*"],
511
+ [210, 219, 217, "#"],
512
+ [153, 162, 158, "+"],
513
+ [20, 30, 32, " "],
514
+ [12, 23, 27, " "],
515
+ [27, 63, 67, "."],
516
+ [64, 153, 154, "="],
517
+ [67, 161, 162, "="],
518
+ [49, 125, 127, "-"],
519
+ [65, 157, 159, "="],
520
+ [46, 105, 109, "-"],
521
+ [21, 41, 47, "."],
522
+ [19, 37, 44, "."],
523
+ [19, 37, 43, "."],
524
+ [21, 42, 46, "."],
525
+ [42, 92, 94, ":"],
526
+ [41, 98, 100, ":"],
527
+ [29, 67, 70, "."],
528
+ [33, 80, 84, ":"],
529
+ [22, 55, 59, "."],
530
+ [83, 92, 94, "-"],
531
+ [148, 154, 157, "+"],
532
+ [145, 156, 160, "+"],
533
+ [182, 200, 202, "*"],
534
+ [202, 222, 222, "#"],
535
+ [198, 220, 222, "#"],
536
+ [197, 217, 218, "#"],
537
+ [195, 215, 215, "#"],
538
+ [198, 218, 218, "#"],
539
+ [198, 218, 219, "#"],
540
+ [184, 199, 201, "*"],
541
+ [128, 129, 123, "="],
542
+ [91, 82, 72, ":"],
543
+ [86, 77, 67, ":"],
544
+ [22, 20, 17, " "],
545
+ [21, 21, 21, " "],
546
+ [29, 29, 29, " "],
547
+ [30, 30, 30, " "]
548
+ ],
549
+ [
550
+ [30, 30, 30, " "],
551
+ [4, 4, 4, " "],
552
+ [99, 104, 96, "-"],
553
+ [119, 129, 123, "="],
554
+ [113, 124, 111, "="],
555
+ [110, 138, 121, "="],
556
+ [98, 130, 111, "="],
557
+ [96, 128, 109, "="],
558
+ [145, 173, 165, "+"],
559
+ [137, 166, 155, "+"],
560
+ [157, 158, 141, "+"],
561
+ [152, 83, 29, "-"],
562
+ [152, 76, 25, "-"],
563
+ [161, 86, 26, "-"],
564
+ [143, 92, 49, "-"],
565
+ [109, 115, 119, "="],
566
+ [123, 128, 135, "="],
567
+ [131, 137, 145, "="],
568
+ [136, 147, 152, "+"],
569
+ [158, 166, 171, "+"],
570
+ [183, 190, 192, "*"],
571
+ [171, 179, 176, "*"],
572
+ [57, 66, 67, ":"],
573
+ [12, 25, 28, " "],
574
+ [13, 25, 30, " "],
575
+ [14, 31, 36, " "],
576
+ [17, 35, 40, "."],
577
+ [17, 34, 40, "."],
578
+ [17, 36, 42, "."],
579
+ [18, 41, 46, "."],
580
+ [46, 100, 105, ":"],
581
+ [66, 146, 149, "="],
582
+ [70, 154, 156, "="],
583
+ [51, 110, 114, "-"],
584
+ [22, 46, 50, "."],
585
+ [16, 31, 34, " "],
586
+ [15, 30, 33, " "],
587
+ [14, 28, 31, " "],
588
+ [10, 25, 28, " "],
589
+ [74, 82, 84, ":"],
590
+ [142, 148, 151, "+"],
591
+ [146, 155, 160, "+"],
592
+ [184, 200, 204, "*"],
593
+ [179, 204, 206, "*"],
594
+ [144, 177, 176, "+"],
595
+ [180, 205, 206, "*"],
596
+ [197, 219, 220, "#"],
597
+ [174, 202, 202, "*"],
598
+ [153, 186, 184, "*"],
599
+ [151, 184, 183, "*"],
600
+ [134, 171, 170, "+"],
601
+ [108, 125, 119, "="],
602
+ [84, 74, 66, ":"],
603
+ [55, 49, 43, "."],
604
+ [12, 11, 11, " "],
605
+ [28, 28, 28, " "],
606
+ [30, 30, 30, " "]
607
+ ],
608
+ [
609
+ [30, 30, 30, " "],
610
+ [25, 25, 25, " "],
611
+ [11, 10, 9, " "],
612
+ [101, 96, 82, "-"],
613
+ [125, 151, 143, "+"],
614
+ [137, 177, 172, "+"],
615
+ [142, 178, 175, "+"],
616
+ [175, 202, 204, "*"],
617
+ [194, 216, 218, "#"],
618
+ [166, 197, 200, "*"],
619
+ [135, 177, 174, "+"],
620
+ [163, 193, 189, "*"],
621
+ [183, 173, 152, "*"],
622
+ [168, 123, 77, "="],
623
+ [166, 104, 46, "="],
624
+ [151, 95, 45, "-"],
625
+ [113, 98, 86, "-"],
626
+ [116, 127, 132, "="],
627
+ [111, 119, 126, "="],
628
+ [105, 112, 119, "-"],
629
+ [121, 126, 132, "="],
630
+ [188, 196, 198, "*"],
631
+ [200, 207, 206, "#"],
632
+ [123, 131, 132, "="],
633
+ [26, 42, 47, "."],
634
+ [20, 35, 41, "."],
635
+ [13, 26, 31, " "],
636
+ [13, 25, 29, " "],
637
+ [13, 27, 31, " "],
638
+ [15, 29, 33, " "],
639
+ [15, 30, 35, " "],
640
+ [15, 30, 36, " "],
641
+ [16, 33, 39, "."],
642
+ [15, 32, 38, " "],
643
+ [13, 29, 33, " "],
644
+ [12, 27, 30, " "],
645
+ [12, 25, 30, " "],
646
+ [11, 22, 28, " "],
647
+ [8, 20, 25, " "],
648
+ [12, 23, 27, " "],
649
+ [126, 134, 134, "="],
650
+ [156, 166, 167, "+"],
651
+ [185, 203, 204, "*"],
652
+ [197, 219, 219, "#"],
653
+ [156, 186, 185, "*"],
654
+ [126, 161, 158, "+"],
655
+ [156, 187, 188, "*"],
656
+ [159, 191, 192, "*"],
657
+ [131, 170, 168, "+"],
658
+ [127, 166, 163, "+"],
659
+ [125, 163, 158, "+"],
660
+ [121, 157, 154, "+"],
661
+ [121, 150, 147, "="],
662
+ [95, 93, 82, "-"],
663
+ [75, 67, 58, ":"],
664
+ [6, 6, 5, " "],
665
+ [27, 27, 27, " "],
666
+ [29, 29, 29, " "],
667
+ [30, 30, 30, " "]
668
+ ],
669
+ [
670
+ [30, 30, 30, " "],
671
+ [21, 21, 21, " "],
672
+ [23, 21, 17, " "],
673
+ [120, 138, 125, "="],
674
+ [126, 164, 159, "+"],
675
+ [126, 163, 155, "+"],
676
+ [132, 166, 160, "+"],
677
+ [135, 168, 168, "+"],
678
+ [138, 170, 171, "+"],
679
+ [136, 170, 170, "+"],
680
+ [135, 171, 171, "+"],
681
+ [153, 186, 187, "*"],
682
+ [195, 220, 221, "#"],
683
+ [201, 225, 226, "#"],
684
+ [202, 226, 227, "#"],
685
+ [203, 227, 227, "#"],
686
+ [195, 217, 218, "#"],
687
+ [148, 162, 163, "+"],
688
+ [90, 95, 101, "-"],
689
+ [106, 111, 121, "-"],
690
+ [134, 137, 148, "="],
691
+ [164, 170, 178, "+"],
692
+ [189, 200, 203, "*"],
693
+ [188, 198, 199, "*"],
694
+ [122, 130, 131, "="],
695
+ [35, 49, 54, "."],
696
+ [22, 39, 44, "."],
697
+ [16, 30, 35, " "],
698
+ [13, 25, 31, " "],
699
+ [12, 25, 29, " "],
700
+ [11, 25, 28, " "],
701
+ [10, 25, 28, " "],
702
+ [11, 25, 29, " "],
703
+ [12, 25, 31, " "],
704
+ [12, 25, 30, " "],
705
+ [11, 24, 29, " "],
706
+ [15, 27, 31, " "],
707
+ [42, 49, 52, "."],
708
+ [101, 107, 108, "-"],
709
+ [160, 168, 170, "+"],
710
+ [150, 162, 166, "+"],
711
+ [179, 198, 200, "*"],
712
+ [203, 223, 225, "#"],
713
+ [184, 209, 211, "#"],
714
+ [133, 168, 167, "+"],
715
+ [117, 155, 155, "+"],
716
+ [124, 159, 157, "+"],
717
+ [127, 160, 159, "+"],
718
+ [126, 158, 159, "+"],
719
+ [121, 151, 153, "+"],
720
+ [120, 150, 152, "="],
721
+ [120, 149, 152, "="],
722
+ [125, 151, 152, "+"],
723
+ [98, 95, 86, "-"],
724
+ [84, 77, 65, ":"],
725
+ [11, 11, 9, " "],
726
+ [24, 24, 24, " "],
727
+ [29, 29, 29, " "],
728
+ [30, 30, 30, " "]
729
+ ],
730
+ [
731
+ [30, 30, 30, " "],
732
+ [21, 21, 21, " "],
733
+ [23, 29, 22, " "],
734
+ [88, 124, 95, "-"],
735
+ [83, 123, 94, "-"],
736
+ [88, 129, 96, "-"],
737
+ [94, 134, 107, "="],
738
+ [132, 165, 162, "+"],
739
+ [132, 167, 168, "+"],
740
+ [129, 167, 167, "+"],
741
+ [129, 168, 167, "+"],
742
+ [132, 169, 170, "+"],
743
+ [133, 169, 170, "+"],
744
+ [138, 173, 175, "+"],
745
+ [153, 185, 187, "*"],
746
+ [177, 189, 177, "*"],
747
+ [170, 123, 71, "="],
748
+ [167, 99, 33, "-"],
749
+ [140, 82, 39, "-"],
750
+ [121, 98, 83, "-"],
751
+ [140, 137, 138, "="],
752
+ [141, 140, 149, "="],
753
+ [142, 143, 155, "+"],
754
+ [150, 153, 164, "+"],
755
+ [164, 170, 178, "+"],
756
+ [178, 187, 192, "*"],
757
+ [184, 194, 197, "*"],
758
+ [186, 195, 197, "*"],
759
+ [192, 199, 201, "*"],
760
+ [194, 201, 203, "#"],
761
+ [195, 203, 204, "#"],
762
+ [198, 206, 207, "#"],
763
+ [200, 209, 209, "#"],
764
+ [198, 208, 209, "#"],
765
+ [190, 201, 203, "*"],
766
+ [179, 190, 192, "*"],
767
+ [166, 177, 181, "*"],
768
+ [141, 149, 155, "+"],
769
+ [118, 129, 135, "="],
770
+ [125, 151, 154, "+"],
771
+ [138, 176, 176, "+"],
772
+ [132, 174, 169, "+"],
773
+ [135, 176, 172, "+"],
774
+ [133, 172, 169, "+"],
775
+ [125, 161, 160, "+"],
776
+ [124, 158, 158, "+"],
777
+ [124, 157, 158, "+"],
778
+ [123, 156, 155, "+"],
779
+ [123, 157, 134, "+"],
780
+ [107, 142, 107, "="],
781
+ [104, 139, 109, "="],
782
+ [100, 135, 98, "="],
783
+ [96, 133, 88, "="],
784
+ [84, 119, 82, "-"],
785
+ [72, 109, 79, "-"],
786
+ [11, 17, 12, " "],
787
+ [24, 25, 24, " "],
788
+ [29, 29, 29, " "],
789
+ [30, 30, 30, " "]
790
+ ],
791
+ [
792
+ [30, 30, 30, " "],
793
+ [25, 25, 25, " "],
794
+ [8, 12, 10, " "],
795
+ [64, 100, 81, "-"],
796
+ [65, 99, 79, "-"],
797
+ [74, 109, 84, "-"],
798
+ [90, 125, 96, "-"],
799
+ [90, 128, 103, "="],
800
+ [112, 148, 132, "="],
801
+ [112, 149, 139, "="],
802
+ [129, 163, 158, "+"],
803
+ [135, 169, 170, "+"],
804
+ [134, 170, 171, "+"],
805
+ [131, 170, 169, "+"],
806
+ [129, 170, 168, "+"],
807
+ [129, 159, 152, "+"],
808
+ [144, 123, 87, "="],
809
+ [192, 123, 42, "="],
810
+ [202, 128, 32, "="],
811
+ [213, 142, 36, "+"],
812
+ [220, 153, 38, "+"],
813
+ [228, 168, 39, "*"],
814
+ [239, 190, 52, "*"],
815
+ [244, 206, 75, "#"],
816
+ [231, 201, 97, "*"],
817
+ [196, 170, 106, "*"],
818
+ [148, 131, 101, "="],
819
+ [106, 106, 105, "-"],
820
+ [97, 105, 116, "-"],
821
+ [95, 105, 114, "-"],
822
+ [89, 99, 107, "-"],
823
+ [82, 91, 100, "-"],
824
+ [76, 83, 91, ":"],
825
+ [104, 83, 63, "-"],
826
+ [135, 88, 39, "-"],
827
+ [162, 108, 38, "="],
828
+ [204, 147, 42, "+"],
829
+ [222, 177, 75, "*"],
830
+ [169, 161, 119, "+"],
831
+ [132, 160, 151, "+"],
832
+ [124, 164, 159, "+"],
833
+ [120, 160, 155, "+"],
834
+ [122, 161, 159, "+"],
835
+ [127, 164, 165, "+"],
836
+ [133, 166, 168, "+"],
837
+ [128, 162, 159, "+"],
838
+ [118, 152, 138, "="],
839
+ [116, 152, 112, "="],
840
+ [112, 148, 99, "="],
841
+ [107, 143, 98, "="],
842
+ [89, 127, 91, "-"],
843
+ [98, 133, 94, "="],
844
+ [84, 121, 85, "-"],
845
+ [69, 105, 77, "-"],
846
+ [59, 92, 70, ":"],
847
+ [4, 7, 6, " "],
848
+ [27, 27, 27, " "],
849
+ [29, 29, 29, " "],
850
+ [30, 30, 30, " "]
851
+ ],
852
+ [
853
+ [30, 30, 30, " "],
854
+ [3, 3, 3, " "],
855
+ [62, 81, 83, ":"],
856
+ [86, 108, 107, "-"],
857
+ [85, 108, 107, "-"],
858
+ [89, 110, 110, "-"],
859
+ [91, 111, 112, "-"],
860
+ [90, 112, 112, "-"],
861
+ [97, 118, 117, "-"],
862
+ [97, 120, 119, "-"],
863
+ [100, 122, 124, "="],
864
+ [103, 125, 129, "="],
865
+ [103, 124, 130, "="],
866
+ [104, 126, 132, "="],
867
+ [104, 116, 115, "-"],
868
+ [140, 110, 74, "="],
869
+ [191, 123, 43, "="],
870
+ [167, 100, 33, "-"],
871
+ [177, 108, 34, "="],
872
+ [205, 136, 37, "+"],
873
+ [217, 153, 40, "+"],
874
+ [207, 141, 39, "+"],
875
+ [186, 120, 36, "="],
876
+ [169, 105, 31, "="],
877
+ [179, 114, 35, "="],
878
+ [203, 139, 42, "+"],
879
+ [222, 163, 46, "+"],
880
+ [230, 179, 56, "*"],
881
+ [225, 182, 73, "*"],
882
+ [197, 160, 75, "+"],
883
+ [154, 120, 68, "="],
884
+ [166, 124, 57, "="],
885
+ [209, 161, 56, "+"],
886
+ [194, 143, 48, "+"],
887
+ [147, 92, 31, "-"],
888
+ [121, 69, 29, ":"],
889
+ [180, 140, 65, "+"],
890
+ [167, 153, 100, "+"],
891
+ [123, 135, 128, "="],
892
+ [112, 135, 140, "="],
893
+ [113, 134, 140, "="],
894
+ [114, 137, 142, "="],
895
+ [121, 143, 148, "="],
896
+ [120, 141, 145, "="],
897
+ [114, 135, 133, "="],
898
+ [113, 134, 131, "="],
899
+ [112, 135, 131, "="],
900
+ [112, 135, 129, "="],
901
+ [106, 130, 124, "="],
902
+ [107, 128, 122, "="],
903
+ [94, 115, 112, "-"],
904
+ [93, 113, 113, "-"],
905
+ [85, 106, 107, "-"],
906
+ [55, 70, 72, ":"],
907
+ [11, 12, 12, " "],
908
+ [28, 28, 28, " "],
909
+ [30, 30, 30, " "]
910
+ ],
911
+ [
912
+ [30, 30, 30, " "],
913
+ [16, 16, 16, " "],
914
+ [22, 34, 30, "."],
915
+ [59, 83, 79, ":"],
916
+ [61, 72, 79, ":"],
917
+ [70, 100, 85, "-"],
918
+ [79, 116, 93, "-"],
919
+ [80, 118, 95, "-"],
920
+ [81, 119, 98, "-"],
921
+ [92, 123, 115, "-"],
922
+ [64, 80, 86, ":"],
923
+ [78, 98, 104, "-"],
924
+ [125, 162, 162, "+"],
925
+ [134, 169, 171, "+"],
926
+ [132, 167, 167, "+"],
927
+ [133, 150, 142, "+"],
928
+ [162, 121, 75, "="],
929
+ [213, 151, 60, "+"],
930
+ [231, 185, 64, "*"],
931
+ [244, 201, 55, "*"],
932
+ [245, 199, 49, "*"],
933
+ [236, 188, 44, "*"],
934
+ [229, 175, 39, "*"],
935
+ [240, 188, 45, "*"],
936
+ [243, 194, 47, "*"],
937
+ [238, 185, 46, "*"],
938
+ [236, 182, 49, "*"],
939
+ [232, 178, 49, "*"],
940
+ [230, 181, 56, "*"],
941
+ [229, 183, 59, "*"],
942
+ [225, 182, 61, "*"],
943
+ [225, 185, 65, "*"],
944
+ [196, 156, 63, "+"],
945
+ [163, 110, 55, "="],
946
+ [152, 95, 50, "-"],
947
+ [202, 153, 53, "+"],
948
+ [231, 182, 52, "*"],
949
+ [233, 193, 72, "*"],
950
+ [200, 176, 92, "*"],
951
+ [146, 154, 134, "+"],
952
+ [130, 156, 161, "+"],
953
+ [124, 153, 154, "+"],
954
+ [107, 139, 122, "="],
955
+ [98, 133, 106, "="],
956
+ [82, 109, 93, "-"],
957
+ [55, 70, 72, ":"],
958
+ [79, 107, 89, "-"],
959
+ [91, 124, 99, "-"],
960
+ [77, 109, 87, "-"],
961
+ [67, 96, 78, "-"],
962
+ [68, 93, 81, ":"],
963
+ [57, 73, 72, ":"],
964
+ [59, 86, 71, ":"],
965
+ [15, 25, 20, " "],
966
+ [20, 21, 20, " "],
967
+ [29, 29, 29, " "],
968
+ [30, 30, 30, " "]
969
+ ],
970
+ [
971
+ [30, 30, 30, " "],
972
+ [7, 8, 8, " "],
973
+ [42, 60, 56, "."],
974
+ [71, 88, 88, ":"],
975
+ [75, 103, 75, "-"],
976
+ [97, 127, 81, "-"],
977
+ [84, 115, 77, "-"],
978
+ [68, 104, 85, "-"],
979
+ [76, 111, 90, "-"],
980
+ [62, 82, 81, ":"],
981
+ [80, 103, 100, "-"],
982
+ [109, 145, 125, "="],
983
+ [118, 154, 138, "="],
984
+ [137, 151, 131, "+"],
985
+ [173, 128, 71, "="],
986
+ [209, 148, 56, "+"],
987
+ [229, 172, 45, "*"],
988
+ [239, 190, 45, "*"],
989
+ [233, 188, 57, "*"],
990
+ [230, 185, 66, "*"],
991
+ [220, 161, 38, "+"],
992
+ [203, 140, 38, "+"],
993
+ [218, 158, 43, "+"],
994
+ [244, 197, 62, "*"],
995
+ [247, 207, 67, "#"],
996
+ [247, 203, 52, "#"],
997
+ [245, 202, 53, "*"],
998
+ [244, 202, 55, "*"],
999
+ [242, 200, 56, "*"],
1000
+ [220, 184, 60, "*"],
1001
+ [166, 136, 67, "="],
1002
+ [142, 99, 63, "-"],
1003
+ [151, 101, 54, "-"],
1004
+ [202, 162, 60, "+"],
1005
+ [243, 207, 63, "#"],
1006
+ [215, 179, 70, "*"],
1007
+ [221, 176, 57, "*"],
1008
+ [241, 193, 46, "*"],
1009
+ [233, 203, 87, "#"],
1010
+ [175, 158, 94, "+"],
1011
+ [129, 143, 111, "="],
1012
+ [105, 138, 114, "="],
1013
+ [88, 125, 105, "-"],
1014
+ [80, 107, 98, "-"],
1015
+ [60, 76, 78, ":"],
1016
+ [70, 97, 82, "-"],
1017
+ [70, 103, 87, "-"],
1018
+ [63, 95, 83, ":"],
1019
+ [57, 91, 77, ":"],
1020
+ [67, 97, 75, "-"],
1021
+ [79, 100, 78, "-"],
1022
+ [41, 57, 46, "."],
1023
+ [13, 15, 14, " "],
1024
+ [28, 28, 28, " "],
1025
+ [30, 30, 30, " "]
1026
+ ],
1027
+ [
1028
+ [30, 30, 30, " "],
1029
+ [25, 25, 25, " "],
1030
+ [9, 11, 6, " "],
1031
+ [71, 91, 51, ":"],
1032
+ [77, 101, 60, "-"],
1033
+ [65, 96, 71, ":"],
1034
+ [62, 94, 75, ":"],
1035
+ [62, 96, 78, ":"],
1036
+ [62, 95, 79, ":"],
1037
+ [64, 82, 83, ":"],
1038
+ [69, 92, 90, ":"],
1039
+ [79, 116, 98, "-"],
1040
+ [99, 120, 95, "-"],
1041
+ [168, 125, 66, "="],
1042
+ [215, 147, 44, "+"],
1043
+ [226, 168, 45, "*"],
1044
+ [200, 142, 47, "+"],
1045
+ [205, 156, 69, "+"],
1046
+ [214, 171, 85, "*"],
1047
+ [197, 158, 81, "+"],
1048
+ [168, 121, 60, "="],
1049
+ [176, 116, 45, "="],
1050
+ [217, 155, 48, "+"],
1051
+ [236, 184, 52, "*"],
1052
+ [239, 190, 56, "*"],
1053
+ [245, 202, 59, "#"],
1054
+ [245, 203, 54, "#"],
1055
+ [242, 200, 53, "*"],
1056
+ [191, 160, 62, "+"],
1057
+ [122, 94, 60, "-"],
1058
+ [108, 72, 51, ":"],
1059
+ [129, 98, 60, "-"],
1060
+ [197, 168, 78, "+"],
1061
+ [243, 210, 76, "#"],
1062
+ [245, 208, 60, "#"],
1063
+ [243, 204, 69, "#"],
1064
+ [197, 147, 57, "+"],
1065
+ [193, 131, 41, "="],
1066
+ [228, 182, 69, "*"],
1067
+ [244, 205, 73, "#"],
1068
+ [240, 211, 96, "#"],
1069
+ [176, 158, 89, "+"],
1070
+ [116, 128, 95, "="],
1071
+ [90, 113, 98, "-"],
1072
+ [67, 85, 85, ":"],
1073
+ [62, 89, 80, ":"],
1074
+ [65, 96, 83, "-"],
1075
+ [86, 115, 84, "-"],
1076
+ [107, 133, 84, "="],
1077
+ [91, 120, 78, "-"],
1078
+ [67, 90, 61, ":"],
1079
+ [11, 13, 10, " "],
1080
+ [25, 25, 25, " "],
1081
+ [29, 29, 29, " "],
1082
+ [30, 30, 30, " "]
1083
+ ],
1084
+ [
1085
+ [30, 30, 30, " "],
1086
+ [29, 29, 29, " "],
1087
+ [23, 23, 23, " "],
1088
+ [11, 13, 8, " "],
1089
+ [85, 100, 62, "-"],
1090
+ [85, 106, 65, "-"],
1091
+ [80, 109, 81, "-"],
1092
+ [93, 122, 87, "-"],
1093
+ [81, 111, 84, "-"],
1094
+ [61, 80, 80, ":"],
1095
+ [72, 94, 93, "-"],
1096
+ [69, 105, 87, "-"],
1097
+ [96, 99, 72, "-"],
1098
+ [179, 117, 47, "="],
1099
+ [205, 133, 36, "+"],
1100
+ [223, 160, 43, "+"],
1101
+ [236, 181, 46, "*"],
1102
+ [236, 184, 49, "*"],
1103
+ [242, 194, 62, "*"],
1104
+ [245, 206, 85, "#"],
1105
+ [237, 200, 78, "*"],
1106
+ [219, 187, 81, "*"],
1107
+ [192, 165, 94, "+"],
1108
+ [180, 143, 74, "+"],
1109
+ [200, 155, 56, "+"],
1110
+ [220, 173, 46, "*"],
1111
+ [208, 163, 46, "+"],
1112
+ [151, 104, 44, "-"],
1113
+ [122, 69, 40, ":"],
1114
+ [143, 88, 40, "-"],
1115
+ [190, 137, 46, "+"],
1116
+ [230, 192, 63, "*"],
1117
+ [240, 211, 88, "#"],
1118
+ [242, 209, 79, "#"],
1119
+ [242, 203, 63, "#"],
1120
+ [241, 192, 51, "*"],
1121
+ [207, 161, 66, "+"],
1122
+ [191, 131, 53, "="],
1123
+ [219, 156, 38, "+"],
1124
+ [239, 188, 43, "*"],
1125
+ [242, 196, 48, "*"],
1126
+ [217, 176, 60, "*"],
1127
+ [157, 114, 49, "="],
1128
+ [142, 97, 49, "-"],
1129
+ [88, 82, 72, ":"],
1130
+ [68, 93, 80, ":"],
1131
+ [78, 113, 77, "-"],
1132
+ [87, 121, 77, "-"],
1133
+ [97, 127, 74, "-"],
1134
+ [75, 98, 55, "-"],
1135
+ [12, 15, 10, " "],
1136
+ [25, 25, 25, " "],
1137
+ [29, 29, 29, " "],
1138
+ [30, 30, 30, " "]
1139
+ ],
1140
+ [
1141
+ [30, 30, 30, " "],
1142
+ [29, 29, 29, " "],
1143
+ [26, 26, 26, " "],
1144
+ [8, 10, 7, " "],
1145
+ [76, 98, 68, "-"],
1146
+ [100, 128, 85, "="],
1147
+ [92, 125, 76, "-"],
1148
+ [82, 117, 69, "-"],
1149
+ [74, 103, 75, "-"],
1150
+ [77, 97, 80, "-"],
1151
+ [94, 89, 64, "-"],
1152
+ [108, 59, 32, ":"],
1153
+ [125, 73, 32, ":"],
1154
+ [196, 130, 51, "="],
1155
+ [201, 131, 40, "="],
1156
+ [205, 138, 40, "+"],
1157
+ [223, 163, 49, "+"],
1158
+ [233, 176, 44, "*"],
1159
+ [204, 158, 50, "+"],
1160
+ [124, 106, 79, "-"],
1161
+ [123, 126, 137, "="],
1162
+ [187, 194, 199, "*"],
1163
+ [214, 223, 221, "#"],
1164
+ [212, 218, 215, "#"],
1165
+ [149, 135, 126, "="],
1166
+ [101, 58, 35, ":"],
1167
+ [124, 73, 35, ":"],
1168
+ [182, 125, 40, "="],
1169
+ [237, 182, 47, "*"],
1170
+ [242, 195, 51, "*"],
1171
+ [239, 202, 64, "*"],
1172
+ [240, 205, 77, "#"],
1173
+ [241, 201, 64, "*"],
1174
+ [241, 194, 47, "*"],
1175
+ [239, 185, 45, "*"],
1176
+ [234, 177, 52, "*"],
1177
+ [191, 127, 40, "="],
1178
+ [193, 121, 36, "="],
1179
+ [207, 142, 45, "+"],
1180
+ [131, 97, 57, "-"],
1181
+ [88, 59, 45, ":"],
1182
+ [98, 59, 41, ":"],
1183
+ [111, 79, 62, "-"],
1184
+ [154, 139, 128, "+"],
1185
+ [112, 116, 89, "-"],
1186
+ [76, 107, 74, "-"],
1187
+ [71, 105, 74, "-"],
1188
+ [56, 77, 50, ":"],
1189
+ [15, 18, 13, " "],
1190
+ [26, 26, 26, " "],
1191
+ [29, 29, 29, " "],
1192
+ [30, 30, 30, " "]
1193
+ ],
1194
+ [
1195
+ [30, 30, 30, " "],
1196
+ [29, 29, 29, " "],
1197
+ [28, 28, 28, " "],
1198
+ [13, 14, 14, " "],
1199
+ [25, 37, 28, "."],
1200
+ [80, 105, 75, "-"],
1201
+ [79, 113, 73, "-"],
1202
+ [92, 110, 70, "-"],
1203
+ [128, 87, 56, "-"],
1204
+ [162, 99, 59, "-"],
1205
+ [156, 92, 52, "-"],
1206
+ [142, 80, 44, "-"],
1207
+ [128, 69, 36, ":"],
1208
+ [166, 104, 47, "="],
1209
+ [197, 127, 43, "="],
1210
+ [198, 127, 38, "="],
1211
+ [172, 109, 34, "="],
1212
+ [113, 66, 30, ":"],
1213
+ [96, 77, 67, ":"],
1214
+ [114, 108, 113, "-"],
1215
+ [153, 156, 167, "+"],
1216
+ [168, 174, 179, "*"],
1217
+ [135, 129, 128, "="],
1218
+ [90, 63, 53, ":"],
1219
+ [112, 72, 34, ":"],
1220
+ [198, 147, 41, "+"],
1221
+ [241, 189, 45, "*"],
1222
+ [240, 190, 49, "*"],
1223
+ [238, 192, 51, "*"],
1224
+ [236, 197, 60, "*"],
1225
+ [234, 190, 58, "*"],
1226
+ [234, 184, 50, "*"],
1227
+ [237, 189, 49, "*"],
1228
+ [227, 169, 41, "*"],
1229
+ [225, 162, 38, "+"],
1230
+ [200, 139, 43, "+"],
1231
+ [193, 126, 39, "="],
1232
+ [151, 87, 24, "-"],
1233
+ [113, 62, 26, ":"],
1234
+ [99, 58, 35, ":"],
1235
+ [87, 48, 32, ":"],
1236
+ [93, 54, 38, ":"],
1237
+ [101, 62, 44, ":"],
1238
+ [80, 65, 46, ":"],
1239
+ [69, 91, 61, ":"],
1240
+ [24, 33, 24, "."],
1241
+ [16, 17, 16, " "],
1242
+ [27, 27, 27, " "],
1243
+ [30, 30, 30, " "]
1244
+ ],
1245
+ [
1246
+ [30, 30, 30, " "],
1247
+ [29, 29, 29, " "],
1248
+ [24, 24, 24, " "],
1249
+ [10, 12, 11, " "],
1250
+ [28, 42, 36, "."],
1251
+ [73, 61, 44, ":"],
1252
+ [146, 84, 47, "-"],
1253
+ [150, 88, 45, "-"],
1254
+ [149, 87, 45, "-"],
1255
+ [147, 85, 45, "-"],
1256
+ [145, 83, 44, "-"],
1257
+ [138, 73, 38, "-"],
1258
+ [132, 69, 32, ":"],
1259
+ [148, 87, 32, "-"],
1260
+ [152, 88, 29, "-"],
1261
+ [129, 69, 26, ":"],
1262
+ [90, 48, 28, ":"],
1263
+ [72, 42, 32, "."],
1264
+ [72, 43, 32, "."],
1265
+ [83, 50, 31, ":"],
1266
+ [121, 73, 33, ":"],
1267
+ [174, 111, 35, "="],
1268
+ [225, 161, 40, "+"],
1269
+ [235, 179, 44, "*"],
1270
+ [230, 175, 46, "*"],
1271
+ [234, 184, 52, "*"],
1272
+ [233, 186, 51, "*"],
1273
+ [227, 181, 49, "*"],
1274
+ [224, 175, 48, "*"],
1275
+ [223, 171, 46, "*"],
1276
+ [232, 187, 56, "*"],
1277
+ [222, 171, 52, "*"],
1278
+ [216, 152, 40, "+"],
1279
+ [219, 154, 47, "+"],
1280
+ [177, 125, 52, "="],
1281
+ [141, 98, 44, "-"],
1282
+ [102, 92, 56, "-"],
1283
+ [70, 94, 72, ":"],
1284
+ [80, 72, 54, ":"],
1285
+ [72, 52, 39, "."],
1286
+ [55, 54, 42, "."],
1287
+ [26, 37, 31, "."],
1288
+ [11, 14, 13, " "],
1289
+ [25, 25, 25, " "],
1290
+ [29, 29, 29, " "],
1291
+ [30, 30, 30, " "]
1292
+ ],
1293
+ [
1294
+ [30, 30, 30, " "],
1295
+ [29, 29, 29, " "],
1296
+ [23, 23, 23, " "],
1297
+ [14, 11, 10, " "],
1298
+ [42, 22, 14, " "],
1299
+ [87, 48, 31, ":"],
1300
+ [110, 72, 53, ":"],
1301
+ [115, 77, 55, "-"],
1302
+ [131, 81, 52, "-"],
1303
+ [153, 90, 48, "-"],
1304
+ [152, 92, 50, "-"],
1305
+ [153, 93, 51, "-"],
1306
+ [142, 83, 45, "-"],
1307
+ [112, 62, 36, ":"],
1308
+ [97, 49, 29, ":"],
1309
+ [94, 47, 28, ":"],
1310
+ [111, 60, 29, ":"],
1311
+ [176, 109, 35, "="],
1312
+ [216, 149, 40, "+"],
1313
+ [230, 170, 42, "*"],
1314
+ [231, 173, 43, "*"],
1315
+ [218, 156, 41, "+"],
1316
+ [219, 159, 44, "+"],
1317
+ [229, 176, 52, "*"],
1318
+ [228, 175, 49, "*"],
1319
+ [222, 164, 43, "+"],
1320
+ [220, 163, 44, "+"],
1321
+ [225, 170, 44, "*"],
1322
+ [236, 186, 51, "*"],
1323
+ [234, 187, 68, "*"],
1324
+ [210, 148, 51, "+"],
1325
+ [209, 139, 36, "+"],
1326
+ [211, 161, 69, "+"],
1327
+ [123, 118, 78, "="],
1328
+ [79, 101, 91, "-"],
1329
+ [66, 93, 86, ":"],
1330
+ [44, 68, 63, ":"],
1331
+ [19, 31, 29, " "],
1332
+ [12, 15, 14, " "],
1333
+ [24, 24, 24, " "],
1334
+ [29, 29, 29, " "],
1335
+ [30, 30, 30, " "]
1336
+ ],
1337
+ [
1338
+ [30, 30, 30, " "],
1339
+ [29, 29, 29, " "],
1340
+ [26, 26, 26, " "],
1341
+ [17, 16, 16, " "],
1342
+ [21, 15, 12, " "],
1343
+ [48, 32, 24, "."],
1344
+ [76, 46, 33, "."],
1345
+ [108, 57, 33, ":"],
1346
+ [124, 68, 40, ":"],
1347
+ [119, 67, 39, ":"],
1348
+ [106, 58, 33, ":"],
1349
+ [105, 57, 32, ":"],
1350
+ [117, 65, 35, ":"],
1351
+ [109, 58, 30, ":"],
1352
+ [138, 78, 29, "-"],
1353
+ [206, 137, 36, "+"],
1354
+ [224, 165, 47, "+"],
1355
+ [228, 170, 48, "*"],
1356
+ [217, 155, 41, "+"],
1357
+ [212, 152, 41, "+"],
1358
+ [218, 161, 43, "+"],
1359
+ [226, 167, 45, "*"],
1360
+ [224, 164, 44, "+"],
1361
+ [218, 157, 42, "++"],
1362
+ [226, 167, 42, "*"],
1363
+ [237, 183, 47, "*"],
1364
+ [241, 193, 60, "*"],
1365
+ [218, 165, 64, "+"],
1366
+ [198, 135, 44, "+"],
1367
+ [181, 131, 47, "="],
1368
+ [116, 97, 62, "-"],
1369
+ [52, 54, 52, "."],
1370
+ [18, 20, 21, " "],
1371
+ [18, 18, 18, " "],
1372
+ [27, 27, 27, " "],
1373
+ [29, 29, 29, " "],
1374
+ [30, 30, 30, " "]
1375
+ ],
1376
+ [
1377
+ [30, 30, 30, " "],
1378
+ [29, 29, 29, " "],
1379
+ [27, 27, 27, " "],
1380
+ [19, 19, 19, " "],
1381
+ [17, 14, 12, " "],
1382
+ [40, 25, 16, "."],
1383
+ [73, 43, 24, "."],
1384
+ [87, 48, 28, ":"],
1385
+ [90, 47, 27, ":"],
1386
+ [99, 53, 31, ":"],
1387
+ [119, 64, 30, ":"],
1388
+ [179, 109, 32, "="],
1389
+ [216, 152, 39, "+"],
1390
+ [221, 160, 44, "+"],
1391
+ [219, 159, 46, "+"],
1392
+ [222, 165, 48, "+"],
1393
+ [221, 163, 42, "+"],
1394
+ [222, 162, 41, "+"],
1395
+ [227, 166, 45, "*"],
1396
+ [224, 162, 44, "+"],
1397
+ [222, 159, 42, "+"],
1398
+ [221, 160, 42, "+"],
1399
+ [212, 155, 38, "+"],
1400
+ [190, 141, 30, "+"],
1401
+ [161, 120, 24, "="],
1402
+ [109, 85, 30, "-"],
1403
+ [44, 37, 23, "."],
1404
+ [15, 15, 14, " "],
1405
+ [20, 20, 20, " "],
1406
+ [27, 27, 27, " "],
1407
+ [29, 29, 29, " "],
1408
+ [30, 30, 30, " "]
1409
+ ],
1410
+ [
1411
+ [30, 30, 30, " "],
1412
+ [29, 29, 29, " "],
1413
+ [28, 28, 28, " "],
1414
+ [24, 24, 24, " "],
1415
+ [18, 18, 18, " "],
1416
+ [14, 13, 13, " "],
1417
+ [19, 15, 11, " "],
1418
+ [36, 26, 12, " "],
1419
+ [55, 41, 15, "."],
1420
+ [71, 53, 17, "."],
1421
+ [83, 64, 20, ":"],
1422
+ [90, 69, 22, ":"],
1423
+ [88, 65, 19, ":"],
1424
+ [81, 59, 17, ":"],
1425
+ [69, 51, 16, "."],
1426
+ [53, 40, 15, "."],
1427
+ [36, 28, 13, "."],
1428
+ [22, 19, 12, " "],
1429
+ [16, 15, 13, " "],
1430
+ [19, 19, 18, " "],
1431
+ [25, 25, 25, " "],
1432
+ [28, 28, 28, " "],
1433
+ [29, 29, 29, " "],
1434
+ [30, 30, 30, " "]
1435
+ ],
1436
+ [
1437
+ [30, 30, 30, " "]
1438
+ ],
1439
+ [
1440
+ [30, 30, 30, " "]
1441
+ ]
1442
+ ];
1443
+ var getMascotLines = () => colorizedMascot.map((line) => {
1444
+ let rendered = "";
1445
+ for (const [r, g, b, text] of line) {
1446
+ rendered += renderTruecolor(r, g, b, text);
1447
+ }
1448
+ return `${rendered}\x1B[0m`;
1449
+ });
1450
+
1451
+ // src/run-interactive-ink.ts
1452
+ var C = {
1453
+ reset: "\x1B[0m",
1454
+ bold: "\x1B[1m",
1455
+ dim: "\x1B[2m",
1456
+ cyan: "\x1B[36m",
1457
+ green: "\x1B[32m",
1458
+ yellow: "\x1B[33m",
1459
+ red: "\x1B[31m",
1460
+ gray: "\x1B[90m",
1461
+ magenta: "\x1B[35m"
1462
+ };
1463
+ var green = (s) => `${C.green}${s}${C.reset}`;
1464
+ var yellow = (s) => `${C.yellow}${s}${C.reset}`;
1465
+ var red = (s) => `${C.red}${s}${C.reset}`;
1466
+ var gray = (s) => `${C.gray}${s}${C.reset}`;
1467
+ var magenta = (s) => `${C.magenta}${s}${C.reset}`;
1468
+ var FAUX_TOOL_LOG_PATTERN = /Tool Used:|Tool Result:|\blist_skills\b|\bcreate_skill\b|\bedit_skill\b/i;
1469
+ var formatDuration = (ms) => ms < 1e3 ? `${ms}ms` : `${(ms / 1e3).toFixed(1)}s`;
1470
+ var stringifyValue = (v) => {
1471
+ try {
1472
+ return JSON.stringify(v);
1473
+ } catch {
1474
+ return String(v);
1475
+ }
1476
+ };
1477
+ var truncate = (v, max) => v.length <= max ? v : `${v.slice(0, Math.max(0, max - 3))}...`;
1478
+ var compactPreview = (v, max = 120) => truncate(stringifyValue(v).replace(/\s+/g, " "), max);
1479
+ var loadMetadata = async (workingDir) => {
1480
+ let agentName = "agent";
1481
+ let model = "unknown";
1482
+ let provider = "unknown";
1483
+ try {
1484
+ const parsed = await parseAgentFile(workingDir);
1485
+ agentName = parsed.frontmatter.name ?? agentName;
1486
+ model = parsed.frontmatter.model?.name ?? model;
1487
+ provider = parsed.frontmatter.model?.provider ?? provider;
1488
+ } catch {
1489
+ }
1490
+ return {
1491
+ agentName,
1492
+ model,
1493
+ provider,
1494
+ workingDir,
1495
+ environment: resolveHarnessEnvironment()
1496
+ };
1497
+ };
1498
+ var ask = (rl, prompt) => new Promise((res) => {
1499
+ rl.question(prompt, (answer) => res(answer));
1500
+ });
1501
+ var sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
1502
+ var streamTextAsTokens = async (text) => {
1503
+ const tokens = text.match(/\S+\s*|\n/g) ?? [text];
1504
+ for (const token of tokens) {
1505
+ stdout.write(token);
1506
+ const trimmed = token.trim();
1507
+ const delay = trimmed.length === 0 ? 0 : Math.max(4, Math.min(18, Math.floor(trimmed.length / 2)));
1508
+ await sleep(delay);
1509
+ }
1510
+ };
1511
+ var EXT_MIME = {
1512
+ jpg: "image/jpeg",
1513
+ jpeg: "image/jpeg",
1514
+ png: "image/png",
1515
+ gif: "image/gif",
1516
+ webp: "image/webp",
1517
+ svg: "image/svg+xml",
1518
+ pdf: "application/pdf",
1519
+ mp4: "video/mp4",
1520
+ webm: "video/webm",
1521
+ mp3: "audio/mpeg",
1522
+ wav: "audio/wav",
1523
+ txt: "text/plain",
1524
+ json: "application/json",
1525
+ csv: "text/csv",
1526
+ html: "text/html"
1527
+ };
1528
+ var extToMime = (ext) => EXT_MIME[ext] ?? "application/octet-stream";
1529
+ var readPendingFiles = async (files) => {
1530
+ const results = [];
1531
+ for (const f of files) {
1532
+ try {
1533
+ const buf = await readFile(f.resolved);
1534
+ const ext = f.resolved.split(".").pop()?.toLowerCase() ?? "";
1535
+ results.push({
1536
+ data: buf.toString("base64"),
1537
+ mediaType: extToMime(ext),
1538
+ filename: basename(f.path)
1539
+ });
1540
+ } catch {
1541
+ console.log(`${C.yellow}warn: could not read ${f.path}, skipping${C.reset}`);
1542
+ }
1543
+ }
1544
+ return results;
1545
+ };
1546
+ var OWNER_ID = "local-owner";
1547
+ var computeTurn = (messages) => Math.max(1, Math.floor(messages.length / 2) + 1);
1548
+ var formatDate = (value) => {
1549
+ try {
1550
+ return new Date(value).toLocaleString();
1551
+ } catch {
1552
+ return String(value);
1553
+ }
1554
+ };
1555
+ var handleSlash = async (command, state, conversationStore) => {
1556
+ const [rawCommand, ...args] = command.trim().split(/\s+/);
1557
+ const norm = rawCommand.toLowerCase();
1558
+ if (norm === "/help") {
1559
+ console.log(
1560
+ gray(
1561
+ "commands> /help /clear /exit /tools /attach <path> /files /list /open <id> /new [title] /delete [id] /continue /reset [all]"
1562
+ )
1563
+ );
1564
+ return { shouldExit: false };
1565
+ }
1566
+ if (norm === "/clear") {
1567
+ process.stdout.write("\x1B[2J\x1B[H");
1568
+ return { shouldExit: false };
1569
+ }
1570
+ if (norm === "/exit") {
1571
+ return { shouldExit: true };
1572
+ }
1573
+ if (norm === "/list") {
1574
+ const conversations = await conversationStore.list(OWNER_ID);
1575
+ if (conversations.length === 0) {
1576
+ console.log(gray("conversations> none"));
1577
+ return { shouldExit: false };
1578
+ }
1579
+ console.log(gray("conversations>"));
1580
+ for (const conversation of conversations) {
1581
+ const activeMarker = state.activeConversationId === conversation.conversationId ? "*" : " ";
1582
+ const maxTitleLen = 40;
1583
+ const title = conversation.title.length > maxTitleLen ? conversation.title.slice(0, maxTitleLen - 1) + "\u2026" : conversation.title;
1584
+ console.log(
1585
+ gray(
1586
+ `${activeMarker} ${conversation.conversationId} | ${title} | ${formatDate(conversation.updatedAt)}`
1587
+ )
1588
+ );
1589
+ }
1590
+ return { shouldExit: false };
1591
+ }
1592
+ if (norm === "/open") {
1593
+ const conversationId = args[0];
1594
+ if (!conversationId) {
1595
+ console.log(yellow("usage> /open <conversationId>"));
1596
+ return { shouldExit: false };
1597
+ }
1598
+ const conversation = await conversationStore.get(conversationId);
1599
+ if (!conversation) {
1600
+ console.log(yellow(`conversations> not found: ${conversationId}`));
1601
+ return { shouldExit: false };
1602
+ }
1603
+ state.activeConversationId = conversation.conversationId;
1604
+ state.messages = [...conversation.messages];
1605
+ state.turn = computeTurn(state.messages);
1606
+ console.log(gray(`conversations> opened ${conversation.conversationId}`));
1607
+ return { shouldExit: false };
1608
+ }
1609
+ if (norm === "/new") {
1610
+ const title = args.join(" ").trim();
1611
+ const conversation = await conversationStore.create(OWNER_ID, title || void 0);
1612
+ state.activeConversationId = conversation.conversationId;
1613
+ state.messages = [];
1614
+ state.turn = 1;
1615
+ console.log(gray(`conversations> new ${conversation.conversationId}`));
1616
+ return { shouldExit: false };
1617
+ }
1618
+ if (norm === "/delete") {
1619
+ const targetConversationId = args[0] ?? state.activeConversationId ?? "";
1620
+ if (!targetConversationId) {
1621
+ console.log(yellow("usage> /delete <conversationId>"));
1622
+ return { shouldExit: false };
1623
+ }
1624
+ const removed = await conversationStore.delete(targetConversationId);
1625
+ if (!removed) {
1626
+ console.log(yellow(`conversations> not found: ${targetConversationId}`));
1627
+ return { shouldExit: false };
1628
+ }
1629
+ if (state.activeConversationId === targetConversationId) {
1630
+ state.activeConversationId = null;
1631
+ state.messages = [];
1632
+ state.turn = 1;
1633
+ }
1634
+ console.log(gray(`conversations> deleted ${targetConversationId}`));
1635
+ return { shouldExit: false };
1636
+ }
1637
+ if (norm === "/continue") {
1638
+ const conversations = await conversationStore.list(OWNER_ID);
1639
+ const latest = conversations[0];
1640
+ if (!latest) {
1641
+ console.log(yellow("conversations> no conversations to continue"));
1642
+ return { shouldExit: false };
1643
+ }
1644
+ state.activeConversationId = latest.conversationId;
1645
+ state.messages = [...latest.messages];
1646
+ state.turn = computeTurn(state.messages);
1647
+ console.log(gray(`conversations> continued ${latest.conversationId}`));
1648
+ return { shouldExit: false };
1649
+ }
1650
+ if (norm === "/reset") {
1651
+ if (args[0]?.toLowerCase() === "all") {
1652
+ const conversations = await conversationStore.list(OWNER_ID);
1653
+ for (const conversation2 of conversations) {
1654
+ await conversationStore.delete(conversation2.conversationId);
1655
+ }
1656
+ state.activeConversationId = null;
1657
+ state.messages = [];
1658
+ state.turn = 1;
1659
+ console.log(gray("conversations> reset all"));
1660
+ return { shouldExit: false };
1661
+ }
1662
+ if (!state.activeConversationId) {
1663
+ state.messages = [];
1664
+ state.turn = 1;
1665
+ console.log(gray("conversations> current session reset"));
1666
+ return { shouldExit: false };
1667
+ }
1668
+ const conversation = await conversationStore.get(state.activeConversationId);
1669
+ if (!conversation) {
1670
+ state.activeConversationId = null;
1671
+ state.messages = [];
1672
+ state.turn = 1;
1673
+ console.log(yellow("conversations> active conversation no longer exists"));
1674
+ return { shouldExit: false };
1675
+ }
1676
+ await conversationStore.update({
1677
+ ...conversation,
1678
+ messages: []
1679
+ });
1680
+ state.messages = [];
1681
+ state.turn = 1;
1682
+ console.log(gray(`conversations> reset ${conversation.conversationId}`));
1683
+ return { shouldExit: false };
1684
+ }
1685
+ if (norm === "/attach") {
1686
+ const filePath = args.join(" ").trim();
1687
+ if (!filePath) {
1688
+ console.log(yellow("usage> /attach <path>"));
1689
+ return { shouldExit: false };
1690
+ }
1691
+ const resolvedPath = resolve(process.cwd(), filePath);
1692
+ try {
1693
+ await readFile(resolvedPath);
1694
+ state.pendingFiles.push({ path: filePath, resolved: resolvedPath });
1695
+ console.log(gray(`attached> ${filePath} [${state.pendingFiles.length} file(s) queued]`));
1696
+ } catch {
1697
+ console.log(yellow(`attach> file not found: ${filePath}`));
1698
+ }
1699
+ return { shouldExit: false };
1700
+ }
1701
+ if (norm === "/files") {
1702
+ if (state.pendingFiles.length === 0) {
1703
+ console.log(gray("files> none attached"));
1704
+ } else {
1705
+ console.log(gray("files>"));
1706
+ for (const f of state.pendingFiles) {
1707
+ console.log(gray(` ${f.path}`));
1708
+ }
1709
+ }
1710
+ return { shouldExit: false };
1711
+ }
1712
+ console.log(yellow(`Unknown command: ${command}`));
1713
+ return { shouldExit: false };
1714
+ };
1715
+ var runInteractiveInk = async ({
1716
+ harness,
1717
+ params,
1718
+ workingDir,
1719
+ config,
1720
+ conversationStore
1721
+ }) => {
1722
+ const metadata = await loadMetadata(workingDir);
1723
+ const rl = readline.createInterface({
1724
+ input: process.stdin,
1725
+ output: process.stdout,
1726
+ terminal: true
1727
+ });
1728
+ console.log("");
1729
+ for (const line of getMascotLines()) {
1730
+ console.log(line);
1731
+ }
1732
+ console.log(`${C.bold}${C.cyan} poncho${C.reset}`);
1733
+ console.log("");
1734
+ console.log(
1735
+ gray(
1736
+ ` ${metadata.agentName} \xB7 ${metadata.provider}/${metadata.model} \xB7 ${metadata.environment}`
1737
+ )
1738
+ );
1739
+ console.log(gray(' Type "exit" to quit, "/help" for commands'));
1740
+ console.log(gray(" Press Ctrl+C during a run to stop streaming output."));
1741
+ console.log(
1742
+ gray(" Conversation: /list /open <id> /new [title] /delete [id] /continue /reset [all]")
1743
+ );
1744
+ console.log(
1745
+ gray(" Files: /attach <path> /files\n")
1746
+ );
1747
+ const intro = await consumeFirstRunIntro(workingDir, {
1748
+ agentName: metadata.agentName,
1749
+ provider: metadata.provider,
1750
+ model: metadata.model,
1751
+ config
1752
+ });
1753
+ if (intro) {
1754
+ console.log(green("assistant>"));
1755
+ await streamTextAsTokens(intro);
1756
+ stdout.write("\n\n");
1757
+ }
1758
+ let messages = intro ? [{ role: "assistant", content: intro }] : [];
1759
+ let turn = 1;
1760
+ let activeConversationId = null;
1761
+ let showToolPayloads = false;
1762
+ let activeRunAbortController = null;
1763
+ let pendingFiles = [];
1764
+ rl.on("SIGINT", () => {
1765
+ if (activeRunAbortController && !activeRunAbortController.signal.aborted) {
1766
+ activeRunAbortController.abort();
1767
+ process.stdout.write("\n");
1768
+ console.log(gray("stop> cancelling current run..."));
1769
+ return;
1770
+ }
1771
+ rl.close();
1772
+ });
1773
+ while (true) {
1774
+ const filesTag = pendingFiles.length > 0 ? `${C.dim}[${pendingFiles.length} file(s)] ${C.reset}` : "";
1775
+ const prompt = `${filesTag}${C.cyan}you> ${C.reset}`;
1776
+ let task;
1777
+ try {
1778
+ task = await ask(rl, prompt);
1779
+ } catch {
1780
+ break;
1781
+ }
1782
+ const trimmed = task.trim();
1783
+ if (!trimmed) continue;
1784
+ if (trimmed.toLowerCase() === "exit") break;
1785
+ if (trimmed.startsWith("/")) {
1786
+ if (trimmed.toLowerCase() === "/exit") break;
1787
+ if (trimmed.toLowerCase() === "/tools") {
1788
+ showToolPayloads = !showToolPayloads;
1789
+ console.log(gray(`tool payloads: ${showToolPayloads ? "on" : "off"}`));
1790
+ continue;
1791
+ }
1792
+ const interactiveState = {
1793
+ messages,
1794
+ turn,
1795
+ activeConversationId,
1796
+ pendingFiles
1797
+ };
1798
+ const slashResult = await handleSlash(
1799
+ trimmed,
1800
+ interactiveState,
1801
+ conversationStore
1802
+ );
1803
+ if (slashResult.shouldExit) {
1804
+ break;
1805
+ }
1806
+ messages = interactiveState.messages;
1807
+ turn = interactiveState.turn;
1808
+ activeConversationId = interactiveState.activeConversationId;
1809
+ pendingFiles = interactiveState.pendingFiles;
1810
+ continue;
1811
+ }
1812
+ console.log(gray(`
1813
+ --- turn ${turn} ---`));
1814
+ process.stdout.write(gray("thinking..."));
1815
+ let thinkingCleared = false;
1816
+ const clearThinking = () => {
1817
+ if (thinkingCleared) return;
1818
+ thinkingCleared = true;
1819
+ readline.clearLine(process.stdout, 0);
1820
+ readline.cursorTo(process.stdout, 0);
1821
+ };
1822
+ let responseText = "";
1823
+ let streamedText = "";
1824
+ let committedText = false;
1825
+ let sawChunk = false;
1826
+ let toolEvents = 0;
1827
+ const toolTimeline = [];
1828
+ const sections = [];
1829
+ let currentText = "";
1830
+ let currentTools = [];
1831
+ let runFailed = false;
1832
+ let runCancelled = false;
1833
+ let usage;
1834
+ let latestRunId = "";
1835
+ const startedAt = Date.now();
1836
+ activeRunAbortController = new AbortController();
1837
+ const turnFiles = pendingFiles.length > 0 ? await readPendingFiles(pendingFiles) : [];
1838
+ if (pendingFiles.length > 0) {
1839
+ console.log(gray(` sending ${turnFiles.length} file(s)`));
1840
+ pendingFiles = [];
1841
+ }
1842
+ let eventSource = harness.run({
1843
+ task: trimmed,
1844
+ parameters: params,
1845
+ messages,
1846
+ files: turnFiles.length > 0 ? turnFiles : void 0,
1847
+ abortSignal: activeRunAbortController.signal
1848
+ });
1849
+ try {
1850
+ while (true) {
1851
+ let checkpointEvent = null;
1852
+ for await (const event of eventSource) {
1853
+ if (event.type === "run:started") {
1854
+ latestRunId = event.runId;
1855
+ }
1856
+ if (event.type === "model:chunk") {
1857
+ sawChunk = true;
1858
+ if (currentTools.length > 0) {
1859
+ sections.push({ type: "tools", content: currentTools });
1860
+ currentTools = [];
1861
+ }
1862
+ responseText += event.content;
1863
+ streamedText += event.content;
1864
+ currentText += event.content;
1865
+ if (!thinkingCleared) {
1866
+ clearThinking();
1867
+ process.stdout.write(`${C.green}assistant> ${C.reset}`);
1868
+ }
1869
+ process.stdout.write(event.content);
1870
+ } else if (event.type === "tool:started" || event.type === "tool:completed" || event.type === "tool:error" || event.type === "tool:approval:required") {
1871
+ if (streamedText.length > 0) {
1872
+ committedText = true;
1873
+ streamedText = "";
1874
+ process.stdout.write("\n");
1875
+ }
1876
+ clearThinking();
1877
+ if (event.type === "tool:started") {
1878
+ if (currentText.length > 0) {
1879
+ sections.push({ type: "text", content: currentText });
1880
+ currentText = "";
1881
+ }
1882
+ const preview2 = showToolPayloads ? compactPreview(event.input, 400) : compactPreview(event.input, 100);
1883
+ console.log(yellow(`tools> start ${event.tool} input=${preview2}`));
1884
+ const toolText = `- start \`${event.tool}\``;
1885
+ toolTimeline.push(toolText);
1886
+ currentTools.push(toolText);
1887
+ toolEvents += 1;
1888
+ } else if (event.type === "tool:completed") {
1889
+ const preview2 = showToolPayloads ? compactPreview(event.output, 400) : compactPreview(event.output, 100);
1890
+ console.log(
1891
+ yellow(
1892
+ `tools> done ${event.tool} in ${formatDuration(event.duration)}`
1893
+ )
1894
+ );
1895
+ if (showToolPayloads) {
1896
+ console.log(yellow(`tools> output ${preview2}`));
1897
+ }
1898
+ const toolText = `- done \`${event.tool}\` in ${formatDuration(event.duration)}`;
1899
+ toolTimeline.push(toolText);
1900
+ currentTools.push(toolText);
1901
+ } else if (event.type === "tool:error") {
1902
+ console.log(
1903
+ red(`tools> error ${event.tool}: ${event.error}`)
1904
+ );
1905
+ const toolText = `- error \`${event.tool}\`: ${event.error}`;
1906
+ toolTimeline.push(toolText);
1907
+ currentTools.push(toolText);
1908
+ } else if (event.type === "tool:approval:required") {
1909
+ console.log(
1910
+ magenta(`tools> approval required for ${event.tool}`)
1911
+ );
1912
+ const toolText = `- approval required \`${event.tool}\``;
1913
+ toolTimeline.push(toolText);
1914
+ currentTools.push(toolText);
1915
+ }
1916
+ } else if (event.type === "tool:approval:checkpoint") {
1917
+ checkpointEvent = event;
1918
+ } else if (event.type === "run:error") {
1919
+ clearThinking();
1920
+ runFailed = true;
1921
+ console.log(red(`error> ${event.error.message}`));
1922
+ } else if (event.type === "run:cancelled") {
1923
+ clearThinking();
1924
+ runCancelled = true;
1925
+ } else if (event.type === "model:response") {
1926
+ usage = event.usage;
1927
+ } else if (event.type === "run:completed" && !sawChunk) {
1928
+ clearThinking();
1929
+ responseText = event.result.response ?? "";
1930
+ if (responseText.length > 0) {
1931
+ process.stdout.write(
1932
+ `${C.green}assistant> ${C.reset}${responseText}
1933
+ `
1934
+ );
1935
+ }
1936
+ }
1937
+ }
1938
+ if (!checkpointEvent) break;
1939
+ if (streamedText.length > 0) {
1940
+ process.stdout.write("\n");
1941
+ streamedText = "";
1942
+ }
1943
+ clearThinking();
1944
+ const preview = compactPreview(checkpointEvent.input, 100);
1945
+ const answer = await ask(
1946
+ rl,
1947
+ `${C.yellow}${C.bold}Tool "${checkpointEvent.tool}" requires approval${C.reset}
1948
+ ${C.gray}input: ${preview}${C.reset}
1949
+ ${C.yellow}approve? (y/n): ${C.reset}`
1950
+ );
1951
+ const approved = answer.trim().toLowerCase() === "y";
1952
+ console.log(
1953
+ approved ? green(` approved ${checkpointEvent.tool}`) : magenta(` denied ${checkpointEvent.tool}`)
1954
+ );
1955
+ const approvalText = approved ? `- approval granted (${checkpointEvent.approvalId})` : `- approval denied (${checkpointEvent.approvalId})`;
1956
+ toolTimeline.push(approvalText);
1957
+ currentTools.push(approvalText);
1958
+ let toolResults;
1959
+ if (approved) {
1960
+ const execResults = await harness.executeTools(
1961
+ [{ id: checkpointEvent.toolCallId, name: checkpointEvent.tool, input: checkpointEvent.input }],
1962
+ { runId: latestRunId, agentId: "interactive", step: 0, workingDir, parameters: params }
1963
+ );
1964
+ toolResults = execResults.map((r) => ({
1965
+ callId: r.callId,
1966
+ toolName: r.tool,
1967
+ result: r.output,
1968
+ error: r.error
1969
+ }));
1970
+ for (const r of execResults) {
1971
+ if (r.error) {
1972
+ console.log(red(`tools> error ${r.tool}: ${r.error}`));
1973
+ const toolText = `- error \`${r.tool}\`: ${r.error}`;
1974
+ toolTimeline.push(toolText);
1975
+ currentTools.push(toolText);
1976
+ } else {
1977
+ console.log(yellow(`tools> done ${r.tool}`));
1978
+ const toolText = `- done \`${r.tool}\``;
1979
+ toolTimeline.push(toolText);
1980
+ currentTools.push(toolText);
1981
+ }
1982
+ }
1983
+ } else {
1984
+ toolResults = [{
1985
+ callId: checkpointEvent.toolCallId,
1986
+ toolName: checkpointEvent.tool,
1987
+ error: "Tool execution denied by user"
1988
+ }];
1989
+ }
1990
+ const fullMessages = [...messages, ...checkpointEvent.checkpointMessages];
1991
+ eventSource = harness.continueFromToolResult({
1992
+ messages: fullMessages,
1993
+ toolResults,
1994
+ abortSignal: activeRunAbortController.signal
1995
+ });
1996
+ process.stdout.write(gray("thinking..."));
1997
+ thinkingCleared = false;
1998
+ }
1999
+ } catch (error) {
2000
+ clearThinking();
2001
+ if (activeRunAbortController?.signal.aborted) {
2002
+ runCancelled = true;
2003
+ } else {
2004
+ runFailed = true;
2005
+ console.log(
2006
+ red(
2007
+ `error> ${error instanceof Error ? error.message : "Unknown error"}`
2008
+ )
2009
+ );
2010
+ }
2011
+ } finally {
2012
+ activeRunAbortController = null;
2013
+ }
2014
+ if (sawChunk && streamedText.length > 0) {
2015
+ process.stdout.write("\n");
2016
+ } else if (!sawChunk && !runFailed && !runCancelled && responseText.length === 0) {
2017
+ clearThinking();
2018
+ console.log(green("assistant> (no response)"));
2019
+ }
2020
+ const fullResponse = responseText || streamedText;
2021
+ if (!runFailed && toolEvents === 0 && FAUX_TOOL_LOG_PATTERN.test(fullResponse)) {
2022
+ console.log(
2023
+ magenta(
2024
+ "warning> assistant described tool execution but no real tool events occurred."
2025
+ )
2026
+ );
2027
+ }
2028
+ const durationMs = Date.now() - startedAt;
2029
+ console.log(
2030
+ gray(`meta> ${formatDuration(durationMs)} | tools: ${toolEvents}
2031
+ `)
2032
+ );
2033
+ if (!activeConversationId) {
2034
+ const created = await conversationStore.create(
2035
+ OWNER_ID,
2036
+ inferConversationTitle(trimmed)
2037
+ );
2038
+ activeConversationId = created.conversationId;
2039
+ }
2040
+ if (currentTools.length > 0) {
2041
+ sections.push({ type: "tools", content: currentTools });
2042
+ }
2043
+ if (currentText.length > 0) {
2044
+ sections.push({ type: "text", content: currentText });
2045
+ }
2046
+ messages.push({ role: "user", content: trimmed });
2047
+ const hasAssistantContent = responseText.length > 0 || toolTimeline.length > 0 || sections.length > 0;
2048
+ if (hasAssistantContent) {
2049
+ messages.push({
2050
+ role: "assistant",
2051
+ content: responseText,
2052
+ metadata: toolTimeline.length > 0 || sections.length > 0 ? {
2053
+ toolActivity: toolTimeline,
2054
+ sections: sections.length > 0 ? sections : void 0
2055
+ } : void 0
2056
+ });
2057
+ }
2058
+ turn = computeTurn(messages);
2059
+ const conversation = await conversationStore.get(activeConversationId);
2060
+ if (conversation) {
2061
+ const maybeTitle = conversation.messages.length === 0 && (conversation.title === "New conversation" || conversation.title.trim().length === 0) ? inferConversationTitle(trimmed) : conversation.title;
2062
+ await conversationStore.update({
2063
+ ...conversation,
2064
+ title: maybeTitle,
2065
+ messages: [...messages],
2066
+ runtimeRunId: latestRunId || conversation.runtimeRunId
2067
+ });
2068
+ }
2069
+ }
2070
+ rl.close();
2071
+ };
2072
+ export {
2073
+ runInteractiveInk
2074
+ };