@turri-dev/cli 0.4.3-next.8482fed → 0.4.3-next.853c640

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