@poncho-ai/cli 0.10.0 → 0.10.2

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