@superblocksteam/vite-plugin-file-sync 2.0.75-next.3 → 2.0.75-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/middleware.d.ts +0 -14
- package/dist/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +0 -40
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +18 -67
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/apis/static-analysis.js +5 -11
- package/dist/ai-service/agent/subagents/apis/static-analysis.js.map +1 -1
- package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js +0 -15
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +0 -3
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-source.d.ts +24 -0
- package/dist/ai-service/agent/tools/apis/api-source.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-source.js +108 -0
- package/dist/ai-service/agent/tools/apis/api-source.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js +3 -11
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api.js +0 -6
- package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.js +3 -99
- package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/integration-types.js +17 -69
- package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +45 -26
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/write-api.d.ts +2 -2
- package/dist/ai-service/agent/tools/apis/write-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/write-api.js +2 -8
- package/dist/ai-service/agent/tools/apis/write-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +0 -3
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +6 -58
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.js +196 -27
- package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.js +22 -12
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +0 -3
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js +0 -15
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
- package/dist/ai-service/agent/tools/build-list-files.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-list-files.js +14 -6
- package/dist/ai-service/agent/tools/build-list-files.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +0 -9
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +2 -2
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.js +25 -8
- package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-read-file.d.ts +4 -10
- package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-read-file.js +77 -75
- package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-reload-file.js +0 -5
- package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-file.js +50 -3
- package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-validate-icons.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-validate-icons.js +0 -8
- package/dist/ai-service/agent/tools/build-validate-icons.js.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.d.ts +2 -2
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.js +17 -7
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
- package/dist/ai-service/agent/tools/get-console-logs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/get-console-logs.js +0 -6
- package/dist/ai-service/agent/tools/get-console-logs.js.map +1 -1
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/get-runtime-errors.js +0 -4
- package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +0 -1
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +0 -1
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js +9 -56
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.js +0 -6
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/run-code.js +0 -9
- package/dist/ai-service/agent/tools/integrations/run-code.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +6 -27
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts +0 -15
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js +0 -30
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +1 -11
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/edit.d.ts +1 -4
- package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/edit.js +8 -10
- package/dist/ai-service/agent/tools2/tools/edit.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/end-test-run.js +0 -5
- package/dist/ai-service/agent/tools2/tools/end-test-run.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +0 -2
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +0 -24
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/glob.d.ts +1 -4
- package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/glob.js +85 -25
- package/dist/ai-service/agent/tools2/tools/glob.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js +0 -9
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +1 -1
- package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep.js +5 -22
- package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +0 -4
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ls.d.ts +1 -8
- package/dist/ai-service/agent/tools2/tools/ls.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ls.js +83 -102
- package/dist/ai-service/agent/tools2/tools/ls.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/read.d.ts +2 -5
- package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/read.js +12 -24
- package/dist/ai-service/agent/tools2/tools/read.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/start-test-run.js +0 -13
- package/dist/ai-service/agent/tools2/tools/start-test-run.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js +0 -6
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/write.d.ts +1 -4
- package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/write.js +4 -9
- package/dist/ai-service/agent/tools2/tools/write.js.map +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts +0 -25
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/types.js.map +1 -1
- package/dist/ai-service/app-interface/linter.d.ts +1 -4
- package/dist/ai-service/app-interface/linter.d.ts.map +1 -1
- package/dist/ai-service/app-interface/linter.js +6 -10
- package/dist/ai-service/app-interface/linter.js.map +1 -1
- package/dist/ai-service/app-interface/shell.d.ts +1 -205
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +14 -474
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +0 -8
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/features.d.ts +0 -8
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +0 -8
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +1 -1
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +24 -26
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/judge/judge-executor.d.ts.map +1 -1
- package/dist/ai-service/judge/judge-executor.js +0 -4
- package/dist/ai-service/judge/judge-executor.js.map +1 -1
- package/dist/ai-service/llm/client.d.ts +3 -19
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +12 -131
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/context/context.d.ts +1 -4
- package/dist/ai-service/llm/context/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context/context.js +5 -27
- package/dist/ai-service/llm/context/context.js.map +1 -1
- package/dist/ai-service/llm/context/internal-types.d.ts +0 -5
- package/dist/ai-service/llm/context/internal-types.d.ts.map +1 -1
- package/dist/ai-service/llm/context/internal-types.js +0 -5
- package/dist/ai-service/llm/context/internal-types.js.map +1 -1
- package/dist/ai-service/llm/context/levels/l1.d.ts +3 -4
- package/dist/ai-service/llm/context/levels/l1.d.ts.map +1 -1
- package/dist/ai-service/llm/context/levels/l1.js +8 -9
- package/dist/ai-service/llm/context/levels/l1.js.map +1 -1
- package/dist/ai-service/llm/context/serialization.d.ts +0 -8
- package/dist/ai-service/llm/context/serialization.d.ts.map +1 -1
- package/dist/ai-service/llm/context/utils/content-compaction.d.ts +5 -7
- package/dist/ai-service/llm/context/utils/content-compaction.d.ts.map +1 -1
- package/dist/ai-service/llm/context/utils/content-compaction.js +6 -27
- package/dist/ai-service/llm/context/utils/content-compaction.js.map +1 -1
- package/dist/ai-service/llm/error.d.ts +0 -1
- package/dist/ai-service/llm/error.d.ts.map +1 -1
- package/dist/ai-service/llm/error.js +3 -29
- package/dist/ai-service/llm/error.js.map +1 -1
- package/dist/ai-service/llm/stream/config.d.ts +5 -14
- package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/config.js +5 -17
- package/dist/ai-service/llm/stream/config.js.map +1 -1
- package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/errors.js +4 -7
- package/dist/ai-service/llm/stream/errors.js.map +1 -1
- package/dist/ai-service/llm/stream/index.d.ts +2 -4
- package/dist/ai-service/llm/stream/index.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/index.js +2 -4
- package/dist/ai-service/llm/stream/index.js.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.js +11 -5
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.js +3 -3
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts +0 -8
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -1
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js +0 -108
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -1
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -1
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +133 -360
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +1 -2
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +8 -29
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +6 -17
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +1 -9
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts +7 -0
- package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/file-read-tracker.js +26 -0
- package/dist/ai-service/state-machine/helpers/file-read-tracker.js.map +1 -0
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +1 -4
- package/dist/ai-service/template-renderer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.js +2 -2
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/components-manager.js +12 -17
- package/dist/components-manager.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +12 -22
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-manager.d.ts +6 -0
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +144 -119
- package/dist/file-system-manager.js.map +1 -1
- package/dist/parsing/util.d.ts.map +1 -1
- package/dist/parsing/util.js +1 -5
- package/dist/parsing/util.js.map +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +11 -5
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts +0 -4
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +8 -15
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +8 -13
- package/dist/sync-service/index.js.map +1 -1
- package/dist/util/logger.d.ts.map +1 -1
- package/dist/util/logger.js +0 -16
- package/dist/util/logger.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +2 -4
- package/dist/util.js.map +1 -1
- package/package.json +16 -10
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts +0 -10
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/clear-error-cache.js +0 -38
- package/dist/ai-service/agent/tools/clear-error-cache.js.map +0 -1
- package/dist/ai-service/app-interface/constants.d.ts +0 -77
- package/dist/ai-service/app-interface/constants.d.ts.map +0 -1
- package/dist/ai-service/app-interface/constants.js +0 -129
- package/dist/ai-service/app-interface/constants.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +0 -87
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.js +0 -91
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts +0 -35
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js +0 -236
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts +0 -5
- package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/handlers/index.js +0 -5
- package/dist/ai-service/app-interface/filesystem/handlers/index.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/index.d.ts +0 -12
- package/dist/ai-service/app-interface/filesystem/index.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/index.js +0 -11
- package/dist/ai-service/app-interface/filesystem/index.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/validation.d.ts +0 -71
- package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/validation.js +0 -170
- package/dist/ai-service/app-interface/filesystem/validation.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +0 -108
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +0 -157
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +0 -1
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts +0 -126
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts.map +0 -1
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js +0 -9
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js.map +0 -1
- package/dist/ai-service/security/index.d.ts +0 -8
- package/dist/ai-service/security/index.d.ts.map +0 -1
- package/dist/ai-service/security/index.js +0 -8
- package/dist/ai-service/security/index.js.map +0 -1
- package/dist/ai-service/security/safety-classifier.d.ts +0 -103
- package/dist/ai-service/security/safety-classifier.d.ts.map +0 -1
- package/dist/ai-service/security/safety-classifier.js +0 -168
- package/dist/ai-service/security/safety-classifier.js.map +0 -1
- package/dist/ai-service/security/secret-scanner.d.ts +0 -145
- package/dist/ai-service/security/secret-scanner.d.ts.map +0 -1
- package/dist/ai-service/security/secret-scanner.js +0 -344
- package/dist/ai-service/security/secret-scanner.js.map +0 -1
- package/dist/ensure-app-provider.d.ts +0 -2
- package/dist/ensure-app-provider.d.ts.map +0 -1
- package/dist/ensure-app-provider.js +0 -209
- package/dist/ensure-app-provider.js.map +0 -1
|
@@ -174,12 +174,8 @@ const PLAYWRIGHT_ACTIONS = [
|
|
|
174
174
|
"scroll",
|
|
175
175
|
"scrollIntoView",
|
|
176
176
|
"checkRuntimeErrors",
|
|
177
|
-
"getEmbedEvents",
|
|
178
|
-
"triggerEmbedEvent",
|
|
179
|
-
"setEmbedProperties",
|
|
180
177
|
];
|
|
181
178
|
let capturedConsoleLogs = [];
|
|
182
|
-
let lastDrainedEmbedEvents = null;
|
|
183
179
|
export async function startEmbeddedPlaywrightMcpServer(options) {
|
|
184
180
|
const logger = options.logger;
|
|
185
181
|
// Create action logger for capturing Playwright actions
|
|
@@ -243,174 +239,154 @@ export async function startEmbeddedPlaywrightMcpServer(options) {
|
|
|
243
239
|
if (!context) {
|
|
244
240
|
throw new Error("Failed to create or reuse a Playwright context");
|
|
245
241
|
}
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
// (sb-init, sb-bootstrap-response, etc.) needed for first-party embedding flows.
|
|
252
|
-
const initData = options.initData;
|
|
253
|
-
const bootstrapData = options.bootstrapData;
|
|
254
|
-
/**
|
|
255
|
-
* CRITICAL: Mock Parent Window Setup for Playwright Browser Automation
|
|
256
|
-
*
|
|
257
|
-
* WHY THIS IS NECESSARY:
|
|
258
|
-
* The Superblocks library code (in @superblocksteam/library) expects to run inside an iframe
|
|
259
|
-
* embedded by the Superblocks editor. It uses `window.parent.postMessage()` to communicate
|
|
260
|
-
* with the editor and relies on `window.parent !== window` to detect the embedded state.
|
|
261
|
-
*
|
|
262
|
-
* When running in Playwright for E2E testing, there is no parent iframe - the page runs
|
|
263
|
-
* standalone. Without this mock, the library would:
|
|
264
|
-
* 1. Fail the `isEmbeddedBySuperblocksFirstParty()` check
|
|
265
|
-
* 2. Never receive the `sb-init` message needed to establish socket connections
|
|
266
|
-
* 3. Never receive the `sb-bootstrap-response` with auth tokens and app data
|
|
267
|
-
*
|
|
268
|
-
* HOW IT WORKS:
|
|
269
|
-
* 1. We override `window.parent` with a mock object BEFORE library code loads (via addInitScript)
|
|
270
|
-
* 2. The mock intercepts `postMessage` calls from the library
|
|
271
|
-
* 3. When the library sends "sb-ready", we respond with "sb-init" containing peerId/auth data
|
|
272
|
-
* 4. When the library sends "sb-editor-request-bootstrap", we respond with bootstrap data
|
|
273
|
-
* 5. We also send initial messages proactively in case the library sets up listeners late
|
|
274
|
-
*
|
|
275
|
-
* TESTING NOTE:
|
|
276
|
-
* Integration tests for this setup should verify:
|
|
277
|
-
* 1. The app successfully initializes and shows content
|
|
278
|
-
* 2. API calls are authenticated (tokens were passed correctly)
|
|
279
|
-
* 3. Real-time features work (socket connection established via peerId)
|
|
280
|
-
*/
|
|
281
|
-
await context.addInitScript((payload) => {
|
|
282
|
-
const { initData: init, bootstrapData: bootstrap } = payload;
|
|
242
|
+
// Inject sb-init and sb-bootstrap-response data for direct iframe access
|
|
243
|
+
// This simulates the parent window sending these messages to the iframe
|
|
244
|
+
if (options?.initData || options?.bootstrapData) {
|
|
245
|
+
const initData = options.initData;
|
|
246
|
+
const bootstrapData = options.bootstrapData;
|
|
283
247
|
/**
|
|
284
|
-
*
|
|
285
|
-
* useEmitEmbedEvent() -> embedStore.emitEvent() -> window.parent.postMessage({ type: "embed-emit-event" })
|
|
248
|
+
* CRITICAL: Mock Parent Window Setup for Playwright Browser Automation
|
|
286
249
|
*
|
|
287
|
-
*
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
*
|
|
301
|
-
* When the
|
|
250
|
+
* WHY THIS IS NECESSARY:
|
|
251
|
+
* The Superblocks library code (in @superblocksteam/library) expects to run inside an iframe
|
|
252
|
+
* embedded by the Superblocks editor. It uses `window.parent.postMessage()` to communicate
|
|
253
|
+
* with the editor and relies on `window.parent !== window` to detect the embedded state.
|
|
254
|
+
*
|
|
255
|
+
* When running in Playwright for E2E testing, there is no parent iframe - the page runs
|
|
256
|
+
* standalone. Without this mock, the library would:
|
|
257
|
+
* 1. Fail the `isEmbeddedBySuperblocksFirstParty()` check
|
|
258
|
+
* 2. Never receive the `sb-init` message needed to establish socket connections
|
|
259
|
+
* 3. Never receive the `sb-bootstrap-response` with auth tokens and app data
|
|
260
|
+
*
|
|
261
|
+
* HOW IT WORKS:
|
|
262
|
+
* 1. We override `window.parent` with a mock object BEFORE library code loads (via addInitScript)
|
|
263
|
+
* 2. The mock intercepts `postMessage` calls from the library
|
|
264
|
+
* 3. When the library sends "sb-ready", we respond with "sb-init" containing peerId/auth data
|
|
265
|
+
* 4. When the library sends "sb-editor-request-bootstrap", we respond with bootstrap data
|
|
266
|
+
* 5. We also send initial messages proactively in case the library sets up listeners late
|
|
267
|
+
*
|
|
268
|
+
* WHAT COULD BREAK THIS:
|
|
269
|
+
* - If the library changes how it detects parent window embedding (e.g., different checks)
|
|
270
|
+
* - If the message types or payload shapes change in the library
|
|
271
|
+
* - If the library adds additional security checks (e.g., origin verification on parent)
|
|
272
|
+
* - If timing changes require different setTimeout delays
|
|
273
|
+
*
|
|
274
|
+
* TESTING NOTE:
|
|
275
|
+
* Integration tests for this setup should verify:
|
|
276
|
+
* 1. The app successfully initializes and shows content
|
|
277
|
+
* 2. API calls are authenticated (tokens were passed correctly)
|
|
278
|
+
* 3. Real-time features work (socket connection established via peerId)
|
|
302
279
|
*/
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
// This triggers the library to establish its socket connection
|
|
315
|
-
if (message?.type === "sb-ready" && init) {
|
|
316
|
-
setTimeout(() => {
|
|
317
|
-
window.postMessage({
|
|
318
|
-
type: "sb-init",
|
|
319
|
-
payload: {
|
|
320
|
-
peerId: init.peerId,
|
|
321
|
-
userId: init.userId,
|
|
322
|
-
devServerAuthorization: init.devServerAuthorization,
|
|
323
|
-
appId: init.appId,
|
|
324
|
-
windowOriginUrl: init.windowOriginUrl,
|
|
325
|
-
},
|
|
326
|
-
startTime: Date.now(),
|
|
327
|
-
}, "*");
|
|
328
|
-
}, 10);
|
|
329
|
-
}
|
|
330
|
-
// When the app sends sb-editor-request-bootstrap, we respond with bootstrap data
|
|
331
|
-
// This provides auth tokens and configuration needed by the API manager
|
|
332
|
-
if (message?.type === "sb-editor-request-bootstrap" && bootstrap) {
|
|
333
|
-
setTimeout(() => {
|
|
334
|
-
window.postMessage({
|
|
335
|
-
type: "sb-bootstrap-response",
|
|
336
|
-
payload: bootstrap,
|
|
337
|
-
startTime: Date.now(),
|
|
338
|
-
}, "*");
|
|
339
|
-
}, 10);
|
|
340
|
-
}
|
|
341
|
-
// When the app sends authenticate-api-request, we respond with resolve-promise
|
|
342
|
-
// This allows API calls to proceed in test mode without actual auth
|
|
343
|
-
if (message?.type === "authenticate-api-request") {
|
|
344
|
-
const { callbackId } = message.payload || {};
|
|
345
|
-
if (callbackId) {
|
|
280
|
+
await context.addInitScript((payload) => {
|
|
281
|
+
const { initData: init, bootstrapData: bootstrap } = payload;
|
|
282
|
+
/**
|
|
283
|
+
* Mock parent window object that intercepts postMessage calls from the library.
|
|
284
|
+
* When the app sends messages expecting a parent response, we handle them here.
|
|
285
|
+
*/
|
|
286
|
+
const mockParent = {
|
|
287
|
+
postMessage: (message, _targetOrigin) => {
|
|
288
|
+
// When the app sends sb-ready, we respond with sb-init
|
|
289
|
+
// This triggers the library to establish its socket connection
|
|
290
|
+
if (message?.type === "sb-ready" && init) {
|
|
346
291
|
setTimeout(() => {
|
|
347
292
|
window.postMessage({
|
|
348
|
-
type: "
|
|
349
|
-
|
|
350
|
-
|
|
293
|
+
type: "sb-init",
|
|
294
|
+
payload: {
|
|
295
|
+
peerId: init.peerId,
|
|
296
|
+
userId: init.userId,
|
|
297
|
+
devServerAuthorization: init.devServerAuthorization,
|
|
298
|
+
appId: init.appId,
|
|
299
|
+
windowOriginUrl: init.windowOriginUrl,
|
|
300
|
+
},
|
|
301
|
+
startTime: Date.now(),
|
|
351
302
|
}, "*");
|
|
352
303
|
}, 10);
|
|
353
304
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
//
|
|
395
|
-
|
|
396
|
-
if (bootstrap.profiles) {
|
|
305
|
+
// When the app sends sb-editor-request-bootstrap, we respond with bootstrap data
|
|
306
|
+
// This provides auth tokens and configuration needed by the API manager
|
|
307
|
+
if (message?.type === "sb-editor-request-bootstrap" && bootstrap) {
|
|
308
|
+
setTimeout(() => {
|
|
309
|
+
window.postMessage({
|
|
310
|
+
type: "sb-bootstrap-response",
|
|
311
|
+
payload: bootstrap,
|
|
312
|
+
startTime: Date.now(),
|
|
313
|
+
}, "*");
|
|
314
|
+
}, 10);
|
|
315
|
+
}
|
|
316
|
+
// When the app sends authenticate-api-request, we respond with resolve-promise
|
|
317
|
+
// This allows API calls to proceed in test mode without actual auth
|
|
318
|
+
if (message?.type === "authenticate-api-request") {
|
|
319
|
+
const { callbackId } = message.payload || {};
|
|
320
|
+
if (callbackId) {
|
|
321
|
+
setTimeout(() => {
|
|
322
|
+
window.postMessage({
|
|
323
|
+
type: "resolve-promise",
|
|
324
|
+
callbackId,
|
|
325
|
+
payload: {}, // Empty success result - no auth errors
|
|
326
|
+
}, "*");
|
|
327
|
+
}, 10);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
// These properties make the mock look like a real window object
|
|
332
|
+
// which helps pass any instanceof or property existence checks
|
|
333
|
+
window: window,
|
|
334
|
+
document: document,
|
|
335
|
+
location: window.location,
|
|
336
|
+
};
|
|
337
|
+
// Override window.parent to point to our mock
|
|
338
|
+
// This must happen before the library code runs (hence addInitScript)
|
|
339
|
+
Object.defineProperty(window, "parent", {
|
|
340
|
+
value: mockParent,
|
|
341
|
+
writable: false,
|
|
342
|
+
configurable: true,
|
|
343
|
+
});
|
|
344
|
+
// Send initial messages proactively after a delay
|
|
345
|
+
// This handles the case where the library sets up listeners after checking window.parent
|
|
346
|
+
if (init) {
|
|
397
347
|
setTimeout(() => {
|
|
398
348
|
window.postMessage({
|
|
399
|
-
type: "sb-
|
|
349
|
+
type: "sb-init",
|
|
400
350
|
payload: {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
351
|
+
peerId: init.peerId,
|
|
352
|
+
userId: init.userId,
|
|
353
|
+
devServerAuthorization: init.devServerAuthorization,
|
|
354
|
+
appId: init.appId,
|
|
355
|
+
windowOriginUrl: init.windowOriginUrl,
|
|
404
356
|
},
|
|
405
357
|
startTime: Date.now(),
|
|
406
358
|
}, "*");
|
|
407
|
-
},
|
|
359
|
+
}, 100);
|
|
408
360
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
361
|
+
if (bootstrap) {
|
|
362
|
+
setTimeout(() => {
|
|
363
|
+
window.postMessage({
|
|
364
|
+
type: "sb-bootstrap-response",
|
|
365
|
+
payload: bootstrap,
|
|
366
|
+
startTime: Date.now(),
|
|
367
|
+
}, "*");
|
|
368
|
+
}, 200);
|
|
369
|
+
// Send sb-global-sync with profiles data for API execution
|
|
370
|
+
// This sets superblocksContext.profiles which is needed for profileId
|
|
371
|
+
if (bootstrap.profiles) {
|
|
372
|
+
setTimeout(() => {
|
|
373
|
+
window.postMessage({
|
|
374
|
+
type: "sb-global-sync",
|
|
375
|
+
payload: {
|
|
376
|
+
global: {
|
|
377
|
+
profiles: bootstrap.profiles,
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
startTime: Date.now(),
|
|
381
|
+
}, "*");
|
|
382
|
+
}, 300);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
initData,
|
|
387
|
+
bootstrapData,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
414
390
|
// Seed a cookie/localStorage with JWT for app domain if provided
|
|
415
391
|
if (options?.jwt && options?.appUrl) {
|
|
416
392
|
try {
|
|
@@ -763,9 +739,6 @@ ACTIONS:
|
|
|
763
739
|
- reload: Reload the page. No params.
|
|
764
740
|
- navigate: Go to URL. Params: { url: string }
|
|
765
741
|
- getConsoleLogs: Get browser console logs. Params: { clear?: boolean }
|
|
766
|
-
- getEmbedEvents: Get the most recent embed events emitted by the app. Params: { }
|
|
767
|
-
- triggerEmbedEvent: Trigger an incoming embed event as if sent by the embedder. Params: { eventName: string, payload?: object }
|
|
768
|
-
- setEmbedProperties: Set embed properties as if sent by the embedder. Params: { properties: object }
|
|
769
742
|
- scroll: Scroll the page. Params: { x?: number, y?: number, deltaX?: number, deltaY?: number }
|
|
770
743
|
- scrollIntoView: Scroll element into view. Params: { selector: string }
|
|
771
744
|
- checkRuntimeErrors: Explicitly check for component crashes. No params.
|
|
@@ -838,20 +811,6 @@ TIPS:
|
|
|
838
811
|
type: "boolean",
|
|
839
812
|
description: "Clear logs after retrieving (for 'getConsoleLogs' action)",
|
|
840
813
|
},
|
|
841
|
-
eventName: {
|
|
842
|
-
type: "string",
|
|
843
|
-
description: "Embed event name to trigger (for 'triggerEmbedEvent' action)",
|
|
844
|
-
},
|
|
845
|
-
payload: {
|
|
846
|
-
type: "object",
|
|
847
|
-
description: "Optional payload to send with the embed event (for 'triggerEmbedEvent' action)",
|
|
848
|
-
additionalProperties: true,
|
|
849
|
-
},
|
|
850
|
-
properties: {
|
|
851
|
-
type: "object",
|
|
852
|
-
description: "Embed properties to set (for 'setEmbedProperties' action)",
|
|
853
|
-
additionalProperties: true,
|
|
854
|
-
},
|
|
855
814
|
x: {
|
|
856
815
|
type: "number",
|
|
857
816
|
description: "Absolute horizontal scroll position in pixels (for 'scroll' action)",
|
|
@@ -1000,21 +959,6 @@ async function captureScreenshot(page) {
|
|
|
1000
959
|
format: "png",
|
|
1001
960
|
};
|
|
1002
961
|
}
|
|
1003
|
-
async function drainEmbedEvents(page) {
|
|
1004
|
-
try {
|
|
1005
|
-
const events = await page.evaluate(() => {
|
|
1006
|
-
return window.__sbGetAndClearEmbedEvents?.() ?? null;
|
|
1007
|
-
});
|
|
1008
|
-
if (Array.isArray(events) && events.length > 0) {
|
|
1009
|
-
lastDrainedEmbedEvents = events;
|
|
1010
|
-
return events;
|
|
1011
|
-
}
|
|
1012
|
-
return null;
|
|
1013
|
-
}
|
|
1014
|
-
catch {
|
|
1015
|
-
return null;
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
962
|
async function executePlaywrightAction(action, page, params) {
|
|
1019
963
|
switch (action) {
|
|
1020
964
|
case "navigate": {
|
|
@@ -1029,7 +973,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1029
973
|
});
|
|
1030
974
|
// Auto-capture screenshot after navigation
|
|
1031
975
|
const screenshot = await captureScreenshot(page);
|
|
1032
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1033
976
|
// Check for runtime errors (component crashes)
|
|
1034
977
|
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1035
978
|
return {
|
|
@@ -1040,7 +983,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1040
983
|
format: screenshot.format,
|
|
1041
984
|
context: {
|
|
1042
985
|
url,
|
|
1043
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1044
986
|
},
|
|
1045
987
|
...(runtimeErrors.hasErrors && {
|
|
1046
988
|
runtimeErrors: runtimeErrors.errors,
|
|
@@ -1058,7 +1000,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1058
1000
|
catch {
|
|
1059
1001
|
// Ignore screenshot errors
|
|
1060
1002
|
}
|
|
1061
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1062
1003
|
return {
|
|
1063
1004
|
success: false,
|
|
1064
1005
|
action: "navigate",
|
|
@@ -1067,7 +1008,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1067
1008
|
format: errorScreenshot?.format ?? "png",
|
|
1068
1009
|
context: {
|
|
1069
1010
|
url,
|
|
1070
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1071
1011
|
},
|
|
1072
1012
|
error: `Navigation to ${url} failed: ${String(error)}`,
|
|
1073
1013
|
};
|
|
@@ -1084,7 +1024,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1084
1024
|
.click({ timeout: params.timeout ?? 10000 });
|
|
1085
1025
|
// Auto-capture screenshot after action
|
|
1086
1026
|
const screenshot = await captureScreenshot(page);
|
|
1087
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1088
1027
|
// Check for runtime errors (component crashes)
|
|
1089
1028
|
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1090
1029
|
return {
|
|
@@ -1095,7 +1034,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1095
1034
|
format: screenshot.format,
|
|
1096
1035
|
context: {
|
|
1097
1036
|
selector,
|
|
1098
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1099
1037
|
},
|
|
1100
1038
|
...(runtimeErrors.hasErrors && {
|
|
1101
1039
|
runtimeErrors: runtimeErrors.errors,
|
|
@@ -1112,7 +1050,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1112
1050
|
catch {
|
|
1113
1051
|
// Ignore screenshot errors
|
|
1114
1052
|
}
|
|
1115
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1116
1053
|
return {
|
|
1117
1054
|
success: false,
|
|
1118
1055
|
action: "click",
|
|
@@ -1121,7 +1058,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1121
1058
|
format: errorScreenshot?.format ?? "png",
|
|
1122
1059
|
context: {
|
|
1123
1060
|
selector,
|
|
1124
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1125
1061
|
},
|
|
1126
1062
|
error: `Click failed on "${selector}": ${String(error)}`,
|
|
1127
1063
|
};
|
|
@@ -1139,7 +1075,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1139
1075
|
.fill(value, { timeout: params.timeout ?? 10000 });
|
|
1140
1076
|
// Auto-capture screenshot after fill
|
|
1141
1077
|
const screenshot = await captureScreenshot(page);
|
|
1142
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1143
1078
|
// Check for runtime errors (component crashes)
|
|
1144
1079
|
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1145
1080
|
return {
|
|
@@ -1151,7 +1086,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1151
1086
|
context: {
|
|
1152
1087
|
selector,
|
|
1153
1088
|
value,
|
|
1154
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1155
1089
|
},
|
|
1156
1090
|
...(runtimeErrors.hasErrors && {
|
|
1157
1091
|
runtimeErrors: runtimeErrors.errors,
|
|
@@ -1168,7 +1102,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1168
1102
|
catch {
|
|
1169
1103
|
// Ignore screenshot errors
|
|
1170
1104
|
}
|
|
1171
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1172
1105
|
return {
|
|
1173
1106
|
success: false,
|
|
1174
1107
|
action: "fill",
|
|
@@ -1178,7 +1111,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1178
1111
|
context: {
|
|
1179
1112
|
selector,
|
|
1180
1113
|
value,
|
|
1181
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1182
1114
|
},
|
|
1183
1115
|
error: `Fill failed on "${selector}": ${String(error)}`,
|
|
1184
1116
|
};
|
|
@@ -1188,7 +1120,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1188
1120
|
const description = params.description || "Capture current state";
|
|
1189
1121
|
// Capture screenshot in WebP format for optimal compression
|
|
1190
1122
|
const screenshot = await captureScreenshot(page);
|
|
1191
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1192
1123
|
return {
|
|
1193
1124
|
success: true,
|
|
1194
1125
|
action: "screenshot",
|
|
@@ -1197,7 +1128,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1197
1128
|
format: screenshot.format,
|
|
1198
1129
|
context: {
|
|
1199
1130
|
fullPage: Boolean(params.fullPage),
|
|
1200
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1201
1131
|
},
|
|
1202
1132
|
};
|
|
1203
1133
|
}
|
|
@@ -1269,7 +1199,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1269
1199
|
}
|
|
1270
1200
|
// Auto-capture screenshot after evaluation
|
|
1271
1201
|
const screenshot = await captureScreenshot(page);
|
|
1272
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1273
1202
|
// Check for runtime errors (component crashes)
|
|
1274
1203
|
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1275
1204
|
return {
|
|
@@ -1281,7 +1210,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1281
1210
|
format: screenshot.format,
|
|
1282
1211
|
context: {
|
|
1283
1212
|
script: script.substring(0, 100) + (script.length > 100 ? "..." : ""),
|
|
1284
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1285
1213
|
},
|
|
1286
1214
|
...(runtimeErrors.hasErrors && {
|
|
1287
1215
|
runtimeErrors: runtimeErrors.errors,
|
|
@@ -1298,7 +1226,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1298
1226
|
catch {
|
|
1299
1227
|
// Ignore screenshot errors
|
|
1300
1228
|
}
|
|
1301
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1302
1229
|
// If the error looks like a syntax error, provide helpful guidance
|
|
1303
1230
|
const errorMsg = String(error);
|
|
1304
1231
|
if (errorMsg.includes("SyntaxError") ||
|
|
@@ -1312,7 +1239,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1312
1239
|
format: errorScreenshot?.format ?? "png",
|
|
1313
1240
|
context: {
|
|
1314
1241
|
script: script.substring(0, 100) + (script.length > 100 ? "..." : ""),
|
|
1315
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1316
1242
|
},
|
|
1317
1243
|
error: "JavaScript evaluation failed. Make sure your code is browser-compatible " +
|
|
1318
1244
|
"(no import/export statements). Error: " +
|
|
@@ -1327,7 +1253,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1327
1253
|
format: errorScreenshot?.format ?? "png",
|
|
1328
1254
|
context: {
|
|
1329
1255
|
script: script.substring(0, 100) + (script.length > 100 ? "..." : ""),
|
|
1330
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1331
1256
|
},
|
|
1332
1257
|
error: String(error),
|
|
1333
1258
|
};
|
|
@@ -1355,150 +1280,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1355
1280
|
count: logs.length,
|
|
1356
1281
|
};
|
|
1357
1282
|
}
|
|
1358
|
-
case "getEmbedEvents": {
|
|
1359
|
-
const description = params.description || "Get embed events";
|
|
1360
|
-
const events = lastDrainedEmbedEvents ?? (await drainEmbedEvents(page)) ?? [];
|
|
1361
|
-
lastDrainedEmbedEvents = null;
|
|
1362
|
-
const screenshot = await captureScreenshot(page);
|
|
1363
|
-
// Check for runtime errors (component crashes)
|
|
1364
|
-
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1365
|
-
return {
|
|
1366
|
-
success: !runtimeErrors.hasErrors,
|
|
1367
|
-
action: "getEmbedEvents",
|
|
1368
|
-
description,
|
|
1369
|
-
screenshot: screenshot.data,
|
|
1370
|
-
format: screenshot.format,
|
|
1371
|
-
events,
|
|
1372
|
-
count: events.length,
|
|
1373
|
-
...(runtimeErrors.hasErrors && {
|
|
1374
|
-
runtimeErrors: runtimeErrors.errors,
|
|
1375
|
-
error: `Component crashed with ${runtimeErrors.errors.length} runtime error(s): ${runtimeErrors.errors.map((e) => e.header).join(", ")}`,
|
|
1376
|
-
}),
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
case "triggerEmbedEvent": {
|
|
1380
|
-
const description = params.description || "Trigger embed event";
|
|
1381
|
-
const eventName = params.eventName;
|
|
1382
|
-
const payload = params.payload ?? {};
|
|
1383
|
-
if (typeof eventName !== "string" || !eventName.trim()) {
|
|
1384
|
-
throw new Error("Missing eventName for triggerEmbedEvent action");
|
|
1385
|
-
}
|
|
1386
|
-
try {
|
|
1387
|
-
// Simulate the embedder sending a message into the iframe.
|
|
1388
|
-
// The library converts this to a CustomEvent `superblocks:${eventName}`,
|
|
1389
|
-
// which is what `useEmbedEvent()` listens to.
|
|
1390
|
-
await page.evaluate(({ eventName, payload }) => {
|
|
1391
|
-
window.postMessage({
|
|
1392
|
-
type: "embed-trigger-event",
|
|
1393
|
-
payload: { eventName, payload },
|
|
1394
|
-
startTime: Date.now(),
|
|
1395
|
-
}, "*");
|
|
1396
|
-
}, { eventName, payload });
|
|
1397
|
-
await page.waitForTimeout(50);
|
|
1398
|
-
const screenshot = await captureScreenshot(page);
|
|
1399
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1400
|
-
// Check for runtime errors (component crashes)
|
|
1401
|
-
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1402
|
-
return {
|
|
1403
|
-
success: !runtimeErrors.hasErrors,
|
|
1404
|
-
action: "triggerEmbedEvent",
|
|
1405
|
-
description,
|
|
1406
|
-
screenshot: screenshot.data,
|
|
1407
|
-
format: screenshot.format,
|
|
1408
|
-
context: {
|
|
1409
|
-
eventName,
|
|
1410
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1411
|
-
},
|
|
1412
|
-
...(runtimeErrors.hasErrors && {
|
|
1413
|
-
runtimeErrors: runtimeErrors.errors,
|
|
1414
|
-
error: `Component crashed with ${runtimeErrors.errors.length} runtime error(s): ${runtimeErrors.errors.map((e) => e.header).join(", ")}`,
|
|
1415
|
-
}),
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
catch (error) {
|
|
1419
|
-
let errorScreenshot = null;
|
|
1420
|
-
try {
|
|
1421
|
-
errorScreenshot = await captureScreenshot(page);
|
|
1422
|
-
}
|
|
1423
|
-
catch {
|
|
1424
|
-
// Ignore screenshot errors
|
|
1425
|
-
}
|
|
1426
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1427
|
-
return {
|
|
1428
|
-
success: false,
|
|
1429
|
-
action: "triggerEmbedEvent",
|
|
1430
|
-
description,
|
|
1431
|
-
screenshot: errorScreenshot?.data,
|
|
1432
|
-
format: errorScreenshot?.format ?? "png",
|
|
1433
|
-
context: {
|
|
1434
|
-
eventName,
|
|
1435
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1436
|
-
},
|
|
1437
|
-
error: `triggerEmbedEvent failed for "${eventName}": ${String(error)}`,
|
|
1438
|
-
};
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
case "setEmbedProperties": {
|
|
1442
|
-
const description = params.description || "Set embed properties";
|
|
1443
|
-
const properties = params.properties;
|
|
1444
|
-
if (!properties || typeof properties !== "object") {
|
|
1445
|
-
throw new Error("Missing properties for setEmbedProperties action");
|
|
1446
|
-
}
|
|
1447
|
-
try {
|
|
1448
|
-
// Simulate the embedder sending embed properties into the iframe.
|
|
1449
|
-
// The library listens for "embed-property-change" and updates embedStore.properties,
|
|
1450
|
-
// which is what `useEmbedProperties()` reads.
|
|
1451
|
-
await page.evaluate(({ properties }) => {
|
|
1452
|
-
window.postMessage({
|
|
1453
|
-
type: "embed-property-change",
|
|
1454
|
-
payload: { properties },
|
|
1455
|
-
startTime: Date.now(),
|
|
1456
|
-
}, "*");
|
|
1457
|
-
}, { properties });
|
|
1458
|
-
await page.waitForTimeout(50);
|
|
1459
|
-
const screenshot = await captureScreenshot(page);
|
|
1460
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1461
|
-
// Check for runtime errors (component crashes)
|
|
1462
|
-
const runtimeErrors = await checkForRuntimeErrors(page);
|
|
1463
|
-
return {
|
|
1464
|
-
success: !runtimeErrors.hasErrors,
|
|
1465
|
-
action: "setEmbedProperties",
|
|
1466
|
-
description,
|
|
1467
|
-
screenshot: screenshot.data,
|
|
1468
|
-
format: screenshot.format,
|
|
1469
|
-
context: {
|
|
1470
|
-
properties,
|
|
1471
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1472
|
-
},
|
|
1473
|
-
...(runtimeErrors.hasErrors && {
|
|
1474
|
-
runtimeErrors: runtimeErrors.errors,
|
|
1475
|
-
error: `Component crashed with ${runtimeErrors.errors.length} runtime error(s): ${runtimeErrors.errors.map((e) => e.header).join(", ")}`,
|
|
1476
|
-
}),
|
|
1477
|
-
};
|
|
1478
|
-
}
|
|
1479
|
-
catch (error) {
|
|
1480
|
-
let errorScreenshot = null;
|
|
1481
|
-
try {
|
|
1482
|
-
errorScreenshot = await captureScreenshot(page);
|
|
1483
|
-
}
|
|
1484
|
-
catch {
|
|
1485
|
-
// Ignore screenshot errors
|
|
1486
|
-
}
|
|
1487
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1488
|
-
return {
|
|
1489
|
-
success: false,
|
|
1490
|
-
action: "setEmbedProperties",
|
|
1491
|
-
description,
|
|
1492
|
-
screenshot: errorScreenshot?.data,
|
|
1493
|
-
format: errorScreenshot?.format ?? "png",
|
|
1494
|
-
context: {
|
|
1495
|
-
properties,
|
|
1496
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1497
|
-
},
|
|
1498
|
-
error: `setEmbedProperties failed: ${String(error)}`,
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
1283
|
case "scroll": {
|
|
1503
1284
|
const { x, y, deltaX, deltaY } = params;
|
|
1504
1285
|
const description = params.description || "Scroll page";
|
|
@@ -1512,7 +1293,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1512
1293
|
}
|
|
1513
1294
|
}, { x, y, deltaX, deltaY });
|
|
1514
1295
|
const screenshot = await captureScreenshot(page);
|
|
1515
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1516
1296
|
return {
|
|
1517
1297
|
success: true,
|
|
1518
1298
|
action: "scroll",
|
|
@@ -1524,7 +1304,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1524
1304
|
y,
|
|
1525
1305
|
deltaX,
|
|
1526
1306
|
deltaY,
|
|
1527
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1528
1307
|
},
|
|
1529
1308
|
};
|
|
1530
1309
|
}
|
|
@@ -1536,7 +1315,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1536
1315
|
catch {
|
|
1537
1316
|
// Ignore screenshot errors
|
|
1538
1317
|
}
|
|
1539
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1540
1318
|
return {
|
|
1541
1319
|
success: false,
|
|
1542
1320
|
action: "scroll",
|
|
@@ -1548,7 +1326,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1548
1326
|
y,
|
|
1549
1327
|
deltaX,
|
|
1550
1328
|
deltaY,
|
|
1551
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1552
1329
|
},
|
|
1553
1330
|
error: `Scroll failed: ${String(error)}`,
|
|
1554
1331
|
};
|
|
@@ -1565,7 +1342,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1565
1342
|
timeout: params.timeout ?? 10000,
|
|
1566
1343
|
});
|
|
1567
1344
|
const screenshot = await captureScreenshot(page);
|
|
1568
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1569
1345
|
return {
|
|
1570
1346
|
success: true,
|
|
1571
1347
|
action: "scrollIntoView",
|
|
@@ -1574,7 +1350,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1574
1350
|
format: screenshot.format,
|
|
1575
1351
|
context: {
|
|
1576
1352
|
selector,
|
|
1577
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1578
1353
|
},
|
|
1579
1354
|
};
|
|
1580
1355
|
}
|
|
@@ -1586,7 +1361,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1586
1361
|
catch {
|
|
1587
1362
|
// Ignore screenshot errors
|
|
1588
1363
|
}
|
|
1589
|
-
const embedEvents = await drainEmbedEvents(page);
|
|
1590
1364
|
return {
|
|
1591
1365
|
success: false,
|
|
1592
1366
|
action: "scrollIntoView",
|
|
@@ -1595,7 +1369,6 @@ async function executePlaywrightAction(action, page, params) {
|
|
|
1595
1369
|
format: errorScreenshot?.format ?? "png",
|
|
1596
1370
|
context: {
|
|
1597
1371
|
selector,
|
|
1598
|
-
...(embedEvents ? { embedEvents } : {}),
|
|
1599
1372
|
},
|
|
1600
1373
|
error: `scrollIntoView failed on "${selector}": ${String(error)}`,
|
|
1601
1374
|
};
|