@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
package/src/mentions.ts DELETED
@@ -1,135 +0,0 @@
1
- // @ 引用文件:输入框里打 @ 时补全路径,发送时把引用的文件内容随消息一起交给模型。
2
- //
3
- // 内容用 read_file / list_dir 工具本身读取,格式和模型自己读到的一样(带行号),
4
- // 而且算作"读过":模型可以直接修改引用的文件,不用先再读一遍。
5
- // 只有存在的路径才算引用,所以消息里普通的 @someone 原样保留。
6
-
7
- import { stat } from "node:fs/promises";
8
- import os from "node:os";
9
- import path from "node:path";
10
- import type { Block, Tool, ToolContext } from "uncarved";
11
- import { display, listFiles } from "./tools/fs.ts";
12
-
13
- /** 补全用的候选最多这么多个(文件加目录) */
14
- const MAX_CANDIDATES = 20_000;
15
-
16
- /** @ 后面的路径:@"带 空格 的路径" 或者到空白为止 */
17
- const MENTION = /(?<=^|\s)@(?:"([^"\n]+)"|([^\s"]+))/g;
18
-
19
- /** 光标正在输入的 @ 引用:@ 的下标和已经输入的部分;不在引用里时返回 undefined */
20
- export function mentionAt(value: string, cursor: number): { start: number; query: string } | undefined {
21
- const m = /(?:^|\s)@("?[^\s"]*)$/.exec(value.slice(0, cursor));
22
- if (!m) return undefined;
23
- return { start: cursor - m[1]!.length - 1, query: m[1]!.replace(/^"/, "") };
24
- }
25
-
26
- /** 补全后的文本:@ 引用加一个空格,含空白的路径加引号 */
27
- export const mentionText = (p: string) => (/\s/.test(p) ? `@"${p}"` : `@${p}`);
28
-
29
- /** 消息里引用的路径,去重,按出现顺序;末尾的标点(句号、逗号……)不算路径 */
30
- export function parseMentions(text: string): string[] {
31
- const out: string[] = [];
32
- for (const m of text.matchAll(MENTION)) {
33
- const p = m[1] ?? m[2]!.replace(/[.,;:!?)\]},。;:!?)】]+$/u, "");
34
- if (p && !out.includes(p)) out.push(p);
35
- }
36
- return out;
37
- }
38
-
39
- /**
40
- * 按 query 给候选路径排序:文件名以 query 开头的最前,其次文件名包含、路径包含,
41
- * 最后是按顺序出现 query 每个字符的模糊匹配;同一档里短的在前
42
- */
43
- export function rankPaths(paths: string[], query: string, limit: number): string[] {
44
- const q = query.toLowerCase().replaceAll("\\", "/");
45
- if (!q) return paths.filter((p) => !p.slice(0, -1).includes("/")).slice(0, limit);
46
- const scored: { p: string; score: number }[] = [];
47
- for (const p of paths) {
48
- const lower = p.toLowerCase();
49
- const base = lower.replace(/\/$/, "").split("/").pop()!;
50
- let score: number;
51
- if (lower.startsWith(q)) score = 0;
52
- else if (base.startsWith(q)) score = 1;
53
- else if (base.includes(q)) score = 2;
54
- else if (lower.includes(q)) score = 3;
55
- else if (subsequence(lower, q)) score = 4;
56
- else continue;
57
- scored.push({ p, score });
58
- }
59
- scored.sort((a, b) => a.score - b.score || a.p.length - b.p.length || a.p.localeCompare(b.p));
60
- return scored.slice(0, limit).map((s) => s.p);
61
- }
62
-
63
- function subsequence(text: string, q: string): boolean {
64
- let i = 0;
65
- for (const ch of text) if (ch === q[i] && ++i === q.length) return true;
66
- return false;
67
- }
68
-
69
- /** 补全的候选:工作目录里未被 git 忽略的文件和它们所在的目录(目录以 / 结尾),相对路径、正斜杠 */
70
- export async function mentionCandidates(cwd: string): Promise<string[]> {
71
- const files: string[] = [];
72
- const dirs = new Set<string>();
73
- for await (const full of await listFiles(cwd, AbortSignal.timeout(5000))) {
74
- const rel = display(cwd, full);
75
- files.push(rel);
76
- for (let i = rel.lastIndexOf("/"); i > 0; i = rel.lastIndexOf("/", i - 1)) {
77
- const dir = rel.slice(0, i + 1);
78
- if (dirs.has(dir)) break;
79
- dirs.add(dir);
80
- }
81
- if (files.length + dirs.size >= MAX_CANDIDATES) break;
82
- }
83
- return [...dirs, ...files];
84
- }
85
-
86
- export interface Attachments {
87
- /** 随消息发出的内容 */
88
- blocks: Block[];
89
- /** 附上了的路径(显示用) */
90
- attached: string[];
91
- /** 存在但读不了的 */
92
- failed: { path: string; reason: string }[];
93
- }
94
-
95
- /** 读取消息里引用的文件和目录;tools 里要有 read_file 和 list_dir */
96
- export async function attachMentions(text: string, opts: { cwd: string; tools: Tool[]; sessionId: string; signal: AbortSignal }): Promise<Attachments> {
97
- const out: Attachments = { blocks: [], attached: [], failed: [] };
98
- const tool = (name: string) => opts.tools.find((t) => t.name === name);
99
- let n = 0;
100
- for (const p of parseMentions(text)) {
101
- const full = path.resolve(opts.cwd, p.replace(/^~(?=$|[\\/])/, os.homedir()));
102
- const info = await stat(full).catch(() => undefined);
103
- if (!info) continue;
104
- const name = info.isDirectory() ? "list_dir" : "read_file";
105
- const t = tool(name);
106
- if (!t) continue;
107
- const ctx: ToolContext = {
108
- sessionId: opts.sessionId,
109
- toolUseId: `mention-${Date.now()}-${n++}`,
110
- signal: opts.signal,
111
- parent: { sessionId: opts.sessionId, eventId: "" },
112
- progress: () => {},
113
- };
114
- const shown = display(opts.cwd, full);
115
- try {
116
- const r = await t.execute({ path: full }, ctx);
117
- if (r.isError) {
118
- out.failed.push({ path: shown, reason: typeof r.content === "string" ? r.content : "could not be read" });
119
- continue;
120
- }
121
- const what = name === "list_dir" ? "the directory" : "the file";
122
- const head = `[Note from jade] The user referenced ${what} ${shown}. Its content, as ${name} returns it:`;
123
- out.blocks.push({ kind: "text", text: head, origin: { by: "host" }, trust: "trusted" });
124
- out.blocks.push(
125
- ...(typeof r.content === "string"
126
- ? [{ kind: "text" as const, text: r.content, origin: { by: "tool" as const, name }, trust: "untrusted" as const }]
127
- : r.content),
128
- );
129
- out.attached.push(shown);
130
- } catch (err) {
131
- out.failed.push({ path: shown, reason: err instanceof Error ? err.message : String(err) });
132
- }
133
- }
134
- return out;
135
- }
package/src/plugin-cli.ts DELETED
@@ -1,278 +0,0 @@
1
- // jade plugin …:安装、更新、卸载、停用插件。在会话外运行,不需要配置模型。
2
-
3
- import { readdir, readFile } from "node:fs/promises";
4
- import path from "node:path";
5
- import { hashDir, type TrustStore } from "uncarved";
6
- import { BUILTINS, BUILTIN_IDS, REQUIRED_IDS } from "./plugins/builtins.ts";
7
- import {
8
- addPlugin,
9
- installedNames,
10
- readPluginSettings,
11
- readRecords,
12
- removePlugin,
13
- setDisabled,
14
- updatePlugins,
15
- type InstallRecord,
16
- } from "./plugins/install.ts";
17
- import { inspectPlugin, pluginId, type PluginInfo } from "./plugins/loader.ts";
18
- import { bold, dim, green, red, terminalSafe, yellow } from "./ui/screen.ts";
19
-
20
- export const PLUGIN_HELP = `Usage: jade plugin <command>
21
-
22
- list built-in and installed plugins
23
- add <source> [options] install a plugin
24
- <source>: a git URL (https://…, git@…, github:user/repo, user/repo; #branch, #tag or #commit),
25
- an npm package (name, name@version, @scope/name, npm:<spec>, a .tgz file),
26
- or a local directory
27
- --project install into <repository>/.jade/plugins instead of $JADE_HOME/plugins
28
- --name <name> directory name (default: the plugin's name)
29
- --path <dir> use this subdirectory of the source (for repositories with several plugins)
30
- --link local directory: link it instead of copying (for plugin development)
31
- --force replace a plugin with the same name
32
- update [name…] [--project] fetch again what jade plugin add installed (all of them when no name is given)
33
- remove <name> [--project] delete an installed plugin
34
- disable <id|name> stop loading a plugin (by its id, or the name of its directory),
35
- or a built-in plugin such as jade/web
36
- enable <id|name> undo disable
37
-
38
- Plugins are loaded when jade starts; restart running sessions to pick up changes.`;
39
-
40
- export interface PluginCliOptions {
41
- home: string;
42
- cwd: string;
43
- /** 仓库根目录(--project 用) */
44
- root: string;
45
- /** --project 安装的插件代码已经由用户看过,写进确认记录 */
46
- trust: TrustStore;
47
- out?: (text: string) => void;
48
- err?: (text: string) => void;
49
- }
50
-
51
- /** 返回退出码 */
52
- export async function pluginCli(argv: string[], o: PluginCliOptions): Promise<number> {
53
- // 插件的名字、说明来自插件目录(可能是刚下载的):只留颜色,去掉能搅乱终端的控制序列
54
- const out = (t: string) => (o.out ?? console.log)(terminalSafe(t));
55
- const err = (t: string) => (o.err ?? console.error)(terminalSafe(t));
56
- const [sub, ...rest] = argv;
57
- const flags = { project: false, link: false, force: false } as { project: boolean; link: boolean; force: boolean; name?: string; path?: string };
58
- const args: string[] = [];
59
- for (let i = 0; i < rest.length; i++) {
60
- const a = rest[i]!;
61
- const value = () => {
62
- const v = rest[++i];
63
- if (v === undefined) throw new UsageError(`${a} needs a value`);
64
- return v;
65
- };
66
- if (a === "--project") flags.project = true;
67
- else if (a === "--link") flags.link = true;
68
- else if (a === "--force" || a === "-f") flags.force = true;
69
- else if (a === "--name") flags.name = value();
70
- else if (a === "--path") flags.path = value();
71
- else if (a === "-h" || a === "--help") {
72
- out(PLUGIN_HELP);
73
- return 0;
74
- } else if (a.startsWith("-")) throw new UsageError(`unknown option ${a}`);
75
- else args.push(a);
76
- }
77
- const userDir = path.join(o.home, "plugins");
78
- const projectDir = path.join(o.root, ".jade", "plugins");
79
- const dir = flags.project ? projectDir : userDir;
80
- const log = (t: string) => err(dim(t));
81
-
82
- switch (sub) {
83
- case undefined:
84
- case "help":
85
- case "-h":
86
- case "--help":
87
- out(PLUGIN_HELP);
88
- return 0;
89
- case "list":
90
- case "ls":
91
- await list(o, out);
92
- return 0;
93
- case "add":
94
- case "install": {
95
- if (args.length !== 1) throw new UsageError("usage: jade plugin add <source> [--project] [--name <name>] [--path <dir>] [--link] [--force]");
96
- const r = await addPlugin(args[0]!, { pluginsDir: dir, cwd: o.cwd, name: flags.name, subdir: flags.path, link: flags.link, force: flags.force, log });
97
- if (flags.project && r.info.kind === "module") await trustProject(r.dir, o.trust);
98
- out(green(`Installed ${bold(pluginId({ name: r.name, dir: r.dir, layer: "user" }, r.info))}${r.info.version ? ` ${r.info.version}` : ""} into ${r.dir}`) + dim(` (${origin(r.record)})`));
99
- for (const line of await provides(r.dir, r.info)) out(` ${line}`);
100
- if (r.info.bundle.unsupported.length) out(yellow(` jade does not support the plugin's ${r.info.bundle.unsupported.join(" and ")} yet; they are ignored`));
101
- if (flags.project) out(dim(" Commit .jade/plugins to share it; others confirm it the first time jade loads it."));
102
- out(dim("Restart jade to load it."));
103
- return 0;
104
- }
105
- case "update":
106
- case "upgrade": {
107
- const results = await updatePlugins(args, { pluginsDir: dir, cwd: o.cwd, log });
108
- if (results.length === 0) out(dim(`No plugins were installed with jade plugin add in ${dir}.`));
109
- let failed = false;
110
- for (const r of results) {
111
- if (r.status === "updated") {
112
- out(green(`${r.name}: updated${r.from || r.to ? ` ${r.from ?? "?"} → ${r.to ?? "?"}` : ""}`));
113
- if (flags.project) {
114
- const info = await inspectPlugin(path.join(dir, r.name)).catch(() => undefined);
115
- if (info?.kind === "module") await trustProject(path.join(dir, r.name), o.trust);
116
- }
117
- } else if (r.status === "current") out(`${r.name}: up to date${r.to ? ` (${r.to})` : ""}`);
118
- else if (r.status === "linked") out(dim(`${r.name}: linked to a local directory; nothing to fetch`));
119
- else if (r.status === "unmanaged") out(dim(`${r.name}: not installed with jade plugin add; update it by hand`));
120
- else {
121
- failed = true;
122
- err(red(`${r.name}: ${r.error}`));
123
- }
124
- }
125
- if (results.some((r) => r.status === "updated")) out(dim("Restart jade to load the new versions."));
126
- return failed ? 1 : 0;
127
- }
128
- case "remove":
129
- case "rm":
130
- case "uninstall": {
131
- if (args.length !== 1) throw new UsageError("usage: jade plugin remove <name> [--project]");
132
- // 停用记录按 id:删掉之前读出来
133
- const info = await inspectPlugin(path.join(dir, args[0]!)).catch(() => undefined);
134
- if (!(await removePlugin(args[0]!, dir))) {
135
- err(red(`plugin ${args[0]} is not installed in ${dir}`));
136
- return 1;
137
- }
138
- if (info) await setDisabled(o.home, pluginId({ name: args[0]!, dir, layer: "user" }, info), false);
139
- out(green(`Removed ${args[0]}.`));
140
- return 0;
141
- }
142
- case "disable":
143
- case "enable": {
144
- if (args.length !== 1) throw new UsageError(`usage: jade plugin ${sub} <id|name>`);
145
- const arg = args[0]!;
146
- if (sub === "disable" && REQUIRED_IDS.has(arg)) {
147
- err(red(`${arg} cannot be disabled: it decides which tool calls need your approval. Plugins can only make it stricter, with gate hooks.`));
148
- return 1;
149
- }
150
- // plugins.json 只记 id:给的是目录名时换成那个插件的 id
151
- let name = arg;
152
- if (!BUILTIN_IDS.has(arg)) {
153
- const installed = await installedPlugins(o);
154
- const byId = installed.find((p) => p.id === arg);
155
- const byDir = installed.filter((p) => p.name === arg && p.id !== undefined);
156
- if (!byId && byDir.length === 1) name = byDir[0]!.id!;
157
- else if (!byId && byDir.length > 1) {
158
- err(red(`several plugins are in a directory called ${arg} (${byDir.map((p) => p.id).join(", ")}); give the id instead`));
159
- return 1;
160
- } else if (!byId && sub === "disable") {
161
- err(yellow(`note: no built-in or installed plugin has the id ${arg}; it is disabled anyway, in case a plugin with that id shows up`));
162
- }
163
- }
164
- const changed = await setDisabled(o.home, name, sub === "disable");
165
- out(changed ? green(`${name} ${sub}d.`) + dim(" Restart jade to apply it.") : dim(`${name} is already ${sub}d.`));
166
- return 0;
167
- }
168
- default:
169
- throw new UsageError(`unknown command ${sub}`);
170
- }
171
- }
172
-
173
- export class UsageError extends Error {}
174
-
175
- async function list(o: PluginCliOptions, out: (t: string) => void) {
176
- const { disabled } = await readPluginSettings(o.home);
177
- const off = new Set(disabled);
178
- // 先读清单(不执行代码):内置插件那一栏要显示被谁代替
179
- const layers = [];
180
- for (const [title, dir] of [
181
- ["User", path.join(o.home, "plugins")],
182
- ["Project", path.join(o.root, ".jade", "plugins")],
183
- ] as const) {
184
- const records = await readRecords(dir);
185
- const entries = [];
186
- for (const name of await installedNames(dir)) {
187
- let info: PluginInfo | undefined;
188
- let problem: string | undefined;
189
- try {
190
- info = await inspectPlugin(path.join(dir, name));
191
- } catch (e) {
192
- problem = e instanceof Error ? e.message : String(e);
193
- }
194
- const id = info ? pluginId({ name, dir, layer: "user" }, info) : undefined;
195
- entries.push({ name, info, problem, id, rec: records[name] });
196
- }
197
- layers.push({ title, dir, entries });
198
- }
199
- const replacedBy = new Map<string, string>();
200
- for (const e of layers.flatMap((l) => l.entries)) {
201
- if (e.id === undefined || off.has(e.id)) continue;
202
- for (const b of e.info?.replaces ?? []) if (!replacedBy.has(b)) replacedBy.set(b, e.id);
203
- }
204
-
205
- out(bold("Built-in") + dim(" (jade plugin disable <id> turns one off)"));
206
- const width = Math.max(...BUILTINS.map((b) => b.id.length)) + 2;
207
- for (const b of BUILTINS) {
208
- const by = replacedBy.get(b.id);
209
- const state = b.required ? dim(" required") : off.has(b.id) ? yellow(" disabled") : by ? yellow(` replaced by ${by}`) : "";
210
- out(` ${b.id.padEnd(width)}${dim(b.about)}${state}`);
211
- }
212
- for (const { title, dir, entries } of layers) {
213
- out("");
214
- out(bold(title) + dim(` ${dir}`));
215
- if (entries.length === 0) {
216
- out(dim(" (none)"));
217
- continue;
218
- }
219
- for (const { name, info, problem, id, rec } of entries) {
220
- const version = info?.version ?? rec?.version;
221
- const state = id !== undefined && off.has(id) ? yellow(" disabled") : problem ? red(` broken: ${problem}`) : "";
222
- const where = id === name ? "" : dim(` (${name}/)`);
223
- out(` ${bold(id ?? name)}${where}${version ? ` ${version}` : ""}${info ? dim(` ${info.kind}`) : ""}${rec ? dim(` · ${origin(rec)}`) : dim(" · copied by hand")}${state}`);
224
- if (info?.description) out(dim(` ${info.description}`));
225
- if (info) for (const line of await provides(path.join(dir, name), info)) out(dim(` ${line}`));
226
- }
227
- }
228
- }
229
-
230
- function origin(rec: InstallRecord): string {
231
- if (rec.kind === "link") return `linked to ${rec.source}`;
232
- const at = rec.commit ? `@${rec.commit.slice(0, 7)}` : "";
233
- return `${rec.source}${rec.subdir ? ` (${rec.subdir})` : ""}${at}`;
234
- }
235
-
236
- /** 插件带了哪些东西(代码的工具和 hook 要加载后才知道,这里只说它是什么形式) */
237
- async function provides(dir: string, info: PluginInfo): Promise<string[]> {
238
- const lines: string[] = [];
239
- if (info.kind === "module") lines.push(`code: ${info.entry}`);
240
- if (info.kind === "process") lines.push(`process: ${[info.json.command, ...(info.json.args ?? [])].join(" ")}`);
241
- if (info.replaces?.length) lines.push(`replaces: ${info.replaces.join(", ")}`);
242
- const skills: string[] = [];
243
- for (const d of info.bundle.skills) {
244
- for (const n of await readdir(d).catch(() => [] as string[])) {
245
- if (await readFile(path.join(d, n, "SKILL.md")).then(() => true, () => false)) skills.push(n);
246
- }
247
- }
248
- if (skills.length) lines.push(`skills: ${skills.sort().join(", ")}`);
249
- const commands: string[] = [];
250
- for (const d of info.bundle.commands) for (const n of await readdir(d).catch(() => [] as string[])) if (n.endsWith(".md")) commands.push(`/${n.slice(0, -3)}`);
251
- if (commands.length) lines.push(`commands: ${commands.sort().join(", ")}`);
252
- if (info.bundle.mcp) {
253
- let servers = info.bundle.mcp.servers;
254
- if (servers === undefined) servers = await readFile(info.bundle.mcp.file, "utf8").then((t) => JSON.parse(t)?.mcpServers, () => undefined);
255
- const names = servers && typeof servers === "object" ? Object.keys(servers) : [];
256
- lines.push(`MCP servers: ${names.length ? names.join(", ") : path.relative(dir, info.bundle.mcp.file)}`);
257
- }
258
- return lines;
259
- }
260
-
261
- /** 用户层和项目层装了的插件:目录名和 id(清单读不了的没有 id) */
262
- async function installedPlugins(o: PluginCliOptions): Promise<{ name: string; id?: string }[]> {
263
- const out: { name: string; id?: string }[] = [];
264
- for (const dir of [path.join(o.home, "plugins"), path.join(o.root, ".jade", "plugins")]) {
265
- for (const name of await installedNames(dir)) {
266
- const info = await inspectPlugin(path.join(dir, name)).catch(() => undefined);
267
- out.push({ name, id: info && pluginId({ name, dir, layer: "user" }, info) });
268
- }
269
- }
270
- return out;
271
- }
272
-
273
- /** 自己用 --project 装的插件不用在启动时再确认一次(别人拉取仓库后第一次加载时仍要确认) */
274
- async function trustProject(dir: string, trust: TrustStore) {
275
- const root = path.resolve(dir);
276
- const { hash } = await hashDir(root);
277
- if (!(await trust.has(hash))) await trust.add({ hash, path: root, at: new Date().toISOString() });
278
- }
@@ -1,37 +0,0 @@
1
- // 预算插件:一轮里模型调用次数超过上限就停下(turn.continue)。
2
-
3
- import type { Plugin, State } from "uncarved";
4
-
5
- export interface BudgetOptions {
6
- /** 一轮最多调用模型的次数,默认 100;传函数时每次判断时取值 */
7
- maxSteps?: number | (() => number);
8
- id?: string;
9
- }
10
-
11
- /** 本轮(最近一条用户输入之后)模型已经回复了几次 */
12
- export function stepsThisTurn(s: State): number {
13
- let steps = 0;
14
- for (let i = s.messages.length - 1; i >= 0; i--) {
15
- const m = s.messages[i]!;
16
- if (m.role === "assistant") steps++;
17
- else if (m.content.some((b) => b.kind !== "tool_result")) break;
18
- }
19
- return steps;
20
- }
21
-
22
- export function budget(opts: BudgetOptions = {}): Plugin {
23
- const max = typeof opts.maxSteps === "function" ? opts.maxSteps : () => (opts.maxSteps as number | undefined) ?? 100;
24
- return {
25
- id: opts.id ?? "jade/budget",
26
- version: "0.1.0",
27
- kernel: "^0.1",
28
- needs: ["gate:turn.continue"],
29
- hooks: [
30
- {
31
- kind: "gate",
32
- point: "turn.continue",
33
- fn: (s) => (stepsThisTurn(s) >= max() ? { decision: "deny" } : { decision: "abstain" }),
34
- },
35
- ],
36
- };
37
- }
@@ -1,34 +0,0 @@
1
- // jade 自带的插件。内核之外的功能都以插件的形式提供,和第三方插件用同一套接口:
2
- // 每个都可以在 $JADE_HOME/plugins.json 里停用(jade plugin disable <id>),
3
- // 或者由第三方插件在 plugin.json 里用 replaces 代替。jade/policy 负责审批,不能停用或代替,第三方插件只能用 gate hook 让它更严格。
4
-
5
- export interface BuiltinInfo {
6
- id: string;
7
- /** 提供什么(jade plugin list、/plugins 显示) */
8
- about: string;
9
- /** 不能停用或代替 */
10
- required?: boolean;
11
- }
12
-
13
- export const BUILTINS: readonly BuiltinInfo[] = [
14
- { id: "jade/policy", about: "permission modes and approvals", required: true },
15
- { id: "jade/prompts", about: "system prompt, environment, AGENTS.md / CLAUDE.md instructions" },
16
- { id: "jade/fs", about: "read_file, write_file, edit_file, multi_edit, list_dir, glob, grep" },
17
- { id: "jade/shell", about: "bash, bash_output, kill_shell" },
18
- { id: "jade/web", about: "web_fetch, web_search, /search" },
19
- { id: "jade/todo", about: "todo_write" },
20
- { id: "jade/ask", about: "ask_user (the agent asks you clarifying questions)" },
21
- { id: "jade/memory", about: "memory tool, memories in the system prompt, /memory" },
22
- { id: "jade/task", about: "task tool (read-only sub-agents)" },
23
- { id: "jade/skills", about: "skill tool, skill list in the system prompt, /skills" },
24
- { id: "jade/mcp", about: "tools of the MCP servers, /mcp" },
25
- { id: "jade/checks", about: "project checks after edits, /checks" },
26
- { id: "jade/compact", about: "compacts the history near the context limit, /compact" },
27
- { id: "jade/budget", about: "limits the steps of a turn" },
28
- { id: "jade/sessions", about: "/clear, /resume, /retry" },
29
- { id: "jade/undo", about: "/undo (restores the files changed in the last turn)" },
30
- { id: "jade/repeats", about: "rejects calls repeated in one response and re-opening an unchanged file, warns about repeated failures and read-backs" },
31
- ];
32
-
33
- export const BUILTIN_IDS: ReadonlySet<string> = new Set(BUILTINS.map((b) => b.id));
34
- export const REQUIRED_IDS: ReadonlySet<string> = new Set(BUILTINS.filter((b) => b.required).map((b) => b.id));