@capyclaw/ppt-suite 2.4.10 → 2.5.68
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 +45 -42
- package/composition.lock.json +46 -70
- package/contract/ppt-contract.json +310 -11
- package/cordis.patch.yml +5 -25
- package/dsh-suite.json +108 -194
- 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/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/editor-host/README.md +37 -0
- package/node_modules/@capyclaw/editor-host/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/editor-host/dsh-suite.json +29 -0
- package/node_modules/@capyclaw/editor-host/lib/host.mjs +14 -0
- package/node_modules/@capyclaw/editor-host/package.json +59 -0
- package/node_modules/@capyclaw/editor-host/src/index.mjs +164 -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/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/ppt-editor/LICENSE +661 -0
- package/node_modules/@capyclaw/ppt-editor/README.md +86 -0
- package/node_modules/@capyclaw/ppt-editor/THIRD_PARTY_NOTICES.md +21 -0
- package/node_modules/@capyclaw/ppt-editor/app.js +6298 -0
- package/node_modules/@capyclaw/ppt-editor/contract/ppt-contract.json +1828 -0
- package/node_modules/@capyclaw/ppt-editor/heartbeat-worker.js +129 -0
- package/node_modules/@capyclaw/ppt-editor/index.html +176 -0
- package/node_modules/@capyclaw/ppt-editor/lib/index.mjs +8 -0
- package/node_modules/@capyclaw/ppt-editor/package.json +57 -0
- package/node_modules/@capyclaw/ppt-editor/ppt-full-app.js +381 -0
- package/node_modules/@capyclaw/ppt-skill-api/README.md +3 -0
- package/node_modules/@capyclaw/ppt-skill-api/contract/ppt-contract.json +1828 -0
- package/node_modules/@capyclaw/ppt-skill-api/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/ppt-skill-api/package.json +49 -0
- package/node_modules/@capyclaw/ppt-skill-api/plugin.mjs +15 -0
- package/node_modules/@capyclaw/ppt-skill-api/skills/pptist-api/SKILL.md +137 -0
- package/node_modules/@capyclaw/ppt-skill-api/skills/pptist-api/references/tool-contract.md +1646 -0
- package/node_modules/@capyclaw/ppt-skill-api/skills/pptist-api/references/visual-qa.md +28 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/README.md +3 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/contract/ppt-contract.json +1828 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/package.json +49 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/plugin.mjs +15 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/SKILL.md +83 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/anti-ai-slop.md +18 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/deck-structure.md +42 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/design-tokens.md +36 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/layout-system.md +30 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/page-craft.md +31 -0
- package/node_modules/@capyclaw/ppt-skill-proposal/skills/pptmaster-proposal/references/scqa-pyramid.md +26 -0
- package/node_modules/@capyclaw/ppt-workbench/LICENSE +661 -0
- package/node_modules/@capyclaw/ppt-workbench/README.md +173 -0
- package/node_modules/@capyclaw/ppt-workbench/THIRD_PARTY_NOTICES.md +21 -0
- package/node_modules/@capyclaw/ppt-workbench/contract/ppt-contract.json +1828 -0
- package/node_modules/@capyclaw/ppt-workbench/core/audit.js +507 -0
- package/node_modules/@capyclaw/ppt-workbench/core/chart.js +199 -0
- package/node_modules/@capyclaw/ppt-workbench/core/color.js +170 -0
- package/node_modules/@capyclaw/ppt-workbench/core/deck-layout.js +375 -0
- package/node_modules/@capyclaw/ppt-workbench/core/formula.js +80 -0
- package/node_modules/@capyclaw/ppt-workbench/core/hfmath/hershey.js +1763 -0
- package/node_modules/@capyclaw/ppt-workbench/core/hfmath/index.js +1176 -0
- package/node_modules/@capyclaw/ppt-workbench/core/hfmath/stretch.js +41 -0
- package/node_modules/@capyclaw/ppt-workbench/core/hfmath/symbols.js +408 -0
- package/node_modules/@capyclaw/ppt-workbench/core/inspect.js +366 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/compare.mjs +103 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/compile.mjs +322 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/edit.mjs +239 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/parse.mjs +346 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/render-html.mjs +84 -0
- package/node_modules/@capyclaw/ppt-workbench/core/manuscript/sync.mjs +101 -0
- package/node_modules/@capyclaw/ppt-workbench/core/measure.js +104 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/browser.js +28 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/chart.js +64 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/deck.js +21 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/element.js +55 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/history.js +11 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/import.js +95 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/index.js +39 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/playback.js +9 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/recolor.js +87 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/slide.js +66 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/table.js +85 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/text.js +35 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops/view.js +13 -0
- package/node_modules/@capyclaw/ppt-workbench/core/ops.js +12 -0
- package/node_modules/@capyclaw/ppt-workbench/core/quick.js +52 -0
- package/node_modules/@capyclaw/ppt-workbench/core/shape-library.js +122 -0
- package/node_modules/@capyclaw/ppt-workbench/core/table.js +178 -0
- package/node_modules/@capyclaw/ppt-workbench/core/text.js +200 -0
- package/node_modules/@capyclaw/ppt-workbench/lib/host.mjs +1 -0
- package/node_modules/@capyclaw/ppt-workbench/package.json +73 -0
- package/node_modules/@capyclaw/ppt-workbench/plugin.mjs +1 -0
- package/node_modules/@capyclaw/ppt-workbench/server/audit.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/bridge-client.mjs +308 -0
- package/node_modules/@capyclaw/ppt-workbench/server/constants.mjs +21 -0
- package/node_modules/@capyclaw/ppt-workbench/server/contract-snapshots.mjs +89 -0
- package/node_modules/@capyclaw/ppt-workbench/server/contract.mjs +24 -0
- package/node_modules/@capyclaw/ppt-workbench/server/deck-layout.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/editor-assets.mjs +132 -0
- package/node_modules/@capyclaw/ppt-workbench/server/embedded-host.mjs +252 -0
- package/node_modules/@capyclaw/ppt-workbench/server/http-utils.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/http.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/runtime/context.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/store/blob-store.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/tuning.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/util/fs-lock.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/infra/workspace/manager.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/mcp/dispatch.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/mcp/handler.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/mcp/instructions.mjs +66 -0
- package/node_modules/@capyclaw/ppt-workbench/server/ppt-shim.mjs +168 -0
- package/node_modules/@capyclaw/ppt-workbench/server/relay.mjs +282 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/assets.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/bridge.mjs +74 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/editor.mjs +9 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/import.mjs +260 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/manuscript.mjs +414 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/mcp.mjs +17 -0
- package/node_modules/@capyclaw/ppt-workbench/server/routes/session.mjs +36 -0
- package/node_modules/@capyclaw/ppt-workbench/server/runtime/recovery.mjs +9 -0
- package/node_modules/@capyclaw/ppt-workbench/server/runtime/watch.mjs +17 -0
- package/node_modules/@capyclaw/ppt-workbench/server/session-context.mjs +5 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/SHARED_MANIFEST.json +70 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/asset-service.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/editor-host.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/editor/lease.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/service/api.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/service/http.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/service/mcp-http.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/tools/validate.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/tuning.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/kit/util/fs-lock.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/service-host.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/tool-host.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/shared/tuning.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/backends/file-backend.mjs +13 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/checkpoints.mjs +28 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/deck-sanitize.mjs +68 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/doc.mjs +56 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/index.mjs +34 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/journal.mjs +9 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/lease.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/sanitize.mjs +33 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/sessions.mjs +314 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/apply.mjs +33 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/audit.mjs +28 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/chart.mjs +83 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/compose.mjs +97 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/contract.mjs +38 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/deck.mjs +27 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/element.mjs +67 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/export.mjs +99 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/formula.mjs +72 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/history.mjs +29 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/image.mjs +174 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/imagesearch.mjs +203 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/import.mjs +180 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/index.mjs +64 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/inspect.mjs +46 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/line.mjs +58 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/manuscript.mjs +208 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/notes.mjs +33 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/present.mjs +34 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/recolor.mjs +62 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/screenshot.mjs +191 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/shape.mjs +64 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/slide.mjs +81 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/style.mjs +48 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/table.mjs +127 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/task.mjs +52 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/capabilities/text.mjs +82 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/color.mjs +4 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/image.mjs +78 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/index.mjs +7 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/manuscript-media.mjs +159 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/offline-render.mjs +256 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/pptx-export.mjs +577 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/recolor.mjs +25 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/remote-image.mjs +443 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/slide.mjs +21 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/text-style.mjs +11 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/domains/tooling.mjs +13 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/index.mjs +14 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/kernel/define.mjs +5 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/kernel/ports.mjs +52 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/kernel/registry.mjs +17 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools/model/deck-schema.mjs +105 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tools.mjs +18 -0
- package/node_modules/@capyclaw/ppt-workbench/server/tuning.mjs +93 -0
- package/node_modules/@capyclaw/ppt-workbench/server/validate.mjs +2 -0
- package/node_modules/@capyclaw/ppt-workbench/server/workbench-framework.mjs +305 -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 +275 -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/skills-service/README.md +31 -0
- package/node_modules/@capyclaw/skills-service/package.json +30 -0
- package/node_modules/@capyclaw/skills-service/server.mjs +237 -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/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +1005 -0
- package/node_modules/@types/node/async_hooks.d.ts +586 -0
- package/node_modules/@types/node/buffer.buffer.d.ts +457 -0
- package/node_modules/@types/node/buffer.d.ts +1901 -0
- package/node_modules/@types/node/child_process.d.ts +1453 -0
- package/node_modules/@types/node/cluster.d.ts +578 -0
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +452 -0
- package/node_modules/@types/node/constants.d.ts +21 -0
- package/node_modules/@types/node/crypto.d.ts +4504 -0
- package/node_modules/@types/node/dgram.d.ts +596 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +551 -0
- package/node_modules/@types/node/dns/promises.d.ts +477 -0
- package/node_modules/@types/node/dns.d.ts +860 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +863 -0
- package/node_modules/@types/node/fs/promises.d.ts +1208 -0
- package/node_modules/@types/node/fs.d.ts +4332 -0
- package/node_modules/@types/node/globals.d.ts +170 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +21 -0
- package/node_modules/@types/node/http.d.ts +1919 -0
- package/node_modules/@types/node/http2.d.ts +2580 -0
- package/node_modules/@types/node/https.d.ts +549 -0
- package/node_modules/@types/node/index.d.ts +92 -0
- package/node_modules/@types/node/inspector.generated.d.ts +2775 -0
- package/node_modules/@types/node/module.d.ts +503 -0
- package/node_modules/@types/node/net.d.ts +924 -0
- package/node_modules/@types/node/os.d.ts +480 -0
- package/node_modules/@types/node/package.json +145 -0
- package/node_modules/@types/node/path.d.ts +191 -0
- package/node_modules/@types/node/perf_hooks.d.ts +860 -0
- package/node_modules/@types/node/process.d.ts +1632 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +140 -0
- package/node_modules/@types/node/readline/promises.d.ts +154 -0
- package/node_modules/@types/node/readline.d.ts +715 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +527 -0
- package/node_modules/@types/node/stream.d.ts +1680 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +1208 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +286 -0
- package/node_modules/@types/node/tls.d.ts +1204 -0
- package/node_modules/@types/node/trace_events.d.ts +171 -0
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +455 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +92 -0
- package/node_modules/@types/node/tty.d.ts +206 -0
- package/node_modules/@types/node/url.d.ts +957 -0
- package/node_modules/@types/node/util.d.ts +2083 -0
- package/node_modules/@types/node/v8.d.ts +753 -0
- package/node_modules/@types/node/vm.d.ts +704 -0
- package/node_modules/@types/node/wasi.d.ts +160 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +81 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +38 -0
- package/node_modules/@types/node/worker_threads.d.ts +698 -0
- package/node_modules/@types/node/zlib.d.ts +517 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/https/package.json +15 -0
- package/node_modules/image-size/LICENSE +9 -0
- package/node_modules/image-size/Readme.md +184 -0
- package/node_modules/image-size/bin/image-size.js +53 -0
- package/node_modules/image-size/dist/detector.d.ts +2 -0
- package/node_modules/image-size/dist/detector.js +30 -0
- package/node_modules/image-size/dist/index.d.ts +10 -0
- package/node_modules/image-size/dist/index.js +129 -0
- package/node_modules/image-size/dist/types/bmp.d.ts +2 -0
- package/node_modules/image-size/dist/types/bmp.js +11 -0
- package/node_modules/image-size/dist/types/cur.d.ts +2 -0
- package/node_modules/image-size/dist/types/cur.js +17 -0
- package/node_modules/image-size/dist/types/dds.d.ts +2 -0
- package/node_modules/image-size/dist/types/dds.js +11 -0
- package/node_modules/image-size/dist/types/gif.d.ts +2 -0
- package/node_modules/image-size/dist/types/gif.js +12 -0
- package/node_modules/image-size/dist/types/heif.d.ts +2 -0
- package/node_modules/image-size/dist/types/heif.js +40 -0
- package/node_modules/image-size/dist/types/icns.d.ts +2 -0
- package/node_modules/image-size/dist/types/icns.js +101 -0
- package/node_modules/image-size/dist/types/ico.d.ts +2 -0
- package/node_modules/image-size/dist/types/ico.js +68 -0
- package/node_modules/image-size/dist/types/index.d.ts +23 -0
- package/node_modules/image-size/dist/types/index.js +46 -0
- package/node_modules/image-size/dist/types/interface.d.ts +13 -0
- package/node_modules/image-size/dist/types/interface.js +2 -0
- package/node_modules/image-size/dist/types/j2c.d.ts +2 -0
- package/node_modules/image-size/dist/types/j2c.js +12 -0
- package/node_modules/image-size/dist/types/jp2.d.ts +2 -0
- package/node_modules/image-size/dist/types/jp2.js +27 -0
- package/node_modules/image-size/dist/types/jpg.d.ts +2 -0
- package/node_modules/image-size/dist/types/jpg.js +123 -0
- package/node_modules/image-size/dist/types/jxl-stream.d.ts +2 -0
- package/node_modules/image-size/dist/types/jxl-stream.js +45 -0
- package/node_modules/image-size/dist/types/jxl.d.ts +2 -0
- package/node_modules/image-size/dist/types/jxl.js +59 -0
- package/node_modules/image-size/dist/types/ktx.d.ts +2 -0
- package/node_modules/image-size/dist/types/ktx.js +19 -0
- package/node_modules/image-size/dist/types/png.d.ts +2 -0
- package/node_modules/image-size/dist/types/png.js +35 -0
- package/node_modules/image-size/dist/types/pnm.d.ts +2 -0
- package/node_modules/image-size/dist/types/pnm.js +72 -0
- package/node_modules/image-size/dist/types/psd.d.ts +2 -0
- package/node_modules/image-size/dist/types/psd.js +11 -0
- package/node_modules/image-size/dist/types/svg.d.ts +2 -0
- package/node_modules/image-size/dist/types/svg.js +90 -0
- package/node_modules/image-size/dist/types/tga.d.ts +2 -0
- package/node_modules/image-size/dist/types/tga.js +15 -0
- package/node_modules/image-size/dist/types/tiff.d.ts +2 -0
- package/node_modules/image-size/dist/types/tiff.js +95 -0
- package/node_modules/image-size/dist/types/utils.d.ts +15 -0
- package/node_modules/image-size/dist/types/utils.js +75 -0
- package/node_modules/image-size/dist/types/webp.d.ts +2 -0
- package/node_modules/image-size/dist/types/webp.js +60 -0
- package/node_modules/image-size/dist/utils/bit-reader.d.ts +10 -0
- package/node_modules/image-size/dist/utils/bit-reader.js +44 -0
- package/node_modules/image-size/package.json +81 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/CHANGES.md +210 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/dist/jszip.js +11586 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/index.d.ts +344 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +510 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/pptxgenjs/LICENSE +21 -0
- package/node_modules/pptxgenjs/README.md +284 -0
- package/node_modules/pptxgenjs/dist/pptxgen.bundle.js +3 -0
- package/node_modules/pptxgenjs/dist/pptxgen.bundle.js.map +1 -0
- package/node_modules/pptxgenjs/dist/pptxgen.cjs.js +7445 -0
- package/node_modules/pptxgenjs/dist/pptxgen.es.js +7439 -0
- package/node_modules/pptxgenjs/dist/pptxgen.min.js +3 -0
- package/node_modules/pptxgenjs/dist/pptxgen.min.js.map +1 -0
- package/node_modules/pptxgenjs/package.json +89 -0
- package/node_modules/pptxgenjs/types/index.d.ts +2670 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/queue/LICENSE +8 -0
- package/node_modules/queue/index.d.ts +173 -0
- package/node_modules/queue/index.js +195 -0
- package/node_modules/queue/package.json +43 -0
- package/node_modules/queue/readme.md +221 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +18 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +97 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
- package/node_modules/undici-types/dispatcher.d.ts +241 -0
- package/node_modules/undici-types/errors.d.ts +128 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +9 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +63 -0
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +71 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +28 -0
- package/node_modules/undici-types/proxy-agent.d.ts +30 -0
- package/node_modules/undici-types/readable.d.ts +61 -0
- package/node_modules/undici-types/webidl.d.ts +220 -0
- package/node_modules/undici-types/websocket.d.ts +131 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/package.json +54 -21
- package/services.json +1 -20
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件描述符:应用插件唯一需要写的东西。
|
|
3
|
+
*
|
|
4
|
+
* import { createPlugin, skillProvider } from '@capyclaw/foundation/abi'
|
|
5
|
+
*
|
|
6
|
+
* export const { name, inject, apply } = createPlugin({
|
|
7
|
+
* name: 'canvas',
|
|
8
|
+
* requires: ['canvas.runtime@^1'],
|
|
9
|
+
* implements: [skillProvider({ skill: './skills/canvas' })],
|
|
10
|
+
* }, import.meta.url)
|
|
11
|
+
*
|
|
12
|
+
* 设计要点:
|
|
13
|
+
* - 构建器在模块加载期就校验 schema,坏描述符不会活到 activate;
|
|
14
|
+
* - 描述符是纯数据 + 函数,不 import 内核、不持有 ctx;
|
|
15
|
+
* - createPlugin 产出的是普通 Cordis 插件形状(name/inject/apply),
|
|
16
|
+
* 装配细节全部收回内核的 mount。
|
|
17
|
+
*/
|
|
18
|
+
import { ABI_MAJOR, getInterfaceKind } from './kinds.mjs'
|
|
19
|
+
import { validateSchema } from './schema.mjs'
|
|
20
|
+
import { validateInterface } from './validate.mjs'
|
|
21
|
+
import { AbiError, ERROR_CODES, toAbiError } from './errors.mjs'
|
|
22
|
+
|
|
23
|
+
const PLUGIN_NAME_RE = /^[a-z0-9][a-z0-9-]*$/
|
|
24
|
+
const CAPABILITY_NAME_RE = /^[a-zA-Z][a-zA-Z0-9]*(?:[.-][a-zA-Z0-9*]+)*$/
|
|
25
|
+
const RANGE_RE = /^(?:\^|~|>=|<=|>|<|=)?[0-9x*][0-9A-Za-z.*-]*$/
|
|
26
|
+
|
|
27
|
+
const KINDS = Object.freeze({
|
|
28
|
+
'skill-provider': 'skill-provider@1',
|
|
29
|
+
'tool-provider': 'tool-provider@1',
|
|
30
|
+
'runtime-driver': 'runtime-driver@1',
|
|
31
|
+
'http-router': 'http-router@1',
|
|
32
|
+
'ui-panel': 'ui-panel@1',
|
|
33
|
+
'lifecycle-hook': 'lifecycle-hook@1',
|
|
34
|
+
'host-event': 'host-event@1',
|
|
35
|
+
'client-panel': 'client-panel@1',
|
|
36
|
+
'own-server': 'own-server@1',
|
|
37
|
+
'service-provider': 'service-provider@1',
|
|
38
|
+
raw: 'raw@1',
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 校验并冻结一个接口描述符。
|
|
43
|
+
* @param {string} kind
|
|
44
|
+
* @param {object} options
|
|
45
|
+
*/
|
|
46
|
+
export function defineInterface(kind, options) {
|
|
47
|
+
const definition = getInterfaceKind(kind)
|
|
48
|
+
if (!definition) {
|
|
49
|
+
throw new AbiError(ERROR_CODES.E_KIND_UNKNOWN, `未知接口种类 ${kind}`, {
|
|
50
|
+
kind,
|
|
51
|
+
known: Object.keys(KINDS).map((key) => KINDS[key]),
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
if (options === null || typeof options !== 'object' || Array.isArray(options)) {
|
|
55
|
+
throw new AbiError(ERROR_CODES.E_SCHEMA, `${kind} 的描述符必须是对象`, { kind })
|
|
56
|
+
}
|
|
57
|
+
const errors = validateSchema(options, definition.schema)
|
|
58
|
+
definition.extra?.(options, errors)
|
|
59
|
+
if (errors.length) {
|
|
60
|
+
throw new AbiError(ERROR_CODES.E_SCHEMA, `${kind} 描述符非法:${errors.join(';')}`, { kind, errors })
|
|
61
|
+
}
|
|
62
|
+
return Object.freeze({ kind, ...options })
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ------------------------------------------------------------------------- */
|
|
66
|
+
/* 六个接口构建器 + 逃生舱 */
|
|
67
|
+
/* ------------------------------------------------------------------------- */
|
|
68
|
+
|
|
69
|
+
export const skillProvider = (options) => defineInterface(KINDS['skill-provider'], options)
|
|
70
|
+
export const toolProvider = (options) => defineInterface(KINDS['tool-provider'], options)
|
|
71
|
+
export const runtimeDriver = (options) => defineInterface(KINDS['runtime-driver'], options)
|
|
72
|
+
export const httpRouter = (options) => defineInterface(KINDS['http-router'], options)
|
|
73
|
+
export const uiPanel = (options) => defineInterface(KINDS['ui-panel'], options)
|
|
74
|
+
export const lifecycleHook = (options) => defineInterface(KINDS['lifecycle-hook'], options)
|
|
75
|
+
export const hostEvent = (options) => defineInterface(KINDS['host-event'], options)
|
|
76
|
+
export const clientPanel = (options) => defineInterface(KINDS['client-panel'], options)
|
|
77
|
+
export const ownServer = (options) => defineInterface(KINDS['own-server'], options)
|
|
78
|
+
export const serviceProvider = (options) => defineInterface(KINDS['service-provider'], options)
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 驱动层统一入口:基建插件用 defineDriver 声明「我提供哪个 ctx 服务」。
|
|
82
|
+
*
|
|
83
|
+
* 与 createPlugin 的关键区别:不 inject os。驱动必须能在 foundation 之前/之后
|
|
84
|
+
* 独立激活,否则 foundation 的 os.net/os.tools/os.proc 会失去服务来源。
|
|
85
|
+
* apply 仍拿到原生 Cordis ctx,因为提供 ctx.provide 是驱动层的职责。
|
|
86
|
+
*/
|
|
87
|
+
export function defineDriver(options = {}) {
|
|
88
|
+
const { name, service, inject = [], apply } = options
|
|
89
|
+
if (!PLUGIN_NAME_RE.test(String(name || ''))) {
|
|
90
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `driver 名必须是 kebab-case:${name}`, { name })
|
|
91
|
+
}
|
|
92
|
+
if (typeof service !== 'string' || !service.trim()) {
|
|
93
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'driver.service 必须是非空字符串', { name, service })
|
|
94
|
+
}
|
|
95
|
+
if (!Array.isArray(inject) || inject.some((item) => typeof item !== 'string' || !item.trim())) {
|
|
96
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'driver.inject 必须是非空字符串数组', { name })
|
|
97
|
+
}
|
|
98
|
+
if (typeof apply !== 'function') {
|
|
99
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'driver.apply 必须是函数', { name, service })
|
|
100
|
+
}
|
|
101
|
+
return Object.freeze({
|
|
102
|
+
name,
|
|
103
|
+
inject: Object.freeze([...inject]),
|
|
104
|
+
apply,
|
|
105
|
+
driver: Object.freeze({ service }),
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** 逃生舱:必须同时导出 apply,且不得与其他接口混用。 */
|
|
110
|
+
export const rawPlugin = (apply) => defineInterface(KINDS.raw, { apply })
|
|
111
|
+
|
|
112
|
+
/* ------------------------------------------------------------------------- */
|
|
113
|
+
/* 插件定义 */
|
|
114
|
+
/* ------------------------------------------------------------------------- */
|
|
115
|
+
|
|
116
|
+
function parseCapability(entry, field) {
|
|
117
|
+
if (typeof entry !== 'string' || !entry.trim()) {
|
|
118
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `${field} 的每一项必须是非空字符串`, { entry })
|
|
119
|
+
}
|
|
120
|
+
const at = entry.lastIndexOf('@')
|
|
121
|
+
if (at <= 0 || at === entry.length - 1) {
|
|
122
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `${field} 项 "${entry}" 必须写成 name@range`, { entry })
|
|
123
|
+
}
|
|
124
|
+
const name = entry.slice(0, at)
|
|
125
|
+
const range = entry.slice(at + 1)
|
|
126
|
+
if (!CAPABILITY_NAME_RE.test(name)) {
|
|
127
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `${field} 项 "${entry}" 的能力名非法`, { entry, name })
|
|
128
|
+
}
|
|
129
|
+
if (!RANGE_RE.test(range)) {
|
|
130
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `${field} 项 "${entry}" 的版本范围非法`, { entry, range })
|
|
131
|
+
}
|
|
132
|
+
return Object.freeze({ name, range, raw: entry })
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {{
|
|
137
|
+
* name: string,
|
|
138
|
+
* apiVersion?: number,
|
|
139
|
+
* description?: string,
|
|
140
|
+
* requires?: string[],
|
|
141
|
+
* provides?: string[],
|
|
142
|
+
* implements: object[]
|
|
143
|
+
* }} options
|
|
144
|
+
*/
|
|
145
|
+
export function definePlugin(options = {}) {
|
|
146
|
+
const {
|
|
147
|
+
name, apiVersion = ABI_MAJOR, description, requires = [], provides = [], inject = [], implements: impls,
|
|
148
|
+
} = options
|
|
149
|
+
|
|
150
|
+
if (!PLUGIN_NAME_RE.test(String(name || ''))) {
|
|
151
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, `插件名必须是 kebab-case:${name}`, { name })
|
|
152
|
+
}
|
|
153
|
+
if (!Number.isInteger(apiVersion) || apiVersion !== ABI_MAJOR) {
|
|
154
|
+
throw new AbiError(ERROR_CODES.E_ABI_MISMATCH,
|
|
155
|
+
`插件声明 ABI v${apiVersion},内核只支持 v${ABI_MAJOR}`, { name, apiVersion, supported: ABI_MAJOR })
|
|
156
|
+
}
|
|
157
|
+
if (!Array.isArray(impls) || impls.length === 0) {
|
|
158
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, '插件必须实现至少一个接口', { name })
|
|
159
|
+
}
|
|
160
|
+
if (description !== undefined && typeof description !== 'string') {
|
|
161
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'description 必须是字符串', { name })
|
|
162
|
+
}
|
|
163
|
+
/* 附加 Cordis inject 只给 raw@1 逃生舱使用:它需要保留原插件的宿主服务依赖。
|
|
164
|
+
* 普通描述符不接受这个字段,避免把宿主服务名泄漏进应用 ABI。 */
|
|
165
|
+
if (!Array.isArray(inject) || inject.some((item) => typeof item !== 'string' || !item.trim())) {
|
|
166
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'inject 必须是非空字符串数组', { name })
|
|
167
|
+
}
|
|
168
|
+
if (inject.length && !impls?.some((impl) => impl?.kind === 'raw@1')) {
|
|
169
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, '只有 raw@1 插件可以声明额外 inject', { name })
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
for (const impl of impls) {
|
|
173
|
+
if (!impl || typeof impl !== 'object' || typeof impl.kind !== 'string') {
|
|
174
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'implements 的每一项必须是 define* 产出的描述符', { name })
|
|
175
|
+
}
|
|
176
|
+
const { definition, errors } = validateInterface(impl)
|
|
177
|
+
if (!definition) {
|
|
178
|
+
throw new AbiError(ERROR_CODES.E_KIND_UNKNOWN, `未知接口种类 ${impl.kind}`, { name, kind: impl.kind })
|
|
179
|
+
}
|
|
180
|
+
if (errors.length) {
|
|
181
|
+
throw new AbiError(ERROR_CODES.E_SCHEMA, `${impl.kind} 描述符非法:${errors.join(';')}`, {
|
|
182
|
+
name, kind: impl.kind, errors,
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (impls.some((impl) => getInterfaceKind(impl.kind)?.exclusive) && impls.length > 1) {
|
|
188
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE, 'raw@1 不得与其他接口混用', { name })
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const requiresEntries = requires.map((entry) => parseCapability(entry, 'requires'))
|
|
192
|
+
const providesEntries = provides.map((entry) => parseCapability(entry, 'provides'))
|
|
193
|
+
for (const entry of providesEntries) {
|
|
194
|
+
if (/^[\^~<>=]/.test(entry.range)) {
|
|
195
|
+
throw new AbiError(ERROR_CODES.E_PLUGIN_SHAPE,
|
|
196
|
+
`provides 必须写精确版本,不能写范围:${entry.raw}`, { entry: entry.raw })
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return Object.freeze({
|
|
201
|
+
kind: 'plugin',
|
|
202
|
+
name,
|
|
203
|
+
apiVersion,
|
|
204
|
+
description,
|
|
205
|
+
requires: Object.freeze(requiresEntries),
|
|
206
|
+
provides: Object.freeze(providesEntries),
|
|
207
|
+
inject: Object.freeze([...inject]),
|
|
208
|
+
implements: Object.freeze([...impls]),
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ------------------------------------------------------------------------- */
|
|
213
|
+
/* Cordis 接缝 */
|
|
214
|
+
/* ------------------------------------------------------------------------- */
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* 把插件定义编译成普通 Cordis 插件:{ name, inject, apply }。
|
|
218
|
+
*
|
|
219
|
+
* apply 的返回值是 disposer(与仓内既有插件一致),内核在卸载时调用。
|
|
220
|
+
* 形状错误(schema / 能力 / 唯一性)同步抛出,让插件加载直接失败;
|
|
221
|
+
* 运行时就绪(子进程拉起等)异步进行,通过 os.report() 观测。
|
|
222
|
+
*
|
|
223
|
+
* @param {object} definition definePlugin 的结果,或直接传 definePlugin 的入参
|
|
224
|
+
* @param {string} baseUrl 插件入口的 import.meta.url,用于解析相对路径
|
|
225
|
+
*/
|
|
226
|
+
export function createPlugin(definition, baseUrl) {
|
|
227
|
+
const spec = definition?.kind === 'plugin' ? definition : definePlugin(definition)
|
|
228
|
+
|
|
229
|
+
function apply(ctx, config = {}) {
|
|
230
|
+
const os = ctx?.os
|
|
231
|
+
if (!os || typeof os.mount !== 'function') {
|
|
232
|
+
throw new AbiError(ERROR_CODES.E_KERNEL_MISSING,
|
|
233
|
+
'ctx.os 不可用:请先安装并启用 @capyclaw/core(公共基建唯一声明者),它会连同 @capyclaw/foundation 一起挂上 os 内核', { plugin: spec.name })
|
|
234
|
+
}
|
|
235
|
+
if (!baseUrl) {
|
|
236
|
+
throw new AbiError(ERROR_CODES.E_BASE_URL_MISSING,
|
|
237
|
+
'createPlugin 需要第二参数 baseUrl(传 import.meta.url)', { plugin: spec.name })
|
|
238
|
+
}
|
|
239
|
+
const handle = os.mount(spec, config, { baseUrl, ctx })
|
|
240
|
+
const dispose = () => handle.dispose()
|
|
241
|
+
// Cordis 只认 ctx.effect 登记的 disposer,apply 的返回值并不可靠:
|
|
242
|
+
// 不显式登记的话,关掉插件再启用时旧记录还占着 name,会撞 E_DUP_PLUGIN。
|
|
243
|
+
if (typeof ctx?.effect === 'function') ctx.effect(() => () => { void dispose() })
|
|
244
|
+
return dispose
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return Object.freeze({
|
|
248
|
+
name: spec.name,
|
|
249
|
+
inject: Object.freeze(['os', ...spec.inject.filter((service) => service !== 'os')]),
|
|
250
|
+
apply,
|
|
251
|
+
spec,
|
|
252
|
+
})
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export { toAbiError }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 描述符校验:把「kind 之外的全部字段」交给对应接口的 schema。
|
|
3
|
+
*
|
|
4
|
+
* 单独成模块,是因为 spec(构建期)与 loader(加载期)必须用同一套判定;
|
|
5
|
+
* 只要两处各写一遍,迟早会出现「构建能过、加载失败」或反过来。
|
|
6
|
+
*/
|
|
7
|
+
import { getInterfaceKind } from './kinds.mjs'
|
|
8
|
+
import { validateSchema } from './schema.mjs'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {object} impl 描述符(含 kind)
|
|
12
|
+
* @returns {{ definition: object|null, errors: string[] }}
|
|
13
|
+
*/
|
|
14
|
+
export function validateInterface(impl) {
|
|
15
|
+
const definition = getInterfaceKind(impl?.kind)
|
|
16
|
+
if (!definition) {
|
|
17
|
+
return { definition: null, errors: [`未知接口种类 ${impl?.kind}`] }
|
|
18
|
+
}
|
|
19
|
+
const body = { ...impl }
|
|
20
|
+
delete body.kind
|
|
21
|
+
const errors = validateSchema(body, definition.schema)
|
|
22
|
+
definition.extra?.(body, errors)
|
|
23
|
+
return { definition, errors }
|
|
24
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 版本与范围:能力声明用 `^1` / `^1.2.0` / `>=1.2` / `1.x` / 精确版本。
|
|
3
|
+
*
|
|
4
|
+
* 只实现这份 ABI 需要的语义,不引入 semver 依赖:
|
|
5
|
+
* - `^1.2.3` → >=1.2.3 且同主版本;`^0.2.3` → >=0.2.3 且同次版本(0.x 约定)
|
|
6
|
+
* - `~1.2.3` → >=1.2.3 且同次版本
|
|
7
|
+
* - `1.x` / `1.*` → 同主版本
|
|
8
|
+
* - `>=` `>` `<=` `<` `=` 前缀
|
|
9
|
+
* - 裸版本 → 精确匹配(比较时忽略末位 0)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export function parseVersion(text) {
|
|
13
|
+
if (typeof text !== 'string') return null
|
|
14
|
+
const match = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-[0-9A-Za-z.-]+)?$/.exec(text.trim())
|
|
15
|
+
if (!match) return null
|
|
16
|
+
return [Number(match[1]), Number(match[2] || 0), Number(match[3] || 0)]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function compareParts(a, b) {
|
|
20
|
+
for (let i = 0; i < 3; i++) {
|
|
21
|
+
if (a[i] !== b[i]) return a[i] < b[i] ? -1 : 1
|
|
22
|
+
}
|
|
23
|
+
return 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function compareVersions(a, b) {
|
|
27
|
+
const left = typeof a === 'string' ? parseVersion(a) : a
|
|
28
|
+
const right = typeof b === 'string' ? parseVersion(b) : b
|
|
29
|
+
if (!left || !right) return NaN
|
|
30
|
+
return compareParts(left, right)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} version 提供方版本,如 '1.2.3'
|
|
35
|
+
* @param {string} range 需求范围,如 '^1'
|
|
36
|
+
* @returns {boolean}
|
|
37
|
+
*/
|
|
38
|
+
export function satisfies(version, range) {
|
|
39
|
+
const current = parseVersion(version)
|
|
40
|
+
if (!current) return false
|
|
41
|
+
const raw = String(range ?? '').trim()
|
|
42
|
+
if (!raw || raw === '*' || raw === 'x') return true
|
|
43
|
+
|
|
44
|
+
if (raw.startsWith('^')) {
|
|
45
|
+
const base = parseVersion(raw.slice(1))
|
|
46
|
+
if (!base) return false
|
|
47
|
+
if (compareParts(current, base) < 0) return false
|
|
48
|
+
return base[0] === 0 ? current[0] === 0 && current[1] === base[1] : current[0] === base[0]
|
|
49
|
+
}
|
|
50
|
+
if (raw.startsWith('~')) {
|
|
51
|
+
const base = parseVersion(raw.slice(1))
|
|
52
|
+
if (!base) return false
|
|
53
|
+
return compareParts(current, base) >= 0 && current[0] === base[0] && current[1] === base[1]
|
|
54
|
+
}
|
|
55
|
+
if (raw.startsWith('>=')) {
|
|
56
|
+
const base = parseVersion(raw.slice(2))
|
|
57
|
+
return Boolean(base) && compareParts(current, base) >= 0
|
|
58
|
+
}
|
|
59
|
+
if (raw.startsWith('<=')) {
|
|
60
|
+
const base = parseVersion(raw.slice(2))
|
|
61
|
+
return Boolean(base) && compareParts(current, base) <= 0
|
|
62
|
+
}
|
|
63
|
+
if (raw.startsWith('>')) {
|
|
64
|
+
const base = parseVersion(raw.slice(1))
|
|
65
|
+
return Boolean(base) && compareParts(current, base) > 0
|
|
66
|
+
}
|
|
67
|
+
if (raw.startsWith('<')) {
|
|
68
|
+
const base = parseVersion(raw.slice(1))
|
|
69
|
+
return Boolean(base) && compareParts(current, base) < 0
|
|
70
|
+
}
|
|
71
|
+
if (raw.startsWith('=')) return satisfies(version, raw.slice(1))
|
|
72
|
+
|
|
73
|
+
const xRange = /^(\d+)(?:\.(\d+))?\.[x*]$/.exec(raw)
|
|
74
|
+
if (xRange) {
|
|
75
|
+
const major = Number(xRange[1])
|
|
76
|
+
const minor = xRange[2] === undefined ? null : Number(xRange[2])
|
|
77
|
+
return current[0] === major && (minor === null || current[1] === minor)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const exact = parseVersion(raw)
|
|
81
|
+
return Boolean(exact) && compareParts(current, exact) === 0
|
|
82
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy plugin-kit compatibility exports. Includes Node resource helpers and
|
|
3
|
+
* dsh runtime-context conventions; importing this entry is not a portability proof.
|
|
4
|
+
* Preserve existing exports; new applications should prefer the descriptor ABI.
|
|
5
|
+
*/
|
|
6
|
+
export * from '@capyclaw/plugin-kit'
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* client-panel@1 适配器:页面开机全局变量 + 可选静态面板。
|
|
3
|
+
*
|
|
4
|
+
* - bootGlobals 必须是同步函数;异步准备放在 prepare(start 阶段)里,
|
|
5
|
+
* 结果通过 state 传给 bootGlobals,避免事件发射器无法 await 的竞态。
|
|
6
|
+
* - 静态 root 与 ui-panel 共用 editorHost + serviceHost 共享前缀。
|
|
7
|
+
*/
|
|
8
|
+
import { fileURLToPath } from 'node:url'
|
|
9
|
+
|
|
10
|
+
import { AbiError, ERROR_CODES } from '../../abi/errors.mjs'
|
|
11
|
+
|
|
12
|
+
export const kind = 'client-panel@1'
|
|
13
|
+
|
|
14
|
+
export function createClientPanelAdapter({ host, net, log }) {
|
|
15
|
+
return {
|
|
16
|
+
kind,
|
|
17
|
+
compile(impl, { spec, config, context }) {
|
|
18
|
+
const ctx = context?.ctx
|
|
19
|
+
if (typeof ctx?.on !== 'function') {
|
|
20
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
21
|
+
'client-panel@1 需要支持 ctx.on 的 Cordis 宿主', { plugin: spec.name })
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let unmount
|
|
25
|
+
let editor
|
|
26
|
+
let app
|
|
27
|
+
if (impl.root) {
|
|
28
|
+
const serviceHost = host.http()
|
|
29
|
+
const editorHost = host.ui()
|
|
30
|
+
if (!serviceHost?.createApp || !editorHost?.createEditorHost) {
|
|
31
|
+
throw new AbiError(ERROR_CODES.E_CAP_MISSING,
|
|
32
|
+
'ctx.editorHost / ctx.serviceHost 不可用:无法挂静态面板',
|
|
33
|
+
{ plugin: spec.name, capability: 'os.ui' })
|
|
34
|
+
}
|
|
35
|
+
if (!context?.baseUrl) {
|
|
36
|
+
throw new AbiError(ERROR_CODES.E_BASE_URL_MISSING,
|
|
37
|
+
`插件 ${spec.name} 缺少 baseUrl,无法解析 ${impl.root}`, { plugin: spec.name })
|
|
38
|
+
}
|
|
39
|
+
const dir = fileURLToPath(new URL(impl.root, context.baseUrl))
|
|
40
|
+
editor = editorHost.createEditorHost({
|
|
41
|
+
id: spec.name,
|
|
42
|
+
dir,
|
|
43
|
+
basePath: '',
|
|
44
|
+
index: impl.index,
|
|
45
|
+
})
|
|
46
|
+
app = serviceHost.createApp({ id: spec.name, title: spec.name })
|
|
47
|
+
try {
|
|
48
|
+
for (const route of editor.routes()) app.use(route)
|
|
49
|
+
unmount = net.mount(impl.mount, app)
|
|
50
|
+
} catch (error) {
|
|
51
|
+
/* 装配/挂载失败回收已建 app(editor 静态宿主无 close,GC 回收)。 */
|
|
52
|
+
try { app.close?.() } catch { /* 尽力回收 */ }
|
|
53
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
54
|
+
`挂载客户端面板 ${impl.mount} 失败:${error.message}`,
|
|
55
|
+
{ plugin: spec.name, prefix: impl.mount, cause: error })
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const panelState = { ready: typeof impl.prepare !== 'function', value: undefined }
|
|
60
|
+
const off = ctx.on('webserver/index-inject', (table) => {
|
|
61
|
+
if (!impl.bootGlobals || !panelState.ready || !Array.isArray(table)) return
|
|
62
|
+
let globals
|
|
63
|
+
try {
|
|
64
|
+
globals = impl.bootGlobals({
|
|
65
|
+
spec, config, log, os: context.os, state: panelState.value,
|
|
66
|
+
})
|
|
67
|
+
} catch (error) {
|
|
68
|
+
log?.error?.(`[foundation] ${spec.name} bootGlobals 失败:${error.message}`)
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
if (!globals || typeof globals !== 'object') return
|
|
72
|
+
for (const [name, value] of Object.entries(globals)) {
|
|
73
|
+
if (value !== undefined) table.push({ kind: 'global', name, value })
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
editor,
|
|
79
|
+
async start() {
|
|
80
|
+
if (typeof impl.prepare === 'function') {
|
|
81
|
+
panelState.value = await impl.prepare({
|
|
82
|
+
spec, config, log, os: context.os,
|
|
83
|
+
})
|
|
84
|
+
panelState.ready = true
|
|
85
|
+
}
|
|
86
|
+
if (unmount) await net.ready()
|
|
87
|
+
},
|
|
88
|
+
dispose() {
|
|
89
|
+
const errors = []
|
|
90
|
+
try { if (typeof off === 'function') off() } catch (error) { errors.push(error) }
|
|
91
|
+
try { if (typeof unmount === 'function') unmount() } catch (error) { errors.push(error) }
|
|
92
|
+
try { app?.close?.() } catch (error) { errors.push(error) }
|
|
93
|
+
if (errors.length) throw errors[0]
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* host-event@1 适配器:把宿主事件订阅交给插件自己的 Cordis ctx。
|
|
3
|
+
*
|
|
4
|
+
* 应用插件只声明事件名与 handler,不接触 ctx;注销由 loader 统一回收。
|
|
5
|
+
*/
|
|
6
|
+
import { AbiError, ERROR_CODES } from '../../abi/errors.mjs'
|
|
7
|
+
|
|
8
|
+
export const kind = 'host-event@1'
|
|
9
|
+
|
|
10
|
+
export function createHostEventAdapter({ log }) {
|
|
11
|
+
return {
|
|
12
|
+
kind,
|
|
13
|
+
compile(impl, { spec, context }) {
|
|
14
|
+
const ctx = context?.ctx
|
|
15
|
+
if (!ctx || typeof ctx.on !== 'function') {
|
|
16
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
17
|
+
'host-event@1 需要支持 ctx.on 的 Cordis 宿主', { plugin: spec.name, event: impl.event })
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let dispose
|
|
21
|
+
try {
|
|
22
|
+
const off = ctx.on(impl.event, impl.handler)
|
|
23
|
+
dispose = typeof off === 'function'
|
|
24
|
+
? off
|
|
25
|
+
: () => { if (typeof ctx.off === 'function') ctx.off(impl.event, impl.handler) }
|
|
26
|
+
} catch (error) {
|
|
27
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
28
|
+
`订阅宿主事件 ${impl.event} 失败:${error.message}`, { plugin: spec.name, event: impl.event, cause: error })
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
log?.debug?.(`[foundation] ${spec.name} 订阅宿主事件 ${impl.event}`)
|
|
32
|
+
return { dispose }
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* http-router@1 适配器:routes(app) 往子 app 上挂路由,内核把子 app 挂到共享宿主的前缀下。
|
|
3
|
+
*
|
|
4
|
+
* 前缀冲突由 service-host 的 sharedHost.mount 检测(重复前缀直接抛错),
|
|
5
|
+
* 应用侧不接触 server、不选端口。
|
|
6
|
+
*
|
|
7
|
+
* 增量(STANDARD v2 V2-1/V2-4 配套,纯向后兼容):
|
|
8
|
+
* - routes 第二参新增 service(name):跨隔离探测公共服务(getService),
|
|
9
|
+
* 让路由插件拿到 ctx.workStore 这类驱动提供的服务,而不必私开句柄;
|
|
10
|
+
* - routes() 返回函数时登记为 disposer:dispose 先 unmount 再调用,
|
|
11
|
+
* 路由层起的定时器/句柄有官方回收点。
|
|
12
|
+
*/
|
|
13
|
+
import { AbiError, ERROR_CODES } from '../../abi/errors.mjs'
|
|
14
|
+
import { getService } from '../ctx-service.mjs'
|
|
15
|
+
|
|
16
|
+
export const kind = 'http-router@1'
|
|
17
|
+
|
|
18
|
+
export function createHttpRouterAdapter({ host, net, log }) {
|
|
19
|
+
return {
|
|
20
|
+
kind,
|
|
21
|
+
compile(impl, { spec, config, context }) {
|
|
22
|
+
const serviceHost = host.http()
|
|
23
|
+
if (!serviceHost?.createApp) {
|
|
24
|
+
throw new AbiError(ERROR_CODES.E_CAP_MISSING,
|
|
25
|
+
'ctx.serviceHost 不可用:无法创建子 app', { plugin: spec.name, capability: 'os.net' })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const app = serviceHost.createApp({ id: spec.name, title: spec.name })
|
|
29
|
+
const service = (name) => getService(context?.ctx, name)
|
|
30
|
+
let cleanup
|
|
31
|
+
try {
|
|
32
|
+
const returned = impl.routes(app, { spec, config, log, os: context?.os, service })
|
|
33
|
+
if (typeof returned === 'function') cleanup = returned
|
|
34
|
+
} catch (error) {
|
|
35
|
+
/* routes 抛错时 app 已创建:此 entry 尚未入 loader entries,编译回滚够不到,
|
|
36
|
+
* 必须就地回收,否则子 app/句柄泄漏。 */
|
|
37
|
+
try { app.close?.() } catch { /* 尽力回收 */ }
|
|
38
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
39
|
+
`路由注册失败:${error.message}`, { plugin: spec.name, cause: error })
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let unmount
|
|
43
|
+
try {
|
|
44
|
+
unmount = net.mount(impl.mount, app)
|
|
45
|
+
} catch (error) {
|
|
46
|
+
/* mount 失败同样回收已建的 app 与 routes 返回的 cleanup。 */
|
|
47
|
+
try { if (cleanup) cleanup() } catch { /* 尽力回收 */ }
|
|
48
|
+
try { app.close?.() } catch { /* 尽力回收 */ }
|
|
49
|
+
throw new AbiError(ERROR_CODES.E_ADAPTER_THREW,
|
|
50
|
+
`挂载前缀 ${impl.mount} 失败:${error.message}`, { plugin: spec.name, prefix: impl.mount, cause: error })
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
log?.debug?.(`[foundation] ${spec.name} 路由挂到 ${impl.mount}`)
|
|
54
|
+
return {
|
|
55
|
+
app,
|
|
56
|
+
start: () => net.ready(),
|
|
57
|
+
dispose: () => {
|
|
58
|
+
/* unmount 与 cleanup 都要执行;cleanup 错误不再吞掉(旧实现 log.warn 后
|
|
59
|
+
* 假装成功,loader 会释放 claims 但定时器/句柄实际泄漏)。错误上抛进
|
|
60
|
+
* loader cleanupErrors,保留「失败保留所有权」语义。 */
|
|
61
|
+
const errors = []
|
|
62
|
+
try { if (typeof unmount === 'function') unmount() } catch (error) { errors.push(error) }
|
|
63
|
+
if (cleanup) { try { cleanup() } catch (error) { errors.push(error) } }
|
|
64
|
+
if (errors.length) throw errors[0]
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lifecycle-hook@1 的适配器。
|
|
3
|
+
*
|
|
4
|
+
* 运行时只执行 onStart / onStop;onInstall / onUpgrade 属于安装与升级流程,
|
|
5
|
+
* 由安装器(publisher / dsh profile 安装)在对应时点读取描述符后调用。
|
|
6
|
+
* 这里把它们登记进 hook 注册表,保证「声明了就找得到」。
|
|
7
|
+
*/
|
|
8
|
+
export const kind = 'lifecycle-hook@1'
|
|
9
|
+
|
|
10
|
+
export function createHookRegistry() {
|
|
11
|
+
return {
|
|
12
|
+
install: [],
|
|
13
|
+
upgrade: [],
|
|
14
|
+
register(phase, entry) {
|
|
15
|
+
if (!this[phase]) throw new Error(`未知生命周期阶段 ${phase}`)
|
|
16
|
+
this[phase].push(entry)
|
|
17
|
+
return () => {
|
|
18
|
+
const index = this[phase].indexOf(entry)
|
|
19
|
+
if (index >= 0) this[phase].splice(index, 1)
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
list() {
|
|
23
|
+
return {
|
|
24
|
+
install: this.install.map((entry) => entry.plugin),
|
|
25
|
+
upgrade: this.upgrade.map((entry) => entry.plugin),
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function createLifecycleAdapter({ hooks, log }) {
|
|
32
|
+
return {
|
|
33
|
+
kind,
|
|
34
|
+
compile(impl, { spec, config, context }) {
|
|
35
|
+
const removers = []
|
|
36
|
+
if (typeof impl.onInstall === 'function') {
|
|
37
|
+
removers.push(hooks.register('install', { plugin: spec.name, run: impl.onInstall }))
|
|
38
|
+
}
|
|
39
|
+
if (typeof impl.onUpgrade === 'function') {
|
|
40
|
+
removers.push(hooks.register('upgrade', { plugin: spec.name, run: impl.onUpgrade }))
|
|
41
|
+
}
|
|
42
|
+
let entered = false
|
|
43
|
+
return {
|
|
44
|
+
async start({ signal } = {}) {
|
|
45
|
+
entered = true
|
|
46
|
+
if (typeof impl.onStart === 'function') await impl.onStart({ plugin: spec.name, config, log, os: context?.os, signal })
|
|
47
|
+
},
|
|
48
|
+
dispose() {
|
|
49
|
+
for (const remove of removers) remove()
|
|
50
|
+
if (entered && typeof impl.onStop === 'function') return impl.onStop({ plugin: spec.name, config, log, os: context?.os })
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|