@turri-dev/cli 0.4.2 → 0.4.3-next.4908c8d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +24 -3
  2. package/dist/banner.js +259 -0
  3. package/dist/capture-cli.js +77 -0
  4. package/dist/capture-view.js +99 -0
  5. package/dist/chat-commands.js +9 -63
  6. package/dist/chat-models.js +17 -15
  7. package/dist/chat-tab-header.js +90 -0
  8. package/dist/chat-tabs.js +100 -0
  9. package/dist/chat-terminal.js +170 -61
  10. package/dist/chat-waiting.js +7 -24
  11. package/dist/cli-options.js +11 -7
  12. package/dist/cli-root.js +141 -0
  13. package/dist/cli.js +48 -36
  14. package/dist/conform-cli.js +4 -6
  15. package/dist/cultivate-cli.js +65 -97
  16. package/dist/doctor-cli.js +99 -0
  17. package/dist/drift-cli.js +2 -7
  18. package/dist/entry-renderers.js +107 -0
  19. package/dist/extension.js +14 -3211
  20. package/dist/init-config-cli.js +209 -0
  21. package/dist/launch-cli.js +55 -91
  22. package/dist/lineage-cli.js +2 -4
  23. package/dist/loop-cli.js +118 -233
  24. package/dist/panel-view.js +409 -0
  25. package/dist/parse-cli.js +5 -2
  26. package/dist/pi-launch.js +43 -13
  27. package/dist/pi-themes.js +21 -0
  28. package/dist/plain-code-blocks.js +56 -0
  29. package/dist/pointer-hover.js +48 -0
  30. package/dist/print-mode.js +20 -0
  31. package/dist/question-dialog.js +26 -3
  32. package/dist/quiet.js +7 -106
  33. package/dist/regenerate/diff-view.js +6 -87
  34. package/dist/regenerate/jobs-tree.js +7 -18
  35. package/dist/regenerate/side-panel.js +158 -22
  36. package/dist/regenerate/spec-map-view.js +25 -70
  37. package/dist/regenerate-cli.js +7 -11
  38. package/dist/reopen.js +80 -0
  39. package/dist/resume-line.js +5 -2
  40. package/dist/skill-progress.js +25 -0
  41. package/dist/skill-report.js +52 -0
  42. package/dist/terminal-marks.js +21 -0
  43. package/dist/terminal-notifications.js +219 -0
  44. package/dist/terminal-view.js +275 -0
  45. package/dist/turri-versions.js +64 -6
  46. package/docs/README.md +4 -2
  47. package/docs/capture.md +227 -0
  48. package/docs/chats.md +14 -10
  49. package/docs/claude-subscription.md +1 -1
  50. package/docs/config.md +23 -8
  51. package/docs/development.md +30 -61
  52. package/docs/headless.md +3 -1
  53. package/docs/hosting.md +3 -251
  54. package/docs/installation.md +5 -3
  55. package/docs/launch.md +3 -3
  56. package/docs/regenerating.md +1 -1
  57. package/docs/sandbox.md +4 -2
  58. package/docs/sentinel.md +13 -13
  59. package/docs/theming.md +3 -3
  60. package/docs/using.md +14 -6
  61. package/package.json +15 -33
  62. package/dist/ask.d.ts +0 -90
  63. package/dist/ask.js +0 -170
  64. package/dist/background-skills.d.ts +0 -53
  65. package/dist/background-skills.js +0 -121
  66. package/dist/bedrock-region.d.ts +0 -66
  67. package/dist/bedrock-region.js +0 -144
  68. package/dist/brand.d.ts +0 -13
  69. package/dist/btw.d.ts +0 -69
  70. package/dist/btw.js +0 -174
  71. package/dist/chat-commands.d.ts +0 -25
  72. package/dist/chat-idle.d.ts +0 -7
  73. package/dist/chat-idle.js +0 -20
  74. package/dist/chat-models.d.ts +0 -22
  75. package/dist/chat-records.d.ts +0 -50
  76. package/dist/chat-records.js +0 -107
  77. package/dist/chat-scope.d.ts +0 -14
  78. package/dist/chat-scope.js +0 -15
  79. package/dist/chat-skills.d.ts +0 -17
  80. package/dist/chat-skills.js +0 -18
  81. package/dist/chat-terminal.d.ts +0 -24
  82. package/dist/chat-ui.d.ts +0 -33
  83. package/dist/chat-waiting.d.ts +0 -64
  84. package/dist/chats.d.ts +0 -338
  85. package/dist/chats.js +0 -996
  86. package/dist/cli-options.d.ts +0 -24
  87. package/dist/cli.d.ts +0 -9
  88. package/dist/config-edit.d.ts +0 -83
  89. package/dist/config-edit.js +0 -390
  90. package/dist/config.d.ts +0 -415
  91. package/dist/config.js +0 -757
  92. package/dist/conform-cli.d.ts +0 -1
  93. package/dist/conformance-switch.d.ts +0 -25
  94. package/dist/conformance-switch.js +0 -86
  95. package/dist/cultivate-cli.d.ts +0 -1
  96. package/dist/doctor-tool.d.ts +0 -11
  97. package/dist/doctor-tool.js +0 -33
  98. package/dist/drift-cli.d.ts +0 -1
  99. package/dist/environment.d.ts +0 -37
  100. package/dist/environment.js +0 -109
  101. package/dist/extension.d.ts +0 -208
  102. package/dist/genome.d.ts +0 -77
  103. package/dist/genome.js +0 -288
  104. package/dist/graph.d.ts +0 -52
  105. package/dist/graph.js +0 -247
  106. package/dist/host-session.d.ts +0 -112
  107. package/dist/host-session.js +0 -103
  108. package/dist/host.d.ts +0 -40
  109. package/dist/host.js +0 -54
  110. package/dist/identity.d.ts +0 -7
  111. package/dist/identity.js +0 -74
  112. package/dist/init-config.d.ts +0 -169
  113. package/dist/init-config.js +0 -840
  114. package/dist/installed-providers.d.ts +0 -40
  115. package/dist/installed-providers.js +0 -98
  116. package/dist/jellyfish.d.ts +0 -40
  117. package/dist/judge.d.ts +0 -25
  118. package/dist/judge.js +0 -62
  119. package/dist/launch-agent.d.ts +0 -62
  120. package/dist/launch-agent.js +0 -339
  121. package/dist/launch-cli.d.ts +0 -1
  122. package/dist/launch-session.d.ts +0 -68
  123. package/dist/launch-session.js +0 -225
  124. package/dist/launch-tools.d.ts +0 -28
  125. package/dist/launch-tools.js +0 -72
  126. package/dist/launch-track.d.ts +0 -175
  127. package/dist/launch-track.js +0 -497
  128. package/dist/lineage-cli.d.ts +0 -1
  129. package/dist/loop-cli.d.ts +0 -35
  130. package/dist/loop-tools.d.ts +0 -103
  131. package/dist/loop-tools.js +0 -357
  132. package/dist/model-check.d.ts +0 -72
  133. package/dist/model-check.js +0 -162
  134. package/dist/module-report.d.ts +0 -9
  135. package/dist/new-project.d.ts +0 -5
  136. package/dist/new-project.js +0 -31
  137. package/dist/notice.d.ts +0 -115
  138. package/dist/notice.js +0 -61
  139. package/dist/parse-cli.d.ts +0 -1
  140. package/dist/parse-tool.d.ts +0 -9
  141. package/dist/parse-tool.js +0 -33
  142. package/dist/pi-launch.d.ts +0 -1
  143. package/dist/pi-settings.d.ts +0 -4
  144. package/dist/pi.d.ts +0 -248
  145. package/dist/pi.js +0 -889
  146. package/dist/picture-row.d.ts +0 -10
  147. package/dist/plain/check.d.ts +0 -63
  148. package/dist/plain/check.js +0 -236
  149. package/dist/plain/concepts.d.ts +0 -37
  150. package/dist/plain/concepts.js +0 -283
  151. package/dist/plain/cycles.d.ts +0 -21
  152. package/dist/plain/cycles.js +0 -190
  153. package/dist/plain/errors.d.ts +0 -26
  154. package/dist/plain/errors.js +0 -50
  155. package/dist/plain/files.d.ts +0 -47
  156. package/dist/plain/files.js +0 -161
  157. package/dist/plain/graph.d.ts +0 -107
  158. package/dist/plain/graph.js +0 -194
  159. package/dist/plain/highlight.d.ts +0 -43
  160. package/dist/plain/highlight.js +0 -196
  161. package/dist/plain/index.d.ts +0 -18
  162. package/dist/plain/index.js +0 -18
  163. package/dist/plain/liquid.d.ts +0 -22
  164. package/dist/plain/liquid.js +0 -124
  165. package/dist/plain/markdown.d.ts +0 -103
  166. package/dist/plain/markdown.js +0 -330
  167. package/dist/plain/module-concepts.d.ts +0 -32
  168. package/dist/plain/module-concepts.js +0 -80
  169. package/dist/plain/parser.d.ts +0 -163
  170. package/dist/plain/parser.js +0 -930
  171. package/dist/plain/plain.tmLanguage.json +0 -150
  172. package/dist/plain/project.d.ts +0 -48
  173. package/dist/plain/project.js +0 -155
  174. package/dist/plain/spec.d.ts +0 -152
  175. package/dist/plain/spec.js +0 -265
  176. package/dist/plain/stdlib.d.ts +0 -16
  177. package/dist/plain/stdlib.js +0 -48
  178. package/dist/plain/test-plain-file.d.ts +0 -59
  179. package/dist/plain/test-plain-file.js +0 -232
  180. package/dist/plain-files.d.ts +0 -21
  181. package/dist/plain-files.js +0 -156
  182. package/dist/question-dialog.d.ts +0 -55
  183. package/dist/questioning.d.ts +0 -55
  184. package/dist/questioning.js +0 -109
  185. package/dist/quiet.d.ts +0 -34
  186. package/dist/regenerate/activity.d.ts +0 -227
  187. package/dist/regenerate/activity.js +0 -250
  188. package/dist/regenerate/agent-env.d.ts +0 -51
  189. package/dist/regenerate/agent-env.js +0 -311
  190. package/dist/regenerate/agent-shell.d.ts +0 -54
  191. package/dist/regenerate/agent-shell.js +0 -121
  192. package/dist/regenerate/arbiter.d.ts +0 -68
  193. package/dist/regenerate/arbiter.js +0 -133
  194. package/dist/regenerate/audit.d.ts +0 -69
  195. package/dist/regenerate/audit.js +0 -212
  196. package/dist/regenerate/base-folder.d.ts +0 -70
  197. package/dist/regenerate/base-folder.js +0 -186
  198. package/dist/regenerate/cases.d.ts +0 -12
  199. package/dist/regenerate/cases.js +0 -149
  200. package/dist/regenerate/change-view.d.ts +0 -23
  201. package/dist/regenerate/change-view.js +0 -153
  202. package/dist/regenerate/chunk-plan.d.ts +0 -217
  203. package/dist/regenerate/chunk-plan.js +0 -937
  204. package/dist/regenerate/codebase.d.ts +0 -21
  205. package/dist/regenerate/codebase.js +0 -75
  206. package/dist/regenerate/command-check.d.ts +0 -66
  207. package/dist/regenerate/command-check.js +0 -508
  208. package/dist/regenerate/compaction.d.ts +0 -13
  209. package/dist/regenerate/compaction.js +0 -20
  210. package/dist/regenerate/confine.d.ts +0 -69
  211. package/dist/regenerate/confine.js +0 -311
  212. package/dist/regenerate/conform.d.ts +0 -66
  213. package/dist/regenerate/conform.js +0 -132
  214. package/dist/regenerate/conformance-agents.d.ts +0 -388
  215. package/dist/regenerate/conformance-agents.js +0 -1162
  216. package/dist/regenerate/conformance.d.ts +0 -191
  217. package/dist/regenerate/conformance.js +0 -1035
  218. package/dist/regenerate/conversation-writes.d.ts +0 -10
  219. package/dist/regenerate/conversation-writes.js +0 -100
  220. package/dist/regenerate/credentials.d.ts +0 -18
  221. package/dist/regenerate/credentials.js +0 -88
  222. package/dist/regenerate/debug-log.d.ts +0 -56
  223. package/dist/regenerate/debug-log.js +0 -236
  224. package/dist/regenerate/debugger.d.ts +0 -36
  225. package/dist/regenerate/debugger.js +0 -133
  226. package/dist/regenerate/delivery.d.ts +0 -2
  227. package/dist/regenerate/diagnose-job.d.ts +0 -2
  228. package/dist/regenerate/diagnose-job.js +0 -40
  229. package/dist/regenerate/diagnose.d.ts +0 -46
  230. package/dist/regenerate/diagnose.js +0 -92
  231. package/dist/regenerate/diff-view.d.ts +0 -64
  232. package/dist/regenerate/drift.d.ts +0 -120
  233. package/dist/regenerate/drift.js +0 -285
  234. package/dist/regenerate/environment-error.d.ts +0 -167
  235. package/dist/regenerate/environment-error.js +0 -342
  236. package/dist/regenerate/failure-reports.d.ts +0 -28
  237. package/dist/regenerate/failure-reports.js +0 -79
  238. package/dist/regenerate/job-log.d.ts +0 -30
  239. package/dist/regenerate/job-log.js +0 -105
  240. package/dist/regenerate/job-panel.d.ts +0 -122
  241. package/dist/regenerate/job-panel.js +0 -339
  242. package/dist/regenerate/jobs-tree.d.ts +0 -75
  243. package/dist/regenerate/jobs.d.ts +0 -231
  244. package/dist/regenerate/jobs.js +0 -522
  245. package/dist/regenerate/lanes.d.ts +0 -16
  246. package/dist/regenerate/lanes.js +0 -32
  247. package/dist/regenerate/launch.d.ts +0 -256
  248. package/dist/regenerate/launch.js +0 -689
  249. package/dist/regenerate/ledger-view.d.ts +0 -87
  250. package/dist/regenerate/ledger-view.js +0 -325
  251. package/dist/regenerate/ledger.d.ts +0 -368
  252. package/dist/regenerate/ledger.js +0 -357
  253. package/dist/regenerate/lineage.d.ts +0 -105
  254. package/dist/regenerate/lineage.js +0 -485
  255. package/dist/regenerate/list-arguments.d.ts +0 -21
  256. package/dist/regenerate/list-arguments.js +0 -121
  257. package/dist/regenerate/loop.d.ts +0 -423
  258. package/dist/regenerate/loop.js +0 -2079
  259. package/dist/regenerate/masking.d.ts +0 -19
  260. package/dist/regenerate/masking.js +0 -95
  261. package/dist/regenerate/model-names.d.ts +0 -33
  262. package/dist/regenerate/model-names.js +0 -92
  263. package/dist/regenerate/notes.d.ts +0 -159
  264. package/dist/regenerate/notes.js +0 -446
  265. package/dist/regenerate/os-sandbox.d.ts +0 -93
  266. package/dist/regenerate/os-sandbox.js +0 -283
  267. package/dist/regenerate/panel-dock.d.ts +0 -23
  268. package/dist/regenerate/paths.d.ts +0 -110
  269. package/dist/regenerate/paths.js +0 -190
  270. package/dist/regenerate/plain-palette.d.ts +0 -34
  271. package/dist/regenerate/prompt.d.ts +0 -230
  272. package/dist/regenerate/prompt.js +0 -741
  273. package/dist/regenerate/pulse-files.d.ts +0 -14
  274. package/dist/regenerate/pulse-files.js +0 -63
  275. package/dist/regenerate/records.d.ts +0 -132
  276. package/dist/regenerate/records.js +0 -327
  277. package/dist/regenerate/regenerate.d.ts +0 -106
  278. package/dist/regenerate/regenerate.js +0 -660
  279. package/dist/regenerate/regression.d.ts +0 -58
  280. package/dist/regenerate/regression.js +0 -188
  281. package/dist/regenerate/renames.d.ts +0 -42
  282. package/dist/regenerate/renames.js +0 -185
  283. package/dist/regenerate/requires.d.ts +0 -117
  284. package/dist/regenerate/requires.js +0 -377
  285. package/dist/regenerate/resources.d.ts +0 -57
  286. package/dist/regenerate/resources.js +0 -162
  287. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  288. package/dist/regenerate/scripts-being-written.js +0 -30
  289. package/dist/regenerate/self-check.d.ts +0 -29
  290. package/dist/regenerate/self-check.js +0 -119
  291. package/dist/regenerate/services.d.ts +0 -28
  292. package/dist/regenerate/services.js +0 -158
  293. package/dist/regenerate/shell.d.ts +0 -91
  294. package/dist/regenerate/shell.js +0 -320
  295. package/dist/regenerate/side-panel.d.ts +0 -59
  296. package/dist/regenerate/spec-map-view.d.ts +0 -139
  297. package/dist/regenerate/spec-map.d.ts +0 -160
  298. package/dist/regenerate/spec-map.js +0 -596
  299. package/dist/regenerate/spec-steps.d.ts +0 -180
  300. package/dist/regenerate/spec-steps.js +0 -729
  301. package/dist/regenerate/standing.d.ts +0 -28
  302. package/dist/regenerate/standing.js +0 -30
  303. package/dist/regenerate/state.d.ts +0 -21
  304. package/dist/regenerate/state.js +0 -10
  305. package/dist/regenerate/steering.d.ts +0 -56
  306. package/dist/regenerate/steering.js +0 -119
  307. package/dist/regenerate/stop-report.d.ts +0 -43
  308. package/dist/regenerate/stop-report.js +0 -160
  309. package/dist/regenerate/submit-work.d.ts +0 -44
  310. package/dist/regenerate/submit-work.js +0 -76
  311. package/dist/regenerate/test-kinds.d.ts +0 -85
  312. package/dist/regenerate/test-kinds.js +0 -171
  313. package/dist/regenerate/test-scripts.d.ts +0 -235
  314. package/dist/regenerate/test-scripts.js +0 -843
  315. package/dist/regenerate/testing-steps.d.ts +0 -52
  316. package/dist/regenerate/testing-steps.js +0 -129
  317. package/dist/regenerate/testing.d.ts +0 -150
  318. package/dist/regenerate/testing.js +0 -438
  319. package/dist/regenerate/transcript-view.d.ts +0 -21
  320. package/dist/regenerate/unit-gate.d.ts +0 -27
  321. package/dist/regenerate/unit-gate.js +0 -20
  322. package/dist/regenerate/unit-review.d.ts +0 -152
  323. package/dist/regenerate/unit-review.js +0 -361
  324. package/dist/regenerate/web.d.ts +0 -61
  325. package/dist/regenerate/web.js +0 -256
  326. package/dist/regenerate/workspace.d.ts +0 -12
  327. package/dist/regenerate/workspace.js +0 -99
  328. package/dist/regenerate-cli.d.ts +0 -1
  329. package/dist/resume-line.d.ts +0 -2
  330. package/dist/review/live.d.ts +0 -72
  331. package/dist/review/live.js +0 -166
  332. package/dist/rules.d.ts +0 -20
  333. package/dist/rules.js +0 -47
  334. package/dist/run-report.d.ts +0 -88
  335. package/dist/run-report.js +0 -338
  336. package/dist/screen-padding.d.ts +0 -28
  337. package/dist/self-invocation.d.ts +0 -36
  338. package/dist/self-invocation.js +0 -137
  339. package/dist/sentinel-chat.d.ts +0 -19
  340. package/dist/sentinel-chat.js +0 -221
  341. package/dist/sentinel-check.d.ts +0 -36
  342. package/dist/sentinel-check.js +0 -78
  343. package/dist/sentinel.d.ts +0 -107
  344. package/dist/sentinel.js +0 -599
  345. package/dist/settings.d.ts +0 -45
  346. package/dist/settings.js +0 -378
  347. package/dist/setup.d.ts +0 -97
  348. package/dist/setup.js +0 -428
  349. package/dist/skill-progress.d.ts +0 -46
  350. package/dist/skill.d.ts +0 -102
  351. package/dist/skill.js +0 -147
  352. package/dist/skills.d.ts +0 -54
  353. package/dist/skills.js +0 -111
  354. package/dist/spawn-async.d.ts +0 -18
  355. package/dist/spawn-async.js +0 -35
  356. package/dist/stack.d.ts +0 -80
  357. package/dist/stack.js +0 -206
  358. package/dist/stdlib.d.ts +0 -43
  359. package/dist/stdlib.js +0 -118
  360. package/dist/surface.d.ts +0 -5
  361. package/dist/surface.js +0 -18
  362. package/dist/terminal-images.d.ts +0 -2
  363. package/dist/test-plain-files.d.ts +0 -41
  364. package/dist/test-plain-files.js +0 -172
  365. package/dist/tools.d.ts +0 -101
  366. package/dist/tools.js +0 -242
  367. package/dist/turri-versions.d.ts +0 -71
  368. package/genome/rules/bullet-continuation.md +0 -61
  369. package/genome/rules/concise-specs-examples.md +0 -460
  370. package/genome/rules/concise-specs-integration-examples.md +0 -281
  371. package/genome/rules/concise-specs.md +0 -80
  372. package/genome/rules/definitions.md +0 -107
  373. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  374. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  375. package/genome/rules/exported-concepts.md +0 -39
  376. package/genome/rules/func-specs.md +0 -164
  377. package/genome/rules/impl-reqs.md +0 -68
  378. package/genome/rules/import-modules.md +0 -49
  379. package/genome/rules/integration-embedded-testing.md +0 -273
  380. package/genome/rules/integration-embedded.md +0 -171
  381. package/genome/rules/integration-standalone.md +0 -135
  382. package/genome/rules/integrations.md +0 -136
  383. package/genome/rules/linked-resources.md +0 -76
  384. package/genome/rules/module-structure.md +0 -112
  385. package/genome/rules/project-model.md +0 -69
  386. package/genome/rules/required-concepts.md +0 -44
  387. package/genome/rules/requires-modules.md +0 -81
  388. package/genome/rules/semantic-ids.md +0 -49
  389. package/genome/rules/stdlib.md +0 -37
  390. package/genome/rules/test-plain-files.md +0 -138
  391. package/genome/rules/test-reqs.md +0 -57
  392. package/genome/rules/turri-regeneration.md +0 -66
  393. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  394. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  395. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  396. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  397. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  398. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  399. package/genome/skills/debug-specs/SKILL.md +0 -194
  400. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  401. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  402. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  403. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  404. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  405. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  406. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  407. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  408. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  409. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  410. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  411. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  412. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  413. package/genome/skills/refactor-module/SKILL.md +0 -218
  414. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  415. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  416. package/stdlib/backend/common.plain +0 -25
  417. package/stdlib/backend/conformance/common.plain +0 -12
  418. package/stdlib/backend/conformance/go-gin.plain +0 -9
  419. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  420. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  421. package/stdlib/backend/conformance/python-django.plain +0 -9
  422. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  423. package/stdlib/backend/conformance/python-flask.plain +0 -9
  424. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  425. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  426. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  427. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  428. package/stdlib/backend/go-gin.plain +0 -18
  429. package/stdlib/backend/go-nethttp.plain +0 -18
  430. package/stdlib/backend/java-springboot.plain +0 -19
  431. package/stdlib/backend/python-django.plain +0 -19
  432. package/stdlib/backend/python-fastapi.plain +0 -23
  433. package/stdlib/backend/python-flask.plain +0 -23
  434. package/stdlib/backend/rust-axum.plain +0 -17
  435. package/stdlib/backend/typescript-express.plain +0 -19
  436. package/stdlib/backend/typescript-fastify.plain +0 -19
  437. package/stdlib/backend/typescript-nestjs.plain +0 -19
  438. package/stdlib/cli/common.plain +0 -17
  439. package/stdlib/cli/conformance/common.plain +0 -11
  440. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  441. package/stdlib/cli/conformance/go-flag.plain +0 -9
  442. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  443. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  444. package/stdlib/cli/conformance/python-click.plain +0 -9
  445. package/stdlib/cli/conformance/python-typer.plain +0 -9
  446. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  447. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  448. package/stdlib/cli/go-cobra.plain +0 -14
  449. package/stdlib/cli/go-flag.plain +0 -14
  450. package/stdlib/cli/java-picocli.plain +0 -15
  451. package/stdlib/cli/python-argparse.plain +0 -18
  452. package/stdlib/cli/python-click.plain +0 -16
  453. package/stdlib/cli/python-typer.plain +0 -16
  454. package/stdlib/cli/rust-clap.plain +0 -14
  455. package/stdlib/cli/typescript-commander.plain +0 -17
  456. package/stdlib/frontend/angular.plain +0 -17
  457. package/stdlib/frontend/common.plain +0 -17
  458. package/stdlib/frontend/conformance/angular.plain +0 -5
  459. package/stdlib/frontend/conformance/common.plain +0 -11
  460. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  461. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  462. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  463. package/stdlib/frontend/react-vite.plain +0 -16
  464. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  465. package/stdlib/frontend/vue-vite.plain +0 -16
  466. package/stdlib/lang/go.plain +0 -13
  467. package/stdlib/lang/java.plain +0 -12
  468. package/stdlib/lang/python.plain +0 -18
  469. package/stdlib/lang/rust.plain +0 -12
  470. package/stdlib/lang/typescript.plain +0 -13
  471. package/stdlib/library/common.plain +0 -15
  472. package/stdlib/library/conformance/common.plain +0 -9
  473. package/stdlib/library/conformance/go.plain +0 -9
  474. package/stdlib/library/conformance/java-gradle.plain +0 -9
  475. package/stdlib/library/conformance/java-maven.plain +0 -9
  476. package/stdlib/library/conformance/python.plain +0 -9
  477. package/stdlib/library/conformance/rust.plain +0 -9
  478. package/stdlib/library/conformance/typescript.plain +0 -9
  479. package/stdlib/library/go.plain +0 -12
  480. package/stdlib/library/java-gradle.plain +0 -13
  481. package/stdlib/library/java-maven.plain +0 -13
  482. package/stdlib/library/python.plain +0 -13
  483. package/stdlib/library/rust.plain +0 -12
  484. package/stdlib/library/typescript.plain +0 -15
package/dist/notice.d.ts DELETED
@@ -1,115 +0,0 @@
1
- import type { Job } from "./regenerate/jobs.ts";
2
- /**
3
- * The sentinel's name and its notices - what it puts to the person - with nothing else: the session's chats (chats.ts)
4
- * hold them, and load early, before the sentinel's tools and what they need (sentinel.ts) can be.
5
- */
6
- /** Its name in the strip, the host's chat list, and the ledger. */
7
- export declare const SENTINEL = "sentinel";
8
- export type ChatRole = typeof SENTINEL;
9
- export type NoticeSeverity = "error" | "warning" | "info";
10
- /** One thing the person can do about a notice: accepted, the focused chat's agent is started on `task`. */
11
- export interface NoticeAction {
12
- label: string;
13
- task: string;
14
- }
15
- export interface NoticeInput {
16
- /**
17
- * `sentinel-start`: not something wrong but a question turri puts before the sentinel first opens in a session - its
18
- * actions start it, or not, and are turri's to carry out, not the chat's agent's (SENTINEL_START). `fixed`: the
19
- * sentinel says what it fixed itself in the project's tooling - a testing script, its config - with nothing to answer:
20
- * a note, never put as a question, and never superseding a notice about its module. None: the sentinel's.
21
- */
22
- kind?: "sentinel-start" | "fixed";
23
- severity: NoticeSeverity;
24
- /** What is wrong, in a line. */
25
- summary: string;
26
- /** What shows it: a step that failed, a log's lines, a test's output. */
27
- evidence: string[];
28
- actions: NoticeAction[];
29
- module?: string;
30
- /** The pulse it is about: its job id. */
31
- job?: string;
32
- /** Its number among its module's pulses. */
33
- pulse?: number;
34
- /** The check it is about, when a host asked the sentinel to check functional specs (`SentinelCheck`): its id. */
35
- check?: string;
36
- /**
37
- * The person may leave it as the build has it, for good (`{ ignore: true }`): a gap in the ***plain the build settled
38
- * with an assumption - never something broken, a pulse that went wrong, a launch that did not come up, nor the
39
- * question whether to start the sentinel.
40
- */
41
- ignorable?: boolean;
42
- }
43
- export type NoticeState = "open" | "accepted" | "steered" | "dismissed" | "ignored" | "superseded";
44
- export interface Notice extends NoticeInput {
45
- id: string;
46
- /** The chat it is put in: the one the person looks at, never the sentinel's. */
47
- chat: string;
48
- state: NoticeState;
49
- at: string;
50
- }
51
- /** The answers to the question put before the sentinel first opens: the actions of a `sentinel-start` notice, in order. */
52
- export declare const SENTINEL_START: {
53
- readonly start: "Start the sentinel";
54
- readonly always: "Start it, and don't ask again";
55
- readonly notNow: "Not this session";
56
- readonly never: "Turn it off for this project";
57
- };
58
- export type SentinelStartChoice = keyof typeof SENTINEL_START;
59
- /**
60
- * How the person answered a notice: one of its actions (by index or label), their own words, not at all this once
61
- * (`dismiss`) - or, on an ignorable one, not at all and not again (`ignore`): left as the build has it.
62
- */
63
- export type NoticeAnswer = {
64
- action: number | string;
65
- } | {
66
- steer: string;
67
- } | {
68
- dismiss: true;
69
- } | {
70
- ignore: true;
71
- };
72
- export declare function newNotice(input: NoticeInput, chat: string): Notice;
73
- /** The choice an answer to a `sentinel-start` notice makes: dismissed, or answered in the person's own words, it is not now. */
74
- export declare function sentinelStartChoice(notice: Notice, answer: NoticeAnswer): SentinelStartChoice;
75
- /** What the focused chat's agent is asked to do once the person answered a notice - undefined when they dismissed it. */
76
- export declare function noticeTask(notice: Notice, answer: NoticeAnswer): string | undefined;
77
- /**
78
- * What the sentinel keeps of a notice the person ignored, in its guidance: what was left as it is - its module, the gap,
79
- * what the build does - and why, so a fresh conversation does not raise it again.
80
- */
81
- export declare function ignoredGuidance(notice: Notice): string;
82
- /** A notice in words: its summary, its evidence and what can be done - for the agent, the log and a chat without a card. */
83
- export declare function describeNotice(notice: NoticeInput): string;
84
- /** Whether a pulse went wrong: failed, stopped, or ran to its end with what it built not passing. */
85
- export declare function wentWrong(job: Job): boolean;
86
- /**
87
- * The sentinel done with a pulse - or a check a host asked for: whether what it checked holds, and what it checked and
88
- * found, in a line or two. `unchecked`: a pulse or a check that was never checked - the person did not start the
89
- * sentinel, it could not be opened, nothing of the module is launched to test a check in, or what runs cannot hold a
90
- * pulse's commit - turri's own word, never the sentinel's.
91
- */
92
- export interface Conclusion {
93
- /** The pulse: its job id. Undefined for a check. */
94
- job?: string;
95
- /** The check: its id (`SentinelCheck`). Undefined for a pulse. */
96
- check?: string;
97
- verdict: "holds" | "wrong" | "unchecked";
98
- summary: string;
99
- module?: string;
100
- pulse?: number;
101
- }
102
- /**
103
- * Functional specs of a module a host asked the sentinel to check, in what is launched of the module: its codebase's code,
104
- * which holds every module its requires chain builds on. Queued with the pulses, in a conversation of its own.
105
- */
106
- export interface SentinelCheck {
107
- id: string;
108
- /** The module whose launch is tested, by name. */
109
- module: string;
110
- plainFile: string;
111
- /** The functional specs to test, each `module:func-id` - of the module, or of a module its requires chain builds on. */
112
- funcIds: string[];
113
- /** When it was asked for. */
114
- at: string;
115
- }
package/dist/notice.js DELETED
@@ -1,61 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- /**
3
- * The sentinel's name and its notices - what it puts to the person - with nothing else: the session's chats (chats.ts)
4
- * hold them, and load early, before the sentinel's tools and what they need (sentinel.ts) can be.
5
- */
6
- /** Its name in the strip, the host's chat list, and the ledger. */
7
- export const SENTINEL = "sentinel";
8
- /** The answers to the question put before the sentinel first opens: the actions of a `sentinel-start` notice, in order. */
9
- export const SENTINEL_START = {
10
- start: "Start the sentinel",
11
- always: "Start it, and don't ask again",
12
- notNow: "Not this session",
13
- never: "Turn it off for this project",
14
- };
15
- export function newNotice(input, chat) {
16
- return { ...input, id: randomUUID().slice(0, 8), chat, state: "open", at: new Date().toISOString() };
17
- }
18
- /** The choice an answer to a `sentinel-start` notice makes: dismissed, or answered in the person's own words, it is not now. */
19
- export function sentinelStartChoice(notice, answer) {
20
- if (!("action" in answer))
21
- return "notNow";
22
- const label = typeof answer.action === "number" ? notice.actions[answer.action]?.label : answer.action;
23
- return Object.keys(SENTINEL_START).find((choice) => SENTINEL_START[choice] === label) ?? "notNow";
24
- }
25
- /** What the focused chat's agent is asked to do once the person answered a notice - undefined when they dismissed it. */
26
- export function noticeTask(notice, answer) {
27
- if ("dismiss" in answer || "ignore" in answer)
28
- return undefined;
29
- const head = [
30
- `The sentinel put this to the person, about ${notice.module !== undefined ? `${notice.module}${notice.pulse !== undefined ? ` pulse ${notice.pulse}` : ""}` : "the work"}:`,
31
- describeNotice(notice),
32
- "",
33
- ];
34
- if ("steer" in answer)
35
- return [...head, `The person answered it in their own words - do what they say:`, answer.steer.trim()].join("\n");
36
- const action = typeof answer.action === "number" ? notice.actions[answer.action] : notice.actions.find((candidate) => candidate.label === answer.action);
37
- if (action === undefined)
38
- return undefined;
39
- return [...head, `The person chose: ${action.label}. Do it now:`, action.task.trim()].join("\n");
40
- }
41
- /**
42
- * What the sentinel keeps of a notice the person ignored, in its guidance: what was left as it is - its module, the gap,
43
- * what the build does - and why, so a fresh conversation does not raise it again.
44
- */
45
- export function ignoredGuidance(notice) {
46
- const about = notice.module !== undefined ? ` in ${notice.module}` : "";
47
- const shows = notice.evidence.length > 0 ? ` (${notice.evidence.join("; ")})` : "";
48
- return `The person chose to leave this${about} as the build has it - do not raise it again unless the build no longer does what they accepted: ${notice.summary}${shows}`;
49
- }
50
- /** A notice in words: its summary, its evidence and what can be done - for the agent, the log and a chat without a card. */
51
- export function describeNotice(notice) {
52
- return [
53
- `${notice.severity === "error" ? "✗" : notice.severity === "warning" ? "!" : "·"} ${notice.summary}`,
54
- ...notice.evidence.map((line) => ` ${line}`),
55
- ...(notice.actions.length > 0 ? ["What can be done:", ...notice.actions.map((action, index) => ` ${index + 1}. ${action.label}`)] : []),
56
- ].join("\n");
57
- }
58
- /** Whether a pulse went wrong: failed, stopped, or ran to its end with what it built not passing. */
59
- export function wentWrong(job) {
60
- return job.status !== "succeeded" || job.details?.passed === false;
61
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import { Type } from "typebox";
2
- /** parse, for the conversation and for the skills that write specs alike: it checks the ***plain, never the code. */
3
- export declare function checkPlainTool(cwd: string): import("@earendil-works/pi-coding-agent").ToolDefinition<Type.TObject<{
4
- target: Type.TString;
5
- template_dir: Type.TOptional<Type.TArray<Type.TString>>;
6
- }>, {
7
- failed: number;
8
- checked: number;
9
- }, any> & import("@earendil-works/pi-coding-agent").ToolDefinition<any, any, any>;
@@ -1,33 +0,0 @@
1
- import { resolve } from "node:path";
2
- import { defineTool } from "@earendil-works/pi-coding-agent";
3
- import { Type } from "typebox";
4
- import { checkPlainTargets, formatCheckResults } from "./plain/check.js";
5
- /** parse, for the conversation and for the skills that write specs alike: it checks the ***plain, never the code. */
6
- export function checkPlainTool(cwd) {
7
- return defineTool({
8
- name: "parse",
9
- label: "Parse ***plain",
10
- description: "Parse one or more .plain modules - their syntax and structure - without regenerating: each with its test plain files, its " +
11
- "imports and required modules, reporting every syntax, concept and structure error with the line it is on, " +
12
- "and every test plain file outside its module's folder. A module that passes lists each functional spec with its " +
13
- "test plain file and its scenarios - one with no test plain file is not tested. Pass a directory to " +
14
- "check every .plain module in it; a test plain file or test folder is refused - name its module. Fast, free, and offline. " +
15
- "It reads the ***plain alone: it runs no code and no test - whether the code does what the ***plain says is the conformance tests', with conform.",
16
- promptSnippet: "parse ***plain - its syntax and structure, never its code or tests - regenerating nothing",
17
- promptGuidelines: [
18
- "Run parse after editing a .plain file, and before telling the user it is ready. Never shell out to another renderer to check one.",
19
- ],
20
- parameters: Type.Object({
21
- target: Type.String({ description: "A .plain file, or a directory holding .plain files" }),
22
- template_dir: Type.Optional(Type.Array(Type.String(), { description: "Extra template directories" })),
23
- }),
24
- async execute(_id, params) {
25
- const results = checkPlainTargets(resolve(cwd, params.target), (params.template_dir ?? []).map((dir) => resolve(cwd, dir)));
26
- const failed = results.filter((result) => !result.ok).length;
27
- const text = results.length === 0
28
- ? `No .plain files found in ${params.target}.`
29
- : `${formatCheckResults(results)}\n\n${failed === 0 ? "All specs valid." : `${failed} of ${results.length} failed.`}`;
30
- return { content: [{ type: "text", text }], details: { failed, checked: results.length } };
31
- },
32
- });
33
- }
@@ -1 +0,0 @@
1
- import "./terminal-images.ts";
@@ -1,4 +0,0 @@
1
- /** Take pi's /settings over: once a process, every chat's screen. */
2
- export declare function takeOverSettings(): void;
3
- /** Open pi's own settings menu on the screen /settings was typed on. False where there is none - a host, print mode. */
4
- export declare function openPiSettings(): boolean;
package/dist/pi.d.ts DELETED
@@ -1,248 +0,0 @@
1
- import { AgentSession, DefaultResourceLoader, ModelRegistry, type ToolDefinition } from "@earendil-works/pi-coding-agent";
2
- import { type AgentRole } from "./config.ts";
3
- type ThinkingLevel = Parameters<AgentSession["setThinkingLevel"]>[0];
4
- /**
5
- * Where sub-agents take their thinking level from: the conversation that started them.
6
- *
7
- * The model is inherited explicitly, by name, all the way down. The thinking level is just
8
- * as much a choice the person made - and left alone pi falls back to its own default, so a
9
- * conversation turned down for speed would hand every render agent a slower one. Read at
10
- * the moment each session starts, so a change mid-conversation applies to the next agent.
11
- */
12
- export declare function inheritThinkingLevel(source: () => ThinkingLevel | undefined): void;
13
- /**
14
- * How hard an agent thinks: the level the config or the model it is given names; else its role's (ROLE_THINKING) - the
15
- * work thinks little, the judgement more; else the conversation's, for an agent with no role.
16
- */
17
- export declare function agentThinking(named: ThinkingLevel | undefined, role: AgentRole | undefined, conversation: () => ThinkingLevel | undefined): ThinkingLevel | undefined;
18
- /**
19
- * Where sub-agents take the providers pi's extensions registered from: the conversation that started them.
20
- *
21
- * A sub-agent is started without extensions (see subAgentResources), so its models are only what pi's own
22
- * configuration has - models.json and auth.json. A provider an extension registers - a company's own LLM
23
- * gateway, say - is in the conversation's model registry and nowhere else: the conversation could use its
24
- * models and a render or skill agent told to use them could not find them. So every sub-agent's model
25
- * runtime is given the providers the conversation's registry holds when the agent starts - the provider,
26
- * not the extension that registered it.
27
- */
28
- export declare function inheritProviders(source: () => ModelRegistry | undefined): void;
29
- /**
30
- * What a sub-agent session is made of: pi's resources without any extensions.
31
- *
32
- * Left to itself, pi builds every session from the user's configuration - including every
33
- * installed extension. When turri is installed globally, that means each render agent,
34
- * judge and skill executor loads a whole second copy of turri inside itself: its
35
- * tools, its hooks, its job registry, all bound to a session that is thrown away minutes
36
- * later. That copy then outlives its session in module state and breaks the next one. A
37
- * sub-agent is given exactly what it needs instead; for agents that work on specs, that
38
- * includes the ***plain rules, which otherwise only reached them through that stray copy.
39
- *
40
- * Nor any context file. pi puts every AGENTS.md / CLAUDE.md from the agent's folder up - the
41
- * project's, the user's ~/.pi/agent one - into its system prompt; a rendering agent works in
42
- * plain_modules/<module>/code, so it would be given whatever the project says about itself. An
43
- * agent turri starts sees only what turri gives it. The conversation still loads
44
- * them, as pi does.
45
- *
46
- * Nor any of pi's skills. pi lists every skill it finds - the user's, the project's - in the system prompt, for the
47
- * agent to load when one fits; an agent turri starts has one job, and turri runs its gated skills itself,
48
- * giving each step to an agent as its task. The conversation keeps them.
49
- */
50
- export declare function subAgentResources(cwd: string, withRules: boolean, system?: string): Promise<DefaultResourceLoader>;
51
- /** Raised when the provider itself failed, rather than the agent producing a poor answer. */
52
- export declare class ProviderError extends Error {
53
- constructor(message: string);
54
- }
55
- /**
56
- * End the agent's turn, turri's own doing - it is going round in a circle, its time is up. The turn ends as any turn
57
- * does: what the agent said stands, and the harness goes on from there. Never a provider error.
58
- */
59
- export declare function stopTurn(session: AgentSession | undefined, reason: string): void;
60
- /** A turn with one thing left to do: every tool but these is refused, the tools the session has left as they are. */
61
- export interface TurnOptions {
62
- onlyTools?: string[];
63
- }
64
- /** How many calls a restricted turn may have refused before it is stopped. */
65
- export declare const REFUSED_BEFORE_STOP = 3;
66
- /**
67
- * `run`, with every tool of the session but `names` refused (guardRepeats refuses them) until it ends. The tools
68
- * themselves are left as they are, so the tools the model is sent - and its prompt cache - stay the same.
69
- */
70
- export declare function withOnlyTools<T>(session: AgentSession, names: string[], run: () => Promise<T>): Promise<T>;
71
- export declare function ask(session: AgentSession, text: string, onDelta?: (delta: string) => void, turn?: TurnOptions): Promise<string>;
72
- /**
73
- * How many times, after pi's own retries, a turn whose provider failed for a moment is tried again; the first wait,
74
- * doubled each time up to the longest - 15s, 30s, 1m, 2m, 4m, 5m: an outage of about 13 minutes is waited out.
75
- */
76
- export declare const PROVIDER_RETRIES = 6;
77
- export declare const PROVIDER_RETRY_DELAY_MS: number;
78
- export declare const PROVIDER_RETRY_MAX_DELAY_MS: number;
79
- /** The wait before try `attempt + 1`: doubled each time, up to the longest, with a tenth either way so parallel jobs do not all come back at once. */
80
- export declare function providerRetryDelay(attempt: number, random?: () => number): number;
81
- /** How long a request to the model may go without anything coming back before the provider is said to be stalling; 0 never. */
82
- export declare const PROVIDER_STALL_MS: number;
83
- /**
84
- * How long one turn of an agent a render starts may take: past it, the turn ends where it is and
85
- * the harness goes on as after any turn - it runs the tests, and judges. The config's `turn-limit:`
86
- * sets it, in seconds, and each role's in `models:`; 0 turns it off.
87
- */
88
- export declare const DEFAULT_TURN_LIMIT_MS: number;
89
- /** How long past the turn limit what is running then - the model answering, a tool - may take to finish. */
90
- export declare const TURN_GRACE_MS: number;
91
- /** An image an agent is sent with a message. */
92
- export interface AgentImage {
93
- type: "image";
94
- data: string;
95
- mimeType: string;
96
- }
97
- /**
98
- * Refuses, before any agent of a job starts, a named model that reads no images when the job's spec links some -
99
- * rather than once the work is under way. Unnamed, the model is pi's default: `createExecutor` refuses it then.
100
- */
101
- export declare function refuseIfModelIsBlind(modelSpec: string | undefined, count: number): Promise<void>;
102
- /** A model that cannot read images, given images to read. */
103
- export declare class ModelCannotReadImagesError extends Error {
104
- }
105
- /**
106
- * Stops an agent whose model reads no images being given some: it would work blind from the spec's images. Says
107
- * which model, and what to do - a coding model that reads images, or the images described in text instead.
108
- */
109
- export declare function refuseIfBlind(model: {
110
- provider: string;
111
- id: string;
112
- input?: readonly string[];
113
- } | undefined, count: number): void;
114
- /**
115
- * What an agent opens with when its task is in its instructions. The task - the spec, how to read it, what to do
116
- * and the rules - is its system prompt, not its first message: compaction sums up the conversation and never the
117
- * system prompt, so what the agent works from stays word for word as it was, however long the work runs, and stays
118
- * in the cached prefix of every call.
119
- */
120
- export declare const BEGIN = "Begin. Your task is in your instructions.";
121
- /** How a session's work is summed up when it gets larger than the threshold: what the summary has to keep, for its role. */
122
- export interface Compaction {
123
- instructions: string;
124
- /** Tokens of conversation - past the system prompt - past which it is compacted. Default: the project's compact-at, else DEFAULT_COMPACT_AT. */
125
- atTokens?: number;
126
- }
127
- /** Tokens of conversation past which a session that keeps working is compacted, when the project does not say. */
128
- export declare const DEFAULT_COMPACT_AT = 100000;
129
- /** Have a session compacted between turns, as `compaction` says: what createExecutor does for an agent given one. */
130
- export declare function keepCompacted(session: object, compaction: Required<Compaction>): void;
131
- /**
132
- * Compact a session's work when its conversation - what it has done, not its instructions - has got larger than its
133
- * threshold. An agent that keeps its session through a job re-reads everything it did on every call: this keeps
134
- * that bounded, as pi's own compaction does only when the context window is nearly full. The summary keeps what
135
- * its role needs; its instructions are untouched. A compaction that fails leaves the session as it was.
136
- */
137
- export declare function compactIfDue(session: AgentSession): Promise<boolean>;
138
- /**
139
- * Have this session's turns timed, as an agent a render starts has: `limitMs` each - its role's in the config - or
140
- * the default.
141
- */
142
- export declare function timeTurns(session: object, limitMs?: number): void;
143
- /** How many calls to one tool may fail in a row, nothing going through, before the agent's turn is stopped. */
144
- export declare const FAILURES_BEFORE_STOP = 10;
145
- /** How many times running the very same tool call is let through before it is refused, and before the turn is stopped. */
146
- export declare const REPEATS_ALLOWED = 3;
147
- export declare const REPEATS_BEFORE_STOP = 6;
148
- /** JSON with every object's keys in order, so two ways of writing the same arguments read the same. */
149
- export declare function canonicalJson(value: unknown): string;
150
- /** How many tool calls an agent that has one thing to decide may make before it is told to decide. */
151
- export interface CallBudget {
152
- calls: number;
153
- /** The tools that hand over the decision - still let through past the budget. */
154
- finish: string[];
155
- }
156
- /**
157
- * Tools that notice an agent going round in a circle. The same call again and again with nothing in
158
- * between; or a look - read, grep, find, ls - made again with nothing changed since, however many
159
- * other looks came between: the same answer comes back. The first few go through; after that the
160
- * call is refused with what is happening, and if the agent carries on regardless its turn is
161
- * stopped - the harness goes on from there, as after any turn.
162
- *
163
- * With a budget, an agent that has one thing to decide - a verdict, a review, an account - is told
164
- * to decide once it has made that many calls: every tool but the one that hands it over refuses,
165
- * and past twice the budget its turn is stopped. Handing it over starts the count again, and forgets
166
- * the looks: a reviewer kept for the next review reads the files as they are by then.
167
- */
168
- export declare function guardRepeats(tools: ToolDefinition[], session: () => AgentSession | undefined, budget?: CallBudget): ToolDefinition[];
169
- /**
170
- * The executor. One session for the whole skill run, so a retry after a failed
171
- * gate arrives as a follow-up turn with the critique in it rather than as a cold
172
- * start that has forgotten what it just wrote.
173
- */
174
- export declare function createExecutor(opts: {
175
- cwd: string;
176
- customTools: ToolDefinition[];
177
- tools: string[];
178
- /**
179
- * "provider/model-id", with ":level" for how hard it thinks ("google/gemini-3.1-pro:high"), or
180
- * ":level" alone for pi's default model. Omitted: whatever pi is configured to use.
181
- */
182
- model?: string;
183
- /** Give it the ***plain rules - for agents that write or edit specs, not code. */
184
- rules?: boolean;
185
- /** Continue the session saved in this file, instead of starting a new one. */
186
- resumeFrom?: string;
187
- /** Save its session to disk, debug mode or not: it is picked back up later (a skill's run, resumed). */
188
- saveSession?: boolean;
189
- /** Added to its system prompt: its sandbox, above all - what it can reach (see confine.ts sandboxNote). */
190
- system?: string;
191
- /**
192
- * Its task - everything its first prompt used to say: the spec, how to read it, what to do, the rules. It goes
193
- * into its system prompt, after `system`, so compaction never sums it up; open the session with BEGIN.
194
- */
195
- task?: string;
196
- /** Given, the session keeps working through a job and is compacted between turns once its work gets larger than the threshold. */
197
- compaction?: Compaction;
198
- /**
199
- * What the agent is, e.g. "app 3 coding agent". Given, the agent is one a render started: its
200
- * whole conversation is streamed to a log named after it (see debug-log.ts).
201
- */
202
- label?: string;
203
- /** For an agent with one thing to decide: how many tool calls it has, and the tools that hand the decision over. */
204
- budget?: CallBudget;
205
- /**
206
- * Images its task refers to - the spec's linked images. Sent with its first message, and again after each
207
- * compaction, which sums them up with the rest. A model that cannot read images is refused, before any work.
208
- */
209
- images?: AgentImage[];
210
- /**
211
- * For an agent that writes and runs code: the harness's own run of the testing script, which an environment report it
212
- * makes is checked against before the pulse stops (checkAgainstScript). Only an agent given it has
213
- * report_environment_error at all.
214
- */
215
- checkEnvironment?: {
216
- run: () => Promise<{
217
- exitCode: number;
218
- output: string;
219
- }>;
220
- script: string;
221
- };
222
- /**
223
- * What the agent does: its role's model, thinking and turn limit in the config (`models:`) apply - the model over
224
- * `model`, unless the config names none for the role.
225
- */
226
- role?: AgentRole;
227
- }): Promise<AgentSession>;
228
- /** A provider request with its thinking level sent as reasoning effort, where the model takes one turri sends itself. */
229
- export declare function withReasoningEffort(payload: unknown, model: unknown, thinkingLevel: string | undefined): unknown;
230
- /**
231
- * A judge. Fresh session, one tool, and - deliberately - no access to the
232
- * executor's transcript. A judge that inherits the actor's reasoning inherits
233
- * its rationalisations, so it gets the artifact and the rubric, nothing else.
234
- */
235
- export declare function createJudge(opts: {
236
- cwd: string;
237
- verdictTool: ToolDefinition;
238
- modelSpec?: string;
239
- borrowAuthFrom: AgentSession;
240
- /** Read-only tools the rubric needs. Empty keeps the judge unable to touch anything. */
241
- extraTools?: string[];
242
- /** What it judges and by which rubric: its instructions, as an executor's task is. Open the session with BEGIN. */
243
- task?: string;
244
- }): Promise<{
245
- session: AgentSession;
246
- modelNote: string;
247
- }>;
248
- export {};