@tianshu-ai/tianshu 0.3.0
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 +200 -0
- package/README.md +284 -0
- package/README.zh-CN.md +136 -0
- package/bin/tianshu.mjs +32 -0
- package/package.json +60 -0
- package/packages/plugin-sdk/dist/agent-loop.d.ts +96 -0
- package/packages/plugin-sdk/dist/agent-loop.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/agent-loop.js +11 -0
- package/packages/plugin-sdk/dist/agent-loop.js.map +1 -0
- package/packages/plugin-sdk/dist/capabilities.d.ts +48 -0
- package/packages/plugin-sdk/dist/capabilities.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/capabilities.js +61 -0
- package/packages/plugin-sdk/dist/capabilities.js.map +1 -0
- package/packages/plugin-sdk/dist/catalog.d.ts +60 -0
- package/packages/plugin-sdk/dist/catalog.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/catalog.js +11 -0
- package/packages/plugin-sdk/dist/catalog.js.map +1 -0
- package/packages/plugin-sdk/dist/client.d.ts +171 -0
- package/packages/plugin-sdk/dist/client.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/client.js +96 -0
- package/packages/plugin-sdk/dist/client.js.map +1 -0
- package/packages/plugin-sdk/dist/index.d.ts +9 -0
- package/packages/plugin-sdk/dist/index.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/index.js +19 -0
- package/packages/plugin-sdk/dist/index.js.map +1 -0
- package/packages/plugin-sdk/dist/lsp.d.ts +32 -0
- package/packages/plugin-sdk/dist/lsp.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/lsp.js +19 -0
- package/packages/plugin-sdk/dist/lsp.js.map +1 -0
- package/packages/plugin-sdk/dist/manifest.d.ts +423 -0
- package/packages/plugin-sdk/dist/manifest.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/manifest.js +7 -0
- package/packages/plugin-sdk/dist/manifest.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-client.d.ts +74 -0
- package/packages/plugin-sdk/dist/mcp-client.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-client.js +226 -0
- package/packages/plugin-sdk/dist/mcp-client.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-fetch.d.ts +10 -0
- package/packages/plugin-sdk/dist/mcp-fetch.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-fetch.js +130 -0
- package/packages/plugin-sdk/dist/mcp-fetch.js.map +1 -0
- package/packages/plugin-sdk/dist/mcp-toolset.d.ts +128 -0
- package/packages/plugin-sdk/dist/mcp-toolset.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/mcp-toolset.js +246 -0
- package/packages/plugin-sdk/dist/mcp-toolset.js.map +1 -0
- package/packages/plugin-sdk/dist/server.d.ts +486 -0
- package/packages/plugin-sdk/dist/server.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/server.js +10 -0
- package/packages/plugin-sdk/dist/server.js.map +1 -0
- package/packages/plugin-sdk/dist/session-inbox.d.ts +56 -0
- package/packages/plugin-sdk/dist/session-inbox.d.ts.map +1 -0
- package/packages/plugin-sdk/dist/session-inbox.js +12 -0
- package/packages/plugin-sdk/dist/session-inbox.js.map +1 -0
- package/packages/plugin-sdk/package.json +36 -0
- package/packages/server/builtinConfig/plugins/README.md +1 -0
- package/packages/server/builtinConfig/plugins/files/manifest.json +100 -0
- package/packages/server/builtinConfig/plugins/files/skills/files-workspace-layout.md +29 -0
- package/packages/server/builtinConfig/plugins/microsandbox/manifest.json +177 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-config.md +38 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
- package/packages/server/builtinConfig/plugins/microsandbox/skills/microsandbox-main-orchestration.md +75 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/README.md +26 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/browser.yaml +105 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner-with-browser.yaml +80 -0
- package/packages/server/builtinConfig/plugins/microsandbox/templates/task-runner.yaml +80 -0
- package/packages/server/builtinConfig/plugins/web-search/manifest.json +65 -0
- package/packages/server/builtinConfig/plugins/web-search/skills/web-search-howto.md +69 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
- package/packages/server/builtinConfig/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
- package/packages/server/builtinConfig/plugins/workboard/manifest.json +180 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/large-input-large-output.md +185 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/workboard-howto.md +166 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/worker-creator.md +267 -0
- package/packages/server/builtinConfig/plugins/workboard/skills/worker-fleet.md +431 -0
- package/packages/server/dist/catalog.d.ts +52 -0
- package/packages/server/dist/catalog.d.ts.map +1 -0
- package/packages/server/dist/catalog.js +189 -0
- package/packages/server/dist/catalog.js.map +1 -0
- package/packages/server/dist/chat/active-harnesses.d.ts +34 -0
- package/packages/server/dist/chat/active-harnesses.d.ts.map +1 -0
- package/packages/server/dist/chat/active-harnesses.js +118 -0
- package/packages/server/dist/chat/active-harnesses.js.map +1 -0
- package/packages/server/dist/chat/agent-loop.d.ts +64 -0
- package/packages/server/dist/chat/agent-loop.d.ts.map +1 -0
- package/packages/server/dist/chat/agent-loop.js +597 -0
- package/packages/server/dist/chat/agent-loop.js.map +1 -0
- package/packages/server/dist/chat/agent-tool-adapter.d.ts +33 -0
- package/packages/server/dist/chat/agent-tool-adapter.d.ts.map +1 -0
- package/packages/server/dist/chat/agent-tool-adapter.js +260 -0
- package/packages/server/dist/chat/agent-tool-adapter.js.map +1 -0
- package/packages/server/dist/chat/compact.d.ts +52 -0
- package/packages/server/dist/chat/compact.d.ts.map +1 -0
- package/packages/server/dist/chat/compact.js +248 -0
- package/packages/server/dist/chat/compact.js.map +1 -0
- package/packages/server/dist/chat/dump-system-prompt.d.ts +17 -0
- package/packages/server/dist/chat/dump-system-prompt.d.ts.map +1 -0
- package/packages/server/dist/chat/dump-system-prompt.js +58 -0
- package/packages/server/dist/chat/dump-system-prompt.js.map +1 -0
- package/packages/server/dist/chat/handler.d.ts +186 -0
- package/packages/server/dist/chat/handler.d.ts.map +1 -0
- package/packages/server/dist/chat/handler.js +1248 -0
- package/packages/server/dist/chat/handler.js.map +1 -0
- package/packages/server/dist/chat/image-fit.d.ts +34 -0
- package/packages/server/dist/chat/image-fit.d.ts.map +1 -0
- package/packages/server/dist/chat/image-fit.js +157 -0
- package/packages/server/dist/chat/image-fit.js.map +1 -0
- package/packages/server/dist/chat/messages.d.ts +118 -0
- package/packages/server/dist/chat/messages.d.ts.map +1 -0
- package/packages/server/dist/chat/messages.js +341 -0
- package/packages/server/dist/chat/messages.js.map +1 -0
- package/packages/server/dist/chat/session-inbox.d.ts +114 -0
- package/packages/server/dist/chat/session-inbox.d.ts.map +1 -0
- package/packages/server/dist/chat/session-inbox.js +418 -0
- package/packages/server/dist/chat/session-inbox.js.map +1 -0
- package/packages/server/dist/chat/sqlite-session-repo.d.ts +26 -0
- package/packages/server/dist/chat/sqlite-session-repo.d.ts.map +1 -0
- package/packages/server/dist/chat/sqlite-session-repo.js +132 -0
- package/packages/server/dist/chat/sqlite-session-repo.js.map +1 -0
- package/packages/server/dist/chat/sqlite-session-storage.d.ts +83 -0
- package/packages/server/dist/chat/sqlite-session-storage.d.ts.map +1 -0
- package/packages/server/dist/chat/sqlite-session-storage.js +418 -0
- package/packages/server/dist/chat/sqlite-session-storage.js.map +1 -0
- package/packages/server/dist/chat/stub-execution-env.d.ts +3 -0
- package/packages/server/dist/chat/stub-execution-env.d.ts.map +1 -0
- package/packages/server/dist/chat/stub-execution-env.js +87 -0
- package/packages/server/dist/chat/stub-execution-env.js.map +1 -0
- package/packages/server/dist/chat/token-estimate.d.ts +11 -0
- package/packages/server/dist/chat/token-estimate.d.ts.map +1 -0
- package/packages/server/dist/chat/token-estimate.js +67 -0
- package/packages/server/dist/chat/token-estimate.js.map +1 -0
- package/packages/server/dist/chat/ws-protocol.d.ts +244 -0
- package/packages/server/dist/chat/ws-protocol.d.ts.map +1 -0
- package/packages/server/dist/chat/ws-protocol.js +193 -0
- package/packages/server/dist/chat/ws-protocol.js.map +1 -0
- package/packages/server/dist/cli.d.ts +9 -0
- package/packages/server/dist/cli.d.ts.map +1 -0
- package/packages/server/dist/cli.js +329 -0
- package/packages/server/dist/cli.js.map +1 -0
- package/packages/server/dist/core/agent-seeds.d.ts +25 -0
- package/packages/server/dist/core/agent-seeds.d.ts.map +1 -0
- package/packages/server/dist/core/agent-seeds.js +69 -0
- package/packages/server/dist/core/agent-seeds.js.map +1 -0
- package/packages/server/dist/core/config.d.ts +172 -0
- package/packages/server/dist/core/config.d.ts.map +1 -0
- package/packages/server/dist/core/config.js +155 -0
- package/packages/server/dist/core/config.js.map +1 -0
- package/packages/server/dist/core/db-pool.d.ts +32 -0
- package/packages/server/dist/core/db-pool.d.ts.map +1 -0
- package/packages/server/dist/core/db-pool.js +108 -0
- package/packages/server/dist/core/db-pool.js.map +1 -0
- package/packages/server/dist/core/dev-mode.d.ts +13 -0
- package/packages/server/dist/core/dev-mode.d.ts.map +1 -0
- package/packages/server/dist/core/dev-mode.js +51 -0
- package/packages/server/dist/core/dev-mode.js.map +1 -0
- package/packages/server/dist/core/global-ops.d.ts +54 -0
- package/packages/server/dist/core/global-ops.d.ts.map +1 -0
- package/packages/server/dist/core/global-ops.js +143 -0
- package/packages/server/dist/core/global-ops.js.map +1 -0
- package/packages/server/dist/core/identity-resolvers.d.ts +102 -0
- package/packages/server/dist/core/identity-resolvers.d.ts.map +1 -0
- package/packages/server/dist/core/identity-resolvers.js +176 -0
- package/packages/server/dist/core/identity-resolvers.js.map +1 -0
- package/packages/server/dist/core/index.d.ts +13 -0
- package/packages/server/dist/core/index.d.ts.map +1 -0
- package/packages/server/dist/core/index.js +18 -0
- package/packages/server/dist/core/index.js.map +1 -0
- package/packages/server/dist/core/llm.d.ts +45 -0
- package/packages/server/dist/core/llm.d.ts.map +1 -0
- package/packages/server/dist/core/llm.js +140 -0
- package/packages/server/dist/core/llm.js.map +1 -0
- package/packages/server/dist/core/mcp-manager.d.ts +47 -0
- package/packages/server/dist/core/mcp-manager.d.ts.map +1 -0
- package/packages/server/dist/core/mcp-manager.js +129 -0
- package/packages/server/dist/core/mcp-manager.js.map +1 -0
- package/packages/server/dist/core/middleware.d.ts +31 -0
- package/packages/server/dist/core/middleware.d.ts.map +1 -0
- package/packages/server/dist/core/middleware.js +102 -0
- package/packages/server/dist/core/middleware.js.map +1 -0
- package/packages/server/dist/core/migrations/001-initial.d.ts +4 -0
- package/packages/server/dist/core/migrations/001-initial.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/001-initial.js +66 -0
- package/packages/server/dist/core/migrations/001-initial.js.map +1 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.d.ts +4 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.js +20 -0
- package/packages/server/dist/core/migrations/002-task-dependencies.js.map +1 -0
- package/packages/server/dist/core/migrations/003-session-tree.d.ts +4 -0
- package/packages/server/dist/core/migrations/003-session-tree.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/003-session-tree.js +96 -0
- package/packages/server/dist/core/migrations/003-session-tree.js.map +1 -0
- package/packages/server/dist/core/migrations/003-worker-agents.d.ts +4 -0
- package/packages/server/dist/core/migrations/003-worker-agents.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/003-worker-agents.js +65 -0
- package/packages/server/dist/core/migrations/003-worker-agents.js.map +1 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts +4 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.js +52 -0
- package/packages/server/dist/core/migrations/004-rebuild-message-chain.js.map +1 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.d.ts +4 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.js +64 -0
- package/packages/server/dist/core/migrations/005-task-status-rename.js.map +1 -0
- package/packages/server/dist/core/migrations/006-task-labels.d.ts +4 -0
- package/packages/server/dist/core/migrations/006-task-labels.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/006-task-labels.js +43 -0
- package/packages/server/dist/core/migrations/006-task-labels.js.map +1 -0
- package/packages/server/dist/core/migrations/007-session-inbox.d.ts +4 -0
- package/packages/server/dist/core/migrations/007-session-inbox.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/007-session-inbox.js +67 -0
- package/packages/server/dist/core/migrations/007-session-inbox.js.map +1 -0
- package/packages/server/dist/core/migrations/008-task-intervention.d.ts +4 -0
- package/packages/server/dist/core/migrations/008-task-intervention.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/008-task-intervention.js +60 -0
- package/packages/server/dist/core/migrations/008-task-intervention.js.map +1 -0
- package/packages/server/dist/core/migrations/index.d.ts +12 -0
- package/packages/server/dist/core/migrations/index.d.ts.map +1 -0
- package/packages/server/dist/core/migrations/index.js +58 -0
- package/packages/server/dist/core/migrations/index.js.map +1 -0
- package/packages/server/dist/core/paths.d.ts +53 -0
- package/packages/server/dist/core/paths.d.ts.map +1 -0
- package/packages/server/dist/core/paths.js +125 -0
- package/packages/server/dist/core/paths.js.map +1 -0
- package/packages/server/dist/core/plugins/builtin-loader.d.ts +56 -0
- package/packages/server/dist/core/plugins/builtin-loader.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/builtin-loader.js +153 -0
- package/packages/server/dist/core/plugins/builtin-loader.js.map +1 -0
- package/packages/server/dist/core/plugins/discovery.d.ts +28 -0
- package/packages/server/dist/core/plugins/discovery.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/discovery.js +97 -0
- package/packages/server/dist/core/plugins/discovery.js.map +1 -0
- package/packages/server/dist/core/plugins/index.d.ts +6 -0
- package/packages/server/dist/core/plugins/index.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/index.js +6 -0
- package/packages/server/dist/core/plugins/index.js.map +1 -0
- package/packages/server/dist/core/plugins/manifest.d.ts +9 -0
- package/packages/server/dist/core/plugins/manifest.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/manifest.js +584 -0
- package/packages/server/dist/core/plugins/manifest.js.map +1 -0
- package/packages/server/dist/core/plugins/registry.d.ts +269 -0
- package/packages/server/dist/core/plugins/registry.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/registry.js +1003 -0
- package/packages/server/dist/core/plugins/registry.js.map +1 -0
- package/packages/server/dist/core/plugins/secrets.d.ts +46 -0
- package/packages/server/dist/core/plugins/secrets.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/secrets.js +174 -0
- package/packages/server/dist/core/plugins/secrets.js.map +1 -0
- package/packages/server/dist/core/plugins/skills.d.ts +131 -0
- package/packages/server/dist/core/plugins/skills.d.ts.map +1 -0
- package/packages/server/dist/core/plugins/skills.js +389 -0
- package/packages/server/dist/core/plugins/skills.js.map +1 -0
- package/packages/server/dist/core/templates.d.ts +28 -0
- package/packages/server/dist/core/templates.d.ts.map +1 -0
- package/packages/server/dist/core/templates.js +103 -0
- package/packages/server/dist/core/templates.js.map +1 -0
- package/packages/server/dist/core/tenant-context.d.ts +18 -0
- package/packages/server/dist/core/tenant-context.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-context.js +42 -0
- package/packages/server/dist/core/tenant-context.js.map +1 -0
- package/packages/server/dist/core/tenant-id.d.ts +8 -0
- package/packages/server/dist/core/tenant-id.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-id.js +53 -0
- package/packages/server/dist/core/tenant-id.js.map +1 -0
- package/packages/server/dist/core/tenant-skills.d.ts +29 -0
- package/packages/server/dist/core/tenant-skills.d.ts.map +1 -0
- package/packages/server/dist/core/tenant-skills.js +77 -0
- package/packages/server/dist/core/tenant-skills.js.map +1 -0
- package/packages/server/dist/core/worker-agents-fs.d.ts +44 -0
- package/packages/server/dist/core/worker-agents-fs.d.ts.map +1 -0
- package/packages/server/dist/core/worker-agents-fs.js +86 -0
- package/packages/server/dist/core/worker-agents-fs.js.map +1 -0
- package/packages/server/dist/core/worker-agents.d.ts +77 -0
- package/packages/server/dist/core/worker-agents.d.ts.map +1 -0
- package/packages/server/dist/core/worker-agents.js +191 -0
- package/packages/server/dist/core/worker-agents.js.map +1 -0
- package/packages/server/dist/index.d.ts +2 -0
- package/packages/server/dist/index.d.ts.map +1 -0
- package/packages/server/dist/index.js +623 -0
- package/packages/server/dist/index.js.map +1 -0
- package/packages/server/dist/lsp/client.d.ts +53 -0
- package/packages/server/dist/lsp/client.d.ts.map +1 -0
- package/packages/server/dist/lsp/client.js +258 -0
- package/packages/server/dist/lsp/client.js.map +1 -0
- package/packages/server/dist/lsp/format.d.ts +13 -0
- package/packages/server/dist/lsp/format.d.ts.map +1 -0
- package/packages/server/dist/lsp/format.js +55 -0
- package/packages/server/dist/lsp/format.js.map +1 -0
- package/packages/server/dist/lsp/index.d.ts +20 -0
- package/packages/server/dist/lsp/index.d.ts.map +1 -0
- package/packages/server/dist/lsp/index.js +32 -0
- package/packages/server/dist/lsp/index.js.map +1 -0
- package/packages/server/dist/lsp/language-registry.d.ts +29 -0
- package/packages/server/dist/lsp/language-registry.d.ts.map +1 -0
- package/packages/server/dist/lsp/language-registry.js +62 -0
- package/packages/server/dist/lsp/language-registry.js.map +1 -0
- package/packages/server/dist/lsp/manager.d.ts +77 -0
- package/packages/server/dist/lsp/manager.d.ts.map +1 -0
- package/packages/server/dist/lsp/manager.js +300 -0
- package/packages/server/dist/lsp/manager.js.map +1 -0
- package/packages/server/dist/plugins-routes.d.ts +96 -0
- package/packages/server/dist/plugins-routes.d.ts.map +1 -0
- package/packages/server/dist/plugins-routes.js +627 -0
- package/packages/server/dist/plugins-routes.js.map +1 -0
- package/packages/server/dist/setup/checks/config.d.ts +9 -0
- package/packages/server/dist/setup/checks/config.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/config.js +66 -0
- package/packages/server/dist/setup/checks/config.js.map +1 -0
- package/packages/server/dist/setup/checks/db.d.ts +6 -0
- package/packages/server/dist/setup/checks/db.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/db.js +79 -0
- package/packages/server/dist/setup/checks/db.js.map +1 -0
- package/packages/server/dist/setup/checks/known-models.d.ts +18 -0
- package/packages/server/dist/setup/checks/known-models.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/known-models.js +119 -0
- package/packages/server/dist/setup/checks/known-models.js.map +1 -0
- package/packages/server/dist/setup/checks/network.d.ts +11 -0
- package/packages/server/dist/setup/checks/network.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/network.js +176 -0
- package/packages/server/dist/setup/checks/network.js.map +1 -0
- package/packages/server/dist/setup/checks/plugins.d.ts +9 -0
- package/packages/server/dist/setup/checks/plugins.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/plugins.js +194 -0
- package/packages/server/dist/setup/checks/plugins.js.map +1 -0
- package/packages/server/dist/setup/checks/providers.d.ts +12 -0
- package/packages/server/dist/setup/checks/providers.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/providers.js +368 -0
- package/packages/server/dist/setup/checks/providers.js.map +1 -0
- package/packages/server/dist/setup/checks/runtime.d.ts +3 -0
- package/packages/server/dist/setup/checks/runtime.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/runtime.js +44 -0
- package/packages/server/dist/setup/checks/runtime.js.map +1 -0
- package/packages/server/dist/setup/checks/sandbox.d.ts +9 -0
- package/packages/server/dist/setup/checks/sandbox.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/sandbox.js +110 -0
- package/packages/server/dist/setup/checks/sandbox.js.map +1 -0
- package/packages/server/dist/setup/checks/tenants.d.ts +9 -0
- package/packages/server/dist/setup/checks/tenants.d.ts.map +1 -0
- package/packages/server/dist/setup/checks/tenants.js +509 -0
- package/packages/server/dist/setup/checks/tenants.js.map +1 -0
- package/packages/server/dist/setup/cli-agent.d.ts +39 -0
- package/packages/server/dist/setup/cli-agent.d.ts.map +1 -0
- package/packages/server/dist/setup/cli-agent.js +1353 -0
- package/packages/server/dist/setup/cli-agent.js.map +1 -0
- package/packages/server/dist/setup/doctor.d.ts +32 -0
- package/packages/server/dist/setup/doctor.d.ts.map +1 -0
- package/packages/server/dist/setup/doctor.js +80 -0
- package/packages/server/dist/setup/doctor.js.map +1 -0
- package/packages/server/dist/setup/launchd.d.ts +107 -0
- package/packages/server/dist/setup/launchd.d.ts.map +1 -0
- package/packages/server/dist/setup/launchd.js +309 -0
- package/packages/server/dist/setup/launchd.js.map +1 -0
- package/packages/server/dist/setup/load-env.d.ts +21 -0
- package/packages/server/dist/setup/load-env.d.ts.map +1 -0
- package/packages/server/dist/setup/load-env.js +88 -0
- package/packages/server/dist/setup/load-env.js.map +1 -0
- package/packages/server/dist/setup/probe-default-model.d.ts +28 -0
- package/packages/server/dist/setup/probe-default-model.d.ts.map +1 -0
- package/packages/server/dist/setup/probe-default-model.js +133 -0
- package/packages/server/dist/setup/probe-default-model.js.map +1 -0
- package/packages/server/dist/setup/render.d.ts +28 -0
- package/packages/server/dist/setup/render.d.ts.map +1 -0
- package/packages/server/dist/setup/render.js +60 -0
- package/packages/server/dist/setup/render.js.map +1 -0
- package/packages/server/dist/setup/repo-root.d.ts +3 -0
- package/packages/server/dist/setup/repo-root.d.ts.map +1 -0
- package/packages/server/dist/setup/repo-root.js +43 -0
- package/packages/server/dist/setup/repo-root.js.map +1 -0
- package/packages/server/dist/setup/service.d.ts +60 -0
- package/packages/server/dist/setup/service.d.ts.map +1 -0
- package/packages/server/dist/setup/service.js +345 -0
- package/packages/server/dist/setup/service.js.map +1 -0
- package/packages/server/dist/setup/start-server.d.ts +23 -0
- package/packages/server/dist/setup/start-server.d.ts.map +1 -0
- package/packages/server/dist/setup/start-server.js +465 -0
- package/packages/server/dist/setup/start-server.js.map +1 -0
- package/packages/server/dist/setup/wizard.d.ts +59 -0
- package/packages/server/dist/setup/wizard.d.ts.map +1 -0
- package/packages/server/dist/setup/wizard.js +556 -0
- package/packages/server/dist/setup/wizard.js.map +1 -0
- package/packages/server/dist/tools/edit-file.d.ts +13 -0
- package/packages/server/dist/tools/edit-file.d.ts.map +1 -0
- package/packages/server/dist/tools/edit-file.js +90 -0
- package/packages/server/dist/tools/edit-file.js.map +1 -0
- package/packages/server/dist/tools/glob.d.ts +12 -0
- package/packages/server/dist/tools/glob.d.ts.map +1 -0
- package/packages/server/dist/tools/glob.js +82 -0
- package/packages/server/dist/tools/glob.js.map +1 -0
- package/packages/server/dist/tools/index.d.ts +82 -0
- package/packages/server/dist/tools/index.d.ts.map +1 -0
- package/packages/server/dist/tools/index.js +72 -0
- package/packages/server/dist/tools/index.js.map +1 -0
- package/packages/server/dist/tools/list-dir.d.ts +24 -0
- package/packages/server/dist/tools/list-dir.d.ts.map +1 -0
- package/packages/server/dist/tools/list-dir.js +99 -0
- package/packages/server/dist/tools/list-dir.js.map +1 -0
- package/packages/server/dist/tools/path-helper.d.ts +15 -0
- package/packages/server/dist/tools/path-helper.d.ts.map +1 -0
- package/packages/server/dist/tools/path-helper.js +72 -0
- package/packages/server/dist/tools/path-helper.js.map +1 -0
- package/packages/server/dist/tools/read-file.d.ts +17 -0
- package/packages/server/dist/tools/read-file.d.ts.map +1 -0
- package/packages/server/dist/tools/read-file.js +94 -0
- package/packages/server/dist/tools/read-file.js.map +1 -0
- package/packages/server/dist/tools/sandbox.d.ts +57 -0
- package/packages/server/dist/tools/sandbox.d.ts.map +1 -0
- package/packages/server/dist/tools/sandbox.js +291 -0
- package/packages/server/dist/tools/sandbox.js.map +1 -0
- package/packages/server/dist/tools/write-file.d.ts +12 -0
- package/packages/server/dist/tools/write-file.d.ts.map +1 -0
- package/packages/server/dist/tools/write-file.js +67 -0
- package/packages/server/dist/tools/write-file.js.map +1 -0
- package/packages/server/dist/worker-agents-routes.d.ts +11 -0
- package/packages/server/dist/worker-agents-routes.d.ts.map +1 -0
- package/packages/server/dist/worker-agents-routes.js +253 -0
- package/packages/server/dist/worker-agents-routes.js.map +1 -0
- package/packages/server/package.json +41 -0
- package/packages/web/dist/assets/index-DH-gJ09_.js +60 -0
- package/packages/web/dist/assets/index-xU4lYYqY.css +2 -0
- package/packages/web/dist/index.html +14 -0
- package/packages/web/package.json +36 -0
- package/plugins/README.md +64 -0
- package/plugins/files/dist/client.d.ts +5 -0
- package/plugins/files/dist/client.d.ts.map +1 -0
- package/plugins/files/dist/client.js +354 -0
- package/plugins/files/dist/client.js.map +1 -0
- package/plugins/files/dist/server.d.ts +32 -0
- package/plugins/files/dist/server.d.ts.map +1 -0
- package/plugins/files/dist/server.js +514 -0
- package/plugins/files/dist/server.js.map +1 -0
- package/plugins/files/dist/tools/edit-file.d.ts +29 -0
- package/plugins/files/dist/tools/edit-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/edit-file.js +230 -0
- package/plugins/files/dist/tools/edit-file.js.map +1 -0
- package/plugins/files/dist/tools/edit-file.prompt.md +36 -0
- package/plugins/files/dist/tools/glob.d.ts +12 -0
- package/plugins/files/dist/tools/glob.d.ts.map +1 -0
- package/plugins/files/dist/tools/glob.js +84 -0
- package/plugins/files/dist/tools/glob.js.map +1 -0
- package/plugins/files/dist/tools/index.d.ts +13 -0
- package/plugins/files/dist/tools/index.d.ts.map +1 -0
- package/plugins/files/dist/tools/index.js +158 -0
- package/plugins/files/dist/tools/index.js.map +1 -0
- package/plugins/files/dist/tools/list-dir.d.ts +24 -0
- package/plugins/files/dist/tools/list-dir.d.ts.map +1 -0
- package/plugins/files/dist/tools/list-dir.js +104 -0
- package/plugins/files/dist/tools/list-dir.js.map +1 -0
- package/plugins/files/dist/tools/load-prompt.d.ts +5 -0
- package/plugins/files/dist/tools/load-prompt.d.ts.map +1 -0
- package/plugins/files/dist/tools/load-prompt.js +39 -0
- package/plugins/files/dist/tools/load-prompt.js.map +1 -0
- package/plugins/files/dist/tools/path-helper.d.ts +32 -0
- package/plugins/files/dist/tools/path-helper.d.ts.map +1 -0
- package/plugins/files/dist/tools/path-helper.js +113 -0
- package/plugins/files/dist/tools/path-helper.js.map +1 -0
- package/plugins/files/dist/tools/read-file.d.ts +17 -0
- package/plugins/files/dist/tools/read-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/read-file.js +109 -0
- package/plugins/files/dist/tools/read-file.js.map +1 -0
- package/plugins/files/dist/tools/read-tracker.d.ts +28 -0
- package/plugins/files/dist/tools/read-tracker.d.ts.map +1 -0
- package/plugins/files/dist/tools/read-tracker.js +135 -0
- package/plugins/files/dist/tools/read-tracker.js.map +1 -0
- package/plugins/files/dist/tools/replacers.d.ts +27 -0
- package/plugins/files/dist/tools/replacers.d.ts.map +1 -0
- package/plugins/files/dist/tools/replacers.js +221 -0
- package/plugins/files/dist/tools/replacers.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-delete.d.ts +12 -0
- package/plugins/files/dist/tools/tenant-config-delete.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-delete.js +70 -0
- package/plugins/files/dist/tools/tenant-config-delete.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-edit.d.ts +25 -0
- package/plugins/files/dist/tools/tenant-config-edit.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-edit.js +142 -0
- package/plugins/files/dist/tools/tenant-config-edit.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-glob.d.ts +12 -0
- package/plugins/files/dist/tools/tenant-config-glob.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-glob.js +64 -0
- package/plugins/files/dist/tools/tenant-config-glob.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-helper.d.ts +64 -0
- package/plugins/files/dist/tools/tenant-config-helper.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-helper.js +162 -0
- package/plugins/files/dist/tools/tenant-config-helper.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-list.d.ts +20 -0
- package/plugins/files/dist/tools/tenant-config-list.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-list.js +95 -0
- package/plugins/files/dist/tools/tenant-config-list.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-read.d.ts +17 -0
- package/plugins/files/dist/tools/tenant-config-read.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-read.js +87 -0
- package/plugins/files/dist/tools/tenant-config-read.js.map +1 -0
- package/plugins/files/dist/tools/tenant-config-write.d.ts +14 -0
- package/plugins/files/dist/tools/tenant-config-write.d.ts.map +1 -0
- package/plugins/files/dist/tools/tenant-config-write.js +78 -0
- package/plugins/files/dist/tools/tenant-config-write.js.map +1 -0
- package/plugins/files/dist/tools/text-shape.d.ts +20 -0
- package/plugins/files/dist/tools/text-shape.d.ts.map +1 -0
- package/plugins/files/dist/tools/text-shape.js +57 -0
- package/plugins/files/dist/tools/text-shape.js.map +1 -0
- package/plugins/files/dist/tools/write-file.d.ts +12 -0
- package/plugins/files/dist/tools/write-file.d.ts.map +1 -0
- package/plugins/files/dist/tools/write-file.js +89 -0
- package/plugins/files/dist/tools/write-file.js.map +1 -0
- package/plugins/files/dist/tools/write-file.prompt.md +14 -0
- package/plugins/files/manifest.json +100 -0
- package/plugins/files/package.json +39 -0
- package/plugins/files/skills/files-workspace-layout.md +29 -0
- package/plugins/microsandbox/dist/admin/browser-routes.d.ts +41 -0
- package/plugins/microsandbox/dist/admin/browser-routes.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/browser-routes.js +208 -0
- package/plugins/microsandbox/dist/admin/browser-routes.js.map +1 -0
- package/plugins/microsandbox/dist/admin/preview-exec.d.ts +38 -0
- package/plugins/microsandbox/dist/admin/preview-exec.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/preview-exec.js +185 -0
- package/plugins/microsandbox/dist/admin/preview-exec.js.map +1 -0
- package/plugins/microsandbox/dist/admin/routes.d.ts +35 -0
- package/plugins/microsandbox/dist/admin/routes.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/routes.js +728 -0
- package/plugins/microsandbox/dist/admin/routes.js.map +1 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts +11 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.js +72 -0
- package/plugins/microsandbox/dist/admin/sandboxfile-io.js.map +1 -0
- package/plugins/microsandbox/dist/admin/templates.d.ts +16 -0
- package/plugins/microsandbox/dist/admin/templates.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin/templates.js +66 -0
- package/plugins/microsandbox/dist/admin/templates.js.map +1 -0
- package/plugins/microsandbox/dist/admin.d.ts +5 -0
- package/plugins/microsandbox/dist/admin.d.ts.map +1 -0
- package/plugins/microsandbox/dist/admin.js +256 -0
- package/plugins/microsandbox/dist/admin.js.map +1 -0
- package/plugins/microsandbox/dist/build/builder.d.ts +69 -0
- package/plugins/microsandbox/dist/build/builder.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/builder.js +257 -0
- package/plugins/microsandbox/dist/build/builder.js.map +1 -0
- package/plugins/microsandbox/dist/build/metadata.d.ts +27 -0
- package/plugins/microsandbox/dist/build/metadata.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/metadata.js +55 -0
- package/plugins/microsandbox/dist/build/metadata.js.map +1 -0
- package/plugins/microsandbox/dist/build/pointer.d.ts +51 -0
- package/plugins/microsandbox/dist/build/pointer.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/pointer.js +130 -0
- package/plugins/microsandbox/dist/build/pointer.js.map +1 -0
- package/plugins/microsandbox/dist/build/sandboxfile.d.ts +15 -0
- package/plugins/microsandbox/dist/build/sandboxfile.d.ts.map +1 -0
- package/plugins/microsandbox/dist/build/sandboxfile.js +176 -0
- package/plugins/microsandbox/dist/build/sandboxfile.js.map +1 -0
- package/plugins/microsandbox/dist/client.d.ts +5 -0
- package/plugins/microsandbox/dist/client.d.ts.map +1 -0
- package/plugins/microsandbox/dist/client.js +941 -0
- package/plugins/microsandbox/dist/client.js.map +1 -0
- package/plugins/microsandbox/dist/runner/browser.d.ts +50 -0
- package/plugins/microsandbox/dist/runner/browser.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/browser.js +142 -0
- package/plugins/microsandbox/dist/runner/browser.js.map +1 -0
- package/plugins/microsandbox/dist/runner/free-port.d.ts +6 -0
- package/plugins/microsandbox/dist/runner/free-port.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/free-port.js +53 -0
- package/plugins/microsandbox/dist/runner/free-port.js.map +1 -0
- package/plugins/microsandbox/dist/runner/index.d.ts +28 -0
- package/plugins/microsandbox/dist/runner/index.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/index.js +72 -0
- package/plugins/microsandbox/dist/runner/index.js.map +1 -0
- package/plugins/microsandbox/dist/runner/microsandbox.d.ts +64 -0
- package/plugins/microsandbox/dist/runner/microsandbox.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/microsandbox.js +668 -0
- package/plugins/microsandbox/dist/runner/microsandbox.js.map +1 -0
- package/plugins/microsandbox/dist/runner/nullable.d.ts +36 -0
- package/plugins/microsandbox/dist/runner/nullable.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/nullable.js +82 -0
- package/plugins/microsandbox/dist/runner/nullable.js.map +1 -0
- package/plugins/microsandbox/dist/runner/pool.d.ts +97 -0
- package/plugins/microsandbox/dist/runner/pool.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/pool.js +494 -0
- package/plugins/microsandbox/dist/runner/pool.js.map +1 -0
- package/plugins/microsandbox/dist/runner/types.d.ts +33 -0
- package/plugins/microsandbox/dist/runner/types.d.ts.map +1 -0
- package/plugins/microsandbox/dist/runner/types.js +79 -0
- package/plugins/microsandbox/dist/runner/types.js.map +1 -0
- package/plugins/microsandbox/dist/server.d.ts +7 -0
- package/plugins/microsandbox/dist/server.d.ts.map +1 -0
- package/plugins/microsandbox/dist/server.js +276 -0
- package/plugins/microsandbox/dist/server.js.map +1 -0
- package/plugins/microsandbox/dist/tools/browser.d.ts +25 -0
- package/plugins/microsandbox/dist/tools/browser.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/browser.js +78 -0
- package/plugins/microsandbox/dist/tools/browser.js.map +1 -0
- package/plugins/microsandbox/dist/tools/build.d.ts +5 -0
- package/plugins/microsandbox/dist/tools/build.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/build.js +243 -0
- package/plugins/microsandbox/dist/tools/build.js.map +1 -0
- package/plugins/microsandbox/dist/tools/index.d.ts +9 -0
- package/plugins/microsandbox/dist/tools/index.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/index.js +430 -0
- package/plugins/microsandbox/dist/tools/index.js.map +1 -0
- package/plugins/microsandbox/dist/tools/mcp-client.d.ts +63 -0
- package/plugins/microsandbox/dist/tools/mcp-client.d.ts.map +1 -0
- package/plugins/microsandbox/dist/tools/mcp-client.js +226 -0
- package/plugins/microsandbox/dist/tools/mcp-client.js.map +1 -0
- package/plugins/microsandbox/manifest.json +177 -0
- package/plugins/microsandbox/package.json +38 -0
- package/plugins/microsandbox/skills/microsandbox-browser-howto.md +155 -0
- package/plugins/microsandbox/skills/microsandbox-build-use.md +201 -0
- package/plugins/microsandbox/skills/microsandbox-config.md +38 -0
- package/plugins/microsandbox/skills/microsandbox-exec-howto.md +144 -0
- package/plugins/microsandbox/skills/microsandbox-libreoffice.md +159 -0
- package/plugins/microsandbox/templates/README.md +26 -0
- package/plugins/web-search/dist/server.d.ts +4 -0
- package/plugins/web-search/dist/server.d.ts.map +1 -0
- package/plugins/web-search/dist/server.js +73 -0
- package/plugins/web-search/dist/server.js.map +1 -0
- package/plugins/web-search/dist/tools/health.d.ts +31 -0
- package/plugins/web-search/dist/tools/health.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/health.js +59 -0
- package/plugins/web-search/dist/tools/health.js.map +1 -0
- package/plugins/web-search/dist/tools/index.d.ts +3 -0
- package/plugins/web-search/dist/tools/index.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/index.js +2 -0
- package/plugins/web-search/dist/tools/index.js.map +1 -0
- package/plugins/web-search/dist/tools/providers.d.ts +43 -0
- package/plugins/web-search/dist/tools/providers.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/providers.js +140 -0
- package/plugins/web-search/dist/tools/providers.js.map +1 -0
- package/plugins/web-search/dist/tools/web-search.d.ts +15 -0
- package/plugins/web-search/dist/tools/web-search.d.ts.map +1 -0
- package/plugins/web-search/dist/tools/web-search.js +244 -0
- package/plugins/web-search/dist/tools/web-search.js.map +1 -0
- package/plugins/web-search/manifest.json +65 -0
- package/plugins/web-search/node_modules/@esbuild/darwin-arm64/README.md +3 -0
- package/plugins/web-search/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/plugins/web-search/node_modules/@vitest/expect/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/expect/README.md +21 -0
- package/plugins/web-search/node_modules/@vitest/expect/dist/index.d.ts +808 -0
- package/plugins/web-search/node_modules/@vitest/expect/dist/index.js +1799 -0
- package/plugins/web-search/node_modules/@vitest/expect/package.json +46 -0
- package/plugins/web-search/node_modules/@vitest/mocker/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/mocker/README.md +5 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.d.ts +2 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/auto-register.js +9 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/browser.js +91 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-interceptor-native.js +15 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-mocker.js +1602 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-pathe.M-eThtNZ.js +174 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-registry.js +182 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/chunk-utils.js +16 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/index.d.ts +21 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/index.js +174 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/mocker.d-Ce9_ySj5.d.ts +83 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/node.d.ts +821 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/node.js +1306 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.d.ts +3 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/redirect.js +75 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/register.d.ts +9 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/register.js +41 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/registry.d-D765pazg.d.ts +87 -0
- package/plugins/web-search/node_modules/@vitest/mocker/dist/types.d-D_aRZRdy.d.ts +8 -0
- package/plugins/web-search/node_modules/@vitest/mocker/package.json +82 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.d.ts +119 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/dist/index.js +1387 -0
- package/plugins/web-search/node_modules/@vitest/pretty-format/package.json +44 -0
- package/plugins/web-search/node_modules/@vitest/runner/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/runner/README.md +5 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/chunk-hooks.js +2254 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/index.d.ts +261 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/index.js +6 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/tasks.d-CkscK4of.d.ts +558 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/types.d.ts +163 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/types.js +1 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/utils.d.ts +47 -0
- package/plugins/web-search/node_modules/@vitest/runner/dist/utils.js +6 -0
- package/plugins/web-search/node_modules/@vitest/runner/package.json +49 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/README.md +84 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d-DHdQ1Csl.d.ts +22 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.d.ts +16 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/environment.js +40 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.d.ts +137 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/index.js +2305 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.d.ts +18 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/manager.js +73 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/dist/rawSnapshot.d-lFsMJFUd.d.ts +61 -0
- package/plugins/web-search/node_modules/@vitest/snapshot/package.json +54 -0
- package/plugins/web-search/node_modules/@vitest/spy/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/spy/README.md +3 -0
- package/plugins/web-search/node_modules/@vitest/spy/dist/index.d.ts +356 -0
- package/plugins/web-search/node_modules/@vitest/spy/dist/index.js +191 -0
- package/plugins/web-search/node_modules/@vitest/spy/package.json +38 -0
- package/plugins/web-search/node_modules/@vitest/utils/LICENSE +21 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +158 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/diff.d.ts +104 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/diff.js +2185 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/error.d.ts +9 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/error.js +162 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.d.ts +56 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/helpers.js +251 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/index.d.ts +57 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/index.js +633 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.d.ts +139 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/source-map.js +996 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.d-BCElaP-c.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.d.ts +53 -0
- package/plugins/web-search/node_modules/@vitest/utils/dist/types.js +1 -0
- package/plugins/web-search/node_modules/@vitest/utils/package.json +77 -0
- package/plugins/web-search/node_modules/chai/LICENSE +21 -0
- package/plugins/web-search/node_modules/chai/README.md +162 -0
- package/plugins/web-search/node_modules/chai/package.json +74 -0
- package/plugins/web-search/node_modules/esbuild/README.md +3 -0
- package/plugins/web-search/node_modules/esbuild/package.json +49 -0
- package/plugins/web-search/node_modules/std-env/README.md +118 -0
- package/plugins/web-search/node_modules/std-env/dist/index.cjs +1 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.cts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.mts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.d.ts +92 -0
- package/plugins/web-search/node_modules/std-env/dist/index.mjs +1 -0
- package/plugins/web-search/node_modules/std-env/package.json +46 -0
- package/plugins/web-search/node_modules/tinyexec/LICENSE +21 -0
- package/plugins/web-search/node_modules/tinyexec/README.md +256 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.cjs +575 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.d.cts +70 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.d.ts +70 -0
- package/plugins/web-search/node_modules/tinyexec/dist/main.js +578 -0
- package/plugins/web-search/node_modules/tinyexec/package.json +66 -0
- package/plugins/web-search/node_modules/tinyrainbow/README.md +28 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/browser.d.ts +8 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/browser.js +20 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +90 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/index-8b61d5bc.d.ts +59 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/node.d.ts +8 -0
- package/plugins/web-search/node_modules/tinyrainbow/dist/node.js +22 -0
- package/plugins/web-search/node_modules/tinyrainbow/package.json +37 -0
- package/plugins/web-search/node_modules/typescript/README.md +50 -0
- package/plugins/web-search/node_modules/typescript/package.json +120 -0
- package/plugins/web-search/node_modules/vite/README.md +20 -0
- package/plugins/web-search/node_modules/vite/dist/client/client.mjs +1106 -0
- package/plugins/web-search/node_modules/vite/dist/client/env.mjs +19 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/build.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/build2.js +5538 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/chunk.js +48 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/config.js +36065 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/config2.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/dist.js +6758 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/lib.js +377 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/logger.js +329 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/optimizer.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/postcss-import.js +479 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/preview.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/chunks/server.js +4 -0
- package/plugins/web-search/node_modules/vite/dist/node/cli.js +698 -0
- package/plugins/web-search/node_modules/vite/dist/node/index.d.ts +3717 -0
- package/plugins/web-search/node_modules/vite/dist/node/index.js +30 -0
- package/plugins/web-search/node_modules/vite/dist/node/module-runner.d.ts +311 -0
- package/plugins/web-search/node_modules/vite/dist/node/module-runner.js +1160 -0
- package/plugins/web-search/node_modules/vite/package.json +199 -0
- package/plugins/web-search/node_modules/vite/types/package.json +4 -0
- package/plugins/web-search/node_modules/vitest/README.md +7 -0
- package/plugins/web-search/node_modules/vitest/dist/browser.d.ts +34 -0
- package/plugins/web-search/node_modules/vitest/dist/browser.js +8 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +7 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/base.DfmxU-tU.js +38 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/benchmark.d.BwvBVTda.d.ts +24 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/cac.0BJqEUeA.js +1469 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/cli-api.DWGBtMmz.js +10660 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/config.d.BKdhh7Zx.d.ts +224 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/console.CtFJOzRO.js +153 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/constants.DnKduX2e.js +44 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DVF1vEu8.js +25 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.DfSpMS-b.js +4350 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/coverage.d.S9RMNXIe.d.ts +35 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/creator.GK6I-cL4.js +640 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +73 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/defaults.B7q_naMc.js +115 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/env.D4Lgay0q.js +8 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/environment.d.cL3nLXbE.d.ts +119 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/execute.B7h3T_Hc.js +708 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/git.BVQ8w_Sw.js +72 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/global.d.MAmajcmJ.d.ts +136 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/globals.DEHgCU4V.js +26 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.B521nVV-.js +157 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.BCWujgDG.js +231 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CmSc2RE5.js +587 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.CwejwG0H.js +105 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.D3XRDfWc.js +213 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.VByaPkjc.js +2183 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/index.X0nbfr6-.js +6584 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/inspector.C914Efll.js +57 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/mocker.d.BE_2ls6u.d.ts +17 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/node.fjCdwEIl.js +15 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/reporters.d.BuRON0I0.d.ts +3168 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/rpc.-pEldfrD.js +83 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/runBaseTests.9Ij9_de-.js +129 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/setup-common.Dd054P77.js +60 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/suite.d.FvehnV49.d.ts +10 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/typechecker.DRKU1-1g.js +874 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/utils.CAioKnHs.js +61 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +65 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +4015 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vite.d.BnOPPc46.d.ts +25 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/vm.BThCzidc.js +756 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.CUgIPz9V.d.ts +176 -0
- package/plugins/web-search/node_modules/vitest/dist/chunks/worker.d.uzWsCv9X.d.ts +8 -0
- package/plugins/web-search/node_modules/vitest/dist/cli.js +27 -0
- package/plugins/web-search/node_modules/vitest/dist/config.cjs +148 -0
- package/plugins/web-search/node_modules/vitest/dist/config.d.ts +100 -0
- package/plugins/web-search/node_modules/vitest/dist/config.js +21 -0
- package/plugins/web-search/node_modules/vitest/dist/coverage.d.ts +108 -0
- package/plugins/web-search/node_modules/vitest/dist/coverage.js +34 -0
- package/plugins/web-search/node_modules/vitest/dist/environments.d.ts +26 -0
- package/plugins/web-search/node_modules/vitest/dist/environments.js +2 -0
- package/plugins/web-search/node_modules/vitest/dist/execute.d.ts +150 -0
- package/plugins/web-search/node_modules/vitest/dist/execute.js +13 -0
- package/plugins/web-search/node_modules/vitest/dist/index.d.ts +651 -0
- package/plugins/web-search/node_modules/vitest/dist/index.js +18 -0
- package/plugins/web-search/node_modules/vitest/dist/mocker.d.ts +1 -0
- package/plugins/web-search/node_modules/vitest/dist/mocker.js +1 -0
- package/plugins/web-search/node_modules/vitest/dist/node.d.ts +158 -0
- package/plugins/web-search/node_modules/vitest/dist/node.js +105 -0
- package/plugins/web-search/node_modules/vitest/dist/path.js +7 -0
- package/plugins/web-search/node_modules/vitest/dist/reporters.d.ts +25 -0
- package/plugins/web-search/node_modules/vitest/dist/reporters.js +23 -0
- package/plugins/web-search/node_modules/vitest/dist/runners.d.ts +46 -0
- package/plugins/web-search/node_modules/vitest/dist/runners.js +235 -0
- package/plugins/web-search/node_modules/vitest/dist/snapshot.d.ts +9 -0
- package/plugins/web-search/node_modules/vitest/dist/snapshot.js +4 -0
- package/plugins/web-search/node_modules/vitest/dist/spy.js +1 -0
- package/plugins/web-search/node_modules/vitest/dist/suite.d.ts +5 -0
- package/plugins/web-search/node_modules/vitest/dist/suite.js +5 -0
- package/plugins/web-search/node_modules/vitest/dist/worker.js +124 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/forks.js +43 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/runVmTests.js +90 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/threads.js +31 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/vmForks.js +47 -0
- package/plugins/web-search/node_modules/vitest/dist/workers/vmThreads.js +37 -0
- package/plugins/web-search/node_modules/vitest/dist/workers.d.ts +40 -0
- package/plugins/web-search/node_modules/vitest/dist/workers.js +30 -0
- package/plugins/web-search/node_modules/vitest/package.json +207 -0
- package/plugins/web-search/package.json +30 -0
- package/plugins/web-search/skills/web-search-howto.md +69 -0
- package/plugins/workboard/agent-seeds/echo-demo/agent.json +7 -0
- package/plugins/workboard/agent-seeds/llm-default/SOUL.md +53 -0
- package/plugins/workboard/agent-seeds/llm-default/agent.json +7 -0
- package/plugins/workboard/dist/client.d.ts +5 -0
- package/plugins/workboard/dist/client.d.ts.map +1 -0
- package/plugins/workboard/dist/client.js +895 -0
- package/plugins/workboard/dist/client.js.map +1 -0
- package/plugins/workboard/dist/db/agents.d.ts +100 -0
- package/plugins/workboard/dist/db/agents.d.ts.map +1 -0
- package/plugins/workboard/dist/db/agents.js +280 -0
- package/plugins/workboard/dist/db/agents.js.map +1 -0
- package/plugins/workboard/dist/db/schema.d.ts +3 -0
- package/plugins/workboard/dist/db/schema.d.ts.map +1 -0
- package/plugins/workboard/dist/db/schema.js +31 -0
- package/plugins/workboard/dist/db/schema.js.map +1 -0
- package/plugins/workboard/dist/db/session-history.d.ts +28 -0
- package/plugins/workboard/dist/db/session-history.d.ts.map +1 -0
- package/plugins/workboard/dist/db/session-history.js +224 -0
- package/plugins/workboard/dist/db/session-history.js.map +1 -0
- package/plugins/workboard/dist/db/tasks.d.ts +260 -0
- package/plugins/workboard/dist/db/tasks.d.ts.map +1 -0
- package/plugins/workboard/dist/db/tasks.js +451 -0
- package/plugins/workboard/dist/db/tasks.js.map +1 -0
- package/plugins/workboard/dist/db/worker-agents.d.ts +16 -0
- package/plugins/workboard/dist/db/worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/db/worker-agents.js +62 -0
- package/plugins/workboard/dist/db/worker-agents.js.map +1 -0
- package/plugins/workboard/dist/effective-skills.d.ts +13 -0
- package/plugins/workboard/dist/effective-skills.d.ts.map +1 -0
- package/plugins/workboard/dist/effective-skills.js +126 -0
- package/plugins/workboard/dist/effective-skills.js.map +1 -0
- package/plugins/workboard/dist/fs-worker-agents.d.ts +35 -0
- package/plugins/workboard/dist/fs-worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/fs-worker-agents.js +199 -0
- package/plugins/workboard/dist/fs-worker-agents.js.map +1 -0
- package/plugins/workboard/dist/migrate-worker-agents.d.ts +11 -0
- package/plugins/workboard/dist/migrate-worker-agents.d.ts.map +1 -0
- package/plugins/workboard/dist/migrate-worker-agents.js +89 -0
- package/plugins/workboard/dist/migrate-worker-agents.js.map +1 -0
- package/plugins/workboard/dist/routes/handlers.d.ts +106 -0
- package/plugins/workboard/dist/routes/handlers.d.ts.map +1 -0
- package/plugins/workboard/dist/routes/handlers.js +668 -0
- package/plugins/workboard/dist/routes/handlers.js.map +1 -0
- package/plugins/workboard/dist/server.d.ts +6 -0
- package/plugins/workboard/dist/server.d.ts.map +1 -0
- package/plugins/workboard/dist/server.js +368 -0
- package/plugins/workboard/dist/server.js.map +1 -0
- package/plugins/workboard/dist/tools/index.d.ts +70 -0
- package/plugins/workboard/dist/tools/index.d.ts.map +1 -0
- package/plugins/workboard/dist/tools/index.js +963 -0
- package/plugins/workboard/dist/tools/index.js.map +1 -0
- package/plugins/workboard/dist/types.d.ts +27 -0
- package/plugins/workboard/dist/types.d.ts.map +1 -0
- package/plugins/workboard/dist/types.js +16 -0
- package/plugins/workboard/dist/types.js.map +1 -0
- package/plugins/workboard/dist/worker/pool.d.ts +220 -0
- package/plugins/workboard/dist/worker/pool.d.ts.map +1 -0
- package/plugins/workboard/dist/worker/pool.js +866 -0
- package/plugins/workboard/dist/worker/pool.js.map +1 -0
- package/plugins/workboard/dist/worker/tool-policy.d.ts +27 -0
- package/plugins/workboard/dist/worker/tool-policy.d.ts.map +1 -0
- package/plugins/workboard/dist/worker/tool-policy.js +76 -0
- package/plugins/workboard/dist/worker/tool-policy.js.map +1 -0
- package/plugins/workboard/dist/worker-agents-page.d.ts +4 -0
- package/plugins/workboard/dist/worker-agents-page.d.ts.map +1 -0
- package/plugins/workboard/dist/worker-agents-page.js +193 -0
- package/plugins/workboard/dist/worker-agents-page.js.map +1 -0
- package/plugins/workboard/manifest.json +180 -0
- package/plugins/workboard/package.json +37 -0
- package/plugins/workboard/skills/large-input-large-output.md +185 -0
- package/plugins/workboard/skills/workboard-howto.md +166 -0
- package/plugins/workboard/skills/worker-creator.md +267 -0
- package/plugins/workboard/skills/worker-fleet.md +431 -0
|
@@ -0,0 +1,1106 @@
|
|
|
1
|
+
import "@vite/env";
|
|
2
|
+
|
|
3
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
4
|
+
function _typeof(o) {
|
|
5
|
+
"@babel/helpers - typeof";
|
|
6
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
7
|
+
return typeof o$1;
|
|
8
|
+
} : function(o$1) {
|
|
9
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
10
|
+
}, _typeof(o);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
15
|
+
function toPrimitive(t, r) {
|
|
16
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
17
|
+
var e = t[Symbol.toPrimitive];
|
|
18
|
+
if (void 0 !== e) {
|
|
19
|
+
var i = e.call(t, r || "default");
|
|
20
|
+
if ("object" != _typeof(i)) return i;
|
|
21
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
22
|
+
}
|
|
23
|
+
return ("string" === r ? String : Number)(t);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
28
|
+
function toPropertyKey(t) {
|
|
29
|
+
var i = toPrimitive(t, "string");
|
|
30
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
35
|
+
function _defineProperty(e, r, t) {
|
|
36
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
37
|
+
value: t,
|
|
38
|
+
enumerable: !0,
|
|
39
|
+
configurable: !0,
|
|
40
|
+
writable: !0
|
|
41
|
+
}) : e[r] = t, e;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/shared/hmr.ts
|
|
46
|
+
var HMRContext = class {
|
|
47
|
+
constructor(hmrClient$1, ownerPath) {
|
|
48
|
+
this.hmrClient = hmrClient$1;
|
|
49
|
+
this.ownerPath = ownerPath;
|
|
50
|
+
_defineProperty(this, "newListeners", void 0);
|
|
51
|
+
if (!hmrClient$1.dataMap.has(ownerPath)) hmrClient$1.dataMap.set(ownerPath, {});
|
|
52
|
+
const mod = hmrClient$1.hotModulesMap.get(ownerPath);
|
|
53
|
+
if (mod) mod.callbacks = [];
|
|
54
|
+
const staleListeners = hmrClient$1.ctxToListenersMap.get(ownerPath);
|
|
55
|
+
if (staleListeners) for (const [event, staleFns] of staleListeners) {
|
|
56
|
+
const listeners = hmrClient$1.customListenersMap.get(event);
|
|
57
|
+
if (listeners) hmrClient$1.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
|
58
|
+
}
|
|
59
|
+
this.newListeners = /* @__PURE__ */ new Map();
|
|
60
|
+
hmrClient$1.ctxToListenersMap.set(ownerPath, this.newListeners);
|
|
61
|
+
}
|
|
62
|
+
get data() {
|
|
63
|
+
return this.hmrClient.dataMap.get(this.ownerPath);
|
|
64
|
+
}
|
|
65
|
+
accept(deps, callback) {
|
|
66
|
+
if (typeof deps === "function" || !deps) this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod));
|
|
67
|
+
else if (typeof deps === "string") this.acceptDeps([deps], ([mod]) => callback?.(mod));
|
|
68
|
+
else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
|
|
69
|
+
else throw new Error(`invalid hot.accept() usage.`);
|
|
70
|
+
}
|
|
71
|
+
acceptExports(_, callback) {
|
|
72
|
+
this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
|
|
73
|
+
}
|
|
74
|
+
dispose(cb) {
|
|
75
|
+
this.hmrClient.disposeMap.set(this.ownerPath, cb);
|
|
76
|
+
}
|
|
77
|
+
prune(cb) {
|
|
78
|
+
this.hmrClient.pruneMap.set(this.ownerPath, cb);
|
|
79
|
+
}
|
|
80
|
+
decline() {}
|
|
81
|
+
invalidate(message) {
|
|
82
|
+
const firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
|
|
83
|
+
this.hmrClient.notifyListeners("vite:invalidate", {
|
|
84
|
+
path: this.ownerPath,
|
|
85
|
+
message,
|
|
86
|
+
firstInvalidatedBy
|
|
87
|
+
});
|
|
88
|
+
this.send("vite:invalidate", {
|
|
89
|
+
path: this.ownerPath,
|
|
90
|
+
message,
|
|
91
|
+
firstInvalidatedBy
|
|
92
|
+
});
|
|
93
|
+
this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`);
|
|
94
|
+
}
|
|
95
|
+
on(event, cb) {
|
|
96
|
+
const addToMap = (map) => {
|
|
97
|
+
const existing = map.get(event) || [];
|
|
98
|
+
existing.push(cb);
|
|
99
|
+
map.set(event, existing);
|
|
100
|
+
};
|
|
101
|
+
addToMap(this.hmrClient.customListenersMap);
|
|
102
|
+
addToMap(this.newListeners);
|
|
103
|
+
}
|
|
104
|
+
off(event, cb) {
|
|
105
|
+
const removeFromMap = (map) => {
|
|
106
|
+
const existing = map.get(event);
|
|
107
|
+
if (existing === void 0) return;
|
|
108
|
+
const pruned = existing.filter((l) => l !== cb);
|
|
109
|
+
if (pruned.length === 0) {
|
|
110
|
+
map.delete(event);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
map.set(event, pruned);
|
|
114
|
+
};
|
|
115
|
+
removeFromMap(this.hmrClient.customListenersMap);
|
|
116
|
+
removeFromMap(this.newListeners);
|
|
117
|
+
}
|
|
118
|
+
send(event, data) {
|
|
119
|
+
this.hmrClient.send({
|
|
120
|
+
type: "custom",
|
|
121
|
+
event,
|
|
122
|
+
data
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
acceptDeps(deps, callback = () => {}) {
|
|
126
|
+
const mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
|
|
127
|
+
id: this.ownerPath,
|
|
128
|
+
callbacks: []
|
|
129
|
+
};
|
|
130
|
+
mod.callbacks.push({
|
|
131
|
+
deps,
|
|
132
|
+
fn: callback
|
|
133
|
+
});
|
|
134
|
+
this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var HMRClient = class {
|
|
138
|
+
constructor(logger, transport$1, importUpdatedModule) {
|
|
139
|
+
this.logger = logger;
|
|
140
|
+
this.transport = transport$1;
|
|
141
|
+
this.importUpdatedModule = importUpdatedModule;
|
|
142
|
+
_defineProperty(this, "hotModulesMap", /* @__PURE__ */ new Map());
|
|
143
|
+
_defineProperty(this, "disposeMap", /* @__PURE__ */ new Map());
|
|
144
|
+
_defineProperty(this, "pruneMap", /* @__PURE__ */ new Map());
|
|
145
|
+
_defineProperty(this, "dataMap", /* @__PURE__ */ new Map());
|
|
146
|
+
_defineProperty(this, "customListenersMap", /* @__PURE__ */ new Map());
|
|
147
|
+
_defineProperty(this, "ctxToListenersMap", /* @__PURE__ */ new Map());
|
|
148
|
+
_defineProperty(this, "currentFirstInvalidatedBy", void 0);
|
|
149
|
+
_defineProperty(this, "updateQueue", []);
|
|
150
|
+
_defineProperty(this, "pendingUpdateQueue", false);
|
|
151
|
+
}
|
|
152
|
+
async notifyListeners(event, data) {
|
|
153
|
+
const cbs = this.customListenersMap.get(event);
|
|
154
|
+
if (cbs) await Promise.allSettled(cbs.map((cb) => cb(data)));
|
|
155
|
+
}
|
|
156
|
+
send(payload) {
|
|
157
|
+
this.transport.send(payload).catch((err) => {
|
|
158
|
+
this.logger.error(err);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
clear() {
|
|
162
|
+
this.hotModulesMap.clear();
|
|
163
|
+
this.disposeMap.clear();
|
|
164
|
+
this.pruneMap.clear();
|
|
165
|
+
this.dataMap.clear();
|
|
166
|
+
this.customListenersMap.clear();
|
|
167
|
+
this.ctxToListenersMap.clear();
|
|
168
|
+
}
|
|
169
|
+
async prunePaths(paths) {
|
|
170
|
+
await Promise.all(paths.map((path) => {
|
|
171
|
+
const disposer = this.disposeMap.get(path);
|
|
172
|
+
if (disposer) return disposer(this.dataMap.get(path));
|
|
173
|
+
}));
|
|
174
|
+
await Promise.all(paths.map((path) => {
|
|
175
|
+
const fn = this.pruneMap.get(path);
|
|
176
|
+
if (fn) return fn(this.dataMap.get(path));
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
warnFailedUpdate(err, path) {
|
|
180
|
+
if (!(err instanceof Error) || !err.message.includes("fetch")) this.logger.error(err);
|
|
181
|
+
this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* buffer multiple hot updates triggered by the same src change
|
|
185
|
+
* so that they are invoked in the same order they were sent.
|
|
186
|
+
* (otherwise the order may be inconsistent because of the http request round trip)
|
|
187
|
+
*/
|
|
188
|
+
async queueUpdate(payload) {
|
|
189
|
+
this.updateQueue.push(this.fetchUpdate(payload));
|
|
190
|
+
if (!this.pendingUpdateQueue) {
|
|
191
|
+
this.pendingUpdateQueue = true;
|
|
192
|
+
await Promise.resolve();
|
|
193
|
+
this.pendingUpdateQueue = false;
|
|
194
|
+
const loading = [...this.updateQueue];
|
|
195
|
+
this.updateQueue = [];
|
|
196
|
+
(await Promise.all(loading)).forEach((fn) => fn && fn());
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async fetchUpdate(update) {
|
|
200
|
+
const { path, acceptedPath, firstInvalidatedBy } = update;
|
|
201
|
+
const mod = this.hotModulesMap.get(path);
|
|
202
|
+
if (!mod) return;
|
|
203
|
+
let fetchedModule;
|
|
204
|
+
const isSelfUpdate = path === acceptedPath;
|
|
205
|
+
const qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));
|
|
206
|
+
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
|
207
|
+
const disposer = this.disposeMap.get(acceptedPath);
|
|
208
|
+
if (disposer) await disposer(this.dataMap.get(acceptedPath));
|
|
209
|
+
try {
|
|
210
|
+
fetchedModule = await this.importUpdatedModule(update);
|
|
211
|
+
} catch (e) {
|
|
212
|
+
this.warnFailedUpdate(e, acceptedPath);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return () => {
|
|
216
|
+
try {
|
|
217
|
+
this.currentFirstInvalidatedBy = firstInvalidatedBy;
|
|
218
|
+
for (const { deps, fn } of qualifiedCallbacks) fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
|
219
|
+
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
|
220
|
+
this.logger.debug(`hot updated: ${loggedPath}`);
|
|
221
|
+
} finally {
|
|
222
|
+
this.currentFirstInvalidatedBy = void 0;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region ../../node_modules/.pnpm/nanoid@5.1.6/node_modules/nanoid/non-secure/index.js
|
|
230
|
+
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
231
|
+
let nanoid = (size = 21) => {
|
|
232
|
+
let id = "";
|
|
233
|
+
let i = size | 0;
|
|
234
|
+
while (i--) id += urlAlphabet[Math.random() * 64 | 0];
|
|
235
|
+
return id;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/shared/constants.ts
|
|
240
|
+
let SOURCEMAPPING_URL = "sourceMa";
|
|
241
|
+
SOURCEMAPPING_URL += "ppingURL";
|
|
242
|
+
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/shared/utils.ts
|
|
245
|
+
const isWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
246
|
+
const AsyncFunction = async function() {}.constructor;
|
|
247
|
+
function promiseWithResolvers() {
|
|
248
|
+
let resolve;
|
|
249
|
+
let reject;
|
|
250
|
+
return {
|
|
251
|
+
promise: new Promise((_resolve, _reject) => {
|
|
252
|
+
resolve = _resolve;
|
|
253
|
+
reject = _reject;
|
|
254
|
+
}),
|
|
255
|
+
resolve,
|
|
256
|
+
reject
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/shared/moduleRunnerTransport.ts
|
|
262
|
+
function reviveInvokeError(e) {
|
|
263
|
+
const error = new Error(e.message || "Unknown invoke error");
|
|
264
|
+
Object.assign(error, e, { runnerError: /* @__PURE__ */ new Error("RunnerError") });
|
|
265
|
+
return error;
|
|
266
|
+
}
|
|
267
|
+
const createInvokeableTransport = (transport$1) => {
|
|
268
|
+
if (transport$1.invoke) return {
|
|
269
|
+
...transport$1,
|
|
270
|
+
async invoke(name, data) {
|
|
271
|
+
const result = await transport$1.invoke({
|
|
272
|
+
type: "custom",
|
|
273
|
+
event: "vite:invoke",
|
|
274
|
+
data: {
|
|
275
|
+
id: "send",
|
|
276
|
+
name,
|
|
277
|
+
data
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
if ("error" in result) throw reviveInvokeError(result.error);
|
|
281
|
+
return result.result;
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
if (!transport$1.send || !transport$1.connect) throw new Error("transport must implement send and connect when invoke is not implemented");
|
|
285
|
+
const rpcPromises = /* @__PURE__ */ new Map();
|
|
286
|
+
return {
|
|
287
|
+
...transport$1,
|
|
288
|
+
connect({ onMessage, onDisconnection }) {
|
|
289
|
+
return transport$1.connect({
|
|
290
|
+
onMessage(payload) {
|
|
291
|
+
if (payload.type === "custom" && payload.event === "vite:invoke") {
|
|
292
|
+
const data = payload.data;
|
|
293
|
+
if (data.id.startsWith("response:")) {
|
|
294
|
+
const invokeId = data.id.slice(9);
|
|
295
|
+
const promise = rpcPromises.get(invokeId);
|
|
296
|
+
if (!promise) return;
|
|
297
|
+
if (promise.timeoutId) clearTimeout(promise.timeoutId);
|
|
298
|
+
rpcPromises.delete(invokeId);
|
|
299
|
+
const { error, result } = data.data;
|
|
300
|
+
if (error) promise.reject(error);
|
|
301
|
+
else promise.resolve(result);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
onMessage(payload);
|
|
306
|
+
},
|
|
307
|
+
onDisconnection
|
|
308
|
+
});
|
|
309
|
+
},
|
|
310
|
+
disconnect() {
|
|
311
|
+
rpcPromises.forEach((promise) => {
|
|
312
|
+
promise.reject(/* @__PURE__ */ new Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
|
|
313
|
+
});
|
|
314
|
+
rpcPromises.clear();
|
|
315
|
+
return transport$1.disconnect?.();
|
|
316
|
+
},
|
|
317
|
+
send(data) {
|
|
318
|
+
return transport$1.send(data);
|
|
319
|
+
},
|
|
320
|
+
async invoke(name, data) {
|
|
321
|
+
const promiseId = nanoid();
|
|
322
|
+
const wrappedData = {
|
|
323
|
+
type: "custom",
|
|
324
|
+
event: "vite:invoke",
|
|
325
|
+
data: {
|
|
326
|
+
name,
|
|
327
|
+
id: `send:${promiseId}`,
|
|
328
|
+
data
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
const sendPromise = transport$1.send(wrappedData);
|
|
332
|
+
const { promise, resolve, reject } = promiseWithResolvers();
|
|
333
|
+
const timeout = transport$1.timeout ?? 6e4;
|
|
334
|
+
let timeoutId;
|
|
335
|
+
if (timeout > 0) {
|
|
336
|
+
timeoutId = setTimeout(() => {
|
|
337
|
+
rpcPromises.delete(promiseId);
|
|
338
|
+
reject(/* @__PURE__ */ new Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
|
|
339
|
+
}, timeout);
|
|
340
|
+
timeoutId?.unref?.();
|
|
341
|
+
}
|
|
342
|
+
rpcPromises.set(promiseId, {
|
|
343
|
+
resolve,
|
|
344
|
+
reject,
|
|
345
|
+
name,
|
|
346
|
+
timeoutId
|
|
347
|
+
});
|
|
348
|
+
if (sendPromise) sendPromise.catch((err) => {
|
|
349
|
+
clearTimeout(timeoutId);
|
|
350
|
+
rpcPromises.delete(promiseId);
|
|
351
|
+
reject(err);
|
|
352
|
+
});
|
|
353
|
+
try {
|
|
354
|
+
return await promise;
|
|
355
|
+
} catch (err) {
|
|
356
|
+
throw reviveInvokeError(err);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
};
|
|
361
|
+
const normalizeModuleRunnerTransport = (transport$1) => {
|
|
362
|
+
const invokeableTransport = createInvokeableTransport(transport$1);
|
|
363
|
+
let isConnected = !invokeableTransport.connect;
|
|
364
|
+
let connectingPromise;
|
|
365
|
+
return {
|
|
366
|
+
...transport$1,
|
|
367
|
+
...invokeableTransport.connect ? { async connect(onMessage) {
|
|
368
|
+
if (isConnected) return;
|
|
369
|
+
if (connectingPromise) {
|
|
370
|
+
await connectingPromise;
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const maybePromise = invokeableTransport.connect({
|
|
374
|
+
onMessage: onMessage ?? (() => {}),
|
|
375
|
+
onDisconnection() {
|
|
376
|
+
isConnected = false;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
if (maybePromise) {
|
|
380
|
+
connectingPromise = maybePromise;
|
|
381
|
+
await connectingPromise;
|
|
382
|
+
connectingPromise = void 0;
|
|
383
|
+
}
|
|
384
|
+
isConnected = true;
|
|
385
|
+
} } : {},
|
|
386
|
+
...invokeableTransport.disconnect ? { async disconnect() {
|
|
387
|
+
if (!isConnected) return;
|
|
388
|
+
if (connectingPromise) await connectingPromise;
|
|
389
|
+
isConnected = false;
|
|
390
|
+
await invokeableTransport.disconnect();
|
|
391
|
+
} } : {},
|
|
392
|
+
async send(data) {
|
|
393
|
+
if (!invokeableTransport.send) return;
|
|
394
|
+
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
395
|
+
else throw new Error("send was called before connect");
|
|
396
|
+
await invokeableTransport.send(data);
|
|
397
|
+
},
|
|
398
|
+
async invoke(name, data) {
|
|
399
|
+
if (!isConnected) if (connectingPromise) await connectingPromise;
|
|
400
|
+
else throw new Error("invoke was called before connect");
|
|
401
|
+
return invokeableTransport.invoke(name, data);
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
const createWebSocketModuleRunnerTransport = (options) => {
|
|
406
|
+
const pingInterval = options.pingInterval ?? 3e4;
|
|
407
|
+
let ws;
|
|
408
|
+
let pingIntervalId;
|
|
409
|
+
return {
|
|
410
|
+
async connect({ onMessage, onDisconnection }) {
|
|
411
|
+
const socket = options.createConnection();
|
|
412
|
+
socket.addEventListener("message", async ({ data }) => {
|
|
413
|
+
onMessage(JSON.parse(data));
|
|
414
|
+
});
|
|
415
|
+
let isOpened = socket.readyState === socket.OPEN;
|
|
416
|
+
if (!isOpened) await new Promise((resolve, reject) => {
|
|
417
|
+
socket.addEventListener("open", () => {
|
|
418
|
+
isOpened = true;
|
|
419
|
+
resolve();
|
|
420
|
+
}, { once: true });
|
|
421
|
+
socket.addEventListener("close", async () => {
|
|
422
|
+
if (!isOpened) {
|
|
423
|
+
reject(/* @__PURE__ */ new Error("WebSocket closed without opened."));
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
onMessage({
|
|
427
|
+
type: "custom",
|
|
428
|
+
event: "vite:ws:disconnect",
|
|
429
|
+
data: { webSocket: socket }
|
|
430
|
+
});
|
|
431
|
+
onDisconnection();
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
onMessage({
|
|
435
|
+
type: "custom",
|
|
436
|
+
event: "vite:ws:connect",
|
|
437
|
+
data: { webSocket: socket }
|
|
438
|
+
});
|
|
439
|
+
ws = socket;
|
|
440
|
+
pingIntervalId = setInterval(() => {
|
|
441
|
+
if (socket.readyState === socket.OPEN) socket.send(JSON.stringify({ type: "ping" }));
|
|
442
|
+
}, pingInterval);
|
|
443
|
+
},
|
|
444
|
+
disconnect() {
|
|
445
|
+
clearInterval(pingIntervalId);
|
|
446
|
+
ws?.close();
|
|
447
|
+
},
|
|
448
|
+
send(data) {
|
|
449
|
+
ws.send(JSON.stringify(data));
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/shared/hmrHandler.ts
|
|
456
|
+
function createHMRHandler(handler) {
|
|
457
|
+
const queue = new Queue();
|
|
458
|
+
return (payload) => queue.enqueue(() => handler(payload));
|
|
459
|
+
}
|
|
460
|
+
var Queue = class {
|
|
461
|
+
constructor() {
|
|
462
|
+
_defineProperty(this, "queue", []);
|
|
463
|
+
_defineProperty(this, "pending", false);
|
|
464
|
+
}
|
|
465
|
+
enqueue(promise) {
|
|
466
|
+
return new Promise((resolve, reject) => {
|
|
467
|
+
this.queue.push({
|
|
468
|
+
promise,
|
|
469
|
+
resolve,
|
|
470
|
+
reject
|
|
471
|
+
});
|
|
472
|
+
this.dequeue();
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
dequeue() {
|
|
476
|
+
if (this.pending) return false;
|
|
477
|
+
const item = this.queue.shift();
|
|
478
|
+
if (!item) return false;
|
|
479
|
+
this.pending = true;
|
|
480
|
+
item.promise().then(item.resolve).catch(item.reject).finally(() => {
|
|
481
|
+
this.pending = false;
|
|
482
|
+
this.dequeue();
|
|
483
|
+
});
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/client/overlay.ts
|
|
490
|
+
const hmrConfigName = __HMR_CONFIG_NAME__;
|
|
491
|
+
const base$1 = __BASE__ || "/";
|
|
492
|
+
const cspNonce = "document" in globalThis ? document.querySelector("meta[property=csp-nonce]")?.nonce : void 0;
|
|
493
|
+
function h(e, attrs = {}, ...children) {
|
|
494
|
+
const elem = document.createElement(e);
|
|
495
|
+
for (const [k, v] of Object.entries(attrs)) if (v !== void 0) elem.setAttribute(k, v);
|
|
496
|
+
elem.append(...children);
|
|
497
|
+
return elem;
|
|
498
|
+
}
|
|
499
|
+
const templateStyle = `
|
|
500
|
+
:host {
|
|
501
|
+
position: fixed;
|
|
502
|
+
top: 0;
|
|
503
|
+
left: 0;
|
|
504
|
+
width: 100%;
|
|
505
|
+
height: 100%;
|
|
506
|
+
z-index: 99999;
|
|
507
|
+
--monospace: 'SFMono-Regular', Consolas,
|
|
508
|
+
'Liberation Mono', Menlo, Courier, monospace;
|
|
509
|
+
--red: #ff5555;
|
|
510
|
+
--yellow: #e2aa53;
|
|
511
|
+
--purple: #cfa4ff;
|
|
512
|
+
--cyan: #2dd9da;
|
|
513
|
+
--dim: #c9c9c9;
|
|
514
|
+
|
|
515
|
+
--window-background: #181818;
|
|
516
|
+
--window-color: #d8d8d8;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.backdrop {
|
|
520
|
+
position: fixed;
|
|
521
|
+
z-index: 99999;
|
|
522
|
+
top: 0;
|
|
523
|
+
left: 0;
|
|
524
|
+
width: 100%;
|
|
525
|
+
height: 100%;
|
|
526
|
+
overflow-y: scroll;
|
|
527
|
+
margin: 0;
|
|
528
|
+
background: rgba(0, 0, 0, 0.66);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.window {
|
|
532
|
+
font-family: var(--monospace);
|
|
533
|
+
line-height: 1.5;
|
|
534
|
+
max-width: 80vw;
|
|
535
|
+
color: var(--window-color);
|
|
536
|
+
box-sizing: border-box;
|
|
537
|
+
margin: 30px auto;
|
|
538
|
+
padding: 2.5vh 4vw;
|
|
539
|
+
position: relative;
|
|
540
|
+
background: var(--window-background);
|
|
541
|
+
border-radius: 6px 6px 8px 8px;
|
|
542
|
+
box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
|
543
|
+
overflow: hidden;
|
|
544
|
+
border-top: 8px solid var(--red);
|
|
545
|
+
direction: ltr;
|
|
546
|
+
text-align: left;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
pre {
|
|
550
|
+
font-family: var(--monospace);
|
|
551
|
+
font-size: 16px;
|
|
552
|
+
margin-top: 0;
|
|
553
|
+
margin-bottom: 1em;
|
|
554
|
+
overflow-x: scroll;
|
|
555
|
+
scrollbar-width: none;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
pre::-webkit-scrollbar {
|
|
559
|
+
display: none;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
pre.frame::-webkit-scrollbar {
|
|
563
|
+
display: block;
|
|
564
|
+
height: 5px;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
pre.frame::-webkit-scrollbar-thumb {
|
|
568
|
+
background: #999;
|
|
569
|
+
border-radius: 5px;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
pre.frame {
|
|
573
|
+
scrollbar-width: thin;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.message {
|
|
577
|
+
line-height: 1.3;
|
|
578
|
+
font-weight: 600;
|
|
579
|
+
white-space: pre-wrap;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.message-body {
|
|
583
|
+
color: var(--red);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.plugin {
|
|
587
|
+
color: var(--purple);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.file {
|
|
591
|
+
color: var(--cyan);
|
|
592
|
+
margin-bottom: 0;
|
|
593
|
+
white-space: pre-wrap;
|
|
594
|
+
word-break: break-all;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.frame {
|
|
598
|
+
color: var(--yellow);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.stack {
|
|
602
|
+
font-size: 13px;
|
|
603
|
+
color: var(--dim);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.tip {
|
|
607
|
+
font-size: 13px;
|
|
608
|
+
color: #999;
|
|
609
|
+
border-top: 1px dotted #999;
|
|
610
|
+
padding-top: 13px;
|
|
611
|
+
line-height: 1.8;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
code {
|
|
615
|
+
font-size: 13px;
|
|
616
|
+
font-family: var(--monospace);
|
|
617
|
+
color: var(--yellow);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.file-link {
|
|
621
|
+
text-decoration: underline;
|
|
622
|
+
cursor: pointer;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
kbd {
|
|
626
|
+
line-height: 1.5;
|
|
627
|
+
font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
628
|
+
font-size: 0.75rem;
|
|
629
|
+
font-weight: 700;
|
|
630
|
+
background-color: rgb(38, 40, 44);
|
|
631
|
+
color: rgb(166, 167, 171);
|
|
632
|
+
padding: 0.15rem 0.3rem;
|
|
633
|
+
border-radius: 0.25rem;
|
|
634
|
+
border-width: 0.0625rem 0.0625rem 0.1875rem;
|
|
635
|
+
border-style: solid;
|
|
636
|
+
border-color: rgb(54, 57, 64);
|
|
637
|
+
border-image: initial;
|
|
638
|
+
}
|
|
639
|
+
`;
|
|
640
|
+
const createTemplate = () => h("div", {
|
|
641
|
+
class: "backdrop",
|
|
642
|
+
part: "backdrop"
|
|
643
|
+
}, h("div", {
|
|
644
|
+
class: "window",
|
|
645
|
+
part: "window"
|
|
646
|
+
}, h("pre", {
|
|
647
|
+
class: "message",
|
|
648
|
+
part: "message"
|
|
649
|
+
}, h("span", {
|
|
650
|
+
class: "plugin",
|
|
651
|
+
part: "plugin"
|
|
652
|
+
}), h("span", {
|
|
653
|
+
class: "message-body",
|
|
654
|
+
part: "message-body"
|
|
655
|
+
})), h("pre", {
|
|
656
|
+
class: "file",
|
|
657
|
+
part: "file"
|
|
658
|
+
}), h("pre", {
|
|
659
|
+
class: "frame",
|
|
660
|
+
part: "frame"
|
|
661
|
+
}), h("pre", {
|
|
662
|
+
class: "stack",
|
|
663
|
+
part: "stack"
|
|
664
|
+
}), h("div", {
|
|
665
|
+
class: "tip",
|
|
666
|
+
part: "tip"
|
|
667
|
+
}, "Click outside, press ", h("kbd", {}, "Esc"), " key, or fix the code to dismiss.", h("br"), "You can also disable this overlay by setting ", h("code", { part: "config-option-name" }, "server.hmr.overlay"), " to ", h("code", { part: "config-option-value" }, "false"), " in ", h("code", { part: "config-file-name" }, hmrConfigName), ".")), h("style", { nonce: cspNonce }, templateStyle));
|
|
668
|
+
const fileRE = /(?:file:\/\/)?(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g;
|
|
669
|
+
const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm;
|
|
670
|
+
const { HTMLElement = class {} } = globalThis;
|
|
671
|
+
var ErrorOverlay = class extends HTMLElement {
|
|
672
|
+
constructor(err, links = true) {
|
|
673
|
+
super();
|
|
674
|
+
_defineProperty(this, "root", void 0);
|
|
675
|
+
_defineProperty(this, "closeOnEsc", void 0);
|
|
676
|
+
this.root = this.attachShadow({ mode: "open" });
|
|
677
|
+
this.root.appendChild(createTemplate());
|
|
678
|
+
codeframeRE.lastIndex = 0;
|
|
679
|
+
const hasFrame = err.frame && codeframeRE.test(err.frame);
|
|
680
|
+
const message = hasFrame ? err.message.replace(codeframeRE, "") : err.message;
|
|
681
|
+
if (err.plugin) this.text(".plugin", `[plugin:${err.plugin}] `);
|
|
682
|
+
this.text(".message-body", message.trim());
|
|
683
|
+
const [file] = (err.loc?.file || err.id || "unknown file").split(`?`);
|
|
684
|
+
if (err.loc) this.text(".file", `${file}:${err.loc.line}:${err.loc.column}`, links);
|
|
685
|
+
else if (err.id) this.text(".file", file);
|
|
686
|
+
if (hasFrame) this.text(".frame", err.frame.trim());
|
|
687
|
+
this.text(".stack", err.stack, links);
|
|
688
|
+
this.root.querySelector(".window").addEventListener("click", (e) => {
|
|
689
|
+
e.stopPropagation();
|
|
690
|
+
});
|
|
691
|
+
this.addEventListener("click", () => {
|
|
692
|
+
this.close();
|
|
693
|
+
});
|
|
694
|
+
this.closeOnEsc = (e) => {
|
|
695
|
+
if (e.key === "Escape" || e.code === "Escape") this.close();
|
|
696
|
+
};
|
|
697
|
+
document.addEventListener("keydown", this.closeOnEsc);
|
|
698
|
+
}
|
|
699
|
+
text(selector, text, linkFiles = false) {
|
|
700
|
+
const el = this.root.querySelector(selector);
|
|
701
|
+
if (!linkFiles) el.textContent = text;
|
|
702
|
+
else {
|
|
703
|
+
let curIndex = 0;
|
|
704
|
+
let match;
|
|
705
|
+
fileRE.lastIndex = 0;
|
|
706
|
+
while (match = fileRE.exec(text)) {
|
|
707
|
+
const { 0: file, index } = match;
|
|
708
|
+
const frag = text.slice(curIndex, index);
|
|
709
|
+
el.appendChild(document.createTextNode(frag));
|
|
710
|
+
const link = document.createElement("a");
|
|
711
|
+
link.textContent = file;
|
|
712
|
+
link.className = "file-link";
|
|
713
|
+
link.onclick = () => {
|
|
714
|
+
fetch(new URL(`${base$1}__open-in-editor?file=${encodeURIComponent(file)}`, import.meta.url));
|
|
715
|
+
};
|
|
716
|
+
el.appendChild(link);
|
|
717
|
+
curIndex += frag.length + file.length;
|
|
718
|
+
}
|
|
719
|
+
if (curIndex < text.length) el.appendChild(document.createTextNode(text.slice(curIndex)));
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
close() {
|
|
723
|
+
this.parentNode?.removeChild(this);
|
|
724
|
+
document.removeEventListener("keydown", this.closeOnEsc);
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
const overlayId = "vite-error-overlay";
|
|
728
|
+
const { customElements } = globalThis;
|
|
729
|
+
if (customElements && !customElements.get(overlayId)) customElements.define(overlayId, ErrorOverlay);
|
|
730
|
+
|
|
731
|
+
//#endregion
|
|
732
|
+
//#region src/client/client.ts
|
|
733
|
+
console.debug("[vite] connecting...");
|
|
734
|
+
const importMetaUrl = new URL(import.meta.url);
|
|
735
|
+
const serverHost = __SERVER_HOST__;
|
|
736
|
+
const socketProtocol = __HMR_PROTOCOL__ || (importMetaUrl.protocol === "https:" ? "wss" : "ws");
|
|
737
|
+
const hmrPort = __HMR_PORT__;
|
|
738
|
+
const socketHost = `${__HMR_HOSTNAME__ || importMetaUrl.hostname}:${hmrPort || importMetaUrl.port}${__HMR_BASE__}`;
|
|
739
|
+
const directSocketHost = __HMR_DIRECT_TARGET__;
|
|
740
|
+
const base = __BASE__ || "/";
|
|
741
|
+
const hmrTimeout = __HMR_TIMEOUT__;
|
|
742
|
+
const wsToken = __WS_TOKEN__;
|
|
743
|
+
const transport = normalizeModuleRunnerTransport((() => {
|
|
744
|
+
let wsTransport = createWebSocketModuleRunnerTransport({
|
|
745
|
+
createConnection: () => new WebSocket(`${socketProtocol}://${socketHost}?token=${wsToken}`, "vite-hmr"),
|
|
746
|
+
pingInterval: hmrTimeout
|
|
747
|
+
});
|
|
748
|
+
return {
|
|
749
|
+
async connect(handlers) {
|
|
750
|
+
try {
|
|
751
|
+
await wsTransport.connect(handlers);
|
|
752
|
+
} catch (e) {
|
|
753
|
+
if (!hmrPort) {
|
|
754
|
+
wsTransport = createWebSocketModuleRunnerTransport({
|
|
755
|
+
createConnection: () => new WebSocket(`${socketProtocol}://${directSocketHost}?token=${wsToken}`, "vite-hmr"),
|
|
756
|
+
pingInterval: hmrTimeout
|
|
757
|
+
});
|
|
758
|
+
try {
|
|
759
|
+
await wsTransport.connect(handlers);
|
|
760
|
+
console.info("[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error.");
|
|
761
|
+
} catch (e$1) {
|
|
762
|
+
if (e$1 instanceof Error && e$1.message.includes("WebSocket closed without opened.")) {
|
|
763
|
+
const currentScriptHostURL = new URL(import.meta.url);
|
|
764
|
+
const currentScriptHost = currentScriptHostURL.host + currentScriptHostURL.pathname.replace(/@vite\/client$/, "");
|
|
765
|
+
console.error(`[vite] failed to connect to websocket.
|
|
766
|
+
your current setup:
|
|
767
|
+
(browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\n (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\nCheck out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .`);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
console.error(`[vite] failed to connect to websocket (${e}). `);
|
|
773
|
+
throw e;
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
async disconnect() {
|
|
777
|
+
await wsTransport.disconnect();
|
|
778
|
+
},
|
|
779
|
+
send(data) {
|
|
780
|
+
wsTransport.send(data);
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
})());
|
|
784
|
+
let willUnload = false;
|
|
785
|
+
if (typeof window !== "undefined") window.addEventListener?.("beforeunload", () => {
|
|
786
|
+
willUnload = true;
|
|
787
|
+
});
|
|
788
|
+
function cleanUrl(pathname) {
|
|
789
|
+
const url = new URL(pathname, "http://vite.dev");
|
|
790
|
+
url.searchParams.delete("direct");
|
|
791
|
+
return url.pathname + url.search;
|
|
792
|
+
}
|
|
793
|
+
let isFirstUpdate = true;
|
|
794
|
+
const outdatedLinkTags = /* @__PURE__ */ new WeakSet();
|
|
795
|
+
const debounceReload = (time) => {
|
|
796
|
+
let timer;
|
|
797
|
+
return () => {
|
|
798
|
+
if (timer) {
|
|
799
|
+
clearTimeout(timer);
|
|
800
|
+
timer = null;
|
|
801
|
+
}
|
|
802
|
+
timer = setTimeout(() => {
|
|
803
|
+
location.reload();
|
|
804
|
+
}, time);
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
const pageReload = debounceReload(20);
|
|
808
|
+
const hmrClient = new HMRClient({
|
|
809
|
+
error: (err) => console.error("[vite]", err),
|
|
810
|
+
debug: (...msg) => console.debug("[vite]", ...msg)
|
|
811
|
+
}, transport, async function importUpdatedModule({ acceptedPath, timestamp, explicitImportRequired, isWithinCircularImport }) {
|
|
812
|
+
const [acceptedPathWithoutQuery, query] = acceptedPath.split(`?`);
|
|
813
|
+
const importPromise = import(
|
|
814
|
+
/* @vite-ignore */
|
|
815
|
+
base + acceptedPathWithoutQuery.slice(1) + `?${explicitImportRequired ? "import&" : ""}t=${timestamp}${query ? `&${query}` : ""}`
|
|
816
|
+
);
|
|
817
|
+
if (isWithinCircularImport) importPromise.catch(() => {
|
|
818
|
+
console.info(`[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`);
|
|
819
|
+
pageReload();
|
|
820
|
+
});
|
|
821
|
+
return await importPromise;
|
|
822
|
+
});
|
|
823
|
+
transport.connect(createHMRHandler(handleMessage));
|
|
824
|
+
async function handleMessage(payload) {
|
|
825
|
+
switch (payload.type) {
|
|
826
|
+
case "connected":
|
|
827
|
+
console.debug(`[vite] connected.`);
|
|
828
|
+
break;
|
|
829
|
+
case "update":
|
|
830
|
+
await hmrClient.notifyListeners("vite:beforeUpdate", payload);
|
|
831
|
+
if (hasDocument) if (isFirstUpdate && hasErrorOverlay()) {
|
|
832
|
+
location.reload();
|
|
833
|
+
return;
|
|
834
|
+
} else {
|
|
835
|
+
if (enableOverlay) clearErrorOverlay();
|
|
836
|
+
isFirstUpdate = false;
|
|
837
|
+
}
|
|
838
|
+
await Promise.all(payload.updates.map(async (update) => {
|
|
839
|
+
if (update.type === "js-update") return hmrClient.queueUpdate(update);
|
|
840
|
+
const { path, timestamp } = update;
|
|
841
|
+
const searchUrl = cleanUrl(path);
|
|
842
|
+
const el = Array.from(document.querySelectorAll("link")).find((e) => !outdatedLinkTags.has(e) && cleanUrl(e.href).includes(searchUrl));
|
|
843
|
+
if (!el) return;
|
|
844
|
+
const newPath = `${base}${searchUrl.slice(1)}${searchUrl.includes("?") ? "&" : "?"}t=${timestamp}`;
|
|
845
|
+
return new Promise((resolve) => {
|
|
846
|
+
const newLinkTag = el.cloneNode();
|
|
847
|
+
newLinkTag.href = new URL(newPath, el.href).href;
|
|
848
|
+
const removeOldEl = () => {
|
|
849
|
+
el.remove();
|
|
850
|
+
console.debug(`[vite] css hot updated: ${searchUrl}`);
|
|
851
|
+
resolve();
|
|
852
|
+
};
|
|
853
|
+
newLinkTag.addEventListener("load", removeOldEl);
|
|
854
|
+
newLinkTag.addEventListener("error", removeOldEl);
|
|
855
|
+
outdatedLinkTags.add(el);
|
|
856
|
+
el.after(newLinkTag);
|
|
857
|
+
});
|
|
858
|
+
}));
|
|
859
|
+
await hmrClient.notifyListeners("vite:afterUpdate", payload);
|
|
860
|
+
break;
|
|
861
|
+
case "custom":
|
|
862
|
+
await hmrClient.notifyListeners(payload.event, payload.data);
|
|
863
|
+
if (payload.event === "vite:ws:disconnect") {
|
|
864
|
+
if (hasDocument && !willUnload) {
|
|
865
|
+
console.log(`[vite] server connection lost. Polling for restart...`);
|
|
866
|
+
const socket = payload.data.webSocket;
|
|
867
|
+
const url = new URL(socket.url);
|
|
868
|
+
url.search = "";
|
|
869
|
+
await waitForSuccessfulPing(url.href);
|
|
870
|
+
location.reload();
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
break;
|
|
874
|
+
case "full-reload":
|
|
875
|
+
await hmrClient.notifyListeners("vite:beforeFullReload", payload);
|
|
876
|
+
if (hasDocument) if (payload.path && payload.path.endsWith(".html")) {
|
|
877
|
+
const pagePath = decodeURI(location.pathname);
|
|
878
|
+
const payloadPath = base + payload.path.slice(1);
|
|
879
|
+
if (pagePath === payloadPath || payload.path === "/index.html" || pagePath.endsWith("/") && pagePath + "index.html" === payloadPath) pageReload();
|
|
880
|
+
return;
|
|
881
|
+
} else pageReload();
|
|
882
|
+
break;
|
|
883
|
+
case "prune":
|
|
884
|
+
await hmrClient.notifyListeners("vite:beforePrune", payload);
|
|
885
|
+
await hmrClient.prunePaths(payload.paths);
|
|
886
|
+
break;
|
|
887
|
+
case "error":
|
|
888
|
+
await hmrClient.notifyListeners("vite:error", payload);
|
|
889
|
+
if (hasDocument) {
|
|
890
|
+
const err = payload.err;
|
|
891
|
+
if (enableOverlay) createErrorOverlay(err);
|
|
892
|
+
else console.error(`[vite] Internal Server Error\n${err.message}\n${err.stack}`);
|
|
893
|
+
}
|
|
894
|
+
break;
|
|
895
|
+
case "ping": break;
|
|
896
|
+
default: return payload;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const enableOverlay = __HMR_ENABLE_OVERLAY__;
|
|
900
|
+
const hasDocument = "document" in globalThis;
|
|
901
|
+
function createErrorOverlay(err) {
|
|
902
|
+
clearErrorOverlay();
|
|
903
|
+
const { customElements: customElements$1 } = globalThis;
|
|
904
|
+
if (customElements$1) {
|
|
905
|
+
const ErrorOverlayConstructor = customElements$1.get(overlayId);
|
|
906
|
+
document.body.appendChild(new ErrorOverlayConstructor(err));
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
function clearErrorOverlay() {
|
|
910
|
+
document.querySelectorAll(overlayId).forEach((n) => n.close());
|
|
911
|
+
}
|
|
912
|
+
function hasErrorOverlay() {
|
|
913
|
+
return document.querySelectorAll(overlayId).length;
|
|
914
|
+
}
|
|
915
|
+
function waitForSuccessfulPing(socketUrl) {
|
|
916
|
+
if (typeof SharedWorker === "undefined") {
|
|
917
|
+
const visibilityManager = {
|
|
918
|
+
currentState: document.visibilityState,
|
|
919
|
+
listeners: /* @__PURE__ */ new Set()
|
|
920
|
+
};
|
|
921
|
+
const onVisibilityChange = () => {
|
|
922
|
+
visibilityManager.currentState = document.visibilityState;
|
|
923
|
+
for (const listener of visibilityManager.listeners) listener(visibilityManager.currentState);
|
|
924
|
+
};
|
|
925
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
926
|
+
return waitForSuccessfulPingInternal(socketUrl, visibilityManager);
|
|
927
|
+
}
|
|
928
|
+
const blob = new Blob([
|
|
929
|
+
"\"use strict\";",
|
|
930
|
+
`const waitForSuccessfulPingInternal = ${waitForSuccessfulPingInternal.toString()};`,
|
|
931
|
+
`const fn = ${pingWorkerContentMain.toString()};`,
|
|
932
|
+
`fn(${JSON.stringify(socketUrl)})`
|
|
933
|
+
], { type: "application/javascript" });
|
|
934
|
+
const objURL = URL.createObjectURL(blob);
|
|
935
|
+
const sharedWorker = new SharedWorker(objURL);
|
|
936
|
+
return new Promise((resolve, reject) => {
|
|
937
|
+
const onVisibilityChange = () => {
|
|
938
|
+
sharedWorker.port.postMessage({ visibility: document.visibilityState });
|
|
939
|
+
};
|
|
940
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
941
|
+
sharedWorker.port.addEventListener("message", (event) => {
|
|
942
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
943
|
+
sharedWorker.port.close();
|
|
944
|
+
const data = event.data;
|
|
945
|
+
if (data.type === "error") {
|
|
946
|
+
reject(data.error);
|
|
947
|
+
return;
|
|
948
|
+
}
|
|
949
|
+
resolve();
|
|
950
|
+
});
|
|
951
|
+
onVisibilityChange();
|
|
952
|
+
sharedWorker.port.start();
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
function pingWorkerContentMain(socketUrl) {
|
|
956
|
+
self.addEventListener("connect", (_event) => {
|
|
957
|
+
const port = _event.ports[0];
|
|
958
|
+
if (!socketUrl) {
|
|
959
|
+
port.postMessage({
|
|
960
|
+
type: "error",
|
|
961
|
+
error: /* @__PURE__ */ new Error("socketUrl not found")
|
|
962
|
+
});
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
const visibilityManager = {
|
|
966
|
+
currentState: "visible",
|
|
967
|
+
listeners: /* @__PURE__ */ new Set()
|
|
968
|
+
};
|
|
969
|
+
port.addEventListener("message", (event) => {
|
|
970
|
+
const { visibility } = event.data;
|
|
971
|
+
visibilityManager.currentState = visibility;
|
|
972
|
+
console.debug("[vite] new window visibility", visibility);
|
|
973
|
+
for (const listener of visibilityManager.listeners) listener(visibility);
|
|
974
|
+
});
|
|
975
|
+
port.start();
|
|
976
|
+
console.debug("[vite] connected from window");
|
|
977
|
+
waitForSuccessfulPingInternal(socketUrl, visibilityManager).then(() => {
|
|
978
|
+
console.debug("[vite] ping successful");
|
|
979
|
+
try {
|
|
980
|
+
port.postMessage({ type: "success" });
|
|
981
|
+
} catch (error) {
|
|
982
|
+
port.postMessage({
|
|
983
|
+
type: "error",
|
|
984
|
+
error
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}, (error) => {
|
|
988
|
+
console.debug("[vite] error happened", error);
|
|
989
|
+
try {
|
|
990
|
+
port.postMessage({
|
|
991
|
+
type: "error",
|
|
992
|
+
error
|
|
993
|
+
});
|
|
994
|
+
} catch (error$1) {
|
|
995
|
+
port.postMessage({
|
|
996
|
+
type: "error",
|
|
997
|
+
error: error$1
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
async function waitForSuccessfulPingInternal(socketUrl, visibilityManager, ms = 1e3) {
|
|
1004
|
+
function wait(ms$1) {
|
|
1005
|
+
return new Promise((resolve) => setTimeout(resolve, ms$1));
|
|
1006
|
+
}
|
|
1007
|
+
async function ping() {
|
|
1008
|
+
try {
|
|
1009
|
+
const socket = new WebSocket(socketUrl, "vite-ping");
|
|
1010
|
+
return new Promise((resolve) => {
|
|
1011
|
+
function onOpen() {
|
|
1012
|
+
resolve(true);
|
|
1013
|
+
close();
|
|
1014
|
+
}
|
|
1015
|
+
function onError() {
|
|
1016
|
+
resolve(false);
|
|
1017
|
+
close();
|
|
1018
|
+
}
|
|
1019
|
+
function close() {
|
|
1020
|
+
socket.removeEventListener("open", onOpen);
|
|
1021
|
+
socket.removeEventListener("error", onError);
|
|
1022
|
+
socket.close();
|
|
1023
|
+
}
|
|
1024
|
+
socket.addEventListener("open", onOpen);
|
|
1025
|
+
socket.addEventListener("error", onError);
|
|
1026
|
+
});
|
|
1027
|
+
} catch {
|
|
1028
|
+
return false;
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
function waitForWindowShow(visibilityManager$1) {
|
|
1032
|
+
return new Promise((resolve) => {
|
|
1033
|
+
const onChange = (newVisibility) => {
|
|
1034
|
+
if (newVisibility === "visible") {
|
|
1035
|
+
resolve();
|
|
1036
|
+
visibilityManager$1.listeners.delete(onChange);
|
|
1037
|
+
}
|
|
1038
|
+
};
|
|
1039
|
+
visibilityManager$1.listeners.add(onChange);
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
if (await ping()) return;
|
|
1043
|
+
await wait(ms);
|
|
1044
|
+
while (true) if (visibilityManager.currentState === "visible") {
|
|
1045
|
+
if (await ping()) break;
|
|
1046
|
+
await wait(ms);
|
|
1047
|
+
} else await waitForWindowShow(visibilityManager);
|
|
1048
|
+
}
|
|
1049
|
+
const sheetsMap = /* @__PURE__ */ new Map();
|
|
1050
|
+
const linkSheetsMap = /* @__PURE__ */ new Map();
|
|
1051
|
+
if ("document" in globalThis) {
|
|
1052
|
+
document.querySelectorAll("style[data-vite-dev-id]").forEach((el) => {
|
|
1053
|
+
sheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1054
|
+
});
|
|
1055
|
+
document.querySelectorAll("link[rel=\"stylesheet\"][data-vite-dev-id]").forEach((el) => {
|
|
1056
|
+
linkSheetsMap.set(el.getAttribute("data-vite-dev-id"), el);
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
let lastInsertedStyle;
|
|
1060
|
+
function updateStyle(id, content) {
|
|
1061
|
+
if (linkSheetsMap.has(id)) return;
|
|
1062
|
+
let style = sheetsMap.get(id);
|
|
1063
|
+
if (!style) {
|
|
1064
|
+
style = document.createElement("style");
|
|
1065
|
+
style.setAttribute("type", "text/css");
|
|
1066
|
+
style.setAttribute("data-vite-dev-id", id);
|
|
1067
|
+
style.textContent = content;
|
|
1068
|
+
if (cspNonce) style.setAttribute("nonce", cspNonce);
|
|
1069
|
+
if (!lastInsertedStyle) {
|
|
1070
|
+
document.head.appendChild(style);
|
|
1071
|
+
setTimeout(() => {
|
|
1072
|
+
lastInsertedStyle = void 0;
|
|
1073
|
+
}, 0);
|
|
1074
|
+
} else lastInsertedStyle.insertAdjacentElement("afterend", style);
|
|
1075
|
+
lastInsertedStyle = style;
|
|
1076
|
+
} else style.textContent = content;
|
|
1077
|
+
sheetsMap.set(id, style);
|
|
1078
|
+
}
|
|
1079
|
+
function removeStyle(id) {
|
|
1080
|
+
if (linkSheetsMap.has(id)) {
|
|
1081
|
+
document.querySelectorAll(`link[rel="stylesheet"][data-vite-dev-id]`).forEach((el) => {
|
|
1082
|
+
if (el.getAttribute("data-vite-dev-id") === id) el.remove();
|
|
1083
|
+
});
|
|
1084
|
+
linkSheetsMap.delete(id);
|
|
1085
|
+
}
|
|
1086
|
+
const style = sheetsMap.get(id);
|
|
1087
|
+
if (style) {
|
|
1088
|
+
document.head.removeChild(style);
|
|
1089
|
+
sheetsMap.delete(id);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function createHotContext(ownerPath) {
|
|
1093
|
+
return new HMRContext(hmrClient, ownerPath);
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* urls here are dynamic import() urls that couldn't be statically analyzed
|
|
1097
|
+
*/
|
|
1098
|
+
function injectQuery(url, queryToInject) {
|
|
1099
|
+
if (url[0] !== "." && url[0] !== "/") return url;
|
|
1100
|
+
const pathname = url.replace(/[?#].*$/, "");
|
|
1101
|
+
const { search, hash } = new URL(url, "http://vite.dev");
|
|
1102
|
+
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash || ""}`;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
//#endregion
|
|
1106
|
+
export { ErrorOverlay, createHotContext, injectQuery, removeStyle, updateStyle };
|