Repository navigation
Expand file tree
/
Copy pathtypes.html
More file actions
430 lines (355 loc) · 29.5 KB
/
Copy pathtypes.html
File metadata and controls
430 lines (355 loc) · 29.5 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
<?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/types</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/types</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>
<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="#Action" title="Action = object
kind*: ActionKind
path*: string
body*: string
stdin*: string ## bash-only: piped to the command's stdin
timeoutSecs*: int ## bash-only: model-requested run cap in seconds; 0 = default
edits*: seq[(string, string)]
plan*: seq[PlanItem]
offset*: int
limit*: int">Action</a></li>
<li><a class="reference" href="#ActionKind" title="ActionKind = enum
akBash, akRead, akWrite, akPatch, akApplyPatch, akPlan, akWebSearch,
akWebFetch, akClear, akError">ActionKind</a></li>
<li><a class="reference" href="#ApiError" title="ApiError = object of CatchableError">ApiError</a></li>
<li><a class="reference" href="#InputState" title="InputState = object
turnActive*: bool
shutdown*: bool
autoSend*: bool
queuedText*: string
queuedEchoRows*: int
queuedPrompts*: seq[tuple[text: string, echoRows: int]]
queuedCommand*: string
queuedCommandRows*: int
cmdWasQuit*: bool">InputState</a></li>
<li><a class="reference" href="#ParseIssue" title="ParseIssue = object
line*: int
msg*: string">ParseIssue</a></li>
<li><a class="reference" href="#PlanItem" title="PlanItem = object
text*: string
status*: string">PlanItem</a></li>
<li><a class="reference" href="#Profile" title="Profile = object
name*, url*, key*, model*: string
family*, version*, variant*: string
reasoning*: string ## reasoning/thinking effort level: "low", "medium",
## "high", or "" when the model has no such knob.
## Mapped to a wire field in `callModel` per family
## (gpt-oss: `reasoning_effort`; glm: `thinking.type`).">Profile</a></li>
<li><a class="reference" href="#ReadCache" title="ReadCache = ref object
state*: Table[string, (Time, int)]">ReadCache</a></li>
<li><a class="reference" href="#Session" title="Session = object
usage*: Usage
lastPromptTokens*: int
toolLog*: seq[ToolRecord]
savePath*: string
profileName*: string
created*: string
cwd*: string
plan*: seq[PlanItem]
readCache*: ReadCache">Session</a></li>
<li><a class="reference" href="#ToolRecord" title="ToolRecord = object
banner*: string
output*: string
code*: int
kind*: ActionKind">ToolRecord</a></li>
<li><a class="reference" href="#Usage" title="Usage = object
promptTokens*, completionTokens*, totalTokens*, cachedTokens*: int">Usage</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="#debugEnabled" title="debugEnabled: bool = false">debugEnabled</a></li>
<li><a class="reference" href="#experimentalEnabled" title="experimentalEnabled: bool = false">experimentalEnabled</a></li>
<li><a class="reference" href="#streamingEnabled" title="streamingEnabled: bool = true">streamingEnabled</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="#DefaultBashTimeout" title="DefaultBashTimeout = 120">DefaultBashTimeout</a></li>
<li><a class="reference" href="#ExitApi" title="ExitApi = 5">ExitApi</a></li>
<li><a class="reference" href="#ExitConfig" title="ExitConfig = 3">ExitConfig</a></li>
<li><a class="reference" href="#ExitUsage" title="ExitUsage = 2">ExitUsage</a></li>
<li><a class="reference" href="#MaxBashTimeout" title="MaxBashTimeout = 600">MaxBashTimeout</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">bashTimeoutSecs
<li><a class="reference" href="#bashTimeoutSecs%2Cint" title="bashTimeoutSecs(req: int): int">bashTimeoutSecs(req: int): int</a></li>
</ul>
<ul class="simple nested-toc-section">die
<li><a class="reference" href="#die%2Cstring%2Cint" title="die(msg: string; code = 1)">die(msg: string; code = 1)</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"><p>Shared types and process-level globals.</p>
<p>All types that cross module boundaries live here to avoid import cycles. <tt class="docutils literal"><span class="pre"><span class="Identifier">experimentalEnabled</span></span></tt> is a global because every module that validates a profile needs it, and threading it through every call site is noise.</p>
</p>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="Action">
<dt><pre><a href="#Action"><span class="Identifier">Action</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">kind</span><span class="Operator">*</span><span class="Other">:</span> <a href="#ActionKind"><span class="Identifier">ActionKind</span></a>
<span class="Identifier">path</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">body</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">stdin</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## bash-only: piped to the command's stdin</span>
<span class="Identifier">timeoutSecs</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Comment">## bash-only: model-requested run cap in seconds; 0 = default</span>
<span class="Identifier">edits</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Other">(</span><span class="Identifier">string</span><span class="Other">,</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">]</span>
<span class="Identifier">plan</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="#PlanItem"><span class="Identifier">PlanItem</span></a><span class="Other">]</span>
<span class="Identifier">offset</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">limit</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span></pre></dt>
<dd>
The parsed, tool-agnostic representation of a single model tool call. <tt class="docutils literal"><span class="pre"><span class="Identifier">runAction</span></span></tt> in actions.nim consumes this and produces the tool result.
</dd>
</div>
<div id="ActionKind">
<dt><pre><a href="#ActionKind"><span class="Identifier">ActionKind</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">akBash</span><span class="Other">,</span> <span class="Identifier">akRead</span><span class="Other">,</span> <span class="Identifier">akWrite</span><span class="Other">,</span> <span class="Identifier">akPatch</span><span class="Other">,</span> <span class="Identifier">akApplyPatch</span><span class="Other">,</span> <span class="Identifier">akPlan</span><span class="Other">,</span> <span class="Identifier">akWebSearch</span><span class="Other">,</span>
<span class="Identifier">akWebFetch</span><span class="Other">,</span> <span class="Identifier">akClear</span><span class="Other">,</span> <span class="Identifier">akError</span></pre></dt>
<dd>
</dd>
</div>
<div id="ApiError">
<dt><pre><a href="#ApiError"><span class="Identifier">ApiError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <span class="Identifier">CatchableError</span></pre></dt>
<dd>
</dd>
</div>
<div id="InputState">
<dt><pre><a href="#InputState"><span class="Identifier">InputState</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">turnActive</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Identifier">shutdown</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Identifier">autoSend</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Identifier">queuedText</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">queuedEchoRows</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">queuedPrompts</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">text</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">,</span> <span class="Identifier">echoRows</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">]</span><span class="Other">]</span>
<span class="Identifier">queuedCommand</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">queuedCommandRows</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">cmdWasQuit</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span></pre></dt>
<dd>
Shared between the main thread and the buffered prompt thread during model/tool turns.
</dd>
</div>
<div id="ParseIssue">
<dt><pre><a href="#ParseIssue"><span class="Identifier">ParseIssue</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">line</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">msg</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt>
<dd>
A syntax problem the text-mode parser surfaced on a fenced block (unterminated fence, orphan code-fence, malformed SEARCH/REPLACE). <tt class="docutils literal"><span class="pre"><span class="Identifier">line</span></span></tt> is 1-indexed into the assistant reply.
</dd>
</div>
<div id="PlanItem">
<dt><pre><a href="#PlanItem"><span class="Identifier">PlanItem</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">text</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">status</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span></pre></dt>
<dd>
One item in a model-emitted <tt class="docutils literal"><span class="pre"><span class="Identifier">update_plan</span></span></tt> / <tt class="docutils literal"><span class="pre"><span class="Identifier">todo</span></span></tt> list.
</dd>
</div>
<div id="Profile">
<dt><pre><a href="#Profile"><span class="Identifier">Profile</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">name</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">url</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">key</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">model</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">family</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">version</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">variant</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">reasoning</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## reasoning/thinking effort level: "low", "medium",</span>
<span class="Comment">## "high", or "" when the model has no such knob.</span>
<span class="Comment">## Mapped to a wire field in `callModel` per family</span>
<span class="Comment">## (gpt-oss: `reasoning_effort`; glm: `thinking.type`).</span></pre></dt>
<dd>
<tt class="docutils literal"><span class="pre"><span class="Identifier">model</span></span></tt> is the full wire value sent in the API <tt class="docutils literal"><span class="pre"><span class="Identifier">model</span></span></tt> field (e.g. "openai/gpt-oss-120b"). Display code shortens it with <tt class="docutils literal"><span class="pre"><span class="Identifier">shortModel</span><span class="Punctuation">(</span><span class="Identifier">model</span><span class="Punctuation">)</span></span></tt> (everything after the last <tt class="docutils literal"><span class="pre"><span class="Operator">/</span></span></tt>). <tt class="docutils literal"><span class="pre"><span class="Identifier">family</span></span></tt> ("glm" / "qwen" / "gpt-oss") drives (prompt, tools) tuple selection. <tt class="docutils literal"><span class="pre"><span class="Identifier">version</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">variant</span></span></tt> (e.g. "3", "480b") are informational tags from KnownGoodCombos. In experimental mode <tt class="docutils literal"><span class="pre"><span class="Identifier">family</span></span></tt> may also come from the per-provider config override.
</dd>
</div>
<div id="ReadCache">
<dt><pre><a href="#ReadCache"><span class="Identifier">ReadCache</span></a> <span class="Other">=</span> <span class="Keyword">ref</span> <span class="Keyword">object</span>
<span class="Identifier">state</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">Table</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">,</span> <span class="Other">(</span><span class="Identifier">Time</span><span class="Other">,</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">]</span></pre></dt>
<dd>
</dd>
</div>
<div id="Session">
<dt><pre><a href="#Session"><span class="Identifier">Session</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">usage</span><span class="Operator">*</span><span class="Other">:</span> <a href="#Usage"><span class="Identifier">Usage</span></a>
<span class="Identifier">lastPromptTokens</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">toolLog</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="#ToolRecord"><span class="Identifier">ToolRecord</span></a><span class="Other">]</span>
<span class="Identifier">savePath</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">profileName</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">created</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">cwd</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">plan</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="#PlanItem"><span class="Identifier">PlanItem</span></a><span class="Other">]</span>
<span class="Identifier">readCache</span><span class="Operator">*</span><span class="Other">:</span> <a href="#ReadCache"><span class="Identifier">ReadCache</span></a></pre></dt>
<dd>
</dd>
</div>
<div id="ToolRecord">
<dt><pre><a href="#ToolRecord"><span class="Identifier">ToolRecord</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">banner</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">output</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">code</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<span class="Identifier">kind</span><span class="Operator">*</span><span class="Other">:</span> <a href="#ActionKind"><span class="Identifier">ActionKind</span></a></pre></dt>
<dd>
</dd>
</div>
<div id="Usage">
<dt><pre><a href="#Usage"><span class="Identifier">Usage</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">promptTokens</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">completionTokens</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">totalTokens</span><span class="Operator">*</span><span class="Other">,</span> <span class="Identifier">cachedTokens</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span></pre></dt>
<dd>
</dd>
</div>
</dl>
</div>
<div class="section" id="8">
<h1><a class="toc-backref" href="#8">Vars</a></h1>
<dl class="item">
<div id="debugEnabled">
<dt><pre><a href="#debugEnabled"><span class="Identifier">debugEnabled</span></a><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span></pre></dt>
<dd>
Set by <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="Identifier">D</span></span></tt>/<tt class="docutils literal"><span class="pre"><span class="Operator">--</span><span class="Identifier">debug</span></span></tt>.
</dd>
</div>
<div id="experimentalEnabled">
<dt><pre><a href="#experimentalEnabled"><span class="Identifier">experimentalEnabled</span></a><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span></pre></dt>
<dd>
Set by <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="Identifier">x</span></span></tt>/<tt class="docutils literal"><span class="pre"><span class="Operator">--</span><span class="Identifier">experimental</span></span></tt>.
</dd>
</div>
<div id="streamingEnabled">
<dt><pre><a href="#streamingEnabled"><span class="Identifier">streamingEnabled</span></a><span class="Other">:</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">true</span></pre></dt>
<dd>
Whether model calls use SSE streaming (<tt class="docutils literal"><span class="pre"><span class="StringLit">"stream"</span><span class="Punctuation">:</span> <span class="Identifier">true</span></span></tt>) or a single request/response. Default on for live output. The non-streaming path is the reliable fallback when a provider's SSE transport is flaky (empty 200 replies, ticker dying mid-response — the streamhttp TLS-read race). Toggled at runtime via <tt class="docutils literal"><span class="pre"><span class="Punctuation">:</span><span class="Identifier">streaming</span> <span class="Identifier">on</span><span class="Operator">/</span><span class="Identifier">off</span></span></tt>, persisted in <tt class="docutils literal"><span class="pre"><span class="Punctuation">[</span><span class="Identifier">settings</span><span class="Punctuation">]</span></span></tt>.
</dd>
</div>
</dl>
</div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<div id="DefaultBashTimeout">
<dt><pre><a href="#DefaultBashTimeout"><span class="Identifier">DefaultBashTimeout</span></a> <span class="Other">=</span> <span class="DecNumber">120</span></pre></dt>
<dd>
seconds; used when the model omits <tt class="docutils literal"><span class="pre"><span class="Identifier">timeout</span></span></tt>
</dd>
</div>
<div id="ExitApi">
<dt><pre><a href="#ExitApi"><span class="Identifier">ExitApi</span></a> <span class="Other">=</span> <span class="DecNumber">5</span></pre></dt>
<dd>
</dd>
</div>
<div id="ExitConfig">
<dt><pre><a href="#ExitConfig"><span class="Identifier">ExitConfig</span></a> <span class="Other">=</span> <span class="DecNumber">3</span></pre></dt>
<dd>
</dd>
</div>
<div id="ExitUsage">
<dt><pre><a href="#ExitUsage"><span class="Identifier">ExitUsage</span></a> <span class="Other">=</span> <span class="DecNumber">2</span></pre></dt>
<dd>
</dd>
</div>
<div id="MaxBashTimeout">
<dt><pre><a href="#MaxBashTimeout"><span class="Identifier">MaxBashTimeout</span></a> <span class="Other">=</span> <span class="DecNumber">600</span></pre></dt>
<dd>
seconds; hard ceiling regardless of model request
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="bashTimeoutSecs-procs-all">
<div id="bashTimeoutSecs,int">
<dt><pre><span class="Keyword">proc</span> <a href="#bashTimeoutSecs%2Cint"><span class="Identifier">bashTimeoutSecs</span></a><span class="Other">(</span><span class="Identifier">req</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</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>
Resolve the run cap (seconds) from a model-requested value. Missing/zero/negative → default; any value above <tt class="docutils literal"><span class="pre"><span class="Identifier">MaxBashTimeout</span></span></tt> is clamped to it. Read at call time so the <tt class="docutils literal"><span class="pre"><span class="Identifier">max_timeout</span></span></tt> setting can raise the ceiling at runtime without a rebuild.
</dd>
</div>
</div>
<div id="die-procs-all">
<div id="die,string,int">
<dt><pre><span class="Keyword">proc</span> <a href="#die%2Cstring%2Cint"><span class="Identifier">die</span></a><span class="Other">(</span><span class="Identifier">msg</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="DecNumber">1</span><span class="Other">)</span> {.<span class="Identifier">noreturn</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>
</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:41:58 UTC</small>
</div>
</div>
</div>
</body>
</html>