@capyclaw/ppt-suite 2.5.69 → 2.5.71
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/composition.lock.json +27 -27
- package/contract/ppt-contract.json +27 -1
- package/dsh-suite.json +27 -17
- package/node_modules/@capyclaw/asset-service/dsh-suite.json +1 -1
- package/node_modules/@capyclaw/asset-service/package.json +1 -1
- package/node_modules/@capyclaw/asset-service/src/index.mjs +4 -3
- package/node_modules/@capyclaw/document-workbench/package.json +6 -3
- package/node_modules/@capyclaw/document-workbench/src/client/index.mjs +56 -3
- package/node_modules/@capyclaw/document-workbench/src/client/visibility.mjs +112 -0
- package/node_modules/@capyclaw/document-workbench/src/model/manifest.mjs +6 -4
- package/node_modules/@capyclaw/document-workbench/src/model/ops.mjs +7 -2
- package/node_modules/@capyclaw/document-workbench/src/session/index.mjs +8 -0
- package/node_modules/@capyclaw/document-workbench/src/store/file-backend.mjs +17 -10
- package/node_modules/@capyclaw/document-workbench/src/store/projection.mjs +39 -0
- package/node_modules/@capyclaw/document-workbench/src/testing/index.mjs +14 -11
- package/node_modules/@capyclaw/editor-host/dsh-suite.json +1 -1
- package/node_modules/@capyclaw/editor-host/package.json +1 -1
- package/node_modules/@capyclaw/editor-host/src/index.mjs +12 -21
- package/node_modules/@capyclaw/foundation/abi/assets.mjs +26 -0
- package/node_modules/@capyclaw/foundation/abi/bridge.mjs +3 -1
- package/node_modules/@capyclaw/foundation/abi/index.mjs +15 -0
- package/node_modules/@capyclaw/foundation/abi/visibility.mjs +90 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/lifecycle-hook.mjs +21 -4
- package/node_modules/@capyclaw/foundation/lib/host/caps.mjs +5 -1
- package/node_modules/@capyclaw/foundation/lib/host/contract.mjs +5 -2
- package/node_modules/@capyclaw/foundation/lib/host/dsh.mjs +4 -0
- package/node_modules/@capyclaw/foundation/lib/host/memory.mjs +29 -2
- package/node_modules/@capyclaw/foundation/lib/kernel.mjs +13 -3
- package/node_modules/@capyclaw/foundation/package.json +1 -1
- package/node_modules/@capyclaw/plugin-kit/package.json +3 -1
- package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat-worker.js +5 -2
- package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat.mjs +26 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +3 -1
- package/node_modules/@capyclaw/plugin-kit/src/service/static.mjs +79 -0
- package/node_modules/@capyclaw/plugin-kit/src/workspace/manager.mjs +13 -5
- package/node_modules/@capyclaw/portal/package.json +1 -1
- package/node_modules/@capyclaw/ppt-editor/app.js +458 -10
- package/node_modules/@capyclaw/ppt-editor/contract/ppt-contract.json +27 -1
- package/node_modules/@capyclaw/ppt-editor/heartbeat-worker.js +5 -2
- package/node_modules/@capyclaw/ppt-editor/index.html +4 -0
- package/node_modules/@capyclaw/ppt-editor/package.json +2 -2
- package/node_modules/@capyclaw/ppt-skill-api/contract/ppt-contract.json +27 -1
- package/node_modules/@capyclaw/ppt-skill-api/package.json +1 -1
- package/node_modules/@capyclaw/ppt-skill-api/skills/pptist-api/references/tool-contract.md +1 -1
- package/node_modules/@capyclaw/ppt-skill-proposal/contract/ppt-contract.json +27 -1
- package/node_modules/@capyclaw/ppt-skill-proposal/package.json +1 -1
- package/node_modules/@capyclaw/ppt-workbench/contract/ppt-contract.json +27 -1
- package/node_modules/@capyclaw/ppt-workbench/core/deck-layout.js +3 -1
- package/node_modules/@capyclaw/ppt-workbench/core/ops/slide.js +9 -3
- package/node_modules/@capyclaw/ppt-workbench/core/text.js +14 -2
- package/node_modules/@capyclaw/ppt-workbench/package.json +10 -8
- package/node_modules/@capyclaw/ppt-workbench/plugin.mjs +13 -1
- package/node_modules/@capyclaw/ppt-workbench/server/contract.mjs +1 -1
- package/node_modules/@capyclaw/ppt-workbench/server/embedded-host.mjs +201 -20
- package/node_modules/@capyclaw/ppt-workbench/server/relay.mjs +10 -7
- package/node_modules/@capyclaw/ppt-workbench/server/shared/SHARED_MANIFEST.json +4 -4
- package/node_modules/@capyclaw/ppt-workbench/server/store/backends/file-backend.mjs +3 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/checkpoints.mjs +4 -1
- package/node_modules/@capyclaw/ppt-workbench/server/store/index.mjs +4 -0
- package/node_modules/@capyclaw/ppt-workbench/server/store/sessions.mjs +139 -4
- package/node_modules/@capyclaw/ppt-workbench/server/store/shape.mjs +37 -0
- package/node_modules/@capyclaw/ppt-workbench/server/workbench-framework.mjs +34 -0
- package/node_modules/@capyclaw/service-broker/README.md +1 -1
- package/node_modules/@capyclaw/service-broker/lib/control.mjs +23 -7
- package/node_modules/@capyclaw/service-broker/lib/engine.mjs +60 -6
- package/node_modules/@capyclaw/service-broker/lib/host.mjs +11 -6
- package/node_modules/@capyclaw/service-broker/lib/skills-client.mjs +30 -10
- package/node_modules/@capyclaw/service-broker/package.json +1 -1
- package/node_modules/@capyclaw/service-host/dsh-suite.json +1 -1
- package/node_modules/@capyclaw/service-host/package.json +1 -1
- package/node_modules/@capyclaw/service-host/src/index.mjs +13 -22
- package/node_modules/@capyclaw/skills-service/README.md +42 -10
- package/node_modules/@capyclaw/skills-service/package.json +6 -3
- package/node_modules/@capyclaw/skills-service/server.mjs +129 -51
- package/node_modules/@capyclaw/suite-kit/README.md +289 -0
- package/node_modules/@capyclaw/suite-kit/bin/dsh-domain.mjs +98 -0
- package/node_modules/@capyclaw/suite-kit/bin/dsh-suite.mjs +174 -0
- package/node_modules/@capyclaw/suite-kit/client/embed.js +35 -0
- package/node_modules/@capyclaw/suite-kit/domain.schema.json +129 -0
- package/node_modules/@capyclaw/suite-kit/package.json +58 -0
- package/node_modules/@capyclaw/suite-kit/src/activation-registry.mjs +184 -0
- package/node_modules/@capyclaw/suite-kit/src/artifacts.mjs +131 -0
- package/node_modules/@capyclaw/suite-kit/src/capability.mjs +181 -0
- package/node_modules/@capyclaw/suite-kit/src/compose.mjs +201 -0
- package/node_modules/@capyclaw/suite-kit/src/domain.mjs +138 -0
- package/node_modules/@capyclaw/suite-kit/src/embed.mjs +81 -0
- package/node_modules/@capyclaw/suite-kit/src/host.mjs +230 -0
- package/node_modules/@capyclaw/suite-kit/src/index.mjs +24 -0
- package/node_modules/@capyclaw/suite-kit/src/manifest.mjs +263 -0
- package/node_modules/@capyclaw/suite-kit/src/orchestration.mjs +100 -0
- package/node_modules/@capyclaw/suite-kit/src/profile.mjs +584 -0
- package/node_modules/@capyclaw/suite-kit/src/surface.mjs +28 -0
- package/node_modules/@capyclaw/suite-kit/suite.schema.json +128 -0
- package/node_modules/@capyclaw/tool-host/dsh-suite.json +2 -2
- package/node_modules/@capyclaw/tool-host/lib/host.mjs +34 -4
- package/node_modules/@capyclaw/tool-host/package.json +1 -1
- package/node_modules/@capyclaw/tool-host/src/admit-images.mjs +80 -0
- package/node_modules/@capyclaw/tool-host/src/caller-session.mjs +25 -0
- package/node_modules/@capyclaw/tool-host/src/index.mjs +59 -14
- package/node_modules/@capyclaw/tool-host/src/mode-gate.mjs +272 -0
- package/node_modules/@capyclaw/work-store/README.md +83 -0
- package/node_modules/@capyclaw/work-store/STANDARD.md +263 -0
- package/node_modules/@capyclaw/work-store/cordis.patch.yml +3 -0
- package/node_modules/@capyclaw/work-store/dsh-suite.json +33 -0
- package/node_modules/@capyclaw/work-store/icon.svg +7 -0
- package/node_modules/@capyclaw/work-store/lib/host.mjs +21 -0
- package/node_modules/@capyclaw/work-store/package.json +68 -0
- package/node_modules/@capyclaw/work-store/src/backend.mjs +90 -0
- package/node_modules/@capyclaw/work-store/src/db.mjs +199 -0
- package/node_modules/@capyclaw/work-store/src/envelope.mjs +132 -0
- package/node_modules/@capyclaw/work-store/src/index.mjs +571 -0
- package/node_modules/@capyclaw/work-store/src/interop.mjs +70 -0
- package/node_modules/@capyclaw/work-store/src/refs.mjs +99 -0
- package/node_modules/@capyclaw/work-store/src/routes.mjs +135 -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/package.json +17 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contractVersion": "2.5.0",
|
|
3
|
-
"packageVersion": "2.5.
|
|
3
|
+
"packageVersion": "2.5.71",
|
|
4
4
|
"toolCount": 32,
|
|
5
5
|
"tools": [
|
|
6
6
|
{
|
|
@@ -1520,6 +1520,7 @@
|
|
|
1520
1520
|
"compose",
|
|
1521
1521
|
"edit"
|
|
1522
1522
|
],
|
|
1523
|
+
"domain": "",
|
|
1523
1524
|
"tools": [
|
|
1524
1525
|
"ppt_outline",
|
|
1525
1526
|
"ppt_write",
|
|
@@ -1534,6 +1535,7 @@
|
|
|
1534
1535
|
"tags": [
|
|
1535
1536
|
"meta"
|
|
1536
1537
|
],
|
|
1538
|
+
"domain": "",
|
|
1537
1539
|
"tools": [
|
|
1538
1540
|
"ppt_capabilities"
|
|
1539
1541
|
]
|
|
@@ -1545,6 +1547,7 @@
|
|
|
1545
1547
|
"tags": [
|
|
1546
1548
|
"read"
|
|
1547
1549
|
],
|
|
1550
|
+
"domain": "",
|
|
1548
1551
|
"tools": [
|
|
1549
1552
|
"ppt_get_deck"
|
|
1550
1553
|
]
|
|
@@ -1557,6 +1560,7 @@
|
|
|
1557
1560
|
"read",
|
|
1558
1561
|
"quality"
|
|
1559
1562
|
],
|
|
1563
|
+
"domain": "",
|
|
1560
1564
|
"tools": [
|
|
1561
1565
|
"ppt_audit"
|
|
1562
1566
|
]
|
|
@@ -1570,6 +1574,7 @@
|
|
|
1570
1574
|
"layout",
|
|
1571
1575
|
"visual"
|
|
1572
1576
|
],
|
|
1577
|
+
"domain": "",
|
|
1573
1578
|
"tools": [
|
|
1574
1579
|
"ppt_inspect"
|
|
1575
1580
|
]
|
|
@@ -1581,6 +1586,7 @@
|
|
|
1581
1586
|
"tags": [
|
|
1582
1587
|
"state"
|
|
1583
1588
|
],
|
|
1589
|
+
"domain": "",
|
|
1584
1590
|
"tools": [
|
|
1585
1591
|
"ppt_task"
|
|
1586
1592
|
]
|
|
@@ -1593,6 +1599,7 @@
|
|
|
1593
1599
|
"write",
|
|
1594
1600
|
"content"
|
|
1595
1601
|
],
|
|
1602
|
+
"domain": "",
|
|
1596
1603
|
"tools": [
|
|
1597
1604
|
"ppt_text",
|
|
1598
1605
|
"ppt_fill"
|
|
@@ -1606,6 +1613,7 @@
|
|
|
1606
1613
|
"write",
|
|
1607
1614
|
"style"
|
|
1608
1615
|
],
|
|
1616
|
+
"domain": "",
|
|
1609
1617
|
"tools": [
|
|
1610
1618
|
"ppt_style"
|
|
1611
1619
|
]
|
|
@@ -1618,6 +1626,7 @@
|
|
|
1618
1626
|
"write",
|
|
1619
1627
|
"layout"
|
|
1620
1628
|
],
|
|
1629
|
+
"domain": "",
|
|
1621
1630
|
"tools": [
|
|
1622
1631
|
"ppt_element"
|
|
1623
1632
|
]
|
|
@@ -1630,6 +1639,7 @@
|
|
|
1630
1639
|
"write",
|
|
1631
1640
|
"structure"
|
|
1632
1641
|
],
|
|
1642
|
+
"domain": "",
|
|
1633
1643
|
"tools": [
|
|
1634
1644
|
"ppt_slide"
|
|
1635
1645
|
]
|
|
@@ -1641,6 +1651,7 @@
|
|
|
1641
1651
|
"tags": [
|
|
1642
1652
|
"advanced"
|
|
1643
1653
|
],
|
|
1654
|
+
"domain": "",
|
|
1644
1655
|
"tools": [
|
|
1645
1656
|
"ppt_apply"
|
|
1646
1657
|
]
|
|
@@ -1653,6 +1664,7 @@
|
|
|
1653
1664
|
"recipe",
|
|
1654
1665
|
"layout"
|
|
1655
1666
|
],
|
|
1667
|
+
"domain": "",
|
|
1656
1668
|
"tools": [
|
|
1657
1669
|
"ppt_deck",
|
|
1658
1670
|
"ppt_page"
|
|
@@ -1666,6 +1678,7 @@
|
|
|
1666
1678
|
"recipe",
|
|
1667
1679
|
"style"
|
|
1668
1680
|
],
|
|
1681
|
+
"domain": "",
|
|
1669
1682
|
"tools": [
|
|
1670
1683
|
"ppt_recolor"
|
|
1671
1684
|
]
|
|
@@ -1678,6 +1691,7 @@
|
|
|
1678
1691
|
"write",
|
|
1679
1692
|
"media"
|
|
1680
1693
|
],
|
|
1694
|
+
"domain": "",
|
|
1681
1695
|
"tools": [
|
|
1682
1696
|
"ppt_image"
|
|
1683
1697
|
]
|
|
@@ -1689,6 +1703,7 @@
|
|
|
1689
1703
|
"tags": [
|
|
1690
1704
|
"read"
|
|
1691
1705
|
],
|
|
1706
|
+
"domain": "",
|
|
1692
1707
|
"tools": [
|
|
1693
1708
|
"ppt_images"
|
|
1694
1709
|
]
|
|
@@ -1701,6 +1716,7 @@
|
|
|
1701
1716
|
"read",
|
|
1702
1717
|
"visual"
|
|
1703
1718
|
],
|
|
1719
|
+
"domain": "",
|
|
1704
1720
|
"tools": [
|
|
1705
1721
|
"ppt_screenshot"
|
|
1706
1722
|
]
|
|
@@ -1712,6 +1728,7 @@
|
|
|
1712
1728
|
"tags": [
|
|
1713
1729
|
"control"
|
|
1714
1730
|
],
|
|
1731
|
+
"domain": "",
|
|
1715
1732
|
"tools": [
|
|
1716
1733
|
"ppt_present"
|
|
1717
1734
|
]
|
|
@@ -1723,6 +1740,7 @@
|
|
|
1723
1740
|
"tags": [
|
|
1724
1741
|
"control"
|
|
1725
1742
|
],
|
|
1743
|
+
"domain": "",
|
|
1726
1744
|
"tools": [
|
|
1727
1745
|
"ppt_history"
|
|
1728
1746
|
]
|
|
@@ -1735,6 +1753,7 @@
|
|
|
1735
1753
|
"write",
|
|
1736
1754
|
"data"
|
|
1737
1755
|
],
|
|
1756
|
+
"domain": "",
|
|
1738
1757
|
"tools": [
|
|
1739
1758
|
"ppt_chart"
|
|
1740
1759
|
]
|
|
@@ -1747,6 +1766,7 @@
|
|
|
1747
1766
|
"write",
|
|
1748
1767
|
"data"
|
|
1749
1768
|
],
|
|
1769
|
+
"domain": "",
|
|
1750
1770
|
"tools": [
|
|
1751
1771
|
"ppt_table",
|
|
1752
1772
|
"ppt_table_cells"
|
|
@@ -1760,6 +1780,7 @@
|
|
|
1760
1780
|
"write",
|
|
1761
1781
|
"content"
|
|
1762
1782
|
],
|
|
1783
|
+
"domain": "",
|
|
1763
1784
|
"tools": [
|
|
1764
1785
|
"ppt_notes"
|
|
1765
1786
|
]
|
|
@@ -1772,6 +1793,7 @@
|
|
|
1772
1793
|
"write",
|
|
1773
1794
|
"layout"
|
|
1774
1795
|
],
|
|
1796
|
+
"domain": "",
|
|
1775
1797
|
"tools": [
|
|
1776
1798
|
"ppt_shape"
|
|
1777
1799
|
]
|
|
@@ -1784,6 +1806,7 @@
|
|
|
1784
1806
|
"write",
|
|
1785
1807
|
"layout"
|
|
1786
1808
|
],
|
|
1809
|
+
"domain": "",
|
|
1787
1810
|
"tools": [
|
|
1788
1811
|
"ppt_line"
|
|
1789
1812
|
]
|
|
@@ -1796,6 +1819,7 @@
|
|
|
1796
1819
|
"write",
|
|
1797
1820
|
"content"
|
|
1798
1821
|
],
|
|
1822
|
+
"domain": "",
|
|
1799
1823
|
"tools": [
|
|
1800
1824
|
"ppt_formula"
|
|
1801
1825
|
]
|
|
@@ -1808,6 +1832,7 @@
|
|
|
1808
1832
|
"write",
|
|
1809
1833
|
"file"
|
|
1810
1834
|
],
|
|
1835
|
+
"domain": "",
|
|
1811
1836
|
"tools": [
|
|
1812
1837
|
"ppt_import_pptx"
|
|
1813
1838
|
]
|
|
@@ -1820,6 +1845,7 @@
|
|
|
1820
1845
|
"write",
|
|
1821
1846
|
"file"
|
|
1822
1847
|
],
|
|
1848
|
+
"domain": "",
|
|
1823
1849
|
"tools": [
|
|
1824
1850
|
"ppt_export_pptx"
|
|
1825
1851
|
]
|
|
@@ -35,9 +35,11 @@ const shapeEl = (id, x, y, w, h, fill, rotate = 0) => ({
|
|
|
35
35
|
path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z', viewBox: [200, 200],
|
|
36
36
|
fill, fixedRatio: false, rotate,
|
|
37
37
|
})
|
|
38
|
+
/* fit 保留签名但不再写入 clip:PPTist 的 clip 是裁剪范围 {shape,range},不是 object-fit;
|
|
39
|
+
* 写 {type:'cover'} 会让整张图渲染空白(2026-11 事故)。不裁剪=null,与 ppt_image 一致。 */
|
|
38
40
|
const imageEl = (id, x, y, w, h, src, fit = 'cover') => ({
|
|
39
41
|
type: 'image', id, left: x, top: y, width: w, height: h,
|
|
40
|
-
src: String(src || ''), clip:
|
|
42
|
+
src: String(src || ''), clip: null, fixedRatio: false, rotate: 0,
|
|
41
43
|
})
|
|
42
44
|
/** 页级 background / accent 覆盖:一张 deck 里允许单页换底色,但仍出自同一份预设。
|
|
43
45
|
* 换底色必须连带换字色,否则深底配深字——审计会判对比度不足,模型也看不出来。
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/** 页面 op:背景、增删改移复制、选中。 */
|
|
2
|
-
import { contrast } from '../text.js'
|
|
2
|
+
import { contrast, normalizeImageClip } from '../text.js'
|
|
3
3
|
|
|
4
4
|
const idx = (c) => (c.id != null ? c.id : c.index)
|
|
5
5
|
const clone = (P, i) => JSON.parse(JSON.stringify(P.getSlides()[i]))
|
|
6
|
+
/* 整页替换/新增时归一 image clip:编译产物或旧落库可能带 {type:'cover'},
|
|
7
|
+
* 不经 makeElement 直接进 PPTist 会渲染空白。统一转合法 clip 或 null。 */
|
|
8
|
+
const cleanSlide = (s) => {
|
|
9
|
+
if (!s || !Array.isArray(s.elements)) return s
|
|
10
|
+
return { ...s, elements: s.elements.map(e => (e && e.type === 'image' ? { ...e, clip: normalizeImageClip(e.clip) } : e)) }
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
export const slideOps = {
|
|
8
14
|
'set-background': {
|
|
@@ -20,12 +26,12 @@ export const slideOps = {
|
|
|
20
26
|
},
|
|
21
27
|
|
|
22
28
|
'add-slide': {
|
|
23
|
-
run(P, c) { P.addSlide(c.slide || {}, c.index) },
|
|
29
|
+
run(P, c) { P.addSlide(cleanSlide(c.slide || {}), c.index) },
|
|
24
30
|
},
|
|
25
31
|
|
|
26
32
|
'update-slide': {
|
|
27
33
|
run(P, c) {
|
|
28
|
-
if (!P.updateSlide(idx(c), c.slide)) throw new Error('update-slide 未命中')
|
|
34
|
+
if (!P.updateSlide(idx(c), cleanSlide(c.slide))) throw new Error('update-slide 未命中')
|
|
29
35
|
},
|
|
30
36
|
},
|
|
31
37
|
|
|
@@ -65,6 +65,18 @@ export function textHtml(current, props, st) {
|
|
|
65
65
|
return '<p style="' + style + '">' + body + '</p>'
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/** PPTist 的 image clip 只认 {shape, range:[[x,y],[x,y]]}(裁剪范围)。
|
|
69
|
+
* 历史上稿件编译曾写 {type:'cover'}(object-fit 语义),PPTist 不认 → 整张图渲染空白,
|
|
70
|
+
* 导出时解构 clip.range 还会 throw。统一在入口归一:非法 / 缺失一律 null(不裁剪)。 */
|
|
71
|
+
export function normalizeImageClip(clip) {
|
|
72
|
+
if (!clip || typeof clip !== 'object') return null
|
|
73
|
+
const range = clip.range
|
|
74
|
+
const okRange = Array.isArray(range) && range.length === 2 &&
|
|
75
|
+
range.every(p => Array.isArray(p) && p.length === 2 && p.every(n => isFinite(Number(n))))
|
|
76
|
+
if (typeof clip.shape !== 'string' || !okRange) return null
|
|
77
|
+
return { shape: clip.shape, range: range.map(p => [Number(p[0]), Number(p[1])]) }
|
|
78
|
+
}
|
|
79
|
+
|
|
68
80
|
/** 元素属性补丁:几何 / 填充 / 文本样式(content 重写保留正文)。 */
|
|
69
81
|
export function patchElement(el, props) {
|
|
70
82
|
;['left', 'top', 'width', 'height', 'rotate', 'opacity'].forEach(k => {
|
|
@@ -73,7 +85,7 @@ export function patchElement(el, props) {
|
|
|
73
85
|
if (props.fill != null) el.fill = String(props.fill)
|
|
74
86
|
if (el.type === 'image') {
|
|
75
87
|
if (props.src != null) el.src = String(props.src)
|
|
76
|
-
if (props.clip != null) el.clip = props.clip
|
|
88
|
+
if (props.clip != null) el.clip = normalizeImageClip(props.clip)
|
|
77
89
|
return
|
|
78
90
|
}
|
|
79
91
|
/* 公式元素:path/latex/viewBox 由渲染器产出,样式走 stroke。 */
|
|
@@ -175,7 +187,7 @@ export function makeElement(e) {
|
|
|
175
187
|
}
|
|
176
188
|
return Object.assign(base, {
|
|
177
189
|
src,
|
|
178
|
-
clip: e.clip
|
|
190
|
+
clip: normalizeImageClip(e.clip),
|
|
179
191
|
...(e.opacity != null ? { opacity: Number(e.opacity) } : {}),
|
|
180
192
|
})
|
|
181
193
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capyclaw/ppt-workbench",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.71",
|
|
4
4
|
"description": "PPT 工作台运行时(headless 可用):32 个 ppt_* MCP 工具(导入/导出 PPTX + 图表/表格/公式/形状/线条/备注 + 契约探测);浏览器实时编辑器由可选成员包 @capyclaw/ppt-editor 提供。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./plugin.mjs",
|
|
@@ -46,13 +46,15 @@
|
|
|
46
46
|
"license": "AGPL-3.0-or-later",
|
|
47
47
|
"scripts": {},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@capyclaw/asset-service": "^0.1.
|
|
50
|
-
"@capyclaw/document-workbench": "^0.2.
|
|
51
|
-
"@capyclaw/editor-host": "^0.1.
|
|
52
|
-
"@capyclaw/foundation": "^0.1.
|
|
53
|
-
"@capyclaw/plugin-kit": "^0.2.
|
|
54
|
-
"@capyclaw/service-host": "^0.1.
|
|
55
|
-
"@capyclaw/
|
|
49
|
+
"@capyclaw/asset-service": "^0.1.6",
|
|
50
|
+
"@capyclaw/document-workbench": "^0.2.4",
|
|
51
|
+
"@capyclaw/editor-host": "^0.1.7",
|
|
52
|
+
"@capyclaw/foundation": "^0.1.11",
|
|
53
|
+
"@capyclaw/plugin-kit": "^0.2.8",
|
|
54
|
+
"@capyclaw/service-host": "^0.1.7",
|
|
55
|
+
"@capyclaw/suite-kit": "^0.2.1",
|
|
56
|
+
"@capyclaw/tool-host": "^0.3.2",
|
|
57
|
+
"@capyclaw/work-store": "^0.3.2",
|
|
56
58
|
"playwright-core": "^1.60.0",
|
|
57
59
|
"pptxgenjs": "^3.12.0"
|
|
58
60
|
},
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* foundation ABI raw@1 wrapper:准入闸扩面后宿主必须走 ABI(见 bridge-build 注释)。
|
|
3
|
+
* raw@1 逃生舱承载多面共生命周期(webServer 路由 + toolHost 工具 + 描述符/表面/portal,
|
|
4
|
+
* 共享 workId/relay);额外 inject 仅 raw@1 可声明。core/os.skills 是套件运行时前提。
|
|
5
|
+
*/
|
|
6
|
+
import { createPlugin, rawPlugin } from '@capyclaw/foundation/abi'
|
|
7
|
+
import { name as hostName, apply as applyHost } from './server/embedded-host.mjs'
|
|
8
|
+
|
|
9
|
+
export const { name, inject, apply } = createPlugin({
|
|
10
|
+
name: hostName,
|
|
11
|
+
inject: ['webServer'],
|
|
12
|
+
implements: [rawPlugin(({ ctx, config }) => applyHost(ctx, config))],
|
|
13
|
+
}, import.meta.url)
|
|
@@ -10,7 +10,7 @@ import { createCapabilityReport } from './shared/tool-host.mjs'
|
|
|
10
10
|
export const CONTRACT_VERSION = '2.5.0'
|
|
11
11
|
|
|
12
12
|
/** 工作台包版本。 */
|
|
13
|
-
export const PACKAGE_VERSION = '2.5.
|
|
13
|
+
export const PACKAGE_VERSION = '2.5.71'
|
|
14
14
|
|
|
15
15
|
/** 生成模型可读的能力报告(`editorPath` 由 tool-host 从 editorUrl 推出:同源相对路径,不带端口)。 */
|
|
16
16
|
export function capabilityReport(args, editorUrl = '', runtime = {}) {
|
|
@@ -21,6 +21,77 @@ export const name = 'ppt-workbench-host'
|
|
|
21
21
|
* 时不加载本插件(standalone 只在脚本里直接调 relay,不经过 cordis)。 */
|
|
22
22
|
export const inject = ['webServer']
|
|
23
23
|
|
|
24
|
+
/* P1-8 描述符语义(互联标准 §B.6 词表,校验器 @capyclaw/suite-kit/capability):
|
|
25
|
+
* 每个工具的真实 produces/consumes。未列出的工具用领域默认(操作本套件作品、返回
|
|
26
|
+
* 状态回执)。envelope 标记导出/截图类工具,P1-6 宿主边界据此把产物登记进信封。
|
|
27
|
+
* 只用词表合法类型(artifact:file/*、artifact:image/*、artifact:deck/canvas、
|
|
28
|
+
* result:status/url、meta:capabilities 等),通配仅结尾 /*。 */
|
|
29
|
+
const DOMAIN_ARTIFACT = 'artifact:deck'
|
|
30
|
+
const TOOL_SEMANTICS = {
|
|
31
|
+
/* 产物导出 / 截图(带信封标记) */
|
|
32
|
+
ppt_export_pptx: { produces: ['artifact:file/pptx'], consumes: ['artifact:deck'], envelope: 'pptx-path' },
|
|
33
|
+
canvas_export: { produces: ['artifact:file/html'], consumes: ['artifact:canvas'], envelope: 'html-path' },
|
|
34
|
+
ppt_screenshot: { produces: ['artifact:image/png', 'artifact:image/jpeg'], consumes: ['artifact:deck'], envelope: 'image' },
|
|
35
|
+
canvas_screenshot: { produces: ['artifact:image/png'], consumes: ['artifact:canvas'], envelope: 'image' },
|
|
36
|
+
/* 素材输入 / 文件导入 / 素材搜索 */
|
|
37
|
+
ppt_image: { produces: ['result:status'], consumes: ['artifact:image/*'] },
|
|
38
|
+
canvas_insert_image: { produces: ['result:status'], consumes: ['artifact:image/*'] },
|
|
39
|
+
ppt_import_pptx: { produces: ['artifact:deck'], consumes: ['artifact:file/pptx'] },
|
|
40
|
+
ppt_images: { produces: ['result:url'], consumes: [] },
|
|
41
|
+
/* 读取 / 检查 / 元信息 */
|
|
42
|
+
ppt_capabilities: { produces: ['meta:capabilities'], consumes: [] },
|
|
43
|
+
canvas_capabilities: { produces: ['meta:capabilities'], consumes: [] },
|
|
44
|
+
ppt_get_deck: { produces: ['artifact:deck'], consumes: ['artifact:deck'] },
|
|
45
|
+
ppt_outline: { produces: ['artifact:deck'], consumes: ['artifact:deck'] },
|
|
46
|
+
canvas_read: { produces: ['artifact:canvas'], consumes: ['artifact:canvas'] },
|
|
47
|
+
ppt_check: { produces: ['result:status'], consumes: ['artifact:deck'] },
|
|
48
|
+
ppt_audit: { produces: ['result:status'], consumes: ['artifact:deck'] },
|
|
49
|
+
ppt_inspect: { produces: ['result:status'], consumes: ['artifact:deck'] },
|
|
50
|
+
canvas_audit: { produces: ['result:status'], consumes: ['artifact:canvas'] },
|
|
51
|
+
canvas_search: { produces: ['result:status'], consumes: ['artifact:canvas'] },
|
|
52
|
+
/* 成稿 / 写入(从文本源生成作品) */
|
|
53
|
+
ppt_write: { produces: ['artifact:deck'], consumes: ['artifact:text/markdown'] },
|
|
54
|
+
ppt_deck: { produces: ['artifact:deck'], consumes: ['artifact:text/markdown'] },
|
|
55
|
+
canvas_write_document: { produces: ['artifact:canvas'], consumes: ['artifact:text/markdown'] },
|
|
56
|
+
canvas_append_blocks: { produces: ['artifact:canvas'], consumes: ['artifact:canvas'] },
|
|
57
|
+
/* 会话级工具(不消费作品) */
|
|
58
|
+
ppt_task: { produces: ['result:status'], consumes: [] },
|
|
59
|
+
canvas_task: { produces: ['result:status'], consumes: [] },
|
|
60
|
+
canvas_checkpoint: { produces: ['result:status'], consumes: [] },
|
|
61
|
+
canvas_commands: { produces: ['meta:capabilities'], consumes: [] },
|
|
62
|
+
ppt_history: { produces: ['result:status'], consumes: ['artifact:deck'] },
|
|
63
|
+
canvas_history: { produces: ['result:status'], consumes: ['artifact:canvas'] },
|
|
64
|
+
}
|
|
65
|
+
const DEFAULT_SEMANTICS = { produces: ['result:status'], consumes: [DOMAIN_ARTIFACT] }
|
|
66
|
+
function semanticsFor(name) { return TOOL_SEMANTICS[name] || DEFAULT_SEMANTICS }
|
|
67
|
+
|
|
68
|
+
/* P1-6 产物提取器:从工具原始返回里取出可登记进信封的产物(文件路径 / 图像字节)。
|
|
69
|
+
* 只读结果、不改返回;登记失败不影响工具本身。type 用信封短词表(pptx/html/image)。 */
|
|
70
|
+
const ENVELOPE_EXTRACTORS = {
|
|
71
|
+
'pptx-path': (result) => {
|
|
72
|
+
try {
|
|
73
|
+
const parsed = JSON.parse(result && typeof result.text === 'string' ? result.text : '')
|
|
74
|
+
if (parsed && parsed.ok && parsed.path) return [{ filePath: parsed.path, type: 'pptx', title: parsed.title }]
|
|
75
|
+
} catch { /* 非 JSON 返回不登记 */ }
|
|
76
|
+
return []
|
|
77
|
+
},
|
|
78
|
+
'html-path': (result) => {
|
|
79
|
+
const text = result && typeof result.text === 'string' ? result.text : ''
|
|
80
|
+
const match = text.match(/已导出 HTML:(.+)/)
|
|
81
|
+
return match && match[1] ? [{ filePath: match[1].trim(), type: 'html' }] : []
|
|
82
|
+
},
|
|
83
|
+
'image': (result) => {
|
|
84
|
+
const items = []
|
|
85
|
+
const content = result && Array.isArray(result.content) ? result.content : []
|
|
86
|
+
for (const part of content) {
|
|
87
|
+
if (part && part.type === 'image' && typeof part.data === 'string') {
|
|
88
|
+
items.push({ bytes: Buffer.from(part.data, 'base64'), mime: part.mimeType || 'image/png', type: 'image' })
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return items
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
|
|
24
95
|
function safeGet(ctx, serviceName) {
|
|
25
96
|
// 原生插件里 ctx.get(name) 只对已 inject 的服务放行;可选依赖用 reflect.get
|
|
26
97
|
// 才不会因为「没在 inject 列表里」被拒绝(core 也是这么取依赖的)。
|
|
@@ -69,7 +140,23 @@ export async function apply(ctx, config) {
|
|
|
69
140
|
? workspaceService.getWork(workId)
|
|
70
141
|
: (runtime ? createRuntimeStoreClient(runtime, { workId }) : null)
|
|
71
142
|
const journalPath = runtime ? path.join(runtime.paths.logs, 'ppt-journal.jsonl') : null
|
|
72
|
-
|
|
143
|
+
/* M5 checkpoint 列表投影(形状声明):内核 WorkspaceBackend 只产出通用信封
|
|
144
|
+
* (name/seq/appliedSeq/pending/title/createdAt/meta),业务字段(PPT 的 slides、
|
|
145
|
+
* canvas 的页数)由套件适配层的 project(payload, base) 叠加。形状模块在 server/store/
|
|
146
|
+
* (src/server/store/ 逐字拷入),命名导出经 cfg.checkpointProject 注入;dw session
|
|
147
|
+
* 无参调 backend.listCheckpoints(),投影必须来自构造期 project。通用桥(browser/wall)
|
|
148
|
+
* 不声明 → project=null 纯信封,不含任何业务名词。 */
|
|
149
|
+
const checkpointProject = (await import('./store/shape.mjs')).projectPptCheckpoint
|
|
150
|
+
/* 投影适配(宿主边界):套件 projector(store/shape.mjs)按 document-workbench
|
|
151
|
+
* projectCheckpoint 约定只返回「扩展字段」(sessionCheckpointFields + 业务字段 slides),
|
|
152
|
+
* 不含 name/createdAt/meta;而 plugin-kit WorkspaceBackend.listCheckpoints 直接采用
|
|
153
|
+
* project(payload, base) 的返回值(不像 FileStateBackend 那样 {...base, ...extra} 合并)。
|
|
154
|
+
* 这里把通用信封 base 与扩展字段合并后再交给 backend,保证 name/createdAt/meta 不丢、
|
|
155
|
+
* 业务字段叠加;若内核日后改为合并语义,此适配幂等兼容。通用桥无 projector → null 纯信封。 */
|
|
156
|
+
const backend = storeClient ? new WorkspaceBackend({
|
|
157
|
+
client: storeClient, workId, journalPath,
|
|
158
|
+
project: checkpointProject ? (payload, base) => ({ ...base, ...checkpointProject(payload, base) }) : null,
|
|
159
|
+
}) : null
|
|
73
160
|
const hostDir = (config && config.hostDir)
|
|
74
161
|
|| runtime?.paths?.contentState
|
|
75
162
|
|| process.env.PPT_BRIDGE_HOME
|
|
@@ -129,6 +216,42 @@ export async function apply(ctx, config) {
|
|
|
129
216
|
const registry = relay.tools
|
|
130
217
|
const tools = safeGet(ctx, 'tools')
|
|
131
218
|
const toolState = { registered: [], errors: [], hasTools: !!(tools && typeof tools.register === 'function') }
|
|
219
|
+
/* P1-6 产物信封接入(互联标准 §B.4):导出/截图类工具的产物在宿主边界登记进
|
|
220
|
+
* work-store artifacts 信封(producer 记能力名)。ctx.workStore 可用且有 putAsset 时
|
|
221
|
+
* 走 registerFileArtifact/registerBytesArtifact;缺席时优雅回落(工具原样返回、不登记)。
|
|
222
|
+
* src 引擎/store 不改,只在宿主边界 wrap 工具实现——native 与 MCP 两面共享同一 TOOL_IMPL,
|
|
223
|
+
* 故两条调用路径都会登记。登记失败只警告,绝不影响工具结果。 */
|
|
224
|
+
const workStore = safeGet(ctx, 'workStore')
|
|
225
|
+
const putAsset = (assetStore && typeof assetStore.put === 'function')
|
|
226
|
+
? (bytes, mime) => assetStore.put(bytes, mime)
|
|
227
|
+
: (assetService && typeof assetService.put === 'function')
|
|
228
|
+
? (bytes, mime) => assetService.put(bytes, mime)
|
|
229
|
+
: null
|
|
230
|
+
if (registry && Array.isArray(registry.TOOLS) && registry.TOOL_IMPL && workStore && typeof workStore.registerArtifact === 'function' && putAsset) {
|
|
231
|
+
const { registerFileArtifact, registerBytesArtifact } = await import('@capyclaw/work-store/interop')
|
|
232
|
+
for (const tool of registry.TOOLS) {
|
|
233
|
+
const sem = semanticsFor(tool.name)
|
|
234
|
+
const extractor = sem.envelope ? ENVELOPE_EXTRACTORS[sem.envelope] : null
|
|
235
|
+
const impl = registry.TOOL_IMPL[tool.name]
|
|
236
|
+
if (!extractor || typeof impl !== 'function') continue
|
|
237
|
+
registry.TOOL_IMPL[tool.name] = async (args, exec) => {
|
|
238
|
+
const result = await impl(args, exec)
|
|
239
|
+
try {
|
|
240
|
+
const sessionId = exec && exec.agent && exec.agent.session ? exec.agent.session.id : null
|
|
241
|
+
for (const item of extractor(result)) {
|
|
242
|
+
const input = { type: item.type, producer: tool.name, producerSuite: 'ppt', workId }
|
|
243
|
+
if (item.title) input.title = item.title
|
|
244
|
+
if (sessionId) input.sessionId = sessionId
|
|
245
|
+
if (item.filePath) await registerFileArtifact(workStore, putAsset, item.filePath, input)
|
|
246
|
+
else if (item.bytes) await registerBytesArtifact(workStore, putAsset, item.bytes, { ...input, mime: item.mime })
|
|
247
|
+
}
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.warn('[ppt-workbench] 产物信封登记失败 ' + tool.name + ': ' + (error && error.message ? error.message : String(error)))
|
|
250
|
+
}
|
|
251
|
+
return result
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
132
255
|
const OUTPUT_SCHEMA = { type: 'object', additionalProperties: true }
|
|
133
256
|
|
|
134
257
|
function toolText(value) {
|
|
@@ -145,28 +268,62 @@ export async function apply(ctx, config) {
|
|
|
145
268
|
}
|
|
146
269
|
|
|
147
270
|
if (registry && Array.isArray(registry.TOOLS) && toolState.hasTools) {
|
|
148
|
-
|
|
271
|
+
if (toolHost && typeof toolHost.registerWithDsh === 'function') {
|
|
272
|
+
/* P1-7 规范路径:经 tool-host 的 registerWithDsh 注册(服务级自动注入 modeGate,
|
|
273
|
+
* 套件零接线)。它统一接线 caller-session ALS、图像准入(裸 base64 先持久化成
|
|
274
|
+
* attachment ref)、isError 归一(失败 throw)、会话模式锁 when 可见性 + guard 硬拒
|
|
275
|
+
* 与感知闸,并保留 execute(args,exec)/output{schema,render} 语义;全有或全无,
|
|
276
|
+
* 任一工具失败逆序释放。传平对象 { tools, systemPrompt } 避免 cordis 未 inject
|
|
277
|
+
* 禁访问 ctx.tools/systemPrompt。domain=cfg.ns 一处覆盖所有 bridge 套件。 */
|
|
149
278
|
try {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
description: tool.description,
|
|
153
|
-
parameters: tool.inputSchema,
|
|
154
|
-
output: {
|
|
155
|
-
schema: OUTPUT_SCHEMA,
|
|
156
|
-
render: (_args, value) => [{ type: 'text', text: toolText(value) }],
|
|
157
|
-
},
|
|
158
|
-
/* 第二个参数是 DSH 的 exec(含 exec.agent.session.id)。工具实现靠它知道
|
|
159
|
-
* 「是哪个会话在调用」,多会话工作台才能把读写落到调用者自己那份文档上;
|
|
160
|
-
* 早期版本只接 args,工具只能猜用户正在看哪个窗口。 */
|
|
161
|
-
execute: async (args, exec) => registry.TOOL_IMPL[tool.name](args || {}, exec),
|
|
162
|
-
})
|
|
279
|
+
const systemPrompt = safeGet(ctx, 'systemPrompt')
|
|
280
|
+
const dispose = toolHost.registerWithDsh({ tools, systemPrompt }, registry, { domain: 'ppt' })
|
|
163
281
|
if (typeof dispose === 'function') disposers.push(dispose)
|
|
164
|
-
toolState.registered.
|
|
282
|
+
toolState.registered = registry.TOOLS.map((t) => t.name)
|
|
165
283
|
} catch (error) {
|
|
166
|
-
toolState.errors.push(
|
|
284
|
+
toolState.errors.push(error && error.message ? error.message : String(error))
|
|
285
|
+
console.warn('[ppt-workbench] 工具注册失败(registerWithDsh 全有或全无): ' + toolState.errors.join(' | '))
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
/* 降级路径(老宿主无 registerWithDsh):会话模式锁 + 逐个 tools.register。
|
|
289
|
+
* DSH 的 ToolDefinition 是 name/description/parameters(JSON Schema)/output{schema,render}/
|
|
290
|
+
* execute;缺 output 时 register 直接抛 TypeError。逐个 try 保证一个工具的 schema
|
|
291
|
+
* 不被支持时,其余工具照常注册。modeGate 缺席(老宿主)时优雅降级为不屏蔽。 */
|
|
292
|
+
const modeGate = toolHost && toolHost.modeGate
|
|
293
|
+
if (modeGate) {
|
|
294
|
+
modeGate.declareTools('ppt', registry.TOOLS.map((t) => t.name), 'ppt')
|
|
295
|
+
modeGate.install(tools)
|
|
296
|
+
if (typeof modeGate.installPrompt === 'function') {
|
|
297
|
+
const systemPrompt = safeGet(ctx, 'systemPrompt')
|
|
298
|
+
if (systemPrompt && typeof systemPrompt.section === 'function') {
|
|
299
|
+
const promptDispose = modeGate.installPrompt(systemPrompt)
|
|
300
|
+
if (typeof promptDispose === 'function') disposers.push(promptDispose)
|
|
301
|
+
}
|
|
302
|
+
}
|
|
167
303
|
}
|
|
304
|
+
for (const tool of registry.TOOLS) {
|
|
305
|
+
try {
|
|
306
|
+
const when = modeGate && modeGate.whenFor(tool.name)
|
|
307
|
+
const dispose = tools.register({
|
|
308
|
+
name: tool.name,
|
|
309
|
+
description: tool.description,
|
|
310
|
+
parameters: tool.inputSchema,
|
|
311
|
+
output: {
|
|
312
|
+
schema: OUTPUT_SCHEMA,
|
|
313
|
+
render: (_args, value) => [{ type: 'text', text: toolText(value) }],
|
|
314
|
+
},
|
|
315
|
+
/* 第二个参数是 DSH 的 exec(含 exec.agent.session.id)。工具实现靠它知道
|
|
316
|
+
* 「是哪个会话在调用」,多会话工作台才能把读写落到调用者自己那份文档上。 */
|
|
317
|
+
execute: async (args, exec) => registry.TOOL_IMPL[tool.name](args || {}, exec),
|
|
318
|
+
}, when ? { when } : {})
|
|
319
|
+
if (typeof dispose === 'function') disposers.push(dispose)
|
|
320
|
+
toolState.registered.push(tool.name)
|
|
321
|
+
} catch (error) {
|
|
322
|
+
toolState.errors.push(tool.name + ': ' + (error && error.message ? error.message : String(error)))
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
if (toolState.errors.length) console.warn('[ppt-workbench] 工具注册失败 ' + toolState.errors.length + ' 个: ' + toolState.errors.join(' | '))
|
|
168
326
|
}
|
|
169
|
-
if (toolState.errors.length) console.warn('[ppt-workbench] 工具注册失败 ' + toolState.errors.length + ' 个: ' + toolState.errors.join(' | '))
|
|
170
327
|
} else if (registry) {
|
|
171
328
|
console.log('[ppt-workbench] 提示:宿主没有 tools 服务,工具面未注册(只提供编辑器页面)')
|
|
172
329
|
}
|
|
@@ -187,8 +344,10 @@ export async function apply(ctx, config) {
|
|
|
187
344
|
tool: tool.name,
|
|
188
345
|
controlMode: 'interface',
|
|
189
346
|
kind: tool.kind || 'write',
|
|
190
|
-
produces
|
|
191
|
-
|
|
347
|
+
/* P1-8 描述符语义(互联标准 §B.6 词表):按工具名取真实 produces/consumes
|
|
348
|
+
* (TOOL_SEMANTICS,capability.mjs 校验合法),不再留空数组。 */
|
|
349
|
+
produces: semanticsFor(tool.name).produces,
|
|
350
|
+
consumes: semanticsFor(tool.name).consumes,
|
|
192
351
|
surface,
|
|
193
352
|
}, { baseUrl: relay.url })
|
|
194
353
|
descriptorState.registered += 1
|
|
@@ -222,6 +381,28 @@ export async function apply(ctx, config) {
|
|
|
222
381
|
if (typeof dispose === 'function') disposers.push(dispose)
|
|
223
382
|
}
|
|
224
383
|
|
|
384
|
+
/* P1-5 表面握手落地:描述符声明了 embeddable:true + embedPath,宿主就必须真实
|
|
385
|
+
* 提供 GET <前缀>/embed.js(嵌入握手客户端)与 GET <前缀>/api/surface(呈现面自描述,
|
|
386
|
+
* EMBED_PROTOCOL_VERSION=1)。复用 suite-kit attachSurface 单一真源,不复制握手代码。
|
|
387
|
+
* 桥宿主不持有 relay 内部 app,用 webServer.register 造 .get shim 交给它——handler
|
|
388
|
+
* 同为 (req,res) 直写响应,完全兼容;embed.js 客户端读 suite-kit 包内真源。
|
|
389
|
+
* 仅 embedded 形态(有 webServer)可挂;standalone 的 app 由框架内部持有未暴露,
|
|
390
|
+
* 宿主边界接不到(剩余项,见交付说明)。exact 子路径与 relay prefix 共存。 */
|
|
391
|
+
if (webServer && typeof webServer.register === 'function') {
|
|
392
|
+
try {
|
|
393
|
+
const { attachSurface } = await import('@capyclaw/suite-kit/surface')
|
|
394
|
+
const surfaceApp = {
|
|
395
|
+
get: (routePath, handler) => {
|
|
396
|
+
const dispose = webServer.register({ kind: 'exact', path: mountPath + routePath, handler })
|
|
397
|
+
if (typeof dispose === 'function') disposers.push(dispose)
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
attachSurface(surfaceApp, { suite: 'ppt', embedPath: mountPath })
|
|
401
|
+
} catch (error) {
|
|
402
|
+
console.warn('[ppt-workbench] 表面握手挂载失败: ' + (error && error.message ? error.message : String(error)))
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
225
406
|
/* 活动台账:embedded 形态没有端口,记 url 即可。台账只供主区舞台
|
|
226
407
|
* (@capyclaw/portal-hud)补标题/最近使用时间,开不开窗由舞台的内容闸决定。
|
|
227
408
|
* editorAvailable === false 是拆包工作台的 headless 形态(编辑器在可选成员包里,
|
|
@@ -39,6 +39,7 @@ import { inspectContractSnapshots, describeMismatch } from './contract-snapshots
|
|
|
39
39
|
import { getTuning } from './tuning.mjs'
|
|
40
40
|
import { createRuntimeStoreClient, loadRuntimeContext } from './infra/runtime/context.mjs'
|
|
41
41
|
import { WorkspaceBackend } from './infra/workspace/manager.mjs'
|
|
42
|
+
import { projectPptCheckpoint } from './store/shape.mjs'
|
|
42
43
|
import { createWorkbench, runIfMain } from './workbench-framework.mjs'
|
|
43
44
|
|
|
44
45
|
export { BASE_PATH }
|
|
@@ -59,15 +60,14 @@ function reconcileShadow(ctx) {
|
|
|
59
60
|
const keys = new Set([DEFAULT_SESSION, sessionStores.activeSession(), ...sessionStores.sessions()])
|
|
60
61
|
for (const sid of keys) {
|
|
61
62
|
if (!sid) continue
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
/* 只读投影:不复活被空闲驱逐的实例。旧实现 forSession(sid).get() 每 5s 把每个会话
|
|
64
|
+
* 重建一遍并刷新 idle 钟,驱逐永远不生效、内存无界;reconcileInfo 从活实例或元数据
|
|
65
|
+
* 快照取旗标,被驱逐会话仍对账得到(不静默消失)。 */
|
|
66
|
+
const info = sessionStores.reconcileInfo(sid)
|
|
67
|
+
if (!info) continue
|
|
64
68
|
const url = sid === DEFAULT_SESSION ? ctx.editorUrl : `${ctx.editorUrl}s/${sid}/`
|
|
65
69
|
/* fire-and-forget:manager 内部守并发与异常,不阻塞对账循环。 */
|
|
66
|
-
shadowManager.reconcile(sid, url,
|
|
67
|
-
hasContent: slides > 0,
|
|
68
|
-
ownerLive: isOwnerLive(doc),
|
|
69
|
-
ownerShadow: isShadowOwner(doc),
|
|
70
|
-
})
|
|
70
|
+
shadowManager.reconcile(sid, url, info)
|
|
71
71
|
}
|
|
72
72
|
} catch (error) {
|
|
73
73
|
console.log('[shadow] 对账循环异常:', error.message)
|
|
@@ -244,6 +244,8 @@ export const startRelay = createWorkbench({
|
|
|
244
244
|
/* 停机回收:清对账定时器、关停所有影子 browser(不留孤儿进程)。 */
|
|
245
245
|
beforeStop: async (ctx) => {
|
|
246
246
|
if (ctx.shadowTimer) { clearInterval(ctx.shadowTimer); ctx.shadowTimer = null }
|
|
247
|
+
/* 卸载会话缓存的空闲驱逐定时器(数据已落盘)。 */
|
|
248
|
+
try { storesOf(ctx)?.dispose?.() } catch { /* ignore */ }
|
|
247
249
|
if (ctx.shadowManager) {
|
|
248
250
|
try { await ctx.shadowManager.dispose() } catch { /* ignore */ }
|
|
249
251
|
ctx.shadowManager = null
|
|
@@ -266,6 +268,7 @@ runIfMain(import.meta.url, async ({ port, dir }) => {
|
|
|
266
268
|
client,
|
|
267
269
|
workId,
|
|
268
270
|
journalPath: runtime.paths?.logs ? path.join(runtime.paths.logs, 'ppt-journal.jsonl') : null,
|
|
271
|
+
project: projectPptCheckpoint,
|
|
269
272
|
})
|
|
270
273
|
: null
|
|
271
274
|
const relay = await startRelay({
|