@uncarved/jade 0.1.3 → 0.2.0
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.
- package/bin/jade.js +5 -27
- package/dist/api.d.ts +266 -0
- package/dist/api.js +38 -0
- package/dist/api.js.map +1 -0
- package/dist/config.d.ts +13 -32
- package/dist/config.js +39 -121
- package/dist/config.js.map +1 -1
- package/dist/fetch.d.ts +20 -0
- package/dist/fetch.js +190 -0
- package/dist/fetch.js.map +1 -0
- package/dist/hash.d.ts +2 -0
- package/dist/hash.js +42 -0
- package/dist/hash.js.map +1 -0
- package/dist/host.d.ts +71 -0
- package/dist/host.js +400 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +11 -30
- package/dist/index.js +11 -30
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +78 -0
- package/dist/install.js +292 -0
- package/dist/install.js.map +1 -0
- package/dist/main.d.ts +1 -2
- package/dist/main.js +159 -1362
- package/dist/main.js.map +1 -1
- package/dist/manifest.d.ts +23 -0
- package/dist/manifest.js +159 -0
- package/dist/manifest.js.map +1 -0
- package/dist/membrane.d.ts +33 -0
- package/dist/membrane.js +140 -0
- package/dist/membrane.js.map +1 -0
- package/dist/remote.d.ts +10 -0
- package/dist/remote.js +292 -0
- package/dist/remote.js.map +1 -0
- package/dist/rescue.d.ts +10 -0
- package/dist/rescue.js +216 -0
- package/dist/rescue.js.map +1 -0
- package/dist/resolve.d.ts +34 -0
- package/dist/resolve.js +178 -0
- package/dist/resolve.js.map +1 -0
- package/dist/rpc.d.ts +26 -0
- package/dist/rpc.js +144 -0
- package/dist/rpc.js.map +1 -0
- package/dist/secrets.d.ts +12 -0
- package/dist/secrets.js +125 -0
- package/dist/secrets.js.map +1 -0
- package/dist/session.d.ts +45 -0
- package/dist/session.js +401 -0
- package/dist/session.js.map +1 -0
- package/dist/source.d.ts +12 -0
- package/dist/source.js +72 -0
- package/dist/source.js.map +1 -0
- package/dist/state.d.ts +37 -0
- package/dist/state.js +93 -0
- package/dist/state.js.map +1 -0
- package/dist/update.d.ts +2 -0
- package/dist/update.js +6 -3
- package/dist/update.js.map +1 -1
- package/package.json +10 -8
- package/plugins/approval/index.ts +297 -0
- package/plugins/approval/plugin.json +18 -0
- package/{src/plugins → plugins/approval}/policy.ts +21 -100
- package/{src/plugins → plugins/approval}/review.ts +62 -16
- package/plugins/ask/index.ts +159 -0
- package/plugins/ask/plugin.json +8 -0
- package/plugins/budget/index.ts +38 -0
- package/plugins/budget/plugin.json +13 -0
- package/{src/plugins → plugins/checks}/checks.ts +48 -38
- package/plugins/checks/index.ts +158 -0
- package/plugins/checks/plugin.json +14 -0
- package/plugins/checks/project.ts +81 -0
- package/plugins/commands/index.ts +76 -0
- package/plugins/commands/plugin.json +7 -0
- package/{src/plugins → plugins/compact}/compact.ts +73 -38
- package/plugins/compact/index.ts +115 -0
- package/plugins/compact/plugin.json +17 -0
- package/plugins/compact/style.ts +17 -0
- package/plugins/continue/index.ts +58 -0
- package/plugins/continue/plugin.json +13 -0
- package/{src/ui → plugins/fs}/diff.ts +2 -2
- package/{src/tools → plugins/fs}/fs.ts +19 -42
- package/{src/tools → plugins/fs}/grep.ts +1 -1
- package/plugins/fs/index.ts +34 -0
- package/plugins/fs/plugin.json +7 -0
- package/{src/ui → plugins/fs}/renderers.ts +25 -70
- package/plugins/fs/style.ts +18 -0
- package/plugins/fs/sys.ts +81 -0
- package/plugins/keys/index.ts +53 -0
- package/plugins/keys/plugin.json +7 -0
- package/plugins/mcp/index.ts +192 -0
- package/{src → plugins/mcp}/mcp.ts +32 -32
- package/plugins/mcp/plugin.json +7 -0
- package/plugins/mcp/project.ts +93 -0
- package/plugins/memory/index.ts +105 -0
- package/{src → plugins/memory}/memory.ts +20 -2
- package/plugins/memory/notes.ts +43 -0
- package/plugins/memory/plugin.json +7 -0
- package/plugins/memory/style.ts +17 -0
- package/plugins/mentions/attach.ts +127 -0
- package/plugins/mentions/index.ts +79 -0
- package/plugins/mentions/plugin.json +7 -0
- package/plugins/mentions/style.ts +17 -0
- package/plugins/models/config.ts +53 -0
- package/plugins/models/configure.ts +455 -0
- package/plugins/models/context.ts +32 -0
- package/plugins/models/index.ts +198 -0
- package/plugins/models/plugin.json +8 -0
- package/{src → plugins/models}/provider.ts +16 -119
- package/plugins/models/saved.ts +94 -0
- package/plugins/modes/index.ts +222 -0
- package/plugins/modes/plugin.json +9 -0
- package/plugins/plugins/index.ts +38 -0
- package/plugins/plugins/plugin.json +7 -0
- package/plugins/print/index.ts +142 -0
- package/plugins/print/plugin.json +8 -0
- package/plugins/prompts/index.ts +83 -0
- package/plugins/prompts/plugin.json +8 -0
- package/plugins/prompts/prompts.ts +253 -0
- package/plugins/prompts/sys.ts +72 -0
- package/plugins/renderers/index.ts +78 -0
- package/plugins/renderers/plugin.json +7 -0
- package/plugins/repeats/index.ts +165 -0
- package/plugins/repeats/plugin.json +6 -0
- package/plugins/schedule/cron.ts +74 -0
- package/plugins/schedule/index.ts +292 -0
- package/plugins/schedule/plugin.json +13 -0
- package/plugins/schedule/store.ts +149 -0
- package/plugins/scratch/index.ts +31 -0
- package/plugins/scratch/plugin.json +7 -0
- package/plugins/screenshot/index.ts +40 -0
- package/plugins/screenshot/plugin.json +7 -0
- package/plugins/screenshot/sys.ts +84 -0
- package/{src/tools/screenshot.ts → plugins/screenshot/tool.ts} +6 -6
- package/plugins/sessions/index.ts +148 -0
- package/plugins/sessions/plugin.json +8 -0
- package/plugins/shell/index.ts +33 -0
- package/plugins/shell/plugin.json +17 -0
- package/plugins/shell/renderers.ts +45 -0
- package/plugins/shell/service.ts +44 -0
- package/{src/tools → plugins/shell}/shell.ts +31 -20
- package/{src → plugins/shell}/sys.ts +2 -43
- package/plugins/skills/index.ts +96 -0
- package/plugins/skills/plugin.json +7 -0
- package/plugins/skills/project.ts +49 -0
- package/{src → plugins/skills}/skills.ts +4 -11
- package/plugins/suggest/index.ts +286 -0
- package/plugins/suggest/plugin.json +18 -0
- package/plugins/task/index.ts +167 -0
- package/plugins/task/plugin.json +15 -0
- package/plugins/task/style.ts +17 -0
- package/plugins/task/subagent.ts +257 -0
- package/{src/tools/todo.ts → plugins/todo/index.ts} +33 -7
- package/plugins/todo/plugin.json +7 -0
- package/{src/ui → plugins/tui}/editor.ts +3 -0
- package/plugins/tui/frontend.ts +596 -0
- package/plugins/tui/index.ts +37 -0
- package/plugins/tui/mentions.ts +113 -0
- package/plugins/tui/plugin.json +10 -0
- package/{src/ui → plugins/tui}/render.ts +8 -2
- package/{src/ui → plugins/tui}/screen.ts +8 -3
- package/{src/ui → plugins/tui}/transcript.ts +74 -99
- package/{src/ui/tui.tsx → plugins/tui/tui.ts} +358 -387
- package/{src/tools → plugins/undo}/checkpoint.ts +21 -60
- package/plugins/undo/index.ts +139 -0
- package/plugins/undo/notes.ts +43 -0
- package/plugins/undo/plugin.json +7 -0
- package/plugins/undo/style.ts +17 -0
- package/plugins/update/index.ts +40 -0
- package/plugins/update/plugin.json +13 -0
- package/plugins/web/env.ts +78 -0
- package/plugins/web/index.ts +133 -0
- package/plugins/web/plugin.json +15 -0
- package/plugins/web/renderers.ts +11 -0
- package/{src/tools → plugins/web}/web.ts +58 -26
- package/plugins-dist/approval/index.js +271 -0
- package/plugins-dist/approval/plugin.json +24 -0
- package/{dist/plugins → plugins-dist/approval}/policy.js +15 -81
- package/{dist/plugins → plugins-dist/approval}/review.js +56 -10
- package/{dist/plugins → plugins-dist/approval}/schema.js +0 -1
- package/plugins-dist/ask/index.js +145 -0
- package/plugins-dist/ask/plugin.json +12 -0
- package/plugins-dist/budget/index.js +37 -0
- package/plugins-dist/budget/plugin.json +15 -0
- package/{dist/plugins → plugins-dist/checks}/checks.js +46 -35
- package/plugins-dist/checks/index.js +150 -0
- package/plugins-dist/checks/plugin.json +21 -0
- package/plugins-dist/checks/project.js +76 -0
- package/plugins-dist/commands/index.js +33 -0
- package/plugins-dist/commands/plugin.json +9 -0
- package/{dist/plugins → plugins-dist/compact}/compact.js +51 -33
- package/plugins-dist/compact/index.js +100 -0
- package/plugins-dist/compact/plugin.json +25 -0
- package/plugins-dist/compact/style.js +14 -0
- package/plugins-dist/continue/index.js +57 -0
- package/plugins-dist/continue/plugin.json +15 -0
- package/{dist/ui → plugins-dist/fs}/diff.js +2 -3
- package/{dist/tools → plugins-dist/fs}/fs.js +17 -42
- package/{dist/tools → plugins-dist/fs}/grep.js +1 -2
- package/plugins-dist/fs/index.js +36 -0
- package/plugins-dist/fs/plugin.json +10 -0
- package/{dist/ui → plugins-dist/fs}/renderers.js +24 -61
- package/plugins-dist/fs/style.js +15 -0
- package/plugins-dist/fs/sys.js +54 -0
- package/plugins-dist/keys/index.js +36 -0
- package/plugins-dist/keys/plugin.json +9 -0
- package/plugins-dist/mcp/index.js +187 -0
- package/{dist → plugins-dist/mcp}/mcp.js +34 -30
- package/plugins-dist/mcp/plugin.json +12 -0
- package/plugins-dist/mcp/project.js +90 -0
- package/plugins-dist/memory/index.js +94 -0
- package/{dist → plugins-dist/memory}/memory.js +21 -3
- package/plugins-dist/memory/notes.js +36 -0
- package/plugins-dist/memory/plugin.json +11 -0
- package/plugins-dist/memory/style.js +14 -0
- package/plugins-dist/mentions/attach.js +120 -0
- package/plugins-dist/mentions/index.js +69 -0
- package/plugins-dist/mentions/plugin.json +9 -0
- package/plugins-dist/mentions/style.js +14 -0
- package/plugins-dist/models/config.js +53 -0
- package/plugins-dist/models/configure.js +415 -0
- package/plugins-dist/models/context.js +27 -0
- package/plugins-dist/models/index.js +167 -0
- package/plugins-dist/models/plugin.json +14 -0
- package/{dist → plugins-dist/models}/provider.js +18 -81
- package/plugins-dist/models/saved.js +80 -0
- package/plugins-dist/modes/index.js +190 -0
- package/plugins-dist/modes/plugin.json +18 -0
- package/plugins-dist/plugins/index.js +37 -0
- package/plugins-dist/plugins/plugin.json +10 -0
- package/plugins-dist/print/index.js +153 -0
- package/plugins-dist/print/plugin.json +14 -0
- package/plugins-dist/prompts/index.js +57 -0
- package/plugins-dist/prompts/plugin.json +13 -0
- package/plugins-dist/prompts/prompts.js +227 -0
- package/plugins-dist/prompts/sys.js +46 -0
- package/plugins-dist/renderers/index.js +36 -0
- package/plugins-dist/renderers/plugin.json +9 -0
- package/plugins-dist/repeats/index.js +165 -0
- package/plugins-dist/repeats/plugin.json +6 -0
- package/plugins-dist/schedule/cron.js +67 -0
- package/plugins-dist/schedule/index.js +281 -0
- package/plugins-dist/schedule/plugin.json +16 -0
- package/plugins-dist/schedule/store.js +125 -0
- package/plugins-dist/scratch/index.js +26 -0
- package/plugins-dist/scratch/plugin.json +10 -0
- package/plugins-dist/screenshot/index.js +35 -0
- package/plugins-dist/screenshot/plugin.json +11 -0
- package/plugins-dist/screenshot/sys.js +76 -0
- package/{dist/tools/screenshot.js → plugins-dist/screenshot/tool.js} +5 -4
- package/plugins-dist/sessions/index.js +136 -0
- package/plugins-dist/sessions/plugin.json +12 -0
- package/plugins-dist/shell/index.js +33 -0
- package/plugins-dist/shell/plugin.json +19 -0
- package/plugins-dist/shell/renderers.js +40 -0
- package/plugins-dist/shell/service.js +29 -0
- package/{dist/tools → plugins-dist/shell}/shell.js +31 -22
- package/{dist → plugins-dist/shell}/sys.js +2 -43
- package/plugins-dist/skills/index.js +90 -0
- package/plugins-dist/skills/plugin.json +12 -0
- package/plugins-dist/skills/project.js +47 -0
- package/{dist → plugins-dist/skills}/skills.js +3 -7
- package/plugins-dist/suggest/index.js +282 -0
- package/plugins-dist/suggest/plugin.json +23 -0
- package/plugins-dist/task/index.js +151 -0
- package/plugins-dist/task/plugin.json +23 -0
- package/plugins-dist/task/style.js +14 -0
- package/plugins-dist/task/subagent.js +208 -0
- package/{dist/tools/todo.js → plugins-dist/todo/index.js} +29 -7
- package/plugins-dist/todo/plugin.json +9 -0
- package/{dist/ui → plugins-dist/tui}/editor.js +3 -1
- package/plugins-dist/tui/frontend.js +586 -0
- package/{dist → plugins-dist/tui}/history.js +0 -1
- package/plugins-dist/tui/index.js +21 -0
- package/{dist/ui → plugins-dist/tui}/markdown.js +0 -1
- package/plugins-dist/tui/mentions.js +115 -0
- package/plugins-dist/tui/plugin.json +25 -0
- package/{dist/ui → plugins-dist/tui}/render.js +7 -3
- package/{dist/ui → plugins-dist/tui}/screen.js +6 -2
- package/{dist/ui → plugins-dist/tui}/transcript.js +76 -98
- package/{dist/ui → plugins-dist/tui}/tui.js +185 -53
- package/{dist/tools → plugins-dist/undo}/checkpoint.js +21 -55
- package/plugins-dist/undo/index.js +140 -0
- package/plugins-dist/undo/notes.js +36 -0
- package/plugins-dist/undo/plugin.json +9 -0
- package/plugins-dist/undo/style.js +14 -0
- package/plugins-dist/update/index.js +34 -0
- package/plugins-dist/update/plugin.json +15 -0
- package/plugins-dist/web/env.js +80 -0
- package/plugins-dist/web/index.js +124 -0
- package/plugins-dist/web/plugin.json +21 -0
- package/plugins-dist/web/renderers.js +7 -0
- package/{dist/tools → plugins-dist/web}/web.js +50 -24
- package/sdk/python/__pycache__/jade_plugin.cpython-312.pyc +0 -0
- package/sdk/python/jade_plugin.py +380 -0
- package/src/api.ts +298 -0
- package/src/config.ts +32 -134
- package/src/fetch.ts +216 -0
- package/src/hash.ts +39 -0
- package/src/host.ts +429 -0
- package/src/index.ts +23 -30
- package/src/install.ts +355 -0
- package/src/main.ts +155 -1387
- package/src/manifest.ts +160 -0
- package/src/membrane.ts +142 -0
- package/src/remote.ts +288 -0
- package/src/rescue.ts +217 -0
- package/src/resolve.ts +199 -0
- package/src/rpc.ts +144 -0
- package/src/secrets.ts +122 -0
- package/src/session.ts +458 -0
- package/src/source.ts +83 -0
- package/src/state.ts +120 -0
- package/src/update.ts +265 -262
- package/LICENSE +0 -21
- package/README.md +0 -204
- package/dist/commands.d.ts +0 -50
- package/dist/commands.js +0 -126
- package/dist/commands.js.map +0 -1
- package/dist/context.d.ts +0 -17
- package/dist/context.js +0 -53
- package/dist/context.js.map +0 -1
- package/dist/distro.d.ts +0 -141
- package/dist/distro.js +0 -462
- package/dist/distro.js.map +0 -1
- package/dist/history.d.ts +0 -10
- package/dist/history.js.map +0 -1
- package/dist/mcp.d.ts +0 -114
- package/dist/mcp.js.map +0 -1
- package/dist/memory.d.ts +0 -19
- package/dist/memory.js.map +0 -1
- package/dist/mentions.d.ts +0 -35
- package/dist/mentions.js +0 -130
- package/dist/mentions.js.map +0 -1
- package/dist/plugin-cli.d.ts +0 -16
- package/dist/plugin-cli.js +0 -294
- package/dist/plugin-cli.js.map +0 -1
- package/dist/plugins/budget.d.ts +0 -9
- package/dist/plugins/budget.js +0 -30
- package/dist/plugins/budget.js.map +0 -1
- package/dist/plugins/builtins.d.ts +0 -10
- package/dist/plugins/builtins.js +0 -25
- package/dist/plugins/builtins.js.map +0 -1
- package/dist/plugins/checks.d.ts +0 -71
- package/dist/plugins/checks.js.map +0 -1
- package/dist/plugins/compact.d.ts +0 -26
- package/dist/plugins/compact.js.map +0 -1
- package/dist/plugins/core.d.ts +0 -47
- package/dist/plugins/core.js +0 -229
- package/dist/plugins/core.js.map +0 -1
- package/dist/plugins/host.d.ts +0 -52
- package/dist/plugins/host.js +0 -115
- package/dist/plugins/host.js.map +0 -1
- package/dist/plugins/install.d.ts +0 -68
- package/dist/plugins/install.js +0 -377
- package/dist/plugins/install.js.map +0 -1
- package/dist/plugins/loader.d.ts +0 -410
- package/dist/plugins/loader.js +0 -407
- package/dist/plugins/loader.js.map +0 -1
- package/dist/plugins/policy.d.ts +0 -98
- package/dist/plugins/policy.js.map +0 -1
- package/dist/plugins/prompts.d.ts +0 -43
- package/dist/plugins/prompts.js +0 -284
- package/dist/plugins/prompts.js.map +0 -1
- package/dist/plugins/repeats.d.ts +0 -16
- package/dist/plugins/repeats.js +0 -151
- package/dist/plugins/repeats.js.map +0 -1
- package/dist/plugins/review.d.ts +0 -18
- package/dist/plugins/review.js.map +0 -1
- package/dist/plugins/schema.d.ts +0 -2
- package/dist/plugins/schema.js.map +0 -1
- package/dist/plugins/sessions.d.ts +0 -7
- package/dist/plugins/sessions.js +0 -110
- package/dist/plugins/sessions.js.map +0 -1
- package/dist/provider.d.ts +0 -165
- package/dist/provider.js.map +0 -1
- package/dist/session-lifecycle.d.ts +0 -61
- package/dist/session-lifecycle.js +0 -167
- package/dist/session-lifecycle.js.map +0 -1
- package/dist/session-scope.d.ts +0 -53
- package/dist/session-scope.js +0 -116
- package/dist/session-scope.js.map +0 -1
- package/dist/sessions.d.ts +0 -28
- package/dist/sessions.js +0 -73
- package/dist/sessions.js.map +0 -1
- package/dist/skills.d.ts +0 -37
- package/dist/skills.js.map +0 -1
- package/dist/sys.d.ts +0 -51
- package/dist/sys.js.map +0 -1
- package/dist/tools/ask.d.ts +0 -11
- package/dist/tools/ask.js +0 -62
- package/dist/tools/ask.js.map +0 -1
- package/dist/tools/checkpoint.d.ts +0 -43
- package/dist/tools/checkpoint.js.map +0 -1
- package/dist/tools/fs.d.ts +0 -39
- package/dist/tools/fs.js.map +0 -1
- package/dist/tools/grep.d.ts +0 -6
- package/dist/tools/grep.js.map +0 -1
- package/dist/tools/screenshot.d.ts +0 -15
- package/dist/tools/screenshot.js.map +0 -1
- package/dist/tools/shell.d.ts +0 -55
- package/dist/tools/shell.js.map +0 -1
- package/dist/tools/task.d.ts +0 -39
- package/dist/tools/task.js +0 -117
- package/dist/tools/task.js.map +0 -1
- package/dist/tools/todo.d.ts +0 -10
- package/dist/tools/todo.js.map +0 -1
- package/dist/tools/web.d.ts +0 -53
- package/dist/tools/web.js.map +0 -1
- package/dist/ui/configure.d.ts +0 -20
- package/dist/ui/configure.js +0 -447
- package/dist/ui/configure.js.map +0 -1
- package/dist/ui/diff.d.ts +0 -20
- package/dist/ui/diff.js.map +0 -1
- package/dist/ui/editor.d.ts +0 -41
- package/dist/ui/editor.js.map +0 -1
- package/dist/ui/markdown.d.ts +0 -22
- package/dist/ui/markdown.js.map +0 -1
- package/dist/ui/render.d.ts +0 -14
- package/dist/ui/render.js.map +0 -1
- package/dist/ui/renderers.d.ts +0 -8
- package/dist/ui/renderers.js.map +0 -1
- package/dist/ui/screen.d.ts +0 -118
- package/dist/ui/screen.js.map +0 -1
- package/dist/ui/transcript.d.ts +0 -46
- package/dist/ui/transcript.js.map +0 -1
- package/dist/ui/tui.d.ts +0 -47
- package/dist/ui/tui.js.map +0 -1
- package/src/commands.ts +0 -144
- package/src/context.ts +0 -64
- package/src/distro.ts +0 -577
- package/src/mentions.ts +0 -135
- package/src/plugin-cli.ts +0 -278
- package/src/plugins/budget.ts +0 -37
- package/src/plugins/builtins.ts +0 -34
- package/src/plugins/core.ts +0 -257
- package/src/plugins/host.ts +0 -146
- package/src/plugins/install.ts +0 -429
- package/src/plugins/loader.ts +0 -742
- package/src/plugins/prompts.ts +0 -327
- package/src/plugins/repeats.ts +0 -157
- package/src/plugins/sessions.ts +0 -109
- package/src/session-lifecycle.ts +0 -194
- package/src/session-scope.ts +0 -135
- package/src/sessions.ts +0 -78
- package/src/tools/ask.ts +0 -72
- package/src/tools/task.ts +0 -149
- package/src/ui/configure.ts +0 -471
- /package/{src/plugins → plugins/approval}/schema.ts +0 -0
- /package/{src → plugins/tui}/history.ts +0 -0
- /package/{src/ui → plugins/tui}/markdown.ts +0 -0
package/dist/host.js
ADDED
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
// 进程级的插件宿主:发现、解析、激活、服务注册、故障隔离、关闭(3.1、4.1、5.3、5.4)。
|
|
2
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
3
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
4
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
5
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
return path;
|
|
9
|
+
};
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { pathToFileURL } from "node:url";
|
|
12
|
+
import { importProjectModule, UntrustedPlugin } from "uncarved";
|
|
13
|
+
import { API_VERSION, PluginError, ServiceUnavailable, StaleContext, } from "./api.js";
|
|
14
|
+
import { pluginConfig, readConfigFile } from "./config.js";
|
|
15
|
+
import { discover } from "./manifest.js";
|
|
16
|
+
import { ambient, invoke, Scope, serviceHandle } from "./membrane.js";
|
|
17
|
+
import { startRemote } from "./remote.js";
|
|
18
|
+
import { resolve } from "./resolve.js";
|
|
19
|
+
import { scopedSecrets, SecretsStore } from "./secrets.js";
|
|
20
|
+
import { Sessions } from "./session.js";
|
|
21
|
+
import { countFault, readFaults, readPluginsConfig, writeFaults } from "./state.js";
|
|
22
|
+
/** 核心自己的身份:核心通过服务句柄调用插件(例如 frontend@1)时的调用方 */
|
|
23
|
+
const CORE_ID = "jade";
|
|
24
|
+
/** 核心自己提供的诊断服务(3.4),名字要和 api.ts 的 Jade 一致 */
|
|
25
|
+
export const JADE_SERVICE = "jade@1";
|
|
26
|
+
/** 状态在启动时由 plugins.json、faults.json 和清单算出(不执行插件代码),之后只由宿主改动 */
|
|
27
|
+
export async function planPlugins(opts) {
|
|
28
|
+
const [{ sources, broken }, config, faults] = await Promise.all([discover(opts.roots), readPluginsConfig(opts.home), readFaults(opts.home)]);
|
|
29
|
+
const disabled = new Set([...config.disabled, ...faults.autoDisabled]);
|
|
30
|
+
const plan = resolve(sources, { apiVersion: API_VERSION, disabled, safe: opts.safe, flags: opts.flags, coreServices: [JADE_SERVICE] });
|
|
31
|
+
// 区分"用户停用"和"连续崩溃后自动停用"
|
|
32
|
+
for (const e of plan.entries) {
|
|
33
|
+
if (e.state === "disabled" && e.reason !== "safe mode" && !config.disabled.includes(e.source.manifest.id)) {
|
|
34
|
+
e.reason = `disabled after ${faults.streaks[e.source.manifest.id]?.count ?? "repeated"} faulty launches (last: ${faults.streaks[e.source.manifest.id]?.last ?? "unknown"}); run "jade plugins enable ${e.source.manifest.id}" to retry`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { plan, broken, faults };
|
|
38
|
+
}
|
|
39
|
+
export class PluginHost {
|
|
40
|
+
plan;
|
|
41
|
+
#opts;
|
|
42
|
+
#broken;
|
|
43
|
+
#faults;
|
|
44
|
+
/** 本次启动里已经记过故障的插件 */
|
|
45
|
+
#faulted = new Set();
|
|
46
|
+
#status = new Map();
|
|
47
|
+
#active = [];
|
|
48
|
+
#services = new Map();
|
|
49
|
+
/** 按调用方创建的服务实例:调用方作用域 → 服务名 → 实例 */
|
|
50
|
+
#perCaller = new WeakMap();
|
|
51
|
+
#core = { plugin: CORE_ID, scope: new Scope(CORE_ID) };
|
|
52
|
+
/** 每个插件自己的密钥;进程级和会话级 ctx 共享同一个实例 */
|
|
53
|
+
#secrets;
|
|
54
|
+
#config = { user: {}, project: {} };
|
|
55
|
+
#pluginConfigs = new Map();
|
|
56
|
+
#sessions;
|
|
57
|
+
#writing = Promise.resolve();
|
|
58
|
+
constructor(opts, plan, broken, faults) {
|
|
59
|
+
this.#opts = opts;
|
|
60
|
+
this.plan = plan;
|
|
61
|
+
this.#broken = broken;
|
|
62
|
+
this.#faults = faults;
|
|
63
|
+
this.#secrets = new SecretsStore(opts.home);
|
|
64
|
+
for (const e of plan.entries)
|
|
65
|
+
this.#status.set(e.source.dir, { state: e.state, ...(e.reason ? { reason: e.reason } : {}) });
|
|
66
|
+
// 核心自己的诊断服务:插件在激活阶段就能取(`/plugins` 用它)
|
|
67
|
+
this.#services.set(JADE_SERVICE, {
|
|
68
|
+
impl: {
|
|
69
|
+
plugins: () => this.status().map((p) => ({ ...p })),
|
|
70
|
+
services: () => [...this.#services].map(([service, e]) => ({ service, provider: e.provider.plugin })).sort((a, b) => a.service.localeCompare(b.service)),
|
|
71
|
+
},
|
|
72
|
+
provider: this.#core,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** 解析并按顺序激活全部插件。单个插件失败不影响其他插件,不抛出 */
|
|
76
|
+
static async start(opts) {
|
|
77
|
+
const { plan, broken, faults } = await planPlugins(opts);
|
|
78
|
+
const host = new PluginHost(opts, plan, broken, faults);
|
|
79
|
+
const [user, project] = await Promise.all([
|
|
80
|
+
readConfigFile(opts.config?.user ?? path.join(opts.home, "config.json")),
|
|
81
|
+
opts.config?.project ? readConfigFile(opts.config.project) : { config: {}, error: undefined },
|
|
82
|
+
]);
|
|
83
|
+
host.#config = { user: user.config, project: project.config };
|
|
84
|
+
for (const e of [user.error, project.error])
|
|
85
|
+
if (e)
|
|
86
|
+
host.#report(e);
|
|
87
|
+
for (const w of plan.warnings)
|
|
88
|
+
host.#report(w);
|
|
89
|
+
// 缺依赖、成环而没加载的插件:例如停用 jade/shell 之后 jade/checks 也不会运行,不能悄悄发生
|
|
90
|
+
for (const e of plan.entries)
|
|
91
|
+
if (e.state === "skipped" && !e.expected)
|
|
92
|
+
host.#report(`plugin ${e.source.manifest.id} is not loaded: ${e.reason}`);
|
|
93
|
+
for (const b of broken)
|
|
94
|
+
host.#report(`plugin at ${b.dir}: ${b.error}`);
|
|
95
|
+
for (const source of plan.order)
|
|
96
|
+
await host.#activate(source);
|
|
97
|
+
await host.#saveFaults();
|
|
98
|
+
return host;
|
|
99
|
+
}
|
|
100
|
+
/** 每个插件的状态和原因,包括读不出清单的目录 */
|
|
101
|
+
status() {
|
|
102
|
+
const infos = this.plan.entries.map((e) => {
|
|
103
|
+
const s = this.#status.get(e.source.dir);
|
|
104
|
+
return { id: e.source.manifest.id, version: e.source.manifest.version, layer: e.source.layer, dir: e.source.dir, state: s.state, ...(s.reason ? { reason: s.reason } : {}) };
|
|
105
|
+
});
|
|
106
|
+
for (const b of this.#broken)
|
|
107
|
+
infos.push({ layer: b.layer, dir: b.dir, state: "broken", reason: b.error });
|
|
108
|
+
return infos;
|
|
109
|
+
}
|
|
110
|
+
/** 核心取服务(例如 frontend@1、provider@1)。没有提供者时返回 undefined */
|
|
111
|
+
service(name) {
|
|
112
|
+
return this.#handle(name, this.#core);
|
|
113
|
+
}
|
|
114
|
+
/** 一个插件的密钥;会话级 ctx 也用它,和进程级共享同一份 */
|
|
115
|
+
secrets(plugin) {
|
|
116
|
+
return this.#secrets.for(plugin);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 处理没人接住的异常(5.3)。归属顺序:AsyncLocalStorage → 错误栈里的插件目录 → 未归属。
|
|
120
|
+
* 能归到插件的隔离它;未归属的记下来,进程不退出
|
|
121
|
+
*/
|
|
122
|
+
handleUncaught(error) {
|
|
123
|
+
const plugin = ambient.getStore()?.plugin ?? (error instanceof PluginError ? error.plugin : undefined) ?? this.#blame(error);
|
|
124
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
125
|
+
if (plugin && plugin !== CORE_ID) {
|
|
126
|
+
void this.quarantine(plugin, message);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
this.#faults.unattributed.push({ at: new Date().toISOString(), error: error instanceof Error ? (error.stack ?? message) : message });
|
|
130
|
+
this.#report(`unhandled error not attributable to any plugin: ${message}`);
|
|
131
|
+
void this.#saveFaults();
|
|
132
|
+
}
|
|
133
|
+
/** 安装进程级的异常处理器,返回卸载函数 */
|
|
134
|
+
installProcessHandlers() {
|
|
135
|
+
const handler = (e) => this.handleUncaught(e);
|
|
136
|
+
process.on("uncaughtException", handler);
|
|
137
|
+
process.on("unhandledRejection", handler);
|
|
138
|
+
return () => {
|
|
139
|
+
process.off("uncaughtException", handler);
|
|
140
|
+
process.off("unhandledRejection", handler);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** 隔离一个插件:关闭它的作用域、撤销它的注册,它提供的服务随之失效(5.3) */
|
|
144
|
+
async quarantine(id, reason) {
|
|
145
|
+
const i = this.#active.findIndex((a) => a.source.manifest.id === id);
|
|
146
|
+
if (i === -1)
|
|
147
|
+
return;
|
|
148
|
+
const [a] = this.#active.splice(i, 1);
|
|
149
|
+
this.#status.set(a.source.dir, { state: "quarantined", reason });
|
|
150
|
+
this.#report(`plugin ${id} was stopped after an error: ${reason}`);
|
|
151
|
+
this.#fault(id, reason);
|
|
152
|
+
// 先会话级、再进程级:会话里的东西可能用着进程级的服务
|
|
153
|
+
for (const s of [...a.sessions, a.owner.scope]) {
|
|
154
|
+
for (const e of await s.close())
|
|
155
|
+
this.#report(String(e instanceof Error ? e.message : e));
|
|
156
|
+
}
|
|
157
|
+
await this.#saveFaults();
|
|
158
|
+
}
|
|
159
|
+
/** 会话:新建、恢复、切换(4.2) */
|
|
160
|
+
get sessions() {
|
|
161
|
+
return (this.#sessions ??= new Sessions({
|
|
162
|
+
home: this.#opts.home,
|
|
163
|
+
cwd: this.#cwd,
|
|
164
|
+
config: (source) => this.#configOf(source),
|
|
165
|
+
core: this.#core,
|
|
166
|
+
active: () => this.#active,
|
|
167
|
+
service: (name, caller) => this.#handle(name, caller),
|
|
168
|
+
provider: (name) => this.plan.providers.get(name),
|
|
169
|
+
secrets: (plugin) => this.#secrets.for(plugin),
|
|
170
|
+
track: (plugin, scope) => this.#active.find((a) => a.source.manifest.id === plugin)?.sessions.add(scope),
|
|
171
|
+
untrack: (plugin, scope) => this.#active.find((a) => a.source.manifest.id === plugin)?.sessions.delete(scope),
|
|
172
|
+
fault: (plugin, reason) => {
|
|
173
|
+
this.#fault(plugin, reason);
|
|
174
|
+
void this.#saveFaults();
|
|
175
|
+
},
|
|
176
|
+
report: (m) => this.#report(m),
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 逆序关闭全部插件。这次启动里跑过、没出故障的插件,连续故障计数清零;
|
|
181
|
+
* 没有加载的(自动停用、用户停用、安全模式)不算,保留它们的记录和最后一次的错误
|
|
182
|
+
*/
|
|
183
|
+
async close() {
|
|
184
|
+
if (this.#sessions)
|
|
185
|
+
await this.#sessions.close();
|
|
186
|
+
await this.#core.scope.close();
|
|
187
|
+
const ran = new Set(this.#active.map((a) => a.source.manifest.id));
|
|
188
|
+
while (this.#active.length > 0) {
|
|
189
|
+
const a = this.#active.pop();
|
|
190
|
+
for (const e of await a.owner.scope.close())
|
|
191
|
+
this.#report(String(e instanceof Error ? e.message : e));
|
|
192
|
+
}
|
|
193
|
+
for (const id of Object.keys(this.#faults.streaks))
|
|
194
|
+
if (ran.has(id) && !this.#faulted.has(id))
|
|
195
|
+
delete this.#faults.streaks[id];
|
|
196
|
+
await this.#saveFaults();
|
|
197
|
+
}
|
|
198
|
+
// ---------- 激活 ----------
|
|
199
|
+
async #activate(source) {
|
|
200
|
+
const { manifest, dir } = source;
|
|
201
|
+
const id = manifest.id;
|
|
202
|
+
// 必需服务的提供者激活失败:不激活,原因精确到服务
|
|
203
|
+
for (const need of manifest.requires ?? []) {
|
|
204
|
+
const provider = this.plan.providers.get(need);
|
|
205
|
+
if (provider && !this.#services.has(need)) {
|
|
206
|
+
this.#status.set(dir, { state: "skipped", reason: `requires ${need}: its provider ${provider} failed to activate` });
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const scope = new Scope(id);
|
|
211
|
+
const owner = { plugin: id, scope };
|
|
212
|
+
try {
|
|
213
|
+
const { module, mark } = await this.#load(source, owner);
|
|
214
|
+
if (module.process)
|
|
215
|
+
await invoke(owner, "process", () => module.process(this.#processContext(source, owner)));
|
|
216
|
+
const missing = (manifest.provides ?? []).filter((s) => this.#services.get(s)?.provider !== owner);
|
|
217
|
+
if (missing.length > 0)
|
|
218
|
+
throw new Error(`declares ${missing.join(", ")} in provides but did not provide it`);
|
|
219
|
+
this.#active.push({ source, module, owner, sessions: new Set(), ...(mark ? { mark } : {}) });
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
// 事务性:已经做的注册全部撤销(4.1)
|
|
223
|
+
await scope.close();
|
|
224
|
+
const reason = e instanceof PluginError && e.plugin === id ? String(e.cause?.message ?? e.message) : e instanceof Error ? e.message : String(e);
|
|
225
|
+
// 用户没有确认不是插件的故障,不计入连续崩溃
|
|
226
|
+
const untrusted = e instanceof UntrustedPlugin;
|
|
227
|
+
this.#status.set(dir, { state: untrusted ? "untrusted" : "failed", reason });
|
|
228
|
+
this.#report(`plugin ${id} ${untrusted ? "was not loaded" : "failed to activate"}: ${reason}`);
|
|
229
|
+
if (!untrusted)
|
|
230
|
+
this.#fault(id, reason);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
async #load(source, owner) {
|
|
234
|
+
const { manifest, dir } = source;
|
|
235
|
+
if (manifest.runtime) {
|
|
236
|
+
// 进程外的项目层插件:内核的确认只能检查 JS 的 import,管不住另一种语言的代码从目录外加载什么
|
|
237
|
+
if (source.layer === "project")
|
|
238
|
+
throw new Error(`out-of-process plugins cannot be loaded from a project yet; put it in ${path.join(this.#opts.home, "plugins")}`);
|
|
239
|
+
const module = await startRemote(source, owner, { report: (m) => this.#report(m), exited: (reason) => void this.quarantine(manifest.id, reason) });
|
|
240
|
+
return { module };
|
|
241
|
+
}
|
|
242
|
+
let mod;
|
|
243
|
+
let mark;
|
|
244
|
+
if (source.layer === "project") {
|
|
245
|
+
// 项目层:内核负责确认(哈希、import 不出目录、请求确认、导入),之前不执行任何代码(第 7 节)
|
|
246
|
+
const trust = this.#opts.trust;
|
|
247
|
+
if (!trust)
|
|
248
|
+
throw new UntrustedPlugin(dir, "project plugins need confirmation, which this jade cannot ask for");
|
|
249
|
+
// 模块顶层代码也归这个插件(顶层启动的定时器出错时能找到它)
|
|
250
|
+
const loaded = await ambient.run(owner, () => importProjectModule(dir, { ...trust, entry: manifest.entry }));
|
|
251
|
+
mod = loaded.module;
|
|
252
|
+
mark = loaded.mark;
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
const file = path.resolve(dir, manifest.entry);
|
|
256
|
+
const rel = path.relative(dir, file);
|
|
257
|
+
if (rel.startsWith("..") || path.isAbsolute(rel))
|
|
258
|
+
throw new Error(`entry ${manifest.entry} is outside the plugin directory`);
|
|
259
|
+
mod = (await ambient.run(owner, () => import(__rewriteRelativeImportExtension(pathToFileURL(file).href))));
|
|
260
|
+
}
|
|
261
|
+
const m = mod.default;
|
|
262
|
+
if (typeof m !== "object" || m === null)
|
|
263
|
+
throw new Error(`entry ${manifest.entry} must default-export definePlugin({ ... })`);
|
|
264
|
+
return { module: m, ...(mark ? { mark } : {}) };
|
|
265
|
+
}
|
|
266
|
+
#processContext(source, owner) {
|
|
267
|
+
const { manifest } = source;
|
|
268
|
+
const id = manifest.id;
|
|
269
|
+
// 每个方法都先检查:作用域关闭后旧 ctx 一律抛 StaleContext(4.1)
|
|
270
|
+
const declared = (name, lists) => {
|
|
271
|
+
if (owner.scope.closed)
|
|
272
|
+
throw new StaleContext(id);
|
|
273
|
+
if (!lists.some((l) => l?.includes(name)))
|
|
274
|
+
throw new Error(`plugin ${id}: ${name} is not declared in plugin.json`);
|
|
275
|
+
};
|
|
276
|
+
return {
|
|
277
|
+
plugin: id,
|
|
278
|
+
signal: owner.scope.signal,
|
|
279
|
+
cwd: this.#cwd,
|
|
280
|
+
home: this.#opts.home,
|
|
281
|
+
config: this.#configOf(source),
|
|
282
|
+
secrets: scopedSecrets(this.#secrets.for(id), () => owner.scope.closed, id),
|
|
283
|
+
require: (name) => {
|
|
284
|
+
declared(name, [manifest.requires]);
|
|
285
|
+
const h = this.#handle(name, owner);
|
|
286
|
+
if (!h)
|
|
287
|
+
throw new ServiceUnavailable(name, this.plan.providers.get(name) ?? "(none)");
|
|
288
|
+
return h;
|
|
289
|
+
},
|
|
290
|
+
service: (name) => {
|
|
291
|
+
declared(name, [manifest.requires, manifest.optional]);
|
|
292
|
+
return this.#handle(name, owner);
|
|
293
|
+
},
|
|
294
|
+
provide: (name, impl) => {
|
|
295
|
+
declared(name, [manifest.provides]);
|
|
296
|
+
if (this.plan.providers.get(name) !== id)
|
|
297
|
+
throw new Error(`plugin ${id}: ${name} is provided by ${this.plan.providers.get(name)}`);
|
|
298
|
+
if (this.#services.has(name))
|
|
299
|
+
throw new Error(`plugin ${id}: ${name} is already provided`);
|
|
300
|
+
owner.scope.add(() => {
|
|
301
|
+
if (this.#services.get(name)?.provider === owner)
|
|
302
|
+
this.#services.delete(name);
|
|
303
|
+
});
|
|
304
|
+
this.#services.set(name, { impl, provider: owner });
|
|
305
|
+
},
|
|
306
|
+
effect: async (start) => {
|
|
307
|
+
if (owner.scope.closed)
|
|
308
|
+
throw new StaleContext(id);
|
|
309
|
+
// 插件调用自己的代码,不过膜:膜会把返回的清理函数也包起来,作用域关闭时它就被当成过期调用拒绝了。
|
|
310
|
+
// Scope.close 自己以插件身份执行清理函数、接住错误
|
|
311
|
+
const d = (await ambient.run(owner, start));
|
|
312
|
+
if (typeof d === "function")
|
|
313
|
+
owner.scope.add(d);
|
|
314
|
+
},
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
#handle(name, caller) {
|
|
318
|
+
const entry = this.#services.get(name);
|
|
319
|
+
if (!entry)
|
|
320
|
+
return undefined;
|
|
321
|
+
const { impl, provider } = entry;
|
|
322
|
+
const isLive = () => this.#services.get(name)?.provider === provider && !provider.scope.closed;
|
|
323
|
+
if (typeof impl !== "function")
|
|
324
|
+
return serviceHandle(name, impl, provider, caller, isLive);
|
|
325
|
+
let mine = this.#perCaller.get(caller.scope);
|
|
326
|
+
if (!mine)
|
|
327
|
+
this.#perCaller.set(caller.scope, (mine = new Map()));
|
|
328
|
+
let instance = mine.get(name);
|
|
329
|
+
if (!instance) {
|
|
330
|
+
const info = {
|
|
331
|
+
plugin: caller.plugin,
|
|
332
|
+
layer: caller === this.#core ? "core" : (this.plan.entries.find((e) => e.source.manifest.id === caller.plugin)?.source.layer ?? "core"),
|
|
333
|
+
signal: caller.scope.signal,
|
|
334
|
+
onDispose: (d) => caller.scope.add(d, provider),
|
|
335
|
+
};
|
|
336
|
+
try {
|
|
337
|
+
instance = ambient.run(provider, () => impl(info));
|
|
338
|
+
}
|
|
339
|
+
catch (e) {
|
|
340
|
+
throw new PluginError(provider.plugin, `${name} for ${caller.plugin}`, e);
|
|
341
|
+
}
|
|
342
|
+
if (typeof instance !== "object" || instance === null)
|
|
343
|
+
throw new PluginError(provider.plugin, name, new Error("the service factory must return an object"));
|
|
344
|
+
mine.set(name, instance);
|
|
345
|
+
}
|
|
346
|
+
return serviceHandle(name, instance, provider, caller, isLive);
|
|
347
|
+
}
|
|
348
|
+
get #cwd() {
|
|
349
|
+
return this.#opts.cwd ?? process.cwd();
|
|
350
|
+
}
|
|
351
|
+
/** 插件的配置;项目层设置了不允许设置的键时告诉用户一次 */
|
|
352
|
+
#configOf(source) {
|
|
353
|
+
const id = source.manifest.id;
|
|
354
|
+
let c = this.#pluginConfigs.get(id);
|
|
355
|
+
if (!c) {
|
|
356
|
+
const { config, ignored } = pluginConfig(source, this.#config.user, this.#config.project);
|
|
357
|
+
if (ignored.length > 0)
|
|
358
|
+
this.#report(`project config for ${id}: ${ignored.join(", ")} can only be set in your own config.json; ignored`);
|
|
359
|
+
this.#pluginConfigs.set(id, (c = config));
|
|
360
|
+
}
|
|
361
|
+
return c;
|
|
362
|
+
}
|
|
363
|
+
// ---------- 故障 ----------
|
|
364
|
+
/** 错误栈里第一个落在某个激活插件目录下的帧(5.3 第 2 步) */
|
|
365
|
+
#blame(error) {
|
|
366
|
+
const stack = error instanceof Error ? error.stack : undefined;
|
|
367
|
+
if (!stack)
|
|
368
|
+
return undefined;
|
|
369
|
+
const norm = (p) => p.replaceAll("\\", "/").toLowerCase();
|
|
370
|
+
let decoded = stack;
|
|
371
|
+
try {
|
|
372
|
+
decoded = decodeURIComponent(stack); // file:// URL 里的空格等被编码过
|
|
373
|
+
}
|
|
374
|
+
catch { }
|
|
375
|
+
const frames = norm(decoded);
|
|
376
|
+
let best;
|
|
377
|
+
for (const a of this.#active) {
|
|
378
|
+
const at = frames.indexOf(norm(a.source.dir) + "/");
|
|
379
|
+
if (at !== -1 && (!best || at < best.at))
|
|
380
|
+
best = { id: a.source.manifest.id, at };
|
|
381
|
+
}
|
|
382
|
+
return best?.id;
|
|
383
|
+
}
|
|
384
|
+
#fault(id, reason) {
|
|
385
|
+
if (this.#faulted.has(id))
|
|
386
|
+
return;
|
|
387
|
+
this.#faulted.add(id);
|
|
388
|
+
if (countFault(this.#faults, id, reason)) {
|
|
389
|
+
this.#report(`plugin ${id} faulted in ${this.#faults.streaks[id].count} launches in a row and will be disabled from the next launch; run "jade plugins enable ${id}" to retry`);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
#saveFaults() {
|
|
393
|
+
this.#writing = this.#writing.then(() => writeFaults(this.#opts.home, this.#faults)).catch((e) => this.#report(`cannot save faults: ${e instanceof Error ? e.message : e}`));
|
|
394
|
+
return this.#writing;
|
|
395
|
+
}
|
|
396
|
+
#report(message) {
|
|
397
|
+
this.#opts.report?.(message);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA,mDAAmD;;;;;;;;;AAEnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAkC,MAAM,UAAU,CAAC;AAChG,OAAO,EACL,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,YAAY,GASb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAmB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAqC,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAc,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAA6B,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,E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
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export * from "./plugins/schema.ts";
|
|
13
|
-
export * from "./tools/fs.ts";
|
|
14
|
-
export * from "./tools/grep.ts";
|
|
15
|
-
export * from "./tools/web.ts";
|
|
16
|
-
export * from "./tools/screenshot.ts";
|
|
17
|
-
export * from "./tools/shell.ts";
|
|
18
|
-
export * from "./tools/task.ts";
|
|
19
|
-
export * from "./tools/checkpoint.ts";
|
|
20
|
-
export * from "./tools/todo.ts";
|
|
21
|
-
export * from "./tools/ask.ts";
|
|
22
|
-
export * from "./config.ts";
|
|
23
|
-
export * from "./context.ts";
|
|
24
|
-
export * from "./commands.ts";
|
|
25
|
-
export * from "./plugins/loader.ts";
|
|
26
|
-
export * from "./plugins/install.ts";
|
|
27
|
-
export * from "./plugins/builtins.ts";
|
|
28
|
-
export * from "./mcp.ts";
|
|
29
|
-
export * from "./skills.ts";
|
|
30
|
-
export * from "./plugins/host.ts";
|
|
1
|
+
export * from "./api.ts";
|
|
2
|
+
export { discover, isPluginId, parseManifest, satisfiesCaret, type BrokenSource, type LayerRoot } from "./manifest.ts";
|
|
3
|
+
export { resolve, type Plan, type PlanEntry, type PlanState, type ResolveOptions } from "./resolve.ts";
|
|
4
|
+
export { PluginHost, planPlugins, type HostOptions, type PluginInfo, type PluginState } from "./host.ts";
|
|
5
|
+
export { pluginsCommand } from "./rescue.ts";
|
|
6
|
+
export { addPlugin, installDir, readRecords, removePlugin, updatePlugins, type AddOptions, type Added, type InstallRecord, type UpdateOptions, type UpdateResult, type UpdateStatus, } from "./install.ts";
|
|
7
|
+
export { parseSource, type PluginSourceSpec, type SourceKind } from "./source.ts";
|
|
8
|
+
export { treeHash } from "./hash.ts";
|
|
9
|
+
export { CORE_PLUGIN_ID, NO_APPROVAL_REASON, Sessions } from "./session.ts";
|
|
10
|
+
export { pluginConfig, readConfigFile, type ConfigFile } from "./config.ts";
|
|
11
|
+
export { FAULT_LIMIT } from "./state.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export * from "./plugins/schema.js";
|
|
13
|
-
export * from "./tools/fs.js";
|
|
14
|
-
export * from "./tools/grep.js";
|
|
15
|
-
export * from "./tools/web.js";
|
|
16
|
-
export * from "./tools/screenshot.js";
|
|
17
|
-
export * from "./tools/shell.js";
|
|
18
|
-
export * from "./tools/task.js";
|
|
19
|
-
export * from "./tools/checkpoint.js";
|
|
20
|
-
export * from "./tools/todo.js";
|
|
21
|
-
export * from "./tools/ask.js";
|
|
22
|
-
export * from "./config.js";
|
|
23
|
-
export * from "./context.js";
|
|
24
|
-
export * from "./commands.js";
|
|
25
|
-
export * from "./plugins/loader.js";
|
|
26
|
-
export * from "./plugins/install.js";
|
|
27
|
-
export * from "./plugins/builtins.js";
|
|
28
|
-
export * from "./mcp.js";
|
|
29
|
-
export * from "./skills.js";
|
|
30
|
-
export * from "./plugins/host.js";
|
|
1
|
+
export * from "./api.js";
|
|
2
|
+
export { discover, isPluginId, parseManifest, satisfiesCaret } from "./manifest.js";
|
|
3
|
+
export { resolve } from "./resolve.js";
|
|
4
|
+
export { PluginHost, planPlugins } from "./host.js";
|
|
5
|
+
export { pluginsCommand } from "./rescue.js";
|
|
6
|
+
export { addPlugin, installDir, readRecords, removePlugin, updatePlugins, } from "./install.js";
|
|
7
|
+
export { parseSource } from "./source.js";
|
|
8
|
+
export { treeHash } from "./hash.js";
|
|
9
|
+
export { CORE_PLUGIN_ID, NO_APPROVAL_REASON, Sessions } from "./session.js";
|
|
10
|
+
export { pluginConfig, readConfigFile } from "./config.js";
|
|
11
|
+
export { FAULT_LIMIT } from "./state.js";
|
|
31
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAqC,MAAM,eAAe,CAAC;AACvH,OAAO,EAAE,OAAO,EAAkE,MAAM,cAAc,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAuD,MAAM,WAAW,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,GAOd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAA0C,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAmB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type TrustStore } from "uncarved";
|
|
2
|
+
import { type SourceKind } from "./source.ts";
|
|
3
|
+
/** 用户层/项目层插件的目录名:id 里的 / 换成 __ */
|
|
4
|
+
export declare const installDir: (root: string, id: string) => string;
|
|
5
|
+
/** 安装记录:更新时据此重新下载,也用来判断装好的插件有没有被手改过 */
|
|
6
|
+
export interface InstallRecord {
|
|
7
|
+
id: string;
|
|
8
|
+
/** 插件目录名(id 去掉 / 替换后的最后一段) */
|
|
9
|
+
dir: string;
|
|
10
|
+
/** 用户写的来源;本地路径是绝对路径 */
|
|
11
|
+
source: string;
|
|
12
|
+
/** 解析后的来源(git 地址、npm 写法或绝对路径);更新时直接用它,不再按当前目录重新解析 source */
|
|
13
|
+
location?: string;
|
|
14
|
+
kind: SourceKind | "link";
|
|
15
|
+
/** git 的分支、tag 或提交 */
|
|
16
|
+
ref?: string;
|
|
17
|
+
/** 只安装来源里的这个子目录 */
|
|
18
|
+
subdir?: string;
|
|
19
|
+
/** git:安装的提交 */
|
|
20
|
+
commit?: string;
|
|
21
|
+
version?: string;
|
|
22
|
+
/** 安装时插件源码的哈希(不含 node_modules、.git 和包管理器的 lock 文件) */
|
|
23
|
+
hash?: string;
|
|
24
|
+
installedAt: string;
|
|
25
|
+
updatedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AddOptions {
|
|
28
|
+
/** $JADE_HOME/plugins 或 <仓库>/.jade/plugins */
|
|
29
|
+
root: string;
|
|
30
|
+
/** 解析相对路径用 */
|
|
31
|
+
cwd: string;
|
|
32
|
+
subdir?: string;
|
|
33
|
+
/** 本地目录:建链接而不是复制 */
|
|
34
|
+
link?: boolean;
|
|
35
|
+
/** 已经有同 id 的插件时替换它 */
|
|
36
|
+
force?: boolean;
|
|
37
|
+
/** 装进项目层:装好后把内容哈希写进信任存储 */
|
|
38
|
+
project?: boolean;
|
|
39
|
+
trust?: TrustStore;
|
|
40
|
+
/** 进度(下载、安装依赖) */
|
|
41
|
+
log?: (text: string) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface Added {
|
|
44
|
+
id: string;
|
|
45
|
+
version: string;
|
|
46
|
+
dir: string;
|
|
47
|
+
record: InstallRecord;
|
|
48
|
+
}
|
|
49
|
+
export interface UpdateOptions {
|
|
50
|
+
root: string;
|
|
51
|
+
cwd: string;
|
|
52
|
+
/** 覆盖装好后被手动改过的插件 */
|
|
53
|
+
force?: boolean;
|
|
54
|
+
project?: boolean;
|
|
55
|
+
trust?: TrustStore;
|
|
56
|
+
log?: (text: string) => void;
|
|
57
|
+
}
|
|
58
|
+
export type UpdateStatus = "updated" | "current" | "linked" | "unmanaged" | "modified" | "failed";
|
|
59
|
+
export interface UpdateResult {
|
|
60
|
+
id: string;
|
|
61
|
+
dir: string;
|
|
62
|
+
status: UpdateStatus;
|
|
63
|
+
from?: string;
|
|
64
|
+
to?: string;
|
|
65
|
+
error?: string;
|
|
66
|
+
}
|
|
67
|
+
/** 从本地目录、npm 包或 git 仓库安装一个插件 */
|
|
68
|
+
export declare function addPlugin(spec: string, opts: AddOptions): Promise<Added>;
|
|
69
|
+
/** 按安装记录重新下载;没给名字时更新这个插件目录里所有用 jade plugins add 装的插件 */
|
|
70
|
+
export declare function updatePlugins(names: readonly string[], opts: UpdateOptions): Promise<UpdateResult[]>;
|
|
71
|
+
/** 删掉一个插件目录和它的安装记录;链接只删链接本身,不碰它指向的目录 */
|
|
72
|
+
export declare function removePlugin(id: string, opts: {
|
|
73
|
+
root: string;
|
|
74
|
+
}): Promise<string>;
|
|
75
|
+
/** 安装记录:<plugins 目录>/.installed.json 的 { plugins: { <id>: InstallRecord } } */
|
|
76
|
+
export declare function readRecords(root: string): Promise<Record<string, InstallRecord>>;
|
|
77
|
+
/** 安装、删除之后清掉这个 id 的停用记录和连续崩溃记录;返回它原来是不是被用户停用了 */
|
|
78
|
+
export declare function forgetPluginState(home: string, id: string): Promise<boolean>;
|