@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
package/docs/sentinel.md CHANGED
@@ -1,33 +1,33 @@
1
1
  # The sentinel
2
2
 
3
- The sentinel is a chat of turri's own, beside the chats you talk to. Every pulse that finishes goes to it: it checks how the pulse went - and, with `launch-after-pulse` on, tests what was launched - and when something needs you, it says so in the chat you are in, with what can be done about it. You go on talking about the software, and building it, while it watches what lands.
3
+ The sentinel is a chat of turri's own, beside the chats you talk to. It checks each finished pulse and, with `launch-after-pulse` on, tests what was launched. You can keep working and read its findings in notifications when you're ready.
4
4
 
5
5
  `sentinel:` in `config.turri.yaml` says whether there is one: `ask`, as it is unset - you are asked before it first opens in a session (below); `true` - it opens without asking; `false` - none. It is there in the terminal and in a host such as turri-desktop - wherever turri holds [chats](chats.md) - and not in pi's print, json or rpc modes, nor on the command line (`turri regenerate`, `turri conform`), which have no chat to tell: there a pulse is told as it is without it.
6
6
 
7
7
  ## Starting it
8
8
 
9
- Under `sentinel: ask`, a tab that starts working on its own is not sprung on you. When the first pulse of a session finishes, turri asks first - a notice of its own in the chat you are in, before the sentinel opens, in one sentence: `app · regenerate pulse 3 finished - start the sentinel, a background tab that reviews each finished pulse and tries to use what was launched?` - the launch left out with `launch-after-pulse` off. In the terminal it is a dialog once that chat is not mid-turn, with how to switch to the sentinel once it is open - `Use "/chat 2" to open the sentinel.`, the number the one it will have in the strip; in a host, a notice with `kind: "sentinel-start"` (see [in a host](#in-a-host)). You answer:
9
+ Under `sentinel: ask`, the first finished pulse adds a question to notifications: start the sentinel for this session? Open `***plain ›` and choose **notifications**, beside **pulses**, or use `/notifications`. A host receives this question as a `sentinel-start` notice. You can choose:
10
10
 
11
11
  - **Start the sentinel** - it opens, and checks this pulse and each after it this session;
12
12
  - **Start it, and don't ask again** - the same, and `sentinel: true` is written to `config.turri.yaml`;
13
- - **Not this session**, or `esc` - no sentinel until turri starts again: each pulse is told to the chat that asked for it, as without one;
13
+ - **Not this session**, or **Dismiss** - no sentinel until turri starts again;
14
14
  - **Turn it off for this project** - `sentinel: false` is written.
15
15
 
16
- Nothing goes to the sentinel, or to your chat, until you answer: the pulses that finish meanwhile are held, and go to it - or to their chats - as you say. You are asked once a session: a sentinel closed and opened again by the next pulse is not asked for again, nor one `turri --continue` reopened. Close the chat it was asked in, and it is asked again in the one you look at.
16
+ Finished pulses appear in notifications immediately. Their reviews wait until you answer. Leaving the tab or pressing `esc` keeps the question open. Once you answer, turri does not ask again in the same session.
17
17
 
18
18
  `/sentinel` sets it from the chat - `/sentinel ask`, `/sentinel on`, `/sentinel off`, or `/sentinel` alone to pick - written to `config.turri.yaml` as `/settings sentinel` does.
19
19
 
20
20
  ## What you see
21
21
 
22
- - **In the chat you are in**, a pulse that finishes shows as it always has - `✓ app · regenerate pulse 3 finished after 4m 10s`, and for one that went wrong, where to see why. A pulse that landed is told to the chat's agent, which tells you in a line or two what landed and what the sentinel is doing with it - and again, in a line, when the sentinel is done with it - checking it, testing what was launched - and does nothing else about it: it does not test, launch or open it, nor do what the project's guidance says to do once a pulse finishes. The pulse is the sentinel's. A pulse that went wrong is not told to it: the sentinel looks into it, and you hear of it as a notice.
22
+ - The **notifications** tab is shared by all chats in the terminal session. Each finished pulse has a completion entry, even with the sentinel off. Each sentinel review has one entry: its conclusion is added to the finding or fix, alongside the evidence and actions. A conclusion does not reopen a dismissed notice or mark it unread again. Failed pulses, builds that did not pass, and reviews that found a problem or could not be checked use the warning colour (orange in the turri themes). Open an entry to see the details; **Back** returns to the list. The **mark all as read** button (`r`) clears unread marks without answering or dismissing notices. The count beside `***plain` and on the notifications tab still includes notices waiting for an answer.
23
23
  - **The sentinel** opens with the first pulse that finishes - once you said to start it, under `sentinel: ask` - in the background: it never takes the screen, and you stay in your chat. It is a tab in the strip like any other chat - `sentinel` - marked while it works and when it has something new. Switch to it to read what it checked: it shows the pulse it is on, or the last one it checked - each pulse has a conversation of its own (below).
24
- - **A notice**, when something needs you: a card in the chat you are in - what is wrong, what shows it, and what can be done, numbered - and, in the terminal, once that chat is not mid-turn, a dialog on it:
24
+ - **A notice**, when something needs you: open its `?` entry in notifications to read what is wrong, the evidence and the choices:
25
25
  - `enter` on an action accepts it: the chat's agent is started on it - a change to the \*\*\*plain, a pulse regenerated again, a credential to provide, a setting to change;
26
26
  - **Ignore - leave it as the build has it**, on a notice the sentinel marked ignorable: nothing is done, and it is not raised again - in this session or the next (below);
27
27
  - **Say what to do instead…** - your own words, and the agent does that;
28
- - **Dismiss**, or `esc`: nothing is done, this once - the next pulse may raise it again.
28
+ - **Dismiss**: nothing is done, this once - the next pulse may raise it again. `esc` goes back without dismissing.
29
29
 
30
- Nothing is done without your answer. A notice goes to the chat you are in; while you are in the sentinel's, to the chat that asked for the pulse. There is one open notice a module: a newer one about the same module supersedes the older one, whose call to action would be stale, and the card says so.
30
+ Accepted work goes to the chat the notice was addressed to. A newer finding about the same module supersedes the old one; the old entry stays in the list but can no longer be acted on.
31
31
 
32
32
  ## What it does
33
33
 
@@ -37,9 +37,9 @@ Each pulse it checks from scratch, in a conversation of its own: its prompt, you
37
37
  2. **tests what was launched**, with `launch-after-pulse` on: what runs is where it is told, and it tries it - in the terminal with its shell (`curl`, the program itself, the logs), in a host also with what the host gives it, a browser say. How far it tests is its own judgement, from what the pulse changed and what the \*\*\*plain says it now does - but not what a later pulse in the same launch changed again: that is the later pulse's check. Where the \*\*\*plain picks one way among several - which of a tie comes first, how a default is chosen - it tries an input on which the ways give different answers, so a pass shows the \*\*\*plain's way and no other. With `launch-after-pulse` off nothing is running, and it checks the pulse alone;
38
38
  3. **finds out why**, when something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software does not do what its \*\*\*plain says. A testing script, or where the config says the scripts are, it fixes itself, resumes the module, and tells you what it changed (below). Anything else it puts to you as a notice, each action a task your chat's agent can carry out once you accept it - and what the machine lacks, the exact command for you to run;
39
39
  4. **notifies no one** when all is well;
40
- 5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two. The chat you are in shows it - `✓ sentinel · app · pulse 3 · checked, it holds` - and its agent tells you so in a line, and does nothing more; when something was wrong, that its notice says what.
40
+ 5. **concludes**, last, whether all is well or not: what it checked and what it found, in a line or two - and, when it tested what was launched, how to try it yourself, in the launch's words. Read the conclusion in notifications - your chat says it too, in a line - or ask your chat about it. In the terminal its notices and conclusions are shown in notifications alone, not drawn in the chat.
41
41
 
42
- A host can ask it to check too: functional specs the person picks in a module - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators') - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in what is launched of the module - its own codebase's code - once the codebase's launches are settled, and reports as for a pulse: a notice when something is wrong, and its conclusion. The sentinel launches nothing: with nothing of the module launched - never, or you halted it - the check ends unchecked, its conclusion saying so - "ask the chat to try it first, which launches it" - and nothing else: it is an answer, not an error; when its last launch did not come up, that is what the sentinel finds out about, as for a pulse. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [in a host](hosting.md#the-sentinel).
42
+ A host can ask it to check too: functional specs the person picks in a module - its own, or those of any module its requires chain builds on (`depths:gene-fragments` in predators') - in turri-desktop, on the preview's list of a module's built ones. It tests those, on its own judgement, in what is launched of the module - its own codebase's code - once the codebase's launches are settled, and reports as for a pulse: a notice when something is wrong, and its conclusion. The sentinel launches nothing: with nothing of the module launched - never, or you halted it - the check ends unchecked, its conclusion saying so - "ask the chat to try it first, which launches it" - and nothing else: it is an answer, not an error; when its last launch did not come up, that is what the sentinel finds out about, as for a pulse. It is refused with the sentinel off, and for a module that does not parse, a functional spec it does not have, or one not built; see [the core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md).
43
43
 
44
44
  It checks every pulse, one at a time, in the order they finished. A pulse that finishes while it works waits its turn, and is checked once it is done - from scratch, as every pulse is. None takes the place of another: a newer pulse of a module waits behind the check of the one before it.
45
45
 
@@ -51,7 +51,7 @@ With `launch-after-pulse` on, a pulse is launched in the background on the [laun
51
51
  - **The launch did not come up**: it is told why, and that is what it finds out about - a finding like any other. It tests nothing in its place: never the code in `plain_modules`, where a pulse may be writing, nor a server of its own.
52
52
  - **You stopped the launch** (`/halt launched <module>`, or every server it started): nothing runs, and it checks the pulse alone.
53
53
  - **Whichever it is**, it is told never to run the code in `plain_modules`, where a pulse may be writing, nor to start a server of its own - not in its shell, not with a host's terminal: what would pass there is not what you try. A server that should run and does not is its finding. A host's terminal command that starts or runs the code there - `cd plain_modules/shorty/code && .venv/bin/uvicorn …`, a program or a path there, an environment variable pointing there - is refused it, saying why; reading there is not.
54
- - **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The error is shown in the chat you are in, recorded in the ledger (`sentinel.refused`), and the pulse is concluded unchecked; the next is taken.
54
+ - **What runs cannot hold it** - turri got it wrong: it is not told of the pulse. The reason appears in notifications with the unchecked conclusion and in the ledger (`sentinel.refused`); the next pulse is taken.
55
55
 
56
56
  When its codebase is launched again while it checks a pulse - a newer pulse landed, of it or of a module built on it - or what runs of it is stopped for another module's launch that needed what it held, its turn is stopped where it is, its conversation kept: what it was testing is being replaced. It takes nothing else meanwhile. Once the codebase's launches have settled - one, or several in a row - turri checks again that what runs holds the pulse's commit, and tells it, in the same conversation, to carry on: what runs now, and to do again what it was doing as the servers restarted. What runs no longer holding it, it is refused as above - for one stopped for another module's launch, saying which. A launch of another codebase that stops nothing of its own leaves it alone.
57
57
 
@@ -63,7 +63,7 @@ Two functional specs that contradict each other stop a pulse in a way only you c
63
63
 
64
64
  It fixes the project's tooling itself, and nothing else:
65
65
 
66
- - **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`. A script that runs `python3` where this machine has `python` of the version the \*\*\*plain names, a path that moved, a flag this machine's version of a tool does not take: it checks what it relies on in its shell (`command -v python`, `python --version`), edits the script, and calls `resume` - the module is brought up again, as when you ask for it, and the scripts run for real. Then it tells you, as a note in your chat (`kind: "fixed"`) with nothing to answer: what it changed and why, the lines before and after. Any other key of the config it changes is put back, and its edit refused.
66
+ - **It fixes** the testing scripts - `test_scripts/`, a `run_*.sh` or `prepare_environment*.sh` at the project's root, each script `config.turri.yaml` names - and, in `config.turri*.yaml`, where the scripts are (`unittests-script`, `conformance-tests-script`, `prepare-environment-script`) and `toolchains:`. For example, if a script calls `python3` but this machine has the required version as `python`, it verifies the version, edits the script and calls `resume` to run the module again. A `fixed` notification shows what changed and why, with nothing to answer. Any other config key it changes is put back and its edit refused.
67
67
  - **It never changes \*\*\*plain.** The \*\*\*plain is your intent: what needs it changed is a notice, its action a task for your chat's agent once you accept it.
68
68
  - **It installs nothing, and changes no setting of the machine's or your shell's** - not a toolchain, not a package, not a PATH line in your profile - under no circumstances: its shell refuses it, as every shell turri runs does. What the machine lacks is a notice with the exact command for you to run, and resuming as its action once you have.
69
69
 
@@ -85,7 +85,7 @@ The `sentinel` role in `models:` - else the chat's model, `models.chat` else `ha
85
85
 
86
86
  ## In a host
87
87
 
88
- A host sees the sentinel as one of its chats - `role: "sentinel"` in `chats()` and `onChats` - and never has focus moved to it. Each pulse's fresh conversation is a new pi session in the same chat, under the same id: `onChatSession(chat, session)` comes before the pulse is put to it, and `session(id)` returns the new one. Under `sentinel: ask`, the question before it first opens comes as a notice like the others, with `kind: "sentinel-start"`, its actions the four answers: `answer(id, { action })` answers it - by index or label - and `{ dismiss: true }` is not this session. Each notice comes as `onNotice(notice)` - `{ id, chat, module, pulse, job, severity, summary, evidence, actions, state }`, `chat` the one to draw it in - and `onNoticeOver(notice)` when it is answered or superseded; `notices()` lists those open. `answer(id, { action } | { steer } | { dismiss: true } | { ignore: true })` answers one, as the terminal's dialog does - `{ ignore: true }` only on a notice with `ignorable: true`, `"refused"` on any other; it ends `state: "ignored"`. `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes as it is done with a pulse, all well or not - told to the chat `chat` too. The sentinel's own tools - a browser - are given with `createTurri({ sentinel: { tools } })`, and it is told it has them. `sentinel: { surface }` says, in the host's words, where the person watches it use them: then it tries what is launched with them, where the person can watch, and keeps its shell for what they cannot show - logs, exit codes, files. Without it, the person does not watch the sentinel, and the host's tools are only to test with as well. See [running turri in a host](hosting.md#the-sentinel).
88
+ A host sees the sentinel as one of its chats - `role: "sentinel"` - and never has focus moved to it; its notices and conclusions come to the host as the session's events, and the host answers a notice itself, as the terminal's notifications do. The host's own tools for it - a browser - and where the person watches it use them are its front end's `sentinel: { tools, surface }`. See [the core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md).
89
89
 
90
90
  ## In the ledger
91
91
 
package/docs/theming.md CHANGED
@@ -10,7 +10,7 @@ turri --use-theme dark # pi's own
10
10
 
11
11
  The second form follows your terminal's light/dark appearance. The default is for `turri` only: [pi](https://pi.dev)'s settings are left alone, so a plain `pi` keeps its theme. With the themes copied to `~/.pi/agent/themes/` (`cp .pi/themes/*.json ~/.pi/agent/themes/`), `{"theme": "turri-dark"}` in `~/.pi/agent/settings.json` gives a plain `pi` the same one.
12
12
 
13
- Bad input fails quietly - an unknown `--use-theme` name and a malformed theme file both run without complaint - so if the colours do not change, suspect a typo rather than the mechanism.
13
+ If the same turri theme is installed in both places, the project's `.pi/themes/` copy takes precedence over the one in `~/.pi/agent/themes/`. turri does not warn about these expected copies. Theme files that fail to load and name clashes with other themes still appear in pi's startup diagnostics.
14
14
 
15
15
  ## The palette
16
16
 
@@ -36,7 +36,7 @@ Both themes, the command line's colours, the \*\*\*plain diff's, the banner's je
36
36
  | indigo | `#5b57d9` | the jellyfish's bell, at its rim - nowhere else |
37
37
  | orange | `#ff7a3d` | the jellyfish's gut, the `$` of bash mode, and everything that asks for you - what failed (`✗`), what works with limits, what needs you (the \*\*\*plain map's `!`): `error`, `warning` |
38
38
 
39
- In the chat header, the `+` is the one pink button. Tabs use the theme's `selectedBg` for their padded surfaces and `accent` for the active tab. Hover underlines the target; `×` takes the warning colour on hover to distinguish closing from switching. The side panel uses the same treatment. In the transcript, pink carries what is done and orange everything that asks for you - what failed, what works with limits, what waits on you - the mark (`✗`, `!`, `■`) telling them apart. The palette has no red.
39
+ In the chat header the `+` button uses the theme's success colour. The `***plain` toggle takes a brand-pink fill and a spinner while regeneration is active; its arrow points left when the panel is open and right when closed. Tabs use the theme's `selectedBg` for their padded surfaces and `accent` for the active tab. Hover underlines the target; `×` takes the warning colour on hover to distinguish closing from switching. The side panel uses the same treatment. In the transcript, pink carries what is done and orange everything that asks for you - what failed, what works with limits, what waits on you - the mark (`✗`, `!`, `■`) telling them apart. The palette has no red.
40
40
 
41
41
  ## Why there are two
42
42
 
package/docs/using.md CHANGED
@@ -7,7 +7,7 @@ cd ~/my-project
7
7
  turri
8
8
  ```
9
9
 
10
- That is [pi](https://pi.dev), with turri's tools, skills and themes loaded - `turri` alone, or with [pi](https://pi.dev)'s options (`turri -c`, `turri --harness-model <m>`). It holds several chats side by side, each working while another is shown: `/chat new` or `alt+n` opens one, `alt+1` … `alt+9` switch, and `turri -c` opens them all again - see [chats](chats.md). It opens with turri's own banner - the jellyfish it is named after, regenerating until the conversation fills the screen: a pixel polyp on the sea floor grows into the jellyfish - a bell from pink down to indigo, an orange gut, neon tentacles - which swims a while, sinks back to the floor, and the polyp grows again, round and round - and once the conversation fills the screen, comes to rest swimming, whole: a picture in a terminal that shows images (Kitty, Ghostty, WezTerm, Warp, iTerm2), and drawn at a third of the size in half blocks in any other, tmux included (`src/jellyfish.ts` draws it, ported from the design system's pixel kit, `scripts/jellyfish-frames.mjs` writes the pictures) - turri's version (and, run from a clone, the commit it is on, and whether the clone has changes) and where its settings are changed - and only when something is wrong, skills that failed to load or agents' commands less fenced than they should be - rather than [pi](https://pi.dev)'s startup header and resource list; `turri --verbose` shows those too. [pi](https://pi.dev)'s "Update Available" notice is left out - turri's [pi](https://pi.dev) is a pinned dependency `pi update` never touches - and the terminal's tab reads `🪼 turri - <folder>`, not [pi](https://pi.dev)'s `π`. Talk to it: ask it to add a feature to \*\*\*plain, regenerate a module, fix a module's \*\*\*plain. It decides which skill or tool applies - but not *how* a skill runs: `cultivate` hands the work to the gated runner, which owns the steps, the gates and the judges (see [skills and gates](skills-and-gates.md)).
10
+ That is [pi](https://pi.dev), with turri's tools, skills and themes loaded - `turri` alone, or with [pi](https://pi.dev)'s options (`turri -c`, `turri --harness-model <m>`). It holds several chats side by side, each working while another is shown: `/chat new` or `alt+n` opens one, `alt+1` … `alt+9` switch, and `turri -c` opens them all again - see [chats](chats.md). It opens with turri's own banner - the jellyfish it is named after, regenerating until the conversation fills the screen: a pixel polyp on the sea floor grows into the jellyfish - a bell from pink down to indigo, an orange gut, neon tentacles - which swims a while, sinks back to the floor, and the polyp grows again, round and round - and once the conversation fills the screen, comes to rest swimming, whole: a picture in a terminal that shows images (Kitty, Ghostty, WezTerm, Warp, iTerm2), and drawn at a third of the size in half blocks in any other, tmux included (`src/jellyfish.ts` draws it, ported from the design system's pixel kit, `scripts/jellyfish-frames.mjs` writes the pictures) - turri's version (and, run from a clone, the commit it is on, and whether the clone has changes), the core's under it (and, a core checkout linked in, its commit, its folder and whether its sources run - see [linked development](development.md#linked-development)) and where its settings are changed - and only when something is wrong, skills that failed to load or agents' commands less fenced than they should be - rather than [pi](https://pi.dev)'s startup header and resource list; `turri --verbose` shows those too. [pi](https://pi.dev)'s "Update Available" notice is left out - turri's [pi](https://pi.dev) is a pinned dependency `pi update` never touches - and the terminal's tab reads `🪼 turri - <folder>`, not [pi](https://pi.dev)'s `π`. Talk to it: ask it to add a feature to \*\*\*plain, regenerate a module, fix a module's \*\*\*plain. It decides which skill or tool applies - but not *how* a skill runs: `cultivate` hands the work to the gated runner, which owns the steps, the gates and the judges (see [skills and gates](skills-and-gates.md)).
11
11
 
12
12
  To start a project, just say what you want - `create a small server in Java Spring Boot` - and turri starts it in the conversation, without asking how: it takes the stack you named, or chooses one this machine can build, and says it in a line; writes the module importing the stack from the standard library, `config.turri.yaml` (conformance tests off unless you ask for them) and the unit testing script (with `implement-unit-testing-script`, unless there is one - in the background, on the coding model, while the first pulse waits for it); then the smallest thing that runs, regenerated at once, and while it regenerates the main thing you described and at most one more, on their happy path - nothing you did not describe. You say `go on`, or what to change, and every change after is \*\*\*plain it writes and regenerates (`src/new-project.ts`).
13
13
 
@@ -15,7 +15,7 @@ Peeking is safe while a question is open - a skill's or the chat's: `ctrl+h` ope
15
15
 
16
16
  While a skill runs, a line above the input shows its phases, every one by name - those done ticked, the one it is in marked, the rest to come - and where it is: the skill's name at the left edge, `phase 2 of 4` at the right, and its phases centred between them, `✓ intent ━━━━ ⠋ stack ──── ○ testing ──── ○ product`. Under it, dimmed, the phase it is in and what it does: `stack - the language, frameworks, storage and architecture`. The phases are the skill's own steps, read from its `SKILL.md`. A skill of one phase, or none, has nothing to be partway through: its line is the spinner and its name alone, `⠹ analyze-func-specs`.
17
17
 
18
- To bring an existing codebase under \*\*\*plain instead, `/capture` captures it into `plain/`, in the background - nothing is asked, its progress shows above the input, and once it ends turri offers to open again in `plain/`, where its report is told and `/regenerate` builds it; only you start it (see [capture](capture.md)).
18
+ To bring an existing codebase under \*\*\*plain instead, `/capture` captures it into `plain/`: the chat's agent does it there in the chat, with sub-agents to study the code, and tells you when it is done - turri opened in `plain/` then regenerates it; only you start it (see [capture](capture.md)).
19
19
 
20
20
  `genome/skills/` holds the rest: adding a feature, a concept, a requirement, a resource; splitting a functional spec that is too big; resolving conflicts; checking the environment - see [authoring \*\*\*plain](authoring-plain.md#the-skills). A skill run that is interrupted can be resumed where it stopped. A project can have skills of its own, in `.turri/skills/` or `.agents/skills/` - see [skills and gates](skills-and-gates.md#a-projects-own-skills).
21
21
 
@@ -44,7 +44,7 @@ The agent does this work with these tools, never by running turri's command line
44
44
 
45
45
  ## Pulses
46
46
 
47
- In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The panel has two clickable tabs: `***plain` for the spec and `pulses` for the work regenerating it. The filled tab marked `▸` is the current view. Click `× close` in the panel's upper-right corner to return to the full-width chat. Below 104 terminal columns the same controls open and close a full-screen panel.
47
+ In the fullscreen TUI, click `***plain ›` at the right end of the chat tabs to open the spec map on the right. The button then points back into the chat (`***plain ‹`); click it again to close the panel, from any of its tabs. Choose `***plain` for the spec, `pulses` for the work regenerating it or `notifications` for results and notices. The selected tab is highlighted; its label stays in place. Below 104 terminal columns the panel fills the screen; `× close` returns to the chat.
48
48
 
49
49
  Click a spec's heading or summary, or an imported file's name, to select it and toggle its details. A wrapped summary is clickable on any of its lines. Click a module tab to switch modules. In `pulses`, click a section, a pulse or a file in its diff to expand or collapse it. The arrow keys and Enter continue from the row you clicked.
50
50
 
@@ -52,7 +52,7 @@ A pulse is one unit of work regenerating the code. It was called a job, and stil
52
52
 
53
53
  A regeneration takes minutes, so in the TUI every tool that regenerates starts the work as a pulse and returns straight away. The conversation carries on, and you need not wait for a pulse to finish: go on shaping the \*\*\*plain and writing its next change, ask questions, try what has landed - turri says so as each pulse starts, and never waits for one itself. A \*\*\*plain change made meanwhile steers the running pulse or is planned again around it (see below); pulses on the same module - or on modules of one `requires` chain - queue behind each other, in the order they were asked for, from the first pulse on: one queued while the module's \*\*\*plain is only a scaffold, with no functional specs yet, or while it does not parse, still holds its module, so nothing on the module runs beside it. Pulses on modules that share nothing run side by side, each with its own progress panel - two modules or ten. How many run at once is capped by what the machine has room for: past `parallel-jobs` (see [the project config](config.md#how-many-jobs-at-once)), a pulse whose turn has come waits for a free slot, and says so.
54
54
 
55
- - **The panel** above the input, while something runs, shows on top what finished - a line a module, the module that finished last on top, its pulses newest first, each with its mark (green, red or amber, as in the side panel), number and kind - what it regenerated is in the side panel - `cognio ✓ 4 conformance · ✓ 3 regenerate · … 2 earlier`, the newest that fit the width - then a rule, and under it each running pulse, the newest first - `cognio · regenerate pulse 5`, `cognio · conformance pulse 6` - its time and cost, and what its agents are doing. A module whose work is being planned into pulses shows at once, before any pulse runs - `shorty · planning the pulses · 12s` - from the moment it is asked for: while its code is deleted for a start from scratch and what is left to regenerate is worked out, as well as while the planner, an agent, cuts it into pulses; a `/regenerate` says it began the moment it is sent. A \*\*\*plain change is looked at quietly, and shows only once the planner runs. Pulses are numbered within their module, as regen numbers them. `ctrl+o` expands the agents' trace alone; what finished stays a line a module. The line of keys under it - `ctrl+o to expand the trace · ctrl+h to peek at regen` - has each key breathing, fully there to a little faint and back, until it is first pressed: once `ctrl+o` has opened the trace, or the side panel has been opened, that key is still for the rest of the session and the other breathes on. What waits is not in it, and it shows no \*\*\*plain diff - the side panel has both. With nothing running it is gone.
55
+ - **The `***plain` button** turns pink and shows a spinner while turri is preparing or planning pulses, regenerating code, or running conformance. It returns to its idle colour when that work stops. Open `pulses` for progress and `notifications` for finished work; neither takes space above the editor.
56
56
  - **A pulse's change** is what its agent works from, not a text diff of the module's file: the items `<spec change>` gives the agent - only what the pulse's functional specs use, an import's items as well as the module's own, a code pulse's without the test reqs - each in the file it is written in, under its section, in the file's order (`change-view.ts`).
57
57
  - **\*\*\*plain in the chat** - a block an agent fences as ` ```plain `, or with no language around a section's header - is highlighted as a \*\*\*plain diff is, by turri's own grammar in the same colours (`src/plain-code-blocks.ts`).
58
58
  - **A \*\*\*plain diff**, in the side panel, reads as an editor shows a diff: its [\*\*\*plain](https://plainlang.org/docs/) highlighted by turri's own grammar, which started from [plyn](https://github.com/plainlang/plyn)'s - section headers, the `# <id>` heading of a functional spec or a scenario, concepts, names in backticks, text in quotes, links, the front matter - each added line filled green and each removed one red, the text on top, the fill the width of the panel ([colours](theming.md#plain-diffs)). It is shown file by file, each file's lines together under its name, with what it adds and takes out - the module being regenerated first, the rest by name, and none the diff does not change. Each line has its number in that file: a \*\*\*plain diff is of \*\*\*plain as read, with what it imports laid in, so a line is placed in the file it is written in - its links read as the parser renders them - and a removed line, in no file now, goes with the change it is part of and has no number. A line is never put in a file on a guess: one that cannot be placed is listed last, under "not found in the spec's files". Where lines of a file are not in the diff, `↕ 28 lines` says how many, as GitHub does - `↑` above the first - and names the section the lines under it are in when it is another than the one above, `↕ 28 lines · ***functional specs***`, as GitHub names a hunk's function: each section is named once.
@@ -99,7 +99,7 @@ In `print`, `json` and `rpc` modes the process ends when the answer is written,
99
99
 
100
100
  ## The project's config.turri.yaml
101
101
 
102
- The chat reads the project's `config.turri.yaml` afresh every turn and follows it: its agent is told what it sets, and the tools that regenerate default to it - `module` when you ask to build without naming one, `coding-model` for what regenerations run on, and the testing scripts. `harness-model` is what `turri` starts on. What you ask for in the conversation wins. Every key, what happens without it, and how the models inherit: [the project config](config.md).
102
+ The chat reads the project's `config.turri.yaml` afresh every turn and follows it: its agent is told what it sets, and the tools that regenerate default to it - `module` when you ask to build without naming one, `coding-model` for what regenerations run on, and the testing scripts. Every chat is put on `harness-model` as it starts, and again whenever it changes - while it cannot be reached, a line above the input says why, and the chat sends nothing to a model until it can ([chats](chats.md#what-each-chat-keeps-and-what-they-share)). What you ask for in the conversation wins. Every key, what happens without it, and how the models inherit: [the project config](config.md).
103
103
 
104
104
  A project whose parts are on different stacks gives a module its own `config.turri.<module>.yaml` beside `config.turri.yaml` - `config.turri.backend.yaml`, `config.turri.frontend.yaml` - with its testing scripts, models and conformance over the project's, for that module and every module built on it that has no file of its own. Nobody chooses it: a backend and a frontend are each built with their own, side by side. The chat is told each module's file. See [a module's own config](config.md#a-modules-own-config).
105
105
 
@@ -122,7 +122,7 @@ judge-model:
122
122
 
123
123
  Each may leave out either part, and a bare string (`coding-model: provider/id`, or `provider/id:high`) is a model alone. What one leaves out it takes from the one it inherits from: the judge model from the coding model, the coding model from the harness model - so with only a harness model, everything runs on it.
124
124
 
125
- On the command line, `turri --harness-model <m> --coding-model <m>` wins over them ([pi](https://pi.dev)'s own `--model` works for the harness model too), and in the conversation [pi](https://pi.dev)'s `/model` changes the harness model and the `settings` tool, below, the coding model. `model:`, from before there were two, is read as `coding-model`. With neither, regenerations run on the conversation's model.
125
+ On the command line, `turri --harness-model <m> --coding-model <m>` wins over them for that run, read as if `config.turri.yaml` had them - a `models:` entry still wins over them ([pi](https://pi.dev)'s own `--model` works for the harness model too) - and in the conversation [pi](https://pi.dev)'s `/model` changes the harness model and the `settings` tool, below, the coding model. `model:`, from before there were two, is read as `coding-model`. With neither, regenerations run on the conversation's model.
126
126
 
127
127
  Every regeneration runs on the coding model unless you say otherwise. Say it in words - "regenerate with gpt 5.5 from now on", "use Claude for the code" - and the agent's `settings` tool writes `coding-model` into `config.turri.yaml`, from the next pulse on, in every [chat](chats.md) and the sessions after; a module's own model goes in its own file. Pulses already queued keep the model they were queued with. For one regeneration alone - "regenerate this on Gemini 3.6 Flash" - the agent passes the model to `regenerate` or `conform` instead, and the config stays as it was.
128
128
 
@@ -207,7 +207,7 @@ turri conform <file.plain> --from-scratch # its tests folder taken out and wri
207
207
  turri lineage <module> # what each regeneration changed in a module, and when
208
208
  turri cultivate debug-specs # run a skill directly - by name, the project's too, or by its folder
209
209
  turri launch <file.plain> # launch what is regenerated from dist/<module>, here
210
- turri capture [path] # capture an existing codebase into ***plain, in <path>/plain - offline
210
+ turri capture [path] # capture an existing codebase into ***plain, in <path>/plain - unattended
211
211
  ```
212
212
 
213
- `turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another. The ones that build take `--model provider/model-id`; `regenerate` also takes `--build-dir` and `--dry-run`, which looks ahead as `pulses` does in the chat - plans the work as `regenerate` would, prints the prompt of each codebase's next pulse from that plan, and starts and writes nothing - so not with `--from-scratch` or functional specs named, which change the code or its record before anything is planned. Template directories come from `PLAIN_TEMPLATE_DIRS`. `--help` on any of them lists the rest.
213
+ `turri cultivate` runs a skill on the project's harness model, as the chat does, unless `--model` names another: its questions asked at the terminal, and each step, artifact, judge and gate decision printed as it is made. The ones that build take `--model provider/model-id`; `regenerate` also takes `--build-dir` and `--dry-run`, which looks ahead as `pulses` does in the chat - plans the work as `regenerate` would, prints the prompt of each codebase's next pulse from that plan, and starts and writes nothing - so not with `--from-scratch` or functional specs named, which change the code or its record before anything is planned. Template directories come from `PLAIN_TEMPLATE_DIRS`. `--help` on any of them lists the rest.
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@turri-dev/cli",
3
- "version": "0.4.3-next.8482fed",
3
+ "version": "0.4.3-next.853c640",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/turri-oss/turri.git"
8
+ "url": "git+https://github.com/turri-oss/turri-cli.git"
9
9
  },
10
- "homepage": "https://github.com/turri-oss/turri#readme",
11
- "bugs": "https://github.com/turri-oss/turri/issues",
10
+ "homepage": "https://github.com/turri-oss/turri-cli#readme",
11
+ "bugs": "https://github.com/turri-oss/turri-cli/issues",
12
12
  "description": "An agent that builds code from ***plain specifications, with harness-enforced review and conformance gates.",
13
13
  "engines": {
14
14
  "node": ">=22.19"
@@ -17,23 +17,20 @@
17
17
  "turri": "bin/turri.mjs"
18
18
  },
19
19
  "exports": {
20
- "./host": {
21
- "types": "./dist/host.d.ts",
22
- "import": "./dist/host.js"
23
- },
24
20
  "./package.json": "./package.json"
25
21
  },
26
22
  "scripts": {
27
- "cultivate": "tsx src/cultivate-cli.ts",
23
+ "cultivate": "node bin/turri.mjs cultivate",
28
24
  "typecheck": "tsc --noEmit",
29
- "chat": "pi -e ./src/extension.ts",
30
- "ask": "pi -p --no-session -e ./src/extension.ts",
25
+ "chat": "node bin/turri.mjs",
26
+ "ask": "node bin/turri.mjs -p --no-session",
31
27
  "test": "vitest run",
28
+ "test:package": "node scripts/package-check.mjs",
32
29
  "test:watch": "vitest",
33
- "mutation": "node scripts/mutation.mjs",
34
- "conform": "tsx src/conform-cli.ts",
35
- "regenerate": "tsx src/regenerate-cli.ts",
36
- "parse": "tsx src/parse-cli.ts",
30
+ "link:core": "node scripts/link-core.mjs",
31
+ "conform": "node bin/turri.mjs conform",
32
+ "regenerate": "node bin/turri.mjs regenerate",
33
+ "parse": "node bin/turri.mjs parse",
37
34
  "doctor": "node bin/turri.mjs doctor",
38
35
  "build": "node scripts/build.mjs",
39
36
  "prepack": "npm run build"
@@ -41,23 +38,10 @@
41
38
  "dependencies": {
42
39
  "@earendil-works/pi-coding-agent": "1.6.0",
43
40
  "@earendil-works/pi-tui": "1.6.0",
44
- "@langchain/langgraph": "1.4.15",
45
- "gray-matter": "^4.0.3",
46
- "js-yaml": "^5.4.2",
47
- "liquidjs": "^10.29.0",
48
- "mdast-util-from-markdown": "^2.0.3",
49
- "mdast-util-gfm-table": "^2.0.0",
50
- "micromark-extension-gfm-table": "^2.1.1",
51
- "remark-parse": "^11.0.0",
52
- "typebox": "^1.3.7",
53
- "unified": "^11.0.5"
41
+ "@turri-dev/core": "0.3.0"
54
42
  },
55
43
  "devDependencies": {
56
- "@stryker-mutator/core": "^10.0.0",
57
- "@stryker-mutator/vitest-runner": "^10.0.0",
58
- "@types/js-yaml": "^4.0.9",
59
44
  "@types/node": "^24.0.0",
60
- "tsx": "^4.19.0",
61
45
  "typescript": "^5.7.0",
62
46
  "vitest": "^5.0.1"
63
47
  },
@@ -69,8 +53,6 @@
69
53
  "bin",
70
54
  "dist",
71
55
  ".pi",
72
- "genome",
73
- "stdlib",
74
56
  "docs",
75
57
  "README.md",
76
58
  "LICENSE"
package/dist/ask.d.ts DELETED
@@ -1,90 +0,0 @@
1
- /**
2
- * How a skill step puts a question to the person running it.
3
- *
4
- * The interaction policy lives here rather than in the extension so it is the same from
5
- * the TUI and the CLI, and so it can be tested without a terminal.
6
- */
7
- export interface AskUserRequest {
8
- question: string;
9
- /** Concrete choices. Selecting beats typing whenever the answer space is known. */
10
- options?: string[];
11
- /** Let the user pick several: each option a box to tick and untick. Their picks come back comma-separated. */
12
- multiSelect?: boolean;
13
- /** Deliberately asking without options, for a genuinely open question. */
14
- freeForm?: boolean;
15
- /**
16
- * What the person must read to answer - the brief to confirm, the plan to approve - shown above the question, as the
17
- * asker gives it. A skill's agent talks in a session of its own that nobody sees, so without it "Is this the right
18
- * brief?" arrives with no brief.
19
- */
20
- context?: string;
21
- /**
22
- * What the asker said last before asking - its account of the work, a probe, a regeneration - kept with the answer in the
23
- * run's record and the transcript, never shown in the dialog.
24
- */
25
- said?: string;
26
- /**
27
- * Offer "Chat about this": an agent asked, and can answer what the person says about the question before they answer
28
- * it. Not for a question the harness asks itself - nobody would answer.
29
- */
30
- chattable?: boolean;
31
- }
32
- export type AskUser = (request: AskUserRequest) => Promise<string>;
33
- /**
34
- * The two dialogs an implementation has to provide. `context` is what to read to answer, given apart from the question so
35
- * a dialog can show a long one without losing the question and its options under it - the TUI's scrolls it.
36
- */
37
- export interface AskUserIO {
38
- /** `at`: the option the cursor starts on - the one just ticked, in a question of several. */
39
- select(title: string, options: string[], context?: string, at?: number, asked?: DialogAsked): Promise<string | undefined>;
40
- input(title: string, context?: string, asked?: DialogAsked): Promise<string | undefined>;
41
- }
42
- /** What a host's dialog is told beside its question. */
43
- export interface DialogAsked {
44
- /** Aborted when the question is over without the dialog's answer - declined, or its turn stopped: the dialog is closed. */
45
- signal: AbortSignal;
46
- }
47
- export declare const OTHER_OPTION = "Something else\u2026";
48
- export declare const CHAT_OPTION = "Chat about this";
49
- export declare const DONE_OPTION = "Done \u2014 that's all of them";
50
- /** An option's box in a question of several, ticked and not. */
51
- export declare const TICKED = "\u2611";
52
- export declare const UNTICKED = "\u2610";
53
- export declare const DISMISSED = "The user dismissed the question without answering.";
54
- /** ctrl+c at a question: the person would not answer it - or stopped the turn that asked it. */
55
- export declare const DECLINED = "The user declined to answer the question.";
56
- /** How an answer that is no answer starts: the person chose to talk about the question first. */
57
- export declare const CHAT_PREFIX = "The user has not answered this question yet: they chose to talk about it first.";
58
- /** What comes back when the person chose "Chat about this": what they said, and what they had picked so far. */
59
- export declare function chatAnswer(said: string, picked?: string[]): string;
60
- /** Whether an answer is the person choosing to talk about the question, rather than answering it. */
61
- export declare function isChat(answer: string): boolean;
62
- /**
63
- * A question with no options and no `free_form` is refused rather than asked.
64
- *
65
- * Offering choices is the thing that makes an interview quick to answer, and an optional
66
- * field is one a model quietly skips. Making the free-form case explicit means asking
67
- * without options is a decision rather than an omission.
68
- */
69
- export declare function missingOptions(request: AskUserRequest): string | null;
70
- /**
71
- * The request as the person should see it: tool-call markup cut out of the question and the
72
- * options - an option that was nothing but markup dropped - and a `multi_select` that leaked into
73
- * the text taken as the argument it was meant to be. `leaked` when there was any.
74
- */
75
- export declare function cleanRequest(request: AskUserRequest): {
76
- request: AskUserRequest;
77
- leaked: boolean;
78
- };
79
- export declare function runAsk(asked: AskUserRequest, io: AskUserIO): Promise<string>;
80
- /**
81
- * While a question is open, what catches ctrl+h on the terminal's input: pi gives an extension's shortcut only the keys
82
- * its editor sees, and a question has the focus. It opens the side panel - the question waits under it - unless the
83
- * panel shows already: its own listener has ctrl+h then, to close it. A key's release and its repeats are left alone.
84
- */
85
- export declare function peekKeyListener(panel: {
86
- open(): void;
87
- shown(): boolean;
88
- }): (data: string) => {
89
- consume: true;
90
- } | undefined;
package/dist/ask.js DELETED
@@ -1,170 +0,0 @@
1
- /**
2
- * How a skill step puts a question to the person running it.
3
- *
4
- * The interaction policy lives here rather than in the extension so it is the same from
5
- * the TUI and the CLI, and so it can be tested without a terminal.
6
- */
7
- import { isKeyRelease, isKeyRepeat, matchesKey } from "@earendil-works/pi-tui";
8
- import { PANEL_KEY } from "./regenerate/job-panel.js";
9
- export const OTHER_OPTION = "Something else…";
10
- export const CHAT_OPTION = "Chat about this";
11
- export const DONE_OPTION = "Done — that's all of them";
12
- /** An option's box in a question of several, ticked and not. */
13
- export const TICKED = "☑";
14
- export const UNTICKED = "☐";
15
- export const DISMISSED = "The user dismissed the question without answering.";
16
- /** ctrl+c at a question: the person would not answer it - or stopped the turn that asked it. */
17
- export const DECLINED = "The user declined to answer the question.";
18
- /** How an answer that is no answer starts: the person chose to talk about the question first. */
19
- export const CHAT_PREFIX = "The user has not answered this question yet: they chose to talk about it first.";
20
- /** What comes back when the person chose "Chat about this": what they said, and what they had picked so far. */
21
- export function chatAnswer(said, picked = []) {
22
- return [CHAT_PREFIX, `They said: ${said.trim()}`, ...(picked.length > 0 ? [`They had picked so far: ${picked.join(", ")}.`] : [])].join("\n");
23
- }
24
- /** Whether an answer is the person choosing to talk about the question, rather than answering it. */
25
- export function isChat(answer) {
26
- return answer.startsWith(CHAT_PREFIX);
27
- }
28
- /** The input after "Something else…" or "Chat about this": with nothing typed, or Esc, the options again. */
29
- const BACK = "(Esc, or nothing typed: back to the options)";
30
- const typedNothing = (typed) => typed === undefined || typed.trim() === "";
31
- /**
32
- * A question with no options and no `free_form` is refused rather than asked.
33
- *
34
- * Offering choices is the thing that makes an interview quick to answer, and an optional
35
- * field is one a model quietly skips. Making the free-form case explicit means asking
36
- * without options is a decision rather than an omission.
37
- */
38
- export function missingOptions(request) {
39
- const hasOptions = request.options !== undefined && request.options.length > 0;
40
- if (hasOptions || request.freeForm === true)
41
- return null;
42
- return ("This question was not asked. Offer concrete options so the user can pick one, or set " +
43
- "free_form to true if the answer genuinely cannot be anticipated (\"What is the app?\"). " +
44
- "Call ask_user again.");
45
- }
46
- /**
47
- * A model's own tool-call syntax, leaked into an argument: `<parameter name="multi_select">false`
48
- * written inside an option instead of as the argument it is. Never shown to the person.
49
- */
50
- const TOOL_MARKUP = /<\/?(?:antml:)?(?:parameter|invoke|function_calls|function|tool_call|arg_key|arg_value)\b[^>]*>/i;
51
- /**
52
- * The request as the person should see it: tool-call markup cut out of the question and the
53
- * options - an option that was nothing but markup dropped - and a `multi_select` that leaked into
54
- * the text taken as the argument it was meant to be. `leaked` when there was any.
55
- */
56
- export function cleanRequest(request) {
57
- let leaked = false;
58
- let multiSelect = request.multiSelect;
59
- const clean = (text) => {
60
- const flag = /<(?:antml:)?parameter\s+name="multi_select"\s*>\s*(true|false)/i.exec(text);
61
- if (flag && multiSelect === undefined)
62
- multiSelect = flag[1].toLowerCase() === "true";
63
- const at = text.search(TOOL_MARKUP);
64
- if (at === -1)
65
- return text.trim();
66
- leaked = true;
67
- return text.slice(0, at).trim();
68
- };
69
- const question = clean(request.question);
70
- const options = request.options === undefined ? undefined : [...new Set(request.options.map(clean).filter((option) => option !== ""))];
71
- return { request: { ...request, question, options, multiSelect }, leaked };
72
- }
73
- export async function runAsk(asked, io) {
74
- const { request, leaked } = cleanRequest(asked);
75
- // What was left once the markup was cut out is not a question worth putting to anyone.
76
- if (leaked && (request.question === "" || (request.options?.length === 0 && request.freeForm !== true))) {
77
- return ("This question was not asked: its question or options held tool-call markup (<parameter ...>) " +
78
- "instead of text. Call ask_user again, with question, options and multi_select as separate arguments.");
79
- }
80
- const refusal = missingOptions(request);
81
- if (refusal !== null)
82
- return refusal;
83
- // The question, and apart from it what it is about: the dialog shows that above it.
84
- const trimmed = request.context?.trim() ?? "";
85
- const context = trimmed !== "" ? trimmed : undefined;
86
- const options = request.options ?? [];
87
- if (options.length === 0) {
88
- return (await io.input(request.question, context)) ?? DISMISSED;
89
- }
90
- // Beside the options: typing an answer instead, and - when an agent asked - talking about the question first. Either
91
- // can be backed out of, to the options again: picked by accident, it costs nothing.
92
- const extras = [OTHER_OPTION, ...(request.chattable === true ? [CHAT_OPTION] : [])];
93
- const typeInstead = () => io.input(`${request.question}\n\n${BACK}`, context);
94
- const chatAbout = () => io.input(`${request.question}\n\nWhat would you like to talk about? ${BACK}`, context);
95
- if (request.multiSelect !== true) {
96
- for (;;) {
97
- const choice = await io.select(request.question, [...options, ...extras], context);
98
- if (choice === undefined)
99
- return DISMISSED;
100
- if (choice === OTHER_OPTION) {
101
- const typed = await typeInstead();
102
- if (typedNothing(typed))
103
- continue;
104
- return typed;
105
- }
106
- if (choice === CHAT_OPTION) {
107
- const said = await chatAbout();
108
- if (typedNothing(said))
109
- continue;
110
- return chatAnswer(said);
111
- }
112
- return choice;
113
- }
114
- }
115
- // Pick several: every option a box, ticked and unticked as it is chosen, until they say they are done. What they type
116
- // is one more box, ticked - and can be unticked too. Something else, Chat about this and Done are no boxes.
117
- const listed = [...options];
118
- const ticked = new Set();
119
- const picked = () => listed.filter((option) => ticked.has(option));
120
- let at = 0;
121
- for (;;) {
122
- const rows = listed.map((option) => `${ticked.has(option) ? TICKED : UNTICKED} ${option}`);
123
- const choice = await io.select(request.question, [...rows, ...extras, DONE_OPTION], context, at);
124
- if (choice === undefined || choice === DONE_OPTION)
125
- break;
126
- if (choice === OTHER_OPTION) {
127
- at = listed.length;
128
- const typed = await typeInstead();
129
- if (typedNothing(typed))
130
- continue;
131
- const option = typed.trim();
132
- if (!listed.includes(option))
133
- listed.push(option);
134
- ticked.add(option);
135
- at = listed.indexOf(option);
136
- continue;
137
- }
138
- if (choice === CHAT_OPTION) {
139
- at = listed.length + extras.indexOf(CHAT_OPTION);
140
- const said = await chatAbout();
141
- if (typedNothing(said))
142
- continue;
143
- return chatAnswer(said, picked());
144
- }
145
- // A row, or - where the answer is typed, on the command line - an option by its text, or one more of their own.
146
- const row = rows.indexOf(choice);
147
- const option = row !== -1 ? listed[row] : choice.trim();
148
- if (!listed.includes(option))
149
- listed.push(option);
150
- if (ticked.has(option))
151
- ticked.delete(option);
152
- else
153
- ticked.add(option);
154
- at = listed.indexOf(option);
155
- }
156
- return ticked.size > 0 ? picked().join(", ") : DISMISSED;
157
- }
158
- /**
159
- * While a question is open, what catches ctrl+h on the terminal's input: pi gives an extension's shortcut only the keys
160
- * its editor sees, and a question has the focus. It opens the side panel - the question waits under it - unless the
161
- * panel shows already: its own listener has ctrl+h then, to close it. A key's release and its repeats are left alone.
162
- */
163
- export function peekKeyListener(panel) {
164
- return (data) => {
165
- if (isKeyRelease(data) || isKeyRepeat(data) || !matchesKey(data, PANEL_KEY) || panel.shown())
166
- return undefined;
167
- panel.open();
168
- return { consume: true };
169
- };
170
- }