@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,174 @@
|
|
|
1
|
+
/** 图片能力:图片先进入对象仓库,deck 只保存 /assets/<sha256> 引用。 */
|
|
2
|
+
import fs from 'node:fs'
|
|
3
|
+
import { imageMime, imageSize, resolveAttachmentFile } from '../domains/image.mjs'
|
|
4
|
+
import { IMAGE_MAX_BYTES, describeImageFailure, downloadImage } from '../domains/remote-image.mjs'
|
|
5
|
+
import { clamp, okText } from '../domains/tooling.mjs'
|
|
6
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
7
|
+
|
|
8
|
+
const MAX_MB = Math.round(IMAGE_MAX_BYTES / 1024 / 1024)
|
|
9
|
+
const TOO_LARGE_HINT = `图片过大(>${MAX_MB}MB),请先压缩后再插入`
|
|
10
|
+
|
|
11
|
+
function readLocalImage(file) {
|
|
12
|
+
const stat = fs.statSync(file)
|
|
13
|
+
if (!stat.isFile()) throw new Error('图片路径不是文件:' + file)
|
|
14
|
+
if (stat.size > IMAGE_MAX_BYTES) throw new Error(TOO_LARGE_HINT)
|
|
15
|
+
return fs.readFileSync(file)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function insertImage(ctx, spec) {
|
|
19
|
+
const { slide, attachment_id, attachmentId, path: filePath, src, left, top, width, height } = spec || {}
|
|
20
|
+
const i = clamp(Number(slide == null ? 0 : slide) | 0, 0, 999)
|
|
21
|
+
const aid = attachment_id || attachmentId
|
|
22
|
+
let buf = null
|
|
23
|
+
let assetUrl = ''
|
|
24
|
+
let dataUrl = ''
|
|
25
|
+
let natW = 0, natH = 0
|
|
26
|
+
if (aid) {
|
|
27
|
+
const p = resolveAttachmentFile(aid)
|
|
28
|
+
buf = readLocalImage(p)
|
|
29
|
+
} else if (filePath) {
|
|
30
|
+
if (!fs.existsSync(String(filePath))) throw new Error('图片文件不存在:' + filePath)
|
|
31
|
+
buf = readLocalImage(String(filePath))
|
|
32
|
+
} else if (src) {
|
|
33
|
+
const s = String(src)
|
|
34
|
+
if (/^https?:/i.test(s)) {
|
|
35
|
+
if (/\/assets\/[a-f0-9]{64}$/i.test(s)) {
|
|
36
|
+
assetUrl = s
|
|
37
|
+
} else {
|
|
38
|
+
/* 远程图不能直接把 URL 丢给编辑器:先下载并验证是图片,再进入对象仓库。 */
|
|
39
|
+
try {
|
|
40
|
+
const fetched = await downloadImage(s)
|
|
41
|
+
buf = fetched.buf
|
|
42
|
+
} catch (error) {
|
|
43
|
+
throw new Error(describeImageFailure(error, s))
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} else if (/^data:image\//i.test(s)) {
|
|
47
|
+
const comma = s.indexOf(',')
|
|
48
|
+
if (comma < 0) throw new Error('data URL 不合法')
|
|
49
|
+
/* 先按 base64 长度粗判,避免解码超大字符串造成瞬时内存峰值。 */
|
|
50
|
+
if (s.length > Math.ceil(IMAGE_MAX_BYTES * 4 / 3) + 128) throw new Error(TOO_LARGE_HINT)
|
|
51
|
+
buf = Buffer.from(s.slice(comma + 1), 'base64')
|
|
52
|
+
if (buf.length > IMAGE_MAX_BYTES) throw new Error(TOO_LARGE_HINT)
|
|
53
|
+
} else if (/^\/assets\/[a-f0-9]{64}$/i.test(s)) {
|
|
54
|
+
assetUrl = s
|
|
55
|
+
} else if (fs.existsSync(s)) {
|
|
56
|
+
buf = readLocalImage(s)
|
|
57
|
+
} else {
|
|
58
|
+
throw new Error('src 既不是 http(s)/data URL,也不是存在的文件:' + s.slice(0, 120))
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
throw new Error('ppt_image 需要 attachment_id / path / src 之一')
|
|
62
|
+
}
|
|
63
|
+
let inlined = false
|
|
64
|
+
let storeError = ''
|
|
65
|
+
if (buf) {
|
|
66
|
+
if (buf.length > IMAGE_MAX_BYTES) throw new Error(TOO_LARGE_HINT)
|
|
67
|
+
const mime = imageMime(buf)
|
|
68
|
+
if (!mime) throw new Error('不支持的图片格式(仅 PNG/JPEG/GIF/WebP/AVIF)')
|
|
69
|
+
/* 只要宿主给了媒体仓就必须写进去。历史上这里看 env PPT_ASSET_STORE 开关,但
|
|
70
|
+
* workspace 后端会先建好 assetStore 再交给 relay,于是 createAssetStore 永不被调用、
|
|
71
|
+
* 开关永远是空的,图片整张 base64 内联进 deck(实测单页 2.6MB)。 */
|
|
72
|
+
let stored = null
|
|
73
|
+
if (typeof ctx.assets?.put === 'function') {
|
|
74
|
+
try { stored = await ctx.assets.put(buf, mime) } catch (error) { storeError = String(error?.message || error) }
|
|
75
|
+
} else {
|
|
76
|
+
storeError = '宿主没有提供媒体仓端口'
|
|
77
|
+
}
|
|
78
|
+
if (stored?.url) {
|
|
79
|
+
assetUrl = stored.url
|
|
80
|
+
} else {
|
|
81
|
+
inlined = true
|
|
82
|
+
dataUrl = `data:${mime};base64,${buf.toString('base64')}`
|
|
83
|
+
}
|
|
84
|
+
const sz = imageSize(buf)
|
|
85
|
+
if (sz) { natW = sz[0]; natH = sz[1] }
|
|
86
|
+
}
|
|
87
|
+
if (!assetUrl && !dataUrl) throw new Error('图片未能写入媒体仓,也没有可内联的数据')
|
|
88
|
+
const SW = 1000, SH = 562.5
|
|
89
|
+
let w = width != null ? Number(width) : null
|
|
90
|
+
let h = height != null ? Number(height) : null
|
|
91
|
+
if ((w == null || h == null) && natW && natH) {
|
|
92
|
+
if (w == null && h == null) {
|
|
93
|
+
const scale = Math.min(SW / natW, SH / natH)
|
|
94
|
+
w = natW * scale; h = natH * scale
|
|
95
|
+
} else if (w == null) {
|
|
96
|
+
w = h * natW / natH
|
|
97
|
+
} else {
|
|
98
|
+
h = w * natH / natW
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (w == null) w = SW
|
|
102
|
+
if (h == null) h = SH
|
|
103
|
+
const l = left != null ? Number(left) : Math.round((SW - w) / 2)
|
|
104
|
+
const t = top != null ? Number(top) : Math.round((SH - h) / 2)
|
|
105
|
+
const element = {
|
|
106
|
+
type: 'image', src: assetUrl || dataUrl,
|
|
107
|
+
left: l, top: t, width: Math.round(w), height: Math.round(h),
|
|
108
|
+
}
|
|
109
|
+
const beforeDoc = await ctx.deck.read()
|
|
110
|
+
const beforeSlide = ((beforeDoc.deck && beforeDoc.deck.slides) || [])[i] || {}
|
|
111
|
+
const beforeIds = new Set((beforeSlide.elements || []).filter(e => e.type === 'image').map(e => e.id))
|
|
112
|
+
const r = await ctx.deck.write([{ op: 'add-element', slide: i, element }])
|
|
113
|
+
if (!r.ok) return okText(r, '图片插入失败')
|
|
114
|
+
const afterDoc = await ctx.deck.read()
|
|
115
|
+
const afterSlide = ((afterDoc.deck && afterDoc.deck.slides) || [])[i] || {}
|
|
116
|
+
const newImg = (afterSlide.elements || []).find(e => e.type === 'image' && !beforeIds.has(e.id))
|
|
117
|
+
if (!newImg) {
|
|
118
|
+
throw new Error('图片未真正插入:deck 中目标页没有新增 image 元素。最常见原因是编辑器还是旧 bundle(不支持 image),请按 F5 刷新桌面后重试;不要重复插入。')
|
|
119
|
+
}
|
|
120
|
+
const imgSrc = String(newImg.src || '')
|
|
121
|
+
/* 媒体仓引用形如 `<base>/media/<sha>`(新版)或 `/assets/<sha>`(旧宿主兜底),
|
|
122
|
+
* data URL 只应出现在没有媒体仓的宿主上。三种都算合法,其余的 src 才是真错误。 */
|
|
123
|
+
const okSrc = /\/media\/[a-f0-9]{8,64}(?:\?.*)?$/i.test(imgSrc)
|
|
124
|
+
|| /^@media\/[a-f0-9]{8,64}$/i.test(imgSrc)
|
|
125
|
+
|| /^\/assets\/[a-f0-9]{64}$/i.test(imgSrc)
|
|
126
|
+
|| /^data:image\//i.test(imgSrc)
|
|
127
|
+
|| /^https?:/i.test(imgSrc)
|
|
128
|
+
if (!okSrc) {
|
|
129
|
+
throw new Error('图片元素已创建但 src 无效(' + imgSrc.slice(0, 80) + '):请重试;若仍失败,把这条错误原样告诉用户。')
|
|
130
|
+
}
|
|
131
|
+
const nat = natW && natH ? `${natW}×${natH}` : '图片'
|
|
132
|
+
const size = `${Math.round(newImg.width)}×${Math.round(newImg.height)}`
|
|
133
|
+
const degrade = inlined
|
|
134
|
+
? `\n⚠ 媒体仓不可用(${storeError || '未提供'}),这张图被内联成 base64 写进了 deck:能显示,但 deck 会明显变大,后续改稿也更容易被整串搬运。把这条告诉用户。`
|
|
135
|
+
: ''
|
|
136
|
+
if (assetUrl) {
|
|
137
|
+
const assetId = assetUrl.split('/').pop()
|
|
138
|
+
return { text: `已存入媒体仓并插入:第 ${i} 页新增图片 id=${newImg.id}(${nat} → ${size},asset=${assetId})${degrade}` }
|
|
139
|
+
}
|
|
140
|
+
return { text: `已插入并校验:第 ${i} 页新增图片 id=${newImg.id}(${nat} → ${size})${degrade}` }
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const imageCapability = defineCapability({
|
|
144
|
+
id: 'image',
|
|
145
|
+
title: '图片',
|
|
146
|
+
tags: ['write', 'media'],
|
|
147
|
+
requires: ['deck', 'assets'],
|
|
148
|
+
provides: { media: { insertImage } },
|
|
149
|
+
features: ['deck.image'],
|
|
150
|
+
tools: [
|
|
151
|
+
defineTool({
|
|
152
|
+
name: 'ppt_image',
|
|
153
|
+
description: '插入图片(一次完成,图片先写入媒体仓,deck 只存 <base>/media/<sha256> 引用):attachment_id 取聊天图片附件的 sha256 id;也支持 path/src。src 走远程下载时带浏览器头、25s 超时、自动重试一次,上限 6MB。失败会返回 [错误码]:HOST_BLOCKED / HTTP_403 / TIMEOUT / TOO_LARGE 等——永久性失败不要重试同一链接或域名,改换来源或先用本地 path 下载。不要用 shell 找图,不要截图验证。',
|
|
154
|
+
inputSchema: {
|
|
155
|
+
type: 'object',
|
|
156
|
+
properties: {
|
|
157
|
+
slide: { type: 'integer', description: '0 起页号,缺省 0(封面)' },
|
|
158
|
+
attachment_id: { type: 'string', description: '聊天图片附件的 attachmentId(sha256:…)' },
|
|
159
|
+
attachmentId: { type: 'string', description: 'attachment_id 的兼容别名' },
|
|
160
|
+
path: { type: 'string', description: '本机图片路径(兼容旧用法)' },
|
|
161
|
+
src: { type: 'string', description: 'http(s) 或 data URL' },
|
|
162
|
+
left: { type: 'number' },
|
|
163
|
+
top: { type: 'number' },
|
|
164
|
+
width: { type: 'number' },
|
|
165
|
+
height: { type: 'number' },
|
|
166
|
+
},
|
|
167
|
+
additionalProperties: false,
|
|
168
|
+
},
|
|
169
|
+
kind: 'write',
|
|
170
|
+
since: '1.0.0',
|
|
171
|
+
handler: (args, ctx) => insertImage(ctx, args),
|
|
172
|
+
}),
|
|
173
|
+
],
|
|
174
|
+
})
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/** 图片检索能力:搜索 + 真实尺寸预检,返回确认可用的候选直链;下载/入库/插图由 ppt_image 负责。 */
|
|
2
|
+
import { IMAGE_UA, probeImage } from '../domains/remote-image.mjs'
|
|
3
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
4
|
+
|
|
5
|
+
const BING = 'https://cn.bing.com/images/async'
|
|
6
|
+
const UA = IMAGE_UA
|
|
7
|
+
const MIN_WIDTH = 480
|
|
8
|
+
/* 显式要大图时让 Bing 先过滤一遍;它给的宽高只当提示,真实尺寸仍以预检读出的为准。 */
|
|
9
|
+
const LARGE_WIDTH = 1000
|
|
10
|
+
const CACHE_TTL_MS = 10 * 60 * 1000
|
|
11
|
+
/* 全局预算:一个 read 工具不该拖到十几秒。
|
|
12
|
+
* 2026-11-02 实测 Bing 图片搜索常态 0.2~0.5s,偶发 7s+ 抖动,
|
|
13
|
+
* 所以搜索单独给 8s(沿用原值,不因预检而收紧),预检在剩余预算里跑,
|
|
14
|
+
* 整轮 12s 封顶。预算耗尽就返回已拿到的结果,不再补测。 */
|
|
15
|
+
const TOTAL_BUDGET_MS = 12000
|
|
16
|
+
const SEARCH_TIMEOUT_MS = 8000
|
|
17
|
+
const PROBE_CONCURRENCY = 9
|
|
18
|
+
const PROBE_TIMEOUT_MS = 3000
|
|
19
|
+
const PROBE_MAX_RATIO = 2
|
|
20
|
+
const cache = new Map()
|
|
21
|
+
|
|
22
|
+
const decode = (value) => String(value || '')
|
|
23
|
+
.replace(/"/g, '"')
|
|
24
|
+
.replace(/&/g, '&')
|
|
25
|
+
.replace(/'/g, "'")
|
|
26
|
+
.replace(/</g, '<')
|
|
27
|
+
.replace(/>/g, '>')
|
|
28
|
+
|
|
29
|
+
/** 从 Bing 图片搜索 HTML 中提取 murl/purl/t。宽高只当提示(Bing 经常不给)。 */
|
|
30
|
+
export function parseBingImages(html, limit = 12) {
|
|
31
|
+
const out = []
|
|
32
|
+
const seen = new Set()
|
|
33
|
+
for (const match of String(html || '').matchAll(/m="(\{"[\s\S]*?)"/g)) {
|
|
34
|
+
let meta
|
|
35
|
+
try { meta = JSON.parse(decode(match[1])) } catch { continue }
|
|
36
|
+
const url = String(meta.murl || '')
|
|
37
|
+
if (!/^https?:\/\//i.test(url) || seen.has(url)) continue
|
|
38
|
+
seen.add(url)
|
|
39
|
+
out.push({
|
|
40
|
+
title: String(meta.t || '').replace(/\s+/g, ' ').trim().slice(0, 80),
|
|
41
|
+
page: String(meta.purl || ''),
|
|
42
|
+
url,
|
|
43
|
+
})
|
|
44
|
+
if (out.length >= limit) break
|
|
45
|
+
}
|
|
46
|
+
return out
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function searchBing(query, count, deadline, floor) {
|
|
50
|
+
const sizeFilter = floor >= LARGE_WIDTH ? '+filterui:photo-photo+filterui:imagesize-large' : '+filterui:photo-photo'
|
|
51
|
+
const url = `${BING}?q=${encodeURIComponent(query)}&first=1&count=${Math.max(count * 3, 24)}&mkt=zh-CN&qft=${sizeFilter}`
|
|
52
|
+
const budget = Math.min(SEARCH_TIMEOUT_MS, Math.max(1000, deadline - Date.now()))
|
|
53
|
+
const res = await fetch(url, {
|
|
54
|
+
signal: AbortSignal.timeout(budget),
|
|
55
|
+
headers: { 'user-agent': UA, 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8' },
|
|
56
|
+
})
|
|
57
|
+
if (!res.ok) throw new Error(`图片搜索 HTTP ${res.status}`)
|
|
58
|
+
return parseBingImages(await res.text(), count)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 并发预检,凑够 want 条就停。
|
|
63
|
+
*
|
|
64
|
+
* 判定分三档,别再拿"能下载"冒充"能用":
|
|
65
|
+
* verified 探测成功,且从头字节解出的真实宽度 ≥ floor,且不是图库水印预览站;
|
|
66
|
+
* unverified 探测超时/抖动/尺寸未知——下载阶段预算更长,留作兜底但明确标出来;
|
|
67
|
+
* rejected 确定的坏链(403/404/不是图片/超大/真实尺寸不够/图库预览)。
|
|
68
|
+
*
|
|
69
|
+
* strict(显式传了 min_width)时尺寸未知的直接不返回:既然用户点名了尺寸,
|
|
70
|
+
* 返回一张量不出的图只会让下游反复试。
|
|
71
|
+
*/
|
|
72
|
+
export async function filterCandidates(items, want, floor, deadline, options = {}) {
|
|
73
|
+
const probe = options.probe || probeImage
|
|
74
|
+
const strict = options.strict === true
|
|
75
|
+
const verified = []
|
|
76
|
+
const unverified = []
|
|
77
|
+
const rejected = []
|
|
78
|
+
const stock = []
|
|
79
|
+
const pool = items.slice(0, Math.min(items.length, Math.max(want, 1) * PROBE_MAX_RATIO))
|
|
80
|
+
const enough = () => (strict ? verified.length >= want : verified.length + unverified.length >= want)
|
|
81
|
+
let cursor = 0
|
|
82
|
+
const worker = async () => {
|
|
83
|
+
while (cursor < pool.length && !enough() && Date.now() < deadline) {
|
|
84
|
+
const item = pool[cursor++]
|
|
85
|
+
let p
|
|
86
|
+
try {
|
|
87
|
+
p = await probe(item.url, { timeoutMs: PROBE_TIMEOUT_MS, deadline })
|
|
88
|
+
} catch (error) {
|
|
89
|
+
p = { ok: false, code: 'NETWORK', reason: error?.message || String(error), permanent: false }
|
|
90
|
+
}
|
|
91
|
+
if (!p.ok) {
|
|
92
|
+
if (p.code === 'STOCK_PREVIEW') stock.push({ ...item, code: p.code })
|
|
93
|
+
else if (p.permanent) rejected.push({ ...item, code: p.code })
|
|
94
|
+
else if (!strict) unverified.push({ ...item, width: null, height: null, bytes: 0 })
|
|
95
|
+
continue
|
|
96
|
+
}
|
|
97
|
+
const width = Number(p.width) || 0
|
|
98
|
+
const height = Number(p.height) || 0
|
|
99
|
+
const bytes = Number(p.bytes || p.size) || 0
|
|
100
|
+
if (!width || !height) {
|
|
101
|
+
if (strict) rejected.push({ ...item, code: 'UNKNOWN_SIZE' })
|
|
102
|
+
else unverified.push({ ...item, width: null, height: null, bytes })
|
|
103
|
+
continue
|
|
104
|
+
}
|
|
105
|
+
if (width < floor) {
|
|
106
|
+
rejected.push({ ...item, width, height, code: 'TOO_SMALL' })
|
|
107
|
+
continue
|
|
108
|
+
}
|
|
109
|
+
verified.push({ ...item, width, height, bytes })
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const lanes = Math.min(PROBE_CONCURRENCY, pool.length)
|
|
113
|
+
await Promise.all(Array.from({ length: lanes }, worker))
|
|
114
|
+
return {
|
|
115
|
+
candidates: [...verified, ...unverified].slice(0, want),
|
|
116
|
+
verified: verified.slice(0, want),
|
|
117
|
+
unverified: unverified.slice(0, want),
|
|
118
|
+
verifiedCount: Math.min(verified.length, want),
|
|
119
|
+
rejected,
|
|
120
|
+
stock,
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** 「HTTP_403 ×2 / TOO_SMALL ×5」这种计数串,比一串 URL 有用。 */
|
|
125
|
+
function summarizeRejects(list) {
|
|
126
|
+
const counts = new Map()
|
|
127
|
+
for (const item of list) counts.set(item.code, (counts.get(item.code) || 0) + 1)
|
|
128
|
+
return [...counts.entries()].sort((a, b) => b[1] - a[1])
|
|
129
|
+
.map(([code, n]) => `${code} ×${n}`)
|
|
130
|
+
.join(' / ')
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const imagesearchCapability = defineCapability({
|
|
134
|
+
id: 'imagesearch',
|
|
135
|
+
title: '图片检索',
|
|
136
|
+
tags: ['read'],
|
|
137
|
+
features: ['media.search'],
|
|
138
|
+
tools: [
|
|
139
|
+
defineTool({
|
|
140
|
+
name: 'ppt_images',
|
|
141
|
+
description: '图片搜索:返回已探测的候选直链(verified=能下载+真实宽度达标+不是带水印的图库预览/视频截帧,整轮 12s 内)。选中后直接用 ppt_image { src: url, slide } 插入,不要换 URL 试探。候选比搜索命中少是正常的:水印图库、缩略图、视频截帧、尺寸不够的都被剔掉了。',
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
query: { type: 'string', maxLength: 120, description: '中文或英文图片搜索词' },
|
|
146
|
+
count: { type: 'integer', minimum: 1, maximum: 12, description: '需要的候选数量,缺省 6' },
|
|
147
|
+
min_width: { type: 'integer', description: '最小宽度像素,缺省 480;显式传了就只返回量得出且达标的图' },
|
|
148
|
+
},
|
|
149
|
+
required: ['query'],
|
|
150
|
+
additionalProperties: false,
|
|
151
|
+
},
|
|
152
|
+
kind: 'read',
|
|
153
|
+
since: '2.3.0',
|
|
154
|
+
handler: async ({ query, count, min_width }) => {
|
|
155
|
+
const want = Math.min(12, Math.max(1, Number(count) || 6))
|
|
156
|
+
const strict = min_width != null && Number(min_width) > 0
|
|
157
|
+
const floor = strict ? Number(min_width) : MIN_WIDTH
|
|
158
|
+
const cacheKey = `${query}|${want}|${floor}|${strict ? 'strict' : 'loose'}`
|
|
159
|
+
const hit = cache.get(cacheKey)
|
|
160
|
+
if (hit && Date.now() - hit.at < CACHE_TTL_MS) return { text: hit.text }
|
|
161
|
+
|
|
162
|
+
const deadline = Date.now() + TOTAL_BUDGET_MS
|
|
163
|
+
/* 不再按 Bing 的 width 预筛:它经常不给宽高,缺失值当 0 时旧代码用 `!item.width`
|
|
164
|
+
* 放行,min_width 形同虚设,6 条候选全是缩略图。尺寸一律以预检读出的为准。 */
|
|
165
|
+
const found = await searchBing(query, want * 3, deadline, floor)
|
|
166
|
+
if (!found.length) throw new Error(`没有找到图片(${query}):换更具体的词,或改用本地图片路径`)
|
|
167
|
+
|
|
168
|
+
const { candidates, verifiedCount, rejected, stock } = await filterCandidates(
|
|
169
|
+
found, want, floor, deadline, { strict },
|
|
170
|
+
)
|
|
171
|
+
if (!candidates.length) {
|
|
172
|
+
const parts = [summarizeRejects(rejected)]
|
|
173
|
+
if (stock.length) parts.push(`STOCK_PREVIEW ×${stock.length}`)
|
|
174
|
+
const detail = parts.filter(Boolean).join(' / ') || '未探测完'
|
|
175
|
+
throw new Error(`搜到 ${found.length} 条但都不可用(${detail}):换搜索词(英文关键词通常更干净),或把图存到本地用 path 传入`)
|
|
176
|
+
}
|
|
177
|
+
const results = candidates.map((item) => ({
|
|
178
|
+
title: item.title,
|
|
179
|
+
page: item.page,
|
|
180
|
+
url: item.url,
|
|
181
|
+
width: item.width,
|
|
182
|
+
height: item.height,
|
|
183
|
+
bytes: item.bytes || 0,
|
|
184
|
+
verified: item.width != null && item.width >= floor,
|
|
185
|
+
}))
|
|
186
|
+
const dropped = rejected.length + stock.length
|
|
187
|
+
const note = verifiedCount === results.length
|
|
188
|
+
? `候选均已探测:可下载、真实宽度≥${floor}px、不是图库水印预览图。直接用 ppt_image { src: url, slide } 插入,不要换 URL 试探。`
|
|
189
|
+
: `前 ${verifiedCount} 条已探测(可下载且宽度≥${floor}px);verified:false 的尺寸没量出来(服务器没回可解析的文件头),可能偏小,优先用前 ${verifiedCount} 条。`
|
|
190
|
+
+ (dropped ? `已剔除 ${dropped} 条(水印图库/缩略图/视频截帧/死链/尺寸不够)。` : '')
|
|
191
|
+
const text = JSON.stringify({
|
|
192
|
+
query,
|
|
193
|
+
count: results.length,
|
|
194
|
+
verified: verifiedCount,
|
|
195
|
+
images: results,
|
|
196
|
+
note,
|
|
197
|
+
}, null, 2)
|
|
198
|
+
cache.set(cacheKey, { at: Date.now(), text })
|
|
199
|
+
return { text }
|
|
200
|
+
},
|
|
201
|
+
}),
|
|
202
|
+
],
|
|
203
|
+
})
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/** PPTX 导入:把本机文件交给编辑器内置的 PPTist 导入器,返回导入摘要。 */
|
|
2
|
+
import crypto from 'node:crypto'
|
|
3
|
+
import fs from 'node:fs'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
6
|
+
|
|
7
|
+
const MAX_BYTES = 128 * 1024 * 1024
|
|
8
|
+
const DEFAULT_WAIT_MS = 180_000
|
|
9
|
+
const MAX_WAIT_MS = 300_000
|
|
10
|
+
const RESULT_URL = '/api/desktop/works/ppt-bridge/import-result'
|
|
11
|
+
const PPTX_EXT = /\.pptx$/i
|
|
12
|
+
|
|
13
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
14
|
+
|
|
15
|
+
function readBytes({ filePath, data }) {
|
|
16
|
+
if (filePath && data) throw new Error('path 与 data 只能二选一')
|
|
17
|
+
if (!filePath && !data) throw new Error('请提供 path(本机 .pptx 路径)或 data(base64)')
|
|
18
|
+
|
|
19
|
+
if (filePath) {
|
|
20
|
+
const abs = path.resolve(String(filePath))
|
|
21
|
+
let stat
|
|
22
|
+
try {
|
|
23
|
+
stat = fs.statSync(abs)
|
|
24
|
+
} catch {
|
|
25
|
+
throw new Error(`找不到文件:${abs}`)
|
|
26
|
+
}
|
|
27
|
+
if (!stat.isFile()) throw new Error(`不是文件:${abs}`)
|
|
28
|
+
if (!PPTX_EXT.test(abs)) throw new Error('只支持 .pptx(OOXML)文件;.ppt 请先用 PowerPoint 另存为 .pptx')
|
|
29
|
+
if (stat.size > MAX_BYTES) throw new Error(`文件过大:${Math.round(stat.size / 1024 / 1024)}MB(上限 ${MAX_BYTES / 1024 / 1024}MB)`)
|
|
30
|
+
return { bytes: fs.readFileSync(abs), name: path.basename(abs), path: abs }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const bytes = Buffer.from(String(data), 'base64')
|
|
34
|
+
if (!bytes.length) throw new Error('data 不是有效的 base64 内容')
|
|
35
|
+
if (bytes.length > MAX_BYTES) throw new Error(`文件过大:${Math.round(bytes.length / 1024 / 1024)}MB(上限 ${MAX_BYTES / 1024 / 1024}MB)`)
|
|
36
|
+
return { bytes, name: 'import.pptx', path: '' }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function assertPptx(bytes) {
|
|
40
|
+
if (bytes.length < 4 || bytes[0] !== 0x50 || bytes[1] !== 0x4b) {
|
|
41
|
+
throw new Error('不是有效的 PPTX 文件(缺少 ZIP/OOXML 头)')
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function compactDeck(deck) {
|
|
46
|
+
const slides = Array.isArray(deck?.slides) ? deck.slides : []
|
|
47
|
+
return {
|
|
48
|
+
title: deck?.title || '',
|
|
49
|
+
slides: slides.length,
|
|
50
|
+
elements: slides.reduce((sum, slide) => sum + (Array.isArray(slide.elements) ? slide.elements.length : 0), 0),
|
|
51
|
+
perSlide: slides.map((slide, index) => ({
|
|
52
|
+
index,
|
|
53
|
+
elements: Array.isArray(slide.elements) ? slide.elements.length : 0,
|
|
54
|
+
types: Array.from(new Set((slide.elements || []).map((el) => el.type).filter(Boolean))),
|
|
55
|
+
})),
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function waitForMirror(ctx, summary, timeoutMs = 8000) {
|
|
60
|
+
const wantSlides = Number(summary?.import?.final ?? summary?.slideCount ?? 0)
|
|
61
|
+
const wantTitle = String(summary?.title || '')
|
|
62
|
+
const deadline = Date.now() + timeoutMs
|
|
63
|
+
let doc = await ctx.deck.read()
|
|
64
|
+
while (Date.now() < deadline) {
|
|
65
|
+
const deck = doc?.deck || {}
|
|
66
|
+
const slides = Array.isArray(deck.slides) ? deck.slides.length : 0
|
|
67
|
+
const titleOk = !wantTitle || String(deck.title || '') === wantTitle
|
|
68
|
+
if ((!wantSlides || slides === wantSlides) && titleOk) return { doc, synced: true }
|
|
69
|
+
await sleep(150)
|
|
70
|
+
doc = await ctx.deck.read()
|
|
71
|
+
}
|
|
72
|
+
return { doc, synced: false }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const importCapability = defineCapability({
|
|
76
|
+
id: 'import',
|
|
77
|
+
title: '导入 PPTX',
|
|
78
|
+
tags: ['write', 'file'],
|
|
79
|
+
requires: ['deck', 'editor', 'importer'],
|
|
80
|
+
features: ['deck.import'],
|
|
81
|
+
tools: [
|
|
82
|
+
defineTool({
|
|
83
|
+
name: 'ppt_import_pptx',
|
|
84
|
+
description: '打开本机 .pptx:交给当前编辑器的原生导入器转换成可编辑 deck。导入后返回标题/页数/每页元素摘要;动画、母版、SmartArt、复杂图表等可能丢失。',
|
|
85
|
+
inputSchema: {
|
|
86
|
+
type: 'object',
|
|
87
|
+
properties: {
|
|
88
|
+
path: { type: 'string', description: '本机 .pptx 文件路径(绝对路径,或相对 MCP 进程 cwd)' },
|
|
89
|
+
data: { type: 'string', description: '可选:PPTX 的 base64 内容(无法访问 path 时使用)' },
|
|
90
|
+
name: { type: 'string', maxLength: 200, description: '显示文件名;缺省取 path 的 basename' },
|
|
91
|
+
mode: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
enum: ['replace', 'append'],
|
|
94
|
+
description: 'replace(默认)用导入内容替换当前 deck;append 追加到现有页之后',
|
|
95
|
+
},
|
|
96
|
+
wait_ms: {
|
|
97
|
+
type: 'integer',
|
|
98
|
+
minimum: 1000,
|
|
99
|
+
maximum: MAX_WAIT_MS,
|
|
100
|
+
description: '等待编辑器完成导入的毫秒数(默认 180000)',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
additionalProperties: false,
|
|
104
|
+
},
|
|
105
|
+
kind: 'write',
|
|
106
|
+
since: '2.4.0',
|
|
107
|
+
handler: async ({ path: filePath, data, name, mode, wait_ms }, ctx) => {
|
|
108
|
+
const input = readBytes({ filePath, data })
|
|
109
|
+
assertPptx(input.bytes)
|
|
110
|
+
const displayName = String(name || input.name || 'import.pptx')
|
|
111
|
+
const importMode = mode === 'append' ? 'append' : 'replace'
|
|
112
|
+
const waitMs = Math.max(1000, Math.min(Number(wait_ms) || DEFAULT_WAIT_MS, MAX_WAIT_MS))
|
|
113
|
+
|
|
114
|
+
/* 导入必须在编辑器页面里执行(复用 PPTist 的 DOM/字体/图片上下文)。 */
|
|
115
|
+
await ctx.editor.require(4000)
|
|
116
|
+
|
|
117
|
+
const uploaded = await ctx.importer.upload(input.bytes, displayName, input.path || '')
|
|
118
|
+
if (!uploaded || !uploaded.url) throw new Error('上传 PPTX 失败:桥没有返回临时文件地址')
|
|
119
|
+
|
|
120
|
+
const req = `imp_${Date.now().toString(36)}_${crypto.randomBytes(4).toString('hex')}`
|
|
121
|
+
const pushed = await ctx.deck.write([
|
|
122
|
+
/* 先压服务端历史快照:导入是编辑器级操作,不走 op 内核;
|
|
123
|
+
* 没有这一步 ppt_history undo 回不到导入前。 */
|
|
124
|
+
{ op: 'snapshot' },
|
|
125
|
+
{
|
|
126
|
+
op: 'import-pptx',
|
|
127
|
+
req,
|
|
128
|
+
id: uploaded.id,
|
|
129
|
+
url: uploaded.url,
|
|
130
|
+
name: displayName,
|
|
131
|
+
mode: importMode,
|
|
132
|
+
resultUrl: RESULT_URL,
|
|
133
|
+
},
|
|
134
|
+
])
|
|
135
|
+
if (!pushed.ok) throw new Error('导入指令投递失败:' + (pushed.error || '编辑器未接受指令'))
|
|
136
|
+
|
|
137
|
+
const deadline = Date.now() + waitMs
|
|
138
|
+
let result = null
|
|
139
|
+
while (Date.now() < deadline) {
|
|
140
|
+
try {
|
|
141
|
+
const current = await ctx.importer.result(req)
|
|
142
|
+
if (current && current.done) { result = current; break }
|
|
143
|
+
} catch { /* relay 瞬断:继续轮询直到超时 */ }
|
|
144
|
+
await sleep(200)
|
|
145
|
+
}
|
|
146
|
+
if (!result) {
|
|
147
|
+
throw new Error(
|
|
148
|
+
`等待编辑器导入超时(${Math.round(waitMs / 1000)}s):请确认编辑器页面已打开并刷新到最新版本`,
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
if (!result.ok) throw new Error('PPTX 导入失败:' + (result.error || '编辑器未返回错误详情'))
|
|
152
|
+
|
|
153
|
+
const { doc, synced } = await waitForMirror(ctx, result.summary)
|
|
154
|
+
const deck = compactDeck(doc?.deck)
|
|
155
|
+
const summary = result.summary && typeof result.summary === 'object' ? result.summary : {}
|
|
156
|
+
const warnings = []
|
|
157
|
+
if (!synced) warnings.push('deck 镜像尚未追上导入结果;稍后调用 ppt_get_deck 复查')
|
|
158
|
+
if (summary.mounted === false) warnings.push('编辑器返回 mounted=false,导入结果可能不完整')
|
|
159
|
+
const expectedFinal = Number(summary.import?.final ?? summary.slideCount ?? 0)
|
|
160
|
+
if (expectedFinal && deck.perSlide.length !== expectedFinal) {
|
|
161
|
+
warnings.push('导入摘要与 deck 页数不一致;请用 ppt_get_deck 复查')
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
text: JSON.stringify({
|
|
166
|
+
ok: true,
|
|
167
|
+
source: { name: displayName, path: input.path || '', bytes: input.bytes.length, mode: importMode },
|
|
168
|
+
title: deck.title || summary.title || '',
|
|
169
|
+
slideCount: deck.slides,
|
|
170
|
+
elementCount: deck.elements,
|
|
171
|
+
deck: { title: deck.title, slides: deck.slides, elements: deck.elements, perSlide: deck.perSlide },
|
|
172
|
+
imported: summary,
|
|
173
|
+
warnings,
|
|
174
|
+
note: 'PPTX 已转换为 PPTist 编辑模型;动画/母版/SmartArt/复杂图表等可能丢失。建议随后调用 ppt_get_deck 或 ppt_audit 检查。',
|
|
175
|
+
}, null, 2),
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
],
|
|
180
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 能力清单:唯一扩展点。
|
|
3
|
+
*
|
|
4
|
+
* 新增能力:新建 capabilities/<id>.mjs,导出 defineCapability(...),
|
|
5
|
+
* 然后在这里加一行 import 和数组项即可。contract / instructions / 测试
|
|
6
|
+
* 全部由 registry 自动派生。
|
|
7
|
+
*/
|
|
8
|
+
import { manuscriptCapability } from './manuscript.mjs'
|
|
9
|
+
import { contractCapability } from './contract.mjs'
|
|
10
|
+
import { deckCapability } from './deck.mjs'
|
|
11
|
+
import { auditCapability } from './audit.mjs'
|
|
12
|
+
import { inspectCapability } from './inspect.mjs'
|
|
13
|
+
import { taskCapability } from './task.mjs'
|
|
14
|
+
import { textCapability } from './text.mjs'
|
|
15
|
+
import { styleCapability } from './style.mjs'
|
|
16
|
+
import { elementCapability } from './element.mjs'
|
|
17
|
+
import { slideCapability } from './slide.mjs'
|
|
18
|
+
import { applyCapability } from './apply.mjs'
|
|
19
|
+
import { composeCapability } from './compose.mjs'
|
|
20
|
+
import { recolorCapability } from './recolor.mjs'
|
|
21
|
+
import { imageCapability } from './image.mjs'
|
|
22
|
+
import { imagesearchCapability } from './imagesearch.mjs'
|
|
23
|
+
import { screenshotCapability } from './screenshot.mjs'
|
|
24
|
+
import { presentCapability } from './present.mjs'
|
|
25
|
+
import { historyCapability } from './history.mjs'
|
|
26
|
+
import { chartCapability } from './chart.mjs'
|
|
27
|
+
import { tableCapability } from './table.mjs'
|
|
28
|
+
import { notesCapability } from './notes.mjs'
|
|
29
|
+
import { shapeCapability } from './shape.mjs'
|
|
30
|
+
import { lineCapability } from './line.mjs'
|
|
31
|
+
import { formulaCapability } from './formula.mjs'
|
|
32
|
+
import { importCapability } from './import.mjs'
|
|
33
|
+
import { exportCapability } from './export.mjs'
|
|
34
|
+
|
|
35
|
+
export const CAPABILITIES = [
|
|
36
|
+
/* 稿件排在最前:它是默认路径,后面的元素级工具是逃生口。 */
|
|
37
|
+
manuscriptCapability,
|
|
38
|
+
contractCapability,
|
|
39
|
+
deckCapability,
|
|
40
|
+
auditCapability,
|
|
41
|
+
/* 体检紧跟在审计后面:审计看整份(配色/密度/重复),体检看单页的几何与字号。 */
|
|
42
|
+
inspectCapability,
|
|
43
|
+
taskCapability,
|
|
44
|
+
textCapability,
|
|
45
|
+
styleCapability,
|
|
46
|
+
elementCapability,
|
|
47
|
+
slideCapability,
|
|
48
|
+
applyCapability,
|
|
49
|
+
composeCapability,
|
|
50
|
+
recolorCapability,
|
|
51
|
+
imageCapability,
|
|
52
|
+
imagesearchCapability,
|
|
53
|
+
screenshotCapability,
|
|
54
|
+
presentCapability,
|
|
55
|
+
historyCapability,
|
|
56
|
+
chartCapability,
|
|
57
|
+
tableCapability,
|
|
58
|
+
notesCapability,
|
|
59
|
+
shapeCapability,
|
|
60
|
+
lineCapability,
|
|
61
|
+
formulaCapability,
|
|
62
|
+
importCapability,
|
|
63
|
+
exportCapability,
|
|
64
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** 版面体检能力:不需要编辑器在线,确定性数字代替截图。 */
|
|
2
|
+
import { formatInspect, inspectDeck, resolveSlide } from '../../../core/inspect.js'
|
|
3
|
+
import { defineCapability, defineTool } from '../kernel/define.mjs'
|
|
4
|
+
|
|
5
|
+
export const inspectCapability = defineCapability({
|
|
6
|
+
id: 'inspect',
|
|
7
|
+
title: '版面体检',
|
|
8
|
+
tags: ['read', 'layout', 'visual'],
|
|
9
|
+
requires: ['deck'],
|
|
10
|
+
features: ['deck.inspect'],
|
|
11
|
+
tools: [
|
|
12
|
+
defineTool({
|
|
13
|
+
name: 'ppt_inspect',
|
|
14
|
+
description: '版面体检(不需要编辑器在线):逐元素给出位置/尺寸/字号/排了几行/需要多高/盒子多高,'
|
|
15
|
+
+ '标出文字溢出、越界、元素重叠、字号过小,并指出溢出的文字会压住下面哪个元素。'
|
|
16
|
+
+ '用户问「这页布局为什么难看」时先看这里(比截图可靠:不依赖窗口、不缩小、每次结果一样)。',
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
slide: {
|
|
21
|
+
anyOf: [{ type: 'integer' }, { type: 'string' }],
|
|
22
|
+
description: '只看某一页:页号 1 起(第 3 页写 3),也可写 #p3 / slide id / 标题片段;省略则体检整份',
|
|
23
|
+
},
|
|
24
|
+
verbose: {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
description: '连没问题的元素也逐条列出(默认只列有问题的元素;指定 slide 时该页自动全列)',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
},
|
|
31
|
+
kind: 'read',
|
|
32
|
+
since: '2.5.53',
|
|
33
|
+
handler: async ({ slide, verbose }, ctx) => {
|
|
34
|
+
const doc = await ctx.deck.read()
|
|
35
|
+
const deck = doc.deck
|
|
36
|
+
const count = deck && Array.isArray(deck.slides) ? deck.slides.length : 0
|
|
37
|
+
if (!count) throw new Error('当前演示文稿为空(0 页),没有可体检的版面。先用 ppt_write 写一份稿件。')
|
|
38
|
+
const only = resolveSlide(deck, slide)
|
|
39
|
+
if (only === -1) throw new Error(`页号越界:${slide}(共 ${count} 页,页号 1 起)`)
|
|
40
|
+
if (only === -2) throw new Error(`找不到这一页:${slide}(可用页号 / #p3 / slide id / 标题片段)`)
|
|
41
|
+
const report = inspectDeck(deck, { only })
|
|
42
|
+
return { text: formatInspect(report, { verbose: !!verbose }) }
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
],
|
|
46
|
+
})
|