@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,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PPT 桥 relay:**业务装配**(HTTP/MCP/锁/发现/独立入口由 server/workbench-framework.mjs 提供)。
|
|
3
|
+
*
|
|
4
|
+
* 本文件只回答「PPT 工作台对外提供什么」:
|
|
5
|
+
* - 存储:BridgeStore(文件或 workspace backend)
|
|
6
|
+
* - 路由:MCP / 资产 / 编辑器静态页 / 导入 / 桥端点
|
|
7
|
+
* - 工具:tools.mjs 的 CAPABILITIES → registry
|
|
8
|
+
* - 健康与指标:deck / slide / seq 等 PPT 语义字段
|
|
9
|
+
* - 崩溃恢复:state.json 里 seq > applied_seq 的指令重放
|
|
10
|
+
*
|
|
11
|
+
* 也可脱离 dsh 独立运行(仅开发):node server/relay.mjs [--port <端口>] [--dir <hostDir>]
|
|
12
|
+
* --port 缺省为 0(由操作系统分配空闲端口),实际地址在启动日志里打印。
|
|
13
|
+
* 端口是基建的事,业务代码只使用 ctx/options 给的地址。
|
|
14
|
+
*/
|
|
15
|
+
import path from 'node:path'
|
|
16
|
+
import { declareBridge, DOC_MODEL_VERSION } from '@capyclaw/foundation/abi'
|
|
17
|
+
import { applyOp } from '../core/ops.js'
|
|
18
|
+
import { createJsonPptApp } from './ppt-shim.mjs'
|
|
19
|
+
import { CONTRACT_VERSION, PACKAGE_VERSION } from './contract.mjs'
|
|
20
|
+
import { BASE_PATH } from './constants.mjs'
|
|
21
|
+
import { createAssetRoutes } from './routes/assets.mjs'
|
|
22
|
+
import { createFileAssetStore } from './shared/asset-service.mjs'
|
|
23
|
+
import { createEditorRoutes } from './routes/editor.mjs'
|
|
24
|
+
import { resolveEditorAssets } from './editor-assets.mjs'
|
|
25
|
+
import { createMcpRoutes } from './routes/mcp.mjs'
|
|
26
|
+
import { createImportRoutes } from './routes/import.mjs'
|
|
27
|
+
import { createManuscriptRoutes } from './routes/manuscript.mjs'
|
|
28
|
+
import { createBridgeRoutes } from './routes/bridge.mjs'
|
|
29
|
+
import { createSessionRoutes } from './routes/session.mjs'
|
|
30
|
+
import { createSessionDispatch, bindToolsToCallerSession } from './session-context.mjs'
|
|
31
|
+
import { createSessionModeRegistry, bindToolsToSessionMode } from '@capyclaw/document-workbench/session-mode'
|
|
32
|
+
import { isOwnerLive, isShadowOwner } from '@capyclaw/document-workbench/session'
|
|
33
|
+
import { createShadowManager } from '@capyclaw/plugin-kit/editor/shadow'
|
|
34
|
+
import { SessionStores, createSessionStoreFacade, DEFAULT_SESSION } from './store/sessions.mjs'
|
|
35
|
+
import { makeDeckSanitizer } from './store/deck-sanitize.mjs'
|
|
36
|
+
import { replayPending } from './runtime/recovery.mjs'
|
|
37
|
+
import { serverInstructions } from './mcp/instructions.mjs'
|
|
38
|
+
import { inspectContractSnapshots, describeMismatch } from './contract-snapshots.mjs'
|
|
39
|
+
import { getTuning } from './tuning.mjs'
|
|
40
|
+
import { createRuntimeStoreClient, loadRuntimeContext } from './infra/runtime/context.mjs'
|
|
41
|
+
import { WorkspaceBackend } from './infra/workspace/manager.mjs'
|
|
42
|
+
import { createWorkbench, runIfMain } from './workbench-framework.mjs'
|
|
43
|
+
|
|
44
|
+
export { BASE_PATH }
|
|
45
|
+
|
|
46
|
+
/* 租约存活判定统一走共享 session/lease(OWNER_TTL 单一真源),不再本地硬编码秒数。 */
|
|
47
|
+
const liveOwner = (doc) => isOwnerLive(doc)
|
|
48
|
+
|
|
49
|
+
/* 每实例状态一律挂 ctx,不用模块级变量——同进程多个 relay 实例(embedded+standalone、
|
|
50
|
+
* HMR 重载)共享模块级变量会互相覆盖 store/影子管理器。SessionStores 经门面 __stores
|
|
51
|
+
* 取回(ctx.store.__stores),影子管理器/定时器挂 ctx.shadowManager/ctx.shadowTimer。 */
|
|
52
|
+
const storesOf = (ctx) => ctx.store.__stores
|
|
53
|
+
|
|
54
|
+
function reconcileShadow(ctx) {
|
|
55
|
+
try {
|
|
56
|
+
const sessionStores = storesOf(ctx)
|
|
57
|
+
const shadowManager = ctx.shadowManager
|
|
58
|
+
if (!shadowManager || !sessionStores || !ctx.editorAssets) return
|
|
59
|
+
const keys = new Set([DEFAULT_SESSION, sessionStores.activeSession(), ...sessionStores.sessions()])
|
|
60
|
+
for (const sid of keys) {
|
|
61
|
+
if (!sid) continue
|
|
62
|
+
const doc = sessionStores.forSession(sid).get()
|
|
63
|
+
const slides = doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0
|
|
64
|
+
const url = sid === DEFAULT_SESSION ? ctx.editorUrl : `${ctx.editorUrl}s/${sid}/`
|
|
65
|
+
/* fire-and-forget:manager 内部守并发与异常,不阻塞对账循环。 */
|
|
66
|
+
shadowManager.reconcile(sid, url, {
|
|
67
|
+
hasContent: slides > 0,
|
|
68
|
+
ownerLive: isOwnerLive(doc),
|
|
69
|
+
ownerShadow: isShadowOwner(doc),
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.log('[shadow] 对账循环异常:', error.message)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const startRelay = createWorkbench({
|
|
78
|
+
id: 'ppt-workbench',
|
|
79
|
+
title: 'PPT Workbench',
|
|
80
|
+
packageVersion: PACKAGE_VERSION,
|
|
81
|
+
contractVersion: CONTRACT_VERSION,
|
|
82
|
+
/* 标准声明:编辑器权威桥 + 文档模型(deck adapter 见 server/tools/model/deck-schema.mjs)。
|
|
83
|
+
* editor:'optional'——界面在可选成员包 @capyclaw/ppt-editor 里:没装就是 headless,
|
|
84
|
+
* 稿件/工具/导出照常,只是没有实时编辑器(桥对账只比 id/protocol/model,不受影响)。 */
|
|
85
|
+
bridge: declareBridge({ id: 'ppt-workbench', model: DOC_MODEL_VERSION, editor: 'optional' }),
|
|
86
|
+
/* 端口不再由业务决定:embedded 形态挂宿主路由,standalone(仅开发)才用 options.port。 */
|
|
87
|
+
basePath: BASE_PATH,
|
|
88
|
+
homeEnv: 'PPT_BRIDGE_HOME',
|
|
89
|
+
defaultHome: '.dsh-ppt-bridge',
|
|
90
|
+
getTuning,
|
|
91
|
+
contract: { version: CONTRACT_VERSION, inspect: inspectContractSnapshots, describe: describeMismatch },
|
|
92
|
+
|
|
93
|
+
/* 每会话一份 deck:这里返回的是「门面」,真正的 store 在请求发生时才按会话
|
|
94
|
+
* 解析(见 store/sessions.mjs)。workspace 后端把文档键在 work 上,仍是单文档。 */
|
|
95
|
+
createStore: ({ hostDir, backend }) => {
|
|
96
|
+
const stores = new SessionStores({ hostDir, backend })
|
|
97
|
+
return createSessionStoreFacade(stores)
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
createAssetStore: ({ hostDir }) => createFileAssetStore({ dir: path.join(hostDir, 'assets') }),
|
|
101
|
+
|
|
102
|
+
/* 通用作品底座(@capyclaw/work-store):宿主 provide 了 ctx.workStore 时,把懒解析器
|
|
103
|
+
* 塞进 SessionStores,deck 即落 SQLite 作品库;没有则保持文件后端(行为不变)。
|
|
104
|
+
* prepare 在 createStore 之后、首个请求之前运行,此时底座服务通常已就绪。 */
|
|
105
|
+
prepare: (ctx) => {
|
|
106
|
+
const sessionStores = storesOf(ctx)
|
|
107
|
+
if (sessionStores && typeof ctx.getWorkStore === 'function') sessionStores.setWorkStore(ctx.getWorkStore)
|
|
108
|
+
/* base64 闸:deck 落盘前把内联 data:image 抽进资产仓,只留 /assets/<sha> 引用。
|
|
109
|
+
* urlBase 与稿件 publicBase 同形(带挂载前缀),保证编辑器 <img> 能直接加载。 */
|
|
110
|
+
if (sessionStores && ctx.assetStore) {
|
|
111
|
+
sessionStores.setDeckSanitizer(makeDeckSanitizer({
|
|
112
|
+
assetStore: ctx.assetStore,
|
|
113
|
+
urlBase: `${ctx.mountPath || ''}${BASE_PATH}`,
|
|
114
|
+
}))
|
|
115
|
+
}
|
|
116
|
+
return {}
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
routes: (ctx) => {
|
|
120
|
+
const sessionStores = storesOf(ctx)
|
|
121
|
+
const jsonP = createJsonPptApp(ctx.store)
|
|
122
|
+
ctx.jsonP = jsonP
|
|
123
|
+
/* F:会话模式锁的底座解析器(works.db 单一真源)。底座缺席 → 守卫跳过。 */
|
|
124
|
+
const modeRegistry = createSessionModeRegistry(ctx.getWorkStore)
|
|
125
|
+
/* 编辑器静态资产在可选成员包 @capyclaw/ppt-editor(拆包后不再随工作台分发)。
|
|
126
|
+
* 解析不到 → headless:不挂静态路由,工具面照常(editor:'optional')。 */
|
|
127
|
+
const editorAssets = resolveEditorAssets(ctx.packageDir, { editorDir: ctx.editorDir })
|
|
128
|
+
ctx.editorAssets = editorAssets
|
|
129
|
+
const editorDir = editorAssets ? editorAssets.dir : null
|
|
130
|
+
/* 路由工厂有的返回数组、有的返回单条——统一拍平,顺序即挂载顺序。 */
|
|
131
|
+
const many = (value) => (Array.isArray(value) ? value : [value])
|
|
132
|
+
const handlers = [
|
|
133
|
+
/* 会话归属端点:编辑器窗口加载/聚焦时上报自己属于哪个会话。 */
|
|
134
|
+
...many(createSessionRoutes({ stores: sessionStores, basePath: BASE_PATH })),
|
|
135
|
+
...many(createMcpRoutes({ getMcpHandler: () => ctx.getMcpHandler?.() })),
|
|
136
|
+
...many(ctx.assetService?.mount
|
|
137
|
+
? ctx.assetService.mount(ctx.app, { store: ctx.assetStore, basePath: BASE_PATH })
|
|
138
|
+
: createAssetRoutes({ assetStore: ctx.assetStore, basePath: BASE_PATH })),
|
|
139
|
+
...(editorDir ? many(createEditorRoutes({ editorDir, editorHost: ctx.editorHost })) : []),
|
|
140
|
+
/* 必须先于 bridge 路由:bridge 的主端点会把任意 POST 当 JSON 读取,
|
|
141
|
+
* 原始 pptx 字节不能被它先消费。 */
|
|
142
|
+
...many(createImportRoutes({ basePath: BASE_PATH, importDir: path.join(ctx.hostDir, 'imports'), store: ctx.store })),
|
|
143
|
+
/* 稿件端点先于 bridge:bridge 会把任意 POST 当桥协议 JSON 读走。
|
|
144
|
+
* publicBase:给浏览器/导出用的媒体地址前缀——embedded 形态必须带
|
|
145
|
+
* `/capyclaw/<ns>`(挂载前缀会被宿主剥掉,但 <img> 请求不会)。 */
|
|
146
|
+
createManuscriptRoutes({
|
|
147
|
+
store: ctx.store,
|
|
148
|
+
stores: sessionStores,
|
|
149
|
+
jsonP,
|
|
150
|
+
applyOp,
|
|
151
|
+
hostDir: ctx.hostDir,
|
|
152
|
+
assetStore: ctx.assetStore,
|
|
153
|
+
publicBase: `${ctx.mountPath || ''}${BASE_PATH}`,
|
|
154
|
+
}),
|
|
155
|
+
...many(createBridgeRoutes({ store: ctx.store, jsonP, applyOp, editorAvailable: !!editorDir, modeRegistry })),
|
|
156
|
+
]
|
|
157
|
+
/* 外层只做一件事:定下这次请求属于哪个会话,然后按原顺序交给内层。 */
|
|
158
|
+
return [createSessionDispatch(handlers, sessionStores)]
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
tools: async (ctx) => {
|
|
162
|
+
try {
|
|
163
|
+
const tools = await import('./tools.mjs')
|
|
164
|
+
const registry = tools.createRegistry(tools.CAPABILITIES, { enabled: ctx.capabilities, toolHost: ctx.toolHost })
|
|
165
|
+
ctx.capabilitiesList = registry.CAPABILITIES || []
|
|
166
|
+
/* F:工具写闸——非 read 工具执行前认领本会话为 ppt(已固化为别的工作台则硬拒)。
|
|
167
|
+
* 必须在会话缝入之前包:那样守卫跑在调用者会话的 ALS 上下文里。 */
|
|
168
|
+
bindToolsToSessionMode(registry, { kind: 'ppt', modeRegistry: createSessionModeRegistry(ctx.getWorkStore) })
|
|
169
|
+
/* 工具调用不经过 HTTP:会话身份从执行上下文(exec.agent.session.id)来,
|
|
170
|
+
* 这样会话 A 的工具只会改 A 的那份 deck,不受「谁在最前面」影响。 */
|
|
171
|
+
return bindToolsToCallerSession(registry)
|
|
172
|
+
} catch (e) {
|
|
173
|
+
/* 以前这里 return {}:服务照样起、/healthz 照样绿、tools/list 却是空的,
|
|
174
|
+
* 上层只能看到"工具不见了"而没有任何报错线索。工具面是这套工作台的全部
|
|
175
|
+
* 价值,装不上就该起不来。 */
|
|
176
|
+
console.error('[ppt-workbench] 工具面装载失败(先跑 npm run build 生成 artifacts):', e.message)
|
|
177
|
+
throw new Error(`ppt-workbench 工具面装载失败:${e.message}(先跑 npm run build 生成 artifacts)`)
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
instructions: (ctx) => serverInstructions(ctx.editorAssets ? ctx.editorUrl : '', {
|
|
182
|
+
tools: ctx.tools || [],
|
|
183
|
+
capabilities: ctx.capabilitiesList || [],
|
|
184
|
+
editorInstalled: !!ctx.editorAssets,
|
|
185
|
+
}),
|
|
186
|
+
|
|
187
|
+
health: (ctx) => {
|
|
188
|
+
const doc = ctx.store.get()
|
|
189
|
+
const slides = doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0
|
|
190
|
+
return {
|
|
191
|
+
bridge: 'ppt-workbench',
|
|
192
|
+
editor: ctx.editorAssets ? ctx.editorUrl : '',
|
|
193
|
+
editorAvailable: !!ctx.editorAssets,
|
|
194
|
+
editorConnected: liveOwner(doc),
|
|
195
|
+
hasDeck: slides > 0,
|
|
196
|
+
slides,
|
|
197
|
+
seq: doc.seq | 0,
|
|
198
|
+
appliedSeq: doc.applied_seq | 0,
|
|
199
|
+
stateSeq: doc.state_seq | 0,
|
|
200
|
+
uiSeq: doc.ui_seq | 0,
|
|
201
|
+
lastError: doc.error || '',
|
|
202
|
+
injected: {
|
|
203
|
+
serviceHost: !!ctx.serviceHost,
|
|
204
|
+
toolHost: !!ctx.toolHost,
|
|
205
|
+
editorHost: !!ctx.editorHost,
|
|
206
|
+
assets: !!ctx.assetStore,
|
|
207
|
+
},
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
metrics: (ctx) => {
|
|
212
|
+
const doc = ctx.store.get()
|
|
213
|
+
const slides = doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0
|
|
214
|
+
return [
|
|
215
|
+
['ppt_workbench_slides', slides],
|
|
216
|
+
['ppt_workbench_seq', doc.seq | 0],
|
|
217
|
+
['ppt_workbench_applied_seq', doc.applied_seq | 0],
|
|
218
|
+
['ppt_workbench_state_seq', doc.state_seq | 0],
|
|
219
|
+
['ppt_workbench_editor_connected', liveOwner(doc) ? 1 : 0],
|
|
220
|
+
['ppt_workbench_shot_req', doc.shot_req | 0],
|
|
221
|
+
['ppt_workbench_memory_rss_bytes', process.memoryUsage().rss],
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
/* bridge-client 在 import 时读 PPT_BRIDGE_URL,必须先设 env 再装工具。 */
|
|
226
|
+
onListening: async (ctx, info, url) => {
|
|
227
|
+
process.env.PPT_BRIDGE_URL = url
|
|
228
|
+
/* 崩溃恢复:seq > applied_seq 说明上一批指令未完整落盘。
|
|
229
|
+
* 用 store 的串行队列占住写锁,恢复完成前的 push 会排队而不是交叉执行。 */
|
|
230
|
+
await ctx.store.enqueue(() => replayPending({ store: ctx.store, jsonP: ctx.jsonP, applyOp }))
|
|
231
|
+
/* 影子显示器:编辑器已安装且 tuning 允许时启用。manager 自身 fail-safe——
|
|
232
|
+
* 解析不到 playwright-core / Chromium 时自动禁用,工具退回离线渲染。 */
|
|
233
|
+
const tuning = getTuning()
|
|
234
|
+
if (ctx.editorAssets && tuning.shadowDisplay !== false) {
|
|
235
|
+
ctx.shadowManager = createShadowManager({
|
|
236
|
+
log: (message) => console.log(message),
|
|
237
|
+
maxConcurrent: Number(tuning.shadowMaxConcurrent) || 4,
|
|
238
|
+
})
|
|
239
|
+
ctx.shadowTimer = setInterval(() => reconcileShadow(ctx), Number(tuning.shadowReconcileMs) || 5000)
|
|
240
|
+
ctx.shadowTimer.unref?.()
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
/* 停机回收:清对账定时器、关停所有影子 browser(不留孤儿进程)。 */
|
|
245
|
+
beforeStop: async (ctx) => {
|
|
246
|
+
if (ctx.shadowTimer) { clearInterval(ctx.shadowTimer); ctx.shadowTimer = null }
|
|
247
|
+
if (ctx.shadowManager) {
|
|
248
|
+
try { await ctx.shadowManager.dispose() } catch { /* ignore */ }
|
|
249
|
+
ctx.shadowManager = null
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
/* 独立入口的启动日志要知道编辑器装没装(embedded 形态不看这个)。 */
|
|
254
|
+
resultExtras: (ctx) => ({ editorAvailable: !!ctx.editorAssets }),
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
/* ---- 独立运行入口(无 dsh 也可手动拉起,供调试/演示)---- */
|
|
258
|
+
runIfMain(import.meta.url, async ({ port, dir }) => {
|
|
259
|
+
/* 独立服务形态也要接上 runtime 的 workspace:broker 拉起时继承了
|
|
260
|
+
* DSH_RUNTIME_FILE / DSH_STORE_*,relay 据此使用当前 runtime 的 store。 */
|
|
261
|
+
const runtime = loadRuntimeContext()
|
|
262
|
+
const workId = runtime?.workId || 'main'
|
|
263
|
+
const client = runtime ? createRuntimeStoreClient(runtime, { workId }) : null
|
|
264
|
+
const backend = client
|
|
265
|
+
? new WorkspaceBackend({
|
|
266
|
+
client,
|
|
267
|
+
workId,
|
|
268
|
+
journalPath: runtime.paths?.logs ? path.join(runtime.paths.logs, 'ppt-journal.jsonl') : null,
|
|
269
|
+
})
|
|
270
|
+
: null
|
|
271
|
+
const relay = await startRelay({
|
|
272
|
+
/* 缺省 0:让操作系统给一个空闲端口。只在开发时才需要「固定端口」,
|
|
273
|
+
* 那时也用 --port 显式指定,业务代码里没有默认端口这个概念。 */
|
|
274
|
+
port: Number(port) || 0,
|
|
275
|
+
hostDir: dir || process.env.PPT_BRIDGE_HOME || runtime?.paths?.contentState || undefined,
|
|
276
|
+
backend,
|
|
277
|
+
})
|
|
278
|
+
console.log('[ppt-workbench] 桥:', relay.url)
|
|
279
|
+
if (relay.editorAvailable) console.log('[ppt-workbench] 编辑器:', relay.editorUrl, '(浏览器打开即用)')
|
|
280
|
+
else console.log('[ppt-workbench] 编辑器: 未安装 @capyclaw/ppt-editor(headless:稿件/工具/导出照常,无实时界面)')
|
|
281
|
+
console.log('[ppt-workbench] MCP 端点:', relay.url.replace(BASE_PATH, '/mcp'))
|
|
282
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PPT 桥端点:协议与路由由 @capyclaw/document-workbench 提供,本文件只注入
|
|
3
|
+
* PPT 的 deck 投影、VIEW_OPS 与 applyOp。
|
|
4
|
+
*/
|
|
5
|
+
import { createDocumentBridge } from '@capyclaw/document-workbench/bridge'
|
|
6
|
+
import { assertSessionMode } from '@capyclaw/document-workbench/session-mode'
|
|
7
|
+
import { BASE_PATH, VIEW_OPS } from '../constants.mjs'
|
|
8
|
+
import { getTuning } from '../tuning.mjs'
|
|
9
|
+
import {
|
|
10
|
+
sanitizeAck, sanitizeClaim, sanitizePush, sanitizeShotResult, sanitizeState,
|
|
11
|
+
} from '../store.mjs'
|
|
12
|
+
|
|
13
|
+
export function createBridgeRoutes({ store, jsonP, applyOp, editorAvailable = true, modeRegistry = null }) {
|
|
14
|
+
const tuning = getTuning()
|
|
15
|
+
return createDocumentBridge({
|
|
16
|
+
session: store,
|
|
17
|
+
basePath: BASE_PATH,
|
|
18
|
+
bridgeName: 'ppt-bridge',
|
|
19
|
+
documentKey: 'deck',
|
|
20
|
+
documentPath: '/deck',
|
|
21
|
+
authority: 'server',
|
|
22
|
+
apply: (cmd) => applyOp(jsonP, cmd),
|
|
23
|
+
isViewOp: (cmd) => VIEW_OPS.has(cmd.op),
|
|
24
|
+
sanitizers: {
|
|
25
|
+
sanitizeAck,
|
|
26
|
+
sanitizeClaim,
|
|
27
|
+
sanitizePush,
|
|
28
|
+
sanitizeShotResult,
|
|
29
|
+
sanitizeState,
|
|
30
|
+
},
|
|
31
|
+
bodyLimitBytes: Number(tuning.bodyLimitBytes) || 10 * 1024 * 1024,
|
|
32
|
+
watch: {
|
|
33
|
+
pollMs: tuning.watchPollMs,
|
|
34
|
+
timeoutSec: tuning.watchTimeoutSec,
|
|
35
|
+
maxTimeoutSec: tuning.watchTimeoutMaxSec,
|
|
36
|
+
},
|
|
37
|
+
projectStatus: (doc) => ({
|
|
38
|
+
bridge: 'ppt-workbench',
|
|
39
|
+
/* headless 标志:编辑器包没装时工具面据此直接报「未安装」,不再盲等租约。 */
|
|
40
|
+
editor_available: editorAvailable,
|
|
41
|
+
has_deck: !!(doc.deck && Array.isArray(doc.deck.slides) && doc.deck.slides.length),
|
|
42
|
+
slides: doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0,
|
|
43
|
+
}),
|
|
44
|
+
projectDocument: (doc) => ({
|
|
45
|
+
deck: doc.deck || {},
|
|
46
|
+
state_seq: doc.state_seq | 0,
|
|
47
|
+
applied_seq: doc.applied_seq | 0,
|
|
48
|
+
}),
|
|
49
|
+
/* E:会话一致性校验(纵深防御)。客户端镜像时声明自己所属会话,必须与请求
|
|
50
|
+
* 目标会话一致——异会话镜像响亮拒绝(409),不静默落库。规则由 PPT 注入,
|
|
51
|
+
* 桥只提供通用 validateState 钩子(不为特例写死接口)。无会话声明/无会话
|
|
52
|
+
* 分发(headless/旧宿主)时不启用,向后兼容。 */
|
|
53
|
+
validateState: (value, ctx) => {
|
|
54
|
+
if (ctx.sessionId && ctx.requestSessionId && ctx.sessionId !== ctx.requestSessionId) {
|
|
55
|
+
return {
|
|
56
|
+
ok: false,
|
|
57
|
+
error: `会话不一致:客户端声明 ${ctx.sessionId},请求目标 ${ctx.requestSessionId}(镜像被拒绝)`,
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return { ok: true }
|
|
61
|
+
},
|
|
62
|
+
/* F:编辑器认领闸。首次认领即把本会话固化为 ppt;已固化为别的工作台时硬拒
|
|
63
|
+
* (409,指明已固化种类 + 请新开会话)。规则由 PPT 注入,桥只提供通用
|
|
64
|
+
* validateClaim 钩子。无底座/无会话身份时守卫自动跳过,向后兼容。 */
|
|
65
|
+
validateClaim: modeRegistry ? (ctx) => {
|
|
66
|
+
try {
|
|
67
|
+
assertSessionMode(ctx.sessionId, 'ppt', modeRegistry)
|
|
68
|
+
return { ok: true }
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return { ok: false, error: e.message }
|
|
71
|
+
}
|
|
72
|
+
} : null,
|
|
73
|
+
}).routes
|
|
74
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 静态编辑器路由统一来自 @capyclaw/editor-host 公共插件。 */
|
|
2
|
+
import { createEditorHost as createSharedEditorHost } from '../shared/editor-host.mjs'
|
|
3
|
+
import { EDITOR_FILES } from '../constants.mjs'
|
|
4
|
+
|
|
5
|
+
export function createEditorRoutes({ editorDir, editorHost = null }) {
|
|
6
|
+
const factory = editorHost?.createEditorHost || createSharedEditorHost
|
|
7
|
+
const host = factory({ id: 'ppt-editor', dir: editorDir, files: EDITOR_FILES })
|
|
8
|
+
return [host.staticRoutes]
|
|
9
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PPTX 导入中转路由。
|
|
3
|
+
*
|
|
4
|
+
* 浏览器端导入需要 File 对象,而 MCP 工具在 Node 进程里拿到的是路径/字节。
|
|
5
|
+
* 这里负责:
|
|
6
|
+
* POST <base>/import-file 原始字节上传 → 临时文件 + 同源下载地址
|
|
7
|
+
* GET <base>/import-file/:id 编辑器页面取回原始字节
|
|
8
|
+
* POST <base>/import-result 编辑器回传导入结果
|
|
9
|
+
* GET <base>/import-result?req= MCP 工具轮询结果
|
|
10
|
+
*
|
|
11
|
+
* 文件与结果都是短生命周期:结果回传后删除临时文件,结果按 TTL 清理。
|
|
12
|
+
*/
|
|
13
|
+
import crypto from 'node:crypto'
|
|
14
|
+
import fs from 'node:fs'
|
|
15
|
+
import path from 'node:path'
|
|
16
|
+
import { readBody, send } from '../infra/http.mjs'
|
|
17
|
+
import { renderDeckToPptx } from '../tools/domains/pptx-export.mjs'
|
|
18
|
+
|
|
19
|
+
const PPTX_MIME = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
|
20
|
+
const MAX_UPLOAD_BYTES = 128 * 1024 * 1024
|
|
21
|
+
const MAX_RESULT_BYTES = 2 * 1024 * 1024
|
|
22
|
+
const RESULT_TTL_MS = 10 * 60 * 1000
|
|
23
|
+
const FILE_TTL_MS = 60 * 60 * 1000
|
|
24
|
+
const ID_RE = /^[a-f0-9]{16,64}$/
|
|
25
|
+
|
|
26
|
+
function readRawBody(req, limit) {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
let size = 0
|
|
29
|
+
let settled = false
|
|
30
|
+
const chunks = []
|
|
31
|
+
const fail = (error) => {
|
|
32
|
+
if (settled) return
|
|
33
|
+
settled = true
|
|
34
|
+
reject(error)
|
|
35
|
+
}
|
|
36
|
+
req.on('data', (chunk) => {
|
|
37
|
+
if (settled) return
|
|
38
|
+
size += chunk.length
|
|
39
|
+
if (size > limit) {
|
|
40
|
+
const error = new Error('pptx 文件超过大小上限')
|
|
41
|
+
error.code = 'BODY_TOO_LARGE'
|
|
42
|
+
fail(error)
|
|
43
|
+
req.resume()
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
chunks.push(chunk)
|
|
47
|
+
})
|
|
48
|
+
req.on('end', () => {
|
|
49
|
+
if (settled) return
|
|
50
|
+
settled = true
|
|
51
|
+
resolve(Buffer.concat(chunks))
|
|
52
|
+
})
|
|
53
|
+
req.on('error', fail)
|
|
54
|
+
req.on('close', () => {
|
|
55
|
+
if (!req.readableEnded) fail(new Error('客户端在上传完成前断开'))
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function safeName(value) {
|
|
61
|
+
let name = String(value || 'import.pptx')
|
|
62
|
+
try { name = decodeURIComponent(name) } catch { /* 保留原值 */ }
|
|
63
|
+
name = path.basename(name).replace(/[\\/:*?"<>|]/g, '_').slice(0, 120)
|
|
64
|
+
return name.toLowerCase().endsWith('.pptx') ? name : `${name || 'import'}.pptx`
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function jsonResult(body) {
|
|
68
|
+
return {
|
|
69
|
+
done: true,
|
|
70
|
+
ok: !!body.ok,
|
|
71
|
+
error: body.error ? String(body.error).slice(0, 2000) : '',
|
|
72
|
+
summary: body.summary && typeof body.summary === 'object' ? body.summary : null,
|
|
73
|
+
ts: Date.now(),
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function createImportRoutes({ basePath, importDir, store }) {
|
|
78
|
+
const prefix = String(basePath || '').replace(/\/+$/, '')
|
|
79
|
+
if (!importDir) throw new Error('createImportRoutes 需要 importDir')
|
|
80
|
+
fs.mkdirSync(importDir, { recursive: true })
|
|
81
|
+
const sourceRecord = path.join(importDir, 'last-open.json')
|
|
82
|
+
|
|
83
|
+
/* 启动时清掉上一个进程遗留的临时文件(失败不影响服务启动)。 */
|
|
84
|
+
try {
|
|
85
|
+
const now = Date.now()
|
|
86
|
+
for (const entry of fs.readdirSync(importDir)) {
|
|
87
|
+
if (!entry.endsWith('.pptx')) continue
|
|
88
|
+
const file = path.join(importDir, entry)
|
|
89
|
+
try {
|
|
90
|
+
if (now - fs.statSync(file).mtimeMs > FILE_TTL_MS) fs.rmSync(file, { force: true })
|
|
91
|
+
} catch { /* 单个文件清理失败忽略 */ }
|
|
92
|
+
}
|
|
93
|
+
} catch { /* 目录不可读忽略 */ }
|
|
94
|
+
|
|
95
|
+
const results = new Map()
|
|
96
|
+
let saving = false
|
|
97
|
+
const timer = setInterval(() => {
|
|
98
|
+
const now = Date.now()
|
|
99
|
+
for (const [key, value] of results) {
|
|
100
|
+
if (now - value.ts > RESULT_TTL_MS) results.delete(key)
|
|
101
|
+
}
|
|
102
|
+
}, 60_000)
|
|
103
|
+
timer.unref?.()
|
|
104
|
+
|
|
105
|
+
return async function importRoutes(req, res, u) {
|
|
106
|
+
const pathname = u.pathname
|
|
107
|
+
if (prefix && pathname !== prefix && !pathname.startsWith(prefix + '/')) return false
|
|
108
|
+
const sub = prefix ? pathname.slice(prefix.length) : pathname
|
|
109
|
+
|
|
110
|
+
/* 原始字节上传 */
|
|
111
|
+
if (sub === '/import-file' && req.method === 'POST') {
|
|
112
|
+
let body
|
|
113
|
+
try {
|
|
114
|
+
body = await readRawBody(req, MAX_UPLOAD_BYTES)
|
|
115
|
+
} catch (error) {
|
|
116
|
+
const status = error?.code === 'BODY_TOO_LARGE' ? 413 : 400
|
|
117
|
+
send(req, res, status, { error: String(error.message || error) })
|
|
118
|
+
return true
|
|
119
|
+
}
|
|
120
|
+
if (!body.length) {
|
|
121
|
+
send(req, res, 400, { error: '上传内容为空' })
|
|
122
|
+
return true
|
|
123
|
+
}
|
|
124
|
+
/* ZIP 魔数:pptx 必须是 OOXML 包,提前拦住误传的图片/JSON。 */
|
|
125
|
+
if (body[0] !== 0x50 || body[1] !== 0x4b) {
|
|
126
|
+
send(req, res, 400, { error: '不是有效的 PPTX 文件(缺少 ZIP/OOXML 头)' })
|
|
127
|
+
return true
|
|
128
|
+
}
|
|
129
|
+
const id = crypto.randomBytes(12).toString('hex')
|
|
130
|
+
const name = safeName(req.headers['x-file-name'])
|
|
131
|
+
const file = path.join(importDir, `${id}.pptx`)
|
|
132
|
+
try {
|
|
133
|
+
await fs.promises.writeFile(file, body)
|
|
134
|
+
} catch (error) {
|
|
135
|
+
send(req, res, 500, { error: '写入临时文件失败:' + String(error.message || error) })
|
|
136
|
+
return true
|
|
137
|
+
}
|
|
138
|
+
/* 记录源文件路径:编辑器“保存回原文件”按钮据此写回。 */
|
|
139
|
+
const sourceHeader = req.headers['x-source-path']
|
|
140
|
+
if (sourceHeader) {
|
|
141
|
+
try {
|
|
142
|
+
const sourcePath = decodeURIComponent(String(sourceHeader))
|
|
143
|
+
if (sourcePath) {
|
|
144
|
+
fs.writeFileSync(sourceRecord, JSON.stringify({ path: sourcePath, name, ts: Date.now() }))
|
|
145
|
+
}
|
|
146
|
+
} catch { /* 源路径只影响保存按钮,不阻塞导入 */ }
|
|
147
|
+
}
|
|
148
|
+
send(req, res, 200, {
|
|
149
|
+
ok: true,
|
|
150
|
+
id,
|
|
151
|
+
name,
|
|
152
|
+
bytes: body.length,
|
|
153
|
+
url: `${prefix}/import-file/${id}`,
|
|
154
|
+
})
|
|
155
|
+
return true
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 编辑器取回原始字节 */
|
|
159
|
+
if (sub.startsWith('/import-file/') && (req.method === 'GET' || req.method === 'HEAD')) {
|
|
160
|
+
const id = sub.slice('/import-file/'.length)
|
|
161
|
+
if (!ID_RE.test(id)) {
|
|
162
|
+
send(req, res, 404, { error: '导入文件不存在' })
|
|
163
|
+
return true
|
|
164
|
+
}
|
|
165
|
+
const file = path.join(importDir, `${id}.pptx`)
|
|
166
|
+
let data
|
|
167
|
+
try {
|
|
168
|
+
data = fs.readFileSync(file)
|
|
169
|
+
} catch {
|
|
170
|
+
send(req, res, 404, { error: '导入文件不存在或已清理' })
|
|
171
|
+
return true
|
|
172
|
+
}
|
|
173
|
+
res.writeHead(200, {
|
|
174
|
+
'content-type': PPTX_MIME,
|
|
175
|
+
'content-length': data.length,
|
|
176
|
+
'cache-control': 'no-store',
|
|
177
|
+
'x-content-type-options': 'nosniff',
|
|
178
|
+
'referrer-policy': 'no-referrer',
|
|
179
|
+
})
|
|
180
|
+
res.end(req.method === 'HEAD' ? undefined : data)
|
|
181
|
+
return true
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* 编辑器回传导入结果 */
|
|
185
|
+
if (sub === '/import-result' && req.method === 'POST') {
|
|
186
|
+
let body
|
|
187
|
+
try {
|
|
188
|
+
body = await readBody(req, MAX_RESULT_BYTES)
|
|
189
|
+
} catch (error) {
|
|
190
|
+
send(req, res, error?.code === 'BODY_TOO_LARGE' ? 413 : 400, { error: String(error.message || error) })
|
|
191
|
+
return true
|
|
192
|
+
}
|
|
193
|
+
if (!body || typeof body.req !== 'string' || !body.req) {
|
|
194
|
+
send(req, res, 400, { error: '缺少 import req' })
|
|
195
|
+
return true
|
|
196
|
+
}
|
|
197
|
+
results.set(body.req, jsonResult(body))
|
|
198
|
+
if (body.id && ID_RE.test(String(body.id))) {
|
|
199
|
+
try { fs.rmSync(path.join(importDir, `${body.id}.pptx`), { force: true }) } catch { /* 忽略 */ }
|
|
200
|
+
}
|
|
201
|
+
send(req, res, 200, { ok: true })
|
|
202
|
+
return true
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* MCP 工具轮询结果 */
|
|
206
|
+
if (sub === '/import-result' && (req.method === 'GET' || req.method === 'HEAD')) {
|
|
207
|
+
const reqId = u.searchParams.get('req') || ''
|
|
208
|
+
const result = reqId ? results.get(reqId) : null
|
|
209
|
+
send(req, res, 200, result || { done: false })
|
|
210
|
+
return true
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* 编辑器“保存回原文件”:把当前 deck 导出到导入时记录的源路径,先备份。 */
|
|
214
|
+
if (sub === '/save-pptx' && req.method === 'POST') {
|
|
215
|
+
if (!store) {
|
|
216
|
+
send(req, res, 503, { error: 'store 未就绪' })
|
|
217
|
+
return true
|
|
218
|
+
}
|
|
219
|
+
if (saving) {
|
|
220
|
+
send(req, res, 409, { error: '已有保存任务在进行中' })
|
|
221
|
+
return true
|
|
222
|
+
}
|
|
223
|
+
let record = null
|
|
224
|
+
try { record = JSON.parse(fs.readFileSync(sourceRecord, 'utf8')) } catch { /* 没有记录 */ }
|
|
225
|
+
const target = String(record?.path || '')
|
|
226
|
+
if (!target || !/\.pptx$/i.test(target)) {
|
|
227
|
+
send(req, res, 409, { error: '当前 deck 不是从本机 .pptx 打开的;请让 agent 用 ppt_export_pptx 另存' })
|
|
228
|
+
return true
|
|
229
|
+
}
|
|
230
|
+
const deck = store.get().deck
|
|
231
|
+
if (!deck || !Array.isArray(deck.slides) || !deck.slides.length) {
|
|
232
|
+
send(req, res, 409, { error: '当前 deck 没有幻灯片' })
|
|
233
|
+
return true
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
saving = true
|
|
237
|
+
try {
|
|
238
|
+
/* 图片地址的主机取请求自带的 Host(embedded 时就是 dsh 自己的地址,端口也是它的),
|
|
239
|
+
* 业务不写死端口;真没有 Host 才退回回环地址(不带端口 = 80,仅兜底)。 */
|
|
240
|
+
const host = req.headers.host || '127.0.0.1'
|
|
241
|
+
const { buffer, stats } = await renderDeckToPptx(deck, {
|
|
242
|
+
assetBase: `http://${host}${prefix}`,
|
|
243
|
+
includeNotes: true,
|
|
244
|
+
})
|
|
245
|
+
const stamp = new Date().toISOString().replace(/[-:]/g, '').replace(/\..+$/, '')
|
|
246
|
+
const backup = target.replace(/\.pptx$/i, `.bak-${stamp}.pptx`)
|
|
247
|
+
if (fs.existsSync(target)) fs.copyFileSync(target, backup)
|
|
248
|
+
fs.writeFileSync(target, buffer)
|
|
249
|
+
send(req, res, 200, { ok: true, path: target, backup, bytes: buffer.length, stats })
|
|
250
|
+
} catch (error) {
|
|
251
|
+
send(req, res, 500, { error: '保存回原文件失败(可能被 PowerPoint 占用):' + String(error.message || error) })
|
|
252
|
+
} finally {
|
|
253
|
+
saving = false
|
|
254
|
+
}
|
|
255
|
+
return true
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return false
|
|
259
|
+
}
|
|
260
|
+
}
|