@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,627 @@
|
|
|
1
|
+
// HTTP surface for the plugin runtime: GET /plugins + PATCH /plugins/:id.
|
|
2
|
+
//
|
|
3
|
+
// Factored out of `index.ts` so integration tests can mount the
|
|
4
|
+
// router on a fresh Express app with a controllable home dir +
|
|
5
|
+
// resolver — no socket, no shutdown plumbing.
|
|
6
|
+
//
|
|
7
|
+
// Mounted by the host at `/api`, so the actual paths are
|
|
8
|
+
// `/api/plugins` and `/api/plugins/:id`.
|
|
9
|
+
import express, { Router } from "express";
|
|
10
|
+
import { loadTenantConfig, TenantConfigForbiddenFieldError, writeTenantConfig, } from "./core/index.js";
|
|
11
|
+
import { applyPluginSecretPatch, collectRoutesForTenant, loadPluginSecrets, redactSecretsInConfig, } from "./core/plugins/index.js";
|
|
12
|
+
const PLUGIN_ID_RE = /^[a-z0-9][a-z0-9-]{1,30}$/;
|
|
13
|
+
/** Compiles `"/agents/:id/reset"` once and caches it. Plugin
|
|
14
|
+
* manifests are bounded so the cache stays small. */
|
|
15
|
+
const pluginPathCache = new Map();
|
|
16
|
+
function compilePluginPath(declared) {
|
|
17
|
+
const cached = pluginPathCache.get(declared);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
const paramNames = [];
|
|
21
|
+
// Escape regex specials, then turn `:name` segments into capture
|
|
22
|
+
// groups. We restrict the capture to a single URL segment
|
|
23
|
+
// (`[A-Za-z0-9._~-]+`) so nested routes still work — a `/a/:id`
|
|
24
|
+
// pattern shouldn't swallow `/a/b/c`.
|
|
25
|
+
const escaped = declared
|
|
26
|
+
.replace(/[.+*?^${}()|[\]\\]/g, (c) => `\\${c}`)
|
|
27
|
+
.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g, (_m, name) => {
|
|
28
|
+
paramNames.push(name);
|
|
29
|
+
return "([A-Za-z0-9._~-]+)";
|
|
30
|
+
});
|
|
31
|
+
const re = new RegExp(`^${escaped}$`);
|
|
32
|
+
const compiled = { re, paramNames };
|
|
33
|
+
pluginPathCache.set(declared, compiled);
|
|
34
|
+
return compiled;
|
|
35
|
+
}
|
|
36
|
+
/** Match `subPath` against a declared route path. Returns the
|
|
37
|
+
* param map (possibly empty) on success, or null on miss. */
|
|
38
|
+
function matchPluginPath(declared, subPath) {
|
|
39
|
+
const { re, paramNames } = compilePluginPath(declared);
|
|
40
|
+
const m = re.exec(subPath);
|
|
41
|
+
if (!m)
|
|
42
|
+
return null;
|
|
43
|
+
const out = {};
|
|
44
|
+
for (let i = 0; i < paramNames.length; i++) {
|
|
45
|
+
const v = m[i + 1];
|
|
46
|
+
if (v !== undefined) {
|
|
47
|
+
out[paramNames[i]] = decodeURIComponent(v);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds an Express router exposing `/plugins` (GET) and
|
|
54
|
+
* `/plugins/:id` (PATCH). Mount it where you want it, e.g.
|
|
55
|
+
* app.use("/api", buildPluginsRouter({ registry, ops }));
|
|
56
|
+
*/
|
|
57
|
+
export function buildPluginsRouter(opts) {
|
|
58
|
+
const { registry, ops, catalog } = opts;
|
|
59
|
+
const r = Router();
|
|
60
|
+
// Plugin-contributed API routes are dispatched per-request so that
|
|
61
|
+
// (a) we don't have to mount-once at boot (tenants are lazy) and
|
|
62
|
+
// (b) enabling/disabling a plugin takes effect on the next request
|
|
63
|
+
// without re-mounting Express. Manifest contracts:
|
|
64
|
+
// - declared path "/foo" → /api/p/<plugin-id>/foo
|
|
65
|
+
// - declared path "/foo/:id" → /api/p/<plugin-id>/foo/<anything>
|
|
66
|
+
// and `:id` is exposed in
|
|
67
|
+
// req.params.id at handler
|
|
68
|
+
// time.
|
|
69
|
+
// Path params accept `[A-Za-z0-9._~-]+` (one URL segment, no
|
|
70
|
+
// slashes) which matches Express's default behaviour closely
|
|
71
|
+
// enough for our handful of CRUD-style routes.
|
|
72
|
+
r.use("/p/:pluginId", async (req, res, next) => {
|
|
73
|
+
if (!req.ctx) {
|
|
74
|
+
res.status(500).json({ error: "no_ctx" });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const pluginId = req.params.pluginId;
|
|
78
|
+
if (!PLUGIN_ID_RE.test(pluginId)) {
|
|
79
|
+
res.status(404).json({ error: "plugin_not_found" });
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
await registry.ensureForTenant(req.ctx.tenant);
|
|
84
|
+
const routes = collectRoutesForTenant(registry, req.ctx.tenant.tenantId);
|
|
85
|
+
const subPath = req.path.length === 0 || req.path === "/" ? "/" : req.path;
|
|
86
|
+
let match = null;
|
|
87
|
+
let matchedParams = null;
|
|
88
|
+
for (const rt of routes) {
|
|
89
|
+
if (rt.pluginId !== pluginId || rt.method !== req.method)
|
|
90
|
+
continue;
|
|
91
|
+
const params = matchPluginPath(rt.path, subPath);
|
|
92
|
+
if (params) {
|
|
93
|
+
match = rt;
|
|
94
|
+
matchedParams = params;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!match) {
|
|
99
|
+
res.status(404).json({ error: "plugin_route_not_found", pluginId, path: subPath });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Express has already populated `req.params.pluginId` for the
|
|
103
|
+
// outer mount; fold the inner route's params on top so the
|
|
104
|
+
// handler sees them.
|
|
105
|
+
if (matchedParams) {
|
|
106
|
+
Object.assign(req.params, matchedParams);
|
|
107
|
+
}
|
|
108
|
+
await match.handler(req, res);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
next(err);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
// Catalog endpoints. Mounted before /plugins/:id so the static
|
|
115
|
+
// segment wins over the param route in Express's router order.
|
|
116
|
+
if (catalog) {
|
|
117
|
+
r.get("/plugins/catalog", async (_req, res, next) => {
|
|
118
|
+
try {
|
|
119
|
+
const snap = await catalog.get();
|
|
120
|
+
res.json(snap);
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
next(err);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
r.post("/plugins/catalog/refresh", async (_req, res, next) => {
|
|
127
|
+
try {
|
|
128
|
+
catalog.invalidate();
|
|
129
|
+
const snap = await catalog.get({ force: true });
|
|
130
|
+
res.json(snap);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
next(err);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
r.get("/plugins", async (req, res, next) => {
|
|
138
|
+
if (!req.ctx) {
|
|
139
|
+
res.status(500).json({ error: "no_ctx" });
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const list = await listPluginsForTenant(registry, req.ctx.tenant);
|
|
144
|
+
res.json({ plugins: list });
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
next(err);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
// ─── MCP servers view (host-owned) ──────────────────────────
|
|
151
|
+
//
|
|
152
|
+
// GET /api/mcp/servers — list every MCP server visible to the
|
|
153
|
+
// tenant. Each entry has `source:
|
|
154
|
+
// "plugin" | "user"` so the admin UI
|
|
155
|
+
// can group + decide what's editable.
|
|
156
|
+
// POST /api/mcp/servers — add a user-owned server. Body:
|
|
157
|
+
// { id, url, displayName?, prefix?,
|
|
158
|
+
// upstreamHost?, enabled? }.
|
|
159
|
+
// PATCH /api/mcp/servers/:id — update a user-owned server.
|
|
160
|
+
// Plugin-owned ids reject 403.
|
|
161
|
+
// DELETE /api/mcp/servers/:id — remove a user-owned server.
|
|
162
|
+
//
|
|
163
|
+
// Plugin-owned toolsets are read-only here — the admin UI tells
|
|
164
|
+
// the user to enable/disable the owning plugin instead.
|
|
165
|
+
r.get("/mcp/servers", async (req, res, next) => {
|
|
166
|
+
if (!req.ctx) {
|
|
167
|
+
res.status(500).json({ error: "no_ctx" });
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
await registry.ensureForTenant(req.ctx.tenant);
|
|
172
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
173
|
+
// Opportunistic refresh of stale entries: the toolset list
|
|
174
|
+
// we get back may be empty / errored because the upstream
|
|
175
|
+
// (e.g. sandbox MCP server) wasn't reachable at activate
|
|
176
|
+
// time. Re-probe in parallel, capped by a short deadline so
|
|
177
|
+
// the page render isn't blocked indefinitely. Anything that
|
|
178
|
+
// fails again surfaces with `lastError`.
|
|
179
|
+
const refreshed = await registry.refreshStaleToolsets(tenantId, 4000);
|
|
180
|
+
void refreshed;
|
|
181
|
+
res.json({ servers: registry.toolsetsForTenant(tenantId) });
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
next(err);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
r.post("/mcp/servers", express.json(), async (req, res, next) => {
|
|
188
|
+
if (!req.ctx) {
|
|
189
|
+
res.status(500).json({ error: "no_ctx" });
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (!opts.mcpManager) {
|
|
193
|
+
res.status(503).json({ error: "mcp_manager_unavailable" });
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
const entry = parseUserEntry(req.body, { existingId: undefined });
|
|
198
|
+
if ("error" in entry) {
|
|
199
|
+
res.status(400).json(entry);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
203
|
+
const cfg = loadTenantConfig(tenantId, ops.homeDir);
|
|
204
|
+
const servers = [...(cfg.mcp?.servers ?? [])];
|
|
205
|
+
if (servers.some((s) => s.id === entry.value.id)) {
|
|
206
|
+
res.status(409).json({ error: "id_in_use", id: entry.value.id });
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
servers.push(entry.value);
|
|
210
|
+
writeTenantConfig(tenantId, { ...cfg, mcp: { ...(cfg.mcp ?? {}), servers } }, ops.homeDir);
|
|
211
|
+
opts.mcpManager.reload(tenantId);
|
|
212
|
+
const tsets = registry.toolsetsForTenant(tenantId);
|
|
213
|
+
res.json({ servers: tsets });
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
if (err instanceof TenantConfigForbiddenFieldError) {
|
|
217
|
+
res.status(400).json({ error: "forbidden_field", message: err.message });
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
next(err);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
r.patch("/mcp/servers/:id", express.json(), async (req, res, next) => {
|
|
224
|
+
if (!req.ctx) {
|
|
225
|
+
res.status(500).json({ error: "no_ctx" });
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (!opts.mcpManager) {
|
|
229
|
+
res.status(503).json({ error: "mcp_manager_unavailable" });
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
try {
|
|
233
|
+
const id = req.params.id;
|
|
234
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
235
|
+
const cfg = loadTenantConfig(tenantId, ops.homeDir);
|
|
236
|
+
const servers = [...(cfg.mcp?.servers ?? [])];
|
|
237
|
+
const idx = servers.findIndex((s) => s.id === id);
|
|
238
|
+
if (idx === -1) {
|
|
239
|
+
res.status(404).json({ error: "server_not_found", id });
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const merged = parseUserEntry({ ...servers[idx], ...req.body, id }, { existingId: id });
|
|
243
|
+
if ("error" in merged) {
|
|
244
|
+
res.status(400).json(merged);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
servers[idx] = merged.value;
|
|
248
|
+
writeTenantConfig(tenantId, { ...cfg, mcp: { ...(cfg.mcp ?? {}), servers } }, ops.homeDir);
|
|
249
|
+
opts.mcpManager.reload(tenantId);
|
|
250
|
+
const tsets = registry.toolsetsForTenant(tenantId);
|
|
251
|
+
res.json({ servers: tsets });
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
next(err);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
r.delete("/mcp/servers/:id", async (req, res, next) => {
|
|
258
|
+
if (!req.ctx) {
|
|
259
|
+
res.status(500).json({ error: "no_ctx" });
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (!opts.mcpManager) {
|
|
263
|
+
res.status(503).json({ error: "mcp_manager_unavailable" });
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
try {
|
|
267
|
+
const id = req.params.id;
|
|
268
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
269
|
+
const cfg = loadTenantConfig(tenantId, ops.homeDir);
|
|
270
|
+
const servers = (cfg.mcp?.servers ?? []).filter((s) => s.id !== id);
|
|
271
|
+
writeTenantConfig(tenantId, { ...cfg, mcp: { ...(cfg.mcp ?? {}), servers } }, ops.homeDir);
|
|
272
|
+
opts.mcpManager.reload(tenantId);
|
|
273
|
+
const tsets = registry.toolsetsForTenant(tenantId);
|
|
274
|
+
res.json({ servers: tsets });
|
|
275
|
+
}
|
|
276
|
+
catch (err) {
|
|
277
|
+
next(err);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
// Force a refresh on one toolset for this tenant. Works for
|
|
281
|
+
// both user-configured and plugin-contributed servers — the
|
|
282
|
+
// admin UI doesn't know (or care) which is which, only that a
|
|
283
|
+
// "Refresh" click should re-probe the upstream.
|
|
284
|
+
r.post("/mcp/servers/:id/refresh", async (req, res, next) => {
|
|
285
|
+
if (!req.ctx) {
|
|
286
|
+
res.status(500).json({ error: "no_ctx" });
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
try {
|
|
290
|
+
await registry.ensureForTenant(req.ctx.tenant);
|
|
291
|
+
const id = req.params.id;
|
|
292
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
293
|
+
const tsets = registry.toolsetsForTenant(tenantId);
|
|
294
|
+
const target = tsets.find((t) => t.id === id);
|
|
295
|
+
if (!target) {
|
|
296
|
+
res.status(404).json({ error: "server_not_found", id });
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const provider = registry.toolsetProviderFor(target, tenantId);
|
|
300
|
+
const refreshFn = provider
|
|
301
|
+
?.refresh;
|
|
302
|
+
if (typeof refreshFn === "function") {
|
|
303
|
+
await refreshFn.call(provider);
|
|
304
|
+
}
|
|
305
|
+
const fresh = registry.toolsetsForTenant(tenantId);
|
|
306
|
+
res.json({ servers: fresh });
|
|
307
|
+
}
|
|
308
|
+
catch (err) {
|
|
309
|
+
next(err);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
// ADR-0004 §16: explicit re-discovery. Useful after a manual
|
|
313
|
+
// catalog install, a `git pull` that adds a new builtin in dev, or
|
|
314
|
+
// any time the on-disk plugin set changed without a config edit.
|
|
315
|
+
// PATCH /plugins/:id already invalidates the registry; this route
|
|
316
|
+
// is for the no-config-change case.
|
|
317
|
+
r.post("/plugins/refresh", async (req, res, next) => {
|
|
318
|
+
if (!req.ctx) {
|
|
319
|
+
res.status(500).json({ error: "no_ctx" });
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
// Re-scan the builtins directory before invalidating the
|
|
324
|
+
// tenant registry, so a freshly-dropped plugin is reachable
|
|
325
|
+
// by `server.entry` lookups when the next ensureForTenant()
|
|
326
|
+
// re-activates everything.
|
|
327
|
+
if (opts.reloadResolver) {
|
|
328
|
+
await opts.reloadResolver();
|
|
329
|
+
}
|
|
330
|
+
// Await deactivate() so refreshing the plugin list while a
|
|
331
|
+
// sandbox VM is running tears it down before the next
|
|
332
|
+
// ensureForTenant brings up a fresh one.
|
|
333
|
+
await registry.invalidate(req.ctx.tenant.tenantId);
|
|
334
|
+
const fresh = ops.open(req.ctx.tenant.tenantId);
|
|
335
|
+
const list = await listPluginsForTenant(registry, fresh);
|
|
336
|
+
res.json({ plugins: list });
|
|
337
|
+
}
|
|
338
|
+
catch (err) {
|
|
339
|
+
next(err);
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
r.patch("/plugins/:id", express.json(), async (req, res, next) => {
|
|
343
|
+
if (!req.ctx) {
|
|
344
|
+
res.status(500).json({ error: "no_ctx" });
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const pluginId = req.params.id;
|
|
348
|
+
if (!PLUGIN_ID_RE.test(pluginId)) {
|
|
349
|
+
res.status(400).json({ error: "bad_plugin_id" });
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const body = req.body;
|
|
353
|
+
if (!body) {
|
|
354
|
+
res.status(400).json({ error: "empty_body" });
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const hasEnabled = typeof body.enabled === "boolean";
|
|
358
|
+
const hasConfig = body.config !== undefined &&
|
|
359
|
+
body.config !== null &&
|
|
360
|
+
typeof body.config === "object" &&
|
|
361
|
+
!Array.isArray(body.config);
|
|
362
|
+
if (!hasEnabled && !hasConfig) {
|
|
363
|
+
res.status(400).json({
|
|
364
|
+
error: "missing_enabled_or_config",
|
|
365
|
+
message: "PATCH body must include `enabled: boolean` and/or `config: object`",
|
|
366
|
+
});
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
const tenantId = req.ctx.tenant.tenantId;
|
|
371
|
+
// Refuse to enable plugins we can't see at all (not on disk in
|
|
372
|
+
// builtin or tenant). Disable is allowed even for unknown ids —
|
|
373
|
+
// it's harmless and lets users prune stale entries from config.
|
|
374
|
+
await registry.ensureForTenant(req.ctx.tenant);
|
|
375
|
+
const knownEntry = registry
|
|
376
|
+
.listForTenant(tenantId)
|
|
377
|
+
.find((e) => e.manifest.id === pluginId);
|
|
378
|
+
if (hasEnabled && body.enabled === true && !knownEntry) {
|
|
379
|
+
res.status(404).json({ error: "plugin_not_found", pluginId });
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (hasConfig && !knownEntry) {
|
|
383
|
+
res.status(404).json({ error: "plugin_not_found", pluginId });
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
// Capture the previous state BEFORE we mutate so we can
|
|
387
|
+
// diff for the plugins_changed notification below.
|
|
388
|
+
const wasEnabled = knownEntry?.state === "active";
|
|
389
|
+
const willEnabled = hasEnabled
|
|
390
|
+
? body.enabled
|
|
391
|
+
: wasEnabled;
|
|
392
|
+
// Split the incoming config into (a) cleartext fields, kept
|
|
393
|
+
// in tenant config.json, and (b) secret fields, sliced out
|
|
394
|
+
// and persisted under <tenant>/secrets/plugin-<id>.json.
|
|
395
|
+
// The split is driven by the manifest's configSchema: a
|
|
396
|
+
// field with kind="secret" goes to secrets/, everything
|
|
397
|
+
// else stays in config.json. Without a schema (no fields
|
|
398
|
+
// declared) the body lands wholesale in config.json —
|
|
399
|
+
// legacy plugins keep working unchanged.
|
|
400
|
+
let plainConfig;
|
|
401
|
+
let secretPatch;
|
|
402
|
+
if (hasConfig) {
|
|
403
|
+
const fields = knownEntry?.manifest.configSchema?.fields ?? [];
|
|
404
|
+
const secretKeys = new Set(fields.filter((f) => f.kind === "secret").map((f) => f.key));
|
|
405
|
+
if (secretKeys.size === 0) {
|
|
406
|
+
plainConfig = body.config;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
const split = splitSecrets(body.config, secretKeys);
|
|
410
|
+
plainConfig = split.plain;
|
|
411
|
+
secretPatch = split.secrets;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
// Mutate the persisted tenant config.
|
|
415
|
+
const cfg = loadTenantConfig(tenantId, ops.homeDir);
|
|
416
|
+
const plugins = { ...(cfg.plugins ?? {}) };
|
|
417
|
+
const existing = plugins[pluginId] ?? {};
|
|
418
|
+
const next = {
|
|
419
|
+
...existing,
|
|
420
|
+
};
|
|
421
|
+
if (hasEnabled)
|
|
422
|
+
next.enabled = body.enabled;
|
|
423
|
+
if (plainConfig !== undefined) {
|
|
424
|
+
next.config = plainConfig;
|
|
425
|
+
}
|
|
426
|
+
plugins[pluginId] = next;
|
|
427
|
+
writeTenantConfig(tenantId, { ...cfg, plugins }, ops.homeDir);
|
|
428
|
+
// And then persist the secret patch (if any) to the secrets/
|
|
429
|
+
// file. Done AFTER config.json so a config write that
|
|
430
|
+
// succeeded but a secrets write that failed leaves the
|
|
431
|
+
// tenant in a recoverable state — the form just retries.
|
|
432
|
+
if (secretPatch && Object.keys(secretPatch).length > 0) {
|
|
433
|
+
const tenantForSecrets = ops.open(tenantId);
|
|
434
|
+
applyPluginSecretPatch(tenantForSecrets.secretsDir, pluginId, secretPatch);
|
|
435
|
+
}
|
|
436
|
+
// Invalidate cached registry so the next discovery + activation
|
|
437
|
+
// sees the new config. TenantContext is rebuilt on every call
|
|
438
|
+
// to ops.open() so config is always re-read from disk.
|
|
439
|
+
await registry.invalidate(tenantId);
|
|
440
|
+
const fresh = ops.open(tenantId);
|
|
441
|
+
const list = await listPluginsForTenant(registry, fresh);
|
|
442
|
+
// Notify the chat surface so (a) the WS gets a
|
|
443
|
+
// `plugins_changed` event and (b) the active session gets
|
|
444
|
+
// told the agent's tool list moved. We compute the delta from
|
|
445
|
+
// the manifest — contributes.tools/toolsets is the source of
|
|
446
|
+
// truth for what tools come and go with this plugin.
|
|
447
|
+
if (opts.onPluginsChanged &&
|
|
448
|
+
knownEntry &&
|
|
449
|
+
hasEnabled &&
|
|
450
|
+
wasEnabled !== willEnabled) {
|
|
451
|
+
const delta = {
|
|
452
|
+
pluginId,
|
|
453
|
+
displayName: knownEntry.manifest.displayName ?? pluginId,
|
|
454
|
+
tools: knownEntry.manifest.contributes?.tools?.map((t) => t.id) ?? [],
|
|
455
|
+
toolsets: knownEntry.manifest.contributes?.toolsets?.map((t) => t.id) ?? [],
|
|
456
|
+
};
|
|
457
|
+
try {
|
|
458
|
+
opts.onPluginsChanged(tenantId, req.ctx.userId, delta, willEnabled ? "enabled" : "disabled");
|
|
459
|
+
}
|
|
460
|
+
catch (err) {
|
|
461
|
+
// Notifications are non-fatal — the PATCH itself succeeded.
|
|
462
|
+
console.warn(`[plugins-routes] onPluginsChanged threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
res.json({ plugins: list });
|
|
466
|
+
}
|
|
467
|
+
catch (err) {
|
|
468
|
+
if (err instanceof TenantConfigForbiddenFieldError) {
|
|
469
|
+
res.status(400).json({ error: "forbidden_field", message: err.message });
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
next(err);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
return r;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Walk a posted plugin config object and split out the secret
|
|
479
|
+
* fields. Secret keys are dotted paths (matching the form's flat
|
|
480
|
+
* value map shape); we drop them from the cleartext object and
|
|
481
|
+
* collect them into a SecretPatch the caller hands to
|
|
482
|
+
* applyPluginSecretPatch.
|
|
483
|
+
*
|
|
484
|
+
* Two value shapes the form may submit per secret field:
|
|
485
|
+
* - string — user typed a new value; persist it.
|
|
486
|
+
* - { __secret: true, set: <bool> } — the redacted shape
|
|
487
|
+
* (form was rendered against an existing config and the user
|
|
488
|
+
* didn't touch the field). Treated as a no-op so saving the
|
|
489
|
+
* form without re-typing the key keeps the existing secret
|
|
490
|
+
* intact.
|
|
491
|
+
* - { __secret: true, clear: true } — explicit clear; deletes
|
|
492
|
+
* the secret from secrets/. (The form's "clear" button sends
|
|
493
|
+
* this.)
|
|
494
|
+
*/
|
|
495
|
+
export function splitSecrets(body, secretKeys) {
|
|
496
|
+
const plain = {};
|
|
497
|
+
const secrets = {};
|
|
498
|
+
// We only walk top-level keys for now — dotted secret keys
|
|
499
|
+
// ("foo.bar") are nested by the form before being sent, so the
|
|
500
|
+
// POST body contains nested objects. We recurse to find them.
|
|
501
|
+
const visit = (obj, prefix, plainTarget) => {
|
|
502
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
503
|
+
const dotted = prefix ? `${prefix}.${k}` : k;
|
|
504
|
+
if (secretKeys.has(dotted)) {
|
|
505
|
+
if (typeof v === "string") {
|
|
506
|
+
secrets[dotted] = v;
|
|
507
|
+
}
|
|
508
|
+
else if (v &&
|
|
509
|
+
typeof v === "object" &&
|
|
510
|
+
v.__secret === true) {
|
|
511
|
+
if (v.clear === true) {
|
|
512
|
+
secrets[dotted] = { __secret: true, clear: true };
|
|
513
|
+
}
|
|
514
|
+
// else: redacted shape — no-op (leave existing secret).
|
|
515
|
+
}
|
|
516
|
+
// Don't write the secret to plain.
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
if (v && typeof v === "object" && !Array.isArray(v)) {
|
|
520
|
+
plainTarget[k] = {};
|
|
521
|
+
visit(v, dotted, plainTarget[k]);
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
plainTarget[k] = v;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
visit(body, "", plain);
|
|
529
|
+
return { plain, secrets };
|
|
530
|
+
}
|
|
531
|
+
export async function listPluginsForTenant(registry, tenant) {
|
|
532
|
+
await registry.ensureForTenant(tenant);
|
|
533
|
+
// Calling collectRoutesForTenant here is intentional: it both
|
|
534
|
+
// surfaces the route shape AND lazily marks any plugin whose
|
|
535
|
+
// manifest claims a missing route handler as failed.
|
|
536
|
+
collectRoutesForTenant(registry, tenant.tenantId);
|
|
537
|
+
const tenantConfigPlugins = (tenant.config.plugins ?? {});
|
|
538
|
+
return registry.listForTenant(tenant.tenantId).map((e) => {
|
|
539
|
+
const rawConfig = tenantConfigPlugins[e.manifest.id]?.config ?? {};
|
|
540
|
+
// Redact any `secret`-kind fields before exposing the config
|
|
541
|
+
// to the browser. The plugin admin form only needs to know
|
|
542
|
+
// whether each secret is set; the cleartext stays on disk
|
|
543
|
+
// under `<tenant>/secrets/plugin-<id>.json`.
|
|
544
|
+
const fields = e.manifest.configSchema?.fields ?? [];
|
|
545
|
+
const hasSecrets = fields.some((f) => f.kind === "secret");
|
|
546
|
+
let safeConfig = rawConfig;
|
|
547
|
+
if (hasSecrets) {
|
|
548
|
+
const secrets = loadPluginSecrets(tenant.secretsDir, e.manifest.id);
|
|
549
|
+
safeConfig = redactSecretsInConfig(rawConfig, fields, secrets);
|
|
550
|
+
}
|
|
551
|
+
return {
|
|
552
|
+
id: e.manifest.id,
|
|
553
|
+
version: e.manifest.version,
|
|
554
|
+
displayName: e.manifest.displayName,
|
|
555
|
+
description: e.manifest.description ?? null,
|
|
556
|
+
source: e.source,
|
|
557
|
+
state: e.state,
|
|
558
|
+
failedReason: e.failedReason ?? null,
|
|
559
|
+
contributes: e.manifest.contributes ?? {},
|
|
560
|
+
clientEntry: e.manifest.client?.entry ?? null,
|
|
561
|
+
/** Declarative form schema; UI uses this to render the config
|
|
562
|
+
* panel. Null when the plugin doesn't expose user-editable
|
|
563
|
+
* config. */
|
|
564
|
+
configSchema: e.manifest.configSchema ?? null,
|
|
565
|
+
/** Current persisted config object — same shape the plugin sees
|
|
566
|
+
* via PluginContext.pluginConfig, except `secret`-kind values
|
|
567
|
+
* are replaced with `{ __secret: true, set: <bool> }` so the
|
|
568
|
+
* browser never sees cleartext. */
|
|
569
|
+
config: safeConfig,
|
|
570
|
+
capabilities: {
|
|
571
|
+
provided: e.capabilityInfo.provided,
|
|
572
|
+
requires: e.capabilityInfo.requires,
|
|
573
|
+
missing: e.capabilityInfo.missing,
|
|
574
|
+
},
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
// Validation for the body of POST/PATCH /mcp/servers. Returns either
|
|
579
|
+
// `{ value: <entry> }` or `{ error: <code>, message: ... }` so the
|
|
580
|
+
// caller can hand the latter straight to `res.json`.
|
|
581
|
+
function parseUserEntry(raw, ctx) {
|
|
582
|
+
if (!raw || typeof raw !== "object") {
|
|
583
|
+
return { error: "bad_body", message: "expected JSON object" };
|
|
584
|
+
}
|
|
585
|
+
const r = raw;
|
|
586
|
+
const id = typeof r.id === "string" ? r.id.trim() : "";
|
|
587
|
+
if (!id)
|
|
588
|
+
return { error: "bad_id", message: "id is required" };
|
|
589
|
+
if (!/^[a-z0-9][a-z0-9-]{0,30}$/.test(id)) {
|
|
590
|
+
return {
|
|
591
|
+
error: "bad_id",
|
|
592
|
+
message: "id must be 1-31 chars: lowercase letters, digits, dashes",
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
if (ctx.existingId !== undefined && id !== ctx.existingId) {
|
|
596
|
+
return {
|
|
597
|
+
error: "id_immutable",
|
|
598
|
+
message: "id cannot be changed via PATCH",
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
const url = typeof r.url === "string" ? r.url.trim() : "";
|
|
602
|
+
if (!url)
|
|
603
|
+
return { error: "bad_url", message: "url is required" };
|
|
604
|
+
try {
|
|
605
|
+
const u = new URL(url);
|
|
606
|
+
if (u.protocol !== "http:" && u.protocol !== "https:") {
|
|
607
|
+
return { error: "bad_url", message: "url must be http(s)" };
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
catch {
|
|
611
|
+
return { error: "bad_url", message: "url is not a valid URL" };
|
|
612
|
+
}
|
|
613
|
+
const entry = { id, url };
|
|
614
|
+
if (typeof r.displayName === "string" && r.displayName.length) {
|
|
615
|
+
entry.displayName = r.displayName.slice(0, 80);
|
|
616
|
+
}
|
|
617
|
+
if (typeof r.prefix === "string") {
|
|
618
|
+
entry.prefix = r.prefix.slice(0, 32);
|
|
619
|
+
}
|
|
620
|
+
if (typeof r.upstreamHost === "string" && r.upstreamHost.length) {
|
|
621
|
+
entry.upstreamHost = r.upstreamHost.slice(0, 200);
|
|
622
|
+
}
|
|
623
|
+
if (typeof r.enabled === "boolean")
|
|
624
|
+
entry.enabled = r.enabled;
|
|
625
|
+
return { value: entry };
|
|
626
|
+
}
|
|
627
|
+
//# sourceMappingURL=plugins-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins-routes.js","sourceRoot":"","sources":["../src/plugins-routes.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,gEAAgE;AAChE,+DAA+D;AAC/D,8CAA8C;AAC9C,EAAE;AACF,yDAAyD;AACzD,yCAAyC;AAEzC,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAEL,gBAAgB,EAGhB,+BAA+B,EAC/B,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