@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,756 @@
|
|
|
1
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
|
+
import vm, { isContext } from 'node:vm';
|
|
3
|
+
import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
|
|
4
|
+
import { distDir } from '../path.js';
|
|
5
|
+
import { createCustomConsole } from './console.CtFJOzRO.js';
|
|
6
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.B7h3T_Hc.js';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { dirname as dirname$1 } from 'node:path';
|
|
9
|
+
import { isPrimitive, isNodeBuiltin, toArray, getCachedData, setCacheData, isBareImport } from 'vite-node/utils';
|
|
10
|
+
import { createRequire, Module } from 'node:module';
|
|
11
|
+
import { CSS_LANGS_RE, KNOWN_ASSET_RE } from 'vite-node/constants';
|
|
12
|
+
import { p as provideWorkerState } from './utils.XdZDrNZV.js';
|
|
13
|
+
|
|
14
|
+
function interopCommonJsModule(interopDefault, mod) {
|
|
15
|
+
if (isPrimitive(mod) || Array.isArray(mod) || mod instanceof Promise) return {
|
|
16
|
+
keys: [],
|
|
17
|
+
moduleExports: {},
|
|
18
|
+
defaultExport: mod
|
|
19
|
+
};
|
|
20
|
+
if (interopDefault !== false && "__esModule" in mod && !isPrimitive(mod.default)) {
|
|
21
|
+
const defaultKets = Object.keys(mod.default);
|
|
22
|
+
const moduleKeys = Object.keys(mod);
|
|
23
|
+
const allKeys = new Set([...defaultKets, ...moduleKeys]);
|
|
24
|
+
allKeys.delete("default");
|
|
25
|
+
return {
|
|
26
|
+
keys: Array.from(allKeys),
|
|
27
|
+
moduleExports: new Proxy(mod, { get(mod, prop) {
|
|
28
|
+
return mod[prop] ?? mod.default?.[prop];
|
|
29
|
+
} }),
|
|
30
|
+
defaultExport: mod
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
keys: Object.keys(mod).filter((key) => key !== "default"),
|
|
35
|
+
moduleExports: mod,
|
|
36
|
+
defaultExport: mod
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const SyntheticModule = vm.SyntheticModule;
|
|
40
|
+
const SourceTextModule = vm.SourceTextModule;
|
|
41
|
+
|
|
42
|
+
const _require = createRequire(import.meta.url);
|
|
43
|
+
const requiresCache = /* @__PURE__ */ new WeakMap();
|
|
44
|
+
class CommonjsExecutor {
|
|
45
|
+
context;
|
|
46
|
+
requireCache = /* @__PURE__ */ new Map();
|
|
47
|
+
publicRequireCache = this.createProxyCache();
|
|
48
|
+
moduleCache = /* @__PURE__ */ new Map();
|
|
49
|
+
builtinCache = Object.create(null);
|
|
50
|
+
extensions = Object.create(null);
|
|
51
|
+
fs;
|
|
52
|
+
Module;
|
|
53
|
+
interopDefault;
|
|
54
|
+
constructor(options) {
|
|
55
|
+
this.context = options.context;
|
|
56
|
+
this.fs = options.fileMap;
|
|
57
|
+
this.interopDefault = options.interopDefault;
|
|
58
|
+
const primitives = vm.runInContext("({ Object, Array, Error })", this.context);
|
|
59
|
+
// eslint-disable-next-line ts/no-this-alias
|
|
60
|
+
const executor = this;
|
|
61
|
+
this.Module = class Module$1 {
|
|
62
|
+
exports;
|
|
63
|
+
isPreloading = false;
|
|
64
|
+
id;
|
|
65
|
+
filename;
|
|
66
|
+
loaded;
|
|
67
|
+
parent;
|
|
68
|
+
children = [];
|
|
69
|
+
path;
|
|
70
|
+
paths = [];
|
|
71
|
+
constructor(id = "", parent) {
|
|
72
|
+
this.exports = primitives.Object.create(Object.prototype);
|
|
73
|
+
// in our case the path should always be resolved already
|
|
74
|
+
this.path = dirname(id);
|
|
75
|
+
this.id = id;
|
|
76
|
+
this.filename = id;
|
|
77
|
+
this.loaded = false;
|
|
78
|
+
this.parent = parent;
|
|
79
|
+
}
|
|
80
|
+
get require() {
|
|
81
|
+
const require = requiresCache.get(this);
|
|
82
|
+
if (require) return require;
|
|
83
|
+
const _require = Module$1.createRequire(this.id);
|
|
84
|
+
requiresCache.set(this, _require);
|
|
85
|
+
return _require;
|
|
86
|
+
}
|
|
87
|
+
static register = () => {
|
|
88
|
+
throw new Error(`[vitest] "register" is not available when running in Vitest.`);
|
|
89
|
+
};
|
|
90
|
+
static registerHooks = () => {
|
|
91
|
+
throw new Error(`[vitest] "registerHooks" is not available when running in Vitest.`);
|
|
92
|
+
};
|
|
93
|
+
_compile(code, filename) {
|
|
94
|
+
const cjsModule = Module$1.wrap(code);
|
|
95
|
+
const script = new vm.Script(cjsModule, {
|
|
96
|
+
filename,
|
|
97
|
+
importModuleDynamically: options.importModuleDynamically
|
|
98
|
+
});
|
|
99
|
+
// @ts-expect-error mark script with current identifier
|
|
100
|
+
script.identifier = filename;
|
|
101
|
+
const fn = script.runInContext(executor.context);
|
|
102
|
+
const __dirname = dirname(filename);
|
|
103
|
+
executor.requireCache.set(filename, this);
|
|
104
|
+
try {
|
|
105
|
+
fn(this.exports, this.require, this, filename, __dirname);
|
|
106
|
+
return this.exports;
|
|
107
|
+
} finally {
|
|
108
|
+
this.loaded = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// exposed for external use, Node.js does the opposite
|
|
112
|
+
static _load = (request, parent, _isMain) => {
|
|
113
|
+
const require = Module$1.createRequire(parent?.filename ?? request);
|
|
114
|
+
return require(request);
|
|
115
|
+
};
|
|
116
|
+
static wrap = (script) => {
|
|
117
|
+
return Module$1.wrapper[0] + script + Module$1.wrapper[1];
|
|
118
|
+
};
|
|
119
|
+
static wrapper = new primitives.Array("(function (exports, require, module, __filename, __dirname) { ", "\n});");
|
|
120
|
+
static builtinModules = Module.builtinModules;
|
|
121
|
+
static findSourceMap = Module.findSourceMap;
|
|
122
|
+
static SourceMap = Module.SourceMap;
|
|
123
|
+
static syncBuiltinESMExports = Module.syncBuiltinESMExports;
|
|
124
|
+
static _cache = executor.publicRequireCache;
|
|
125
|
+
static _extensions = executor.extensions;
|
|
126
|
+
static createRequire = (filename) => {
|
|
127
|
+
return executor.createRequire(filename);
|
|
128
|
+
};
|
|
129
|
+
static runMain = () => {
|
|
130
|
+
throw new primitives.Error("[vitest] \"runMain\" is not implemented.");
|
|
131
|
+
};
|
|
132
|
+
// @ts-expect-error not typed
|
|
133
|
+
static _resolveFilename = Module._resolveFilename;
|
|
134
|
+
// @ts-expect-error not typed
|
|
135
|
+
static _findPath = Module._findPath;
|
|
136
|
+
// @ts-expect-error not typed
|
|
137
|
+
static _initPaths = Module._initPaths;
|
|
138
|
+
// @ts-expect-error not typed
|
|
139
|
+
static _preloadModules = Module._preloadModules;
|
|
140
|
+
// @ts-expect-error not typed
|
|
141
|
+
static _resolveLookupPaths = Module._resolveLookupPaths;
|
|
142
|
+
// @ts-expect-error not typed
|
|
143
|
+
static globalPaths = Module.globalPaths;
|
|
144
|
+
static isBuiltin = Module.isBuiltin;
|
|
145
|
+
static constants = Module.constants;
|
|
146
|
+
static enableCompileCache = Module.enableCompileCache;
|
|
147
|
+
static getCompileCacheDir = Module.getCompileCacheDir;
|
|
148
|
+
static flushCompileCache = Module.flushCompileCache;
|
|
149
|
+
static stripTypeScriptTypes = Module.stripTypeScriptTypes;
|
|
150
|
+
static findPackageJSON = Module.findPackageJSON;
|
|
151
|
+
static Module = Module$1;
|
|
152
|
+
};
|
|
153
|
+
this.extensions[".js"] = this.requireJs;
|
|
154
|
+
this.extensions[".json"] = this.requireJson;
|
|
155
|
+
}
|
|
156
|
+
requireJs = (m, filename) => {
|
|
157
|
+
const content = this.fs.readFile(filename);
|
|
158
|
+
m._compile(content, filename);
|
|
159
|
+
};
|
|
160
|
+
requireJson = (m, filename) => {
|
|
161
|
+
const code = this.fs.readFile(filename);
|
|
162
|
+
m.exports = JSON.parse(code);
|
|
163
|
+
};
|
|
164
|
+
createRequire = (filename) => {
|
|
165
|
+
const _require = createRequire(filename);
|
|
166
|
+
const require = (id) => {
|
|
167
|
+
const resolved = _require.resolve(id);
|
|
168
|
+
const ext = extname(resolved);
|
|
169
|
+
if (ext === ".node" || isNodeBuiltin(resolved)) return this.requireCoreModule(resolved);
|
|
170
|
+
const module = new this.Module(resolved);
|
|
171
|
+
return this.loadCommonJSModule(module, resolved);
|
|
172
|
+
};
|
|
173
|
+
require.resolve = _require.resolve;
|
|
174
|
+
Object.defineProperty(require, "extensions", {
|
|
175
|
+
get: () => this.extensions,
|
|
176
|
+
set: () => {},
|
|
177
|
+
configurable: true
|
|
178
|
+
});
|
|
179
|
+
require.main = void 0;
|
|
180
|
+
require.cache = this.publicRequireCache;
|
|
181
|
+
return require;
|
|
182
|
+
};
|
|
183
|
+
createProxyCache() {
|
|
184
|
+
return new Proxy(Object.create(null), {
|
|
185
|
+
defineProperty: () => true,
|
|
186
|
+
deleteProperty: () => true,
|
|
187
|
+
set: () => true,
|
|
188
|
+
get: (_, key) => this.requireCache.get(key),
|
|
189
|
+
has: (_, key) => this.requireCache.has(key),
|
|
190
|
+
ownKeys: () => Array.from(this.requireCache.keys()),
|
|
191
|
+
getOwnPropertyDescriptor() {
|
|
192
|
+
return {
|
|
193
|
+
configurable: true,
|
|
194
|
+
enumerable: true
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// very naive implementation for Node.js require
|
|
200
|
+
loadCommonJSModule(module, filename) {
|
|
201
|
+
const cached = this.requireCache.get(filename);
|
|
202
|
+
if (cached) return cached.exports;
|
|
203
|
+
const extension = this.findLongestRegisteredExtension(filename);
|
|
204
|
+
const loader = this.extensions[extension] || this.extensions[".js"];
|
|
205
|
+
loader(module, filename);
|
|
206
|
+
return module.exports;
|
|
207
|
+
}
|
|
208
|
+
findLongestRegisteredExtension(filename) {
|
|
209
|
+
const name = basename(filename);
|
|
210
|
+
let currentExtension;
|
|
211
|
+
let index;
|
|
212
|
+
let startIndex = 0;
|
|
213
|
+
// eslint-disable-next-line no-cond-assign
|
|
214
|
+
while ((index = name.indexOf(".", startIndex)) !== -1) {
|
|
215
|
+
startIndex = index + 1;
|
|
216
|
+
if (index === 0) continue;
|
|
217
|
+
currentExtension = name.slice(index);
|
|
218
|
+
if (this.extensions[currentExtension]) return currentExtension;
|
|
219
|
+
}
|
|
220
|
+
return ".js";
|
|
221
|
+
}
|
|
222
|
+
getCoreSyntheticModule(identifier) {
|
|
223
|
+
if (this.moduleCache.has(identifier)) return this.moduleCache.get(identifier);
|
|
224
|
+
const exports = this.require(identifier);
|
|
225
|
+
const keys = Object.keys(exports);
|
|
226
|
+
const module = new SyntheticModule([...keys, "default"], () => {
|
|
227
|
+
for (const key of keys) module.setExport(key, exports[key]);
|
|
228
|
+
module.setExport("default", exports);
|
|
229
|
+
}, {
|
|
230
|
+
context: this.context,
|
|
231
|
+
identifier
|
|
232
|
+
});
|
|
233
|
+
this.moduleCache.set(identifier, module);
|
|
234
|
+
return module;
|
|
235
|
+
}
|
|
236
|
+
getCjsSyntheticModule(path, identifier) {
|
|
237
|
+
if (this.moduleCache.has(identifier)) return this.moduleCache.get(identifier);
|
|
238
|
+
const exports = this.require(path);
|
|
239
|
+
// TODO: technically module should be parsed to find static exports, implement for strict mode in #2854
|
|
240
|
+
const { keys, moduleExports, defaultExport } = interopCommonJsModule(this.interopDefault, exports);
|
|
241
|
+
const module = new SyntheticModule([...keys, "default"], function() {
|
|
242
|
+
for (const key of keys) this.setExport(key, moduleExports[key]);
|
|
243
|
+
this.setExport("default", defaultExport);
|
|
244
|
+
}, {
|
|
245
|
+
context: this.context,
|
|
246
|
+
identifier
|
|
247
|
+
});
|
|
248
|
+
this.moduleCache.set(identifier, module);
|
|
249
|
+
return module;
|
|
250
|
+
}
|
|
251
|
+
// TODO: use this in strict mode, when available in #2854
|
|
252
|
+
// private _getNamedCjsExports(path: string): Set<string> {
|
|
253
|
+
// const cachedNamedExports = this.cjsNamedExportsMap.get(path)
|
|
254
|
+
// if (cachedNamedExports) {
|
|
255
|
+
// return cachedNamedExports
|
|
256
|
+
// }
|
|
257
|
+
// if (extname(path) === '.node') {
|
|
258
|
+
// const moduleExports = this.require(path)
|
|
259
|
+
// const namedExports = new Set(Object.keys(moduleExports))
|
|
260
|
+
// this.cjsNamedExportsMap.set(path, namedExports)
|
|
261
|
+
// return namedExports
|
|
262
|
+
// }
|
|
263
|
+
// const code = this.fs.readFile(path)
|
|
264
|
+
// const { exports, reexports } = parseCjs(code, path)
|
|
265
|
+
// const namedExports = new Set(exports)
|
|
266
|
+
// this.cjsNamedExportsMap.set(path, namedExports)
|
|
267
|
+
// for (const reexport of reexports) {
|
|
268
|
+
// if (isNodeBuiltin(reexport)) {
|
|
269
|
+
// const exports = this.require(reexport)
|
|
270
|
+
// if (exports !== null && typeof exports === 'object') {
|
|
271
|
+
// for (const e of Object.keys(exports)) {
|
|
272
|
+
// namedExports.add(e)
|
|
273
|
+
// }
|
|
274
|
+
// }
|
|
275
|
+
// }
|
|
276
|
+
// else {
|
|
277
|
+
// const require = this.createRequire(path)
|
|
278
|
+
// const resolved = require.resolve(reexport)
|
|
279
|
+
// const exports = this._getNamedCjsExports(resolved)
|
|
280
|
+
// for (const e of exports) {
|
|
281
|
+
// namedExports.add(e)
|
|
282
|
+
// }
|
|
283
|
+
// }
|
|
284
|
+
// }
|
|
285
|
+
// return namedExports
|
|
286
|
+
// }
|
|
287
|
+
require(identifier) {
|
|
288
|
+
const ext = extname(identifier);
|
|
289
|
+
if (ext === ".node" || isNodeBuiltin(identifier)) return this.requireCoreModule(identifier);
|
|
290
|
+
const module = new this.Module(identifier);
|
|
291
|
+
return this.loadCommonJSModule(module, identifier);
|
|
292
|
+
}
|
|
293
|
+
requireCoreModule(identifier) {
|
|
294
|
+
const normalized = identifier.replace(/^node:/, "");
|
|
295
|
+
if (this.builtinCache[normalized]) return this.builtinCache[normalized].exports;
|
|
296
|
+
const moduleExports = _require(identifier);
|
|
297
|
+
if (identifier === "node:module" || identifier === "module") {
|
|
298
|
+
const module = new this.Module("/module.js");
|
|
299
|
+
module.exports = this.Module;
|
|
300
|
+
this.builtinCache[normalized] = module;
|
|
301
|
+
return module.exports;
|
|
302
|
+
}
|
|
303
|
+
this.builtinCache[normalized] = _require.cache[normalized];
|
|
304
|
+
// TODO: should we wrap module to rethrow context errors?
|
|
305
|
+
return moduleExports;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const dataURIRegex = /^data:(?<mime>text\/javascript|application\/json|application\/wasm)(?:;(?<encoding>charset=utf-8|base64))?,(?<code>.*)$/;
|
|
310
|
+
class EsmExecutor {
|
|
311
|
+
moduleCache = /* @__PURE__ */ new Map();
|
|
312
|
+
esmLinkMap = /* @__PURE__ */ new WeakMap();
|
|
313
|
+
context;
|
|
314
|
+
#httpIp = IPnumber("127.0.0.0");
|
|
315
|
+
constructor(executor, options) {
|
|
316
|
+
this.executor = executor;
|
|
317
|
+
this.context = options.context;
|
|
318
|
+
}
|
|
319
|
+
async evaluateModule(m) {
|
|
320
|
+
if (m.status === "unlinked") this.esmLinkMap.set(m, m.link((identifier, referencer) => this.executor.resolveModule(identifier, referencer.identifier)));
|
|
321
|
+
await this.esmLinkMap.get(m);
|
|
322
|
+
if (m.status === "linked") await m.evaluate();
|
|
323
|
+
return m;
|
|
324
|
+
}
|
|
325
|
+
async createEsModule(fileURL, getCode) {
|
|
326
|
+
const cached = this.moduleCache.get(fileURL);
|
|
327
|
+
if (cached) return cached;
|
|
328
|
+
const promise = this.loadEsModule(fileURL, getCode);
|
|
329
|
+
this.moduleCache.set(fileURL, promise);
|
|
330
|
+
return promise;
|
|
331
|
+
}
|
|
332
|
+
async loadEsModule(fileURL, getCode) {
|
|
333
|
+
const code = await getCode();
|
|
334
|
+
// TODO: should not be allowed in strict mode, implement in #2854
|
|
335
|
+
if (fileURL.endsWith(".json")) {
|
|
336
|
+
const m = new SyntheticModule(["default"], function() {
|
|
337
|
+
const result = JSON.parse(code);
|
|
338
|
+
this.setExport("default", result);
|
|
339
|
+
});
|
|
340
|
+
this.moduleCache.set(fileURL, m);
|
|
341
|
+
return m;
|
|
342
|
+
}
|
|
343
|
+
const m = new SourceTextModule(code, {
|
|
344
|
+
identifier: fileURL,
|
|
345
|
+
context: this.context,
|
|
346
|
+
importModuleDynamically: this.executor.importModuleDynamically,
|
|
347
|
+
initializeImportMeta: (meta, mod) => {
|
|
348
|
+
meta.url = mod.identifier;
|
|
349
|
+
if (mod.identifier.startsWith("file:")) {
|
|
350
|
+
const filename = fileURLToPath(mod.identifier);
|
|
351
|
+
meta.filename = filename;
|
|
352
|
+
meta.dirname = dirname$1(filename);
|
|
353
|
+
}
|
|
354
|
+
meta.resolve = (specifier, importer) => {
|
|
355
|
+
return this.executor.resolve(specifier, importer != null ? importer.toString() : mod.identifier);
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
this.moduleCache.set(fileURL, m);
|
|
360
|
+
return m;
|
|
361
|
+
}
|
|
362
|
+
async createWebAssemblyModule(fileUrl, getCode) {
|
|
363
|
+
const cached = this.moduleCache.get(fileUrl);
|
|
364
|
+
if (cached) return cached;
|
|
365
|
+
const m = this.loadWebAssemblyModule(getCode(), fileUrl);
|
|
366
|
+
this.moduleCache.set(fileUrl, m);
|
|
367
|
+
return m;
|
|
368
|
+
}
|
|
369
|
+
async createNetworkModule(fileUrl) {
|
|
370
|
+
// https://nodejs.org/api/esm.html#https-and-http-imports
|
|
371
|
+
if (fileUrl.startsWith("http:")) {
|
|
372
|
+
const url = new URL(fileUrl);
|
|
373
|
+
if (url.hostname !== "localhost" && url.hostname !== "::1" && (IPnumber(url.hostname) & IPmask(8)) !== this.#httpIp) throw new Error(
|
|
374
|
+
// we don't know the importer, so it's undefined (the same happens in --pool=threads)
|
|
375
|
+
`import of '${fileUrl}' by undefined is not supported: http can only be used to load local resources (use https instead).`
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
return this.createEsModule(fileUrl, () => fetch(fileUrl).then((r) => r.text()));
|
|
379
|
+
}
|
|
380
|
+
async loadWebAssemblyModule(source, identifier) {
|
|
381
|
+
const cached = this.moduleCache.get(identifier);
|
|
382
|
+
if (cached) return cached;
|
|
383
|
+
const wasmModule = await WebAssembly.compile(source);
|
|
384
|
+
const exports = WebAssembly.Module.exports(wasmModule);
|
|
385
|
+
const imports = WebAssembly.Module.imports(wasmModule);
|
|
386
|
+
const moduleLookup = {};
|
|
387
|
+
for (const { module } of imports) if (moduleLookup[module] === void 0) moduleLookup[module] = await this.executor.resolveModule(module, identifier);
|
|
388
|
+
const evaluateModule = (module) => this.evaluateModule(module);
|
|
389
|
+
const syntheticModule = new SyntheticModule(exports.map(({ name }) => name), async function() {
|
|
390
|
+
const importsObject = {};
|
|
391
|
+
for (const { module, name } of imports) {
|
|
392
|
+
if (!importsObject[module]) importsObject[module] = {};
|
|
393
|
+
await evaluateModule(moduleLookup[module]);
|
|
394
|
+
importsObject[module][name] = moduleLookup[module].namespace[name];
|
|
395
|
+
}
|
|
396
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, importsObject);
|
|
397
|
+
for (const { name } of exports) this.setExport(name, wasmInstance.exports[name]);
|
|
398
|
+
}, {
|
|
399
|
+
context: this.context,
|
|
400
|
+
identifier
|
|
401
|
+
});
|
|
402
|
+
return syntheticModule;
|
|
403
|
+
}
|
|
404
|
+
cacheModule(identifier, module) {
|
|
405
|
+
this.moduleCache.set(identifier, module);
|
|
406
|
+
}
|
|
407
|
+
resolveCachedModule(identifier) {
|
|
408
|
+
return this.moduleCache.get(identifier);
|
|
409
|
+
}
|
|
410
|
+
async createDataModule(identifier) {
|
|
411
|
+
const cached = this.moduleCache.get(identifier);
|
|
412
|
+
if (cached) return cached;
|
|
413
|
+
const match = identifier.match(dataURIRegex);
|
|
414
|
+
if (!match || !match.groups) throw new Error("Invalid data URI");
|
|
415
|
+
const mime = match.groups.mime;
|
|
416
|
+
const encoding = match.groups.encoding;
|
|
417
|
+
if (mime === "application/wasm") {
|
|
418
|
+
if (!encoding) throw new Error("Missing data URI encoding");
|
|
419
|
+
if (encoding !== "base64") throw new Error(`Invalid data URI encoding: ${encoding}`);
|
|
420
|
+
const module = this.loadWebAssemblyModule(Buffer.from(match.groups.code, "base64"), identifier);
|
|
421
|
+
this.moduleCache.set(identifier, module);
|
|
422
|
+
return module;
|
|
423
|
+
}
|
|
424
|
+
let code = match.groups.code;
|
|
425
|
+
if (!encoding || encoding === "charset=utf-8") code = decodeURIComponent(code);
|
|
426
|
+
else if (encoding === "base64") code = Buffer.from(code, "base64").toString();
|
|
427
|
+
else throw new Error(`Invalid data URI encoding: ${encoding}`);
|
|
428
|
+
if (mime === "application/json") {
|
|
429
|
+
const module = new SyntheticModule(["default"], function() {
|
|
430
|
+
const obj = JSON.parse(code);
|
|
431
|
+
this.setExport("default", obj);
|
|
432
|
+
}, {
|
|
433
|
+
context: this.context,
|
|
434
|
+
identifier
|
|
435
|
+
});
|
|
436
|
+
this.moduleCache.set(identifier, module);
|
|
437
|
+
return module;
|
|
438
|
+
}
|
|
439
|
+
return this.createEsModule(identifier, () => code);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function IPnumber(address) {
|
|
443
|
+
const ip = address.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/);
|
|
444
|
+
if (ip) return (+ip[1] << 24) + (+ip[2] << 16) + (+ip[3] << 8) + +ip[4];
|
|
445
|
+
throw new Error(`Expected IP address, received ${address}`);
|
|
446
|
+
}
|
|
447
|
+
function IPmask(maskSize) {
|
|
448
|
+
return -1 << 32 - maskSize;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const CLIENT_ID = "/@vite/client";
|
|
452
|
+
const CLIENT_FILE = pathToFileURL(CLIENT_ID).href;
|
|
453
|
+
class ViteExecutor {
|
|
454
|
+
esm;
|
|
455
|
+
constructor(options) {
|
|
456
|
+
this.options = options;
|
|
457
|
+
this.esm = options.esmExecutor;
|
|
458
|
+
}
|
|
459
|
+
resolve = (identifier, parent) => {
|
|
460
|
+
if (identifier === CLIENT_ID) {
|
|
461
|
+
if (this.workerState.environment.transformMode === "web") return identifier;
|
|
462
|
+
const packageName = this.getPackageName(parent);
|
|
463
|
+
throw new Error(`[vitest] Vitest cannot handle ${CLIENT_ID} imported in ${parent} when running in SSR environment. Add "${packageName}" to "ssr.noExternal" if you are using Vite SSR, or to "server.deps.inline" if you are using Vite Node.`);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
get workerState() {
|
|
467
|
+
return this.options.context.__vitest_worker__;
|
|
468
|
+
}
|
|
469
|
+
getPackageName(modulePath) {
|
|
470
|
+
const path = normalize(modulePath);
|
|
471
|
+
let name = path.split("/node_modules/").pop() || "";
|
|
472
|
+
if (name?.startsWith("@")) name = name.split("/").slice(0, 2).join("/");
|
|
473
|
+
else name = name.split("/")[0];
|
|
474
|
+
return name;
|
|
475
|
+
}
|
|
476
|
+
async createViteModule(fileUrl) {
|
|
477
|
+
if (fileUrl === CLIENT_FILE) return this.createViteClientModule();
|
|
478
|
+
const cached = this.esm.resolveCachedModule(fileUrl);
|
|
479
|
+
if (cached) return cached;
|
|
480
|
+
return this.esm.createEsModule(fileUrl, async () => {
|
|
481
|
+
try {
|
|
482
|
+
const result = await this.options.transform(fileUrl, "web");
|
|
483
|
+
if (result.code) return result.code;
|
|
484
|
+
} catch (cause) {
|
|
485
|
+
// rethrow vite error if it cannot load the module because it's not resolved
|
|
486
|
+
if (typeof cause === "object" && cause.code === "ERR_LOAD_URL" || typeof cause?.message === "string" && cause.message.includes("Failed to load url")) {
|
|
487
|
+
const error = new Error(`Cannot find module '${fileUrl}'`, { cause });
|
|
488
|
+
error.code = "ERR_MODULE_NOT_FOUND";
|
|
489
|
+
throw error;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
throw new Error(`[vitest] Failed to transform ${fileUrl}. Does the file exist?`);
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
createViteClientModule() {
|
|
496
|
+
const identifier = CLIENT_ID;
|
|
497
|
+
const cached = this.esm.resolveCachedModule(identifier);
|
|
498
|
+
if (cached) return cached;
|
|
499
|
+
const stub = this.options.viteClientModule;
|
|
500
|
+
const moduleKeys = Object.keys(stub);
|
|
501
|
+
const module = new SyntheticModule(moduleKeys, function() {
|
|
502
|
+
moduleKeys.forEach((key) => {
|
|
503
|
+
this.setExport(key, stub[key]);
|
|
504
|
+
});
|
|
505
|
+
}, {
|
|
506
|
+
context: this.options.context,
|
|
507
|
+
identifier
|
|
508
|
+
});
|
|
509
|
+
this.esm.cacheModule(identifier, module);
|
|
510
|
+
return module;
|
|
511
|
+
}
|
|
512
|
+
canResolve = (fileUrl) => {
|
|
513
|
+
const transformMode = this.workerState.environment.transformMode;
|
|
514
|
+
if (transformMode !== "web") return false;
|
|
515
|
+
if (fileUrl === CLIENT_FILE) return true;
|
|
516
|
+
const config = this.workerState.config.deps?.web || {};
|
|
517
|
+
const [modulePath] = fileUrl.split("?");
|
|
518
|
+
if (config.transformCss && CSS_LANGS_RE.test(modulePath)) return true;
|
|
519
|
+
if (config.transformAssets && KNOWN_ASSET_RE.test(modulePath)) return true;
|
|
520
|
+
if (toArray(config.transformGlobPattern).some((pattern) => pattern.test(modulePath))) return true;
|
|
521
|
+
return false;
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
const { existsSync, statSync } = fs;
|
|
526
|
+
// always defined when we use vm pool
|
|
527
|
+
const nativeResolve = import.meta.resolve;
|
|
528
|
+
// TODO: improve Node.js strict mode support in #2854
|
|
529
|
+
class ExternalModulesExecutor {
|
|
530
|
+
cjs;
|
|
531
|
+
esm;
|
|
532
|
+
vite;
|
|
533
|
+
context;
|
|
534
|
+
fs;
|
|
535
|
+
resolvers = [];
|
|
536
|
+
#networkSupported = null;
|
|
537
|
+
constructor(options) {
|
|
538
|
+
this.options = options;
|
|
539
|
+
this.context = options.context;
|
|
540
|
+
this.fs = options.fileMap;
|
|
541
|
+
this.esm = new EsmExecutor(this, { context: this.context });
|
|
542
|
+
this.cjs = new CommonjsExecutor({
|
|
543
|
+
context: this.context,
|
|
544
|
+
importModuleDynamically: this.importModuleDynamically,
|
|
545
|
+
fileMap: options.fileMap,
|
|
546
|
+
interopDefault: options.interopDefault
|
|
547
|
+
});
|
|
548
|
+
this.vite = new ViteExecutor({
|
|
549
|
+
esmExecutor: this.esm,
|
|
550
|
+
context: this.context,
|
|
551
|
+
transform: options.transform,
|
|
552
|
+
viteClientModule: options.viteClientModule
|
|
553
|
+
});
|
|
554
|
+
this.resolvers = [this.vite.resolve];
|
|
555
|
+
}
|
|
556
|
+
async import(identifier) {
|
|
557
|
+
const module = await this.createModule(identifier);
|
|
558
|
+
await this.esm.evaluateModule(module);
|
|
559
|
+
return module.namespace;
|
|
560
|
+
}
|
|
561
|
+
require(identifier) {
|
|
562
|
+
return this.cjs.require(identifier);
|
|
563
|
+
}
|
|
564
|
+
createRequire(identifier) {
|
|
565
|
+
return this.cjs.createRequire(identifier);
|
|
566
|
+
}
|
|
567
|
+
// dynamic import can be used in both ESM and CJS, so we have it in the executor
|
|
568
|
+
importModuleDynamically = async (specifier, referencer) => {
|
|
569
|
+
const module = await this.resolveModule(specifier, referencer.identifier);
|
|
570
|
+
return await this.esm.evaluateModule(module);
|
|
571
|
+
};
|
|
572
|
+
resolveModule = async (specifier, referencer) => {
|
|
573
|
+
let identifier = this.resolve(specifier, referencer);
|
|
574
|
+
if (identifier instanceof Promise) identifier = await identifier;
|
|
575
|
+
return await this.createModule(identifier);
|
|
576
|
+
};
|
|
577
|
+
resolve(specifier, parent) {
|
|
578
|
+
for (const resolver of this.resolvers) {
|
|
579
|
+
const id = resolver(specifier, parent);
|
|
580
|
+
if (id) return id;
|
|
581
|
+
}
|
|
582
|
+
// import.meta.resolve can be asynchronous in older +18 Node versions
|
|
583
|
+
return nativeResolve(specifier, parent);
|
|
584
|
+
}
|
|
585
|
+
findNearestPackageData(basedir) {
|
|
586
|
+
const originalBasedir = basedir;
|
|
587
|
+
const packageCache = this.options.packageCache;
|
|
588
|
+
while (basedir) {
|
|
589
|
+
const cached = getCachedData(packageCache, basedir, originalBasedir);
|
|
590
|
+
if (cached) return cached;
|
|
591
|
+
const pkgPath = join(basedir, "package.json");
|
|
592
|
+
try {
|
|
593
|
+
if (statSync(pkgPath, { throwIfNoEntry: false })?.isFile()) {
|
|
594
|
+
const pkgData = JSON.parse(this.fs.readFile(pkgPath));
|
|
595
|
+
if (packageCache) setCacheData(packageCache, pkgData, basedir, originalBasedir);
|
|
596
|
+
return pkgData;
|
|
597
|
+
}
|
|
598
|
+
} catch {}
|
|
599
|
+
const nextBasedir = dirname$1(basedir);
|
|
600
|
+
if (nextBasedir === basedir) break;
|
|
601
|
+
basedir = nextBasedir;
|
|
602
|
+
}
|
|
603
|
+
return {};
|
|
604
|
+
}
|
|
605
|
+
getModuleInformation(identifier) {
|
|
606
|
+
if (identifier.startsWith("data:")) return {
|
|
607
|
+
type: "data",
|
|
608
|
+
url: identifier,
|
|
609
|
+
path: identifier
|
|
610
|
+
};
|
|
611
|
+
const extension = extname(identifier);
|
|
612
|
+
if (extension === ".node" || isNodeBuiltin(identifier)) return {
|
|
613
|
+
type: "builtin",
|
|
614
|
+
url: identifier,
|
|
615
|
+
path: identifier
|
|
616
|
+
};
|
|
617
|
+
if (this.isNetworkSupported && (identifier.startsWith("http:") || identifier.startsWith("https:"))) return {
|
|
618
|
+
type: "network",
|
|
619
|
+
url: identifier,
|
|
620
|
+
path: identifier
|
|
621
|
+
};
|
|
622
|
+
const isFileUrl = identifier.startsWith("file://");
|
|
623
|
+
const pathUrl = isFileUrl ? fileURLToPath(identifier.split("?")[0]) : identifier;
|
|
624
|
+
const fileUrl = isFileUrl ? identifier : pathToFileURL(pathUrl).toString();
|
|
625
|
+
let type;
|
|
626
|
+
if (this.vite.canResolve(fileUrl)) type = "vite";
|
|
627
|
+
else if (extension === ".mjs") type = "module";
|
|
628
|
+
else if (extension === ".cjs") type = "commonjs";
|
|
629
|
+
else if (extension === ".wasm")
|
|
630
|
+
// still experimental on NodeJS --experimental-wasm-modules
|
|
631
|
+
// cf. ESM_FILE_FORMAT(url) in https://nodejs.org/docs/latest-v20.x/api/esm.html#resolution-algorithm
|
|
632
|
+
type = "wasm";
|
|
633
|
+
else {
|
|
634
|
+
const pkgData = this.findNearestPackageData(normalize(pathUrl));
|
|
635
|
+
type = pkgData.type === "module" ? "module" : "commonjs";
|
|
636
|
+
}
|
|
637
|
+
return {
|
|
638
|
+
type,
|
|
639
|
+
path: pathUrl,
|
|
640
|
+
url: fileUrl
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
createModule(identifier) {
|
|
644
|
+
const { type, url, path } = this.getModuleInformation(identifier);
|
|
645
|
+
// create ERR_MODULE_NOT_FOUND on our own since latest NodeJS's import.meta.resolve doesn't throw on non-existing namespace or path
|
|
646
|
+
// https://github.com/nodejs/node/pull/49038
|
|
647
|
+
if ((type === "module" || type === "commonjs" || type === "wasm") && !existsSync(path)) {
|
|
648
|
+
const error = new Error(`Cannot find ${isBareImport(path) ? "package" : "module"} '${path}'`);
|
|
649
|
+
error.code = "ERR_MODULE_NOT_FOUND";
|
|
650
|
+
throw error;
|
|
651
|
+
}
|
|
652
|
+
switch (type) {
|
|
653
|
+
case "data": return this.esm.createDataModule(identifier);
|
|
654
|
+
case "builtin": return this.cjs.getCoreSyntheticModule(identifier);
|
|
655
|
+
case "vite": return this.vite.createViteModule(url);
|
|
656
|
+
case "wasm": return this.esm.createWebAssemblyModule(url, () => this.fs.readBuffer(path));
|
|
657
|
+
case "module": return this.esm.createEsModule(url, () => this.fs.readFileAsync(path));
|
|
658
|
+
case "commonjs": return this.cjs.getCjsSyntheticModule(path, identifier);
|
|
659
|
+
case "network": return this.esm.createNetworkModule(url);
|
|
660
|
+
default: {
|
|
661
|
+
const _deadend = type;
|
|
662
|
+
return _deadend;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
get isNetworkSupported() {
|
|
667
|
+
if (this.#networkSupported == null) if (process.execArgv.includes("--experimental-network-imports")) this.#networkSupported = true;
|
|
668
|
+
else if (process.env.NODE_OPTIONS?.includes("--experimental-network-imports")) this.#networkSupported = true;
|
|
669
|
+
else this.#networkSupported = false;
|
|
670
|
+
return this.#networkSupported;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
const { promises, readFileSync } = fs;
|
|
675
|
+
class FileMap {
|
|
676
|
+
fsCache = /* @__PURE__ */ new Map();
|
|
677
|
+
fsBufferCache = /* @__PURE__ */ new Map();
|
|
678
|
+
async readFileAsync(path) {
|
|
679
|
+
const cached = this.fsCache.get(path);
|
|
680
|
+
if (cached != null) return cached;
|
|
681
|
+
const source = await promises.readFile(path, "utf-8");
|
|
682
|
+
this.fsCache.set(path, source);
|
|
683
|
+
return source;
|
|
684
|
+
}
|
|
685
|
+
readFile(path) {
|
|
686
|
+
const cached = this.fsCache.get(path);
|
|
687
|
+
if (cached != null) return cached;
|
|
688
|
+
const source = readFileSync(path, "utf-8");
|
|
689
|
+
this.fsCache.set(path, source);
|
|
690
|
+
return source;
|
|
691
|
+
}
|
|
692
|
+
readBuffer(path) {
|
|
693
|
+
const cached = this.fsBufferCache.get(path);
|
|
694
|
+
if (cached != null) return cached;
|
|
695
|
+
const buffer = readFileSync(path);
|
|
696
|
+
this.fsBufferCache.set(path, buffer);
|
|
697
|
+
return buffer;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const entryFile = pathToFileURL(resolve(distDir, "workers/runVmTests.js")).href;
|
|
702
|
+
const fileMap = new FileMap();
|
|
703
|
+
const packageCache = /* @__PURE__ */ new Map();
|
|
704
|
+
async function runVmTests(method, state) {
|
|
705
|
+
const { environment, ctx, rpc } = state;
|
|
706
|
+
if (!environment.setupVM) {
|
|
707
|
+
const envName = ctx.environment.name;
|
|
708
|
+
const packageId = envName[0] === "." ? envName : `vitest-environment-${envName}`;
|
|
709
|
+
throw new TypeError(`Environment "${ctx.environment.name}" is not a valid environment. Path "${packageId}" doesn't support vm environment because it doesn't provide "setupVM" method.`);
|
|
710
|
+
}
|
|
711
|
+
const vm = await environment.setupVM(ctx.environment.options || ctx.config.environmentOptions || {});
|
|
712
|
+
state.durations.environment = performance.now() - state.durations.environment;
|
|
713
|
+
process.env.VITEST_VM_POOL = "1";
|
|
714
|
+
if (!vm.getVmContext) throw new TypeError(`Environment ${environment.name} doesn't provide "getVmContext" method. It should return a context created by "vm.createContext" method.`);
|
|
715
|
+
const context = vm.getVmContext();
|
|
716
|
+
if (!isContext(context)) throw new TypeError(`Environment ${environment.name} doesn't provide a valid context. It should be created by "vm.createContext" method.`);
|
|
717
|
+
provideWorkerState(context, state);
|
|
718
|
+
// this is unfortunately needed for our own dependencies
|
|
719
|
+
// we need to find a way to not rely on this by default
|
|
720
|
+
// because browser doesn't provide these globals
|
|
721
|
+
context.process = process;
|
|
722
|
+
context.global = context;
|
|
723
|
+
context.console = state.config.disableConsoleIntercept ? console : createCustomConsole(state);
|
|
724
|
+
// TODO: don't hardcode setImmediate in fake timers defaults
|
|
725
|
+
context.setImmediate = setImmediate;
|
|
726
|
+
context.clearImmediate = clearImmediate;
|
|
727
|
+
const stubs = getDefaultRequestStubs(context);
|
|
728
|
+
const externalModulesExecutor = new ExternalModulesExecutor({
|
|
729
|
+
context,
|
|
730
|
+
fileMap,
|
|
731
|
+
packageCache,
|
|
732
|
+
transform: rpc.transform,
|
|
733
|
+
viteClientModule: stubs["/@vite/client"]
|
|
734
|
+
});
|
|
735
|
+
const executor = await startVitestExecutor({
|
|
736
|
+
context,
|
|
737
|
+
moduleCache: state.moduleCache,
|
|
738
|
+
state,
|
|
739
|
+
externalModulesExecutor,
|
|
740
|
+
requestStubs: stubs
|
|
741
|
+
});
|
|
742
|
+
context.__vitest_mocker__ = executor.mocker;
|
|
743
|
+
const { run } = await executor.importExternalModule(entryFile);
|
|
744
|
+
const fileSpecs = ctx.files.map((f) => typeof f === "string" ? {
|
|
745
|
+
filepath: f,
|
|
746
|
+
testLocations: void 0
|
|
747
|
+
} : f);
|
|
748
|
+
try {
|
|
749
|
+
await run(method, fileSpecs, ctx.config, executor);
|
|
750
|
+
} finally {
|
|
751
|
+
await vm.teardown?.();
|
|
752
|
+
state.environmentTeardownRun = true;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export { runVmTests as r };
|