@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,346 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 稿件解析:结构化文字稿(.ms.md)→ 版式 spec 序列。
|
|
3
|
+
*
|
|
4
|
+
* 设计约束(长期性来自这几条,不是来自语法好看):
|
|
5
|
+
* 1. 只用 markdown 骨架(## / ### / - / | / >),模型写得稳、人读得懂、git 能 diff;
|
|
6
|
+
* 2. 每页携带显式稳定 id({#p1}),寻址不靠"第几页/第几个元素"——否则只是把
|
|
7
|
+
* element index 漂移换成了行号漂移,同一类 bug 换个皮肤;
|
|
8
|
+
* 3. 版式可省略,但省略时必须**推断并上报**(不静默)。
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const PAGE_RE = /^##\s+(.*)$/
|
|
12
|
+
const COL_RE = /^###\s+(.*)$/
|
|
13
|
+
const SUB_RE = /^\s+[-*]\s+(.*)$/
|
|
14
|
+
const BULLET_RE = /^-\s+(.*)$/
|
|
15
|
+
const QUOTE_RE = /^>\s?(.*)$/
|
|
16
|
+
const AUTHOR_RE = /^[—–]\s*(.*)$/
|
|
17
|
+
const TABLE_RE = /^\|(.*)\|\s*$/
|
|
18
|
+
const FIELD_RE = /^([a-z][a-z_]*)\s*:\s*(.*)$/
|
|
19
|
+
const ATTR_RE = /\{([^}]*)\}\s*$/
|
|
20
|
+
const SEP_ROW_RE = /^[\s|:-]+$/
|
|
21
|
+
|
|
22
|
+
/** 允许出现在页内的字段行;不在表内的 key 会被上报而不是默默吃掉。 */
|
|
23
|
+
const FIELDS = new Set([
|
|
24
|
+
'kicker', 'subtitle', 'foot', 'note', 'index', 'author', 'quote', 'title', 'layout', 'id',
|
|
25
|
+
/* 视觉层也归稿件管:背景色、强调色、演讲者备注、图片。这样「画布上才能做的事」
|
|
26
|
+
* 在稿件里都有写法,就不需要第二条写入口了。 */
|
|
27
|
+
'background', 'accent', 'notes', 'image', 'caption',
|
|
28
|
+
])
|
|
29
|
+
const IMG_RE = /^!\[([^\]]*)\]\(([^)]+)\)\s*$/
|
|
30
|
+
/* 围栏块(图表 / 公式的数据体)与独立公式行:
|
|
31
|
+
* ```chart ... ``` $$ E = mc^2 $$
|
|
32
|
+
* 为什么要围栏:图表数据是多行的,靠字段行写不下;而坐标仍然不给。 */
|
|
33
|
+
const FENCE_RE = /^\s*```(\w*)\s*$/
|
|
34
|
+
const MATH_LINE_RE = /^\$\$(.+?)\$\$\s*$/
|
|
35
|
+
const FENCE_LANGS = new Set(['chart', 'table', 'formula', 'text'])
|
|
36
|
+
/* 值清洗:除了 trim,还要去掉**成对的外层引号**。
|
|
37
|
+
* `background: "#000000"` 是模型/用户最自然的写法之一,引号留在值里会一路进到
|
|
38
|
+
* deck 的 background.color("\"#000000\"")——颜色解析失败、导出的底色失效,
|
|
39
|
+
* 而且稿件的期望 deck 与画布永远不一致(inSync 永远 false)。 */
|
|
40
|
+
const clean = (s) => {
|
|
41
|
+
let text = String(s == null ? '' : s).trim()
|
|
42
|
+
if (text.length >= 2) {
|
|
43
|
+
const first = text[0]
|
|
44
|
+
if ((first === '"' || first === "'") && text[text.length - 1] === first) {
|
|
45
|
+
text = text.slice(1, -1).trim()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return text
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function parseKV(text) {
|
|
52
|
+
const out = {}
|
|
53
|
+
for (const line of text.split('\n')) {
|
|
54
|
+
const t = clean(line)
|
|
55
|
+
if (!t || t.startsWith('#')) continue
|
|
56
|
+
const i = t.indexOf(':')
|
|
57
|
+
if (i < 0) continue
|
|
58
|
+
out[clean(t.slice(0, i))] = clean(t.slice(i + 1))
|
|
59
|
+
}
|
|
60
|
+
return out
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function parseAttrs(text) {
|
|
64
|
+
const out = { attrs: {} }
|
|
65
|
+
for (const tok of text.split(/\s+/).filter(Boolean)) {
|
|
66
|
+
if (tok.startsWith('#')) out.id = tok.slice(1)
|
|
67
|
+
else {
|
|
68
|
+
const i = tok.indexOf('=')
|
|
69
|
+
if (i > 0) out.attrs[clean(tok.slice(0, i))] = clean(tok.slice(i + 1))
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return out
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const last = (arr) => (arr.length ? arr[arr.length - 1] : null)
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 推断版式:只做"结构上确定"的判断,宁可回落到 bullets,也不假装懂。
|
|
79
|
+
* 任何推断都会生成 info 级 finding,让人知道这里是猜的。
|
|
80
|
+
*/
|
|
81
|
+
function inferLayout(page) {
|
|
82
|
+
if (page.latex) return 'formula'
|
|
83
|
+
if (page.fence && page.fence.lang === 'chart') return 'chart'
|
|
84
|
+
if (page.table.length) return 'stat'
|
|
85
|
+
if (page.groups.length >= 2) return 'two'
|
|
86
|
+
if (page.quoteLines.length) return 'quote'
|
|
87
|
+
return 'bullets'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function newPage(seq) {
|
|
91
|
+
return {
|
|
92
|
+
seq,
|
|
93
|
+
id: '',
|
|
94
|
+
title: '',
|
|
95
|
+
layout: null,
|
|
96
|
+
layoutFrom: 'implicit',
|
|
97
|
+
attrs: {},
|
|
98
|
+
fields: {},
|
|
99
|
+
bullets: [],
|
|
100
|
+
groups: [],
|
|
101
|
+
table: [],
|
|
102
|
+
quoteLines: [],
|
|
103
|
+
authorHint: '',
|
|
104
|
+
stray: [],
|
|
105
|
+
fence: null,
|
|
106
|
+
latex: '',
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function pushBullet(page, text) {
|
|
111
|
+
const target = page.groups.length ? last(page.groups).bullets : page.bullets
|
|
112
|
+
target.push({ text: clean(text), detail: '' })
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function lastBullet(page) {
|
|
116
|
+
if (page.groups.length) return last(last(page.groups).bullets)
|
|
117
|
+
return last(page.bullets)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function parseTableRow(line) {
|
|
121
|
+
const inner = line.replace(/^\|/, '').replace(/\|\s*$/, '')
|
|
122
|
+
if (SEP_ROW_RE.test(inner)) return null
|
|
123
|
+
return inner.split('|').map(clean)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function parseManuscript(src) {
|
|
127
|
+
const findings = []
|
|
128
|
+
const text = String(src == null ? '' : src).replace(/\r\n?/g, '\n')
|
|
129
|
+
|
|
130
|
+
let meta = {}
|
|
131
|
+
let body = text
|
|
132
|
+
const fm = text.match(/^---\n([\s\S]*?)\n---[ \t]*\n?/)
|
|
133
|
+
if (fm) {
|
|
134
|
+
meta = parseKV(fm[1])
|
|
135
|
+
body = text.slice(fm[0].length)
|
|
136
|
+
}
|
|
137
|
+
for (const key of Object.keys(meta)) {
|
|
138
|
+
if (!['title', 'preset', 'author', 'subtitle', 'background', 'accent'].includes(key)) {
|
|
139
|
+
findings.push({ level: 'warn', kind: 'unknown-meta', where: key, message: `未知的文档字段「${key}」,已忽略` })
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const pages = []
|
|
144
|
+
let page = null
|
|
145
|
+
let fenceLang = null
|
|
146
|
+
let fenceLines = []
|
|
147
|
+
let mathOpen = false
|
|
148
|
+
let mathLines = []
|
|
149
|
+
|
|
150
|
+
const flush = () => {
|
|
151
|
+
if (!page) return
|
|
152
|
+
if (!page.layout) {
|
|
153
|
+
page.layout = page.layoutFrom === 'attr' ? 'bullets' : inferLayout(page)
|
|
154
|
+
page.layoutFrom = page.layoutFrom === 'attr' ? 'attr' : 'inferred'
|
|
155
|
+
if (page.layoutFrom === 'inferred') {
|
|
156
|
+
findings.push({
|
|
157
|
+
level: 'info', kind: 'layout-inferred', where: page.id || `#${page.seq + 1}`,
|
|
158
|
+
message: `未指定 layout,按内容形态推断为「${page.layout}」`,
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// 结构不匹配:报出来,别让 `- ` 条目在 stat 页上凭空消失。
|
|
163
|
+
if (page.layout === 'stat' && !page.table.length) {
|
|
164
|
+
findings.push({ level: 'error', kind: 'layout-needs-table', where: page.id, message: 'stat 版式需要至少一行 | 数值 | 说明 | 表格' })
|
|
165
|
+
}
|
|
166
|
+
if (page.layout === 'two' && page.groups.length < 2) {
|
|
167
|
+
findings.push({ level: 'error', kind: 'layout-needs-two-columns', where: page.id, message: 'two 版式需要两个 ### 分栏' })
|
|
168
|
+
}
|
|
169
|
+
if (page.layout === 'quote' && !page.quoteLines.length) {
|
|
170
|
+
findings.push({ level: 'error', kind: 'layout-needs-quote', where: page.id, message: 'quote 版式需要 > 引用行' })
|
|
171
|
+
}
|
|
172
|
+
if (page.layout === 'table' && !page.table.length) {
|
|
173
|
+
findings.push({ level: 'error', kind: 'layout-needs-table', where: page.id, message: 'table 版式需要 | 列 | 列 | 表格行(首行当表头)' })
|
|
174
|
+
}
|
|
175
|
+
if (page.layout === 'chart' && !(page.fence && page.fence.lang === 'chart')) {
|
|
176
|
+
findings.push({ level: 'error', kind: 'layout-needs-chart', where: page.id, message: 'chart 版式需要一个 ```chart 围栏(type / labels / series)' })
|
|
177
|
+
}
|
|
178
|
+
if (page.layout === 'formula' && !page.latex) {
|
|
179
|
+
findings.push({ level: 'error', kind: 'layout-needs-formula', where: page.id, message: 'formula 版式需要一行 $$ TeX $$ 公式' })
|
|
180
|
+
}
|
|
181
|
+
/* 围栏写了但版式没用到:报出来,别让数据凭空消失。 */
|
|
182
|
+
if (page.fence && FENCE_LANGS.has(page.fence.lang) && page.fence.lang !== 'text'
|
|
183
|
+
&& !['chart', 'table', 'formula'].includes(page.layout)) {
|
|
184
|
+
findings.push({
|
|
185
|
+
level: 'warn', kind: 'fence-ignored', where: page.id,
|
|
186
|
+
message: `这一页有 \`\`\`${page.fence.lang} 围栏,但 ${page.layout} 版式用不到它(chart / table / formula 版式才用)`,
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
if (page.stray.length) {
|
|
190
|
+
findings.push({
|
|
191
|
+
level: 'warn', kind: 'stray-text', where: page.id,
|
|
192
|
+
message: `有 ${page.stray.length} 行既不是字段也不是条目,未进入 deck:${page.stray[0].slice(0, 40)}`,
|
|
193
|
+
})
|
|
194
|
+
}
|
|
195
|
+
pages.push(page)
|
|
196
|
+
page = null
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (const rawLine of body.split('\n')) {
|
|
200
|
+
const line = rawLine.replace(/\s+$/, '')
|
|
201
|
+
|
|
202
|
+
/* 围栏未闭合时,里面的一切都是数据——包括以 ## 开头的行。 */
|
|
203
|
+
if (fenceLang !== null) {
|
|
204
|
+
const close = line.match(FENCE_RE)
|
|
205
|
+
if (close && !close[1]) {
|
|
206
|
+
if (page) {
|
|
207
|
+
page.fence = { lang: fenceLang, text: fenceLines.join('\n') }
|
|
208
|
+
if (!FENCE_LANGS.has(fenceLang)) {
|
|
209
|
+
findings.push({ level: 'warn', kind: 'unknown-fence', where: page.id, message: `未知的围栏类型 \`\`\`${fenceLang},内容已忽略` })
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
fenceLang = null
|
|
213
|
+
fenceLines = []
|
|
214
|
+
} else {
|
|
215
|
+
fenceLines.push(rawLine)
|
|
216
|
+
}
|
|
217
|
+
continue
|
|
218
|
+
}
|
|
219
|
+
if (mathOpen) {
|
|
220
|
+
if (line.trim() === '$$') {
|
|
221
|
+
if (page) page.latex = mathLines.join('\n').trim()
|
|
222
|
+
mathOpen = false
|
|
223
|
+
mathLines = []
|
|
224
|
+
} else {
|
|
225
|
+
mathLines.push(rawLine)
|
|
226
|
+
}
|
|
227
|
+
continue
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const h2 = line.match(PAGE_RE)
|
|
231
|
+
if (h2) {
|
|
232
|
+
flush()
|
|
233
|
+
page = newPage(pages.length)
|
|
234
|
+
let rest = clean(h2[1])
|
|
235
|
+
const am = rest.match(ATTR_RE)
|
|
236
|
+
if (am) {
|
|
237
|
+
const a = parseAttrs(am[1])
|
|
238
|
+
page.id = a.id || ''
|
|
239
|
+
page.attrs = a.attrs
|
|
240
|
+
rest = clean(rest.slice(0, am.index))
|
|
241
|
+
if (a.attrs.layout) {
|
|
242
|
+
page.layout = a.attrs.layout
|
|
243
|
+
page.layoutFrom = 'attr'
|
|
244
|
+
}
|
|
245
|
+
for (const k of Object.keys(a.attrs)) {
|
|
246
|
+
if (k !== 'layout') {
|
|
247
|
+
findings.push({ level: 'warn', kind: 'unknown-attr', where: page.id, message: `未知页属性「${k}」` })
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
page.title = rest
|
|
252
|
+
if (!page.id) page.id = `p${page.seq + 1}`
|
|
253
|
+
continue
|
|
254
|
+
}
|
|
255
|
+
if (!page) {
|
|
256
|
+
if (clean(line)) {
|
|
257
|
+
findings.push({ level: 'warn', kind: 'orphan-line', where: 'doc', message: `页面之前的内容被忽略:${clean(line).slice(0, 40)}` })
|
|
258
|
+
}
|
|
259
|
+
continue
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
const fenceOpen = line.match(FENCE_RE)
|
|
263
|
+
if (fenceOpen) {
|
|
264
|
+
fenceLang = fenceOpen[1] || 'text'
|
|
265
|
+
fenceLines = []
|
|
266
|
+
continue
|
|
267
|
+
}
|
|
268
|
+
if (line.trim() === '$$') {
|
|
269
|
+
mathOpen = true
|
|
270
|
+
mathLines = []
|
|
271
|
+
continue
|
|
272
|
+
}
|
|
273
|
+
const mathLine = line.match(MATH_LINE_RE)
|
|
274
|
+
if (mathLine) {
|
|
275
|
+
page.latex = clean(mathLine[1])
|
|
276
|
+
continue
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (line.startsWith('### ')) {
|
|
280
|
+
const m = line.match(COL_RE)
|
|
281
|
+
page.groups.push({ heading: clean(m[1]), bullets: [] })
|
|
282
|
+
continue
|
|
283
|
+
}
|
|
284
|
+
const sub = line.match(SUB_RE)
|
|
285
|
+
if (sub) {
|
|
286
|
+
const b = lastBullet(page)
|
|
287
|
+
if (b) b.detail = clean(sub[1])
|
|
288
|
+
else page.stray.push(line)
|
|
289
|
+
continue
|
|
290
|
+
}
|
|
291
|
+
const bul = line.match(BULLET_RE)
|
|
292
|
+
if (bul) {
|
|
293
|
+
pushBullet(page, bul[1])
|
|
294
|
+
continue
|
|
295
|
+
}
|
|
296
|
+
if (TABLE_RE.test(line)) {
|
|
297
|
+
const row = parseTableRow(line)
|
|
298
|
+
if (row) page.table.push(row)
|
|
299
|
+
continue
|
|
300
|
+
}
|
|
301
|
+
const q = line.match(QUOTE_RE)
|
|
302
|
+
if (q) {
|
|
303
|
+
page.quoteLines.push(clean(q[1]))
|
|
304
|
+
continue
|
|
305
|
+
}
|
|
306
|
+
const au = line.match(AUTHOR_RE)
|
|
307
|
+
if (au) {
|
|
308
|
+
page.authorHint = clean(au[1])
|
|
309
|
+
continue
|
|
310
|
+
}
|
|
311
|
+
const img = line.match(IMG_RE)
|
|
312
|
+
if (img) {
|
|
313
|
+
page.image = clean(img[2])
|
|
314
|
+
page.imageAlt = clean(img[1])
|
|
315
|
+
continue
|
|
316
|
+
}
|
|
317
|
+
if (!clean(line)) continue
|
|
318
|
+
const f = line.match(FIELD_RE)
|
|
319
|
+
if (f) {
|
|
320
|
+
const key = f[1]
|
|
321
|
+
if (!FIELDS.has(key)) {
|
|
322
|
+
page.stray.push(line)
|
|
323
|
+
continue
|
|
324
|
+
}
|
|
325
|
+
if (key === 'layout') {
|
|
326
|
+
page.layout = clean(f[2])
|
|
327
|
+
page.layoutFrom = 'attr'
|
|
328
|
+
continue
|
|
329
|
+
}
|
|
330
|
+
if (key === 'id') {
|
|
331
|
+
findings.push({ level: 'warn', kind: 'id-inline', where: page.id, message: 'id 应写在标题的 {#id} 里,字段 id 已忽略' })
|
|
332
|
+
continue
|
|
333
|
+
}
|
|
334
|
+
page.fields[key] = clean(f[2])
|
|
335
|
+
if (key === 'title') page.title = clean(f[2])
|
|
336
|
+
continue
|
|
337
|
+
}
|
|
338
|
+
page.stray.push(line)
|
|
339
|
+
}
|
|
340
|
+
flush()
|
|
341
|
+
|
|
342
|
+
if (!pages.length) {
|
|
343
|
+
findings.push({ level: 'error', kind: 'empty', where: 'doc', message: '稿件里没有任何一页(需要 ## 标题)' })
|
|
344
|
+
}
|
|
345
|
+
return { meta, pages, findings }
|
|
346
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deck → 自包含 HTML(1000×562.5 画布,等比缩放)。
|
|
3
|
+
* 只覆盖引擎当前会产出元素类型(text / shape),其余类型给占位框并标注,
|
|
4
|
+
* 不装作渲染成功——渲染不出来必须看得见。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const esc = (s) => String(s == null ? '' : s)
|
|
8
|
+
.replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]))
|
|
9
|
+
|
|
10
|
+
const num = (v, d = 0) => (Number.isFinite(Number(v)) ? Number(v) : d)
|
|
11
|
+
|
|
12
|
+
function renderElement(el) {
|
|
13
|
+
const box = `left:${num(el.left)}px;top:${num(el.top)}px;width:${num(el.width)}px;height:${num(el.height)}px;`
|
|
14
|
+
const rot = el.rotate ? `transform:rotate(${num(el.rotate)}deg);` : ''
|
|
15
|
+
if (el.type === 'text') {
|
|
16
|
+
/* content 已经是引擎产出的 HTML(textEl 内部对用户文本做过 escapeHtml),
|
|
17
|
+
* 这里必须原样注入;再转义一次就会把 <p style=...> 当字面量显示出来。 */
|
|
18
|
+
return `<div class="el el-text" data-id="${esc(el.id)}" style="${box}${rot}">${el.content || ''}</div>`
|
|
19
|
+
}
|
|
20
|
+
if (el.type === 'shape') {
|
|
21
|
+
const vb = Array.isArray(el.viewBox) && el.viewBox.length === 2 ? el.viewBox : [200, 200]
|
|
22
|
+
const fill = esc(el.fill || 'transparent')
|
|
23
|
+
const path = esc(el.path || 'M 0 0 L 200 0 L 200 200 L 0 200 Z')
|
|
24
|
+
return `<div class="el el-shape" data-id="${esc(el.id)}" style="${box}${rot}">` +
|
|
25
|
+
`<svg viewBox="0 0 ${vb[0]} ${vb[1]}" preserveAspectRatio="none"><path d="${path}" fill="${fill}"/></svg></div>`
|
|
26
|
+
}
|
|
27
|
+
if (el.type === 'image' && el.src) {
|
|
28
|
+
return `<div class="el" data-id="${esc(el.id)}" style="${box}${rot}"><img src="${esc(el.src)}" alt="" style="width:100%;height:100%;object-fit:cover"/></div>`
|
|
29
|
+
}
|
|
30
|
+
return `<div class="el el-unsupported" data-id="${esc(el.id)}" style="${box}${rot}">${esc(el.type || 'unknown')}</div>`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function renderSlide(slide, i) {
|
|
34
|
+
const bg = slide.background && slide.background.color ? slide.background.color : '#ffffff'
|
|
35
|
+
const els = (slide.elements || []).map(renderElement).join('')
|
|
36
|
+
return `<section class="slide" data-index="${i}" data-id="${esc(slide.id)}" style="background:${esc(bg)}">${els}</section>`
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** 只渲染页面部分(编辑器预览用,JS 负责缩放)。 */
|
|
40
|
+
export function renderSlidesHtml(deck) {
|
|
41
|
+
return (deck.slides || []).map(renderSlide).join('')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** 独立 HTML(可直接双击打开 / 传阅 / 存档)。 */
|
|
45
|
+
export function renderStandaloneHtml(deck, opts = {}) {
|
|
46
|
+
const title = esc(deck.title || '稿件编译产物')
|
|
47
|
+
return `<!doctype html>
|
|
48
|
+
<html lang="zh-CN"><head><meta charset="utf-8"/>
|
|
49
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
50
|
+
<title>${title}</title>
|
|
51
|
+
<style>
|
|
52
|
+
:root{--w:1000;--h:562.5}
|
|
53
|
+
*{box-sizing:border-box}
|
|
54
|
+
body{margin:0;background:#0b0e14;font-family:-apple-system,"Segoe UI","Microsoft YaHei",sans-serif}
|
|
55
|
+
.deck{padding:24px;display:flex;flex-direction:column;gap:24px;align-items:center}
|
|
56
|
+
.slide{position:relative;width:1000px;height:562.5px;overflow:hidden;flex:0 0 auto;
|
|
57
|
+
box-shadow:0 8px 32px rgba(0,0,0,.45);border-radius:2px}
|
|
58
|
+
.el{position:absolute}
|
|
59
|
+
.el-text{overflow:hidden}
|
|
60
|
+
.el-text p{margin:0;line-height:1.32;white-space:pre-wrap;word-break:break-word}
|
|
61
|
+
.el-shape svg{display:block;width:100%;height:100%}
|
|
62
|
+
.el-unsupported{outline:1px dashed #f59e0b;color:#f59e0b;font:12px/1.4 monospace;padding:4px}
|
|
63
|
+
@media print{
|
|
64
|
+
body{background:#fff}
|
|
65
|
+
.deck{padding:0;gap:0}
|
|
66
|
+
.slide{box-shadow:none;page-break-after:always;border-radius:0}
|
|
67
|
+
}
|
|
68
|
+
</style></head>
|
|
69
|
+
<body><div class="deck">${renderSlidesHtml(deck)}</div>
|
|
70
|
+
<script>
|
|
71
|
+
// 等比缩放到视口宽度(画布逻辑坐标恒为 1000×562.5,不做二次排版)
|
|
72
|
+
function fit(){
|
|
73
|
+
var w = Math.min(document.documentElement.clientWidth - 48, 1280)
|
|
74
|
+
var s = w / 1000
|
|
75
|
+
document.querySelectorAll('.slide').forEach(function(el){
|
|
76
|
+
el.style.transformOrigin = 'top center'
|
|
77
|
+
el.style.transform = 'scale(' + s + ')'
|
|
78
|
+
el.style.marginBottom = (562.5 * (s - 1)) + 'px'
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
addEventListener('resize', fit); fit()
|
|
82
|
+
</script>
|
|
83
|
+
</body></html>`
|
|
84
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 稿件 → deck 的「落地」层。
|
|
3
|
+
*
|
|
4
|
+
* 单一真源之后这里只剩一件事:把「编译结果」写进工作台时,尽量只动真正变了的页。
|
|
5
|
+
* 整份 load 会让编辑器重画整份 deck——用户看到的就是「先变白、再变蓝、最后才删页」。
|
|
6
|
+
*
|
|
7
|
+
* 曾经这里还有 applyPresentation / applyGeometry:把工作台上人工拖过的框、单独调过的
|
|
8
|
+
* 底色搬到新产物上。那是第二条真源,也是「改字把蓝色打回白色」「只挪了个位置被判
|
|
9
|
+
* drift」这类 bug 的根。现在视觉层(background / accent / notes / image)已经写进稿件
|
|
10
|
+
* 语法,deck 是稿件的纯函数,那两层被删掉了。工作台画布上的手动改动只影响当前画面,
|
|
11
|
+
* 下一次改稿会被重排——这是单一真源的代价,也已经写进 instructions 告诉模型。
|
|
12
|
+
*
|
|
13
|
+
* 剩下的配对难点是 id:编译产物的 id 里带页序号(lt_bullets_3),删掉第 7 页之后
|
|
14
|
+
* 后面每页的 id 都会变。所以 diff 按「内容签名」而不是按 id 配。
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const textOf = (e) => String(e.content ?? e.text ?? e.value ?? '')
|
|
18
|
+
|
|
19
|
+
/** 比较两页时忽略 id:编译产物的 id 里带页序号,删一页后面全变,
|
|
20
|
+
* 但那些页的内容一个字都没动——不该为此重画。 */
|
|
21
|
+
const withoutIds = (s) => JSON.stringify(s, (k, v) => (k === 'id' ? undefined : v))
|
|
22
|
+
const samePage = (a, b) => withoutIds(a) === withoutIds(b)
|
|
23
|
+
|
|
24
|
+
/** 内容签名:忽略 id、几何、背景,只认「这一页由哪些元素、什么文字构成」。 */
|
|
25
|
+
export function slideSig(slide) {
|
|
26
|
+
const els = (slide && slide.elements ? slide.elements : []).map(
|
|
27
|
+
(e) => `${e.type || ''}:${textOf(e)}`,
|
|
28
|
+
)
|
|
29
|
+
return `${slide && slide.layout ? slide.layout : ''}\u0002${els.join('\u0001')}`
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function lcsPairs(a, b) {
|
|
33
|
+
const n = a.length
|
|
34
|
+
const m = b.length
|
|
35
|
+
const dp = Array.from({ length: n + 1 }, () => new Int32Array(m + 1))
|
|
36
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
37
|
+
for (let j = m - 1; j >= 0; j--) {
|
|
38
|
+
dp[i][j] = a[i] === b[j] ? dp[i + 1][j + 1] + 1 : Math.max(dp[i + 1][j], dp[i][j + 1])
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const pairs = []
|
|
42
|
+
let i = 0
|
|
43
|
+
let j = 0
|
|
44
|
+
while (i < n && j < m) {
|
|
45
|
+
if (a[i] === b[j]) { pairs.push([i, j]); i++; j++ }
|
|
46
|
+
else if (dp[i + 1][j] >= dp[i][j + 1]) i++
|
|
47
|
+
else j++
|
|
48
|
+
}
|
|
49
|
+
return pairs
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 最小 op 序列。返回 null 表示「这次别打补丁」,调用方退回一次 load。
|
|
54
|
+
* 之所以要算 LCS:删一页会让后面每页的文字/签名都还在,但 id 全变;
|
|
55
|
+
* 按 id 比会得出「删 1 页 + 改 20 页」,按签名比才是「删 1 页」。
|
|
56
|
+
*/
|
|
57
|
+
export function deckDiffOps(prev, next, { limit = 60 } = {}) {
|
|
58
|
+
const p = (prev && prev.slides) || []
|
|
59
|
+
const n = (next && next.slides) || []
|
|
60
|
+
if (!p.length) return null
|
|
61
|
+
if (JSON.stringify(prev.theme || null) !== JSON.stringify(next.theme || null)) return null
|
|
62
|
+
|
|
63
|
+
const pairs = lcsPairs(p.map(slideSig), n.map(slideSig))
|
|
64
|
+
const keptPrev = new Set(pairs.map(([i]) => i))
|
|
65
|
+
const keptNext = new Set(pairs.map(([, j]) => j))
|
|
66
|
+
|
|
67
|
+
const freePrev = p.map((_, i) => i).filter((i) => !keptPrev.has(i))
|
|
68
|
+
const freeNext = n.map((_, j) => j).filter((j) => !keptNext.has(j))
|
|
69
|
+
|
|
70
|
+
/* 剩下的一对一按顺序认成「改过的页」:它们应该走 update-slide,而不是删了再加。
|
|
71
|
+
* 这样改一页只重画那一页,不会整份重排。 */
|
|
72
|
+
const target = new Map()
|
|
73
|
+
for (const [i, j] of pairs) target.set(j, i)
|
|
74
|
+
const paired = Math.min(freePrev.length, freeNext.length)
|
|
75
|
+
for (let x = 0; x < paired; x++) target.set(freeNext[x], freePrev[x])
|
|
76
|
+
|
|
77
|
+
const ops = []
|
|
78
|
+
const keep = new Set(target.values())
|
|
79
|
+
for (let i = p.length - 1; i >= 0; i--) if (!keep.has(i)) ops.push({ op: 'remove-slide', index: i })
|
|
80
|
+
if (ops.length > 20) return null
|
|
81
|
+
|
|
82
|
+
const cur = p.map((_, i) => i).filter((i) => keep.has(i))
|
|
83
|
+
for (let j = 0; j < n.length; j++) {
|
|
84
|
+
const i = target.get(j)
|
|
85
|
+
if (i == null) {
|
|
86
|
+
ops.push({ op: 'add-slide', index: j, slide: n[j] })
|
|
87
|
+
cur.splice(j, 0, -1 - j)
|
|
88
|
+
continue
|
|
89
|
+
}
|
|
90
|
+
const at = cur.indexOf(i)
|
|
91
|
+
if (at !== j) {
|
|
92
|
+
ops.push({ op: 'move-slide', from: at, to: j })
|
|
93
|
+
const [x] = cur.splice(at, 1)
|
|
94
|
+
cur.splice(j, 0, x)
|
|
95
|
+
}
|
|
96
|
+
if (!samePage(p[i], n[j])) {
|
|
97
|
+
ops.push({ op: 'update-slide', index: j, slide: n[j] })
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return ops.length <= limit ? ops : null
|
|
101
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 文字的「一把尺子」:`ppt_audit` 与 `ppt_inspect` 共用同一套估算。
|
|
3
|
+
*
|
|
4
|
+
* 为什么必须共用:同一页如果出现两种结论(审计说溢出、体检说没问题),
|
|
5
|
+
* 模型就会去修一个本来没错的地方——这正是「看一眼第三页」花掉 175 秒的成因之一。
|
|
6
|
+
*
|
|
7
|
+
* 不是排版器,是量级判断:
|
|
8
|
+
* - 行高按 1.5 倍字号(PPTist 的 `.element-content{line-height:1.5}`,也是版式表里
|
|
9
|
+
* 「22px 文字配 34px 框」的来源);
|
|
10
|
+
* - 宽度按逐字 em 累加(全角 1em、数字 0.56em、小写 0.52em),比「整串按 CJK 与否
|
|
11
|
+
* 一刀切」更贴近实际折行,避免中文里夹几个数字就被误判成两行;
|
|
12
|
+
* - 段落之间 PPTist 有 5px 间距(`--paragraphSpace` 默认值)。
|
|
13
|
+
* 误差由调用方的门限吸收,不追求像素级一致。
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export const DEFAULT_FONT = 20
|
|
17
|
+
export const LINE_HEIGHT = 1.5
|
|
18
|
+
export const PARAGRAPH_GAP = 5
|
|
19
|
+
export const CANVAS_W = 1000
|
|
20
|
+
export const CANVAS_H = 562.5
|
|
21
|
+
|
|
22
|
+
/** 单个字符的宽度(em)。 */
|
|
23
|
+
export function emOf(char) {
|
|
24
|
+
const code = char.codePointAt(0)
|
|
25
|
+
if (
|
|
26
|
+
(code >= 0x1100 && code <= 0x115f) || // 韩文首字母
|
|
27
|
+
(code >= 0x2e80 && code <= 0xa4cf) || // 中日韩部首、标点、汉字、假名
|
|
28
|
+
(code >= 0xac00 && code <= 0xd7a3) || // 韩文音节
|
|
29
|
+
(code >= 0xf900 && code <= 0xfaff) || // 兼容汉字
|
|
30
|
+
(code >= 0xfe30 && code <= 0xfe4f) || // 竖排标点
|
|
31
|
+
(code >= 0xff00 && code <= 0xff60) || // 全角 ASCII
|
|
32
|
+
(code >= 0xffe0 && code <= 0xffe6) || // 全角符号
|
|
33
|
+
(code >= 0x1f300 && code <= 0x1f9ff) // emoji(近似全角)
|
|
34
|
+
) return 1
|
|
35
|
+
if (char === ' ' || char === '\t' || char === '\u00a0') return 0.3
|
|
36
|
+
if (code >= 0x30 && code <= 0x39) return 0.56 // 0-9
|
|
37
|
+
if (code >= 0x41 && code <= 0x5a) return 0.6 // A-Z
|
|
38
|
+
if (code >= 0x61 && code <= 0x7a) return 0.52 // a-z
|
|
39
|
+
return 0.55
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 一整串文字的宽度(em)。 */
|
|
43
|
+
export function emUnits(text) {
|
|
44
|
+
let total = 0
|
|
45
|
+
for (const char of String(text == null ? '' : text)) total += emOf(char)
|
|
46
|
+
return total
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 单段文字的估算:能排几行、要占多高。
|
|
51
|
+
* @param {string} text 单段(不含换行)文字
|
|
52
|
+
* @param {{width?: number, fontSize?: number}} box 文本框宽度与字号
|
|
53
|
+
* @returns {{units: number, capacity: number, lines: number, need: number}}
|
|
54
|
+
*/
|
|
55
|
+
export function measureText(text, { width, fontSize = DEFAULT_FONT } = {}) {
|
|
56
|
+
const w = Math.max(1, Number(width) || 0)
|
|
57
|
+
const fs = Math.max(1, Number(fontSize) || DEFAULT_FONT)
|
|
58
|
+
const units = emUnits(text)
|
|
59
|
+
/* 每行能放的 em 数:框宽 / 字号。0.5em 下限避免宽度为 0 时除出 Infinity。 */
|
|
60
|
+
const capacity = Math.max(0.5, w / fs)
|
|
61
|
+
const lines = Math.max(1, Math.ceil(units / capacity))
|
|
62
|
+
return { units, capacity, lines, need: Math.round(lines * fs * LINE_HEIGHT) }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** HTML 里声明过的最大字号;没有则 0。 */
|
|
66
|
+
export function fontSizeFromHtml(html) {
|
|
67
|
+
let size = 0
|
|
68
|
+
for (const match of String(html || '').matchAll(/font-size\s*:\s*(\d+(?:\.\d+)?)\s*px/gi)) {
|
|
69
|
+
size = Math.max(size, Number(match[1]))
|
|
70
|
+
}
|
|
71
|
+
return size
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 「这一页的字真的挤出框了吗」——审计与体检共用同一个判定。
|
|
76
|
+
*
|
|
77
|
+
* 为什么不能按 need > height 直接报:PPTist 的文字框 line-height 是 1.5,
|
|
78
|
+
* 行盒本来就比字墨高一截(60px 的字,行盒 90px)。实测一个 60px 的数字放在 80px 的框里
|
|
79
|
+
* 只溢出 10px,视觉上完全正常——报出来只会让模型去改一个没错的地方。
|
|
80
|
+
* 所以只有溢出超过半行才算数;超过一整行才算 error(那是真的压到别的元素了)。
|
|
81
|
+
*
|
|
82
|
+
* @returns {null | {spill: number, severity: 'warning'|'error'}}
|
|
83
|
+
*/
|
|
84
|
+
export function overflowOf({ need, height, fontSize = DEFAULT_FONT }) {
|
|
85
|
+
const box = Math.max(0, Number(height) || 0)
|
|
86
|
+
const spill = (Number(need) || 0) - box
|
|
87
|
+
const size = Number(fontSize) || DEFAULT_FONT
|
|
88
|
+
/* 半行是可视阈值:再小的差值是行盒留白,不是排版事故。 */
|
|
89
|
+
if (spill <= Math.max(4, size * 0.5)) return null
|
|
90
|
+
return { spill: Math.round(spill), severity: spill > size ? 'error' : 'warning' }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 元素上的字号:先看 content 里 inline 的 font-size,再看元素字段,最后兜底 20px。
|
|
95
|
+
* @param {object} element deck 元素
|
|
96
|
+
* @param {(element: object) => string} htmlOf 取文字 HTML 的函数(core/text.js 提供)
|
|
97
|
+
*/
|
|
98
|
+
export function elementFontSize(element, htmlOf = () => '') {
|
|
99
|
+
const size = fontSizeFromHtml(htmlOf(element))
|
|
100
|
+
if (size) return size
|
|
101
|
+
return Number(
|
|
102
|
+
element && (element.fontSize ?? element.style?.fontSize ?? element.text?.fontSize),
|
|
103
|
+
) || DEFAULT_FONT
|
|
104
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 浏览器专用 op 适配器:大图压缩。
|
|
3
|
+
*
|
|
4
|
+
* 不进入 core/ops 的分发器;编辑器把 `shrinkImage` 作为
|
|
5
|
+
* `ctx.media.prepareImage` 注入。Node 侧(relay/stdio)不 import 本文件。
|
|
6
|
+
*/
|
|
7
|
+
export async function shrinkImage(el) {
|
|
8
|
+
if (typeof document === 'undefined') return el
|
|
9
|
+
const src = String(el.src || '')
|
|
10
|
+
if (!/^data:image\//i.test(src) || src.length < 250000) return el
|
|
11
|
+
try {
|
|
12
|
+
const img = await new Promise((resolve, reject) => {
|
|
13
|
+
const im = new Image()
|
|
14
|
+
im.onload = () => resolve(im)
|
|
15
|
+
im.onerror = reject
|
|
16
|
+
im.src = src
|
|
17
|
+
})
|
|
18
|
+
const maxW = 1600
|
|
19
|
+
const scale = Math.min(1, maxW / (img.width || maxW))
|
|
20
|
+
if (scale >= 1 && src.length < 900000) return el
|
|
21
|
+
const cv = document.createElement('canvas')
|
|
22
|
+
cv.width = Math.max(1, Math.round((img.width || maxW) * scale))
|
|
23
|
+
cv.height = Math.max(1, Math.round((img.height || maxW) * scale))
|
|
24
|
+
cv.getContext('2d').drawImage(img, 0, 0, cv.width, cv.height)
|
|
25
|
+
el.src = cv.toDataURL('image/jpeg', 0.85)
|
|
26
|
+
} catch (e) { /* 压缩失败保留原图 */ }
|
|
27
|
+
return el
|
|
28
|
+
}
|