@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,35 @@
|
|
|
1
|
+
import { ModuleExecutionInfo } from 'vite-node/client';
|
|
2
|
+
|
|
3
|
+
interface RuntimeCoverageModuleLoader {
|
|
4
|
+
executeId: (id: string) => Promise<{
|
|
5
|
+
default: RuntimeCoverageProviderModule
|
|
6
|
+
}>;
|
|
7
|
+
isBrowser?: boolean;
|
|
8
|
+
moduleExecutionInfo?: ModuleExecutionInfo;
|
|
9
|
+
}
|
|
10
|
+
interface RuntimeCoverageProviderModule {
|
|
11
|
+
/**
|
|
12
|
+
* Factory for creating a new coverage provider
|
|
13
|
+
*/
|
|
14
|
+
getProvider: () => any;
|
|
15
|
+
/**
|
|
16
|
+
* Executed before tests are run in the worker thread.
|
|
17
|
+
*/
|
|
18
|
+
startCoverage?: (runtimeOptions: {
|
|
19
|
+
isolate: boolean
|
|
20
|
+
}) => unknown | Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Executed on after each run in the worker thread. Possible to return a payload passed to the provider
|
|
23
|
+
*/
|
|
24
|
+
takeCoverage?: (runtimeOptions?: {
|
|
25
|
+
moduleExecutionInfo?: ModuleExecutionInfo
|
|
26
|
+
}) => unknown | Promise<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Executed after all tests have been run in the worker thread.
|
|
29
|
+
*/
|
|
30
|
+
stopCoverage?: (runtimeOptions: {
|
|
31
|
+
isolate: boolean
|
|
32
|
+
}) => unknown | Promise<unknown>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type { RuntimeCoverageModuleLoader as R, RuntimeCoverageProviderModule as a };
|
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
import { existsSync, writeFileSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { resolve, dirname, relative } from 'node:path';
|
|
4
|
+
import { detectPackageManager, installPackage } from './index.D3XRDfWc.js';
|
|
5
|
+
import { p as prompt, f as findUp } from './index.X0nbfr6-.js';
|
|
6
|
+
import { x } from 'tinyexec';
|
|
7
|
+
import c from 'tinyrainbow';
|
|
8
|
+
import { c as configFiles } from './constants.DnKduX2e.js';
|
|
9
|
+
import 'node:process';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import './_commonjsHelpers.BFTU3MAI.js';
|
|
12
|
+
import 'readline';
|
|
13
|
+
import 'events';
|
|
14
|
+
|
|
15
|
+
const jsxExample = {
|
|
16
|
+
name: "HelloWorld.jsx",
|
|
17
|
+
js: `
|
|
18
|
+
export default function HelloWorld({ name }) {
|
|
19
|
+
return (
|
|
20
|
+
<div>
|
|
21
|
+
<h1>Hello {name}!</h1>
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
`,
|
|
26
|
+
ts: `
|
|
27
|
+
export default function HelloWorld({ name }: { name: string }) {
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<h1>Hello {name}!</h1>
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
test: `
|
|
36
|
+
import { expect, test } from 'vitest'
|
|
37
|
+
import { render } from '@testing-library/jsx'
|
|
38
|
+
import HelloWorld from './HelloWorld.jsx'
|
|
39
|
+
|
|
40
|
+
test('renders name', async () => {
|
|
41
|
+
const { getByText } = render(<HelloWorld name="Vitest" />)
|
|
42
|
+
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
|
|
43
|
+
})
|
|
44
|
+
`
|
|
45
|
+
};
|
|
46
|
+
const vueExample = {
|
|
47
|
+
name: "HelloWorld.vue",
|
|
48
|
+
js: `
|
|
49
|
+
<script setup>
|
|
50
|
+
defineProps({
|
|
51
|
+
name: String
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div>
|
|
57
|
+
<h1>Hello {{ name }}!</h1>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
`,
|
|
61
|
+
ts: `
|
|
62
|
+
<script setup lang="ts">
|
|
63
|
+
defineProps<{
|
|
64
|
+
name: string
|
|
65
|
+
}>()
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<div>
|
|
70
|
+
<h1>Hello {{ name }}!</h1>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
`,
|
|
74
|
+
test: `
|
|
75
|
+
import { expect, test } from 'vitest'
|
|
76
|
+
import { render } from 'vitest-browser-vue'
|
|
77
|
+
import HelloWorld from './HelloWorld.vue'
|
|
78
|
+
|
|
79
|
+
test('renders name', async () => {
|
|
80
|
+
const { getByText } = render(HelloWorld, {
|
|
81
|
+
props: { name: 'Vitest' },
|
|
82
|
+
})
|
|
83
|
+
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
|
|
84
|
+
})
|
|
85
|
+
`
|
|
86
|
+
};
|
|
87
|
+
const svelteExample = {
|
|
88
|
+
name: "HelloWorld.svelte",
|
|
89
|
+
js: `
|
|
90
|
+
<script>
|
|
91
|
+
export let name
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<h1>Hello {name}!</h1>
|
|
95
|
+
`,
|
|
96
|
+
ts: `
|
|
97
|
+
<script lang="ts">
|
|
98
|
+
export let name: string
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<h1>Hello {name}!</h1>
|
|
102
|
+
`,
|
|
103
|
+
test: `
|
|
104
|
+
import { expect, test } from 'vitest'
|
|
105
|
+
import { render } from 'vitest-browser-svelte'
|
|
106
|
+
import HelloWorld from './HelloWorld.svelte'
|
|
107
|
+
|
|
108
|
+
test('renders name', async () => {
|
|
109
|
+
const { getByText } = render(HelloWorld, { name: 'Vitest' })
|
|
110
|
+
await expect.element(getByText('Hello Vitest!')).toBeInTheDocument()
|
|
111
|
+
})
|
|
112
|
+
`
|
|
113
|
+
};
|
|
114
|
+
const markoExample = {
|
|
115
|
+
name: "HelloWorld.marko",
|
|
116
|
+
js: `
|
|
117
|
+
class {
|
|
118
|
+
onCreate() {
|
|
119
|
+
this.state = { name: null }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
<h1>Hello \${state.name}!</h1>
|
|
124
|
+
`,
|
|
125
|
+
ts: `
|
|
126
|
+
export interface Input {
|
|
127
|
+
name: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
<h1>Hello \${input.name}!</h1>
|
|
131
|
+
`,
|
|
132
|
+
test: `
|
|
133
|
+
import { expect, test } from 'vitest'
|
|
134
|
+
import { render } from '@marko/testing-library'
|
|
135
|
+
import HelloWorld from './HelloWorld.svelte'
|
|
136
|
+
|
|
137
|
+
test('renders name', async () => {
|
|
138
|
+
const { getByText } = await render(HelloWorld, { name: 'Vitest' })
|
|
139
|
+
const element = getByText('Hello Vitest!')
|
|
140
|
+
expect(element).toBeInTheDocument()
|
|
141
|
+
})
|
|
142
|
+
`
|
|
143
|
+
};
|
|
144
|
+
const litExample = {
|
|
145
|
+
name: "HelloWorld.js",
|
|
146
|
+
js: `
|
|
147
|
+
import { html, LitElement } from 'lit'
|
|
148
|
+
|
|
149
|
+
export class HelloWorld extends LitElement {
|
|
150
|
+
static properties = {
|
|
151
|
+
name: { type: String },
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
constructor() {
|
|
155
|
+
super()
|
|
156
|
+
this.name = 'World'
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
render() {
|
|
160
|
+
return html\`<h1>Hello \${this.name}!</h1>\`
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
customElements.define('hello-world', HelloWorld)
|
|
165
|
+
`,
|
|
166
|
+
ts: `
|
|
167
|
+
import { html, LitElement } from 'lit'
|
|
168
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
169
|
+
|
|
170
|
+
@customElement('hello-world')
|
|
171
|
+
export class HelloWorld extends LitElement {
|
|
172
|
+
@property({ type: String })
|
|
173
|
+
name = 'World'
|
|
174
|
+
|
|
175
|
+
render() {
|
|
176
|
+
return html\`<h1>Hello \${this.name}!</h1>\`
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare global {
|
|
181
|
+
interface HTMLElementTagNameMap {
|
|
182
|
+
'hello-world': HelloWorld
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`,
|
|
186
|
+
test: `
|
|
187
|
+
import { expect, test } from 'vitest'
|
|
188
|
+
import { render } from 'vitest-browser-lit'
|
|
189
|
+
import { html } from 'lit'
|
|
190
|
+
import './HelloWorld.js'
|
|
191
|
+
|
|
192
|
+
test('renders name', async () => {
|
|
193
|
+
const screen = render(html\`<hello-world name="Vitest"></hello-world>\`)
|
|
194
|
+
const element = screen.getByText('Hello Vitest!')
|
|
195
|
+
await expect.element(element).toBeInTheDocument()
|
|
196
|
+
})
|
|
197
|
+
`
|
|
198
|
+
};
|
|
199
|
+
const vanillaExample = {
|
|
200
|
+
name: "HelloWorld.js",
|
|
201
|
+
js: `
|
|
202
|
+
export default function HelloWorld({ name }) {
|
|
203
|
+
const parent = document.createElement('div')
|
|
204
|
+
|
|
205
|
+
const h1 = document.createElement('h1')
|
|
206
|
+
h1.textContent = 'Hello ' + name + '!'
|
|
207
|
+
parent.appendChild(h1)
|
|
208
|
+
|
|
209
|
+
return parent
|
|
210
|
+
}
|
|
211
|
+
`,
|
|
212
|
+
ts: `
|
|
213
|
+
export default function HelloWorld({ name }: { name: string }): HTMLDivElement {
|
|
214
|
+
const parent = document.createElement('div')
|
|
215
|
+
|
|
216
|
+
const h1 = document.createElement('h1')
|
|
217
|
+
h1.textContent = 'Hello ' + name + '!'
|
|
218
|
+
parent.appendChild(h1)
|
|
219
|
+
|
|
220
|
+
return parent
|
|
221
|
+
}
|
|
222
|
+
`,
|
|
223
|
+
test: `
|
|
224
|
+
import { expect, test } from 'vitest'
|
|
225
|
+
import { getByText } from '@testing-library/dom'
|
|
226
|
+
import HelloWorld from './HelloWorld.js'
|
|
227
|
+
|
|
228
|
+
test('renders name', () => {
|
|
229
|
+
const parent = HelloWorld({ name: 'Vitest' })
|
|
230
|
+
document.body.appendChild(parent)
|
|
231
|
+
|
|
232
|
+
const element = getByText(parent, 'Hello Vitest!')
|
|
233
|
+
expect(element).toBeInTheDocument()
|
|
234
|
+
})
|
|
235
|
+
`
|
|
236
|
+
};
|
|
237
|
+
function getExampleTest(framework) {
|
|
238
|
+
switch (framework) {
|
|
239
|
+
case "solid": return {
|
|
240
|
+
...jsxExample,
|
|
241
|
+
test: jsxExample.test.replace("@testing-library/jsx", `@testing-library/${framework}`)
|
|
242
|
+
};
|
|
243
|
+
case "preact":
|
|
244
|
+
case "react": return {
|
|
245
|
+
...jsxExample,
|
|
246
|
+
test: jsxExample.test.replace("@testing-library/jsx", `vitest-browser-${framework}`)
|
|
247
|
+
};
|
|
248
|
+
case "vue": return vueExample;
|
|
249
|
+
case "svelte": return svelteExample;
|
|
250
|
+
case "lit": return litExample;
|
|
251
|
+
case "marko": return markoExample;
|
|
252
|
+
default: return vanillaExample;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async function generateExampleFiles(framework, lang) {
|
|
256
|
+
const example = getExampleTest(framework);
|
|
257
|
+
let fileName = example.name;
|
|
258
|
+
const folder = resolve(process.cwd(), "vitest-example");
|
|
259
|
+
const fileContent = example[lang];
|
|
260
|
+
if (!existsSync(folder)) await mkdir(folder, { recursive: true });
|
|
261
|
+
const isJSX = fileName.endsWith(".jsx");
|
|
262
|
+
if (isJSX && lang === "ts") fileName = fileName.replace(".jsx", ".tsx");
|
|
263
|
+
else if (fileName.endsWith(".js") && lang === "ts") fileName = fileName.replace(".js", ".ts");
|
|
264
|
+
const filePath = resolve(folder, fileName);
|
|
265
|
+
const testPath = resolve(folder, `HelloWorld.test.${isJSX ? `${lang}x` : lang}`);
|
|
266
|
+
writeFileSync(filePath, fileContent.trimStart(), "utf-8");
|
|
267
|
+
writeFileSync(testPath, example.test.trimStart(), "utf-8");
|
|
268
|
+
return testPath;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// eslint-disable-next-line no-console
|
|
272
|
+
const log = console.log;
|
|
273
|
+
function getProviderOptions() {
|
|
274
|
+
const providers = {
|
|
275
|
+
playwright: "Playwright relies on Chrome DevTools protocol. Read more: https://playwright.dev",
|
|
276
|
+
webdriverio: "WebdriverIO uses WebDriver protocol. Read more: https://webdriver.io",
|
|
277
|
+
preview: "Preview is useful to quickly run your tests in the browser, but not suitable for CI."
|
|
278
|
+
};
|
|
279
|
+
return Object.entries(providers).map(([provider, description]) => {
|
|
280
|
+
return {
|
|
281
|
+
title: provider,
|
|
282
|
+
description,
|
|
283
|
+
value: provider
|
|
284
|
+
};
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function getBrowserNames(provider) {
|
|
288
|
+
switch (provider) {
|
|
289
|
+
case "webdriverio": return [
|
|
290
|
+
"chrome",
|
|
291
|
+
"firefox",
|
|
292
|
+
"edge",
|
|
293
|
+
"safari"
|
|
294
|
+
];
|
|
295
|
+
case "playwright": return [
|
|
296
|
+
"chromium",
|
|
297
|
+
"firefox",
|
|
298
|
+
"webkit"
|
|
299
|
+
];
|
|
300
|
+
case "preview": return [
|
|
301
|
+
"chrome",
|
|
302
|
+
"firefox",
|
|
303
|
+
"safari"
|
|
304
|
+
];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function getProviderPackageNames(provider) {
|
|
308
|
+
switch (provider) {
|
|
309
|
+
case "webdriverio": return {
|
|
310
|
+
types: "@vitest/browser/providers/webdriverio",
|
|
311
|
+
pkg: "webdriverio"
|
|
312
|
+
};
|
|
313
|
+
case "playwright": return {
|
|
314
|
+
types: "@vitest/browser/providers/playwright",
|
|
315
|
+
pkg: "playwright"
|
|
316
|
+
};
|
|
317
|
+
case "preview": return {
|
|
318
|
+
types: "@vitest/browser/matchers",
|
|
319
|
+
pkg: null
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
throw new Error(`Unsupported provider: ${provider}`);
|
|
323
|
+
}
|
|
324
|
+
function getFramework() {
|
|
325
|
+
return [
|
|
326
|
+
{
|
|
327
|
+
title: "vanilla",
|
|
328
|
+
value: "vanilla",
|
|
329
|
+
description: "No framework, just plain JavaScript or TypeScript."
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
title: "vue",
|
|
333
|
+
value: "vue",
|
|
334
|
+
description: "\"The Progressive JavaScript Framework\""
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
title: "svelte",
|
|
338
|
+
value: "svelte",
|
|
339
|
+
description: "\"Svelte: cybernetically enhanced web apps\""
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
title: "react",
|
|
343
|
+
value: "react",
|
|
344
|
+
description: "\"The library for web and native user interfaces\""
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
title: "lit",
|
|
348
|
+
value: "lit",
|
|
349
|
+
description: "\"A simple library for building fast, lightweight web components.\""
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
title: "preact",
|
|
353
|
+
value: "preact",
|
|
354
|
+
description: "\"Fast 3kB alternative to React with the same modern API\""
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
title: "solid",
|
|
358
|
+
value: "solid",
|
|
359
|
+
description: "\"Simple and performant reactivity for building user interfaces\""
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
title: "marko",
|
|
363
|
+
value: "marko",
|
|
364
|
+
description: "\"A declarative, HTML-based language that makes building web apps fun\""
|
|
365
|
+
}
|
|
366
|
+
];
|
|
367
|
+
}
|
|
368
|
+
function getFrameworkTestPackage(framework) {
|
|
369
|
+
switch (framework) {
|
|
370
|
+
case "vanilla": return null;
|
|
371
|
+
case "vue": return "vitest-browser-vue";
|
|
372
|
+
case "svelte": return "vitest-browser-svelte";
|
|
373
|
+
case "react": return "vitest-browser-react";
|
|
374
|
+
case "lit": return "vitest-browser-lit";
|
|
375
|
+
case "preact": return "vitest-browser-preact";
|
|
376
|
+
case "solid": return "@solidjs/testing-library";
|
|
377
|
+
case "marko": return "@marko/testing-library";
|
|
378
|
+
}
|
|
379
|
+
throw new Error(`Unsupported framework: ${framework}`);
|
|
380
|
+
}
|
|
381
|
+
function getFrameworkPluginPackage(framework) {
|
|
382
|
+
switch (framework) {
|
|
383
|
+
case "vue": return "@vitejs/plugin-vue";
|
|
384
|
+
case "svelte": return "@sveltejs/vite-plugin-svelte";
|
|
385
|
+
case "react": return "@vitejs/plugin-react";
|
|
386
|
+
case "preact": return "@preact/preset-vite";
|
|
387
|
+
case "solid": return "vite-plugin-solid";
|
|
388
|
+
case "marko": return "@marko/vite";
|
|
389
|
+
}
|
|
390
|
+
return null;
|
|
391
|
+
}
|
|
392
|
+
async function updateTsConfig(type) {
|
|
393
|
+
if (type == null) return;
|
|
394
|
+
const msg = `Add "${c.bold(type)}" to your tsconfig.json "${c.bold("compilerOptions.types")}" field to have better intellisense support.`;
|
|
395
|
+
log();
|
|
396
|
+
log(c.yellow("◼"), c.yellow(msg));
|
|
397
|
+
}
|
|
398
|
+
function getLanguageOptions() {
|
|
399
|
+
return [{
|
|
400
|
+
title: "TypeScript",
|
|
401
|
+
description: "Use TypeScript.",
|
|
402
|
+
value: "ts"
|
|
403
|
+
}, {
|
|
404
|
+
title: "JavaScript",
|
|
405
|
+
description: "Use plain JavaScript.",
|
|
406
|
+
value: "js"
|
|
407
|
+
}];
|
|
408
|
+
}
|
|
409
|
+
async function installPackages(pkgManager, packages) {
|
|
410
|
+
if (!packages.length) {
|
|
411
|
+
log(c.green("✔"), c.bold("All packages are already installed."));
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
log(c.cyan("◼"), c.bold("Installing packages..."));
|
|
415
|
+
log(c.cyan("◼"), packages.join(", "));
|
|
416
|
+
log();
|
|
417
|
+
await installPackage(packages, {
|
|
418
|
+
dev: true,
|
|
419
|
+
packageManager: pkgManager ?? void 0
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
function readPkgJson(path) {
|
|
423
|
+
if (!existsSync(path)) return null;
|
|
424
|
+
const content = readFileSync(path, "utf-8");
|
|
425
|
+
return JSON.parse(content);
|
|
426
|
+
}
|
|
427
|
+
function getPossibleDefaults(dependencies) {
|
|
428
|
+
const provider = getPossibleProvider(dependencies);
|
|
429
|
+
const framework = getPossibleFramework(dependencies);
|
|
430
|
+
return {
|
|
431
|
+
lang: "ts",
|
|
432
|
+
provider,
|
|
433
|
+
framework
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
function getPossibleFramework(dependencies) {
|
|
437
|
+
if (dependencies.vue || dependencies["vue-tsc"] || dependencies["@vue/reactivity"]) return "vue";
|
|
438
|
+
if (dependencies.react || dependencies["react-dom"]) return "react";
|
|
439
|
+
if (dependencies.svelte || dependencies["@sveltejs/kit"]) return "svelte";
|
|
440
|
+
if (dependencies.lit || dependencies["lit-html"]) return "lit";
|
|
441
|
+
if (dependencies.preact) return "preact";
|
|
442
|
+
if (dependencies["solid-js"] || dependencies["@solidjs/start"]) return "solid";
|
|
443
|
+
if (dependencies.marko) return "marko";
|
|
444
|
+
return "vanilla";
|
|
445
|
+
}
|
|
446
|
+
function getPossibleProvider(dependencies) {
|
|
447
|
+
if (dependencies.webdriverio || dependencies["@wdio/cli"] || dependencies["@wdio/config"]) return "webdriverio";
|
|
448
|
+
// playwright is the default recommendation
|
|
449
|
+
return "playwright";
|
|
450
|
+
}
|
|
451
|
+
function getProviderDocsLink(provider) {
|
|
452
|
+
switch (provider) {
|
|
453
|
+
case "playwright": return "https://vitest.dev/guide/browser/playwright";
|
|
454
|
+
case "webdriverio": return "https://vitest.dev/guide/browser/webdriverio";
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function sort(choices, value) {
|
|
458
|
+
const index = choices.findIndex((i) => i.value === value);
|
|
459
|
+
if (index === -1) return choices;
|
|
460
|
+
const item = choices.splice(index, 1)[0];
|
|
461
|
+
return [item, ...choices];
|
|
462
|
+
}
|
|
463
|
+
function fail() {
|
|
464
|
+
process.exitCode = 1;
|
|
465
|
+
}
|
|
466
|
+
async function generateFrameworkConfigFile(options) {
|
|
467
|
+
const frameworkImport = options.framework === "svelte" ? `import { svelte } from '${options.frameworkPlugin}'` : `import ${options.framework} from '${options.frameworkPlugin}'`;
|
|
468
|
+
const configContent = [
|
|
469
|
+
`import { defineConfig } from 'vitest/config'`,
|
|
470
|
+
options.frameworkPlugin ? frameworkImport : null,
|
|
471
|
+
``,
|
|
472
|
+
"export default defineConfig({",
|
|
473
|
+
options.frameworkPlugin ? ` plugins: [${options.framework}()],` : null,
|
|
474
|
+
` test: {`,
|
|
475
|
+
` browser: {`,
|
|
476
|
+
` enabled: true,`,
|
|
477
|
+
` provider: '${options.provider}',`,
|
|
478
|
+
options.provider !== "preview" && ` // ${getProviderDocsLink(options.provider)}`,
|
|
479
|
+
` instances: [`,
|
|
480
|
+
...options.browsers.map((browser) => ` { browser: '${browser}' },`),
|
|
481
|
+
` ],`,
|
|
482
|
+
` },`,
|
|
483
|
+
` },`,
|
|
484
|
+
`})`,
|
|
485
|
+
""
|
|
486
|
+
].filter((t) => typeof t === "string").join("\n");
|
|
487
|
+
await writeFile(options.configPath, configContent);
|
|
488
|
+
}
|
|
489
|
+
async function updatePkgJsonScripts(pkgJsonPath, vitestScript) {
|
|
490
|
+
if (!existsSync(pkgJsonPath)) {
|
|
491
|
+
const pkg = { scripts: { "test:browser": vitestScript } };
|
|
492
|
+
await writeFile(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf-8");
|
|
493
|
+
} else {
|
|
494
|
+
const pkg = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
495
|
+
pkg.scripts = pkg.scripts || {};
|
|
496
|
+
pkg.scripts["test:browser"] = vitestScript;
|
|
497
|
+
await writeFile(pkgJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf-8");
|
|
498
|
+
}
|
|
499
|
+
log(c.green("✔"), "Added \"test:browser\" script to your package.json.");
|
|
500
|
+
}
|
|
501
|
+
function getRunScript(pkgManager) {
|
|
502
|
+
switch (pkgManager) {
|
|
503
|
+
case "yarn@berry":
|
|
504
|
+
case "yarn": return "yarn test:browser";
|
|
505
|
+
case "pnpm@6":
|
|
506
|
+
case "pnpm": return "pnpm test:browser";
|
|
507
|
+
case "bun": return "bun test:browser";
|
|
508
|
+
default: return "npm run test:browser";
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function getPlaywrightRunArgs(pkgManager) {
|
|
512
|
+
switch (pkgManager) {
|
|
513
|
+
case "yarn@berry":
|
|
514
|
+
case "yarn": return ["yarn", "exec"];
|
|
515
|
+
case "pnpm@6":
|
|
516
|
+
case "pnpm": return ["pnpx"];
|
|
517
|
+
case "bun": return ["bunx"];
|
|
518
|
+
default: return ["npx"];
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
async function create() {
|
|
522
|
+
log(c.cyan("◼"), "This utility will help you set up a browser testing environment.\n");
|
|
523
|
+
const pkgJsonPath = resolve(process.cwd(), "package.json");
|
|
524
|
+
const pkg = readPkgJson(pkgJsonPath) || {};
|
|
525
|
+
const dependencies = {
|
|
526
|
+
...pkg.dependencies,
|
|
527
|
+
...pkg.devDependencies
|
|
528
|
+
};
|
|
529
|
+
const defaults = getPossibleDefaults(dependencies);
|
|
530
|
+
const { lang } = await prompt({
|
|
531
|
+
type: "select",
|
|
532
|
+
name: "lang",
|
|
533
|
+
message: "Choose a language for your tests",
|
|
534
|
+
choices: sort(getLanguageOptions(), defaults?.lang)
|
|
535
|
+
});
|
|
536
|
+
if (!lang) return fail();
|
|
537
|
+
const { provider } = await prompt({
|
|
538
|
+
type: "select",
|
|
539
|
+
name: "provider",
|
|
540
|
+
message: "Choose a browser provider. Vitest will use its API to control the testing environment",
|
|
541
|
+
choices: sort(getProviderOptions(), defaults?.provider)
|
|
542
|
+
});
|
|
543
|
+
if (!provider) return fail();
|
|
544
|
+
const { browsers } = await prompt({
|
|
545
|
+
type: "multiselect",
|
|
546
|
+
name: "browsers",
|
|
547
|
+
message: "Choose a browser",
|
|
548
|
+
choices: getBrowserNames(provider).map((browser) => ({
|
|
549
|
+
title: browser,
|
|
550
|
+
value: browser
|
|
551
|
+
}))
|
|
552
|
+
});
|
|
553
|
+
if (!provider) return fail();
|
|
554
|
+
const { framework } = await prompt({
|
|
555
|
+
type: "select",
|
|
556
|
+
name: "framework",
|
|
557
|
+
message: "Choose your framework",
|
|
558
|
+
choices: sort(getFramework(), defaults?.framework)
|
|
559
|
+
});
|
|
560
|
+
if (!framework) return fail();
|
|
561
|
+
let installPlaywright = false;
|
|
562
|
+
if (provider === "playwright") ({installPlaywright} = await prompt({
|
|
563
|
+
type: "confirm",
|
|
564
|
+
name: "installPlaywright",
|
|
565
|
+
message: `Install Playwright browsers (can be done manually via 'pnpm exec playwright install')?`
|
|
566
|
+
}));
|
|
567
|
+
if (installPlaywright == null) return fail();
|
|
568
|
+
const dependenciesToInstall = ["@vitest/browser"];
|
|
569
|
+
const frameworkPackage = getFrameworkTestPackage(framework);
|
|
570
|
+
if (frameworkPackage) dependenciesToInstall.push(frameworkPackage);
|
|
571
|
+
const providerPkg = getProviderPackageNames(provider);
|
|
572
|
+
if (providerPkg.pkg) dependenciesToInstall.push(providerPkg.pkg);
|
|
573
|
+
const frameworkPlugin = getFrameworkPluginPackage(framework);
|
|
574
|
+
if (frameworkPlugin) dependenciesToInstall.push(frameworkPlugin);
|
|
575
|
+
const pkgManager = await detectPackageManager();
|
|
576
|
+
log();
|
|
577
|
+
await installPackages(pkgManager, dependenciesToInstall.filter((pkg) => !dependencies[pkg]));
|
|
578
|
+
const rootConfig = await findUp(configFiles, { cwd: process.cwd() });
|
|
579
|
+
let scriptCommand = "vitest";
|
|
580
|
+
log();
|
|
581
|
+
if (rootConfig) {
|
|
582
|
+
const configPath = resolve(dirname(rootConfig), `vitest.browser.config.${lang}`);
|
|
583
|
+
scriptCommand = `vitest --config=${relative(process.cwd(), configPath)}`;
|
|
584
|
+
await generateFrameworkConfigFile({
|
|
585
|
+
configPath,
|
|
586
|
+
framework,
|
|
587
|
+
frameworkPlugin,
|
|
588
|
+
provider,
|
|
589
|
+
browsers
|
|
590
|
+
});
|
|
591
|
+
log(
|
|
592
|
+
c.green("✔"),
|
|
593
|
+
"Created a new config file for browser tests:",
|
|
594
|
+
c.bold(relative(process.cwd(), configPath)),
|
|
595
|
+
// TODO: Can we modify the config ourselves?
|
|
596
|
+
"\nSince you already have a Vitest config file, it is recommended to copy the contents of the new file ",
|
|
597
|
+
"into your existing config located at ",
|
|
598
|
+
c.bold(relative(process.cwd(), rootConfig))
|
|
599
|
+
);
|
|
600
|
+
} else {
|
|
601
|
+
const configPath = resolve(process.cwd(), `vitest.config.${lang}`);
|
|
602
|
+
await generateFrameworkConfigFile({
|
|
603
|
+
configPath,
|
|
604
|
+
framework,
|
|
605
|
+
frameworkPlugin,
|
|
606
|
+
provider,
|
|
607
|
+
browsers
|
|
608
|
+
});
|
|
609
|
+
log(c.green("✔"), "Created a config file for browser tests:", c.bold(relative(process.cwd(), configPath)));
|
|
610
|
+
}
|
|
611
|
+
log();
|
|
612
|
+
await updatePkgJsonScripts(pkgJsonPath, scriptCommand);
|
|
613
|
+
if (installPlaywright) {
|
|
614
|
+
log();
|
|
615
|
+
const [command, ...args] = getPlaywrightRunArgs(pkgManager);
|
|
616
|
+
const allArgs = [
|
|
617
|
+
...args,
|
|
618
|
+
"playwright",
|
|
619
|
+
"install",
|
|
620
|
+
"--with-deps"
|
|
621
|
+
];
|
|
622
|
+
log(c.cyan("◼"), `Installing Playwright dependencies with \`${c.bold(command)} ${c.bold(allArgs.join(" "))}\`...`);
|
|
623
|
+
log();
|
|
624
|
+
await x(command, allArgs, { nodeOptions: { stdio: [
|
|
625
|
+
"pipe",
|
|
626
|
+
"inherit",
|
|
627
|
+
"inherit"
|
|
628
|
+
] } });
|
|
629
|
+
}
|
|
630
|
+
// TODO: can we do this ourselves?
|
|
631
|
+
if (lang === "ts") await updateTsConfig(providerPkg?.types);
|
|
632
|
+
log();
|
|
633
|
+
const exampleTestFile = await generateExampleFiles(framework, lang);
|
|
634
|
+
log(c.green("✔"), "Created example test file in", c.bold(relative(process.cwd(), exampleTestFile)));
|
|
635
|
+
log(c.dim(" You can safely delete this file once you have written your own tests."));
|
|
636
|
+
log();
|
|
637
|
+
log(c.cyan("◼"), "All done! Run your tests with", c.bold(getRunScript(pkgManager)));
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export { create };
|