@turri-dev/cli 0.4.3-next.8482fed → 0.4.3-next.8c1b0fa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (531) hide show
  1. package/README.md +22 -2
  2. package/dist/banner.js +248 -0
  3. package/dist/capture-cli.js +4 -4
  4. package/dist/capture-view.js +99 -0
  5. package/dist/chat-commands.js +6 -6
  6. package/dist/chat-models.js +17 -15
  7. package/dist/chat-tab-header.js +21 -9
  8. package/dist/chat-tabs.js +11 -7
  9. package/dist/chat-terminal.js +127 -64
  10. package/dist/chat-waiting.js +0 -20
  11. package/dist/cli-options.js +11 -7
  12. package/dist/cli-root.js +101 -0
  13. package/dist/cli.js +20 -26
  14. package/dist/conform-cli.js +4 -6
  15. package/dist/cultivate-cli.js +65 -97
  16. package/dist/doctor-cli.js +99 -0
  17. package/dist/drift-cli.js +2 -7
  18. package/dist/entry-renderers.js +107 -0
  19. package/dist/extension.js +14 -3344
  20. package/dist/init-config-cli.js +209 -0
  21. package/dist/launch-cli.js +55 -91
  22. package/dist/lineage-cli.js +2 -4
  23. package/dist/loop-cli.js +118 -237
  24. package/dist/panel-view.js +409 -0
  25. package/dist/parse-cli.js +5 -2
  26. package/dist/pi-launch.js +43 -13
  27. package/dist/pi-themes.js +21 -0
  28. package/dist/plain-code-blocks.js +1 -1
  29. package/dist/pointer-hover.js +4 -0
  30. package/dist/print-mode.js +20 -0
  31. package/dist/question-dialog.js +26 -3
  32. package/dist/quiet.js +7 -106
  33. package/dist/regenerate/diff-view.js +6 -87
  34. package/dist/regenerate/jobs-tree.js +2 -17
  35. package/dist/regenerate/side-panel.js +32 -5
  36. package/dist/regenerate/spec-map-view.js +3 -68
  37. package/dist/regenerate-cli.js +7 -11
  38. package/dist/reopen.js +40 -7
  39. package/dist/skill-progress.js +25 -0
  40. package/dist/skill-report.js +52 -0
  41. package/dist/terminal-marks.js +21 -0
  42. package/dist/terminal-notifications.js +219 -0
  43. package/dist/terminal-view.js +275 -0
  44. package/dist/turri-versions.js +64 -6
  45. package/docs/README.md +2 -2
  46. package/docs/capture.md +47 -11
  47. package/docs/chats.md +10 -7
  48. package/docs/claude-subscription.md +1 -1
  49. package/docs/config.md +11 -8
  50. package/docs/development.md +30 -64
  51. package/docs/headless.md +3 -1
  52. package/docs/hosting.md +3 -251
  53. package/docs/installation.md +4 -2
  54. package/docs/launch.md +3 -3
  55. package/docs/sandbox.md +2 -0
  56. package/docs/sentinel.md +13 -13
  57. package/docs/theming.md +2 -2
  58. package/docs/using.md +5 -5
  59. package/package.json +10 -28
  60. package/dist/ask.d.ts +0 -90
  61. package/dist/ask.js +0 -170
  62. package/dist/background-skills.d.ts +0 -56
  63. package/dist/background-skills.js +0 -129
  64. package/dist/bedrock-region.d.ts +0 -66
  65. package/dist/bedrock-region.js +0 -144
  66. package/dist/brand.d.ts +0 -13
  67. package/dist/btw.d.ts +0 -69
  68. package/dist/btw.js +0 -174
  69. package/dist/capture/agents.d.ts +0 -361
  70. package/dist/capture/agents.js +0 -332
  71. package/dist/capture/area.d.ts +0 -58
  72. package/dist/capture/area.js +0 -197
  73. package/dist/capture/assemble.d.ts +0 -122
  74. package/dist/capture/assemble.js +0 -452
  75. package/dist/capture/capture.d.ts +0 -116
  76. package/dist/capture/capture.js +0 -1228
  77. package/dist/capture/chat.d.ts +0 -29
  78. package/dist/capture/chat.js +0 -94
  79. package/dist/capture/checks.d.ts +0 -142
  80. package/dist/capture/checks.js +0 -643
  81. package/dist/capture/config.d.ts +0 -13
  82. package/dist/capture/config.js +0 -60
  83. package/dist/capture/interface.d.ts +0 -71
  84. package/dist/capture/interface.js +0 -199
  85. package/dist/capture/map.d.ts +0 -56
  86. package/dist/capture/map.js +0 -530
  87. package/dist/capture/progress.d.ts +0 -108
  88. package/dist/capture/progress.js +0 -234
  89. package/dist/capture/report.d.ts +0 -75
  90. package/dist/capture/report.js +0 -267
  91. package/dist/capture/scripts.d.ts +0 -26
  92. package/dist/capture/scripts.js +0 -33
  93. package/dist/capture/state.d.ts +0 -296
  94. package/dist/capture/state.js +0 -43
  95. package/dist/capture/trial.d.ts +0 -34
  96. package/dist/capture/trial.js +0 -89
  97. package/dist/capture-cli.d.ts +0 -1
  98. package/dist/chat-commands.d.ts +0 -17
  99. package/dist/chat-idle.d.ts +0 -7
  100. package/dist/chat-idle.js +0 -20
  101. package/dist/chat-models.d.ts +0 -22
  102. package/dist/chat-records.d.ts +0 -50
  103. package/dist/chat-records.js +0 -107
  104. package/dist/chat-scope.d.ts +0 -14
  105. package/dist/chat-scope.js +0 -15
  106. package/dist/chat-skills.d.ts +0 -17
  107. package/dist/chat-skills.js +0 -18
  108. package/dist/chat-tab-header.d.ts +0 -15
  109. package/dist/chat-tabs.d.ts +0 -20
  110. package/dist/chat-terminal.d.ts +0 -24
  111. package/dist/chat-ui.d.ts +0 -33
  112. package/dist/chat-waiting.d.ts +0 -67
  113. package/dist/chats.d.ts +0 -340
  114. package/dist/chats.js +0 -996
  115. package/dist/cli-options.d.ts +0 -24
  116. package/dist/cli.d.ts +0 -9
  117. package/dist/config-edit.d.ts +0 -83
  118. package/dist/config-edit.js +0 -391
  119. package/dist/config.d.ts +0 -428
  120. package/dist/config.js +0 -811
  121. package/dist/conform-cli.d.ts +0 -1
  122. package/dist/conformance-switch.d.ts +0 -25
  123. package/dist/conformance-switch.js +0 -86
  124. package/dist/cultivate-cli.d.ts +0 -1
  125. package/dist/doctor-tool.d.ts +0 -11
  126. package/dist/doctor-tool.js +0 -33
  127. package/dist/drift-cli.d.ts +0 -1
  128. package/dist/environment.d.ts +0 -37
  129. package/dist/environment.js +0 -109
  130. package/dist/extension.d.ts +0 -208
  131. package/dist/genome.d.ts +0 -77
  132. package/dist/genome.js +0 -288
  133. package/dist/graph.d.ts +0 -52
  134. package/dist/graph.js +0 -247
  135. package/dist/host-session.d.ts +0 -112
  136. package/dist/host-session.js +0 -103
  137. package/dist/host.d.ts +0 -40
  138. package/dist/host.js +0 -54
  139. package/dist/identity.d.ts +0 -7
  140. package/dist/identity.js +0 -75
  141. package/dist/init-config.d.ts +0 -169
  142. package/dist/init-config.js +0 -841
  143. package/dist/installed-providers.d.ts +0 -40
  144. package/dist/installed-providers.js +0 -98
  145. package/dist/jellyfish.d.ts +0 -40
  146. package/dist/judge.d.ts +0 -25
  147. package/dist/judge.js +0 -62
  148. package/dist/launch-agent.d.ts +0 -62
  149. package/dist/launch-agent.js +0 -339
  150. package/dist/launch-cli.d.ts +0 -1
  151. package/dist/launch-session.d.ts +0 -68
  152. package/dist/launch-session.js +0 -225
  153. package/dist/launch-tools.d.ts +0 -28
  154. package/dist/launch-tools.js +0 -72
  155. package/dist/launch-track.d.ts +0 -175
  156. package/dist/launch-track.js +0 -497
  157. package/dist/lineage-cli.d.ts +0 -1
  158. package/dist/loop-cli.d.ts +0 -35
  159. package/dist/loop-tools.d.ts +0 -103
  160. package/dist/loop-tools.js +0 -361
  161. package/dist/model-check.d.ts +0 -72
  162. package/dist/model-check.js +0 -162
  163. package/dist/module-report.d.ts +0 -9
  164. package/dist/new-project.d.ts +0 -10
  165. package/dist/new-project.js +0 -42
  166. package/dist/notice.d.ts +0 -115
  167. package/dist/notice.js +0 -61
  168. package/dist/parse-cli.d.ts +0 -1
  169. package/dist/parse-tool.d.ts +0 -9
  170. package/dist/parse-tool.js +0 -33
  171. package/dist/pi-launch.d.ts +0 -1
  172. package/dist/pi-settings.d.ts +0 -4
  173. package/dist/pi.d.ts +0 -248
  174. package/dist/pi.js +0 -889
  175. package/dist/picture-row.d.ts +0 -10
  176. package/dist/plain/check.d.ts +0 -63
  177. package/dist/plain/check.js +0 -236
  178. package/dist/plain/concepts.d.ts +0 -37
  179. package/dist/plain/concepts.js +0 -283
  180. package/dist/plain/cycles.d.ts +0 -21
  181. package/dist/plain/cycles.js +0 -190
  182. package/dist/plain/errors.d.ts +0 -26
  183. package/dist/plain/errors.js +0 -50
  184. package/dist/plain/files.d.ts +0 -47
  185. package/dist/plain/files.js +0 -161
  186. package/dist/plain/graph.d.ts +0 -107
  187. package/dist/plain/graph.js +0 -194
  188. package/dist/plain/highlight.d.ts +0 -43
  189. package/dist/plain/highlight.js +0 -196
  190. package/dist/plain/index.d.ts +0 -18
  191. package/dist/plain/index.js +0 -18
  192. package/dist/plain/liquid.d.ts +0 -22
  193. package/dist/plain/liquid.js +0 -124
  194. package/dist/plain/markdown.d.ts +0 -103
  195. package/dist/plain/markdown.js +0 -330
  196. package/dist/plain/module-concepts.d.ts +0 -32
  197. package/dist/plain/module-concepts.js +0 -80
  198. package/dist/plain/parser.d.ts +0 -163
  199. package/dist/plain/parser.js +0 -930
  200. package/dist/plain/plain.tmLanguage.json +0 -150
  201. package/dist/plain/project.d.ts +0 -48
  202. package/dist/plain/project.js +0 -155
  203. package/dist/plain/spec.d.ts +0 -152
  204. package/dist/plain/spec.js +0 -265
  205. package/dist/plain/stdlib.d.ts +0 -16
  206. package/dist/plain/stdlib.js +0 -48
  207. package/dist/plain/test-plain-file.d.ts +0 -59
  208. package/dist/plain/test-plain-file.js +0 -232
  209. package/dist/plain-code-blocks.d.ts +0 -14
  210. package/dist/plain-files.d.ts +0 -21
  211. package/dist/plain-files.js +0 -156
  212. package/dist/pointer-hover.d.ts +0 -12
  213. package/dist/question-dialog.d.ts +0 -55
  214. package/dist/questioning.d.ts +0 -55
  215. package/dist/questioning.js +0 -109
  216. package/dist/quiet.d.ts +0 -34
  217. package/dist/regenerate/activity.d.ts +0 -227
  218. package/dist/regenerate/activity.js +0 -250
  219. package/dist/regenerate/agent-env.d.ts +0 -51
  220. package/dist/regenerate/agent-env.js +0 -311
  221. package/dist/regenerate/agent-shell.d.ts +0 -54
  222. package/dist/regenerate/agent-shell.js +0 -121
  223. package/dist/regenerate/arbiter.d.ts +0 -68
  224. package/dist/regenerate/arbiter.js +0 -133
  225. package/dist/regenerate/audit.d.ts +0 -69
  226. package/dist/regenerate/audit.js +0 -212
  227. package/dist/regenerate/base-folder.d.ts +0 -70
  228. package/dist/regenerate/base-folder.js +0 -186
  229. package/dist/regenerate/cases.d.ts +0 -12
  230. package/dist/regenerate/cases.js +0 -149
  231. package/dist/regenerate/change-view.d.ts +0 -23
  232. package/dist/regenerate/change-view.js +0 -153
  233. package/dist/regenerate/chunk-plan.d.ts +0 -217
  234. package/dist/regenerate/chunk-plan.js +0 -937
  235. package/dist/regenerate/codebase.d.ts +0 -21
  236. package/dist/regenerate/codebase.js +0 -75
  237. package/dist/regenerate/command-check.d.ts +0 -66
  238. package/dist/regenerate/command-check.js +0 -577
  239. package/dist/regenerate/compaction.d.ts +0 -13
  240. package/dist/regenerate/compaction.js +0 -20
  241. package/dist/regenerate/confine.d.ts +0 -69
  242. package/dist/regenerate/confine.js +0 -311
  243. package/dist/regenerate/conform.d.ts +0 -66
  244. package/dist/regenerate/conform.js +0 -132
  245. package/dist/regenerate/conformance-agents.d.ts +0 -388
  246. package/dist/regenerate/conformance-agents.js +0 -1162
  247. package/dist/regenerate/conformance.d.ts +0 -191
  248. package/dist/regenerate/conformance.js +0 -1035
  249. package/dist/regenerate/conversation-writes.d.ts +0 -10
  250. package/dist/regenerate/conversation-writes.js +0 -100
  251. package/dist/regenerate/credentials.d.ts +0 -18
  252. package/dist/regenerate/credentials.js +0 -88
  253. package/dist/regenerate/debug-log.d.ts +0 -56
  254. package/dist/regenerate/debug-log.js +0 -236
  255. package/dist/regenerate/debugger.d.ts +0 -36
  256. package/dist/regenerate/debugger.js +0 -133
  257. package/dist/regenerate/delivery.d.ts +0 -2
  258. package/dist/regenerate/diagnose-job.d.ts +0 -2
  259. package/dist/regenerate/diagnose-job.js +0 -40
  260. package/dist/regenerate/diagnose.d.ts +0 -46
  261. package/dist/regenerate/diagnose.js +0 -92
  262. package/dist/regenerate/diff-view.d.ts +0 -64
  263. package/dist/regenerate/drift.d.ts +0 -120
  264. package/dist/regenerate/drift.js +0 -285
  265. package/dist/regenerate/environment-error.d.ts +0 -167
  266. package/dist/regenerate/environment-error.js +0 -342
  267. package/dist/regenerate/failure-reports.d.ts +0 -28
  268. package/dist/regenerate/failure-reports.js +0 -79
  269. package/dist/regenerate/job-log.d.ts +0 -30
  270. package/dist/regenerate/job-log.js +0 -105
  271. package/dist/regenerate/job-panel.d.ts +0 -122
  272. package/dist/regenerate/job-panel.js +0 -339
  273. package/dist/regenerate/jobs-tree.d.ts +0 -76
  274. package/dist/regenerate/jobs.d.ts +0 -231
  275. package/dist/regenerate/jobs.js +0 -522
  276. package/dist/regenerate/lanes.d.ts +0 -16
  277. package/dist/regenerate/lanes.js +0 -32
  278. package/dist/regenerate/launch.d.ts +0 -256
  279. package/dist/regenerate/launch.js +0 -689
  280. package/dist/regenerate/ledger-view.d.ts +0 -87
  281. package/dist/regenerate/ledger-view.js +0 -325
  282. package/dist/regenerate/ledger.d.ts +0 -368
  283. package/dist/regenerate/ledger.js +0 -357
  284. package/dist/regenerate/lineage.d.ts +0 -105
  285. package/dist/regenerate/lineage.js +0 -485
  286. package/dist/regenerate/list-arguments.d.ts +0 -21
  287. package/dist/regenerate/list-arguments.js +0 -121
  288. package/dist/regenerate/loop.d.ts +0 -423
  289. package/dist/regenerate/loop.js +0 -2087
  290. package/dist/regenerate/masking.d.ts +0 -19
  291. package/dist/regenerate/masking.js +0 -95
  292. package/dist/regenerate/model-names.d.ts +0 -33
  293. package/dist/regenerate/model-names.js +0 -92
  294. package/dist/regenerate/notes.d.ts +0 -159
  295. package/dist/regenerate/notes.js +0 -446
  296. package/dist/regenerate/os-sandbox.d.ts +0 -93
  297. package/dist/regenerate/os-sandbox.js +0 -283
  298. package/dist/regenerate/panel-dock.d.ts +0 -23
  299. package/dist/regenerate/paths.d.ts +0 -110
  300. package/dist/regenerate/paths.js +0 -190
  301. package/dist/regenerate/plain-palette.d.ts +0 -34
  302. package/dist/regenerate/prompt.d.ts +0 -230
  303. package/dist/regenerate/prompt.js +0 -741
  304. package/dist/regenerate/pulse-files.d.ts +0 -14
  305. package/dist/regenerate/pulse-files.js +0 -63
  306. package/dist/regenerate/records.d.ts +0 -132
  307. package/dist/regenerate/records.js +0 -327
  308. package/dist/regenerate/regenerate.d.ts +0 -106
  309. package/dist/regenerate/regenerate.js +0 -660
  310. package/dist/regenerate/regression.d.ts +0 -58
  311. package/dist/regenerate/regression.js +0 -188
  312. package/dist/regenerate/renames.d.ts +0 -42
  313. package/dist/regenerate/renames.js +0 -185
  314. package/dist/regenerate/requires.d.ts +0 -117
  315. package/dist/regenerate/requires.js +0 -377
  316. package/dist/regenerate/resources.d.ts +0 -57
  317. package/dist/regenerate/resources.js +0 -162
  318. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  319. package/dist/regenerate/scripts-being-written.js +0 -30
  320. package/dist/regenerate/self-check.d.ts +0 -29
  321. package/dist/regenerate/self-check.js +0 -119
  322. package/dist/regenerate/services.d.ts +0 -28
  323. package/dist/regenerate/services.js +0 -158
  324. package/dist/regenerate/shell.d.ts +0 -91
  325. package/dist/regenerate/shell.js +0 -320
  326. package/dist/regenerate/side-panel.d.ts +0 -62
  327. package/dist/regenerate/spec-map-view.d.ts +0 -147
  328. package/dist/regenerate/spec-map.d.ts +0 -160
  329. package/dist/regenerate/spec-map.js +0 -596
  330. package/dist/regenerate/spec-steps.d.ts +0 -180
  331. package/dist/regenerate/spec-steps.js +0 -729
  332. package/dist/regenerate/standing.d.ts +0 -28
  333. package/dist/regenerate/standing.js +0 -30
  334. package/dist/regenerate/state.d.ts +0 -21
  335. package/dist/regenerate/state.js +0 -10
  336. package/dist/regenerate/steering.d.ts +0 -56
  337. package/dist/regenerate/steering.js +0 -119
  338. package/dist/regenerate/stop-report.d.ts +0 -43
  339. package/dist/regenerate/stop-report.js +0 -160
  340. package/dist/regenerate/submit-work.d.ts +0 -44
  341. package/dist/regenerate/submit-work.js +0 -76
  342. package/dist/regenerate/test-kinds.d.ts +0 -85
  343. package/dist/regenerate/test-kinds.js +0 -171
  344. package/dist/regenerate/test-scripts.d.ts +0 -240
  345. package/dist/regenerate/test-scripts.js +0 -847
  346. package/dist/regenerate/testing-steps.d.ts +0 -52
  347. package/dist/regenerate/testing-steps.js +0 -129
  348. package/dist/regenerate/testing.d.ts +0 -150
  349. package/dist/regenerate/testing.js +0 -438
  350. package/dist/regenerate/transcript-view.d.ts +0 -21
  351. package/dist/regenerate/unit-gate.d.ts +0 -27
  352. package/dist/regenerate/unit-gate.js +0 -20
  353. package/dist/regenerate/unit-review.d.ts +0 -152
  354. package/dist/regenerate/unit-review.js +0 -361
  355. package/dist/regenerate/web.d.ts +0 -61
  356. package/dist/regenerate/web.js +0 -256
  357. package/dist/regenerate/workspace.d.ts +0 -12
  358. package/dist/regenerate/workspace.js +0 -99
  359. package/dist/regenerate-cli.d.ts +0 -1
  360. package/dist/reopen.d.ts +0 -29
  361. package/dist/resume-line.d.ts +0 -5
  362. package/dist/review/live.d.ts +0 -72
  363. package/dist/review/live.js +0 -166
  364. package/dist/rules.d.ts +0 -20
  365. package/dist/rules.js +0 -47
  366. package/dist/run-report.d.ts +0 -88
  367. package/dist/run-report.js +0 -338
  368. package/dist/screen-padding.d.ts +0 -28
  369. package/dist/self-invocation.d.ts +0 -36
  370. package/dist/self-invocation.js +0 -137
  371. package/dist/sentinel-chat.d.ts +0 -19
  372. package/dist/sentinel-chat.js +0 -221
  373. package/dist/sentinel-check.d.ts +0 -36
  374. package/dist/sentinel-check.js +0 -78
  375. package/dist/sentinel.d.ts +0 -107
  376. package/dist/sentinel.js +0 -599
  377. package/dist/settings.d.ts +0 -45
  378. package/dist/settings.js +0 -378
  379. package/dist/setup.d.ts +0 -97
  380. package/dist/setup.js +0 -436
  381. package/dist/skill-progress.d.ts +0 -46
  382. package/dist/skill.d.ts +0 -102
  383. package/dist/skill.js +0 -147
  384. package/dist/skills.d.ts +0 -54
  385. package/dist/skills.js +0 -111
  386. package/dist/spawn-async.d.ts +0 -18
  387. package/dist/spawn-async.js +0 -35
  388. package/dist/stack.d.ts +0 -80
  389. package/dist/stack.js +0 -206
  390. package/dist/stdlib.d.ts +0 -43
  391. package/dist/stdlib.js +0 -118
  392. package/dist/surface.d.ts +0 -5
  393. package/dist/surface.js +0 -18
  394. package/dist/terminal-images.d.ts +0 -2
  395. package/dist/test-plain-files.d.ts +0 -41
  396. package/dist/test-plain-files.js +0 -172
  397. package/dist/tools.d.ts +0 -101
  398. package/dist/tools.js +0 -242
  399. package/dist/turri-versions.d.ts +0 -71
  400. package/genome/capture/capture.md +0 -26
  401. package/genome/capture/check-conventions.md +0 -5
  402. package/genome/capture/check-reference.md +0 -11
  403. package/genome/capture/concepts.md +0 -3
  404. package/genome/capture/divide.md +0 -9
  405. package/genome/capture/feature.md +0 -45
  406. package/genome/capture/interface.md +0 -9
  407. package/genome/capture/modules.md +0 -23
  408. package/genome/capture/outline.md +0 -11
  409. package/genome/capture/readability.md +0 -12
  410. package/genome/capture/reference.md +0 -10
  411. package/genome/capture/split.md +0 -9
  412. package/genome/capture/survey.md +0 -37
  413. package/genome/capture/trial.md +0 -18
  414. package/genome/capture/verify.md +0 -7
  415. package/genome/rules/bullet-continuation.md +0 -61
  416. package/genome/rules/concise-specs-examples.md +0 -460
  417. package/genome/rules/concise-specs-integration-examples.md +0 -281
  418. package/genome/rules/concise-specs.md +0 -80
  419. package/genome/rules/definitions.md +0 -107
  420. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  421. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  422. package/genome/rules/exported-concepts.md +0 -39
  423. package/genome/rules/func-specs.md +0 -164
  424. package/genome/rules/impl-reqs.md +0 -68
  425. package/genome/rules/import-modules.md +0 -49
  426. package/genome/rules/integration-embedded-testing.md +0 -273
  427. package/genome/rules/integration-embedded.md +0 -171
  428. package/genome/rules/integration-standalone.md +0 -135
  429. package/genome/rules/integrations.md +0 -136
  430. package/genome/rules/linked-resources.md +0 -76
  431. package/genome/rules/module-structure.md +0 -112
  432. package/genome/rules/project-model.md +0 -69
  433. package/genome/rules/required-concepts.md +0 -44
  434. package/genome/rules/requires-modules.md +0 -81
  435. package/genome/rules/semantic-ids.md +0 -49
  436. package/genome/rules/stdlib.md +0 -37
  437. package/genome/rules/test-plain-files.md +0 -138
  438. package/genome/rules/test-reqs.md +0 -57
  439. package/genome/rules/turri-regeneration.md +0 -66
  440. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  441. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  442. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  443. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  444. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  445. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  446. package/genome/skills/debug-specs/SKILL.md +0 -194
  447. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  448. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  449. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  450. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  451. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  452. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  453. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  454. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  455. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  456. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  457. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  458. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  459. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  460. package/genome/skills/refactor-module/SKILL.md +0 -218
  461. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  462. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  463. package/stdlib/backend/common.plain +0 -25
  464. package/stdlib/backend/conformance/common.plain +0 -12
  465. package/stdlib/backend/conformance/go-gin.plain +0 -9
  466. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  467. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  468. package/stdlib/backend/conformance/python-django.plain +0 -9
  469. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  470. package/stdlib/backend/conformance/python-flask.plain +0 -9
  471. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  472. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  473. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  474. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  475. package/stdlib/backend/go-gin.plain +0 -18
  476. package/stdlib/backend/go-nethttp.plain +0 -18
  477. package/stdlib/backend/java-springboot.plain +0 -19
  478. package/stdlib/backend/python-django.plain +0 -19
  479. package/stdlib/backend/python-fastapi.plain +0 -23
  480. package/stdlib/backend/python-flask.plain +0 -23
  481. package/stdlib/backend/rust-axum.plain +0 -17
  482. package/stdlib/backend/typescript-express.plain +0 -19
  483. package/stdlib/backend/typescript-fastify.plain +0 -19
  484. package/stdlib/backend/typescript-nestjs.plain +0 -19
  485. package/stdlib/cli/common.plain +0 -17
  486. package/stdlib/cli/conformance/common.plain +0 -11
  487. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  488. package/stdlib/cli/conformance/go-flag.plain +0 -9
  489. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  490. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  491. package/stdlib/cli/conformance/python-click.plain +0 -9
  492. package/stdlib/cli/conformance/python-typer.plain +0 -9
  493. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  494. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  495. package/stdlib/cli/go-cobra.plain +0 -14
  496. package/stdlib/cli/go-flag.plain +0 -14
  497. package/stdlib/cli/java-picocli.plain +0 -15
  498. package/stdlib/cli/python-argparse.plain +0 -18
  499. package/stdlib/cli/python-click.plain +0 -16
  500. package/stdlib/cli/python-typer.plain +0 -16
  501. package/stdlib/cli/rust-clap.plain +0 -14
  502. package/stdlib/cli/typescript-commander.plain +0 -17
  503. package/stdlib/frontend/angular.plain +0 -17
  504. package/stdlib/frontend/common.plain +0 -17
  505. package/stdlib/frontend/conformance/angular.plain +0 -5
  506. package/stdlib/frontend/conformance/common.plain +0 -11
  507. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  508. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  509. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  510. package/stdlib/frontend/react-vite.plain +0 -16
  511. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  512. package/stdlib/frontend/vue-vite.plain +0 -16
  513. package/stdlib/lang/go.plain +0 -13
  514. package/stdlib/lang/java.plain +0 -12
  515. package/stdlib/lang/python.plain +0 -18
  516. package/stdlib/lang/rust.plain +0 -12
  517. package/stdlib/lang/typescript.plain +0 -13
  518. package/stdlib/library/common.plain +0 -15
  519. package/stdlib/library/conformance/common.plain +0 -9
  520. package/stdlib/library/conformance/go.plain +0 -9
  521. package/stdlib/library/conformance/java-gradle.plain +0 -9
  522. package/stdlib/library/conformance/java-maven.plain +0 -9
  523. package/stdlib/library/conformance/python.plain +0 -9
  524. package/stdlib/library/conformance/rust.plain +0 -9
  525. package/stdlib/library/conformance/typescript.plain +0 -9
  526. package/stdlib/library/go.plain +0 -12
  527. package/stdlib/library/java-gradle.plain +0 -13
  528. package/stdlib/library/java-maven.plain +0 -13
  529. package/stdlib/library/python.plain +0 -13
  530. package/stdlib/library/rust.plain +0 -12
  531. package/stdlib/library/typescript.plain +0 -15
package/dist/sentinel.js DELETED
@@ -1,599 +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) {
123
- return sentinel
124
- ? [
125
- "<pulse-ends>",
126
- "The sentinel - a chat of my own, beside this one - checks every pulse that finishes and tests what was launched.",
127
- "When a pulse lands, the chat the person is in is told, to tell them it landed and what the sentinel does with it -",
128
- "and nothing more: the pulse is the sentinel's. A pulse that went wrong you are not told of. What needs the person, the",
129
- "sentinel puts to them as a notice in the chat they are in: what is wrong, and what can be done. When they accept",
130
- "one, you are given it, and what they chose: do it.",
131
- "</pulse-ends>",
132
- ].join("\n")
133
- : "<pulse-ends>\nWhen a pulse asked for in this chat ends, you are told, and react to it.\n</pulse-ends>";
134
- }
135
- /**
136
- * What the chat the person is in is told of a pulse that landed, with the sentinel on: that it landed, what the sentinel
137
- * does with it - and to tell the person so, and do nothing else about it. `launching`: launch-after-pulse is on - it is
138
- * launched in the background, and the sentinel tests it once it runs.
139
- */
140
- export function landedNote(job, options = {}) {
141
- const launching = options.launching === true;
142
- // The host showed the person the pulse's end itself: what happened, for when they ask - nobody is told anything now.
143
- if (options.shown === true) {
144
- return [
145
- `Pulse ${job.id} - ${pulseName(job)} - landed, after ${formatDuration(job)}.`,
146
- "",
147
- (job.report ?? "").trim(),
148
- "",
149
- `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.`,
150
- ].join("\n");
151
- }
152
- return [
153
- `Pulse ${job.id} - ${pulseName(job)} - landed, after ${formatDuration(job)}.`,
154
- "",
155
- (job.report ?? "").trim(),
156
- "",
157
- `${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.`,
158
- "",
159
- `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.`,
160
- ].join("\n");
161
- }
162
- /**
163
- * Its identity and its task, in its system prompt in place of the conversation's. A host's `surface` - where the person
164
- * 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.
165
- */
166
- export function sentinelPrompt(cwd, options = {}) {
167
- const guidance = readGuidance(cwd);
168
- const tools = options.extraTools ?? [];
169
- const surface = options.surface?.trim() ?? "";
170
- const theirs = tools.length > 0 ? tools.join(", ") : "the host's tools";
171
- return [
172
- "<sentinel>",
173
- "You are turri's sentinel: a chat of turri's own, beside the chats the person talks to while they build their software",
174
- "with turri. Every pulse that finishes comes to you, each in a conversation of its own - and functional specs the person",
175
- "asks you to check. This conversation is for the pulse, or the check, in the message turri writes first. For a pulse:",
176
- "what it was, how it ended,",
177
- ...(surface === ""
178
- ? ["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."]
179
- : [
180
- "its ***plain diff, its log, and what was launched. The person can watch you try it, where the host shows it;",
181
- "they talk to you in another chat, and hear what you find only through notify_person.",
182
- ]),
183
- "",
184
- "For the pulse:",
185
- "1. Check how it went, from what turri tells you - and, when that is not enough, the pulse in full (pulses with its id),",
186
- " its log, and the code and the ***plain, which you read.",
187
- "2. When it was launched (the message says so - launch-after-pulse is on), test it: it is running where the message",
188
- " says - a launch that holds the pulse's commit, and the pulses after it the message names. Test what the message",
189
- " says this pulse changed - what a later pulse changed again is that pulse's to test. How far you test is yours to",
190
- " judge, from what the pulse changed and what the ***plain says",
191
- " it should do: that it came up, answers, and does what its ***plain diff says it now does. Where the ***plain picks",
192
- " one way among several - which of a tie comes first, how a default is chosen - try an input on which the ways give",
193
- " different answers, so a pass shows the ***plain's way and no other: a tie whose first word is also first",
194
- " alphabetically tells \"first in the file\" from nothing.",
195
- "3. When something is wrong - the pulse failed or stopped, it did not pass, the launch did not come up, the software",
196
- " does not do what its ***plain says - find out why. Then:",
197
- " - When it is the project's tooling - a testing script, or where config.turri.yaml says the scripts are and which",
198
- " toolchain folders the agents may read (toolchains:) - fix it yourself, with edit: a script calling python3 where",
199
- " this machine has python of the version the ***plain names, a path that moved, a flag the tool's version does not",
200
- " take. Check what you rely on in your shell first (`command -v python`, `python --version`). Then call resume for",
201
- " the module, so the work runs again with the fix - and notify_person once, fixed: true, severity info, no actions:",
202
- " what you changed and why, the lines before and after in the evidence.",
203
- " - Anything else, call notify_person once: what is wrong, what shows it, and what the person can do about it, each",
204
- " a task the agent of their chat can carry out once they accept it - a change to the ***plain, a credential to",
205
- " provide, a pulse to regenerate again. Be exact: the task is all that agent is given. What the machine lacks - a",
206
- " toolchain, a tool, a system library - and any setting of the machine's or the person's shell: say exactly what",
207
- " the person runs themselves (`brew install node`), and make the action resuming once they have.",
208
- " When it is a gap in the ***plain the build settled with an assumption - something the person may reasonably leave",
209
- " as it is - say so with ignorable: the gap in the summary, what the build does in the evidence. Never for",
210
- " something broken, a pulse that went wrong, or a launch that did not come up.",
211
- "4. When all is well, notify no one.",
212
- "5. Last, call conclude once for it - holds or wrong, and in a line or two what you checked and what you found:",
213
- " the chat the person is in is told, whether all is well or not. Then say the same here, in a line or two.",
214
- "",
215
- "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",
216
- "message says. Test those - what each says and its scenarios - not the module's other functional specs. Notify the",
217
- "person of what does not do what its ***plain says, as for a pulse, and call conclude once for the check, by its id.",
218
- "",
219
- "You fix the project's tooling and nothing else. Your file tools read the whole project; write and edit reach only the",
220
- "testing scripts and config.turri.yaml - and in it only where the scripts are, and toolchains:. Your shell runs with",
221
- "the project read only; the files you try a launch with go in $TMPDIR - /tmp is outside what it may write. It sees no",
222
- "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",
223
- "launch, or regenerate but by resume after a fix of yours. You install nothing on this machine and change none of",
224
- "its settings, nor the person's shell - under no circumstances: that is always the person's, said in a notice. You",
225
- "never ask the person questions - a notice is how you reach them.",
226
- "",
227
- "The person can talk to you here. When they tell you how to check - what to test, what to leave alone, where things",
228
- "run - keep it with keep_guidance, in their words, so it holds from now on: this conversation ends with its pulse,",
229
- "and the next pulse's starts afresh, with only what you kept. What the person chose to leave as the build has it is",
230
- "in your guidance too: do not raise it again, unless the build no longer does what they accepted.",
231
- ...(surface !== ""
232
- ? [
233
- "",
234
- "Where the person watches you, in the host's words:",
235
- "<surface>",
236
- surface,
237
- "</surface>",
238
- `Try what is launched with ${theirs}, where the person can watch. Keep your shell for what those cannot show - logs, exit`,
239
- "codes, files.",
240
- ]
241
- : tools.length > 0
242
- ? ["", `The host gives you ${theirs} to test with as well.`]
243
- : []),
244
- "</sentinel>",
245
- ...(guidance !== "" ? ["", "<guidance>", "What the person told you to keep in mind:", guidance, "</guidance>"] : []),
246
- ].join("\n");
247
- }
248
- /** What the sentinel is told of one finished pulse: the ledger's facts, the chats, and what runs of it. */
249
- export function sentinelBrief(job, context) {
250
- const view = (() => {
251
- try {
252
- const entries = readLedger(context.project, { job: job.id });
253
- const found = pulseView(job.id, entries);
254
- return found !== undefined ? describePulseView(found) : undefined;
255
- }
256
- catch {
257
- return undefined;
258
- }
259
- })();
260
- const ended = job.status === "succeeded"
261
- ? didNotPass(job)
262
- ? "ran to its end, and what it built did not pass"
263
- : "finished, and landed what it built"
264
- : job.status === "stopped"
265
- ? "was stopped"
266
- : "failed";
267
- const lines = [`Pulse ${job.id} - ${pulseName(job)} - ${ended}, after ${formatDuration(job)}.`];
268
- if (context.asked !== undefined)
269
- lines.push(`It was asked for in the chat "${context.asked}".`);
270
- if (context.focused !== undefined)
271
- lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
272
- lines.push("", job.status === "succeeded" ? (job.report ?? "").trim() : (job.error ?? job.note ?? "").trim());
273
- if (view !== undefined)
274
- lines.push("", "What the ledger has of it:", view);
275
- else if (job.diff !== undefined && job.diff.trim() !== "")
276
- lines.push("", "Its ***plain diff:", job.diff.trimEnd());
277
- if (job.logFile !== undefined)
278
- lines.push("", `Its log: ${job.logFile}`);
279
- if (job.status === "succeeded" && !didNotPass(job))
280
- lines.push("", ...launchLines(job, context.launch));
281
- if (job.specConflict !== undefined) {
282
- 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.");
283
- }
284
- else if (wentWrong(job)) {
285
- 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);
286
- }
287
- lines.push("", `When you are done with it, call conclude for ${job.id} - whether all is well or not.`);
288
- return lines.join("\n");
289
- }
290
- /** 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. */
291
- function launchLines(job, launch) {
292
- const spec = (each) => `${each.module}:${each.funcId}`;
293
- if (launch.off === true)
294
- 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];
295
- if (launch.commit === undefined)
296
- return ["Nothing was launched for it: turri has no commit it landed - check the pulse alone.", LAUNCHED_ONLY];
297
- const commit = launch.commit.slice(0, 7);
298
- if (launch.notAsked !== undefined)
299
- 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];
300
- if (launch.stopped === true || launch.launch === undefined)
301
- return [`Its commit is ${commit}. The person stopped its launch: nothing of it runs - check the pulse alone.`, LAUNCHED_ONLY];
302
- const what = launch.launch;
303
- const later = launch.later.map((other) => `${other.id} (${pulseName(other)})`);
304
- const lines = [
305
- `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(", ")}` : ""}.`,
306
- ];
307
- if (what.status === "failed") {
308
- 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);
309
- return lines;
310
- }
311
- lines.push("What runs now:", ...whatRuns(launch.running, launchedDir(what)), LAUNCHED_ONLY);
312
- if (launch.laterSpecs.length > 0) {
313
- 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"}.`);
314
- }
315
- else
316
- lines.push("Test what this pulse changed.");
317
- return lines;
318
- }
319
- /**
320
- * What the sentinel is told of a host's check: what is launched of the module - what runs, and where - and the
321
- * functional specs to test, with what each says and its scenarios, as turri reads them now.
322
- */
323
- export function sentinelCheckBrief(check, context) {
324
- const lines = [
325
- `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.`,
326
- ];
327
- if (context.focused !== undefined)
328
- lines.push(`The person is in the chat "${context.focused}": a notice goes there.`);
329
- 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
330
- ? [
331
- `Its last launch, ${context.failed.id}, did not come up: ${context.failed.summary ?? "the launch agent did not say why"}`,
332
- "That is what you find out about: the launch did not come up. Test nothing in its place.",
333
- ]
334
- : whatRuns(context.running, context.dir)), LAUNCHED_ONLY, "", `Test these functional specs of ${check.module} - only these, not its others, though they run too:`);
335
- for (const spec of context.specs) {
336
- lines.push("", `# ${spec.funcId}`, spec.text);
337
- for (const [title, scenarios] of [["Conformance scenarios", spec.conformance], ["Acceptance scenarios", spec.acceptance]]) {
338
- if (scenarios.length === 0)
339
- continue;
340
- lines.push(`${title}:`, ...scenarios.map((scenario) => `- ${scenario.id}: ${scenario.text.replace(/\n+/g, " ")}`));
341
- }
342
- }
343
- 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.`);
344
- return lines.join("\n");
345
- }
346
- // ---------------------------------------------------------------------------------------------
347
- // Its tools.
348
- /**
349
- * The tools the sentinel's agent may call: what reads, write and edit for the project's tooling alone, resume, its
350
- * notices and its guidance - and what a host gives it.
351
- */
352
- 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"];
353
- /** A testing script by its name - `run_unittests_python.sh`, `prepare_environment_node.sh` - and a config file of turri's. */
354
- const SCRIPT_FILE = /^(run_|prepare_environment).*\.(sh|ps1|bat|cmd)$/;
355
- const CONFIG_FILE_NAME = /^config\.turri(\..+)?\.yaml$/;
356
- /** The keys of config.turri.yaml the sentinel may change: where the testing scripts are, and the toolchains' folders. */
357
- export const SENTINEL_CONFIG_KEYS = ["unittests-script", "conformance-tests-script", "prepare-environment-script", "toolchains"];
358
- /**
359
- * The project's tooling, which the sentinel fixes itself: its testing scripts - `test_scripts/`, a `run_*.sh` or
360
- * `prepare_environment*.sh` at its root, and each script its config names - and its `config.turri*.yaml` files. In the
361
- * project, and in a project one folder down (***plain kept in plain/). Never a .plain file: the ***plain is the person's.
362
- */
363
- export function sentinelTooling(cwd) {
364
- const root = resolve(cwd);
365
- const projects = [root, ...listDirs(root).filter((dir) => listFiles(dir).some((name) => CONFIG_FILE_NAME.test(name)))];
366
- return [
367
- ...new Set(projects.flatMap((project) => {
368
- const configs = listFiles(project).filter((name) => CONFIG_FILE_NAME.test(name));
369
- const named = configs.flatMap((name) => {
370
- const config = readConfigFile(join(project, name));
371
- return [config.unittestsScript, config.conformanceTestsScript, config.prepareEnvironmentScript].filter((path) => typeof path === "string").map((path) => resolve(project, path));
372
- });
373
- return [
374
- join(project, "test_scripts"),
375
- ...listFiles(project).filter((name) => SCRIPT_FILE.test(name)).map((name) => join(project, name)),
376
- ...configs.map((name) => join(project, name)),
377
- ...named,
378
- ];
379
- })),
380
- ].filter((path) => !path.endsWith(".plain"));
381
- }
382
- function listFiles(dir) {
383
- try {
384
- return readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => entry.name);
385
- }
386
- catch {
387
- return [];
388
- }
389
- }
390
- function listDirs(dir) {
391
- try {
392
- 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));
393
- }
394
- catch {
395
- return [];
396
- }
397
- }
398
- /**
399
- * Its file tools and shell: the whole project to read, and to write only its tooling (`sentinelTooling`) - in a config
400
- * file, only the keys of SENTINEL_CONFIG_KEYS. Its shell runs behind the command check, the OS sandbox where one is up,
401
- * and the audit, with the project read only and the network open - and changes nothing of the machine's. Its home and
402
- * temporary folder are its own, in the modules' scratch.
403
- */
404
- export function sentinelFileTools(cwd) {
405
- const tooling = sentinelTooling(cwd);
406
- const { tools } = confinedTools({ workdir: cwd, read: [cwd], write: tooling, shellHome: join(cwd, MODULES_DIR, `.${SENTINEL}`), fixesScripts: true });
407
- const shell = confinedTools({ workdir: cwd, read: [cwd], write: [], shellHome: join(cwd, MODULES_DIR, `.${SENTINEL}`) }).tools;
408
- return tools.map((tool) => {
409
- // Its shell writes nothing in the project: only write and edit reach the tooling.
410
- if (tool.name === "bash")
411
- return shell.find((each) => each.name === "bash");
412
- if (tool.name !== "write" && tool.name !== "edit")
413
- return tool;
414
- return {
415
- ...tool,
416
- async execute(toolCallId, params, signal, onUpdate, ctx) {
417
- const path = resolve(cwd, String(params.path ?? ""));
418
- if (!CONFIG_FILE_NAME.test(basename(path)))
419
- return tool.execute(toolCallId, params, signal, onUpdate, ctx);
420
- // A config file: only where the testing scripts are, and the toolchains, may change - anything else is put back.
421
- const before = existsSync(path) ? readFileSync(path, "utf8") : undefined;
422
- const result = await tool.execute(toolCallId, params, signal, onUpdate, ctx);
423
- const changed = changedKeys(before ?? "", existsSync(path) ? readFileSync(path, "utf8") : "").filter((key) => !SENTINEL_CONFIG_KEYS.includes(key.replace(/_/g, "-")));
424
- if (changed.length > 0) {
425
- if (before === undefined)
426
- rmSync(path, { force: true });
427
- else
428
- writeFileSync(path, before);
429
- 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.`);
430
- }
431
- return result;
432
- },
433
- };
434
- });
435
- }
436
- /** The top-level keys whose values differ between two config texts - one that does not parse differing in every key. */
437
- function changedKeys(before, after) {
438
- const parse = (text) => {
439
- try {
440
- const value = loadYaml(text);
441
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : value === undefined || value === null ? {} : undefined;
442
- }
443
- catch {
444
- return undefined;
445
- }
446
- };
447
- const [was, now] = [parse(before), parse(after)];
448
- if (was === undefined || now === undefined)
449
- return ["the file as a whole - it no longer reads as YAML"];
450
- return [...new Set([...Object.keys(was), ...Object.keys(now)])].filter((key) => JSON.stringify(was[key]) !== JSON.stringify(now[key]));
451
- }
452
- export function notifyTool(notify) {
453
- return defineTool({
454
- name: "notify_person",
455
- label: "Notify",
456
- 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 " +
457
- "they can do about it. Each action is a task the agent of their chat carries out once they accept it. Only when they " +
458
- "need to act - never for a pulse that went well - or, severity info and no actions, to say what you fixed yourself in " +
459
- "the testing scripts or their config, and why.",
460
- parameters: Type.Object({
461
- 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" }),
462
- summary: Type.String({ description: "What is wrong, in one line" }),
463
- 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" }),
464
- actions: Type.Array(Type.Object({
465
- label: Type.String({ description: "What the person accepts, in a few words: \"Change the ***plain to …\", \"Regenerate fs 3 again\"" }),
466
- task: Type.String({ description: "Exactly what their chat's agent does once they accept it - all it is given" }),
467
- }), { description: "What can be done, the best first" }),
468
- module: Type.Optional(Type.String({ description: "The module it is about" })),
469
- pulse: Type.Optional(Type.String({ description: "The pulse's id" })),
470
- check: Type.Optional(Type.String({ description: "The check's id, when it is about a check the person asked for" })),
471
- 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" })),
472
- ignorable: Type.Optional(Type.Boolean({
473
- 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 " +
474
- "assumption - then say the gap in the summary and what the build does in the evidence (the ***plain does not say what happens to " +
475
- "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.",
476
- })),
477
- }),
478
- async execute(_id, params) {
479
- const notice = notify({
480
- severity: params.severity,
481
- summary: params.summary,
482
- evidence: params.evidence,
483
- actions: params.actions,
484
- ...(params.ignorable === true ? { ignorable: true } : {}),
485
- ...(params.fixed === true ? { kind: "fixed" } : {}),
486
- ...(params.module !== undefined ? { module: params.module } : {}),
487
- ...(params.pulse !== undefined ? { job: params.pulse } : {}),
488
- ...(params.check !== undefined ? { check: params.check } : {}),
489
- });
490
- return {
491
- 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." }],
492
- details: { notice: notice?.id },
493
- };
494
- },
495
- });
496
- }
497
- export function concludeTool(conclude) {
498
- return defineTool({
499
- name: "conclude",
500
- label: "Conclude",
501
- 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 " +
502
- "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 " +
503
- "notify_person, when something is wrong. Name the pulse, or the check.",
504
- parameters: Type.Object({
505
- pulse: Type.Optional(Type.String({ description: "The pulse's id" })),
506
- check: Type.Optional(Type.String({ description: "The check's id, for a check the person asked for - in place of pulse" })),
507
- 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" }),
508
- 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\"" }),
509
- }),
510
- async execute(_id, params) {
511
- if ((params.pulse === undefined) === (params.check === undefined))
512
- throw new Error("Name the pulse, or the check - one of them.");
513
- const chat = conclude({ ...(params.pulse !== undefined ? { job: params.pulse } : { check: params.check }), verdict: params.verdict, summary: params.summary });
514
- return {
515
- content: [{ type: "text", text: chat !== undefined ? "The chat the person is in is told." : "There is no chat to tell: say it here." }],
516
- details: {},
517
- };
518
- },
519
- });
520
- }
521
- /** What the chat the person is in is told when the sentinel is done with a pulse: to say so, and do nothing more. */
522
- export function concludedNote(conclusion, options = {}) {
523
- const about = conclusion.check !== undefined
524
- ? `the check you asked for${conclusion.module !== undefined ? ` of ${conclusion.module}` : ""}`
525
- : conclusion.module !== undefined
526
- ? `${conclusion.module}${conclusion.pulse !== undefined ? ` pulse ${conclusion.pulse}` : ""}`
527
- : `pulse ${conclusion.job}`;
528
- if (conclusion.verdict === "unchecked") {
529
- if (options.shown === true)
530
- return [`The sentinel did not do ${about} (${conclusion.check ?? conclusion.job}).`, conclusion.summary.trim()].join("\n");
531
- 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");
532
- }
533
- // The host showed the person the conclusion itself: what the sentinel found, for when they ask.
534
- if (options.shown === true) {
535
- return [
536
- `The sentinel is done with ${about} (${conclusion.check ?? conclusion.job}): ${conclusion.verdict === "holds" ? "it holds" : "something is wrong"}.`,
537
- conclusion.summary.trim(),
538
- ...(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."] : []),
539
- ].join("\n");
540
- }
541
- return [
542
- `The sentinel is done with ${about} (${conclusion.check ?? conclusion.job}): ${conclusion.verdict === "holds" ? "it holds" : "something is wrong"}.`,
543
- conclusion.summary.trim(),
544
- "",
545
- conclusion.verdict === "holds"
546
- ? "Tell the person, in a line, that the sentinel checked it and it holds - and what it checked. Do nothing else about it."
547
- : "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.",
548
- ].join("\n");
549
- }
550
- /** Bring a module up again once the sentinel fixed what stopped its pulse: what is left there is regenerated, its scripts run. */
551
- export function resumeTool(resume) {
552
- return defineTool({
553
- name: "resume",
554
- label: "Resume",
555
- description: "Bring a module up again after you fixed what stopped its pulse - a testing script, a toolchains: entry: what is left to " +
556
- "regenerate there runs again, its testing scripts with it, as when the person asks for it. Only after a fix of yours, " +
557
- "never to try again what nothing was changed for. What it starts comes back to you as a pulse that finished.",
558
- parameters: Type.Object({ plain_file: Type.String({ description: "The module's .plain file, from the project's folder: app.plain" }) }),
559
- async execute(_id, params) {
560
- return { content: [{ type: "text", text: await resume(params.plain_file) }], details: {} };
561
- },
562
- });
563
- }
564
- /**
565
- * 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
566
- * start - as turri's records say it. The sentinel's shell is sandboxed from every other process, so it cannot ask itself.
567
- */
568
- export function whoHoldsTool(cwd) {
569
- return defineTool({
570
- name: "who_holds",
571
- label: "Who holds",
572
- description: "What listens on a TCP port on this machine, and whose it is: a server one of turri's launches started (which launch, " +
573
- "which module, which commit), one another turri started, or a program turri did not start - with how the person " +
574
- "frees it. Use it when what answers at a launch's URL is not what you expect, or nothing does: your shell cannot " +
575
- "see other processes. It stops nothing.",
576
- parameters: Type.Object({ port: Type.Integer({ minimum: 1, maximum: 65535, description: "The port, e.g. 8000" }) }),
577
- async execute(_id, params) {
578
- const pids = listenersOf(params.port);
579
- const text = pids === undefined
580
- ? `turri cannot tell what holds port ${params.port} here: there is no lsof.`
581
- : pids.length === 0
582
- ? `Nothing listens on port ${params.port}.`
583
- : [`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");
584
- return { content: [{ type: "text", text }], details: {} };
585
- },
586
- });
587
- }
588
- export function keepGuidanceTool(cwd) {
589
- return defineTool({
590
- name: "keep_guidance",
591
- label: "Keep guidance",
592
- 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.",
593
- parameters: Type.Object({ text: Type.String({ description: "What to keep in mind, as they said it" }) }),
594
- async execute(_id, params) {
595
- keepGuidance(cwd, params.text);
596
- return { content: [{ type: "text", text: "Kept." }], details: {} };
597
- },
598
- });
599
- }
@@ -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;