@turri-dev/cli 0.4.3-next.aea3ca1 → 0.4.3-next.fd01774

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 (483) hide show
  1. package/README.md +24 -3
  2. package/dist/banner.js +248 -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 +163 -54
  10. package/dist/chat-waiting.js +0 -20
  11. package/dist/cli-options.js +11 -7
  12. package/dist/cli-root.js +101 -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/skill-progress.js +25 -0
  40. package/dist/skill-report.js +52 -0
  41. package/dist/terminal-marks.js +21 -0
  42. package/dist/terminal-notifications.js +219 -0
  43. package/dist/terminal-view.js +275 -0
  44. package/dist/turri-versions.js +64 -6
  45. package/docs/README.md +4 -2
  46. package/docs/capture.md +227 -0
  47. package/docs/chats.md +14 -10
  48. package/docs/claude-subscription.md +1 -1
  49. package/docs/config.md +23 -8
  50. package/docs/development.md +30 -61
  51. package/docs/headless.md +3 -1
  52. package/docs/hosting.md +3 -251
  53. package/docs/installation.md +5 -3
  54. package/docs/launch.md +3 -3
  55. package/docs/regenerating.md +1 -1
  56. package/docs/sandbox.md +4 -2
  57. package/docs/sentinel.md +13 -13
  58. package/docs/theming.md +3 -3
  59. package/docs/using.md +13 -5
  60. package/package.json +13 -31
  61. package/dist/ask.d.ts +0 -90
  62. package/dist/ask.js +0 -170
  63. package/dist/background-skills.d.ts +0 -53
  64. package/dist/background-skills.js +0 -121
  65. package/dist/bedrock-region.d.ts +0 -66
  66. package/dist/bedrock-region.js +0 -144
  67. package/dist/brand.d.ts +0 -13
  68. package/dist/btw.d.ts +0 -69
  69. package/dist/btw.js +0 -174
  70. package/dist/chat-commands.d.ts +0 -25
  71. package/dist/chat-idle.d.ts +0 -7
  72. package/dist/chat-idle.js +0 -20
  73. package/dist/chat-models.d.ts +0 -22
  74. package/dist/chat-records.d.ts +0 -50
  75. package/dist/chat-records.js +0 -107
  76. package/dist/chat-scope.d.ts +0 -14
  77. package/dist/chat-scope.js +0 -15
  78. package/dist/chat-skills.d.ts +0 -17
  79. package/dist/chat-skills.js +0 -18
  80. package/dist/chat-terminal.d.ts +0 -24
  81. package/dist/chat-ui.d.ts +0 -33
  82. package/dist/chat-waiting.d.ts +0 -67
  83. package/dist/chats.d.ts +0 -338
  84. package/dist/chats.js +0 -996
  85. package/dist/cli-options.d.ts +0 -24
  86. package/dist/cli.d.ts +0 -9
  87. package/dist/config-edit.d.ts +0 -83
  88. package/dist/config-edit.js +0 -390
  89. package/dist/config.d.ts +0 -415
  90. package/dist/config.js +0 -757
  91. package/dist/conform-cli.d.ts +0 -1
  92. package/dist/conformance-switch.d.ts +0 -25
  93. package/dist/conformance-switch.js +0 -86
  94. package/dist/cultivate-cli.d.ts +0 -1
  95. package/dist/doctor-tool.d.ts +0 -11
  96. package/dist/doctor-tool.js +0 -33
  97. package/dist/drift-cli.d.ts +0 -1
  98. package/dist/environment.d.ts +0 -37
  99. package/dist/environment.js +0 -109
  100. package/dist/extension.d.ts +0 -208
  101. package/dist/genome.d.ts +0 -77
  102. package/dist/genome.js +0 -288
  103. package/dist/graph.d.ts +0 -52
  104. package/dist/graph.js +0 -247
  105. package/dist/host-session.d.ts +0 -112
  106. package/dist/host-session.js +0 -103
  107. package/dist/host.d.ts +0 -40
  108. package/dist/host.js +0 -54
  109. package/dist/identity.d.ts +0 -7
  110. package/dist/identity.js +0 -74
  111. package/dist/init-config.d.ts +0 -169
  112. package/dist/init-config.js +0 -840
  113. package/dist/installed-providers.d.ts +0 -40
  114. package/dist/installed-providers.js +0 -98
  115. package/dist/jellyfish.d.ts +0 -40
  116. package/dist/judge.d.ts +0 -25
  117. package/dist/judge.js +0 -62
  118. package/dist/launch-agent.d.ts +0 -62
  119. package/dist/launch-agent.js +0 -339
  120. package/dist/launch-cli.d.ts +0 -1
  121. package/dist/launch-session.d.ts +0 -68
  122. package/dist/launch-session.js +0 -225
  123. package/dist/launch-tools.d.ts +0 -28
  124. package/dist/launch-tools.js +0 -72
  125. package/dist/launch-track.d.ts +0 -175
  126. package/dist/launch-track.js +0 -497
  127. package/dist/lineage-cli.d.ts +0 -1
  128. package/dist/loop-cli.d.ts +0 -35
  129. package/dist/loop-tools.d.ts +0 -103
  130. package/dist/loop-tools.js +0 -357
  131. package/dist/model-check.d.ts +0 -72
  132. package/dist/model-check.js +0 -162
  133. package/dist/module-report.d.ts +0 -9
  134. package/dist/new-project.d.ts +0 -5
  135. package/dist/new-project.js +0 -31
  136. package/dist/notice.d.ts +0 -115
  137. package/dist/notice.js +0 -61
  138. package/dist/parse-cli.d.ts +0 -1
  139. package/dist/parse-tool.d.ts +0 -9
  140. package/dist/parse-tool.js +0 -33
  141. package/dist/pi-launch.d.ts +0 -1
  142. package/dist/pi-settings.d.ts +0 -4
  143. package/dist/pi.d.ts +0 -248
  144. package/dist/pi.js +0 -889
  145. package/dist/picture-row.d.ts +0 -10
  146. package/dist/plain/check.d.ts +0 -63
  147. package/dist/plain/check.js +0 -236
  148. package/dist/plain/concepts.d.ts +0 -37
  149. package/dist/plain/concepts.js +0 -283
  150. package/dist/plain/cycles.d.ts +0 -21
  151. package/dist/plain/cycles.js +0 -190
  152. package/dist/plain/errors.d.ts +0 -26
  153. package/dist/plain/errors.js +0 -50
  154. package/dist/plain/files.d.ts +0 -47
  155. package/dist/plain/files.js +0 -161
  156. package/dist/plain/graph.d.ts +0 -107
  157. package/dist/plain/graph.js +0 -194
  158. package/dist/plain/highlight.d.ts +0 -43
  159. package/dist/plain/highlight.js +0 -196
  160. package/dist/plain/index.d.ts +0 -18
  161. package/dist/plain/index.js +0 -18
  162. package/dist/plain/liquid.d.ts +0 -22
  163. package/dist/plain/liquid.js +0 -124
  164. package/dist/plain/markdown.d.ts +0 -103
  165. package/dist/plain/markdown.js +0 -330
  166. package/dist/plain/module-concepts.d.ts +0 -32
  167. package/dist/plain/module-concepts.js +0 -80
  168. package/dist/plain/parser.d.ts +0 -163
  169. package/dist/plain/parser.js +0 -930
  170. package/dist/plain/plain.tmLanguage.json +0 -150
  171. package/dist/plain/project.d.ts +0 -48
  172. package/dist/plain/project.js +0 -155
  173. package/dist/plain/spec.d.ts +0 -152
  174. package/dist/plain/spec.js +0 -265
  175. package/dist/plain/stdlib.d.ts +0 -16
  176. package/dist/plain/stdlib.js +0 -48
  177. package/dist/plain/test-plain-file.d.ts +0 -59
  178. package/dist/plain/test-plain-file.js +0 -232
  179. package/dist/plain-files.d.ts +0 -21
  180. package/dist/plain-files.js +0 -156
  181. package/dist/question-dialog.d.ts +0 -55
  182. package/dist/questioning.d.ts +0 -55
  183. package/dist/questioning.js +0 -109
  184. package/dist/quiet.d.ts +0 -34
  185. package/dist/regenerate/activity.d.ts +0 -227
  186. package/dist/regenerate/activity.js +0 -250
  187. package/dist/regenerate/agent-env.d.ts +0 -51
  188. package/dist/regenerate/agent-env.js +0 -311
  189. package/dist/regenerate/agent-shell.d.ts +0 -54
  190. package/dist/regenerate/agent-shell.js +0 -121
  191. package/dist/regenerate/arbiter.d.ts +0 -68
  192. package/dist/regenerate/arbiter.js +0 -133
  193. package/dist/regenerate/audit.d.ts +0 -69
  194. package/dist/regenerate/audit.js +0 -212
  195. package/dist/regenerate/base-folder.d.ts +0 -70
  196. package/dist/regenerate/base-folder.js +0 -186
  197. package/dist/regenerate/cases.d.ts +0 -12
  198. package/dist/regenerate/cases.js +0 -149
  199. package/dist/regenerate/change-view.d.ts +0 -23
  200. package/dist/regenerate/change-view.js +0 -153
  201. package/dist/regenerate/chunk-plan.d.ts +0 -217
  202. package/dist/regenerate/chunk-plan.js +0 -937
  203. package/dist/regenerate/codebase.d.ts +0 -21
  204. package/dist/regenerate/codebase.js +0 -75
  205. package/dist/regenerate/command-check.d.ts +0 -66
  206. package/dist/regenerate/command-check.js +0 -508
  207. package/dist/regenerate/compaction.d.ts +0 -13
  208. package/dist/regenerate/compaction.js +0 -20
  209. package/dist/regenerate/confine.d.ts +0 -69
  210. package/dist/regenerate/confine.js +0 -311
  211. package/dist/regenerate/conform.d.ts +0 -66
  212. package/dist/regenerate/conform.js +0 -132
  213. package/dist/regenerate/conformance-agents.d.ts +0 -388
  214. package/dist/regenerate/conformance-agents.js +0 -1162
  215. package/dist/regenerate/conformance.d.ts +0 -191
  216. package/dist/regenerate/conformance.js +0 -1035
  217. package/dist/regenerate/conversation-writes.d.ts +0 -10
  218. package/dist/regenerate/conversation-writes.js +0 -100
  219. package/dist/regenerate/credentials.d.ts +0 -18
  220. package/dist/regenerate/credentials.js +0 -88
  221. package/dist/regenerate/debug-log.d.ts +0 -56
  222. package/dist/regenerate/debug-log.js +0 -236
  223. package/dist/regenerate/debugger.d.ts +0 -36
  224. package/dist/regenerate/debugger.js +0 -133
  225. package/dist/regenerate/delivery.d.ts +0 -2
  226. package/dist/regenerate/diagnose-job.d.ts +0 -2
  227. package/dist/regenerate/diagnose-job.js +0 -40
  228. package/dist/regenerate/diagnose.d.ts +0 -46
  229. package/dist/regenerate/diagnose.js +0 -92
  230. package/dist/regenerate/diff-view.d.ts +0 -64
  231. package/dist/regenerate/drift.d.ts +0 -120
  232. package/dist/regenerate/drift.js +0 -285
  233. package/dist/regenerate/environment-error.d.ts +0 -167
  234. package/dist/regenerate/environment-error.js +0 -342
  235. package/dist/regenerate/failure-reports.d.ts +0 -28
  236. package/dist/regenerate/failure-reports.js +0 -79
  237. package/dist/regenerate/job-log.d.ts +0 -30
  238. package/dist/regenerate/job-log.js +0 -105
  239. package/dist/regenerate/job-panel.d.ts +0 -122
  240. package/dist/regenerate/job-panel.js +0 -339
  241. package/dist/regenerate/jobs-tree.d.ts +0 -75
  242. package/dist/regenerate/jobs.d.ts +0 -231
  243. package/dist/regenerate/jobs.js +0 -522
  244. package/dist/regenerate/lanes.d.ts +0 -16
  245. package/dist/regenerate/lanes.js +0 -32
  246. package/dist/regenerate/launch.d.ts +0 -256
  247. package/dist/regenerate/launch.js +0 -689
  248. package/dist/regenerate/ledger-view.d.ts +0 -87
  249. package/dist/regenerate/ledger-view.js +0 -325
  250. package/dist/regenerate/ledger.d.ts +0 -368
  251. package/dist/regenerate/ledger.js +0 -357
  252. package/dist/regenerate/lineage.d.ts +0 -105
  253. package/dist/regenerate/lineage.js +0 -485
  254. package/dist/regenerate/list-arguments.d.ts +0 -21
  255. package/dist/regenerate/list-arguments.js +0 -121
  256. package/dist/regenerate/loop.d.ts +0 -423
  257. package/dist/regenerate/loop.js +0 -2079
  258. package/dist/regenerate/masking.d.ts +0 -19
  259. package/dist/regenerate/masking.js +0 -95
  260. package/dist/regenerate/model-names.d.ts +0 -33
  261. package/dist/regenerate/model-names.js +0 -92
  262. package/dist/regenerate/notes.d.ts +0 -159
  263. package/dist/regenerate/notes.js +0 -446
  264. package/dist/regenerate/os-sandbox.d.ts +0 -93
  265. package/dist/regenerate/os-sandbox.js +0 -283
  266. package/dist/regenerate/panel-dock.d.ts +0 -23
  267. package/dist/regenerate/paths.d.ts +0 -110
  268. package/dist/regenerate/paths.js +0 -190
  269. package/dist/regenerate/plain-palette.d.ts +0 -34
  270. package/dist/regenerate/prompt.d.ts +0 -230
  271. package/dist/regenerate/prompt.js +0 -741
  272. package/dist/regenerate/pulse-files.d.ts +0 -14
  273. package/dist/regenerate/pulse-files.js +0 -63
  274. package/dist/regenerate/records.d.ts +0 -132
  275. package/dist/regenerate/records.js +0 -327
  276. package/dist/regenerate/regenerate.d.ts +0 -106
  277. package/dist/regenerate/regenerate.js +0 -660
  278. package/dist/regenerate/regression.d.ts +0 -58
  279. package/dist/regenerate/regression.js +0 -188
  280. package/dist/regenerate/renames.d.ts +0 -42
  281. package/dist/regenerate/renames.js +0 -185
  282. package/dist/regenerate/requires.d.ts +0 -117
  283. package/dist/regenerate/requires.js +0 -377
  284. package/dist/regenerate/resources.d.ts +0 -57
  285. package/dist/regenerate/resources.js +0 -162
  286. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  287. package/dist/regenerate/scripts-being-written.js +0 -30
  288. package/dist/regenerate/self-check.d.ts +0 -29
  289. package/dist/regenerate/self-check.js +0 -119
  290. package/dist/regenerate/services.d.ts +0 -28
  291. package/dist/regenerate/services.js +0 -158
  292. package/dist/regenerate/shell.d.ts +0 -91
  293. package/dist/regenerate/shell.js +0 -320
  294. package/dist/regenerate/side-panel.d.ts +0 -59
  295. package/dist/regenerate/spec-map-view.d.ts +0 -139
  296. package/dist/regenerate/spec-map.d.ts +0 -160
  297. package/dist/regenerate/spec-map.js +0 -596
  298. package/dist/regenerate/spec-steps.d.ts +0 -180
  299. package/dist/regenerate/spec-steps.js +0 -729
  300. package/dist/regenerate/standing.d.ts +0 -28
  301. package/dist/regenerate/standing.js +0 -30
  302. package/dist/regenerate/state.d.ts +0 -21
  303. package/dist/regenerate/state.js +0 -10
  304. package/dist/regenerate/steering.d.ts +0 -56
  305. package/dist/regenerate/steering.js +0 -119
  306. package/dist/regenerate/stop-report.d.ts +0 -43
  307. package/dist/regenerate/stop-report.js +0 -160
  308. package/dist/regenerate/submit-work.d.ts +0 -44
  309. package/dist/regenerate/submit-work.js +0 -76
  310. package/dist/regenerate/test-kinds.d.ts +0 -85
  311. package/dist/regenerate/test-kinds.js +0 -171
  312. package/dist/regenerate/test-scripts.d.ts +0 -235
  313. package/dist/regenerate/test-scripts.js +0 -843
  314. package/dist/regenerate/testing-steps.d.ts +0 -52
  315. package/dist/regenerate/testing-steps.js +0 -129
  316. package/dist/regenerate/testing.d.ts +0 -150
  317. package/dist/regenerate/testing.js +0 -438
  318. package/dist/regenerate/transcript-view.d.ts +0 -21
  319. package/dist/regenerate/unit-gate.d.ts +0 -27
  320. package/dist/regenerate/unit-gate.js +0 -20
  321. package/dist/regenerate/unit-review.d.ts +0 -152
  322. package/dist/regenerate/unit-review.js +0 -361
  323. package/dist/regenerate/web.d.ts +0 -61
  324. package/dist/regenerate/web.js +0 -256
  325. package/dist/regenerate/workspace.d.ts +0 -12
  326. package/dist/regenerate/workspace.js +0 -99
  327. package/dist/regenerate-cli.d.ts +0 -1
  328. package/dist/resume-line.d.ts +0 -5
  329. package/dist/review/live.d.ts +0 -72
  330. package/dist/review/live.js +0 -166
  331. package/dist/rules.d.ts +0 -20
  332. package/dist/rules.js +0 -47
  333. package/dist/run-report.d.ts +0 -88
  334. package/dist/run-report.js +0 -338
  335. package/dist/screen-padding.d.ts +0 -28
  336. package/dist/self-invocation.d.ts +0 -36
  337. package/dist/self-invocation.js +0 -137
  338. package/dist/sentinel-chat.d.ts +0 -19
  339. package/dist/sentinel-chat.js +0 -221
  340. package/dist/sentinel-check.d.ts +0 -36
  341. package/dist/sentinel-check.js +0 -78
  342. package/dist/sentinel.d.ts +0 -107
  343. package/dist/sentinel.js +0 -599
  344. package/dist/settings.d.ts +0 -45
  345. package/dist/settings.js +0 -378
  346. package/dist/setup.d.ts +0 -97
  347. package/dist/setup.js +0 -428
  348. package/dist/skill-progress.d.ts +0 -46
  349. package/dist/skill.d.ts +0 -102
  350. package/dist/skill.js +0 -147
  351. package/dist/skills.d.ts +0 -54
  352. package/dist/skills.js +0 -111
  353. package/dist/spawn-async.d.ts +0 -18
  354. package/dist/spawn-async.js +0 -35
  355. package/dist/stack.d.ts +0 -80
  356. package/dist/stack.js +0 -206
  357. package/dist/stdlib.d.ts +0 -43
  358. package/dist/stdlib.js +0 -118
  359. package/dist/surface.d.ts +0 -5
  360. package/dist/surface.js +0 -18
  361. package/dist/terminal-images.d.ts +0 -2
  362. package/dist/test-plain-files.d.ts +0 -41
  363. package/dist/test-plain-files.js +0 -172
  364. package/dist/tools.d.ts +0 -101
  365. package/dist/tools.js +0 -242
  366. package/dist/turri-versions.d.ts +0 -71
  367. package/genome/rules/bullet-continuation.md +0 -61
  368. package/genome/rules/concise-specs-examples.md +0 -460
  369. package/genome/rules/concise-specs-integration-examples.md +0 -281
  370. package/genome/rules/concise-specs.md +0 -80
  371. package/genome/rules/definitions.md +0 -107
  372. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  373. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  374. package/genome/rules/exported-concepts.md +0 -39
  375. package/genome/rules/func-specs.md +0 -164
  376. package/genome/rules/impl-reqs.md +0 -68
  377. package/genome/rules/import-modules.md +0 -49
  378. package/genome/rules/integration-embedded-testing.md +0 -273
  379. package/genome/rules/integration-embedded.md +0 -171
  380. package/genome/rules/integration-standalone.md +0 -135
  381. package/genome/rules/integrations.md +0 -136
  382. package/genome/rules/linked-resources.md +0 -76
  383. package/genome/rules/module-structure.md +0 -112
  384. package/genome/rules/project-model.md +0 -69
  385. package/genome/rules/required-concepts.md +0 -44
  386. package/genome/rules/requires-modules.md +0 -81
  387. package/genome/rules/semantic-ids.md +0 -49
  388. package/genome/rules/stdlib.md +0 -37
  389. package/genome/rules/test-plain-files.md +0 -138
  390. package/genome/rules/test-reqs.md +0 -57
  391. package/genome/rules/turri-regeneration.md +0 -66
  392. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  393. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  394. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  395. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  396. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  397. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  398. package/genome/skills/debug-specs/SKILL.md +0 -194
  399. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  400. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  401. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  402. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  403. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  404. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  405. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  406. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  407. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  408. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  409. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  410. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  411. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  412. package/genome/skills/refactor-module/SKILL.md +0 -218
  413. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  414. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  415. package/stdlib/backend/common.plain +0 -25
  416. package/stdlib/backend/conformance/common.plain +0 -12
  417. package/stdlib/backend/conformance/go-gin.plain +0 -9
  418. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  419. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  420. package/stdlib/backend/conformance/python-django.plain +0 -9
  421. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  422. package/stdlib/backend/conformance/python-flask.plain +0 -9
  423. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  424. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  425. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  426. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  427. package/stdlib/backend/go-gin.plain +0 -18
  428. package/stdlib/backend/go-nethttp.plain +0 -18
  429. package/stdlib/backend/java-springboot.plain +0 -19
  430. package/stdlib/backend/python-django.plain +0 -19
  431. package/stdlib/backend/python-fastapi.plain +0 -23
  432. package/stdlib/backend/python-flask.plain +0 -23
  433. package/stdlib/backend/rust-axum.plain +0 -17
  434. package/stdlib/backend/typescript-express.plain +0 -19
  435. package/stdlib/backend/typescript-fastify.plain +0 -19
  436. package/stdlib/backend/typescript-nestjs.plain +0 -19
  437. package/stdlib/cli/common.plain +0 -17
  438. package/stdlib/cli/conformance/common.plain +0 -11
  439. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  440. package/stdlib/cli/conformance/go-flag.plain +0 -9
  441. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  442. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  443. package/stdlib/cli/conformance/python-click.plain +0 -9
  444. package/stdlib/cli/conformance/python-typer.plain +0 -9
  445. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  446. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  447. package/stdlib/cli/go-cobra.plain +0 -14
  448. package/stdlib/cli/go-flag.plain +0 -14
  449. package/stdlib/cli/java-picocli.plain +0 -15
  450. package/stdlib/cli/python-argparse.plain +0 -18
  451. package/stdlib/cli/python-click.plain +0 -16
  452. package/stdlib/cli/python-typer.plain +0 -16
  453. package/stdlib/cli/rust-clap.plain +0 -14
  454. package/stdlib/cli/typescript-commander.plain +0 -17
  455. package/stdlib/frontend/angular.plain +0 -17
  456. package/stdlib/frontend/common.plain +0 -17
  457. package/stdlib/frontend/conformance/angular.plain +0 -5
  458. package/stdlib/frontend/conformance/common.plain +0 -11
  459. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  460. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  461. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  462. package/stdlib/frontend/react-vite.plain +0 -16
  463. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  464. package/stdlib/frontend/vue-vite.plain +0 -16
  465. package/stdlib/lang/go.plain +0 -13
  466. package/stdlib/lang/java.plain +0 -12
  467. package/stdlib/lang/python.plain +0 -18
  468. package/stdlib/lang/rust.plain +0 -12
  469. package/stdlib/lang/typescript.plain +0 -13
  470. package/stdlib/library/common.plain +0 -15
  471. package/stdlib/library/conformance/common.plain +0 -9
  472. package/stdlib/library/conformance/go.plain +0 -9
  473. package/stdlib/library/conformance/java-gradle.plain +0 -9
  474. package/stdlib/library/conformance/java-maven.plain +0 -9
  475. package/stdlib/library/conformance/python.plain +0 -9
  476. package/stdlib/library/conformance/rust.plain +0 -9
  477. package/stdlib/library/conformance/typescript.plain +0 -9
  478. package/stdlib/library/go.plain +0 -12
  479. package/stdlib/library/java-gradle.plain +0 -13
  480. package/stdlib/library/java-maven.plain +0 -13
  481. package/stdlib/library/python.plain +0 -13
  482. package/stdlib/library/rust.plain +0 -12
  483. package/stdlib/library/typescript.plain +0 -15
@@ -1,156 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
3
- import { basename, isAbsolute, join, relative, resolve, sep } from "node:path";
4
- import { createEditToolDefinition, createWriteToolDefinition } from "@earendil-works/pi-coding-agent";
5
- import { readProjectConfig, moduleConfigsOf } from "./config.js";
6
- import { parseMarkdown } from "./plain/markdown.js";
7
- import { hasScheme, linksIn } from "./plain/parser.js";
8
- import { insideAny } from "./regenerate/confine.js";
9
- import { credentialRefusal, isCredentialFile } from "./regenerate/credentials.js";
10
- import { DIST_DIR, MODULES_DIR } from "./regenerate/paths.js";
11
- import { PREPARE_NAME, SCRIPTS_DIR, scriptKind } from "./regenerate/test-scripts.js";
12
- /** A config.turri.yaml, a module's own config.turri.<module>.yaml - what the project's testing scripts are named in. */
13
- const TURRI_CONFIG_NAME = /^config\.turri(\.[^/]+)?\.yaml$/;
14
- /** Folders that hold what is built, installed or turri's own - never the project's ***plain. */
15
- function outsidePlain(path) {
16
- const parts = path.split(sep);
17
- return parts[0] === DIST_DIR || parts.some((part) => part.startsWith(".") || part === MODULES_DIR || part === "node_modules" || part === "__pycache__");
18
- }
19
- /**
20
- * The project's ***plain and what it is built with, and a digest of each: its .plain files, the resources they link,
21
- * its testing scripts and its config.turri*.yaml. Nothing else is a skill's to change - not the built code, a launch,
22
- * what a running app writes. `also`: paths that were among them before, digested while they are there, so one a skill
23
- * stopped linking or naming is still seen if it changed it.
24
- */
25
- export function projectFiles(root, also = []) {
26
- const all = [];
27
- const walk = (dir, depth) => {
28
- if (depth > 8)
29
- return;
30
- let entries;
31
- try {
32
- entries = readdirSync(dir, { withFileTypes: true });
33
- }
34
- catch {
35
- return;
36
- }
37
- for (const entry of entries) {
38
- if (entry.name.startsWith(".") || entry.name === MODULES_DIR || entry.name === "node_modules" || entry.name === "__pycache__")
39
- continue;
40
- const path = join(dir, entry.name);
41
- if (entry.isDirectory())
42
- walk(path, depth + 1);
43
- else if (entry.isFile())
44
- all.push(relative(root, path));
45
- }
46
- };
47
- walk(root, 0);
48
- const wanted = new Set(also);
49
- const named = (path) => {
50
- if (path !== undefined && path.trim() !== "")
51
- wanted.add(relative(root, resolve(root, path.trim())));
52
- };
53
- for (const path of all) {
54
- const name = basename(path);
55
- if (path.split(sep)[0] === SCRIPTS_DIR || scriptKind(name) !== undefined || PREPARE_NAME.test(name) || TURRI_CONFIG_NAME.test(name))
56
- wanted.add(path);
57
- if (!path.endsWith(".plain"))
58
- continue;
59
- wanted.add(path);
60
- // The resources it links, as the parser reads its links: from the project's folder.
61
- try {
62
- for (const { target } of linksIn(parseMarkdown(readFileSync(join(root, path), "utf8")))) {
63
- if (target !== "" && !hasScheme(target) && !isAbsolute(target))
64
- named(target);
65
- }
66
- }
67
- catch {
68
- // A file that cannot be read links nothing.
69
- }
70
- }
71
- // Scripts config.turri*.yaml names, whatever they are called.
72
- for (const module of [undefined, ...moduleConfigsOf(root)]) {
73
- const config = readProjectConfig(root, module);
74
- named(config.unittestsScript);
75
- named(config.conformanceTestsScript);
76
- named(config.prepareEnvironmentScript);
77
- }
78
- const files = new Map();
79
- for (const path of wanted) {
80
- if (path.startsWith("..") || isAbsolute(path) || path.split(sep).includes(MODULES_DIR))
81
- continue;
82
- try {
83
- files.set(path, createHash("sha1").update(readFileSync(join(root, path))).digest("hex"));
84
- }
85
- catch {
86
- // A file that cannot be read, or is not there, is left out.
87
- }
88
- }
89
- return files;
90
- }
91
- /** The files added, changed or removed between two digests of the project. */
92
- export function changedFiles(before, after) {
93
- const changed = [...after].filter(([path, digest]) => before.get(path) !== digest).map(([path]) => path);
94
- const removed = [...before.keys()].filter((path) => !after.has(path)).map((path) => `${path} (removed)`);
95
- return [...changed, ...removed].sort();
96
- }
97
- /**
98
- * Why a skill's agent may not write a path, or nothing when it may. It writes the project's ***plain: a file of it
99
- * (`projectFiles`), or a new one - a resource it is about to link, a testing script - anywhere in the project but where
100
- * what is built, launched or installed lives. Never an existing file that is not the ***plain's: the code, a launch,
101
- * what an app it started writes.
102
- */
103
- export function plainWriteRefusal(root, path) {
104
- const absolute = resolve(root, path);
105
- if (!insideAny(absolute, [root]))
106
- return `${absolute} is outside the project. A skill writes the project's ***plain, and nothing else.`;
107
- if (isCredentialFile(absolute))
108
- return credentialRefusal(absolute);
109
- const inProject = relative(resolve(root), absolute);
110
- if (outsidePlain(inProject)) {
111
- return (`${inProject} is not the project's ***plain - ${MODULES_DIR}/, ${DIST_DIR}/ and the hidden folders hold what is ` +
112
- "built, launched and installed, and turri's own. A skill writes .plain files, the resources they link and the testing scripts.");
113
- }
114
- if (existsSync(absolute) && !projectFiles(root).has(inProject)) {
115
- return (`${inProject} is not the project's ***plain: no .plain file links it, and it is not a testing script or a ` +
116
- "config.turri*.yaml. A skill changes only those - link a resource from the ***plain before changing it.");
117
- }
118
- return undefined;
119
- }
120
- /** pi's write and edit for a skill's agent: each path checked by `plainWriteRefusal` - as given, and as the tool resolved it. */
121
- export function plainWriteTools(root) {
122
- const check = (path) => {
123
- if (path === undefined)
124
- return;
125
- const refusal = plainWriteRefusal(root, path.trim().replace(/^@/, ""));
126
- if (refusal !== undefined)
127
- throw new Error(refusal);
128
- };
129
- const guard = (def) => ({
130
- ...def,
131
- async execute(toolCallId, params, signal, onUpdate, ctx) {
132
- check(params.path);
133
- return def.execute(toolCallId, params, signal, onUpdate, ctx);
134
- },
135
- });
136
- return [
137
- guard(createWriteToolDefinition(root, {
138
- operations: {
139
- writeFile: async (path, content) => (check(path), writeFileSync(path, content)),
140
- // A folder that is there already is not written: only where it would be made is checked.
141
- mkdir: async (dir) => {
142
- if (!existsSync(dir))
143
- check(dir);
144
- mkdirSync(dir, { recursive: true });
145
- },
146
- },
147
- })),
148
- guard(createEditToolDefinition(root, {
149
- operations: {
150
- readFile: async (path) => (check(path), readFileSync(path)),
151
- writeFile: async (path, content) => (check(path), writeFileSync(path, content)),
152
- access: async (path) => check(path),
153
- },
154
- })),
155
- ];
156
- }
@@ -1,55 +0,0 @@
1
- import { type Component, type Focusable, type TuiMouseEvent, type TuiMouseEventResult } from "@earendil-works/pi-tui";
2
- /**
3
- * The dialog a question is put to the person in, in the TUI: what they must read to answer - a brief to confirm, a plan
4
- * to approve - above the question, and the options, or a line to type the answer on.
5
- *
6
- * pi's own select puts all of it in its title, so a long brief pushes the options off the screen: the person answers a
7
- * question they cannot see the choices of. Here the brief scrolls in a window of its own, sized to the terminal, and
8
- * the question and its options always show below it - PgUp/PgDn or Shift+Up/Down scroll it, and the mouse wheel.
9
- */
10
- export interface DialogStyle {
11
- accent(text: string): string;
12
- muted(text: string): string;
13
- bold(text: string): string;
14
- }
15
- export interface QuestionDialogOptions {
16
- /** What to read to answer: shown above the question, scrolling when it is long. Markdown's **bold** and `code` shown as such. */
17
- context?: string;
18
- question: string;
19
- /** The choices. Without them, a line to type the answer on. */
20
- options?: string[];
21
- /** The choice the cursor starts on. */
22
- selected?: number;
23
- /** The terminal's height, for the window the brief scrolls in. */
24
- rows: () => number;
25
- style: DialogStyle;
26
- /** The answer - an option, or what was typed - or undefined, dismissed. */
27
- done: (answer: string | undefined) => void;
28
- /** ctrl+c: the question declined, the asker deciding what that stops (askUserVia). Without it, dismissed as esc is. */
29
- interrupt?: () => void;
30
- /** Draw again: a key changed what shows. */
31
- requestRender: () => void;
32
- }
33
- export declare class QuestionDialog implements Component, Focusable {
34
- private readonly options;
35
- private readonly input;
36
- private selected;
37
- /** The brief's first line in its window. */
38
- private scroll;
39
- /** How far the brief scrolls, and its window's height - as last drawn. */
40
- private maxScroll;
41
- private window;
42
- private answered;
43
- private focusedNow;
44
- constructor(options: QuestionDialogOptions);
45
- get focused(): boolean;
46
- set focused(value: boolean);
47
- /** Closed, no answer given: the question declined from outside - its turn stopped. */
48
- dismiss(): void;
49
- private finish;
50
- private scrollBy;
51
- render(width: number): string[];
52
- handleInput(data: string): void;
53
- handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
54
- invalidate(): void;
55
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * How many questions an interview may put to the person in each phase it caps, and how broad each is - the
3
- * questioning level, the first thing a skill with `metadata.questioning` asks. Light, medium and thorough cap each such
4
- * phase at 3, 5 and 10 questions; best judgement leaves it to the agent, which says when it has asked enough. Every
5
- * level covers the same ground: fewer questions are broader ones, and what they leave open the agent decides itself.
6
- * The level limits the questions, never the spec changes. The phase's closing confirmation, asked with
7
- * `confirms_phase`, is never counted.
8
- */
9
- export interface QuestioningLevel {
10
- name: string;
11
- /** Questions a capped phase may ask; none for best judgement. */
12
- cap?: number;
13
- /** As the person is offered it. */
14
- option: string;
15
- /** How broad each question is, as the agent is told. */
16
- breadth: string;
17
- }
18
- export declare const QUESTIONING_LEVELS: QuestioningLevel[];
19
- /** The level an answer picks: by its name, wherever it is in the answer; anything else is best judgement. */
20
- export declare function levelOf(answer: string): QuestioningLevel;
21
- /** The question the harness puts first, and what the person reads above it. */
22
- export declare function questioningQuestion(phases: string[]): {
23
- question: string;
24
- options: string[];
25
- context: string;
26
- };
27
- /** What a resumed run picks up: the level, and how far each phase's questions went. */
28
- export interface QuestioningState {
29
- level: string;
30
- asked: Record<string, number>;
31
- /** Phases whose questions are over. */
32
- over: string[];
33
- }
34
- export interface Questioning {
35
- level: QuestioningLevel;
36
- /** The phase now running. */
37
- enter(phase: string): void;
38
- /** Why a question may not be asked now, or undefined when it may. */
39
- refusal(confirmsPhase: boolean): string | undefined;
40
- /** A question was answered. */
41
- answered(confirmsPhase: boolean): void;
42
- /** The agent ends this phase's questions itself; what to tell it. */
43
- end(): string;
44
- /** What the agent is told of the level as a phase starts. */
45
- note(phase: string, first: boolean): string | undefined;
46
- state(): QuestioningState;
47
- }
48
- export declare function createQuestioning(options: {
49
- level: QuestioningLevel;
50
- /** The phases the level caps. */
51
- phases: string[];
52
- from?: QuestioningState;
53
- /** Called whenever the state changes, to keep it for a resume. */
54
- onChange?: (state: QuestioningState) => void;
55
- }): Questioning;
@@ -1,109 +0,0 @@
1
- /**
2
- * How many questions an interview may put to the person in each phase it caps, and how broad each is - the
3
- * questioning level, the first thing a skill with `metadata.questioning` asks. Light, medium and thorough cap each such
4
- * phase at 3, 5 and 10 questions; best judgement leaves it to the agent, which says when it has asked enough. Every
5
- * level covers the same ground: fewer questions are broader ones, and what they leave open the agent decides itself.
6
- * The level limits the questions, never the spec changes. The phase's closing confirmation, asked with
7
- * `confirms_phase`, is never counted.
8
- */
9
- export const QUESTIONING_LEVELS = [
10
- {
11
- name: "light",
12
- cap: 3,
13
- option: "Light - at most 3 broad questions a phase, turri decides the details",
14
- breadth: "Ask broad questions: each settles a whole area of the phase at once - the features and their order, what the product does end to end - proposing what fits the brief for the person to confirm or correct. The details are yours.",
15
- },
16
- {
17
- name: "medium",
18
- cap: 5,
19
- option: "Medium - at most 5 questions a phase, each a feature or topic",
20
- breadth: "Ask about one feature or topic a question, with its main rules in the same question. The edge cases are yours.",
21
- },
22
- {
23
- name: "thorough",
24
- cap: 10,
25
- option: "Thorough - at most 10 narrow questions a phase, edge cases included",
26
- breadth: "Ask narrow questions: one feature, rule or edge case a question, with follow-ups on the ones that matter most.",
27
- },
28
- {
29
- name: "best judgement",
30
- option: "Best judgement - turri decides how much each phase asks",
31
- breadth: "Ask as broadly or as narrowly as each area needs - narrow where the person's answer changes the product, broad or not at all where the brief already says.",
32
- },
33
- ];
34
- const BEST_JUDGEMENT = QUESTIONING_LEVELS.at(-1);
35
- /** The level an answer picks: by its name, wherever it is in the answer; anything else is best judgement. */
36
- export function levelOf(answer) {
37
- const said = answer.toLowerCase();
38
- return QUESTIONING_LEVELS.find((level) => said.startsWith(level.name)) ?? QUESTIONING_LEVELS.find((level) => said.includes(level.name.split(" ")[0])) ?? BEST_JUDGEMENT;
39
- }
40
- /** The question the harness puts first, and what the person reads above it. */
41
- export function questioningQuestion(phases) {
42
- const named = phases.length === 1 ? `the ${phases[0]} phase` : `the ${phases.slice(0, -1).join(", ")} and ${phases.at(-1)} phases`;
43
- return {
44
- question: `How many questions should I ask you in ${named}?`,
45
- options: QUESTIONING_LEVELS.map((level) => level.option),
46
- context: `Light, medium and thorough cap ${phases.length === 1 ? named : `each of ${named}`} at 3, 5 and 10 questions - broader with fewer, so every level ` +
47
- "covers the same ground, only in less or more depth. What the questions leave open, turri decides itself and " +
48
- "says what it chose. With best judgement, turri asks as much as it judges each phase needs. Each phase still " +
49
- "ends with your confirmation of its summary.",
50
- };
51
- }
52
- export function createQuestioning(options) {
53
- const { level, phases } = options;
54
- const asked = { ...(options.from?.asked ?? {}) };
55
- const over = new Set(options.from?.over ?? []);
56
- let phase = "";
57
- const capped = () => phases.includes(phase);
58
- const state = () => ({ level: level.name, asked: { ...asked }, over: [...over] });
59
- const changed = () => options.onChange?.(state());
60
- const decideTheRest = "Decide what is left yourself, as a careful engineer would, in the light of the intent brief, and say in one line what you chose.";
61
- return {
62
- level,
63
- enter(next) {
64
- phase = next;
65
- },
66
- refusal(confirmsPhase) {
67
- if (!capped() || confirmsPhase || !over.has(phase))
68
- return undefined;
69
- const why = level.cap !== undefined && (asked[phase] ?? 0) >= level.cap
70
- ? `${level.name} questioning allows ${level.cap} questions in the ${phase} phase, and all ${level.cap} are asked`
71
- : `you ended the ${phase} phase's questions`;
72
- return `This question was not asked: ${why}. ${decideTheRest} Only the phase's closing confirmation, with confirms_phase, may still be asked.`;
73
- },
74
- answered(confirmsPhase) {
75
- if (!capped() || confirmsPhase)
76
- return;
77
- asked[phase] = (asked[phase] ?? 0) + 1;
78
- if (level.cap !== undefined && asked[phase] >= level.cap)
79
- over.add(phase);
80
- changed();
81
- },
82
- end() {
83
- if (!capped())
84
- return `The ${phase} phase's questions are not capped: ask what it needs.`;
85
- over.add(phase);
86
- changed();
87
- return `The ${phase} phase's questions are over. ${decideTheRest} End the phase with its summary and its confirmation, asked with confirms_phase.`;
88
- },
89
- note(next, first) {
90
- const chosen = `The person chose ${level.name} questioning${first ? " - the harness asked it, so do not ask it again" : ""}.`;
91
- if (!phases.includes(next)) {
92
- return first ? `${chosen} It caps the questions of the ${phases.join(" and ")} phases, not this one.` : undefined;
93
- }
94
- const limit = level.cap !== undefined
95
- ? `Ask at most ${level.cap} questions with ask_user in this phase, follow-ups included; past them ask_user refuses. To stop sooner, call end_questions.`
96
- : "Stop asking once the phase is settled enough to build: call end_questions.";
97
- return [
98
- chosen,
99
- limit,
100
- level.breadth,
101
- "Whatever the level, the questions cover all of the phase's topics: the level sets their depth, not their reach.",
102
- "The phase's closing confirmation is asked with confirms_phase: true and is not counted.",
103
- `What the questions leave open: ${decideTheRest}`,
104
- "The level limits the questions, never the spec changes: write as many as the phase needs, decided ones included.",
105
- ].join(" ");
106
- },
107
- state,
108
- };
109
- }
package/dist/quiet.d.ts DELETED
@@ -1,34 +0,0 @@
1
- /**
2
- * Keeps library chatter out of the terminal while a tool runs.
3
- *
4
- * A skill run spawns many nested agent sessions - an executor, two judges per gate, a fix
5
- * agent, each queued render - and libraries underneath them write to the console. In the
6
- * TUI every one of those writes interrupts the differential renderer, which abandons the
7
- * current frame and leaves it stranded in scrollback. Dozens of "Working" lines pile up.
8
- *
9
- * Only the `console` methods are intercepted, never `process.stdout.write` itself: that is
10
- * how pi draws the TUI, and silencing it would blank the screen. Library noise goes
11
- * through `console`; pi's rendering does not.
12
- */
13
- /** Drop the NOISE warnings for good, from here on - captured or not. Safe to call more than once. */
14
- export declare function dropNoise(): void;
15
- export interface Captured<T> {
16
- result: T;
17
- /** Whatever the libraries tried to print, in order. */
18
- output: string[];
19
- }
20
- /** Run `fn` with console output collected instead of printed. */
21
- export declare function captureConsole<T>(fn: () => Promise<T>): Promise<Captured<T>>;
22
- /**
23
- * Capture that spans something other than one promise - a whole agent turn, say.
24
- *
25
- * `captureConsole` covers work it can wrap. A conversation's own model calls happen inside
26
- * pi's agent loop, where there is nothing to wrap, so those are bracketed by hand instead.
27
- * `end` is safe to call twice and safe to skip: an unbalanced `begin` leaves the console
28
- * patched, so callers must end it from a handler that always runs.
29
- */
30
- export declare function beginCapture(): {
31
- end: () => string[];
32
- };
33
- /** One line noting what was swallowed, or nothing when it was quiet. */
34
- export declare function describeCaptured(output: string[]): string | null;
@@ -1,227 +0,0 @@
1
- /**
2
- * What a background job is doing right now.
3
- *
4
- * A render is minutes of agents working with nothing on screen. The work is several layers
5
- * deep - a chain, a module, a functionality, an agent session, its tool calls - and
6
- * threading a callback through all of them would touch every signature on the way. Instead
7
- * each job runs inside its own async context, and anything underneath it reports into
8
- * whichever job it is running for: the render steps say which stage they are at, and every
9
- * agent session reports its tool calls. Outside a job, reporting is a no-op.
10
- */
11
- export interface ActivitySink {
12
- /** Which stage of the work this is, e.g. "writing code and unit tests". */
13
- stage(label: string): void;
14
- /** One thing that just happened, e.g. "✎ write greeter.py". */
15
- activity(line: string): void;
16
- /** A line about the machinery under the work - which walls are up, what a command changed that was put back - kept in the job's log too. */
17
- note?(line: string): void;
18
- /**
19
- * What is happening at this moment, e.g. "thinking", or undefined when nothing is.
20
- * `keepSince` updates the words without restarting the clock on it.
21
- */
22
- now(label: string | undefined, options?: {
23
- keepSince?: boolean;
24
- }): void;
25
- /** What one model response cost. */
26
- usage(usage: UsageReport): void;
27
- /** One agent's share of the work: a turn it took, a compaction, what a model call of it cost. */
28
- agent?(tally: AgentReport): void;
29
- /** One piece of the full conversation, for reading it back while it happens. */
30
- transcript(entry: TranscriptEntry): void;
31
- /** Aborted when the job is asked to stop. */
32
- signal?: AbortSignal;
33
- /** Which job this is, for what records it - a debug log's header. */
34
- job?: {
35
- id: string;
36
- kind: string;
37
- summary: string;
38
- };
39
- /** The project the job works in, and its module: where what it does is recorded (ledger.ts). */
40
- project?: string;
41
- module?: string;
42
- /** The spec was found to contradict itself - for the person to decide. */
43
- specConflict?(conflict: SpecConflict): void;
44
- /** The functional spec being built now, or nothing when none is. */
45
- spec?(spec: BuildingSpec | undefined): void;
46
- }
47
- /** A functional spec as it is being built: which it is, where it sits, and its text as the spec has it. */
48
- export interface BuildingSpec {
49
- /** The functional spec, as data: for a host to light it without reading the label. */
50
- spec: {
51
- module: string;
52
- funcId: string;
53
- };
54
- /** For a person: "core:add-task, functional spec of 3". */
55
- label: string;
56
- /** Its text, with its scenarios after it. */
57
- text: string;
58
- /**
59
- * When work on it began - set by the job, and kept while the same one goes on to its next stage
60
- * (its conformance tests, the whole suite), so its time is the whole of it.
61
- */
62
- since?: number;
63
- }
64
- /** Say which functional spec is being built now - shown with the job, and in its transcript. */
65
- export declare function reportSpec(spec: BuildingSpec | undefined): void;
66
- /**
67
- * Two functional specs that cannot both hold, as a conformance run's judge found them - the times
68
- * it takes to count. Nothing in the code or the tests can fix it: the person decides which is meant.
69
- */
70
- export interface SpecConflict {
71
- /** The module whose conformance run found it, and its .plain file. */
72
- moduleName: string;
73
- plainFile: string;
74
- /**
75
- * The two functional specs - in that module, or in one it requires - each with its module, its
76
- * func-id there, the .plain file it is in, and its functional spec as that file has it.
77
- */
78
- specs: Array<{
79
- module: string;
80
- funcId: string;
81
- plainFile: string;
82
- text: string;
83
- }>;
84
- /** What the judge said each time it raised it, oldest first. */
85
- reasons: string[];
86
- }
87
- /** Say the spec contradicts itself, to the job this runs for. */
88
- export declare function reportSpecConflict(conflict: SpecConflict): void;
89
- /** Raised inside a job that was asked to stop, so the work unwinds instead of carrying on. */
90
- export declare class JobStoppedError extends Error {
91
- constructor();
92
- }
93
- /** The stop signal of the job this code is running for - else of the work outside a job it runs for - if there is one. */
94
- export declare function currentStopSignal(): AbortSignal | undefined;
95
- /** Run work for no job that `signal` stops: every agent under it ends its turn, and the work unwinds with JobStoppedError. */
96
- export declare function withStopSignal<T>(signal: AbortSignal | undefined, run: () => Promise<T>): Promise<T>;
97
- /**
98
- * What work under withStopSignal hands on to the session - the work loop, the job registry - with each of its methods
99
- * run clear of that signal: a pulse or a plan started from a skill outlives the skill being stopped.
100
- */
101
- export declare function clearOfStop<T extends object>(given: T): T;
102
- /** The job this code is running for, if it is running for one. */
103
- export declare function currentJob(): {
104
- id: string;
105
- kind: string;
106
- summary: string;
107
- } | undefined;
108
- /** Where this code runs: the job it runs for, its project and its module - each when it runs for one. */
109
- export declare function currentPlace(): {
110
- job?: string;
111
- project?: string;
112
- module?: string;
113
- };
114
- /**
115
- * The conversation an agent is having, as it happens: what it was asked, what it wrote and
116
- * thought, what it called and what came back. Text and thinking arrive as deltas and are
117
- * joined to the entry before them of the same kind.
118
- */
119
- export interface TranscriptEntry {
120
- /** `diff`: a spec change the job is about to render, as a git diff. */
121
- kind: "stage" | "spec" | "diff" | "prompt" | "text" | "thinking" | "tool" | "result";
122
- text: string;
123
- /** For a result: whether the tool failed. */
124
- error?: boolean;
125
- /** The whole of it, where `text` is clipped for the screen - a tool call's arguments, its result. */
126
- full?: string;
127
- /** Which agent it is from, e.g. "app 1 judge", and what it runs on - for a prompt, a reply, a thought, a tool call, a result. */
128
- agent?: {
129
- label: string;
130
- model?: string;
131
- };
132
- }
133
- export declare function reportTranscript(entry: TranscriptEntry): void;
134
- /** The part of a model response's usage a job adds up. */
135
- export interface UsageReport {
136
- input: number;
137
- output: number;
138
- cacheRead: number;
139
- cacheWrite: number;
140
- cost: number;
141
- }
142
- /**
143
- * What a stage is about, said so the person knows what the name is: "module backend", or "functional spec
144
- * backend:add-task". A stage leads with it: `${unitOf(moduleName, funcId)}: running the tests`.
145
- */
146
- export declare function unitOf(moduleName: string, funcId?: string): string;
147
- export declare function reportUsage(usage: UsageReport): void;
148
- /** What one agent of a job did, added to what it did before: counted by its label. */
149
- export interface AgentReport {
150
- label: string;
151
- model?: string;
152
- turns?: number;
153
- compactions?: number;
154
- usage?: UsageReport;
155
- }
156
- /** Each agent of a job, as the job adds it up: how many turns it took, how often its work was compacted, what it cost. */
157
- export interface AgentTally {
158
- label: string;
159
- model?: string;
160
- turns: number;
161
- compactions: number;
162
- usage: UsageReport;
163
- }
164
- export declare function reportAgent(report: AgentReport): void;
165
- /** Add one agent report to a job's tally, by label - its first report starts its row. */
166
- export declare function addAgentReport(tallies: AgentTally[], report: AgentReport): void;
167
- /** A job's agents, a line each: "app 1 reviewer · 3 turns · 1 compaction · 210.4k tok · $0.41". */
168
- export declare function describeAgents(tallies: AgentTally[]): string[];
169
- /** "1.2k tok · $0.03", or "" when nothing has been spent yet. */
170
- export declare function describeUsage(usage: UsageReport | undefined): string;
171
- /**
172
- * Something an agent did with its model, wherever it ran - in a pulse or not, the planner too: what a
173
- * headless run's report adds up (run-report.ts). A call is one model response; a turn, one request of the harness's
174
- * to an agent, as many calls as it takes; a compaction, its work summed up - a call of its own. A provider retry is a
175
- * request the provider failed for a moment, waited out and tried again - by pi, or by turri after pi gave up; a provider
176
- * stall, a request the provider has sent nothing back on for a long while; a stop, a turn turri itself ended - the
177
- * agent going round in a circle, or its time up - after which the harness carries on as after any turn.
178
- */
179
- export interface ModelEvent {
180
- kind: "call" | "turn" | "compaction" | "provider_retry" | "provider_stall" | "stopped";
181
- /** For a provider retry: what the provider said, the try this is and how many there may be, and the wait before it. For a stall, waitMs is how long it has been silent. */
182
- error?: string;
183
- attempt?: number;
184
- of?: number;
185
- waitMs?: number;
186
- /** For a stop: why turri ended the turn. */
187
- reason?: string;
188
- /** "provider/model-id:thinking", when known. */
189
- model?: string;
190
- role?: string;
191
- label?: string;
192
- /** The job it was made for: none outside a pulse. */
193
- job?: string;
194
- usage?: UsageReport;
195
- /** For a call: how long the model took to answer it, in milliseconds. */
196
- ms?: number;
197
- }
198
- /** Hear of every model call, turn and compaction from now on. Returns what stops it. */
199
- export declare function onModelEvent(listener: (event: ModelEvent) => void): () => void;
200
- /**
201
- * The model provider failing or stalling, in a line for the person: the chat's notification, a headless run's console.
202
- * A turn turri stopped itself is the work going its normal course - kept in the activity, the pulse's log and the run
203
- * report, not said.
204
- */
205
- export declare function describeTurnIncident(event: ModelEvent): string | undefined;
206
- export declare function reportModelEvent(event: Omit<ModelEvent, "job">): void;
207
- export declare function withActivity<T>(sink: ActivitySink, run: () => Promise<T>): Promise<T>;
208
- export declare function reportStage(label: string): void;
209
- export declare function reportActivity(line: string): void;
210
- /** Say something about the machinery under the work: shown as activity, and kept in the job's log, which the activity is not. */
211
- export declare function reportNote(line: string): void;
212
- /** Say something for the job's log alone: the machinery, not what its agents are doing. */
213
- export declare function reportLogNote(line: string): void;
214
- export declare function reportNow(label: string | undefined, options?: {
215
- keepSince?: boolean;
216
- }): void;
217
- /**
218
- * Paths as they are inside `plain_modules`: everything up to and including it left out, wherever
219
- * a path to it appears - `/Users/…/project/plain_modules/app/code/main.py` is `app/code/main.py`.
220
- * The rest of the path is the same for every line, and is what pushes the part that differs off
221
- * the end of it.
222
- */
223
- export declare function withinModules(text: string): string;
224
- /** A tool call as one short line. Unknown tools still show up, by name. */
225
- export declare function describeToolCall(name: string, args: Record<string, unknown> | undefined): string;
226
- /** The outcome of a test run, or nothing for tools whose outcome is not worth a line. */
227
- export declare function describeToolResult(name: string, result: unknown, isError: boolean): string | undefined;