@songtonyli/dsh-cli 0.1.40 → 0.1.41
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 +1 -1
- package/bin/dsh.mjs +1 -1
- package/node_modules/@deepseek-ai/cordis/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-group/package.json +3 -3
- package/node_modules/@deepseek-ai/cordis-plugin-include/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-loader/package.json +4 -4
- package/node_modules/@deepseek-ai/cordis-plugin-timer/package.json +3 -3
- package/node_modules/@deepseek-ai/cosmokit/package.json +1 -1
- package/node_modules/@deepseek-ai/dsh/README.i18n.yaml +21 -5
- package/node_modules/@deepseek-ai/dsh/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh/lib/bin.js +5 -11
- package/node_modules/@deepseek-ai/dsh/lib/{dump-config-C-0P1h0W.js → dump-config-BEDI-dNY.js} +2 -2
- package/node_modules/@deepseek-ai/dsh/lib/dump-config-crgOY3tW.js +2 -0
- package/node_modules/@deepseek-ai/dsh/lib/{dump-config-schema-BgEU7VYz.js → dump-config-schema-DhhNOaro.js} +3 -3
- package/node_modules/@deepseek-ai/dsh/lib/plugin-DkYIj96-.js +83 -0
- package/node_modules/@deepseek-ai/dsh/lib/{profile-boot-DIiro1p-.js → profile-boot-BZ2ZjNWi.js} +4 -3
- package/node_modules/@deepseek-ai/dsh/lib/profile-boot.js +1 -1
- package/node_modules/@deepseek-ai/dsh/package.json +116 -113
- package/node_modules/@deepseek-ai/dsh-acp/README.i18n.yaml +81 -5
- package/node_modules/@deepseek-ai/dsh-acp/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-acp-app/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-acp-app/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-agent/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-agent/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-agent-default-model/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-agent-default-model/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-default-model/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-default-model/lib/index.js +10 -3
- package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-agent-instructions/README.i18n.yaml +99 -5
- package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +26 -25
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.i18n.yaml +99 -5
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-agent-loop/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +35 -9
- package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +27 -26
- package/node_modules/@deepseek-ai/dsh-agent-preset/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-agent-preset/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +9 -6
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/SKILL.md +10 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/practices.md +38 -0
- package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/ui-plugin.md +1 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/index.js +52 -21
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/invariant.js +52 -21
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +114 -45
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.remote-client.js +37 -3
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/index.js +26 -11
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/mount.js +5 -1
- package/node_modules/@deepseek-ai/dsh-agent-preset-registry/package.json +39 -36
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-api-account-controller/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-api-account-controller/README.md +7 -1
- package/node_modules/@deepseek-ai/dsh-api-account-controller/README.zh.md +7 -1
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/index.js +123 -10
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/typert.host.js +200 -11
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/typert.remote-client.js +200 -11
- package/node_modules/@deepseek-ai/dsh-api-account-controller/lib/types/index.js +79 -6
- package/node_modules/@deepseek-ai/dsh-api-account-controller/package.json +9 -7
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.js +6 -2
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/index.js +50 -26
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/stream-client.js +9 -2
- package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/index.js +61 -29
- package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +14 -13
- package/node_modules/@deepseek-ai/dsh-api-job-controller/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-api-job-controller/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +1268 -217
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/index.js +12 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/client/index.js +5 -2
- package/node_modules/@deepseek-ai/dsh-api-remotes/lib/types/remote-events.js +3 -0
- package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +43 -40
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.md +9 -5
- package/node_modules/@deepseek-ai/dsh-api-session-controller/README.zh.md +9 -5
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +101 -32
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/index.js +159 -79
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +179 -99
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.remote-client.js +40 -15
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/catalog.js +52 -3
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/assistant-stream.js +16 -1
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/projection-store.js +9 -0
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/sessions/session.js +81 -40
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/client/transport.js +5 -2
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/commands.js +11 -14
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/history.js +24 -9
- package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/types/index.js +24 -4
- package/node_modules/@deepseek-ai/dsh-api-session-controller/package.json +75 -68
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-api-settings-controller/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +63 -39
- package/node_modules/@deepseek-ai/dsh-api-terminal-controller/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/client.js +4 -5
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/index.js +25 -12
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.host.js +13 -32
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/typert.remote-client.js +11 -26
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/model.js +2 -3
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/client/service.js +2 -2
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/default-directory.js +3 -3
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/default-workspace.js +29 -0
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/lib/types/index.js +7 -11
- package/node_modules/@deepseek-ai/dsh-api-workspace-controller/package.json +25 -21
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/lib/index.js +7 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/lib/typert.host.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/lib/typert.remote-client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/lib/types/index.js +10 -1
- package/node_modules/@deepseek-ai/dsh-api-workspace-files/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-app-boot/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-app-boot/README.md +11 -3
- package/node_modules/@deepseek-ai/dsh-app-boot/README.zh.md +11 -3
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +460 -60
- package/node_modules/@deepseek-ai/dsh-app-boot/lib/worker/profile-resolution-bootstrap.js +16 -6
- package/node_modules/@deepseek-ai/dsh-app-boot/package.json +22 -19
- package/node_modules/@deepseek-ai/dsh-atomic-write/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-atomic-write/README.md +6 -5
- package/node_modules/@deepseek-ai/dsh-atomic-write/README.zh.md +6 -5
- package/node_modules/@deepseek-ai/dsh-atomic-write/lib/index.js +73 -8
- package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-attachment/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-attachment/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-attachment-local/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-authorization/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-authorization/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-base/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +5 -2
- package/node_modules/@deepseek-ai/dsh-base/package.json +96 -95
- package/node_modules/@deepseek-ai/dsh-bash-local/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-bash-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/README.i18n.yaml +96 -5
- package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-brand/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-brand/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-chunked-list/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-chunked-list/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-connection/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-connection/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-file-upload/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +63 -39
- package/node_modules/@deepseek-ai/dsh-client-file-upload/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-hmr/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-locale/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +9 -1
- package/node_modules/@deepseek-ai/dsh-client-locale/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-client-modules/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +103 -17
- package/node_modules/@deepseek-ai/dsh-client-modules/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-resources/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-client-resources/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/README.md +94 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/README.zh.md +94 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/lib/client.js +2006 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/lib/index.js +23 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/lib/protocol.js +524 -0
- package/node_modules/@deepseek-ai/dsh-client-shortcuts/package.json +63 -0
- package/node_modules/@deepseek-ai/dsh-client-store/README.i18n.yaml +27 -5
- package/node_modules/@deepseek-ai/dsh-client-store/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +192 -135
- package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.i18n.yaml +27 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/lib/client.js +77 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-approval/package.json +16 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +19 -93
- package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-brand-official/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +34 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +34 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +885 -287
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/index.js +15 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +12 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +12 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +415 -80
- package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +35 -34
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +73 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +10 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +10 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +242 -211
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +29 -29
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +8 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +63 -36
- package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +14 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.md +14 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/README.zh.md +14 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +97 -80
- package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +172 -56
- package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +22 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +8 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +16 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +17 -7
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +336 -98
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/index.js +140 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/typert.host.js +53 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/typert.remote-client.js +28 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/package.json +36 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.md +32 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/README.zh.md +32 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Button.module.css +6 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Checkbox.module.css +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/CodeCard.module.css +83 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ConnectionIndicator.module.css +6 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/DiffBlock.module.css +24 -53
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/HoverCard.module.css +17 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ImageLightbox.module.css +46 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ImagePreview.module.css +24 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Input.module.css +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/JsonTree.module.css +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Menu.module.css +22 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/MenuSurface.module.css +49 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Modal.module.css +27 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Pill.module.css +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ReadBlock.module.css +13 -81
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/RiskConfirmation.module.css +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SearchBlock.module.css +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SegmentedControl.module.css +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/SegmentedTabs.module.css +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/ShortcutKeys.module.css +33 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Switch.module.css +3 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/TerminalBlock.module.css +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Toast.module.css +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/Tooltip.module.css +9 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/WebBlock.module.css +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js +1735 -897
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/CodeBlock.module.css +16 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/JsonBlock.module.css +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/markdown/MarkdownText.module.css +28 -23
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/settings-form/SettingsForm.module.css +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/settings-form/fields.module.css +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Button.d.ts +6 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/CodeToolbar.d.ts +30 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/DiffBlock.d.ts +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/HoverCard.d.ts +5 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ImageLightbox.d.ts +27 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ImagePreview.d.ts +12 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Menu.d.ts +12 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/MenuSurface.d.ts +16 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Modal.d.ts +12 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ReadBlock.d.ts +2 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/ShortcutKeys.d.ts +11 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/Tooltip.d.ts +17 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/code-highlighting.d.ts +1 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/focus.d.ts +9 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/guide-artwork.d.ts +15 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/index.d.ts +8 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/icons/shared-artwork.d.ts +8 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/index.d.ts +10 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/input-modality.d.ts +19 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/keyboard-composition.d.ts +11 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/CodeBlock.d.ts +6 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/MarkdownDelegate.d.ts +11 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/highlight.d.ts +16 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/local-image-syntax.d.ts +10 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/markdown/render.d.ts +3 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/plugin-artwork.d.ts +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/settings-form/fields.d.ts +1 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/useModalLayer.d.ts +27 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/types/user-text.d.ts +2 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/user-text.module.css +4 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +6 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-renderer/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +36 -39
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +42 -45
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +6735 -171
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +32 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-session/README.i18n.yaml +27 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-session/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.md +46 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/README.zh.md +46 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2300 -255
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/index.js +66 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-account/package.json +22 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-agent-loop/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.md +10 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/README.zh.md +10 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +202 -109
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +20 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +10 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +11 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +48 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-shell/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-signin/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/lib/client.js +12 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-subagent/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-settings-web-search/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/README.i18n.yaml +37 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/README.md +89 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/README.zh.md +89 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/lib/client.js +1163 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/lib/index.js +6 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-shortcuts/package.json +63 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +59 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +16 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/lib/client.js +77 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-browser/package.json +13 -12
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +14 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +14 -8
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.excel.js +41 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +102 -75
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.pdf.js +57 -28
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +76 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +19 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +12 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +12 -6
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +667 -85
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +20 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.js +151 -106
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/lib/client.terminal.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-terminal/package.json +19 -17
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +29 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +67 -48
- package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +20 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +20 -2
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +13 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +13 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +13 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +315 -90
- package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +25 -24
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +68 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +8 -3
- package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +12 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +12 -10
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +608 -329
- package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +27 -25
- package/node_modules/@deepseek-ai/dsh-cmdline/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-cmdline/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-command-compact/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-command-compact/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-command-feedback/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-command-goal/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-command-goal/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-commands/README.i18n.yaml +75 -5
- package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +63 -39
- package/node_modules/@deepseek-ai/dsh-commands/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-compaction/README.i18n.yaml +84 -5
- package/node_modules/@deepseek-ai/dsh-compaction/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.i18n.yaml +105 -5
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-compaction-basic/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-compaction-basic/lib/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-compaction-image-offload/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-config-editor/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-config-editor/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/README.md +4 -0
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/README.zh.md +4 -0
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +193 -43
- package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +126 -78
- package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-credentials/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-credentials/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-credentials-local/README.i18n.yaml +75 -5
- package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-account/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-deepseek-account/README.md +13 -3
- package/node_modules/@deepseek-ai/dsh-deepseek-account/README.zh.md +13 -3
- package/node_modules/@deepseek-ai/dsh-deepseek-account/lib/index.js +54 -1
- package/node_modules/@deepseek-ai/dsh-deepseek-account/lib/types/account-tasks.js +30 -0
- package/node_modules/@deepseek-ai/dsh-deepseek-account/lib/types/index.js +26 -0
- package/node_modules/@deepseek-ai/dsh-deepseek-account/package.json +14 -5
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.md +16 -8
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/README.zh.md +16 -8
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/index.js +262 -40
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/types/details.js +44 -3
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/types/index.js +190 -32
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/lib/types/protocol.js +45 -2
- package/node_modules/@deepseek-ai/dsh-deepseek-account-platform/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.i18n.yaml +30 -5
- package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-deque/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-deque/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.i18n.yaml +99 -5
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.md +7 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/README.zh.md +7 -3
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/index.js +359 -323
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/invariant.js +170 -25
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/index.js +180 -237
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/invariant.js +2 -2
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/projection.js +95 -28
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/task-board.js +7 -47
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/types/task-view.js +57 -0
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/package.json +25 -39
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team-profile/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/index.js +3 -2
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.host.js +27 -6
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/typert.remote-client.js +20 -3
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/lib/types/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-experimental-api-speech-to-text/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +64 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +129 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +129 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/cordis.patch.yml +3 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/icon.svg +10 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +508 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/en.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/locale/zh.json +6 -0
- package/node_modules/@deepseek-ai/dsh-experimental-auto-review/package.json +82 -0
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.md +14 -10
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/README.zh.md +14 -10
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/lib/client.js +317 -4345
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-agent-team/package.json +24 -28
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.md +4 -2
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/README.zh.md +4 -2
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/lib/client.js +184 -44
- package/node_modules/@deepseek-ai/dsh-experimental-client-ui-voice-input/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/lib/index.js +5 -4
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/lib/types/index.js +5 -4
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text/package.json +11 -9
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.md +5 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/README.zh.md +5 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/lib/index.js +164 -26
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/lib/worker.js +3 -1
- package/node_modules/@deepseek-ai/dsh-experimental-speech-to-text-sensevoice/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/lib/index.js +9 -1
- package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-experimental-voice-input-bundle/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-file-reference/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-file-reference/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-file-reference-local/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-file-reference-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-fs/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-fs/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-fs-local/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-fs-local/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-goal/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +63 -39
- package/node_modules/@deepseek-ai/dsh-goal/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +17 -17
- package/node_modules/@deepseek-ai/dsh-headless/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-headless/package.json +22 -22
- package/node_modules/@deepseek-ai/dsh-hmr/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-hmr/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-home-paths/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-home-paths/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-hook-protocol/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-hook-protocol/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/README.i18n.yaml +87 -5
- package/node_modules/@deepseek-ai/dsh-hooks-claude-code/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-hooks-codex/README.i18n.yaml +87 -5
- package/node_modules/@deepseek-ai/dsh-hooks-codex/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/lib/index.js +2 -2
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/lib/types/resolver.js +2 -2
- package/node_modules/@deepseek-ai/dsh-host-open-in-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-host-webserver/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-http-proxy/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-http-proxy/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-invariants/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-invariants/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-jobs/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-jobs/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-jobs-local/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-launch-environment/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-lazy-require/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-lazy-require/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-llm/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-llm/lib/index.js +107 -12
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +16 -20
- package/node_modules/@deepseek-ai/dsh-llm/lib/typert.remote-client.js +3 -3
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/content.js +107 -0
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/error.js +2 -0
- package/node_modules/@deepseek-ai/dsh-llm/lib/types/index.js +26 -9
- package/node_modules/@deepseek-ai/dsh-llm/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-llm-cursor/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-llm-cursor/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.md +18 -13
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/README.zh.md +18 -13
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +642 -595
- package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +44 -47
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.md +79 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/README.zh.md +79 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/lib/index.js +62 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-account/package.json +54 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.i18n.yaml +46 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.md +78 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/README.zh.md +78 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/lib/index.js +69 -0
- package/node_modules/@deepseek-ai/dsh-llm-deepseek-api-key/package.json +53 -0
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +93 -5
- package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +26 -25
- package/node_modules/@deepseek-ai/dsh-llm-retry/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-llm-retry/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-retry/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +26 -25
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.i18n.yaml +96 -5
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-mcp-resources/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-mcp-resources/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-message-feedback/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-native-command/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-native-command/README.md +5 -3
- package/node_modules/@deepseek-ai/dsh-native-command/README.zh.md +5 -3
- package/node_modules/@deepseek-ai/dsh-native-command/lib/index.js +108 -33
- package/node_modules/@deepseek-ai/dsh-native-command/lib/types/file-applications-windows.js +55 -10
- package/node_modules/@deepseek-ai/dsh-native-command/lib/types/path-opener.js +59 -22
- package/node_modules/@deepseek-ai/dsh-native-command/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/lib/index.js +111 -9
- package/node_modules/@deepseek-ai/dsh-no-progress-reminder/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-office-to-pdf/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-output-retention/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-output-retention/README.md +7 -3
- package/node_modules/@deepseek-ai/dsh-output-retention/README.zh.md +7 -3
- package/node_modules/@deepseek-ai/dsh-output-retention/lib/index.js +17 -1
- package/node_modules/@deepseek-ai/dsh-output-retention/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-package-manifest/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-package-manifest/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-permission-presets/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-permission-presets/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/index.js +9 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +65 -41
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.remote-client.js +1 -1
- package/node_modules/@deepseek-ai/dsh-permission-presets/lib/types/index.js +10 -3
- package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-persona/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-persona/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-plan-mode/README.i18n.yaml +108 -5
- package/node_modules/@deepseek-ai/dsh-plan-mode/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-plan-mode/lib/types/index.js +0 -1
- package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +19 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +19 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +760 -155
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +237 -26
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +215 -22
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/failure.js +19 -2
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/github-connection.js +61 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +113 -23
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/install-failure.js +1 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +403 -22
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/registry.js +2 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/run-tree.js +57 -0
- package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/tools.js +13 -3
- package/node_modules/@deepseek-ai/dsh-plugin-manager/package.json +33 -33
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-plugin-package-inventory-deepseek/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-pwsh-local/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/README.i18n.yaml +99 -5
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/lib/index.js +111 -9
- package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-sandbox/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-sandbox/lib/index.js +16 -2
- package/node_modules/@deepseek-ai/dsh-sandbox/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-sandbox-local/README.i18n.yaml +64 -6
- package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +12 -12
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/README.i18n.yaml +67 -6
- package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-schedule/README.i18n.yaml +75 -5
- package/node_modules/@deepseek-ai/dsh-schedule/README.md +65 -129
- package/node_modules/@deepseek-ai/dsh-schedule/README.zh.md +72 -137
- package/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +2147 -797
- package/node_modules/@deepseek-ai/dsh-schedule/lib/invariant.js +79 -17
- package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +727 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +477 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/delivery-history.js +66 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/domain.js +1000 -113
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +428 -101
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/invariant.js +8 -1
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/runtime.js +129 -268
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/storage.js +54 -0
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/tools.js +305 -204
- package/node_modules/@deepseek-ai/dsh-schedule/lib/types/update.js +164 -0
- package/node_modules/@deepseek-ai/dsh-schedule/package.json +50 -28
- package/node_modules/@deepseek-ai/dsh-scope/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-scope/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +39 -5
- package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +1 -0
- package/node_modules/@deepseek-ai/dsh-sdk-app/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/README.i18n.yaml +48 -5
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/cordis.patch.yml +1 -1
- package/node_modules/@deepseek-ai/dsh-sdk-minimal/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-session/README.i18n.yaml +102 -5
- package/node_modules/@deepseek-ai/dsh-session/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session/lib/index.js +89 -0
- package/node_modules/@deepseek-ai/dsh-session/lib/types/index.js +16 -0
- package/node_modules/@deepseek-ai/dsh-session/lib/types/tool-history.js +76 -0
- package/node_modules/@deepseek-ai/dsh-session/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-session-format/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-session-format/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-session-format-catalog/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-session-format-v0-to-v1/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/README.i18n.yaml +51 -5
- package/node_modules/@deepseek-ai/dsh-session-format-v1-to-v2/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-session-format-v2-to-v3/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-format-v3-to-v4/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.md +8 -4
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.zh.md +8 -4
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/index.js +53 -9
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/types/index.js +51 -9
- package/node_modules/@deepseek-ai/dsh-session-log-deepseek/package.json +20 -19
- package/node_modules/@deepseek-ai/dsh-session-log-export/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-session-log-export/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-session-log-export/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +3 -3
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/CHANGELOG.md +10 -0
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/LICENSE +1 -1
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/README.md +10 -10
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/esm/browser.js +82 -55
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/esm/index.mjs +87 -56
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/lib/browser.cjs +106 -77
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/lib/index.cjs +106 -77
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/lib/node-worker.cjs +5 -1
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/lib/node.cjs +111 -78
- package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/package.json +12 -11
- package/node_modules/@deepseek-ai/dsh-session-log-export/node_modules/fflate/umd/index.js +1 -0
- package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-session-persistence/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +189 -9
- package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-projection/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-session-projection/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-query/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-session-query/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-session-query/lib/index.js +7 -1
- package/node_modules/@deepseek-ai/dsh-session-query/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-reference/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +63 -39
- package/node_modules/@deepseek-ai/dsh-session-reference/package.json +39 -39
- package/node_modules/@deepseek-ai/dsh-session-stats/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-session-stats/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-session-telemetry/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-session-title/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-session-title/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +18 -17
- package/node_modules/@deepseek-ai/dsh-session-title-llm/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-session-turn-outline/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-settings/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-settings/package.json +19 -19
- package/node_modules/@deepseek-ai/dsh-shell/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-shell/package.json +7 -7
- package/node_modules/@deepseek-ai/dsh-shell-env/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-shell-env/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-skill/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-skill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-skill-badge/README.i18n.yaml +54 -5
- package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +5 -5
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-skill-office/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-skill-office/README.md +8 -2
- package/node_modules/@deepseek-ai/dsh-skill-office/README.zh.md +8 -2
- package/node_modules/@deepseek-ai/dsh-skill-office/assets/office-docx/SKILL.md +14 -3
- package/node_modules/@deepseek-ai/dsh-skill-office/assets/office-pptx/SKILL.md +14 -3
- package/node_modules/@deepseek-ai/dsh-skill-office/assets/office-xlsx/SKILL.md +22 -4
- package/node_modules/@deepseek-ai/dsh-skill-office/lib/index.js +21 -3
- package/node_modules/@deepseek-ai/dsh-skill-office/package.json +9 -8
- package/node_modules/@deepseek-ai/dsh-spill/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-spill/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-spill/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-spill/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-spill-local/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-spill-local/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-spill-policy/README.i18n.yaml +81 -5
- package/node_modules/@deepseek-ai/dsh-spill-policy/README.md +22 -22
- package/node_modules/@deepseek-ai/dsh-spill-policy/README.zh.md +22 -22
- package/node_modules/@deepseek-ai/dsh-spill-policy/lib/index.js +216 -142
- package/node_modules/@deepseek-ai/dsh-spill-policy/lib/types/index.js +110 -167
- package/node_modules/@deepseek-ai/dsh-spill-policy/lib/types/notice.js +10 -2
- package/node_modules/@deepseek-ai/dsh-spill-policy/lib/types/retention.js +88 -0
- package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +35 -22
- package/node_modules/@deepseek-ai/dsh-storage/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-storage/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-storage-domain/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-storage-json/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-storage-json/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-storage-json/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subagent/README.i18n.yaml +93 -5
- package/node_modules/@deepseek-ai/dsh-subagent/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +4 -3
- package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +71 -238
- package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +65 -41
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/control-types.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/index.js +12 -12
- package/node_modules/@deepseek-ai/dsh-subagent/lib/types/list-children.js +50 -261
- package/node_modules/@deepseek-ai/dsh-subagent/package.json +51 -56
- package/node_modules/@deepseek-ai/dsh-subagent-acp/README.i18n.yaml +84 -5
- package/node_modules/@deepseek-ai/dsh-subagent-acp/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/README.i18n.yaml +81 -5
- package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/README.i18n.yaml +105 -5
- package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/package.json +26 -26
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +21 -20
- package/node_modules/@deepseek-ai/dsh-subprocess/README.i18n.yaml +72 -5
- package/node_modules/@deepseek-ai/dsh-subprocess/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.md +3 -2
- package/node_modules/@deepseek-ai/dsh-subprocess-local/README.zh.md +3 -2
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/index.js +10 -4
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/output.js +82 -24
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner-launch-B2zsQ1Dz.js +1529 -0
- package/node_modules/@deepseek-ai/dsh-subprocess-local/lib/runner.js +1 -1
- package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-system-prompt/README.i18n.yaml +87 -5
- package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-terminal/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-terminal/package.json +8 -8
- package/node_modules/@deepseek-ai/dsh-terminal-bash/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-time-context/README.i18n.yaml +69 -5
- package/node_modules/@deepseek-ai/dsh-time-context/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-time-context/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-time-context/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-time-context/package.json +24 -24
- package/node_modules/@deepseek-ai/dsh-timeout/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-timeout/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-tmux-context/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-tmux-context/lib/index.js +111 -9
- package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +14 -14
- package/node_modules/@deepseek-ai/dsh-token-meter/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-token-meter/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-token-meter/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-token-meter/package.json +22 -18
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/README.i18n.yaml +75 -5
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.i18n.yaml +126 -5
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-bash/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-bash/lib/index.js +6 -9
- package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +32 -32
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/lib/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +24 -22
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-tool-cordis/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +373 -79
- package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +141 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +9 -73
- package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +32 -30
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.i18n.yaml +114 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.md +3 -9
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/README.zh.md +3 -9
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/lib/index.js +4 -5
- package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-goal/README.zh.md +2 -2
- package/node_modules/@deepseek-ai/dsh-tool-goal/lib/index.js +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.i18n.yaml +96 -5
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-jobs/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-jobs/lib/index.js +21 -15
- package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-tool-present/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-tool-present/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-present/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-present/lib/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-present/lib/types/index.js +5 -5
- package/node_modules/@deepseek-ai/dsh-tool-present/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.i18n.yaml +123 -5
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/README.zh.md +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/lib/index.js +8 -8
- package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +31 -31
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.md +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/README.zh.md +6 -6
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/lib/index.js +7 -25
- package/node_modules/@deepseek-ai/dsh-tool-pwsh-persistent/package.json +25 -23
- package/node_modules/@deepseek-ai/dsh-tool-ralph/README.i18n.yaml +99 -5
- package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +23 -23
- package/node_modules/@deepseek-ai/dsh-tool-skill/README.i18n.yaml +141 -5
- package/node_modules/@deepseek-ai/dsh-tool-skill/lib/index.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/lib/index.js +2 -1
- package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +22 -20
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.i18n.yaml +120 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +30 -30
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.i18n.yaml +105 -5
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/index.js +3 -3
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/index.js +6 -11
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/lib/types/list-agents.js +6 -14
- package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +21 -21
- package/node_modules/@deepseek-ai/dsh-tool-todo/README.i18n.yaml +90 -5
- package/node_modules/@deepseek-ai/dsh-tool-todo/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-todo/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-todo/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-todo/lib/types/index.js +5 -15
- package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +20 -20
- package/node_modules/@deepseek-ai/dsh-tool-web/README.i18n.yaml +150 -5
- package/node_modules/@deepseek-ai/dsh-tool-web/README.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/README.zh.md +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/lib/index.js +4 -4
- package/node_modules/@deepseek-ai/dsh-tool-web/package.json +22 -21
- package/node_modules/@deepseek-ai/dsh-tool-workflow/README.i18n.yaml +102 -5
- package/node_modules/@deepseek-ai/dsh-tool-workflow/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-workflow/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-tool-workflow/lib/index.js +9 -16
- package/node_modules/@deepseek-ai/dsh-tool-workflow/lib/types/index.js +10 -16
- package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-tool-workspace-dependencies/package.json +11 -11
- package/node_modules/@deepseek-ai/dsh-tools/README.i18n.yaml +102 -5
- package/node_modules/@deepseek-ai/dsh-tools/README.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tools/README.zh.md +3 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/index.js +16 -2
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/index.js +13 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/ptc.js +1 -1
- package/node_modules/@deepseek-ai/dsh-tools/lib/types/schema.js +5 -0
- package/node_modules/@deepseek-ai/dsh-tools/package.json +27 -27
- package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +84 -5
- package/node_modules/@deepseek-ai/dsh-tui-app/package.json +76 -76
- package/node_modules/@deepseek-ai/dsh-typert-loader/README.i18n.yaml +57 -5
- package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-typert-protocol/README.i18n.yaml +63 -5
- package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-typert-registry/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-user-approval/README.i18n.yaml +87 -5
- package/node_modules/@deepseek-ai/dsh-user-approval/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-approval/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-user-approval/package.json +18 -18
- package/node_modules/@deepseek-ai/dsh-user-questions/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-user-questions/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-util-code-language/README.i18n.yaml +25 -0
- package/node_modules/@deepseek-ai/dsh-util-code-language/README.md +50 -0
- package/node_modules/@deepseek-ai/dsh-util-code-language/README.zh.md +50 -0
- package/node_modules/@deepseek-ai/dsh-util-code-language/lib/index.js +269 -0
- package/node_modules/@deepseek-ai/dsh-util-code-language/package.json +35 -0
- package/node_modules/@deepseek-ai/dsh-util-crypto/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-util-crypto/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-time/README.i18n.yaml +33 -5
- package/node_modules/@deepseek-ai/dsh-util-time/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-values/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-util-values/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/README.i18n.yaml +24 -5
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/README.md +2 -0
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/README.zh.md +2 -0
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/lib/index.js +11 -1
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/lib/types/index.d.ts +7 -0
- package/node_modules/@deepseek-ai/dsh-util-workspace-path/package.json +3 -3
- package/node_modules/@deepseek-ai/dsh-web/README.i18n.yaml +66 -5
- package/node_modules/@deepseek-ai/dsh-web/package.json +6 -6
- package/node_modules/@deepseek-ai/dsh-web-app/README.i18n.yaml +75 -5
- package/node_modules/@deepseek-ai/dsh-web-app/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-web-app/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +21 -3
- package/node_modules/@deepseek-ai/dsh-web-app/lib/index.js +33 -5
- package/node_modules/@deepseek-ai/dsh-web-app/package.json +143 -139
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-web-fetch-http/package.json +10 -10
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/fonts/Montserrat-OFL.txt +93 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/fonts/montserrat-light-Cvd2VjE_.woff2 +0 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/fonts/montserrat-medium-B4OyO9CN.woff2 +0 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/fonts/montserrat-regular-DYep38cA.woff2 +0 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DUvMhLle.css +1 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Q6zc2uHV.js +127 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/asciidoc-Ve4PFQV2.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/bat-BkioyH1T.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/bibtex-CHM0blh-.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/clojure-P80f7IUj.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/cmake-D1j8_8rp.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/csv-fuZLfV_i.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/dart-bE4Kk8sk.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/diff-D97Zzqfu.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/dotenv-Da5cRb03.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/elixir-CvYZzuDY.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/erlang-DsQrWhSR.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/fish-BvzEVeQv.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/fsharp-CXgrBDvD.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/graphql-DujV8YkJ.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/groovy-gcz8RCvz.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/haskell-Df6bDoY_.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/hcl-BWvSN4gD.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/html-derivative-DOyKdj44.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/html-fwsONPVS.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/http-DcV90OkR.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/javascript-DI5JR1nB.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/julia-BpJ6DjL_.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/latex-B4C7GdlO.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/log-2UxHyX5q.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/make-CHLpvVh8.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/nix-CwoSXNpI.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/perl-DsWkoyyU.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/php-LEPfNACG.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/powershell-Dpen1YoG.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/proto-C7zT0LnQ.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/r-Dspwwk_N.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/rst-BbocfKWr.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/ruby-R292Iif0.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/scala-C151Ov-r.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/svelte-DNMY6jOf.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/system-verilog-CnnmHF94.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/vb-D17OF-Vu.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/verilog-BQ8w6xss.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/vue-Dq2x6432.js +2 -0
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +17 -15
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/README.i18n.yaml +84 -5
- package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-web-search-exa/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-web-search-exa/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/README.i18n.yaml +81 -5
- package/node_modules/@deepseek-ai/dsh-web-search-perplexity/package.json +9 -9
- package/node_modules/@deepseek-ai/dsh-webhook/README.i18n.yaml +45 -5
- package/node_modules/@deepseek-ai/dsh-webhook/package.json +25 -25
- package/node_modules/@deepseek-ai/dsh-webhook-github/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-webhook-github/package.json +15 -15
- package/node_modules/@deepseek-ai/dsh-win32-process/README.i18n.yaml +42 -5
- package/node_modules/@deepseek-ai/dsh-win32-process/package.json +4 -4
- package/node_modules/@deepseek-ai/dsh-workflow/README.i18n.yaml +60 -5
- package/node_modules/@deepseek-ai/dsh-workflow/package.json +13 -13
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/README.i18n.yaml +78 -5
- package/node_modules/@deepseek-ai/dsh-workflow-ptc/package.json +37 -36
- package/node_modules/@deepseek-ai/dsh-workspace/README.i18n.yaml +87 -5
- package/node_modules/@deepseek-ai/dsh-workspace/README.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/dsh-workspace/lib/index.js +7 -5
- package/node_modules/@deepseek-ai/dsh-workspace/lib/types/index.js +7 -5
- package/node_modules/@deepseek-ai/dsh-workspace/package.json +16 -16
- package/node_modules/@deepseek-ai/dsh-workspace-changes/README.i18n.yaml +36 -5
- package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +16 -16
- package/node_modules/@deepseek-ai/libreoffice-kit/README.md +30 -5
- package/node_modules/@deepseek-ai/libreoffice-kit/README.zh.md +30 -5
- package/node_modules/@deepseek-ai/libreoffice-kit/lib/cli.js +2058 -0
- package/node_modules/@deepseek-ai/libreoffice-kit/lib/font-snapshot-worker.js +454 -0
- package/node_modules/@deepseek-ai/libreoffice-kit/lib/index.js +1055 -57
- package/node_modules/@deepseek-ai/libreoffice-kit/lib/worker.js +922 -239
- package/node_modules/@deepseek-ai/libreoffice-kit/package.json +9 -3
- package/node_modules/@deepseek-ai/node-addon-system/README.i18n.yaml +9 -5
- package/node_modules/@deepseek-ai/node-addon-system/README.md +1 -1
- package/node_modules/@deepseek-ai/node-addon-system/README.zh.md +1 -1
- package/node_modules/@deepseek-ai/schemastery/package.json +2 -2
- package/node_modules/@js-temporal/polyfill/CHANGELOG.md +453 -0
- package/node_modules/@js-temporal/polyfill/LICENSE +13 -0
- package/node_modules/@js-temporal/polyfill/README.md +90 -0
- package/node_modules/@js-temporal/polyfill/dist/index.cjs +2 -0
- package/node_modules/@js-temporal/polyfill/dist/index.esm.js +2 -0
- package/node_modules/@js-temporal/polyfill/dist/index.umd.js +2 -0
- package/node_modules/@js-temporal/polyfill/lib/assert.ts +8 -0
- package/node_modules/@js-temporal/polyfill/lib/bigintmath.ts +39 -0
- package/node_modules/@js-temporal/polyfill/lib/calendar.ts +2424 -0
- package/node_modules/@js-temporal/polyfill/lib/debug.ts +7 -0
- package/node_modules/@js-temporal/polyfill/lib/duration.ts +438 -0
- package/node_modules/@js-temporal/polyfill/lib/ecmascript.ts +4973 -0
- package/node_modules/@js-temporal/polyfill/lib/index.ts +34 -0
- package/node_modules/@js-temporal/polyfill/lib/init.ts +43 -0
- package/node_modules/@js-temporal/polyfill/lib/instant.ts +138 -0
- package/node_modules/@js-temporal/polyfill/lib/intl.ts +758 -0
- package/node_modules/@js-temporal/polyfill/lib/intrinsicclass.ts +162 -0
- package/node_modules/@js-temporal/polyfill/lib/legacydate.ts +17 -0
- package/node_modules/@js-temporal/polyfill/lib/math.ts +96 -0
- package/node_modules/@js-temporal/polyfill/lib/now.ts +48 -0
- package/node_modules/@js-temporal/polyfill/lib/plaindate.ts +212 -0
- package/node_modules/@js-temporal/polyfill/lib/plaindatetime.ts +274 -0
- package/node_modules/@js-temporal/polyfill/lib/plainmonthday.ts +110 -0
- package/node_modules/@js-temporal/polyfill/lib/plaintime.ts +154 -0
- package/node_modules/@js-temporal/polyfill/lib/plainyearmonth.ts +157 -0
- package/node_modules/@js-temporal/polyfill/lib/regex.ts +59 -0
- package/node_modules/@js-temporal/polyfill/lib/slots.ts +341 -0
- package/node_modules/@js-temporal/polyfill/lib/temporal.ts +10 -0
- package/node_modules/@js-temporal/polyfill/lib/timeduration.ts +149 -0
- package/node_modules/@js-temporal/polyfill/lib/zoneddatetime.ts +492 -0
- package/node_modules/@js-temporal/polyfill/package.json +125 -0
- package/node_modules/fflate/CHANGELOG.md +0 -10
- package/node_modules/fflate/LICENSE +1 -1
- package/node_modules/fflate/README.md +10 -10
- package/node_modules/fflate/esm/browser.js +55 -82
- package/node_modules/fflate/esm/index.mjs +56 -87
- package/node_modules/fflate/lib/browser.cjs +77 -106
- package/node_modules/fflate/lib/index.cjs +77 -106
- package/node_modules/fflate/lib/node-worker.cjs +1 -5
- package/node_modules/fflate/lib/node.cjs +78 -111
- package/node_modules/fflate/package.json +10 -11
- package/node_modules/fflate/umd/index.js +1 -1
- package/node_modules/jsbi/LICENSE +176 -0
- package/node_modules/jsbi/README.md +173 -0
- package/node_modules/jsbi/dist/jsbi-cjs.js +2 -0
- package/node_modules/jsbi/dist/jsbi-umd.js +2 -0
- package/node_modules/jsbi/dist/jsbi.mjs +2 -0
- package/node_modules/jsbi/package.json +25 -0
- package/package.json +305 -289
- package/node_modules/@deepseek-ai/dsh/lib/dump-config-DaAE0NHG.js +0 -2
- package/node_modules/@deepseek-ai/dsh/lib/plugin-CnNK4cws.js +0 -31
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/typert.host.js +0 -741
- package/node_modules/@deepseek-ai/dsh-experimental-agent-team/lib/typert.remote-client.js +0 -70
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-DU8FBaxM.js +0 -127
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Uv-aF9RH.css +0 -1
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/html-CfGypltT.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/php-DJl5gRdb.js +0 -2
- package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/langs/ruby-5eNB0pDK.js +0 -2
- package/node_modules/@deepseek-ai/libreoffice-kit/node_modules/fflate/umd/index.js +0 -1
- /package/node_modules/@deepseek-ai/{libreoffice-kit → dsh-session-log-export}/node_modules/fflate/lib/worker.cjs +0 -0
|
@@ -0,0 +1,2058 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { parseArgs } from "node:util";
|
|
4
|
+
import { dirname, extname, isAbsolute, join, posix, relative, resolve, sep, win32 } from "node:path";
|
|
5
|
+
import { constants, lstatSync, readdirSync } from "node:fs";
|
|
6
|
+
import { lstat, mkdir, mkdtemp, open, readFile, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
7
|
+
import { homedir, tmpdir } from "node:os";
|
|
8
|
+
import { Worker } from "node:worker_threads";
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
11
|
+
import { createInterface } from "node:readline";
|
|
12
|
+
import { zlibSync } from "fflate";
|
|
13
|
+
import "fontkit";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
//#region lib/types/errors.js
|
|
16
|
+
/** Stable render failure categories shared across the Node worker and native helper transports. */
|
|
17
|
+
const CODES = /* @__PURE__ */ new Set([
|
|
18
|
+
"input-too-large",
|
|
19
|
+
"output-too-large",
|
|
20
|
+
"invalid-document",
|
|
21
|
+
"unsupported-format",
|
|
22
|
+
"invalid-output",
|
|
23
|
+
"timeout",
|
|
24
|
+
"unavailable",
|
|
25
|
+
"failed"
|
|
26
|
+
]);
|
|
27
|
+
/** An actionable converter failure; operating-system errors and caller abort reasons remain unchanged. */
|
|
28
|
+
var ConversionError = class extends Error {
|
|
29
|
+
/** Published failure category carried across worker and helper transports. */
|
|
30
|
+
code;
|
|
31
|
+
/**
|
|
32
|
+
* @param code - Published failure category.
|
|
33
|
+
* @param message - Consumer-facing failure description.
|
|
34
|
+
* @param options - Standard error options; a cause is preserved for diagnostics.
|
|
35
|
+
*/
|
|
36
|
+
constructor(code, message, options) {
|
|
37
|
+
super(message, options);
|
|
38
|
+
this.name = "ConversionError";
|
|
39
|
+
this.code = code;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Only published categories cross worker/helper messages; unknown errors use the generic failure category.
|
|
44
|
+
* @param error - The thrown value, which may be any type and may carry an unpublished `code`.
|
|
45
|
+
* @returns The published category, or `failed` when no published category is present.
|
|
46
|
+
*/
|
|
47
|
+
function failureCode(error) {
|
|
48
|
+
const code = error?.code;
|
|
49
|
+
return typeof code === "string" && CODES.has(code) ? code : "failed";
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region lib/types/sheet-geometry.js
|
|
53
|
+
const MAX_COLUMN = 16383;
|
|
54
|
+
const MAX_ROW = 1048575;
|
|
55
|
+
function column(index) {
|
|
56
|
+
let name = "";
|
|
57
|
+
for (let value = index + 1; value > 0; value = Math.floor((value - 1) / 26)) name = String.fromCharCode(65 + (value - 1) % 26) + name;
|
|
58
|
+
return name;
|
|
59
|
+
}
|
|
60
|
+
function rangeName(range) {
|
|
61
|
+
return `${column(range.firstColumn)}${range.firstRow + 1}:${column(range.lastColumn)}${range.lastRow + 1}`;
|
|
62
|
+
}
|
|
63
|
+
function parseCellRange(value) {
|
|
64
|
+
const match = /^\$?([A-Z]{1,3})\$?([1-9]\d{0,6})(?::\$?([A-Z]{1,3})\$?([1-9]\d{0,6}))?$/i.exec(value);
|
|
65
|
+
if (!match) throw new TypeError("range must be an A1 cell or rectangle without a sheet prefix.");
|
|
66
|
+
const col = (name) => [...name.toUpperCase()].reduce((sum, c) => sum * 26 + c.charCodeAt(0) - 64, 0) - 1;
|
|
67
|
+
const firstColumn = col(match[1]);
|
|
68
|
+
const firstRow = Number(match[2]) - 1;
|
|
69
|
+
const lastColumn = col(match[3] ?? match[1]);
|
|
70
|
+
const lastRow = Number(match[4] ?? match[2]) - 1;
|
|
71
|
+
if (lastColumn < firstColumn || lastRow < firstRow || lastColumn > MAX_COLUMN || lastRow > MAX_ROW) throw new TypeError("range exceeds Calc worksheet bounds or has reversed endpoints.");
|
|
72
|
+
return {
|
|
73
|
+
firstColumn,
|
|
74
|
+
firstRow,
|
|
75
|
+
lastColumn,
|
|
76
|
+
lastRow
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function sheetPartInfo(value) {
|
|
80
|
+
const info = JSON.parse(value);
|
|
81
|
+
if (!info || typeof info.name !== "string" || ![0, 1].includes(info.visible) || ![0, 1].includes(info.rtllayout) || !Number.isInteger(info.lastcolumn) || !Number.isInteger(info.lastrow) || info.lastcolumn < 0 || info.lastrow < 0 || info.lastcolumn > MAX_COLUMN || info.lastrow > MAX_ROW) throw new Error("LibreOffice returned invalid worksheet data-area metadata.");
|
|
82
|
+
return info;
|
|
83
|
+
}
|
|
84
|
+
/** Formatting-only cells and standalone drawings do not enlarge LibreOffice's data area. */
|
|
85
|
+
function dataArea(info) {
|
|
86
|
+
return {
|
|
87
|
+
firstColumn: 0,
|
|
88
|
+
firstRow: 0,
|
|
89
|
+
lastColumn: info.lastcolumn,
|
|
90
|
+
lastRow: info.lastrow
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function spans(encoded, flags, maximum) {
|
|
94
|
+
if (typeof encoded !== "string" || encoded.length > 33554432) throw new Error("Invalid worksheet geometry span encoding.");
|
|
95
|
+
const tokens = encoded.trim().split(/\s+/);
|
|
96
|
+
let previous = -1;
|
|
97
|
+
let flag = 0;
|
|
98
|
+
const result = tokens.map((token, i) => {
|
|
99
|
+
const fields = token.split(":");
|
|
100
|
+
let value;
|
|
101
|
+
let end;
|
|
102
|
+
if (flags && i > 0) {
|
|
103
|
+
value = flag = 1 - flag;
|
|
104
|
+
end = Number(fields[0]);
|
|
105
|
+
if (fields.length !== 1) throw new Error("Invalid worksheet flag span.");
|
|
106
|
+
} else {
|
|
107
|
+
value = Number(fields[0]);
|
|
108
|
+
end = Number(fields[1]);
|
|
109
|
+
flag = value;
|
|
110
|
+
if (fields.length !== 2) throw new Error("Invalid worksheet size span.");
|
|
111
|
+
}
|
|
112
|
+
if (!Number.isSafeInteger(value) || value < 0 || (flags ? value > 1 : value > 65535) || !Number.isSafeInteger(end) || end <= previous || end > maximum) throw new Error("Invalid worksheet geometry span.");
|
|
113
|
+
previous = end;
|
|
114
|
+
return {
|
|
115
|
+
end,
|
|
116
|
+
value
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
if (previous !== maximum) throw new Error("Worksheet geometry does not cover the complete dimension.");
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
function dimension(data, first, last, maximum, scale) {
|
|
123
|
+
const sizes = spans(data?.sizes, false, maximum);
|
|
124
|
+
const hidden = spans(data?.hidden, true, maximum);
|
|
125
|
+
const filtered = spans(data?.filtered, true, maximum);
|
|
126
|
+
let position = 0, start = 0, index = 0, si = 0, hi = 0, fi = 0;
|
|
127
|
+
while (index <= last) {
|
|
128
|
+
const size = sizes[si], hide = hidden[hi], filter = filtered[fi];
|
|
129
|
+
const end = Math.min(size.end, hide.end, filter.end, last, index < first ? first - 1 : last);
|
|
130
|
+
const pixels = hide.value || filter.value || size.value === 0 ? 0 : Math.max(1, Math.floor(size.value * scale / 15));
|
|
131
|
+
if (index === first) start = position;
|
|
132
|
+
position += (end - index + 1) * pixels;
|
|
133
|
+
index = end + 1;
|
|
134
|
+
if (index > size.end) si++;
|
|
135
|
+
if (index > hide.end) hi++;
|
|
136
|
+
if (index > filter.end) fi++;
|
|
137
|
+
}
|
|
138
|
+
return [start / scale, (position - start) / scale];
|
|
139
|
+
}
|
|
140
|
+
/** Logical columns advance from A; LOK itself mirrors RTL sheet painting. No manual x inversion. */
|
|
141
|
+
function sheetRangeRectangle(geometry, range, scale) {
|
|
142
|
+
if (!Number.isFinite(scale) || scale <= 0 || scale > 16) throw new TypeError("Invalid worksheet raster scale.");
|
|
143
|
+
const [x, width] = dimension(geometry.columns, range.firstColumn, range.lastColumn, MAX_COLUMN, scale);
|
|
144
|
+
const [y, height] = dimension(geometry.rows, range.firstRow, range.lastRow, MAX_ROW, scale);
|
|
145
|
+
if (width <= 0 || height <= 0) throw new Error("The selected worksheet range is entirely hidden or filtered.");
|
|
146
|
+
if ([
|
|
147
|
+
x,
|
|
148
|
+
y,
|
|
149
|
+
width,
|
|
150
|
+
height,
|
|
151
|
+
x + width,
|
|
152
|
+
y + height
|
|
153
|
+
].some((value) => !Number.isFinite(value) || value * 15 > 2147483647)) throw new Error("The selected worksheet range exceeds the supported coordinate range.");
|
|
154
|
+
return {
|
|
155
|
+
x,
|
|
156
|
+
y,
|
|
157
|
+
width,
|
|
158
|
+
height
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** Split a region on its output-pixel grid, bounding the plan before allocating it. */
|
|
162
|
+
function splitRasterRectangle(rectangle, scale, limits) {
|
|
163
|
+
const { x, y, width, height } = rectangle;
|
|
164
|
+
const { maxPixels, maxDimension, maxTiles } = limits;
|
|
165
|
+
if (![
|
|
166
|
+
x,
|
|
167
|
+
y,
|
|
168
|
+
width,
|
|
169
|
+
height,
|
|
170
|
+
scale
|
|
171
|
+
].every(Number.isFinite) || x < 0 || y < 0 || width <= 0 || height <= 0 || scale <= 0 || !Number.isSafeInteger(maxPixels) || maxPixels < 1 || maxPixels > 16777216 || !Number.isSafeInteger(maxDimension) || maxDimension < 1 || maxDimension > 16777216 || !Number.isSafeInteger(maxTiles) || maxTiles < 0) throw new TypeError("Invalid raster splitting limits or rectangle.");
|
|
172
|
+
const pixelWidth = Math.ceil(width * scale - 1e-9), pixelHeight = Math.ceil(height * scale - 1e-9);
|
|
173
|
+
if (![pixelWidth, pixelHeight].every((value) => Number.isSafeInteger(value) && value > 0)) throw new RangeError("Raster dimensions exceed the coordinate range.");
|
|
174
|
+
let tileWidth = Math.min(pixelWidth, maxDimension), tileHeight = Math.min(pixelHeight, maxDimension);
|
|
175
|
+
if (tileWidth * tileHeight > maxPixels) {
|
|
176
|
+
const side = Math.floor(Math.sqrt(maxPixels));
|
|
177
|
+
if (tileWidth <= side) tileHeight = Math.floor(maxPixels / tileWidth);
|
|
178
|
+
else if (tileHeight <= side) tileWidth = Math.floor(maxPixels / tileHeight);
|
|
179
|
+
else {
|
|
180
|
+
tileWidth = side;
|
|
181
|
+
tileHeight = Math.min(tileHeight, Math.floor(maxPixels / tileWidth));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const columns = Math.ceil(pixelWidth / tileWidth), rows = Math.ceil(pixelHeight / tileHeight);
|
|
185
|
+
if (columns * rows > maxTiles) throw new RangeError("Raster batch exceeds maxPages after worksheet splitting.");
|
|
186
|
+
const result = [];
|
|
187
|
+
for (let row = 0; row < rows; row++) for (let column = 0; column < columns; column++) {
|
|
188
|
+
const left = column * tileWidth / scale, top = row * tileHeight / scale;
|
|
189
|
+
result.push({
|
|
190
|
+
x: x + left,
|
|
191
|
+
y: y + top,
|
|
192
|
+
width: Math.min(tileWidth / scale, width - left),
|
|
193
|
+
height: Math.min(tileHeight / scale, height - top)
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
/** Writer's zero-area parity placeholders have no visible page. Offsets stay in twips. */
|
|
199
|
+
function writerPages(rectangles) {
|
|
200
|
+
const pages = rectangles.split(";").filter((value) => value.trim()).flatMap((rectangle) => {
|
|
201
|
+
const fields = rectangle.split(",").map((value) => Number(value.trim()));
|
|
202
|
+
const [x, y, width, height] = fields;
|
|
203
|
+
if (fields.length !== 4 || x === void 0 || y === void 0 || width === void 0 || height === void 0 || fields.some((value) => !Number.isSafeInteger(value) || value < 0 || value > 2147483647) || width === 0 !== (height === 0) || x + width > 2147483647 || y + height > 2147483647) throw new Error("LibreOffice returned invalid page rectangles.");
|
|
204
|
+
return width === 0 ? [] : [{
|
|
205
|
+
x,
|
|
206
|
+
y,
|
|
207
|
+
width: width / 15,
|
|
208
|
+
height: height / 15,
|
|
209
|
+
part: -1
|
|
210
|
+
}];
|
|
211
|
+
});
|
|
212
|
+
if (pages.length === 0) throw new Error("LibreOffice returned no document pages.");
|
|
213
|
+
return pages;
|
|
214
|
+
}
|
|
215
|
+
/** Validate coordinates before allocation or wasm32 integer conversion. */
|
|
216
|
+
function tileDimensions(request, pages) {
|
|
217
|
+
const page = pages[request.pageIndex];
|
|
218
|
+
if (!Number.isSafeInteger(request.pageIndex) || !page || ![
|
|
219
|
+
request.x,
|
|
220
|
+
request.y,
|
|
221
|
+
request.width,
|
|
222
|
+
request.height,
|
|
223
|
+
request.scale
|
|
224
|
+
].every(Number.isFinite) || request.x < 0 || request.y < 0 || request.width <= 0 || request.height <= 0 || request.scale <= 0 || request.x + request.width > page.width + .001 || request.y + request.height > page.height + .001) throw new Error("Tile rectangle lies outside its page.");
|
|
225
|
+
const width = Math.ceil(request.width * request.scale - 1e-9);
|
|
226
|
+
const height = Math.ceil(request.height * request.scale - 1e-9);
|
|
227
|
+
if (width <= 0 || height <= 0 || !Number.isSafeInteger(width * height) || width * height > 16777216) throw new Error("Tile exceeds the 16 megapixel allocation limit.");
|
|
228
|
+
const twips = [
|
|
229
|
+
page.x + Math.round(request.x * 15),
|
|
230
|
+
page.y + Math.round(request.y * 15),
|
|
231
|
+
Math.round(request.width * 15),
|
|
232
|
+
Math.round(request.height * 15)
|
|
233
|
+
];
|
|
234
|
+
if (twips.some((value) => !Number.isSafeInteger(value) || value < 0 || value > 2147483647) || twips[0] + twips[2] > 2147483647 || twips[1] + twips[3] > 2147483647) throw new Error("Tile coordinates exceed the wasm32 range.");
|
|
235
|
+
return {
|
|
236
|
+
page,
|
|
237
|
+
width,
|
|
238
|
+
height
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/** Cairo/LO channels are premultiplied; PNG and ImageData require straight RGBA. */
|
|
242
|
+
function rgbaPixels(source, tileMode) {
|
|
243
|
+
if (tileMode !== 0 && tileMode !== 1 || source.length % 4 !== 0) throw new Error("LibreOffice returned an unsupported tile pixel format.");
|
|
244
|
+
const result = new Uint8ClampedArray(source.length);
|
|
245
|
+
for (let index = 0; index < source.length; index += 4) {
|
|
246
|
+
const alpha = source[index + 3];
|
|
247
|
+
const multiplier = alpha === 0 ? 0 : 255 / alpha;
|
|
248
|
+
result[index] = source[index + (tileMode === 1 ? 2 : 0)] * multiplier;
|
|
249
|
+
result[index + 1] = source[index + 1] * multiplier;
|
|
250
|
+
result[index + 2] = source[index + (tileMode === 1 ? 0 : 2)] * multiplier;
|
|
251
|
+
result[index + 3] = alpha;
|
|
252
|
+
}
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region lib/types/image-operations.js
|
|
257
|
+
/** Public direct-raster request and immutable saved-file manifest. */
|
|
258
|
+
const IMAGE_FORMATS = [
|
|
259
|
+
"doc",
|
|
260
|
+
"docx",
|
|
261
|
+
"odt",
|
|
262
|
+
"xls",
|
|
263
|
+
"xlsx",
|
|
264
|
+
"ods",
|
|
265
|
+
"ppt",
|
|
266
|
+
"pptx",
|
|
267
|
+
"odp",
|
|
268
|
+
"pdf"
|
|
269
|
+
];
|
|
270
|
+
function resolveImageRender(request) {
|
|
271
|
+
if (!request || typeof request.inputPath !== "string" || typeof request.outputDir !== "string" || !isAbsolute(request.inputPath) || !isAbsolute(request.outputDir) || request.inputPath.includes("\0") || request.outputDir.includes("\0")) throw new TypeError("inputPath and outputDir must be absolute filesystem paths.");
|
|
272
|
+
const inputPath = resolve(request.inputPath), outputDir = resolve(request.outputDir);
|
|
273
|
+
const within = relative(outputDir, inputPath);
|
|
274
|
+
if (!within || !within.startsWith("..") && !isAbsolute(within)) throw new TypeError("Input cannot be inside the newly owned output directory.");
|
|
275
|
+
const extension = extname(inputPath).slice(1).toLowerCase();
|
|
276
|
+
if (!IMAGE_FORMATS.includes(extension)) throw new ConversionError("unsupported-format", `Unsupported image input: ${extension}.`);
|
|
277
|
+
const calc = [
|
|
278
|
+
"xls",
|
|
279
|
+
"xlsx",
|
|
280
|
+
"ods"
|
|
281
|
+
].includes(extension);
|
|
282
|
+
if (calc && request.pages !== void 0) throw new TypeError("Worksheets use sheet and A1 range, not printed page numbers.");
|
|
283
|
+
if (!calc && (request.sheet !== void 0 || request.range !== void 0)) throw new TypeError("sheet and range apply only to worksheets.");
|
|
284
|
+
if (request.sheet !== void 0 && (typeof request.sheet !== "string" || !request.sheet.trim() || request.sheet.includes("\0"))) throw new TypeError("sheet must be a nonempty exact worksheet name.");
|
|
285
|
+
if (request.range !== void 0 && request.sheet === void 0) throw new TypeError("range requires an exact sheet name.");
|
|
286
|
+
const range = request.range === void 0 ? void 0 : rangeName(parseCellRange(request.range));
|
|
287
|
+
const pages = request.pages ?? "all";
|
|
288
|
+
if (pages !== "all" && (!Array.isArray(pages) || pages.length === 0 || pages.some((page) => !Number.isSafeInteger(page) || page < 1) || new Set(pages).size !== pages.length)) throw new TypeError("pages must be all or distinct positive one-based page numbers.");
|
|
289
|
+
const dpi = request.dpi ?? 144;
|
|
290
|
+
const maxPages = request.maxPages ?? 100;
|
|
291
|
+
const maxPixels = request.maxPixels ?? 16777216;
|
|
292
|
+
const maxDimension = request.maxDimension ?? 8192;
|
|
293
|
+
if (!Number.isFinite(dpi) || dpi < 24 || dpi > 600) throw new TypeError("dpi must be between 24 and 600.");
|
|
294
|
+
if (!Number.isSafeInteger(maxPages) || maxPages < 1 || maxPages > 1e4) throw new TypeError("maxPages must be an integer between 1 and 10000.");
|
|
295
|
+
if (!Number.isSafeInteger(maxPixels) || maxPixels < 1 || maxPixels > 16777216) throw new TypeError("maxPixels must be between 1 and 16777216.");
|
|
296
|
+
if (!Number.isSafeInteger(maxDimension) || maxDimension < 1 || maxDimension > 16777216) throw new TypeError("maxDimension must be between 1 and 16777216.");
|
|
297
|
+
if (pages !== "all" && pages.length > maxPages) throw new ConversionError("output-too-large", "Selected page count exceeds maxPages.");
|
|
298
|
+
return {
|
|
299
|
+
kind: "images",
|
|
300
|
+
inputPath,
|
|
301
|
+
outputDir,
|
|
302
|
+
extension,
|
|
303
|
+
dpi,
|
|
304
|
+
maxPages,
|
|
305
|
+
maxPixels,
|
|
306
|
+
maxDimension,
|
|
307
|
+
...calc ? {} : { pages: pages === "all" ? "all" : [...pages] },
|
|
308
|
+
...request.sheet === void 0 ? {} : { sheet: request.sheet },
|
|
309
|
+
...range === void 0 ? {} : { range }
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
function selectedPages(pages, count, limit) {
|
|
313
|
+
if (!Number.isSafeInteger(count) || count < 1) throw new ConversionError("invalid-document", "The document contains no renderable pages.");
|
|
314
|
+
const result = pages === void 0 || pages === "all" ? Array.from({ length: Math.min(count, limit + 1) }, (_, i) => i + 1) : [...pages];
|
|
315
|
+
if (result.length > limit) throw new ConversionError("output-too-large", "Selected page count exceeds maxPages; select pages or raise the limit.");
|
|
316
|
+
if (result.some((page) => page > count)) throw new TypeError(`Selected page lies outside the ${count}-page document.`);
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region lib/types/profile.js
|
|
321
|
+
/** Private headless profile used by both native and WASM conversions. */
|
|
322
|
+
/**
|
|
323
|
+
* CSV selection is checked by the engine wrapper before saving; suppress the interactive warning.
|
|
324
|
+
* @param fontNodes - Escaped VCL font-substitution nodes, or an empty string for WASM.
|
|
325
|
+
* @returns The per-operation registry XML; macro execution is independently disabled at load.
|
|
326
|
+
*/
|
|
327
|
+
function profileXml(fontNodes = "") {
|
|
328
|
+
return `<?xml version="1.0" encoding="UTF-8"?><oor:items xmlns:oor="http://openoffice.org/2001/registry"><item oor:path="/org.openoffice.Office.Calc/Input"><prop oor:name="WarnActiveSheet" oor:op="fuse"><value>false</value></prop></item><item oor:path="/org.openoffice.VCL/FontSubstitutions/en">${fontNodes}</item></oor:items>\n`;
|
|
329
|
+
}
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region lib/types/native-font-names.js
|
|
332
|
+
/** Localized search names from LibreOffice Core's fixed font-name dictionary. */
|
|
333
|
+
const LOCALIZED_FONT_SEARCH_NAMES = /* @__PURE__ */ new Map([
|
|
334
|
+
["바탕", "batang"],
|
|
335
|
+
["바탕체", "batangche"],
|
|
336
|
+
["궁서", "gungshu"],
|
|
337
|
+
["궁서체", "gungshuche"],
|
|
338
|
+
["굴림", "gulim"],
|
|
339
|
+
["굴림체", "gulimche"],
|
|
340
|
+
["돋움", "dotum"],
|
|
341
|
+
["돋움체", "dotumche"],
|
|
342
|
+
["宋体", "simsun"],
|
|
343
|
+
["新宋体", "nsimsun"],
|
|
344
|
+
["黑体", "simhei"],
|
|
345
|
+
["楷体", "simkai"],
|
|
346
|
+
["中易宋体", "zycjksun"],
|
|
347
|
+
["中易黑体", "zycjkhei"],
|
|
348
|
+
["中易楷体", "zycjkkai"],
|
|
349
|
+
["方正黑体", "fzhei"],
|
|
350
|
+
["方正楷体", "fzkai"],
|
|
351
|
+
["方正宋一", "fzsong"],
|
|
352
|
+
["方正书宋", "fzshusong"],
|
|
353
|
+
["方正仿宋", "fzfangsong"],
|
|
354
|
+
["m简黑", "mhei"],
|
|
355
|
+
["m潠窪", "mhei"],
|
|
356
|
+
["m简楷噬", "mkai"],
|
|
357
|
+
["m潠翱抎", "mkai"],
|
|
358
|
+
["m简宋", "msong"],
|
|
359
|
+
["m潠冼", "msong"],
|
|
360
|
+
["m简夫宋", "cfangsong"],
|
|
361
|
+
["m潠溘冼", "cfangsong"],
|
|
362
|
+
["細明體", "mingliu"],
|
|
363
|
+
["新細明體", "pmingliu"],
|
|
364
|
+
["桥", "hei"],
|
|
365
|
+
["歡", "kai"],
|
|
366
|
+
["浩湧", "ming"],
|
|
367
|
+
["msゴシック", "msgothic"],
|
|
368
|
+
["mspゴシック", "mspgothic"],
|
|
369
|
+
["ms明朝", "msmincho"],
|
|
370
|
+
["msp明朝", "mspmincho"],
|
|
371
|
+
["微軟正黑體", "microsoftjhenghei"],
|
|
372
|
+
["微软雅黑", "microsoftyahei"],
|
|
373
|
+
["メイリオ", "meiryo"],
|
|
374
|
+
["hg明朝l", "hgminchol"],
|
|
375
|
+
["hgゴシックb", "hggothicb"],
|
|
376
|
+
["hgp明朝l", "hgpminchol"],
|
|
377
|
+
["hgpゴシックb", "hgpgothicb"],
|
|
378
|
+
["hg明朝lsun", "hgmincholsun"],
|
|
379
|
+
["hgゴシックbsun", "hggothicbsun"],
|
|
380
|
+
["hgp明朝lsun", "hgpmincholsun"],
|
|
381
|
+
["hgpゴシックbsun", "hgpgothicbsun"],
|
|
382
|
+
["hg平成明朝体", "hgheiseimin"],
|
|
383
|
+
["hg平成明朝体w3x12", "hgheiseimin"],
|
|
384
|
+
["ipa明朝", "ipamincho"],
|
|
385
|
+
["ipap明朝", "ipapmincho"],
|
|
386
|
+
["ipaゴシック", "ipagothic"],
|
|
387
|
+
["ipapゴシック", "ipapgothic"],
|
|
388
|
+
["ipauiゴシック", "ipauigothic"],
|
|
389
|
+
["takao明朝", "takaomincho"],
|
|
390
|
+
["takaop明朝", "takaopmincho"],
|
|
391
|
+
["takaoゴシック", "takaogothic"],
|
|
392
|
+
["takaopゴシック", "takaopgothic"],
|
|
393
|
+
["さざなみ明朝", "sazanamimincho"],
|
|
394
|
+
["さざなみゴシック", "sazanamigothic"],
|
|
395
|
+
["東風明朝", "kochimincho"],
|
|
396
|
+
["東風ゴシック", "kochigothic"],
|
|
397
|
+
["썬돋움", "sundotum"],
|
|
398
|
+
["썬굴림", "sungulim"],
|
|
399
|
+
["썬바탕", "sunbatang"],
|
|
400
|
+
["백묵돋움", "baekmukdotum"],
|
|
401
|
+
["백묵굴림", "baekmukgulim"],
|
|
402
|
+
["백묵바탕", "baekmukbatang"],
|
|
403
|
+
["方正黑體", "fzheiti"],
|
|
404
|
+
["方正楷體", "fzkaitib"],
|
|
405
|
+
["方正明體", "fzmingtib"],
|
|
406
|
+
["方正宋体", "fzsongti"],
|
|
407
|
+
["hy견명조", "hymyeongjoextra"],
|
|
408
|
+
["hy신명조", "hysinmyeongjomedium"],
|
|
409
|
+
["hy중고딕", "hygothicmedium"],
|
|
410
|
+
["hy그래픽m", "hygraphicmedium"],
|
|
411
|
+
["hy그래픽", "hygraphic"],
|
|
412
|
+
["새굴림", "newgulim"],
|
|
413
|
+
["썬궁서", "sungungseo"],
|
|
414
|
+
["hy궁서b", "hygungsobold"],
|
|
415
|
+
["hy궁서", "hygungso"],
|
|
416
|
+
["썬헤드라인", "sunheadline"],
|
|
417
|
+
["hy헤드라인m", "hyheadlinemedium"],
|
|
418
|
+
["hy헤드라인", "hyheadline"],
|
|
419
|
+
["휴먼옛체", "yetr"],
|
|
420
|
+
["hy견고딕", "hygothicextra"],
|
|
421
|
+
["썬목판", "sunmokpan"],
|
|
422
|
+
["썬엽서", "sunyeopseo"],
|
|
423
|
+
["썬백송", "sunbaeksong"],
|
|
424
|
+
["hy엽서l", "hypostlight"],
|
|
425
|
+
["hy엽서", "hypost"],
|
|
426
|
+
["휴먼매직체", "magicr"],
|
|
427
|
+
["썬크리스탈", "suncrystal"],
|
|
428
|
+
["썬샘물", "sunsaemmul"],
|
|
429
|
+
["hy얕은샘물m", "hyshortsamulmedium"],
|
|
430
|
+
["hy얕은샘물", "hyshortsamul"],
|
|
431
|
+
["한컴바탕", "haansoftbatang"],
|
|
432
|
+
["한컴돋움", "haansoftdotum"],
|
|
433
|
+
["한양해서", "hyhaeseo"],
|
|
434
|
+
["md솔체", "mdsol"],
|
|
435
|
+
["md개성체", "mdgaesung"],
|
|
436
|
+
["md아트체", "mdart"],
|
|
437
|
+
["md아롱체", "mdalong"],
|
|
438
|
+
["md이솝체", "mdeasop"],
|
|
439
|
+
["hgゴシックe", "hggothice"],
|
|
440
|
+
["hgpゴシックe", "hgpgothice"],
|
|
441
|
+
["hgsゴシックe", "hgsgothice"],
|
|
442
|
+
["hgゴシックm", "hggothicm"],
|
|
443
|
+
["hgpゴシックm", "hgpgothicm"],
|
|
444
|
+
["hgsゴシックm", "hgsgothicm"],
|
|
445
|
+
["hg行書体", "hggyoshotai"],
|
|
446
|
+
["hgp行書体", "hgpgyoshotai"],
|
|
447
|
+
["hgs行書体", "hgsgyoshotai"],
|
|
448
|
+
["hg教科書体", "hgkyokashotai"],
|
|
449
|
+
["hgp教科書体", "hgpkyokashotai"],
|
|
450
|
+
["hgs教科書体", "hgskyokashotai"],
|
|
451
|
+
["hg明朝b", "hgminchob"],
|
|
452
|
+
["hgp明朝b", "hgpminchob"],
|
|
453
|
+
["hgs明朝b", "hgsminchob"],
|
|
454
|
+
["hg明朝e", "hgminchoe"],
|
|
455
|
+
["hgp明朝e", "hgpminchoe"],
|
|
456
|
+
["hgs明朝e", "hgsminchoe"],
|
|
457
|
+
["hg創英角ポップ体", "hgsoeikakupoptai"],
|
|
458
|
+
["hgp創英角ポップ体", "hgpsoeikakupopta"],
|
|
459
|
+
["hgs創英角ポップ体", "hgssoeikakupopta"],
|
|
460
|
+
["hg創英プレゼンスeb", "hgsoeipresenceeb"],
|
|
461
|
+
["hgp創英プレゼンスeb", "hgpsoeipresenceeb"],
|
|
462
|
+
["hgs創英プレゼンスeb", "hgssoeipresenceeb"],
|
|
463
|
+
["hg創英角ゴシックub", "hgsoeikakugothicub"],
|
|
464
|
+
["hgp創英角ゴシックub", "hgpsoeikakugothicub"],
|
|
465
|
+
["hgs創英角ゴシックub", "hgssoeikakugothicub"],
|
|
466
|
+
["hg正楷書体-pro", "hgseikaishotaipro"],
|
|
467
|
+
["hg丸ゴシック-pro", "hgmarugothicmpro"],
|
|
468
|
+
["ヒラギノ明朝pro", "hiraginominchopro"],
|
|
469
|
+
["ヒラギノ明朝pron", "hiraginominchopron"],
|
|
470
|
+
["ヒラギノ角ゴシック", "hiraginosans"],
|
|
471
|
+
["ヒラギノ角ゴpro", "hiraginokakugothicpro"],
|
|
472
|
+
["ヒラギノ角ゴpron", "hiraginokakugothicpron"],
|
|
473
|
+
["ヒラギノ丸ゴpro", "hiraginomarugothicpro"],
|
|
474
|
+
["ヒラギノ丸ゴpron", "hiraginomarugothicpron"],
|
|
475
|
+
["游ゴシック", "yugothic"],
|
|
476
|
+
["游ゴシック体", "yugothictai"],
|
|
477
|
+
["游明朝", "yumincho"],
|
|
478
|
+
["游明朝体", "yuminchotai"],
|
|
479
|
+
["源ノ角ゴシック", "sourcehansans"],
|
|
480
|
+
["源ノ角ゴシックjp", "sourcehansansjp"],
|
|
481
|
+
["源ノ角ゴシックhw", "sourcehansanshw"],
|
|
482
|
+
["源ノ明朝", "sourcehanserif"],
|
|
483
|
+
["源ノ明朝jp", "sourcehanserifjp"],
|
|
484
|
+
["ipamj明朝", "ipamjmincho"],
|
|
485
|
+
["ipaexゴシック", "ipaexgothic"],
|
|
486
|
+
["ipaex明朝", "ipaexmimcho"]
|
|
487
|
+
]);
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region lib/types/native.js
|
|
490
|
+
/** Per-render native helper process ownership and bounded result transport. */
|
|
491
|
+
const METRIC_SEARCH_NAMES = /* @__PURE__ */ new Map([
|
|
492
|
+
["timesnewroman", "liberationserif"],
|
|
493
|
+
["arial", "liberationsans"],
|
|
494
|
+
["arialnarrow", "liberationsansnarrow"],
|
|
495
|
+
["couriernew", "liberationmono"],
|
|
496
|
+
["cambria", "caladea"],
|
|
497
|
+
["calibri", "carlito"],
|
|
498
|
+
["bundessans", "calibri"],
|
|
499
|
+
["bundessansoffice", "calibri"],
|
|
500
|
+
["bundessansregular", "calibri"],
|
|
501
|
+
["bundesserif", "cambria"],
|
|
502
|
+
["bundesserifoffice", "cambria"],
|
|
503
|
+
["bundesserifregular", "cambria"]
|
|
504
|
+
]);
|
|
505
|
+
/** Environment variables the helper inherits from the embedding process. */
|
|
506
|
+
const NATIVE_ENVIRONMENT_KEYS = [
|
|
507
|
+
"PATH",
|
|
508
|
+
"SystemRoot",
|
|
509
|
+
"SYSTEMROOT",
|
|
510
|
+
"WINDIR",
|
|
511
|
+
"COMSPEC",
|
|
512
|
+
"PATHEXT",
|
|
513
|
+
"LANG",
|
|
514
|
+
"LC_ALL",
|
|
515
|
+
"TZ"
|
|
516
|
+
];
|
|
517
|
+
function fontSearchName(value) {
|
|
518
|
+
const name = value.replaceAll(/[\uff00-\uff5e]/g, (character) => String.fromCharCode(character.charCodeAt(0) - 65248)).replaceAll(/[A-Z]/g, (character) => character.toLowerCase()).replaceAll(/[^a-z0-9;()\u0080-\uffff]/g, "");
|
|
519
|
+
return LOCALIZED_FONT_SEARCH_NAMES.get(name) ?? name;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Write missing-family choices into the private profile's VCL substitution table.
|
|
523
|
+
* Installed originals and metric-compatible fonts are resolved before this table by LibreOffice.
|
|
524
|
+
* @param profile - Existing, conversion-owned profile directory.
|
|
525
|
+
* @param substitutions - Missing document families and the selected installed family.
|
|
526
|
+
* @returns Resolves after the exclusive profile file is written; empty choices still disable the interactive CSV warning.
|
|
527
|
+
*/
|
|
528
|
+
async function prepareNativeFontProfile(profile, substitutions) {
|
|
529
|
+
const families = new Map(substitutions.map(({ family, substitute }) => [fontSearchName(family), substitute]));
|
|
530
|
+
for (const [family, substitute] of [...families]) for (let alias = METRIC_SEARCH_NAMES.get(family); alias; alias = METRIC_SEARCH_NAMES.get(alias)) if (!families.has(alias)) families.set(alias, substitute);
|
|
531
|
+
const escape = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
532
|
+
const xml = profileXml([...families].map(([family, substitute]) => `<node oor:name="${escape(family)}" oor:op="replace"><prop oor:name="SubstFonts" oor:op="fuse"><value>${escape(substitute)}</value></prop></node>`).join(""));
|
|
533
|
+
const user = join(profile, "user");
|
|
534
|
+
await mkdir(user, { mode: 448 });
|
|
535
|
+
await writeFile(join(user, "registrymodifications.xcu"), xml, {
|
|
536
|
+
flag: "wx",
|
|
537
|
+
mode: 384
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Linux searches the verified program directory; ambient loader overrides and credentials are excluded.
|
|
542
|
+
* @param profile - Conversion-owned profile directory the helper treats as home.
|
|
543
|
+
* @param programDirectory - Verified engine program directory.
|
|
544
|
+
* @param source - Embedding process environment.
|
|
545
|
+
* @param platform - Host operating system.
|
|
546
|
+
* @returns the environment the helper starts with.
|
|
547
|
+
*/
|
|
548
|
+
function nativeEnvironment(profile, programDirectory, source = process.env, platform = process.platform) {
|
|
549
|
+
const env = {};
|
|
550
|
+
for (const key of NATIVE_ENVIRONMENT_KEYS) {
|
|
551
|
+
const value = source[key];
|
|
552
|
+
if (value !== void 0) env[key] = value;
|
|
553
|
+
}
|
|
554
|
+
if (platform === "linux") env.LD_LIBRARY_PATH = programDirectory;
|
|
555
|
+
return Object.assign(env, {
|
|
556
|
+
HOME: profile,
|
|
557
|
+
USERPROFILE: profile,
|
|
558
|
+
TMPDIR: profile,
|
|
559
|
+
TMP: profile,
|
|
560
|
+
TEMP: profile
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Run one native conversion and await bounded result transport.
|
|
565
|
+
* @param engine - Resolved native engine installation.
|
|
566
|
+
* @param options - Validated conversion limits.
|
|
567
|
+
* @param input - Private source path inside the conversion scratch directory.
|
|
568
|
+
* @param output - Private PDF path inside the conversion scratch directory.
|
|
569
|
+
* @param profile - Conversion-owned profile directory.
|
|
570
|
+
* @param fonts - Installed font files the helper may load.
|
|
571
|
+
* @param substitutions - Missing families and their selected installed substitutes.
|
|
572
|
+
* @param signal - Cancellation; it kills the helper and awaits its exit.
|
|
573
|
+
* @param operation - Validated output format, recalculation, and worksheet selection.
|
|
574
|
+
* @throws ConversionError for a reported conversion failure, and the abort reason for cancellation.
|
|
575
|
+
*/
|
|
576
|
+
async function runNative(engine, options, input, output, profile, fonts, substitutions, signal, operation = {
|
|
577
|
+
format: "pdf",
|
|
578
|
+
recalculate: false
|
|
579
|
+
}) {
|
|
580
|
+
signal.throwIfAborted();
|
|
581
|
+
await prepareNativeFontProfile(profile, substitutions);
|
|
582
|
+
signal.throwIfAborted();
|
|
583
|
+
const env = nativeEnvironment(profile, engine.programDirectory);
|
|
584
|
+
const child = spawn(engine.executable, [
|
|
585
|
+
"--program-directory",
|
|
586
|
+
engine.programDirectory,
|
|
587
|
+
"--input-path",
|
|
588
|
+
input,
|
|
589
|
+
"--output-path",
|
|
590
|
+
output,
|
|
591
|
+
"--profile-directory",
|
|
592
|
+
profile,
|
|
593
|
+
"--max-output-bytes",
|
|
594
|
+
String(options.maxOutputBytes),
|
|
595
|
+
"--max-image-resolution",
|
|
596
|
+
String(options.maxImageResolution),
|
|
597
|
+
"--format",
|
|
598
|
+
operation.format,
|
|
599
|
+
"--recalculate",
|
|
600
|
+
String(operation.recalculate),
|
|
601
|
+
...operation.sheet === void 0 ? [] : ["--sheet", operation.sheet],
|
|
602
|
+
...fonts.flatMap((path) => ["--font-file", path])
|
|
603
|
+
], {
|
|
604
|
+
stdio: [
|
|
605
|
+
"ignore",
|
|
606
|
+
"pipe",
|
|
607
|
+
"pipe"
|
|
608
|
+
],
|
|
609
|
+
windowsHide: true,
|
|
610
|
+
env
|
|
611
|
+
});
|
|
612
|
+
let stdout = "";
|
|
613
|
+
let stderr = "";
|
|
614
|
+
let failure;
|
|
615
|
+
const abort = () => {
|
|
616
|
+
failure ??= signal.reason;
|
|
617
|
+
child.kill("SIGKILL");
|
|
618
|
+
};
|
|
619
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
620
|
+
child.stdout.setEncoding("utf8");
|
|
621
|
+
child.stderr.setEncoding("utf8");
|
|
622
|
+
child.stdout.on("data", (chunk) => {
|
|
623
|
+
stdout += chunk;
|
|
624
|
+
if (stdout.length > 65536) {
|
|
625
|
+
failure ??= /* @__PURE__ */ new Error("LibreOffice helper exceeded its response limit.");
|
|
626
|
+
child.kill("SIGKILL");
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
child.stderr.on("data", (chunk) => {
|
|
630
|
+
stderr = (stderr + chunk).slice(-65536);
|
|
631
|
+
});
|
|
632
|
+
try {
|
|
633
|
+
const code = await new Promise((resolve, reject) => {
|
|
634
|
+
child.once("error", (error) => {
|
|
635
|
+
failure ??= error;
|
|
636
|
+
});
|
|
637
|
+
child.once("close", (code, signal) => {
|
|
638
|
+
if (signal === "SIGXFSZ") failure ??= new ConversionError("output-too-large", "LibreOffice exceeded its output file-size limit.");
|
|
639
|
+
if (failure) reject(failure);
|
|
640
|
+
else resolve(code);
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
signal.throwIfAborted();
|
|
644
|
+
let result;
|
|
645
|
+
try {
|
|
646
|
+
result = JSON.parse(stdout);
|
|
647
|
+
} catch (cause) {
|
|
648
|
+
throw new Error(`LibreOffice helper returned an invalid response (exit ${code}). ${stderr}`, { cause });
|
|
649
|
+
}
|
|
650
|
+
if (code !== 0 || result.ok !== true) throw new ConversionError(failureCode(result), `LibreOffice native conversion failed: ${result.error ?? stderr}`);
|
|
651
|
+
} finally {
|
|
652
|
+
signal.removeEventListener("abort", abort);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region lib/types/png.js
|
|
657
|
+
/** Portable PNG encoding over straight RGBA; browser and Node need no native image dependency. */
|
|
658
|
+
const crcTable = Uint32Array.from({ length: 256 }, (_, value) => {
|
|
659
|
+
for (let bit = 0; bit < 8; bit++) value = value & 1 ? 3988292384 ^ value >>> 1 : value >>> 1;
|
|
660
|
+
return value >>> 0;
|
|
661
|
+
});
|
|
662
|
+
function chunk(type, bytes) {
|
|
663
|
+
const output = new Uint8Array(bytes.length + 12);
|
|
664
|
+
const view = new DataView(output.buffer);
|
|
665
|
+
view.setUint32(0, bytes.length);
|
|
666
|
+
output.set(new TextEncoder().encode(type), 4);
|
|
667
|
+
output.set(bytes, 8);
|
|
668
|
+
let crc = 4294967295;
|
|
669
|
+
for (let i = 4; i < output.length - 4; i++) crc = crcTable[(crc ^ output[i]) & 255] ^ crc >>> 8;
|
|
670
|
+
view.setUint32(output.length - 4, (crc ^ 4294967295) >>> 0);
|
|
671
|
+
return output;
|
|
672
|
+
}
|
|
673
|
+
function encodePng(width, height, rgba) {
|
|
674
|
+
if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 1 || height < 1 || width * height > 16777216 || rgba.byteLength !== width * height * 4) throw new TypeError("Invalid PNG raster dimensions.");
|
|
675
|
+
const header = /* @__PURE__ */ new Uint8Array(13);
|
|
676
|
+
const view = new DataView(header.buffer);
|
|
677
|
+
view.setUint32(0, width);
|
|
678
|
+
view.setUint32(4, height);
|
|
679
|
+
header[8] = 8;
|
|
680
|
+
header[9] = 6;
|
|
681
|
+
const scanlines = new Uint8Array(height * (width * 4 + 1));
|
|
682
|
+
for (let y = 0; y < height; y++) {
|
|
683
|
+
const source = y * width * 4;
|
|
684
|
+
const target = y * (width * 4 + 1);
|
|
685
|
+
scanlines[target] = 1;
|
|
686
|
+
for (let x = 0; x < width * 4; x++) scanlines[target + 1 + x] = rgba[source + x] - (x < 4 ? 0 : rgba[source + x - 4]);
|
|
687
|
+
}
|
|
688
|
+
const chunks = [
|
|
689
|
+
new Uint8Array([
|
|
690
|
+
137,
|
|
691
|
+
80,
|
|
692
|
+
78,
|
|
693
|
+
71,
|
|
694
|
+
13,
|
|
695
|
+
10,
|
|
696
|
+
26,
|
|
697
|
+
10
|
|
698
|
+
]),
|
|
699
|
+
chunk("IHDR", header),
|
|
700
|
+
chunk("IDAT", zlibSync(scanlines, { level: 6 })),
|
|
701
|
+
chunk("IEND", /* @__PURE__ */ new Uint8Array())
|
|
702
|
+
];
|
|
703
|
+
const result = new Uint8Array(chunks.reduce((sum, value) => sum + value.length, 0));
|
|
704
|
+
let offset = 0;
|
|
705
|
+
for (const value of chunks) {
|
|
706
|
+
result.set(value, offset);
|
|
707
|
+
offset += value.length;
|
|
708
|
+
}
|
|
709
|
+
return result;
|
|
710
|
+
}
|
|
711
|
+
//#endregion
|
|
712
|
+
//#region lib/types/native-image-renderer.js
|
|
713
|
+
/** Direct native LibreOfficeKit/PDFium rasterization through one operation-owned helper. */
|
|
714
|
+
function failure(value, stderr) {
|
|
715
|
+
const result = value;
|
|
716
|
+
return new ConversionError(failureCode(result), `LibreOffice native rendering failed: ${result.error ?? stderr}`);
|
|
717
|
+
}
|
|
718
|
+
function plan(ready, request) {
|
|
719
|
+
const select = (pages) => ({
|
|
720
|
+
count: pages.length,
|
|
721
|
+
regions: selectedPages(request.pages, pages.length, request.maxPages).map((number) => {
|
|
722
|
+
const page = pages[number - 1];
|
|
723
|
+
return {
|
|
724
|
+
page,
|
|
725
|
+
number,
|
|
726
|
+
rectangle: {
|
|
727
|
+
x: 0,
|
|
728
|
+
y: 0,
|
|
729
|
+
width: page.width,
|
|
730
|
+
height: page.height
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
})
|
|
734
|
+
});
|
|
735
|
+
if (ready.documentType === "pdf" || ready.documentType === "presentation") {
|
|
736
|
+
const pages = ready.pages;
|
|
737
|
+
if (!Array.isArray(pages)) throw new ConversionError("invalid-document", "LibreOffice returned no page dimensions.");
|
|
738
|
+
return select(pages.map(({ width, height }, part) => {
|
|
739
|
+
if (!Number.isSafeInteger(width) || !Number.isSafeInteger(height) || width < 1 || height < 1) throw new ConversionError("invalid-document", "LibreOffice returned invalid page dimensions.");
|
|
740
|
+
return {
|
|
741
|
+
part,
|
|
742
|
+
x: 0,
|
|
743
|
+
y: 0,
|
|
744
|
+
width: width / 15,
|
|
745
|
+
height: height / 15
|
|
746
|
+
};
|
|
747
|
+
}));
|
|
748
|
+
}
|
|
749
|
+
if (ready.documentType === "text") {
|
|
750
|
+
if (typeof ready.writerRectangles !== "string") throw new ConversionError("invalid-document", "LibreOffice returned no Writer page rectangles.");
|
|
751
|
+
return select(writerPages(ready.writerRectangles));
|
|
752
|
+
}
|
|
753
|
+
const sheets = (ready.sheets ?? []).map(({ part, info, geometry }) => ({
|
|
754
|
+
part,
|
|
755
|
+
info: sheetPartInfo(info),
|
|
756
|
+
geometry: JSON.parse(geometry)
|
|
757
|
+
}));
|
|
758
|
+
const count = sheets.filter((sheet) => sheet.info.visible).length;
|
|
759
|
+
const chosen = request.sheet === void 0 ? sheets.filter((sheet) => sheet.info.visible) : sheets.filter((sheet) => sheet.info.name === request.sheet);
|
|
760
|
+
if (chosen.length === 0) throw new ConversionError("invalid-document", "The exact worksheet name does not exist or the workbook has no visible sheets.");
|
|
761
|
+
if (chosen.length > request.maxPages) throw new ConversionError("output-too-large", "Selected worksheet count exceeds maxPages; select a sheet or raise the limit.");
|
|
762
|
+
const scale = request.dpi / 96;
|
|
763
|
+
return {
|
|
764
|
+
count,
|
|
765
|
+
regions: chosen.map(({ part, info, geometry }) => {
|
|
766
|
+
const range = request.range === void 0 ? dataArea(info) : parseCellRange(request.range);
|
|
767
|
+
const rectangle = sheetRangeRectangle(geometry, range, scale);
|
|
768
|
+
return {
|
|
769
|
+
page: {
|
|
770
|
+
x: 0,
|
|
771
|
+
y: 0,
|
|
772
|
+
width: rectangle.x + rectangle.width,
|
|
773
|
+
height: rectangle.y + rectangle.height,
|
|
774
|
+
part
|
|
775
|
+
},
|
|
776
|
+
rectangle,
|
|
777
|
+
sheet: info.name,
|
|
778
|
+
range: rangeName(range),
|
|
779
|
+
rtl: Boolean(info.rtllayout)
|
|
780
|
+
};
|
|
781
|
+
})
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
/** Run one native image batch and write final PNGs only after each bounded paint succeeds. */
|
|
785
|
+
async function renderImagesWithNative(request) {
|
|
786
|
+
const { engine, options, inputPath, source, scratch, profile, fonts, substitutions, missingFonts, operation, signal } = request;
|
|
787
|
+
signal.throwIfAborted();
|
|
788
|
+
await mkdir(profile, { mode: 448 });
|
|
789
|
+
await prepareNativeFontProfile(profile, substitutions);
|
|
790
|
+
const child = spawn(engine.executable, [
|
|
791
|
+
"--operation",
|
|
792
|
+
"render-images",
|
|
793
|
+
"--program-directory",
|
|
794
|
+
engine.programDirectory,
|
|
795
|
+
"--input-path",
|
|
796
|
+
inputPath,
|
|
797
|
+
"--scratch-directory",
|
|
798
|
+
scratch,
|
|
799
|
+
"--profile-directory",
|
|
800
|
+
profile,
|
|
801
|
+
"--max-output-bytes",
|
|
802
|
+
String(options.maxOutputBytes),
|
|
803
|
+
"--max-image-resolution",
|
|
804
|
+
String(options.maxImageResolution),
|
|
805
|
+
...fonts.flatMap((path) => ["--font-file", path])
|
|
806
|
+
], {
|
|
807
|
+
stdio: [
|
|
808
|
+
"pipe",
|
|
809
|
+
"pipe",
|
|
810
|
+
"pipe"
|
|
811
|
+
],
|
|
812
|
+
windowsHide: true,
|
|
813
|
+
env: nativeEnvironment(profile, engine.programDirectory)
|
|
814
|
+
});
|
|
815
|
+
const lines = [];
|
|
816
|
+
const waiters = [];
|
|
817
|
+
const output = createInterface({ input: child.stdout });
|
|
818
|
+
output.on("line", (line) => {
|
|
819
|
+
const waiter = waiters.shift();
|
|
820
|
+
if (waiter) waiter(line);
|
|
821
|
+
else lines.push(line);
|
|
822
|
+
});
|
|
823
|
+
let stderr = "";
|
|
824
|
+
let stopped;
|
|
825
|
+
child.stderr.setEncoding("utf8");
|
|
826
|
+
child.stderr.on("data", (chunk) => {
|
|
827
|
+
stderr = (stderr + chunk).slice(-65536);
|
|
828
|
+
});
|
|
829
|
+
const closed = new Promise((resolve, reject) => {
|
|
830
|
+
child.once("error", reject);
|
|
831
|
+
child.once("close", resolve);
|
|
832
|
+
});
|
|
833
|
+
const abort = () => {
|
|
834
|
+
stopped ??= signal.reason;
|
|
835
|
+
child.kill("SIGKILL");
|
|
836
|
+
};
|
|
837
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
838
|
+
const next = async () => {
|
|
839
|
+
signal.throwIfAborted();
|
|
840
|
+
if (lines.length > 0) return lines.shift();
|
|
841
|
+
return new Promise((resolve, reject) => {
|
|
842
|
+
const done = (line) => {
|
|
843
|
+
signal.removeEventListener("abort", cancel);
|
|
844
|
+
resolve(line);
|
|
845
|
+
};
|
|
846
|
+
const cancel = () => {
|
|
847
|
+
const index = waiters.indexOf(done);
|
|
848
|
+
if (index >= 0) waiters.splice(index, 1);
|
|
849
|
+
reject(signal.reason);
|
|
850
|
+
};
|
|
851
|
+
signal.addEventListener("abort", cancel, { once: true });
|
|
852
|
+
waiters.push(done);
|
|
853
|
+
});
|
|
854
|
+
};
|
|
855
|
+
const response = async () => {
|
|
856
|
+
const line = await next();
|
|
857
|
+
let value;
|
|
858
|
+
try {
|
|
859
|
+
value = JSON.parse(line);
|
|
860
|
+
} catch (cause) {
|
|
861
|
+
throw new Error(`LibreOffice native renderer returned invalid JSON. ${stderr}`, { cause });
|
|
862
|
+
}
|
|
863
|
+
if (!value.ok) throw failure(value, stderr);
|
|
864
|
+
return value;
|
|
865
|
+
};
|
|
866
|
+
try {
|
|
867
|
+
const ready = await response();
|
|
868
|
+
if (ready.kind !== "ready") throw new Error("LibreOffice native renderer did not initialize.");
|
|
869
|
+
const planned = plan(ready, operation);
|
|
870
|
+
const scale = operation.dpi / 96;
|
|
871
|
+
const selected = [];
|
|
872
|
+
for (const region of planned.regions) if (region.sheet === void 0) selected.push(region);
|
|
873
|
+
else {
|
|
874
|
+
let rectangles;
|
|
875
|
+
try {
|
|
876
|
+
rectangles = splitRasterRectangle(region.rectangle, scale, {
|
|
877
|
+
maxPixels: operation.maxPixels,
|
|
878
|
+
maxDimension: operation.maxDimension,
|
|
879
|
+
maxTiles: operation.maxPages - selected.length
|
|
880
|
+
});
|
|
881
|
+
} catch (cause) {
|
|
882
|
+
throw new ConversionError("output-too-large", String(cause), { cause });
|
|
883
|
+
}
|
|
884
|
+
selected.push(...rectangles.map((rectangle) => ({
|
|
885
|
+
...region,
|
|
886
|
+
rectangle
|
|
887
|
+
})));
|
|
888
|
+
}
|
|
889
|
+
for (const { page, rectangle } of selected) {
|
|
890
|
+
const { width, height } = tileDimensions({
|
|
891
|
+
pageIndex: 0,
|
|
892
|
+
...rectangle,
|
|
893
|
+
scale
|
|
894
|
+
}, [page]);
|
|
895
|
+
if (width > operation.maxDimension || height > operation.maxDimension || width * height > operation.maxPixels) throw new ConversionError("output-too-large", "Selected page exceeds maxPixels or maxDimension; reduce DPI or raise the image limits.");
|
|
896
|
+
}
|
|
897
|
+
const images = [];
|
|
898
|
+
let total = 0;
|
|
899
|
+
for (const region of selected) {
|
|
900
|
+
signal.throwIfAborted();
|
|
901
|
+
const { width, height } = tileDimensions({
|
|
902
|
+
pageIndex: 0,
|
|
903
|
+
...region.rectangle,
|
|
904
|
+
scale
|
|
905
|
+
}, [region.page]);
|
|
906
|
+
const x = region.page.x + Math.round(region.rectangle.x * 15);
|
|
907
|
+
const y = region.page.y + Math.round(region.rectangle.y * 15);
|
|
908
|
+
const twipsWidth = Math.max(1, Math.round(region.rectangle.width * 15));
|
|
909
|
+
const twipsHeight = Math.max(1, Math.round(region.rectangle.height * 15));
|
|
910
|
+
const index = images.length + 1;
|
|
911
|
+
child.stdin.write(`P ${index} ${region.page.part} ${width} ${height} ${x} ${y} ${twipsWidth} ${twipsHeight}\n`);
|
|
912
|
+
const painted = await response();
|
|
913
|
+
if (painted.kind !== "paint" || painted.index !== index || painted.width !== width || painted.height !== height) throw new Error("LibreOffice native renderer returned inconsistent tile metadata.");
|
|
914
|
+
if (resolve(painted.path) !== resolve(scratch, `tile-${index}.rgba`)) throw new Error("LibreOffice native renderer returned a tile outside its scratch directory.");
|
|
915
|
+
const raw = await readFile(painted.path);
|
|
916
|
+
if (raw.byteLength !== width * height * 4) throw new Error("LibreOffice native renderer returned incomplete pixels.");
|
|
917
|
+
const png = encodePng(width, height, ready.documentType === "pdf" ? new Uint8ClampedArray(raw) : rgbaPixels(raw, ready.tileMode));
|
|
918
|
+
total += png.byteLength;
|
|
919
|
+
if (total > options.maxOutputBytes) throw new ConversionError("output-too-large", "PNG batch exceeds maxOutputBytes.");
|
|
920
|
+
const path = join(operation.outputDir, `page-${String(index).padStart(4, "0")}.png`);
|
|
921
|
+
await writeFile(path, png, {
|
|
922
|
+
flag: "wx",
|
|
923
|
+
mode: 384
|
|
924
|
+
});
|
|
925
|
+
images.push({
|
|
926
|
+
index,
|
|
927
|
+
...region.number === void 0 ? {} : { page: region.number },
|
|
928
|
+
...region.sheet === void 0 ? {} : {
|
|
929
|
+
sheet: region.sheet,
|
|
930
|
+
range: region.range,
|
|
931
|
+
rtl: region.rtl
|
|
932
|
+
},
|
|
933
|
+
path,
|
|
934
|
+
width,
|
|
935
|
+
height,
|
|
936
|
+
rectangle: region.rectangle,
|
|
937
|
+
byteLength: png.byteLength
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
child.stdin.end("DONE\n");
|
|
941
|
+
if ((await response()).kind !== "done") throw new Error("LibreOffice native renderer did not finish.");
|
|
942
|
+
const code = await closed;
|
|
943
|
+
if (code !== 0) throw new Error(`LibreOffice native renderer exited ${code}. ${stderr}`);
|
|
944
|
+
return {
|
|
945
|
+
schemaVersion: 1,
|
|
946
|
+
backend: "native",
|
|
947
|
+
rasterEngine: ready.documentType === "pdf" ? "pdfium" : "libreoffice",
|
|
948
|
+
source: "saved",
|
|
949
|
+
inputPath: operation.inputPath,
|
|
950
|
+
sourceSha256: createHash("sha256").update(source).digest("hex"),
|
|
951
|
+
dpi: operation.dpi,
|
|
952
|
+
pageCount: planned.count,
|
|
953
|
+
images,
|
|
954
|
+
missingFonts: [...missingFonts]
|
|
955
|
+
};
|
|
956
|
+
} finally {
|
|
957
|
+
signal.removeEventListener("abort", abort);
|
|
958
|
+
output.close();
|
|
959
|
+
if (child.exitCode === null) child.kill("SIGKILL");
|
|
960
|
+
await closed.catch(() => {});
|
|
961
|
+
if (stopped !== void 0) throw stopped;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region lib/types/fonts.js
|
|
966
|
+
/** Host font metadata snapshots and conversion-local glyph matching over original files. */
|
|
967
|
+
/**
|
|
968
|
+
* @param error - Thrown filesystem value.
|
|
969
|
+
* @returns whether it means the path is not a usable font source.
|
|
970
|
+
*/
|
|
971
|
+
function absent(error) {
|
|
972
|
+
return error instanceof Error && "code" in error && [
|
|
973
|
+
"ENOENT",
|
|
974
|
+
"EACCES",
|
|
975
|
+
"EPERM",
|
|
976
|
+
"ENOTDIR"
|
|
977
|
+
].includes(String(error.code));
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Discover system and per-user font roots using the selected platform's path separators.
|
|
981
|
+
* @param platform - Host operating system.
|
|
982
|
+
* @param home - Host user home used to locate per-user font directories.
|
|
983
|
+
* @param env - Host environment containing Windows and XDG directory overrides.
|
|
984
|
+
* @returns candidate directories; missing platform directories are ignored during indexing.
|
|
985
|
+
*/
|
|
986
|
+
function systemFontDirectories(platform = process.platform, home = homedir(), env = process.env) {
|
|
987
|
+
if (platform === "win32") return [win32.join(env.SystemRoot ?? "C:\\Windows", "Fonts"), win32.join(env.LOCALAPPDATA ?? win32.join(home, "AppData", "Local"), "Microsoft", "Windows", "Fonts")];
|
|
988
|
+
if (platform === "darwin") return [
|
|
989
|
+
"/System/Library/Fonts",
|
|
990
|
+
"/Library/Fonts",
|
|
991
|
+
posix.join(home, "Library/Fonts"),
|
|
992
|
+
...mobileAssetFontDirectories("/System/Library/AssetsV2")
|
|
993
|
+
];
|
|
994
|
+
const shared = (env.XDG_DATA_DIRS ?? "/usr/local/share:/usr/share").split(":").filter(Boolean);
|
|
995
|
+
return [.../* @__PURE__ */ new Set([
|
|
996
|
+
...shared.map((path) => posix.join(path, "fonts")),
|
|
997
|
+
posix.join(home, ".fonts"),
|
|
998
|
+
posix.join(env.XDG_DATA_HOME ?? posix.join(home, ".local/share"), "fonts")
|
|
999
|
+
])];
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Font asset directories macOS publishes under its MobileAsset root.
|
|
1003
|
+
* @param assets - Absolute MobileAsset font directory root.
|
|
1004
|
+
* @returns matching asset directories, sorted by name.
|
|
1005
|
+
* @throws when the root exists but cannot be read for a reason other than its absence or protection.
|
|
1006
|
+
*/
|
|
1007
|
+
function mobileAssetFontDirectories(assets) {
|
|
1008
|
+
let entries = [];
|
|
1009
|
+
try {
|
|
1010
|
+
entries = readdirSync(assets);
|
|
1011
|
+
} catch (error) {
|
|
1012
|
+
if (!absent(error)) throw error;
|
|
1013
|
+
}
|
|
1014
|
+
return entries.filter((name) => /^com_apple_MobileAsset_Font\d*$/.test(name)).sort().map((name) => join(assets, name));
|
|
1015
|
+
}
|
|
1016
|
+
//#endregion
|
|
1017
|
+
//#region lib/types/font-metadata-cache.js
|
|
1018
|
+
/** Resolve the platform's user-local cache, independently of font discovery. */
|
|
1019
|
+
function defaultFontMetadataCacheDirectory(platform = process.platform, home = homedir(), env = process.env) {
|
|
1020
|
+
if (platform === "darwin") return posix.join(home, "Library/Caches/libreoffice-kit");
|
|
1021
|
+
if (platform === "win32") return win32.join(env.LOCALAPPDATA ?? win32.join(home, "AppData/Local"), "libreoffice-kit/Cache");
|
|
1022
|
+
return posix.join(env.XDG_CACHE_HOME && posix.isAbsolute(env.XDG_CACHE_HOME) ? env.XDG_CACHE_HOME : posix.join(home, ".cache"), "libreoffice-kit");
|
|
1023
|
+
}
|
|
1024
|
+
//#endregion
|
|
1025
|
+
//#region lib/types/options.js
|
|
1026
|
+
const SANS_CJK_FAMILIES = [
|
|
1027
|
+
"Microsoft YaHei",
|
|
1028
|
+
"Microsoft YaHei UI",
|
|
1029
|
+
"微软雅黑",
|
|
1030
|
+
"PingFang SC",
|
|
1031
|
+
"Noto Sans CJK SC",
|
|
1032
|
+
"Noto Sans SC",
|
|
1033
|
+
"Source Han Sans SC",
|
|
1034
|
+
"SimHei",
|
|
1035
|
+
"黑体",
|
|
1036
|
+
"Heiti SC",
|
|
1037
|
+
"STHeiti"
|
|
1038
|
+
];
|
|
1039
|
+
/** Ordered family groups used when the caller supplies none. */
|
|
1040
|
+
const FONT_FALLBACKS = [
|
|
1041
|
+
["Calibri", "Carlito"],
|
|
1042
|
+
[
|
|
1043
|
+
"Calibri Light",
|
|
1044
|
+
"Carlito",
|
|
1045
|
+
"Calibri"
|
|
1046
|
+
],
|
|
1047
|
+
["Cambria", "Caladea"],
|
|
1048
|
+
[
|
|
1049
|
+
"宋体",
|
|
1050
|
+
"SimSun",
|
|
1051
|
+
"NSimSun",
|
|
1052
|
+
"Songti SC",
|
|
1053
|
+
"STSong",
|
|
1054
|
+
"Noto Serif CJK SC",
|
|
1055
|
+
"Noto Serif SC",
|
|
1056
|
+
"Source Han Serif SC"
|
|
1057
|
+
],
|
|
1058
|
+
[
|
|
1059
|
+
"黑体",
|
|
1060
|
+
"SimHei",
|
|
1061
|
+
"Heiti SC",
|
|
1062
|
+
"STHeiti",
|
|
1063
|
+
"Noto Sans CJK SC",
|
|
1064
|
+
"Noto Sans SC",
|
|
1065
|
+
"Source Han Sans SC"
|
|
1066
|
+
],
|
|
1067
|
+
[
|
|
1068
|
+
"微软雅黑",
|
|
1069
|
+
"Microsoft YaHei",
|
|
1070
|
+
"Microsoft YaHei UI",
|
|
1071
|
+
"PingFang SC",
|
|
1072
|
+
"Noto Sans CJK SC",
|
|
1073
|
+
"Noto Sans SC"
|
|
1074
|
+
],
|
|
1075
|
+
[
|
|
1076
|
+
"楷体",
|
|
1077
|
+
"KaiTi",
|
|
1078
|
+
"Kaiti SC",
|
|
1079
|
+
"STKaiti",
|
|
1080
|
+
"LXGW WenKai"
|
|
1081
|
+
],
|
|
1082
|
+
[
|
|
1083
|
+
"仿宋",
|
|
1084
|
+
"FangSong",
|
|
1085
|
+
"STFangsong",
|
|
1086
|
+
"Songti SC",
|
|
1087
|
+
"Noto Serif CJK SC"
|
|
1088
|
+
],
|
|
1089
|
+
[
|
|
1090
|
+
"sans-serif",
|
|
1091
|
+
"Arial",
|
|
1092
|
+
"Liberation Sans",
|
|
1093
|
+
"Helvetica",
|
|
1094
|
+
"DejaVu Sans",
|
|
1095
|
+
"Calibri",
|
|
1096
|
+
"Calibri Light",
|
|
1097
|
+
"Carlito",
|
|
1098
|
+
...SANS_CJK_FAMILIES
|
|
1099
|
+
],
|
|
1100
|
+
[
|
|
1101
|
+
"serif",
|
|
1102
|
+
"Times New Roman",
|
|
1103
|
+
"Liberation Serif",
|
|
1104
|
+
"Times",
|
|
1105
|
+
"DejaVu Serif",
|
|
1106
|
+
"Cambria",
|
|
1107
|
+
"Caladea",
|
|
1108
|
+
"SimSun",
|
|
1109
|
+
"NSimSun",
|
|
1110
|
+
"宋体",
|
|
1111
|
+
"Songti SC",
|
|
1112
|
+
"STSong",
|
|
1113
|
+
"Noto Serif CJK SC",
|
|
1114
|
+
"Noto Serif SC",
|
|
1115
|
+
"Source Han Serif SC"
|
|
1116
|
+
],
|
|
1117
|
+
[
|
|
1118
|
+
"monospace",
|
|
1119
|
+
"Courier New",
|
|
1120
|
+
"Liberation Mono",
|
|
1121
|
+
"DejaVu Sans Mono",
|
|
1122
|
+
"Menlo",
|
|
1123
|
+
"Monaco",
|
|
1124
|
+
"Courier",
|
|
1125
|
+
"NSimSun",
|
|
1126
|
+
"Noto Sans Mono CJK SC",
|
|
1127
|
+
...SANS_CJK_FAMILIES
|
|
1128
|
+
],
|
|
1129
|
+
[
|
|
1130
|
+
"Symbol",
|
|
1131
|
+
"Standard Symbols PS",
|
|
1132
|
+
"Symbola",
|
|
1133
|
+
"Segoe UI Symbol",
|
|
1134
|
+
"Apple Symbols",
|
|
1135
|
+
"FreeSerif",
|
|
1136
|
+
"DejaVu Sans"
|
|
1137
|
+
]
|
|
1138
|
+
];
|
|
1139
|
+
const DEFAULT_LIMITS = {
|
|
1140
|
+
timeoutMs: 12e4,
|
|
1141
|
+
maxInputBytes: 67108864,
|
|
1142
|
+
maxOutputBytes: 134217728,
|
|
1143
|
+
maxImageResolution: 144,
|
|
1144
|
+
maxArchiveEntries: 2e4,
|
|
1145
|
+
maxUncompressedBytes: 536870912,
|
|
1146
|
+
maxFontFiles: 2e4,
|
|
1147
|
+
maxFontFileBytes: 268435456,
|
|
1148
|
+
maxLoadedFontBytes: 536870912,
|
|
1149
|
+
maxFontResolutionEntries: 4096,
|
|
1150
|
+
maxFontMetadataCacheBytes: 33554432
|
|
1151
|
+
};
|
|
1152
|
+
const FONT_COLLECTION_NAMES = ["fontDirectories", "initialFontFamilies"];
|
|
1153
|
+
function positiveSafeInteger(value, name) {
|
|
1154
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1) throw new RangeError(`${name} must be a positive safe integer.`);
|
|
1155
|
+
if (name.endsWith("Ms") && value > 2147483647) throw new RangeError(`${name} exceeds the Node timer range.`);
|
|
1156
|
+
return value;
|
|
1157
|
+
}
|
|
1158
|
+
function fontNames(value, name) {
|
|
1159
|
+
if (!Array.isArray(value)) throw new TypeError(`${name} must contain nonempty strings.`);
|
|
1160
|
+
const names = [];
|
|
1161
|
+
for (const entry of value) {
|
|
1162
|
+
if (typeof entry !== "string" || entry.length === 0 || entry.includes("\0")) throw new TypeError(`${name} must contain nonempty strings.`);
|
|
1163
|
+
names.push(entry);
|
|
1164
|
+
}
|
|
1165
|
+
return names;
|
|
1166
|
+
}
|
|
1167
|
+
function fontGroups(value) {
|
|
1168
|
+
if (!Array.isArray(value) || value.some((group) => !Array.isArray(group) || group.length < 2 || group.some((entry) => typeof entry !== "string" || !entry.trim()))) throw new TypeError("fontFallbacks must contain groups of at least two nonblank font names.");
|
|
1169
|
+
return value.map((group) => [...group]);
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Resolve defaults once; reject misspelled options and malformed font settings.
|
|
1173
|
+
* @param input - Caller options; absent fields keep their documented default.
|
|
1174
|
+
* @returns The validated limits and font settings, with caller arrays copied.
|
|
1175
|
+
* @throws TypeError for a non-object argument or an unknown option name.
|
|
1176
|
+
* @throws RangeError for a limit outside the positive safe-integer timer range.
|
|
1177
|
+
*/
|
|
1178
|
+
function resolveOptions(input = {}) {
|
|
1179
|
+
const callerOptions = input;
|
|
1180
|
+
if (callerOptions === null || typeof callerOptions !== "object" || Array.isArray(callerOptions)) throw new TypeError("Converter options must be an object.");
|
|
1181
|
+
const merged = {
|
|
1182
|
+
...DEFAULT_LIMITS,
|
|
1183
|
+
fontDirectories: systemFontDirectories(),
|
|
1184
|
+
fontFallbacks: FONT_FALLBACKS,
|
|
1185
|
+
initialFontFamilies: [],
|
|
1186
|
+
...input
|
|
1187
|
+
};
|
|
1188
|
+
for (const key of Object.keys(input)) if (!(key in DEFAULT_LIMITS) && !FONT_COLLECTION_NAMES.includes(key) && key !== "fontFallbacks" && key !== "fontMetadataCacheDirectory") throw new TypeError(`Unknown converter option: ${key}`);
|
|
1189
|
+
const cacheDirectory = input.fontMetadataCacheDirectory === void 0 ? defaultFontMetadataCacheDirectory() : input.fontMetadataCacheDirectory;
|
|
1190
|
+
if (cacheDirectory !== false && (typeof cacheDirectory !== "string" || !isAbsolute(cacheDirectory) || cacheDirectory.includes("\0"))) throw new TypeError("fontMetadataCacheDirectory must be an absolute path or false.");
|
|
1191
|
+
return {
|
|
1192
|
+
fontMetadataCacheDirectory: cacheDirectory,
|
|
1193
|
+
maxFontMetadataCacheBytes: positiveSafeInteger(merged.maxFontMetadataCacheBytes, "maxFontMetadataCacheBytes"),
|
|
1194
|
+
timeoutMs: positiveSafeInteger(merged.timeoutMs, "timeoutMs"),
|
|
1195
|
+
maxInputBytes: positiveSafeInteger(merged.maxInputBytes, "maxInputBytes"),
|
|
1196
|
+
maxOutputBytes: positiveSafeInteger(merged.maxOutputBytes, "maxOutputBytes"),
|
|
1197
|
+
maxImageResolution: positiveSafeInteger(merged.maxImageResolution, "maxImageResolution"),
|
|
1198
|
+
maxArchiveEntries: positiveSafeInteger(merged.maxArchiveEntries, "maxArchiveEntries"),
|
|
1199
|
+
maxUncompressedBytes: positiveSafeInteger(merged.maxUncompressedBytes, "maxUncompressedBytes"),
|
|
1200
|
+
maxFontFiles: positiveSafeInteger(merged.maxFontFiles, "maxFontFiles"),
|
|
1201
|
+
maxFontFileBytes: positiveSafeInteger(merged.maxFontFileBytes, "maxFontFileBytes"),
|
|
1202
|
+
maxLoadedFontBytes: positiveSafeInteger(merged.maxLoadedFontBytes, "maxLoadedFontBytes"),
|
|
1203
|
+
maxFontResolutionEntries: positiveSafeInteger(merged.maxFontResolutionEntries, "maxFontResolutionEntries"),
|
|
1204
|
+
fontDirectories: fontNames(merged.fontDirectories, "fontDirectories"),
|
|
1205
|
+
includeOfficeFonts: input.fontDirectories === void 0,
|
|
1206
|
+
initialFontFamilies: fontNames(merged.initialFontFamilies, "initialFontFamilies"),
|
|
1207
|
+
fontFallbacks: fontGroups(merged.fontFallbacks)
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region lib/types/engine.js
|
|
1212
|
+
/** Resolve installed, version-matched engine packages without downloads or compilation. */
|
|
1213
|
+
const require = createRequire(import.meta.url);
|
|
1214
|
+
/**
|
|
1215
|
+
* Engine-family version every installed engine package must carry. The engine
|
|
1216
|
+
* family shares its release version with this Node API.
|
|
1217
|
+
*/
|
|
1218
|
+
const ENGINE_VERSION = "0.1.1";
|
|
1219
|
+
/** npm scope and name prefix shared by the engine packages this adapter installs. */
|
|
1220
|
+
const ENGINE_PREFIX = "@deepseek-ai/libreoffice-kit";
|
|
1221
|
+
/**
|
|
1222
|
+
* Whether an installed engine package directory is present on the resolution path.
|
|
1223
|
+
* @param name - Engine package name.
|
|
1224
|
+
* @returns true when at least one resolution directory holds the package.
|
|
1225
|
+
*/
|
|
1226
|
+
function installedPackageExists(name) {
|
|
1227
|
+
return (require.resolve.paths(name) ?? []).some((directory) => lstatSync(join(directory, name), { throwIfNoEntry: false }) !== void 0);
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Return the optional package target for the current process ABI.
|
|
1231
|
+
* @param platform - Host operating system.
|
|
1232
|
+
* @param arch - Host CPU architecture.
|
|
1233
|
+
* @param report - Host diagnostic report used to identify glibc.
|
|
1234
|
+
* @returns the declared platform target, or undefined for an unsupported host.
|
|
1235
|
+
*/
|
|
1236
|
+
function platformTarget(platform = process.platform, arch = process.arch, report = hostReport) {
|
|
1237
|
+
if (!["arm64", "x64"].includes(arch)) return void 0;
|
|
1238
|
+
if (platform === "darwin" || platform === "win32") return `${platform}-${arch}`;
|
|
1239
|
+
if (platform !== "linux") return void 0;
|
|
1240
|
+
return report().header?.glibcVersionRuntime ? `linux-${arch}-glibc` : void 0;
|
|
1241
|
+
}
|
|
1242
|
+
/** @returns the host diagnostic report as the engine resolver reads it. */
|
|
1243
|
+
function hostReport() {
|
|
1244
|
+
return process.report.getReport();
|
|
1245
|
+
}
|
|
1246
|
+
function asset(root, value) {
|
|
1247
|
+
if (typeof value !== "string" || !value || isAbsolute(value)) throw new Error("Engine manifest contains an invalid asset path.");
|
|
1248
|
+
const path = resolve(root, value);
|
|
1249
|
+
if (relative(root, path).startsWith(`..${sep}`) || relative(root, path) === "..") throw new Error("Engine asset escapes its installed package.");
|
|
1250
|
+
return path;
|
|
1251
|
+
}
|
|
1252
|
+
function glibcVersion(value) {
|
|
1253
|
+
return typeof value === "string" && /^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?$/.test(value) && value.split(".").every((part) => Number.isSafeInteger(Number(part))) ? value.split(".").map(Number) : void 0;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* macOS and Windows require their native engine. Linux uses WASM when no compatible development native engine is installed.
|
|
1257
|
+
* @param resolvePackage - Package manifest resolver; injectable for selection tests.
|
|
1258
|
+
* @param packageExists - Installed-package probe; injectable for selection tests.
|
|
1259
|
+
* @param host - Process identification and diagnostic report.
|
|
1260
|
+
* @returns the installed native engine, or the installed WASM engine.
|
|
1261
|
+
*/
|
|
1262
|
+
async function resolveEngine(resolvePackage = (name) => require.resolve(`${name}/package.json`), packageExists = installedPackageExists, { platform = process.platform, arch = process.arch, report = hostReport } = {}) {
|
|
1263
|
+
const details = platform === "linux" ? report() : {};
|
|
1264
|
+
const target = platformTarget(platform, arch, () => details);
|
|
1265
|
+
if (target !== void 0) {
|
|
1266
|
+
const name = `${ENGINE_PREFIX}-${target}`;
|
|
1267
|
+
let packageFile;
|
|
1268
|
+
try {
|
|
1269
|
+
packageFile = resolvePackage(name);
|
|
1270
|
+
} catch (error) {
|
|
1271
|
+
const failure = error;
|
|
1272
|
+
if (!(failure?.code === "MODULE_NOT_FOUND" && typeof failure.message === "string" && failure.message.includes(`${name}/package.json`))) throw error;
|
|
1273
|
+
if (packageExists(name)) throw new Error(`Installed LibreOfficeKit package is incomplete: ${name}`, { cause: error });
|
|
1274
|
+
if (platform !== "linux") throw new Error(`Required LibreOfficeKit native package is missing: ${name}`, { cause: error });
|
|
1275
|
+
}
|
|
1276
|
+
if (packageFile !== void 0) {
|
|
1277
|
+
const engine = await readEngine(packageFile, "native", target);
|
|
1278
|
+
const minimum = glibcVersion(engine.glibcMinimum);
|
|
1279
|
+
const host = glibcVersion(details.header?.glibcVersionRuntime);
|
|
1280
|
+
if (!(minimum && host && minimum.some((part, index) => part > (host[index] ?? 0) && minimum.slice(0, index).every((prior, priorIndex) => prior === host[priorIndex])))) return engine;
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
if (platform !== "linux") throw new Error(`Unsupported LibreOfficeKit host: ${platform}-${arch}`);
|
|
1284
|
+
return readEngine(resolvePackage(`${ENGINE_PREFIX}-wasm`), "wasm", "wasm");
|
|
1285
|
+
}
|
|
1286
|
+
async function engineAsset(root, value, name, kind) {
|
|
1287
|
+
const path = asset(root, value);
|
|
1288
|
+
const status = await stat(path);
|
|
1289
|
+
if (kind === "directory" ? !status.isDirectory() : !status.isFile()) throw new Error(`Installed LibreOfficeKit ${name} is not a ${kind}.`);
|
|
1290
|
+
if (name === "executable" && process.platform !== "win32" && !(status.mode & 73)) throw new Error("Installed LibreOfficeKit executable is not executable.");
|
|
1291
|
+
return path;
|
|
1292
|
+
}
|
|
1293
|
+
async function readEngine(packageFile, backend, target) {
|
|
1294
|
+
const root = dirname(packageFile);
|
|
1295
|
+
const [pkg, manifest] = await Promise.all([readFile(packageFile, "utf8").then((text) => JSON.parse(text)), readFile(resolve(root, "prebuilds.json"), "utf8").then((text) => JSON.parse(text))]);
|
|
1296
|
+
const engine = manifest.engine;
|
|
1297
|
+
if (pkg.name !== `${ENGINE_PREFIX}-${target}` || pkg.version !== "0.1.1" || manifest.version !== pkg.version || manifest.schemaVersion !== 1 || manifest.status !== "built" || engine === void 0 || engine.kind !== backend || manifest.platform !== target) throw new Error(`Installed LibreOfficeKit ${backend} package has an incompatible or incomplete manifest.`);
|
|
1298
|
+
const minimum = engine.glibcMinimum;
|
|
1299
|
+
if (minimum !== void 0 && (!target.endsWith("-glibc") || !glibcVersion(minimum))) throw new Error("Installed LibreOfficeKit engine has an invalid glibcMinimum.");
|
|
1300
|
+
const glibcFloor = minimum === void 0 ? {} : { glibcMinimum: minimum };
|
|
1301
|
+
if (backend === "native") {
|
|
1302
|
+
const executable = await engineAsset(root, engine.executable, "executable", "file");
|
|
1303
|
+
return {
|
|
1304
|
+
backend,
|
|
1305
|
+
root,
|
|
1306
|
+
programDirectory: await engineAsset(root, engine.programDirectory, "programDirectory", "directory"),
|
|
1307
|
+
executable,
|
|
1308
|
+
...glibcFloor
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
return {
|
|
1312
|
+
backend,
|
|
1313
|
+
root,
|
|
1314
|
+
programDirectory: String(engine.programDirectory),
|
|
1315
|
+
loader: await engineAsset(root, engine.loader, "loader", "file"),
|
|
1316
|
+
wasm: await engineAsset(root, engine.wasm, "wasm", "file"),
|
|
1317
|
+
data: await engineAsset(root, engine.data, "data", "file"),
|
|
1318
|
+
metadata: await engineAsset(root, engine.metadata, "metadata", "file"),
|
|
1319
|
+
...glibcFloor
|
|
1320
|
+
};
|
|
1321
|
+
}
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region lib/types/operations.js
|
|
1324
|
+
/** Validated document operations shared by the public API, workers, and CLI. */
|
|
1325
|
+
/** Conversions supported by the bundled Writer, Calc, and Impress components. */
|
|
1326
|
+
const CONVERSION_FORMATS = [
|
|
1327
|
+
{
|
|
1328
|
+
inputs: [
|
|
1329
|
+
"doc",
|
|
1330
|
+
"docx",
|
|
1331
|
+
"odt"
|
|
1332
|
+
],
|
|
1333
|
+
outputs: [
|
|
1334
|
+
"pdf",
|
|
1335
|
+
"docx",
|
|
1336
|
+
"odt",
|
|
1337
|
+
"txt"
|
|
1338
|
+
]
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
inputs: [
|
|
1342
|
+
"xls",
|
|
1343
|
+
"xlsx",
|
|
1344
|
+
"ods"
|
|
1345
|
+
],
|
|
1346
|
+
outputs: [
|
|
1347
|
+
"pdf",
|
|
1348
|
+
"xlsx",
|
|
1349
|
+
"ods",
|
|
1350
|
+
"csv"
|
|
1351
|
+
]
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
inputs: [
|
|
1355
|
+
"ppt",
|
|
1356
|
+
"pptx",
|
|
1357
|
+
"odp"
|
|
1358
|
+
],
|
|
1359
|
+
outputs: [
|
|
1360
|
+
"pdf",
|
|
1361
|
+
"pptx",
|
|
1362
|
+
"odp"
|
|
1363
|
+
]
|
|
1364
|
+
}
|
|
1365
|
+
];
|
|
1366
|
+
/**
|
|
1367
|
+
* Validate paths and the format matrix before file access or queue admission.
|
|
1368
|
+
* @param request - Public conversion parameters.
|
|
1369
|
+
* @param operation - PDF compatibility entry, general conversion, or workbook recalculation.
|
|
1370
|
+
* @returns The explicit engine operation.
|
|
1371
|
+
*/
|
|
1372
|
+
function resolveConversion(request, operation) {
|
|
1373
|
+
if (!request || typeof request.inputPath !== "string" || typeof request.outputPath !== "string" || !isAbsolute(request.inputPath) || !isAbsolute(request.outputPath) || request.inputPath.includes("\0") || request.outputPath.includes("\0")) throw new TypeError("inputPath and outputPath must be absolute filesystem paths.");
|
|
1374
|
+
if (resolve(request.inputPath) === resolve(request.outputPath)) throw new TypeError("Input and output paths must differ.");
|
|
1375
|
+
const extension = extname(request.inputPath).slice(1).toLowerCase();
|
|
1376
|
+
const format = operation === "render" ? "pdf" : extname(request.outputPath).slice(1).toLowerCase();
|
|
1377
|
+
const family = CONVERSION_FORMATS.find((group) => group.inputs.includes(extension));
|
|
1378
|
+
if (!family || !family.outputs.includes(format)) throw new ConversionError("unsupported-format", `Unsupported conversion: ${extension || "(no input extension)"} → ${format || "(no output extension)"}.`);
|
|
1379
|
+
if (operation === "recalculate" && (![
|
|
1380
|
+
"xls",
|
|
1381
|
+
"xlsx",
|
|
1382
|
+
"ods"
|
|
1383
|
+
].includes(extension) || !["xlsx", "ods"].includes(format))) throw new ConversionError("unsupported-format", "Recalculation requires XLS, XLSX, or ODS input and XLSX or ODS output.");
|
|
1384
|
+
if (request.sheet !== void 0 && (format !== "csv" || typeof request.sheet !== "string" || !request.sheet.trim() || request.sheet.includes("\0"))) throw new TypeError("sheet must be a nonempty exact worksheet name and is supported only for CSV output.");
|
|
1385
|
+
return {
|
|
1386
|
+
inputPath: request.inputPath,
|
|
1387
|
+
outputPath: request.outputPath,
|
|
1388
|
+
extension,
|
|
1389
|
+
format,
|
|
1390
|
+
recalculate: operation === "recalculate",
|
|
1391
|
+
...request.sheet === void 0 ? {} : { sheet: request.sheet }
|
|
1392
|
+
};
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Reject an engine output with an incorrect container signature.
|
|
1396
|
+
* @param bytes - Complete bounded output.
|
|
1397
|
+
* @param format - Requested output suffix.
|
|
1398
|
+
*/
|
|
1399
|
+
function validateOutput(bytes, format) {
|
|
1400
|
+
if (format === "pdf" && new TextDecoder().decode(bytes.subarray(0, 5)) !== "%PDF-") throw new ConversionError("invalid-output", "LibreOffice did not produce a PDF.");
|
|
1401
|
+
if ([
|
|
1402
|
+
"docx",
|
|
1403
|
+
"xlsx",
|
|
1404
|
+
"pptx",
|
|
1405
|
+
"odt",
|
|
1406
|
+
"ods",
|
|
1407
|
+
"odp"
|
|
1408
|
+
].includes(format) && (bytes[0] !== 80 || bytes[1] !== 75 || bytes[2] !== 3 || bytes[3] !== 4)) throw new ConversionError("invalid-output", `LibreOffice did not produce a ${format} archive.`);
|
|
1409
|
+
}
|
|
1410
|
+
//#endregion
|
|
1411
|
+
//#region lib/types/runtime.js
|
|
1412
|
+
/** Offline discovery of the installed engine and public entry points. */
|
|
1413
|
+
/**
|
|
1414
|
+
* Inspect installed engine metadata without starting, downloading, or building an engine.
|
|
1415
|
+
* @returns Public entry paths, engine version, and selected backend.
|
|
1416
|
+
* @throws ConversionError when the installed engine is unavailable or invalid.
|
|
1417
|
+
*/
|
|
1418
|
+
async function discoverRuntime() {
|
|
1419
|
+
try {
|
|
1420
|
+
const engine = await resolveEngine();
|
|
1421
|
+
return {
|
|
1422
|
+
version: ENGINE_VERSION,
|
|
1423
|
+
backend: engine.backend,
|
|
1424
|
+
cliPath: fileURLToPath(new URL("./cli.js", import.meta.url)),
|
|
1425
|
+
nodeApiPath: fileURLToPath(new URL("./index.js", import.meta.url))
|
|
1426
|
+
};
|
|
1427
|
+
} catch (cause) {
|
|
1428
|
+
throw new ConversionError("unavailable", cause.message, { cause });
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
//#endregion
|
|
1432
|
+
//#region lib/types/font-snapshot-state.js
|
|
1433
|
+
/** Shared in-flight metadata work with independent cancellation and joined Worker cleanup. */
|
|
1434
|
+
/** Run one scan outside the event loop and join it before returning or cleaning its temporary file. */
|
|
1435
|
+
async function runFontSnapshot(options, previous, signal) {
|
|
1436
|
+
signal.throwIfAborted();
|
|
1437
|
+
const temporaryPath = options.fontMetadataCacheDirectory === false ? void 0 : join(options.fontMetadataCacheDirectory, `.font-metadata-${randomUUID()}.tmp`);
|
|
1438
|
+
const data = {
|
|
1439
|
+
options,
|
|
1440
|
+
previous,
|
|
1441
|
+
...temporaryPath === void 0 ? {} : { temporaryPath }
|
|
1442
|
+
};
|
|
1443
|
+
const worker = new Worker(new URL("./font-snapshot-worker.js", import.meta.url), {
|
|
1444
|
+
workerData: data,
|
|
1445
|
+
execArgv: [],
|
|
1446
|
+
name: "libreoffice-font-metadata",
|
|
1447
|
+
stdout: true,
|
|
1448
|
+
stderr: true
|
|
1449
|
+
});
|
|
1450
|
+
worker.stdout.resume();
|
|
1451
|
+
worker.stderr.resume();
|
|
1452
|
+
const result = Promise.withResolvers();
|
|
1453
|
+
const abort = () => result.reject(signal.reason);
|
|
1454
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1455
|
+
worker.once("error", result.reject);
|
|
1456
|
+
worker.once("exit", (code) => result.reject(new ConversionError("failed", `Font metadata worker exited before returning a snapshot (${code}).`)));
|
|
1457
|
+
worker.once("message", (message) => {
|
|
1458
|
+
if (message.ok) result.resolve(message.snapshot);
|
|
1459
|
+
else result.reject(new ConversionError(failureCode(message), message.error));
|
|
1460
|
+
});
|
|
1461
|
+
try {
|
|
1462
|
+
return await result.promise;
|
|
1463
|
+
} finally {
|
|
1464
|
+
signal.removeEventListener("abort", abort);
|
|
1465
|
+
await worker.terminate();
|
|
1466
|
+
if (temporaryPath !== void 0) try {
|
|
1467
|
+
await rm(temporaryPath, { force: true });
|
|
1468
|
+
} catch {}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
/** Each acquisition refreshes inventory; overlapping acquisitions share only the active scan. */
|
|
1472
|
+
var FontSnapshotState = class {
|
|
1473
|
+
previous = [];
|
|
1474
|
+
scan;
|
|
1475
|
+
/** Revalidate files for an operation without coupling its cancellation to other waiters. */
|
|
1476
|
+
async acquire(options, signal) {
|
|
1477
|
+
signal.throwIfAborted();
|
|
1478
|
+
while (this.scan?.controller.signal.aborted) {
|
|
1479
|
+
await this.scan.promise.catch(() => {});
|
|
1480
|
+
signal.throwIfAborted();
|
|
1481
|
+
}
|
|
1482
|
+
if (this.scan === void 0) {
|
|
1483
|
+
const controller = new AbortController();
|
|
1484
|
+
const promise = runFontSnapshot(options, this.previous, controller.signal).then((snapshot) => {
|
|
1485
|
+
this.previous = Buffer.byteLength(JSON.stringify(snapshot.records)) <= options.maxFontMetadataCacheBytes ? snapshot.records : [];
|
|
1486
|
+
return snapshot;
|
|
1487
|
+
}).finally(() => {
|
|
1488
|
+
this.scan = void 0;
|
|
1489
|
+
});
|
|
1490
|
+
this.scan = {
|
|
1491
|
+
controller,
|
|
1492
|
+
promise,
|
|
1493
|
+
waiters: 0
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
const scan = this.scan;
|
|
1497
|
+
scan.waiters++;
|
|
1498
|
+
const cancelled = Promise.withResolvers();
|
|
1499
|
+
const abort = () => cancelled.reject(signal.reason);
|
|
1500
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1501
|
+
try {
|
|
1502
|
+
return await Promise.race([scan.promise, cancelled.promise]);
|
|
1503
|
+
} finally {
|
|
1504
|
+
signal.removeEventListener("abort", abort);
|
|
1505
|
+
scan.waiters--;
|
|
1506
|
+
if (scan.waiters === 0 && this.scan === scan) {
|
|
1507
|
+
scan.controller.abort(/* @__PURE__ */ new Error("All font scan waiters stopped."));
|
|
1508
|
+
await scan.promise.catch(() => {});
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
/** Release completed metadata after the owning factory has joined its operations. */
|
|
1513
|
+
clear() {
|
|
1514
|
+
this.previous = [];
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
//#endregion
|
|
1518
|
+
//#region lib/types/font-snapshot-validation.js
|
|
1519
|
+
/** Verify the operation's source versions before publishing its output. */
|
|
1520
|
+
/** Reject changed, removed, or replaced sources without exposing local font paths. */
|
|
1521
|
+
async function validateFontSnapshot(snapshot) {
|
|
1522
|
+
await Promise.all(snapshot.records.map(async (record) => {
|
|
1523
|
+
try {
|
|
1524
|
+
const current = await lstat(record.path);
|
|
1525
|
+
if (current.isFile() && [
|
|
1526
|
+
"dev",
|
|
1527
|
+
"ino",
|
|
1528
|
+
"size",
|
|
1529
|
+
"mtimeMs",
|
|
1530
|
+
"ctimeMs"
|
|
1531
|
+
].every((key) => current[key] === record[key])) return;
|
|
1532
|
+
} catch {}
|
|
1533
|
+
throw new ConversionError("failed", "A system font changed during conversion; retry the operation.");
|
|
1534
|
+
}));
|
|
1535
|
+
}
|
|
1536
|
+
//#endregion
|
|
1537
|
+
//#region lib/types/index.js
|
|
1538
|
+
/** Convert caller-authorized disk documents with installed native or Node WASM engines. */
|
|
1539
|
+
/** File identity that must match across a bounded read. */
|
|
1540
|
+
const CHANGED_KEYS = [
|
|
1541
|
+
"size",
|
|
1542
|
+
"mtimeMs",
|
|
1543
|
+
"ctimeMs"
|
|
1544
|
+
];
|
|
1545
|
+
async function readBounded(path, limit, signal, role) {
|
|
1546
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NONBLOCK | constants.O_NOFOLLOW);
|
|
1547
|
+
try {
|
|
1548
|
+
const before = await file.stat();
|
|
1549
|
+
const invalid = role === "input" ? "invalid-document" : "invalid-output";
|
|
1550
|
+
if (!before.isFile() || role === "input" && before.size < 1) throw new ConversionError(invalid, "Document must be a nonempty regular file.");
|
|
1551
|
+
if (before.size > limit) throw new ConversionError(`${role}-too-large`, `Document exceeds its ${role} byte limit.`);
|
|
1552
|
+
const bytes = Buffer.alloc(before.size);
|
|
1553
|
+
for (let offset = 0; offset < bytes.length;) {
|
|
1554
|
+
signal.throwIfAborted();
|
|
1555
|
+
const { bytesRead } = await file.read(bytes, offset, bytes.length - offset, offset);
|
|
1556
|
+
if (!bytesRead) throw new ConversionError(invalid, "Document was truncated while reading.");
|
|
1557
|
+
offset += bytesRead;
|
|
1558
|
+
}
|
|
1559
|
+
const after = await file.stat();
|
|
1560
|
+
if (CHANGED_KEYS.some((key) => before[key] !== after[key])) throw new ConversionError(invalid, "Document changed while reading.");
|
|
1561
|
+
signal.throwIfAborted();
|
|
1562
|
+
return bytes;
|
|
1563
|
+
} finally {
|
|
1564
|
+
await file.close();
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
async function runWorker(data, signal, onFontCache) {
|
|
1568
|
+
signal.throwIfAborted();
|
|
1569
|
+
const worker = new Worker(new URL("./worker.js", import.meta.url), {
|
|
1570
|
+
workerData: data,
|
|
1571
|
+
name: "libreoffice-conversion",
|
|
1572
|
+
execArgv: [],
|
|
1573
|
+
stdout: true,
|
|
1574
|
+
stderr: true
|
|
1575
|
+
});
|
|
1576
|
+
worker.stdout.resume();
|
|
1577
|
+
worker.stderr.resume();
|
|
1578
|
+
const settled = Promise.withResolvers();
|
|
1579
|
+
const abort = () => {
|
|
1580
|
+
settled.reject(signal.reason);
|
|
1581
|
+
};
|
|
1582
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1583
|
+
worker.once("error", settled.reject);
|
|
1584
|
+
worker.once("exit", (code) => {
|
|
1585
|
+
settled.reject(new ConversionError("failed", `LibreOffice worker exited before returning a result (${code}).`));
|
|
1586
|
+
});
|
|
1587
|
+
worker.on("message", (message) => {
|
|
1588
|
+
if (message.kind === "font-cache") onFontCache(message.entries);
|
|
1589
|
+
else if (message.ok) settled.resolve(message);
|
|
1590
|
+
else settled.reject(new ConversionError(failureCode(message), message.error));
|
|
1591
|
+
});
|
|
1592
|
+
try {
|
|
1593
|
+
return await settled.promise;
|
|
1594
|
+
} finally {
|
|
1595
|
+
signal.removeEventListener("abort", abort);
|
|
1596
|
+
await worker.terminate();
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
const DEFAULT_SHARED_STATE_LIMIT = 16;
|
|
1600
|
+
const defaultSharedStates = /* @__PURE__ */ new Map();
|
|
1601
|
+
function sharedStateKey(options, engine) {
|
|
1602
|
+
return JSON.stringify({
|
|
1603
|
+
engine,
|
|
1604
|
+
fontDirectories: options.fontDirectories,
|
|
1605
|
+
includeOfficeFonts: options.includeOfficeFonts,
|
|
1606
|
+
fontFallbacks: options.fontFallbacks,
|
|
1607
|
+
initialFontFamilies: options.initialFontFamilies,
|
|
1608
|
+
maxFontFiles: options.maxFontFiles,
|
|
1609
|
+
maxFontFileBytes: options.maxFontFileBytes,
|
|
1610
|
+
maxLoadedFontBytes: options.maxLoadedFontBytes,
|
|
1611
|
+
maxFontResolutionEntries: options.maxFontResolutionEntries,
|
|
1612
|
+
fontMetadataCacheDirectory: options.fontMetadataCacheDirectory,
|
|
1613
|
+
maxFontMetadataCacheBytes: options.maxFontMetadataCacheBytes
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
function defaultSharedState(options, engine) {
|
|
1617
|
+
const key = sharedStateKey(options, engine);
|
|
1618
|
+
const existing = defaultSharedStates.get(key);
|
|
1619
|
+
if (existing !== void 0) {
|
|
1620
|
+
defaultSharedStates.delete(key);
|
|
1621
|
+
defaultSharedStates.set(key, existing);
|
|
1622
|
+
return existing;
|
|
1623
|
+
}
|
|
1624
|
+
const state = {
|
|
1625
|
+
snapshots: new FontSnapshotState(),
|
|
1626
|
+
generation: void 0,
|
|
1627
|
+
fontCache: /* @__PURE__ */ new Map()
|
|
1628
|
+
};
|
|
1629
|
+
defaultSharedStates.set(key, state);
|
|
1630
|
+
while (defaultSharedStates.size > DEFAULT_SHARED_STATE_LIMIT) defaultSharedStates.delete(defaultSharedStates.keys().next().value);
|
|
1631
|
+
return state;
|
|
1632
|
+
}
|
|
1633
|
+
async function resolveConverter(options) {
|
|
1634
|
+
const resolvedOptions = resolveOptions(options);
|
|
1635
|
+
let engine;
|
|
1636
|
+
try {
|
|
1637
|
+
engine = await resolveEngine();
|
|
1638
|
+
} catch (cause) {
|
|
1639
|
+
throw new ConversionError("unavailable", cause.message, { cause });
|
|
1640
|
+
}
|
|
1641
|
+
return {
|
|
1642
|
+
options: resolvedOptions,
|
|
1643
|
+
engine
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
function createConverterWith(resolvedOptions, engine, shared, onDispose) {
|
|
1647
|
+
const lifetime = new AbortController();
|
|
1648
|
+
const active = /* @__PURE__ */ new Set();
|
|
1649
|
+
const waiting = /* @__PURE__ */ new Set();
|
|
1650
|
+
let running = false;
|
|
1651
|
+
let disposal;
|
|
1652
|
+
const mergeCache = (generation, entries) => {
|
|
1653
|
+
if (shared.generation !== generation) return;
|
|
1654
|
+
for (const entry of entries) {
|
|
1655
|
+
const prior = shared.fontCache.get(entry.key);
|
|
1656
|
+
const faces = new Map((prior?.faces ?? []).map((face) => [`${face.path}\0${face.faceIndex}`, face]));
|
|
1657
|
+
for (const face of entry.faces) faces.set(`${face.path}\0${face.faceIndex}`, face);
|
|
1658
|
+
const merged = {
|
|
1659
|
+
...entry,
|
|
1660
|
+
codePoints: [.../* @__PURE__ */ new Set([...prior?.codePoints ?? [], ...entry.codePoints])].sort((left, right) => left - right),
|
|
1661
|
+
emptyRequest: prior?.emptyRequest === true || entry.emptyRequest,
|
|
1662
|
+
faces: [...faces.values()],
|
|
1663
|
+
...(prior?.missingFamily ?? entry.missingFamily) === void 0 ? {} : { missingFamily: prior?.missingFamily ?? entry.missingFamily }
|
|
1664
|
+
};
|
|
1665
|
+
shared.fontCache.delete(entry.key);
|
|
1666
|
+
shared.fontCache.set(entry.key, merged);
|
|
1667
|
+
}
|
|
1668
|
+
while (shared.fontCache.size > resolvedOptions.maxFontResolutionEntries) shared.fontCache.delete(shared.fontCache.keys().next().value);
|
|
1669
|
+
};
|
|
1670
|
+
async function snapshot(signal) {
|
|
1671
|
+
const current = await shared.snapshots.acquire(resolvedOptions, signal);
|
|
1672
|
+
if (shared.generation !== current.generation) {
|
|
1673
|
+
shared.generation = current.generation;
|
|
1674
|
+
shared.fontCache.clear();
|
|
1675
|
+
}
|
|
1676
|
+
return current;
|
|
1677
|
+
}
|
|
1678
|
+
async function acquire(signal) {
|
|
1679
|
+
while (running) {
|
|
1680
|
+
signal.throwIfAborted();
|
|
1681
|
+
await new Promise((resolve, reject) => {
|
|
1682
|
+
const cleanup = () => {
|
|
1683
|
+
waiting.delete(wake);
|
|
1684
|
+
signal.removeEventListener("abort", abort);
|
|
1685
|
+
};
|
|
1686
|
+
const wake = () => {
|
|
1687
|
+
cleanup();
|
|
1688
|
+
resolve();
|
|
1689
|
+
};
|
|
1690
|
+
const abort = () => {
|
|
1691
|
+
cleanup();
|
|
1692
|
+
reject(signal.reason);
|
|
1693
|
+
};
|
|
1694
|
+
waiting.add(wake);
|
|
1695
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
signal.throwIfAborted();
|
|
1699
|
+
running = true;
|
|
1700
|
+
}
|
|
1701
|
+
async function execute(request, signal) {
|
|
1702
|
+
const { extension, format } = request;
|
|
1703
|
+
await acquire(signal);
|
|
1704
|
+
const deadline = new AbortController();
|
|
1705
|
+
const stopped = AbortSignal.any([signal, deadline.signal]);
|
|
1706
|
+
const timer = setTimeout(() => {
|
|
1707
|
+
deadline.abort(new ConversionError("timeout", "LibreOffice conversion timed out."));
|
|
1708
|
+
}, resolvedOptions.timeoutMs);
|
|
1709
|
+
let scratch;
|
|
1710
|
+
let output;
|
|
1711
|
+
let succeeded = false;
|
|
1712
|
+
let failure;
|
|
1713
|
+
try {
|
|
1714
|
+
stopped.throwIfAborted();
|
|
1715
|
+
output = await open(request.outputPath, "wx", 384);
|
|
1716
|
+
const sourceBytes = await readBounded(request.inputPath, resolvedOptions.maxInputBytes, stopped, "input");
|
|
1717
|
+
scratch = await mkdtemp(join(tmpdir(), "libreoffice-kit-"));
|
|
1718
|
+
const inputPath = join(scratch, `document.${extension}`);
|
|
1719
|
+
const input = await open(inputPath, "wx", 384);
|
|
1720
|
+
try {
|
|
1721
|
+
await input.writeFile(sourceBytes);
|
|
1722
|
+
} finally {
|
|
1723
|
+
await input.close();
|
|
1724
|
+
}
|
|
1725
|
+
const fonts = await snapshot(stopped);
|
|
1726
|
+
const result = await runWorker({
|
|
1727
|
+
inputPath,
|
|
1728
|
+
extension,
|
|
1729
|
+
operation: request,
|
|
1730
|
+
options: resolvedOptions,
|
|
1731
|
+
engine,
|
|
1732
|
+
scratch,
|
|
1733
|
+
fontFaces: fonts.faces,
|
|
1734
|
+
fontCache: [...shared.fontCache.values()]
|
|
1735
|
+
}, stopped, (entries) => mergeCache(fonts.generation, entries));
|
|
1736
|
+
if ("images" in result) throw new ConversionError("failed", "Conversion worker returned an image batch for an export request.");
|
|
1737
|
+
let bytes;
|
|
1738
|
+
if ("output" in result) bytes = result.output;
|
|
1739
|
+
else {
|
|
1740
|
+
const native = engine;
|
|
1741
|
+
const profile = join(scratch, "profile");
|
|
1742
|
+
await mkdir(profile, { mode: 448 });
|
|
1743
|
+
const path = join(scratch, `output.${format}`);
|
|
1744
|
+
await runNative(native, resolvedOptions, inputPath, path, profile, result.fonts, result.substitutions, stopped, request);
|
|
1745
|
+
bytes = await readBounded(path, resolvedOptions.maxOutputBytes, stopped, "output");
|
|
1746
|
+
}
|
|
1747
|
+
validateOutput(bytes, format);
|
|
1748
|
+
await validateFontSnapshot(fonts);
|
|
1749
|
+
stopped.throwIfAborted();
|
|
1750
|
+
await output.writeFile(bytes);
|
|
1751
|
+
stopped.throwIfAborted();
|
|
1752
|
+
succeeded = true;
|
|
1753
|
+
return {
|
|
1754
|
+
backend: engine.backend,
|
|
1755
|
+
missingFonts: result.missingFonts
|
|
1756
|
+
};
|
|
1757
|
+
} catch (error) {
|
|
1758
|
+
failure = error;
|
|
1759
|
+
throw error;
|
|
1760
|
+
} finally {
|
|
1761
|
+
clearTimeout(timer);
|
|
1762
|
+
try {
|
|
1763
|
+
const errors = [];
|
|
1764
|
+
try {
|
|
1765
|
+
await output?.close();
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
errors.push(error);
|
|
1768
|
+
}
|
|
1769
|
+
const cleanup = await Promise.allSettled([...output && !succeeded ? [unlink(request.outputPath)] : [], ...scratch ? [rm(scratch, {
|
|
1770
|
+
recursive: true,
|
|
1771
|
+
force: true
|
|
1772
|
+
})] : []]);
|
|
1773
|
+
for (const result of cleanup) if (result.status === "rejected") errors.push(result.reason);
|
|
1774
|
+
if (errors.length) throw new AggregateError(failure ? [failure, ...errors] : errors, "LibreOffice conversion cleanup failed.");
|
|
1775
|
+
} finally {
|
|
1776
|
+
running = false;
|
|
1777
|
+
for (const wake of [...waiting]) wake();
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
async function executeImages(request, signal) {
|
|
1782
|
+
await acquire(signal);
|
|
1783
|
+
const deadline = new AbortController();
|
|
1784
|
+
const stopped = AbortSignal.any([signal, deadline.signal]);
|
|
1785
|
+
const timer = setTimeout(() => deadline.abort(new ConversionError("timeout", "LibreOffice image rendering timed out.")), resolvedOptions.timeoutMs);
|
|
1786
|
+
let scratch;
|
|
1787
|
+
let owned = false;
|
|
1788
|
+
let succeeded = false;
|
|
1789
|
+
try {
|
|
1790
|
+
stopped.throwIfAborted();
|
|
1791
|
+
await mkdir(request.outputDir, { mode: 448 });
|
|
1792
|
+
owned = true;
|
|
1793
|
+
const source = await readBounded(request.inputPath, resolvedOptions.maxInputBytes, stopped, "input");
|
|
1794
|
+
scratch = await mkdtemp(join(tmpdir(), "libreoffice-kit-images-"));
|
|
1795
|
+
const inputPath = join(scratch, `document.${request.extension}`);
|
|
1796
|
+
await writeFile(inputPath, source, {
|
|
1797
|
+
flag: "wx",
|
|
1798
|
+
mode: 384
|
|
1799
|
+
});
|
|
1800
|
+
const fonts = await snapshot(stopped);
|
|
1801
|
+
const result = await runWorker({
|
|
1802
|
+
inputPath,
|
|
1803
|
+
extension: request.extension,
|
|
1804
|
+
operation: request,
|
|
1805
|
+
options: resolvedOptions,
|
|
1806
|
+
engine,
|
|
1807
|
+
scratch,
|
|
1808
|
+
fontFaces: fonts.faces,
|
|
1809
|
+
fontCache: [...shared.fontCache.values()]
|
|
1810
|
+
}, stopped, (entries) => mergeCache(fonts.generation, entries));
|
|
1811
|
+
let images;
|
|
1812
|
+
if ("images" in result) images = result.images;
|
|
1813
|
+
else if ("fonts" in result) {
|
|
1814
|
+
const profile = join(scratch, "profile");
|
|
1815
|
+
images = await renderImagesWithNative({
|
|
1816
|
+
engine,
|
|
1817
|
+
options: resolvedOptions,
|
|
1818
|
+
inputPath,
|
|
1819
|
+
source,
|
|
1820
|
+
scratch,
|
|
1821
|
+
profile,
|
|
1822
|
+
fonts: result.fonts,
|
|
1823
|
+
substitutions: result.substitutions,
|
|
1824
|
+
missingFonts: result.missingFonts,
|
|
1825
|
+
operation: request,
|
|
1826
|
+
signal: stopped
|
|
1827
|
+
});
|
|
1828
|
+
} else throw new ConversionError("failed", "Image worker did not return its manifest.");
|
|
1829
|
+
await validateFontSnapshot(fonts);
|
|
1830
|
+
stopped.throwIfAborted();
|
|
1831
|
+
await writeFile(join(request.outputDir, "manifest.json"), `${JSON.stringify(images, null, 2)}\n`, {
|
|
1832
|
+
flag: "wx",
|
|
1833
|
+
mode: 384
|
|
1834
|
+
});
|
|
1835
|
+
stopped.throwIfAborted();
|
|
1836
|
+
succeeded = true;
|
|
1837
|
+
return images;
|
|
1838
|
+
} finally {
|
|
1839
|
+
clearTimeout(timer);
|
|
1840
|
+
try {
|
|
1841
|
+
const failures = (await Promise.allSettled([...scratch ? [rm(scratch, {
|
|
1842
|
+
recursive: true,
|
|
1843
|
+
force: true
|
|
1844
|
+
})] : [], ...owned && !succeeded ? [rm(request.outputDir, {
|
|
1845
|
+
recursive: true,
|
|
1846
|
+
force: true
|
|
1847
|
+
})] : []])).filter((result) => result.status === "rejected");
|
|
1848
|
+
if (failures.length) throw new AggregateError(failures.map((result) => result.reason), "Image batch cleanup failed.");
|
|
1849
|
+
} finally {
|
|
1850
|
+
running = false;
|
|
1851
|
+
for (const wake of [...waiting]) wake();
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
async function submit(request, operation, signal) {
|
|
1856
|
+
const task = execute(resolveConversion(request, operation), signal ? AbortSignal.any([signal, lifetime.signal]) : lifetime.signal);
|
|
1857
|
+
active.add(task);
|
|
1858
|
+
task.finally(() => {
|
|
1859
|
+
active.delete(task);
|
|
1860
|
+
}).catch((_error) => {});
|
|
1861
|
+
return task;
|
|
1862
|
+
}
|
|
1863
|
+
const converter = {
|
|
1864
|
+
backend: engine.backend,
|
|
1865
|
+
render: (request, signal) => submit(request, "render", signal),
|
|
1866
|
+
async renderImages(request, signal) {
|
|
1867
|
+
const task = executeImages(resolveImageRender(request), signal ? AbortSignal.any([signal, lifetime.signal]) : lifetime.signal);
|
|
1868
|
+
active.add(task);
|
|
1869
|
+
task.finally(() => active.delete(task)).catch(() => {});
|
|
1870
|
+
return task;
|
|
1871
|
+
},
|
|
1872
|
+
convert: (request, signal) => submit(request, "convert", signal),
|
|
1873
|
+
recalculate: (request, signal) => submit(request, "recalculate", signal),
|
|
1874
|
+
dispose() {
|
|
1875
|
+
disposal ??= (async () => {
|
|
1876
|
+
lifetime.abort(/* @__PURE__ */ new Error("LibreOffice converter is disposed."));
|
|
1877
|
+
await Promise.allSettled(active);
|
|
1878
|
+
onDispose?.(converter);
|
|
1879
|
+
})();
|
|
1880
|
+
return disposal;
|
|
1881
|
+
}
|
|
1882
|
+
};
|
|
1883
|
+
return converter;
|
|
1884
|
+
}
|
|
1885
|
+
/** Create one converter with process-shared, configuration-isolated bounded font metadata. */
|
|
1886
|
+
async function createConverter(options) {
|
|
1887
|
+
const { options: resolvedOptions, engine } = await resolveConverter(options);
|
|
1888
|
+
return createConverterWith(resolvedOptions, engine, defaultSharedState(resolvedOptions, engine));
|
|
1889
|
+
}
|
|
1890
|
+
//#endregion
|
|
1891
|
+
//#region lib/types/cli.js
|
|
1892
|
+
/** Offline CLI over the public converter; stdout contains one JSON result. */
|
|
1893
|
+
const numericOptions = {
|
|
1894
|
+
"timeout-ms": "timeoutMs",
|
|
1895
|
+
"max-input-bytes": "maxInputBytes",
|
|
1896
|
+
"max-output-bytes": "maxOutputBytes",
|
|
1897
|
+
"max-image-resolution": "maxImageResolution",
|
|
1898
|
+
"max-archive-entries": "maxArchiveEntries",
|
|
1899
|
+
"max-uncompressed-bytes": "maxUncompressedBytes",
|
|
1900
|
+
"max-font-files": "maxFontFiles",
|
|
1901
|
+
"max-font-file-bytes": "maxFontFileBytes",
|
|
1902
|
+
"max-loaded-font-bytes": "maxLoadedFontBytes"
|
|
1903
|
+
};
|
|
1904
|
+
async function main() {
|
|
1905
|
+
const { values, positionals } = parseArgs({
|
|
1906
|
+
allowPositionals: true,
|
|
1907
|
+
strict: true,
|
|
1908
|
+
options: {
|
|
1909
|
+
json: { type: "boolean" },
|
|
1910
|
+
input: { type: "string" },
|
|
1911
|
+
output: { type: "string" },
|
|
1912
|
+
sheet: { type: "string" },
|
|
1913
|
+
"font-directory": {
|
|
1914
|
+
type: "string",
|
|
1915
|
+
multiple: true
|
|
1916
|
+
},
|
|
1917
|
+
"initial-font-family": {
|
|
1918
|
+
type: "string",
|
|
1919
|
+
multiple: true
|
|
1920
|
+
},
|
|
1921
|
+
"font-fallbacks": { type: "string" },
|
|
1922
|
+
"output-dir": { type: "string" },
|
|
1923
|
+
pages: { type: "string" },
|
|
1924
|
+
range: { type: "string" },
|
|
1925
|
+
dpi: { type: "string" },
|
|
1926
|
+
"max-pages": { type: "string" },
|
|
1927
|
+
"max-pixels": { type: "string" },
|
|
1928
|
+
"max-dimension": { type: "string" },
|
|
1929
|
+
...Object.fromEntries(Object.keys(numericOptions).map((key) => [key, { type: "string" }]))
|
|
1930
|
+
}
|
|
1931
|
+
});
|
|
1932
|
+
const command = positionals[0] ?? "";
|
|
1933
|
+
if (positionals.length !== 1 || ![
|
|
1934
|
+
"capabilities",
|
|
1935
|
+
"convert",
|
|
1936
|
+
"recalculate",
|
|
1937
|
+
"render"
|
|
1938
|
+
].includes(command)) throw new TypeError("Usage: libreoffice-kit capabilities --json | render --input <file> --output-dir <fresh-directory> [--pages all|1,3] [--sheet <name> --range A1:D20] [--dpi 144] | convert --input <file> --output <file> [--sheet <name>] | recalculate --input <workbook> --output <xlsx|ods>");
|
|
1939
|
+
if (command === "capabilities") {
|
|
1940
|
+
if (Object.keys(values).some((key) => key !== "json")) throw new TypeError("capabilities accepts only --json.");
|
|
1941
|
+
process.stdout.write(`${JSON.stringify({
|
|
1942
|
+
runtime: await discoverRuntime(),
|
|
1943
|
+
conversions: CONVERSION_FORMATS,
|
|
1944
|
+
imageRendering: {
|
|
1945
|
+
inputs: IMAGE_FORMATS,
|
|
1946
|
+
output: "png",
|
|
1947
|
+
officeBackend: "libreoffice",
|
|
1948
|
+
pdfBackend: "pdfium",
|
|
1949
|
+
pages: "one-based physical pages or slides; all by default",
|
|
1950
|
+
worksheets: "exact sheet plus optional A1 range; all visible data areas by default",
|
|
1951
|
+
maxPages: 100,
|
|
1952
|
+
maxPixels: 16777216,
|
|
1953
|
+
maxDimension: 8192
|
|
1954
|
+
},
|
|
1955
|
+
csv: {
|
|
1956
|
+
sheet: "exact name; required when the input has multiple worksheets",
|
|
1957
|
+
encoding: "UTF-8",
|
|
1958
|
+
delimiter: ","
|
|
1959
|
+
},
|
|
1960
|
+
recalculation: {
|
|
1961
|
+
inputs: [
|
|
1962
|
+
"xls",
|
|
1963
|
+
"xlsx",
|
|
1964
|
+
"ods"
|
|
1965
|
+
],
|
|
1966
|
+
outputs: ["xlsx", "ods"],
|
|
1967
|
+
preservesFormulas: true
|
|
1968
|
+
},
|
|
1969
|
+
options: {
|
|
1970
|
+
limits: Object.keys(numericOptions),
|
|
1971
|
+
fonts: [
|
|
1972
|
+
"font-directory",
|
|
1973
|
+
"initial-font-family",
|
|
1974
|
+
"font-fallbacks"
|
|
1975
|
+
]
|
|
1976
|
+
}
|
|
1977
|
+
})}\n`);
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
if (typeof values.input !== "string") throw new TypeError("--input is required.");
|
|
1981
|
+
if (command === "render") {
|
|
1982
|
+
if (typeof values["output-dir"] !== "string" || values.output !== void 0) throw new TypeError("render requires --output-dir and does not accept --output.");
|
|
1983
|
+
} else {
|
|
1984
|
+
if (typeof values.output !== "string") throw new TypeError("--input and --output are required.");
|
|
1985
|
+
if ([
|
|
1986
|
+
"output-dir",
|
|
1987
|
+
"pages",
|
|
1988
|
+
"range",
|
|
1989
|
+
"dpi",
|
|
1990
|
+
"max-pages",
|
|
1991
|
+
"max-pixels",
|
|
1992
|
+
"max-dimension"
|
|
1993
|
+
].some((key) => key in values)) throw new TypeError("Image selection options require the render command.");
|
|
1994
|
+
}
|
|
1995
|
+
const options = {};
|
|
1996
|
+
for (const [flag, key] of Object.entries(numericOptions)) {
|
|
1997
|
+
const value = values[flag];
|
|
1998
|
+
if (value !== void 0) {
|
|
1999
|
+
if (typeof value !== "string" || !/^\d+$/.test(value)) throw new TypeError(`--${flag} must be a positive integer.`);
|
|
2000
|
+
options[key] = Number(value);
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
if (values["font-directory"]) options.fontDirectories = values["font-directory"].map((path) => resolve(path));
|
|
2004
|
+
if (values["initial-font-family"]) options.initialFontFamilies = values["initial-font-family"];
|
|
2005
|
+
if (values["font-fallbacks"]) options.fontFallbacks = JSON.parse(values["font-fallbacks"]);
|
|
2006
|
+
const request = {
|
|
2007
|
+
inputPath: resolve(values.input),
|
|
2008
|
+
outputPath: typeof values.output === "string" ? resolve(values.output) : "",
|
|
2009
|
+
...values.sheet === void 0 ? {} : { sheet: values.sheet }
|
|
2010
|
+
};
|
|
2011
|
+
if (command === "recalculate" && request.sheet !== void 0) throw new TypeError("--sheet is supported only for CSV conversion.");
|
|
2012
|
+
const converter = await createConverter(options);
|
|
2013
|
+
const controller = new AbortController();
|
|
2014
|
+
const cancel = () => {
|
|
2015
|
+
controller.abort(/* @__PURE__ */ new Error("LibreOffice CLI was cancelled."));
|
|
2016
|
+
};
|
|
2017
|
+
process.once("SIGINT", cancel);
|
|
2018
|
+
process.once("SIGTERM", cancel);
|
|
2019
|
+
try {
|
|
2020
|
+
if (command === "render") {
|
|
2021
|
+
const pageText = values.pages;
|
|
2022
|
+
if (pageText !== void 0 && pageText !== "all" && !/^[1-9]\d*(?:,[1-9]\d*)*$/.test(pageText)) throw new TypeError("--pages must be all or comma-separated one-based page numbers.");
|
|
2023
|
+
const result = await converter.renderImages({
|
|
2024
|
+
inputPath: request.inputPath,
|
|
2025
|
+
outputDir: resolve(values["output-dir"]),
|
|
2026
|
+
...pageText === void 0 ? {} : { pages: pageText === "all" ? "all" : pageText.split(",").map(Number) },
|
|
2027
|
+
...request.sheet === void 0 ? {} : { sheet: request.sheet },
|
|
2028
|
+
...values.range === void 0 ? {} : { range: values.range },
|
|
2029
|
+
...values.dpi === void 0 ? {} : { dpi: Number(values.dpi) },
|
|
2030
|
+
...values["max-pages"] === void 0 ? {} : { maxPages: Number(values["max-pages"]) },
|
|
2031
|
+
...values["max-pixels"] === void 0 ? {} : { maxPixels: Number(values["max-pixels"]) },
|
|
2032
|
+
...values["max-dimension"] === void 0 ? {} : { maxDimension: Number(values["max-dimension"]) }
|
|
2033
|
+
}, controller.signal);
|
|
2034
|
+
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2037
|
+
const result = command === "recalculate" ? await converter.recalculate(request, controller.signal) : await converter.convert(request, controller.signal);
|
|
2038
|
+
process.stdout.write(`${JSON.stringify({
|
|
2039
|
+
...result,
|
|
2040
|
+
outputPath: request.outputPath
|
|
2041
|
+
})}\n`);
|
|
2042
|
+
} finally {
|
|
2043
|
+
process.removeListener("SIGINT", cancel);
|
|
2044
|
+
process.removeListener("SIGTERM", cancel);
|
|
2045
|
+
await converter.dispose();
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
try {
|
|
2049
|
+
await main();
|
|
2050
|
+
} catch (error) {
|
|
2051
|
+
process.stderr.write(`${JSON.stringify({
|
|
2052
|
+
code: failureCode(error),
|
|
2053
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2054
|
+
})}\n`);
|
|
2055
|
+
process.exitCode = 1;
|
|
2056
|
+
}
|
|
2057
|
+
//#endregion
|
|
2058
|
+
export {};
|