@uncarved/jade 0.1.3 → 0.2.1

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 (455) hide show
  1. package/README.md +161 -150
  2. package/bin/jade.js +14 -25
  3. package/dist/api.d.ts +266 -0
  4. package/dist/api.js +38 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/config.d.ts +13 -32
  7. package/dist/config.js +39 -121
  8. package/dist/config.js.map +1 -1
  9. package/dist/fetch.d.ts +20 -0
  10. package/dist/fetch.js +190 -0
  11. package/dist/fetch.js.map +1 -0
  12. package/dist/hash.d.ts +2 -0
  13. package/dist/hash.js +42 -0
  14. package/dist/hash.js.map +1 -0
  15. package/dist/host.d.ts +71 -0
  16. package/dist/host.js +400 -0
  17. package/dist/host.js.map +1 -0
  18. package/dist/index.d.ts +11 -30
  19. package/dist/index.js +11 -30
  20. package/dist/index.js.map +1 -1
  21. package/dist/install.d.ts +78 -0
  22. package/dist/install.js +292 -0
  23. package/dist/install.js.map +1 -0
  24. package/dist/main.d.ts +1 -2
  25. package/dist/main.js +160 -1362
  26. package/dist/main.js.map +1 -1
  27. package/dist/manifest.d.ts +23 -0
  28. package/dist/manifest.js +159 -0
  29. package/dist/manifest.js.map +1 -0
  30. package/dist/membrane.d.ts +33 -0
  31. package/dist/membrane.js +140 -0
  32. package/dist/membrane.js.map +1 -0
  33. package/dist/remote.d.ts +10 -0
  34. package/dist/remote.js +292 -0
  35. package/dist/remote.js.map +1 -0
  36. package/dist/rescue.d.ts +10 -0
  37. package/dist/rescue.js +216 -0
  38. package/dist/rescue.js.map +1 -0
  39. package/dist/resolve.d.ts +34 -0
  40. package/dist/resolve.js +178 -0
  41. package/dist/resolve.js.map +1 -0
  42. package/dist/rpc.d.ts +26 -0
  43. package/dist/rpc.js +144 -0
  44. package/dist/rpc.js.map +1 -0
  45. package/dist/secrets.d.ts +12 -0
  46. package/dist/secrets.js +125 -0
  47. package/dist/secrets.js.map +1 -0
  48. package/dist/session.d.ts +45 -0
  49. package/dist/session.js +401 -0
  50. package/dist/session.js.map +1 -0
  51. package/dist/source.d.ts +12 -0
  52. package/dist/source.js +72 -0
  53. package/dist/source.js.map +1 -0
  54. package/dist/state.d.ts +37 -0
  55. package/dist/state.js +93 -0
  56. package/dist/state.js.map +1 -0
  57. package/dist/update.d.ts +2 -0
  58. package/dist/update.js +6 -3
  59. package/dist/update.js.map +1 -1
  60. package/package.json +10 -8
  61. package/plugins/approval/index.ts +311 -0
  62. package/plugins/approval/plugin.json +22 -0
  63. package/{src/plugins → plugins/approval}/policy.ts +45 -104
  64. package/{src/plugins → plugins/approval}/review.ts +62 -16
  65. package/plugins/ask/index.ts +159 -0
  66. package/plugins/ask/plugin.json +8 -0
  67. package/plugins/budget/index.ts +38 -0
  68. package/plugins/budget/plugin.json +13 -0
  69. package/{src/plugins → plugins/checks}/checks.ts +48 -38
  70. package/plugins/checks/index.ts +158 -0
  71. package/plugins/checks/plugin.json +14 -0
  72. package/plugins/checks/project.ts +81 -0
  73. package/plugins/commands/index.ts +76 -0
  74. package/plugins/commands/plugin.json +7 -0
  75. package/{src/plugins → plugins/compact}/compact.ts +80 -39
  76. package/plugins/compact/index.ts +115 -0
  77. package/plugins/compact/plugin.json +17 -0
  78. package/plugins/compact/style.ts +17 -0
  79. package/plugins/continue/index.ts +58 -0
  80. package/plugins/continue/plugin.json +13 -0
  81. package/{src/ui → plugins/fs}/diff.ts +2 -2
  82. package/{src/tools → plugins/fs}/fs.ts +89 -46
  83. package/{src/tools → plugins/fs}/grep.ts +36 -8
  84. package/plugins/fs/index.ts +37 -0
  85. package/plugins/fs/plugin.json +7 -0
  86. package/{src/ui → plugins/fs}/renderers.ts +25 -70
  87. package/plugins/fs/style.ts +18 -0
  88. package/plugins/fs/sys.ts +81 -0
  89. package/plugins/keys/index.ts +53 -0
  90. package/plugins/keys/plugin.json +7 -0
  91. package/plugins/mcp/index.ts +192 -0
  92. package/{src → plugins/mcp}/mcp.ts +32 -32
  93. package/plugins/mcp/plugin.json +7 -0
  94. package/plugins/mcp/project.ts +93 -0
  95. package/plugins/memory/index.ts +105 -0
  96. package/{src → plugins/memory}/memory.ts +20 -2
  97. package/plugins/memory/notes.ts +43 -0
  98. package/plugins/memory/plugin.json +7 -0
  99. package/plugins/memory/style.ts +17 -0
  100. package/plugins/mentions/attach.ts +127 -0
  101. package/plugins/mentions/index.ts +99 -0
  102. package/plugins/mentions/plugin.json +7 -0
  103. package/plugins/mentions/style.ts +17 -0
  104. package/plugins/models/config.ts +53 -0
  105. package/plugins/models/configure.ts +455 -0
  106. package/plugins/models/context.ts +32 -0
  107. package/plugins/models/index.ts +213 -0
  108. package/plugins/models/plugin.json +8 -0
  109. package/{src → plugins/models}/provider.ts +16 -119
  110. package/plugins/models/saved.ts +94 -0
  111. package/plugins/modes/index.ts +222 -0
  112. package/plugins/modes/plugin.json +9 -0
  113. package/plugins/plugins/index.ts +38 -0
  114. package/plugins/plugins/plugin.json +7 -0
  115. package/plugins/print/index.ts +160 -0
  116. package/plugins/print/plugin.json +8 -0
  117. package/plugins/prompts/index.ts +111 -0
  118. package/plugins/prompts/plugin.json +8 -0
  119. package/plugins/prompts/prompts.ts +258 -0
  120. package/plugins/prompts/results.ts +63 -0
  121. package/plugins/prompts/sys.ts +84 -0
  122. package/plugins/renderers/index.ts +78 -0
  123. package/plugins/renderers/plugin.json +7 -0
  124. package/plugins/repeats/index.ts +165 -0
  125. package/plugins/repeats/plugin.json +6 -0
  126. package/plugins/schedule/cron.ts +74 -0
  127. package/plugins/schedule/index.ts +292 -0
  128. package/plugins/schedule/plugin.json +13 -0
  129. package/plugins/schedule/store.ts +149 -0
  130. package/plugins/scratch/index.ts +31 -0
  131. package/plugins/scratch/plugin.json +7 -0
  132. package/plugins/screenshot/index.ts +40 -0
  133. package/plugins/screenshot/plugin.json +7 -0
  134. package/plugins/screenshot/sys.ts +84 -0
  135. package/{src/tools/screenshot.ts → plugins/screenshot/tool.ts} +6 -6
  136. package/plugins/sessions/index.ts +148 -0
  137. package/plugins/sessions/plugin.json +8 -0
  138. package/plugins/shell/index.ts +33 -0
  139. package/plugins/shell/plugin.json +17 -0
  140. package/plugins/shell/renderers.ts +45 -0
  141. package/plugins/shell/service.ts +44 -0
  142. package/{src/tools → plugins/shell}/shell.ts +31 -20
  143. package/{src → plugins/shell}/sys.ts +2 -43
  144. package/plugins/skills/index.ts +96 -0
  145. package/plugins/skills/plugin.json +7 -0
  146. package/plugins/skills/project.ts +49 -0
  147. package/{src → plugins/skills}/skills.ts +4 -11
  148. package/plugins/suggest/index.ts +286 -0
  149. package/plugins/suggest/plugin.json +18 -0
  150. package/plugins/task/index.ts +168 -0
  151. package/plugins/task/plugin.json +15 -0
  152. package/plugins/task/style.ts +17 -0
  153. package/plugins/task/subagent.ts +343 -0
  154. package/plugins/todo/index.ts +93 -0
  155. package/plugins/todo/plugin.json +7 -0
  156. package/{src/ui → plugins/tui}/editor.ts +3 -0
  157. package/plugins/tui/frontend.ts +619 -0
  158. package/plugins/tui/index.ts +37 -0
  159. package/plugins/tui/mentions.ts +153 -0
  160. package/plugins/tui/plugin.json +10 -0
  161. package/{src/ui → plugins/tui}/render.ts +8 -2
  162. package/{src/ui → plugins/tui}/screen.ts +8 -3
  163. package/{src/ui → plugins/tui}/transcript.ts +79 -100
  164. package/{src/ui/tui.tsx → plugins/tui/tui.ts} +360 -392
  165. package/plugins/tui/vendor.ts +16 -0
  166. package/{src/tools → plugins/undo}/checkpoint.ts +45 -60
  167. package/plugins/undo/index.ts +143 -0
  168. package/plugins/undo/notes.ts +43 -0
  169. package/plugins/undo/plugin.json +7 -0
  170. package/plugins/undo/style.ts +17 -0
  171. package/plugins/update/index.ts +40 -0
  172. package/plugins/update/plugin.json +13 -0
  173. package/plugins/web/env.ts +78 -0
  174. package/plugins/web/index.ts +133 -0
  175. package/plugins/web/plugin.json +15 -0
  176. package/plugins/web/renderers.ts +11 -0
  177. package/{src/tools → plugins/web}/web.ts +64 -31
  178. package/plugins-dist/approval/index.js +287 -0
  179. package/plugins-dist/approval/plugin.json +28 -0
  180. package/{dist/plugins → plugins-dist/approval}/policy.js +41 -85
  181. package/{dist/plugins → plugins-dist/approval}/review.js +56 -10
  182. package/{dist/plugins → plugins-dist/approval}/schema.js +0 -1
  183. package/plugins-dist/ask/index.js +145 -0
  184. package/plugins-dist/ask/plugin.json +12 -0
  185. package/plugins-dist/budget/index.js +37 -0
  186. package/plugins-dist/budget/plugin.json +15 -0
  187. package/{dist/plugins → plugins-dist/checks}/checks.js +46 -35
  188. package/plugins-dist/checks/index.js +150 -0
  189. package/plugins-dist/checks/plugin.json +21 -0
  190. package/plugins-dist/checks/project.js +76 -0
  191. package/plugins-dist/commands/index.js +33 -0
  192. package/plugins-dist/commands/plugin.json +9 -0
  193. package/{dist/plugins → plugins-dist/compact}/compact.js +58 -34
  194. package/plugins-dist/compact/index.js +100 -0
  195. package/plugins-dist/compact/plugin.json +25 -0
  196. package/plugins-dist/compact/style.js +14 -0
  197. package/plugins-dist/continue/index.js +57 -0
  198. package/plugins-dist/continue/plugin.json +15 -0
  199. package/{dist/ui → plugins-dist/fs}/diff.js +2 -3
  200. package/{dist/tools → plugins-dist/fs}/fs.js +82 -46
  201. package/{dist/tools → plugins-dist/fs}/grep.js +36 -11
  202. package/plugins-dist/fs/index.js +39 -0
  203. package/plugins-dist/fs/plugin.json +10 -0
  204. package/{dist/ui → plugins-dist/fs}/renderers.js +24 -61
  205. package/plugins-dist/fs/style.js +15 -0
  206. package/plugins-dist/fs/sys.js +54 -0
  207. package/plugins-dist/keys/index.js +36 -0
  208. package/plugins-dist/keys/plugin.json +9 -0
  209. package/plugins-dist/mcp/index.js +187 -0
  210. package/{dist → plugins-dist/mcp}/mcp.js +34 -30
  211. package/plugins-dist/mcp/plugin.json +12 -0
  212. package/plugins-dist/mcp/project.js +90 -0
  213. package/plugins-dist/memory/index.js +94 -0
  214. package/{dist → plugins-dist/memory}/memory.js +21 -3
  215. package/plugins-dist/memory/notes.js +36 -0
  216. package/plugins-dist/memory/plugin.json +11 -0
  217. package/plugins-dist/memory/style.js +14 -0
  218. package/plugins-dist/mentions/attach.js +120 -0
  219. package/plugins-dist/mentions/index.js +87 -0
  220. package/plugins-dist/mentions/plugin.json +9 -0
  221. package/plugins-dist/mentions/style.js +14 -0
  222. package/plugins-dist/models/config.js +53 -0
  223. package/plugins-dist/models/configure.js +415 -0
  224. package/plugins-dist/models/context.js +27 -0
  225. package/plugins-dist/models/index.js +181 -0
  226. package/plugins-dist/models/plugin.json +14 -0
  227. package/{dist → plugins-dist/models}/provider.js +18 -81
  228. package/plugins-dist/models/saved.js +80 -0
  229. package/plugins-dist/modes/index.js +190 -0
  230. package/plugins-dist/modes/plugin.json +18 -0
  231. package/plugins-dist/plugins/index.js +37 -0
  232. package/plugins-dist/plugins/plugin.json +10 -0
  233. package/plugins-dist/print/index.js +172 -0
  234. package/plugins-dist/print/plugin.json +14 -0
  235. package/plugins-dist/prompts/index.js +85 -0
  236. package/plugins-dist/prompts/plugin.json +13 -0
  237. package/plugins-dist/prompts/prompts.js +231 -0
  238. package/plugins-dist/prompts/results.js +60 -0
  239. package/plugins-dist/prompts/sys.js +58 -0
  240. package/plugins-dist/renderers/index.js +36 -0
  241. package/plugins-dist/renderers/plugin.json +9 -0
  242. package/plugins-dist/repeats/index.js +165 -0
  243. package/plugins-dist/repeats/plugin.json +6 -0
  244. package/plugins-dist/schedule/cron.js +67 -0
  245. package/plugins-dist/schedule/index.js +281 -0
  246. package/plugins-dist/schedule/plugin.json +16 -0
  247. package/plugins-dist/schedule/store.js +125 -0
  248. package/plugins-dist/scratch/index.js +26 -0
  249. package/plugins-dist/scratch/plugin.json +10 -0
  250. package/plugins-dist/screenshot/index.js +35 -0
  251. package/plugins-dist/screenshot/plugin.json +11 -0
  252. package/plugins-dist/screenshot/sys.js +76 -0
  253. package/{dist/tools/screenshot.js → plugins-dist/screenshot/tool.js} +5 -4
  254. package/plugins-dist/sessions/index.js +136 -0
  255. package/plugins-dist/sessions/plugin.json +12 -0
  256. package/plugins-dist/shell/index.js +33 -0
  257. package/plugins-dist/shell/plugin.json +19 -0
  258. package/plugins-dist/shell/renderers.js +40 -0
  259. package/plugins-dist/shell/service.js +29 -0
  260. package/{dist/tools → plugins-dist/shell}/shell.js +31 -22
  261. package/{dist → plugins-dist/shell}/sys.js +2 -43
  262. package/plugins-dist/skills/index.js +90 -0
  263. package/plugins-dist/skills/plugin.json +12 -0
  264. package/plugins-dist/skills/project.js +47 -0
  265. package/{dist → plugins-dist/skills}/skills.js +3 -7
  266. package/plugins-dist/suggest/index.js +282 -0
  267. package/plugins-dist/suggest/plugin.json +23 -0
  268. package/plugins-dist/task/index.js +152 -0
  269. package/plugins-dist/task/plugin.json +23 -0
  270. package/plugins-dist/task/style.js +14 -0
  271. package/plugins-dist/task/subagent.js +284 -0
  272. package/{dist/tools/todo.js → plugins-dist/todo/index.js} +31 -9
  273. package/plugins-dist/todo/plugin.json +9 -0
  274. package/{dist/ui → plugins-dist/tui}/editor.js +3 -1
  275. package/plugins-dist/tui/frontend.js +609 -0
  276. package/{dist → plugins-dist/tui}/history.js +0 -1
  277. package/plugins-dist/tui/index.js +21 -0
  278. package/{dist/ui → plugins-dist/tui}/markdown.js +0 -1
  279. package/plugins-dist/tui/mentions.js +153 -0
  280. package/plugins-dist/tui/plugin.json +25 -0
  281. package/{dist/ui → plugins-dist/tui}/render.js +7 -3
  282. package/{dist/ui → plugins-dist/tui}/screen.js +6 -2
  283. package/{dist/ui → plugins-dist/tui}/transcript.js +79 -99
  284. package/{dist/ui → plugins-dist/tui}/tui.js +185 -54
  285. package/plugins-dist/tui/vendor.js +13822 -0
  286. package/{dist/tools → plugins-dist/undo}/checkpoint.js +48 -55
  287. package/plugins-dist/undo/index.js +143 -0
  288. package/plugins-dist/undo/notes.js +36 -0
  289. package/plugins-dist/undo/plugin.json +9 -0
  290. package/plugins-dist/undo/style.js +14 -0
  291. package/plugins-dist/update/index.js +34 -0
  292. package/plugins-dist/update/plugin.json +15 -0
  293. package/plugins-dist/web/env.js +80 -0
  294. package/plugins-dist/web/index.js +124 -0
  295. package/plugins-dist/web/plugin.json +21 -0
  296. package/plugins-dist/web/renderers.js +7 -0
  297. package/{dist/tools → plugins-dist/web}/web.js +56 -29
  298. package/sdk/python/__pycache__/jade_plugin.cpython-312.pyc +0 -0
  299. package/sdk/python/jade_plugin.py +380 -0
  300. package/src/api.ts +298 -0
  301. package/src/config.ts +32 -134
  302. package/src/fetch.ts +216 -0
  303. package/src/hash.ts +39 -0
  304. package/src/host.ts +429 -0
  305. package/src/index.ts +23 -30
  306. package/src/install.ts +355 -0
  307. package/src/main.ts +156 -1387
  308. package/src/manifest.ts +160 -0
  309. package/src/membrane.ts +142 -0
  310. package/src/remote.ts +288 -0
  311. package/src/rescue.ts +217 -0
  312. package/src/resolve.ts +199 -0
  313. package/src/rpc.ts +144 -0
  314. package/src/secrets.ts +122 -0
  315. package/src/session.ts +458 -0
  316. package/src/source.ts +83 -0
  317. package/src/state.ts +120 -0
  318. package/src/update.ts +265 -262
  319. package/LICENSE +0 -21
  320. package/dist/commands.d.ts +0 -50
  321. package/dist/commands.js +0 -126
  322. package/dist/commands.js.map +0 -1
  323. package/dist/context.d.ts +0 -17
  324. package/dist/context.js +0 -53
  325. package/dist/context.js.map +0 -1
  326. package/dist/distro.d.ts +0 -141
  327. package/dist/distro.js +0 -462
  328. package/dist/distro.js.map +0 -1
  329. package/dist/history.d.ts +0 -10
  330. package/dist/history.js.map +0 -1
  331. package/dist/mcp.d.ts +0 -114
  332. package/dist/mcp.js.map +0 -1
  333. package/dist/memory.d.ts +0 -19
  334. package/dist/memory.js.map +0 -1
  335. package/dist/mentions.d.ts +0 -35
  336. package/dist/mentions.js +0 -130
  337. package/dist/mentions.js.map +0 -1
  338. package/dist/plugin-cli.d.ts +0 -16
  339. package/dist/plugin-cli.js +0 -294
  340. package/dist/plugin-cli.js.map +0 -1
  341. package/dist/plugins/budget.d.ts +0 -9
  342. package/dist/plugins/budget.js +0 -30
  343. package/dist/plugins/budget.js.map +0 -1
  344. package/dist/plugins/builtins.d.ts +0 -10
  345. package/dist/plugins/builtins.js +0 -25
  346. package/dist/plugins/builtins.js.map +0 -1
  347. package/dist/plugins/checks.d.ts +0 -71
  348. package/dist/plugins/checks.js.map +0 -1
  349. package/dist/plugins/compact.d.ts +0 -26
  350. package/dist/plugins/compact.js.map +0 -1
  351. package/dist/plugins/core.d.ts +0 -47
  352. package/dist/plugins/core.js +0 -229
  353. package/dist/plugins/core.js.map +0 -1
  354. package/dist/plugins/host.d.ts +0 -52
  355. package/dist/plugins/host.js +0 -115
  356. package/dist/plugins/host.js.map +0 -1
  357. package/dist/plugins/install.d.ts +0 -68
  358. package/dist/plugins/install.js +0 -377
  359. package/dist/plugins/install.js.map +0 -1
  360. package/dist/plugins/loader.d.ts +0 -410
  361. package/dist/plugins/loader.js +0 -407
  362. package/dist/plugins/loader.js.map +0 -1
  363. package/dist/plugins/policy.d.ts +0 -98
  364. package/dist/plugins/policy.js.map +0 -1
  365. package/dist/plugins/prompts.d.ts +0 -43
  366. package/dist/plugins/prompts.js +0 -284
  367. package/dist/plugins/prompts.js.map +0 -1
  368. package/dist/plugins/repeats.d.ts +0 -16
  369. package/dist/plugins/repeats.js +0 -151
  370. package/dist/plugins/repeats.js.map +0 -1
  371. package/dist/plugins/review.d.ts +0 -18
  372. package/dist/plugins/review.js.map +0 -1
  373. package/dist/plugins/schema.d.ts +0 -2
  374. package/dist/plugins/schema.js.map +0 -1
  375. package/dist/plugins/sessions.d.ts +0 -7
  376. package/dist/plugins/sessions.js +0 -110
  377. package/dist/plugins/sessions.js.map +0 -1
  378. package/dist/provider.d.ts +0 -165
  379. package/dist/provider.js.map +0 -1
  380. package/dist/session-lifecycle.d.ts +0 -61
  381. package/dist/session-lifecycle.js +0 -167
  382. package/dist/session-lifecycle.js.map +0 -1
  383. package/dist/session-scope.d.ts +0 -53
  384. package/dist/session-scope.js +0 -116
  385. package/dist/session-scope.js.map +0 -1
  386. package/dist/sessions.d.ts +0 -28
  387. package/dist/sessions.js +0 -73
  388. package/dist/sessions.js.map +0 -1
  389. package/dist/skills.d.ts +0 -37
  390. package/dist/skills.js.map +0 -1
  391. package/dist/sys.d.ts +0 -51
  392. package/dist/sys.js.map +0 -1
  393. package/dist/tools/ask.d.ts +0 -11
  394. package/dist/tools/ask.js +0 -62
  395. package/dist/tools/ask.js.map +0 -1
  396. package/dist/tools/checkpoint.d.ts +0 -43
  397. package/dist/tools/checkpoint.js.map +0 -1
  398. package/dist/tools/fs.d.ts +0 -39
  399. package/dist/tools/fs.js.map +0 -1
  400. package/dist/tools/grep.d.ts +0 -6
  401. package/dist/tools/grep.js.map +0 -1
  402. package/dist/tools/screenshot.d.ts +0 -15
  403. package/dist/tools/screenshot.js.map +0 -1
  404. package/dist/tools/shell.d.ts +0 -55
  405. package/dist/tools/shell.js.map +0 -1
  406. package/dist/tools/task.d.ts +0 -39
  407. package/dist/tools/task.js +0 -117
  408. package/dist/tools/task.js.map +0 -1
  409. package/dist/tools/todo.d.ts +0 -10
  410. package/dist/tools/todo.js.map +0 -1
  411. package/dist/tools/web.d.ts +0 -53
  412. package/dist/tools/web.js.map +0 -1
  413. package/dist/ui/configure.d.ts +0 -20
  414. package/dist/ui/configure.js +0 -447
  415. package/dist/ui/configure.js.map +0 -1
  416. package/dist/ui/diff.d.ts +0 -20
  417. package/dist/ui/diff.js.map +0 -1
  418. package/dist/ui/editor.d.ts +0 -41
  419. package/dist/ui/editor.js.map +0 -1
  420. package/dist/ui/markdown.d.ts +0 -22
  421. package/dist/ui/markdown.js.map +0 -1
  422. package/dist/ui/render.d.ts +0 -14
  423. package/dist/ui/render.js.map +0 -1
  424. package/dist/ui/renderers.d.ts +0 -8
  425. package/dist/ui/renderers.js.map +0 -1
  426. package/dist/ui/screen.d.ts +0 -118
  427. package/dist/ui/screen.js.map +0 -1
  428. package/dist/ui/transcript.d.ts +0 -46
  429. package/dist/ui/transcript.js.map +0 -1
  430. package/dist/ui/tui.d.ts +0 -47
  431. package/dist/ui/tui.js.map +0 -1
  432. package/src/commands.ts +0 -144
  433. package/src/context.ts +0 -64
  434. package/src/distro.ts +0 -577
  435. package/src/mentions.ts +0 -135
  436. package/src/plugin-cli.ts +0 -278
  437. package/src/plugins/budget.ts +0 -37
  438. package/src/plugins/builtins.ts +0 -34
  439. package/src/plugins/core.ts +0 -257
  440. package/src/plugins/host.ts +0 -146
  441. package/src/plugins/install.ts +0 -429
  442. package/src/plugins/loader.ts +0 -742
  443. package/src/plugins/prompts.ts +0 -327
  444. package/src/plugins/repeats.ts +0 -157
  445. package/src/plugins/sessions.ts +0 -109
  446. package/src/session-lifecycle.ts +0 -194
  447. package/src/session-scope.ts +0 -135
  448. package/src/sessions.ts +0 -78
  449. package/src/tools/ask.ts +0 -72
  450. package/src/tools/task.ts +0 -149
  451. package/src/tools/todo.ts +0 -67
  452. package/src/ui/configure.ts +0 -471
  453. /package/{src/plugins → plugins/approval}/schema.ts +0 -0
  454. /package/{src → plugins/tui}/history.ts +0 -0
  455. /package/{src/ui → plugins/tui}/markdown.ts +0 -0
@@ -1,410 +0,0 @@
1
- import type { Choice } from "../ui/screen.ts";
2
- import { type Awaitable, type Message, type Plugin, type TrustStore, type Usage } from "uncarved";
3
- import type { RunCommand } from "../tools/shell.ts";
4
- import type { Checkpoint } from "../tools/checkpoint.ts";
5
- import type { ProviderDef } from "../provider.ts";
6
- /** 插件提供的模型服务,见 provider.ts 的 ProviderDef */
7
- export type PluginProvider = ProviderDef;
8
- export declare const JADE_VERSION: string;
9
- export type PluginLayer = "user" | "project";
10
- /** jade 创建插件实例时传给工厂函数的参数 */
11
- export interface JadePluginContext {
12
- /** jade 的版本 */
13
- jade: string;
14
- /** 工作目录(已解析符号链接) */
15
- cwd: string;
16
- /** 仓库根目录;不在 git 仓库里时等于 cwd */
17
- root: string;
18
- /** jade 的数据目录($JADE_HOME) */
19
- home: string;
20
- /** 插件自己的目录 */
21
- dir: string;
22
- layer: PluginLayer;
23
- /**
24
- * 同 uncarved 的 definePlugin:补上 kernel 和 hooks 用到的 needs,另外 id、version 不写时用 plugin.json 里的。
25
- * 项目层插件通常 import 不到 uncarved,用这个
26
- */
27
- definePlugin: <T extends ContextPluginDraft>(draft: T) => T & JadePlugin;
28
- /** 用 jade 的 shell 执行命令,超时或中断时连同子进程一起结束;找不到 shell 时没有 */
29
- run?: RunCommand;
30
- /**
31
- * 用当前配置的模型发一次请求:不带工具,不记进会话,和会话共用限速和重试;用户切换模型后用新的。
32
- * 返回回复的文字;onText 收到流式输出的片段,拿到想要的内容后可以用 signal 中止
33
- */
34
- complete(req: CompleteRequest, signal: AbortSignal): Promise<CompleteResult>;
35
- /** 设置状态栏上本插件的那一段文字(一行,过长时截断,窗口窄时先被去掉);undefined 去掉 */
36
- status(text: string | undefined): void;
37
- /** 文件快照:写文件的工具写之前记下原内容,/undo 据此恢复。见 FileCheckpoints */
38
- checkpoints: FileCheckpoints;
39
- /** 终端界面的输入框(见 InputControl)。只给用户层插件;非交互运行(-p)时没有 */
40
- input?: InputControl;
41
- /**
42
- * 替用户提交一行,和在输入框里按回车一样:/ 开头的是命令;模型正忙时排队。
43
- * 对话里会注明是哪个插件发的。只给用户层插件(它能替用户说话);非交互运行(-p)时没有
44
- */
45
- send?(text: string): void;
46
- /**
47
- * 这套实例的会话结束(换会话、重新加载、退出)时中止,在 dispose 之前。
48
- * 工厂函数里开的定时器、监听可以挂在它上面关掉:ctx.signal.addEventListener("abort", () => clearInterval(timer))
49
- */
50
- signal: AbortSignal;
51
- }
52
- /** 宿主这边的输入框:多了一个参数,是调用的插件的 id(宿主据此提示过期的调用) */
53
- export interface HostInput {
54
- text(plugin?: string): string;
55
- insert(text: string, plugin?: string): void;
56
- set(text: string, plugin?: string): void;
57
- }
58
- /** 输入框里用户还没提交的文字 */
59
- export interface InputControl {
60
- /** 现在的文字 */
61
- text(): string;
62
- /** 在光标处插入,光标移到插入的文字后面 */
63
- insert(text: string): void;
64
- /** 换掉全部文字,光标放到末尾;空字符串清空 */
65
- set(text: string): void;
66
- }
67
- /**
68
- * 一个工具在对话里怎么显示,不影响发给模型的内容。只能为本插件 tools 里的工具注册:
69
- * 别的工具(jade 自己的、MCP 的、别的插件的)的显示,特别是审批时的预览,插件改不了。
70
- * 每个函数都可以不写;返回 undefined 或出错时用 jade 默认的显示(出错时提示一次)
71
- */
72
- export interface ToolRenderer {
73
- tool: string;
74
- /** 调用行 "● 工具名(…)" 括号里的摘要,只显示第一行;默认是 path 参数或参数的 JSON */
75
- summary?(input: unknown): string | undefined;
76
- /** 摘要省略了的参数(例如很长的命令),点击调用行展开后显示在最前面,可以多行;默认没有 */
77
- details?(input: unknown): string | undefined;
78
- /** 请用户批准时显示的预览,可以多行、带 ANSI 颜色;默认是参数的 JSON */
79
- preview?(input: unknown): Awaitable<string | undefined>;
80
- /**
81
- * 工具执行之前同步调用(例如记下修改前的文件,好在结果里显示 diff),返回值交给 result 的 before。
82
- * 用户拒绝的调用、重新显示的历史不调用
83
- */
84
- before?(input: unknown): unknown;
85
- /**
86
- * 结果:line 接在调用行的 "⎿ " 后面(一行),details 是点击展开后的内容(可以多行);
87
- * 默认显示结果文字的第一行,多出的行折叠起来
88
- */
89
- result?(r: {
90
- input: unknown;
91
- text: string;
92
- isError: boolean;
93
- before?: unknown;
94
- }): {
95
- line: string;
96
- details?: string;
97
- } | undefined;
98
- }
99
- /** 插件 dispose 的时限:超过了不再等,显示警告 */
100
- export declare const DISPOSE_TIMEOUT_MS = 5000;
101
- /** "ctrl+<字母>" 或 "alt+<字母或数字>" */
102
- export declare const KEY_SPEC: RegExp;
103
- /**
104
- * jade 自己用的键,插件不能用:编辑(ctrl+a/e/d/w/u/k,alt+f)、搜索历史(ctrl+r)、重画(ctrl+l)、展开(ctrl+o)、
105
- * 中断和退出(ctrl+c),以及终端里等同于退格、Tab、回车的 ctrl+h/i/j/m
106
- */
107
- export declare const RESERVED_KEYS: ReadonlySet<string>;
108
- /** 插件的快捷键:输入框有焦点时按下(模型工作时也算)调用 run;弹出对话框时不响应 */
109
- export interface PluginKey {
110
- /** 见 KEY_SPEC;不分大小写,不能是 RESERVED_KEYS 里的 */
111
- key: string;
112
- /** /help 里显示 */
113
- description?: string;
114
- /**
115
- * 出错时在对话里显示警告。要改输入框、发消息用插件上下文的 input、send。
116
- * key 是按下的键,规范成小写(例如 "ctrl+g");换会话、退出时 signal 中止。
117
- * 上一次还没执行完时再按,会再调用一次(切换式的键要自己记住状态)
118
- */
119
- run(ctx: {
120
- key: string;
121
- sessionId: string;
122
- signal: AbortSignal;
123
- }): Awaitable<void>;
124
- }
125
- /**
126
- * 文件快照,按会话存放,不进日志。jade/fs 的写文件工具和 jade/undo 都只用这个接口:
127
- * 第三方插件的工具写文件前也调用 save,/undo 就能撤销它的修改
128
- */
129
- export interface FileCheckpoints {
130
- /**
131
- * 写文件之前调用(用工具调用的 ctx.sessionId、ctx.toolUseId)。path 是绝对路径;before 是原内容,null 表示文件原本不存在;
132
- * afterHash 是写入后内容(UTF-8)的 sha256 十六进制,撤销前用它判断文件之后有没有被别人改过
133
- */
134
- save(sessionId: string, cp: Omit<Checkpoint, "at">): Promise<void>;
135
- /** 会话的全部快照,最新的在前 */
136
- list(sessionId: string): Promise<Checkpoint[]>;
137
- /** 文件现在的内容还是不是这次写入后的样子 */
138
- unchangedSince(cp: Checkpoint): Promise<boolean>;
139
- /** 把文件恢复成 before(before 为 null 时删掉文件) */
140
- restore(cp: Checkpoint): Promise<void>;
141
- }
142
- export interface CompleteRequest {
143
- system?: string;
144
- prompt: string;
145
- onText?(delta: string): void;
146
- }
147
- export interface CompleteResult {
148
- text: string;
149
- /** 实际回复的模型 */
150
- model: string;
151
- usage?: Usage;
152
- }
153
- /** 斜杠命令和用户交互用的界面。非交互运行(-p)时 select / input 直接返回 undefined */
154
- export interface CommandUI {
155
- readonly interactive: boolean;
156
- /** 输出一段文字(可以带 ANSI 颜色) */
157
- log(text: string): void;
158
- /** 让用户从几项里选一项;取消时返回 undefined */
159
- select<T>(title: string, choices: Choice<T>[], opts?: {
160
- body?: string;
161
- }): Promise<T | undefined>;
162
- /** 让用户输入一行;取消时返回 undefined */
163
- input(title: string, opts?: {
164
- initial?: string;
165
- placeholder?: string;
166
- mask?: boolean;
167
- }): Promise<string | undefined>;
168
- }
169
- export interface PluginCommandContext {
170
- sessionId: string;
171
- cwd: string;
172
- /** 用户按 esc 或退出时中断 */
173
- signal: AbortSignal;
174
- /** 当前会话的派生数据(各插件用 ctx.record 写入的) */
175
- derived: Readonly<Record<string, unknown>>;
176
- ui: CommandUI;
177
- /** 附在用户下一条消息前面告诉模型的话,例如"用户删掉了某条记忆" */
178
- note(text: string): void;
179
- /** 操作会话(见 SessionControl);instant 的命令在模型工作时执行,没有这个字段 */
180
- session?: SessionControl;
181
- }
182
- /** 这个目录里的一个会话(会话索引里的一项) */
183
- export interface SessionSummary {
184
- id: string;
185
- /** 第一条消息的开头 */
186
- title: string;
187
- /** 最近一次使用的时间(ISO) */
188
- at: string;
189
- }
190
- /**
191
- * 斜杠命令操作会话用的接口,jade 自己的 /clear、/resume、/retry、/undo 也只用它。
192
- * 换会话之后它指向新的会话:之后的 messages()、record() 都是新会话的
193
- */
194
- export interface SessionControl {
195
- /** 当前会话的消息(拷贝) */
196
- messages(): Message[];
197
- /** 写一项派生数据进日志(derived.recorded),恢复会话后仍在。key 只能是插件的 id 或以 "<id>/" 开头 */
198
- record(key: string, value: unknown): Promise<void>;
199
- /** 这个工作目录里的会话,最近用过的在前 */
200
- list(): Promise<SessionSummary[]>;
201
- /** 开始新会话,当前的保留、可以恢复 */
202
- clear(): Promise<void>;
203
- /** 换到会话 id;恢复失败时留在当前会话并显示原因 */
204
- resume(id: string): Promise<void>;
205
- /** 上一次请求在模型回复之前就失败了时重新请求,不用再发消息;没有可重试的返回 false */
206
- retry(): Promise<boolean>;
207
- /**
208
- * 用新的插件实例继续当前会话,对话内容不变:工具和系统提示词按现在的配置重新生成(例如改了 $JADE_HOME/.env 之后)。
209
- * 调用它的插件实例随之被换掉,之后不要再用它的状态
210
- */
211
- reload(): Promise<void>;
212
- }
213
- /** 字符串:显示给用户;{ prompt }:作为用户消息发给模型;不返回:什么也不做 */
214
- export type PluginCommandResult = string | {
215
- prompt: string;
216
- } | void | undefined;
217
- /** 插件提供的斜杠命令 */
218
- export interface PluginCommand {
219
- name: string;
220
- description?: string;
221
- /** 参数提示,例如 "<file>" */
222
- args?: string;
223
- /**
224
- * 不碰会话状态(只查看、只改插件自己的设置)的命令设为 true:模型工作时也立即执行,不排队。
225
- * 这种命令返回 { prompt } 无效
226
- */
227
- instant?: boolean;
228
- run(args: string, ctx: PluginCommandContext): Awaitable<PluginCommandResult>;
229
- }
230
- /** jade 的插件:内核的 Plugin,外加 jade 认识的扩展字段 */
231
- export interface JadePlugin extends Plugin {
232
- commands?: PluginCommand[];
233
- /** 快捷键,见 PluginKey;和排在前面的插件用了同一个键时忽略 */
234
- keys?: PluginKey[];
235
- /** 本插件的工具在对话里怎么显示,见 ToolRenderer */
236
- renderers?: ToolRenderer[];
237
- /**
238
- * jade 不再用这个实例时调用一次:换会话(/clear、/resume)、重新加载、退出,以及创建了却没用上的实例(例如按 id 停用的)。
239
- * 在会话的收尾(session.detached 的 hook)之后。停掉定时器、关掉连接和监听;
240
- * 之后 ctx.status、ctx.input、ctx.send 不再起作用。限时 DISPOSE_TIMEOUT_MS,出错或超时只显示警告
241
- */
242
- dispose?(): Awaitable<void>;
243
- }
244
- /** definePlugin 的输入:kernel、needs 可以省略 */
245
- export type JadePluginDraft = Omit<JadePlugin, "kernel" | "needs"> & {
246
- kernel?: string;
247
- needs?: string[];
248
- };
249
- /** 插件上下文里 definePlugin 的输入:id、version 也可以省略,用 plugin.json 里的 */
250
- export type ContextPluginDraft = Omit<JadePluginDraft, "id" | "version"> & {
251
- id?: string;
252
- version?: string;
253
- };
254
- export type JadePluginFactory = (ctx: JadePluginContext) => Awaitable<JadePlugin>;
255
- /** 宿主(createJade)提供的那部分上下文;status、send 由加载器按插件的 id 转给宿主,input、send 只转给用户层插件 */
256
- export type HostContext = Omit<JadePluginContext, "dir" | "layer" | "status" | "send" | "definePlugin" | "input"> & {
257
- definePlugin: <T extends JadePluginDraft>(draft: T) => T & JadePlugin;
258
- status(plugin: string, text: string | undefined): void;
259
- send?(plugin: string, text: string): void;
260
- input?: HostInput;
261
- };
262
- /** plugin.json;只带内容的插件可以没有 */
263
- export interface PluginJson {
264
- /**
265
- * 插件的 id,全局唯一,建议 "作者/名字"。有代码的插件必须写:jade 不执行代码就能认出插件(按 id 停用、检查重复),
266
- * 插件实例的 id 必须和它相同。只带内容的插件不写时用目录名
267
- */
268
- id?: string;
269
- /** jade plugin add 安装时用作目录名;/plugins 显示 */
270
- name?: string;
271
- version?: string;
272
- description?: string;
273
- /**
274
- * 代替的内置插件的 id(例如 ["jade/web"]):被代替的内置插件不再加载,它的工具名可以由本插件提供。
275
- * 写在清单里,不执行代码就能知道;jade/policy 不能代替。只有带代码的插件可以写
276
- */
277
- replaces?: string[];
278
- /** 进程内插件的入口,默认依次找 index.ts、index.js、index.mjs */
279
- entry?: string;
280
- /** 进程外插件的启动命令;"./"、"../" 开头的相对于插件目录 */
281
- command?: string;
282
- args?: string[];
283
- env?: Record<string, string>;
284
- /** 默认 true:继承 jade 的全部环境变量 */
285
- inheritEnv?: boolean;
286
- /** 等插件回复 initialize 的时间,默认 10 秒 */
287
- initTimeoutMs?: number;
288
- }
289
- /** 插件目录带的内容(都是绝对路径) */
290
- export interface PluginBundle {
291
- /** 每个目录里的 <name>/SKILL.md 是一个 skill */
292
- skills: string[];
293
- /** 每个目录里的 <name>.md 是一个斜杠命令 */
294
- commands: string[];
295
- /** MCP 服务:配置文件,或者 Claude Code 的 plugin.json 里直接写的 mcpServers */
296
- mcp?: {
297
- file: string;
298
- servers?: unknown;
299
- };
300
- /** 认出来但 jade 还不支持的内容,例如 Claude Code 插件的 hooks、agents */
301
- unsupported: string[];
302
- }
303
- /** 不执行代码就能知道的插件信息 */
304
- export interface PluginInfo {
305
- /** plugin.json 的 id;只带内容的插件可以没有(用目录名,见 pluginId) */
306
- id?: string;
307
- name?: string;
308
- version?: string;
309
- description?: string;
310
- /** plugin.json 的 replaces */
311
- replaces?: string[];
312
- /** module:TS/JS 模块;process:plugin.json 写了 command;content:没有代码,只有 skills、命令、MCP 配置 */
313
- kind: "module" | "process" | "content";
314
- /** module 的入口文件(相对于插件目录) */
315
- entry?: string;
316
- json: PluginJson;
317
- bundle: PluginBundle;
318
- }
319
- export interface FoundPlugin {
320
- /** 目录名 */
321
- name: string;
322
- dir: string;
323
- layer: PluginLayer;
324
- }
325
- /** 读过清单、确定了 id 的插件,还没有执行它的代码 */
326
- export interface ResolvedPlugin extends FoundPlugin {
327
- id: string;
328
- info: PluginInfo;
329
- }
330
- export interface LoadedPlugin extends FoundPlugin {
331
- /** 插件的 id(plugin.json 的 id;只带内容的插件没写时是目录名)。实例的 id 必须和它相同 */
332
- id: string;
333
- kind: PluginInfo["kind"];
334
- /** 模块入口(相对于插件目录),或者进程外插件的启动命令;只有内容的插件为空字符串 */
335
- entry: string;
336
- info: PluginInfo;
337
- /** 创建一套实例,每个会话调用一次;进程外插件只有一个进程,每次返回同一个对象。只有内容的插件没有 */
338
- create?(host: HostContext): Promise<JadePlugin>;
339
- /**
340
- * 进程外插件:这一套实例的快捷键和命令,按 initialize 回复里的清单生成、绑定到这一套的 ctx。
341
- * 进程(create 返回的对象)在会话之间共用,所以它们不挂在进程对象上,见 docs/design/jade-plugin-lifecycle.md 第 6 节
342
- */
343
- adapters?(host: HostContext): Pick<JadePlugin, "keys" | "commands">;
344
- /**
345
- * 插件模块导出的模型服务(export const providers),用 JADE_PROVIDER=<kind> 选择;只认用户层的,项目层的读出来只为提示。
346
- * 不属于哪套插件实例:加载时就读到,启动时注册一次,所有会话共用。还没检查,见 collectProviders
347
- */
348
- providers?: unknown;
349
- /** 进程外插件:结束进程 */
350
- close?(): Promise<void>;
351
- /** 进程外插件的状态:退出信息和最近的 stderr */
352
- process?: {
353
- exited?: {
354
- code: number | null;
355
- signal: string | null;
356
- };
357
- stderr: string[];
358
- };
359
- }
360
- export interface ConfirmPlugin {
361
- (request: {
362
- path: string;
363
- hash: string;
364
- files: string[];
365
- command?: string;
366
- }): Promise<boolean>;
367
- }
368
- export interface LoadOptions {
369
- trust: TrustStore;
370
- /** 项目层插件新出现或内容变化时请用户确认 */
371
- confirm: ConfirmPlugin;
372
- /** 进程外插件意外退出 */
373
- onExit?(plugin: LoadedPlugin, exit: {
374
- code: number | null;
375
- signal: string | null;
376
- }): void;
377
- }
378
- /** 用户层在前;项目层从仓库根目录往下,同名目录近的覆盖远的 */
379
- export declare function discoverPlugins(opts: {
380
- home: string;
381
- root: string;
382
- cwd: string;
383
- }): Promise<FoundPlugin[]>;
384
- /**
385
- * 读插件的清单,确定 id,不执行代码:去掉按 id 停用的、id 重复的(排在后面的跳过)、用了内置插件 id 的。
386
- * 清单读不了的放进 broken,由宿主报告
387
- */
388
- export declare function resolvePlugins(found: FoundPlugin[], disabled: ReadonlySet<string>): Promise<{
389
- plugins: ResolvedPlugin[];
390
- broken: {
391
- found: FoundPlugin;
392
- error: unknown;
393
- }[];
394
- warnings: string[];
395
- }>;
396
- /** 插件的 id:plugin.json 的 id;只带内容的插件没写时用目录名 */
397
- export declare function pluginId(found: FoundPlugin, info: PluginInfo): string;
398
- /** 加载插件:读清单(宿主已经用 resolvePlugins 读过时直接用),项目层的先请用户确认,然后 import 模块或启动进程 */
399
- export declare function loadPlugin(found: FoundPlugin & {
400
- info?: PluginInfo;
401
- }, opts: LoadOptions): Promise<LoadedPlugin>;
402
- /**
403
- * 读插件目录,不执行其中的代码:jade plugin add 用它检查和命名,loadPlugin 用它决定怎么加载。
404
- * 什么都提供不了的目录抛出错误
405
- */
406
- export declare function inspectPlugin(dir: string): Promise<PluginInfo>;
407
- /** 插件 id:几段字母、数字和 . _ - @,用 / 分隔 */
408
- export declare const PLUGIN_ID: RegExp;
409
- /** 斜杠命令名:字母数字开头,之后可以有 - 和 _ */
410
- export declare const COMMAND_NAME: RegExp;