@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,389 @@
|
|
|
1
|
+
// Skill loader (ADR-0004 §11).
|
|
2
|
+
//
|
|
3
|
+
// A "skill" is a markdown how-to file that ships alongside its
|
|
4
|
+
// owning plugin (host self-ships some too). The agent doesn't see
|
|
5
|
+
// skill bodies by default \u2014 instead it sees a list of
|
|
6
|
+
// `{ name, description, location }` injected into the system
|
|
7
|
+
// prompt and pulls a body into context on demand via the files
|
|
8
|
+
// plugin's `tenant_config_read` / `read_file` tools.
|
|
9
|
+
//
|
|
10
|
+
// Frontmatter shape:
|
|
11
|
+
//
|
|
12
|
+
// ---
|
|
13
|
+
// name: tianshu-mount-layout
|
|
14
|
+
// description: How the host filesystem maps into the sandbox guest.
|
|
15
|
+
// when: # optional
|
|
16
|
+
// toolPresent: exec # any of these forms
|
|
17
|
+
// capabilityPresent: sandbox.shell
|
|
18
|
+
// ---
|
|
19
|
+
//
|
|
20
|
+
// `when` is plain {key:value} \u2014 v0 supports `toolPresent` and
|
|
21
|
+
// `capabilityPresent`. Composition (and/or) is v1+.
|
|
22
|
+
//
|
|
23
|
+
// We intentionally don't bring in gray-matter / js-yaml etc.\u2014a
|
|
24
|
+
// minimal hand-parser for `key: value` plus a flat sub-block keeps
|
|
25
|
+
// the dependency footprint tiny and the failure modes obvious. If
|
|
26
|
+
// authors want richer frontmatter, we'll switch then.
|
|
27
|
+
import fs from "node:fs";
|
|
28
|
+
import path from "node:path";
|
|
29
|
+
/**
|
|
30
|
+
* Load every `contributes.skills[]` entry for one plugin.
|
|
31
|
+
* `pluginDir` is the manifest's directory; skill paths are resolved
|
|
32
|
+
* against it.
|
|
33
|
+
*/
|
|
34
|
+
export function loadSkillsForPlugin(args) {
|
|
35
|
+
const skills = [];
|
|
36
|
+
const failures = [];
|
|
37
|
+
for (const c of args.contributions) {
|
|
38
|
+
const filePath = path.resolve(args.pluginDir, c.path);
|
|
39
|
+
const source = { pluginId: args.pluginId, contributionId: c.id };
|
|
40
|
+
const loaded = loadSkillFromFile({ filePath, source });
|
|
41
|
+
if (loaded.ok) {
|
|
42
|
+
skills.push(loaded.skill);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
failures.push({ source, filePath, reason: loaded.reason });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return { skills, failures };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Discover OpenClaw-style directory skills under `rootDir`.
|
|
52
|
+
*
|
|
53
|
+
* Each immediate subdirectory whose name doesn't start with `.` and
|
|
54
|
+
* which contains a `SKILL.md` becomes one skill. Frontmatter parsing
|
|
55
|
+
* mirrors `loadSkillsForPlugin`. Optional sibling dirs (`scripts/`,
|
|
56
|
+
* `references/`, `assets/`) are deliberately not eagerly loaded —
|
|
57
|
+
* the agent reads them on demand via the regular file tools, just
|
|
58
|
+
* like Claude Code / OpenClaw do.
|
|
59
|
+
*
|
|
60
|
+
* Returns `{skills:[], failures:[]}` when `rootDir` doesn't exist
|
|
61
|
+
* (so callers can probe many candidate locations cheaply).
|
|
62
|
+
*/
|
|
63
|
+
export function loadDirectorySkills(args) {
|
|
64
|
+
const skills = [];
|
|
65
|
+
const failures = [];
|
|
66
|
+
if (!fs.existsSync(args.rootDir))
|
|
67
|
+
return { skills, failures };
|
|
68
|
+
let entries;
|
|
69
|
+
try {
|
|
70
|
+
entries = fs.readdirSync(args.rootDir, { withFileTypes: true });
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return {
|
|
74
|
+
skills,
|
|
75
|
+
failures: [
|
|
76
|
+
{
|
|
77
|
+
source: { pluginId: args.pluginId, contributionId: "<root>" },
|
|
78
|
+
filePath: args.rootDir,
|
|
79
|
+
reason: `readdir failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
for (const entry of entries) {
|
|
85
|
+
if (!entry.isDirectory())
|
|
86
|
+
continue;
|
|
87
|
+
if (entry.name.startsWith("."))
|
|
88
|
+
continue;
|
|
89
|
+
const skillMd = path.join(args.rootDir, entry.name, "SKILL.md");
|
|
90
|
+
if (!fs.existsSync(skillMd))
|
|
91
|
+
continue;
|
|
92
|
+
const source = {
|
|
93
|
+
pluginId: args.pluginId,
|
|
94
|
+
contributionId: entry.name,
|
|
95
|
+
};
|
|
96
|
+
const loaded = loadSkillFromFile({ filePath: skillMd, source });
|
|
97
|
+
if (loaded.ok) {
|
|
98
|
+
skills.push(loaded.skill);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
failures.push({ source, filePath: skillMd, reason: loaded.reason });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { skills, failures };
|
|
105
|
+
}
|
|
106
|
+
function loadSkillFromFile(args) {
|
|
107
|
+
if (!fs.existsSync(args.filePath)) {
|
|
108
|
+
return { ok: false, reason: "skill file not found" };
|
|
109
|
+
}
|
|
110
|
+
let raw;
|
|
111
|
+
try {
|
|
112
|
+
raw = fs.readFileSync(args.filePath, "utf8");
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
return {
|
|
116
|
+
ok: false,
|
|
117
|
+
reason: `read failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const parsed = parseFrontmatter(raw);
|
|
121
|
+
if (!parsed.ok)
|
|
122
|
+
return { ok: false, reason: parsed.reason };
|
|
123
|
+
const { frontmatter, body } = parsed;
|
|
124
|
+
const name = pickString(frontmatter, "name");
|
|
125
|
+
const description = pickString(frontmatter, "description");
|
|
126
|
+
if (!name)
|
|
127
|
+
return { ok: false, reason: "frontmatter missing `name`" };
|
|
128
|
+
if (!description) {
|
|
129
|
+
return { ok: false, reason: "frontmatter missing `description`" };
|
|
130
|
+
}
|
|
131
|
+
const scope = pickString(frontmatter, "scope");
|
|
132
|
+
const scopeNarrowed = scope === "main" || scope === "worker" ? scope : undefined;
|
|
133
|
+
return {
|
|
134
|
+
ok: true,
|
|
135
|
+
skill: {
|
|
136
|
+
source: args.source,
|
|
137
|
+
filePath: args.filePath,
|
|
138
|
+
name,
|
|
139
|
+
description,
|
|
140
|
+
when: extractWhen(frontmatter),
|
|
141
|
+
scope: scopeNarrowed,
|
|
142
|
+
body: body.trim(),
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function parseFrontmatter(src) {
|
|
147
|
+
// No frontmatter? Treat as empty map, body = whole file. Some
|
|
148
|
+
// skills may legitimately have nothing to declare beyond name/desc;
|
|
149
|
+
// we still require those fields, so authors will see the missing
|
|
150
|
+
// -name error if they skip the block entirely.
|
|
151
|
+
if (!src.startsWith("---")) {
|
|
152
|
+
return { ok: true, frontmatter: {}, body: src };
|
|
153
|
+
}
|
|
154
|
+
const end = src.indexOf("\n---", 3);
|
|
155
|
+
if (end < 0) {
|
|
156
|
+
return { ok: false, reason: "frontmatter open `---` has no closing `---`" };
|
|
157
|
+
}
|
|
158
|
+
const fmText = src.slice(3, end).replace(/^\r?\n/, "");
|
|
159
|
+
let body = src.slice(end + 4);
|
|
160
|
+
if (body.startsWith("\r\n"))
|
|
161
|
+
body = body.slice(2);
|
|
162
|
+
else if (body.startsWith("\n"))
|
|
163
|
+
body = body.slice(1);
|
|
164
|
+
const fm = {};
|
|
165
|
+
let currentBlock = null;
|
|
166
|
+
const lines = fmText.split(/\r?\n/);
|
|
167
|
+
for (const lineRaw of lines) {
|
|
168
|
+
if (lineRaw.trim().length === 0)
|
|
169
|
+
continue;
|
|
170
|
+
const indented = /^\s/.test(lineRaw);
|
|
171
|
+
const line = lineRaw.trimEnd();
|
|
172
|
+
if (!indented) {
|
|
173
|
+
// top-level "key:" or "key: value"
|
|
174
|
+
const m = /^([A-Za-z][A-Za-z0-9_]*)\s*:\s*(.*)$/.exec(line);
|
|
175
|
+
if (!m) {
|
|
176
|
+
return { ok: false, reason: `bad frontmatter line: "${line}"` };
|
|
177
|
+
}
|
|
178
|
+
const key = m[1];
|
|
179
|
+
const value = m[2];
|
|
180
|
+
if (value.length === 0) {
|
|
181
|
+
// start of a sub-block
|
|
182
|
+
const map = {};
|
|
183
|
+
currentBlock = { key, map };
|
|
184
|
+
fm[key] = map;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
currentBlock = null;
|
|
188
|
+
fm[key] = unquote(value);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
if (!currentBlock) {
|
|
193
|
+
return {
|
|
194
|
+
ok: false,
|
|
195
|
+
reason: `indented line "${line.trim()}" without an enclosing block`,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
const m = /^\s+([A-Za-z][A-Za-z0-9_]*)\s*:\s*(.*)$/.exec(line);
|
|
199
|
+
if (!m) {
|
|
200
|
+
return { ok: false, reason: `bad sub-block line: "${line}"` };
|
|
201
|
+
}
|
|
202
|
+
currentBlock.map[m[1]] = unquote(m[2]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return { ok: true, frontmatter: fm, body };
|
|
206
|
+
}
|
|
207
|
+
function unquote(s) {
|
|
208
|
+
if ((s.startsWith('"') && s.endsWith('"') && s.length >= 2) ||
|
|
209
|
+
(s.startsWith("'") && s.endsWith("'") && s.length >= 2)) {
|
|
210
|
+
return s.slice(1, -1);
|
|
211
|
+
}
|
|
212
|
+
return s;
|
|
213
|
+
}
|
|
214
|
+
function pickString(fm, key) {
|
|
215
|
+
const v = fm[key];
|
|
216
|
+
return typeof v === "string" ? v : undefined;
|
|
217
|
+
}
|
|
218
|
+
function extractWhen(fm) {
|
|
219
|
+
const w = fm["when"];
|
|
220
|
+
if (!w || typeof w !== "object")
|
|
221
|
+
return undefined;
|
|
222
|
+
const out = {};
|
|
223
|
+
if (typeof w.toolPresent === "string")
|
|
224
|
+
out.toolPresent = w.toolPresent;
|
|
225
|
+
if (typeof w.capabilityPresent === "string")
|
|
226
|
+
out.capabilityPresent = w.capabilityPresent;
|
|
227
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Filter skills by their `when:` predicate and `scope:` field
|
|
231
|
+
* against the current tenant state.
|
|
232
|
+
*
|
|
233
|
+
* `agentScope` (`"main"` | `"worker"`) determines who's loading
|
|
234
|
+
* the skill list right now. A skill marked `scope: main` is
|
|
235
|
+
* hidden from worker runs; `scope: worker` is hidden from the
|
|
236
|
+
* main chat agent. Skills without a `scope:` are visible to
|
|
237
|
+
* both, the legacy default. Omit `agentScope` (or pass undefined)
|
|
238
|
+
* to bypass the scope filter entirely — useful for callers that
|
|
239
|
+
* want the unfiltered universe (e.g. admin UIs).
|
|
240
|
+
*/
|
|
241
|
+
export function filterSkillsForTenant(skills, ctx) {
|
|
242
|
+
return skills.filter((s) => {
|
|
243
|
+
if (s.scope && ctx.agentScope && s.scope !== ctx.agentScope) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
if (!s.when)
|
|
247
|
+
return true;
|
|
248
|
+
if (s.when.toolPresent && !ctx.hasTool(s.when.toolPresent))
|
|
249
|
+
return false;
|
|
250
|
+
if (s.when.capabilityPresent && !ctx.hasCapability(s.when.capabilityPresent)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
return true;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
// ─── tenant-config mirroring ─────────────────────────────────────
|
|
257
|
+
//
|
|
258
|
+
// Why mirror at all
|
|
259
|
+
// - Plugin / host SKILL.md files live outside any tenant
|
|
260
|
+
// workspace (under `<repoRoot>/skills/` or `<pluginDir>/
|
|
261
|
+
// skills/`), so `tenant_config_read` (scoped to
|
|
262
|
+
// `_tenant/config/`) and `read_file` (scoped to the user
|
|
263
|
+
// workspace) can't reach them.
|
|
264
|
+
// - We tried a `read_skill(name)` meta-tool. It works but is a
|
|
265
|
+
// special case agents have to learn. The user's preference is
|
|
266
|
+
// "skills are files, read them like any other file" — so we
|
|
267
|
+
// mirror once at boot and let `tenant_config_read` do the
|
|
268
|
+
// work.
|
|
269
|
+
//
|
|
270
|
+
// Mirror layout
|
|
271
|
+
// <tenant>/_tenant/config/skills/_host/<pluginId>/<skillId>/SKILL.md
|
|
272
|
+
//
|
|
273
|
+
// `_host/` namespacing keeps user-authored tenant skills (under
|
|
274
|
+
// `skills/<name>/SKILL.md`) and worker bundles cleanly separate
|
|
275
|
+
// from things the host owns. The mirror tree is overwritten on
|
|
276
|
+
// every boot — the source of truth lives in the plugin / host
|
|
277
|
+
// repo, edits there are pointless and `tenant_config_write`
|
|
278
|
+
// refuses paths under `skills/_host/` to make that explicit.
|
|
279
|
+
const HOST_SKILL_NAMESPACE = "_host";
|
|
280
|
+
export function mirroredSkillRelPath(pluginId, contributionId) {
|
|
281
|
+
return `skills/${HOST_SKILL_NAMESPACE}/${pluginId}/${contributionId}/SKILL.md`;
|
|
282
|
+
}
|
|
283
|
+
/** Absolute path of the mirror entry for one skill, given the
|
|
284
|
+
* tenant's `_tenant/config/` root. */
|
|
285
|
+
export function mirroredSkillFilePath(tenantConfigDir, pluginId, contributionId) {
|
|
286
|
+
return path.join(tenantConfigDir, "skills", HOST_SKILL_NAMESPACE, pluginId, contributionId, "SKILL.md");
|
|
287
|
+
}
|
|
288
|
+
/** True iff a `_tenant/config/...` path falls under the host
|
|
289
|
+
* mirror tree. Used by `tenant_config_write` to refuse writes
|
|
290
|
+
* there (the source of truth is the plugin / host repo). */
|
|
291
|
+
export function isMirroredSkillPath(relPath) {
|
|
292
|
+
// Strip leading slash if any so callers can pass either form.
|
|
293
|
+
const trimmed = relPath.replace(/^\/+/, "");
|
|
294
|
+
return trimmed.startsWith(`skills/${HOST_SKILL_NAMESPACE}/`);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Write the body of every supplied skill to its mirror location
|
|
298
|
+
* under `tenantConfigDir`. Idempotent — files are rewritten on
|
|
299
|
+
* every call. Returns the skills with `filePath` rebound to the
|
|
300
|
+
* mirror path so callers (system prompt, tools) advertise the
|
|
301
|
+
* tenant-config URI instead of the absolute host path the agent
|
|
302
|
+
* can't read.
|
|
303
|
+
*
|
|
304
|
+
* We rebind in a NEW LoadedSkill so the original (used for in-
|
|
305
|
+
* memory body access) keeps its real filePath for diagnostics.
|
|
306
|
+
*
|
|
307
|
+
* Failure to write a single mirror entry is logged but does not
|
|
308
|
+
* abort the rest — a skill we couldn't mirror just falls through
|
|
309
|
+
* to its original (unreachable) filePath, which is no worse than
|
|
310
|
+
* the pre-mirror state.
|
|
311
|
+
*/
|
|
312
|
+
export function mirrorSkillsToTenantConfig(args) {
|
|
313
|
+
const out = [];
|
|
314
|
+
for (const s of args.skills) {
|
|
315
|
+
const dest = mirroredSkillFilePath(args.tenantConfigDir, s.source.pluginId, s.source.contributionId);
|
|
316
|
+
try {
|
|
317
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
318
|
+
// Reconstruct the on-disk file from frontmatter + body so
|
|
319
|
+
// the mirrored copy is a self-contained SKILL.md, not just
|
|
320
|
+
// the body. The agent reads the mirrored path and gets back
|
|
321
|
+
// the same shape it would have seen at the source.
|
|
322
|
+
const text = renderSkillFile(s);
|
|
323
|
+
// Only rewrite if the content actually changed — avoids
|
|
324
|
+
// tripping the workboard fs.watch on every boot when nothing
|
|
325
|
+
// moved. (The watcher debounces, but writing zero-delta files
|
|
326
|
+
// every activate is still wasteful.)
|
|
327
|
+
let existing = null;
|
|
328
|
+
try {
|
|
329
|
+
existing = fs.readFileSync(dest, "utf8");
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
existing = null;
|
|
333
|
+
}
|
|
334
|
+
if (existing !== text) {
|
|
335
|
+
const tmp = `${dest}.tmp.${process.pid}.${Date.now()}`;
|
|
336
|
+
fs.writeFileSync(tmp, text);
|
|
337
|
+
fs.renameSync(tmp, dest);
|
|
338
|
+
}
|
|
339
|
+
out.push({ ...s, filePath: dest });
|
|
340
|
+
}
|
|
341
|
+
catch (err) {
|
|
342
|
+
args.log.warn("[skills] mirror failed", {
|
|
343
|
+
pluginId: s.source.pluginId,
|
|
344
|
+
contributionId: s.source.contributionId,
|
|
345
|
+
dest,
|
|
346
|
+
err: err instanceof Error ? err.message : String(err),
|
|
347
|
+
});
|
|
348
|
+
out.push(s); // fall through with original filePath
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return out;
|
|
352
|
+
}
|
|
353
|
+
/** Reconstruct the SKILL.md text from a LoadedSkill. The original
|
|
354
|
+
* on-disk file may have used yaml-style frontmatter; we emit a
|
|
355
|
+
* canonical, hand-parseable form that the same loader can re-read
|
|
356
|
+
* if anyone ever points loadSkillsForPlugin at the mirror tree. */
|
|
357
|
+
function renderSkillFile(s) {
|
|
358
|
+
const lines = ["---"];
|
|
359
|
+
lines.push(`name: ${s.name}`);
|
|
360
|
+
lines.push(`description: ${s.description}`);
|
|
361
|
+
if (s.scope)
|
|
362
|
+
lines.push(`scope: ${s.scope}`);
|
|
363
|
+
if (s.when?.toolPresent) {
|
|
364
|
+
lines.push(`when:`);
|
|
365
|
+
lines.push(` toolPresent: ${s.when.toolPresent}`);
|
|
366
|
+
}
|
|
367
|
+
else if (s.when?.capabilityPresent) {
|
|
368
|
+
lines.push(`when:`);
|
|
369
|
+
lines.push(` capabilityPresent: ${s.when.capabilityPresent}`);
|
|
370
|
+
}
|
|
371
|
+
lines.push("---");
|
|
372
|
+
lines.push("");
|
|
373
|
+
lines.push(s.body);
|
|
374
|
+
return lines.join("\n");
|
|
375
|
+
}
|
|
376
|
+
/** Remove every entry under `skills/_host/` for a tenant. Useful
|
|
377
|
+
* when a plugin is disabled / uninstalled and we don't want stale
|
|
378
|
+
* mirror copies advertising skills the agent can no longer use.
|
|
379
|
+
* Best-effort: a missing directory is fine. */
|
|
380
|
+
export function cleanupMirroredSkills(tenantConfigDir) {
|
|
381
|
+
const root = path.join(tenantConfigDir, "skills", HOST_SKILL_NAMESPACE);
|
|
382
|
+
try {
|
|
383
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
// best-effort
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/core/plugins/skills.ts"],"names":[],"mappings":"AAAA,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,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;gDAGgD;AAChD,MAAM,UAAU,qBAAqB,CAAC,eAAuB;IAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IACxE,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,cAAc;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Resolve where the on-disk templates directory lives. */
|
|
2
|
+
export declare function getTemplatesDir(): string;
|
|
3
|
+
export declare const TENANT_TEMPLATE = "tenant-workspace";
|
|
4
|
+
export declare const USER_TEMPLATE = "user-workspace";
|
|
5
|
+
/** Seed the tenant-shared `_tenant/` workspace. Idempotent on already-existing dirs. */
|
|
6
|
+
export declare function seedTenantWorkspace(tenantId: string, home?: string): void;
|
|
7
|
+
/** Seed a user's home dir under workspace/users/<userId>/. Idempotent. */
|
|
8
|
+
export declare function seedUserWorkspace(tenantId: string, userId: string, home?: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Backfill missing template subtrees into an existing tenant.
|
|
11
|
+
*
|
|
12
|
+
* `seedTenantWorkspace` only fires the first time a tenant is
|
|
13
|
+
* created — once `_tenant/` exists it bails out. That's correct
|
|
14
|
+
* for SOUL.md / MEMORY.md (user may have edited them) but wrong
|
|
15
|
+
* for additive config the host ships later, e.g. the
|
|
16
|
+
* `_tenant/config/main/skills/skill-creator/` bundle that backs
|
|
17
|
+
* the agent-managed skill workflow.
|
|
18
|
+
*
|
|
19
|
+
* `ensureTenantConfigDefaults` walks the template's `config/` tree
|
|
20
|
+
* and copies each *missing* file/dir into the tenant. Existing
|
|
21
|
+
* files are left alone, so a user-edited skill is never
|
|
22
|
+
* overwritten. Skills the user removed will be re-seeded — that's
|
|
23
|
+
* intentional; if you want to disable a builtin skill, set
|
|
24
|
+
* `enabled: false` in its frontmatter rather than deleting the
|
|
25
|
+
* directory.
|
|
26
|
+
*/
|
|
27
|
+
export declare function ensureTenantConfigDefaults(tenantId: string, home?: string): void;
|
|
28
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAoBA,2DAA2D;AAC3D,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAa9C,wFAAwF;AACxF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CASzE;AAED,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAKvF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAUN"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Workspace seeding from templates/.
|
|
2
|
+
//
|
|
3
|
+
// When a tenant is created, we copy `templates/tenant-workspace/` into
|
|
4
|
+
// `<tenant>/workspace/_tenant/`. When a user is added to a tenant, we
|
|
5
|
+
// copy `templates/user-workspace/` into `<tenant>/workspace/users/<userId>/`.
|
|
6
|
+
//
|
|
7
|
+
// Templates ship in the server package's source tree (and dist tree after
|
|
8
|
+
// build). The TIANSHU_TEMPLATES_DIR env var overrides for tests / Docker.
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { getTenantSharedDir, getTenantWorkspaceDir, getUserHomeDir, } from "./paths.js";
|
|
13
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
/** Resolve where the on-disk templates directory lives. */
|
|
15
|
+
export function getTemplatesDir() {
|
|
16
|
+
const env = process.env.TIANSHU_TEMPLATES_DIR?.trim();
|
|
17
|
+
if (env)
|
|
18
|
+
return path.resolve(env);
|
|
19
|
+
// src/core/templates.ts → ../../templates (relative to packages/server/src)
|
|
20
|
+
return path.resolve(__dirname, "..", "..", "templates");
|
|
21
|
+
}
|
|
22
|
+
export const TENANT_TEMPLATE = "tenant-workspace";
|
|
23
|
+
export const USER_TEMPLATE = "user-workspace";
|
|
24
|
+
function copyDirRecursive(src, dest) {
|
|
25
|
+
if (!fs.existsSync(src)) {
|
|
26
|
+
// Templates not shipped (e.g. in some test setups) — leave the
|
|
27
|
+
// destination empty rather than crashing. Higher-level code can
|
|
28
|
+
// recover by lazily creating files when first accessed.
|
|
29
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
fs.cpSync(src, dest, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
/** Seed the tenant-shared `_tenant/` workspace. Idempotent on already-existing dirs. */
|
|
35
|
+
export function seedTenantWorkspace(tenantId, home) {
|
|
36
|
+
const sharedDir = getTenantSharedDir(tenantId, home);
|
|
37
|
+
if (fs.existsSync(sharedDir))
|
|
38
|
+
return;
|
|
39
|
+
const templates = getTemplatesDir();
|
|
40
|
+
copyDirRecursive(path.join(templates, TENANT_TEMPLATE), sharedDir);
|
|
41
|
+
// Always ensure users/ container exists alongside _tenant/.
|
|
42
|
+
const usersDir = path.join(getTenantWorkspaceDir(tenantId, home), "users");
|
|
43
|
+
fs.mkdirSync(usersDir, { recursive: true });
|
|
44
|
+
}
|
|
45
|
+
/** Seed a user's home dir under workspace/users/<userId>/. Idempotent. */
|
|
46
|
+
export function seedUserWorkspace(tenantId, userId, home) {
|
|
47
|
+
const userHome = getUserHomeDir(tenantId, userId, home);
|
|
48
|
+
if (fs.existsSync(userHome))
|
|
49
|
+
return;
|
|
50
|
+
const templates = getTemplatesDir();
|
|
51
|
+
copyDirRecursive(path.join(templates, USER_TEMPLATE), userHome);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Backfill missing template subtrees into an existing tenant.
|
|
55
|
+
*
|
|
56
|
+
* `seedTenantWorkspace` only fires the first time a tenant is
|
|
57
|
+
* created — once `_tenant/` exists it bails out. That's correct
|
|
58
|
+
* for SOUL.md / MEMORY.md (user may have edited them) but wrong
|
|
59
|
+
* for additive config the host ships later, e.g. the
|
|
60
|
+
* `_tenant/config/main/skills/skill-creator/` bundle that backs
|
|
61
|
+
* the agent-managed skill workflow.
|
|
62
|
+
*
|
|
63
|
+
* `ensureTenantConfigDefaults` walks the template's `config/` tree
|
|
64
|
+
* and copies each *missing* file/dir into the tenant. Existing
|
|
65
|
+
* files are left alone, so a user-edited skill is never
|
|
66
|
+
* overwritten. Skills the user removed will be re-seeded — that's
|
|
67
|
+
* intentional; if you want to disable a builtin skill, set
|
|
68
|
+
* `enabled: false` in its frontmatter rather than deleting the
|
|
69
|
+
* directory.
|
|
70
|
+
*/
|
|
71
|
+
export function ensureTenantConfigDefaults(tenantId, home) {
|
|
72
|
+
const templates = getTemplatesDir();
|
|
73
|
+
const tenantConfigSrc = path.join(templates, TENANT_TEMPLATE, "config");
|
|
74
|
+
if (!fs.existsSync(tenantConfigSrc))
|
|
75
|
+
return;
|
|
76
|
+
const tenantConfigDst = path.join(getTenantSharedDir(tenantId, home), "config");
|
|
77
|
+
fs.mkdirSync(tenantConfigDst, { recursive: true });
|
|
78
|
+
copyMissing(tenantConfigSrc, tenantConfigDst);
|
|
79
|
+
}
|
|
80
|
+
/** Copy files/dirs from `src` into `dst`, skipping anything already
|
|
81
|
+
* present at the destination. Symlinks are followed but not copied
|
|
82
|
+
* as symlinks — the tenant config tree is treated as plain data. */
|
|
83
|
+
function copyMissing(src, dst) {
|
|
84
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
85
|
+
for (const entry of entries) {
|
|
86
|
+
const srcPath = path.join(src, entry.name);
|
|
87
|
+
const dstPath = path.join(dst, entry.name);
|
|
88
|
+
if (entry.isDirectory()) {
|
|
89
|
+
if (!fs.existsSync(dstPath)) {
|
|
90
|
+
fs.cpSync(srcPath, dstPath, { recursive: true });
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
copyMissing(srcPath, dstPath);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else if (entry.isFile() || entry.isSymbolicLink()) {
|
|
97
|
+
if (!fs.existsSync(dstPath)) {
|
|
98
|
+
fs.copyFileSync(srcPath, dstPath);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,0EAA0E;AAE1E,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB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AAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;YACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Database as DB } from "better-sqlite3";
|
|
2
|
+
import { type ResolvedConfig } from "./config.js";
|
|
3
|
+
export declare class TenantContext {
|
|
4
|
+
readonly tenantId: string;
|
|
5
|
+
readonly db: DB;
|
|
6
|
+
readonly config: ResolvedConfig;
|
|
7
|
+
readonly home: string;
|
|
8
|
+
constructor(tenantId: string, db: DB, config: ResolvedConfig, home: string);
|
|
9
|
+
get root(): string;
|
|
10
|
+
get workspaceDir(): string;
|
|
11
|
+
get sharedDir(): string;
|
|
12
|
+
get secretsDir(): string;
|
|
13
|
+
get logsDir(): string;
|
|
14
|
+
userHomeDir(userId: string): string;
|
|
15
|
+
}
|
|
16
|
+
/** Build a TenantContext given a freshly-opened DB and the tenantId. */
|
|
17
|
+
export declare function buildTenantContext(tenantId: string, db: DB, home: string): TenantContext;
|
|
18
|
+
//# sourceMappingURL=tenant-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-context.d.ts","sourceRoot":"","sources":["../../src/core/tenant-context.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAUvE,qBAAa,aAAa;aAEN,QAAQ,EAAE,MAAM;aAChB,EAAE,EAAE,EAAE;aACN,MAAM,EAAE,cAAc;aACtB,IAAI,EAAE,MAAM;gBAHZ,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,EAAE,EACN,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM;IAG9B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAGpC;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,MAAM,GACX,aAAa,CAGf"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// A TenantContext is the per-request "everything you need to do work for
|
|
2
|
+
// this tenant" handle. Routes don't take a tenantId string — they take
|
|
3
|
+
// a TenantContext, so by construction they cannot accidentally swap
|
|
4
|
+
// tenants halfway through a handler.
|
|
5
|
+
import { resolveTenantConfig } from "./config.js";
|
|
6
|
+
import { getTenantLogsDir, getTenantRoot, getTenantSecretsDir, getTenantSharedDir, getTenantWorkspaceDir, getUserHomeDir, } from "./paths.js";
|
|
7
|
+
export class TenantContext {
|
|
8
|
+
tenantId;
|
|
9
|
+
db;
|
|
10
|
+
config;
|
|
11
|
+
home;
|
|
12
|
+
constructor(tenantId, db, config, home) {
|
|
13
|
+
this.tenantId = tenantId;
|
|
14
|
+
this.db = db;
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.home = home;
|
|
17
|
+
}
|
|
18
|
+
get root() {
|
|
19
|
+
return getTenantRoot(this.tenantId, this.home);
|
|
20
|
+
}
|
|
21
|
+
get workspaceDir() {
|
|
22
|
+
return getTenantWorkspaceDir(this.tenantId, this.home);
|
|
23
|
+
}
|
|
24
|
+
get sharedDir() {
|
|
25
|
+
return getTenantSharedDir(this.tenantId, this.home);
|
|
26
|
+
}
|
|
27
|
+
get secretsDir() {
|
|
28
|
+
return getTenantSecretsDir(this.tenantId, this.home);
|
|
29
|
+
}
|
|
30
|
+
get logsDir() {
|
|
31
|
+
return getTenantLogsDir(this.tenantId, this.home);
|
|
32
|
+
}
|
|
33
|
+
userHomeDir(userId) {
|
|
34
|
+
return getUserHomeDir(this.tenantId, userId, this.home);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Build a TenantContext given a freshly-opened DB and the tenantId. */
|
|
38
|
+
export function buildTenantContext(tenantId, db, home) {
|
|
39
|
+
const config = resolveTenantConfig(tenantId, home);
|
|
40
|
+
return new TenantContext(tenantId, db, config, home);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=tenant-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-context.js","sourceRoot":"","sources":["../../src/core/tenant-context.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,uEAAuE;AACvE,oEAAoE;AACpE,qCAAqC;AAGrC,OAAO,EAAE,mBAAmB,EAAuB,MAAM,aAAa,CAAC;AACvE,OA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MAAM,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class InvalidTenantIdError extends Error {
|
|
2
|
+
readonly code: "INVALID_TENANT_ID";
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
/** Validate a candidate tenantId. Returns the canonical id (== input) or throws. */
|
|
6
|
+
export declare function validateTenantId(candidate: unknown): string;
|
|
7
|
+
export declare function isValidTenantId(candidate: unknown): candidate is string;
|
|
8
|
+
//# sourceMappingURL=tenant-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-id.d.ts","sourceRoot":"","sources":["../../src/core/tenant-id.ts"],"names":[],"mappings":"AAyBA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAG,mBAAmB,CAAU;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAc3D;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI,MAAM,CAOvE"}
|