@capyclaw/browser-suite 0.1.2 → 0.2.37
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/LICENSE +21 -0
- package/README.md +9 -5
- package/composition.lock.json +37 -25
- package/contract/browser-contract.json +484 -25
- package/cordis.patch.yml +3 -9
- package/dsh-suite.json +110 -82
- package/lib/index.mjs +1 -1
- 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/browser-skill-api/README.md +3 -0
- package/node_modules/@capyclaw/browser-skill-api/contract/browser-contract.json +1349 -0
- package/node_modules/@capyclaw/browser-skill-api/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/browser-skill-api/package.json +49 -0
- package/node_modules/@capyclaw/browser-skill-api/plugin.mjs +15 -0
- package/node_modules/@capyclaw/browser-skill-api/skills/browser-api/SKILL.md +85 -0
- package/node_modules/@capyclaw/browser-skill-api/skills/browser-api/references/tool-contract.md +692 -0
- package/node_modules/@capyclaw/browser-skill-browser/README.md +3 -0
- package/node_modules/@capyclaw/browser-skill-browser/contract/browser-contract.json +1349 -0
- package/node_modules/@capyclaw/browser-skill-browser/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/browser-skill-browser/package.json +49 -0
- package/node_modules/@capyclaw/browser-skill-browser/plugin.mjs +15 -0
- package/node_modules/@capyclaw/browser-skill-browser/skills/browser/SKILL.md +27 -0
- package/node_modules/@capyclaw/browser-skill-ops/README.md +3 -0
- package/node_modules/@capyclaw/browser-skill-ops/contract/browser-contract.json +1349 -0
- package/node_modules/@capyclaw/browser-skill-ops/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/browser-skill-ops/package.json +49 -0
- package/node_modules/@capyclaw/browser-skill-ops/plugin.mjs +15 -0
- package/node_modules/@capyclaw/browser-skill-ops/skills/browser-ops/SKILL.md +63 -0
- package/node_modules/@capyclaw/browser-workbench/README.md +89 -0
- package/node_modules/@capyclaw/browser-workbench/contract/browser-contract.json +1349 -0
- package/node_modules/@capyclaw/browser-workbench/demo/form.html +112 -0
- package/node_modules/@capyclaw/browser-workbench/lib/host.mjs +1 -0
- package/node_modules/@capyclaw/browser-workbench/package.json +71 -0
- package/node_modules/@capyclaw/browser-workbench/plugin.mjs +1 -0
- package/node_modules/@capyclaw/browser-workbench/server/constants.mjs +16 -0
- package/node_modules/@capyclaw/browser-workbench/server/contract-snapshots.mjs +81 -0
- package/node_modules/@capyclaw/browser-workbench/server/contract.mjs +24 -0
- package/node_modules/@capyclaw/browser-workbench/server/embedded-host.mjs +247 -0
- package/node_modules/@capyclaw/browser-workbench/server/engine.mjs +2466 -0
- package/node_modules/@capyclaw/browser-workbench/server/governor.mjs +189 -0
- package/node_modules/@capyclaw/browser-workbench/server/http-utils.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/human.mjs +628 -0
- package/node_modules/@capyclaw/browser-workbench/server/infra/http.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/infra/tuning.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/input.mjs +154 -0
- package/node_modules/@capyclaw/browser-workbench/server/login-vault.mjs +109 -0
- package/node_modules/@capyclaw/browser-workbench/server/mcp/handler.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/mcp/instructions.mjs +31 -0
- package/node_modules/@capyclaw/browser-workbench/server/orphans.mjs +163 -0
- package/node_modules/@capyclaw/browser-workbench/server/relay.mjs +198 -0
- package/node_modules/@capyclaw/browser-workbench/server/routes/api.mjs +233 -0
- package/node_modules/@capyclaw/browser-workbench/server/routes/assets.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/routes/mcp.mjs +17 -0
- package/node_modules/@capyclaw/browser-workbench/server/routes/workbench.mjs +33 -0
- package/node_modules/@capyclaw/browser-workbench/server/session-engines.mjs +223 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/SHARED_MANIFEST.json +70 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/asset-service.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/editor-host.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/editor/lease.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/service/api.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/service/http.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/service/mcp-http.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/tools/validate.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/tuning.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/kit/util/fs-lock.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/service-host.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/tool-host.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/shared/tuning.mjs +2 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/contract.mjs +55 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/evaluate.mjs +36 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/index.mjs +26 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/interaction.mjs +215 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/navigation.mjs +35 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/screenshot.mjs +50 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/session.mjs +81 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/snapshot.mjs +30 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/capabilities/tabs.mjs +35 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/index.mjs +12 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/kernel/define.mjs +5 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/kernel/output.mjs +30 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/kernel/ports.mjs +59 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools/kernel/registry.mjs +17 -0
- package/node_modules/@capyclaw/browser-workbench/server/tools.mjs +3 -0
- package/node_modules/@capyclaw/browser-workbench/server/workbench-framework.mjs +305 -0
- package/node_modules/@capyclaw/browser-workbench/ui/app.js +447 -0
- package/node_modules/@capyclaw/browser-workbench/ui/index.html +46 -0
- package/node_modules/@capyclaw/browser-workbench/ui/style.css +144 -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 +139 -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/portal/README.md +70 -0
- package/node_modules/@capyclaw/portal/lib/index.mjs +387 -0
- package/node_modules/@capyclaw/portal/lib/ledger.mjs +194 -0
- package/node_modules/@capyclaw/portal/lib/portal-agent.ps1 +811 -0
- package/node_modules/@capyclaw/portal/lib/portal-darwin.mjs +183 -0
- package/node_modules/@capyclaw/portal/package.json +40 -0
- package/node_modules/@capyclaw/service-broker/README.md +104 -0
- package/node_modules/@capyclaw/service-broker/cordis.patch.yml +8 -0
- package/node_modules/@capyclaw/service-broker/dsh-suite.json +21 -0
- package/node_modules/@capyclaw/service-broker/lib/control.mjs +193 -0
- package/node_modules/@capyclaw/service-broker/lib/discovery.mjs +109 -0
- package/node_modules/@capyclaw/service-broker/lib/engine.mjs +1236 -0
- package/node_modules/@capyclaw/service-broker/lib/host.mjs +182 -0
- package/node_modules/@capyclaw/service-broker/lib/manifest.mjs +249 -0
- package/node_modules/@capyclaw/service-broker/lib/recovery.mjs +325 -0
- package/node_modules/@capyclaw/service-broker/lib/skills-client.mjs +28 -0
- package/node_modules/@capyclaw/service-broker/lib/spec.mjs +78 -0
- package/node_modules/@capyclaw/service-broker/package.json +65 -0
- package/node_modules/@capyclaw/service-broker/server.mjs +81 -0
- package/node_modules/@capyclaw/service-broker/service.schema.json +62 -0
- package/node_modules/@capyclaw/service-broker/services.json +3 -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 +31 -14
- package/services.json +1 -21
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @capyclaw/tool-host —— 工具面标准件。
|
|
3
|
+
*
|
|
4
|
+
* 把“能力声明 → 注册表 → 工具 schema/实现 → 契约报告 → MCP 协议壳”收成一套:
|
|
5
|
+
* defineTool / defineCapability / createRegistry / createMcpHandler /
|
|
6
|
+
* createCapabilityReport / buildInstructions
|
|
7
|
+
*
|
|
8
|
+
* 功能插件只写业务能力,不再复制 kernel/registry/dispatch/validate/contract。
|
|
9
|
+
*/
|
|
10
|
+
import { createMcpHandler as createKitMcpHandler } from '@capyclaw/plugin-kit/service/mcp-http'
|
|
11
|
+
import { validateToolArguments } from '@capyclaw/plugin-kit/tools/validate'
|
|
12
|
+
import { normalizeToolResult, resultText } from '@capyclaw/plugin-kit/tools/result'
|
|
13
|
+
import { createServiceApi } from '@capyclaw/plugin-kit/service/api'
|
|
14
|
+
import { createDescriptorRegistry } from './descriptors.mjs'
|
|
15
|
+
|
|
16
|
+
export { createDescriptorRegistry } from './descriptors.mjs'
|
|
17
|
+
|
|
18
|
+
const KINDS = new Set(['read', 'write', 'control'])
|
|
19
|
+
|
|
20
|
+
export function defineTool({
|
|
21
|
+
name,
|
|
22
|
+
description = '',
|
|
23
|
+
inputSchema = { type: 'object', properties: {}, additionalProperties: false },
|
|
24
|
+
kind = 'write',
|
|
25
|
+
since = '1.0.0',
|
|
26
|
+
handler,
|
|
27
|
+
} = {}) {
|
|
28
|
+
if (!name || typeof name !== 'string') throw new Error('defineTool 需要 name')
|
|
29
|
+
if (typeof handler !== 'function') throw new Error(`工具 ${name} 需要 handler`)
|
|
30
|
+
if (!KINDS.has(kind)) throw new Error(`工具 ${name} 的 kind 非法: ${kind}`)
|
|
31
|
+
return Object.freeze({ name, description, inputSchema, kind, since, handler })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function defineCapability({
|
|
35
|
+
id,
|
|
36
|
+
title,
|
|
37
|
+
description = '',
|
|
38
|
+
tags = [],
|
|
39
|
+
requires = [],
|
|
40
|
+
dependsOn = [],
|
|
41
|
+
provides = {},
|
|
42
|
+
features = [],
|
|
43
|
+
tools = [],
|
|
44
|
+
} = {}) {
|
|
45
|
+
if (!id || typeof id !== 'string') throw new Error('defineCapability 需要 id')
|
|
46
|
+
if (!Array.isArray(tools) || !tools.length) throw new Error(`能力 ${id} 至少需要一个工具`)
|
|
47
|
+
return Object.freeze({
|
|
48
|
+
id,
|
|
49
|
+
title: title || id,
|
|
50
|
+
description,
|
|
51
|
+
tags: Object.freeze([...tags]),
|
|
52
|
+
requires: Object.freeze([...requires]),
|
|
53
|
+
dependsOn: Object.freeze([...dependsOn]),
|
|
54
|
+
provides: Object.freeze({ ...provides }),
|
|
55
|
+
features: Object.freeze([...features]),
|
|
56
|
+
tools: Object.freeze([...tools]),
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function validateCapabilities(capabilities) {
|
|
61
|
+
const ids = new Set()
|
|
62
|
+
const toolNames = new Set()
|
|
63
|
+
for (const cap of capabilities) {
|
|
64
|
+
if (ids.has(cap.id)) throw new Error(`重复的 capability id: ${cap.id}`)
|
|
65
|
+
ids.add(cap.id)
|
|
66
|
+
for (const tool of cap.tools) {
|
|
67
|
+
if (toolNames.has(tool.name)) throw new Error(`重复的工具名: ${tool.name}`)
|
|
68
|
+
toolNames.add(tool.name)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (const cap of capabilities) {
|
|
72
|
+
for (const dep of cap.dependsOn) {
|
|
73
|
+
if (!ids.has(dep)) throw new Error(`能力 ${cap.id} 依赖不存在的能力: ${dep}`)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function selectCapabilities(capabilities, enabled) {
|
|
79
|
+
if (!enabled || !enabled.length) return capabilities
|
|
80
|
+
const byId = new Map(capabilities.map((cap) => [cap.id, cap]))
|
|
81
|
+
for (const id of enabled) {
|
|
82
|
+
if (!byId.has(id)) throw new Error(`enabled 里有未知能力: ${id}`)
|
|
83
|
+
}
|
|
84
|
+
const ids = new Set(enabled)
|
|
85
|
+
let changed = true
|
|
86
|
+
while (changed) {
|
|
87
|
+
changed = false
|
|
88
|
+
for (const cap of capabilities) {
|
|
89
|
+
if (!ids.has(cap.id)) continue
|
|
90
|
+
for (const dep of cap.dependsOn) {
|
|
91
|
+
if (!ids.has(dep)) { ids.add(dep); changed = true }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return capabilities.filter((cap) => ids.has(cap.id))
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {Array} capabilities
|
|
100
|
+
* @param {{ enabled?: string[], ports?: object, report?: Function, reserved?: string[] }} options
|
|
101
|
+
*/
|
|
102
|
+
export function createRegistry(capabilities, { enabled = null, ports = null, report = null, reserved = [] } = {}) {
|
|
103
|
+
validateCapabilities(capabilities)
|
|
104
|
+
const selected = selectCapabilities(capabilities, enabled)
|
|
105
|
+
|
|
106
|
+
const kernelPorts = { ...(ports || {}) }
|
|
107
|
+
const reservedNames = new Set([...(reserved || []), 'contract'])
|
|
108
|
+
const providers = new Map()
|
|
109
|
+
for (const cap of selected) {
|
|
110
|
+
for (const [ns, api] of Object.entries(cap.provides || {})) {
|
|
111
|
+
if (reservedNames.has(ns)) throw new Error(`能力 ${cap.id} 不能覆盖内核端口: ${ns}`)
|
|
112
|
+
if (providers.has(ns)) throw new Error(`服务命名空间重复: ${ns}(${providers.get(ns).cap.id} / ${cap.id})`)
|
|
113
|
+
providers.set(ns, { cap, api })
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const available = new Set([...Object.keys(kernelPorts), ...reservedNames, ...providers.keys()])
|
|
118
|
+
for (const cap of selected) {
|
|
119
|
+
for (const req of cap.requires) {
|
|
120
|
+
if (!available.has(req)) throw new Error(`能力 ${cap.id} 需要未提供的端口/服务: ${req}`)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const ctx = { ...kernelPorts }
|
|
125
|
+
for (const [ns, { api }] of providers) {
|
|
126
|
+
ctx[ns] = {}
|
|
127
|
+
for (const [method, fn] of Object.entries(api)) {
|
|
128
|
+
if (typeof fn !== 'function') throw new Error(`服务 ${ns}.${method} 必须是函数`)
|
|
129
|
+
ctx[ns][method] = (...args) => fn(ctx, ...args)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const TOOLS = []
|
|
134
|
+
const TOOL_IMPL = {}
|
|
135
|
+
const TOOL_META = {}
|
|
136
|
+
const FEATURES = []
|
|
137
|
+
const CAPABILITIES = []
|
|
138
|
+
|
|
139
|
+
for (const cap of selected) {
|
|
140
|
+
for (const feature of cap.features) {
|
|
141
|
+
if (!FEATURES.includes(feature)) FEATURES.push(feature)
|
|
142
|
+
}
|
|
143
|
+
CAPABILITIES.push({
|
|
144
|
+
id: cap.id,
|
|
145
|
+
title: cap.title,
|
|
146
|
+
description: cap.description,
|
|
147
|
+
tags: [...cap.tags],
|
|
148
|
+
tools: cap.tools.map((tool) => tool.name),
|
|
149
|
+
})
|
|
150
|
+
for (const tool of cap.tools) {
|
|
151
|
+
TOOLS.push({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema })
|
|
152
|
+
TOOL_META[tool.name] = { kind: tool.kind, since: tool.since, capability: cap.id }
|
|
153
|
+
TOOL_IMPL[tool.name] = (args) => tool.handler(args || {}, ctx)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const reportFn = report || createCapabilityReport
|
|
158
|
+
ctx.contract = {
|
|
159
|
+
report: (editorUrl = '', runtime = {}) => reportFn({
|
|
160
|
+
tools: TOOLS,
|
|
161
|
+
toolMeta: TOOL_META,
|
|
162
|
+
features: FEATURES,
|
|
163
|
+
capabilities: CAPABILITIES,
|
|
164
|
+
editorUrl,
|
|
165
|
+
runtime,
|
|
166
|
+
}),
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* 动态增删工具:配合 MCP 活引用(tools/list 读 registry.TOOLS),注册/注销后
|
|
170
|
+
* 客户端重新 list 即见最新工具集,无需重建 handler。旧 registry 是纯静态,
|
|
171
|
+
* 套件热重载/能力开关无法反映到工具面。 */
|
|
172
|
+
function registerTool(tool, capabilityId = '') {
|
|
173
|
+
if (!tool || typeof tool.name !== 'string' || !tool.name) throw new Error('registerTool 需要 tool.name')
|
|
174
|
+
if (typeof tool.handler !== 'function') throw new Error(`工具 ${tool.name} 需要 handler`)
|
|
175
|
+
if (TOOL_IMPL[tool.name]) throw new Error(`工具已存在: ${tool.name}`)
|
|
176
|
+
TOOLS.push({ name: tool.name, description: tool.description || '', inputSchema: tool.inputSchema || { type: 'object', properties: {} } })
|
|
177
|
+
TOOL_META[tool.name] = { kind: tool.kind || 'write', since: tool.since || '1.0.0', capability: capabilityId }
|
|
178
|
+
TOOL_IMPL[tool.name] = (args) => tool.handler(args || {}, ctx)
|
|
179
|
+
return true
|
|
180
|
+
}
|
|
181
|
+
function unregisterTool(name) {
|
|
182
|
+
const index = TOOLS.findIndex((tool) => tool.name === name)
|
|
183
|
+
if (index < 0) return false
|
|
184
|
+
TOOLS.splice(index, 1)
|
|
185
|
+
delete TOOL_IMPL[name]
|
|
186
|
+
delete TOOL_META[name]
|
|
187
|
+
return true
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return { TOOLS, TOOL_IMPL, TOOL_META, FEATURES, CAPABILITIES, ctx, registerTool, unregisterTool }
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** 与 MCP 工具面解耦:调用前统一校验。 */
|
|
194
|
+
export function createToolDispatcher({ tools, callTool }) {
|
|
195
|
+
const toolMap = new Map((tools || []).map((tool) => [tool.name, tool]))
|
|
196
|
+
return {
|
|
197
|
+
listTools() {
|
|
198
|
+
return { tools }
|
|
199
|
+
},
|
|
200
|
+
async callTool(name, args = {}) {
|
|
201
|
+
const tool = toolMap.get(name)
|
|
202
|
+
if (!tool) {
|
|
203
|
+
return { content: [{ type: 'text', text: `未知工具: ${String(name)}` }], isError: true }
|
|
204
|
+
}
|
|
205
|
+
const check = validateToolArguments(tool, args)
|
|
206
|
+
if (!check.ok) {
|
|
207
|
+
return { content: [{ type: 'text', text: '参数不合法:' + check.errors.join(';') }], isError: true }
|
|
208
|
+
}
|
|
209
|
+
const out = await callTool(name, args)
|
|
210
|
+
/* 与 MCP 面同一归一化:保留纯字符串/空 text/对象,不丢成 'ok'(B 轴 P0-5)。 */
|
|
211
|
+
return normalizeToolResult(out)
|
|
212
|
+
},
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* MCP Streamable HTTP 处理器。registry 可直接传 createRegistry 的返回值。
|
|
218
|
+
* 兼容两种调用:
|
|
219
|
+
* { registry } 或 { tools, toolImpl }
|
|
220
|
+
* { tools, callTool }(旧 relay 形态)
|
|
221
|
+
* @param {{ registry?: object, tools?: Array, toolImpl?: object, callTool?: Function, serverInfo?: object, instructions?: string }} options
|
|
222
|
+
*/
|
|
223
|
+
export function createMcpHandler({ registry, tools, toolImpl, callTool, serverInfo, instructions, listChanged } = {}) {
|
|
224
|
+
/* registry 形态走活引用:tools/list 每次读 registry.TOOLS,callTool 读 registry.TOOL_IMPL,
|
|
225
|
+
* 于是 registerTool/unregisterTool 的动态增删立刻可见,无需重建 handler。 */
|
|
226
|
+
const useRegistry = !tools && !!registry
|
|
227
|
+
const impl = toolImpl || registry?.TOOL_IMPL || null
|
|
228
|
+
const staticList = tools || null
|
|
229
|
+
if (!useRegistry && (!Array.isArray(staticList) || !staticList.length)) throw new Error('createMcpHandler: 没有工具可暴露')
|
|
230
|
+
if (!impl && typeof callTool !== 'function') throw new Error('createMcpHandler: 需要 toolImpl 或 callTool')
|
|
231
|
+
return createKitMcpHandler({
|
|
232
|
+
tools: useRegistry ? () => registry.TOOLS : staticList,
|
|
233
|
+
callTool: (name, args, context) => {
|
|
234
|
+
if (typeof callTool === 'function' && !impl) return callTool(name, args, context)
|
|
235
|
+
const source = useRegistry ? registry.TOOL_IMPL : impl
|
|
236
|
+
const fn = source[name]
|
|
237
|
+
if (!fn) throw new Error(`未知工具: ${name}`)
|
|
238
|
+
return fn(args, context)
|
|
239
|
+
},
|
|
240
|
+
serverInfo: serverInfo || { name: 'dsh-tool-host', version: '0.1.0' },
|
|
241
|
+
instructions,
|
|
242
|
+
listChanged,
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** 把绝对地址收成同源相对路径:给人看的地址不带端口,端口是宿主的内部细节。 */
|
|
247
|
+
function sameOriginPath(url) {
|
|
248
|
+
const raw = String(url || '').trim()
|
|
249
|
+
if (!raw) return ''
|
|
250
|
+
if (raw.startsWith('/')) return raw
|
|
251
|
+
try {
|
|
252
|
+
const { pathname } = new URL(raw)
|
|
253
|
+
return pathname.endsWith('/') ? pathname : `${pathname}/`
|
|
254
|
+
} catch {
|
|
255
|
+
return ''
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function createCapabilityReport({
|
|
260
|
+
tools = [],
|
|
261
|
+
toolMeta = {},
|
|
262
|
+
features = [],
|
|
263
|
+
capabilities = [],
|
|
264
|
+
contractVersion = '1.0.0',
|
|
265
|
+
packageVersion = '0.0.0',
|
|
266
|
+
editorUrl = '',
|
|
267
|
+
runtime = {},
|
|
268
|
+
} = {}) {
|
|
269
|
+
return {
|
|
270
|
+
contractVersion,
|
|
271
|
+
packageVersion,
|
|
272
|
+
editorUrl,
|
|
273
|
+
editorPath: sameOriginPath(editorUrl),
|
|
274
|
+
...runtime,
|
|
275
|
+
toolCount: tools.length,
|
|
276
|
+
tools: tools.map((tool) => ({
|
|
277
|
+
name: tool.name,
|
|
278
|
+
kind: toolMeta[tool.name]?.kind ?? 'write',
|
|
279
|
+
since: toolMeta[tool.name]?.since ?? '1.0.0',
|
|
280
|
+
capability: toolMeta[tool.name]?.capability ?? '',
|
|
281
|
+
})),
|
|
282
|
+
features,
|
|
283
|
+
capabilities: capabilities.map((cap) => ({
|
|
284
|
+
id: cap.id,
|
|
285
|
+
title: cap.title,
|
|
286
|
+
description: cap.description || '',
|
|
287
|
+
tags: cap.tags || [],
|
|
288
|
+
tools: cap.tools || [],
|
|
289
|
+
})),
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 生成 MCP server instructions(≤32KB)。业务只提供数据,不再手写排版。
|
|
295
|
+
*/
|
|
296
|
+
export function buildInstructions({
|
|
297
|
+
title = '',
|
|
298
|
+
intro = '',
|
|
299
|
+
startup = [],
|
|
300
|
+
capabilities = [],
|
|
301
|
+
tools = [],
|
|
302
|
+
rules = [],
|
|
303
|
+
output = [],
|
|
304
|
+
} = {}) {
|
|
305
|
+
const rows = capabilities.length
|
|
306
|
+
? capabilities.map((cap) => `| ${cap.title} | ${cap.tools.map((name) => `\`${name}\``).join(', ')} | ${cap.description || ''} |`)
|
|
307
|
+
: [{
|
|
308
|
+
title: '工具',
|
|
309
|
+
tools: tools.map((tool) => tool.name),
|
|
310
|
+
description: '',
|
|
311
|
+
}].map((cap) => `| ${cap.title} | ${cap.tools.map((name) => `\`${name}\``).join(', ')} | |`)
|
|
312
|
+
|
|
313
|
+
const lines = []
|
|
314
|
+
if (title) lines.push(`# ${title}`, '')
|
|
315
|
+
if (intro) lines.push(intro, '')
|
|
316
|
+
if (startup.length) {
|
|
317
|
+
lines.push('## 启动检查')
|
|
318
|
+
startup.forEach((line, index) => lines.push(`${index + 1}. ${line}`))
|
|
319
|
+
lines.push('')
|
|
320
|
+
}
|
|
321
|
+
lines.push('## 能力面', '| 能力 | 工具 | 用途 |', '|---|---|---|', ...rows, '')
|
|
322
|
+
if (rules.length) {
|
|
323
|
+
lines.push('## 硬规则')
|
|
324
|
+
rules.forEach((line) => lines.push(`- ${line}`))
|
|
325
|
+
lines.push('')
|
|
326
|
+
}
|
|
327
|
+
if (output.length) {
|
|
328
|
+
lines.push('## 输出')
|
|
329
|
+
output.forEach((line) => lines.push(`- ${line}`))
|
|
330
|
+
}
|
|
331
|
+
return lines.join('\n')
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* 把能力注册表直接注册到 DSH 的 ctx.tools(同进程原生工具面)。
|
|
336
|
+
* 注册后不再需要单独的 loopback /mcp 端口和 @deepseek-ai/dsh-mcp-client row。
|
|
337
|
+
*
|
|
338
|
+
* `execute(args, exec)` 的第二个参数是 DSH 的调用上下文,`exec.agent.session.id`
|
|
339
|
+
* 是「哪个会话调用了这个工具」——多会话工作台要靠它把写入落到调用者的那份文档上。
|
|
340
|
+
* 以前这里写成 `(args) => impl(args)`,把它丢了,于是工具只能退化成"猜用户在看哪个窗口"。
|
|
341
|
+
*
|
|
342
|
+
* @param {object} ctx DSH cordis context
|
|
343
|
+
* @param {object} registry createRegistry() 的返回值
|
|
344
|
+
* @param {{ namespace?: string }} options
|
|
345
|
+
* @returns {() => void} 反注册全部工具
|
|
346
|
+
*/
|
|
347
|
+
export function registerWithDsh(ctx, registry, { namespace = '' } = {}) {
|
|
348
|
+
if (!ctx?.tools?.register) throw new Error('registerWithDsh: 当前 DSH 没有 ctx.tools.register')
|
|
349
|
+
const disposers = []
|
|
350
|
+
try {
|
|
351
|
+
for (const tool of registry?.TOOLS || []) {
|
|
352
|
+
const impl = registry.TOOL_IMPL?.[tool.name]
|
|
353
|
+
if (typeof impl !== 'function') throw new Error(`registerWithDsh: 工具缺少实现 ${tool.name}`)
|
|
354
|
+
const name = namespace ? `${namespace}_${tool.name}` : tool.name
|
|
355
|
+
disposers.push(ctx.tools.register({
|
|
356
|
+
name,
|
|
357
|
+
description: tool.description || '',
|
|
358
|
+
parameters: tool.inputSchema || { type: 'object', properties: {}, additionalProperties: false },
|
|
359
|
+
output: {
|
|
360
|
+
/* execute 恒返回归一化 {content:[...]} object,故此 object schema 恒满足,
|
|
361
|
+
* 不再与 string/{text}/undefined 返回冲突(B 轴 P0-2)。 */
|
|
362
|
+
schema: { type: 'object', additionalProperties: true },
|
|
363
|
+
render: (args, value) => (value && Array.isArray(value.content)
|
|
364
|
+
? value.content
|
|
365
|
+
: normalizeToolResult(value).content),
|
|
366
|
+
},
|
|
367
|
+
execute: async (args, exec) => {
|
|
368
|
+
const normalized = normalizeToolResult(await impl(args, exec))
|
|
369
|
+
/* DSH 原生面成功恒 isError:false,失败必须 throw 才走错误路径(B 轴 P0-1)。
|
|
370
|
+
* 把工具自报的 isError:true 转成 throw,与 MCP 面的失败语义对齐。 */
|
|
371
|
+
if (normalized.isError === true) {
|
|
372
|
+
throw new Error(resultText(normalized) || `工具 ${name} 执行失败`)
|
|
373
|
+
}
|
|
374
|
+
return normalized
|
|
375
|
+
},
|
|
376
|
+
}))
|
|
377
|
+
}
|
|
378
|
+
} catch (error) {
|
|
379
|
+
/* 全有或全无:任一工具注册失败,逆序释放已注册的,避免部分注册泄漏(B 轴 P0-6)。 */
|
|
380
|
+
for (let i = disposers.length - 1; i >= 0; i--) {
|
|
381
|
+
try { disposers[i]() } catch { /* 忽略释放失败 */ }
|
|
382
|
+
}
|
|
383
|
+
throw error
|
|
384
|
+
}
|
|
385
|
+
return () => {
|
|
386
|
+
for (const dispose of disposers) {
|
|
387
|
+
try { dispose() } catch { /* 忽略重复释放 */ }
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export function createToolHost(config = {}) {
|
|
393
|
+
// 跨套件能力发现注册表(互联标准 §A.4/§E)。深度校验器可选注入(suite-kit)。
|
|
394
|
+
const descriptors = createDescriptorRegistry({ validate: config.validateDescriptor })
|
|
395
|
+
return {
|
|
396
|
+
api: createServiceApi('toolHost', '1.1.0', ['dsl', 'registry', 'validate', 'contract', 'mcp', 'instructions', 'native-tools', 'descriptors']),
|
|
397
|
+
version: '0.2.0',
|
|
398
|
+
defineTool,
|
|
399
|
+
defineCapability,
|
|
400
|
+
createRegistry: (capabilities, options = {}) => createRegistry(capabilities, { ...config, ...options }),
|
|
401
|
+
createMcpHandler,
|
|
402
|
+
createToolDispatcher,
|
|
403
|
+
createCapabilityReport,
|
|
404
|
+
buildInstructions,
|
|
405
|
+
registerWithDsh,
|
|
406
|
+
validateToolArguments,
|
|
407
|
+
// 能力描述符注册/发现(编排器按类型动态发现,套件零互依赖)。
|
|
408
|
+
registerCapabilityDescriptor: (descriptor, options) => descriptors.register(descriptor, options),
|
|
409
|
+
unregisterCapabilityDescriptor: (name) => descriptors.unregister(name),
|
|
410
|
+
discoverCapabilities: (query) => descriptors.discover(query),
|
|
411
|
+
capabilityCatalog: () => descriptors.catalog(),
|
|
412
|
+
listSurfaces: () => descriptors.listSurfaces(),
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export { validateToolArguments }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capyclaw/browser-suite",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.37",
|
|
4
|
+
"description": "浏览器操控宿主内嵌工作台(挂在 dsh 的 /capyclaw/browser,路由与端口由基建决定;Playwright 引擎、有头可见、登录态持久化)+ 3 个独立 skill 包 + 服务中间件(broker);公共基建(os / toolHost / serviceHost / assets / serviceBroker)由 @capyclaw/core 统一提供,需同一 profile 启用它。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.mjs",
|
|
7
7
|
"exports": {
|
|
@@ -16,15 +16,18 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@capyclaw/
|
|
20
|
-
"@capyclaw/
|
|
21
|
-
"@capyclaw/
|
|
22
|
-
"@capyclaw/
|
|
23
|
-
"@capyclaw/
|
|
24
|
-
"@capyclaw/
|
|
25
|
-
"@capyclaw/
|
|
26
|
-
"@capyclaw/
|
|
27
|
-
"@capyclaw/
|
|
19
|
+
"@capyclaw/asset-service": "^0.1.4",
|
|
20
|
+
"@capyclaw/browser-skill-api": "^0.2.4",
|
|
21
|
+
"@capyclaw/browser-skill-browser": "^0.2.4",
|
|
22
|
+
"@capyclaw/browser-skill-ops": "^0.2.4",
|
|
23
|
+
"@capyclaw/browser-workbench": "^0.1.18",
|
|
24
|
+
"@capyclaw/document-workbench": "^0.2.2",
|
|
25
|
+
"@capyclaw/foundation": "^0.1.9",
|
|
26
|
+
"@capyclaw/plugin-kit": "^0.2.6",
|
|
27
|
+
"@capyclaw/service-broker": "^0.2.25",
|
|
28
|
+
"@capyclaw/service-host": "^0.1.5",
|
|
29
|
+
"@capyclaw/tool-host": "^0.2.0",
|
|
30
|
+
"playwright": "^1.64.1"
|
|
28
31
|
},
|
|
29
32
|
"dsh": {
|
|
30
33
|
"bundle": {
|
|
@@ -36,7 +39,7 @@
|
|
|
36
39
|
},
|
|
37
40
|
"meta": {
|
|
38
41
|
"title": "浏览器操控工作台套件",
|
|
39
|
-
"description": "
|
|
42
|
+
"description": "浏览器操控宿主内嵌工作台(挂在 dsh 的 /capyclaw/browser,路由与端口由基建决定;Playwright 引擎、有头可见、登录态持久化)+ 3 个独立 skill 包 + 服务中间件(broker);公共基建(os / toolHost / serviceHost / assets / serviceBroker)由 @capyclaw/core 统一提供,需同一 profile 启用它。"
|
|
40
43
|
},
|
|
41
44
|
"files": [
|
|
42
45
|
"lib/",
|
|
@@ -57,10 +60,24 @@
|
|
|
57
60
|
"repository": {
|
|
58
61
|
"type": "git",
|
|
59
62
|
"url": "git+https://github.com/Maple496/capyclaw.git",
|
|
60
|
-
"directory": "
|
|
63
|
+
"directory": "A/projects/browser/artifacts/plugin/capyclaw-browser-suite"
|
|
61
64
|
},
|
|
62
65
|
"bugs": {
|
|
63
66
|
"url": "https://github.com/Maple496/capyclaw/issues"
|
|
64
67
|
},
|
|
65
|
-
"homepage": "https://github.com/capyclaw/
|
|
68
|
+
"homepage": "https://github.com/Maple496/capyclaw/tree/main/A/projects/browser/artifacts/plugin/capyclaw-browser-suite#readme",
|
|
69
|
+
"bundledDependencies": [
|
|
70
|
+
"@capyclaw/asset-service",
|
|
71
|
+
"@capyclaw/browser-skill-api",
|
|
72
|
+
"@capyclaw/browser-skill-browser",
|
|
73
|
+
"@capyclaw/browser-skill-ops",
|
|
74
|
+
"@capyclaw/browser-workbench",
|
|
75
|
+
"@capyclaw/document-workbench",
|
|
76
|
+
"@capyclaw/foundation",
|
|
77
|
+
"@capyclaw/plugin-kit",
|
|
78
|
+
"@capyclaw/portal",
|
|
79
|
+
"@capyclaw/service-broker",
|
|
80
|
+
"@capyclaw/service-host",
|
|
81
|
+
"@capyclaw/tool-host"
|
|
82
|
+
]
|
|
66
83
|
}
|
package/services.json
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"services": [
|
|
3
|
-
{
|
|
4
|
-
"id": "browser-workbench",
|
|
5
|
-
"portFrom": "content",
|
|
6
|
-
"dirFrom": "contentState",
|
|
7
|
-
"cmd": [
|
|
8
|
-
"node",
|
|
9
|
-
"${PACKAGE_DIR}/node_modules/@capyclaw/browser-workbench/server/relay.mjs",
|
|
10
|
-
"--port",
|
|
11
|
-
"${PORT}",
|
|
12
|
-
"--dir",
|
|
13
|
-
"${PACKAGE_DIR}/.host"
|
|
14
|
-
],
|
|
15
|
-
"ports": {
|
|
16
|
-
"main": 39315
|
|
17
|
-
},
|
|
18
|
-
"url": "http://127.0.0.1:${PORT}",
|
|
19
|
-
"keepAlive": true,
|
|
20
|
-
"healthPath": "/healthz"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
2
|
+
"services": []
|
|
23
3
|
}
|