@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
package/dist/sentinel.js DELETED
@@ -1,601 +0,0 @@
1
- import { appendFileSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
2
- import { basename, join, resolve } from "node:path";
3
- import { load as loadYaml } from "js-yaml";
4
- import { defineTool } from "@earendil-works/pi-coding-agent";
5
- import { Type } from "typebox";
6
- import { readConfigFile, readProjectConfig } from "./config.js";
7
- import { confinedTools } from "./regenerate/confine.js";
8
- import { describeSpecConflict } from "./regenerate/stop-report.js";
9
- import { didNotPass } from "./regenerate/job-panel.js";
10
- import { formatDuration, pulseName } from "./regenerate/jobs.js";
11
- import { readLedger } from "./regenerate/ledger.js";
12
- import { describePulseView, pulseView } from "./regenerate/ledger-view.js";
13
- import { MODULES_DIR, ensureInScratch } from "./regenerate/paths.js";
14
- import { describeHolder, howToFree, launchLogDir, listenersOf, whoHolds } from "./regenerate/launch.js";
15
- import { projectDirOf } from "./regenerate/paths.js";
16
- import { LAUNCHED_ONLY, launchedDir, whatRuns } from "./launch-session.js";
17
- import { launchText } from "./launch-track.js";
18
- import { SENTINEL, SENTINEL_START, wentWrong } from "./notice.js";
19
- export * from "./notice.js";
20
- /**
21
- * The sentinel: a chat of the session's own that every finished pulse goes to (docs/sentinel.md). It checks how each
22
- * pulse went - and, with `launch-after-pulse` on, tests what was launched - finds out why when something is wrong, and
23
- * puts it to the person as a notice in the chat they look at, with what they can do about it. It changes nothing: its
24
- * file tools only read, its shell runs with the project read only, and it has none of the tools that change ***plain or
25
- * start work. The chat the person talks to is never interrupted for a pulse that went well.
26
- */
27
- /** Whether the project wants a sentinel: `sentinel:` in config.turri.yaml - true, false, or ask, as it is unset. */
28
- export function sentinelSetting(cwd) {
29
- try {
30
- return readProjectConfig(cwd).sentinel ?? "ask";
31
- }
32
- catch {
33
- return "ask";
34
- }
35
- }
36
- /**
37
- * What the person is asked before the sentinel first opens in a session, under `sentinel: ask`, in one sentence: the pulse
38
- * - or the host's check - that would open it and what it does - so a tab that starts working on its own is not a surprise
39
- * - and whether to start it.
40
- */
41
- export function sentinelStartNotice(about, cwd) {
42
- let launched = false;
43
- try {
44
- launched = readProjectConfig(cwd).launchAfterPulse === true;
45
- }
46
- catch {
47
- /* a config that cannot be read launches nothing */
48
- }
49
- const what = `a background tab that reviews each finished pulse${launched ? " and tries to use what was launched" : ""}`;
50
- if (!("kind" in about)) {
51
- return {
52
- kind: "sentinel-start",
53
- severity: "info",
54
- summary: `Checking ${about.funcIds.join(", ")} of ${about.module} needs the sentinel, ${what} - start it?`,
55
- evidence: [],
56
- actions: [
57
- { label: SENTINEL_START.start, task: "The sentinel is started for this session: this check, and each pulse after it, go to it." },
58
- { label: SENTINEL_START.always, task: "The sentinel is started, and sentinel: true written to config.turri.yaml: it opens without asking from now on." },
59
- { label: SENTINEL_START.notNow, task: "No sentinel this session: the check is not done. turri asks again next time." },
60
- { label: SENTINEL_START.never, task: "sentinel: false written to config.turri.yaml: no sentinel, and no asking." },
61
- ],
62
- module: about.module,
63
- check: about.id,
64
- };
65
- }
66
- const job = about;
67
- return {
68
- kind: "sentinel-start",
69
- severity: "info",
70
- summary: `${pulseName(job)} finished - start the sentinel, ${what}?`,
71
- evidence: [],
72
- actions: [
73
- { label: SENTINEL_START.start, task: "The sentinel is started for this session: this pulse and each after it go to it." },
74
- { label: SENTINEL_START.always, task: "The sentinel is started, and sentinel: true written to config.turri.yaml: it opens without asking from now on." },
75
- { label: SENTINEL_START.notNow, task: "No sentinel this session: each pulse is told to the chat that asked for it. turri asks again next time." },
76
- { label: SENTINEL_START.never, task: "sentinel: false written to config.turri.yaml: no sentinel, and no asking." },
77
- ],
78
- job: job.id,
79
- ...(job.pulse !== undefined ? { pulse: job.pulse } : {}),
80
- };
81
- }
82
- /** A pulse that stopped on ***plain that contradicts itself: put to the person by turri itself, the way out the chat's to work out. */
83
- export function specConflictNotice(job, task) {
84
- return {
85
- severity: "warning",
86
- summary: `${pulseName(job)} stopped: two functional specs contradict each other`,
87
- evidence: describeSpecConflict(job.specConflict).split("\n").filter((line) => line.trim() !== ""),
88
- actions: [{ label: "Work out the conflict with me", task }],
89
- ...(job.module !== undefined ? { module: job.module } : {}),
90
- job: job.id,
91
- ...(job.pulse !== undefined ? { pulse: job.pulse } : {}),
92
- };
93
- }
94
- // ---------------------------------------------------------------------------------------------
95
- // The person's guidance: what they told the sentinel, kept apart from its conversation.
96
- export function guidanceFile(cwd) {
97
- const scratch = join(cwd, ".turri");
98
- ensureInScratch(scratch, scratch);
99
- return join(scratch, "sentinel.md");
100
- }
101
- export function readGuidance(cwd) {
102
- try {
103
- const file = join(cwd, ".turri", "sentinel.md");
104
- return existsSync(file) ? readFileSync(file, "utf8").trim() : "";
105
- }
106
- catch {
107
- return "";
108
- }
109
- }
110
- export function keepGuidance(cwd, text) {
111
- const line = text.replace(/\s+/g, " ").trim();
112
- if (line === "")
113
- return;
114
- appendFileSync(guidanceFile(cwd), `- ${line} (${new Date().toISOString().slice(0, 16).replace("T", " ")})\n`);
115
- }
116
- // ---------------------------------------------------------------------------------------------
117
- // What the sentinel is told.
118
- /**
119
- * What a chat of the person's is told of the pulses that end: told itself, of those asked for in it - or, with the
120
- * sentinel on, nothing, the sentinel telling the person what needs them.
121
- */
122
- export function pulseEndsBlock(sentinel, terminal = false) {
123
- if (sentinel && terminal)
124
- return "<pulse-ends>\nThe sentinel checks finished pulses. Their results, its conclusions and its notices go to the notification centre (/notifications). Do not announce them here. Answer if the person asks; when they accept a notice's action, do the task you are given.\n</pulse-ends>";
125
- return sentinel
126
- ? [
127
- "<pulse-ends>",
128
- "The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was launched.",
129
- "When a pulse lands, the chat the person is in is told, to tell them it landed and what the sentinel does with it -",
130
- "and nothing more: the pulse is the sentinel's. A pulse that went wrong you are not told of. What needs the person, the",
131
- "sentinel puts to them as a notice in the chat they are in: what is wrong, and what can be done. When they accept",
132
- "one, you are given it, and what they chose: do it.",
133
- "</pulse-ends>",
134
- ].join("\n")
135
- : "<pulse-ends>\nWhen a pulse asked for in this chat ends, you are told, and react to it.\n</pulse-ends>";
136
- }
137
- /**
138
- * What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
139
- * does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
140
- * launched in the background, and the sentinel tests it once it runs.
141
- */
142
- export function landedNote(job, options = {}) {
143
- const launching = options.launching === true;
144
- // The host showed the person the pulse's end itself: what happened, for when they ask - nobody is told anything now.
145
- if (options.shown === true) {
146
- return [
147
- `Pulse ${job.id} - ${pulseName(job)} - landed, after ${formatDuration(job)}.`,
148
- "",
149
- (job.report ?? "").trim(),
150
- "",
151
- `The sentinel - a chat of my own beside this one - checks it${launching ? ", once it is launched, in the background, and tests what runs" : ""}; the person was shown that it landed. The pulse is the sentinel's: nothing is to be tested, launched, opened or run for it here.`,
152
- ].join("\n");
153
- }
154
- return [
155
- `Pulse ${job.id} - ${pulseName(job)} - landed, after ${formatDuration(job)}.`,
156
- "",
157
- (job.report ?? "").trim(),
158
- "",
159
- `${launching ? "It is being launched in the background, and the sentinel" : "The sentinel"} - a chat of my own beside this one - checks it${launching ? " and tests what runs once it is up" : " now"}. If it finds something wrong, it puts it to the person in the chat they are in, with what can be done; when it is done, you are told.`,
160
- "",
161
- `Tell the person, in a line or two, what landed and that the sentinel is checking it${launching ? " - and tests it once it is launched" : ""}. Do nothing else about it: the pulse is the sentinel's now. Do not test it, launch it, open it, run anything for it, or start other work because of it - whatever the project's guidance says to do when a pulse finishes.`,
162
- ].join("\n");
163
- }
164
- /**
165
- * Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
166
- * watches it, in the host's words - stands in place of their not watching, and has it try what is launched with the host's tools.
167
- */
168
- export function sentinelPrompt(cwd, options = {}) {
169
- const guidance = readGuidance(cwd);
170
- const tools = options.extraTools ?? [];
171
- const surface = options.surface?.trim() ?? "";
172
- const theirs = tools.length > 0 ? tools.join(", ") : "the host's tools";
173
- return [
174
- "<sentinel>",
175
- "You are turri's sentinel: a chat of turri's own, beside the chats the person talks to while they build their software",
176
- "with turri. Every pulse that finishes comes to you, each in a conversation of its own - and functional specs the person",
177
- "asks you to check. This conversation is for the pulse, or the check, in the message turri writes first. For a pulse:",
178
- "what it was, how it ended,",
179
- ...(surface === ""
180
- ? ["its ***plain diff, its log, and what was launched. The person does not watch you: they are in another chat, and", "hear from you only through notify_person."]
181
- : [
182
- "its ***plain diff, its log, and what was launched. The person can watch you try it, where the host shows it;",
183
- "they talk to you in another chat, and hear what you find only through notify_person.",
184
- ]),
185
- "",
186
- "For the pulse:",
187
- "1. Check how it went, from what turri tells you - and, when that is not enough, the pulse in full (pulses with its id),",
188
- " its log, and the code and the ***plain, which you read.",
189
- "2. When it was launched (the message says so - launch-after-pulse is on), test it: it is running where the message",
190
- " says - a launch that holds the pulse's commit, and the pulses after it the message names. Test what the message",
191
- " says this pulse changed - what a later pulse changed again is that pulse's to test. How far you test is yours to",
192
- " judge, from what the pulse changed and what the ***plain says",
193
- " it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
194
- " one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
195
- " different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
196
- " alphabetically tells \"first in the file\" from nothing.",
197
- "3. When something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software",
198
- " does not do what its ***plain says - find out why. Then:",
199
- " - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
200
- " toolchain folders the agents may read (toolchains:) - fix it yourself, with edit: a script calling python3 where",
201
- " this machine has python of the version the ***plain names, a path that moved, a flag the tool's version does not",
202
- " take. Check what you rely on in your shell first (`command -v python`, `python --version`). Then call resume for",
203
- " the module, so the work runs again with the fix - and notify_person once, fixed: true, severity info, no actions:",
204
- " what you changed and why, the lines before and after in the evidence.",
205
- " - Anything else, call notify_person once: what is wrong, what shows it, and what the person can do about it, each",
206
- " a task the agent of their chat can carry out once they accept it - a change to the ***plain, a credential to",
207
- " provide, a pulse to regenerate again. Be exact: the task is all that agent is given. What the machine lacks - a",
208
- " toolchain, a tool, a system library - and any setting of the machine's or the person's shell: say exactly what",
209
- " the person runs themselves (`brew install node`), and make the action resuming once they have.",
210
- " When it is a gap in the ***plain the build settled with an assumption - something the person may reasonably leave",
211
- " as it is - say so with ignorable: the gap in the summary, what the build does in the evidence. Never for",
212
- " something broken, a pulse that went wrong, or a launch that did not come up.",
213
- "4. When all is well, notify no one.",
214
- "5. Last, call conclude once for it - holds or wrong, and in a line or two what you checked and what you found:",
215
- " the chat the person is in is told, whether all is well or not. Then say the same here, in a line or two.",
216
- "",
217
- "For a check: the person picked functional specs of a module for you to test in what is launched of it, which runs where the",
218
- "message says. Test those - what each says and its scenarios - not the module's other functional specs. Notify the",
219
- "person of what does not do what its ***plain says, as for a pulse, and call conclude once for the check, by its id.",
220
- "",
221
- "You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
222
- "testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
223
- "the project read only; the files you try a launch with go in $TMPDIR - /tmp is outside what it may write. It sees no",
224
- "other process: ps and lsof do not run there - who_holds says what holds a port and whose it is. You never change ***plain - it is the person's intent, never yours to fix - and never",
225
- "launch, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
226
- "its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
227
- "never ask the person questions - a notice is how you reach them.",
228
- "",
229
- "The person can talk to you here. When they tell you how to check - what to test, what to leave alone, where things",
230
- "run - keep it with keep_guidance, in their words, so it holds from now on: this conversation ends with its pulse,",
231
- "and the next pulse's starts afresh, with only what you kept. What the person chose to leave as the build has it is",
232
- "in your guidance too: do not raise it again, unless the build no longer does what they accepted.",
233
- ...(surface !== ""
234
- ? [
235
- "",
236
- "Where the person watches you, in the host's words:",
237
- "<surface>",
238
- surface,
239
- "</surface>",
240
- `Try what is launched with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
241
- "codes, files.",
242
- ]
243
- : tools.length > 0
244
- ? ["", `The host gives you ${theirs} to test with as well.`]
245
- : []),
246
- "</sentinel>",
247
- ...(guidance !== "" ? ["", "<guidance>", "What the person told you to keep in mind:", guidance, "</guidance>"] : []),
248
- ].join("\n");
249
- }
250
- /** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
251
- export function sentinelBrief(job, context) {
252
- const view = (() => {
253
- try {
254
- const entries = readLedger(context.project, { job: job.id });
255
- const found = pulseView(job.id, entries);
256
- return found !== undefined ? describePulseView(found) : undefined;
257
- }
258
- catch {
259
- return undefined;
260
- }
261
- })();
262
- const ended = job.status === "succeeded"
263
- ? didNotPass(job)
264
- ? "ran to its end, and what it built did not pass"
265
- : "finished, and landed what it built"
266
- : job.status === "stopped"
267
- ? "was stopped"
268
- : "failed";
269
- const lines = [`Pulse ${job.id} - ${pulseName(job)} - ${ended}, after ${formatDuration(job)}.`];
270
- if (context.asked !== undefined)
271
- lines.push(`It was asked for in the chat "${context.asked}".`);
272
- if (context.focused !== undefined)
273
- lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
274
- lines.push("", job.status === "succeeded" ? (job.report ?? "").trim() : (job.error ?? job.note ?? "").trim());
275
- if (view !== undefined)
276
- lines.push("", "What the ledger has of it:", view);
277
- else if (job.diff !== undefined && job.diff.trim() !== "")
278
- lines.push("", "Its ***plain diff:", job.diff.trimEnd());
279
- if (job.logFile !== undefined)
280
- lines.push("", `Its log: ${job.logFile}`);
281
- if (job.status === "succeeded" && !didNotPass(job))
282
- lines.push("", ...launchLines(job, context.launch));
283
- if (job.specConflict !== undefined) {
284
- lines.push("", "It stopped on two functional specs that contradict each other: turri has put that to the person itself. Notify no one about it.");
285
- }
286
- else if (wentWrong(job)) {
287
- lines.push("", "It went wrong: find out why. A testing script, or where the config says the scripts are, is yours to fix - then resume", "the module, and tell the person what you changed. Anything else, notify the person. What the chat would have been told", "to do about it - each step of it that is not a fix to the tooling is a task for a notice's action, not yours, and an", "install is never anyone's but the person's:", context.reaction);
288
- }
289
- lines.push("", `When you are done with it, call conclude for ${job.id} - whether all is well or not.`);
290
- return lines.join("\n");
291
- }
292
- /** What runs for a pulse that landed, as the sentinel is told it: the launch that holds its commit, or why there is none to test. */
293
- function launchLines(job, launch) {
294
- const spec = (each) => `${each.module}:${each.funcId}`;
295
- if (launch.off === true)
296
- return [`${launch.commit !== undefined ? `Its commit is ${launch.commit.slice(0, 7)}. ` : ""}launch-after-pulse is off: nothing was launched, and you test nothing running - check the pulse alone.`, LAUNCHED_ONLY];
297
- if (launch.commit === undefined)
298
- return ["Nothing was launched for it: turri has no commit it landed - check the pulse alone.", LAUNCHED_ONLY];
299
- const commit = launch.commit.slice(0, 7);
300
- if (launch.notAsked !== undefined)
301
- return [`Its commit is ${commit}. Its launch could not be asked for: ${launch.notAsked}`, "That is what you find out about: the launch did not come up.", LAUNCHED_ONLY];
302
- if (launch.stopped === true || launch.launch === undefined)
303
- return [`Its commit is ${commit}. The person stopped its launch: nothing of it runs - check the pulse alone.`, LAUNCHED_ONLY];
304
- const what = launch.launch;
305
- const later = launch.later.map((other) => `${other.id} (${pulseName(other)})`);
306
- const lines = [
307
- `Its commit is ${commit}. It was launched in the background (launch-after-pulse): what runs is ${what.codebase} at ${what.short} (${what.id}), which holds it${what.codebase !== job.module && job.module !== undefined ? ` - ${what.codebase} is built on ${job.module}, and holds its code` : ""}${later.length > 0 ? ` and the pulses that landed after it - ${later.join(", ")}` : ""}.`,
308
- ];
309
- if (what.status === "failed") {
310
- lines.push(`That launch did not come up: ${launchText(what) || "the launch agent did not say why"}`, "That is what you find out about: the launch did not come up. Test nothing in its place.", LAUNCHED_ONLY);
311
- return lines;
312
- }
313
- lines.push("What runs now:", ...whatRuns(launch.running, launchedDir(what)), LAUNCHED_ONLY);
314
- if (launch.laterSpecs.length > 0) {
315
- lines.push(`Test what this pulse changed - but not ${launch.laterSpecs.map(spec).join(", ")}: a later pulse changed ${launch.laterSpecs.length === 1 ? "it" : "them"} again, and its check tests ${launch.laterSpecs.length === 1 ? "it" : "them"}.`);
316
- }
317
- else
318
- lines.push("Test what this pulse changed.");
319
- return lines;
320
- }
321
- /**
322
- * What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
323
- * functional specs to test, with what each says and its scenarios, as turri reads them now.
324
- */
325
- export function sentinelCheckBrief(check, context) {
326
- const lines = [
327
- `Check ${check.id}: the person asked you to check ${check.funcIds.length === 1 ? "a functional spec" : `${check.funcIds.length} functional specs`} of ${check.module}, in what is launched of it.`,
328
- ];
329
- if (context.focused !== undefined)
330
- lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
331
- lines.push("", `What is launched of ${check.module} holds its code and that of every module its requires chain builds on${context.commit !== undefined ? `, at its commit ${context.commit}` : ""} - a commit that landed whole, never what a pulse is writing now.${context.failed !== undefined ? "" : " What runs now:"}`, ...(context.failed !== undefined
332
- ? [
333
- `Its last launch, ${context.failed.id}, did not come up: ${context.failed.summary ?? "the launch agent did not say why"}`,
334
- "That is what you find out about: the launch did not come up. Test nothing in its place.",
335
- ]
336
- : whatRuns(context.running, context.dir)), LAUNCHED_ONLY, "", `Test these functional specs of ${check.module} - only these, not its others, though they run too:`);
337
- for (const spec of context.specs) {
338
- lines.push("", `# ${spec.funcId}`, spec.text);
339
- for (const [title, scenarios] of [["Conformance scenarios", spec.conformance], ["Acceptance scenarios", spec.acceptance]]) {
340
- if (scenarios.length === 0)
341
- continue;
342
- lines.push(`${title}:`, ...scenarios.map((scenario) => `- ${scenario.id}: ${scenario.text.replace(/\n+/g, " ")}`));
343
- }
344
- }
345
- lines.push("", "How far you test each is yours to judge, from what it says and its scenarios. When one does not do what its ***plain says, find out why and notify the person, as for a pulse, naming the check.", `When you are done, call conclude for check ${check.id} - whether all is well or not.`);
346
- return lines.join("\n");
347
- }
348
- // ---------------------------------------------------------------------------------------------
349
- // Its tools.
350
- /**
351
- * The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
352
- * notices and its guidance - and what a host gives it.
353
- */
354
- export const SENTINEL_TOOLS = ["read", "ls", "grep", "find", "write", "edit", "bash", "read_output", "pulses", "parse", "doctor", "web_search", "web_fetch", "resume", "notify_person", "conclude", "keep_guidance", "who_holds"];
355
- /** A testing script by its name - `run_unittests_python.sh`, `prepare_environment_node.sh` - and a config file of turri's. */
356
- const SCRIPT_FILE = /^(run_|prepare_environment).*\.(sh|ps1|bat|cmd)$/;
357
- const CONFIG_FILE_NAME = /^config\.turri(\..+)?\.yaml$/;
358
- /** The keys of config.turri.yaml the sentinel may change: where the testing scripts are, and the toolchains' folders. */
359
- export const SENTINEL_CONFIG_KEYS = ["unittests-script", "conformance-tests-script", "prepare-environment-script", "toolchains"];
360
- /**
361
- * The project's tooling, which the sentinel fixes itself: its testing scripts - `test_scripts/`, a `run_*.sh` or
362
- * `prepare_environment*.sh` at its root, and each script its config names - and its `config.turri*.yaml` files. In the
363
- * project, and in a project one folder down (***plain kept in plain/). Never a .plain file: the ***plain is the person's.
364
- */
365
- export function sentinelTooling(cwd) {
366
- const root = resolve(cwd);
367
- const projects = [root, ...listDirs(root).filter((dir) => listFiles(dir).some((name) => CONFIG_FILE_NAME.test(name)))];
368
- return [
369
- ...new Set(projects.flatMap((project) => {
370
- const configs = listFiles(project).filter((name) => CONFIG_FILE_NAME.test(name));
371
- const named = configs.flatMap((name) => {
372
- const config = readConfigFile(join(project, name));
373
- return [config.unittestsScript, config.conformanceTestsScript, config.prepareEnvironmentScript].filter((path) => typeof path === "string").map((path) => resolve(project, path));
374
- });
375
- return [
376
- join(project, "test_scripts"),
377
- ...listFiles(project).filter((name) => SCRIPT_FILE.test(name)).map((name) => join(project, name)),
378
- ...configs.map((name) => join(project, name)),
379
- ...named,
380
- ];
381
- })),
382
- ].filter((path) => !path.endsWith(".plain"));
383
- }
384
- function listFiles(dir) {
385
- try {
386
- return readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => entry.name);
387
- }
388
- catch {
389
- return [];
390
- }
391
- }
392
- function listDirs(dir) {
393
- try {
394
- return readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== MODULES_DIR && entry.name !== "node_modules").map((entry) => join(dir, entry.name));
395
- }
396
- catch {
397
- return [];
398
- }
399
- }
400
- /**
401
- * Its file tools and shell: the whole project to read, and to write only its tooling (`sentinelTooling`) - in a config
402
- * file, only the keys of SENTINEL_CONFIG_KEYS. Its shell runs behind the command check, the OS sandbox where one is up,
403
- * and the audit, with the project read only and the network open - and changes nothing of the machine's. Its home and
404
- * temporary folder are its own, in the modules' scratch.
405
- */
406
- export function sentinelFileTools(cwd) {
407
- const tooling = sentinelTooling(cwd);
408
- const { tools } = confinedTools({ workdir: cwd, read: [cwd], write: tooling, shellHome: join(cwd, MODULES_DIR, `.${SENTINEL}`), fixesScripts: true });
409
- const shell = confinedTools({ workdir: cwd, read: [cwd], write: [], shellHome: join(cwd, MODULES_DIR, `.${SENTINEL}`) }).tools;
410
- return tools.map((tool) => {
411
- // Its shell writes nothing in the project: only write and edit reach the tooling.
412
- if (tool.name === "bash")
413
- return shell.find((each) => each.name === "bash");
414
- if (tool.name !== "write" && tool.name !== "edit")
415
- return tool;
416
- return {
417
- ...tool,
418
- async execute(toolCallId, params, signal, onUpdate, ctx) {
419
- const path = resolve(cwd, String(params.path ?? ""));
420
- if (!CONFIG_FILE_NAME.test(basename(path)))
421
- return tool.execute(toolCallId, params, signal, onUpdate, ctx);
422
- // A config file: only where the testing scripts are, and the toolchains, may change - anything else is put back.
423
- const before = existsSync(path) ? readFileSync(path, "utf8") : undefined;
424
- const result = await tool.execute(toolCallId, params, signal, onUpdate, ctx);
425
- const changed = changedKeys(before ?? "", existsSync(path) ? readFileSync(path, "utf8") : "").filter((key) => !SENTINEL_CONFIG_KEYS.includes(key.replace(/_/g, "-")));
426
- if (changed.length > 0) {
427
- if (before === undefined)
428
- rmSync(path, { force: true });
429
- else
430
- writeFileSync(path, before);
431
- throw new Error(`Put back: in ${basename(path)} the sentinel changes only ${SENTINEL_CONFIG_KEYS.join(", ")} - not ${changed.join(", ")}. A setting of any other kind is the person's: put it to them with notify_person.`);
432
- }
433
- return result;
434
- },
435
- };
436
- });
437
- }
438
- /** The top-level keys whose values differ between two config texts - one that does not parse differing in every key. */
439
- function changedKeys(before, after) {
440
- const parse = (text) => {
441
- try {
442
- const value = loadYaml(text);
443
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : value === undefined || value === null ? {} : undefined;
444
- }
445
- catch {
446
- return undefined;
447
- }
448
- };
449
- const [was, now] = [parse(before), parse(after)];
450
- if (was === undefined || now === undefined)
451
- return ["the file as a whole - it no longer reads as YAML"];
452
- return [...new Set([...Object.keys(was), ...Object.keys(now)])].filter((key) => JSON.stringify(was[key]) !== JSON.stringify(now[key]));
453
- }
454
- export function notifyTool(notify) {
455
- return defineTool({
456
- name: "notify_person",
457
- label: "Notify",
458
- description: "Put what is wrong with a finished pulse to the person, in the chat they are in: what is wrong, what shows it, and what " +
459
- "they can do about it. Each action is a task the agent of their chat carries out once they accept it. Only when they " +
460
- "need to act - never for a pulse that went well - or, severity info and no actions, to say what you fixed yourself in " +
461
- "the testing scripts or their config, and why.",
462
- parameters: Type.Object({
463
- severity: Type.Union([Type.Literal("error"), Type.Literal("warning"), Type.Literal("info")], { description: "error: it is broken; warning: it works but not as its ***plain says, or something is missing; info: worth their knowing" }),
464
- summary: Type.String({ description: "What is wrong, in one line" }),
465
- evidence: Type.Array(Type.String(), { description: "What shows it, a line each: a step that failed, a log's lines, a request and its answer" }),
466
- actions: Type.Array(Type.Object({
467
- label: Type.String({ description: "What the person accepts, in a few words: \"Change the ***plain to …\", \"Regenerate fs 3 again\"" }),
468
- task: Type.String({ description: "Exactly what their chat's agent does once they accept it - all it is given" }),
469
- }), { description: "What can be done, the best first" }),
470
- module: Type.Optional(Type.String({ description: "The module it is about" })),
471
- pulse: Type.Optional(Type.String({ description: "The pulse's id" })),
472
- check: Type.Optional(Type.String({ description: "The check's id, when it is about a check the person asked for" })),
473
- fixed: Type.Optional(Type.Boolean({ description: "true when this says what you fixed yourself in a testing script or its config - severity info, no actions: a note, nothing to answer" })),
474
- ignorable: Type.Optional(Type.Boolean({
475
- description: "true when the person may reasonably leave it as the build has it, for good: chiefly a gap in the ***plain the build settled with an " +
476
- "assumption - then say the gap in the summary and what the build does in the evidence (the ***plain does not say what happens to " +
477
- "passwords over 72 bytes; the build refuses them with 422). Never for something broken, a pulse that went wrong, or a launch that did not come up.",
478
- })),
479
- }),
480
- async execute(_id, params) {
481
- const notice = notify({
482
- severity: params.severity,
483
- summary: params.summary,
484
- evidence: params.evidence,
485
- actions: params.actions,
486
- ...(params.ignorable === true ? { ignorable: true } : {}),
487
- ...(params.fixed === true ? { kind: "fixed" } : {}),
488
- ...(params.module !== undefined ? { module: params.module } : {}),
489
- ...(params.pulse !== undefined ? { job: params.pulse } : {}),
490
- ...(params.check !== undefined ? { check: params.check } : {}),
491
- });
492
- return {
493
- content: [{ type: "text", text: notice !== undefined ? `Put to the person, in the chat they are in (notice ${notice.id}).` : "There is no chat to put it in: say it here." }],
494
- details: { notice: notice?.id },
495
- };
496
- },
497
- });
498
- }
499
- export function concludeTool(conclude) {
500
- return defineTool({
501
- name: "conclude",
502
- label: "Conclude",
503
- description: "Say you are done with a pulse - or a check the person asked for - whether what you checked holds, and in a line or two what " +
504
- "you checked and found. The chat the person is in is told, whether all is well or not. Once a pulse or check, last - after " +
505
- "notify_person, when something is wrong. Name the pulse, or the check.",
506
- parameters: Type.Object({
507
- pulse: Type.Optional(Type.String({ description: "The pulse's id" })),
508
- check: Type.Optional(Type.String({ description: "The check's id, for a check the person asked for - in place of pulse" })),
509
- verdict: Type.Union([Type.Literal("holds"), Type.Literal("wrong")], { description: "holds: it does what its ***plain says; wrong: it does not, or it went wrong" }),
510
- summary: Type.String({ description: "What you checked and what you found, in a line or two: \"GET /api/ping answers pong; the new alias route redirects\"" }),
511
- }),
512
- async execute(_id, params) {
513
- if ((params.pulse === undefined) === (params.check === undefined))
514
- throw new Error("Name the pulse, or the check - one of them.");
515
- const chat = conclude({ ...(params.pulse !== undefined ? { job: params.pulse } : { check: params.check }), verdict: params.verdict, summary: params.summary });
516
- return {
517
- content: [{ type: "text", text: chat !== undefined ? "The chat the person is in is told." : "There is no chat to tell: say it here." }],
518
- details: {},
519
- };
520
- },
521
- });
522
- }
523
- /** What the chat the person is in is told when the sentinel is done with a pulse: to say so, and do nothing more. */
524
- export function concludedNote(conclusion, options = {}) {
525
- const about = conclusion.check !== undefined
526
- ? `the check you asked for${conclusion.module !== undefined ? ` of ${conclusion.module}` : ""}`
527
- : conclusion.module !== undefined
528
- ? `${conclusion.module}${conclusion.pulse !== undefined ? ` pulse ${conclusion.pulse}` : ""}`
529
- : `pulse ${conclusion.job}`;
530
- if (conclusion.verdict === "unchecked") {
531
- if (options.shown === true)
532
- return [`The sentinel did not do ${about} (${conclusion.check ?? conclusion.job}).`, conclusion.summary.trim()].join("\n");
533
- return [`The sentinel did not do ${about} (${conclusion.check ?? conclusion.job}).`, conclusion.summary.trim(), "", "Tell the person, in a line, that it was not checked and why. Do nothing else about it."].join("\n");
534
- }
535
- // The host showed the person the conclusion itself: what the sentinel found, for when they ask.
536
- if (options.shown === true) {
537
- return [
538
- `The sentinel is done with ${about} (${conclusion.check ?? conclusion.job}): ${conclusion.verdict === "holds" ? "it holds" : "something is wrong"}.`,
539
- conclusion.summary.trim(),
540
- ...(conclusion.verdict === "wrong" ? ["", "Its notice in this chat says what is wrong and what can be done; nothing is done about it until the person answers it."] : []),
541
- ].join("\n");
542
- }
543
- return [
544
- `The sentinel is done with ${about} (${conclusion.check ?? conclusion.job}): ${conclusion.verdict === "holds" ? "it holds" : "something is wrong"}.`,
545
- conclusion.summary.trim(),
546
- "",
547
- conclusion.verdict === "holds"
548
- ? "Tell the person, in a line, that the sentinel checked it and it holds - and what it checked. Do nothing else about it."
549
- : "Tell the person, in a line, that the sentinel found something wrong, and that its notice in this chat says what and what can be done. Do nothing else about it until they answer the notice.",
550
- ].join("\n");
551
- }
552
- /** Bring a module up again once the sentinel fixed what stopped its pulse: what is left there is regenerated, its scripts run. */
553
- export function resumeTool(resume) {
554
- return defineTool({
555
- name: "resume",
556
- label: "Resume",
557
- description: "Bring a module up again after you fixed what stopped its pulse - a testing script, a toolchains: entry: what is left to " +
558
- "regenerate there runs again, its testing scripts with it, as when the person asks for it. Only after a fix of yours, " +
559
- "never to try again what nothing was changed for. What it starts comes back to you as a pulse that finished.",
560
- parameters: Type.Object({ plain_file: Type.String({ description: "The module's .plain file, from the project's folder: app.plain" }) }),
561
- async execute(_id, params) {
562
- return { content: [{ type: "text", text: await resume(params.plain_file) }], details: {} };
563
- },
564
- });
565
- }
566
- /**
567
- * who_holds: what holds a TCP port, and whose it is - one of turri's launches, another turri's, or a program turri did not
568
- * start - as turri's records say it. The sentinel's shell is sandboxed from every other process, so it cannot ask itself.
569
- */
570
- export function whoHoldsTool(cwd) {
571
- return defineTool({
572
- name: "who_holds",
573
- label: "Who holds",
574
- description: "What listens on a TCP port on this machine, and whose it is: a server one of turri's launches started (which launch, " +
575
- "which module, which commit), one another turri started, or a program turri did not start - with how the person " +
576
- "frees it. Use it when what answers at a launch's URL is not what you expect, or nothing does: your shell cannot " +
577
- "see other processes. It stops nothing.",
578
- parameters: Type.Object({ port: Type.Integer({ minimum: 1, maximum: 65535, description: "The port, e.g. 8000" }) }),
579
- async execute(_id, params) {
580
- const pids = listenersOf(params.port);
581
- const text = pids === undefined
582
- ? `turri cannot tell what holds port ${params.port} here: there is no lsof.`
583
- : pids.length === 0
584
- ? `Nothing listens on port ${params.port}.`
585
- : [`Port ${params.port} is held by:`, ...pids.map((pid) => whoHolds(pid, launchLogDir(projectDirOf(join(cwd, "turri.plain"))))).map((holder) => `- ${describeHolder(holder)}. ${howToFree(holder)}`)].join("\n");
586
- return { content: [{ type: "text", text }], details: {} };
587
- },
588
- });
589
- }
590
- export function keepGuidanceTool(cwd) {
591
- return defineTool({
592
- name: "keep_guidance",
593
- label: "Keep guidance",
594
- description: "Keep what the person told you about how to check their software, in their words: it is in your prompt from now on, after you are closed and opened again too.",
595
- parameters: Type.Object({ text: Type.String({ description: "What to keep in mind, as they said it" }) }),
596
- async execute(_id, params) {
597
- keepGuidance(cwd, params.text);
598
- return { content: [{ type: "text", text: "Kept." }], details: {} };
599
- },
600
- });
601
- }
@@ -1,45 +0,0 @@
1
- import { type ExtensionAPI, type ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { type Setting } from "./config-edit.ts";
3
- /**
4
- * `/settings`: every setting of the project's config.turri.yaml from the chat - `/settings` alone lists them,
5
- * `/settings review` asks for review's value, `/settings review false` sets it. Each is written into the file
6
- * and takes effect as it says - now, at your next message, at the next pulse - never only once turri starts again:
7
- * what turri fixes at its start is changed live here (live). It takes pi's own /settings over (pi-settings.ts), whose
8
- * menu is its last entry.
9
- *
10
- * The chat's `settings` tool reads them and changes them as the person asks - into config.turri.yaml, or a module's
11
- * own config.turri.<module>.yaml - a model checked as it is written, by the name the person said. What is the person's
12
- * alone (`personOnly`) it refuses, and points to /settings.
13
- */
14
- /** What a change does to turri as it runs, beside the file: each says what it did, or nothing. */
15
- export interface LiveHooks {
16
- /** The chat's model is now this - provider/id:thinking - or, undefined, no longer set in the file. */
17
- chatModel(spec: string | undefined, ctx: ExtensionContext): Promise<string | undefined>;
18
- /** The coding model changed in the file: one given for this session - --coding-model - gives way to it. */
19
- codingModel(): string | undefined;
20
- /** How many pulses run at once: the number, or the machine's default. */
21
- parallelJobs(count: number | undefined): string | undefined;
22
- }
23
- export interface SettingsOptions {
24
- /** The folder whose config.turri.yaml the chat reads. */
25
- cwd: string;
26
- /** The ***plain rules there are, by name - what rules-off takes. */
27
- rules: () => string[];
28
- /** The chat's model, provider/id:thinking, after a change - read as the file has it now. */
29
- chatSpec: () => string | undefined;
30
- live: LiveHooks;
31
- }
32
- /** The models pi can reach here, signed in: provider/id - from a chat's context, the model registry the chats use. */
33
- export declare function reachable(ctx: ExtensionContext | undefined): string[];
34
- /**
35
- * Every value /settings offers for a setting after what is typed, in its order - "unset" left out, and uncapped: what
36
- * its completions show, the first of them, and what a host's settings list shows (host-session.ts `settingChoices`).
37
- * A model setting's are every model pi can reach, signed in - `models` - and after a colon, that model's thinking levels.
38
- */
39
- export declare function settingCandidates(setting: Setting, typed: string, where: {
40
- cwd: string;
41
- models: () => string[];
42
- }): string[];
43
- /** The ***plain rules there are, by name - what rules-off takes, and its values. */
44
- export declare function ruleNames(): string[];
45
- export declare function registerSettings(pi: ExtensionAPI, options: SettingsOptions): void;