@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,698 @@
|
|
|
1
|
+
import { s as __toESM } from "./chunks/chunk.js";
|
|
2
|
+
import { N as VERSION, R as require_picocolors, n as createLogger } from "./chunks/logger.js";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { performance } from "node:perf_hooks";
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
|
+
|
|
8
|
+
//#region ../../node_modules/.pnpm/cac@6.7.14/node_modules/cac/dist/index.mjs
|
|
9
|
+
function toArr(any) {
|
|
10
|
+
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
11
|
+
}
|
|
12
|
+
function toVal(out, key, val, opts) {
|
|
13
|
+
var x, old = out[key], nxt = !!~opts.string.indexOf(key) ? val == null || val === true ? "" : String(val) : typeof val === "boolean" ? val : !!~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x = +val, x * 0 === 0) ? x : val), !!val) : (x = +val, x * 0 === 0) ? x : val;
|
|
14
|
+
out[key] = old == null ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
|
|
15
|
+
}
|
|
16
|
+
function mri2(args, opts) {
|
|
17
|
+
args = args || [];
|
|
18
|
+
opts = opts || {};
|
|
19
|
+
var k, arr, arg, name, val, out = { _: [] };
|
|
20
|
+
var i = 0, j = 0, idx = 0, len = args.length;
|
|
21
|
+
const alibi = opts.alias !== void 0;
|
|
22
|
+
const strict = opts.unknown !== void 0;
|
|
23
|
+
const defaults = opts.default !== void 0;
|
|
24
|
+
opts.alias = opts.alias || {};
|
|
25
|
+
opts.string = toArr(opts.string);
|
|
26
|
+
opts.boolean = toArr(opts.boolean);
|
|
27
|
+
if (alibi) for (k in opts.alias) {
|
|
28
|
+
arr = opts.alias[k] = toArr(opts.alias[k]);
|
|
29
|
+
for (i = 0; i < arr.length; i++) (opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
|
30
|
+
}
|
|
31
|
+
for (i = opts.boolean.length; i-- > 0;) {
|
|
32
|
+
arr = opts.alias[opts.boolean[i]] || [];
|
|
33
|
+
for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
|
|
34
|
+
}
|
|
35
|
+
for (i = opts.string.length; i-- > 0;) {
|
|
36
|
+
arr = opts.alias[opts.string[i]] || [];
|
|
37
|
+
for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
|
|
38
|
+
}
|
|
39
|
+
if (defaults) for (k in opts.default) {
|
|
40
|
+
name = typeof opts.default[k];
|
|
41
|
+
arr = opts.alias[k] = opts.alias[k] || [];
|
|
42
|
+
if (opts[name] !== void 0) {
|
|
43
|
+
opts[name].push(k);
|
|
44
|
+
for (i = 0; i < arr.length; i++) opts[name].push(arr[i]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const keys = strict ? Object.keys(opts.alias) : [];
|
|
48
|
+
for (i = 0; i < len; i++) {
|
|
49
|
+
arg = args[i];
|
|
50
|
+
if (arg === "--") {
|
|
51
|
+
out._ = out._.concat(args.slice(++i));
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
for (j = 0; j < arg.length; j++) if (arg.charCodeAt(j) !== 45) break;
|
|
55
|
+
if (j === 0) out._.push(arg);
|
|
56
|
+
else if (arg.substring(j, j + 3) === "no-") {
|
|
57
|
+
name = arg.substring(j + 3);
|
|
58
|
+
if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
|
|
59
|
+
out[name] = false;
|
|
60
|
+
} else {
|
|
61
|
+
for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
|
|
62
|
+
name = arg.substring(j, idx);
|
|
63
|
+
val = arg.substring(++idx) || i + 1 === len || ("" + args[i + 1]).charCodeAt(0) === 45 || args[++i];
|
|
64
|
+
arr = j === 2 ? [name] : name;
|
|
65
|
+
for (idx = 0; idx < arr.length; idx++) {
|
|
66
|
+
name = arr[idx];
|
|
67
|
+
if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
|
|
68
|
+
toVal(out, name, idx + 1 < arr.length || val, opts);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (defaults) {
|
|
73
|
+
for (k in opts.default) if (out[k] === void 0) out[k] = opts.default[k];
|
|
74
|
+
}
|
|
75
|
+
if (alibi) for (k in out) {
|
|
76
|
+
arr = opts.alias[k] || [];
|
|
77
|
+
while (arr.length > 0) out[arr.shift()] = out[k];
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
const removeBrackets = (v) => v.replace(/[<[].+/, "").trim();
|
|
82
|
+
const findAllBrackets = (v) => {
|
|
83
|
+
const ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g;
|
|
84
|
+
const SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g;
|
|
85
|
+
const res = [];
|
|
86
|
+
const parse = (match) => {
|
|
87
|
+
let variadic = false;
|
|
88
|
+
let value = match[1];
|
|
89
|
+
if (value.startsWith("...")) {
|
|
90
|
+
value = value.slice(3);
|
|
91
|
+
variadic = true;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
required: match[0].startsWith("<"),
|
|
95
|
+
value,
|
|
96
|
+
variadic
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
let angledMatch;
|
|
100
|
+
while (angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v)) res.push(parse(angledMatch));
|
|
101
|
+
let squareMatch;
|
|
102
|
+
while (squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v)) res.push(parse(squareMatch));
|
|
103
|
+
return res;
|
|
104
|
+
};
|
|
105
|
+
const getMriOptions = (options) => {
|
|
106
|
+
const result = {
|
|
107
|
+
alias: {},
|
|
108
|
+
boolean: []
|
|
109
|
+
};
|
|
110
|
+
for (const [index, option] of options.entries()) {
|
|
111
|
+
if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
|
|
112
|
+
if (option.isBoolean) if (option.negated) {
|
|
113
|
+
if (!options.some((o, i) => {
|
|
114
|
+
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
|
115
|
+
})) result.boolean.push(option.names[0]);
|
|
116
|
+
} else result.boolean.push(option.names[0]);
|
|
117
|
+
}
|
|
118
|
+
return result;
|
|
119
|
+
};
|
|
120
|
+
const findLongest = (arr) => {
|
|
121
|
+
return arr.sort((a, b) => {
|
|
122
|
+
return a.length > b.length ? -1 : 1;
|
|
123
|
+
})[0];
|
|
124
|
+
};
|
|
125
|
+
const padRight = (str, length) => {
|
|
126
|
+
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
127
|
+
};
|
|
128
|
+
const camelcase = (input) => {
|
|
129
|
+
return input.replace(/([a-z])-([a-z])/g, (_, p1, p2) => {
|
|
130
|
+
return p1 + p2.toUpperCase();
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const setDotProp = (obj, keys, val) => {
|
|
134
|
+
let i = 0;
|
|
135
|
+
let length = keys.length;
|
|
136
|
+
let t = obj;
|
|
137
|
+
let x;
|
|
138
|
+
for (; i < length; ++i) {
|
|
139
|
+
x = t[keys[i]];
|
|
140
|
+
t = t[keys[i]] = i === length - 1 ? val : x != null ? x : !!~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const setByType = (obj, transforms) => {
|
|
144
|
+
for (const key of Object.keys(transforms)) {
|
|
145
|
+
const transform = transforms[key];
|
|
146
|
+
if (transform.shouldTransform) {
|
|
147
|
+
obj[key] = Array.prototype.concat.call([], obj[key]);
|
|
148
|
+
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const getFileName = (input) => {
|
|
153
|
+
const m = /([^\\\/]+)$/.exec(input);
|
|
154
|
+
return m ? m[1] : "";
|
|
155
|
+
};
|
|
156
|
+
const camelcaseOptionName = (name) => {
|
|
157
|
+
return name.split(".").map((v, i) => {
|
|
158
|
+
return i === 0 ? camelcase(v) : v;
|
|
159
|
+
}).join(".");
|
|
160
|
+
};
|
|
161
|
+
var CACError = class extends Error {
|
|
162
|
+
constructor(message) {
|
|
163
|
+
super(message);
|
|
164
|
+
this.name = this.constructor.name;
|
|
165
|
+
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, this.constructor);
|
|
166
|
+
else this.stack = new Error(message).stack;
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
var Option = class {
|
|
170
|
+
constructor(rawName, description, config) {
|
|
171
|
+
this.rawName = rawName;
|
|
172
|
+
this.description = description;
|
|
173
|
+
this.config = Object.assign({}, config);
|
|
174
|
+
rawName = rawName.replace(/\.\*/g, "");
|
|
175
|
+
this.negated = false;
|
|
176
|
+
this.names = removeBrackets(rawName).split(",").map((v) => {
|
|
177
|
+
let name = v.trim().replace(/^-{1,2}/, "");
|
|
178
|
+
if (name.startsWith("no-")) {
|
|
179
|
+
this.negated = true;
|
|
180
|
+
name = name.replace(/^no-/, "");
|
|
181
|
+
}
|
|
182
|
+
return camelcaseOptionName(name);
|
|
183
|
+
}).sort((a, b) => a.length > b.length ? 1 : -1);
|
|
184
|
+
this.name = this.names[this.names.length - 1];
|
|
185
|
+
if (this.negated && this.config.default == null) this.config.default = true;
|
|
186
|
+
if (rawName.includes("<")) this.required = true;
|
|
187
|
+
else if (rawName.includes("[")) this.required = false;
|
|
188
|
+
else this.isBoolean = true;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const processArgs = process.argv;
|
|
192
|
+
const platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
|
|
193
|
+
var Command = class {
|
|
194
|
+
constructor(rawName, description, config = {}, cli$1) {
|
|
195
|
+
this.rawName = rawName;
|
|
196
|
+
this.description = description;
|
|
197
|
+
this.config = config;
|
|
198
|
+
this.cli = cli$1;
|
|
199
|
+
this.options = [];
|
|
200
|
+
this.aliasNames = [];
|
|
201
|
+
this.name = removeBrackets(rawName);
|
|
202
|
+
this.args = findAllBrackets(rawName);
|
|
203
|
+
this.examples = [];
|
|
204
|
+
}
|
|
205
|
+
usage(text) {
|
|
206
|
+
this.usageText = text;
|
|
207
|
+
return this;
|
|
208
|
+
}
|
|
209
|
+
allowUnknownOptions() {
|
|
210
|
+
this.config.allowUnknownOptions = true;
|
|
211
|
+
return this;
|
|
212
|
+
}
|
|
213
|
+
ignoreOptionDefaultValue() {
|
|
214
|
+
this.config.ignoreOptionDefaultValue = true;
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
version(version, customFlags = "-v, --version") {
|
|
218
|
+
this.versionNumber = version;
|
|
219
|
+
this.option(customFlags, "Display version number");
|
|
220
|
+
return this;
|
|
221
|
+
}
|
|
222
|
+
example(example) {
|
|
223
|
+
this.examples.push(example);
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
option(rawName, description, config) {
|
|
227
|
+
const option = new Option(rawName, description, config);
|
|
228
|
+
this.options.push(option);
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
alias(name) {
|
|
232
|
+
this.aliasNames.push(name);
|
|
233
|
+
return this;
|
|
234
|
+
}
|
|
235
|
+
action(callback) {
|
|
236
|
+
this.commandAction = callback;
|
|
237
|
+
return this;
|
|
238
|
+
}
|
|
239
|
+
isMatched(name) {
|
|
240
|
+
return this.name === name || this.aliasNames.includes(name);
|
|
241
|
+
}
|
|
242
|
+
get isDefaultCommand() {
|
|
243
|
+
return this.name === "" || this.aliasNames.includes("!");
|
|
244
|
+
}
|
|
245
|
+
get isGlobalCommand() {
|
|
246
|
+
return this instanceof GlobalCommand;
|
|
247
|
+
}
|
|
248
|
+
hasOption(name) {
|
|
249
|
+
name = name.split(".")[0];
|
|
250
|
+
return this.options.find((option) => {
|
|
251
|
+
return option.names.includes(name);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
outputHelp() {
|
|
255
|
+
const { name, commands } = this.cli;
|
|
256
|
+
const { versionNumber, options: globalOptions, helpCallback } = this.cli.globalCommand;
|
|
257
|
+
let sections = [{ body: `${name}${versionNumber ? `/${versionNumber}` : ""}` }];
|
|
258
|
+
sections.push({
|
|
259
|
+
title: "Usage",
|
|
260
|
+
body: ` $ ${name} ${this.usageText || this.rawName}`
|
|
261
|
+
});
|
|
262
|
+
if ((this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0) {
|
|
263
|
+
const longestCommandName = findLongest(commands.map((command) => command.rawName));
|
|
264
|
+
sections.push({
|
|
265
|
+
title: "Commands",
|
|
266
|
+
body: commands.map((command) => {
|
|
267
|
+
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
|
|
268
|
+
}).join("\n")
|
|
269
|
+
});
|
|
270
|
+
sections.push({
|
|
271
|
+
title: `For more info, run any command with the \`--help\` flag`,
|
|
272
|
+
body: commands.map((command) => ` $ ${name}${command.name === "" ? "" : ` ${command.name}`} --help`).join("\n")
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...globalOptions || []];
|
|
276
|
+
if (!this.isGlobalCommand && !this.isDefaultCommand) options = options.filter((option) => option.name !== "version");
|
|
277
|
+
if (options.length > 0) {
|
|
278
|
+
const longestOptionName = findLongest(options.map((option) => option.rawName));
|
|
279
|
+
sections.push({
|
|
280
|
+
title: "Options",
|
|
281
|
+
body: options.map((option) => {
|
|
282
|
+
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === void 0 ? "" : `(default: ${option.config.default})`}`;
|
|
283
|
+
}).join("\n")
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
if (this.examples.length > 0) sections.push({
|
|
287
|
+
title: "Examples",
|
|
288
|
+
body: this.examples.map((example) => {
|
|
289
|
+
if (typeof example === "function") return example(name);
|
|
290
|
+
return example;
|
|
291
|
+
}).join("\n")
|
|
292
|
+
});
|
|
293
|
+
if (helpCallback) sections = helpCallback(sections) || sections;
|
|
294
|
+
console.log(sections.map((section) => {
|
|
295
|
+
return section.title ? `${section.title}:
|
|
296
|
+
${section.body}` : section.body;
|
|
297
|
+
}).join("\n\n"));
|
|
298
|
+
}
|
|
299
|
+
outputVersion() {
|
|
300
|
+
const { name } = this.cli;
|
|
301
|
+
const { versionNumber } = this.cli.globalCommand;
|
|
302
|
+
if (versionNumber) console.log(`${name}/${versionNumber} ${platformInfo}`);
|
|
303
|
+
}
|
|
304
|
+
checkRequiredArgs() {
|
|
305
|
+
const minimalArgsCount = this.args.filter((arg) => arg.required).length;
|
|
306
|
+
if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
|
|
307
|
+
}
|
|
308
|
+
checkUnknownOptions() {
|
|
309
|
+
const { options, globalCommand } = this.cli;
|
|
310
|
+
if (!this.config.allowUnknownOptions) {
|
|
311
|
+
for (const name of Object.keys(options)) if (name !== "--" && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
checkOptionValue() {
|
|
315
|
+
const { options: parsedOptions, globalCommand } = this.cli;
|
|
316
|
+
const options = [...globalCommand.options, ...this.options];
|
|
317
|
+
for (const option of options) {
|
|
318
|
+
const value = parsedOptions[option.name.split(".")[0]];
|
|
319
|
+
if (option.required) {
|
|
320
|
+
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
|
321
|
+
if (value === true || value === false && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
var GlobalCommand = class extends Command {
|
|
327
|
+
constructor(cli$1) {
|
|
328
|
+
super("@@global@@", "", {}, cli$1);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
var __assign = Object.assign;
|
|
332
|
+
var CAC = class extends EventEmitter {
|
|
333
|
+
constructor(name = "") {
|
|
334
|
+
super();
|
|
335
|
+
this.name = name;
|
|
336
|
+
this.commands = [];
|
|
337
|
+
this.rawArgs = [];
|
|
338
|
+
this.args = [];
|
|
339
|
+
this.options = {};
|
|
340
|
+
this.globalCommand = new GlobalCommand(this);
|
|
341
|
+
this.globalCommand.usage("<command> [options]");
|
|
342
|
+
}
|
|
343
|
+
usage(text) {
|
|
344
|
+
this.globalCommand.usage(text);
|
|
345
|
+
return this;
|
|
346
|
+
}
|
|
347
|
+
command(rawName, description, config) {
|
|
348
|
+
const command = new Command(rawName, description || "", config, this);
|
|
349
|
+
command.globalCommand = this.globalCommand;
|
|
350
|
+
this.commands.push(command);
|
|
351
|
+
return command;
|
|
352
|
+
}
|
|
353
|
+
option(rawName, description, config) {
|
|
354
|
+
this.globalCommand.option(rawName, description, config);
|
|
355
|
+
return this;
|
|
356
|
+
}
|
|
357
|
+
help(callback) {
|
|
358
|
+
this.globalCommand.option("-h, --help", "Display this message");
|
|
359
|
+
this.globalCommand.helpCallback = callback;
|
|
360
|
+
this.showHelpOnExit = true;
|
|
361
|
+
return this;
|
|
362
|
+
}
|
|
363
|
+
version(version, customFlags = "-v, --version") {
|
|
364
|
+
this.globalCommand.version(version, customFlags);
|
|
365
|
+
this.showVersionOnExit = true;
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
example(example) {
|
|
369
|
+
this.globalCommand.example(example);
|
|
370
|
+
return this;
|
|
371
|
+
}
|
|
372
|
+
outputHelp() {
|
|
373
|
+
if (this.matchedCommand) this.matchedCommand.outputHelp();
|
|
374
|
+
else this.globalCommand.outputHelp();
|
|
375
|
+
}
|
|
376
|
+
outputVersion() {
|
|
377
|
+
this.globalCommand.outputVersion();
|
|
378
|
+
}
|
|
379
|
+
setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
|
|
380
|
+
this.args = args;
|
|
381
|
+
this.options = options;
|
|
382
|
+
if (matchedCommand) this.matchedCommand = matchedCommand;
|
|
383
|
+
if (matchedCommandName) this.matchedCommandName = matchedCommandName;
|
|
384
|
+
return this;
|
|
385
|
+
}
|
|
386
|
+
unsetMatchedCommand() {
|
|
387
|
+
this.matchedCommand = void 0;
|
|
388
|
+
this.matchedCommandName = void 0;
|
|
389
|
+
}
|
|
390
|
+
parse(argv = processArgs, { run = true } = {}) {
|
|
391
|
+
this.rawArgs = argv;
|
|
392
|
+
if (!this.name) this.name = argv[1] ? getFileName(argv[1]) : "cli";
|
|
393
|
+
let shouldParse = true;
|
|
394
|
+
for (const command of this.commands) {
|
|
395
|
+
const parsed = this.mri(argv.slice(2), command);
|
|
396
|
+
const commandName = parsed.args[0];
|
|
397
|
+
if (command.isMatched(commandName)) {
|
|
398
|
+
shouldParse = false;
|
|
399
|
+
const parsedInfo = __assign(__assign({}, parsed), { args: parsed.args.slice(1) });
|
|
400
|
+
this.setParsedInfo(parsedInfo, command, commandName);
|
|
401
|
+
this.emit(`command:${commandName}`, command);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (shouldParse) {
|
|
405
|
+
for (const command of this.commands) if (command.name === "") {
|
|
406
|
+
shouldParse = false;
|
|
407
|
+
const parsed = this.mri(argv.slice(2), command);
|
|
408
|
+
this.setParsedInfo(parsed, command);
|
|
409
|
+
this.emit(`command:!`, command);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (shouldParse) {
|
|
413
|
+
const parsed = this.mri(argv.slice(2));
|
|
414
|
+
this.setParsedInfo(parsed);
|
|
415
|
+
}
|
|
416
|
+
if (this.options.help && this.showHelpOnExit) {
|
|
417
|
+
this.outputHelp();
|
|
418
|
+
run = false;
|
|
419
|
+
this.unsetMatchedCommand();
|
|
420
|
+
}
|
|
421
|
+
if (this.options.version && this.showVersionOnExit && this.matchedCommandName == null) {
|
|
422
|
+
this.outputVersion();
|
|
423
|
+
run = false;
|
|
424
|
+
this.unsetMatchedCommand();
|
|
425
|
+
}
|
|
426
|
+
const parsedArgv = {
|
|
427
|
+
args: this.args,
|
|
428
|
+
options: this.options
|
|
429
|
+
};
|
|
430
|
+
if (run) this.runMatchedCommand();
|
|
431
|
+
if (!this.matchedCommand && this.args[0]) this.emit("command:*");
|
|
432
|
+
return parsedArgv;
|
|
433
|
+
}
|
|
434
|
+
mri(argv, command) {
|
|
435
|
+
const cliOptions = [...this.globalCommand.options, ...command ? command.options : []];
|
|
436
|
+
const mriOptions = getMriOptions(cliOptions);
|
|
437
|
+
let argsAfterDoubleDashes = [];
|
|
438
|
+
const doubleDashesIndex = argv.indexOf("--");
|
|
439
|
+
if (doubleDashesIndex > -1) {
|
|
440
|
+
argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1);
|
|
441
|
+
argv = argv.slice(0, doubleDashesIndex);
|
|
442
|
+
}
|
|
443
|
+
let parsed = mri2(argv, mriOptions);
|
|
444
|
+
parsed = Object.keys(parsed).reduce((res, name) => {
|
|
445
|
+
return __assign(__assign({}, res), { [camelcaseOptionName(name)]: parsed[name] });
|
|
446
|
+
}, { _: [] });
|
|
447
|
+
const args = parsed._;
|
|
448
|
+
const options = { "--": argsAfterDoubleDashes };
|
|
449
|
+
const ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue;
|
|
450
|
+
let transforms = Object.create(null);
|
|
451
|
+
for (const cliOption of cliOptions) {
|
|
452
|
+
if (!ignoreDefault && cliOption.config.default !== void 0) for (const name of cliOption.names) options[name] = cliOption.config.default;
|
|
453
|
+
if (Array.isArray(cliOption.config.type)) {
|
|
454
|
+
if (transforms[cliOption.name] === void 0) {
|
|
455
|
+
transforms[cliOption.name] = Object.create(null);
|
|
456
|
+
transforms[cliOption.name]["shouldTransform"] = true;
|
|
457
|
+
transforms[cliOption.name]["transformFunction"] = cliOption.config.type[0];
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
for (const key of Object.keys(parsed)) if (key !== "_") {
|
|
462
|
+
setDotProp(options, key.split("."), parsed[key]);
|
|
463
|
+
setByType(options, transforms);
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
args,
|
|
467
|
+
options
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
runMatchedCommand() {
|
|
471
|
+
const { args, options, matchedCommand: command } = this;
|
|
472
|
+
if (!command || !command.commandAction) return;
|
|
473
|
+
command.checkUnknownOptions();
|
|
474
|
+
command.checkOptionValue();
|
|
475
|
+
command.checkRequiredArgs();
|
|
476
|
+
const actionArgs = [];
|
|
477
|
+
command.args.forEach((arg, index) => {
|
|
478
|
+
if (arg.variadic) actionArgs.push(args.slice(index));
|
|
479
|
+
else actionArgs.push(args[index]);
|
|
480
|
+
});
|
|
481
|
+
actionArgs.push(options);
|
|
482
|
+
return command.commandAction.apply(this, actionArgs);
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
const cac = (name = "") => new CAC(name);
|
|
486
|
+
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/node/cli.ts
|
|
489
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
490
|
+
function checkNodeVersion(nodeVersion) {
|
|
491
|
+
const currentVersion = nodeVersion.split(".");
|
|
492
|
+
const major = parseInt(currentVersion[0], 10);
|
|
493
|
+
const minor = parseInt(currentVersion[1], 10);
|
|
494
|
+
return major === 20 && minor >= 19 || major === 22 && minor >= 12 || major > 22;
|
|
495
|
+
}
|
|
496
|
+
if (!checkNodeVersion(process.versions.node)) console.warn(import_picocolors.default.yellow(`You are using Node.js ${process.versions.node}. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`));
|
|
497
|
+
const cli = cac("vite");
|
|
498
|
+
let profileSession = global.__vite_profile_session;
|
|
499
|
+
let profileCount = 0;
|
|
500
|
+
const stopProfiler = (log) => {
|
|
501
|
+
if (!profileSession) return;
|
|
502
|
+
return new Promise((res, rej) => {
|
|
503
|
+
profileSession.post("Profiler.stop", (err, { profile }) => {
|
|
504
|
+
if (!err) {
|
|
505
|
+
const outPath = path.resolve(`./vite-profile-${profileCount++}.cpuprofile`);
|
|
506
|
+
fs.writeFileSync(outPath, JSON.stringify(profile));
|
|
507
|
+
log(import_picocolors.default.yellow(`CPU profile written to ${import_picocolors.default.white(import_picocolors.default.dim(outPath))}`));
|
|
508
|
+
profileSession = void 0;
|
|
509
|
+
res();
|
|
510
|
+
} else rej(err);
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
const filterDuplicateOptions = (options) => {
|
|
515
|
+
for (const [key, value] of Object.entries(options)) if (Array.isArray(value)) options[key] = value[value.length - 1];
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* removing global flags before passing as command specific sub-configs
|
|
519
|
+
*/
|
|
520
|
+
function cleanGlobalCLIOptions(options) {
|
|
521
|
+
const ret = { ...options };
|
|
522
|
+
delete ret["--"];
|
|
523
|
+
delete ret.c;
|
|
524
|
+
delete ret.config;
|
|
525
|
+
delete ret.base;
|
|
526
|
+
delete ret.l;
|
|
527
|
+
delete ret.logLevel;
|
|
528
|
+
delete ret.clearScreen;
|
|
529
|
+
delete ret.configLoader;
|
|
530
|
+
delete ret.d;
|
|
531
|
+
delete ret.debug;
|
|
532
|
+
delete ret.f;
|
|
533
|
+
delete ret.filter;
|
|
534
|
+
delete ret.m;
|
|
535
|
+
delete ret.mode;
|
|
536
|
+
delete ret.force;
|
|
537
|
+
delete ret.w;
|
|
538
|
+
if ("sourcemap" in ret) {
|
|
539
|
+
const sourcemap = ret.sourcemap;
|
|
540
|
+
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
|
541
|
+
}
|
|
542
|
+
if ("watch" in ret) ret.watch = ret.watch ? {} : void 0;
|
|
543
|
+
return ret;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* removing builder flags before passing as command specific sub-configs
|
|
547
|
+
*/
|
|
548
|
+
function cleanBuilderCLIOptions(options) {
|
|
549
|
+
const ret = { ...options };
|
|
550
|
+
delete ret.app;
|
|
551
|
+
return ret;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* host may be a number (like 0), should convert to string
|
|
555
|
+
*/
|
|
556
|
+
const convertHost = (v) => {
|
|
557
|
+
if (typeof v === "number") return String(v);
|
|
558
|
+
return v;
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* base may be a number (like 0), should convert to empty string
|
|
562
|
+
*/
|
|
563
|
+
const convertBase = (v) => {
|
|
564
|
+
if (v === 0) return "";
|
|
565
|
+
return v;
|
|
566
|
+
};
|
|
567
|
+
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, { type: [convertBase] }).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("--configLoader <loader>", `[string] use 'bundle' to bundle the config with esbuild, or 'runner' (experimental) to process it on the fly, or 'native' (experimental) to load using the native runtime (default: bundle)`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
|
568
|
+
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
|
569
|
+
filterDuplicateOptions(options);
|
|
570
|
+
const { createServer } = await import("./chunks/server.js");
|
|
571
|
+
try {
|
|
572
|
+
const server = await createServer({
|
|
573
|
+
root,
|
|
574
|
+
base: options.base,
|
|
575
|
+
mode: options.mode,
|
|
576
|
+
configFile: options.config,
|
|
577
|
+
configLoader: options.configLoader,
|
|
578
|
+
logLevel: options.logLevel,
|
|
579
|
+
clearScreen: options.clearScreen,
|
|
580
|
+
server: cleanGlobalCLIOptions(options),
|
|
581
|
+
forceOptimizeDeps: options.force
|
|
582
|
+
});
|
|
583
|
+
if (!server.httpServer) throw new Error("HTTP server not available");
|
|
584
|
+
await server.listen();
|
|
585
|
+
const info = server.config.logger.info;
|
|
586
|
+
const modeString = options.mode && options.mode !== "development" ? ` ${import_picocolors.default.bgGreen(` ${import_picocolors.default.bold(options.mode)} `)}` : "";
|
|
587
|
+
const viteStartTime = global.__vite_start_time ?? false;
|
|
588
|
+
const startupDurationString = viteStartTime ? import_picocolors.default.dim(`ready in ${import_picocolors.default.reset(import_picocolors.default.bold(Math.ceil(performance.now() - viteStartTime)))} ms`) : "";
|
|
589
|
+
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
|
590
|
+
info(`\n ${import_picocolors.default.green(`${import_picocolors.default.bold("VITE")} v${VERSION}`)}${modeString} ${startupDurationString}\n`, { clear: !hasExistingLogs });
|
|
591
|
+
server.printUrls();
|
|
592
|
+
const customShortcuts = [];
|
|
593
|
+
if (profileSession) customShortcuts.push({
|
|
594
|
+
key: "p",
|
|
595
|
+
description: "start/stop the profiler",
|
|
596
|
+
async action(server$1) {
|
|
597
|
+
if (profileSession) await stopProfiler(server$1.config.logger.info);
|
|
598
|
+
else {
|
|
599
|
+
const inspector = await import("node:inspector").then((r) => r.default);
|
|
600
|
+
await new Promise((res) => {
|
|
601
|
+
profileSession = new inspector.Session();
|
|
602
|
+
profileSession.connect();
|
|
603
|
+
profileSession.post("Profiler.enable", () => {
|
|
604
|
+
profileSession.post("Profiler.start", () => {
|
|
605
|
+
server$1.config.logger.info("Profiler started");
|
|
606
|
+
res();
|
|
607
|
+
});
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
server.bindCLIShortcuts({
|
|
614
|
+
print: true,
|
|
615
|
+
customShortcuts
|
|
616
|
+
});
|
|
617
|
+
} catch (e) {
|
|
618
|
+
const logger = createLogger(options.logLevel);
|
|
619
|
+
logger.error(import_picocolors.default.red(`error when starting dev server:\n${e.stack}`), { error: e });
|
|
620
|
+
await stopProfiler(logger.info);
|
|
621
|
+
process.exit(1);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'baseline-widely-available')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("--assetsDir <dir>", `[string] directory under outDir to place assets in (default: assets)`).option("--assetsInlineLimit <number>", `[number] static asset base64 inline threshold in bytes (default: 4096)`).option("--ssr [entry]", `[string] build specified entry for server-side rendering`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(async (root, options) => {
|
|
625
|
+
filterDuplicateOptions(options);
|
|
626
|
+
const { createBuilder } = await import("./chunks/build.js");
|
|
627
|
+
const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
|
|
628
|
+
try {
|
|
629
|
+
await (await createBuilder({
|
|
630
|
+
root,
|
|
631
|
+
base: options.base,
|
|
632
|
+
mode: options.mode,
|
|
633
|
+
configFile: options.config,
|
|
634
|
+
configLoader: options.configLoader,
|
|
635
|
+
logLevel: options.logLevel,
|
|
636
|
+
clearScreen: options.clearScreen,
|
|
637
|
+
build: buildOptions,
|
|
638
|
+
...options.app ? { builder: {} } : {}
|
|
639
|
+
}, null)).buildApp();
|
|
640
|
+
} catch (e) {
|
|
641
|
+
createLogger(options.logLevel).error(import_picocolors.default.red(`error during build:\n${e.stack}`), { error: e });
|
|
642
|
+
process.exit(1);
|
|
643
|
+
} finally {
|
|
644
|
+
await stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
cli.command("optimize [root]", "pre-bundle dependencies (deprecated, the pre-bundle process runs automatically and does not need to be called)").option("--force", `[boolean] force the optimizer to ignore the cache and re-bundle`).action(async (root, options) => {
|
|
648
|
+
filterDuplicateOptions(options);
|
|
649
|
+
const { resolveConfig } = await import("./chunks/config2.js");
|
|
650
|
+
const { optimizeDeps } = await import("./chunks/optimizer.js");
|
|
651
|
+
try {
|
|
652
|
+
await optimizeDeps(await resolveConfig({
|
|
653
|
+
root,
|
|
654
|
+
base: options.base,
|
|
655
|
+
configFile: options.config,
|
|
656
|
+
configLoader: options.configLoader,
|
|
657
|
+
logLevel: options.logLevel,
|
|
658
|
+
mode: options.mode
|
|
659
|
+
}, "serve"), options.force, true);
|
|
660
|
+
} catch (e) {
|
|
661
|
+
createLogger(options.logLevel).error(import_picocolors.default.red(`error when optimizing deps:\n${e.stack}`), { error: e });
|
|
662
|
+
process.exit(1);
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(async (root, options) => {
|
|
666
|
+
filterDuplicateOptions(options);
|
|
667
|
+
const { preview } = await import("./chunks/preview.js");
|
|
668
|
+
try {
|
|
669
|
+
const server = await preview({
|
|
670
|
+
root,
|
|
671
|
+
base: options.base,
|
|
672
|
+
configFile: options.config,
|
|
673
|
+
configLoader: options.configLoader,
|
|
674
|
+
logLevel: options.logLevel,
|
|
675
|
+
mode: options.mode,
|
|
676
|
+
build: { outDir: options.outDir },
|
|
677
|
+
preview: {
|
|
678
|
+
port: options.port,
|
|
679
|
+
strictPort: options.strictPort,
|
|
680
|
+
host: options.host,
|
|
681
|
+
open: options.open
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
server.printUrls();
|
|
685
|
+
server.bindCLIShortcuts({ print: true });
|
|
686
|
+
} catch (e) {
|
|
687
|
+
createLogger(options.logLevel).error(import_picocolors.default.red(`error when starting preview server:\n${e.stack}`), { error: e });
|
|
688
|
+
process.exit(1);
|
|
689
|
+
} finally {
|
|
690
|
+
await stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
cli.help();
|
|
694
|
+
cli.version(VERSION);
|
|
695
|
+
cli.parse();
|
|
696
|
+
|
|
697
|
+
//#endregion
|
|
698
|
+
export { stopProfiler };
|