@capyclaw/browser-workbench 0.0.0-stage → 0.1.19
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/README.md +88 -2
- package/contract/browser-contract.json +1349 -0
- package/demo/form.html +112 -0
- package/lib/host.mjs +1 -0
- package/node_modules/@capyclaw/asset-service/README.md +48 -0
- package/node_modules/@capyclaw/asset-service/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/asset-service/dsh-suite.json +29 -0
- package/node_modules/@capyclaw/asset-service/lib/host.mjs +14 -0
- package/node_modules/@capyclaw/asset-service/package.json +59 -0
- package/node_modules/@capyclaw/asset-service/src/index.mjs +304 -0
- package/node_modules/@capyclaw/document-workbench/README.md +125 -0
- package/node_modules/@capyclaw/document-workbench/package.json +44 -0
- package/node_modules/@capyclaw/document-workbench/src/bridge/index.mjs +321 -0
- package/node_modules/@capyclaw/document-workbench/src/client/index.mjs +625 -0
- package/node_modules/@capyclaw/document-workbench/src/client/screenshot.mjs +98 -0
- package/node_modules/@capyclaw/document-workbench/src/index.mjs +9 -0
- package/node_modules/@capyclaw/document-workbench/src/model/audit.mjs +101 -0
- package/node_modules/@capyclaw/document-workbench/src/model/conformance.mjs +92 -0
- package/node_modules/@capyclaw/document-workbench/src/model/ids.mjs +56 -0
- package/node_modules/@capyclaw/document-workbench/src/model/index.mjs +18 -0
- package/node_modules/@capyclaw/document-workbench/src/model/locate.mjs +118 -0
- package/node_modules/@capyclaw/document-workbench/src/model/manifest.mjs +148 -0
- package/node_modules/@capyclaw/document-workbench/src/model/ops.mjs +160 -0
- package/node_modules/@capyclaw/document-workbench/src/model/validate.mjs +72 -0
- package/node_modules/@capyclaw/document-workbench/src/ops/index.mjs +93 -0
- package/node_modules/@capyclaw/document-workbench/src/session/context.mjs +103 -0
- package/node_modules/@capyclaw/document-workbench/src/session/index.mjs +394 -0
- package/node_modules/@capyclaw/document-workbench/src/session/lease.mjs +105 -0
- package/node_modules/@capyclaw/document-workbench/src/session/mode.mjs +80 -0
- package/node_modules/@capyclaw/document-workbench/src/session/sanitize.mjs +107 -0
- package/node_modules/@capyclaw/document-workbench/src/session/state.mjs +159 -0
- package/node_modules/@capyclaw/document-workbench/src/session/watch.mjs +63 -0
- package/node_modules/@capyclaw/document-workbench/src/store/file-backend.mjs +158 -0
- package/node_modules/@capyclaw/document-workbench/src/testing/index.mjs +75 -0
- package/node_modules/@capyclaw/foundation/README.md +51 -0
- package/node_modules/@capyclaw/foundation/abi/bridge.mjs +86 -0
- package/node_modules/@capyclaw/foundation/abi/errors.mjs +63 -0
- package/node_modules/@capyclaw/foundation/abi/index.mjs +35 -0
- package/node_modules/@capyclaw/foundation/abi/kinds.mjs +271 -0
- package/node_modules/@capyclaw/foundation/abi/loader.mjs +345 -0
- package/node_modules/@capyclaw/foundation/abi/schema.mjs +98 -0
- package/node_modules/@capyclaw/foundation/abi/spec.mjs +255 -0
- package/node_modules/@capyclaw/foundation/abi/validate.mjs +24 -0
- package/node_modules/@capyclaw/foundation/abi/version.mjs +82 -0
- package/node_modules/@capyclaw/foundation/cordis.patch.yml +5 -0
- package/node_modules/@capyclaw/foundation/kit/index.mjs +6 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/client-panel.mjs +98 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/host-event.mjs +35 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/http-router.mjs +69 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/lifecycle-hook.mjs +55 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/own-server.mjs +113 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/raw.mjs +69 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +120 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/service-provider.mjs +77 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/skill-provider.mjs +56 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/tool-provider.mjs +50 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/ui-panel.mjs +64 -0
- package/node_modules/@capyclaw/foundation/lib/ctx-service.mjs +42 -0
- package/node_modules/@capyclaw/foundation/lib/host/caps.mjs +34 -0
- package/node_modules/@capyclaw/foundation/lib/host/contract.mjs +85 -0
- package/node_modules/@capyclaw/foundation/lib/host/dsh.mjs +50 -0
- package/node_modules/@capyclaw/foundation/lib/host/memory.mjs +160 -0
- package/node_modules/@capyclaw/foundation/lib/host.mjs +23 -0
- package/node_modules/@capyclaw/foundation/lib/kernel.mjs +185 -0
- package/node_modules/@capyclaw/foundation/lib/skill/scan.mjs +115 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/events.mjs +60 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/log.mjs +51 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/net.mjs +188 -0
- package/node_modules/@capyclaw/foundation/package.json +53 -0
- package/node_modules/@capyclaw/foundation/runtime/index.mjs +20 -0
- package/node_modules/@capyclaw/plugin-kit/INTEGRATION.md +100 -0
- package/node_modules/@capyclaw/plugin-kit/README.md +70 -0
- package/node_modules/@capyclaw/plugin-kit/bin/sync.mjs +103 -0
- package/node_modules/@capyclaw/plugin-kit/package.json +69 -0
- package/node_modules/@capyclaw/plugin-kit/src/cli.mjs +56 -0
- package/node_modules/@capyclaw/plugin-kit/src/config.mjs +142 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat-worker.js +129 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +58 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/shadow.mjs +219 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/transport.js +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/index.mjs +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/pack.mjs +230 -0
- package/node_modules/@capyclaw/plugin-kit/src/runtime/context.mjs +128 -0
- package/node_modules/@capyclaw/plugin-kit/src/self-contained.mjs +307 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/api.mjs +45 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/http.mjs +113 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +150 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/server.mjs +131 -0
- package/node_modules/@capyclaw/plugin-kit/src/skills/provider.mjs +82 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/blob-store.mjs +109 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/content-store.mjs +17 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/journal-store.mjs +89 -0
- package/node_modules/@capyclaw/plugin-kit/src/tools/result.mjs +57 -0
- package/node_modules/@capyclaw/plugin-kit/src/tools/validate.mjs +150 -0
- package/node_modules/@capyclaw/plugin-kit/src/tuning.mjs +82 -0
- package/node_modules/@capyclaw/plugin-kit/src/util/fs-lock.mjs +132 -0
- package/node_modules/@capyclaw/plugin-kit/src/util/http.mjs +130 -0
- package/node_modules/@capyclaw/plugin-kit/src/workspace/manager.mjs +656 -0
- package/node_modules/@capyclaw/plugin-kit/src/zip.mjs +181 -0
- package/node_modules/@capyclaw/service-host/README.md +86 -0
- package/node_modules/@capyclaw/service-host/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/service-host/dsh-suite.json +29 -0
- package/node_modules/@capyclaw/service-host/lib/host.mjs +22 -0
- package/node_modules/@capyclaw/service-host/package.json +60 -0
- package/node_modules/@capyclaw/service-host/src/index.mjs +571 -0
- package/node_modules/@capyclaw/service-host/src/tuning.mjs +63 -0
- package/node_modules/@capyclaw/tool-host/README.md +56 -0
- package/node_modules/@capyclaw/tool-host/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/tool-host/dsh-suite.json +30 -0
- package/node_modules/@capyclaw/tool-host/lib/host.mjs +16 -0
- package/node_modules/@capyclaw/tool-host/package.json +59 -0
- package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +166 -0
- package/node_modules/@capyclaw/tool-host/src/index.mjs +416 -0
- package/package.json +77 -4
- package/plugin.mjs +1 -0
- package/server/constants.mjs +16 -0
- package/server/contract-snapshots.mjs +81 -0
- package/server/contract.mjs +24 -0
- package/server/embedded-host.mjs +247 -0
- package/server/engine.mjs +2466 -0
- package/server/governor.mjs +189 -0
- package/server/http-utils.mjs +2 -0
- package/server/human.mjs +628 -0
- package/server/infra/http.mjs +2 -0
- package/server/infra/tuning.mjs +2 -0
- package/server/input.mjs +154 -0
- package/server/login-vault.mjs +109 -0
- package/server/mcp/handler.mjs +2 -0
- package/server/mcp/instructions.mjs +31 -0
- package/server/orphans.mjs +163 -0
- package/server/relay.mjs +198 -0
- package/server/routes/api.mjs +233 -0
- package/server/routes/assets.mjs +2 -0
- package/server/routes/mcp.mjs +17 -0
- package/server/routes/workbench.mjs +33 -0
- package/server/session-engines.mjs +223 -0
- package/server/shared/SHARED_MANIFEST.json +70 -0
- package/server/shared/asset-service.mjs +2 -0
- package/server/shared/editor-host.mjs +2 -0
- package/server/shared/kit/editor/lease.mjs +2 -0
- package/server/shared/kit/service/api.mjs +2 -0
- package/server/shared/kit/service/http.mjs +2 -0
- package/server/shared/kit/service/mcp-http.mjs +2 -0
- package/server/shared/kit/tools/validate.mjs +2 -0
- package/server/shared/kit/tuning.mjs +2 -0
- package/server/shared/kit/util/fs-lock.mjs +2 -0
- package/server/shared/service-host.mjs +2 -0
- package/server/shared/tool-host.mjs +2 -0
- package/server/shared/tuning.mjs +2 -0
- package/server/tools/capabilities/contract.mjs +55 -0
- package/server/tools/capabilities/evaluate.mjs +36 -0
- package/server/tools/capabilities/index.mjs +26 -0
- package/server/tools/capabilities/interaction.mjs +215 -0
- package/server/tools/capabilities/navigation.mjs +35 -0
- package/server/tools/capabilities/screenshot.mjs +50 -0
- package/server/tools/capabilities/session.mjs +81 -0
- package/server/tools/capabilities/snapshot.mjs +30 -0
- package/server/tools/capabilities/tabs.mjs +35 -0
- package/server/tools/index.mjs +12 -0
- package/server/tools/kernel/define.mjs +5 -0
- package/server/tools/kernel/output.mjs +30 -0
- package/server/tools/kernel/ports.mjs +59 -0
- package/server/tools/kernel/registry.mjs +17 -0
- package/server/tools.mjs +3 -0
- package/server/workbench-framework.mjs +305 -0
- package/ui/app.js +447 -0
- package/ui/index.html +46 -0
- package/ui/style.css +144 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作台 API(/api/*):可视化工作台的数据面。
|
|
3
|
+
*
|
|
4
|
+
* F2 每会话隔离:getEngine(req) 按请求所属会话(/s/<sid> 段,由 createSessionDispatch
|
|
5
|
+
* 缝入 req.sessionId)现场解析到那个会话自己的引擎;兼容旧 {engine} 单实例注入。
|
|
6
|
+
* 只暴露观察、实时画面与轻控制:状态 / 实时帧(SSE)/ 快照 / 标签页 / 导航 / 远端输入 / 关闭。
|
|
7
|
+
*
|
|
8
|
+
* /api/live 是本轮新增的关键一条:它把当前活动页的 JPEG 帧用 SSE 推给侧栏,
|
|
9
|
+
* 侧栏再把鼠标键盘经 /api/input 回放成真实输入——于是「浏览器在 DSH 侧栏里」
|
|
10
|
+
* 是真的可交互,不再是一张 1.2s 刷新一次的截图。
|
|
11
|
+
*/
|
|
12
|
+
import { readBody, send } from '../http-utils.mjs'
|
|
13
|
+
|
|
14
|
+
function sendEngineError(req, res, error) {
|
|
15
|
+
const status = error?.code === 'ENGINE_LAUNCH_FAILED' ? 503 : 400
|
|
16
|
+
send(req, res, status, {
|
|
17
|
+
ok: false,
|
|
18
|
+
error: { code: error?.code || 'INTERNAL', message: error?.message || String(error), hint: error?.hint || '' },
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** SSE 一条消息:JS 里的 JSON,避免帧里出现裸换行把事件流切坏。 */
|
|
23
|
+
function sseFrame(frame) {
|
|
24
|
+
return `data: ${JSON.stringify({ t: frame.tab, w: frame.width, h: frame.height, img: frame.data })}\n\n`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function createApiRoutes({ engine: fallbackEngine, getEngine, embedded }) {
|
|
28
|
+
/* 每请求解析引擎:getEngine 缺省回落到注入的单实例(兼容旧装配/测试)。 */
|
|
29
|
+
const resolveEngine = typeof getEngine === 'function' ? getEngine : () => fallbackEngine
|
|
30
|
+
return [
|
|
31
|
+
/* GET /api/status —— 引擎状态 + 最近动作(工作台轮询数据源)。 */
|
|
32
|
+
async (req, res, u) => {
|
|
33
|
+
if (u.pathname !== '/api/status' || req.method !== 'GET') return false
|
|
34
|
+
try {
|
|
35
|
+
const engine = await resolveEngine(req)
|
|
36
|
+
/* embedded 旗标给 UI:嵌入式强制无头(见 engine.mjs resolveHeadlessPolicy),
|
|
37
|
+
* 「切到有头」按钮在嵌入式隐藏,避免承诺一个不会发生的弹窗。 */
|
|
38
|
+
send(req, res, 200, { ok: true, status: { ...engine.status(), embedded: !!embedded }, actions: engine.actionLog().slice(0, 20) })
|
|
39
|
+
} catch (error) {
|
|
40
|
+
sendEngineError(req, res, error)
|
|
41
|
+
}
|
|
42
|
+
return true
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
/* GET /api/live —— 活动页实时帧(text/event-stream)。
|
|
46
|
+
* 客户端一断开就退订,引擎随即停掉 screencast,不会在没人看时白烧 CPU。 */
|
|
47
|
+
async (req, res, u) => {
|
|
48
|
+
if (u.pathname !== '/api/live' || req.method !== 'GET') return false
|
|
49
|
+
/* 引擎解析(可能触发懒创建/启动)必须包在 try 里:失败时回结构化错误,
|
|
50
|
+
而不是让拒绝冒泡成未处理异常把整个服务进程打崩。 */
|
|
51
|
+
let engine
|
|
52
|
+
try { engine = await resolveEngine(req) } catch (error) { sendEngineError(req, res, error); return true }
|
|
53
|
+
res.writeHead(200, {
|
|
54
|
+
'content-type': 'text/event-stream; charset=utf-8',
|
|
55
|
+
'cache-control': 'no-store, no-cache, must-revalidate',
|
|
56
|
+
'x-content-type-options': 'nosniff',
|
|
57
|
+
'x-accel-buffering': 'no',
|
|
58
|
+
connection: 'keep-alive',
|
|
59
|
+
})
|
|
60
|
+
res.write(': live\n\n')
|
|
61
|
+
|
|
62
|
+
/* 背压:上一次写没冲干净就丢掉这一帧(视频流丢帧不丢语义)。 */
|
|
63
|
+
let blocked = false
|
|
64
|
+
const onFrame = (frame) => {
|
|
65
|
+
if (blocked || res.writableEnded || res.destroyed) return
|
|
66
|
+
blocked = true
|
|
67
|
+
try {
|
|
68
|
+
if (res.write(sseFrame(frame))) blocked = false
|
|
69
|
+
else res.once('drain', () => { blocked = false })
|
|
70
|
+
} catch {
|
|
71
|
+
blocked = true
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const unwatch = engine.watchFrames(onFrame)
|
|
76
|
+
/* 心跳:切到后台标签页时浏览器会节流,长连接需要定期有字节,否则被判定空闲。 */
|
|
77
|
+
const heartbeat = setInterval(() => {
|
|
78
|
+
if (res.writableEnded || res.destroyed) return
|
|
79
|
+
try { res.write(': ping\n\n') } catch { /* 已断开 */ }
|
|
80
|
+
}, 15000)
|
|
81
|
+
heartbeat.unref?.()
|
|
82
|
+
|
|
83
|
+
let closed = false
|
|
84
|
+
const stop = () => {
|
|
85
|
+
if (closed) return
|
|
86
|
+
closed = true
|
|
87
|
+
clearInterval(heartbeat)
|
|
88
|
+
try { unwatch() } catch { /* 已退订 */ }
|
|
89
|
+
}
|
|
90
|
+
req.on('close', stop)
|
|
91
|
+
res.on('close', stop)
|
|
92
|
+
res.on('error', stop) /* 写失败(客户端硬断)也要退订,别留着 screencast 白烧 CPU */
|
|
93
|
+
return true
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
/* POST /api/input —— 远端输入回放:{ type: 'pointer'|'key', ... } */
|
|
97
|
+
async (req, res, u) => {
|
|
98
|
+
if (u.pathname !== '/api/input' || req.method !== 'POST') return false
|
|
99
|
+
try {
|
|
100
|
+
const engine = await resolveEngine(req)
|
|
101
|
+
const body = await readBody(req, 64 * 1024)
|
|
102
|
+
const out = await engine.input(body)
|
|
103
|
+
send(req, res, 200, { ok: true, ...out })
|
|
104
|
+
} catch (error) {
|
|
105
|
+
sendEngineError(req, res, error)
|
|
106
|
+
}
|
|
107
|
+
return true
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
/* GET /api/screenshot —— 单张实时画面(PNG,不落盘)。SSE 不可用时的兜底。 */
|
|
111
|
+
async (req, res, u) => {
|
|
112
|
+
if (u.pathname !== '/api/screenshot' || req.method !== 'GET') return false
|
|
113
|
+
let engine
|
|
114
|
+
try { engine = await resolveEngine(req) } catch (error) { sendEngineError(req, res, error); return true }
|
|
115
|
+
if (!engine.status().running) {
|
|
116
|
+
send(req, res, 503, {
|
|
117
|
+
ok: false,
|
|
118
|
+
error: { code: 'ENGINE_NOT_RUNNING', message: '浏览器未启动', hint: 'POST /api/navigate 打开一个网址后会自动启动。' },
|
|
119
|
+
})
|
|
120
|
+
return true
|
|
121
|
+
}
|
|
122
|
+
try {
|
|
123
|
+
const png = await engine.screenshotBuffer({})
|
|
124
|
+
res.writeHead(200, { 'content-type': 'image/png', 'cache-control': 'no-store' })
|
|
125
|
+
res.end(req.method === 'HEAD' ? undefined : png)
|
|
126
|
+
} catch (error) {
|
|
127
|
+
sendEngineError(req, res, error)
|
|
128
|
+
}
|
|
129
|
+
return true
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
/* GET /api/snapshot —— 当前页面元素快照(与 browser_snapshot 同源)。 */
|
|
133
|
+
async (req, res, u) => {
|
|
134
|
+
if (u.pathname !== '/api/snapshot' || req.method !== 'GET') return false
|
|
135
|
+
try {
|
|
136
|
+
const engine = await resolveEngine(req)
|
|
137
|
+
const out = await engine.snapshot({})
|
|
138
|
+
send(req, res, 200, { ok: true, ...out })
|
|
139
|
+
} catch (error) {
|
|
140
|
+
sendEngineError(req, res, error)
|
|
141
|
+
}
|
|
142
|
+
return true
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
/* POST /api/navigate { url } —— 工作台便捷导航(拉起浏览器)。 */
|
|
146
|
+
async (req, res, u) => {
|
|
147
|
+
if (u.pathname !== '/api/navigate' || req.method !== 'POST') return false
|
|
148
|
+
try {
|
|
149
|
+
const engine = await resolveEngine(req)
|
|
150
|
+
const body = await readBody(req, 64 * 1024)
|
|
151
|
+
const out = await engine.navigate({ url: String(body.url || '') })
|
|
152
|
+
send(req, res, 200, { ok: true, tab: out.tab, url: out.url, title: out.title, note: out.note || '', authWall: !!out.authWall })
|
|
153
|
+
} catch (error) {
|
|
154
|
+
sendEngineError(req, res, error)
|
|
155
|
+
}
|
|
156
|
+
return true
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
/* POST /api/tabs { action, tab?, url? } —— 标签页切换/新建/关闭/列出。 */
|
|
160
|
+
async (req, res, u) => {
|
|
161
|
+
if (u.pathname !== '/api/tabs' || req.method !== 'POST') return false
|
|
162
|
+
try {
|
|
163
|
+
const engine = await resolveEngine(req)
|
|
164
|
+
const body = await readBody(req, 64 * 1024)
|
|
165
|
+
const out = await engine.tabsAction({ action: body.action || 'list', tab: body.tab, url: body.url })
|
|
166
|
+
send(req, res, 200, { ok: true, ...out })
|
|
167
|
+
} catch (error) {
|
|
168
|
+
sendEngineError(req, res, error)
|
|
169
|
+
}
|
|
170
|
+
return true
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
/* POST /api/history { action } —— 工作台的后退/前进/刷新(与 browser_history 同源)。 */
|
|
174
|
+
async (req, res, u) => {
|
|
175
|
+
if (u.pathname !== '/api/history' || req.method !== 'POST') return false
|
|
176
|
+
try {
|
|
177
|
+
const engine = await resolveEngine(req)
|
|
178
|
+
const body = await readBody(req, 64 * 1024)
|
|
179
|
+
const out = await engine.history({ action: String(body.action || 'back') })
|
|
180
|
+
send(req, res, 200, { ok: true, action: out.action, url: out.url, tab: out.tab, note: out.note || '', authWall: !!out.authWall })
|
|
181
|
+
} catch (error) {
|
|
182
|
+
sendEngineError(req, res, error)
|
|
183
|
+
}
|
|
184
|
+
return true
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
/* POST /api/control { action: 'close' | 'headless', value? }
|
|
188
|
+
* headless 切完会关掉运行中的浏览器,下次动作按新模式重启(登录态保留)。 */
|
|
189
|
+
async (req, res, u) => {
|
|
190
|
+
if (u.pathname !== '/api/control' || req.method !== 'POST') return false
|
|
191
|
+
try {
|
|
192
|
+
const engine = await resolveEngine(req)
|
|
193
|
+
const body = await readBody(req, 64 * 1024)
|
|
194
|
+
const action = String(body.action || '')
|
|
195
|
+
if (action === 'close') {
|
|
196
|
+
send(req, res, 200, { ok: true, ...(await engine.close()) })
|
|
197
|
+
return true
|
|
198
|
+
}
|
|
199
|
+
if (action === 'resume') {
|
|
200
|
+
/* 重开工作台时恢复上次浏览器(懒启动 + 标签页恢复,不附带新导航)。 */
|
|
201
|
+
send(req, res, 200, { ok: true, ...(await engine.resume()) })
|
|
202
|
+
return true
|
|
203
|
+
}
|
|
204
|
+
if (action === 'headless') {
|
|
205
|
+
const out = await engine.setHeadless(!!body.value)
|
|
206
|
+
send(req, res, 200, { ok: true, ...out })
|
|
207
|
+
return true
|
|
208
|
+
}
|
|
209
|
+
send(req, res, 400, {
|
|
210
|
+
ok: false,
|
|
211
|
+
error: { code: 'ARG_INVALID', message: `不支持 ${action || '(空)'}`, hint: '可用:close / headless' },
|
|
212
|
+
})
|
|
213
|
+
} catch (error) {
|
|
214
|
+
sendEngineError(req, res, error)
|
|
215
|
+
}
|
|
216
|
+
return true
|
|
217
|
+
},
|
|
218
|
+
|
|
219
|
+
/* 未知 /api/* —— 列出可用接口。 */
|
|
220
|
+
async (req, res, u) => {
|
|
221
|
+
if (!u.pathname.startsWith('/api/')) return false
|
|
222
|
+
send(req, res, 404, {
|
|
223
|
+
ok: false,
|
|
224
|
+
error: {
|
|
225
|
+
code: 'NOT_FOUND',
|
|
226
|
+
message: `未知接口 ${u.pathname}`,
|
|
227
|
+
hint: '可用:GET /api/status、GET /api/live、GET /api/screenshot、GET /api/snapshot、POST /api/navigate、POST /api/input、POST /api/tabs、POST /api/control',
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
return true
|
|
231
|
+
},
|
|
232
|
+
]
|
|
233
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** MCP 端点路由:协议细节由 kit 的 createMcpHandler 处理。 */
|
|
2
|
+
import { send } from '../http-utils.mjs'
|
|
3
|
+
|
|
4
|
+
export function createMcpRoutes({ mcpHandler, getMcpHandler } = {}) {
|
|
5
|
+
return [
|
|
6
|
+
async (req, res, u) => {
|
|
7
|
+
if (u.pathname !== '/mcp') return false
|
|
8
|
+
const handler = typeof getMcpHandler === 'function' ? getMcpHandler() : mcpHandler
|
|
9
|
+
if (!handler) {
|
|
10
|
+
send(req, res, 503, { ok: false, error: 'MCP tools not ready' })
|
|
11
|
+
return true
|
|
12
|
+
}
|
|
13
|
+
await handler(req, res)
|
|
14
|
+
return true
|
|
15
|
+
},
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** 工作台静态页与内置演示页(白名单路由,杜绝路径穿越)。 */
|
|
2
|
+
import { readFile } from 'node:fs/promises'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
import { DEMO_FILES, WORKBENCH_FILES } from '../constants.mjs'
|
|
6
|
+
|
|
7
|
+
export function createWorkbenchRoutes({ packageDir }) {
|
|
8
|
+
const uiDir = path.join(packageDir, 'ui')
|
|
9
|
+
const demoDir = path.join(packageDir, 'demo')
|
|
10
|
+
return [
|
|
11
|
+
async (req, res, u) => {
|
|
12
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') return false
|
|
13
|
+
const ui = WORKBENCH_FILES[u.pathname]
|
|
14
|
+
const demo = DEMO_FILES[u.pathname]
|
|
15
|
+
if (!ui && !demo) return false
|
|
16
|
+
const file = ui ? path.join(uiDir, ui[0]) : path.join(demoDir, demo[0])
|
|
17
|
+
const mime = (ui || demo)[1]
|
|
18
|
+
try {
|
|
19
|
+
const content = await readFile(file)
|
|
20
|
+
res.writeHead(200, {
|
|
21
|
+
'content-type': mime,
|
|
22
|
+
'cache-control': 'no-store',
|
|
23
|
+
'x-content-type-options': 'nosniff',
|
|
24
|
+
})
|
|
25
|
+
res.end(req.method === 'HEAD' ? undefined : content)
|
|
26
|
+
} catch {
|
|
27
|
+
res.writeHead(404, { 'content-type': 'text/plain; charset=utf-8' })
|
|
28
|
+
res.end('Not found')
|
|
29
|
+
}
|
|
30
|
+
return true
|
|
31
|
+
},
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 每会话一个浏览器引擎(F2:会话间彻底隔离)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么需要它:以前全进程只有一个 Playwright 引擎,所有会话共用同一份标签页、
|
|
5
|
+
* 动作队列与登录态——会话 A 的导航/点击会落在会话 B 正在看的页面上,跨会话串写。
|
|
6
|
+
* 现在每个会话各持一个引擎(独立 profile/标签页/互斥队列),请求/工具调用发生时
|
|
7
|
+
* 按「当前会话」现场解析,互不相干。
|
|
8
|
+
*
|
|
9
|
+
* 会话身份的唯一真源是 @capyclaw/document-workbench/session-context 的 AsyncLocalStorage:
|
|
10
|
+
* - HTTP 请求:createSessionDispatch 从 URL 的 /s/<sid> 段缝入;
|
|
11
|
+
* - 工具调用:bindToolsToCallerSession 从 exec.agent.session.id 缝入。
|
|
12
|
+
* 解析顺序:当前会话(ALS)→ default。无会话身份时(standalone 开发态)落 default,
|
|
13
|
+
* 行为与旧单引擎一致。
|
|
14
|
+
*
|
|
15
|
+
* 引擎是重资源(Playwright 上下文),所以懒创建:第一次用到某会话才拉起,
|
|
16
|
+
* 且只 mkdir profile/screenshots,浏览器本体到首次 navigate 才启动(见 engine.mjs)。
|
|
17
|
+
* 缓存的是 Promise<engine>:并发首请求共享同一次创建,不会重复拉起。
|
|
18
|
+
*/
|
|
19
|
+
import path from 'node:path'
|
|
20
|
+
import fs from 'node:fs'
|
|
21
|
+
import { currentSession } from '@capyclaw/document-workbench/session-context'
|
|
22
|
+
|
|
23
|
+
const DEFAULT_SESSION = 'default'
|
|
24
|
+
/* 会话 id 只允许安全字符(要当目录名),与 service-host 的 SESSION_PATH 同口径。 */
|
|
25
|
+
const SID_RE = /^[A-Za-z0-9][A-Za-z0-9._~-]{0,127}$/
|
|
26
|
+
|
|
27
|
+
export function normalizeSessionId(value) {
|
|
28
|
+
const sid = String(value == null ? '' : value).trim()
|
|
29
|
+
return SID_RE.test(sid) ? sid : ''
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param {object} options
|
|
34
|
+
* @param {string} options.hostDir 宿主数据目录;每会话引擎落 <hostDir>/sessions/<sid>/
|
|
35
|
+
* @param {object} [options.config] resolveEngineConfig 的产物(各会话共用同一配置)
|
|
36
|
+
* @param {Function} [options.createEngine] 引擎工厂(测试注入);缺省=createBrowserEngine。
|
|
37
|
+
* 缺省工厂用动态 import('./engine.mjs'):src/server 与产物 server/ 里引擎都在
|
|
38
|
+
* './engine.mjs'(build 把 src/mcp/engine.mjs 拷成 server/engine.mjs),动态 import
|
|
39
|
+
* 让本模块在 src 下也能被独立 import(测试注入工厂时根本不触发缺省工厂)。
|
|
40
|
+
*/
|
|
41
|
+
export function createSessionEngines({ hostDir, config, createEngine }) {
|
|
42
|
+
if (!hostDir) throw new Error('createSessionEngines: 缺少 hostDir')
|
|
43
|
+
const make = createEngine
|
|
44
|
+
|| ((opts) => import('./engine.mjs').then((m) => m.createBrowserEngine(opts)))
|
|
45
|
+
const cache = new Map() // sid → Promise<engine>
|
|
46
|
+
const ready = new Map() // sid → engine(已就绪,供回收巡检;避免 await 创建中的 Promise)
|
|
47
|
+
|
|
48
|
+
function forSession(value) {
|
|
49
|
+
const key = normalizeSessionId(value) || DEFAULT_SESSION
|
|
50
|
+
if (!cache.has(key)) {
|
|
51
|
+
const engineHostDir = path.join(hostDir, 'sessions', key)
|
|
52
|
+
let pending
|
|
53
|
+
pending = Promise.resolve()
|
|
54
|
+
.then(() => make({ hostDir: engineHostDir, config }))
|
|
55
|
+
.then((engine) => { ready.set(key, engine); return engine })
|
|
56
|
+
.catch((error) => {
|
|
57
|
+
/* 创建失败不缓存坏结果:下次请求可重试(别把一个瞬态错误固化成永久坏会话)。 */
|
|
58
|
+
if (cache.get(key) === pending) cache.delete(key)
|
|
59
|
+
ready.delete(key)
|
|
60
|
+
throw error
|
|
61
|
+
})
|
|
62
|
+
cache.set(key, pending)
|
|
63
|
+
}
|
|
64
|
+
return cache.get(key)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 当前会话的引擎(Promise)。工具端口/路由在请求发生时调用,ALS 已缝好会话。 */
|
|
68
|
+
function current() {
|
|
69
|
+
return forSession(currentSession())
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ---- 资源回收(空闲 + LRU 上限)----
|
|
73
|
+
* 引擎对象常驻缓存(保 profile / 标签日志 / 会话身份),回收只释放浏览器进程:
|
|
74
|
+
* ① 空闲:running 且超过 idleTimeoutMs 没人用、且没人在看(watching=0)→ suspend;
|
|
75
|
+
* ② LRU 上限:running 数超过 maxRunningEngines → 按最久未用 suspend 到上限。
|
|
76
|
+
* 下次该会话再有请求时懒重启 + 恢复标签页(见 engine.mjs restoreJournal)。
|
|
77
|
+
* 注入共享引擎(测试/旧装配)时按引擎对象去重,避免一个实例被当成多个计数。 */
|
|
78
|
+
const cfg = config || {}
|
|
79
|
+
const idleTimeoutMs = Number.isFinite(cfg.idleTimeoutMs) ? cfg.idleTimeoutMs : 1800000
|
|
80
|
+
const maxRunning = Number.isFinite(cfg.maxRunningEngines) ? cfg.maxRunningEngines : 6
|
|
81
|
+
const reapIntervalMs = Number.isFinite(cfg.reapIntervalMs) && cfg.reapIntervalMs > 0 ? cfg.reapIntervalMs : 30000
|
|
82
|
+
|
|
83
|
+
let reaping = false
|
|
84
|
+
async function reap() {
|
|
85
|
+
/* 重入守卫:巡检是异步的(await suspend),定时器/手动触发可能叠在一起。
|
|
86
|
+
叠跑会重复挂起同一引擎、并把 LRU 计数算乱。一次只跑一轮。 */
|
|
87
|
+
if (reaping) return
|
|
88
|
+
reaping = true
|
|
89
|
+
try {
|
|
90
|
+
const entries = []
|
|
91
|
+
const seen = new Set()
|
|
92
|
+
for (const engine of ready.values()) {
|
|
93
|
+
if (seen.has(engine)) continue
|
|
94
|
+
seen.add(engine)
|
|
95
|
+
if (!engine || typeof engine.status !== 'function') continue
|
|
96
|
+
let st
|
|
97
|
+
try { st = engine.status() } catch { continue }
|
|
98
|
+
if (st.running) entries.push({ engine, st })
|
|
99
|
+
}
|
|
100
|
+
const now = Date.now()
|
|
101
|
+
const suspendable = (e) => typeof e.engine.suspend === 'function' && (e.st.watching || 0) === 0
|
|
102
|
+
/* ① 空闲回收。扫描时的 lastActivity 可能已陈旧:真正挂起前再读一次新鲜状态,
|
|
103
|
+
并把 ifIdleMs 传给引擎,让它在动作队列里挂起前二次复检(期间可能来了新动作)。 */
|
|
104
|
+
if (idleTimeoutMs > 0) {
|
|
105
|
+
for (const e of entries) {
|
|
106
|
+
const last = Number(e.st.lastActivity) || 0
|
|
107
|
+
if (!(last && now - last > idleTimeoutMs && suspendable(e))) continue
|
|
108
|
+
let fresh
|
|
109
|
+
try { fresh = e.engine.status() } catch { continue }
|
|
110
|
+
const freshLast = Number(fresh.lastActivity) || 0
|
|
111
|
+
if (!fresh.running || (fresh.watching || 0) !== 0) continue
|
|
112
|
+
if (freshLast && Date.now() - freshLast <= idleTimeoutMs) continue
|
|
113
|
+
try { await e.engine.suspend({ ifIdleMs: idleTimeoutMs }) } catch { /* 已退出 */ }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/* ② LRU 上限:重新数 running(空闲回收可能已减),超限按最久未用挂起。 */
|
|
117
|
+
if (maxRunning > 0) {
|
|
118
|
+
const running = entries.filter((e) => { try { return e.engine.status().running } catch { return false } })
|
|
119
|
+
if (running.length > maxRunning) {
|
|
120
|
+
running.sort((a, b) => (Number(a.st.lastActivity) || 0) - (Number(b.st.lastActivity) || 0))
|
|
121
|
+
let excess = running.length - maxRunning
|
|
122
|
+
for (const e of running) {
|
|
123
|
+
if (excess <= 0) break
|
|
124
|
+
if (!suspendable(e)) continue
|
|
125
|
+
/* 强制挂起前也看一眼是否刚被观看/使用,避免把正在用的页挂起。 */
|
|
126
|
+
let fresh
|
|
127
|
+
try { fresh = e.engine.status() } catch { continue }
|
|
128
|
+
if (!fresh.running || (fresh.watching || 0) !== 0) continue
|
|
129
|
+
try { await e.engine.suspend(); excess -= 1 } catch { /* 已退出 */ }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
} finally {
|
|
134
|
+
reaping = false
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let reapTimer = null
|
|
139
|
+
if (idleTimeoutMs > 0 || maxRunning > 0) {
|
|
140
|
+
reapTimer = setInterval(() => { reap().catch(() => {}) }, reapIntervalMs)
|
|
141
|
+
reapTimer.unref?.()
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ---- 磁盘回收:会话 profile 目录 TTL 清理 ----
|
|
145
|
+
* 进程回收(reap)只挂起浏览器,<hostDir>/sessions/<sid>/ 的 profile 目录从不删,
|
|
146
|
+
* 跨宿主重启越积越多(实测约 40 个陈旧目录)。这里按 mtime TTL 清理「不在本进程
|
|
147
|
+
* 缓存里」的陈旧会话目录——本进程用过的会话常驻 cache,受保护不会被误删;
|
|
148
|
+
* default / login-vault 是共享登录态,永不删。启动即扫一次清历史,之后慢周期巡检。 */
|
|
149
|
+
const sessionDirTtlMs = Number.isFinite(cfg.sessionDirTtlMs) ? cfg.sessionDirTtlMs : 7 * 24 * 3600 * 1000
|
|
150
|
+
const PROTECTED_DIRS = new Set([DEFAULT_SESSION, 'login-vault'])
|
|
151
|
+
async function cleanupSessionDirs() {
|
|
152
|
+
if (sessionDirTtlMs <= 0) return { removed: 0 }
|
|
153
|
+
const sessionsRoot = path.join(hostDir, 'sessions')
|
|
154
|
+
let names
|
|
155
|
+
try { names = fs.readdirSync(sessionsRoot) } catch { return { removed: 0 } }
|
|
156
|
+
const now = Date.now()
|
|
157
|
+
let removed = 0
|
|
158
|
+
for (const name of names) {
|
|
159
|
+
if (PROTECTED_DIRS.has(name) || cache.has(name) || !SID_RE.test(name)) continue
|
|
160
|
+
const full = path.join(sessionsRoot, name)
|
|
161
|
+
try {
|
|
162
|
+
const st = fs.statSync(full)
|
|
163
|
+
if (!st.isDirectory()) continue
|
|
164
|
+
if (now - st.mtimeMs > sessionDirTtlMs) {
|
|
165
|
+
fs.rmSync(full, { recursive: true, force: true })
|
|
166
|
+
removed += 1
|
|
167
|
+
}
|
|
168
|
+
} catch { /* 忽略单个目录失败 */ }
|
|
169
|
+
}
|
|
170
|
+
return { removed }
|
|
171
|
+
}
|
|
172
|
+
let dirCleanupTimer = null
|
|
173
|
+
if (sessionDirTtlMs > 0) {
|
|
174
|
+
cleanupSessionDirs().catch(() => {})
|
|
175
|
+
dirCleanupTimer = setInterval(() => { cleanupSessionDirs().catch(() => {}) }, 3600000)
|
|
176
|
+
dirCleanupTimer.unref?.()
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** 停服前挂起所有已创建的引擎(保留标签日志供下次恢复),避免僵尸浏览器进程。
|
|
180
|
+
* 停服竞态:框架先调 beforeStop 再关 HTTP,await 期间仍可能有请求进来重建引擎。
|
|
181
|
+
* 用 drain 循环把「await 期间新创建的」也扫掉(最多 5 轮,防持续流量下无限循环);
|
|
182
|
+
* 并发 closeAll 共享同一次 drain。drain 结束后缓存为空,后续请求仍可重建(既有语义)。 */
|
|
183
|
+
let closingPromise = null
|
|
184
|
+
function closeAll() {
|
|
185
|
+
if (closingPromise) return closingPromise
|
|
186
|
+
closingPromise = (async () => {
|
|
187
|
+
try {
|
|
188
|
+
if (reapTimer) { clearInterval(reapTimer); reapTimer = null }
|
|
189
|
+
if (dirCleanupTimer) { clearInterval(dirCleanupTimer); dirCleanupTimer = null }
|
|
190
|
+
for (let pass = 0; pass < 5; pass += 1) {
|
|
191
|
+
const pending = [...cache.values()]
|
|
192
|
+
cache.clear()
|
|
193
|
+
ready.clear()
|
|
194
|
+
if (pending.length === 0) break
|
|
195
|
+
await Promise.all(pending.map(async (p) => {
|
|
196
|
+
try {
|
|
197
|
+
const engine = await p
|
|
198
|
+
/* 停服走挂起(保标签日志);假引擎无 suspend 时回落 close。 */
|
|
199
|
+
if (typeof engine.suspend === 'function') await engine.suspend()
|
|
200
|
+
else await engine.close()
|
|
201
|
+
} catch { /* 浏览器已退出/创建失败时忽略 */ }
|
|
202
|
+
}))
|
|
203
|
+
}
|
|
204
|
+
cache.clear()
|
|
205
|
+
ready.clear()
|
|
206
|
+
} finally {
|
|
207
|
+
closingPromise = null
|
|
208
|
+
}
|
|
209
|
+
})()
|
|
210
|
+
return closingPromise
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return {
|
|
214
|
+
forSession,
|
|
215
|
+
current,
|
|
216
|
+
closeAll,
|
|
217
|
+
sessions: () => [...cache.keys()],
|
|
218
|
+
/* 手动触发一次回收巡检(测试用;生产由定时器驱动)。 */
|
|
219
|
+
reapNow: () => reap(),
|
|
220
|
+
/* 手动触发一次会话目录磁盘清理(测试用;生产启动+慢周期驱动)。 */
|
|
221
|
+
cleanupSessionDirsNow: () => cleanupSessionDirs(),
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"mode": "re-export",
|
|
4
|
+
"packages": {
|
|
5
|
+
"service-host": {
|
|
6
|
+
"package": "@capyclaw/service-host",
|
|
7
|
+
"version": "0.1.5",
|
|
8
|
+
"apiVersion": "1.0.0",
|
|
9
|
+
"spec": "@capyclaw/service-host/src",
|
|
10
|
+
"sha256": "af0a57d779bfe6a66dc935320178d591ef799a7e037f7a5823cdfa1fe5878eeb"
|
|
11
|
+
},
|
|
12
|
+
"tool-host": {
|
|
13
|
+
"package": "@capyclaw/tool-host",
|
|
14
|
+
"version": "0.2.0",
|
|
15
|
+
"apiVersion": "1.1.0",
|
|
16
|
+
"spec": "@capyclaw/tool-host/src",
|
|
17
|
+
"sha256": "23256dbcd5cbee0b96b33c97e4eb4e74d0e169cbdde52f91d4526f2fc0f60d3e"
|
|
18
|
+
},
|
|
19
|
+
"asset-service": {
|
|
20
|
+
"package": "@capyclaw/asset-service",
|
|
21
|
+
"version": "0.1.4",
|
|
22
|
+
"apiVersion": "1.0.0",
|
|
23
|
+
"spec": "@capyclaw/asset-service/src",
|
|
24
|
+
"sha256": "311a83e95d56dbb69b739d61aced0889b64e85eddd95b883e322e0fa5be8bd6f"
|
|
25
|
+
},
|
|
26
|
+
"editor-host": {
|
|
27
|
+
"package": "@capyclaw/editor-host",
|
|
28
|
+
"version": "0.1.5",
|
|
29
|
+
"apiVersion": "1.0.0",
|
|
30
|
+
"spec": "@capyclaw/editor-host/src",
|
|
31
|
+
"sha256": "c8b80dbd4f1b2bee9ef9001423a013031a21ea9a3b8897b5536fe6e5687f01b3"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"kit": {
|
|
35
|
+
"tuning.mjs": {
|
|
36
|
+
"spec": "@capyclaw/plugin-kit/tuning",
|
|
37
|
+
"sha256": "6dc1d89c97056b03c27d744e6256e0e8d88a772c340acc6e04a3413e9ee5cc8b"
|
|
38
|
+
},
|
|
39
|
+
"service/api.mjs": {
|
|
40
|
+
"spec": "@capyclaw/plugin-kit/service/api",
|
|
41
|
+
"sha256": "336a92237d5575709d421cb8199bad7c56fbd95bfd2b30b5d9b913f719db8402"
|
|
42
|
+
},
|
|
43
|
+
"service/http.mjs": {
|
|
44
|
+
"spec": "@capyclaw/plugin-kit/service/http",
|
|
45
|
+
"sha256": "5839bf8872a208f14a219ba7528e2d19e9884f6e6a2645689d58369952d0476f"
|
|
46
|
+
},
|
|
47
|
+
"service/mcp-http.mjs": {
|
|
48
|
+
"spec": "@capyclaw/plugin-kit/service/mcp-http",
|
|
49
|
+
"sha256": "54bce272839c9477d460a483ee4bce62ca9f61b56174247ed718a7711eec7ee2"
|
|
50
|
+
},
|
|
51
|
+
"tools/validate.mjs": {
|
|
52
|
+
"spec": "@capyclaw/plugin-kit/tools/validate",
|
|
53
|
+
"sha256": "d88424caa66913acfc49a340c6e6eea6fe930a676ee8d32581d6366877f21389"
|
|
54
|
+
},
|
|
55
|
+
"editor/lease.mjs": {
|
|
56
|
+
"spec": "@capyclaw/plugin-kit/editor/lease",
|
|
57
|
+
"sha256": "4b1fe0ea3678d27f5283827a1d658784b915914cb6a0780f9534426ffd66b25f"
|
|
58
|
+
},
|
|
59
|
+
"util/fs-lock.mjs": {
|
|
60
|
+
"spec": "@capyclaw/plugin-kit/util/fs-lock",
|
|
61
|
+
"sha256": "c528e30271d83be2c857c160246598f96e636dacb2561a5e2109337e84d0865b"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"pkgRoot": {
|
|
65
|
+
"capyclaw-service-host/tuning.mjs": {
|
|
66
|
+
"spec": "@capyclaw/service-host/tuning",
|
|
67
|
+
"sha256": "1425851a3bff8c672a58536096faa321c74a4d4333cc0ae9268c1cfe83696492"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|