local-cli-agent 5.0.4
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/LICENSE +21 -0
- package/README.md +306 -0
- package/dist/agents/base/base-agent.d.ts +38 -0
- package/dist/agents/base/base-agent.d.ts.map +1 -0
- package/dist/agents/base/base-agent.js +69 -0
- package/dist/agents/base/base-agent.js.map +1 -0
- package/dist/agents/browser/browser-profile-manager.d.ts +16 -0
- package/dist/agents/browser/browser-profile-manager.d.ts.map +1 -0
- package/dist/agents/browser/browser-profile-manager.js +149 -0
- package/dist/agents/browser/browser-profile-manager.js.map +1 -0
- package/dist/agents/browser/browser-sub-agent.d.ts +22 -0
- package/dist/agents/browser/browser-sub-agent.d.ts.map +1 -0
- package/dist/agents/browser/browser-sub-agent.js +162 -0
- package/dist/agents/browser/browser-sub-agent.js.map +1 -0
- package/dist/agents/browser/confluence-agent.d.ts +3 -0
- package/dist/agents/browser/confluence-agent.d.ts.map +1 -0
- package/dist/agents/browser/confluence-agent.js +35 -0
- package/dist/agents/browser/confluence-agent.js.map +1 -0
- package/dist/agents/browser/index.d.ts +4 -0
- package/dist/agents/browser/index.d.ts.map +1 -0
- package/dist/agents/browser/index.js +4 -0
- package/dist/agents/browser/index.js.map +1 -0
- package/dist/agents/browser/jira-agent.d.ts +3 -0
- package/dist/agents/browser/jira-agent.d.ts.map +1 -0
- package/dist/agents/browser/jira-agent.js +35 -0
- package/dist/agents/browser/jira-agent.js.map +1 -0
- package/dist/agents/browser/prompts.d.ts +4 -0
- package/dist/agents/browser/prompts.d.ts.map +1 -0
- package/dist/agents/browser/prompts.js +241 -0
- package/dist/agents/browser/prompts.js.map +1 -0
- package/dist/agents/browser/search-agent.d.ts +3 -0
- package/dist/agents/browser/search-agent.d.ts.map +1 -0
- package/dist/agents/browser/search-agent.js +31 -0
- package/dist/agents/browser/search-agent.js.map +1 -0
- package/dist/agents/common/complete-tool.d.ts +3 -0
- package/dist/agents/common/complete-tool.d.ts.map +1 -0
- package/dist/agents/common/complete-tool.js +18 -0
- package/dist/agents/common/complete-tool.js.map +1 -0
- package/dist/agents/common/index.d.ts +3 -0
- package/dist/agents/common/index.d.ts.map +1 -0
- package/dist/agents/common/index.js +3 -0
- package/dist/agents/common/index.js.map +1 -0
- package/dist/agents/common/sub-agent.d.ts +40 -0
- package/dist/agents/common/sub-agent.d.ts.map +1 -0
- package/dist/agents/common/sub-agent.js +313 -0
- package/dist/agents/common/sub-agent.js.map +1 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/office/complete-tool.d.ts +3 -0
- package/dist/agents/office/complete-tool.d.ts.map +1 -0
- package/dist/agents/office/complete-tool.js +18 -0
- package/dist/agents/office/complete-tool.js.map +1 -0
- package/dist/agents/office/excel-agent.d.ts +3 -0
- package/dist/agents/office/excel-agent.d.ts.map +1 -0
- package/dist/agents/office/excel-agent.js +31 -0
- package/dist/agents/office/excel-agent.js.map +1 -0
- package/dist/agents/office/excel-create-agent.d.ts +3 -0
- package/dist/agents/office/excel-create-agent.d.ts.map +1 -0
- package/dist/agents/office/excel-create-agent.js +58 -0
- package/dist/agents/office/excel-create-agent.js.map +1 -0
- package/dist/agents/office/excel-create-prompts.d.ts +4 -0
- package/dist/agents/office/excel-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/excel-create-prompts.js +217 -0
- package/dist/agents/office/excel-create-prompts.js.map +1 -0
- package/dist/agents/office/index.d.ts +10 -0
- package/dist/agents/office/index.d.ts.map +1 -0
- package/dist/agents/office/index.js +10 -0
- package/dist/agents/office/index.js.map +1 -0
- package/dist/agents/office/office-sub-agent.d.ts +21 -0
- package/dist/agents/office/office-sub-agent.d.ts.map +1 -0
- package/dist/agents/office/office-sub-agent.js +127 -0
- package/dist/agents/office/office-sub-agent.js.map +1 -0
- package/dist/agents/office/powerpoint-agent.d.ts +3 -0
- package/dist/agents/office/powerpoint-agent.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-agent.js +37 -0
- package/dist/agents/office/powerpoint-agent.js.map +1 -0
- package/dist/agents/office/powerpoint-create-agent.d.ts +3 -0
- package/dist/agents/office/powerpoint-create-agent.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-create-agent.js +1124 -0
- package/dist/agents/office/powerpoint-create-agent.js.map +1 -0
- package/dist/agents/office/powerpoint-create-prompts.d.ts +116 -0
- package/dist/agents/office/powerpoint-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/powerpoint-create-prompts.js +1354 -0
- package/dist/agents/office/powerpoint-create-prompts.js.map +1 -0
- package/dist/agents/office/prompts.d.ts +11 -0
- package/dist/agents/office/prompts.d.ts.map +1 -0
- package/dist/agents/office/prompts.js +852 -0
- package/dist/agents/office/prompts.js.map +1 -0
- package/dist/agents/office/word-agent.d.ts +3 -0
- package/dist/agents/office/word-agent.d.ts.map +1 -0
- package/dist/agents/office/word-agent.js +31 -0
- package/dist/agents/office/word-agent.js.map +1 -0
- package/dist/agents/office/word-create-agent.d.ts +3 -0
- package/dist/agents/office/word-create-agent.d.ts.map +1 -0
- package/dist/agents/office/word-create-agent.js +36 -0
- package/dist/agents/office/word-create-agent.js.map +1 -0
- package/dist/agents/office/word-create-prompts.d.ts +4 -0
- package/dist/agents/office/word-create-prompts.d.ts.map +1 -0
- package/dist/agents/office/word-create-prompts.js +288 -0
- package/dist/agents/office/word-create-prompts.js.map +1 -0
- package/dist/agents/planner/index.d.ts +14 -0
- package/dist/agents/planner/index.d.ts.map +1 -0
- package/dist/agents/planner/index.js +334 -0
- package/dist/agents/planner/index.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +166 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/chat-command.d.ts +2 -0
- package/dist/commands/chat-command.d.ts.map +1 -0
- package/dist/commands/chat-command.js +90 -0
- package/dist/commands/chat-command.js.map +1 -0
- package/dist/commands/electron-client.d.ts +17 -0
- package/dist/commands/electron-client.d.ts.map +1 -0
- package/dist/commands/electron-client.js +180 -0
- package/dist/commands/electron-client.js.map +1 -0
- package/dist/commands/jarvis-command.d.ts +2 -0
- package/dist/commands/jarvis-command.d.ts.map +1 -0
- package/dist/commands/jarvis-command.js +66 -0
- package/dist/commands/jarvis-command.js.map +1 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +13 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/compact/compact-manager.d.ts +22 -0
- package/dist/core/compact/compact-manager.d.ts.map +1 -0
- package/dist/core/compact/compact-manager.js +77 -0
- package/dist/core/compact/compact-manager.js.map +1 -0
- package/dist/core/compact/compact-prompts.d.ts +11 -0
- package/dist/core/compact/compact-prompts.d.ts.map +1 -0
- package/dist/core/compact/compact-prompts.js +90 -0
- package/dist/core/compact/compact-prompts.js.map +1 -0
- package/dist/core/compact/context-tracker.d.ts +28 -0
- package/dist/core/compact/context-tracker.d.ts.map +1 -0
- package/dist/core/compact/context-tracker.js +71 -0
- package/dist/core/compact/context-tracker.js.map +1 -0
- package/dist/core/compact/index.d.ts +4 -0
- package/dist/core/compact/index.d.ts.map +1 -0
- package/dist/core/compact/index.js +4 -0
- package/dist/core/compact/index.js.map +1 -0
- package/dist/core/config/config-manager.d.ts +43 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +254 -0
- package/dist/core/config/config-manager.js.map +1 -0
- package/dist/core/config/index.d.ts +2 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +2 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/docs-manager.d.ts +46 -0
- package/dist/core/docs-manager.d.ts.map +1 -0
- package/dist/core/docs-manager.js +475 -0
- package/dist/core/docs-manager.js.map +1 -0
- package/dist/core/git-auto-updater.d.ts +58 -0
- package/dist/core/git-auto-updater.d.ts.map +1 -0
- package/dist/core/git-auto-updater.js +374 -0
- package/dist/core/git-auto-updater.js.map +1 -0
- package/dist/core/llm/index.d.ts +2 -0
- package/dist/core/llm/index.d.ts.map +1 -0
- package/dist/core/llm/index.js +2 -0
- package/dist/core/llm/index.js.map +1 -0
- package/dist/core/llm/llm-client.d.ts +110 -0
- package/dist/core/llm/llm-client.d.ts.map +1 -0
- package/dist/core/llm/llm-client.js +1272 -0
- package/dist/core/llm/llm-client.js.map +1 -0
- package/dist/core/session/index.d.ts +2 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +2 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +73 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +260 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/slash-command-handler.d.ts +31 -0
- package/dist/core/slash-command-handler.d.ts.map +1 -0
- package/dist/core/slash-command-handler.js +304 -0
- package/dist/core/slash-command-handler.js.map +1 -0
- package/dist/core/telemetry/error-reporter.d.ts +2 -0
- package/dist/core/telemetry/error-reporter.d.ts.map +1 -0
- package/dist/core/telemetry/error-reporter.js +3 -0
- package/dist/core/telemetry/error-reporter.js.map +1 -0
- package/dist/core/usage-tracker.d.ts +70 -0
- package/dist/core/usage-tracker.d.ts.map +1 -0
- package/dist/core/usage-tracker.js +251 -0
- package/dist/core/usage-tracker.js.map +1 -0
- package/dist/errors/base.d.ts +22 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +43 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/file.d.ts +31 -0
- package/dist/errors/file.d.ts.map +1 -0
- package/dist/errors/file.js +110 -0
- package/dist/errors/file.js.map +1 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +41 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/llm.d.ts +30 -0
- package/dist/errors/llm.d.ts.map +1 -0
- package/dist/errors/llm.js +97 -0
- package/dist/errors/llm.js.map +1 -0
- package/dist/errors/network.d.ts +19 -0
- package/dist/errors/network.d.ts.map +1 -0
- package/dist/errors/network.js +82 -0
- package/dist/errors/network.js.map +1 -0
- package/dist/errors/validation.d.ts +19 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +62 -0
- package/dist/errors/validation.js.map +1 -0
- package/dist/eval/eval-runner.d.ts +24 -0
- package/dist/eval/eval-runner.d.ts.map +1 -0
- package/dist/eval/eval-runner.js +291 -0
- package/dist/eval/eval-runner.js.map +1 -0
- package/dist/eval/index.d.ts +3 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +3 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/types.d.ts +77 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +2 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +4 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/plan-executor.d.ts +27 -0
- package/dist/orchestration/plan-executor.d.ts.map +1 -0
- package/dist/orchestration/plan-executor.js +536 -0
- package/dist/orchestration/plan-executor.js.map +1 -0
- package/dist/orchestration/types.d.ts +69 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +2 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/orchestration/utils.d.ts +14 -0
- package/dist/orchestration/utils.d.ts.map +1 -0
- package/dist/orchestration/utils.js +105 -0
- package/dist/orchestration/utils.js.map +1 -0
- package/dist/pipe/index.d.ts +2 -0
- package/dist/pipe/index.d.ts.map +1 -0
- package/dist/pipe/index.js +2 -0
- package/dist/pipe/index.js.map +1 -0
- package/dist/pipe/pipe-runner.d.ts +15 -0
- package/dist/pipe/pipe-runner.d.ts.map +1 -0
- package/dist/pipe/pipe-runner.js +207 -0
- package/dist/pipe/pipe-runner.js.map +1 -0
- package/dist/prompts/agents/planning.d.ts +4 -0
- package/dist/prompts/agents/planning.d.ts.map +1 -0
- package/dist/prompts/agents/planning.js +318 -0
- package/dist/prompts/agents/planning.js.map +1 -0
- package/dist/prompts/index.d.ts +8 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +8 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/shared/codebase-rules.d.ts +4 -0
- package/dist/prompts/shared/codebase-rules.d.ts.map +1 -0
- package/dist/prompts/shared/codebase-rules.js +16 -0
- package/dist/prompts/shared/codebase-rules.js.map +1 -0
- package/dist/prompts/shared/git-rules.d.ts +2 -0
- package/dist/prompts/shared/git-rules.d.ts.map +1 -0
- package/dist/prompts/shared/git-rules.js +87 -0
- package/dist/prompts/shared/git-rules.js.map +1 -0
- package/dist/prompts/shared/language-rules.d.ts +4 -0
- package/dist/prompts/shared/language-rules.d.ts.map +1 -0
- package/dist/prompts/shared/language-rules.js +22 -0
- package/dist/prompts/shared/language-rules.js.map +1 -0
- package/dist/prompts/shared/tool-usage.d.ts +14 -0
- package/dist/prompts/shared/tool-usage.d.ts.map +1 -0
- package/dist/prompts/shared/tool-usage.js +92 -0
- package/dist/prompts/shared/tool-usage.js.map +1 -0
- package/dist/prompts/system/compact.d.ts +3 -0
- package/dist/prompts/system/compact.d.ts.map +1 -0
- package/dist/prompts/system/compact.js +73 -0
- package/dist/prompts/system/compact.js.map +1 -0
- package/dist/prompts/system/plan-execute.d.ts +6 -0
- package/dist/prompts/system/plan-execute.d.ts.map +1 -0
- package/dist/prompts/system/plan-execute.js +178 -0
- package/dist/prompts/system/plan-execute.js.map +1 -0
- package/dist/tools/browser/browser-client.d.ts +108 -0
- package/dist/tools/browser/browser-client.d.ts.map +1 -0
- package/dist/tools/browser/browser-client.js +965 -0
- package/dist/tools/browser/browser-client.js.map +1 -0
- package/dist/tools/browser/browser-tools.d.ts +18 -0
- package/dist/tools/browser/browser-tools.d.ts.map +1 -0
- package/dist/tools/browser/browser-tools.js +983 -0
- package/dist/tools/browser/browser-tools.js.map +1 -0
- package/dist/tools/browser/index.d.ts +7 -0
- package/dist/tools/browser/index.d.ts.map +1 -0
- package/dist/tools/browser/index.js +17 -0
- package/dist/tools/browser/index.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/llm/index.d.ts +2 -0
- package/dist/tools/llm/index.d.ts.map +1 -0
- package/dist/tools/llm/index.js +2 -0
- package/dist/tools/llm/index.js.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts +5 -0
- package/dist/tools/llm/simple/ask-user-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/ask-user-tool.js +7 -0
- package/dist/tools/llm/simple/ask-user-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-bash-tool.js +320 -0
- package/dist/tools/llm/simple/background-bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts +30 -0
- package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/background-powershell-tool.js +302 -0
- package/dist/tools/llm/simple/background-powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/bash-tool.d.ts +4 -0
- package/dist/tools/llm/simple/bash-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/bash-tool.js +167 -0
- package/dist/tools/llm/simple/bash-tool.js.map +1 -0
- package/dist/tools/llm/simple/file-tools.d.ts +13 -0
- package/dist/tools/llm/simple/file-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/file-tools.js +814 -0
- package/dist/tools/llm/simple/file-tools.js.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts +12 -0
- package/dist/tools/llm/simple/final-response-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/final-response-tool.js +107 -0
- package/dist/tools/llm/simple/final-response-tool.js.map +1 -0
- package/dist/tools/llm/simple/index.d.ts +11 -0
- package/dist/tools/llm/simple/index.d.ts.map +1 -0
- package/dist/tools/llm/simple/index.js +20 -0
- package/dist/tools/llm/simple/index.js.map +1 -0
- package/dist/tools/llm/simple/planning-tools.d.ts +5 -0
- package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/planning-tools.js +121 -0
- package/dist/tools/llm/simple/planning-tools.js.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts +4 -0
- package/dist/tools/llm/simple/powershell-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/powershell-tool.js +163 -0
- package/dist/tools/llm/simple/powershell-tool.js.map +1 -0
- package/dist/tools/llm/simple/read-image-tool.d.ts +8 -0
- package/dist/tools/llm/simple/read-image-tool.d.ts.map +1 -0
- package/dist/tools/llm/simple/read-image-tool.js +170 -0
- package/dist/tools/llm/simple/read-image-tool.js.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts +40 -0
- package/dist/tools/llm/simple/simple-tool-executor.d.ts.map +1 -0
- package/dist/tools/llm/simple/simple-tool-executor.js +159 -0
- package/dist/tools/llm/simple/simple-tool-executor.js.map +1 -0
- package/dist/tools/llm/simple/todo-tools.d.ts +15 -0
- package/dist/tools/llm/simple/todo-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/todo-tools.js +145 -0
- package/dist/tools/llm/simple/todo-tools.js.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts +22 -0
- package/dist/tools/llm/simple/user-interaction-tools.d.ts.map +1 -0
- package/dist/tools/llm/simple/user-interaction-tools.js +168 -0
- package/dist/tools/llm/simple/user-interaction-tools.js.map +1 -0
- package/dist/tools/office/common/constants.d.ts +192 -0
- package/dist/tools/office/common/constants.d.ts.map +1 -0
- package/dist/tools/office/common/constants.js +165 -0
- package/dist/tools/office/common/constants.js.map +1 -0
- package/dist/tools/office/common/index.d.ts +4 -0
- package/dist/tools/office/common/index.d.ts.map +1 -0
- package/dist/tools/office/common/index.js +3 -0
- package/dist/tools/office/common/index.js.map +1 -0
- package/dist/tools/office/common/types.d.ts +82 -0
- package/dist/tools/office/common/types.d.ts.map +1 -0
- package/dist/tools/office/common/types.js +2 -0
- package/dist/tools/office/common/types.js.map +1 -0
- package/dist/tools/office/common/utils.d.ts +16 -0
- package/dist/tools/office/common/utils.d.ts.map +1 -0
- package/dist/tools/office/common/utils.js +60 -0
- package/dist/tools/office/common/utils.js.map +1 -0
- package/dist/tools/office/excel-client.d.ts +219 -0
- package/dist/tools/office/excel-client.d.ts.map +1 -0
- package/dist/tools/office/excel-client.js +2346 -0
- package/dist/tools/office/excel-client.js.map +1 -0
- package/dist/tools/office/excel-tools/cells.d.ts +10 -0
- package/dist/tools/office/excel-tools/cells.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/cells.js +283 -0
- package/dist/tools/office/excel-tools/cells.js.map +1 -0
- package/dist/tools/office/excel-tools/charts.d.ts +6 -0
- package/dist/tools/office/excel-tools/charts.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/charts.js +124 -0
- package/dist/tools/office/excel-tools/charts.js.map +1 -0
- package/dist/tools/office/excel-tools/comments.d.ts +6 -0
- package/dist/tools/office/excel-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/comments.js +114 -0
- package/dist/tools/office/excel-tools/comments.js.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts +10 -0
- package/dist/tools/office/excel-tools/data-ops.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/data-ops.js +266 -0
- package/dist/tools/office/excel-tools/data-ops.js.map +1 -0
- package/dist/tools/office/excel-tools/export.d.ts +5 -0
- package/dist/tools/office/excel-tools/export.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/export.js +75 -0
- package/dist/tools/office/excel-tools/export.js.map +1 -0
- package/dist/tools/office/excel-tools/formatting.d.ts +10 -0
- package/dist/tools/office/excel-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/formatting.js +276 -0
- package/dist/tools/office/excel-tools/formatting.js.map +1 -0
- package/dist/tools/office/excel-tools/index.d.ts +18 -0
- package/dist/tools/office/excel-tools/index.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/index.js +54 -0
- package/dist/tools/office/excel-tools/index.js.map +1 -0
- package/dist/tools/office/excel-tools/launch.d.ts +10 -0
- package/dist/tools/office/excel-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/launch.js +250 -0
- package/dist/tools/office/excel-tools/launch.js.map +1 -0
- package/dist/tools/office/excel-tools/media.d.ts +5 -0
- package/dist/tools/office/excel-tools/media.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/media.js +84 -0
- package/dist/tools/office/excel-tools/media.js.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts +6 -0
- package/dist/tools/office/excel-tools/named-ranges.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/named-ranges.js +113 -0
- package/dist/tools/office/excel-tools/named-ranges.js.map +1 -0
- package/dist/tools/office/excel-tools/protection.d.ts +5 -0
- package/dist/tools/office/excel-tools/protection.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/protection.js +75 -0
- package/dist/tools/office/excel-tools/protection.js.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts +11 -0
- package/dist/tools/office/excel-tools/rows-columns.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/rows-columns.js +293 -0
- package/dist/tools/office/excel-tools/rows-columns.js.map +1 -0
- package/dist/tools/office/excel-tools/sheet-builders.d.ts +9 -0
- package/dist/tools/office/excel-tools/sheet-builders.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/sheet-builders.js +483 -0
- package/dist/tools/office/excel-tools/sheet-builders.js.map +1 -0
- package/dist/tools/office/excel-tools/sheets.d.ts +8 -0
- package/dist/tools/office/excel-tools/sheets.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/sheets.js +182 -0
- package/dist/tools/office/excel-tools/sheets.js.map +1 -0
- package/dist/tools/office/excel-tools/validation.d.ts +7 -0
- package/dist/tools/office/excel-tools/validation.d.ts.map +1 -0
- package/dist/tools/office/excel-tools/validation.js +175 -0
- package/dist/tools/office/excel-tools/validation.js.map +1 -0
- package/dist/tools/office/excel-tools.d.ts +3 -0
- package/dist/tools/office/excel-tools.d.ts.map +1 -0
- package/dist/tools/office/excel-tools.js +3 -0
- package/dist/tools/office/excel-tools.js.map +1 -0
- package/dist/tools/office/index.d.ts +6 -0
- package/dist/tools/office/index.d.ts.map +1 -0
- package/dist/tools/office/index.js +9 -0
- package/dist/tools/office/index.js.map +1 -0
- package/dist/tools/office/office-client-base.d.ts +33 -0
- package/dist/tools/office/office-client-base.d.ts.map +1 -0
- package/dist/tools/office/office-client-base.js +166 -0
- package/dist/tools/office/office-client-base.js.map +1 -0
- package/dist/tools/office/office-client.d.ts +196 -0
- package/dist/tools/office/office-client.d.ts.map +1 -0
- package/dist/tools/office/office-client.js +200 -0
- package/dist/tools/office/office-client.js.map +1 -0
- package/dist/tools/office/powerpoint-client.d.ts +148 -0
- package/dist/tools/office/powerpoint-client.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-client.js +1310 -0
- package/dist/tools/office/powerpoint-client.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/effects.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/effects.js +246 -0
- package/dist/tools/office/powerpoint-tools/effects.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/export.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/export.js +123 -0
- package/dist/tools/office/powerpoint-tools/export.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts +15 -0
- package/dist/tools/office/powerpoint-tools/index.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/index.js +40 -0
- package/dist/tools/office/powerpoint-tools/index.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts +9 -0
- package/dist/tools/office/powerpoint-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/launch.js +218 -0
- package/dist/tools/office/powerpoint-tools/launch.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.d.ts +12 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.js +785 -0
- package/dist/tools/office/powerpoint-tools/layout-builders.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/media.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/media.js +211 -0
- package/dist/tools/office/powerpoint-tools/media.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts +8 -0
- package/dist/tools/office/powerpoint-tools/notes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/notes.js +171 -0
- package/dist/tools/office/powerpoint-tools/notes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/sections.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/sections.js +104 -0
- package/dist/tools/office/powerpoint-tools/sections.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts +22 -0
- package/dist/tools/office/powerpoint-tools/shapes.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/shapes.js +681 -0
- package/dist/tools/office/powerpoint-tools/shapes.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts +11 -0
- package/dist/tools/office/powerpoint-tools/slides.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/slides.js +283 -0
- package/dist/tools/office/powerpoint-tools/slides.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts +6 -0
- package/dist/tools/office/powerpoint-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/tables.js +132 -0
- package/dist/tools/office/powerpoint-tools/tables.js.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts +12 -0
- package/dist/tools/office/powerpoint-tools/text.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools/text.js +379 -0
- package/dist/tools/office/powerpoint-tools/text.js.map +1 -0
- package/dist/tools/office/powerpoint-tools.d.ts +3 -0
- package/dist/tools/office/powerpoint-tools.d.ts.map +1 -0
- package/dist/tools/office/powerpoint-tools.js +3 -0
- package/dist/tools/office/powerpoint-tools.js.map +1 -0
- package/dist/tools/office/word-client.d.ts +169 -0
- package/dist/tools/office/word-client.d.ts.map +1 -0
- package/dist/tools/office/word-client.js +1636 -0
- package/dist/tools/office/word-client.js.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts +7 -0
- package/dist/tools/office/word-tools/bookmarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/bookmarks.js +146 -0
- package/dist/tools/office/word-tools/bookmarks.js.map +1 -0
- package/dist/tools/office/word-tools/comments.d.ts +7 -0
- package/dist/tools/office/word-tools/comments.d.ts.map +1 -0
- package/dist/tools/office/word-tools/comments.js +146 -0
- package/dist/tools/office/word-tools/comments.js.map +1 -0
- package/dist/tools/office/word-tools/content.d.ts +7 -0
- package/dist/tools/office/word-tools/content.d.ts.map +1 -0
- package/dist/tools/office/word-tools/content.js +168 -0
- package/dist/tools/office/word-tools/content.js.map +1 -0
- package/dist/tools/office/word-tools/export.d.ts +5 -0
- package/dist/tools/office/word-tools/export.d.ts.map +1 -0
- package/dist/tools/office/word-tools/export.js +73 -0
- package/dist/tools/office/word-tools/export.js.map +1 -0
- package/dist/tools/office/word-tools/formatting.d.ts +6 -0
- package/dist/tools/office/word-tools/formatting.d.ts.map +1 -0
- package/dist/tools/office/word-tools/formatting.js +129 -0
- package/dist/tools/office/word-tools/formatting.js.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts +6 -0
- package/dist/tools/office/word-tools/headers-footers.d.ts.map +1 -0
- package/dist/tools/office/word-tools/headers-footers.js +117 -0
- package/dist/tools/office/word-tools/headers-footers.js.map +1 -0
- package/dist/tools/office/word-tools/index.d.ts +19 -0
- package/dist/tools/office/word-tools/index.d.ts.map +1 -0
- package/dist/tools/office/word-tools/index.js +60 -0
- package/dist/tools/office/word-tools/index.js.map +1 -0
- package/dist/tools/office/word-tools/launch.d.ts +10 -0
- package/dist/tools/office/word-tools/launch.d.ts.map +1 -0
- package/dist/tools/office/word-tools/launch.js +257 -0
- package/dist/tools/office/word-tools/launch.js.map +1 -0
- package/dist/tools/office/word-tools/lists.d.ts +5 -0
- package/dist/tools/office/word-tools/lists.d.ts.map +1 -0
- package/dist/tools/office/word-tools/lists.js +73 -0
- package/dist/tools/office/word-tools/lists.js.map +1 -0
- package/dist/tools/office/word-tools/navigation.d.ts +5 -0
- package/dist/tools/office/word-tools/navigation.d.ts.map +1 -0
- package/dist/tools/office/word-tools/navigation.js +85 -0
- package/dist/tools/office/word-tools/navigation.js.map +1 -0
- package/dist/tools/office/word-tools/page-setup.d.ts +7 -0
- package/dist/tools/office/word-tools/page-setup.d.ts.map +1 -0
- package/dist/tools/office/word-tools/page-setup.js +152 -0
- package/dist/tools/office/word-tools/page-setup.js.map +1 -0
- package/dist/tools/office/word-tools/section-builders.d.ts +12 -0
- package/dist/tools/office/word-tools/section-builders.d.ts.map +1 -0
- package/dist/tools/office/word-tools/section-builders.js +601 -0
- package/dist/tools/office/word-tools/section-builders.js.map +1 -0
- package/dist/tools/office/word-tools/tables.d.ts +8 -0
- package/dist/tools/office/word-tools/tables.d.ts.map +1 -0
- package/dist/tools/office/word-tools/tables.js +197 -0
- package/dist/tools/office/word-tools/tables.js.map +1 -0
- package/dist/tools/office/word-tools/text.d.ts +9 -0
- package/dist/tools/office/word-tools/text.d.ts.map +1 -0
- package/dist/tools/office/word-tools/text.js +245 -0
- package/dist/tools/office/word-tools/text.js.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts +5 -0
- package/dist/tools/office/word-tools/undo-redo.d.ts.map +1 -0
- package/dist/tools/office/word-tools/undo-redo.js +73 -0
- package/dist/tools/office/word-tools/undo-redo.js.map +1 -0
- package/dist/tools/office/word-tools/watermarks.d.ts +5 -0
- package/dist/tools/office/word-tools/watermarks.d.ts.map +1 -0
- package/dist/tools/office/word-tools/watermarks.js +81 -0
- package/dist/tools/office/word-tools/watermarks.js.map +1 -0
- package/dist/tools/office/word-tools.d.ts +3 -0
- package/dist/tools/office/word-tools.d.ts.map +1 -0
- package/dist/tools/office/word-tools.js +3 -0
- package/dist/tools/office/word-tools.js.map +1 -0
- package/dist/tools/registry.d.ts +55 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +296 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +88 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +19 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/types/index.d.ts +132 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/PlanExecuteView.d.ts +11 -0
- package/dist/ui/PlanExecuteView.d.ts.map +1 -0
- package/dist/ui/PlanExecuteView.js +27 -0
- package/dist/ui/PlanExecuteView.js.map +1 -0
- package/dist/ui/TodoPanel.d.ts +13 -0
- package/dist/ui/TodoPanel.d.ts.map +1 -0
- package/dist/ui/TodoPanel.js +138 -0
- package/dist/ui/TodoPanel.js.map +1 -0
- package/dist/ui/UpdateNotification.d.ts +13 -0
- package/dist/ui/UpdateNotification.d.ts.map +1 -0
- package/dist/ui/UpdateNotification.js +42 -0
- package/dist/ui/UpdateNotification.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +25 -0
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.js +116 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -0
- package/dist/ui/components/CommandBrowser.d.ts +10 -0
- package/dist/ui/components/CommandBrowser.d.ts.map +1 -0
- package/dist/ui/components/CommandBrowser.js +57 -0
- package/dist/ui/components/CommandBrowser.js.map +1 -0
- package/dist/ui/components/CustomTextInput.d.ts +13 -0
- package/dist/ui/components/CustomTextInput.d.ts.map +1 -0
- package/dist/ui/components/CustomTextInput.js +246 -0
- package/dist/ui/components/CustomTextInput.js.map +1 -0
- package/dist/ui/components/FileBrowser.d.ts +11 -0
- package/dist/ui/components/FileBrowser.d.ts.map +1 -0
- package/dist/ui/components/FileBrowser.js +45 -0
- package/dist/ui/components/FileBrowser.js.map +1 -0
- package/dist/ui/components/LLMSetupWizard.d.ts +8 -0
- package/dist/ui/components/LLMSetupWizard.d.ts.map +1 -0
- package/dist/ui/components/LLMSetupWizard.js +197 -0
- package/dist/ui/components/LLMSetupWizard.js.map +1 -0
- package/dist/ui/components/Logo.d.ts +20 -0
- package/dist/ui/components/Logo.d.ts.map +1 -0
- package/dist/ui/components/Logo.js +100 -0
- package/dist/ui/components/Logo.js.map +1 -0
- package/dist/ui/components/MarkdownRenderer.d.ts +9 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/ui/components/MarkdownRenderer.js +198 -0
- package/dist/ui/components/MarkdownRenderer.js.map +1 -0
- package/dist/ui/components/ModelSelector.d.ts +8 -0
- package/dist/ui/components/ModelSelector.d.ts.map +1 -0
- package/dist/ui/components/ModelSelector.js +111 -0
- package/dist/ui/components/ModelSelector.js.map +1 -0
- package/dist/ui/components/PlanExecuteApp.d.ts +23 -0
- package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -0
- package/dist/ui/components/PlanExecuteApp.js +1377 -0
- package/dist/ui/components/PlanExecuteApp.js.map +1 -0
- package/dist/ui/components/ProgressBar.d.ts +10 -0
- package/dist/ui/components/ProgressBar.d.ts.map +1 -0
- package/dist/ui/components/ProgressBar.js +26 -0
- package/dist/ui/components/ProgressBar.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +23 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +162 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/ThinkingIndicator.d.ts +14 -0
- package/dist/ui/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/ui/components/ThinkingIndicator.js +63 -0
- package/dist/ui/components/ThinkingIndicator.js.map +1 -0
- package/dist/ui/components/TodoListView.d.ts +11 -0
- package/dist/ui/components/TodoListView.d.ts.map +1 -0
- package/dist/ui/components/TodoListView.js +69 -0
- package/dist/ui/components/TodoListView.js.map +1 -0
- package/dist/ui/components/ToolSelector.d.ts +7 -0
- package/dist/ui/components/ToolSelector.d.ts.map +1 -0
- package/dist/ui/components/ToolSelector.js +112 -0
- package/dist/ui/components/ToolSelector.js.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts +13 -0
- package/dist/ui/components/dialogs/ApprovalDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js +175 -0
- package/dist/ui/components/dialogs/ApprovalDialog.js.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts +9 -0
- package/dist/ui/components/dialogs/AskUserDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/AskUserDialog.js +111 -0
- package/dist/ui/components/dialogs/AskUserDialog.js.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts +8 -0
- package/dist/ui/components/dialogs/DocsBrowser.d.ts.map +1 -0
- package/dist/ui/components/dialogs/DocsBrowser.js +127 -0
- package/dist/ui/components/dialogs/DocsBrowser.js.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts +10 -0
- package/dist/ui/components/dialogs/SettingsDialog.d.ts.map +1 -0
- package/dist/ui/components/dialogs/SettingsDialog.js +586 -0
- package/dist/ui/components/dialogs/SettingsDialog.js.map +1 -0
- package/dist/ui/components/dialogs/index.d.ts +3 -0
- package/dist/ui/components/dialogs/index.d.ts.map +1 -0
- package/dist/ui/components/dialogs/index.js +3 -0
- package/dist/ui/components/dialogs/index.js.map +1 -0
- package/dist/ui/components/index.d.ts +12 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +9 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/panels/LogPanel.d.ts +7 -0
- package/dist/ui/components/panels/LogPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/LogPanel.js +280 -0
- package/dist/ui/components/panels/LogPanel.js.map +1 -0
- package/dist/ui/components/panels/SessionPanel.d.ts +8 -0
- package/dist/ui/components/panels/SessionPanel.d.ts.map +1 -0
- package/dist/ui/components/panels/SessionPanel.js +81 -0
- package/dist/ui/components/panels/SessionPanel.js.map +1 -0
- package/dist/ui/components/panels/index.d.ts +4 -0
- package/dist/ui/components/panels/index.d.ts.map +1 -0
- package/dist/ui/components/panels/index.js +4 -0
- package/dist/ui/components/panels/index.js.map +1 -0
- package/dist/ui/components/views/ChatView.d.ts +12 -0
- package/dist/ui/components/views/ChatView.d.ts.map +1 -0
- package/dist/ui/components/views/ChatView.js +289 -0
- package/dist/ui/components/views/ChatView.js.map +1 -0
- package/dist/ui/components/views/index.d.ts +2 -0
- package/dist/ui/components/views/index.d.ts.map +1 -0
- package/dist/ui/components/views/index.js +2 -0
- package/dist/ui/components/views/index.js.map +1 -0
- package/dist/ui/contexts/TokenContext.d.ts +29 -0
- package/dist/ui/contexts/TokenContext.d.ts.map +1 -0
- package/dist/ui/contexts/TokenContext.js +79 -0
- package/dist/ui/contexts/TokenContext.js.map +1 -0
- package/dist/ui/hooks/atFileProcessor.d.ts +15 -0
- package/dist/ui/hooks/atFileProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/atFileProcessor.js +88 -0
- package/dist/ui/hooks/atFileProcessor.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +9 -0
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +9 -0
- package/dist/ui/hooks/index.js.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts +21 -0
- package/dist/ui/hooks/slashCommandProcessor.d.ts.map +1 -0
- package/dist/ui/hooks/slashCommandProcessor.js +96 -0
- package/dist/ui/hooks/slashCommandProcessor.js.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts +12 -0
- package/dist/ui/hooks/useCommandBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useCommandBrowserState.js +66 -0
- package/dist/ui/hooks/useCommandBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts +15 -0
- package/dist/ui/hooks/useFileBrowserState.d.ts.map +1 -0
- package/dist/ui/hooks/useFileBrowserState.js +80 -0
- package/dist/ui/hooks/useFileBrowserState.js.map +1 -0
- package/dist/ui/hooks/useFileList.d.ts +20 -0
- package/dist/ui/hooks/useFileList.d.ts.map +1 -0
- package/dist/ui/hooks/useFileList.js +57 -0
- package/dist/ui/hooks/useFileList.js.map +1 -0
- package/dist/ui/hooks/useInputHistory.d.ts +9 -0
- package/dist/ui/hooks/useInputHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useInputHistory.js +68 -0
- package/dist/ui/hooks/useInputHistory.js.map +1 -0
- package/dist/ui/hooks/usePlanExecution.d.ts +8 -0
- package/dist/ui/hooks/usePlanExecution.d.ts.map +1 -0
- package/dist/ui/hooks/usePlanExecution.js +218 -0
- package/dist/ui/hooks/usePlanExecution.js.map +1 -0
- package/dist/ui/hooks/useTerminalWidth.d.ts +4 -0
- package/dist/ui/hooks/useTerminalWidth.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalWidth.js +26 -0
- package/dist/ui/hooks/useTerminalWidth.js.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +7 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink-entry.d.ts +3 -0
- package/dist/ui/ink-entry.d.ts.map +1 -0
- package/dist/ui/ink-entry.js +22 -0
- package/dist/ui/ink-entry.js.map +1 -0
- package/dist/utils/file-system.d.ts +9 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +99 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/git-utils.d.ts +2 -0
- package/dist/utils/git-utils.d.ts.map +1 -0
- package/dist/utils/git-utils.js +16 -0
- package/dist/utils/git-utils.js.map +1 -0
- package/dist/utils/json-stream-logger.d.ts +74 -0
- package/dist/utils/json-stream-logger.d.ts.map +1 -0
- package/dist/utils/json-stream-logger.js +808 -0
- package/dist/utils/json-stream-logger.js.map +1 -0
- package/dist/utils/logger.d.ts +152 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +1672 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/platform-utils.d.ts +19 -0
- package/dist/utils/platform-utils.d.ts.map +1 -0
- package/dist/utils/platform-utils.js +134 -0
- package/dist/utils/platform-utils.js.map +1 -0
- package/dist/utils/wsl-utils.d.ts +4 -0
- package/dist/utils/wsl-utils.d.ts.map +1 -0
- package/dist/utils/wsl-utils.js +72 -0
- package/dist/utils/wsl-utils.js.map +1 -0
- package/package.json +132 -0
- package/scripts/patch-yoga.js +48 -0
|
@@ -0,0 +1,1310 @@
|
|
|
1
|
+
import { OfficeClientBase } from './office-client-base.js';
|
|
2
|
+
export class PowerPointClient extends OfficeClientBase {
|
|
3
|
+
comProgId = 'PowerPoint.Application';
|
|
4
|
+
displayAlertsSuppressExpr = '1';
|
|
5
|
+
async powerpointLaunch() {
|
|
6
|
+
return this.executePowerShell(`
|
|
7
|
+
try {
|
|
8
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
9
|
+
$ppt.Visible = -1 # msoTrue
|
|
10
|
+
@{ success = $true; message = "Connected to existing PowerPoint instance" } | ConvertTo-Json -Compress
|
|
11
|
+
} catch {
|
|
12
|
+
$ppt = New-Object -ComObject PowerPoint.Application
|
|
13
|
+
$ppt.Visible = -1 # msoTrue
|
|
14
|
+
@{ success = $true; message = "Launched new PowerPoint instance" } | ConvertTo-Json -Compress
|
|
15
|
+
}
|
|
16
|
+
`);
|
|
17
|
+
}
|
|
18
|
+
async powerpointCreate() {
|
|
19
|
+
return this.executePowerShell(`
|
|
20
|
+
try {
|
|
21
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
22
|
+
} catch {
|
|
23
|
+
$ppt = New-Object -ComObject PowerPoint.Application
|
|
24
|
+
}
|
|
25
|
+
$ppt.DisplayAlerts = 1 # ppAlertsNone
|
|
26
|
+
$ppt.Visible = -1 # msoTrue
|
|
27
|
+
# Close all existing presentations to prevent leftover slides from previous runs
|
|
28
|
+
for ($i = $ppt.Presentations.Count; $i -ge 1; $i--) {
|
|
29
|
+
try { $ppt.Presentations($i).Close() } catch {}
|
|
30
|
+
}
|
|
31
|
+
$presentation = $ppt.Presentations.Add(-1)
|
|
32
|
+
$ppt.DisplayAlerts = 2 # ppAlertsAll
|
|
33
|
+
@{ success = $true; message = "Created new presentation"; presentation_name = $presentation.Name } | ConvertTo-Json -Compress
|
|
34
|
+
`);
|
|
35
|
+
}
|
|
36
|
+
async powerpointOpen(filePath) {
|
|
37
|
+
const windowsPath = this.toWindowsPath(filePath).replace(/'/g, "''");
|
|
38
|
+
return this.executePowerShell(`
|
|
39
|
+
try {
|
|
40
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
41
|
+
} catch {
|
|
42
|
+
$ppt = New-Object -ComObject PowerPoint.Application
|
|
43
|
+
}
|
|
44
|
+
$ppt.DisplayAlerts = 1 # ppAlertsNone
|
|
45
|
+
$ppt.Visible = -1 # msoTrue
|
|
46
|
+
$presentation = $ppt.Presentations.Open('${windowsPath}')
|
|
47
|
+
$ppt.DisplayAlerts = 2 # ppAlertsAll
|
|
48
|
+
@{ success = $true; message = "Presentation opened"; presentation_name = $presentation.Name; path = $presentation.FullName } | ConvertTo-Json -Compress
|
|
49
|
+
`);
|
|
50
|
+
}
|
|
51
|
+
async powerpointAddSlide(layout = 1) {
|
|
52
|
+
return this.executePowerShell(`
|
|
53
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
54
|
+
$presentation = $ppt.ActivePresentation
|
|
55
|
+
$slideCount = $presentation.Slides.Count
|
|
56
|
+
$customLayout = $presentation.SlideMaster.CustomLayouts(${layout})
|
|
57
|
+
$slide = $presentation.Slides.AddSlide($slideCount + 1, $customLayout)
|
|
58
|
+
@{ success = $true; message = "Slide added"; slide_number = $slide.SlideIndex; layout = ${layout} } | ConvertTo-Json -Compress
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
61
|
+
async powerpointDeleteSlide(slideNumber) {
|
|
62
|
+
return this.executePowerShell(`
|
|
63
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
64
|
+
$presentation = $ppt.ActivePresentation
|
|
65
|
+
$presentation.Slides(${slideNumber}).Delete()
|
|
66
|
+
@{ success = $true; message = "Slide ${slideNumber} deleted" } | ConvertTo-Json -Compress
|
|
67
|
+
`);
|
|
68
|
+
}
|
|
69
|
+
async powerpointMoveSlide(fromIndex, toIndex) {
|
|
70
|
+
return this.executePowerShell(`
|
|
71
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
72
|
+
$presentation = $ppt.ActivePresentation
|
|
73
|
+
$presentation.Slides(${fromIndex}).MoveTo(${toIndex})
|
|
74
|
+
@{ success = $true; message = "Slide moved from ${fromIndex} to ${toIndex}" } | ConvertTo-Json -Compress
|
|
75
|
+
`);
|
|
76
|
+
}
|
|
77
|
+
async powerpointWriteText(slideNumber, shapeIndex, text, options) {
|
|
78
|
+
const escapedText = text.replace(/'/g, "''");
|
|
79
|
+
const hasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(text);
|
|
80
|
+
const fontName = options?.fontName || (hasKorean ? 'Malgun Gothic' : '');
|
|
81
|
+
const formatCommands = [];
|
|
82
|
+
if (fontName)
|
|
83
|
+
formatCommands.push(`$textRange.Font.Name = '${fontName.replace(/'/g, "''")}'`);
|
|
84
|
+
if (options?.fontSize)
|
|
85
|
+
formatCommands.push(`$textRange.Font.Size = ${options.fontSize}`);
|
|
86
|
+
if (options?.bold !== undefined)
|
|
87
|
+
formatCommands.push(`$textRange.Font.Bold = ${options.bold ? '-1' : '0'}`);
|
|
88
|
+
return this.executePowerShell(`
|
|
89
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
90
|
+
$presentation = $ppt.ActivePresentation
|
|
91
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
92
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
93
|
+
$textRange = $shape.TextFrame.TextRange
|
|
94
|
+
$textContent = '${escapedText}' -replace '\\\\n', [char]10 -replace '\\n', [char]10
|
|
95
|
+
$textRange.Text = $textContent
|
|
96
|
+
${formatCommands.join('\n')}
|
|
97
|
+
@{ success = $true; message = "Text written to slide ${slideNumber}, shape ${shapeIndex}" } | ConvertTo-Json -Compress
|
|
98
|
+
`);
|
|
99
|
+
}
|
|
100
|
+
async powerpointReadSlide(slideNumber) {
|
|
101
|
+
return this.executePowerShell(`
|
|
102
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
103
|
+
$presentation = $ppt.ActivePresentation
|
|
104
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
105
|
+
$texts = @()
|
|
106
|
+
foreach ($shape in $slide.Shapes) {
|
|
107
|
+
if ($shape.HasTextFrame -eq -1) {
|
|
108
|
+
$texts += @{
|
|
109
|
+
shape_index = $shape.Index
|
|
110
|
+
shape_name = $shape.Name
|
|
111
|
+
text = $shape.TextFrame.TextRange.Text
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
@{
|
|
116
|
+
success = $true
|
|
117
|
+
slide_number = ${slideNumber}
|
|
118
|
+
shape_count = $slide.Shapes.Count
|
|
119
|
+
texts = $texts
|
|
120
|
+
} | ConvertTo-Json -Compress -Depth 5
|
|
121
|
+
`);
|
|
122
|
+
}
|
|
123
|
+
async powerpointAddTextbox(slideNumber, text, left = 100, top = 100, width = 300, height = 50, options) {
|
|
124
|
+
const escapedText = text.replace(/'/g, "''");
|
|
125
|
+
const formatCmds = [];
|
|
126
|
+
const hasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(text);
|
|
127
|
+
const fontName = options?.fontName || (hasKorean ? 'Malgun Gothic' : undefined);
|
|
128
|
+
if (fontName)
|
|
129
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.Font.Name = '${fontName}'`);
|
|
130
|
+
if (options?.fontSize)
|
|
131
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.Font.Size = ${options.fontSize}`);
|
|
132
|
+
if (options?.bold != null)
|
|
133
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.Font.Bold = ${options.bold ? '-1' : '0'}`);
|
|
134
|
+
if (options?.italic != null)
|
|
135
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.Font.Italic = ${options.italic ? '-1' : '0'}`);
|
|
136
|
+
if (options?.fontColor) {
|
|
137
|
+
const hex = options.fontColor.replace('#', '');
|
|
138
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
139
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
140
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
141
|
+
const rgb = r + g * 256 + b * 65536;
|
|
142
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.Font.Color.RGB = ${rgb}`);
|
|
143
|
+
}
|
|
144
|
+
const hAlignMap = { left: 1, center: 2, right: 3, justify: 4 };
|
|
145
|
+
if (options?.alignment && hAlignMap[options.alignment]) {
|
|
146
|
+
formatCmds.push(`$textbox.TextFrame.TextRange.ParagraphFormat.Alignment = ${hAlignMap[options.alignment]}`);
|
|
147
|
+
}
|
|
148
|
+
const vAnchorMap = { top: 1, middle: 3, bottom: 4 };
|
|
149
|
+
if (options?.verticalAnchor && vAnchorMap[options.verticalAnchor]) {
|
|
150
|
+
formatCmds.push(`$textbox.TextFrame.VerticalAnchor = ${vAnchorMap[options.verticalAnchor]}`);
|
|
151
|
+
}
|
|
152
|
+
const formatScript = formatCmds.length > 0 ? formatCmds.join('\n') : '';
|
|
153
|
+
return this.executePowerShell(`
|
|
154
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
155
|
+
$presentation = $ppt.ActivePresentation
|
|
156
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
157
|
+
# msoTextOrientationHorizontal = 1
|
|
158
|
+
$textbox = $slide.Shapes.AddTextbox(1, ${left}, ${top}, ${width}, ${height})
|
|
159
|
+
$textContent = '${escapedText}' -replace '\\\\n', [char]10 -replace '\\n', [char]10
|
|
160
|
+
$textbox.TextFrame.TextRange.Text = $textContent
|
|
161
|
+
${formatScript}
|
|
162
|
+
@{ success = $true; message = "Textbox added to slide ${slideNumber}"; shape_index = $textbox.Index } | ConvertTo-Json -Compress
|
|
163
|
+
`);
|
|
164
|
+
}
|
|
165
|
+
async powerpointSetFont(slideNumber, shapeIndex, options) {
|
|
166
|
+
const commands = [];
|
|
167
|
+
if (options.fontName)
|
|
168
|
+
commands.push(`$textRange.Font.Name = '${options.fontName.replace(/'/g, "''")}'`);
|
|
169
|
+
if (options.fontSize)
|
|
170
|
+
commands.push(`$textRange.Font.Size = ${options.fontSize}`);
|
|
171
|
+
if (options.bold !== undefined)
|
|
172
|
+
commands.push(`$textRange.Font.Bold = ${options.bold ? '-1' : '0'}`);
|
|
173
|
+
if (options.italic !== undefined)
|
|
174
|
+
commands.push(`$textRange.Font.Italic = ${options.italic ? '-1' : '0'}`);
|
|
175
|
+
if (options.color) {
|
|
176
|
+
const rgb = this.hexToRgb(options.color);
|
|
177
|
+
if (rgb)
|
|
178
|
+
commands.push(`$textRange.Font.Color.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
179
|
+
}
|
|
180
|
+
return this.executePowerShell(`
|
|
181
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
182
|
+
$presentation = $ppt.ActivePresentation
|
|
183
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
184
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
185
|
+
$textRange = $shape.TextFrame.TextRange
|
|
186
|
+
${commands.join('\n')}
|
|
187
|
+
@{ success = $true; message = "Font set for slide ${slideNumber}, shape ${shapeIndex}" } | ConvertTo-Json -Compress
|
|
188
|
+
`);
|
|
189
|
+
}
|
|
190
|
+
async powerpointAddImage(slideNumber, imagePath, left = 100, top = 100, width, height) {
|
|
191
|
+
const windowsPath = this.toWindowsPath(imagePath).replace(/'/g, "''");
|
|
192
|
+
const sizeScript = width !== undefined && height !== undefined
|
|
193
|
+
? `$shape.Width = ${width}; $shape.Height = ${height}`
|
|
194
|
+
: '';
|
|
195
|
+
return this.executePowerShell(`
|
|
196
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
197
|
+
$presentation = $ppt.ActivePresentation
|
|
198
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
199
|
+
$shape = $slide.Shapes.AddPicture('${windowsPath}', 0, -1, ${left}, ${top})
|
|
200
|
+
${sizeScript}
|
|
201
|
+
@{ success = $true; message = "Image added to slide ${slideNumber}"; shape_index = $shape.Index } | ConvertTo-Json -Compress
|
|
202
|
+
`);
|
|
203
|
+
}
|
|
204
|
+
async powerpointAddShape(slideNumber, shapeType, left, top, width, height, fillColor) {
|
|
205
|
+
const shapeTypeMap = {
|
|
206
|
+
rectangle: 1,
|
|
207
|
+
oval: 9,
|
|
208
|
+
triangle: 7,
|
|
209
|
+
arrow: 33,
|
|
210
|
+
star: 92
|
|
211
|
+
};
|
|
212
|
+
const shapeTypeNum = shapeTypeMap[shapeType] || 1;
|
|
213
|
+
let fillScript = '';
|
|
214
|
+
if (fillColor) {
|
|
215
|
+
const rgb = this.hexToRgb(fillColor);
|
|
216
|
+
if (rgb)
|
|
217
|
+
fillScript = `$shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`;
|
|
218
|
+
}
|
|
219
|
+
return this.executePowerShell(`
|
|
220
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
221
|
+
$presentation = $ppt.ActivePresentation
|
|
222
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
223
|
+
$shape = $slide.Shapes.AddShape(${shapeTypeNum}, ${left}, ${top}, ${width}, ${height})
|
|
224
|
+
${fillScript}
|
|
225
|
+
@{ success = $true; message = "${shapeType} shape added to slide ${slideNumber}"; shape_index = $shape.Index } | ConvertTo-Json -Compress
|
|
226
|
+
`);
|
|
227
|
+
}
|
|
228
|
+
async powerpointAddAnimation(slideNumber, shapeIndex, effect = 'fade', trigger = 'on_click') {
|
|
229
|
+
const effectMap = {
|
|
230
|
+
fade: 3844,
|
|
231
|
+
appear: 1,
|
|
232
|
+
fly_in: 3844,
|
|
233
|
+
zoom: 3845,
|
|
234
|
+
wipe: 22
|
|
235
|
+
};
|
|
236
|
+
const triggerMap = {
|
|
237
|
+
on_click: 1,
|
|
238
|
+
with_previous: 2,
|
|
239
|
+
after_previous: 3
|
|
240
|
+
};
|
|
241
|
+
return this.executePowerShell(`
|
|
242
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
243
|
+
$presentation = $ppt.ActivePresentation
|
|
244
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
245
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
246
|
+
$effect = $slide.TimeLine.MainSequence.AddEffect($shape, ${effectMap[effect] || 3844}, 0, ${triggerMap[trigger] || 1})
|
|
247
|
+
@{ success = $true; message = "Animation '${effect}' added to shape ${shapeIndex}" } | ConvertTo-Json -Compress
|
|
248
|
+
`);
|
|
249
|
+
}
|
|
250
|
+
async powerpointSetTransition(slideNumber, transitionType = 'fade', duration = 1) {
|
|
251
|
+
const transitionMap = {
|
|
252
|
+
fade: 3849,
|
|
253
|
+
push: 3846,
|
|
254
|
+
wipe: 3851,
|
|
255
|
+
split: 3848,
|
|
256
|
+
reveal: 3850,
|
|
257
|
+
random: 0
|
|
258
|
+
};
|
|
259
|
+
return this.executePowerShell(`
|
|
260
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
261
|
+
$presentation = $ppt.ActivePresentation
|
|
262
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
263
|
+
$slide.SlideShowTransition.EntryEffect = ${transitionMap[transitionType]}
|
|
264
|
+
$slide.SlideShowTransition.Duration = ${duration}
|
|
265
|
+
@{ success = $true; message = "Transition '${transitionType}' set for slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
266
|
+
`);
|
|
267
|
+
}
|
|
268
|
+
async powerpointSetBackground(slideNumber, options) {
|
|
269
|
+
let bgScript = '';
|
|
270
|
+
if (options.color) {
|
|
271
|
+
const rgb = this.hexToRgb(options.color);
|
|
272
|
+
if (rgb) {
|
|
273
|
+
bgScript = `
|
|
274
|
+
$slide.FollowMasterBackground = 0
|
|
275
|
+
$slide.Background.Fill.Solid()
|
|
276
|
+
$slide.Background.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else if (options.imagePath) {
|
|
280
|
+
const windowsPath = this.toWindowsPath(options.imagePath).replace(/'/g, "''");
|
|
281
|
+
bgScript = `
|
|
282
|
+
$slide.FollowMasterBackground = 0
|
|
283
|
+
$slide.Background.Fill.UserPicture('${windowsPath}')`;
|
|
284
|
+
}
|
|
285
|
+
return this.executePowerShell(`
|
|
286
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
287
|
+
$presentation = $ppt.ActivePresentation
|
|
288
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
289
|
+
${bgScript}
|
|
290
|
+
@{ success = $true; message = "Background set for slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
291
|
+
`);
|
|
292
|
+
}
|
|
293
|
+
async powerpointAddFullSlideImage(slideNumber, imagePath) {
|
|
294
|
+
const windowsPath = this.toWindowsPath(imagePath).replace(/'/g, "''");
|
|
295
|
+
return this.executePowerShell(`
|
|
296
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
297
|
+
$presentation = $ppt.ActivePresentation
|
|
298
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
299
|
+
$w = $presentation.PageSetup.SlideWidth
|
|
300
|
+
$h = $presentation.PageSetup.SlideHeight
|
|
301
|
+
for ($s = $slide.Shapes.Count; $s -ge 1; $s--) { try { $slide.Shapes($s).Delete() } catch {} }
|
|
302
|
+
$pic = $slide.Shapes.AddPicture('${windowsPath}', 0, -1, 0, 0, $w, $h)
|
|
303
|
+
$pic.LockAspectRatio = 0
|
|
304
|
+
$pic.ZOrder(1)
|
|
305
|
+
@{ success = $true; message = "Full-slide image added to slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
306
|
+
`);
|
|
307
|
+
}
|
|
308
|
+
async powerpointGetSlideCount() {
|
|
309
|
+
return this.executePowerShell(`
|
|
310
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
311
|
+
$presentation = $ppt.ActivePresentation
|
|
312
|
+
@{ success = $true; slide_count = $presentation.Slides.Count } | ConvertTo-Json -Compress
|
|
313
|
+
`);
|
|
314
|
+
}
|
|
315
|
+
async powerpointSave(filePath) {
|
|
316
|
+
const windowsPath = filePath ? this.toWindowsPath(filePath).replace(/'/g, "''") : '';
|
|
317
|
+
return this.executePowerShell(`
|
|
318
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
319
|
+
$presentation = $ppt.ActivePresentation
|
|
320
|
+
${windowsPath ? `$presentation.SaveAs('${windowsPath}')` : '$presentation.Save()'}
|
|
321
|
+
@{ success = $true; message = "Presentation saved"; path = $presentation.FullName } | ConvertTo-Json -Compress
|
|
322
|
+
`);
|
|
323
|
+
}
|
|
324
|
+
async powerpointExportToPDF(outputPath) {
|
|
325
|
+
const windowsPath = this.toWindowsPath(outputPath).replace(/'/g, "''");
|
|
326
|
+
return this.executePowerShell(`
|
|
327
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
328
|
+
$presentation = $ppt.ActivePresentation
|
|
329
|
+
# ppSaveAsPDF = 32
|
|
330
|
+
$presentation.SaveAs('${windowsPath}', 32)
|
|
331
|
+
@{ success = $true; message = "Exported to PDF"; path = '${windowsPath}' } | ConvertTo-Json -Compress
|
|
332
|
+
`);
|
|
333
|
+
}
|
|
334
|
+
async powerpointStartSlideshow(fromSlide = 1) {
|
|
335
|
+
return this.executePowerShell(`
|
|
336
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
337
|
+
$presentation = $ppt.ActivePresentation
|
|
338
|
+
$settings = $presentation.SlideShowSettings
|
|
339
|
+
$settings.StartingSlide = ${fromSlide}
|
|
340
|
+
$settings.Run()
|
|
341
|
+
@{ success = $true; message = "Slideshow started from slide ${fromSlide}" } | ConvertTo-Json -Compress
|
|
342
|
+
`);
|
|
343
|
+
}
|
|
344
|
+
async powerpointClose(save = false) {
|
|
345
|
+
return this.executePowerShell(`
|
|
346
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
347
|
+
$presentation = $ppt.ActivePresentation
|
|
348
|
+
${save ? '$presentation.Save()' : ''}
|
|
349
|
+
$presentation.Close()
|
|
350
|
+
@{ success = $true; message = "Presentation closed" } | ConvertTo-Json -Compress
|
|
351
|
+
`);
|
|
352
|
+
}
|
|
353
|
+
async powerpointQuit(save = false) {
|
|
354
|
+
return this.executePowerShell(`
|
|
355
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
356
|
+
${save ? `
|
|
357
|
+
foreach ($pres in $ppt.Presentations) {
|
|
358
|
+
$pres.Save()
|
|
359
|
+
}` : ''}
|
|
360
|
+
$ppt.Quit()
|
|
361
|
+
@{ success = $true; message = "PowerPoint closed" } | ConvertTo-Json -Compress
|
|
362
|
+
`);
|
|
363
|
+
}
|
|
364
|
+
async powerpointScreenshot() {
|
|
365
|
+
const result = await this.executePowerShell(`
|
|
366
|
+
Add-Type -AssemblyName System.Windows.Forms
|
|
367
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
368
|
+
$presentation = $ppt.ActivePresentation
|
|
369
|
+
$slide = $presentation.Slides($ppt.ActiveWindow.View.Slide.SlideIndex)
|
|
370
|
+
|
|
371
|
+
# Export slide as image
|
|
372
|
+
$tempPath = [System.IO.Path]::GetTempFileName() + ".png"
|
|
373
|
+
$slide.Export($tempPath, "PNG")
|
|
374
|
+
|
|
375
|
+
# Read and convert to base64
|
|
376
|
+
$bytes = [System.IO.File]::ReadAllBytes($tempPath)
|
|
377
|
+
$base64 = [Convert]::ToBase64String($bytes)
|
|
378
|
+
|
|
379
|
+
# Clean up
|
|
380
|
+
Remove-Item $tempPath -Force
|
|
381
|
+
|
|
382
|
+
@{
|
|
383
|
+
success = $true
|
|
384
|
+
image = $base64
|
|
385
|
+
format = "png"
|
|
386
|
+
encoding = "base64"
|
|
387
|
+
} | ConvertTo-Json -Compress
|
|
388
|
+
`);
|
|
389
|
+
return result;
|
|
390
|
+
}
|
|
391
|
+
async powerpointAddTable(slideNumber, rows, cols, left = 100, top = 100, width = 400, height = 200, data) {
|
|
392
|
+
if (data) {
|
|
393
|
+
rows = Math.max(rows, data.length);
|
|
394
|
+
cols = Math.max(cols, ...data.map(row => row?.length || 0));
|
|
395
|
+
}
|
|
396
|
+
let dataScript = '';
|
|
397
|
+
if (data) {
|
|
398
|
+
const dataLines = [];
|
|
399
|
+
for (let i = 0; i < data.length && i < rows; i++) {
|
|
400
|
+
const row = data[i];
|
|
401
|
+
if (!row)
|
|
402
|
+
continue;
|
|
403
|
+
for (let j = 0; j < row.length && j < cols; j++) {
|
|
404
|
+
const cellValue = row[j];
|
|
405
|
+
if (cellValue === undefined)
|
|
406
|
+
continue;
|
|
407
|
+
const cellHasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(cellValue);
|
|
408
|
+
const val = cellValue.replace(/'/g, "''");
|
|
409
|
+
dataLines.push(`$table.Cell(${i + 1}, ${j + 1}).Shape.TextFrame.TextRange.Text = ('${val}' -replace '\\\\n', [char]10 -replace '\\n', [char]10)`);
|
|
410
|
+
if (cellHasKorean) {
|
|
411
|
+
dataLines.push(`$table.Cell(${i + 1}, ${j + 1}).Shape.TextFrame.TextRange.Font.Name = 'Malgun Gothic'`);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
dataScript = dataLines.join('\n');
|
|
416
|
+
}
|
|
417
|
+
return this.executePowerShell(`
|
|
418
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
419
|
+
$presentation = $ppt.ActivePresentation
|
|
420
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
421
|
+
$table = $slide.Shapes.AddTable(${rows}, ${cols}, ${left}, ${top}, ${width}, ${height}).Table
|
|
422
|
+
${dataScript}
|
|
423
|
+
@{ success = $true; message = "Table added with ${rows} rows and ${cols} columns"; shape_index = $slide.Shapes.Count } | ConvertTo-Json -Compress
|
|
424
|
+
`);
|
|
425
|
+
}
|
|
426
|
+
async powerpointSetTableCell(slideNumber, shapeIndex, row, col, text, options) {
|
|
427
|
+
const escapedText = text.replace(/'/g, "''");
|
|
428
|
+
const hasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(text);
|
|
429
|
+
const fontName = options?.fontName || (hasKorean ? 'Malgun Gothic' : '');
|
|
430
|
+
const formatCommands = [];
|
|
431
|
+
if (fontName)
|
|
432
|
+
formatCommands.push(`$cell.Shape.TextFrame.TextRange.Font.Name = '${fontName}'`);
|
|
433
|
+
if (options?.fontSize)
|
|
434
|
+
formatCommands.push(`$cell.Shape.TextFrame.TextRange.Font.Size = ${options.fontSize}`);
|
|
435
|
+
if (options?.bold !== undefined)
|
|
436
|
+
formatCommands.push(`$cell.Shape.TextFrame.TextRange.Font.Bold = ${options.bold ? '-1' : '0'}`);
|
|
437
|
+
if (options?.fillColor) {
|
|
438
|
+
const rgb = this.hexToRgb(options.fillColor);
|
|
439
|
+
if (rgb)
|
|
440
|
+
formatCommands.push(`$cell.Shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
441
|
+
}
|
|
442
|
+
return this.executePowerShell(`
|
|
443
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
444
|
+
$presentation = $ppt.ActivePresentation
|
|
445
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
446
|
+
$table = $slide.Shapes(${shapeIndex}).Table
|
|
447
|
+
$cell = $table.Cell(${row}, ${col})
|
|
448
|
+
$textContent = '${escapedText}' -replace '\\\\n', [char]10 -replace '\\n', [char]10
|
|
449
|
+
$cell.Shape.TextFrame.TextRange.Text = $textContent
|
|
450
|
+
${formatCommands.join('\n')}
|
|
451
|
+
@{ success = $true; message = "Table cell (${row}, ${col}) updated" } | ConvertTo-Json -Compress
|
|
452
|
+
`);
|
|
453
|
+
}
|
|
454
|
+
async powerpointSetTableStyle(slideNumber, shapeIndex, options) {
|
|
455
|
+
const commands = [];
|
|
456
|
+
if (options.borderColor) {
|
|
457
|
+
const rgb = this.hexToRgb(options.borderColor);
|
|
458
|
+
if (rgb) {
|
|
459
|
+
commands.push(`
|
|
460
|
+
for ($r = 1; $r -le $table.Rows.Count; $r++) {
|
|
461
|
+
for ($c = 1; $c -le $table.Columns.Count; $c++) {
|
|
462
|
+
$cell = $table.Cell($r, $c)
|
|
463
|
+
$cell.Borders(1).ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
464
|
+
$cell.Borders(2).ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
465
|
+
$cell.Borders(3).ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
466
|
+
$cell.Borders(4).ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
467
|
+
}
|
|
468
|
+
}`);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (options.headerRowFill) {
|
|
472
|
+
const rgb = this.hexToRgb(options.headerRowFill);
|
|
473
|
+
if (rgb) {
|
|
474
|
+
commands.push(`
|
|
475
|
+
for ($c = 1; $c -le $table.Columns.Count; $c++) {
|
|
476
|
+
$table.Cell(1, $c).Shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
477
|
+
}`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
if (options.alternateRowFill) {
|
|
481
|
+
const rgb = this.hexToRgb(options.alternateRowFill);
|
|
482
|
+
if (rgb) {
|
|
483
|
+
commands.push(`
|
|
484
|
+
for ($r = 2; $r -le $table.Rows.Count; $r += 2) {
|
|
485
|
+
for ($c = 1; $c -le $table.Columns.Count; $c++) {
|
|
486
|
+
$table.Cell($r, $c).Shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}
|
|
487
|
+
}
|
|
488
|
+
}`);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return this.executePowerShell(`
|
|
492
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
493
|
+
$presentation = $ppt.ActivePresentation
|
|
494
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
495
|
+
$table = $slide.Shapes(${shapeIndex}).Table
|
|
496
|
+
${commands.join('\n')}
|
|
497
|
+
@{ success = $true; message = "Table style updated" } | ConvertTo-Json -Compress
|
|
498
|
+
`);
|
|
499
|
+
}
|
|
500
|
+
async powerpointDeleteShape(slideNumber, shapeIndex) {
|
|
501
|
+
return this.executePowerShell(`
|
|
502
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
503
|
+
$presentation = $ppt.ActivePresentation
|
|
504
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
505
|
+
$slide.Shapes(${shapeIndex}).Delete()
|
|
506
|
+
@{ success = $true; message = "Shape ${shapeIndex} deleted from slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
507
|
+
`);
|
|
508
|
+
}
|
|
509
|
+
async powerpointDuplicateShape(slideNumber, shapeIndex) {
|
|
510
|
+
return this.executePowerShell(`
|
|
511
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
512
|
+
$presentation = $ppt.ActivePresentation
|
|
513
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
514
|
+
$newShape = $slide.Shapes(${shapeIndex}).Duplicate()
|
|
515
|
+
@{ success = $true; message = "Shape duplicated"; new_shape_index = $newShape.Index } | ConvertTo-Json -Compress
|
|
516
|
+
`);
|
|
517
|
+
}
|
|
518
|
+
async powerpointRotateShape(slideNumber, shapeIndex, angle) {
|
|
519
|
+
return this.executePowerShell(`
|
|
520
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
521
|
+
$presentation = $ppt.ActivePresentation
|
|
522
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
523
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
524
|
+
$shape.Rotation = ${angle}
|
|
525
|
+
@{ success = $true; message = "Shape rotated to ${angle} degrees" } | ConvertTo-Json -Compress
|
|
526
|
+
`);
|
|
527
|
+
}
|
|
528
|
+
async powerpointGetShapeInfo(slideNumber, shapeIndex) {
|
|
529
|
+
return this.executePowerShell(`
|
|
530
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
531
|
+
$presentation = $ppt.ActivePresentation
|
|
532
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
533
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
534
|
+
@{
|
|
535
|
+
success = $true
|
|
536
|
+
name = $shape.Name
|
|
537
|
+
type = $shape.Type
|
|
538
|
+
left = $shape.Left
|
|
539
|
+
top = $shape.Top
|
|
540
|
+
width = $shape.Width
|
|
541
|
+
height = $shape.Height
|
|
542
|
+
rotation = $shape.Rotation
|
|
543
|
+
visible = $shape.Visible
|
|
544
|
+
has_text = $shape.HasTextFrame
|
|
545
|
+
} | ConvertTo-Json -Compress
|
|
546
|
+
`);
|
|
547
|
+
}
|
|
548
|
+
async powerpointSetShapeName(slideNumber, shapeIndex, name) {
|
|
549
|
+
const escapedName = name.replace(/'/g, "''");
|
|
550
|
+
return this.executePowerShell(`
|
|
551
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
552
|
+
$presentation = $ppt.ActivePresentation
|
|
553
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
554
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
555
|
+
$shape.Name = '${escapedName}'
|
|
556
|
+
@{ success = $true; message = "Shape name set to '${escapedName}'" } | ConvertTo-Json -Compress
|
|
557
|
+
`);
|
|
558
|
+
}
|
|
559
|
+
async powerpointSetShapeOpacity(slideNumber, shapeIndex, opacity) {
|
|
560
|
+
const transparency = 1 - (opacity / 100);
|
|
561
|
+
return this.executePowerShell(`
|
|
562
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
563
|
+
$presentation = $ppt.ActivePresentation
|
|
564
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
565
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
566
|
+
$shape.Fill.Transparency = ${transparency}
|
|
567
|
+
@{ success = $true; message = "Shape opacity set to ${opacity}%" } | ConvertTo-Json -Compress
|
|
568
|
+
`);
|
|
569
|
+
}
|
|
570
|
+
async powerpointGetShapeList(slideNumber) {
|
|
571
|
+
return this.executePowerShell(`
|
|
572
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
573
|
+
$presentation = $ppt.ActivePresentation
|
|
574
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
575
|
+
$shapes = @()
|
|
576
|
+
for ($i = 1; $i -le $slide.Shapes.Count; $i++) {
|
|
577
|
+
$s = $slide.Shapes($i)
|
|
578
|
+
$shapes += @{
|
|
579
|
+
index = $i
|
|
580
|
+
name = $s.Name
|
|
581
|
+
type = $s.Type
|
|
582
|
+
left = $s.Left
|
|
583
|
+
top = $s.Top
|
|
584
|
+
width = $s.Width
|
|
585
|
+
height = $s.Height
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
@{ success = $true; slide = ${slideNumber}; count = $slide.Shapes.Count; shapes = $shapes } | ConvertTo-Json -Compress -Depth 5
|
|
589
|
+
`);
|
|
590
|
+
}
|
|
591
|
+
async powerpointSetShapePosition(slideNumber, shapeIndex, left, top) {
|
|
592
|
+
return this.executePowerShell(`
|
|
593
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
594
|
+
$presentation = $ppt.ActivePresentation
|
|
595
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
596
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
597
|
+
$shape.Left = ${left}
|
|
598
|
+
$shape.Top = ${top}
|
|
599
|
+
@{ success = $true; message = "Shape position set to (${left}, ${top})" } | ConvertTo-Json -Compress
|
|
600
|
+
`);
|
|
601
|
+
}
|
|
602
|
+
async powerpointSetShapeSize(slideNumber, shapeIndex, width, height, lockAspectRatio = false) {
|
|
603
|
+
return this.executePowerShell(`
|
|
604
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
605
|
+
$presentation = $ppt.ActivePresentation
|
|
606
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
607
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
608
|
+
$shape.LockAspectRatio = ${lockAspectRatio ? '-1' : '0'}
|
|
609
|
+
$shape.Width = ${width}
|
|
610
|
+
$shape.Height = ${height}
|
|
611
|
+
@{ success = $true; message = "Shape size set to ${width}x${height}" } | ConvertTo-Json -Compress
|
|
612
|
+
`);
|
|
613
|
+
}
|
|
614
|
+
async powerpointSetShapeStyle(slideNumber, shapeIndex, options) {
|
|
615
|
+
const commands = [];
|
|
616
|
+
if (options.noFill) {
|
|
617
|
+
commands.push('$shape.Fill.Visible = 0');
|
|
618
|
+
}
|
|
619
|
+
else if (options.fillColor) {
|
|
620
|
+
const rgb = this.hexToRgb(options.fillColor);
|
|
621
|
+
if (rgb) {
|
|
622
|
+
commands.push('$shape.Fill.Visible = -1');
|
|
623
|
+
commands.push('$shape.Fill.Solid()');
|
|
624
|
+
commands.push(`$shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
if (options.fillTransparency !== undefined) {
|
|
628
|
+
commands.push(`$shape.Fill.Transparency = ${options.fillTransparency / 100}`);
|
|
629
|
+
}
|
|
630
|
+
if (options.noLine) {
|
|
631
|
+
commands.push('$shape.Line.Visible = 0');
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
if (options.lineColor) {
|
|
635
|
+
const rgb = this.hexToRgb(options.lineColor);
|
|
636
|
+
if (rgb) {
|
|
637
|
+
commands.push('$shape.Line.Visible = -1');
|
|
638
|
+
commands.push(`$shape.Line.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (options.lineWeight !== undefined) {
|
|
642
|
+
commands.push(`$shape.Line.Weight = ${options.lineWeight}`);
|
|
643
|
+
}
|
|
644
|
+
if (options.lineStyle) {
|
|
645
|
+
const styleMap = { solid: 1, dash: 4, dot: 2, dashDot: 5 };
|
|
646
|
+
commands.push(`$shape.Line.DashStyle = ${styleMap[options.lineStyle]}`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
return this.executePowerShell(`
|
|
650
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
651
|
+
$presentation = $ppt.ActivePresentation
|
|
652
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
653
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
654
|
+
${commands.join('\n')}
|
|
655
|
+
@{ success = $true; message = "Shape style updated" } | ConvertTo-Json -Compress
|
|
656
|
+
`);
|
|
657
|
+
}
|
|
658
|
+
async powerpointBringToFront(slideNumber, shapeIndex) {
|
|
659
|
+
return this.executePowerShell(`
|
|
660
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
661
|
+
$presentation = $ppt.ActivePresentation
|
|
662
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
663
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
664
|
+
$shape.ZOrder(0) # msoBringToFront = 0
|
|
665
|
+
@{ success = $true; message = "Shape brought to front" } | ConvertTo-Json -Compress
|
|
666
|
+
`);
|
|
667
|
+
}
|
|
668
|
+
async powerpointSendToBack(slideNumber, shapeIndex) {
|
|
669
|
+
return this.executePowerShell(`
|
|
670
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
671
|
+
$presentation = $ppt.ActivePresentation
|
|
672
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
673
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
674
|
+
$shape.ZOrder(1) # msoSendToBack = 1
|
|
675
|
+
@{ success = $true; message = "Shape sent to back" } | ConvertTo-Json -Compress
|
|
676
|
+
`);
|
|
677
|
+
}
|
|
678
|
+
async powerpointBringForward(slideNumber, shapeIndex) {
|
|
679
|
+
return this.executePowerShell(`
|
|
680
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
681
|
+
$presentation = $ppt.ActivePresentation
|
|
682
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
683
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
684
|
+
$shape.ZOrder(2) # msoBringForward = 2
|
|
685
|
+
@{ success = $true; message = "Shape brought forward" } | ConvertTo-Json -Compress
|
|
686
|
+
`);
|
|
687
|
+
}
|
|
688
|
+
async powerpointSendBackward(slideNumber, shapeIndex) {
|
|
689
|
+
return this.executePowerShell(`
|
|
690
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
691
|
+
$presentation = $ppt.ActivePresentation
|
|
692
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
693
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
694
|
+
$shape.ZOrder(3) # msoSendBackward = 3
|
|
695
|
+
@{ success = $true; message = "Shape sent backward" } | ConvertTo-Json -Compress
|
|
696
|
+
`);
|
|
697
|
+
}
|
|
698
|
+
async powerpointAlignShapes(slideNumber, shapeIndices, alignment) {
|
|
699
|
+
const alignMap = {
|
|
700
|
+
left: 0,
|
|
701
|
+
center: 1,
|
|
702
|
+
right: 2,
|
|
703
|
+
top: 3,
|
|
704
|
+
middle: 4,
|
|
705
|
+
bottom: 5,
|
|
706
|
+
};
|
|
707
|
+
return this.executePowerShell(`
|
|
708
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
709
|
+
$presentation = $ppt.ActivePresentation
|
|
710
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
711
|
+
$shapeRange = $slide.Shapes.Range(@(${shapeIndices.join(', ')}))
|
|
712
|
+
$shapeRange.Align(${alignMap[alignment]}, 0) # 0 = msoFalse (relative to slide)
|
|
713
|
+
@{ success = $true; message = "Shapes aligned to ${alignment}" } | ConvertTo-Json -Compress
|
|
714
|
+
`);
|
|
715
|
+
}
|
|
716
|
+
async powerpointDistributeShapes(slideNumber, shapeIndices, direction) {
|
|
717
|
+
const distributeType = direction === 'horizontal' ? 0 : 1;
|
|
718
|
+
return this.executePowerShell(`
|
|
719
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
720
|
+
$presentation = $ppt.ActivePresentation
|
|
721
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
722
|
+
$shapeRange = $slide.Shapes.Range(@(${shapeIndices.join(', ')}))
|
|
723
|
+
$shapeRange.Distribute(${distributeType}, 0)
|
|
724
|
+
@{ success = $true; message = "Shapes distributed ${direction}ly" } | ConvertTo-Json -Compress
|
|
725
|
+
`);
|
|
726
|
+
}
|
|
727
|
+
async powerpointSetSlideLayout(slideNumber, layoutIndex) {
|
|
728
|
+
return this.executePowerShell(`
|
|
729
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
730
|
+
$presentation = $ppt.ActivePresentation
|
|
731
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
732
|
+
$slide.Layout = ${layoutIndex}
|
|
733
|
+
@{ success = $true; message = "Slide layout set to ${layoutIndex}" } | ConvertTo-Json -Compress
|
|
734
|
+
`);
|
|
735
|
+
}
|
|
736
|
+
async powerpointDuplicateSlide(slideNumber) {
|
|
737
|
+
return this.executePowerShell(`
|
|
738
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
739
|
+
$presentation = $ppt.ActivePresentation
|
|
740
|
+
$newSlide = $presentation.Slides(${slideNumber}).Duplicate()
|
|
741
|
+
@{ success = $true; message = "Slide ${slideNumber} duplicated"; new_slide_index = $newSlide.SlideIndex } | ConvertTo-Json -Compress
|
|
742
|
+
`);
|
|
743
|
+
}
|
|
744
|
+
async powerpointHideSlide(slideNumber) {
|
|
745
|
+
return this.executePowerShell(`
|
|
746
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
747
|
+
$presentation = $ppt.ActivePresentation
|
|
748
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
749
|
+
$slide.SlideShowTransition.Hidden = -1
|
|
750
|
+
@{ success = $true; message = "Slide ${slideNumber} hidden" } | ConvertTo-Json -Compress
|
|
751
|
+
`);
|
|
752
|
+
}
|
|
753
|
+
async powerpointShowSlide(slideNumber) {
|
|
754
|
+
return this.executePowerShell(`
|
|
755
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
756
|
+
$presentation = $ppt.ActivePresentation
|
|
757
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
758
|
+
$slide.SlideShowTransition.Hidden = 0
|
|
759
|
+
@{ success = $true; message = "Slide ${slideNumber} shown" } | ConvertTo-Json -Compress
|
|
760
|
+
`);
|
|
761
|
+
}
|
|
762
|
+
async powerpointAddSection(sectionName, beforeSlide) {
|
|
763
|
+
const escapedName = sectionName.replace(/'/g, "''");
|
|
764
|
+
return this.executePowerShell(`
|
|
765
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
766
|
+
$presentation = $ppt.ActivePresentation
|
|
767
|
+
$sectionIndex = $presentation.SectionProperties.AddBeforeSlide(${beforeSlide}, '${escapedName}')
|
|
768
|
+
@{ success = $true; message = "Section '${escapedName}' added"; section_index = $sectionIndex } | ConvertTo-Json -Compress
|
|
769
|
+
`);
|
|
770
|
+
}
|
|
771
|
+
async powerpointDeleteSection(sectionIndex, deleteSlides = false) {
|
|
772
|
+
return this.executePowerShell(`
|
|
773
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
774
|
+
$presentation = $ppt.ActivePresentation
|
|
775
|
+
$presentation.SectionProperties.Delete(${sectionIndex}, ${deleteSlides ? '-1' : '0'})
|
|
776
|
+
@{ success = $true; message = "Section ${sectionIndex} deleted" } | ConvertTo-Json -Compress
|
|
777
|
+
`);
|
|
778
|
+
}
|
|
779
|
+
async powerpointGetSections() {
|
|
780
|
+
return this.executePowerShell(`
|
|
781
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
782
|
+
$presentation = $ppt.ActivePresentation
|
|
783
|
+
$sections = @()
|
|
784
|
+
for ($i = 1; $i -le $presentation.SectionProperties.Count; $i++) {
|
|
785
|
+
$sections += @{
|
|
786
|
+
index = $i
|
|
787
|
+
name = $presentation.SectionProperties.Name($i)
|
|
788
|
+
firstSlide = $presentation.SectionProperties.FirstSlide($i)
|
|
789
|
+
slideCount = $presentation.SectionProperties.SlidesCount($i)
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
@{ success = $true; count = $presentation.SectionProperties.Count; sections = $sections } | ConvertTo-Json -Compress -Depth 5
|
|
793
|
+
`);
|
|
794
|
+
}
|
|
795
|
+
async powerpointAddNote(slideNumber, noteText) {
|
|
796
|
+
const escapedText = noteText.replace(/'/g, "''");
|
|
797
|
+
const hasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(noteText);
|
|
798
|
+
return this.executePowerShell(`
|
|
799
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
800
|
+
$presentation = $ppt.ActivePresentation
|
|
801
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
802
|
+
$noteRange = $slide.NotesPage.Shapes.Placeholders(2).TextFrame.TextRange
|
|
803
|
+
$textContent = '${escapedText}' -replace '\\\\n', [char]10 -replace '\\n', [char]10
|
|
804
|
+
$noteRange.Text = $textContent
|
|
805
|
+
${hasKorean ? "$noteRange.Font.Name = 'Malgun Gothic'" : ''}
|
|
806
|
+
@{ success = $true; message = "Note added to slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
807
|
+
`);
|
|
808
|
+
}
|
|
809
|
+
async powerpointGetNote(slideNumber) {
|
|
810
|
+
return this.executePowerShell(`
|
|
811
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
812
|
+
$presentation = $ppt.ActivePresentation
|
|
813
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
814
|
+
$noteText = $slide.NotesPage.Shapes.Placeholders(2).TextFrame.TextRange.Text
|
|
815
|
+
@{ success = $true; slide = ${slideNumber}; note = $noteText } | ConvertTo-Json -Compress
|
|
816
|
+
`);
|
|
817
|
+
}
|
|
818
|
+
async powerpointGroupShapes(slideNumber, shapeIndices) {
|
|
819
|
+
return this.executePowerShell(`
|
|
820
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
821
|
+
$presentation = $ppt.ActivePresentation
|
|
822
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
823
|
+
$shapeRange = $slide.Shapes.Range(@(${shapeIndices.join(', ')}))
|
|
824
|
+
$group = $shapeRange.Group()
|
|
825
|
+
@{ success = $true; message = "Shapes grouped"; group_index = $group.Index } | ConvertTo-Json -Compress
|
|
826
|
+
`);
|
|
827
|
+
}
|
|
828
|
+
async powerpointUngroupShapes(slideNumber, groupIndex) {
|
|
829
|
+
return this.executePowerShell(`
|
|
830
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
831
|
+
$presentation = $ppt.ActivePresentation
|
|
832
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
833
|
+
$group = $slide.Shapes(${groupIndex})
|
|
834
|
+
$shapeRange = $group.Ungroup()
|
|
835
|
+
@{ success = $true; message = "Group ungrouped"; shape_count = $shapeRange.Count } | ConvertTo-Json -Compress
|
|
836
|
+
`);
|
|
837
|
+
}
|
|
838
|
+
async powerpointSetTextAlignment(slideNumber, shapeIndex, horizontal, vertical) {
|
|
839
|
+
const hAlignMap = { left: 1, center: 2, right: 3, justify: 4 };
|
|
840
|
+
const vAlignMap = { top: 1, middle: 3, bottom: 4 };
|
|
841
|
+
const commands = [];
|
|
842
|
+
commands.push(`$shape.TextFrame.TextRange.ParagraphFormat.Alignment = ${hAlignMap[horizontal]}`);
|
|
843
|
+
if (vertical) {
|
|
844
|
+
commands.push(`$shape.TextFrame.VerticalAnchor = ${vAlignMap[vertical]}`);
|
|
845
|
+
}
|
|
846
|
+
return this.executePowerShell(`
|
|
847
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
848
|
+
$presentation = $ppt.ActivePresentation
|
|
849
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
850
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
851
|
+
${commands.join('\n')}
|
|
852
|
+
@{ success = $true; message = "Text alignment set" } | ConvertTo-Json -Compress
|
|
853
|
+
`);
|
|
854
|
+
}
|
|
855
|
+
async powerpointSetBulletList(slideNumber, shapeIndex, bulletType, bulletChar) {
|
|
856
|
+
const typeMap = { none: 0, bullet: 1, numbered: 2 };
|
|
857
|
+
let bulletScript = `$shape.TextFrame.TextRange.ParagraphFormat.Bullet.Type = ${typeMap[bulletType]}`;
|
|
858
|
+
if (bulletType === 'bullet' && bulletChar) {
|
|
859
|
+
bulletScript += `\n$shape.TextFrame.TextRange.ParagraphFormat.Bullet.Character = [int][char]'${bulletChar}'`;
|
|
860
|
+
}
|
|
861
|
+
return this.executePowerShell(`
|
|
862
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
863
|
+
$presentation = $ppt.ActivePresentation
|
|
864
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
865
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
866
|
+
${bulletScript}
|
|
867
|
+
@{ success = $true; message = "Bullet style set to ${bulletType}" } | ConvertTo-Json -Compress
|
|
868
|
+
`);
|
|
869
|
+
}
|
|
870
|
+
async powerpointSetLineSpacing(slideNumber, shapeIndex, lineSpacing, spaceAfter, spaceBefore) {
|
|
871
|
+
const commands = [];
|
|
872
|
+
commands.push(`$shape.TextFrame.TextRange.ParagraphFormat.LineRuleWithin = 0`);
|
|
873
|
+
commands.push(`$shape.TextFrame.TextRange.ParagraphFormat.SpaceWithin = ${lineSpacing}`);
|
|
874
|
+
if (spaceAfter !== undefined) {
|
|
875
|
+
commands.push(`$shape.TextFrame.TextRange.ParagraphFormat.SpaceAfter = ${spaceAfter}`);
|
|
876
|
+
}
|
|
877
|
+
if (spaceBefore !== undefined) {
|
|
878
|
+
commands.push(`$shape.TextFrame.TextRange.ParagraphFormat.SpaceBefore = ${spaceBefore}`);
|
|
879
|
+
}
|
|
880
|
+
return this.executePowerShell(`
|
|
881
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
882
|
+
$presentation = $ppt.ActivePresentation
|
|
883
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
884
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
885
|
+
${commands.join('\n')}
|
|
886
|
+
@{ success = $true; message = "Line spacing set to ${lineSpacing}" } | ConvertTo-Json -Compress
|
|
887
|
+
`);
|
|
888
|
+
}
|
|
889
|
+
async powerpointSetTextboxBorder(slideNumber, shapeIndex, options) {
|
|
890
|
+
const commands = [];
|
|
891
|
+
if (options.visible === false) {
|
|
892
|
+
commands.push('$shape.Line.Visible = 0');
|
|
893
|
+
}
|
|
894
|
+
else {
|
|
895
|
+
commands.push('$shape.Line.Visible = -1');
|
|
896
|
+
if (options.color) {
|
|
897
|
+
const rgb = this.hexToRgb(options.color);
|
|
898
|
+
if (rgb)
|
|
899
|
+
commands.push(`$shape.Line.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
900
|
+
}
|
|
901
|
+
if (options.weight !== undefined)
|
|
902
|
+
commands.push(`$shape.Line.Weight = ${options.weight}`);
|
|
903
|
+
if (options.style) {
|
|
904
|
+
const styleMap = { solid: 1, dash: 4, dot: 2 };
|
|
905
|
+
commands.push(`$shape.Line.DashStyle = ${styleMap[options.style]}`);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
return this.executePowerShell(`
|
|
909
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
910
|
+
$presentation = $ppt.ActivePresentation
|
|
911
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
912
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
913
|
+
${commands.join('\n')}
|
|
914
|
+
@{ success = $true; message = "Textbox border updated" } | ConvertTo-Json -Compress
|
|
915
|
+
`);
|
|
916
|
+
}
|
|
917
|
+
async powerpointSetTextboxFill(slideNumber, shapeIndex, options) {
|
|
918
|
+
const commands = [];
|
|
919
|
+
if (options.visible === false) {
|
|
920
|
+
commands.push('$shape.Fill.Visible = 0');
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
commands.push('$shape.Fill.Visible = -1');
|
|
924
|
+
commands.push('$shape.Fill.Solid()');
|
|
925
|
+
if (options.color) {
|
|
926
|
+
const rgb = this.hexToRgb(options.color);
|
|
927
|
+
if (rgb)
|
|
928
|
+
commands.push(`$shape.Fill.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
929
|
+
}
|
|
930
|
+
if (options.transparency !== undefined) {
|
|
931
|
+
commands.push(`$shape.Fill.Transparency = ${options.transparency / 100}`);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
return this.executePowerShell(`
|
|
935
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
936
|
+
$presentation = $ppt.ActivePresentation
|
|
937
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
938
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
939
|
+
${commands.join('\n')}
|
|
940
|
+
@{ success = $true; message = "Textbox fill updated" } | ConvertTo-Json -Compress
|
|
941
|
+
`);
|
|
942
|
+
}
|
|
943
|
+
async powerpointAddHyperlink(slideNumber, shapeIndex, url, screenTip) {
|
|
944
|
+
const escapedUrl = url.replace(/'/g, "''");
|
|
945
|
+
const escapedTip = screenTip?.replace(/'/g, "''") || '';
|
|
946
|
+
return this.executePowerShell(`
|
|
947
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
948
|
+
$presentation = $ppt.ActivePresentation
|
|
949
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
950
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
951
|
+
$link = $shape.ActionSettings(1).Hyperlink
|
|
952
|
+
$link.Address = '${escapedUrl}'
|
|
953
|
+
${escapedTip ? `$link.ScreenTip = '${escapedTip}'` : ''}
|
|
954
|
+
@{ success = $true; message = "Hyperlink added to shape" } | ConvertTo-Json -Compress
|
|
955
|
+
`);
|
|
956
|
+
}
|
|
957
|
+
async powerpointAddVideo(slideNumber, videoPath, left = 100, top = 100, width = 400, height = 300) {
|
|
958
|
+
const windowsPath = this.toWindowsPath(videoPath).replace(/'/g, "''");
|
|
959
|
+
return this.executePowerShell(`
|
|
960
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
961
|
+
$presentation = $ppt.ActivePresentation
|
|
962
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
963
|
+
$video = $slide.Shapes.AddMediaObject2('${windowsPath}', 0, -1, ${left}, ${top}, ${width}, ${height})
|
|
964
|
+
@{ success = $true; message = "Video added to slide ${slideNumber}"; shape_index = $video.Index } | ConvertTo-Json -Compress
|
|
965
|
+
`);
|
|
966
|
+
}
|
|
967
|
+
async powerpointAddAudio(slideNumber, audioPath, left = 100, top = 100, playInBackground = false) {
|
|
968
|
+
const windowsPath = this.toWindowsPath(audioPath).replace(/'/g, "''");
|
|
969
|
+
const bgScript = playInBackground ? `
|
|
970
|
+
$audio.AnimationSettings.PlaySettings.PlayOnEntry = -1
|
|
971
|
+
$audio.AnimationSettings.PlaySettings.HideWhileNotPlaying = -1
|
|
972
|
+
$audio.AnimationSettings.PlaySettings.LoopUntilStopped = 0
|
|
973
|
+
` : '';
|
|
974
|
+
return this.executePowerShell(`
|
|
975
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
976
|
+
$presentation = $ppt.ActivePresentation
|
|
977
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
978
|
+
$audio = $slide.Shapes.AddMediaObject2('${windowsPath}', 0, -1, ${left}, ${top})
|
|
979
|
+
${bgScript}
|
|
980
|
+
@{ success = $true; message = "Audio added to slide ${slideNumber}"; shape_index = $audio.Index } | ConvertTo-Json -Compress
|
|
981
|
+
`);
|
|
982
|
+
}
|
|
983
|
+
async powerpointAddChart(slideNumber, chartType, left = 100, top = 100, width = 400, height = 300, data) {
|
|
984
|
+
const chartTypeMap = {
|
|
985
|
+
column: 51,
|
|
986
|
+
bar: 57,
|
|
987
|
+
line: 4,
|
|
988
|
+
pie: 5,
|
|
989
|
+
area: 1,
|
|
990
|
+
scatter: -4169,
|
|
991
|
+
};
|
|
992
|
+
let dataScript = '';
|
|
993
|
+
if (data) {
|
|
994
|
+
const rows = data.series.length + 1;
|
|
995
|
+
const cols = data.categories.length + 1;
|
|
996
|
+
dataScript = `
|
|
997
|
+
$chart.ChartData.Activate()
|
|
998
|
+
$workbook = $chart.ChartData.Workbook
|
|
999
|
+
$sheet = $workbook.Worksheets(1)
|
|
1000
|
+
$sheet.Cells.Clear()
|
|
1001
|
+
`;
|
|
1002
|
+
for (let i = 0; i < data.categories.length; i++) {
|
|
1003
|
+
const cat = data.categories[i]?.replace(/'/g, "''") || '';
|
|
1004
|
+
dataScript += `$sheet.Cells(1, ${i + 2}).Value = '${cat}'\n`;
|
|
1005
|
+
}
|
|
1006
|
+
for (let s = 0; s < data.series.length; s++) {
|
|
1007
|
+
const series = data.series[s];
|
|
1008
|
+
if (!series)
|
|
1009
|
+
continue;
|
|
1010
|
+
dataScript += `$sheet.Cells(${s + 2}, 1).Value = '${series.name.replace(/'/g, "''")}'\n`;
|
|
1011
|
+
for (let v = 0; v < series.values.length; v++) {
|
|
1012
|
+
dataScript += `$sheet.Cells(${s + 2}, ${v + 2}).Value = ${series.values[v]}\n`;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
dataScript += `
|
|
1016
|
+
$chart.SetSourceData($sheet.Range($sheet.Cells(1,1), $sheet.Cells(${rows}, ${cols})))
|
|
1017
|
+
$workbook.Close()
|
|
1018
|
+
`;
|
|
1019
|
+
}
|
|
1020
|
+
return this.executePowerShell(`
|
|
1021
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1022
|
+
$presentation = $ppt.ActivePresentation
|
|
1023
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
1024
|
+
$chart = $slide.Shapes.AddChart2(-1, ${chartTypeMap[chartType]}, ${left}, ${top}, ${width}, ${height}).Chart
|
|
1025
|
+
${dataScript}
|
|
1026
|
+
@{ success = $true; message = "${chartType} chart added to slide ${slideNumber}"; shape_index = $slide.Shapes.Count } | ConvertTo-Json -Compress
|
|
1027
|
+
`);
|
|
1028
|
+
}
|
|
1029
|
+
async powerpointSetShadow(slideNumber, shapeIndex, options) {
|
|
1030
|
+
const commands = [];
|
|
1031
|
+
if (options.visible === false) {
|
|
1032
|
+
commands.push('$shape.Shadow.Visible = 0');
|
|
1033
|
+
}
|
|
1034
|
+
else {
|
|
1035
|
+
commands.push('$shape.Shadow.Visible = -1');
|
|
1036
|
+
if (options.type === 'inner') {
|
|
1037
|
+
commands.push('$shape.Shadow.Type = 21');
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
commands.push('$shape.Shadow.Type = 1');
|
|
1041
|
+
}
|
|
1042
|
+
if (options.color) {
|
|
1043
|
+
const rgb = this.hexToRgb(options.color);
|
|
1044
|
+
if (rgb)
|
|
1045
|
+
commands.push(`$shape.Shadow.ForeColor.RGB = ${rgb.r + rgb.g * 256 + rgb.b * 65536}`);
|
|
1046
|
+
}
|
|
1047
|
+
if (options.blur !== undefined)
|
|
1048
|
+
commands.push(`$shape.Shadow.Blur = ${options.blur}`);
|
|
1049
|
+
if (options.offsetX !== undefined)
|
|
1050
|
+
commands.push(`$shape.Shadow.OffsetX = ${options.offsetX}`);
|
|
1051
|
+
if (options.offsetY !== undefined)
|
|
1052
|
+
commands.push(`$shape.Shadow.OffsetY = ${options.offsetY}`);
|
|
1053
|
+
if (options.transparency !== undefined)
|
|
1054
|
+
commands.push(`$shape.Shadow.Transparency = ${options.transparency / 100}`);
|
|
1055
|
+
}
|
|
1056
|
+
return this.executePowerShell(`
|
|
1057
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1058
|
+
$presentation = $ppt.ActivePresentation
|
|
1059
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
1060
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
1061
|
+
${commands.join('\n')}
|
|
1062
|
+
@{ success = $true; message = "Shadow effect updated" } | ConvertTo-Json -Compress
|
|
1063
|
+
`);
|
|
1064
|
+
}
|
|
1065
|
+
async powerpointSetReflection(slideNumber, shapeIndex, options) {
|
|
1066
|
+
const commands = [];
|
|
1067
|
+
if (options.visible === false) {
|
|
1068
|
+
commands.push('$shape.Reflection.Type = 0');
|
|
1069
|
+
}
|
|
1070
|
+
else {
|
|
1071
|
+
commands.push(`$shape.Reflection.Type = ${options.type || 1}`);
|
|
1072
|
+
if (options.blur !== undefined)
|
|
1073
|
+
commands.push(`$shape.Reflection.Blur = ${options.blur}`);
|
|
1074
|
+
if (options.offset !== undefined)
|
|
1075
|
+
commands.push(`$shape.Reflection.Offset = ${options.offset}`);
|
|
1076
|
+
if (options.size !== undefined)
|
|
1077
|
+
commands.push(`$shape.Reflection.Size = ${options.size}`);
|
|
1078
|
+
if (options.transparency !== undefined)
|
|
1079
|
+
commands.push(`$shape.Reflection.Transparency = ${options.transparency / 100}`);
|
|
1080
|
+
}
|
|
1081
|
+
return this.executePowerShell(`
|
|
1082
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1083
|
+
$presentation = $ppt.ActivePresentation
|
|
1084
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
1085
|
+
$shape = $slide.Shapes(${shapeIndex})
|
|
1086
|
+
${commands.join('\n')}
|
|
1087
|
+
@{ success = $true; message = "Reflection effect updated" } | ConvertTo-Json -Compress
|
|
1088
|
+
`);
|
|
1089
|
+
}
|
|
1090
|
+
async powerpointApplyTheme(themePath) {
|
|
1091
|
+
const windowsPath = this.toWindowsPath(themePath).replace(/'/g, "''");
|
|
1092
|
+
return this.executePowerShell(`
|
|
1093
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1094
|
+
$presentation = $ppt.ActivePresentation
|
|
1095
|
+
$presentation.ApplyTheme('${windowsPath}')
|
|
1096
|
+
@{ success = $true; message = "Theme applied" } | ConvertTo-Json -Compress
|
|
1097
|
+
`);
|
|
1098
|
+
}
|
|
1099
|
+
async powerpointGetThemes() {
|
|
1100
|
+
return this.executePowerShell(`
|
|
1101
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1102
|
+
$themesPath = [Environment]::GetFolderPath('CommonDocuments') + '\\Microsoft\\Templates\\Document Themes'
|
|
1103
|
+
$themes = @()
|
|
1104
|
+
if (Test-Path $themesPath) {
|
|
1105
|
+
Get-ChildItem -Path $themesPath -Filter "*.thmx" | ForEach-Object {
|
|
1106
|
+
$themes += @{ name = $_.BaseName; path = $_.FullName }
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
# Also check user themes
|
|
1110
|
+
$userThemesPath = [Environment]::GetFolderPath('MyDocuments') + '\\Custom Office Templates'
|
|
1111
|
+
if (Test-Path $userThemesPath) {
|
|
1112
|
+
Get-ChildItem -Path $userThemesPath -Filter "*.thmx" -ErrorAction SilentlyContinue | ForEach-Object {
|
|
1113
|
+
$themes += @{ name = $_.BaseName; path = $_.FullName }
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
@{ success = $true; themes = $themes } | ConvertTo-Json -Compress -Depth 5
|
|
1117
|
+
`);
|
|
1118
|
+
}
|
|
1119
|
+
async powerpointSetPlaceholderText(slideNumber, placeholderType, text) {
|
|
1120
|
+
const escapedText = text.replace(/'/g, "''");
|
|
1121
|
+
const hasKorean = /[가-힣ㄱ-ㅎㅏ-ㅣ]/.test(text);
|
|
1122
|
+
const typeMap = {
|
|
1123
|
+
title: 1,
|
|
1124
|
+
subtitle: 4,
|
|
1125
|
+
body: 2,
|
|
1126
|
+
footer: 5,
|
|
1127
|
+
slideNumber: 6,
|
|
1128
|
+
date: 16,
|
|
1129
|
+
};
|
|
1130
|
+
return this.executePowerShell(`
|
|
1131
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1132
|
+
$presentation = $ppt.ActivePresentation
|
|
1133
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
1134
|
+
$placeholder = $null
|
|
1135
|
+
foreach ($shape in $slide.Shapes) {
|
|
1136
|
+
if ($shape.Type -eq 14) { # msoPlaceholder
|
|
1137
|
+
if ($shape.PlaceholderFormat.Type -eq ${typeMap[placeholderType]}) {
|
|
1138
|
+
$placeholder = $shape
|
|
1139
|
+
break
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
if ($placeholder) {
|
|
1144
|
+
$textContent = '${escapedText}' -replace '\\\\n', [char]10 -replace '\\n', [char]10
|
|
1145
|
+
$placeholder.TextFrame.TextRange.Text = $textContent
|
|
1146
|
+
${hasKorean ? "$placeholder.TextFrame.TextRange.Font.Name = 'Malgun Gothic'" : ''}
|
|
1147
|
+
@{ success = $true; message = "${placeholderType} placeholder text set" } | ConvertTo-Json -Compress
|
|
1148
|
+
} else {
|
|
1149
|
+
@{ success = $false; error = "Placeholder type '${placeholderType}' not found on slide ${slideNumber}" } | ConvertTo-Json -Compress
|
|
1150
|
+
}
|
|
1151
|
+
`);
|
|
1152
|
+
}
|
|
1153
|
+
async powerpointGetPlaceholders(slideNumber) {
|
|
1154
|
+
return this.executePowerShell(`
|
|
1155
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1156
|
+
$presentation = $ppt.ActivePresentation
|
|
1157
|
+
$slide = $presentation.Slides(${slideNumber})
|
|
1158
|
+
$placeholders = @()
|
|
1159
|
+
foreach ($shape in $slide.Shapes) {
|
|
1160
|
+
if ($shape.Type -eq 14) { # msoPlaceholder
|
|
1161
|
+
$placeholders += @{
|
|
1162
|
+
index = $shape.Index
|
|
1163
|
+
name = $shape.Name
|
|
1164
|
+
type = $shape.PlaceholderFormat.Type
|
|
1165
|
+
hasText = $shape.HasTextFrame
|
|
1166
|
+
text = if ($shape.HasTextFrame -eq -1) { $shape.TextFrame.TextRange.Text } else { "" }
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
@{ success = $true; slide = ${slideNumber}; placeholders = $placeholders } | ConvertTo-Json -Compress -Depth 5
|
|
1171
|
+
`);
|
|
1172
|
+
}
|
|
1173
|
+
async powerpointGetSlideLayouts() {
|
|
1174
|
+
return this.executePowerShell(`
|
|
1175
|
+
$ppt = [Runtime.InteropServices.Marshal]::GetActiveObject("PowerPoint.Application")
|
|
1176
|
+
$presentation = $ppt.ActivePresentation
|
|
1177
|
+
$layouts = @()
|
|
1178
|
+
$master = $presentation.SlideMaster
|
|
1179
|
+
for ($i = 1; $i -le $master.CustomLayouts.Count; $i++) {
|
|
1180
|
+
$layout = $master.CustomLayouts($i)
|
|
1181
|
+
$layouts += @{
|
|
1182
|
+
index = $i
|
|
1183
|
+
name = $layout.Name
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
@{ success = $true; layouts = $layouts } | ConvertTo-Json -Compress -Depth 5
|
|
1187
|
+
`);
|
|
1188
|
+
}
|
|
1189
|
+
async renderHtmlToImage(htmlWindowsPath, imageWindowsPath) {
|
|
1190
|
+
const safeHtml = htmlWindowsPath.replace(/'/g, "''");
|
|
1191
|
+
const safePng = imageWindowsPath.replace(/'/g, "''");
|
|
1192
|
+
return this.executePowerShell(`
|
|
1193
|
+
$edgePath = (Get-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\msedge.exe' -ErrorAction SilentlyContinue).'(default)'
|
|
1194
|
+
if (-not $edgePath -or -not (Test-Path $edgePath)) {
|
|
1195
|
+
$candidates = @(
|
|
1196
|
+
'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
|
|
1197
|
+
'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe'
|
|
1198
|
+
)
|
|
1199
|
+
$edgePath = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
1200
|
+
}
|
|
1201
|
+
if (-not $edgePath) {
|
|
1202
|
+
$chromePath = (Get-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe' -ErrorAction SilentlyContinue).'(default)'
|
|
1203
|
+
if (-not $chromePath -or -not (Test-Path $chromePath)) {
|
|
1204
|
+
$chromeCandidates = @(
|
|
1205
|
+
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
|
|
1206
|
+
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
|
|
1207
|
+
)
|
|
1208
|
+
$chromePath = $chromeCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
1209
|
+
}
|
|
1210
|
+
if ($chromePath) { $edgePath = $chromePath }
|
|
1211
|
+
else { throw 'Neither Microsoft Edge nor Google Chrome found' }
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
$htmlFile = '${safeHtml}'
|
|
1215
|
+
$pngFile = '${safePng}'
|
|
1216
|
+
$fileUrl = 'file:///' + ($htmlFile -replace '\\\\', '/')
|
|
1217
|
+
|
|
1218
|
+
$psi = New-Object System.Diagnostics.ProcessStartInfo
|
|
1219
|
+
$psi.FileName = $edgePath
|
|
1220
|
+
$rawPng = $pngFile + '.raw.png'
|
|
1221
|
+
$psi.Arguments = "--headless=new --disable-gpu --no-sandbox --hide-scrollbars --force-device-scale-factor=1 --window-size=2040,1200 --screenshot=$rawPng $fileUrl"
|
|
1222
|
+
$psi.UseShellExecute = $false
|
|
1223
|
+
$psi.CreateNoWindow = $true
|
|
1224
|
+
$proc = [System.Diagnostics.Process]::Start($psi)
|
|
1225
|
+
$proc.WaitForExit(15000)
|
|
1226
|
+
|
|
1227
|
+
if (-not (Test-Path $rawPng)) {
|
|
1228
|
+
throw "Screenshot not created. Exit code: $($proc.ExitCode)"
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
# Crop from 2040x1200 to 1920x1080 (removes Edge headless gradient edge gap)
|
|
1232
|
+
Add-Type -AssemblyName System.Drawing
|
|
1233
|
+
$raw = [System.Drawing.Bitmap]::new($rawPng)
|
|
1234
|
+
$cropped = New-Object System.Drawing.Bitmap(1920, 1080)
|
|
1235
|
+
$g = [System.Drawing.Graphics]::FromImage($cropped)
|
|
1236
|
+
$g.DrawImage($raw, 0, 0, [System.Drawing.Rectangle]::new(0, 0, 1920, 1080), [System.Drawing.GraphicsUnit]::Pixel)
|
|
1237
|
+
$g.Dispose()
|
|
1238
|
+
$cropped.Save($pngFile, [System.Drawing.Imaging.ImageFormat]::Png)
|
|
1239
|
+
$raw.Dispose()
|
|
1240
|
+
$cropped.Dispose()
|
|
1241
|
+
Remove-Item $rawPng -Force -ErrorAction SilentlyContinue
|
|
1242
|
+
|
|
1243
|
+
@{ success = $true; image_path = $pngFile } | ConvertTo-Json -Compress
|
|
1244
|
+
`);
|
|
1245
|
+
}
|
|
1246
|
+
async measureHtmlHeight(htmlWindowsPath) {
|
|
1247
|
+
const safeHtml = htmlWindowsPath.replace(/'/g, "''");
|
|
1248
|
+
try {
|
|
1249
|
+
const result = await this.executePowerShell(`
|
|
1250
|
+
$edgePath = (Get-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\msedge.exe' -ErrorAction SilentlyContinue).'(default)'
|
|
1251
|
+
if (-not $edgePath -or -not (Test-Path $edgePath)) {
|
|
1252
|
+
$candidates = @(
|
|
1253
|
+
'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe',
|
|
1254
|
+
'C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe'
|
|
1255
|
+
)
|
|
1256
|
+
$edgePath = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
1257
|
+
}
|
|
1258
|
+
if (-not $edgePath) {
|
|
1259
|
+
$chromePath = (Get-ItemProperty 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe' -ErrorAction SilentlyContinue).'(default)'
|
|
1260
|
+
if (-not $chromePath -or -not (Test-Path $chromePath)) {
|
|
1261
|
+
$chromeCandidates = @(
|
|
1262
|
+
'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
|
|
1263
|
+
'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
|
|
1264
|
+
)
|
|
1265
|
+
$chromePath = $chromeCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
1266
|
+
}
|
|
1267
|
+
if ($chromePath) { $edgePath = $chromePath }
|
|
1268
|
+
else { throw 'Neither Microsoft Edge nor Google Chrome found' }
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
$htmlFile = '${safeHtml}'
|
|
1272
|
+
$fileUrl = 'file:///' + ($htmlFile -replace '\\\\', '/')
|
|
1273
|
+
|
|
1274
|
+
$psi = New-Object System.Diagnostics.ProcessStartInfo
|
|
1275
|
+
$psi.FileName = $edgePath
|
|
1276
|
+
$psi.Arguments = "--headless=new --disable-gpu --no-sandbox --dump-dom $fileUrl"
|
|
1277
|
+
$psi.UseShellExecute = $false
|
|
1278
|
+
$psi.CreateNoWindow = $true
|
|
1279
|
+
$psi.RedirectStandardOutput = $true
|
|
1280
|
+
$psi.RedirectStandardError = $true
|
|
1281
|
+
$psi.StandardOutputEncoding = [System.Text.Encoding]::UTF8
|
|
1282
|
+
$proc = [System.Diagnostics.Process]::Start($psi)
|
|
1283
|
+
$output = $proc.StandardOutput.ReadToEnd()
|
|
1284
|
+
$proc.StandardError.ReadToEnd() | Out-Null
|
|
1285
|
+
if (-not $proc.WaitForExit(15000)) { try { $proc.Kill() } catch {} }
|
|
1286
|
+
|
|
1287
|
+
# Match title tag specifically — avoids encoding issues with full-output regex
|
|
1288
|
+
$height = -1
|
|
1289
|
+
if ($output -match '<title>SH:(\\d+)</title>') {
|
|
1290
|
+
$height = [int]$Matches[1]
|
|
1291
|
+
} elseif ($output -match 'SH:(\\d+)') {
|
|
1292
|
+
$height = [int]$Matches[1]
|
|
1293
|
+
}
|
|
1294
|
+
if ($height -gt 0) {
|
|
1295
|
+
@{ success = $true; height = $height } | ConvertTo-Json -Compress
|
|
1296
|
+
} else {
|
|
1297
|
+
@{ success = $false; height = -1 } | ConvertTo-Json -Compress
|
|
1298
|
+
}
|
|
1299
|
+
`);
|
|
1300
|
+
if (result.success) {
|
|
1301
|
+
const height = result['height'];
|
|
1302
|
+
return typeof height === 'number' ? height : -1;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
catch { }
|
|
1306
|
+
return -1;
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
export const powerpointClient = new PowerPointClient();
|
|
1310
|
+
//# sourceMappingURL=powerpoint-client.js.map
|