@capyclaw/ppt-suite 2.4.10 → 2.5.67
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 +223 -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 +91 -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 +159 -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 +68 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +113 -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 +87 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/events.mjs +60 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/log.mjs +51 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/net.mjs +188 -0
- package/node_modules/@capyclaw/foundation/package.json +53 -0
- package/node_modules/@capyclaw/foundation/runtime/index.mjs +20 -0
- package/node_modules/@capyclaw/plugin-kit/INTEGRATION.md +100 -0
- package/node_modules/@capyclaw/plugin-kit/README.md +70 -0
- package/node_modules/@capyclaw/plugin-kit/bin/sync.mjs +103 -0
- package/node_modules/@capyclaw/plugin-kit/package.json +69 -0
- package/node_modules/@capyclaw/plugin-kit/src/cli.mjs +56 -0
- package/node_modules/@capyclaw/plugin-kit/src/config.mjs +142 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat-worker.js +129 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +139 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/shadow.mjs +219 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/transport.js +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/index.mjs +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/pack.mjs +230 -0
- package/node_modules/@capyclaw/plugin-kit/src/runtime/context.mjs +128 -0
- package/node_modules/@capyclaw/plugin-kit/src/self-contained.mjs +307 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/api.mjs +45 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/http.mjs +113 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +143 -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 +41 -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 +29 -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 +303 -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 +325 -0
- package/node_modules/@capyclaw/service-broker/lib/skills-client.mjs +28 -0
- package/node_modules/@capyclaw/service-broker/lib/spec.mjs +78 -0
- package/node_modules/@capyclaw/service-broker/package.json +65 -0
- package/node_modules/@capyclaw/service-broker/server.mjs +81 -0
- package/node_modules/@capyclaw/service-broker/service.schema.json +62 -0
- package/node_modules/@capyclaw/service-broker/services.json +3 -0
- package/node_modules/@capyclaw/service-host/README.md +86 -0
- package/node_modules/@capyclaw/service-host/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/service-host/dsh-suite.json +29 -0
- package/node_modules/@capyclaw/service-host/lib/host.mjs +22 -0
- package/node_modules/@capyclaw/service-host/package.json +60 -0
- package/node_modules/@capyclaw/service-host/src/index.mjs +571 -0
- package/node_modules/@capyclaw/service-host/src/tuning.mjs +63 -0
- package/node_modules/@capyclaw/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 +142 -0
- package/node_modules/@capyclaw/tool-host/src/index.mjs +390 -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/playwright-core/LICENSE +202 -0
- package/node_modules/playwright-core/NOTICE +5 -0
- package/node_modules/playwright-core/README.md +3 -0
- package/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
- package/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/node_modules/playwright-core/browsers.json +52 -0
- package/node_modules/playwright-core/cli.js +22 -0
- package/node_modules/playwright-core/index.d.ts +17 -0
- package/node_modules/playwright-core/index.js +17 -0
- package/node_modules/playwright-core/index.mjs +28 -0
- package/node_modules/playwright-core/lib/bootstrap.js +149 -0
- package/node_modules/playwright-core/lib/coreBundle.js +78041 -0
- package/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
- package/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
- package/node_modules/playwright-core/lib/entry/mcp.js +10 -0
- package/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
- package/node_modules/playwright-core/lib/package.js +50 -0
- package/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/server/electron/loader.js +123 -0
- package/node_modules/playwright-core/lib/serverRegistry.js +1939 -0
- package/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +65 -0
- package/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
- package/node_modules/playwright-core/lib/tools/cli-client/cli.js +7 -0
- package/node_modules/playwright-core/lib/tools/cli-client/help.json +808 -0
- package/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
- package/node_modules/playwright-core/lib/tools/cli-client/output.js +352 -0
- package/node_modules/playwright-core/lib/tools/cli-client/program.js +422 -0
- package/node_modules/playwright-core/lib/tools/cli-client/registry.js +180 -0
- package/node_modules/playwright-core/lib/tools/cli-client/session.js +261 -0
- package/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/SKILL.md +493 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/element-attributes.md +23 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/pr-attachments.md +60 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/request-mocking.md +87 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/running-code.md +245 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/session-management.md +227 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/storage-state.md +275 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/test-generation.md +433 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/tracing.md +139 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-cli/references/video-recording.md +216 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/SKILL.md +136 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/gallery-spec.md +144 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/migration.md +89 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/react.md +69 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/typing.md +173 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-component-testing/references/vue.md +77 -0
- package/node_modules/playwright-core/lib/tools/skills/playwright-trace/SKILL.md +174 -0
- package/node_modules/playwright-core/lib/tools/utils/extension.js +112 -0
- package/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
- package/node_modules/playwright-core/lib/utilsBundle.js +86078 -0
- package/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +1890 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codeMirrorModule-CQ8RZGBm.js +32 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-AwgwcYie.css +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/index-hRvO4yU2.js +12 -0
- package/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
- package/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
- package/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-DK72OMRi.js +32 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-BZpYJZ-P.css +1 -0
- package/node_modules/playwright-core/lib/vite/recorder/assets/index-Cn0mmDuv.js +129 -0
- package/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js +32 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-D-g2vrvf.js +184 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-B794rD2Z.js +7 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.C8BeHuxd.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/index.oNry3Hjv.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CYwC_gH1.js +5 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CyMfwkXJ.css +1 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
- package/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
- package/node_modules/playwright-core/lib/webp_codec.LICENSE +173 -0
- package/node_modules/playwright-core/lib/webp_codec.wasm +0 -0
- package/node_modules/playwright-core/lib/xdg-open +1267 -0
- package/node_modules/playwright-core/package.json +34 -0
- package/node_modules/playwright-core/types/protocol.d.ts +24776 -0
- package/node_modules/playwright-core/types/structs.d.ts +52 -0
- package/node_modules/playwright-core/types/types.d.ts +27167 -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,81 @@
|
|
|
1
|
+
/** 页面管理能力。 */
|
|
2
|
+
import { simpleSlide } from '../domains/slide.mjs'
|
|
3
|
+
import { okText } from '../domains/tooling.mjs'
|
|
4
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
5
|
+
|
|
6
|
+
export const slideCapability = defineCapability({
|
|
7
|
+
id: 'slide',
|
|
8
|
+
title: '页面管理',
|
|
9
|
+
tags: ['write', 'structure'],
|
|
10
|
+
requires: ['deck'],
|
|
11
|
+
features: ['deck.write'],
|
|
12
|
+
tools: [
|
|
13
|
+
defineTool({
|
|
14
|
+
name: 'ppt_slide',
|
|
15
|
+
description: '页管理:add(标题+要点)/remove/move/duplicate/select。',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
action: { type: 'string', enum: ['add', 'remove', 'move', 'duplicate', 'select'] },
|
|
20
|
+
index: { type: 'integer', description: '目标页号(0 起);add 时为插入位置,缺省末尾' },
|
|
21
|
+
to: { type: 'integer', description: 'move 的目标位置' },
|
|
22
|
+
title: { type: 'string', maxLength: 40, description: 'add 的标题' },
|
|
23
|
+
bullets: { type: 'array', maxItems: 8, items: { type: 'string', maxLength: 80 } },
|
|
24
|
+
background: { type: 'string' },
|
|
25
|
+
},
|
|
26
|
+
required: ['action'],
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
},
|
|
29
|
+
kind: 'write',
|
|
30
|
+
since: '1.0.0',
|
|
31
|
+
handler: async ({ action, index, to, title, bullets, background }, ctx) => {
|
|
32
|
+
const slideCount = async () => {
|
|
33
|
+
const doc = await ctx.deck.read()
|
|
34
|
+
return doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0
|
|
35
|
+
}
|
|
36
|
+
const requirePage = (value, label = 'index') => {
|
|
37
|
+
const n = Number(value)
|
|
38
|
+
if (!Number.isInteger(n) || n < 0) throw new Error(`ppt_slide ${action} 需要 ${label}(0 起整数)`)
|
|
39
|
+
return n
|
|
40
|
+
}
|
|
41
|
+
if (action === 'add') {
|
|
42
|
+
const count = await slideCount()
|
|
43
|
+
let at = index != null ? Math.min(requirePage(index), count) : count
|
|
44
|
+
const r = await ctx.deck.write([{ op: 'add-slide', slide: simpleSlide(title || '新一页', bullets, background), index: at }])
|
|
45
|
+
return okText(r, `已加一页「${title || '新一页'}」`)
|
|
46
|
+
}
|
|
47
|
+
if (action === 'remove') {
|
|
48
|
+
const count = await slideCount()
|
|
49
|
+
const i = requirePage(index)
|
|
50
|
+
if (i >= count) throw new Error(`页号越界:${i}(共 ${count} 页)`)
|
|
51
|
+
const r = await ctx.deck.write([{ op: 'remove-slide', id: i }])
|
|
52
|
+
return okText(r, `已删除第 ${i} 页`)
|
|
53
|
+
}
|
|
54
|
+
if (action === 'move') {
|
|
55
|
+
const count = await slideCount()
|
|
56
|
+
const from = requirePage(index)
|
|
57
|
+
const target = requirePage(to, 'to')
|
|
58
|
+
if (from >= count) throw new Error(`页号越界:${from}(共 ${count} 页)`)
|
|
59
|
+
if (target >= count) throw new Error(`目标页号越界:${target}(共 ${count} 页)`)
|
|
60
|
+
const r = await ctx.deck.write([{ op: 'move-slide', from, to: target }])
|
|
61
|
+
return okText(r, `已移动第 ${from} 页到 ${target}`)
|
|
62
|
+
}
|
|
63
|
+
if (action === 'duplicate') {
|
|
64
|
+
const count = await slideCount()
|
|
65
|
+
const i = requirePage(index)
|
|
66
|
+
if (i >= count) throw new Error(`页号越界:${i}(共 ${count} 页)`)
|
|
67
|
+
const r = await ctx.deck.write([{ op: 'duplicate-slide', id: i }])
|
|
68
|
+
return okText(r, `已复制第 ${i} 页`)
|
|
69
|
+
}
|
|
70
|
+
if (action === 'select') {
|
|
71
|
+
const count = await slideCount()
|
|
72
|
+
const i = requirePage(index)
|
|
73
|
+
if (i >= count) throw new Error(`页号越界:${i}(共 ${count} 页)`)
|
|
74
|
+
const r = await ctx.deck.write([{ op: 'select', id: i }])
|
|
75
|
+
return okText(r, `已选中第 ${i} 页`)
|
|
76
|
+
}
|
|
77
|
+
throw new Error('未知 action: ' + action)
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
],
|
|
81
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** 样式能力:背景色、文字颜色、字体名、主题色。 */
|
|
2
|
+
import { resolveColor } from '../domains/color.mjs'
|
|
3
|
+
import { clamp, normalizeSlides, okText } from '../domains/tooling.mjs'
|
|
4
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
5
|
+
|
|
6
|
+
export const styleCapability = defineCapability({
|
|
7
|
+
id: 'style',
|
|
8
|
+
title: '主题与背景',
|
|
9
|
+
tags: ['write', 'style'],
|
|
10
|
+
requires: ['deck'],
|
|
11
|
+
features: ['deck.write'],
|
|
12
|
+
tools: [
|
|
13
|
+
defineTool({
|
|
14
|
+
name: 'ppt_style',
|
|
15
|
+
description: '整体样式:背景色(可指定页),文字颜色,字体名,主题色数组。浅底会自动配深字、深底配白字。',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
background: { type: 'string', description: '背景色(CSS 或中文色名)' },
|
|
20
|
+
slides: { type: 'array', items: { type: 'integer' }, description: '只改这些页的背景;缺省全部' },
|
|
21
|
+
contrast: { type: 'boolean', description: '自动对比度,缺省 true' },
|
|
22
|
+
text_color: { type: 'string', description: '全局正文颜色' },
|
|
23
|
+
font_name: { type: 'string' },
|
|
24
|
+
theme_colors: { type: 'array', items: { type: 'string' }, description: '主题色数组' },
|
|
25
|
+
},
|
|
26
|
+
additionalProperties: false,
|
|
27
|
+
},
|
|
28
|
+
kind: 'write',
|
|
29
|
+
since: '1.0.0',
|
|
30
|
+
handler: async ({ background, slides, contrast, text_color, font_name, theme_colors }, ctx) => {
|
|
31
|
+
const ops = []
|
|
32
|
+
if (background) {
|
|
33
|
+
const cmd = { op: 'set-background', color: resolveColor(background), contrast: contrast !== false }
|
|
34
|
+
const targets = normalizeSlides(slides)
|
|
35
|
+
if (targets) cmd.indices = targets
|
|
36
|
+
ops.push(cmd)
|
|
37
|
+
}
|
|
38
|
+
const theme = {}
|
|
39
|
+
if (text_color) theme.fontColor = resolveColor(text_color)
|
|
40
|
+
if (font_name) theme.fontName = String(font_name)
|
|
41
|
+
if (Array.isArray(theme_colors) && theme_colors.length) theme.themeColors = theme_colors.map(resolveColor)
|
|
42
|
+
if (Object.keys(theme).length) ops.push({ op: 'theme', theme })
|
|
43
|
+
const r = await ctx.deck.write(ops)
|
|
44
|
+
return okText(r, '样式已更新')
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
})
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** 表格能力:把二维数据直接变成 PPTist 原生表格,支持表头样式与单元格精修。 */
|
|
2
|
+
import { clamp, okText } from '../domains/tooling.mjs'
|
|
3
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
4
|
+
|
|
5
|
+
export const tableCapability = defineCapability({
|
|
6
|
+
id: 'table',
|
|
7
|
+
title: '表格',
|
|
8
|
+
tags: ['write', 'data'],
|
|
9
|
+
requires: ['deck'],
|
|
10
|
+
features: ['deck.table'],
|
|
11
|
+
tools: [
|
|
12
|
+
defineTool({
|
|
13
|
+
name: 'ppt_table',
|
|
14
|
+
description:
|
|
15
|
+
'插入或整体更新表格(PPTist 原生表格)。rows 为二维数组,字符串/数字直接作单元格;' +
|
|
16
|
+
'header: true 时首行渲染为加粗底色表头。带 element_id 时整体替换该表格数据。',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
slide: { type: 'integer', description: '0 起页号,默认 0' },
|
|
21
|
+
rows: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
description: '二维数组,如 [["区域","目标"],["华东",70],["华南",66]];单元格也可用对象 {text, bold, color, backcolor, align, fontsize}',
|
|
24
|
+
items: { type: 'array' },
|
|
25
|
+
},
|
|
26
|
+
header: { type: 'boolean', description: '首行作为表头(加粗 + 主题色浅底)' },
|
|
27
|
+
theme_color: { type: 'string', description: '表格主题色(表头底色由此淡化生成),默认 #5b9bd5' },
|
|
28
|
+
element_id: { type: 'string', description: '更新模式:整体替换该表格的数据/列宽' },
|
|
29
|
+
col_widths: { type: 'array', items: { type: 'number' }, description: '列宽比例或像素(自动归一)' },
|
|
30
|
+
cell_min_height: { type: 'number', description: '单元格最小高度,默认 36' },
|
|
31
|
+
left: { type: 'number' },
|
|
32
|
+
top: { type: 'number' },
|
|
33
|
+
width: { type: 'number' },
|
|
34
|
+
height: { type: 'number' },
|
|
35
|
+
},
|
|
36
|
+
required: ['slide', 'rows'],
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
},
|
|
39
|
+
kind: 'write',
|
|
40
|
+
since: '2.2.0',
|
|
41
|
+
handler: async (args, ctx) => {
|
|
42
|
+
const i = clamp(Number(args.slide) | 0, 0, 999)
|
|
43
|
+
const p = args || {}
|
|
44
|
+
if (p.element_id) {
|
|
45
|
+
const props = {}
|
|
46
|
+
if (p.rows != null) {
|
|
47
|
+
// 整体替换:重建 data,保留原主题色
|
|
48
|
+
const element = { rows: p.rows, header: Boolean(p.header), themeColor: p.theme_color }
|
|
49
|
+
const r0 = await ctx.deck.write([{ op: 'remove-element', slide: i, elementId: String(p.element_id) }])
|
|
50
|
+
if (!r0.ok) return { text: `替换失败:${r0.error}` }
|
|
51
|
+
const r = await ctx.deck.write([{ op: 'add-table', slide: i, element }])
|
|
52
|
+
return okText(r, `已重建表格 ${p.element_id}`)
|
|
53
|
+
}
|
|
54
|
+
if (p.theme_color) props.themeColor = p.theme_color
|
|
55
|
+
if (p.header != null) props.rowHeader = Boolean(p.header)
|
|
56
|
+
if (Array.isArray(p.col_widths)) props.colWidths = p.col_widths
|
|
57
|
+
for (const k of ['left', 'top', 'width', 'height']) {
|
|
58
|
+
if (p[k] != null) props[k] = p[k]
|
|
59
|
+
}
|
|
60
|
+
const r = await ctx.deck.write([{ op: 'update-table', slide: i, elementId: String(p.element_id), props }])
|
|
61
|
+
return okText(r, `已更新表格 ${p.element_id}`)
|
|
62
|
+
}
|
|
63
|
+
const element = {
|
|
64
|
+
rows: p.rows,
|
|
65
|
+
header: Boolean(p.header),
|
|
66
|
+
...(p.theme_color ? { themeColor: p.theme_color } : {}),
|
|
67
|
+
...(Array.isArray(p.col_widths) ? { colWidths: p.col_widths } : {}),
|
|
68
|
+
...(p.cell_min_height != null ? { cellMinHeight: p.cell_min_height } : {}),
|
|
69
|
+
}
|
|
70
|
+
for (const k of ['left', 'top', 'width', 'height']) {
|
|
71
|
+
if (p[k] != null) element[k] = p[k]
|
|
72
|
+
}
|
|
73
|
+
const r = await ctx.deck.write([{ op: 'add-table', slide: i, element }])
|
|
74
|
+
return okText(r, `已在第 ${i} 页插入表格(${p.rows.length} 行)`)
|
|
75
|
+
},
|
|
76
|
+
}),
|
|
77
|
+
|
|
78
|
+
defineTool({
|
|
79
|
+
name: 'ppt_table_cells',
|
|
80
|
+
description:
|
|
81
|
+
'精修已有表格的单元格:改文字 / 加粗 / 颜色 / 底色 / 对齐 / 字号,也可换表格主题色。' +
|
|
82
|
+
'行号列号从 0 起,元素 id 可用 ppt_get_deck 查询。',
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
slide: { type: 'integer', description: '0 起页号,默认 0' },
|
|
87
|
+
element_id: { type: 'string', description: '表格元素 id' },
|
|
88
|
+
cells: {
|
|
89
|
+
type: 'array',
|
|
90
|
+
description: '单元格补丁列表',
|
|
91
|
+
items: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
row: { type: 'integer', description: '0 起行号' },
|
|
95
|
+
col: { type: 'integer', description: '0 起列号' },
|
|
96
|
+
text: { type: 'string' },
|
|
97
|
+
bold: { type: 'boolean' },
|
|
98
|
+
color: { type: 'string', description: '文字颜色' },
|
|
99
|
+
backcolor: { type: 'string', description: '单元格底色' },
|
|
100
|
+
align: { type: 'string', enum: ['left', 'center', 'right'] },
|
|
101
|
+
fontsize: { type: 'number' },
|
|
102
|
+
},
|
|
103
|
+
required: ['row', 'col'],
|
|
104
|
+
additionalProperties: false,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
theme_color: { type: 'string', description: '顺带更换表格主题色' },
|
|
108
|
+
},
|
|
109
|
+
required: ['slide', 'element_id', 'cells'],
|
|
110
|
+
additionalProperties: false,
|
|
111
|
+
},
|
|
112
|
+
kind: 'write',
|
|
113
|
+
since: '2.2.0',
|
|
114
|
+
handler: async ({ slide, element_id, cells, theme_color }, ctx) => {
|
|
115
|
+
const i = clamp(Number(slide) | 0, 0, 999)
|
|
116
|
+
const r = await ctx.deck.write([{
|
|
117
|
+
op: 'set-table-cells',
|
|
118
|
+
slide: i,
|
|
119
|
+
elementId: String(element_id),
|
|
120
|
+
cells,
|
|
121
|
+
...(theme_color ? { themeColor: theme_color } : {}),
|
|
122
|
+
}])
|
|
123
|
+
return okText(r, `已更新表格 ${element_id} 的 ${Array.isArray(cells) ? cells.length : 0} 个单元格`)
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
],
|
|
127
|
+
})
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** 任务恢复能力:status / list / checkpoint / restore。 */
|
|
2
|
+
import { okText } from '../domains/tooling.mjs'
|
|
3
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
4
|
+
|
|
5
|
+
export const taskCapability = defineCapability({
|
|
6
|
+
id: 'task',
|
|
7
|
+
title: '任务恢复',
|
|
8
|
+
tags: ['state'],
|
|
9
|
+
requires: ['deck', 'task'],
|
|
10
|
+
features: ['deck.task'],
|
|
11
|
+
tools: [
|
|
12
|
+
defineTool({
|
|
13
|
+
name: 'ppt_task',
|
|
14
|
+
description: '任务恢复:status 查当前进度/待处理批次/最近 checkpoint;list 列 checkpoint;checkpoint 保存命名快照;restore 恢复快照。长任务每阶段保存一次。',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
action: { type: 'string', enum: ['status', 'list', 'checkpoint', 'restore'] },
|
|
19
|
+
name: { type: 'string', maxLength: 64, description: 'checkpoint 名称(字母/数字/._-)' },
|
|
20
|
+
meta: { type: 'object', description: 'checkpoint 附带的 goal/plan/next 等元数据' },
|
|
21
|
+
},
|
|
22
|
+
required: ['action'],
|
|
23
|
+
additionalProperties: false,
|
|
24
|
+
},
|
|
25
|
+
kind: 'read',
|
|
26
|
+
since: '2.2.0',
|
|
27
|
+
handler: async ({ action, name, meta }, ctx) => {
|
|
28
|
+
if (action === 'status') {
|
|
29
|
+
const status = await ctx.task.status()
|
|
30
|
+
return { text: JSON.stringify(status, null, 2) }
|
|
31
|
+
}
|
|
32
|
+
if (action === 'list') {
|
|
33
|
+
const data = await ctx.task.list()
|
|
34
|
+
return { text: JSON.stringify(data, null, 2) }
|
|
35
|
+
}
|
|
36
|
+
if (action === 'checkpoint') {
|
|
37
|
+
if (!name) throw new Error('checkpoint 需要 name')
|
|
38
|
+
const saved = await ctx.task.checkpoint(name, meta || {})
|
|
39
|
+
return { text: `已保存 checkpoint ${saved.name}(seq ${saved.seq},${saved.slides} 页)` }
|
|
40
|
+
}
|
|
41
|
+
if (action === 'restore') {
|
|
42
|
+
if (!name) throw new Error('restore 需要 name')
|
|
43
|
+
const saved = await ctx.task.read(name)
|
|
44
|
+
if (!saved || !saved.deck) throw new Error('checkpoint 不存在或内容损坏: ' + name)
|
|
45
|
+
const result = await ctx.deck.write([{ op: 'load', deck: saved.deck }])
|
|
46
|
+
return okText(result, `已恢复 checkpoint ${name}(${saved.slides} 页)`)
|
|
47
|
+
}
|
|
48
|
+
throw new Error('未知 action: ' + action)
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
})
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** 文本能力:按页/元素改文本,文字槽位填充。 */
|
|
2
|
+
import { clamp, normalizeSlides, okText } from '../domains/tooling.mjs'
|
|
3
|
+
import { normalizeTextStyle } from '../domains/text-style.mjs'
|
|
4
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
5
|
+
|
|
6
|
+
export const textCapability = defineCapability({
|
|
7
|
+
id: 'text',
|
|
8
|
+
title: '文字与槽位',
|
|
9
|
+
tags: ['write', 'content'],
|
|
10
|
+
requires: ['deck'],
|
|
11
|
+
features: ['deck.write'],
|
|
12
|
+
tools: [
|
|
13
|
+
defineTool({
|
|
14
|
+
name: 'ppt_text',
|
|
15
|
+
description: '改文字:某页或某几页(缺省全部页)的首个文本,或指定 element_id 的文本;可同时改字号/颜色/加粗/对齐。首个文本优先取 text 元素,纯图形文字页回退到带文字的 shape。',
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
text: { type: 'string', maxLength: 2000 },
|
|
20
|
+
slide: { type: 'integer', description: '0 起页号' },
|
|
21
|
+
slides: { type: 'array', maxItems: 100, items: { type: 'integer' }, description: '0 起页号数组(缺省=全部)' },
|
|
22
|
+
element_id: { type: 'string', description: '元素 id(缺省=首个文本)' },
|
|
23
|
+
font_size: { type: 'integer' },
|
|
24
|
+
color: { type: 'string', description: 'CSS 颜色或中文色名' },
|
|
25
|
+
bold: { type: 'boolean' },
|
|
26
|
+
align: { type: 'string', enum: ['left', 'center', 'right', 'justify'] },
|
|
27
|
+
},
|
|
28
|
+
required: ['text'],
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
},
|
|
31
|
+
kind: 'write',
|
|
32
|
+
since: '1.0.0',
|
|
33
|
+
handler: async ({ text, slide, slides, element_id, ...style }, ctx) => {
|
|
34
|
+
const base = { text: String(text ?? '') }
|
|
35
|
+
if (element_id) base.elementId = String(element_id)
|
|
36
|
+
Object.assign(base, normalizeTextStyle(style))
|
|
37
|
+
const targets = normalizeSlides(slides)
|
|
38
|
+
|| (slide !== undefined && slide !== null ? [clamp(Number(slide) | 0, 0, 999)] : null)
|
|
39
|
+
if (targets) {
|
|
40
|
+
const r = await ctx.deck.write(targets.map(i => Object.assign({ op: 'set-text', id: i }, base)))
|
|
41
|
+
return okText(r, `已改 ${targets.length} 页文本`)
|
|
42
|
+
}
|
|
43
|
+
const doc = await ctx.deck.read()
|
|
44
|
+
const n = doc.deck && Array.isArray(doc.deck.slides) ? doc.deck.slides.length : 0
|
|
45
|
+
if (!n) throw new Error('桥上没有 deck')
|
|
46
|
+
const r = await ctx.deck.write(Array.from({ length: n }, (_, i) => Object.assign({ op: 'set-text', id: i }, base)))
|
|
47
|
+
return okText(r, `已改全部 ${n} 页文本`)
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
defineTool({
|
|
51
|
+
name: 'ppt_fill',
|
|
52
|
+
description: '填充文字槽位:把某页的第 slot 个文字载体(0 起,含带文字的 shape)改成 text,可带字号/颜色/加粗/对齐。保留原版式。',
|
|
53
|
+
inputSchema: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
slide: { type: 'integer', description: '0 起页号' },
|
|
57
|
+
slot: { type: 'integer', description: '该页第几个文字载体(0 起,含图形内文字)' },
|
|
58
|
+
text: { type: 'string' },
|
|
59
|
+
font_size: { type: 'integer' },
|
|
60
|
+
color: { type: 'string' },
|
|
61
|
+
bold: { type: 'boolean' },
|
|
62
|
+
align: { type: 'string' },
|
|
63
|
+
},
|
|
64
|
+
required: ['slide', 'slot', 'text'],
|
|
65
|
+
additionalProperties: false,
|
|
66
|
+
},
|
|
67
|
+
kind: 'write',
|
|
68
|
+
since: '1.0.0',
|
|
69
|
+
handler: async ({ slide, slot, text, ...style }, ctx) => {
|
|
70
|
+
const cmd = {
|
|
71
|
+
op: 'fill-slot',
|
|
72
|
+
slide: clamp(Number(slide) | 0, 0, 999),
|
|
73
|
+
slot: clamp(Number(slot) | 0, 0, 99),
|
|
74
|
+
text: String(text ?? ''),
|
|
75
|
+
...normalizeTextStyle(style),
|
|
76
|
+
}
|
|
77
|
+
const r = await ctx.deck.write([cmd])
|
|
78
|
+
return okText(r, `已填第 ${slide} 页槽位 ${slot}`)
|
|
79
|
+
},
|
|
80
|
+
}),
|
|
81
|
+
],
|
|
82
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** 图片域:字节嗅探 / 尺寸解析 / 聊天附件定位(实际落盘由 assets 端口负责)。 */
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import path from 'node:path'
|
|
4
|
+
|
|
5
|
+
export function imageMime(buf) {
|
|
6
|
+
if (buf[0] === 0x89 && buf[1] === 0x50) return 'image/png'
|
|
7
|
+
if (buf[0] === 0xff && buf[1] === 0xd8) return 'image/jpeg'
|
|
8
|
+
if (buf.slice(0, 3).toString('ascii') === 'GIF') return 'image/gif'
|
|
9
|
+
if (buf.slice(8, 12).toString('ascii') === 'WEBP') return 'image/webp'
|
|
10
|
+
/* ISO BMFF 家族:ftyp 盒的品牌决定 AVIF / HEIF。有些 CDN 无视 Accept 直接回 AVIF,
|
|
11
|
+
* 认出来比「不是可用的图片」有用——Chromium 渲染得出来。 */
|
|
12
|
+
if (buf.length > 12 && buf.slice(4, 8).toString('ascii') === 'ftyp') {
|
|
13
|
+
const brand = buf.slice(8, 12).toString('ascii')
|
|
14
|
+
if (brand === 'avif' || brand === 'avis') return 'image/avif'
|
|
15
|
+
if (brand.startsWith('hei') || brand === 'mif1' || brand === 'msf1') return 'image/heic'
|
|
16
|
+
}
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function imageSize(buf) {
|
|
21
|
+
if (buf[0] === 0x89 && buf[1] === 0x50 && buf.length > 24) {
|
|
22
|
+
return [buf.readUInt32BE(16), buf.readUInt32BE(20)]
|
|
23
|
+
}
|
|
24
|
+
if (buf.slice(0, 3).toString('ascii') === 'GIF' && buf.length > 10) {
|
|
25
|
+
return [buf.readUInt16LE(6), buf.readUInt16LE(8)]
|
|
26
|
+
}
|
|
27
|
+
if (buf[0] === 0xff && buf[1] === 0xd8) {
|
|
28
|
+
let i = 2
|
|
29
|
+
while (i + 8 < buf.length) {
|
|
30
|
+
if (buf[i] !== 0xff) { i++; continue }
|
|
31
|
+
const m = buf[i + 1]
|
|
32
|
+
i += 2
|
|
33
|
+
if (m === 0xd8 || m === 0xd9 || m === 0x01) continue
|
|
34
|
+
const len = buf.readUInt16BE(i)
|
|
35
|
+
if ([0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf].includes(m)) {
|
|
36
|
+
return [buf.readUInt16BE(i + 5), buf.readUInt16BE(i + 3)]
|
|
37
|
+
}
|
|
38
|
+
i += len
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/* WebP:三个变体的画布尺寸藏在不同位置,但都能在前 40 字节解出来。 */
|
|
42
|
+
if (buf.slice(0, 4).toString('ascii') === 'RIFF' && buf.slice(8, 12).toString('ascii') === 'WEBP' && buf.length >= 30) {
|
|
43
|
+
const kind = buf.slice(12, 16).toString('ascii')
|
|
44
|
+
if (kind === 'VP8 ' && buf.length > 30) {
|
|
45
|
+
return [buf.readUInt16LE(26) & 0x3fff, buf.readUInt16LE(28) & 0x3fff]
|
|
46
|
+
}
|
|
47
|
+
if (kind === 'VP8L' && buf.length > 25) {
|
|
48
|
+
const bits = buf.readUInt32LE(21)
|
|
49
|
+
return [(bits & 0x3fff) + 1, ((bits >> 14) & 0x3fff) + 1]
|
|
50
|
+
}
|
|
51
|
+
if (kind === 'VP8X') {
|
|
52
|
+
const w = 1 + (buf.readUIntLE(24, 3)), h = 1 + (buf.readUIntLE(27, 3))
|
|
53
|
+
return [w, h]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/* AVIF/HEIC:ISOBMFF 里第一个 ispe 盒带画布尺寸;只扫前若干 KB,够用。 */
|
|
57
|
+
const ispe = buf.indexOf(Buffer.from('ispe', 'ascii'))
|
|
58
|
+
if (ispe > 0 && ispe + 16 <= buf.length) {
|
|
59
|
+
const w = buf.readUInt32BE(ispe + 8)
|
|
60
|
+
const h = buf.readUInt32BE(ispe + 12)
|
|
61
|
+
if (w > 0 && h > 0 && w < 100000 && h < 100000) return [w, h]
|
|
62
|
+
}
|
|
63
|
+
return null
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function resolveAttachmentFile(id) {
|
|
67
|
+
const hex = String(id || '').replace(/^sha256:/i, '')
|
|
68
|
+
if (!/^[0-9a-f]{64}$/i.test(hex)) throw new Error('attachment_id 必须是 sha256:<64位hex>')
|
|
69
|
+
const roots = []
|
|
70
|
+
if (process.env.DSH_HOME) roots.push(path.join(process.env.DSH_HOME, 'attachments', 'v1', 'objects'))
|
|
71
|
+
if (process.env.DSH_ATTACHMENTS_DIR) roots.push(process.env.DSH_ATTACHMENTS_DIR)
|
|
72
|
+
if (process.env.USERPROFILE) roots.push(path.join(process.env.USERPROFILE, '.dsh', 'attachments', 'v1', 'objects'))
|
|
73
|
+
for (const root of roots) {
|
|
74
|
+
const p = path.join(root, hex.slice(0, 2), hex)
|
|
75
|
+
if (fs.existsSync(p)) return p
|
|
76
|
+
}
|
|
77
|
+
throw new Error('找不到聊天附件:' + id + '(请在聊天里重新粘贴图片)')
|
|
78
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 工具域辅助桶:只给 tools.mjs 兼容导出用,能力模块按需直接 import 具体文件。 */
|
|
2
|
+
export { COLORS, resolveColor, parseColor, contrastColor, relativeLuminance } from './color.mjs'
|
|
3
|
+
export { expandRecolorOps, resolveForeground } from './recolor.mjs'
|
|
4
|
+
export { simpleSlide } from './slide.mjs'
|
|
5
|
+
export { imageMime, imageSize, resolveAttachmentFile } from './image.mjs'
|
|
6
|
+
export { clamp, sleep, okText, normalizeSlides } from './tooling.mjs'
|
|
7
|
+
export { normalizeTextStyle } from './text-style.mjs'
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 稿件里的图片一律**引用**,不内联。
|
|
3
|
+
*
|
|
4
|
+
* 为什么:data URL 一旦进入稿件文本,模型每次读稿/改稿都要吞吐几十 KB 的 base64
|
|
5
|
+
* (一张 60KB 的图 ≈ 2 万 token),而且 replace 要求模型把整串重抄一遍——抄错一个字符
|
|
6
|
+
* 图就坏了。所以这里只做两件事:
|
|
7
|
+
*
|
|
8
|
+
* 1. 把附件 / 本地路径 / 外链统一读成字节,算出 sha256,交给调用方存进媒体仓;
|
|
9
|
+
* 2. 把稿件文本里的图片改写成一个短引用 ``。
|
|
10
|
+
*
|
|
11
|
+
* 字节只在三个时刻出现:写入时(进仓)、渲染时(由 /media/<sha> 端点按需吐)、导出时
|
|
12
|
+
* (再内联进 pptx)。稿件文本和模型视野里永远只有那个短引用。
|
|
13
|
+
*/
|
|
14
|
+
import { createHash } from 'node:crypto'
|
|
15
|
+
import { readFileSync } from 'node:fs'
|
|
16
|
+
import { downloadImage, describeImageFailure } from './remote-image.mjs'
|
|
17
|
+
import { imageMime, resolveAttachmentFile } from './image.mjs'
|
|
18
|
+
|
|
19
|
+
const MAX_BYTES = 6 * 1024 * 1024
|
|
20
|
+
const IMG_RE = /!\[([^\]]*)\]\(([^)\s]+)\)/g
|
|
21
|
+
const MEDIA_RE = /^@media\/[a-f0-9]{8,}$/i
|
|
22
|
+
const MEDIA_URL_RE = /\/media\/[a-f0-9]{8,}\/?$/i
|
|
23
|
+
const ASSET_RE = /^\/assets\/[a-f0-9]{8,}/i
|
|
24
|
+
const DATA_RE = /^data:image\//i
|
|
25
|
+
const LOCAL_RE = /^(?:[a-zA-Z]:[\\/]|\.{0,2}[\\/])/
|
|
26
|
+
|
|
27
|
+
const sha256 = (buf) => createHash('sha256').update(buf).digest('hex')
|
|
28
|
+
|
|
29
|
+
/** 读出一张图的实际字节:附件、本地路径、外链。 */
|
|
30
|
+
async function loadBytes(ref) {
|
|
31
|
+
if (/^attachment:/i.test(ref)) {
|
|
32
|
+
const id = ref.replace(/^attachment:/i, '').replace(/^sha256:/i, '')
|
|
33
|
+
const file = await resolveAttachmentFile(id)
|
|
34
|
+
if (!file) throw new Error('附件不存在或已过期(附件只在本会话可读)')
|
|
35
|
+
return readFileSync(file)
|
|
36
|
+
}
|
|
37
|
+
if (LOCAL_RE.test(ref)) return readFileSync(ref)
|
|
38
|
+
if (/^https?:\/\//i.test(ref)) return (await downloadImage(ref)).buf
|
|
39
|
+
throw new Error('地址认不出来(要 attachment:…、本地路径或 http(s) 链接)')
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const reasonOf = (error, ref) => {
|
|
43
|
+
/* 本地路径读不到时别说成「远程图片不可用」——会把排查引到网络上去。 */
|
|
44
|
+
if (!/^https?:\/\//i.test(String(ref)) && !/^attachment:/i.test(String(ref))) {
|
|
45
|
+
return `本地文件读不到:${String(error && error.message || error)}`
|
|
46
|
+
}
|
|
47
|
+
try { return describeImageFailure(error, ref) } catch { /* 退回原始消息 */ }
|
|
48
|
+
return String(error && error.message || error)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 把一段文本里的图片引用化。
|
|
53
|
+
* @returns {{text:string, media:Object<string,{mime:string,data:string}>, landed:number, failed:number}}
|
|
54
|
+
*/
|
|
55
|
+
export async function landImages(text, ctx, findings = []) {
|
|
56
|
+
const out = []
|
|
57
|
+
const media = {}
|
|
58
|
+
const failures = []
|
|
59
|
+
let landed = 0
|
|
60
|
+
let failed = 0
|
|
61
|
+
let last = 0
|
|
62
|
+
|
|
63
|
+
for (const m of String(text || '').matchAll(IMG_RE)) {
|
|
64
|
+
const [whole, alt, ref] = m
|
|
65
|
+
out.push(text.slice(last, m.index))
|
|
66
|
+
last = m.index + whole.length
|
|
67
|
+
|
|
68
|
+
// 已经是引用(或历史遗留的对象仓库地址):原样保留,不再读字节
|
|
69
|
+
if (MEDIA_RE.test(ref) || MEDIA_URL_RE.test(ref) || ASSET_RE.test(ref) || DATA_RE.test(ref)) {
|
|
70
|
+
out.push(whole)
|
|
71
|
+
continue
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
const buf = await loadBytes(ref)
|
|
76
|
+
if (buf.length > MAX_BYTES) {
|
|
77
|
+
throw new Error(`图片太大(${Math.round(buf.length / 1024)}KB,上限 ${MAX_BYTES / 1024 / 1024}MB)`)
|
|
78
|
+
}
|
|
79
|
+
const mime = imageMime(buf)
|
|
80
|
+
if (!mime) throw new Error('不是可用的图片(仅 PNG / JPEG / GIF / WebP / AVIF)')
|
|
81
|
+
const sha = sha256(buf)
|
|
82
|
+
media[sha] = { mime, data: buf.toString('base64') }
|
|
83
|
+
out.push(``)
|
|
84
|
+
landed += 1
|
|
85
|
+
} catch (error) {
|
|
86
|
+
failed += 1
|
|
87
|
+
const reason = reasonOf(error, ref)
|
|
88
|
+
/* 失败必须能被上层原样报给使用者:只给一个计数,模型会当成「小事」跳过。 */
|
|
89
|
+
failures.push({ field: alt || '图片', ref: String(ref).slice(0, 200), reason })
|
|
90
|
+
findings.push({
|
|
91
|
+
level: 'warn',
|
|
92
|
+
kind: 'image-failed',
|
|
93
|
+
field: alt ? `图片「${alt}」` : '图片',
|
|
94
|
+
message: `没能落地(${reason}),已从这一块移除:${String(ref).slice(0, 80)}`,
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
out.push(String(text || '').slice(last))
|
|
100
|
+
return { text: out.join(''), media, landed, failed, failures }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** 整稿:ppt_write / ppt_check。 */
|
|
104
|
+
export async function landImagesInSource(src, ctx, findings = []) {
|
|
105
|
+
return landImages(src, ctx, findings)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** 块级操作:只改 op.text,其它字段原样透传。 */
|
|
109
|
+
export async function landImagesInOps(ops, ctx, findings = []) {
|
|
110
|
+
const out = []
|
|
111
|
+
const media = {}
|
|
112
|
+
const failures = []
|
|
113
|
+
let landed = 0
|
|
114
|
+
let failed = 0
|
|
115
|
+
for (const op of Array.isArray(ops) ? ops : []) {
|
|
116
|
+
if (typeof op?.text === 'string' && op.text.includes('![')) {
|
|
117
|
+
const r = await landImages(op.text, ctx, findings)
|
|
118
|
+
out.push({ ...op, text: r.text })
|
|
119
|
+
Object.assign(media, r.media)
|
|
120
|
+
landed += r.landed
|
|
121
|
+
failed += r.failed
|
|
122
|
+
failures.push(...r.failures)
|
|
123
|
+
} else {
|
|
124
|
+
out.push(op)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { ops: out, media, landed, failed, failures }
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** 把 deck 里的 `@media/<sha>` 展开成可加载的地址(写盘前调用)。
|
|
131
|
+
* base 形如 `/api/desktop/works/ppt-bridge`,最终给编辑器的是 `<base>/media/<sha>`。
|
|
132
|
+
* **返回的是「展开了几处」(数字),不是 deck**——它就地改传入对象。
|
|
133
|
+
* 要一份改好的副本请用 expandDeckMediaRefs()。 */
|
|
134
|
+
export function expandMediaRefs(deck, basePath) {
|
|
135
|
+
let count = 0
|
|
136
|
+
for (const slide of deck?.slides || []) {
|
|
137
|
+
for (const el of slide.elements || []) {
|
|
138
|
+
const src = String(el?.src || '')
|
|
139
|
+
if (!MEDIA_RE.test(src)) continue
|
|
140
|
+
el.src = `${basePath}/media/${src.slice('@media/'.length)}`
|
|
141
|
+
count += 1
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return count
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 返回「展开后的 deck 副本」,原对象不动。
|
|
149
|
+
*
|
|
150
|
+
* 为什么要有这个:`inSync` 判断曾经写成 `expandMediaRefs(clone(deck), base)`——
|
|
151
|
+
* 拿到的是数字 0,于是「稿件的期望 deck」变成空,`sameText` 永远不相等:
|
|
152
|
+
* 每次读稿都报 `inSync:false / drift: expected 0`,每次写入都挂一条
|
|
153
|
+
* `deck-rebased` 警告(说画布改动被丢了,其实没丢)。这种假警报会直接带偏模型。
|
|
154
|
+
*/
|
|
155
|
+
export function expandDeckMediaRefs(deck, basePath) {
|
|
156
|
+
const copy = structuredClone(deck)
|
|
157
|
+
expandMediaRefs(copy, basePath)
|
|
158
|
+
return copy
|
|
159
|
+
}
|