@turri-dev/cli 0.4.3-next.7ada234 → 0.4.3-next.8c1b0fa

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 (538) hide show
  1. package/README.md +22 -2
  2. package/dist/banner.js +248 -0
  3. package/dist/capture-cli.js +1 -1
  4. package/dist/capture-view.js +99 -0
  5. package/dist/chat-commands.js +6 -6
  6. package/dist/chat-models.js +17 -15
  7. package/dist/chat-tab-header.js +0 -1
  8. package/dist/chat-tabs.js +1 -1
  9. package/dist/chat-terminal.js +115 -73
  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 +20 -26
  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 -3379
  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 -237
  24. package/dist/panel-view.js +409 -0
  25. package/dist/parse-cli.js +5 -2
  26. package/dist/pi-launch.js +41 -13
  27. package/dist/pi-themes.js +2 -2
  28. package/dist/plain-code-blocks.js +1 -1
  29. package/dist/print-mode.js +20 -0
  30. package/dist/quiet.js +7 -106
  31. package/dist/regenerate/diff-view.js +6 -87
  32. package/dist/regenerate/jobs-tree.js +2 -17
  33. package/dist/regenerate/spec-map-view.js +3 -68
  34. package/dist/regenerate-cli.js +7 -11
  35. package/dist/reopen.js +40 -7
  36. package/dist/skill-progress.js +25 -0
  37. package/dist/skill-report.js +52 -0
  38. package/dist/terminal-marks.js +21 -0
  39. package/dist/terminal-notifications.js +74 -19
  40. package/dist/terminal-view.js +275 -0
  41. package/dist/turri-versions.js +64 -6
  42. package/docs/README.md +2 -2
  43. package/docs/chats.md +4 -4
  44. package/docs/claude-subscription.md +1 -1
  45. package/docs/config.md +5 -4
  46. package/docs/development.md +30 -64
  47. package/docs/headless.md +3 -1
  48. package/docs/hosting.md +3 -251
  49. package/docs/installation.md +4 -2
  50. package/docs/launch.md +1 -1
  51. package/docs/sentinel.md +3 -3
  52. package/docs/using.md +3 -3
  53. package/package.json +10 -28
  54. package/dist/ask.d.ts +0 -90
  55. package/dist/ask.js +0 -170
  56. package/dist/background-skills.d.ts +0 -56
  57. package/dist/background-skills.js +0 -129
  58. package/dist/bedrock-region.d.ts +0 -66
  59. package/dist/bedrock-region.js +0 -144
  60. package/dist/brand.d.ts +0 -13
  61. package/dist/btw.d.ts +0 -69
  62. package/dist/btw.js +0 -174
  63. package/dist/capture/agents.d.ts +0 -406
  64. package/dist/capture/agents.js +0 -379
  65. package/dist/capture/area.d.ts +0 -58
  66. package/dist/capture/area.js +0 -197
  67. package/dist/capture/assemble.d.ts +0 -112
  68. package/dist/capture/assemble.js +0 -453
  69. package/dist/capture/capture.d.ts +0 -116
  70. package/dist/capture/capture.js +0 -1315
  71. package/dist/capture/chat.d.ts +0 -29
  72. package/dist/capture/chat.js +0 -94
  73. package/dist/capture/checks.d.ts +0 -142
  74. package/dist/capture/checks.js +0 -649
  75. package/dist/capture/config.d.ts +0 -13
  76. package/dist/capture/config.js +0 -66
  77. package/dist/capture/interface.d.ts +0 -71
  78. package/dist/capture/interface.js +0 -199
  79. package/dist/capture/map.d.ts +0 -56
  80. package/dist/capture/map.js +0 -530
  81. package/dist/capture/models.d.ts +0 -4
  82. package/dist/capture/models.js +0 -16
  83. package/dist/capture/plan.d.ts +0 -7
  84. package/dist/capture/plan.js +0 -13
  85. package/dist/capture/progress.d.ts +0 -111
  86. package/dist/capture/progress.js +0 -266
  87. package/dist/capture/python-interface.d.ts +0 -3
  88. package/dist/capture/python-interface.js +0 -17
  89. package/dist/capture/report.d.ts +0 -75
  90. package/dist/capture/report.js +0 -268
  91. package/dist/capture/runners.d.ts +0 -6
  92. package/dist/capture/runners.js +0 -59
  93. package/dist/capture/scripts.d.ts +0 -26
  94. package/dist/capture/scripts.js +0 -38
  95. package/dist/capture/state.d.ts +0 -310
  96. package/dist/capture/state.js +0 -43
  97. package/dist/capture/trial.d.ts +0 -34
  98. package/dist/capture/trial.js +0 -89
  99. package/dist/capture-cli.d.ts +0 -1
  100. package/dist/chat-commands.d.ts +0 -17
  101. package/dist/chat-idle.d.ts +0 -7
  102. package/dist/chat-idle.js +0 -20
  103. package/dist/chat-models.d.ts +0 -22
  104. package/dist/chat-records.d.ts +0 -50
  105. package/dist/chat-records.js +0 -107
  106. package/dist/chat-scope.d.ts +0 -14
  107. package/dist/chat-scope.js +0 -15
  108. package/dist/chat-skills.d.ts +0 -17
  109. package/dist/chat-skills.js +0 -18
  110. package/dist/chat-tab-header.d.ts +0 -16
  111. package/dist/chat-tabs.d.ts +0 -26
  112. package/dist/chat-terminal.d.ts +0 -24
  113. package/dist/chat-ui.d.ts +0 -33
  114. package/dist/chat-waiting.d.ts +0 -67
  115. package/dist/chats.d.ts +0 -346
  116. package/dist/chats.js +0 -1022
  117. package/dist/cli-options.d.ts +0 -24
  118. package/dist/cli.d.ts +0 -9
  119. package/dist/config-edit.d.ts +0 -83
  120. package/dist/config-edit.js +0 -393
  121. package/dist/config.d.ts +0 -428
  122. package/dist/config.js +0 -816
  123. package/dist/conform-cli.d.ts +0 -1
  124. package/dist/conformance-switch.d.ts +0 -25
  125. package/dist/conformance-switch.js +0 -86
  126. package/dist/cultivate-cli.d.ts +0 -1
  127. package/dist/doctor-tool.d.ts +0 -11
  128. package/dist/doctor-tool.js +0 -33
  129. package/dist/drift-cli.d.ts +0 -1
  130. package/dist/environment.d.ts +0 -37
  131. package/dist/environment.js +0 -109
  132. package/dist/extension.d.ts +0 -209
  133. package/dist/genome.d.ts +0 -77
  134. package/dist/genome.js +0 -288
  135. package/dist/graph.d.ts +0 -52
  136. package/dist/graph.js +0 -247
  137. package/dist/host-session.d.ts +0 -112
  138. package/dist/host-session.js +0 -103
  139. package/dist/host.d.ts +0 -40
  140. package/dist/host.js +0 -54
  141. package/dist/identity.d.ts +0 -7
  142. package/dist/identity.js +0 -75
  143. package/dist/init-config.d.ts +0 -172
  144. package/dist/init-config.js +0 -867
  145. package/dist/installed-providers.d.ts +0 -40
  146. package/dist/installed-providers.js +0 -98
  147. package/dist/jellyfish.d.ts +0 -40
  148. package/dist/judge.d.ts +0 -25
  149. package/dist/judge.js +0 -62
  150. package/dist/launch-agent.d.ts +0 -62
  151. package/dist/launch-agent.js +0 -339
  152. package/dist/launch-cli.d.ts +0 -1
  153. package/dist/launch-session.d.ts +0 -68
  154. package/dist/launch-session.js +0 -225
  155. package/dist/launch-tools.d.ts +0 -28
  156. package/dist/launch-tools.js +0 -72
  157. package/dist/launch-track.d.ts +0 -175
  158. package/dist/launch-track.js +0 -497
  159. package/dist/lineage-cli.d.ts +0 -1
  160. package/dist/loop-cli.d.ts +0 -35
  161. package/dist/loop-tools.d.ts +0 -103
  162. package/dist/loop-tools.js +0 -361
  163. package/dist/model-check.d.ts +0 -72
  164. package/dist/model-check.js +0 -162
  165. package/dist/module-report.d.ts +0 -9
  166. package/dist/new-project.d.ts +0 -10
  167. package/dist/new-project.js +0 -42
  168. package/dist/notice.d.ts +0 -115
  169. package/dist/notice.js +0 -61
  170. package/dist/parse-cli.d.ts +0 -1
  171. package/dist/parse-tool.d.ts +0 -9
  172. package/dist/parse-tool.js +0 -33
  173. package/dist/pi-launch.d.ts +0 -1
  174. package/dist/pi-settings.d.ts +0 -4
  175. package/dist/pi-themes.d.ts +0 -3
  176. package/dist/pi.d.ts +0 -248
  177. package/dist/pi.js +0 -889
  178. package/dist/picture-row.d.ts +0 -10
  179. package/dist/plain/check.d.ts +0 -63
  180. package/dist/plain/check.js +0 -236
  181. package/dist/plain/concepts.d.ts +0 -37
  182. package/dist/plain/concepts.js +0 -283
  183. package/dist/plain/cycles.d.ts +0 -21
  184. package/dist/plain/cycles.js +0 -190
  185. package/dist/plain/errors.d.ts +0 -26
  186. package/dist/plain/errors.js +0 -50
  187. package/dist/plain/files.d.ts +0 -47
  188. package/dist/plain/files.js +0 -161
  189. package/dist/plain/graph.d.ts +0 -107
  190. package/dist/plain/graph.js +0 -194
  191. package/dist/plain/highlight.d.ts +0 -43
  192. package/dist/plain/highlight.js +0 -196
  193. package/dist/plain/index.d.ts +0 -18
  194. package/dist/plain/index.js +0 -18
  195. package/dist/plain/liquid.d.ts +0 -22
  196. package/dist/plain/liquid.js +0 -124
  197. package/dist/plain/markdown.d.ts +0 -103
  198. package/dist/plain/markdown.js +0 -330
  199. package/dist/plain/module-concepts.d.ts +0 -32
  200. package/dist/plain/module-concepts.js +0 -80
  201. package/dist/plain/parser.d.ts +0 -163
  202. package/dist/plain/parser.js +0 -930
  203. package/dist/plain/plain.tmLanguage.json +0 -150
  204. package/dist/plain/project.d.ts +0 -48
  205. package/dist/plain/project.js +0 -155
  206. package/dist/plain/spec.d.ts +0 -152
  207. package/dist/plain/spec.js +0 -265
  208. package/dist/plain/stdlib.d.ts +0 -16
  209. package/dist/plain/stdlib.js +0 -48
  210. package/dist/plain/test-plain-file.d.ts +0 -59
  211. package/dist/plain/test-plain-file.js +0 -232
  212. package/dist/plain-code-blocks.d.ts +0 -14
  213. package/dist/plain-files.d.ts +0 -21
  214. package/dist/plain-files.js +0 -156
  215. package/dist/pointer-hover.d.ts +0 -12
  216. package/dist/question-dialog.d.ts +0 -60
  217. package/dist/questioning.d.ts +0 -55
  218. package/dist/questioning.js +0 -109
  219. package/dist/quiet.d.ts +0 -34
  220. package/dist/regenerate/activity.d.ts +0 -227
  221. package/dist/regenerate/activity.js +0 -250
  222. package/dist/regenerate/agent-env.d.ts +0 -51
  223. package/dist/regenerate/agent-env.js +0 -315
  224. package/dist/regenerate/agent-shell.d.ts +0 -54
  225. package/dist/regenerate/agent-shell.js +0 -121
  226. package/dist/regenerate/arbiter.d.ts +0 -68
  227. package/dist/regenerate/arbiter.js +0 -133
  228. package/dist/regenerate/audit.d.ts +0 -69
  229. package/dist/regenerate/audit.js +0 -212
  230. package/dist/regenerate/base-folder.d.ts +0 -70
  231. package/dist/regenerate/base-folder.js +0 -186
  232. package/dist/regenerate/cases.d.ts +0 -12
  233. package/dist/regenerate/cases.js +0 -149
  234. package/dist/regenerate/change-view.d.ts +0 -23
  235. package/dist/regenerate/change-view.js +0 -153
  236. package/dist/regenerate/chunk-plan.d.ts +0 -217
  237. package/dist/regenerate/chunk-plan.js +0 -937
  238. package/dist/regenerate/codebase.d.ts +0 -21
  239. package/dist/regenerate/codebase.js +0 -75
  240. package/dist/regenerate/command-check.d.ts +0 -66
  241. package/dist/regenerate/command-check.js +0 -577
  242. package/dist/regenerate/compaction.d.ts +0 -13
  243. package/dist/regenerate/compaction.js +0 -20
  244. package/dist/regenerate/confine.d.ts +0 -69
  245. package/dist/regenerate/confine.js +0 -311
  246. package/dist/regenerate/conform.d.ts +0 -66
  247. package/dist/regenerate/conform.js +0 -132
  248. package/dist/regenerate/conformance-agents.d.ts +0 -388
  249. package/dist/regenerate/conformance-agents.js +0 -1162
  250. package/dist/regenerate/conformance.d.ts +0 -191
  251. package/dist/regenerate/conformance.js +0 -1035
  252. package/dist/regenerate/conversation-writes.d.ts +0 -10
  253. package/dist/regenerate/conversation-writes.js +0 -100
  254. package/dist/regenerate/credentials.d.ts +0 -18
  255. package/dist/regenerate/credentials.js +0 -88
  256. package/dist/regenerate/debug-log.d.ts +0 -56
  257. package/dist/regenerate/debug-log.js +0 -236
  258. package/dist/regenerate/debugger.d.ts +0 -36
  259. package/dist/regenerate/debugger.js +0 -133
  260. package/dist/regenerate/delivery.d.ts +0 -2
  261. package/dist/regenerate/diagnose-job.d.ts +0 -2
  262. package/dist/regenerate/diagnose-job.js +0 -40
  263. package/dist/regenerate/diagnose.d.ts +0 -46
  264. package/dist/regenerate/diagnose.js +0 -92
  265. package/dist/regenerate/diff-view.d.ts +0 -64
  266. package/dist/regenerate/drift.d.ts +0 -120
  267. package/dist/regenerate/drift.js +0 -285
  268. package/dist/regenerate/environment-error.d.ts +0 -167
  269. package/dist/regenerate/environment-error.js +0 -342
  270. package/dist/regenerate/failure-reports.d.ts +0 -28
  271. package/dist/regenerate/failure-reports.js +0 -79
  272. package/dist/regenerate/job-log.d.ts +0 -30
  273. package/dist/regenerate/job-log.js +0 -105
  274. package/dist/regenerate/job-panel.d.ts +0 -20
  275. package/dist/regenerate/job-panel.js +0 -54
  276. package/dist/regenerate/jobs-tree.d.ts +0 -76
  277. package/dist/regenerate/jobs.d.ts +0 -231
  278. package/dist/regenerate/jobs.js +0 -522
  279. package/dist/regenerate/lanes.d.ts +0 -16
  280. package/dist/regenerate/lanes.js +0 -32
  281. package/dist/regenerate/launch.d.ts +0 -256
  282. package/dist/regenerate/launch.js +0 -689
  283. package/dist/regenerate/ledger-view.d.ts +0 -87
  284. package/dist/regenerate/ledger-view.js +0 -325
  285. package/dist/regenerate/ledger.d.ts +0 -368
  286. package/dist/regenerate/ledger.js +0 -357
  287. package/dist/regenerate/lineage.d.ts +0 -105
  288. package/dist/regenerate/lineage.js +0 -485
  289. package/dist/regenerate/list-arguments.d.ts +0 -21
  290. package/dist/regenerate/list-arguments.js +0 -121
  291. package/dist/regenerate/loop.d.ts +0 -423
  292. package/dist/regenerate/loop.js +0 -2087
  293. package/dist/regenerate/masking.d.ts +0 -19
  294. package/dist/regenerate/masking.js +0 -95
  295. package/dist/regenerate/model-names.d.ts +0 -33
  296. package/dist/regenerate/model-names.js +0 -92
  297. package/dist/regenerate/notes.d.ts +0 -159
  298. package/dist/regenerate/notes.js +0 -446
  299. package/dist/regenerate/os-sandbox.d.ts +0 -93
  300. package/dist/regenerate/os-sandbox.js +0 -283
  301. package/dist/regenerate/panel-dock.d.ts +0 -23
  302. package/dist/regenerate/paths.d.ts +0 -110
  303. package/dist/regenerate/paths.js +0 -190
  304. package/dist/regenerate/plain-palette.d.ts +0 -34
  305. package/dist/regenerate/prompt.d.ts +0 -230
  306. package/dist/regenerate/prompt.js +0 -741
  307. package/dist/regenerate/pulse-files.d.ts +0 -14
  308. package/dist/regenerate/pulse-files.js +0 -63
  309. package/dist/regenerate/records.d.ts +0 -132
  310. package/dist/regenerate/records.js +0 -327
  311. package/dist/regenerate/regenerate.d.ts +0 -106
  312. package/dist/regenerate/regenerate.js +0 -660
  313. package/dist/regenerate/regression.d.ts +0 -58
  314. package/dist/regenerate/regression.js +0 -188
  315. package/dist/regenerate/renames.d.ts +0 -42
  316. package/dist/regenerate/renames.js +0 -185
  317. package/dist/regenerate/requires.d.ts +0 -117
  318. package/dist/regenerate/requires.js +0 -377
  319. package/dist/regenerate/resources.d.ts +0 -57
  320. package/dist/regenerate/resources.js +0 -162
  321. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  322. package/dist/regenerate/scripts-being-written.js +0 -30
  323. package/dist/regenerate/self-check.d.ts +0 -29
  324. package/dist/regenerate/self-check.js +0 -119
  325. package/dist/regenerate/services.d.ts +0 -28
  326. package/dist/regenerate/services.js +0 -158
  327. package/dist/regenerate/shell.d.ts +0 -91
  328. package/dist/regenerate/shell.js +0 -320
  329. package/dist/regenerate/side-panel.d.ts +0 -64
  330. package/dist/regenerate/spec-map-view.d.ts +0 -147
  331. package/dist/regenerate/spec-map.d.ts +0 -160
  332. package/dist/regenerate/spec-map.js +0 -596
  333. package/dist/regenerate/spec-steps.d.ts +0 -180
  334. package/dist/regenerate/spec-steps.js +0 -729
  335. package/dist/regenerate/standing.d.ts +0 -28
  336. package/dist/regenerate/standing.js +0 -30
  337. package/dist/regenerate/state.d.ts +0 -21
  338. package/dist/regenerate/state.js +0 -10
  339. package/dist/regenerate/steering.d.ts +0 -56
  340. package/dist/regenerate/steering.js +0 -119
  341. package/dist/regenerate/stop-report.d.ts +0 -43
  342. package/dist/regenerate/stop-report.js +0 -160
  343. package/dist/regenerate/submit-work.d.ts +0 -44
  344. package/dist/regenerate/submit-work.js +0 -76
  345. package/dist/regenerate/test-kinds.d.ts +0 -85
  346. package/dist/regenerate/test-kinds.js +0 -171
  347. package/dist/regenerate/test-scripts.d.ts +0 -240
  348. package/dist/regenerate/test-scripts.js +0 -847
  349. package/dist/regenerate/testing-steps.d.ts +0 -52
  350. package/dist/regenerate/testing-steps.js +0 -129
  351. package/dist/regenerate/testing.d.ts +0 -150
  352. package/dist/regenerate/testing.js +0 -438
  353. package/dist/regenerate/transcript-view.d.ts +0 -21
  354. package/dist/regenerate/unit-gate.d.ts +0 -27
  355. package/dist/regenerate/unit-gate.js +0 -20
  356. package/dist/regenerate/unit-review.d.ts +0 -152
  357. package/dist/regenerate/unit-review.js +0 -361
  358. package/dist/regenerate/web.d.ts +0 -61
  359. package/dist/regenerate/web.js +0 -256
  360. package/dist/regenerate/workspace.d.ts +0 -12
  361. package/dist/regenerate/workspace.js +0 -99
  362. package/dist/regenerate-cli.d.ts +0 -1
  363. package/dist/reopen.d.ts +0 -29
  364. package/dist/resume-line.d.ts +0 -5
  365. package/dist/review/live.d.ts +0 -72
  366. package/dist/review/live.js +0 -166
  367. package/dist/rules.d.ts +0 -20
  368. package/dist/rules.js +0 -47
  369. package/dist/run-report.d.ts +0 -88
  370. package/dist/run-report.js +0 -338
  371. package/dist/screen-padding.d.ts +0 -28
  372. package/dist/self-invocation.d.ts +0 -36
  373. package/dist/self-invocation.js +0 -137
  374. package/dist/sentinel-chat.d.ts +0 -19
  375. package/dist/sentinel-chat.js +0 -226
  376. package/dist/sentinel-check.d.ts +0 -36
  377. package/dist/sentinel-check.js +0 -78
  378. package/dist/sentinel.d.ts +0 -107
  379. package/dist/sentinel.js +0 -601
  380. package/dist/settings.d.ts +0 -45
  381. package/dist/settings.js +0 -378
  382. package/dist/setup.d.ts +0 -97
  383. package/dist/setup.js +0 -436
  384. package/dist/skill-progress.d.ts +0 -46
  385. package/dist/skill.d.ts +0 -102
  386. package/dist/skill.js +0 -147
  387. package/dist/skills.d.ts +0 -54
  388. package/dist/skills.js +0 -111
  389. package/dist/spawn-async.d.ts +0 -18
  390. package/dist/spawn-async.js +0 -35
  391. package/dist/stack.d.ts +0 -80
  392. package/dist/stack.js +0 -206
  393. package/dist/stdlib.d.ts +0 -43
  394. package/dist/stdlib.js +0 -118
  395. package/dist/surface.d.ts +0 -5
  396. package/dist/surface.js +0 -18
  397. package/dist/terminal-images.d.ts +0 -2
  398. package/dist/terminal-notifications.d.ts +0 -37
  399. package/dist/test-plain-files.d.ts +0 -41
  400. package/dist/test-plain-files.js +0 -172
  401. package/dist/tools.d.ts +0 -101
  402. package/dist/tools.js +0 -242
  403. package/dist/turri-versions.d.ts +0 -71
  404. package/genome/capture/capture.md +0 -26
  405. package/genome/capture/check-conventions.md +0 -5
  406. package/genome/capture/check-reference.md +0 -12
  407. package/genome/capture/compact.md +0 -7
  408. package/genome/capture/concepts.md +0 -3
  409. package/genome/capture/divide.md +0 -9
  410. package/genome/capture/feature.md +0 -45
  411. package/genome/capture/interface.md +0 -9
  412. package/genome/capture/modules.md +0 -25
  413. package/genome/capture/outline.md +0 -11
  414. package/genome/capture/python-interface.py +0 -111
  415. package/genome/capture/readability.md +0 -12
  416. package/genome/capture/reference.md +0 -10
  417. package/genome/capture/runners/python-requirements.sh +0 -67
  418. package/genome/capture/split.md +0 -9
  419. package/genome/capture/survey.md +0 -39
  420. package/genome/capture/trial.md +0 -18
  421. package/genome/capture/verify.md +0 -7
  422. package/genome/rules/bullet-continuation.md +0 -61
  423. package/genome/rules/concise-specs-examples.md +0 -460
  424. package/genome/rules/concise-specs-integration-examples.md +0 -281
  425. package/genome/rules/concise-specs.md +0 -80
  426. package/genome/rules/definitions.md +0 -107
  427. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  428. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  429. package/genome/rules/exported-concepts.md +0 -39
  430. package/genome/rules/func-specs.md +0 -164
  431. package/genome/rules/impl-reqs.md +0 -68
  432. package/genome/rules/import-modules.md +0 -49
  433. package/genome/rules/integration-embedded-testing.md +0 -273
  434. package/genome/rules/integration-embedded.md +0 -171
  435. package/genome/rules/integration-standalone.md +0 -135
  436. package/genome/rules/integrations.md +0 -136
  437. package/genome/rules/linked-resources.md +0 -76
  438. package/genome/rules/module-structure.md +0 -112
  439. package/genome/rules/project-model.md +0 -69
  440. package/genome/rules/required-concepts.md +0 -44
  441. package/genome/rules/requires-modules.md +0 -81
  442. package/genome/rules/semantic-ids.md +0 -49
  443. package/genome/rules/stdlib.md +0 -37
  444. package/genome/rules/test-plain-files.md +0 -138
  445. package/genome/rules/test-reqs.md +0 -57
  446. package/genome/rules/turri-regeneration.md +0 -66
  447. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  448. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  449. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  450. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  451. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  452. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  453. package/genome/skills/debug-specs/SKILL.md +0 -194
  454. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  455. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  456. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  457. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  458. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  459. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  460. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  461. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  462. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  463. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  464. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  465. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  466. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  467. package/genome/skills/refactor-module/SKILL.md +0 -218
  468. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  469. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  470. package/stdlib/backend/common.plain +0 -25
  471. package/stdlib/backend/conformance/common.plain +0 -12
  472. package/stdlib/backend/conformance/go-gin.plain +0 -9
  473. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  474. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  475. package/stdlib/backend/conformance/python-django.plain +0 -9
  476. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  477. package/stdlib/backend/conformance/python-flask.plain +0 -9
  478. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  479. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  480. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  481. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  482. package/stdlib/backend/go-gin.plain +0 -18
  483. package/stdlib/backend/go-nethttp.plain +0 -18
  484. package/stdlib/backend/java-springboot.plain +0 -19
  485. package/stdlib/backend/python-django.plain +0 -19
  486. package/stdlib/backend/python-fastapi.plain +0 -23
  487. package/stdlib/backend/python-flask.plain +0 -23
  488. package/stdlib/backend/rust-axum.plain +0 -17
  489. package/stdlib/backend/typescript-express.plain +0 -19
  490. package/stdlib/backend/typescript-fastify.plain +0 -19
  491. package/stdlib/backend/typescript-nestjs.plain +0 -19
  492. package/stdlib/cli/common.plain +0 -17
  493. package/stdlib/cli/conformance/common.plain +0 -11
  494. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  495. package/stdlib/cli/conformance/go-flag.plain +0 -9
  496. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  497. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  498. package/stdlib/cli/conformance/python-click.plain +0 -9
  499. package/stdlib/cli/conformance/python-typer.plain +0 -9
  500. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  501. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  502. package/stdlib/cli/go-cobra.plain +0 -14
  503. package/stdlib/cli/go-flag.plain +0 -14
  504. package/stdlib/cli/java-picocli.plain +0 -15
  505. package/stdlib/cli/python-argparse.plain +0 -18
  506. package/stdlib/cli/python-click.plain +0 -16
  507. package/stdlib/cli/python-typer.plain +0 -16
  508. package/stdlib/cli/rust-clap.plain +0 -14
  509. package/stdlib/cli/typescript-commander.plain +0 -17
  510. package/stdlib/frontend/angular.plain +0 -17
  511. package/stdlib/frontend/common.plain +0 -17
  512. package/stdlib/frontend/conformance/angular.plain +0 -5
  513. package/stdlib/frontend/conformance/common.plain +0 -11
  514. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  515. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  516. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  517. package/stdlib/frontend/react-vite.plain +0 -16
  518. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  519. package/stdlib/frontend/vue-vite.plain +0 -16
  520. package/stdlib/lang/go.plain +0 -13
  521. package/stdlib/lang/java.plain +0 -12
  522. package/stdlib/lang/python.plain +0 -18
  523. package/stdlib/lang/rust.plain +0 -12
  524. package/stdlib/lang/typescript.plain +0 -13
  525. package/stdlib/library/common.plain +0 -15
  526. package/stdlib/library/conformance/common.plain +0 -9
  527. package/stdlib/library/conformance/go.plain +0 -9
  528. package/stdlib/library/conformance/java-gradle.plain +0 -9
  529. package/stdlib/library/conformance/java-maven.plain +0 -9
  530. package/stdlib/library/conformance/python.plain +0 -9
  531. package/stdlib/library/conformance/rust.plain +0 -9
  532. package/stdlib/library/conformance/typescript.plain +0 -9
  533. package/stdlib/library/go.plain +0 -12
  534. package/stdlib/library/java-gradle.plain +0 -13
  535. package/stdlib/library/java-maven.plain +0 -13
  536. package/stdlib/library/python.plain +0 -13
  537. package/stdlib/library/rust.plain +0 -12
  538. 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,12 +0,0 @@
1
- import type { Theme } from "@earendil-works/pi-coding-agent";
2
- export type ButtonRole = "tab" | "new" | "close" | "panel" | "regenerating";
3
- export type ButtonPaint = (text: string, active: boolean, hovered: boolean, role: ButtonRole) => string;
4
- /** The layout owns the padding, so the entire coloured surface is also the click target. */
5
- export declare function buttonLabel(theme: Theme, text: string, active: boolean, hovered: boolean, role: ButtonRole): string;
6
- /** pi sends moves to the component under the pointer but has no leave event. Share one hover target across the
7
- * screen: if the next input is dispatched elsewhere the old highlight goes away. Redraw only on a change. */
8
- export declare class PointerHover {
9
- target: string | undefined;
10
- dispatch<T>(dispatch: () => T, redraw: () => void): T;
11
- }
12
- export declare function terminalPointer(terminal: object): PointerHover;
@@ -1,60 +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
- /** Draw choices as clickable buttons in the side panel. The padding belongs to the button. */
22
- choiceButton?(text: string, selected: boolean): string;
23
- /** The choice the cursor starts on. */
24
- selected?: number;
25
- /** The terminal's height, for the window the brief scrolls in. */
26
- rows: () => number;
27
- style: DialogStyle;
28
- /** The answer - an option, or what was typed - or undefined, dismissed. */
29
- done: (answer: string | undefined) => void;
30
- /** ctrl+c: the question declined, the asker deciding what that stops (askUserVia). Without it, dismissed as esc is. */
31
- interrupt?: () => void;
32
- /** Draw again: a key changed what shows. */
33
- requestRender: () => void;
34
- }
35
- export declare class QuestionDialog implements Component, Focusable {
36
- private readonly options;
37
- private readonly input;
38
- private selected;
39
- /** The brief's first line in its window. */
40
- private scroll;
41
- /** How far the brief scrolls, and its window's height - as last drawn. */
42
- private maxScroll;
43
- private window;
44
- private answered;
45
- private choiceLines;
46
- private choiceTop;
47
- private pressed;
48
- private focusedNow;
49
- constructor(options: QuestionDialogOptions);
50
- get focused(): boolean;
51
- set focused(value: boolean);
52
- /** Closed, no answer given: the question declined from outside - its turn stopped. */
53
- dismiss(): void;
54
- private finish;
55
- private scrollBy;
56
- render(width: number): string[];
57
- handleInput(data: string): void;
58
- handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
59
- invalidate(): void;
60
- }
@@ -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;