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