@turri-dev/cli 0.4.3-next.7ada234 → 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 (538) 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 +0 -1
  7. package/dist/chat-tabs.js +1 -1
  8. package/dist/chat-terminal.js +114 -73
  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 -3379
  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 +37 -13
  26. package/dist/pi-themes.js +2 -2
  27. package/dist/plain-code-blocks.js +1 -1
  28. package/dist/print-mode.js +20 -0
  29. package/dist/quiet.js +7 -106
  30. package/dist/regenerate/diff-view.js +6 -87
  31. package/dist/regenerate/jobs-tree.js +2 -17
  32. package/dist/regenerate/spec-map-view.js +3 -68
  33. package/dist/regenerate-cli.js +7 -11
  34. package/dist/skill-progress.js +25 -0
  35. package/dist/skill-report.js +52 -0
  36. package/dist/terminal-marks.js +21 -0
  37. package/dist/terminal-notifications.js +74 -19
  38. package/dist/terminal-view.js +239 -0
  39. package/dist/turri-versions.js +64 -6
  40. package/docs/README.md +3 -3
  41. package/docs/capture.md +79 -180
  42. package/docs/chats.md +4 -4
  43. package/docs/claude-subscription.md +1 -1
  44. package/docs/config.md +7 -9
  45. package/docs/development.md +30 -64
  46. package/docs/headless.md +3 -1
  47. package/docs/hosting.md +3 -251
  48. package/docs/installation.md +5 -3
  49. package/docs/launch.md +1 -1
  50. package/docs/sentinel.md +3 -3
  51. package/docs/using.md +6 -6
  52. package/package.json +13 -31
  53. package/dist/ask.d.ts +0 -90
  54. package/dist/ask.js +0 -170
  55. package/dist/background-skills.d.ts +0 -56
  56. package/dist/background-skills.js +0 -129
  57. package/dist/bedrock-region.d.ts +0 -66
  58. package/dist/bedrock-region.js +0 -144
  59. package/dist/brand.d.ts +0 -13
  60. package/dist/btw.d.ts +0 -69
  61. package/dist/btw.js +0 -174
  62. package/dist/capture/agents.d.ts +0 -406
  63. package/dist/capture/agents.js +0 -379
  64. package/dist/capture/area.d.ts +0 -58
  65. package/dist/capture/area.js +0 -197
  66. package/dist/capture/assemble.d.ts +0 -112
  67. package/dist/capture/assemble.js +0 -453
  68. package/dist/capture/capture.d.ts +0 -116
  69. package/dist/capture/capture.js +0 -1315
  70. package/dist/capture/chat.d.ts +0 -29
  71. package/dist/capture/chat.js +0 -94
  72. package/dist/capture/checks.d.ts +0 -142
  73. package/dist/capture/checks.js +0 -649
  74. package/dist/capture/config.d.ts +0 -13
  75. package/dist/capture/config.js +0 -66
  76. package/dist/capture/interface.d.ts +0 -71
  77. package/dist/capture/interface.js +0 -199
  78. package/dist/capture/map.d.ts +0 -56
  79. package/dist/capture/map.js +0 -530
  80. package/dist/capture/models.d.ts +0 -4
  81. package/dist/capture/models.js +0 -16
  82. package/dist/capture/plan.d.ts +0 -7
  83. package/dist/capture/plan.js +0 -13
  84. package/dist/capture/progress.d.ts +0 -111
  85. package/dist/capture/progress.js +0 -266
  86. package/dist/capture/python-interface.d.ts +0 -3
  87. package/dist/capture/python-interface.js +0 -17
  88. package/dist/capture/report.d.ts +0 -75
  89. package/dist/capture/report.js +0 -268
  90. package/dist/capture/runners.d.ts +0 -6
  91. package/dist/capture/runners.js +0 -59
  92. package/dist/capture/scripts.d.ts +0 -26
  93. package/dist/capture/scripts.js +0 -38
  94. package/dist/capture/state.d.ts +0 -310
  95. package/dist/capture/state.js +0 -43
  96. package/dist/capture/trial.d.ts +0 -34
  97. package/dist/capture/trial.js +0 -89
  98. package/dist/capture-cli.d.ts +0 -1
  99. package/dist/chat-commands.d.ts +0 -17
  100. package/dist/chat-idle.d.ts +0 -7
  101. package/dist/chat-idle.js +0 -20
  102. package/dist/chat-models.d.ts +0 -22
  103. package/dist/chat-records.d.ts +0 -50
  104. package/dist/chat-records.js +0 -107
  105. package/dist/chat-scope.d.ts +0 -14
  106. package/dist/chat-scope.js +0 -15
  107. package/dist/chat-skills.d.ts +0 -17
  108. package/dist/chat-skills.js +0 -18
  109. package/dist/chat-tab-header.d.ts +0 -16
  110. package/dist/chat-tabs.d.ts +0 -26
  111. package/dist/chat-terminal.d.ts +0 -24
  112. package/dist/chat-ui.d.ts +0 -33
  113. package/dist/chat-waiting.d.ts +0 -67
  114. package/dist/chats.d.ts +0 -346
  115. package/dist/chats.js +0 -1022
  116. package/dist/cli-options.d.ts +0 -24
  117. package/dist/cli.d.ts +0 -9
  118. package/dist/config-edit.d.ts +0 -83
  119. package/dist/config-edit.js +0 -393
  120. package/dist/config.d.ts +0 -428
  121. package/dist/config.js +0 -816
  122. package/dist/conform-cli.d.ts +0 -1
  123. package/dist/conformance-switch.d.ts +0 -25
  124. package/dist/conformance-switch.js +0 -86
  125. package/dist/cultivate-cli.d.ts +0 -1
  126. package/dist/doctor-tool.d.ts +0 -11
  127. package/dist/doctor-tool.js +0 -33
  128. package/dist/drift-cli.d.ts +0 -1
  129. package/dist/environment.d.ts +0 -37
  130. package/dist/environment.js +0 -109
  131. package/dist/extension.d.ts +0 -209
  132. package/dist/genome.d.ts +0 -77
  133. package/dist/genome.js +0 -288
  134. package/dist/graph.d.ts +0 -52
  135. package/dist/graph.js +0 -247
  136. package/dist/host-session.d.ts +0 -112
  137. package/dist/host-session.js +0 -103
  138. package/dist/host.d.ts +0 -40
  139. package/dist/host.js +0 -54
  140. package/dist/identity.d.ts +0 -7
  141. package/dist/identity.js +0 -75
  142. package/dist/init-config.d.ts +0 -172
  143. package/dist/init-config.js +0 -867
  144. package/dist/installed-providers.d.ts +0 -40
  145. package/dist/installed-providers.js +0 -98
  146. package/dist/jellyfish.d.ts +0 -40
  147. package/dist/judge.d.ts +0 -25
  148. package/dist/judge.js +0 -62
  149. package/dist/launch-agent.d.ts +0 -62
  150. package/dist/launch-agent.js +0 -339
  151. package/dist/launch-cli.d.ts +0 -1
  152. package/dist/launch-session.d.ts +0 -68
  153. package/dist/launch-session.js +0 -225
  154. package/dist/launch-tools.d.ts +0 -28
  155. package/dist/launch-tools.js +0 -72
  156. package/dist/launch-track.d.ts +0 -175
  157. package/dist/launch-track.js +0 -497
  158. package/dist/lineage-cli.d.ts +0 -1
  159. package/dist/loop-cli.d.ts +0 -35
  160. package/dist/loop-tools.d.ts +0 -103
  161. package/dist/loop-tools.js +0 -361
  162. package/dist/model-check.d.ts +0 -72
  163. package/dist/model-check.js +0 -162
  164. package/dist/module-report.d.ts +0 -9
  165. package/dist/new-project.d.ts +0 -10
  166. package/dist/new-project.js +0 -42
  167. package/dist/notice.d.ts +0 -115
  168. package/dist/notice.js +0 -61
  169. package/dist/parse-cli.d.ts +0 -1
  170. package/dist/parse-tool.d.ts +0 -9
  171. package/dist/parse-tool.js +0 -33
  172. package/dist/pi-launch.d.ts +0 -1
  173. package/dist/pi-settings.d.ts +0 -4
  174. package/dist/pi-themes.d.ts +0 -3
  175. package/dist/pi.d.ts +0 -248
  176. package/dist/pi.js +0 -889
  177. package/dist/picture-row.d.ts +0 -10
  178. package/dist/plain/check.d.ts +0 -63
  179. package/dist/plain/check.js +0 -236
  180. package/dist/plain/concepts.d.ts +0 -37
  181. package/dist/plain/concepts.js +0 -283
  182. package/dist/plain/cycles.d.ts +0 -21
  183. package/dist/plain/cycles.js +0 -190
  184. package/dist/plain/errors.d.ts +0 -26
  185. package/dist/plain/errors.js +0 -50
  186. package/dist/plain/files.d.ts +0 -47
  187. package/dist/plain/files.js +0 -161
  188. package/dist/plain/graph.d.ts +0 -107
  189. package/dist/plain/graph.js +0 -194
  190. package/dist/plain/highlight.d.ts +0 -43
  191. package/dist/plain/highlight.js +0 -196
  192. package/dist/plain/index.d.ts +0 -18
  193. package/dist/plain/index.js +0 -18
  194. package/dist/plain/liquid.d.ts +0 -22
  195. package/dist/plain/liquid.js +0 -124
  196. package/dist/plain/markdown.d.ts +0 -103
  197. package/dist/plain/markdown.js +0 -330
  198. package/dist/plain/module-concepts.d.ts +0 -32
  199. package/dist/plain/module-concepts.js +0 -80
  200. package/dist/plain/parser.d.ts +0 -163
  201. package/dist/plain/parser.js +0 -930
  202. package/dist/plain/plain.tmLanguage.json +0 -150
  203. package/dist/plain/project.d.ts +0 -48
  204. package/dist/plain/project.js +0 -155
  205. package/dist/plain/spec.d.ts +0 -152
  206. package/dist/plain/spec.js +0 -265
  207. package/dist/plain/stdlib.d.ts +0 -16
  208. package/dist/plain/stdlib.js +0 -48
  209. package/dist/plain/test-plain-file.d.ts +0 -59
  210. package/dist/plain/test-plain-file.js +0 -232
  211. package/dist/plain-code-blocks.d.ts +0 -14
  212. package/dist/plain-files.d.ts +0 -21
  213. package/dist/plain-files.js +0 -156
  214. package/dist/pointer-hover.d.ts +0 -12
  215. package/dist/question-dialog.d.ts +0 -60
  216. package/dist/questioning.d.ts +0 -55
  217. package/dist/questioning.js +0 -109
  218. package/dist/quiet.d.ts +0 -34
  219. package/dist/regenerate/activity.d.ts +0 -227
  220. package/dist/regenerate/activity.js +0 -250
  221. package/dist/regenerate/agent-env.d.ts +0 -51
  222. package/dist/regenerate/agent-env.js +0 -315
  223. package/dist/regenerate/agent-shell.d.ts +0 -54
  224. package/dist/regenerate/agent-shell.js +0 -121
  225. package/dist/regenerate/arbiter.d.ts +0 -68
  226. package/dist/regenerate/arbiter.js +0 -133
  227. package/dist/regenerate/audit.d.ts +0 -69
  228. package/dist/regenerate/audit.js +0 -212
  229. package/dist/regenerate/base-folder.d.ts +0 -70
  230. package/dist/regenerate/base-folder.js +0 -186
  231. package/dist/regenerate/cases.d.ts +0 -12
  232. package/dist/regenerate/cases.js +0 -149
  233. package/dist/regenerate/change-view.d.ts +0 -23
  234. package/dist/regenerate/change-view.js +0 -153
  235. package/dist/regenerate/chunk-plan.d.ts +0 -217
  236. package/dist/regenerate/chunk-plan.js +0 -937
  237. package/dist/regenerate/codebase.d.ts +0 -21
  238. package/dist/regenerate/codebase.js +0 -75
  239. package/dist/regenerate/command-check.d.ts +0 -66
  240. package/dist/regenerate/command-check.js +0 -577
  241. package/dist/regenerate/compaction.d.ts +0 -13
  242. package/dist/regenerate/compaction.js +0 -20
  243. package/dist/regenerate/confine.d.ts +0 -69
  244. package/dist/regenerate/confine.js +0 -311
  245. package/dist/regenerate/conform.d.ts +0 -66
  246. package/dist/regenerate/conform.js +0 -132
  247. package/dist/regenerate/conformance-agents.d.ts +0 -388
  248. package/dist/regenerate/conformance-agents.js +0 -1162
  249. package/dist/regenerate/conformance.d.ts +0 -191
  250. package/dist/regenerate/conformance.js +0 -1035
  251. package/dist/regenerate/conversation-writes.d.ts +0 -10
  252. package/dist/regenerate/conversation-writes.js +0 -100
  253. package/dist/regenerate/credentials.d.ts +0 -18
  254. package/dist/regenerate/credentials.js +0 -88
  255. package/dist/regenerate/debug-log.d.ts +0 -56
  256. package/dist/regenerate/debug-log.js +0 -236
  257. package/dist/regenerate/debugger.d.ts +0 -36
  258. package/dist/regenerate/debugger.js +0 -133
  259. package/dist/regenerate/delivery.d.ts +0 -2
  260. package/dist/regenerate/diagnose-job.d.ts +0 -2
  261. package/dist/regenerate/diagnose-job.js +0 -40
  262. package/dist/regenerate/diagnose.d.ts +0 -46
  263. package/dist/regenerate/diagnose.js +0 -92
  264. package/dist/regenerate/diff-view.d.ts +0 -64
  265. package/dist/regenerate/drift.d.ts +0 -120
  266. package/dist/regenerate/drift.js +0 -285
  267. package/dist/regenerate/environment-error.d.ts +0 -167
  268. package/dist/regenerate/environment-error.js +0 -342
  269. package/dist/regenerate/failure-reports.d.ts +0 -28
  270. package/dist/regenerate/failure-reports.js +0 -79
  271. package/dist/regenerate/job-log.d.ts +0 -30
  272. package/dist/regenerate/job-log.js +0 -105
  273. package/dist/regenerate/job-panel.d.ts +0 -20
  274. package/dist/regenerate/job-panel.js +0 -54
  275. package/dist/regenerate/jobs-tree.d.ts +0 -76
  276. package/dist/regenerate/jobs.d.ts +0 -231
  277. package/dist/regenerate/jobs.js +0 -522
  278. package/dist/regenerate/lanes.d.ts +0 -16
  279. package/dist/regenerate/lanes.js +0 -32
  280. package/dist/regenerate/launch.d.ts +0 -256
  281. package/dist/regenerate/launch.js +0 -689
  282. package/dist/regenerate/ledger-view.d.ts +0 -87
  283. package/dist/regenerate/ledger-view.js +0 -325
  284. package/dist/regenerate/ledger.d.ts +0 -368
  285. package/dist/regenerate/ledger.js +0 -357
  286. package/dist/regenerate/lineage.d.ts +0 -105
  287. package/dist/regenerate/lineage.js +0 -485
  288. package/dist/regenerate/list-arguments.d.ts +0 -21
  289. package/dist/regenerate/list-arguments.js +0 -121
  290. package/dist/regenerate/loop.d.ts +0 -423
  291. package/dist/regenerate/loop.js +0 -2087
  292. package/dist/regenerate/masking.d.ts +0 -19
  293. package/dist/regenerate/masking.js +0 -95
  294. package/dist/regenerate/model-names.d.ts +0 -33
  295. package/dist/regenerate/model-names.js +0 -92
  296. package/dist/regenerate/notes.d.ts +0 -159
  297. package/dist/regenerate/notes.js +0 -446
  298. package/dist/regenerate/os-sandbox.d.ts +0 -93
  299. package/dist/regenerate/os-sandbox.js +0 -283
  300. package/dist/regenerate/panel-dock.d.ts +0 -23
  301. package/dist/regenerate/paths.d.ts +0 -110
  302. package/dist/regenerate/paths.js +0 -190
  303. package/dist/regenerate/plain-palette.d.ts +0 -34
  304. package/dist/regenerate/prompt.d.ts +0 -230
  305. package/dist/regenerate/prompt.js +0 -741
  306. package/dist/regenerate/pulse-files.d.ts +0 -14
  307. package/dist/regenerate/pulse-files.js +0 -63
  308. package/dist/regenerate/records.d.ts +0 -132
  309. package/dist/regenerate/records.js +0 -327
  310. package/dist/regenerate/regenerate.d.ts +0 -106
  311. package/dist/regenerate/regenerate.js +0 -660
  312. package/dist/regenerate/regression.d.ts +0 -58
  313. package/dist/regenerate/regression.js +0 -188
  314. package/dist/regenerate/renames.d.ts +0 -42
  315. package/dist/regenerate/renames.js +0 -185
  316. package/dist/regenerate/requires.d.ts +0 -117
  317. package/dist/regenerate/requires.js +0 -377
  318. package/dist/regenerate/resources.d.ts +0 -57
  319. package/dist/regenerate/resources.js +0 -162
  320. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  321. package/dist/regenerate/scripts-being-written.js +0 -30
  322. package/dist/regenerate/self-check.d.ts +0 -29
  323. package/dist/regenerate/self-check.js +0 -119
  324. package/dist/regenerate/services.d.ts +0 -28
  325. package/dist/regenerate/services.js +0 -158
  326. package/dist/regenerate/shell.d.ts +0 -91
  327. package/dist/regenerate/shell.js +0 -320
  328. package/dist/regenerate/side-panel.d.ts +0 -64
  329. package/dist/regenerate/spec-map-view.d.ts +0 -147
  330. package/dist/regenerate/spec-map.d.ts +0 -160
  331. package/dist/regenerate/spec-map.js +0 -596
  332. package/dist/regenerate/spec-steps.d.ts +0 -180
  333. package/dist/regenerate/spec-steps.js +0 -729
  334. package/dist/regenerate/standing.d.ts +0 -28
  335. package/dist/regenerate/standing.js +0 -30
  336. package/dist/regenerate/state.d.ts +0 -21
  337. package/dist/regenerate/state.js +0 -10
  338. package/dist/regenerate/steering.d.ts +0 -56
  339. package/dist/regenerate/steering.js +0 -119
  340. package/dist/regenerate/stop-report.d.ts +0 -43
  341. package/dist/regenerate/stop-report.js +0 -160
  342. package/dist/regenerate/submit-work.d.ts +0 -44
  343. package/dist/regenerate/submit-work.js +0 -76
  344. package/dist/regenerate/test-kinds.d.ts +0 -85
  345. package/dist/regenerate/test-kinds.js +0 -171
  346. package/dist/regenerate/test-scripts.d.ts +0 -240
  347. package/dist/regenerate/test-scripts.js +0 -847
  348. package/dist/regenerate/testing-steps.d.ts +0 -52
  349. package/dist/regenerate/testing-steps.js +0 -129
  350. package/dist/regenerate/testing.d.ts +0 -150
  351. package/dist/regenerate/testing.js +0 -438
  352. package/dist/regenerate/transcript-view.d.ts +0 -21
  353. package/dist/regenerate/unit-gate.d.ts +0 -27
  354. package/dist/regenerate/unit-gate.js +0 -20
  355. package/dist/regenerate/unit-review.d.ts +0 -152
  356. package/dist/regenerate/unit-review.js +0 -361
  357. package/dist/regenerate/web.d.ts +0 -61
  358. package/dist/regenerate/web.js +0 -256
  359. package/dist/regenerate/workspace.d.ts +0 -12
  360. package/dist/regenerate/workspace.js +0 -99
  361. package/dist/regenerate-cli.d.ts +0 -1
  362. package/dist/reopen.d.ts +0 -29
  363. package/dist/reopen.js +0 -47
  364. package/dist/resume-line.d.ts +0 -5
  365. package/dist/review/live.d.ts +0 -72
  366. package/dist/review/live.js +0 -166
  367. package/dist/rules.d.ts +0 -20
  368. package/dist/rules.js +0 -47
  369. package/dist/run-report.d.ts +0 -88
  370. package/dist/run-report.js +0 -338
  371. package/dist/screen-padding.d.ts +0 -28
  372. package/dist/self-invocation.d.ts +0 -36
  373. package/dist/self-invocation.js +0 -137
  374. package/dist/sentinel-chat.d.ts +0 -19
  375. package/dist/sentinel-chat.js +0 -226
  376. package/dist/sentinel-check.d.ts +0 -36
  377. package/dist/sentinel-check.js +0 -78
  378. package/dist/sentinel.d.ts +0 -107
  379. package/dist/sentinel.js +0 -601
  380. package/dist/settings.d.ts +0 -45
  381. package/dist/settings.js +0 -378
  382. package/dist/setup.d.ts +0 -97
  383. package/dist/setup.js +0 -436
  384. package/dist/skill-progress.d.ts +0 -46
  385. package/dist/skill.d.ts +0 -102
  386. package/dist/skill.js +0 -147
  387. package/dist/skills.d.ts +0 -54
  388. package/dist/skills.js +0 -111
  389. package/dist/spawn-async.d.ts +0 -18
  390. package/dist/spawn-async.js +0 -35
  391. package/dist/stack.d.ts +0 -80
  392. package/dist/stack.js +0 -206
  393. package/dist/stdlib.d.ts +0 -43
  394. package/dist/stdlib.js +0 -118
  395. package/dist/surface.d.ts +0 -5
  396. package/dist/surface.js +0 -18
  397. package/dist/terminal-images.d.ts +0 -2
  398. package/dist/terminal-notifications.d.ts +0 -37
  399. package/dist/test-plain-files.d.ts +0 -41
  400. package/dist/test-plain-files.js +0 -172
  401. package/dist/tools.d.ts +0 -101
  402. package/dist/tools.js +0 -242
  403. package/dist/turri-versions.d.ts +0 -71
  404. package/genome/capture/capture.md +0 -26
  405. package/genome/capture/check-conventions.md +0 -5
  406. package/genome/capture/check-reference.md +0 -12
  407. package/genome/capture/compact.md +0 -7
  408. package/genome/capture/concepts.md +0 -3
  409. package/genome/capture/divide.md +0 -9
  410. package/genome/capture/feature.md +0 -45
  411. package/genome/capture/interface.md +0 -9
  412. package/genome/capture/modules.md +0 -25
  413. package/genome/capture/outline.md +0 -11
  414. package/genome/capture/python-interface.py +0 -111
  415. package/genome/capture/readability.md +0 -12
  416. package/genome/capture/reference.md +0 -10
  417. package/genome/capture/runners/python-requirements.sh +0 -67
  418. package/genome/capture/split.md +0 -9
  419. package/genome/capture/survey.md +0 -39
  420. package/genome/capture/trial.md +0 -18
  421. package/genome/capture/verify.md +0 -7
  422. package/genome/rules/bullet-continuation.md +0 -61
  423. package/genome/rules/concise-specs-examples.md +0 -460
  424. package/genome/rules/concise-specs-integration-examples.md +0 -281
  425. package/genome/rules/concise-specs.md +0 -80
  426. package/genome/rules/definitions.md +0 -107
  427. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  428. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  429. package/genome/rules/exported-concepts.md +0 -39
  430. package/genome/rules/func-specs.md +0 -164
  431. package/genome/rules/impl-reqs.md +0 -68
  432. package/genome/rules/import-modules.md +0 -49
  433. package/genome/rules/integration-embedded-testing.md +0 -273
  434. package/genome/rules/integration-embedded.md +0 -171
  435. package/genome/rules/integration-standalone.md +0 -135
  436. package/genome/rules/integrations.md +0 -136
  437. package/genome/rules/linked-resources.md +0 -76
  438. package/genome/rules/module-structure.md +0 -112
  439. package/genome/rules/project-model.md +0 -69
  440. package/genome/rules/required-concepts.md +0 -44
  441. package/genome/rules/requires-modules.md +0 -81
  442. package/genome/rules/semantic-ids.md +0 -49
  443. package/genome/rules/stdlib.md +0 -37
  444. package/genome/rules/test-plain-files.md +0 -138
  445. package/genome/rules/test-reqs.md +0 -57
  446. package/genome/rules/turri-regeneration.md +0 -66
  447. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  448. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  449. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  450. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  451. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  452. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  453. package/genome/skills/debug-specs/SKILL.md +0 -194
  454. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  455. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  456. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  457. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  458. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  459. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  460. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  461. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  462. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  463. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  464. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  465. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  466. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  467. package/genome/skills/refactor-module/SKILL.md +0 -218
  468. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  469. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  470. package/stdlib/backend/common.plain +0 -25
  471. package/stdlib/backend/conformance/common.plain +0 -12
  472. package/stdlib/backend/conformance/go-gin.plain +0 -9
  473. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  474. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  475. package/stdlib/backend/conformance/python-django.plain +0 -9
  476. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  477. package/stdlib/backend/conformance/python-flask.plain +0 -9
  478. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  479. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  480. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  481. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  482. package/stdlib/backend/go-gin.plain +0 -18
  483. package/stdlib/backend/go-nethttp.plain +0 -18
  484. package/stdlib/backend/java-springboot.plain +0 -19
  485. package/stdlib/backend/python-django.plain +0 -19
  486. package/stdlib/backend/python-fastapi.plain +0 -23
  487. package/stdlib/backend/python-flask.plain +0 -23
  488. package/stdlib/backend/rust-axum.plain +0 -17
  489. package/stdlib/backend/typescript-express.plain +0 -19
  490. package/stdlib/backend/typescript-fastify.plain +0 -19
  491. package/stdlib/backend/typescript-nestjs.plain +0 -19
  492. package/stdlib/cli/common.plain +0 -17
  493. package/stdlib/cli/conformance/common.plain +0 -11
  494. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  495. package/stdlib/cli/conformance/go-flag.plain +0 -9
  496. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  497. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  498. package/stdlib/cli/conformance/python-click.plain +0 -9
  499. package/stdlib/cli/conformance/python-typer.plain +0 -9
  500. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  501. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  502. package/stdlib/cli/go-cobra.plain +0 -14
  503. package/stdlib/cli/go-flag.plain +0 -14
  504. package/stdlib/cli/java-picocli.plain +0 -15
  505. package/stdlib/cli/python-argparse.plain +0 -18
  506. package/stdlib/cli/python-click.plain +0 -16
  507. package/stdlib/cli/python-typer.plain +0 -16
  508. package/stdlib/cli/rust-clap.plain +0 -14
  509. package/stdlib/cli/typescript-commander.plain +0 -17
  510. package/stdlib/frontend/angular.plain +0 -17
  511. package/stdlib/frontend/common.plain +0 -17
  512. package/stdlib/frontend/conformance/angular.plain +0 -5
  513. package/stdlib/frontend/conformance/common.plain +0 -11
  514. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  515. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  516. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  517. package/stdlib/frontend/react-vite.plain +0 -16
  518. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  519. package/stdlib/frontend/vue-vite.plain +0 -16
  520. package/stdlib/lang/go.plain +0 -13
  521. package/stdlib/lang/java.plain +0 -12
  522. package/stdlib/lang/python.plain +0 -18
  523. package/stdlib/lang/rust.plain +0 -12
  524. package/stdlib/lang/typescript.plain +0 -13
  525. package/stdlib/library/common.plain +0 -15
  526. package/stdlib/library/conformance/common.plain +0 -9
  527. package/stdlib/library/conformance/go.plain +0 -9
  528. package/stdlib/library/conformance/java-gradle.plain +0 -9
  529. package/stdlib/library/conformance/java-maven.plain +0 -9
  530. package/stdlib/library/conformance/python.plain +0 -9
  531. package/stdlib/library/conformance/rust.plain +0 -9
  532. package/stdlib/library/conformance/typescript.plain +0 -9
  533. package/stdlib/library/go.plain +0 -12
  534. package/stdlib/library/java-gradle.plain +0 -13
  535. package/stdlib/library/java-maven.plain +0 -13
  536. package/stdlib/library/python.plain +0 -13
  537. package/stdlib/library/rust.plain +0 -12
  538. package/stdlib/library/typescript.plain +0 -15
@@ -1,78 +1,44 @@
1
- # Development
1
+ # Developing turri's CLI
2
2
 
3
- ```bash
4
- npm run typecheck # types
5
- npm test # the whole suite, about a minute
6
- ```
7
-
8
- The suite runs the projects' testing scripts on this machine, as turri does. The fixture scripts stage each run in a folder of their own, as test files running side by side would otherwise share one.
3
+ This repository publishes `@turri-dev/cli`: the `turri` command and the terminal. [`@turri-dev/core`](https://github.com/turri-oss/turri-core) owns the session, harness, agents, parser, genome and standard library; the terminal is one front end of its session, as a [desktop host](hosting.md) is another. A change to how turri builds goes there; a change to how the terminal shows it goes here. The CLI imports the core's five public entries alone - `@turri-dev/core`, `/plain`, `/project`, `/models` and `/system` - as [the core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md) describes them.
9
4
 
10
- `.github/workflows/test.yml` runs both on GitHub for every pull request and every push to `main`, and `.github/workflows/commits.yml` checks that each of a pull request's commits is a Conventional Commit, with no fixup and no merge commit - a pull request is rebased onto `main`, each commit as it is. A pull request from a fork runs them once the maintainer has approved its run - see [contributing](../CONTRIBUTING.md).
5
+ ## Linked development
11
6
 
12
- ## Mutation testing
7
+ With a released core, `npm ci` installs the pinned version. To use a core checkout instead, install its dependencies there first (`npm ci`), then run this **in the CLI checkout**:
13
8
 
14
- `npm run mutation` runs [Stryker](https://stryker-mutator.io) over the core of regeneration - the parts in `stryker.config.mjs` - one part at a time, each part's report in `reports/mutation/<part>/`. A part with a report is skipped, so a run that is stopped goes on from the part it was in; `npm run mutation -- <part>` runs one again, and `npm run mutation -- --summary` sums up the reports there are. It takes hours: each part runs the suite once to find which tests reach which mutant (`vitest.stryker.config.ts`, the suite without the files that run real commands behind the sandbox), then each mutant against those tests. `scripts/mutation.mjs` sets two things in Stryker's vitest runner the suite needs - forked workers, and a test-name filter that matches vitest 5's names - again after every `npm install`.
15
-
16
- The `mutation` workflow (`.github/workflows/mutation.yml`) runs it on GitHub, started by hand: Actions, mutation, Run workflow. It takes the parts to run, space-separated (empty for every part), each a job of its own side by side, on four cores (`TURRI_MUTATION_CONCURRENCY`; six here). Each part's `mutation.html` and `mutation.json` are uploaded as an artifact, `mutation-<part>`, and summed up on the run's page. Stryker's incremental file is cached from run to run, so a run tests again only the mutants whose code or tests changed; tick `fresh` to test every one again.
17
-
18
- Working on turri itself, `npm link` points the global `turri` at this clone, so edits take effect immediately. `npm run chat` starts [pi](https://pi.dev) with the extension loaded from `src/`.
9
+ ```bash
10
+ npm run link:core -- ../turri-core # or the path to a core worktree
11
+ export NODE_OPTIONS=--conditions=turri-source
12
+ node bin/turri.mjs # the CLI and the core both run from src/
13
+ npm run typecheck
14
+ npm test
15
+ ```
19
16
 
20
- The package on npm is built: Node runs no `.ts` file inside a `node_modules`, so `npm run build` (`scripts/build.mjs`, over `tsconfig.build.json`) compiles `src/` into `dist/`, file for file - each file as deep as its source, so it finds `genome/`, `stdlib/` and `.pi/` the same way - with its imports' `.ts` rewritten to `.js`, and copies the other files in `src/` beside them. `npm pack` and `npm publish` run it first (`prepack`), and the package holds `dist/`, not `src/`. `bin/turri.mjs` runs `src/cli.ts` where there is one and `dist/cli.js` otherwise; `cli.ts` starts [pi](https://pi.dev) with the launcher and extension beside itself, whichever they are. To try the package as users get it: `npm pack`, then `npm install -g ./turri-dev-cli-<version>.tgz`.
17
+ In PowerShell set `$env:NODE_OPTIONS = '--conditions=turri-source'`. The link helper also links the core's installed pi and pi-tui into the CLI: the terminal must patch the same pi classes that own its chats. It does not change either manifest or lockfile. `npm ci` restores the release dependencies once that version is on npm. Use the source condition only with a linked checkout: the npm packages ship compiled JS and declarations, not TypeScript sources. The banner says which core runs, under turri's version: a released one by its version alone, a checkout by its commit, its folder and whether its sources run - in the warning colour when it runs its `dist/`, which is only as new as its last build.
21
18
 
22
- ## Publishing
19
+ ## Checking a change
23
20
 
24
- `.github/workflows/publish.yml` publishes `@turri-dev/cli`, after the typecheck and the suite pass:
21
+ `npm test` runs the CLI and terminal suite without calling a model. `npm run typecheck` checks `src/`; with a linked core it follows the `turri-source` condition. To run one file: `npx vitest run tests/regenerate/jobs-tree.test.ts`. The harness suite and mutation tests run [in the core](https://github.com/turri-oss/turri-core/blob/main/docs/development.md).
25
22
 
26
- - every push or merge into `main` publishes a prerelease under the `next` dist-tag - the patch after the `latest` on npm, with the commit's sha: `0.1.2-next.<sha>`. `latest` is not touched; `npm install -g @turri-dev/cli@next` gets it.
27
- - a GitHub Release tagged `vX.Y.Z`, published by hand, publishes `X.Y.Z` as `latest` (or under `next`, if the release is marked a pre-release). The tag is the version: it is set in the runner and never committed, so `package.json`'s version on `main` is stale by design. Once npm has a release on `latest`, it is posted to the Discord channel whose webhook is the repository secret `DISCORD_RELEASE_WEBHOOK` - its name, its notes and the command that updates; without the secret nothing is posted.
23
+ `npm run build` compiles the CLI against the core's built declarations. On an unbuilt core checkout, run its `npm run build` first. `npm run test:package` installs the packed CLI in a temporary project and runs its commands there. Pass the core checkout to pack and install both packages, including before the core version is published - the clone is installed as the version the CLI pins, as its own package.json keeps the version it was last given:
28
24
 
29
- The workflow signs in to npm with npm's trusted publishing (OIDC), not a token: the package's settings on npmjs.com trust `turri-oss/turri`, the workflow `publish.yml` and the environment `npm`. Renaming the workflow file breaks it.
25
+ ```bash
26
+ npm run test:package -- ../turri-core
27
+ ```
30
28
 
31
29
  ## Layout
32
30
 
33
- | path | what it is |
34
- |---|---|
35
- | `bin/turri.mjs` | the launcher: checks the Node version, then loads `src/cli.ts` |
36
- | `src/cli.ts` | the `turri` command and its subcommands |
37
- | `src/setup.ts`, `src/doctor-tool.ts`, `src/environment.ts`, `src/stack.ts` | `turri doctor` and the chat's `doctor` tool, and what they check - this machine, and in a project what its modules need of it |
38
- | `src/extension.ts` | the [pi](https://pi.dev) extension: every tool and command the conversation has - and `createTurriCore`, the session it is built into |
39
- | `src/chats.ts`, `src/chat-scope.ts`, `src/chat-records.ts` | the session's [chats](chats.md): which chat a pulse is told to, each chat's scope - its id and stack - and `.turri/chats.json` |
40
- | `src/sentinel.ts`, `src/sentinel-chat.ts` | [the sentinel](sentinel.md): its prompt, what it is told of a pulse, its fenced tools, its guidance; notices - their cards, the terminal's dialog, their answers |
41
- | `src/chat-terminal.ts`, `src/chat-ui.ts`, `src/chat-commands.ts` | the terminal's chats: [pi](https://pi.dev)'s screen switched between live sessions, a hidden chat's stand-in for it, `/chat` and its keys |
42
- | `src/host-session.ts` | `createTurri`, the session for a host |
43
- | `src/skill.ts` | parses `SKILL.md` into steps and gates |
44
- | `src/graph.ts` | compiles a skill into a LangGraph `StateGraph`: step -> gate -> route |
45
- | `src/judge.ts` | runs independent judges, applies the quorum, builds the critique |
46
- | `src/genome.ts` | `runSkill()` - the one entry point the CLI and the extension share |
47
- | `src/pi.ts` | [pi](https://pi.dev) session factories for executors, sub-agents and judges |
48
- | `src/loop-tools.ts` | `regenerate`, `drift` and `halt` - one definition each, for the conversation and the skills alike |
49
- | `src/plain/` | the [\*\*\*plain](https://plainlang.org/docs/) parser - see [parser](parser.md) - and `highlight.ts`, which highlights \*\*\*plain with turri's own grammar, `plain.tmLanguage.json` - started from [plyn](https://github.com/plainlang/plyn)'s at `f9c02b8`, and changed here since: test plain files' sections and keys, the `# <id>` heading |
50
- | `src/regenerate/conformance.ts` | conformance tests: writing them, and fixing the test or the code until they pass |
51
- | `src/regenerate/regenerate.ts`, `src/regenerate/conform.ts` | a code job - a \*\*\*plain diff regenerated in the code - and a conformance job |
52
- | `src/regenerate/loop.ts`, `src/regenerate/records.ts`, `src/regenerate/drift.ts`, `src/regenerate/jobs.ts` | the work loop, the records and the work derived from them, and background jobs |
53
- | `src/regenerate/chunk-plan.ts`, `src/regenerate/cases.ts` | cutting the work into jobs, and what a job's agents are told by its cases |
54
- | `src/regenerate/regression.ts` | the whole conformance suite run, and the repair agent that may not touch tests |
55
- | `src/regenerate/lineage.ts` | module history in `.plaingit` |
56
- | `src/regenerate/launch.ts`, `src/launch-track.ts`, `src/launch-session.ts`, `src/launch-agent.ts`, `src/launch-tools.ts`, `src/launch-cli.ts` | launch: a commit to `dist/<module>`, the launch track, the launch agent and what it starts on the host - see [launch](launch.md) |
57
- | `src/regenerate/confine.ts`, `src/regenerate/agent-shell.ts`, `src/regenerate/command-check.ts`, `src/regenerate/os-sandbox.ts`, `src/regenerate/audit.ts`, `src/regenerate/agent-env.ts`, `src/regenerate/shell.ts` | the file-tool fence and the walls around every agent command: the check, the OS sandbox, the audit, the module's environment, the host runner - see [sandbox](sandbox.md) |
58
- | `src/regenerate/model-names.ts` | resolving a model named as the person said it - for a call's `model` and the `settings` tool |
59
- | `src/regenerate/job-panel.ts`, `src/regenerate/transcript-view.ts`, `src/regenerate/diff-view.ts` | the job panel, the side panel's colours, and a \*\*\*plain diff as they show it - highlighted and banded |
60
- | `src/regenerate/side-panel.ts`, `src/regenerate/panel-dock.ts` | the side panel, and the chat narrowed beside it when it is docked |
61
- | `src/screen-padding.ts` | the blank row above and below the whole screen and the two columns either side, in both of [pi](https://pi.dev)'s ways of drawing it |
62
- | `src/regenerate/spec-map.ts`, `src/regenerate/spec-map-view.ts` | regen: each item's mark, from the records, the `.plain` files and the work loop's plan (`mapPlan`), and the map drawn |
63
- | `src/regenerate/debug-log.ts` | each regenerating agent's whole conversation, streamed to `.turri/debug/` - while its pulse runs, and kept in debug mode |
64
- | `src/regenerate/pulse-files.ts` | what a pulse writes only for a person - its logs, outputs, temporary files, its chain's installed dependencies - removed as it ends outside debug mode |
65
- | `src/regenerate/failure-reports.ts` | why a pulse that failed or finished without landing did - what `pulses` says of it - kept in `.turri/pulses/<id>.md` whatever the debug setting, for a later session |
66
- | `src/regenerate/ledger.ts`, `src/regenerate/ledger-view.ts` | the ledger: what turri did, as typed facts, in `.turri/ledger/` - `record()`, read back for `pulses` - see [the ledger](using.md#the-ledger) |
67
- | `src/capture/`, `src/capture-cli.ts` | [capture](capture.md): the map, areas folded to a budget, the agents and the checks of what they hand over, assembling the modules, the testing scripts, the report, resuming, its status while it runs - and `turri capture` |
68
- | `src/reopen.ts` | a chat opened again in another folder by `turri` once it quits - into the project a capture wrote |
69
- | `src/plain-code-blocks.ts` | \*\*\*plain fenced as ` ```plain ` in the chat, highlighted by turri's grammar - pi-tui's Markdown patched |
70
- | `genome/` | what turri knows and can do: `genome/skills/`, the skill library, `genome/rules/`, the \*\*\*plain authoring rules, and `genome/capture/`, capture's prompts |
31
+ | Where | What it owns |
32
+ | --- | --- |
33
+ | `bin/turri.mjs`, `src/cli.ts`, `src/*-cli.ts` | Node checks, argument parsing, command dispatch, printing and exit status. `regenerate`, `conform`, `launch` and `cultivate` open a session with no front end; `loop-cli.ts` prints a run from its events. |
34
+ | `src/cli-root.ts`, `src/turri-versions.ts` | This turri: its identity for the core (`client`), its version line, update and PATH checks. |
35
+ | `src/pi-launch.ts`, `src/extension.ts` | Prepare terminal images, open the process's session before pi's `main` and build its extension into pi. The banner and themes come from this package; the genome comes from the core. |
36
+ | `src/terminal-view.ts`, `src/banner.ts`, `src/entry-renderers.ts` | The terminal's `Frontend` - what it shows, how it asks, its surface - drawn from the session's events; the welcome screen and transcript rendering. |
37
+ | `src/panel-view.ts`, `src/terminal-notifications.ts`, `src/regenerate/*-view.ts`, `src/regenerate/jobs-tree.ts` | The side panel: regen, pulses, the inbox of notifications and keyboard focus. |
38
+ | `src/chat-*.ts`, `src/pi-settings.ts`, `src/skill-progress.ts` | The chats on pi's screen (`sessions: external`), their stand-in UI while hidden, tabs and keys, the settings menu and progress widgets. |
39
+
40
+ ## Publishing
71
41
 
72
- ## Known edges
42
+ The compatible core version must be available on npm before releasing the CLI. Pin that version with npm and keep its lockfile resolution. The CLI's `prepack` builds `dist/`; the package includes the CLI's assets, themes, launcher and docs, and exports nothing but its `package.json`. The core is a normal versioned dependency.
73
43
 
74
- - Judges default to the executor's model. Real separation wants a different provider - set `model:` on the gate. An unconfigured model falls back to the executor's with a note rather than failing the run.
75
- - The executor keeps one session across steps and retries, so context builds up with attempts. Long skills want compaction or a session per step.
76
- - A gate's escalation lives in memory (LangGraph's `MemorySaver`): it must be answered in the same run.
77
- - The gate machinery has no automated coverage; see [trying the gate semantics](skills-and-gates.md#trying-the-gate-semantics).
78
- - Jobs live in memory: there is no resuming a job after [pi](https://pi.dev) exits. The work itself is on disk, so a killed job leaves a partial build rather than nothing.
44
+ The typecheck, suite and packed consumer check run in `.github/workflows/test.yml`, on the core the CLI pins, installed with `npm ci`. `.github/workflows/publish.yml` uses npm trusted publishing: a push to `main` publishes a prerelease under `next`; a GitHub release tagged `vX.Y.Z` publishes that version under `latest`, or `next` for a prerelease. See [contributing](../CONTRIBUTING.md) for the commit checks.
package/docs/headless.md CHANGED
@@ -65,7 +65,7 @@ Useful options - `turri regenerate --help` lists all of them:
65
65
  | `--from-scratch` | delete the module's code and conformance tests (its lineage keeps them) and regenerate all of it |
66
66
  | `--from-scratch-chain` | the same for every module of its requires chain, the base's included, built again from the bottom |
67
67
  | `turri conform --from-scratch` | take out the tests folder at the tip of the module's chain (its lineage keeps it) and write the tests again from a copy of the tests of the module the tip requires, the code untouched; `--from-scratch-chain`, from nothing |
68
- | `--start-over` | start over, unasked, a codebase built without a module it now requires - without a terminal, a run that needs it and lacks it stops |
68
+ | `--start-over` | start over, unasked, a codebase built without a module it now requires - without it, a terminal is asked: a no regenerates the rest of the chain, the run ending incomplete; with no terminal, the run stops there |
69
69
  | `--build-dir <dir>` | as the run ends, export the code there - see below |
70
70
  | `--report <file.json>` | write [the run report](#the-run-report) there |
71
71
 
@@ -181,6 +181,8 @@ A module that `requires` others is built in its own codebase on top of theirs: t
181
181
 
182
182
  ## If it stopped
183
183
 
184
+ `Ctrl-C` stops a run as it would end: its running pulses stopped and rolled back, nothing more started, the code exported to `--build-dir` and the report written - `interrupted`, exit `130`. A second `Ctrl-C` leaves at once. `SIGTERM` and `SIGHUP` leave at once too, what its agents started stopped with it.
185
+
184
186
  Run the same command again. Functionalities already built from the current \*\*\*plain description are left alone, and modules that are complete are skipped, so it picks up where it stopped - after a crash, a provider outage, or a machine that went to sleep anyway. Whatever the stopped run left half-written is undone first: each step starts from the module's last commit. A functionality whose \*\*\*plain has changed since counts as not built, so editing \*\*\*plain and re-running rebuilds what changed. `--from-scratch` rebuilds the module; `--from-scratch-chain` rebuilds every module of its chain.
185
187
 
186
188
  ## Rebuilding one functionality
package/docs/hosting.md CHANGED
@@ -1,255 +1,7 @@
1
1
  # Running turri in a host
2
2
 
3
- `turri` runs its chats in a terminal. A host - a desktop app, an editor - can run the same session itself, its chats in its own windows, and show what turri's terminal would draw in its own way: the jobs, the questions, the \*\*\*plain description. It imports turri from npm as `@turri-dev/cli/host`.
3
+ `turri` runs its chats in a terminal. A host - a desktop app, an editor - runs the same session itself, its chats in its own windows, and shows what turri's terminal draws in its own way: the pulses, the questions, the \*\*\*plain.
4
4
 
5
- ## What the host entry gives
5
+ The terminal and a host build on the same package, [`@turri-dev/core`](https://github.com/turri-oss/turri-core): each opens one session with `createTurri({ frontend })`, says in its `Frontend` what it does differently - where its chats' pi sessions are made, how it asks the person, what it shows itself, where the person watches the work - hears the session's events and asks its methods. The terminal's front end is in this repository (`src/terminal-view.ts`, `src/chat-terminal.ts`); a host writes its own. [The core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md) is the whole of it.
6
6
 
7
- `@turri-dev/cli/host` is turri's compiled code (`dist/host.js`, with its types) - the conversation and what a host shows beside it:
8
-
9
- | export | what it is |
10
- | --- | --- |
11
- | `createTurri(options)` | a turri session: its [chats](chats.md), each a [pi](https://pi.dev) session with every tool, slash command, rule and skill the terminal has, on one job registry and work loop. The host opens, closes and shows them, is told of their jobs and asks their questions, and asks the sentinel to check functional specs (`check`) - see [the session in a host](#the-session-in-a-host). |
12
- | `SENTINEL`, `SENTINEL_START`, `Notice`, `NoticeAnswer`, `Conclusion`, `SentinelCheck`, `CheckRequest` | the [sentinel](sentinel.md)'s chat role, the answers to the question before it starts, its notices and how they are answered, its conclusions - a pulse's by `job`, a check's by `check` - and the checks a host asks of it - see [the sentinel](#the-sentinel). |
13
- | `MAX_CHATS`, `ChatInfo`, `ChatStatus` | the most chats a session has open - nine - and what the host is told of each. |
14
- | `pi` | [pi](https://pi.dev) itself, as turri is built against it. Make the host's own extensions and UI with this one, not another copy. |
15
- | `readProjectConfig`, `projectModels`, `modelSpec`, `configForSpec`, `hasProjectConfig`, `stacksOf` | the project's settings, as [config.turri.yaml](config.md) has them. |
16
- | `configSettings`, `currentValue`, `readConfigText`, `overriddenBy`, `EFFECT_TEXT` | every setting of config.turri.yaml as [/settings](config.md#changing-it-from-the-chat) knows it - its key, what it does, its kind (a yes or no, one of a few words, a number, a model, a list, a path, a budget), its words or the values offered first, what it is unset and when a change takes effect - and what the file has now (`currentValue(readConfigText(dir), key)`), and what wins over it. Change one as the person would, by sending `/settings <key> <value>` to the chat: turri checks it and writes it with the file's comments kept. A setting's values for a list are the session's `settingChoices(key, typed?)`: what /settings's completions offer after `typed`, in their order, but whole - uncapped, where the terminal shows forty - and without unset, which the host draws itself; the values alone. A model setting's are every model of every provider signed in to, from the model registry the chats use, whether or not one has run /settings - and after a colon, that model's thinking levels. An unknown key gives `[]`. |
17
- | `debugMode` | whether turri keeps, in a project, what it writes only for debugging it - `debug:`, or `TURRI_DEBUG` over it (see [debug mode](config.md#debug-mode)). |
18
- | `initConfig(dir, { vendor, bedrock, models, force, catalogue })`, `VENDORS`, `BEDROCK_REGIONS`, `BEDROCK_DEFAULT` | a project's first config.turri.yaml, as `turri init-config` writes it - async, it may read [pi](https://pi.dev)'s catalogue - see [a project's first config](#a-projects-first-config). |
19
- | `machineChange(command)`, `machineChangeReason(why)` | whether a command line would install something on the machine or change a setting of the machine's or the person's shell - and why - and what turri says instead: for a host's own tool that types into a shell, which turri cannot see a command in. |
20
- | `installedModelRuntime(cwd?)`, `EXTENSION_PROVIDERS` | pi's model runtime with the providers the person's installed pi extensions register - for a host's sign-in sheet before a chat is open - and the providers turri knows come from an extension - see [models from a pi extension in a host](#models-from-a-pi-extension-in-a-host). |
21
- | `piModelCatalogue`, `bedrockMakers`, `bedrockModelsIn`, `bedrockDefaultModels`, `bedrockModels`, `bedrockPlaceOf`, `makerLabel`, `BEDROCK_GEOGRAPHIES`, `BEDROCK_IN_REGION` | [pi](https://pi.dev)'s model catalogue, read without a request, and Bedrock in it: whose models it serves, in which geographies, which two turri offers for a maker and geography. |
22
- | `bedrockAwsRegion`, `bedrockNeedsAwsRegion` | the AWS region turri calls a Bedrock geography's models in, and whether that geography needs a region of its own - every one but `global`, `us` and `in-region`, which [pi](https://pi.dev)'s default `us-east-1` serves. |
23
- | `bedrockRegionFor(projectDir)`, `BedrockRegion`, `BedrockRegionSource` | the AWS region the project's Bedrock models are called in, read without setting anything: `{ region?, source, models, needs?, conflict? }` - `source` `set` (the person's `AWS_REGION` or `AWS_DEFAULT_REGION`, never touched), `turri` (turri sets `AWS_REGION` as the session starts, the models needing it and none set), `profile` (the `AWS_PROFILE`'s region, in the models' geography) or `default` (nothing names one: `us-east-1`); `models` the Bedrock models the config names, each stack's too; `needs` the region and geography they need, when one; `conflict`, the models needing two regions, each with its models - then no region is set, one `AWS_REGION` serving every model. `region` is undefined with no Bedrock model, or with a conflict and nothing set. Undefined on an older turri. |
24
- | `checkPlainFile`, `plainFileParser`, `resolveTemplateDirs`, `iterateFunctionalSpecs`, `FUNCTIONAL_REQUIREMENTS` | \*\*\*plain checked and parsed, with its test plain files, its functional specs one by one - `{ funcId, specifications }`, the specifications with the functional spec's conformance and acceptance scenarios, each `{ id, text }` - as `turri parse` reads it. |
25
- | `highlightLines`, `roleOf` | \*\*\*plain's lines coloured by turri's own [\*\*\*plain](https://plainlang.org/docs/) grammar, each piece by its `PlainRole`: `section`, `concept`, `link`, `literal`, `keyword`, `module`, `comment`, `bullet` and `id` - the `# <id>` heading of a functional spec or a scenario, and a test plain file's `func_id:` value, the functional spec it binds to. A test plain file's `module:` value is a `module`, whole - `my-app`, `billing.v2` - as a module name listed under `import:` or `requires:` is. |
26
- | `plainGraph(projectDir)` | a project's \*\*\*plain as a graph to move around in: its modules with what each imports and requires and what imports and requires it, each item of their sections with its line, and the concepts - an item linked to those it names and to where each is defined - see [\*\*\*plain for a host](#plain-for-a-host). |
27
- | `testDirOf(plainFile)`, `DEFAULT_TEST_DIR` | the absolute folder a module's test plain files are in - `test-dir`, its module's own file's over the project's, else `tests` (`DEFAULT_TEST_DIR`), from the project's folder - for a host that lists a project's modules by walking its .plain files and leaves the test plain files out. It is a module's, not a project's, because a module's `config.turri.<module>.yaml` may name a folder of its own. |
28
- | `conceptsOf(plainFile)`, `findConcepts(text)`, `conceptBeingTyped(text)` | the concepts a module can name, with what each is and the module that defines it; the concepts written in a piece of text; the one being typed at its end. |
29
- | `stdlibTemplates()`, `isStack`, `STDLIB_KINDS` | turri's standard library: every template with its kind, file, text, imports and its conformance template or the stack it tests, and the kinds in order with their titles. |
30
- | `projectStanding(projectDir, { loop?, files? })`, `ModuleStanding` | how every module of a project stands, in one call - see [how a project stands](#how-a-project-stands). |
31
- | `requiresOrder(projectDir, { files? })` | a project's .plain files, absolute, in the order they are built: each after every module it requires, as its requires chain (`resolveRequiresChain`) has them - the files taken in the order given, by name without `files`, each brought in after what it requires. A module whose chain does not resolve - it does not parse, a module it requires is not there, a cycle - goes after what its front matter says it requires, as far as those are found; none is left out. Only the files given are in it: `files`, absolute or from the project, else every .plain file in the project's folder. |
32
- | `functionalityCompletion`, `createWorkLoop`, `createJobRegistry`, `describeModules`, `PlannedPulse` | how far each functional spec is built - each module's `specified`, `withScenarios` (those tested, which tested-of-specified counts over), `completed`, `conformanceTested`, `tested` and `incomplete` - and the work a \*\*\*plain change would plan, before it runs: the session's `turri.loop` `lookAhead(plainFile)` plans a module as regenerate would and starts nothing, and `plannedPulse(rowId)` gives a planned row's cases and - the next pulse of its codebase - its coding agent's whole prompt (`PlannedPulse`), from the plan regenerate then runs ([looking ahead](regenerating.md#a-whole-module)). |
33
- | `onModelEvent`, `describeTurnIncident` | a provider failing and waited out, a turn turri ended itself. |
34
- | `onLedgerEvent`, `readLedger`, `ledgerDir`, `runViews`, `pulseView`, `describePulseView`, `describeRuns`, `ledgerProjects`, `earlierPulses`, `asJob` | what turri did, as facts - the [ledger](using.md#the-ledger): each event heard as it is recorded, and every run and pulse read back, earlier sessions' too - see [the ledger in a host](#the-ledger-in-a-host). |
35
- | `doctor({ dir, models, env })`, `Check`, `Level` | whether the machine - and, with `dir`, that project - is ready for turri, as `turri doctor` checks it: a list of checks to show in the host's own way - see [doctor in a host](#doctor-in-a-host). |
36
- | `sweepOrphanedGroups` | stop what a turri killed outright left running, before anything starts. |
37
-
38
- It is turri's own code, as the terminal runs it: a 0.x release may change any of it.
39
-
40
- ## A project's first config
41
-
42
- ```js
43
- import { initConfig, piModelCatalogue, bedrockMakers, bedrockModelsIn, bedrockDefaultModels } from "@turri-dev/cli/host";
44
-
45
- const catalogue = await piModelCatalogue();
46
- bedrockMakers(catalogue); // [{ maker: "xai", label: "xAI", regions: ["global", "us", "in-region"] }, ...]
47
- bedrockModelsIn(catalogue, { maker: "xai", region: "global" }); // the maker's chat models there, with their prices
48
- const offered = bedrockDefaultModels(catalogue, { maker: "xai", region: "global" });
49
- const { written, message } = await initConfig(project, { models: { harness, coding }, catalogue });
50
- ```
51
-
52
- `initConfig` writes config.turri.yaml as `turri init-config` does, and returns what it did - `written`, and `message`, the lines the terminal prints. It is async.
53
-
54
- - `vendor` - `anthropic`, `openai`, `google`, `amazon-bedrock`, `claude-code` (a Claude subscription, through the [pi-claude-code](https://github.com/earendil-works/pi-claude-code) extension) or `other` - fills in that vendor's own two models (`VENDORS` has each one's label and models).
55
- - `bedrock: { maker?, region }`, on Amazon Bedrock, says whose and where. turri's own pair is written where it has one - Anthropic's and OpenAI's in `BEDROCK_REGIONS` - and otherwise the pair `bedrockDefaultModels` offers from [pi](https://pi.dev)'s catalogue: any maker and geography it has.
56
- - `models: { harness, coding, strong? }` writes those two instead - any pair [pi](https://pi.dev)'s catalogue has as chat models, full model ids without a thinking level (`amazon-bedrock/global.xai.grok-4.7`). They go wherever the vendor's own would: the two models with the thinking turri writes, the commented-out `judge-model` and `models:` examples, `strong` - the judging examples' model - being `harness` unless given. The vendor, the Bedrock maker and the geography are read from them, so neither `vendor` nor `bedrock` is needed. A model the catalogue does not have, or that is not a chat model, writes nothing: `written` is false and `message` says which, with the closest the catalogue has.
57
- - `catalogue`, the one the host already read, saves reading it again.
58
-
59
- The message says whose models were written - "with xAI's models on Amazon Bedrock (global)" - and how to sign in: an `AWS_PROFILE` or a Bedrock API key, never a region. For a geography that needs one, it says which turri calls it in - `turri calls eu's models in eu-central-1. AWS_REGION, set, overrides it - and so does your AWS profile's region, when it is in eu.` - `bedrockAwsRegion(geography)` being that region, and `bedrockNeedsAwsRegion(geography)` whether the geography needs one. turri sets it itself: `createTurri` - and `turri` in a terminal, and every command that calls a model - sets `AWS_REGION` for the project's Bedrock models before any is called, when they need a region and neither `AWS_REGION` nor `AWS_DEFAULT_REGION` is set, and works it out again when the config's models change through `/settings` and as each pulse takes its model. A host that shows the person where their models run reads `bedrockRegionFor(projectDir)` - "turri calls these models in eu-central-1" - rather than asking them to set anything.
60
-
61
- ## How a project stands
62
-
63
- ```js
64
- import { projectStanding } from "@turri-dev/cli/host";
65
-
66
- for (const { plainFile, module, drift, driftError, completion, completionError } of projectStanding(projectDir, { loop: turri.loop })) {
67
- // drift: loop.drift(plainFile)'s reports; completion: functionalityCompletion(plainFile)'s chains.
68
- }
69
- ```
70
-
71
- `projectStanding` gives each module of the project what `drift` and `functionalityCompletion` give it asked alone - `drift`, every codebase of its requires chain with what is left to regenerate there, and `completion`, its chain's functional specs completed and conformance tested - in one call. Asked module by module, each call parses and reads the whole chain below the module again: on a project of a dozen modules in one chain, seconds. Asked of the project, each file is parsed once and each codebase's record read once, the modules below shared by every chain they are in.
72
-
73
- - `loop` is the work loop whose `drift` is read - the session's `turri.loop`, which knows the pulses running and the codebases halted. Without one, a loop of its own, asked nothing, reads the codebases as their records have them - drift plans and starts nothing.
74
- - `files` are the .plain files to look at, absolute or from the project. Without them, every .plain file in the project's folder.
75
- - A module drift or completion cannot say - one that does not parse, a module it requires not there - has `driftError` or `completionError`, the message, in place of the answer; the others are answered all the same.
76
-
77
- What it reads is kept between calls while it holds: a parse while the files it read are as they were - their text, and the files it looked for still not there - a codebase's record by the commit its history is at, a config file by its size and modification time. Asked again with nothing changed, it costs a fraction of the first call; a change is seen at the next. `plainGraph`, `checkPlainFile`, `plainFileParser`, `drift` and `functionalityCompletion` keep the same.
78
-
79
- ## Models from a pi extension in a host
80
-
81
- A provider a [pi](https://pi.dev) extension registers - `claude-code`, a Claude subscription through Claude Code ([a Claude subscription](claude-subscription.md)), or a company's own gateway - is in a host's chats as in the terminal's: each chat's resource loader loads the person's installed pi packages, and turri's agents take the providers from the chat. Without a chat, turri loads the installed extensions itself - `piModelCatalogue`, `doctor` and `initConfig` see their providers. What a host does with pi's model runtime itself before a chat is open - its sign-in sheet listing the providers and whether each is connected, say - takes `installedModelRuntime(cwd?)`: pi's runtime with the installed extensions' providers in it, loaded once a process. A `ModelRuntime.create()` of the host's own has none of them, and `claude-code` would be missing from the list until a chat is open. `EXTENSION_PROVIDERS` names the providers turri knows come from an extension - `claude-code` - each with its label, the command that installs its extension, and how it is signed in to: `claude-code`'s sign-in is Claude Code's own, `claude auth login` in a terminal, and pi's login for it refuses, saying so. The host's process needs the person's PATH, as for doctor below, to find `claude`.
82
-
83
- ## doctor in a host
84
-
85
- ```js
86
- import { doctor } from "@turri-dev/cli/host";
87
-
88
- const checks = await doctor({ dir: project, env: engineEnv });
89
- // [{ level: "ok" | "missing" | "limited" | "info", name, detail, more?, fix? }, ...]
90
- ```
91
-
92
- `doctor` runs the checks `turri doctor` prints, and returns them: Node, bash, git, which OS sandbox is up under the agents' commands, and whether any model provider has credentials. With `dir`, the project too: whether this machine has the toolchains its modules' implementation reqs name, what in its testing scripts it does not have, and - when its config names a `claude-code/...` model - the `Claude subscription` check: pi-claude-code installed, Claude Code on the PATH, signed in to a subscription, and nothing set that the extension refuses. It prints nothing and asks nothing; each check's `fix` is plain text, to show as it is. A check `missing` means turri cannot run until it is fixed, `limited` that it runs with less.
93
-
94
- - `dir` is the project to check - not the process's working folder, which in a host is not the project. Without it, only the machine is checked.
95
- - `models: true` asks each model the project's config.turri.yaml names for a word, with this machine's credentials - a request a model, which costs money. It is off by default: run it when the person asks.
96
- - `env` is the environment whose PATH is looked in - for bash, git, the sandbox, the toolchains and what the testing scripts run - by default the process's own. A Mac app opened from Finder runs with `/usr/bin:/bin:/usr/sbin:/sbin`, not the person's shell's PATH: pass the environment the host's engine runs turri with, so doctor checks the PATH turri will actually have.
97
-
98
- It never holds the host's thread up: every command it runs - bash, git, the sandbox, `java_home`, a base folder's `git ls-files` - runs without blocking, side by side, and the project's modules are parsed one at a time, the thread given back between them.
99
-
100
- What matters only in a terminal - `turri` on the PATH, a plain `pi` an older turri made load turri - is left to `turri doctor`.
101
-
102
- ## The session in a host
103
-
104
- ```js
105
- import { createTurri, pi } from "@turri-dev/cli/host";
106
-
107
- process.chdir(project); // the session is the project's in the process's working folder
108
- const turri = await createTurri({
109
- onJobChange: (job) => {}, // a job started, moved on, did something, or ended - any chat's
110
- onPlanChange: () => {}, // what is planned changed with no job
111
- dialogs: (chat) => ({ select, input }), // a chat's questions, put in the host's own dialogs - each with a signal to close it
112
- uiContext: (chat) => uiContext, // a chat's other UI calls - notices, the working line
113
- surface: SURFACE, // the host's UI, in its own words, told to the model in place of the terminal's
114
- systemPrompt: (prompt) => prompt, // the last word on the whole system prompt, each turn
115
- extensions: [browser, terminal], // the host's own extensions, built into every chat after turri's
116
- restore: true, // reopen the last session's chats here, as `turri --continue` does
117
- onNotice: (notice) => {}, // the sentinel puts something to the person: draw it in notice.chat
118
- onNoticeOver: (notice) => {}, // ...answered, dismissed, ignored or superseded: take its card down
119
- onConcluded: (conclusion) => {}, // the sentinel is done with a pulse - or a check: holds, wrong or unchecked, told to conclusion.chat
120
- pulseEndsShown: true, // the host shows each pulse that lands and each conclusion itself: the chat is told without a turn
121
- onChatSession: (chat, session) => {}, // a chat's session replaced, same id: the sentinel's, fresh for each pulse - follow this one
122
- sentinel: {
123
- tools: [browserTool], // the sentinel's own tools, beside turri's: what it tests a launch with
124
- surface: "...", // where the person watches it use them, in the host's words
125
- },
126
- });
127
-
128
- const chat = await turri.openChat(); // { id, title, status, shown, session }: a fresh chat, shown
129
- chat.session.subscribe((event) => {}); // pi's session: its events, prompt(), abort()
130
- await chat.session.prompt("add a cart to the shop");
131
- turri.focus(other.id); // the chat the person looks at now
132
- await turri.interrupt(chat.id); // ctrl+c: "stopped" what it was doing, else "ended" the session - "ignored", "missing"
133
- await turri.decline(chat.id); // ctrl+c at a question: "declined", the turn going on - "none", "missing"
134
- turri.chats(); // [{ id, title, status: "idle" | "working" | "question" | "unread", shown, role? }]
135
- turri.notices(); // the notices open now
136
- turri.check({ module: "app", funcIds: ["add-task"] }); // the sentinel to test these in what is launched of app: { check: id } or { refused: why }
137
- turri.settingChoices("harness-model"); // every value /settings offers for a setting, whole: every model signed in to
138
- turri.settingChoices("harness-model", "openai/gpt-6-astra:"); // after a colon, that model's thinking levels
139
- turri.turnOnConformanceTests("app.plain"); // conformance tests on: the file written - config.turri.yaml, or the stack's
140
- await turri.answer(notice.id, { action: 0 }); // or { steer: "…" }, { dismiss: true }, { ignore: true }: "done", "dismissed", "ignored", "refused", "over", "missing"
141
- turri.onChats((chats) => {}); // a chat opened, closed, renamed, working or done
142
- await turri.closeChat(chat.id); // its turn stopped, its conversation deleted - its pulses run on
143
- turri.jobs; // the session's job registry: every pulse any chat started
144
- turri.loop; // its work loop, once a chat is open
145
- await turri.dispose(); // every chat let go, what launches started stopped
146
- ```
147
-
148
- - **The chats.** Up to nine, each its own history, model, thinking level and stack, all on the session's one job registry and work loop - see [chats](chats.md). `openChat({ sessionFile })` reopens a saved one. A pulse's end goes to the sentinel (below), and is shown in the chat `focus` last named - its agent told of a pulse that landed only to say so and what the sentinel is doing with it, and not told of one that went wrong. What the `surface` says to do once something is launched is then not done after a pulse: the sentinel tests what was launched. With `sentinel: false`, it is told to the chat that asked for it, its agent reacting there - to the chat `focus` last named when that one is closed. A chat is never hidden from turri's side: what the host does not show, it still runs, and its questions go to the host's dialogs at once - the host decides where they wait. `status` says a turn is running (`working`) or that it said something since it was last focused (`unread`).
149
- - **Interrupting.** `interrupt(id)` is the terminal's ctrl+c for a host's key or button: it stops what that chat is doing - its turn, a skill or a tool in it, a `!` command, a compaction - and nothing in the other chats (`stopped`). A skill stopped keeps its run, to be continued. A question of the chat's open in the host's dialogs when its turn is stopped is over - declined - and its dialog's `signal` aborted, for the host to close it. A chat doing nothing ends the session, every chat with it, as `dispose` does (`ended`): turri never exits the host's process, so the host closes what showed it. An interrupt straight after one that stopped something is `ignored`, so pressing twice to be sure ends nothing. `session.abort()` is the chat's turn alone, and never ends the session.
150
- - **Declining a question.** `decline(id)` is ctrl+c at a question in turri's terminal: the question the chat asks now - its ask_user, a skill's interview, a review gate's escalation, whatever goes through the host's dialogs - declined. The asker is told "The user declined to answer the question." and the turn goes on; a review gate declined stands. It declines each question it is called at, however many in a row, and never stops the turn - that is `interrupt`. `none` when the chat asks nothing now, `missing` for a chat not open. A dialog that resolves with `undefined` is something else - dismissed, and in a question of several answers "done" with the boxes ticked so far.
151
- - **The record.** The chats are recorded in `.turri/chats.json` as the terminal records them, and `restore: true` reopens the last ended session's - without it, a host starts with none and deletes nothing. A chat closed is deleted; a session's chats are kept until five newer sessions have recorded theirs.
152
- - **The jobs.** The host is told of each job as it changes, and has the registry and the loop themselves, so it shows the very jobs the chats run. Its buttons are best a chat's commands - `session.prompt("/regenerate app.plain")`, `session.prompt("/conform app.plain app:add-task")` - so the plan is the chats', and no model turn stands between the button and the pulse. A job's \*\*\*plain diff is `job.diff`, and `job.diffWhere` places its lines in the `.plain` files: by a line's place in the diff, its `file`, its `line` there, the `section` it is in and `written` - the line as the file has it. The diff is \*\*\*plain as read, a link `[text](path)` in it as `` `[resource]text` ``, so a host that finds the lines again in a file's text - after an edit since the pulse started - matches them by `written`, never by the diff's text. A `job.diff` in a ledger written before `written` was added has none. `job.cases` is the functional specs the pulse covers, as planned, by what it does to each - `{ add, patch, again, delete }`, each a list of `{ module, funcId }`, `module` the pulse's own or one below it: new, changed, regenerated again with its text unchanged, taken out. A host lights those specs from it, and marks a line of the diff as regenerated again from `again` - never from the diff, where such a line is unchanged. A pulse of none is mechanical - reqs, or definitions none uses; a job that is not a pulse has no `cases`. The ledger's `job.queued` carries them too. `job.building` is the one functional spec a job is on now, when it is on one: `{ spec: { module, funcId }, label, text, since }` - `spec` the functional spec as data, `label` and `text` what the terminal shows (`core:add-task, functional spec of 3`, its text with its scenarios). Only a conformance run of one named functional spec sets it; a pulse the work loop plans covers its functional specs together and leaves it unset - light those from `cases`.
153
- - **The questions.** `dialogs(chat)` gives a chat's two dialogs: `select(title, options, context, at, { signal })` and `input(title, context, { signal })`, each resolving with the answer, or undefined when the person dismissed it. `signal` is aborted when the question is over without the dialog's answer - declined by `decline`, or its turn stopped (`interrupt`, `session.abort()`): the host closes the dialog it opened for it, whatever it resolves with then being ignored. A host may leave it unread. The chat's questions, a skill's interview and a review gate's escalation are put in them; without them, in the `uiContext`'s own dialogs.
154
- - **The surface.** What turri tells the model of where the person watches the work is the terminal's by default: regen, the side panel on `ctrl+h`, `/pulses`. In a host none of that is there, and the model would send the person to keys and panels that do not exist. `surface` is the host's own description of its UI - the views it has in place of the terminal's, what its marks and buttons mean, where questions appear - in its own words. Given, turri leaves every terminal instruction out of what the model is told and puts the surface in turri's identity, as a `<surface>` block, where the identity speaks of regen. It reaches the side questions and the tools' own words too: a pulse not found says the `pulses` tool lists them, not `/pulses`. Text only the person sees in the terminal - the job panel, the side panel - is the terminal's and stays as it is. Without `surface`, the prompt is the terminal's, byte for byte. What the conversation is to do once something is launched belongs there too - open it in the host's preview, say what to test: it is told once each launch it asked for ends, and - with `sentinel: false` - each launch after a pulse under `launch-after-pulse`, and does then what it was told to do once something is launched. With the sentinel on, the sentinel tests what is launched after a pulse, and the conversation only says it landed. With `sentinel: false`, the chat that asked for a pulse that lands under `launch-after-pulse` is told as it lands that its commit is being launched in the background - to say so in a line and offer nothing else - and then told the launch's end. Every launch, as it is asked for, starts and ends, comes to the host as `onLaunch(launch)` - its codebase, commit, status and summary. `summary` is what the launch agent said - where it runs, or why it did not come up - and nothing of turri's: show its first line as the launch's line. What turri stopped for the launch comes apart, in `stopped`, one entry a process, as it stops them - while the launch runs too: `why` (`below` - a launch of a module below it in its chain, whose code it holds; `held` - a server of another module's launch that held what it needs, `held` saying what, "port 5173"; `left-behind` - one an earlier turri session left running), the `module` whose launch started it, that `launch` and its `commit` when known, the process's `name`, `pid` and `url`. Show it beside the launch from those fields - "stopped bestiary's launch at befa07f - upgrades holds its code" - never by reading a sentence. `launchText(launch)`, exported beside the type, is the two together as the chat and the terminal read them - turri's lines, then the summary - for a host that shows the whole at a click. One whose code runs already - the chat asking for what runs, a pulse that landed only tests - comes once, `status: "launched"` with `already: true`, its own cause and the commit it was asked for; the launch that started what runs is not told again. One that ended with a newer launch of its codebase - or of a module built on it - waiting comes with its real status and `replacedBy`, the newer one's id: that one starts at once and stops what it started, so draw it as replaced rather than as running - the chat that asked for it is told so, and hears the newer one's end instead, as for one `superseded` as it waited (`supersededBy`). A launch whose servers a newer launch stopped later - one of a module built on it, which holds its code, or one that needed a port or anything else they held - comes again too, with `replacedBy` set: nothing of it runs, and the newer launch's `stopped` says what it stopped, whose it was and why (see [across a project](launch.md#across-a-project)). The newer launch may be of another codebase: what runs of a module is its own newest launch's unless one has `replacedBy`, and then the launch that id names. What a launch started, halted on request (`/halt launched`, the `halt` tool) with nothing of it left running, comes again as `status: "stopped"`, "Stopped on request.": nothing of the codebase is launched from then on, and its next launch launches anew. A launch that said a server runs is `launched` only while one it started itself runs: something else answering at its port - another turri's server, another program - makes it `failed`, its summary saying what holds the port, whose it is and how to free it. What an earlier turri's launches left running - a host that quit without `dispose`, a turri killed outright - is stopped as the session starts and before each launch of its codebase, and the next launch's `stopped` has it, `why: "left-behind"` (see [what an earlier session left running](launch.md#what-an-earlier-session-left-running)).
155
- - **The banner.** The first chat's session starts with turri's banner, an entry `customType: "turri_banner"`. Its `data.config` is what turri says of the project's config files, a line each - `{ kind, file, text }`, `text` as the terminal shows it: `renamed`, a key turri renamed in the file itself, its value kept (`release-after-pulse` to `launch-after-pulse`) - information, nothing to do; `old-beside-new`, a file that sets an old name beside its new one, the old doing nothing - take it out; `unknown`, keys turri does not read - a setting it no longer has, a misspelt one. Draw `renamed` as information, the others as warnings, by `kind`, never by the words. `ConfigLine` and `ConfigLineKind` are exported.
156
- - **The system prompt.** `systemPrompt(prompt)` gets the whole system prompt for the turn - [pi](https://pi.dev)'s, turri's identity and blocks, the rules - after turri's own `before_agent_start` work, and returns what is sent. It is for what `surface` does not cover; to describe the UI, use `surface`, rather than words appended after turri's that contradict them.
157
- - **The mode.** Each chat is bound in [pi](https://pi.dev)'s `tui` mode: the work runs in the background and keeps the chat free, as the terminal does. Its other UI calls - its notices, its working line, a confirm - come to `uiContext(chat)`, as [pi](https://pi.dev)'s [SDK](https://github.com/earendil-works/pi) describes it.
158
-
159
- ### Conformance tests
160
-
161
- Conformance tests are on only with `conformance-tests: true` ([config](config.md#conformance-tests)) - off when unset: then no conformance pulse runs, and the chats' `conform` is refused - turning them on is the person's decision; `conformance-tests` is one of `configSettings()`, and `settingChoices("conformance-tests")` gives `true` and `false`. To turn them on from the host's own button, the session's `turnOnConformanceTests(plainFile?)` does what `/conform` does before it tests, with no model call: it writes `conformance-tests: true` where the module's value comes from - its own `config.turri.<module>.yaml`, or a required module's, when that sets the key, which `/settings` alone would not change, else `config.turri.yaml` - the chats' `conform` no longer refused, and returns the file it wrote, from the project. `plainFile`, absolute or from the project, picks the module; omitted, the project's. It starts no conformance pulse: the host offers that itself, with `/conform`. With them on, the chats write scenarios for a functional spec they judge needs them, as a \*\*\*plain change like any other - its test plain file, `<test-dir>/<module>/<func-id>.plain` - which the work loop then tests.
162
-
163
- A host's chats run the [background skills](skills-and-gates.md) in the background, as the terminal's do - the two that write the testing scripts: `cultivate` returns at once, and nothing of the run shows while it runs. Its result's `details` say what it started: `{ background: true, kind?, plainFile? }` - `kind` the testing script it writes, `unit` or `conformance`, and `plainFile` the module it is for, relative to the project, each left out when there is none; `started: false` too when the skill was running already and nothing new was started - enough to show "writing the unit testing script for hello.plain, in the background" with no table of which skill writes which. Its end goes to the chat that started it, once that chat is idle: a run that did its work as an entry of its session, `turri_skill_run` (`data.text`, the line - `Unit testing script written: test_scripts/run_unittests_python.sh.`), that starts no turn; one that did not as a hidden message to its agent, `customType: "turri_skill_run"` (`details.skills`), that starts a turn in which the chat tells the person what went wrong, its `details` `{ skills, runs }` - `runs` one `{ skill, kind?, plainFile? }` for each run in it, for a turn marked "unit testing script not written · hello.plain". Meanwhile a module that lacks the script waits for it, its `why` in `mapPlan()` and `status()` `waiting for its unit testing script, which is being written` - or its conformance testing script - and starts by itself once it is written. `onPlanChange` fires as it starts waiting and as it stops - the script written, or the run ended without it - as it does whenever a module's `why` changes.
164
-
165
- A codebase that started from a [base folder](regenerating.md#the-base-folder) says so in its module's status: `loop.status()` gives `base: { folder, files }` - the folder as `base-folder:` named it, and how many of the files that came from it the codebase has still - for "started from `brand` · 12 files" in a module's head. A module built on such a codebase has the same, carried up with the code; one that started from none, or has no code yet, has no `base`. It is read again only when a pulse lands, so a host may read it on every `onPlanChange`. The record behind it, `code/.turri-base.json`, is turri's own: a host reads `base`, never the file.
166
-
167
- ### The sentinel
168
-
169
- The [sentinel](sentinel.md) is one of the host's chats: turri opens it with the first pulse that finishes, through the host's own `create` like any chat - `onChats` hears of it, `role: "sentinel"` - and never moves `focus` to it. It closes like any chat, and the next pulse that finishes opens it again; with it on, `openChat` opens up to eight.
170
-
171
- - **A conversation a pulse.** The sentinel checks each pulse from scratch, in a conversation of its own - one pulse at a time, the others waiting their turn. The chat keeps its id; its session is replaced. As it starts on a pulse, the session it had is stopped and let go (`abort`, `dispose`), a new one is made in its place, and `onChatSession(chat, session)` comes with it - before the pulse is put to it - then `onChats`; `session(id)` returns the new one from then on. A host that follows the sentinel's chat subscribes to that session in place of the old - an `onChats` listener that follows only the ids it has not seen would hear nothing more of it. The first pulse goes to the session the chat was opened with: there is no `onChatSession` for it. Each conversation's first message is the hidden brief of its pulse - `customType: "turri_sentinel_pulse"`, `details.jobId` - so a host that splits the sentinel's work by pulse on it still can; the conversations before are not in the new session, and what the host showed of them is its own to keep.
172
-
173
- - **Notices.** What it finds wrong comes as `onNotice(notice)`: `{ id, chat, severity: "error" | "warning" | "info", summary, evidence: string[], actions: [{ label, task }], module?, pulse?, job?, ignorable?, state: "open" }`. Draw it in the chat `chat` names - the one `focus` last named, or, while that is the sentinel, the chat that asked for the pulse. It is drawn there as a card in the transcript too. A host given `onNotice` answers it itself - the terminal's dialog is not opened - with `answer(id, …)`: `{ action: index | label }` starts that chat's agent on the action's task, `{ steer: text }` on the person's words, `{ dismiss: true }` on nothing, this once. A notice with `ignorable: true` - a gap in the \*\*\*plain the build settled with an assumption, which the person may leave as it is - takes `{ ignore: true }` too: offer it as its own button beside the actions. Nothing is done in the chat, the notice ends `state: "ignored"` (`"ignored"`), and turri writes it to the sentinel's guidance, so it is not raised again in this session or the next; on a notice without `ignorable`, `{ ignore: true }` is `"refused"` and the notice stays open. `onNoticeOver(notice)` comes as it is answered - and when a newer notice about its module supersedes it (`state: "superseded"`) - for the host to take the card down. `notices()` lists the open ones.
174
- - **Fixes it made.** The sentinel fixes the project's testing scripts and their config itself ([what it may do](sentinel.md#what-it-may-do)), and says so as a notice with `kind: "fixed"`, `severity: "info"`, no actions, the lines before and after in `evidence`: a note, with nothing to answer. Draw it as one - its card with a way to put it away (`answer(id, { dismiss: true })`), no "say what to do instead". It never supersedes a notice about its module. The terminal puts it in notifications.
175
- - **The machine is the person's.** turri installs nothing and changes no setting of the machine's or the person's shell, in any chat, the sentinel's included - and through a host's tools as through its own: a tool call whose input has a `command` string - a host's `terminal_run` - is refused when the command would (`machineChange`), with what to do instead (`machineChangeReason`), as turri's own `bash` is; and the sentinel's, also when it writes a `.plain` file, or starts or runs the code in `plain_modules` - what nobody launched: it tests what is launched. A tool that types into what already runs - a terminal's `terminal_type` at a shell prompt - is the host's to check: `machineChange(text)` says whether a line would change the machine, and why.
176
- - **Starting it.** Under `sentinel: ask` - as it is unset - the person is asked before it first opens in the session: a notice with `kind: "sentinel-start"`, `severity: "info"`, in the chat `chat` names, its `summary` the question in one sentence, no `evidence`, and its actions the answers - `Start the sentinel`, `Start it, and don't ask again`, `Not this session`, `Turn it off for this project`. Draw it as a question rather than as something wrong. `answer(id, { action })` answers it, by index or label - `"done"` - and `{ dismiss: true }` is not this session; turri writes `sentinel:` itself for the two that choose for the project. Until it is answered, the pulses that finish are held: neither the sentinel nor the chat hears of them. A host that offers the setting too writes it as `/settings` does - `ask`, `true` or `false` (see `configSettings`).
177
- - **Conclusions.** As the sentinel is done with each pulse - all well or not - `onConcluded({ job, verdict: "holds" | "wrong", summary, module, pulse, chat })` comes, and the chat `chat` names - the one `focus` last named, as for a notice - shows it and its agent says so in a line. A pulse turri cannot brief it on - what runs cannot hold the pulse's commit, turri's own error - ends `verdict: "unchecked"`, with an error shown in that chat as well.
178
- - **A host that shows them itself.** With the sentinel on, the default host has the chat report each landed pulse and each conclusion in a turn of its own. A host with a notification centre passes `pulseEndsShown: true` and presents them from `onJobChange` and `onConcluded`. Both still reach the chat - `customType: "turri_job_landed"` and `"turri_sentinel_concluded"`, hidden and starting no turn - so it can answer when asked. The terminal uses this quiet delivery with its own notifications tab. Host notice actions, the sentinel's briefs and checks, and delivery with the sentinel off are unchanged.
179
- - **Checks.** `check({ module, funcIds })` asks the sentinel to test functional specs of one module - the person picked them on a list of its built ones, say - in the background, on its own judgement, reported as a pulse is. `module` is the module whose launch is checked, by name; `funcIds` the functional specs to test, each `module:func-id` - of that module, or of any module its requires chain builds on, whose code its codebase holds: `check({ module: "predators", funcIds: ["depths:gene-fragments"] })`. A bare func-id is the module's own. The check and its brief name each as `module:func-id`. It returns `{ check: id }` at once, or `{ refused: why }`, saying which: the sentinel off (`sentinel: false`), or not started this session; a module not in the project's folder, an import module, one that does not parse; a name outside its chain - `Not in predators' codebase: arena:waves - arena is not predators or a module its requires chain builds on (depths, ocean).`; a func-id its module does not have; one not built in the module's own codebase as its \*\*\*plain has it now - with where the module's code is built on instead, when it is. What is tested is what is launched of the module - its own codebase's code, which holds the code of every module its requires chain builds on - never what a pulse is writing, and never another module's: turri does not choose one for it. Under `sentinel: ask`, a check asked before the sentinel was started puts the start question first, as a pulse does - `check` set on the notice - and waits for the answer.
180
- - **Queued with the pulses.** It waits its turn behind the sentinel's work, and is taken in a conversation of its own: `onChatSession`, then the conversation's first message, the hidden brief of the check - `customType: "turri_sentinel_check"`, `details: { checkId, module, funcIds }`. A pulse of its module that lands meanwhile waits for it, rather than stopping it.
181
- - **In what is launched.** The sentinel launches nothing. Once the module's launches are settled - nothing launching, nothing waiting to - it is told what runs and where, as for a pulse, and each functional spec's text and scenarios, as turri reads them, to test those and not the module's others. With nothing of the module launched - never, or halted - the check ends unchecked, its summary saying so in the person's words - `Not checked: nothing of app is launched to test it in - ask the chat to try it first, which launches it.` - and with no notice: it is an answer, not an error. When the module's last launch did not come up, the sentinel is told why, and that is its finding.
182
- - **Reported as a pulse is.** Its notices come as `onNotice`, with `check` - its id - and its module. It ends with `onConcluded({ check, verdict, summary, module, chat })` - `check` in place of `job`, which it has none of. A check that never runs - nothing of the module launched, the person did not start the sentinel when asked, it could not be opened, it was closed before it got to it - ends `verdict: "unchecked"`, the summary saying why, which the sentinel itself never gives. The ledger has `sentinel.asked` as it is asked for, and `sentinel.checking` and `sentinel.concluded` with `check`.
183
- - **Its model.** The `sentinel` role in `models:`, else the chat's model - `models.chat`, else `harness-model` - with its thinking, set as its chat opens: not pi's default model, which may not be one the project's provider has. What the person then picks in its chat stands. See [its model](sentinel.md#its-model).
184
- - **Its tools.** `sentinel: { tools }` are [pi](https://pi.dev) tool definitions registered in the sentinel's chat alone and told to it in its prompt - the host's browser, say, for it to test what is launched with. The rest of the host's `extensions` are built into its chat too, but their tools are refused it: only its own read, and these.
185
- - **Its surface.** `sentinel: { surface }` is where the person watches the sentinel use those tools, in the host's own words - the preview pane its browser and terminal show in, say. Given, the sentinel's prompt has it, as a `<surface>` block, in place of the person not watching it: it tries what is launched with the host's tools, where the person can watch, and keeps its own shell for what those 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. As for the conversation, `systemPrompt` has the last word on its prompt.
186
- - **Its surface.** What it is told is its own prompt, not the conversation's: the host's `surface` is not in it; `systemPrompt` still has the last word.
187
-
188
- A surface for a desktop app might read:
189
-
190
- ```js
191
- const SURFACE = `The person uses turri's desktop app, not a terminal: there are no keys to press. Slash commands are typed in
192
- the chat, and the toolbar's buttons send them too.
193
- - The Specs view shows each .plain file, every functional spec marked: a green dot is built, a pulsing ring regenerating,
194
- a hollow ring planned, grey waiting.
195
- - The Pulses view lists every pulse - running, planned and finished. A row opens what its agents did and its log; its
196
- Halt button stops it.
197
- - Your questions appear as cards above the message box: the person picks an option or types an answer there.
198
- - The Run button launches what is built and opens it.`;
199
- ```
200
-
201
- ## \*\*\*plain for a host
202
-
203
- ```js
204
- import { conceptBeingTyped, conceptsOf, findConcepts, plainGraph, stdlibTemplates, STDLIB_KINDS } from "@turri-dev/cli/host";
205
-
206
- const { modules, items, concepts, testPlainFiles } = plainGraph(projectDir);
207
- const app = modules.find((module) => module.module === "app");
208
- app.requires; // [{ name: "base", file: "/…/base.plain" }] - and imports, importedBy, requiredBy, the same way
209
- app.items; // ["/…/app.plain:11", "/…/app.plain:15"] - its own items, in order
210
- items.find((item) => item.id === app.items[1]);
211
- // { id, file, module: "app", section: "functional specs", line: 15, funcId: "fill-cart", text: ":User: can fill :Cart:.",
212
- // defines: [], uses: [{ concept: ":User:", definition: "/…/base.plain:8" }, { concept: ":Cart:", definition: "/…/app.plain:11" }],
213
- // resources: [{ text: "the schema", target: "schema.json", file: "/…/schema.json", line: 15 }],
214
- // testPlainFile: "/…/tests/app/fill-cart.plain", scenarios: { conformance: [{ id: "adds-an-item", text: "…", line: 8 }], acceptance: [] } }
215
- testPlainFiles[0];
216
- // { file: "/…/tests/app/fill-cart.plain", module: "app", funcId: "fill-cart", item: "/…/app.plain:15", conformance: [...], acceptance: [...] }
217
- concepts.find((concept) => concept.definition === "/…/base.plain:8");
218
- // { concept: ":User:", definition: "/…/base.plain:8", module: "base", text: "is a person who signs up.", usedBy: [...] }
219
- ```
220
-
221
- - **The graph.** `plainGraph` reads every .plain file in the project's folder and its `template/` folder, and every module they import or require, wherever the parser finds it - the standard library's templates too. A **module** is a file: its imports, resolved as the parser reads an import (a `stdlib/` module from turri's own folder), its required modules, resolved as the requires chain finds them - `file: null` when one is not found - and the reverse of both, `importedBy` and `requiredBy`, so a host goes up and down the requires chain without inverting anything. An **item** is one item of a section - a definition, an implementation req, a test req, a functional spec - with its file, the line it starts on (a functional spec's, its `# <func-id>` heading's), its text (a functional spec's, its body), a functional spec's `funcId`, its `testPlainFile` - null when it has none - and its `scenarios`, `{ conformance, acceptance }`, each `{ id, text, line }`, the concepts a definition defines, and each concept it names with the item that defines it: its own module's definitions, its imports', and those its required modules export, as the parser sees them from that module. `definition` is null for \*\*\*plain's own concepts, and for one defined nowhere the module can see. Its `resources` are the linked resources it names - `[text](target)`, as the parser reads them - each with `file`, the file regenerating reads it from (the template folders first, then the current folder), null when it is not there, and `line`, the line the link is on. `resources` is on every item, `[]` when it names none: a turri that gives no resources has no field. A **concept** is one definition of it - or \*\*\*plain's own, `definition: null` - with every item that names it there. An item's id is `<file>:<line>`: the file to open and the line to go to. A **test plain file** - each `.plain` file under the project's test folder (`test-dir`, `tests` by default) - is a node of its own: its `module` and `funcId` as its front matter binds it, `item`, the id of the functional spec it binds to, and its `conformance` and `acceptance` scenarios, each with the line its `# <scenario-id>` heading is on. One that does not parse, is outside its module's folder, or binds to no functional spec has `error`, and `item` null.
222
- - **What does not parse.** Nothing throws. A file that does not parse has `error`, the parser's message; its links are what its front matter says, and its items what of its own text reads without its imports. A file whose items Liquid moves keeps the lines of its own text.
223
- - **Concepts.** `conceptsOf(plainFile)` is what one module can name - `{ concept, definition, module }`, `definition` the text after its concepts, `module` null for \*\*\*plain's own - for suggestions as the person types. Inside a test plain file, call it with the module's file the test plain file binds to: its scenarios name that module's concepts. `findConcepts(text)` is every concept written in a piece of text, `{ concept, start, end }`, and `conceptBeingTyped(text)` the one at its end still open - `{ typed: ":Us", start }`, or undefined - both with the parser's own pattern.
224
- - **The standard library.** `stdlibTemplates()` is every template in turri's `stdlib/`, sorted: `name` - what a module imports it as - `file`, `kind` (`backend`, `frontend`, `cli`, `library` or `lang`), `description`, `text`, `imports` as the parser reads its front matter, a stack's `conformance` template when it has one, and a conformance template's stack as `tests`. `isStack(template)` says whether it is a stack to import; `STDLIB_KINDS` is the kinds in order, each with its title.
225
-
226
- ## The ledger in a host
227
-
228
- `createTurri` starts the ledger itself, in the process's working folder - the project's - so a host needs nothing to have one: its pulses are recorded as `host` runs, each event with the chat its work was asked for in, and the chats' `pulses` already tells the model of earlier sessions' pulses. What the host can do with it is show it.
229
-
230
- ```js
231
- import { onLedgerEvent, pulseView, readLedger, runViews } from "@turri-dev/cli/host";
232
-
233
- // Each event as it is recorded - written or not, so a project with ledger-keep: 0 is heard too.
234
- const stop = onLedgerEvent((entry, project) => {
235
- if (entry.kind === "healer.failed") notify(`the ${entry.healer} failed: ${entry.error}`);
236
- if (entry.kind === "provider.error" && !entry.transient) notify(`the model provider: ${entry.error}`);
237
- });
238
-
239
- // The project's runs, the most recent first, each with its pulses, the most recent first - how each ended, how long, what it cost.
240
- const runs = runViews(projectDir);
241
-
242
- // One pulse, from this session or an earlier one: its rounds, test runs, verdicts, healers, refusals, history.
243
- const view = pulseView("646d", readLedger(projectDir, { job: "646d" }));
244
-
245
- // Earlier sessions' pulses as jobs, to list beside this session's - none this session's registry knows.
246
- const { jobs, more } = earlierPulses(ledgerProjects(projectDir), new Set(turri.jobs.list().map((job) => job.id)));
247
- ```
248
-
249
- - **Live.** `onLedgerEvent(listener)` is told every event as turri records it, with the project it is about, until what it returns is called; a listener that throws misses that event and nothing else. It is the pulse's own detail - its stages, test runs, verdicts, refusals - where `onJobChange` is the job as a whole.
250
- - **Read back.** `readLedger(project, { job, run, kinds, since })` is the project's events, oldest first, the gzipped runs too; `runViews` and `pulseView` gather them into runs and pulses, and `describePulseView` and `describeRuns` say them in lines, as the chat's `pulses` tells them. `ledgerProjects(dir)` finds the ledgers of a folder and the projects under it. `earlierPulses(projects, known, runs = 3)` gives the last runs before this one as `Job`s - the shape a host already draws for this session's - each marked `earlier: { run, runMode, lines }`, `lines` what the ledger says of it, and with its `cases`, `diff` and `diffWhere` - the \*\*\*plain diff it regenerated, as last steered, and where its lines are written - as a pulse of this session has them (a pulse recorded before `job.diff` was has none); `more` is how many runs are beyond them. They are read only: never started, halted or waited for. turri's own side panel lists them so, as **earlier sessions**.
251
- - **What it is for.** Looking up, never deciding: what is built and what is left come from the records and the work loop, as before. Its events and their fields are `LedgerEvent`'s - a kind is added, never changed, and every event carries `v: 1`.
252
-
253
- ## Running it
254
-
255
- The host entry is compiled JavaScript, so any Node from 22.19 runs it - Electron's own included; nothing strips types. It finds turri's own folders - `genome/`, `stdlib/`, `.pi/` - beside `dist/` in the package, wherever npm installed it.
7
+ `@turri-dev/cli/host`, which carried the old desktop contract over the core's compatibility bridge, is gone: a host imports `@turri-dev/core`.
@@ -20,7 +20,7 @@ turri init-config # a config.turri.yaml with the model you talk to and the one
20
20
  turri # pi, with turri's tools, skills and themes loaded
21
21
  ```
22
22
 
23
- The package is `@turri-dev/cli` - npm keeps the name `turri` back, as too like another package's - and the command it puts on your PATH is `turri`. `npm install -g @turri-dev/cli@next` gets the latest prerelease instead, built from the last commit on `main`. Installed again - `@latest` or `@next` - it replaces the one there. `turri --version` says which turri runs, and the [pi](https://pi.dev) under it: `turri 0.1.6 (pi 1.3.0)`, and from a clone its commit too.
23
+ The package is `@turri-dev/cli` - npm keeps the name `turri` back, as too like another package's - and the command it puts on your PATH is `turri`. `npm install -g @turri-dev/cli@next` gets the latest prerelease instead, built from the last commit on `main`. Installed again - `@latest` or `@next` - it replaces the one there. `turri --version` says which turri runs, and the core and the [pi](https://pi.dev) under it: `turri 0.2.0 (core 0.2.0; pi 1.6.0)`, and from a clone the commit too.
24
24
 
25
25
  ## pi packages
26
26
 
@@ -64,13 +64,15 @@ From 0.2.1 on, turri says so itself: its banner warns, as it starts, when a newe
64
64
  To work on turri itself, put the clone on your PATH instead:
65
65
 
66
66
  ```bash
67
- git clone git@github.com:turri-oss/turri.git && cd turri
67
+ git clone git@github.com:turri-oss/turri-cli.git && cd turri-cli
68
68
  npm install
69
69
  npm link # puts `turri` on your PATH, pointing at this clone
70
70
  ```
71
71
 
72
72
  A clone runs its TypeScript sources directly - Node strips the types - so edits take effect immediately. The package on npm runs JavaScript compiled from them instead (`npm run build`, into `dist/`, run by `npm pack` and `npm publish` before they pack), as Node runs no `.ts` file inside a `node_modules`. `bin/turri.mjs` runs `src/` where there is one, and `dist/` otherwise.
73
73
 
74
+ To use a local `@turri-dev/core`, including before the matching core release is on npm, follow [linked development](development.md#linked-development) in place of `npm install`.
75
+
74
76
  To update, `git pull` and `npm install` - the second picks up a dependency that changed, [pi](https://pi.dev)'s say. `npm link` needs running only once. A **turri** already running keeps the code it started with: start it again to run what you pulled.
75
77
 
76
78
  ## In Docker
@@ -100,7 +102,7 @@ In a project - a folder with `config.turri.yaml` (or the old `config.yaml`) or `
100
102
  | the AWS region | for a project whose models are on Amazon Bedrock: the region they are called in, and where it comes from - turri's, set for the geography they need; the person's `AWS_REGION`; the profile's - and wrong when the person's is outside that geography, or the models need two regions, which one `AWS_REGION` cannot serve |
101
103
  | the models | each model `config.turri.yaml` names - `harness-model`, `coding-model`, `judge-model`, every role under `models:` - sent one short request through [pi](https://pi.dev), with the credentials turri's agents will use, for any provider [pi](https://pi.dev) supports. One that answers is ready; for one that does not, it says what the provider said and what to do: the credentials [pi](https://pi.dev) reads for that provider (`AWS_PROFILE` and `AWS_REGION` for Amazon Bedrock, `OPENAI_API_KEY`, `/login`, ...), model access in the Bedrock console, the closest model ids [pi](https://pi.dev) knows for one it does not. `--harness-model`, `--coding-model` (`--model`) and `--judge-model` name models as the config's keys, as `turri regenerate` reads them - checked in a project or not. `--no-models` skips it |
102
104
 
103
- Removing that file is the one thing `doctor` changes, and it asks first; `turri doctor --yes` says yes. Run without a terminal - piped, or in CI - it asks nothing and changes nothing. Run it again whenever something breaks; `turri doctor --no-models` leaves out the models' requests. In the chat, ask for a self check: the `doctor` tool runs the same checks, the models only when you ask. A host - a desktop app - runs the same checks through `doctor` and shows them itself (see [doctor in a host](hosting.md#doctor-in-a-host)).
105
+ Removing that file is the one thing `doctor` changes, and it asks first; `turri doctor --yes` says yes. Run without a terminal - piped, or in CI - it asks nothing and changes nothing. Run it again whenever something breaks; `turri doctor --no-models` leaves out the models' requests. In the chat, ask for a self check: the `doctor` tool runs the same checks, the models only when you ask. A host - a desktop app - runs the same checks through the core's `doctor` and shows them itself (see [the core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md)); what is the CLI's own - its version, the turris on the PATH, an older turri's file in every pi - is `turri doctor`'s alone.
104
106
 
105
107
  The chat is told every turn which wall is up and what the project's modules need of this machine that it lacks. What they need is worked out from all the project's \*\*\*plain - seconds, on a project of long requires chains - so it is worked out when the first turn asks - not as the chat opens - and again after a turn in which \*\*\*plain changed, never while your message waits: a turn is told what was known last.
106
108
 
package/docs/launch.md CHANGED
@@ -47,7 +47,7 @@ A project's launches are of several codebases: the modules of a `requires` chain
47
47
 
48
48
  - **Up a chain, the newer module replaces the one below.** A launch stops what launches of every module below it in its `requires` chain started, as it stops what the last launch of its own codebase started: their code is in it, an older build of the same app. That is everything they started - a server on the same port, one on another, a worker - whatever it holds. What an earlier turri left running of them is stopped too. A launch of a module below it under way is waited for - it ends, and the newer one starts and stops what it started; one waiting is never launched (`superseded`). So whichever pulse lands, the newest build of the chain is what runs - and nothing older answers at its URL, even when the newer one does not come up.
49
49
  - **Side by side, what does not get in the way runs on.** What turri's launches of any other module started - a branch beside it - is left running, unless it holds what this launch needs: then turri stops it, and this launch takes it. A port the harness sees itself, as `activate` starts the server. Anything else - a socket, a lock or pid file, a container name, a database kept open - the launch agent finds in what failed (its output, `lsof`, `ps`), and frees with `stop_launched`, naming a pid of it and what it holds. Either way turri stops only what its own records say one of its launches started.
50
- - **Said, every time.** A launch whose servers were stopped this way is replaced: a host hears it again (`onLaunch`), with `replacedBy` the newer launch's id - nothing of it runs, and its codebase's code, for a module below, is what the newer launch runs. What the newer launch stopped is kept on it apart from what its agent said - `stopped`, an entry a process with why, whose launch, module, commit, pid and address, for a host to show beside it ([hosting](hosting.md)) - and what the chat and the terminal are told begins with a line for each - `Stopped what bestiary's launch launch-17 at befa07f started - bestiary (pid 96379, http://localhost:5173): upgrades is built on bestiary and holds its code, so this launch takes its place.`, or `Stopped server (pid 96379, http://localhost:5173), from web's launch launch-4 at 1a2b3c4: it held port 5173, which cli needs.` - and the ledger has `launch.freed` and `launch.replaced`.
50
+ - **Said, every time.** A launch whose servers were stopped this way is replaced: a host hears it again (`onLaunch`), with `replacedBy` the newer launch's id - nothing of it runs, and its codebase's code, for a module below, is what the newer launch runs. What the newer launch stopped is kept on it apart from what its agent said - `stopped`, an entry a process with why, whose launch, module, commit, pid and address, for a host to show beside it ([the core's interface](https://github.com/turri-oss/turri-core/blob/main/docs/core.md)) - and what the chat and the terminal are told begins with a line for each - `Stopped what bestiary's launch launch-17 at befa07f started - bestiary (pid 96379, http://localhost:5173): upgrades is built on bestiary and holds its code, so this launch takes its place.`, or `Stopped server (pid 96379, http://localhost:5173), from web's launch launch-4 at 1a2b3c4: it held port 5173, which cli needs.` - and the ledger has `launch.freed` and `launch.replaced`.
51
51
 
52
52
  The [sentinel](sentinel.md) tests a pulse of a module below in the launch of the module built on it that replaced its own: that launch holds its commit, as the module started from that code.
53
53
 
package/docs/sentinel.md CHANGED
@@ -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. Read the conclusion in notifications, or ask your chat about it.
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
 
@@ -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