@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,226 @@
|
|
|
1
|
+
// Minimal MCP client over Streamable HTTP.
|
|
2
|
+
//
|
|
3
|
+
// @playwright/mcp 0.x supports two transports: legacy SSE (GET /sse +
|
|
4
|
+
// POST /messages?sessionId=…) and the newer "Streamable HTTP" single
|
|
5
|
+
// endpoint (POST /mcp). We use the latter — it's a single round-trip
|
|
6
|
+
// per tool call and the server returns either a JSON body or an SSE
|
|
7
|
+
// stream we can read until the response message arrives.
|
|
8
|
+
//
|
|
9
|
+
// We don't pull in the official @modelcontextprotocol/sdk because:
|
|
10
|
+
// 1. it's ~150 KB pulled into the plugin bundle for what is, at
|
|
11
|
+
// this stage, four method calls (initialize, tools/list,
|
|
12
|
+
// tools/call, "notifications/initialized");
|
|
13
|
+
// 2. node:http reads SSE chunks in ~30 lines.
|
|
14
|
+
// If we end up calling more MCP servers we'll switch to the SDK.
|
|
15
|
+
//
|
|
16
|
+
// Why node:http and not Node's built-in fetch? Playwright MCP
|
|
17
|
+
// validates the Host request header against its bound address
|
|
18
|
+
// (default "localhost:<port>") and 403's mismatches with
|
|
19
|
+
// `Access is only allowed at localhost:<port>`. We're behind a
|
|
20
|
+
// per-tenant microsandbox port forward, so the upstream host
|
|
21
|
+
// (e.g. 127.0.0.1:58474) is never "localhost:3200". Setting
|
|
22
|
+
// `Host: localhost:3200` is the right answer — but Node's undici
|
|
23
|
+
// fetch implementation silently overrides any caller-supplied Host
|
|
24
|
+
// header with the URL's host (see undici's `Request` validation).
|
|
25
|
+
// node:http lets us set Host explicitly, so we use that. The MCP
|
|
26
|
+
// server itself can stay locked to localhost — no need to widen
|
|
27
|
+
// `--allowed-hosts` in the sandboxfile.
|
|
28
|
+
import { request as httpRequest } from "node:http";
|
|
29
|
+
const PROTOCOL_VERSION = "2025-06-18";
|
|
30
|
+
const CLIENT_INFO = { name: "tianshu-microsandbox", version: "0.1.0" };
|
|
31
|
+
export class McpClientError extends Error {
|
|
32
|
+
code;
|
|
33
|
+
constructor(message, code) {
|
|
34
|
+
super(message);
|
|
35
|
+
this.code = code;
|
|
36
|
+
this.name = "McpClientError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export class McpClient {
|
|
40
|
+
baseUrl;
|
|
41
|
+
timeoutMs;
|
|
42
|
+
sessionId = null;
|
|
43
|
+
nextId = 1;
|
|
44
|
+
initialised = false;
|
|
45
|
+
host;
|
|
46
|
+
port;
|
|
47
|
+
/** Host header to send. Always the MCP server's bound address
|
|
48
|
+
* inside the sandbox (default localhost:3200), regardless of
|
|
49
|
+
* whatever forwarded port we connect to from the host. */
|
|
50
|
+
hostHeader;
|
|
51
|
+
constructor(
|
|
52
|
+
/** e.g. http://localhost:6701 (no trailing slash). */
|
|
53
|
+
baseUrl,
|
|
54
|
+
/** Per-call request timeout. Default 30s. */
|
|
55
|
+
timeoutMs = 30_000,
|
|
56
|
+
/** Override the upstream MCP server's bound Host. Defaults to
|
|
57
|
+
* `localhost:3200` which is what the supervisord-managed
|
|
58
|
+
* Playwright MCP listens on inside browser.yaml's VM. */
|
|
59
|
+
upstreamHost = "localhost:3200") {
|
|
60
|
+
this.baseUrl = baseUrl;
|
|
61
|
+
this.timeoutMs = timeoutMs;
|
|
62
|
+
const u = new URL(baseUrl);
|
|
63
|
+
this.host = u.hostname;
|
|
64
|
+
this.port = u.port ? Number(u.port) : u.protocol === "https:" ? 443 : 80;
|
|
65
|
+
this.hostHeader = upstreamHost;
|
|
66
|
+
}
|
|
67
|
+
/** One-shot: open an MCP session, call a tool, close. Caller
|
|
68
|
+
* doesn't have to manage session lifecycle. */
|
|
69
|
+
async callTool(name, args) {
|
|
70
|
+
if (!this.initialised)
|
|
71
|
+
await this.initialise();
|
|
72
|
+
const result = await this.request("tools/call", {
|
|
73
|
+
name,
|
|
74
|
+
arguments: args,
|
|
75
|
+
});
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
/** Returns the registered tools advertised by the server. Mostly
|
|
79
|
+
* useful for diagnostics; the host already knows tool names from
|
|
80
|
+
* manifest contributions. */
|
|
81
|
+
async listTools() {
|
|
82
|
+
if (!this.initialised)
|
|
83
|
+
await this.initialise();
|
|
84
|
+
return this.request("tools/list", {});
|
|
85
|
+
}
|
|
86
|
+
// ─── internals ─────────────────────────────────────────────
|
|
87
|
+
async initialise() {
|
|
88
|
+
const init = await this.request("initialize", {
|
|
89
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
90
|
+
capabilities: { tools: {} },
|
|
91
|
+
clientInfo: CLIENT_INFO,
|
|
92
|
+
});
|
|
93
|
+
if (!init.protocolVersion) {
|
|
94
|
+
throw new McpClientError(`MCP initialize returned no protocolVersion: ${JSON.stringify(init)}`);
|
|
95
|
+
}
|
|
96
|
+
// Send the post-init notification (per MCP spec).
|
|
97
|
+
await this.notify("notifications/initialized", {});
|
|
98
|
+
this.initialised = true;
|
|
99
|
+
}
|
|
100
|
+
async request(method, params) {
|
|
101
|
+
const id = this.nextId++;
|
|
102
|
+
const body = { jsonrpc: "2.0", id, method, params };
|
|
103
|
+
const headers = {
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
Accept: "application/json, text/event-stream",
|
|
106
|
+
};
|
|
107
|
+
if (this.sessionId)
|
|
108
|
+
headers["Mcp-Session-Id"] = this.sessionId;
|
|
109
|
+
const { res, status, headers: respHeaders } = await this.send(headers, JSON.stringify(body));
|
|
110
|
+
if (status < 200 || status >= 300) {
|
|
111
|
+
const text = await drain(res).catch(() => "");
|
|
112
|
+
throw new McpClientError(`MCP HTTP ${status}: ${text.slice(0, 400)}`, status);
|
|
113
|
+
}
|
|
114
|
+
// Server returns Mcp-Session-Id on the initialize response.
|
|
115
|
+
const newSession = respHeaders["mcp-session-id"];
|
|
116
|
+
if (typeof newSession === "string")
|
|
117
|
+
this.sessionId = newSession;
|
|
118
|
+
const ct = (respHeaders["content-type"] ?? "");
|
|
119
|
+
let envelope;
|
|
120
|
+
if (ct.includes("text/event-stream")) {
|
|
121
|
+
envelope = await readJsonRpcFromSse(res, id);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const buf = await drain(res);
|
|
125
|
+
envelope = JSON.parse(buf);
|
|
126
|
+
}
|
|
127
|
+
if ("error" in envelope) {
|
|
128
|
+
throw new McpClientError(envelope.error.message, envelope.error.code);
|
|
129
|
+
}
|
|
130
|
+
return envelope.result;
|
|
131
|
+
}
|
|
132
|
+
async notify(method, params) {
|
|
133
|
+
const headers = {
|
|
134
|
+
"Content-Type": "application/json",
|
|
135
|
+
Accept: "application/json, text/event-stream",
|
|
136
|
+
};
|
|
137
|
+
if (this.sessionId)
|
|
138
|
+
headers["Mcp-Session-Id"] = this.sessionId;
|
|
139
|
+
// Notifications have no id, no response needed; we still wait
|
|
140
|
+
// for the HTTP 202/200 to make sure the server saw it before
|
|
141
|
+
// we send the next request.
|
|
142
|
+
const { res, status } = await this.send(headers, JSON.stringify({ jsonrpc: "2.0", method, params }));
|
|
143
|
+
if (status < 200 || status >= 300) {
|
|
144
|
+
const text = await drain(res).catch(() => "");
|
|
145
|
+
throw new McpClientError(`MCP notify HTTP ${status}: ${text.slice(0, 200)}`, status);
|
|
146
|
+
}
|
|
147
|
+
// Drain body so the connection can be reused.
|
|
148
|
+
await drain(res).catch(() => "");
|
|
149
|
+
}
|
|
150
|
+
/** Send a single POST to /mcp using node:http, with the Host
|
|
151
|
+
* header pinned to the upstream MCP's bound address. */
|
|
152
|
+
send(headers, body) {
|
|
153
|
+
return new Promise((resolve, reject) => {
|
|
154
|
+
const req = httpRequest({
|
|
155
|
+
host: this.host,
|
|
156
|
+
port: this.port,
|
|
157
|
+
path: "/mcp",
|
|
158
|
+
method: "POST",
|
|
159
|
+
headers: {
|
|
160
|
+
Host: this.hostHeader,
|
|
161
|
+
"Content-Length": Buffer.byteLength(body),
|
|
162
|
+
...headers,
|
|
163
|
+
},
|
|
164
|
+
}, (res) => {
|
|
165
|
+
resolve({
|
|
166
|
+
res,
|
|
167
|
+
status: res.statusCode ?? 0,
|
|
168
|
+
headers: res.headers,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
req.on("error", reject);
|
|
172
|
+
const timer = setTimeout(() => {
|
|
173
|
+
req.destroy(new Error(`MCP request timed out after ${this.timeoutMs}ms`));
|
|
174
|
+
}, this.timeoutMs);
|
|
175
|
+
req.on("close", () => clearTimeout(timer));
|
|
176
|
+
req.write(body);
|
|
177
|
+
req.end();
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function drain(res) {
|
|
182
|
+
const chunks = [];
|
|
183
|
+
for await (const chunk of res) {
|
|
184
|
+
chunks.push(typeof chunk === "string" ? Buffer.from(chunk) : chunk);
|
|
185
|
+
}
|
|
186
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Read an SSE stream and return the first jsonrpc envelope whose `id`
|
|
190
|
+
* matches the request we sent. The server may emit progress events
|
|
191
|
+
* (notifications/progress) before the final response; we skip those.
|
|
192
|
+
*/
|
|
193
|
+
async function readJsonRpcFromSse(res, expectId) {
|
|
194
|
+
let buf = "";
|
|
195
|
+
for await (const chunk of res) {
|
|
196
|
+
buf += typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
197
|
+
let blockEnd;
|
|
198
|
+
// eslint-disable-next-line no-cond-assign
|
|
199
|
+
while ((blockEnd = buf.indexOf("\n\n")) >= 0) {
|
|
200
|
+
const block = buf.slice(0, blockEnd);
|
|
201
|
+
buf = buf.slice(blockEnd + 2);
|
|
202
|
+
const dataLines = block
|
|
203
|
+
.split("\n")
|
|
204
|
+
.filter((l) => l.startsWith("data:"))
|
|
205
|
+
.map((l) => l.slice(5).trimStart());
|
|
206
|
+
if (dataLines.length === 0)
|
|
207
|
+
continue;
|
|
208
|
+
const payload = dataLines.join("\n");
|
|
209
|
+
try {
|
|
210
|
+
const env = JSON.parse(payload);
|
|
211
|
+
if (env.id === expectId) {
|
|
212
|
+
// Drop the connection so the server stops streaming.
|
|
213
|
+
res.destroy();
|
|
214
|
+
return env;
|
|
215
|
+
}
|
|
216
|
+
// Otherwise it's a notification (id missing) or another
|
|
217
|
+
// request we don't care about; keep reading.
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
// Malformed event; ignore and keep reading.
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
throw new McpClientError("MCP SSE stream ended before response arrived");
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=mcp-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-client.js","sourceRoot":"","sources":["../../src/tools/mcp-client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "microsandbox",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"displayName": "MicroSandbox",
|
|
5
|
+
"description": "Per-tenant shell sandbox running on microsandbox (Apple Virtualization.framework / KVM). Provides sandbox.shell + an opt-in browser.cdp sidecar (Stealth Chromium via CloakBrowser + Playwright MCP + noVNC; lit up by a follow-up PR).",
|
|
6
|
+
"author": "tianshu-ai",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"permissions": ["workspace.read", "workspace.write", "process.spawn"],
|
|
9
|
+
"provides": ["sandbox.shell", "sandbox.taskPool", "browser.cdp"],
|
|
10
|
+
"client": { "entry": "@tianshu-builtin/plugin-microsandbox/client" },
|
|
11
|
+
"server": { "entry": "@tianshu-builtin/plugin-microsandbox/server" },
|
|
12
|
+
"contributes": {
|
|
13
|
+
"topBarButtons": [
|
|
14
|
+
{
|
|
15
|
+
"id": "browser",
|
|
16
|
+
"icon": "Globe",
|
|
17
|
+
"tooltip": "Browser viewport (noVNC)",
|
|
18
|
+
"opensPanel": "microsandbox.browser",
|
|
19
|
+
"order": 210
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"rightPanels": [
|
|
23
|
+
{
|
|
24
|
+
"id": "browser",
|
|
25
|
+
"displayName": "Browser",
|
|
26
|
+
"component": "BrowserViewportPanel"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"adminPages": [
|
|
30
|
+
{
|
|
31
|
+
"id": "main",
|
|
32
|
+
"displayName": "Sandbox",
|
|
33
|
+
"icon": "Box",
|
|
34
|
+
"component": "MicroSandboxAdminPage",
|
|
35
|
+
"group": "Plugins",
|
|
36
|
+
"order": 100
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"sandboxes": [
|
|
40
|
+
{
|
|
41
|
+
"id": "main",
|
|
42
|
+
"kind": "shell",
|
|
43
|
+
"displayName": "MicroSandbox",
|
|
44
|
+
"module": "MicroSandboxRunner"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"tools": [
|
|
48
|
+
{ "id": "exec", "module": "ExecTool" },
|
|
49
|
+
{ "id": "reset_sandbox", "module": "ResetSandboxTool" },
|
|
50
|
+
{ "id": "get_sandbox_status", "module": "GetSandboxStatusTool" },
|
|
51
|
+
{ "id": "update_sandbox_config", "module": "UpdateSandboxConfigTool" },
|
|
52
|
+
{ "id": "build_sandbox", "module": "BuildSandboxTool" },
|
|
53
|
+
{ "id": "list_sandbox_builds", "module": "ListSandboxBuildsTool" },
|
|
54
|
+
{ "id": "use_sandbox_build", "module": "UseSandboxBuildTool" },
|
|
55
|
+
{ "id": "browser_health_check", "module": "BrowserHealthCheckTool" }
|
|
56
|
+
],
|
|
57
|
+
"toolsets": [
|
|
58
|
+
{ "id": "browser", "module": "BrowserToolset", "displayName": "Playwright (Browser)" }
|
|
59
|
+
],
|
|
60
|
+
"skills": [
|
|
61
|
+
{ "id": "exec-howto", "path": "skills/microsandbox-exec-howto.md" },
|
|
62
|
+
{ "id": "config", "path": "skills/microsandbox-config.md" },
|
|
63
|
+
{ "id": "build-use", "path": "skills/microsandbox-build-use.md" },
|
|
64
|
+
{ "id": "browser-howto", "path": "skills/microsandbox-browser-howto.md" },
|
|
65
|
+
{ "id": "libreoffice", "path": "skills/microsandbox-libreoffice.md" }
|
|
66
|
+
],
|
|
67
|
+
"systemPromptFragments": [
|
|
68
|
+
{
|
|
69
|
+
"id": "no-foreground-servers",
|
|
70
|
+
"text": "- Long-running servers (`python -m http.server`, `npm start`, `npm run dev`, anything that listens on a port and never returns) WILL hang the `exec` call until the host's per-call timeout fires (5 min default). Even with `nohup` alone the call hangs because microsandbox's exec channel waits for the started process tree's stdio to close, and nohup doesn't close stdin or detach from the controlling terminal.\n\n If you need to start a server, the ONLY safe pattern is:\n\n nohup setsid <cmd> > /tmp/srv.log 2>&1 < /dev/null &\n\n All four pieces are required: `setsid` puts the process in a new session (no controlling terminal); `< /dev/null` closes stdin; `>/tmp/srv.log 2>&1` redirects stdout AND stderr; trailing `&` puts it in the shell background. Skip any one and exec hangs.\n\n Then verify with `curl http://localhost:<port>/...` in a separate exec call. Don't background-then-curl in the same shell line \u2014 the shell process itself becomes the parent and won't exit."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "already-installed-runtimes",
|
|
74
|
+
"text": "- The sandbox already ships chromium (CDP 9222), Playwright MCP (3200), LibreOffice, Node 22, and Python 3.12. Don't `apt install` / `pip install` / `playwright install` what's already there."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "task-sandbox-is-ephemeral",
|
|
78
|
+
"text": "- If you are running as a workboard task worker (you have a workboard task id and your run will end with `task_complete`), the sandbox you `exec` in is per-task and gets stopped the moment the task terminates. Anything you nohup / setsid / disown into the background dies with the sandbox \u2014 don't try to leave servers / queues / cron jobs / file watchers running for someone else to consume. Run the work inline, capture its output to a file under your home, then `task_complete` with the file path.\n\n Concrete VERIFY-task pattern: if the deliverable is an HTML / PDF / image file and you want to confirm it renders, DON'T spin up `python -m http.server` to serve it. Either (a) use a Playwright MCP `browser_navigate` to `file:///workspace/users/<self>/projects/<slug>/report.html` directly (Playwright MCP is configured with `--allow-unrestricted-file-access`, so file:// URLs work), or (b) `cat` / `head` the file and inspect the structure inline, or (c) for charts, check the rendered file's size + that it contains expected canvas/svg/img markup (`grep -c '<canvas\\|<svg\\|<img' report.html`). Spinning up a transient http server adds a process that has to be cleanly torn down before task_complete, and the typical agent forgets the `setsid + </dev/null` pattern and hangs the run.\n\n Long-lived background services belong in a chat session (the long-lived sandbox there survives between turns), not in a task. Installed packages, files you wrote, and other on-disk state DO survive across attempts of the same task \u2014 only running processes don't."
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"apiRoutes": [
|
|
82
|
+
{ "method": "GET", "path": "/status", "handler": "status" },
|
|
83
|
+
{ "method": "GET", "path": "/sandboxfile", "handler": "getSandboxfile" },
|
|
84
|
+
{ "method": "PUT", "path": "/sandboxfile", "handler": "putSandboxfile" },
|
|
85
|
+
{ "method": "GET", "path": "/sandboxfile/templates", "handler": "getSandboxfileTemplates" },
|
|
86
|
+
{ "method": "GET", "path": "/builds", "handler": "getBuilds" },
|
|
87
|
+
{ "method": "POST", "path": "/builds", "handler": "postBuilds" },
|
|
88
|
+
{ "method": "POST", "path": "/builds/use", "handler": "postUseBuild" },
|
|
89
|
+
{ "method": "POST", "path": "/reset", "handler": "postReset" },
|
|
90
|
+
{ "method": "POST", "path": "/exec", "handler": "postExec" },
|
|
91
|
+
{ "method": "GET", "path": "/task-pool", "handler": "getTaskPool" },
|
|
92
|
+
{ "method": "POST", "path": "/task-pool/destroy", "handler": "postTaskPoolDestroy" },
|
|
93
|
+
{ "method": "GET", "path": "/browser/status", "handler": "getBrowserStatus" },
|
|
94
|
+
{ "method": "POST", "path": "/browser/restart", "handler": "postBrowserRestart" },
|
|
95
|
+
{ "method": "POST", "path": "/browser/resize", "handler": "postBrowserResize" }
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"configSchema": {
|
|
99
|
+
"fields": [
|
|
100
|
+
{
|
|
101
|
+
"key": "memoryMib",
|
|
102
|
+
"label": "Browser sandbox memory",
|
|
103
|
+
"kind": "number",
|
|
104
|
+
"unit": "MiB",
|
|
105
|
+
"min": 512,
|
|
106
|
+
"max": 65536,
|
|
107
|
+
"step": 512,
|
|
108
|
+
"default": 2048,
|
|
109
|
+
"description": "RAM allotted to the long-lived Browser sandbox VM. Increase to 8192+ MiB for browser-heavy workloads (chromium + Playwright MCP), 12288+ for build-time pip / npm of large stacks. Restart the sandbox (Reset) for the new value to take effect."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"key": "cpus",
|
|
113
|
+
"label": "Browser sandbox vCPU count",
|
|
114
|
+
"kind": "number",
|
|
115
|
+
"min": 1,
|
|
116
|
+
"max": 16,
|
|
117
|
+
"step": 1,
|
|
118
|
+
"default": 2,
|
|
119
|
+
"description": "Logical CPU count handed to the long-lived Browser sandbox VM. Reset the sandbox after changing."
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"key": "execTimeoutMs",
|
|
123
|
+
"label": "Per-exec timeout (Browser)",
|
|
124
|
+
"kind": "number",
|
|
125
|
+
"unit": "ms",
|
|
126
|
+
"min": 5000,
|
|
127
|
+
"max": 1800000,
|
|
128
|
+
"step": 5000,
|
|
129
|
+
"default": 300000,
|
|
130
|
+
"description": "Max wall-clock time for one Browser `exec` call before it's force-killed. Bump this for long-running installers; consider running them with `nohup setsid … &` instead."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"key": "taskMemoryMib",
|
|
134
|
+
"label": "Task sandbox memory",
|
|
135
|
+
"kind": "number",
|
|
136
|
+
"unit": "MiB",
|
|
137
|
+
"min": 512,
|
|
138
|
+
"max": 65536,
|
|
139
|
+
"step": 512,
|
|
140
|
+
"default": 2048,
|
|
141
|
+
"description": "RAM allotted to per-task sandbox VMs (forked from the Task snapshot). Set lower than the Browser value to fit more parallel tasks; raise it for tasks that need a heavy data-science stack. Effective on the next task acquire."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"key": "taskCpus",
|
|
145
|
+
"label": "Task sandbox vCPU count",
|
|
146
|
+
"kind": "number",
|
|
147
|
+
"min": 1,
|
|
148
|
+
"max": 16,
|
|
149
|
+
"step": 1,
|
|
150
|
+
"default": 2,
|
|
151
|
+
"description": "Logical CPU count handed to each per-task sandbox VM. Effective on the next task acquire."
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"key": "taskExecTimeoutMs",
|
|
155
|
+
"label": "Per-exec timeout (Task)",
|
|
156
|
+
"kind": "number",
|
|
157
|
+
"unit": "ms",
|
|
158
|
+
"min": 5000,
|
|
159
|
+
"max": 1800000,
|
|
160
|
+
"step": 5000,
|
|
161
|
+
"default": 300000,
|
|
162
|
+
"description": "Max wall-clock time for one Task `exec` call before it's force-killed. Per-task sandboxes typically run shorter, more focused commands than the Browser sandbox."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"key": "taskIdleShutdownMs",
|
|
166
|
+
"label": "Task sandbox idle shutdown",
|
|
167
|
+
"kind": "number",
|
|
168
|
+
"unit": "ms",
|
|
169
|
+
"min": 0,
|
|
170
|
+
"max": 86400000,
|
|
171
|
+
"step": 60000,
|
|
172
|
+
"default": 600000,
|
|
173
|
+
"description": "How long a task sandbox stays alive after its task ends before it's stopped. 0 = stop immediately on release. Higher values trade RAM for faster reuse when the same kind of task runs again soon."
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tianshu-builtin/plugin-microsandbox",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Per-tenant shell sandbox + browser sidecar driver for Tianshu (builtin plugin, ADR-0004 §9).",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/server.js",
|
|
8
|
+
"types": "./dist/server.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./server": {
|
|
11
|
+
"types": "./dist/server.d.ts",
|
|
12
|
+
"default": "./dist/server.js"
|
|
13
|
+
},
|
|
14
|
+
"./client": {
|
|
15
|
+
"types": "./dist/client.d.ts",
|
|
16
|
+
"default": "./dist/client.js"
|
|
17
|
+
},
|
|
18
|
+
"./manifest.json": "./manifest.json"
|
|
19
|
+
},
|
|
20
|
+
"files": ["dist", "src", "skills", "manifest.json"],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsc --watch --preserveWatchOutput",
|
|
24
|
+
"test": "vitest run --passWithNoTests"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@tianshu/plugin-sdk": "*",
|
|
28
|
+
"microsandbox": "^0.5.7"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^25.9.1",
|
|
32
|
+
"@types/react": "^19.2.17",
|
|
33
|
+
"lucide-react": "^1.17.0",
|
|
34
|
+
"react": "^19.0.0",
|
|
35
|
+
"typescript": "^6.0.3",
|
|
36
|
+
"vitest": "^4.1.6"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: microsandbox-browser-howto
|
|
3
|
+
description: How the embedded browser surface works — three agent tools (browser_navigate / browser_snapshot / browser_screenshot), when each is the right pick, and what to do when the tools are not yet available.
|
|
4
|
+
when:
|
|
5
|
+
toolPresent: browser_navigate
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The microsandbox plugin ships an embedded **Stealth Chromium**
|
|
9
|
+
(CloakBrowser) reachable through Playwright MCP, plus a noVNC
|
|
10
|
+
viewport in the admin Browser page. Three agent tools surface that
|
|
11
|
+
stack:
|
|
12
|
+
|
|
13
|
+
| Tool | Use when |
|
|
14
|
+
|------|----------|
|
|
15
|
+
| `browser_navigate(url)` | You need a real page render — JS, redirects, cookies. Equivalent to `page.goto()`. |
|
|
16
|
+
| `browser_snapshot()` | You want to *act on* the page next. Returns an accessibility tree (roles, names, refs). Cheap, structured, easy to reason about. |
|
|
17
|
+
| `browser_screenshot()` | You need pixels — visual diffing, vision-model prompting, sharing a screenshot back to the user. |
|
|
18
|
+
|
|
19
|
+
## Don't install another browser
|
|
20
|
+
|
|
21
|
+
The sandbox **already has** a chromium running on port 9222 (CDP),
|
|
22
|
+
a Playwright MCP server on 3200, and noVNC on 6080. You will
|
|
23
|
+
sometimes feel like reaching for `pip install playwright &&
|
|
24
|
+
playwright install chromium` or `npx playwright install` to do
|
|
25
|
+
your own scripted scrape — don't.
|
|
26
|
+
|
|
27
|
+
- `playwright install chromium` downloads ~200 MB to the sandbox
|
|
28
|
+
every time. The sandbox is ephemeral; the next reset throws
|
|
29
|
+
the download away. Network egress is restricted; the install
|
|
30
|
+
often hangs or 403s.
|
|
31
|
+
- A second chromium would race the first for `--user-data-dir`,
|
|
32
|
+
CDP port 9222, and X11 display :99.
|
|
33
|
+
- The MCP tools (`browser_navigate`, etc.) already cover the 90%
|
|
34
|
+
case more cheaply than a hand-rolled Playwright script.
|
|
35
|
+
|
|
36
|
+
Use the MCP tools first. If you genuinely need scripted control
|
|
37
|
+
(login flows with conditional logic, multi-step forms),
|
|
38
|
+
connect to the existing chromium via CDP from inside the sandbox
|
|
39
|
+
shell:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from playwright.sync_api import sync_playwright
|
|
43
|
+
with sync_playwright() as p:
|
|
44
|
+
# Reuse the already-running browser — no install step.
|
|
45
|
+
browser = p.chromium.connect_over_cdp("http://127.0.0.1:9222")
|
|
46
|
+
page = browser.contexts[0].new_page()
|
|
47
|
+
page.goto("https://example.com")
|
|
48
|
+
print(page.title())
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`pip install playwright` (the Python package) is fine — it's
|
|
52
|
+
small. **Skip the `playwright install` step**. You're connecting
|
|
53
|
+
to an existing browser, not launching a new one.
|
|
54
|
+
|
|
55
|
+
## Default workflow
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
1. browser_navigate("https://…")
|
|
59
|
+
2. browser_snapshot() # find the element to act on
|
|
60
|
+
3. browser_screenshot() # only if you need the picture
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Snapshots beat screenshots whenever the model needs to *interact*
|
|
64
|
+
or *extract*. Screenshots are best treated as a presentation
|
|
65
|
+
format, not a comprehension format.
|
|
66
|
+
|
|
67
|
+
## Tool availability
|
|
68
|
+
|
|
69
|
+
These tools are gated on the BrowserSidecar reporting a live
|
|
70
|
+
Playwright MCP port. If the chromium stack isn't built into the
|
|
71
|
+
tenant's Sandboxfile yet, the tools won't show up in your tool
|
|
72
|
+
list — there's no point trying to fall back to them.
|
|
73
|
+
|
|
74
|
+
If the user wants to use the browser:
|
|
75
|
+
|
|
76
|
+
1. They open `/admin/microsandbox/browser` and check **Status**.
|
|
77
|
+
2. If "not running", they edit the Sandboxfile (Sandbox admin
|
|
78
|
+
page) to include the browser layer (CloakBrowser + Xvfb +
|
|
79
|
+
x11vnc + noVNC + Playwright MCP), build, then `use & reset`.
|
|
80
|
+
3. Once the admin page reports `ready: true` with three live
|
|
81
|
+
ports, your tool list reloads and `browser_*` tools show up.
|
|
82
|
+
|
|
83
|
+
Don't tell the user "I'll navigate" before the tools are available
|
|
84
|
+
— the call will return a structured error and waste a turn.
|
|
85
|
+
|
|
86
|
+
## Coordinates and viewports
|
|
87
|
+
|
|
88
|
+
When the user has the admin Browser page open, the noVNC iframe
|
|
89
|
+
reports its size back to the host via a ResizeObserver, and that
|
|
90
|
+
viewport is reachable through `browser.cdp`'s `getLastViewport()`.
|
|
91
|
+
The browser tools auto-set Playwright's viewport from this before
|
|
92
|
+
each navigation, so screenshots match what the user sees.
|
|
93
|
+
|
|
94
|
+
If the user is **not** watching the page (no admin tab open), the
|
|
95
|
+
viewport falls back to `1280x800`. Don't write skills that
|
|
96
|
+
hard-code coordinates — they'll only work for one viewport.
|
|
97
|
+
|
|
98
|
+
## When the browser tools hang
|
|
99
|
+
|
|
100
|
+
If a `browser_*` call returns a confusing timeout / error, or
|
|
101
|
+
`exec` itself sticks (the symptom is "the conversation just
|
|
102
|
+
stops emitting tokens for 30+s"), call:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
browser_health_check()
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
It probes CDP `/json/version` with a 2.5s timeout and returns
|
|
109
|
+
`{ok, latencyMs, error?, suggestion?}`. The `suggestion` field
|
|
110
|
+
tells you the next concrete recovery step:
|
|
111
|
+
|
|
112
|
+
- **CDP host port not mapped**: the snapshot you booted doesn't
|
|
113
|
+
ship the browser stack. Build one that does (template
|
|
114
|
+
`browser.yaml`).
|
|
115
|
+
- **CDP not reachable / connect refused**: chromium or
|
|
116
|
+
supervisord crashed inside the guest. Try `browser_restart`
|
|
117
|
+
first (cheap, ~5s). If the next `browser_health_check` still
|
|
118
|
+
fails, escalate to `reset_sandbox`.
|
|
119
|
+
- **CDP probe timed out**: the sandbox VM itself is wedged.
|
|
120
|
+
Skip `browser_restart` (it'll hang too) and go straight to
|
|
121
|
+
`reset_sandbox`. Files under `/workspace` survive.
|
|
122
|
+
|
|
123
|
+
Don't loop the probe — call once, act on the suggestion, call
|
|
124
|
+
again only after attempting recovery.
|
|
125
|
+
|
|
126
|
+
## What NOT to do
|
|
127
|
+
|
|
128
|
+
- Don't `browser_navigate` to user input as a URL without
|
|
129
|
+
validating the scheme. Stick to `https://` for arbitrary user
|
|
130
|
+
input; if the user explicitly asks for a local resource (a
|
|
131
|
+
service running in the same sandbox), confirm `http://localhost`
|
|
132
|
+
is intended.
|
|
133
|
+
- Don't `browser_screenshot` without `browser_navigate` first —
|
|
134
|
+
the tool will return whatever the page state was, which may be
|
|
135
|
+
blank or the previous user's content.
|
|
136
|
+
- Don't paste large snapshot blobs back into the chat verbatim.
|
|
137
|
+
Summarise: "the page has a search box (ref=e3) and a list of 12
|
|
138
|
+
results (refs=e7..e18)" is much more useful than 4 KB of AX
|
|
139
|
+
JSON.
|
|
140
|
+
- Don't expect the embedded chromium to share cookies with the
|
|
141
|
+
user's host browser. Each sandbox has an isolated profile;
|
|
142
|
+
authenticated sessions need to be performed inside the sandbox
|
|
143
|
+
(e.g. via `browser_navigate` to a login URL the user trusts).
|
|
144
|
+
|
|
145
|
+
## Why CloakBrowser instead of stock Chromium
|
|
146
|
+
|
|
147
|
+
Stock headless chromium leaks several automation tells (navigator.
|
|
148
|
+
webdriver, headless UA, missing GPU/WebGL profile, abnormal
|
|
149
|
+
plugin/font lists). CloakBrowser patches those at the C++ source
|
|
150
|
+
level, so common bot-detection sites don't refuse the page. Same
|
|
151
|
+
Playwright API, drop-in `launch()` replacement.
|
|
152
|
+
|
|
153
|
+
This does **not** mean you can ignore site terms of service.
|
|
154
|
+
Realistic fingerprints help compatibility, not authorisation. If a
|
|
155
|
+
site's TOS forbids automated access, that's still a no.
|