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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/README.md +26 -4
  2. package/dist/banner.js +259 -0
  3. package/dist/capture-cli.js +50 -68
  4. package/dist/chat-commands.js +6 -6
  5. package/dist/chat-models.js +17 -15
  6. package/dist/chat-tab-header.js +21 -9
  7. package/dist/chat-tabs.js +11 -7
  8. package/dist/chat-terminal.js +126 -64
  9. package/dist/chat-waiting.js +0 -20
  10. package/dist/cli-options.js +11 -7
  11. package/dist/cli-root.js +141 -0
  12. package/dist/cli.js +49 -55
  13. package/dist/conform-cli.js +4 -6
  14. package/dist/cultivate-cli.js +65 -97
  15. package/dist/doctor-cli.js +99 -0
  16. package/dist/drift-cli.js +2 -7
  17. package/dist/entry-renderers.js +107 -0
  18. package/dist/extension.js +14 -3344
  19. package/dist/init-config-cli.js +218 -0
  20. package/dist/launch-cli.js +55 -91
  21. package/dist/lineage-cli.js +2 -4
  22. package/dist/loop-cli.js +118 -237
  23. package/dist/panel-view.js +409 -0
  24. package/dist/parse-cli.js +5 -2
  25. package/dist/pi-launch.js +39 -13
  26. package/dist/pi-themes.js +21 -0
  27. package/dist/plain-code-blocks.js +1 -1
  28. package/dist/pointer-hover.js +4 -0
  29. package/dist/print-mode.js +20 -0
  30. package/dist/question-dialog.js +26 -3
  31. package/dist/quiet.js +7 -106
  32. package/dist/regenerate/diff-view.js +6 -87
  33. package/dist/regenerate/jobs-tree.js +2 -17
  34. package/dist/regenerate/side-panel.js +32 -5
  35. package/dist/regenerate/spec-map-view.js +3 -68
  36. package/dist/regenerate-cli.js +7 -11
  37. package/dist/skill-progress.js +25 -0
  38. package/dist/skill-report.js +52 -0
  39. package/dist/terminal-marks.js +21 -0
  40. package/dist/terminal-notifications.js +219 -0
  41. package/dist/terminal-view.js +239 -0
  42. package/dist/turri-versions.js +64 -6
  43. package/docs/README.md +3 -3
  44. package/docs/capture.md +87 -152
  45. package/docs/chats.md +10 -7
  46. package/docs/claude-subscription.md +1 -1
  47. package/docs/config.md +8 -8
  48. package/docs/development.md +30 -64
  49. package/docs/headless.md +3 -1
  50. package/docs/hosting.md +3 -251
  51. package/docs/installation.md +5 -3
  52. package/docs/launch.md +3 -3
  53. package/docs/sandbox.md +2 -0
  54. package/docs/sentinel.md +13 -13
  55. package/docs/theming.md +2 -2
  56. package/docs/using.md +8 -8
  57. package/package.json +13 -31
  58. package/dist/ask.d.ts +0 -90
  59. package/dist/ask.js +0 -170
  60. package/dist/background-skills.d.ts +0 -56
  61. package/dist/background-skills.js +0 -129
  62. package/dist/bedrock-region.d.ts +0 -66
  63. package/dist/bedrock-region.js +0 -144
  64. package/dist/brand.d.ts +0 -13
  65. package/dist/btw.d.ts +0 -69
  66. package/dist/btw.js +0 -174
  67. package/dist/capture/agents.d.ts +0 -361
  68. package/dist/capture/agents.js +0 -332
  69. package/dist/capture/area.d.ts +0 -58
  70. package/dist/capture/area.js +0 -197
  71. package/dist/capture/assemble.d.ts +0 -122
  72. package/dist/capture/assemble.js +0 -452
  73. package/dist/capture/capture.d.ts +0 -116
  74. package/dist/capture/capture.js +0 -1228
  75. package/dist/capture/chat.d.ts +0 -29
  76. package/dist/capture/chat.js +0 -94
  77. package/dist/capture/checks.d.ts +0 -142
  78. package/dist/capture/checks.js +0 -643
  79. package/dist/capture/config.d.ts +0 -13
  80. package/dist/capture/config.js +0 -60
  81. package/dist/capture/interface.d.ts +0 -71
  82. package/dist/capture/interface.js +0 -199
  83. package/dist/capture/map.d.ts +0 -56
  84. package/dist/capture/map.js +0 -530
  85. package/dist/capture/progress.d.ts +0 -108
  86. package/dist/capture/progress.js +0 -234
  87. package/dist/capture/report.d.ts +0 -75
  88. package/dist/capture/report.js +0 -267
  89. package/dist/capture/scripts.d.ts +0 -26
  90. package/dist/capture/scripts.js +0 -33
  91. package/dist/capture/state.d.ts +0 -296
  92. package/dist/capture/state.js +0 -43
  93. package/dist/capture/trial.d.ts +0 -34
  94. package/dist/capture/trial.js +0 -89
  95. package/dist/capture-cli.d.ts +0 -1
  96. package/dist/chat-commands.d.ts +0 -17
  97. package/dist/chat-idle.d.ts +0 -7
  98. package/dist/chat-idle.js +0 -20
  99. package/dist/chat-models.d.ts +0 -22
  100. package/dist/chat-records.d.ts +0 -50
  101. package/dist/chat-records.js +0 -107
  102. package/dist/chat-scope.d.ts +0 -14
  103. package/dist/chat-scope.js +0 -15
  104. package/dist/chat-skills.d.ts +0 -17
  105. package/dist/chat-skills.js +0 -18
  106. package/dist/chat-tab-header.d.ts +0 -15
  107. package/dist/chat-tabs.d.ts +0 -20
  108. package/dist/chat-terminal.d.ts +0 -24
  109. package/dist/chat-ui.d.ts +0 -33
  110. package/dist/chat-waiting.d.ts +0 -67
  111. package/dist/chats.d.ts +0 -340
  112. package/dist/chats.js +0 -996
  113. package/dist/cli-options.d.ts +0 -24
  114. package/dist/cli.d.ts +0 -9
  115. package/dist/config-edit.d.ts +0 -83
  116. package/dist/config-edit.js +0 -391
  117. package/dist/config.d.ts +0 -428
  118. package/dist/config.js +0 -811
  119. package/dist/conform-cli.d.ts +0 -1
  120. package/dist/conformance-switch.d.ts +0 -25
  121. package/dist/conformance-switch.js +0 -86
  122. package/dist/cultivate-cli.d.ts +0 -1
  123. package/dist/doctor-tool.d.ts +0 -11
  124. package/dist/doctor-tool.js +0 -33
  125. package/dist/drift-cli.d.ts +0 -1
  126. package/dist/environment.d.ts +0 -37
  127. package/dist/environment.js +0 -109
  128. package/dist/extension.d.ts +0 -208
  129. package/dist/genome.d.ts +0 -77
  130. package/dist/genome.js +0 -288
  131. package/dist/graph.d.ts +0 -52
  132. package/dist/graph.js +0 -247
  133. package/dist/host-session.d.ts +0 -112
  134. package/dist/host-session.js +0 -103
  135. package/dist/host.d.ts +0 -40
  136. package/dist/host.js +0 -54
  137. package/dist/identity.d.ts +0 -7
  138. package/dist/identity.js +0 -75
  139. package/dist/init-config.d.ts +0 -169
  140. package/dist/init-config.js +0 -841
  141. package/dist/installed-providers.d.ts +0 -40
  142. package/dist/installed-providers.js +0 -98
  143. package/dist/jellyfish.d.ts +0 -40
  144. package/dist/judge.d.ts +0 -25
  145. package/dist/judge.js +0 -62
  146. package/dist/launch-agent.d.ts +0 -62
  147. package/dist/launch-agent.js +0 -339
  148. package/dist/launch-cli.d.ts +0 -1
  149. package/dist/launch-session.d.ts +0 -68
  150. package/dist/launch-session.js +0 -225
  151. package/dist/launch-tools.d.ts +0 -28
  152. package/dist/launch-tools.js +0 -72
  153. package/dist/launch-track.d.ts +0 -175
  154. package/dist/launch-track.js +0 -497
  155. package/dist/lineage-cli.d.ts +0 -1
  156. package/dist/loop-cli.d.ts +0 -35
  157. package/dist/loop-tools.d.ts +0 -103
  158. package/dist/loop-tools.js +0 -361
  159. package/dist/model-check.d.ts +0 -72
  160. package/dist/model-check.js +0 -162
  161. package/dist/module-report.d.ts +0 -9
  162. package/dist/new-project.d.ts +0 -10
  163. package/dist/new-project.js +0 -42
  164. package/dist/notice.d.ts +0 -115
  165. package/dist/notice.js +0 -61
  166. package/dist/parse-cli.d.ts +0 -1
  167. package/dist/parse-tool.d.ts +0 -9
  168. package/dist/parse-tool.js +0 -33
  169. package/dist/pi-launch.d.ts +0 -1
  170. package/dist/pi-settings.d.ts +0 -4
  171. package/dist/pi.d.ts +0 -248
  172. package/dist/pi.js +0 -889
  173. package/dist/picture-row.d.ts +0 -10
  174. package/dist/plain/check.d.ts +0 -63
  175. package/dist/plain/check.js +0 -236
  176. package/dist/plain/concepts.d.ts +0 -37
  177. package/dist/plain/concepts.js +0 -283
  178. package/dist/plain/cycles.d.ts +0 -21
  179. package/dist/plain/cycles.js +0 -190
  180. package/dist/plain/errors.d.ts +0 -26
  181. package/dist/plain/errors.js +0 -50
  182. package/dist/plain/files.d.ts +0 -47
  183. package/dist/plain/files.js +0 -161
  184. package/dist/plain/graph.d.ts +0 -107
  185. package/dist/plain/graph.js +0 -194
  186. package/dist/plain/highlight.d.ts +0 -43
  187. package/dist/plain/highlight.js +0 -196
  188. package/dist/plain/index.d.ts +0 -18
  189. package/dist/plain/index.js +0 -18
  190. package/dist/plain/liquid.d.ts +0 -22
  191. package/dist/plain/liquid.js +0 -124
  192. package/dist/plain/markdown.d.ts +0 -103
  193. package/dist/plain/markdown.js +0 -330
  194. package/dist/plain/module-concepts.d.ts +0 -32
  195. package/dist/plain/module-concepts.js +0 -80
  196. package/dist/plain/parser.d.ts +0 -163
  197. package/dist/plain/parser.js +0 -930
  198. package/dist/plain/plain.tmLanguage.json +0 -150
  199. package/dist/plain/project.d.ts +0 -48
  200. package/dist/plain/project.js +0 -155
  201. package/dist/plain/spec.d.ts +0 -152
  202. package/dist/plain/spec.js +0 -265
  203. package/dist/plain/stdlib.d.ts +0 -16
  204. package/dist/plain/stdlib.js +0 -48
  205. package/dist/plain/test-plain-file.d.ts +0 -59
  206. package/dist/plain/test-plain-file.js +0 -232
  207. package/dist/plain-code-blocks.d.ts +0 -14
  208. package/dist/plain-files.d.ts +0 -21
  209. package/dist/plain-files.js +0 -156
  210. package/dist/pointer-hover.d.ts +0 -12
  211. package/dist/question-dialog.d.ts +0 -55
  212. package/dist/questioning.d.ts +0 -55
  213. package/dist/questioning.js +0 -109
  214. package/dist/quiet.d.ts +0 -34
  215. package/dist/regenerate/activity.d.ts +0 -227
  216. package/dist/regenerate/activity.js +0 -250
  217. package/dist/regenerate/agent-env.d.ts +0 -51
  218. package/dist/regenerate/agent-env.js +0 -311
  219. package/dist/regenerate/agent-shell.d.ts +0 -54
  220. package/dist/regenerate/agent-shell.js +0 -121
  221. package/dist/regenerate/arbiter.d.ts +0 -68
  222. package/dist/regenerate/arbiter.js +0 -133
  223. package/dist/regenerate/audit.d.ts +0 -69
  224. package/dist/regenerate/audit.js +0 -212
  225. package/dist/regenerate/base-folder.d.ts +0 -70
  226. package/dist/regenerate/base-folder.js +0 -186
  227. package/dist/regenerate/cases.d.ts +0 -12
  228. package/dist/regenerate/cases.js +0 -149
  229. package/dist/regenerate/change-view.d.ts +0 -23
  230. package/dist/regenerate/change-view.js +0 -153
  231. package/dist/regenerate/chunk-plan.d.ts +0 -217
  232. package/dist/regenerate/chunk-plan.js +0 -937
  233. package/dist/regenerate/codebase.d.ts +0 -21
  234. package/dist/regenerate/codebase.js +0 -75
  235. package/dist/regenerate/command-check.d.ts +0 -66
  236. package/dist/regenerate/command-check.js +0 -577
  237. package/dist/regenerate/compaction.d.ts +0 -13
  238. package/dist/regenerate/compaction.js +0 -20
  239. package/dist/regenerate/confine.d.ts +0 -69
  240. package/dist/regenerate/confine.js +0 -311
  241. package/dist/regenerate/conform.d.ts +0 -66
  242. package/dist/regenerate/conform.js +0 -132
  243. package/dist/regenerate/conformance-agents.d.ts +0 -388
  244. package/dist/regenerate/conformance-agents.js +0 -1162
  245. package/dist/regenerate/conformance.d.ts +0 -191
  246. package/dist/regenerate/conformance.js +0 -1035
  247. package/dist/regenerate/conversation-writes.d.ts +0 -10
  248. package/dist/regenerate/conversation-writes.js +0 -100
  249. package/dist/regenerate/credentials.d.ts +0 -18
  250. package/dist/regenerate/credentials.js +0 -88
  251. package/dist/regenerate/debug-log.d.ts +0 -56
  252. package/dist/regenerate/debug-log.js +0 -236
  253. package/dist/regenerate/debugger.d.ts +0 -36
  254. package/dist/regenerate/debugger.js +0 -133
  255. package/dist/regenerate/delivery.d.ts +0 -2
  256. package/dist/regenerate/diagnose-job.d.ts +0 -2
  257. package/dist/regenerate/diagnose-job.js +0 -40
  258. package/dist/regenerate/diagnose.d.ts +0 -46
  259. package/dist/regenerate/diagnose.js +0 -92
  260. package/dist/regenerate/diff-view.d.ts +0 -64
  261. package/dist/regenerate/drift.d.ts +0 -120
  262. package/dist/regenerate/drift.js +0 -285
  263. package/dist/regenerate/environment-error.d.ts +0 -167
  264. package/dist/regenerate/environment-error.js +0 -342
  265. package/dist/regenerate/failure-reports.d.ts +0 -28
  266. package/dist/regenerate/failure-reports.js +0 -79
  267. package/dist/regenerate/job-log.d.ts +0 -30
  268. package/dist/regenerate/job-log.js +0 -105
  269. package/dist/regenerate/job-panel.d.ts +0 -122
  270. package/dist/regenerate/job-panel.js +0 -339
  271. package/dist/regenerate/jobs-tree.d.ts +0 -76
  272. package/dist/regenerate/jobs.d.ts +0 -231
  273. package/dist/regenerate/jobs.js +0 -522
  274. package/dist/regenerate/lanes.d.ts +0 -16
  275. package/dist/regenerate/lanes.js +0 -32
  276. package/dist/regenerate/launch.d.ts +0 -256
  277. package/dist/regenerate/launch.js +0 -689
  278. package/dist/regenerate/ledger-view.d.ts +0 -87
  279. package/dist/regenerate/ledger-view.js +0 -325
  280. package/dist/regenerate/ledger.d.ts +0 -368
  281. package/dist/regenerate/ledger.js +0 -357
  282. package/dist/regenerate/lineage.d.ts +0 -105
  283. package/dist/regenerate/lineage.js +0 -485
  284. package/dist/regenerate/list-arguments.d.ts +0 -21
  285. package/dist/regenerate/list-arguments.js +0 -121
  286. package/dist/regenerate/loop.d.ts +0 -423
  287. package/dist/regenerate/loop.js +0 -2087
  288. package/dist/regenerate/masking.d.ts +0 -19
  289. package/dist/regenerate/masking.js +0 -95
  290. package/dist/regenerate/model-names.d.ts +0 -33
  291. package/dist/regenerate/model-names.js +0 -92
  292. package/dist/regenerate/notes.d.ts +0 -159
  293. package/dist/regenerate/notes.js +0 -446
  294. package/dist/regenerate/os-sandbox.d.ts +0 -93
  295. package/dist/regenerate/os-sandbox.js +0 -283
  296. package/dist/regenerate/panel-dock.d.ts +0 -23
  297. package/dist/regenerate/paths.d.ts +0 -110
  298. package/dist/regenerate/paths.js +0 -190
  299. package/dist/regenerate/plain-palette.d.ts +0 -34
  300. package/dist/regenerate/prompt.d.ts +0 -230
  301. package/dist/regenerate/prompt.js +0 -741
  302. package/dist/regenerate/pulse-files.d.ts +0 -14
  303. package/dist/regenerate/pulse-files.js +0 -63
  304. package/dist/regenerate/records.d.ts +0 -132
  305. package/dist/regenerate/records.js +0 -327
  306. package/dist/regenerate/regenerate.d.ts +0 -106
  307. package/dist/regenerate/regenerate.js +0 -660
  308. package/dist/regenerate/regression.d.ts +0 -58
  309. package/dist/regenerate/regression.js +0 -188
  310. package/dist/regenerate/renames.d.ts +0 -42
  311. package/dist/regenerate/renames.js +0 -185
  312. package/dist/regenerate/requires.d.ts +0 -117
  313. package/dist/regenerate/requires.js +0 -377
  314. package/dist/regenerate/resources.d.ts +0 -57
  315. package/dist/regenerate/resources.js +0 -162
  316. package/dist/regenerate/scripts-being-written.d.ts +0 -19
  317. package/dist/regenerate/scripts-being-written.js +0 -30
  318. package/dist/regenerate/self-check.d.ts +0 -29
  319. package/dist/regenerate/self-check.js +0 -119
  320. package/dist/regenerate/services.d.ts +0 -28
  321. package/dist/regenerate/services.js +0 -158
  322. package/dist/regenerate/shell.d.ts +0 -91
  323. package/dist/regenerate/shell.js +0 -320
  324. package/dist/regenerate/side-panel.d.ts +0 -62
  325. package/dist/regenerate/spec-map-view.d.ts +0 -147
  326. package/dist/regenerate/spec-map.d.ts +0 -160
  327. package/dist/regenerate/spec-map.js +0 -596
  328. package/dist/regenerate/spec-steps.d.ts +0 -180
  329. package/dist/regenerate/spec-steps.js +0 -729
  330. package/dist/regenerate/standing.d.ts +0 -28
  331. package/dist/regenerate/standing.js +0 -30
  332. package/dist/regenerate/state.d.ts +0 -21
  333. package/dist/regenerate/state.js +0 -10
  334. package/dist/regenerate/steering.d.ts +0 -56
  335. package/dist/regenerate/steering.js +0 -119
  336. package/dist/regenerate/stop-report.d.ts +0 -43
  337. package/dist/regenerate/stop-report.js +0 -160
  338. package/dist/regenerate/submit-work.d.ts +0 -44
  339. package/dist/regenerate/submit-work.js +0 -76
  340. package/dist/regenerate/test-kinds.d.ts +0 -85
  341. package/dist/regenerate/test-kinds.js +0 -171
  342. package/dist/regenerate/test-scripts.d.ts +0 -240
  343. package/dist/regenerate/test-scripts.js +0 -847
  344. package/dist/regenerate/testing-steps.d.ts +0 -52
  345. package/dist/regenerate/testing-steps.js +0 -129
  346. package/dist/regenerate/testing.d.ts +0 -150
  347. package/dist/regenerate/testing.js +0 -438
  348. package/dist/regenerate/transcript-view.d.ts +0 -21
  349. package/dist/regenerate/unit-gate.d.ts +0 -27
  350. package/dist/regenerate/unit-gate.js +0 -20
  351. package/dist/regenerate/unit-review.d.ts +0 -152
  352. package/dist/regenerate/unit-review.js +0 -361
  353. package/dist/regenerate/web.d.ts +0 -61
  354. package/dist/regenerate/web.js +0 -256
  355. package/dist/regenerate/workspace.d.ts +0 -12
  356. package/dist/regenerate/workspace.js +0 -99
  357. package/dist/regenerate-cli.d.ts +0 -1
  358. package/dist/reopen.d.ts +0 -29
  359. package/dist/reopen.js +0 -47
  360. package/dist/resume-line.d.ts +0 -5
  361. package/dist/review/live.d.ts +0 -72
  362. package/dist/review/live.js +0 -166
  363. package/dist/rules.d.ts +0 -20
  364. package/dist/rules.js +0 -47
  365. package/dist/run-report.d.ts +0 -88
  366. package/dist/run-report.js +0 -338
  367. package/dist/screen-padding.d.ts +0 -28
  368. package/dist/self-invocation.d.ts +0 -36
  369. package/dist/self-invocation.js +0 -137
  370. package/dist/sentinel-chat.d.ts +0 -19
  371. package/dist/sentinel-chat.js +0 -221
  372. package/dist/sentinel-check.d.ts +0 -36
  373. package/dist/sentinel-check.js +0 -78
  374. package/dist/sentinel.d.ts +0 -107
  375. package/dist/sentinel.js +0 -599
  376. package/dist/settings.d.ts +0 -45
  377. package/dist/settings.js +0 -378
  378. package/dist/setup.d.ts +0 -97
  379. package/dist/setup.js +0 -436
  380. package/dist/skill-progress.d.ts +0 -46
  381. package/dist/skill.d.ts +0 -102
  382. package/dist/skill.js +0 -147
  383. package/dist/skills.d.ts +0 -54
  384. package/dist/skills.js +0 -111
  385. package/dist/spawn-async.d.ts +0 -18
  386. package/dist/spawn-async.js +0 -35
  387. package/dist/stack.d.ts +0 -80
  388. package/dist/stack.js +0 -206
  389. package/dist/stdlib.d.ts +0 -43
  390. package/dist/stdlib.js +0 -118
  391. package/dist/surface.d.ts +0 -5
  392. package/dist/surface.js +0 -18
  393. package/dist/terminal-images.d.ts +0 -2
  394. package/dist/test-plain-files.d.ts +0 -41
  395. package/dist/test-plain-files.js +0 -172
  396. package/dist/tools.d.ts +0 -101
  397. package/dist/tools.js +0 -242
  398. package/dist/turri-versions.d.ts +0 -71
  399. package/genome/capture/capture.md +0 -26
  400. package/genome/capture/check-conventions.md +0 -5
  401. package/genome/capture/check-reference.md +0 -11
  402. package/genome/capture/concepts.md +0 -3
  403. package/genome/capture/divide.md +0 -9
  404. package/genome/capture/feature.md +0 -45
  405. package/genome/capture/interface.md +0 -9
  406. package/genome/capture/modules.md +0 -23
  407. package/genome/capture/outline.md +0 -11
  408. package/genome/capture/readability.md +0 -12
  409. package/genome/capture/reference.md +0 -10
  410. package/genome/capture/split.md +0 -9
  411. package/genome/capture/survey.md +0 -37
  412. package/genome/capture/trial.md +0 -18
  413. package/genome/capture/verify.md +0 -7
  414. package/genome/rules/bullet-continuation.md +0 -61
  415. package/genome/rules/concise-specs-examples.md +0 -460
  416. package/genome/rules/concise-specs-integration-examples.md +0 -281
  417. package/genome/rules/concise-specs.md +0 -80
  418. package/genome/rules/definitions.md +0 -107
  419. package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
  420. package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
  421. package/genome/rules/exported-concepts.md +0 -39
  422. package/genome/rules/func-specs.md +0 -164
  423. package/genome/rules/impl-reqs.md +0 -68
  424. package/genome/rules/import-modules.md +0 -49
  425. package/genome/rules/integration-embedded-testing.md +0 -273
  426. package/genome/rules/integration-embedded.md +0 -171
  427. package/genome/rules/integration-standalone.md +0 -135
  428. package/genome/rules/integrations.md +0 -136
  429. package/genome/rules/linked-resources.md +0 -76
  430. package/genome/rules/module-structure.md +0 -112
  431. package/genome/rules/project-model.md +0 -69
  432. package/genome/rules/required-concepts.md +0 -44
  433. package/genome/rules/requires-modules.md +0 -81
  434. package/genome/rules/semantic-ids.md +0 -49
  435. package/genome/rules/stdlib.md +0 -37
  436. package/genome/rules/test-plain-files.md +0 -138
  437. package/genome/rules/test-reqs.md +0 -57
  438. package/genome/rules/turri-regeneration.md +0 -66
  439. package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
  440. package/genome/skills/analyze-func-specs/SKILL.md +0 -137
  441. package/genome/skills/break-down-func-spec/SKILL.md +0 -229
  442. package/genome/skills/consolidate-concepts/SKILL.md +0 -192
  443. package/genome/skills/convert-old-syntax/SKILL.md +0 -68
  444. package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
  445. package/genome/skills/debug-specs/SKILL.md +0 -194
  446. package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
  447. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
  448. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
  449. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
  450. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
  451. package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
  452. package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
  453. package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
  454. package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
  455. package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
  456. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
  457. package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
  458. package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
  459. package/genome/skills/refactor-module/SKILL.md +0 -218
  460. package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
  461. package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
  462. package/stdlib/backend/common.plain +0 -25
  463. package/stdlib/backend/conformance/common.plain +0 -12
  464. package/stdlib/backend/conformance/go-gin.plain +0 -9
  465. package/stdlib/backend/conformance/go-nethttp.plain +0 -9
  466. package/stdlib/backend/conformance/java-springboot.plain +0 -9
  467. package/stdlib/backend/conformance/python-django.plain +0 -9
  468. package/stdlib/backend/conformance/python-fastapi.plain +0 -9
  469. package/stdlib/backend/conformance/python-flask.plain +0 -9
  470. package/stdlib/backend/conformance/rust-axum.plain +0 -9
  471. package/stdlib/backend/conformance/typescript-express.plain +0 -9
  472. package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
  473. package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
  474. package/stdlib/backend/go-gin.plain +0 -18
  475. package/stdlib/backend/go-nethttp.plain +0 -18
  476. package/stdlib/backend/java-springboot.plain +0 -19
  477. package/stdlib/backend/python-django.plain +0 -19
  478. package/stdlib/backend/python-fastapi.plain +0 -23
  479. package/stdlib/backend/python-flask.plain +0 -23
  480. package/stdlib/backend/rust-axum.plain +0 -17
  481. package/stdlib/backend/typescript-express.plain +0 -19
  482. package/stdlib/backend/typescript-fastify.plain +0 -19
  483. package/stdlib/backend/typescript-nestjs.plain +0 -19
  484. package/stdlib/cli/common.plain +0 -17
  485. package/stdlib/cli/conformance/common.plain +0 -11
  486. package/stdlib/cli/conformance/go-cobra.plain +0 -9
  487. package/stdlib/cli/conformance/go-flag.plain +0 -9
  488. package/stdlib/cli/conformance/java-picocli.plain +0 -9
  489. package/stdlib/cli/conformance/python-argparse.plain +0 -9
  490. package/stdlib/cli/conformance/python-click.plain +0 -9
  491. package/stdlib/cli/conformance/python-typer.plain +0 -9
  492. package/stdlib/cli/conformance/rust-clap.plain +0 -9
  493. package/stdlib/cli/conformance/typescript-commander.plain +0 -9
  494. package/stdlib/cli/go-cobra.plain +0 -14
  495. package/stdlib/cli/go-flag.plain +0 -14
  496. package/stdlib/cli/java-picocli.plain +0 -15
  497. package/stdlib/cli/python-argparse.plain +0 -18
  498. package/stdlib/cli/python-click.plain +0 -16
  499. package/stdlib/cli/python-typer.plain +0 -16
  500. package/stdlib/cli/rust-clap.plain +0 -14
  501. package/stdlib/cli/typescript-commander.plain +0 -17
  502. package/stdlib/frontend/angular.plain +0 -17
  503. package/stdlib/frontend/common.plain +0 -17
  504. package/stdlib/frontend/conformance/angular.plain +0 -5
  505. package/stdlib/frontend/conformance/common.plain +0 -11
  506. package/stdlib/frontend/conformance/react-vite.plain +0 -5
  507. package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
  508. package/stdlib/frontend/conformance/vue-vite.plain +0 -5
  509. package/stdlib/frontend/react-vite.plain +0 -16
  510. package/stdlib/frontend/sveltekit-spa.plain +0 -16
  511. package/stdlib/frontend/vue-vite.plain +0 -16
  512. package/stdlib/lang/go.plain +0 -13
  513. package/stdlib/lang/java.plain +0 -12
  514. package/stdlib/lang/python.plain +0 -18
  515. package/stdlib/lang/rust.plain +0 -12
  516. package/stdlib/lang/typescript.plain +0 -13
  517. package/stdlib/library/common.plain +0 -15
  518. package/stdlib/library/conformance/common.plain +0 -9
  519. package/stdlib/library/conformance/go.plain +0 -9
  520. package/stdlib/library/conformance/java-gradle.plain +0 -9
  521. package/stdlib/library/conformance/java-maven.plain +0 -9
  522. package/stdlib/library/conformance/python.plain +0 -9
  523. package/stdlib/library/conformance/rust.plain +0 -9
  524. package/stdlib/library/conformance/typescript.plain +0 -9
  525. package/stdlib/library/go.plain +0 -12
  526. package/stdlib/library/java-gradle.plain +0 -13
  527. package/stdlib/library/java-maven.plain +0 -13
  528. package/stdlib/library/python.plain +0 -13
  529. package/stdlib/library/rust.plain +0 -12
  530. package/stdlib/library/typescript.plain +0 -15
@@ -1,283 +0,0 @@
1
- import { spawnSync } from "node:child_process";
2
- import { existsSync, realpathSync } from "node:fs";
3
- import { basename, dirname, join, resolve, sep } from "node:path";
4
- import { spawnAsync } from "../spawn-async.js";
5
- /** The caps set inside the sandbox before the command runs: processes, and file size in 1024-byte blocks (8 GiB). */
6
- export const PROCESS_CAP = 4096;
7
- export const FILE_SIZE_CAP_BLOCKS = 8 * 1024 * 1024;
8
- /** A folder as the kernel sees it - symlinks resolved as far as it exists - since that is what both sandboxes check. */
9
- function real(path) {
10
- // Neither sandbox runs on Windows: the paths are kept as they are, so what is generated is the same everywhere.
11
- if (process.platform === "win32")
12
- return path;
13
- let head = resolve(path);
14
- const tail = [];
15
- for (;;) {
16
- if (existsSync(head))
17
- return join(realpathSync(head), ...tail.reverse());
18
- const parent = dirname(head);
19
- if (parent === head)
20
- return resolve(path);
21
- tail.push(basename(head));
22
- head = parent;
23
- }
24
- }
25
- /** What of macOS a command needs to read beyond the toolchains, besides `/usr`, `/bin`, `/System`: the loader's caches, the time zone, the developer tools. */
26
- export const MACOS_MACHINE = [
27
- "/usr",
28
- "/bin",
29
- "/sbin",
30
- "/System",
31
- "/Library/Apple",
32
- "/Library/Developer",
33
- "/Library/Java",
34
- "/Library/Frameworks",
35
- "/Library/Preferences",
36
- "/private/etc",
37
- "/private/var/db/timezone",
38
- "/private/var/db/dyld",
39
- "/private/var/select",
40
- "/opt/homebrew",
41
- "/opt/local",
42
- "/Applications/Xcode.app",
43
- "/dev",
44
- ];
45
- /** What of Linux a command needs to read beyond the toolchains. */
46
- export const LINUX_MACHINE = ["/usr", "/bin", "/sbin", "/lib", "/lib32", "/lib64", "/libx32", "/etc", "/opt", "/nix", "/snap", "/run/systemd/resolve"];
47
- /**
48
- * What of the machine a command reads, from the environment it runs in: the system's folders, every folder on its PATH,
49
- * the folders its toolchain variables point at, and the project's `toolchains:`. Only the PATH folders themselves, not
50
- * their parents - `~/.cargo/bin`, not `~/.cargo`, which holds a registry's credentials - but for a version manager's
51
- * install: a `bin` whose parent is a version, `…/installs/node/24.16.0/bin`, links its tools into the install beside it
52
- * (`npm` into `lib/node_modules`), and an install holds the toolchain, never a credential.
53
- */
54
- export function machineFor(env, toolchainVariables, extra = [], platform = process.platform) {
55
- const base = platform === "darwin" ? MACOS_MACHINE : platform === "linux" ? LINUX_MACHINE : [];
56
- const onPath = (env.PATH ?? "").split(platform === "win32" ? ";" : ":").filter((dir) => dir.startsWith("/"));
57
- const installs = onPath.flatMap((dir) => {
58
- const install = /^(.*\/v?\d+\.\d+(?:\.\d+)?[^/]*)\/bin\/?$/.exec(dir)?.[1];
59
- return install !== undefined ? [install] : [];
60
- });
61
- const located = toolchainVariables.map((name) => env[name]).filter((dir) => dir !== undefined && dir.startsWith("/"));
62
- return [...new Set([...base, ...onPath, ...installs, ...located, ...extra])];
63
- }
64
- function sbplString(path) {
65
- return `"${path.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
66
- }
67
- /**
68
- * The Seatbelt profile for a fence. Everything is allowed but what it names - reading file contents outside the
69
- * allow-list, writing outside the writable folders, the code record, Unix sockets outside the folders, signals and
70
- * process information beyond the sandbox - later rules winning over earlier ones. File metadata stays readable, as
71
- * resolving a path needs.
72
- */
73
- export function seatbeltProfile(fence, userDirs = darwinUserDirs()) {
74
- // The machine's folders as given - they are the system's own spelling; the fence's with their symlinks resolved.
75
- const subpaths = (paths, resolveLinks = true) => paths.map((path) => ` (subpath ${sbplString(resolveLinks ? real(path) : path)})`).join("\n");
76
- const readable = [...fence.read, ...fence.write, ...fence.writable];
77
- const writable = [...fence.write, ...fence.writable];
78
- return [
79
- "(version 1)",
80
- "(allow default)",
81
- ";; Reading: the machine's allow-list and the fence, nothing else.",
82
- "(deny file-read-data file-read-xattr)",
83
- "(allow file-read-data file-read-xattr",
84
- ' (literal "/")',
85
- ' (literal "/etc") (literal "/var") (literal "/tmp") (literal "/private/var/run/resolv.conf")',
86
- subpaths(fence.machine, false),
87
- subpaths(readable),
88
- ")",
89
- ";; Writing: its own folders, the module's home, TMPDIR and caches, the devices.",
90
- "(deny file-write*)",
91
- "(allow file-write*",
92
- subpaths(writable),
93
- ' (literal "/dev/null") (literal "/dev/zero") (literal "/dev/tty") (literal "/dev/dtracehelper")',
94
- ' (regex #"^/dev/fd/")',
95
- ")",
96
- ...darwinToolCaches(userDirs),
97
- ";; The code record is the harness's. (A wildcard deny does not override an allow of one operation: each is named.)",
98
- ...(fence.deny.length > 0 ? [`(deny file-read-data file-read-xattr file-write*${fence.deny.map((path) => ` (literal ${sbplString(real(path))})`).join("")})`] : []),
99
- ";; No Unix socket outside its folders: the Docker daemon, an SSH agent, the person's services.",
100
- "(deny network-outbound (remote unix-socket))",
101
- `(allow network-outbound (remote unix-socket (path-literal "/private/var/run/mDNSResponder")) (remote unix-socket (subpath ${sbplString(real(fence.cwd))}))${writable.map((path) => ` (remote unix-socket (subpath ${sbplString(real(path))}))`).join("")})`,
102
- ";; Signals and process information: only within this sandbox.",
103
- "(deny signal)",
104
- "(allow signal (target same-sandbox))",
105
- "(deny process-info*)",
106
- "(allow process-info* (target same-sandbox))",
107
- "(allow process-info-pidinfo process-info-setcontrol (target self))",
108
- "",
109
- ].join("\n");
110
- }
111
- /** macOS's per-user temporary and cache folders, as `getconf` gives them - asked once. */
112
- let darwinDirs;
113
- export function darwinUserDirs() {
114
- if (darwinDirs !== undefined)
115
- return darwinDirs;
116
- const ask = (name) => {
117
- if (process.platform !== "darwin")
118
- return undefined;
119
- const run = spawnSync("getconf", [name], { encoding: "utf8", timeout: 5000 });
120
- const dir = run.status === 0 ? run.stdout.trim().replace(/\/$/, "") : "";
121
- return dir !== "" ? real(dir) : undefined;
122
- };
123
- darwinDirs = { temp: ask("DARWIN_USER_TEMP_DIR"), cache: ask("DARWIN_USER_CACHE_DIR") };
124
- return darwinDirs;
125
- }
126
- /**
127
- * The developer tools' own scratch files on macOS: `xcrun` (behind `/usr/bin/git`, `clang`, `make`) keeps a database in
128
- * the per-user temporary folder, and clang its module cache in the per-user cache folder - whatever TMPDIR says.
129
- */
130
- function darwinToolCaches({ temp, cache }) {
131
- const rules = [];
132
- const regex = (path) => path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
133
- if (temp !== undefined)
134
- rules.push(`(allow file-read-data file-write* (regex #"^${regex(temp)}/xcrun_db"))`);
135
- if (cache !== undefined)
136
- rules.push(`(allow file-read-data file-write* (subpath ${sbplString(join(cache, "clang"))}) (subpath ${sbplString(join(cache, "com.apple.dt.xcrun"))}))`);
137
- return rules.length > 0 ? [";; The developer tools' own scratch files.", ...rules] : [];
138
- }
139
- /** The bubblewrap arguments for a fence, up to the command. `proc: "bind"` binds the host's /proc where mounting one is refused. */
140
- export function bubblewrapArgs(fence, options = { proc: "mount" }) {
141
- const args = ["--die-with-parent", "--unshare-pid", "--unshare-ipc", "--unshare-uts", "--unshare-cgroup-try"];
142
- for (const path of fence.machine)
143
- args.push("--ro-bind-try", path, path);
144
- args.push(...(options.proc === "mount" ? ["--proc", "/proc"] : ["--ro-bind", "/proc", "/proc"]));
145
- args.push("--dev", "/dev", "--tmpfs", "/tmp");
146
- for (const path of fence.read)
147
- args.push("--ro-bind", real(path), real(path));
148
- for (const path of [...fence.write, ...fence.writable])
149
- args.push("--bind", real(path), real(path));
150
- // The record: covered by an empty file, unreadable and unwritable.
151
- for (const path of fence.deny)
152
- if (existsSync(path))
153
- args.push("--ro-bind", "/dev/null", real(path));
154
- args.push("--chdir", real(fence.cwd));
155
- return args;
156
- }
157
- /** The caps, set inside the sandbox, then the command itself. */
158
- function capped(argv) {
159
- const caps = `ulimit -S -u ${PROCESS_CAP} 2>/dev/null; ulimit -S -f ${FILE_SIZE_CAP_BLOCKS} 2>/dev/null; exec "$@"`;
160
- return ["/bin/bash", "-c", caps, "turri", ...argv];
161
- }
162
- /** How a command is run behind the wall that is up: for the host runner's `wrap`. Where none is, it runs as it is. */
163
- export function sandboxWrap(wall, fence) {
164
- if (wall.kind === "seatbelt")
165
- return (argv) => ["/usr/bin/sandbox-exec", "-p", seatbeltProfile(fence), ...capped(argv)];
166
- if (wall.kind === "bubblewrap")
167
- return (argv) => ["bwrap", ...bubblewrapArgs(fence, { proc: wall.proc }), "--", ...capped(argv)];
168
- return (argv) => argv;
169
- }
170
- /** What bubblewrap's refusal to start says is missing, and how to give it - each failure has a message of its own. */
171
- export function whyBubblewrapFailed(output) {
172
- if (/ENOENT|not found|No such file or directory: 'bwrap'|spawnSync bwrap/i.test(output) && !/Can't mount/.test(output)) {
173
- return { why: "bubblewrap is not installed", fix: "install it: `apt install bubblewrap` (or your distribution's package)" };
174
- }
175
- if (/Creating new namespace failed: Operation not permitted|No permissions to create a new namespace/.test(output)) {
176
- return {
177
- why: "this machine does not let an unprivileged process create a user namespace",
178
- fix: "in Docker, run the container as a user that is not root (`--user`), with `--security-opt seccomp=unconfined`; on the host, `sysctl -w kernel.unprivileged_userns_clone=1`",
179
- };
180
- }
181
- if (/setting up uid map: Permission denied|Failed to make \/ slave: Permission denied/.test(output)) {
182
- return {
183
- why: "AppArmor keeps bubblewrap from setting up its namespace",
184
- fix: "in Docker, add `--security-opt apparmor=unconfined`; on Ubuntu 24.04, `sysctl -w kernel.apparmor_restrict_unprivileged_userns=0` or an AppArmor profile for bwrap",
185
- };
186
- }
187
- if (/Can't mount proc on (\/newroot)?\/proc/.test(output)) {
188
- return { why: "the container masks /proc", fix: "in Docker, add `--security-opt systempaths=unconfined`" };
189
- }
190
- return { why: `bubblewrap did not start: ${output.trim().split("\n")[0] ?? "no reason given"}` };
191
- }
192
- let probed;
193
- /** For tests: forget what was found, or say what to find. */
194
- export function setSandboxForTests(wall) {
195
- probed = wall;
196
- }
197
- /**
198
- * Which wall is up on this machine - tried once, by starting a sandbox that runs `true` - and, when none starts, why
199
- * and how to give it one.
200
- */
201
- export function sandboxAvailable() {
202
- if (probed !== undefined)
203
- return probed;
204
- probed = probe();
205
- return probed;
206
- }
207
- /** Which wall would be up with `env`'s PATH - doctor's for a host whose engine runs with another PATH; tried each time. */
208
- export function sandboxWith(env) {
209
- return env === process.env ? sandboxAvailable() : probe(env);
210
- }
211
- /** Which wall would be up with `env`'s PATH, as `sandboxWith` finds - its probes run without holding the thread up. */
212
- export async function sandboxWithAsync(env = process.env) {
213
- if (env === process.env && probed !== undefined)
214
- return probed;
215
- const settled = noProbe();
216
- let wall;
217
- if (settled !== undefined)
218
- wall = settled;
219
- else if (process.platform === "darwin")
220
- wall = seatbeltWall(await spawnAsync(SEATBELT_PROBE[0], SEATBELT_PROBE.slice(1), { timeout: 10_000 }));
221
- else {
222
- const mounted = await spawnAsync("bwrap", bubblewrapProbe("mount"), { timeout: 10_000, env });
223
- wall = bubblewrapWall(mounted, needsBind(mounted) ? await spawnAsync("bwrap", bubblewrapProbe("bind"), { timeout: 10_000, env }) : undefined);
224
- }
225
- if (env === process.env)
226
- probed = wall;
227
- return wall;
228
- }
229
- function probe(env = process.env) {
230
- const settled = noProbe();
231
- if (settled !== undefined)
232
- return settled;
233
- if (process.platform === "darwin")
234
- return seatbeltWall(spawnSync(SEATBELT_PROBE[0], SEATBELT_PROBE.slice(1), { encoding: "utf8", timeout: 10_000 }));
235
- const tryProc = (proc) => spawnSync("bwrap", bubblewrapProbe(proc), { encoding: "utf8", timeout: 10_000, env });
236
- const mounted = tryProc("mount");
237
- return bubblewrapWall(mounted, needsBind(mounted) ? tryProc("bind") : undefined);
238
- }
239
- /** The wall where nothing need be run to tell: no Seatbelt to try, or a platform turri drives none on. */
240
- function noProbe() {
241
- if (process.platform === "darwin")
242
- return existsSync("/usr/bin/sandbox-exec") ? undefined : { kind: "none", why: "this macOS has no sandbox-exec (Seatbelt)" };
243
- if (process.platform === "linux")
244
- return undefined;
245
- if (process.platform === "win32")
246
- return { kind: "none", why: "Windows has no OS sandbox turri drives: the command check and the audit hold alone" };
247
- return { kind: "none", why: `${process.platform} has no OS sandbox turri drives` };
248
- }
249
- /** A sandbox that runs `true`, on macOS. */
250
- const SEATBELT_PROBE = ["/usr/bin/sandbox-exec", "-p", "(version 1)(allow default)", "/usr/bin/true"];
251
- function seatbeltWall(run) {
252
- return run.status === 0 ? { kind: "seatbelt" } : { kind: "none", why: `Seatbelt did not start: ${(run.stderr || String(run.error ?? "")).trim()}` };
253
- }
254
- /** bubblewrap's arguments for a sandbox that runs `true`, its /proc mounted or bound. */
255
- function bubblewrapProbe(proc) {
256
- return ["--ro-bind", "/", "/", ...(proc === "mount" ? ["--proc", "/proc"] : ["--ro-bind", "/proc", "/proc"]), "--dev", "/dev", "--unshare-pid", "--", "true"];
257
- }
258
- const probeOutput = (run) => `${run.stderr ?? ""}${run.error !== undefined ? String(run.error) : ""}`;
259
- /** Whether bubblewrap failed only to mount a /proc - tried again binding the host's. */
260
- function needsBind(mounted) {
261
- return mounted.status !== 0 && /Can't mount proc on (\/newroot)?\/proc/.test(probeOutput(mounted));
262
- }
263
- function bubblewrapWall(mounted, bound) {
264
- if (mounted.status === 0)
265
- return { kind: "bubblewrap", proc: "mount" };
266
- if (bound?.status === 0)
267
- return { kind: "bubblewrap", proc: "bind" };
268
- return { kind: "none", ...whyBubblewrapFailed(probeOutput(mounted)) };
269
- }
270
- /** Whether `path` is one of the fence's roots or under one - for the tests and the audit. */
271
- export function underAny(path, roots) {
272
- const target = real(path);
273
- return roots.some((root) => {
274
- const base = real(root);
275
- return target === base || target.startsWith(base + sep);
276
- });
277
- }
278
- /** Where the agents' commands run, in one line for the person: which walls are up, or that only the shared ones are. */
279
- export function sandboxSummary(wall = sandboxAvailable()) {
280
- if (wall.kind === "none")
281
- return { level: "limited", text: `agents' commands run on this machine behind the command check and the audit - no OS sandbox: ${wall.why} (turri doctor)` };
282
- return { level: "ok", text: `agents' commands run on this machine behind the command check, ${wall.kind === "seatbelt" ? "Seatbelt" : "bubblewrap"} and the audit` };
283
- }
@@ -1,23 +0,0 @@
1
- /** The columns the panel takes beside the chat: half of what they share, the rule between them in the middle - 0 when that is too narrow to share. */
2
- export declare function dockedWidth(columns: number): number;
3
- /**
4
- * The chat narrowed by `panelWidth()` columns, read at each frame - 0 gives it the whole width. Returns what gives it the
5
- * whole width back for good.
6
- */
7
- export declare function narrowChat(tui: object, panelWidth: () => number): () => void;
8
- /**
9
- * A press of a mouse button, as pi's full screen takes it - `side` told whether it was in the chat, left of `chatWidth()`
10
- * columns, or in the panel - before the press goes on as it would have. Motion and the wheel are not presses. pi's
11
- * regular screen reads no mouse: nothing is done there. Returns what takes the watch off.
12
- */
13
- export declare function clickToFocus(tui: object, chatWidth: () => number, side: (side: "chat" | "panel") => void): () => void;
14
- /**
15
- * A line drawn faint - the side that does not have the keys, in the shade. Faint (SGR 2) holds through a line's colours;
16
- * only a reset - SGR 0, or 22 - ends it, so it is set again after each one. A line holding an image is left as it is.
17
- */
18
- export declare function shade(line: string): string;
19
- /**
20
- * The chat in the shade while `shaded()`: each of its rows drawn faint as the screen lays the overlays over it - the
21
- * docked panel the last of them, which covers its own columns. Returns what takes the shade off.
22
- */
23
- export declare function shadeChat(tui: object, shaded: () => boolean): () => void;
@@ -1,110 +0,0 @@
1
- /** A module's code record and its tests' - `code/.turri.json`, `tests/.turri.json` (records.ts). */
2
- export declare const RECORD_FILE = ".turri.json";
3
- /** What a codebase started from, when it started from a base folder (base-folder.ts): beside the code record, never code. */
4
- export declare const BASE_RECORD_FILE = ".turri-base.json";
5
- /**
6
- * The ***plain standard library: import modules for generic pieces of software that ship with turri,
7
- * imported as `stdlib/backend/python-fastapi` - a reserved name (see plain/stdlib.ts).
8
- */
9
- export declare const STDLIB_DIR: string;
10
- /**
11
- * Where a module's generated code and tests live.
12
- *
13
- * Everything a module produces sits under `plain_modules/<module>/`, next to the specs it
14
- * came from and inside the project's own repository: `code/` holds the implementation and
15
- * its unit tests, `tests/` the black-box conformance tests - of every functionality built so
16
- * far, the required modules' included, organised however suits them.
17
- * The build state is written into `code/`, so what a codebase contains travels with that
18
- * codebase instead of living in a scratch directory that can be cleared without anyone
19
- * noticing the specs and the code have drifted apart.
20
- */
21
- /**
22
- * Whether `path` is `root` or inside it, in this machine's paths: on Windows a path is not under `C:\x` by starting
23
- * with `C:\x/`, and one on another drive is outside whatever its text.
24
- */
25
- export declare function isWithin(path: string, root: string): boolean;
26
- /**
27
- * A path written with `/` on every machine. A relative one is a name, as git and ***plain write one: shown, compared or
28
- * put in a diff - a file of a codebase, a .plain file from the project. An absolute one is a path handed to bash, which
29
- * on Windows is Git Bash, whose tools may read a backslash as an escape: Windows and Git Bash both take `C:/Users`.
30
- * Opening a file in turri still goes through `join`.
31
- */
32
- export declare function slashed(path: string): string;
33
- export declare const MODULES_DIR = "plain_modules";
34
- export declare function moduleDir(moduleName: string, cwd?: string): string;
35
- /** Implementation and unit tests: `plain_modules/<module>/code`. */
36
- export declare function defaultBuildDir(moduleName: string, cwd?: string): string;
37
- /**
38
- * The directory every module's output hangs off, `plain_modules` by default.
39
- *
40
- * Callers override this to build somewhere else - a sandbox, a test fixture - and the
41
- * layout underneath it stays the same.
42
- */
43
- /**
44
- * The project a spec belongs to: the nearest folder, from the spec's own up, that holds a
45
- * `config.turri.yaml`, a module's `config.turri.<module>.yaml`, the `config.yaml` turri read before it had a file of
46
- * its own, or a `plain_modules` - where its code is built, its config read, its testing scripts found. Without any, the
47
- * spec's own folder. So `plain/hubspot.plain`, beside `plain/config.turri.yaml` and `plain/plain_modules`, is built there,
48
- * wherever turri was started;
49
- * specs at the root of their project are built where they always were.
50
- */
51
- export declare function projectDirOf(plainFile: string): string;
52
- /** Whether a folder says it is a project: it holds a config file or `plain_modules/`. */
53
- export declare function isProjectDir(dir: string): boolean;
54
- export declare function modulesRoot(cwd?: string): string;
55
- export declare function buildDirUnder(root: string, moduleName: string): string;
56
- export declare function testsDirUnder(root: string, moduleName: string): string;
57
- /**
58
- * The `plain_modules` a directory sits in: what holds every module's code and tests. A
59
- * directory outside one - a sandbox, an explicit `--build-dir` - is its own root, so this
60
- * never silently widens to a whole disk.
61
- */
62
- export declare function modulesRootOf(dir: string): string;
63
- /**
64
- * `.turri` inside the modules root: what turri keeps beside the code - the package
65
- * caches, the modules' homes and temporary folders, the copies test runs happen in, the
66
- * outputs kept for read_output. Ignored by the project's history.
67
- */
68
- export declare function modulesScratchDir(dir: string): string;
69
- /** Make `path` inside the modules' scratch, which ignores itself. Returns `path`. */
70
- export declare function ensureInModulesScratch(dir: string, path: string): string;
71
- /** Where the project keeps what a launch puts out: `dist/`, beside `plain_modules`. */
72
- export declare const DIST_DIR = "dist";
73
- /**
74
- * Where a person tries a module: `<project>/dist/<module>`, the module's code as its last commit has
75
- * it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every launch.
76
- */
77
- export declare function distDirFor(projectDir: string, moduleName: string): string;
78
- /**
79
- * The project a directory belongs to: the one `plain_modules` sits in, when the directory is
80
- * inside it; otherwise the directory's parent for a build folder, or the directory itself.
81
- */
82
- export declare function projectRootOf(dir: string): string;
83
- /**
84
- * `.turri` in the project: the harness's own scratch space - copies to try things in,
85
- * saved agent sessions. Never part of the project's history, so it ignores itself - but for `skills/`, the
86
- * project's own skills.
87
- */
88
- export declare function scratchDir(dir: string): string;
89
- /**
90
- * Where a skill run keeps its state - the manifest an interrupted run resumes from, the evidence
91
- * each phase's gate is judged on: `.turri/runs/<skill>` in the project, beside the rest of
92
- * turri's scratch, ignored by the project's history like it.
93
- */
94
- export declare function skillRunDir(cwd: string, skillName: string): string;
95
- /**
96
- * What the scratch dir's .gitignore says: everything in it is ignored but `skills/` - the project's own skills
97
- * (skills.ts), which are written by hand and kept in its history.
98
- */
99
- export declare const SCRATCH_IGNORE = "*\n!skills/\n!skills/**\n";
100
- /** Make `path`, inside a scratch dir, and see that the scratch dir ignores itself, its skills apart. Returns `path`. */
101
- export declare function ensureInScratch(scratch: string, path: string): string;
102
- /** Where agent sessions are saved, so what an agent did can be read - and resumed - later. */
103
- export declare function sessionsDir(project: string): string;
104
- /**
105
- * Template search order, matching file_utils.get_template_directories: the plain file's
106
- * own directory first, then a sibling `template/` directory if there is one (where a
107
- * project keeps its import modules), then anything passed in, then PLAIN_TEMPLATE_DIRS.
108
- * A `stdlib/...` import is not looked for in them: it is turri's (see plain/stdlib.ts).
109
- */
110
- export declare function resolveTemplateDirs(plainFile: string, extra?: string[]): string[];
@@ -1,190 +0,0 @@
1
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
2
- import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- /** A module's code record and its tests' - `code/.turri.json`, `tests/.turri.json` (records.ts). */
5
- export const RECORD_FILE = ".turri.json";
6
- /** What a codebase started from, when it started from a base folder (base-folder.ts): beside the code record, never code. */
7
- export const BASE_RECORD_FILE = ".turri-base.json";
8
- /**
9
- * The ***plain standard library: import modules for generic pieces of software that ship with turri,
10
- * imported as `stdlib/backend/python-fastapi` - a reserved name (see plain/stdlib.ts).
11
- */
12
- export const STDLIB_DIR = join(dirname(dirname(dirname(fileURLToPath(import.meta.url)))), "stdlib");
13
- /**
14
- * Where a module's generated code and tests live.
15
- *
16
- * Everything a module produces sits under `plain_modules/<module>/`, next to the specs it
17
- * came from and inside the project's own repository: `code/` holds the implementation and
18
- * its unit tests, `tests/` the black-box conformance tests - of every functionality built so
19
- * far, the required modules' included, organised however suits them.
20
- * The build state is written into `code/`, so what a codebase contains travels with that
21
- * codebase instead of living in a scratch directory that can be cleared without anyone
22
- * noticing the specs and the code have drifted apart.
23
- */
24
- /**
25
- * Whether `path` is `root` or inside it, in this machine's paths: on Windows a path is not under `C:\x` by starting
26
- * with `C:\x/`, and one on another drive is outside whatever its text.
27
- */
28
- export function isWithin(path, root) {
29
- const from = relative(root, path);
30
- return from === "" || (from !== ".." && !from.startsWith(`..${sep}`) && !isAbsolute(from));
31
- }
32
- /**
33
- * A path written with `/` on every machine. A relative one is a name, as git and ***plain write one: shown, compared or
34
- * put in a diff - a file of a codebase, a .plain file from the project. An absolute one is a path handed to bash, which
35
- * on Windows is Git Bash, whose tools may read a backslash as an escape: Windows and Git Bash both take `C:/Users`.
36
- * Opening a file in turri still goes through `join`.
37
- */
38
- export function slashed(path) {
39
- return sep === "/" ? path : path.split(sep).join("/");
40
- }
41
- export const MODULES_DIR = "plain_modules";
42
- export function moduleDir(moduleName, cwd = process.cwd()) {
43
- return join(cwd, MODULES_DIR, moduleName);
44
- }
45
- /** Implementation and unit tests: `plain_modules/<module>/code`. */
46
- export function defaultBuildDir(moduleName, cwd = process.cwd()) {
47
- return join(moduleDir(moduleName, cwd), "code");
48
- }
49
- /**
50
- * The directory every module's output hangs off, `plain_modules` by default.
51
- *
52
- * Callers override this to build somewhere else - a sandbox, a test fixture - and the
53
- * layout underneath it stays the same.
54
- */
55
- /**
56
- * The project a spec belongs to: the nearest folder, from the spec's own up, that holds a
57
- * `config.turri.yaml`, a module's `config.turri.<module>.yaml`, the `config.yaml` turri read before it had a file of
58
- * its own, or a `plain_modules` - where its code is built, its config read, its testing scripts found. Without any, the
59
- * spec's own folder. So `plain/hubspot.plain`, beside `plain/config.turri.yaml` and `plain/plain_modules`, is built there,
60
- * wherever turri was started;
61
- * specs at the root of their project are built where they always were.
62
- */
63
- export function projectDirOf(plainFile) {
64
- const start = dirname(resolve(plainFile));
65
- for (let dir = start;; dir = dirname(dir)) {
66
- if (isProjectDir(dir))
67
- return dir;
68
- if (dirname(dir) === dir)
69
- return start;
70
- }
71
- }
72
- /** Whether a folder says it is a project: it holds a config file or `plain_modules/`. */
73
- export function isProjectDir(dir) {
74
- return existsSync(join(dir, "config.yaml")) || existsSync(join(dir, MODULES_DIR)) || hasModuleConfig(dir);
75
- }
76
- /** Whether a folder holds a config file - config.turri.yaml, a module's config.turri.<module>.yaml, or one in the old naming - which makes it a project too. */
77
- function hasModuleConfig(dir) {
78
- try {
79
- return readdirSync(dir).some((name) => /^config\..+\.yaml$/.test(name));
80
- }
81
- catch {
82
- return false;
83
- }
84
- }
85
- export function modulesRoot(cwd = process.cwd()) {
86
- return join(cwd, MODULES_DIR);
87
- }
88
- export function buildDirUnder(root, moduleName) {
89
- return join(root, moduleName, "code");
90
- }
91
- export function testsDirUnder(root, moduleName) {
92
- return join(root, moduleName, "tests");
93
- }
94
- /**
95
- * The `plain_modules` a directory sits in: what holds every module's code and tests. A
96
- * directory outside one - a sandbox, an explicit `--build-dir` - is its own root, so this
97
- * never silently widens to a whole disk.
98
- */
99
- export function modulesRootOf(dir) {
100
- const parts = resolve(dir).split(sep);
101
- const index = parts.lastIndexOf(MODULES_DIR);
102
- return index === -1 ? resolve(dir) : parts.slice(0, index + 1).join(sep);
103
- }
104
- /**
105
- * `.turri` inside the modules root: what turri keeps beside the code - the package
106
- * caches, the modules' homes and temporary folders, the copies test runs happen in, the
107
- * outputs kept for read_output. Ignored by the project's history.
108
- */
109
- export function modulesScratchDir(dir) {
110
- return join(modulesRootOf(dir), ".turri");
111
- }
112
- /** Make `path` inside the modules' scratch, which ignores itself. Returns `path`. */
113
- export function ensureInModulesScratch(dir, path) {
114
- return ensureInScratch(modulesScratchDir(dir), path);
115
- }
116
- /** Where the project keeps what a launch puts out: `dist/`, beside `plain_modules`. */
117
- export const DIST_DIR = "dist";
118
- /**
119
- * Where a person tries a module: `<project>/dist/<module>`, the module's code as its last commit has
120
- * it. Outside `plain_modules`, so no agent can reach it, and replaced whole by every launch.
121
- */
122
- export function distDirFor(projectDir, moduleName) {
123
- return join(projectDir, DIST_DIR, moduleName);
124
- }
125
- /**
126
- * The project a directory belongs to: the one `plain_modules` sits in, when the directory is
127
- * inside it; otherwise the directory's parent for a build folder, or the directory itself.
128
- */
129
- export function projectRootOf(dir) {
130
- const parts = resolve(dir).split(sep);
131
- const index = parts.lastIndexOf(MODULES_DIR);
132
- return index === -1 ? resolve(dir) : parts.slice(0, index).join(sep);
133
- }
134
- /**
135
- * `.turri` in the project: the harness's own scratch space - copies to try things in,
136
- * saved agent sessions. Never part of the project's history, so it ignores itself - but for `skills/`, the
137
- * project's own skills.
138
- */
139
- export function scratchDir(dir) {
140
- const parts = resolve(dir).split(sep);
141
- const index = parts.lastIndexOf(MODULES_DIR);
142
- const project = index === -1 ? dirname(resolve(dir)) : parts.slice(0, index).join(sep);
143
- return join(project, ".turri");
144
- }
145
- /**
146
- * Where a skill run keeps its state - the manifest an interrupted run resumes from, the evidence
147
- * each phase's gate is judged on: `.turri/runs/<skill>` in the project, beside the rest of
148
- * turri's scratch, ignored by the project's history like it.
149
- */
150
- export function skillRunDir(cwd, skillName) {
151
- const scratch = join(resolve(cwd), ".turri");
152
- return ensureInScratch(scratch, join(scratch, "runs", skillName));
153
- }
154
- /**
155
- * What the scratch dir's .gitignore says: everything in it is ignored but `skills/` - the project's own skills
156
- * (skills.ts), which are written by hand and kept in its history.
157
- */
158
- export const SCRATCH_IGNORE = "*\n!skills/\n!skills/**\n";
159
- /** Make `path`, inside a scratch dir, and see that the scratch dir ignores itself, its skills apart. Returns `path`. */
160
- export function ensureInScratch(scratch, path) {
161
- mkdirSync(path, { recursive: true });
162
- const ignore = join(scratch, ".gitignore");
163
- // One written before skills were kept here ignored them too: it is brought up to date.
164
- if (!existsSync(ignore) || readFileSync(ignore, "utf8") === "*\n")
165
- writeFileSync(ignore, SCRATCH_IGNORE);
166
- return path;
167
- }
168
- /** Where agent sessions are saved, so what an agent did can be read - and resumed - later. */
169
- export function sessionsDir(project) {
170
- const scratch = scratchDir(join(project, MODULES_DIR));
171
- return ensureInScratch(scratch, join(scratch, "sessions"));
172
- }
173
- /**
174
- * Template search order, matching file_utils.get_template_directories: the plain file's
175
- * own directory first, then a sibling `template/` directory if there is one (where a
176
- * project keeps its import modules), then anything passed in, then PLAIN_TEMPLATE_DIRS.
177
- * A `stdlib/...` import is not looked for in them: it is turri's (see plain/stdlib.ts).
178
- */
179
- export function resolveTemplateDirs(plainFile, extra = []) {
180
- const own = dirname(resolve(plainFile));
181
- const dirs = [own];
182
- const sibling = join(own, "template");
183
- if (existsSync(sibling))
184
- dirs.push(sibling);
185
- dirs.push(...extra.map((dir) => resolve(dir)));
186
- const fromEnv = process.env.PLAIN_TEMPLATE_DIRS;
187
- if (fromEnv)
188
- dirs.push(...fromEnv.split(delimiter).filter(Boolean).map((dir) => resolve(dir)));
189
- return [...new Set(dirs)];
190
- }
@@ -1,34 +0,0 @@
1
- import type { DiffPaint } from "./diff-view.ts";
2
- /** A colour's SGR parameters: 24-bit, or the nearest of the 256 where the terminal has no more. */
3
- export declare function sgr(hex: string, background: boolean, truecolor: boolean): string;
4
- /**
5
- * Neon, for what is shown to do what its spec says - regen's ◆: the design system's colour for what can be followed,
6
- * 12.2:1 on abyss. On a light surface, where neon is illegible (1.6:1 on white), blue whale, 12.9:1 on white.
7
- */
8
- export declare const BRAND_NEON: {
9
- light: string;
10
- dark: string;
11
- };
12
- /**
13
- * Pink, the one pink thing in a view - the banner's wordmark: 6.54:1 on abyss. On a light surface, where pink is
14
- * too pale (2.9:1 on white), eggplant, 9.9:1 on white.
15
- */
16
- export declare const BRAND_PINK: {
17
- light: string;
18
- dark: string;
19
- };
20
- /** Text in neon on a theme - blue whale on a light one - in as many colours as the terminal has. */
21
- export declare const brandNeon: (theme: {
22
- appearance?: "dark" | "light";
23
- getColorMode?(): string;
24
- }) => ((text: string) => string);
25
- /** Text in pink on a theme - eggplant on a light one - in as many colours as the terminal has. */
26
- export declare const brandPink: (theme: {
27
- appearance?: "dark" | "light";
28
- getColorMode?(): string;
29
- }) => ((text: string) => string);
30
- /** How a spec diff is painted on a theme: its palette by whether the theme is dark or light, in as many colours as the terminal has. */
31
- export declare function plainPaint(theme: {
32
- appearance?: "dark" | "light";
33
- getColorMode?(): string;
34
- }): DiffPaint;