Repository navigation
Expand file tree
/
Copy pathdisplay.html
More file actions
936 lines (701 loc) · 85.3 KB
/
Copy pathdisplay.html
File metadata and controls
936 lines (701 loc) · 85.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>threecode/display</title>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="../nimdoc.out.css?v=2.2.10">
<!-- JS -->
<script type="text/javascript" src="../dochack.js?v=2.2.10"></script>
</head>
<body>
<div class="document" id="documentId">
<input type="checkbox" id="nav-toggle" hidden>
<label for="nav-toggle" id="nav-burger">☰</label>
<label for="nav-toggle" id="nav-overlay"></label>
<div class="container">
<h1 class="title">threecode/display</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme: </label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple">
<li><a id="indexLink" href="../theindex.html">Index</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput" oninput="search()"/>
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#MarkdownState" title="MarkdownState = ref object
firstEmit*: bool
tableBuf*: seq[string]
codeBuf*: seq[string]
inCode*: bool">MarkdownState</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#8" id="58">Vars</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#navigatedUp" title="navigatedUp: bool = false">navigatedUp</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#AssistantTextStyle" title="AssistantTextStyle = "\e[97m"">AssistantTextStyle</a></li>
<li><a class="reference" href="#SessionListCap" title="SessionListCap = 20">SessionListCap</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">assistantTextBytes
<li><a class="reference" href="#assistantTextBytes%2Cstring" title="assistantTextBytes(bytes: string): string">assistantTextBytes(bytes: string): string</a></li>
</ul>
<ul class="simple nested-toc-section">cmdError
<li><a class="reference" href="#cmdError%2Cstring" title="cmdError(body: string)">cmdError(body: string)</a></li>
</ul>
<ul class="simple nested-toc-section">cmdResponse
<li><a class="reference" href="#cmdResponse%2Cstring" title="cmdResponse(body: string)">cmdResponse(body: string)</a></li>
</ul>
<ul class="simple nested-toc-section">contextLabel
<li><a class="reference" href="#contextLabel%2Cint%2Cint" title="contextLabel(promptTokens, window: int): string">contextLabel(promptTokens, window: int): string</a></li>
</ul>
<ul class="simple nested-toc-section">finishMd
<li><a class="reference" href="#finishMd%2CMarkdownState%2CFile" title="finishMd(s: MarkdownState; outFile: File): bool">finishMd(s: MarkdownState; outFile: File): bool</a></li>
</ul>
<ul class="simple nested-toc-section">handleMdLine
<li><a class="reference" href="#handleMdLine%2CMarkdownState%2Cstring%2CFile" title="handleMdLine(s: MarkdownState; l: string; outFile: File): bool">handleMdLine(s: MarkdownState; l: string; outFile: File): bool</a></li>
</ul>
<ul class="simple nested-toc-section">initMarkdownState
<li><a class="reference" href="#initMarkdownState" title="initMarkdownState(firstEmit = true): MarkdownState">initMarkdownState(firstEmit = true): MarkdownState</a></li>
</ul>
<ul class="simple nested-toc-section">installEditorTweaks
<li><a class="reference" href="#installEditorTweaks" title="installEditorTweaks()">installEditorTweaks()</a></li>
</ul>
<ul class="simple nested-toc-section">isSkillRead
<li><a class="reference" href="#isSkillRead%2CAction" title="isSkillRead(act: Action): bool">isSkillRead(act: Action): bool</a></li>
</ul>
<ul class="simple nested-toc-section">listTools
<li><a class="reference" href="#listTools%2Cseq%5BToolRecord%5D" title="listTools(toolLog: seq[ToolRecord])">listTools(toolLog: seq[ToolRecord])</a></li>
</ul>
<ul class="simple nested-toc-section">printActionResult
<li><a class="reference" href="#printActionResult%2CAction%2Cstring%2Cint%2Cint%2Cstring" title="printActionResult(act: Action; res: string; code: int; idx: int; diff = "")">printActionResult(act: Action; res: string; code: int; idx: int; diff = "")</a></li>
</ul>
<ul class="simple nested-toc-section">printCompactHeadTail
<li><a class="reference" href="#printCompactHeadTail%2Cstring%2Cint" title="printCompactHeadTail(res: string; idx: int; head = CompactHead;
tail = CompactTail)">printCompactHeadTail(res: string; idx: int; head = CompactHead;
tail = CompactTail)</a></li>
</ul>
<ul class="simple nested-toc-section">printDiff
<li><a class="reference" href="#printDiff%2Cstring" title="printDiff(diff: string)">printDiff(diff: string)</a></li>
</ul>
<ul class="simple nested-toc-section">printKnownGood
<li><a class="reference" href="#printKnownGood" title="printKnownGood()">printKnownGood()</a></li>
</ul>
<ul class="simple nested-toc-section">printSessionList
<li><a class="reference" href="#printSessionList%2Cseq%5Bstring%5D%2Cstring%2Cbool" title="printSessionList(paths: seq[string]; currentPath: string; showCwd: bool)">printSessionList(paths: seq[string]; currentPath: string; showCwd: bool)</a></li>
</ul>
<ul class="simple nested-toc-section">printSkillLoaded
<li><a class="reference" href="#printSkillLoaded%2CAction" title="printSkillLoaded(act: Action)">printSkillLoaded(act: Action)</a></li>
</ul>
<ul class="simple nested-toc-section">printToolResult
<li><a class="reference" href="#printToolResult%2CActionKind%2Cstring%2Cint%2Cint%2Cstring" title="printToolResult(kind: ActionKind; res: string; code: int; idx: int; diff = "")">printToolResult(kind: ActionKind; res: string; code: int; idx: int; diff = "")</a></li>
</ul>
<ul class="simple nested-toc-section">renderAssistantContent
<li><a class="reference" href="#renderAssistantContent%2Cstring%2CFile" title="renderAssistantContent(content: string; outFile: File = stdout)">renderAssistantContent(content: string; outFile: File = stdout)</a></li>
</ul>
<ul class="simple nested-toc-section">renderHelp
<li><a class="reference" href="#renderHelp" title="renderHelp()">renderHelp()</a></li>
</ul>
<ul class="simple nested-toc-section">renderTokenLine
<li><a class="reference" href="#renderTokenLine%2CUsage%2Cint%2Cint" title="renderTokenLine(usage: Usage; window: int; elapsedS = -1)">renderTokenLine(usage: Usage; window: int; elapsedS = -1)</a></li>
</ul>
<ul class="simple nested-toc-section">renderToolBanner
<li><a class="reference" href="#renderToolBanner%2Cstring%2CActionKind%2Cint%2Cint" title="renderToolBanner(banner: string; kind: ActionKind; code: int; elapsedS = -1)">renderToolBanner(banner: string; kind: ActionKind; code: int; elapsedS = -1)</a></li>
</ul>
<ul class="simple nested-toc-section">renderToolPending
<li><a class="reference" href="#renderToolPending%2Cstring%2CActionKind" title="renderToolPending(banner: string; kind: ActionKind)">renderToolPending(banner: string; kind: ActionKind)</a></li>
</ul>
<ul class="simple nested-toc-section">replaySessionTail
<li><a class="reference" href="#replaySessionTail%2CJsonNode%2Cseq%5BToolRecord%5D%2Cint%2Cstring" title="replaySessionTail(messages: JsonNode; toolLog: seq[ToolRecord]; window: int;
family: string): Usage">replaySessionTail(messages: JsonNode; toolLog: seq[ToolRecord]; window: int;
family: string): Usage</a></li>
</ul>
<ul class="simple nested-toc-section">showProfile
<li><a class="reference" href="#showProfile%2CProfile" title="showProfile(p: Profile)">showProfile(p: Profile)</a></li>
</ul>
<ul class="simple nested-toc-section">showTool
<li><a class="reference" href="#showTool%2Cstring%2Cseq%5BToolRecord%5D" title="showTool(arg: string; toolLog: seq[ToolRecord])">showTool(arg: string; toolLog: seq[ToolRecord])</a></li>
</ul>
<ul class="simple nested-toc-section">skillNameFromAct
<li><a class="reference" href="#skillNameFromAct%2CAction" title="skillNameFromAct(act: Action): string">skillNameFromAct(act: Action): string</a></li>
</ul>
<ul class="simple nested-toc-section">subtleWrite
<li><a class="reference" href="#subtleWrite%2CFile%2Cstring" title="subtleWrite(outFile: File; body: string)">subtleWrite(outFile: File; body: string)</a></li>
</ul>
<ul class="simple nested-toc-section">subtleWriteLn
<li><a class="reference" href="#subtleWriteLn%2CFile%2Cstring" title="subtleWriteLn(outFile: File; body: string)">subtleWriteLn(outFile: File; body: string)</a></li>
</ul>
<ul class="simple nested-toc-section">tokenLineBytes
<li><a class="reference" href="#tokenLineBytes%2CUsage%2Cint%2Cint" title="tokenLineBytes(usage: Usage; window: int; elapsedS = -1): string">tokenLineBytes(usage: Usage; window: int; elapsedS = -1): string</a></li>
</ul>
<ul class="simple nested-toc-section">tokenLineLabel
<li><a class="reference" href="#tokenLineLabel%2CUsage%2Cint%2Cint" title="tokenLineLabel(usage: Usage; window: int; elapsedS = -1): string">tokenLineLabel(usage: Usage; window: int; elapsedS = -1): string</a></li>
</ul>
<ul class="simple nested-toc-section">toolBannerBytes
<li><a class="reference" href="#toolBannerBytes%2Cstring%2CActionKind%2Cint%2Cint" title="toolBannerBytes(banner: string; kind: ActionKind; code: int; elapsedS = -1): string">toolBannerBytes(banner: string; kind: ActionKind; code: int; elapsedS = -1): string</a></li>
</ul>
<ul class="simple nested-toc-section">toolIcon
<li><a class="reference" href="#toolIcon%2CActionKind" title="toolIcon(kind: ActionKind): string">toolIcon(kind: ActionKind): string</a></li>
</ul>
<ul class="simple nested-toc-section">toolResultBytes
<li><a class="reference" href="#toolResultBytes%2CActionKind%2Cstring%2Cint%2Cint%2Cstring" title="toolResultBytes(kind: ActionKind; res: string; code: int; idx: int; diff = ""): string">toolResultBytes(kind: ActionKind; res: string; code: int; idx: int; diff = ""): string</a></li>
</ul>
<ul class="simple nested-toc-section">toolTranscriptBytes
<li><a class="reference" href="#toolTranscriptBytes%2CAction%2Cstring%2Cint%2Cint%2Cstring%2Cint" title="toolTranscriptBytes(act: Action; res: string; code: int; idx: int; diff = "";
elapsedS = -1): string">toolTranscriptBytes(act: Action; res: string; code: int; idx: int; diff = "";
elapsedS = -1): string</a></li>
<li><a class="reference" href="#toolTranscriptBytes%2Cstring%2CActionKind%2Cstring%2Cint%2Cint%2Cstring%2Cint" title="toolTranscriptBytes(banner: string; kind: ActionKind; res: string; code: int;
idx: int; diff = ""; elapsedS = -1): string">toolTranscriptBytes(banner: string; kind: ActionKind; res: string; code: int;
idx: int; diff = ""; elapsedS = -1): string</a></li>
</ul>
<ul class="simple nested-toc-section">welcome
<li><a class="reference" href="#welcome%2CProfile" title="welcome(p: Profile): minline.LineEditor">welcome(p: Profile): minline.LineEditor</a></li>
</ul>
<ul class="simple nested-toc-section">writeAssistantBullet
<li><a class="reference" href="#writeAssistantBullet%2CFile" title="writeAssistantBullet(outFile: File = stdout)">writeAssistantBullet(outFile: File = stdout)</a></li>
</ul>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#18" id="68">Templates</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">err
<li><a class="reference" href="#err.t%2Cvarargs%5Buntyped%5D" title="err(args: varargs[untyped])">err(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">errLn
<li><a class="reference" href="#errLn.t%2Cvarargs%5Buntyped%5D" title="errLn(args: varargs[untyped])">errLn(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">hint
<li><a class="reference" href="#hint.t%2Cvarargs%5Buntyped%5D" title="hint(args: varargs[untyped])">hint(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">hintLn
<li><a class="reference" href="#hintLn.t%2Cvarargs%5Buntyped%5D" title="hintLn(args: varargs[untyped])">hintLn(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">note
<li><a class="reference" href="#note.t%2Cvarargs%5Buntyped%5D" title="note(args: varargs[untyped])">note(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">noteLn
<li><a class="reference" href="#noteLn.t%2Cvarargs%5Buntyped%5D" title="noteLn(args: varargs[untyped])">noteLn(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">warn
<li><a class="reference" href="#warn.t%2Cvarargs%5Buntyped%5D" title="warn(args: varargs[untyped])">warn(args: varargs[untyped])</a></li>
</ul>
<ul class="simple nested-toc-section">warnLn
<li><a class="reference" href="#warnLn.t%2Cvarargs%5Buntyped%5D" title="warnLn(args: varargs[untyped])">warnLn(args: varargs[untyped])</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"><p>Transcript formatting: markdown, receipts, tool banners, and session replay.</p>
<p>This module formats append-only scrollback content. It may write ordinary transcript text, usually while <tt class="docutils literal"><span class="pre"><span class="Identifier">api</span><span class="Operator">.</span><span class="Identifier">writeTranscriptWithFatPrompt</span></span></tt> has temporarily captured stdout or while terminal locking is already active, but it does not own volatile cursor movement or prompt repainting.</p>
<ul class="simple"><li><strong>Markdown rendering</strong>: headers, fences, tables, bold/italic/code pass through <tt class="docutils literal"><span class="pre"><span class="Identifier">printLine</span></span></tt> which calls <tt class="docutils literal"><span class="pre"><span class="Identifier">applyInlineMd</span></span></tt> and wraps at terminal width. Tables buffer rows and render aligned box-drawing via <tt class="docutils literal"><span class="pre"><span class="Identifier">renderMdTable</span></span></tt>.</li>
<li><strong>Token receipt</strong>: the dim receipt in scroll history after each turn (<tt class="docutils literal"><span class="pre"><span class="Identifier">renderTokenLine</span></span></tt>). Live token-bar policy lives in <tt class="docutils literal"><span class="pre"><span class="Identifier">fatprompt</span><span class="Operator">.</span><span class="Identifier">nim</span></span></tt>.</li>
<li><strong>Tool banners</strong>: per-kind glyph and path header for each tool call result.</li>
<li><strong>Session replay</strong>: <tt class="docutils literal"><span class="pre"><span class="Identifier">replaySession</span></span></tt> reprints a loaded session in the same visual style as a live session, reusing the same render helpers.</li>
</ul>
<p>The three-tier colour palette (bold cyan for hints, plain cyan for notes, grey-244 for subtle FYI output) avoids SGR <tt class="docutils literal"><span class="pre"><span class="Identifier">dim</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">fgWhite</span></span></tt> which render below readable contrast on light terminal backgrounds.</p>
</p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="types.html">types</a>, <a class="reference external" href="util.html">util</a>, <a class="reference external" href="config.html">config</a>, <a class="reference external" href="prompts.html">prompts</a>, <a class="reference external" href="session.html">session</a>, <a class="reference external" href="actions.html">actions</a>, <a class="reference external" href="minline.html">minline</a>, <a class="reference external" href="toolstream.html">toolstream</a>, <a class="reference external" href="terminal.html">terminal</a>
</dl>
</div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="MarkdownState">
<dt><pre><a href="#MarkdownState"><span class="Identifier">MarkdownState</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">firstEmit</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Identifier">tableBuf</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span>
<span class="Identifier">codeBuf</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span>
<span class="Identifier">inCode</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span></pre></dt>
<dd>
Per-line markdown rendering state. Shared between the streaming path (api.nim feeds chunks line by line as they arrive over SSE) and the replay path (display.nim feeds the stored full content). Both call <tt class="docutils literal"><span class="pre"><span class="Identifier">handleMdLine</span></span></tt> per line and <tt class="docutils literal"><span class="pre"><span class="Identifier">finishMd</span></span></tt> at end so the visible output is byte-identical regardless of who fed the lines. <tt class="docutils literal"><span class="pre"><span class="Keyword">ref</span></span></tt> so nested closures inside the handlers can mutate it.
</dd>
</div>
</dl>
</div>
<div class="section" id="8">
<h1><a class="toc-backref" href="#8">Vars</a></h1>
<dl class="item">
<div id="navigatedUp">
<dt><pre><a href="#navigatedUp"><span class="Identifier">navigatedUp</span></a><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span></pre></dt>
<dd>
</dd>
</div>
</dl>
</div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<div id="AssistantTextStyle">
<dt><pre><a href="#AssistantTextStyle"><span class="Identifier">AssistantTextStyle</span></a> <span class="Other">=</span> <span class="StringLit">"\e[97m"</span></pre></dt>
<dd>
</dd>
</div>
<div id="SessionListCap">
<dt><pre><a href="#SessionListCap"><span class="Identifier">SessionListCap</span></a> <span class="Other">=</span> <span class="DecNumber">20</span></pre></dt>
<dd>
Newest sessions shown by <tt class="docutils literal"><span class="pre"><span class="Identifier">printSessionList</span></span></tt> / <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="Identifier">l</span></span></tt> / <tt class="docutils literal"><span class="pre"><span class="Punctuation">:</span><span class="Identifier">sessions</span></span></tt>. Paths arrive newest-first from <tt class="docutils literal"><span class="pre"><span class="Identifier">listSessionPaths</span></span></tt>, so the cap is a simple slice. Listing is directory-scoped by design; the full set lives under <tt class="docutils literal"><span class="pre"><span class="Identifier">sessionDir</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for anyone who needs it.
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="assistantTextBytes-procs-all">
<div id="assistantTextBytes,string">
<dt><pre><span class="Keyword">proc</span> <a href="#assistantTextBytes%2Cstring"><span class="Identifier">assistantTextBytes</span></a><span class="Other">(</span><span class="Identifier">bytes</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="cmdError-procs-all">
<div id="cmdError,string">
<dt><pre><span class="Keyword">proc</span> <a href="#cmdError%2Cstring"><span class="Identifier">cmdError</span></a><span class="Other">(</span><span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Actionable error from a system command — non-bold magenta, no indent, blank lines above and below.
</dd>
</div>
</div>
<div id="cmdResponse-procs-all">
<div id="cmdResponse,string">
<dt><pre><span class="Keyword">proc</span> <a href="#cmdResponse%2Cstring"><span class="Identifier">cmdResponse</span></a><span class="Other">(</span><span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
System-command response. One blank line above and below, no indentation, default terminal color (matching LLM output). Distinguishes system feedback from model replies.
</dd>
</div>
</div>
<div id="contextLabel-procs-all">
<div id="contextLabel,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#contextLabel%2Cint%2Cint"><span class="Identifier">contextLabel</span></a><span class="Other">(</span><span class="Identifier">promptTokens</span><span class="Other">,</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
"○ 12%" / "◔ 25%" / … / "● 92%". Empty when there's no useful number (no window). Previously also omitted when there were no tokens yet, which hid the context indicator at startup. We now always show a bullet with a percentage, defaulting to 0% when <tt class="docutils literal"><span class="pre"><span class="Identifier">promptTokens</span></span></tt> is zero.
</dd>
</div>
</div>
<div id="finishMd-procs-all">
<div id="finishMd,MarkdownState,File">
<dt><pre><span class="Keyword">proc</span> <a href="#finishMd%2CMarkdownState%2CFile"><span class="Identifier">finishMd</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="#MarkdownState"><span class="Identifier">MarkdownState</span></a><span class="Other">;</span> <span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">discardable</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Flush any pending code block or table buffer at end of content. Returns true if anything was written.
</dd>
</div>
</div>
<div id="handleMdLine-procs-all">
<div id="handleMdLine,MarkdownState,string,File">
<dt><pre><span class="Keyword">proc</span> <a href="#handleMdLine%2CMarkdownState%2Cstring%2CFile"><span class="Identifier">handleMdLine</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="#MarkdownState"><span class="Identifier">MarkdownState</span></a><span class="Other">;</span> <span class="Identifier">l</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span class="Identifier">discardable</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Route one input line through markdown handlers (headers, fences, tables, paragraphs). Returns true if anything was written to <tt class="docutils literal"><span class="pre"><span class="Identifier">outFile</span></span></tt> this call (table rows and code-block bodies buffer silently until flushed). State accumulates across calls.
</dd>
</div>
</div>
<div id="initMarkdownState-procs-all">
<div id="initMarkdownState">
<dt><pre><span class="Keyword">proc</span> <a href="#initMarkdownState"><span class="Identifier">initMarkdownState</span></a><span class="Other">(</span><span class="Identifier">firstEmit</span> <span class="Other">=</span> <span class="Identifier">true</span><span class="Other">)</span><span class="Other">:</span> <a href="#MarkdownState"><span class="Identifier">MarkdownState</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="installEditorTweaks-procs-all">
<div id="installEditorTweaks">
<dt><pre><span class="Keyword">proc</span> <a href="#installEditorTweaks"><span class="Identifier">installEditorTweaks</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="isSkillRead-procs-all">
<div id="isSkillRead,Action">
<dt><pre><span class="Keyword">proc</span> <a href="#isSkillRead%2CAction"><span class="Identifier">isSkillRead</span></a><span class="Other">(</span><span class="Identifier">act</span><span class="Other">:</span> <a href="types.html#Action"><span class="Identifier">Action</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
True when the action is a <tt class="docutils literal"><span class="pre"><span class="Identifier">cat</span></span></tt>/<tt class="docutils literal"><span class="pre"><span class="Identifier">head</span></span></tt>/<tt class="docutils literal"><span class="pre"><span class="Identifier">sed</span></span></tt>-style read of a skill file (any path under a registered skills dir). The main loop suppresses banner + body output for these and prints its own dim "loaded skill: <name>" marker so the user sees a single, styled signal rather than a tool transcript.
</dd>
</div>
</div>
<div id="listTools-procs-all">
<div id="listTools,seq[ToolRecord]">
<dt><pre><span class="Keyword">proc</span> <a href="#listTools%2Cseq%5BToolRecord%5D"><span class="Identifier">listTools</span></a><span class="Other">(</span><span class="Identifier">toolLog</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="types.html#ToolRecord"><span class="Identifier">ToolRecord</span></a><span class="Other">]</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="printActionResult-procs-all">
<div id="printActionResult,Action,string,int,int,string">
<dt><pre><span class="Keyword">proc</span> <a href="#printActionResult%2CAction%2Cstring%2Cint%2Cint%2Cstring"><span class="Identifier">printActionResult</span></a><span class="Other">(</span><span class="Identifier">act</span><span class="Other">:</span> <a href="types.html#Action"><span class="Identifier">Action</span></a><span class="Other">;</span> <span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">diff</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="printCompactHeadTail-procs-all">
<div id="printCompactHeadTail,string,int">
<dt><pre><span class="Keyword">proc</span> <a href="#printCompactHeadTail%2Cstring%2Cint"><span class="Identifier">printCompactHeadTail</span></a><span class="Other">(</span><span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">head</span> <span class="Other">=</span> <span class="Identifier">CompactHead</span><span class="Other">;</span>
<span class="Identifier">tail</span> <span class="Other">=</span> <span class="Identifier">CompactTail</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Head/tail truncation for non-bash tool kinds that don't have the streaming-terminal semantics (read, web search, web fetch). Keeps the first <tt class="docutils literal"><span class="pre"><span class="Identifier">head</span></span></tt> and last <tt class="docutils literal"><span class="pre"><span class="Identifier">tail</span></span></tt> lines with an "N lines hidden" marker in the middle. Bash uses <tt class="docutils literal"><span class="pre"><span class="Identifier">printBashScroll</span></span></tt> instead.
</dd>
</div>
</div>
<div id="printDiff-procs-all">
<div id="printDiff,string">
<dt><pre><span class="Keyword">proc</span> <a href="#printDiff%2Cstring"><span class="Identifier">printDiff</span></a><span class="Other">(</span><span class="Identifier">diff</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="printKnownGood-procs-all">
<div id="printKnownGood">
<dt><pre><span class="Keyword">proc</span> <a href="#printKnownGood"><span class="Identifier">printKnownGood</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
List every <tt class="docutils literal"><span class="pre"><span class="Punctuation">(</span><span class="Identifier">provider</span><span class="Punctuation">,</span> <span class="Identifier">variant</span><span class="Punctuation">)</span></span></tt> combo in <tt class="docutils literal"><span class="pre"><span class="Identifier">KnownGoodCombos</span></span></tt> along with its model + version tags. Powers <tt class="docutils literal"><span class="pre"><span class="Operator">--</span><span class="Identifier">good</span></span></tt> / <tt class="docutils literal"><span class="pre"><span class="DecNumber">3</span><span class="Identifier">code</span> <span class="Identifier">good</span></span></tt> so a user can survey the curated catalog without configuring anything.
</dd>
</div>
</div>
<div id="printSessionList-procs-all">
<div id="printSessionList,seq[string],string,bool">
<dt><pre><span class="Keyword">proc</span> <a href="#printSessionList%2Cseq%5Bstring%5D%2Cstring%2Cbool"><span class="Identifier">printSessionList</span></a><span class="Other">(</span><span class="Identifier">paths</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">currentPath</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">showCwd</span><span class="Other">:</span> <span class="Identifier">bool</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="printSkillLoaded-procs-all">
<div id="printSkillLoaded,Action">
<dt><pre><span class="Keyword">proc</span> <a href="#printSkillLoaded%2CAction"><span class="Identifier">printSkillLoaded</span></a><span class="Other">(</span><span class="Identifier">act</span><span class="Other">:</span> <a href="types.html#Action"><span class="Identifier">Action</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span>
<span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="printToolResult-procs-all">
<div id="printToolResult,ActionKind,string,int,int,string">
<dt><pre><span class="Keyword">proc</span> <a href="#printToolResult%2CActionKind%2Cstring%2Cint%2Cint%2Cstring"><span class="Identifier">printToolResult</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">;</span> <span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span>
<span class="Identifier">diff</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Body of a tool turn. bash uses the scroll-area shape via <tt class="docutils literal"><span class="pre"><span class="Identifier">printBashScroll</span></span></tt> (streaming-style: marker + tail), read/web use the head/tail compact via <tt class="docutils literal"><span class="pre"><span class="Identifier">printCompactHeadTail</span></span></tt>; write shows the new file contents through the same head/tail path as read. patch prints the headline only on success, or the first error line on failure. A non-empty <tt class="docutils literal"><span class="pre"><span class="Identifier">diff</span></span></tt> is colourised after the body (for patch). Banner is drawn separately by <tt class="docutils literal"><span class="pre"><span class="Identifier">renderToolBanner</span></span></tt>.
</dd>
</div>
</div>
<div id="renderAssistantContent-procs-all">
<div id="renderAssistantContent,string,File">
<dt><pre><span class="Keyword">proc</span> <a href="#renderAssistantContent%2Cstring%2CFile"><span class="Identifier">renderAssistantContent</span></a><span class="Other">(</span><span class="Identifier">content</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span> <span class="Other">=</span> <span class="Identifier">stdout</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteDirEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Bullet <tt class="docutils literal"><span class="pre"><span class="Identifier">●</span> <span class="Punctuation">`</span> <span class="Operator">+</span> <span class="Identifier">bright</span><span class="Operator">-</span><span class="Identifier">white</span> <span class="Identifier">content</span> <span class="Identifier">with</span> <span class="Identifier">full</span> <span class="Identifier">markdown</span> <span class="Identifier">structure</span> <span class="Punctuation">(</span><span class="Identifier">headers</span><span class="Punctuation">,</span> <span class="Identifier">fences</span><span class="Punctuation">,</span> <span class="Identifier">tables</span><span class="Punctuation">,</span> <span class="Identifier">inline</span> <span class="Identifier">bold</span> <span class="Keyword">and</span> <span class="Identifier">backtick</span><span class="Operator">-</span><span class="Identifier">code</span><span class="Punctuation">)</span><span class="Operator">.</span> <span class="Identifier">Used</span> <span class="Identifier">by</span> <span class="Identifier">replay</span> <span class="Keyword">and</span> <span class="Identifier">by</span> <span class="Identifier">the</span> <span class="Identifier">live</span> <span class="Identifier">path</span> <span class="Keyword">when</span> <span class="Identifier">content</span> <span class="Identifier">was</span> <span class="Identifier">buffered</span> <span class="Punctuation">(</span><span class="Identifier">rare</span><span class="Punctuation">:</span> <span class="Identifier">streaming</span> <span class="Identifier">bypasses</span> <span class="Identifier">this</span> <span class="Keyword">and</span> <span class="Identifier">feeds</span> <span class="Identifier">the</span> <span class="Identifier">same</span> <span class="Identifier">handlers</span> <span class="Identifier">chunk</span> <span class="Identifier">by</span> <span class="Identifier">chunk</span><span class="Punctuation">)</span><span class="Operator">.</span> <span class="Punctuation">`</span><span class="Identifier">outFile</span></span></tt> lets tests capture output to a temp file; default is stdout.
</dd>
</div>
</div>
<div id="renderHelp-procs-all">
<div id="renderHelp">
<dt><pre><span class="Keyword">proc</span> <a href="#renderHelp"><span class="Identifier">renderHelp</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
:help body in default terminal color. <tt class="docutils literal"><span class="pre"><span class="DecNumber">3</span><span class="Identifier">code</span></span></tt> highlighted bright bold cyan; <tt class="docutils literal"><span class="pre"><span class="Punctuation">:</span><span class="Identifier">command</span></span></tt> tokens highlighted bright white.
</dd>
</div>
</div>
<div id="renderTokenLine-procs-all">
<div id="renderTokenLine,Usage,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#renderTokenLine%2CUsage%2Cint%2Cint"><span class="Identifier">renderTokenLine</span></a><span class="Other">(</span><span class="Identifier">usage</span><span class="Other">:</span> <a href="types.html#Usage"><span class="Identifier">Usage</span></a><span class="Other">;</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
"○N% ↑Nk ↻Nk ↓Nk Ts": context glyph, fresh, cached, generated, optional duration. Two-space separation, no padding inside slots. Empty when usage has no totals. Live passes seconds; replay passes<div class="option-list"><div class="option-list-item odd"><div class="option-list-label"><tt><span class="option">-1 to omit the duration.</span></tt></div><div class="option-list-description"></div></div>
</div>
</dd>
</div>
</div>
<div id="renderToolBanner-procs-all">
<div id="renderToolBanner,string,ActionKind,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#renderToolBanner%2Cstring%2CActionKind%2Cint%2Cint"><span class="Identifier">renderToolBanner</span></a><span class="Other">(</span><span class="Identifier">banner</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Final tool banner. Icons render in default text color regardless of exit code. Optional <tt class="docutils literal"><span class="pre"><span class="Punctuation">(</span><span class="Identifier">Ns</span><span class="Punctuation">)</span></span></tt> suffix when <tt class="docutils literal"><span class="pre"><span class="Identifier">elapsedS</span> <span class="Operator">>=</span> <span class="DecNumber">1</span></span></tt> (live); replay passes -1 to omit it.
</dd>
</div>
</div>
<div id="renderToolPending-procs-all">
<div id="renderToolPending,string,ActionKind">
<dt><pre><span class="Keyword">proc</span> <a href="#renderToolPending%2Cstring%2CActionKind"><span class="Identifier">renderToolPending</span></a><span class="Other">(</span><span class="Identifier">banner</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Pre-execution banner: grey bullet + grey banner. Live only; the live caller overwrites this line with <tt class="docutils literal"><span class="pre"><span class="Identifier">renderToolBanner</span></span></tt> once the action returns. Replay skips this and goes straight to the result form.
</dd>
</div>
</div>
<div id="replaySessionTail-procs-all">
<div id="replaySessionTail,JsonNode,seq[ToolRecord],int,string">
<dt><pre><span class="Keyword">proc</span> <a href="#replaySessionTail%2CJsonNode%2Cseq%5BToolRecord%5D%2Cint%2Cstring"><span class="Identifier">replaySessionTail</span></a><span class="Other">(</span><span class="Identifier">messages</span><span class="Other">:</span> <span class="Identifier">JsonNode</span><span class="Other">;</span> <span class="Identifier">toolLog</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="types.html#ToolRecord"><span class="Identifier">ToolRecord</span></a><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">family</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="types.html#Usage"><span class="Identifier">Usage</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteDirEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Replay the whole conversation into scrollback so a resumed session drops the user back into the full prior context, reachable by scrolling up. The session file is already bounded by compaction to roughly one context window, so replaying it in full stays manageable. Renders via the same helpers the live path uses; usage is read from each assistant message's inline <tt class="docutils literal"><span class="pre"><span class="Identifier">usage</span></span></tt> field (legacy sessions saved before the inline format simply skip the token line). The last assistant's inline receipt is suppressed and its usage is returned instead — the caller paints the live token bar with it, so the resumed shape matches the post-<tt class="docutils literal"><span class="pre"><span class="Identifier">endTurn</span></span></tt> typing-ready state.
</dd>
</div>
</div>
<div id="showProfile-procs-all">
<div id="showProfile,Profile">
<dt><pre><span class="Keyword">proc</span> <a href="#showProfile%2CProfile"><span class="Identifier">showProfile</span></a><span class="Other">(</span><span class="Identifier">p</span><span class="Other">:</span> <a href="types.html#Profile"><span class="Identifier">Profile</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="showTool-procs-all">
<div id="showTool,string,seq[ToolRecord]">
<dt><pre><span class="Keyword">proc</span> <a href="#showTool%2Cstring%2Cseq%5BToolRecord%5D"><span class="Identifier">showTool</span></a><span class="Other">(</span><span class="Identifier">arg</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">toolLog</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="types.html#ToolRecord"><span class="Identifier">ToolRecord</span></a><span class="Other">]</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="skillNameFromAct-procs-all">
<div id="skillNameFromAct,Action">
<dt><pre><span class="Keyword">proc</span> <a href="#skillNameFromAct%2CAction"><span class="Identifier">skillNameFromAct</span></a><span class="Other">(</span><span class="Identifier">act</span><span class="Other">:</span> <a href="types.html#Action"><span class="Identifier">Action</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Best-effort extraction of the skill name from a skill-read action. Returns the basename without the <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">md</span></span></tt> suffix, or "" if we can't tell. The bash form scans for the first registered skills-dir prefix in the command body, then takes the path that follows.
</dd>
</div>
</div>
<div id="subtleWrite-procs-all">
<div id="subtleWrite,File,string">
<dt><pre><span class="Keyword">proc</span> <a href="#subtleWrite%2CFile%2Cstring"><span class="Identifier">subtleWrite</span></a><span class="Other">(</span><span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
FYI tier — grey 244, readable on both backgrounds. Replaces styledWrite(styleDim, ..., resetStyle) which is invisible on white terminals.
</dd>
</div>
</div>
<div id="subtleWriteLn-procs-all">
<div id="subtleWriteLn,File,string">
<dt><pre><span class="Keyword">proc</span> <a href="#subtleWriteLn%2CFile%2Cstring"><span class="Identifier">subtleWriteLn</span></a><span class="Other">(</span><span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="tokenLineBytes-procs-all">
<div id="tokenLineBytes,Usage,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#tokenLineBytes%2CUsage%2Cint%2Cint"><span class="Identifier">tokenLineBytes</span></a><span class="Other">(</span><span class="Identifier">usage</span><span class="Other">:</span> <a href="types.html#Usage"><span class="Identifier">Usage</span></a><span class="Other">;</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Pure-byte form of the <strong>token receipt</strong> row used by the <em>replay</em> path (saved sessions). The live path uses <tt class="docutils literal"><span class="pre"><span class="Identifier">emitUserSubmit</span></span></tt> / <tt class="docutils literal"><span class="pre"><span class="Identifier">commitTranscriptBytes</span></span></tt>, which paint the receipt in place of the previous turn's bar. Returns "" when there's no usage.
</dd>
</div>
</div>
<div id="tokenLineLabel-procs-all">
<div id="tokenLineLabel,Usage,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#tokenLineLabel%2CUsage%2Cint%2Cint"><span class="Identifier">tokenLineLabel</span></a><span class="Other">(</span><span class="Identifier">usage</span><span class="Other">:</span> <a href="types.html#Usage"><span class="Identifier">Usage</span></a><span class="Other">;</span> <span class="Identifier">window</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Pure label string for the bar / receipt: "○N% ↑input ↻cached ↓completion Ts" (no styling, no leading spaces — caller wraps it in cyan-bright for the bar or dim for the receipt). Empty when there's no usage to report.
</dd>
</div>
</div>
<div id="toolBannerBytes-procs-all">
<div id="toolBannerBytes,string,ActionKind,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#toolBannerBytes%2Cstring%2CActionKind%2Cint%2Cint"><span class="Identifier">toolBannerBytes</span></a><span class="Other">(</span><span class="Identifier">banner</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="toolIcon-procs-all">
<div id="toolIcon,ActionKind">
<dt><pre><span class="Keyword">proc</span> <a href="#toolIcon%2CActionKind"><span class="Identifier">toolIcon</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="toolResultBytes-procs-all">
<div id="toolResultBytes,ActionKind,string,int,int,string">
<dt><pre><span class="Keyword">proc</span> <a href="#toolResultBytes%2CActionKind%2Cstring%2Cint%2Cint%2Cstring"><span class="Identifier">toolResultBytes</span></a><span class="Other">(</span><span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">;</span> <span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span>
<span class="Identifier">diff</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="toolTranscriptBytes-procs-all">
<div id="toolTranscriptBytes,Action,string,int,int,string,int">
<dt><pre><span class="Keyword">proc</span> <a href="#toolTranscriptBytes%2CAction%2Cstring%2Cint%2Cint%2Cstring%2Cint"><span class="Identifier">toolTranscriptBytes</span></a><span class="Other">(</span><span class="Identifier">act</span><span class="Other">:</span> <a href="types.html#Action"><span class="Identifier">Action</span></a><span class="Other">;</span> <span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span>
<span class="Identifier">diff</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
<div id="toolTranscriptBytes,string,ActionKind,string,int,int,string,int">
<dt><pre><span class="Keyword">proc</span> <a href="#toolTranscriptBytes%2Cstring%2CActionKind%2Cstring%2Cint%2Cint%2Cstring%2Cint"><span class="Identifier">toolTranscriptBytes</span></a><span class="Other">(</span><span class="Identifier">banner</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">kind</span><span class="Other">:</span> <a href="types.html#ActionKind"><span class="Identifier">ActionKind</span></a><span class="Other">;</span> <span class="Identifier">res</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span>
<span class="Identifier">code</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">idx</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">diff</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">;</span> <span class="Identifier">elapsedS</span> <span class="Other">=</span> <span class="DecNumber">-1</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="welcome-procs-all">
<div id="welcome,Profile">
<dt><pre><span class="Keyword">proc</span> <a href="#welcome%2CProfile"><span class="Identifier">welcome</span></a><span class="Other">(</span><span class="Identifier">p</span><span class="Other">:</span> <a href="types.html#Profile"><span class="Identifier">Profile</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">minline</span><span class="Other">.</span><span class="Identifier">LineEditor</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
<span class="Identifier">WriteIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">WriteDirEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
<div id="writeAssistantBullet-procs-all">
<div id="writeAssistantBullet,File">
<dt><pre><span class="Keyword">proc</span> <a href="#writeAssistantBullet%2CFile"><span class="Identifier">writeAssistantBullet</span></a><span class="Other">(</span><span class="Identifier">outFile</span><span class="Other">:</span> <span class="Identifier">File</span> <span class="Other">=</span> <span class="Identifier">stdout</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
</dd>
</div>
</div>
</dl>
</div>
<div class="section" id="18">
<h1><a class="toc-backref" href="#18">Templates</a></h1>
<dl class="item">
<div id="err-templates-all">
<div id="err.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#err.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">err</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="errLn-templates-all">
<div id="errLn.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#errLn.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">errLn</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="hint-templates-all">
<div id="hint.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#hint.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">hint</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="hintLn-templates-all">
<div id="hintLn.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#hintLn.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">hintLn</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="note-templates-all">
<div id="note.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#note.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">note</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="noteLn-templates-all">
<div id="noteLn.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#noteLn.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">noteLn</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="warn-templates-all">
<div id="warn.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#warn.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">warn</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
<div id="warnLn-templates-all">
<div id="warnLn.t,varargs[untyped]">
<dt><pre><span class="Keyword">template</span> <a href="#warnLn.t%2Cvarargs%5Buntyped%5D"><span class="Identifier">warnLn</span></a><span class="Other">(</span><span class="Identifier">args</span><span class="Other">:</span> <span class="Identifier">varargs</span><span class="Other">[</span><span class="Identifier">untyped</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2026-06-27 09:42:02 UTC</small>
</div>
</div>
</div>
</body>
</html>