@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,64 @@
|
|
|
1
|
+
export declare class TenantConfigPathError extends Error {
|
|
2
|
+
readonly requested: string;
|
|
3
|
+
readonly code: "TENANT_CONFIG_PATH_ERROR";
|
|
4
|
+
constructor(requested: string, reason: string);
|
|
5
|
+
}
|
|
6
|
+
/** Absolute on-disk root for the tenant config tree.
|
|
7
|
+
*
|
|
8
|
+
* `tenantHomeDir` is the **per-tenant** root and may be either:
|
|
9
|
+
* - `<...>/tenants/<id>` (preferred form)
|
|
10
|
+
* - `<...>/tenants/<id>/workspace` (also accepted because
|
|
11
|
+
* `AgentToolContext.tenantHomeDir` is currently filled by
|
|
12
|
+
* handler/agent-loop with `ctx.workspaceDir` for symmetry
|
|
13
|
+
* with the file-plugin call sites)
|
|
14
|
+
*
|
|
15
|
+
* Anything else — e.g. the global `~/.tianshu` root — is a
|
|
16
|
+
* bug; the resulting path would write into a tenant-bleeding
|
|
17
|
+
* shared location. We can't easily detect that here, so the
|
|
18
|
+
* contract is on the caller (host wires this from
|
|
19
|
+
* ctx.workspaceDir / similar). */
|
|
20
|
+
export declare function getTenantConfigRoot(tenantHomeDir: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a tool-supplied `tenant-config:///<rel>` URI (or a bare
|
|
23
|
+
* relative path) into an absolute on-disk path under the tenant
|
|
24
|
+
* config root. Throws if the path escapes the root, contains `..`,
|
|
25
|
+
* or is empty.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveInTenantConfig(tenantHomeDir: string, requested: string): string;
|
|
28
|
+
/** Convert an absolute path back into a `tenant-config:///<rel>`
|
|
29
|
+
* URI for use in tool result text. Throws if `abs` is outside the
|
|
30
|
+
* tenant-config root. */
|
|
31
|
+
export declare function toTenantConfigUri(tenantHomeDir: string, abs: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Decide whether the given absolute path is writable from the
|
|
34
|
+
* provided agent scope. Reads are not gated; only `tenant_config_write`
|
|
35
|
+
* / `tenant_config_edit` / `tenant_config_delete` consult this.
|
|
36
|
+
*
|
|
37
|
+
* Allowed shapes (rooted at the tenant config tree):
|
|
38
|
+
*
|
|
39
|
+
* main agent → `skills/...`, `main/skills/...`
|
|
40
|
+
* worker:<kind> → `workers/<kind>/skills/...`
|
|
41
|
+
*
|
|
42
|
+
* The boundary is **only** the per-scope `skills/` subtree for now
|
|
43
|
+
* (i.e. shared `skills/`, `main/skills/`, `workers/<kind>/skills/`).
|
|
44
|
+
* Future surfaces (SOUL.md, MEMORY.md) would each need their own
|
|
45
|
+
* opt-in here \u2014 keeping the allow-list narrow makes accidental
|
|
46
|
+
* writes to agent personality files impossible by construction.
|
|
47
|
+
*/
|
|
48
|
+
export type AgentScope = {
|
|
49
|
+
kind: "main";
|
|
50
|
+
} | {
|
|
51
|
+
kind: "worker";
|
|
52
|
+
workerKind: string;
|
|
53
|
+
slug?: string;
|
|
54
|
+
};
|
|
55
|
+
export interface WriteCheck {
|
|
56
|
+
ok: boolean;
|
|
57
|
+
/** Human-readable reason when `ok=false`. */
|
|
58
|
+
reason?: string;
|
|
59
|
+
/** Canonical scope label ("shared", "main", `worker:<kind>`) when
|
|
60
|
+
* `ok=true`, for tool result text. */
|
|
61
|
+
scopeLabel?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function checkWritable(tenantHomeDir: string, abs: string, scope: AgentScope): WriteCheck;
|
|
64
|
+
//# sourceMappingURL=tenant-config-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-helper.d.ts","sourceRoot":"","sources":["../../src/tools/tenant-config-helper.ts"],"names":[],"mappings":"AAeA,qBAAa,qBAAsB,SAAQ,KAAK;aAElB,SAAS,EAAE,MAAM;IAD7C,QAAQ,CAAC,IAAI,EAAG,0BAA0B,CAAU;gBACxB,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI9D;AAED;;;;;;;;;;;;;mCAamC;AACnC,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAoBjE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,MAAM,CAuBR;AAED;;0BAE0B;AAC1B,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACV,MAAM,CAQR;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;2CACuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,UAAU,GAChB,UAAU,CAsEZ"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Path / scope helper for the `tenant_config_*` agent tools.
|
|
2
|
+
//
|
|
3
|
+
// These tools operate on the tenant-shared config tree at
|
|
4
|
+
// `<tenant>/workspace/_tenant/config/`. That tree houses skills and
|
|
5
|
+
// (in future) other agent-facing config that the user can edit but
|
|
6
|
+
// is not part of any single user's home dir.
|
|
7
|
+
//
|
|
8
|
+
// URI shape: `tenant-config:///<rel>` mirrors the user-workspace
|
|
9
|
+
// `workspace:///<rel>` URIs the rest of the files plugin emits.
|
|
10
|
+
// Path-traversal protection is identical: literal `..` segments in
|
|
11
|
+
// the requested path are rejected up front, and the resolved path
|
|
12
|
+
// is checked against the canonical tenant-config root.
|
|
13
|
+
import path from "node:path";
|
|
14
|
+
export class TenantConfigPathError extends Error {
|
|
15
|
+
requested;
|
|
16
|
+
code = "TENANT_CONFIG_PATH_ERROR";
|
|
17
|
+
constructor(requested, reason) {
|
|
18
|
+
super(`tenant-config path "${requested}" rejected: ${reason}`);
|
|
19
|
+
this.requested = requested;
|
|
20
|
+
this.name = "TenantConfigPathError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Absolute on-disk root for the tenant config tree.
|
|
24
|
+
*
|
|
25
|
+
* `tenantHomeDir` is the **per-tenant** root and may be either:
|
|
26
|
+
* - `<...>/tenants/<id>` (preferred form)
|
|
27
|
+
* - `<...>/tenants/<id>/workspace` (also accepted because
|
|
28
|
+
* `AgentToolContext.tenantHomeDir` is currently filled by
|
|
29
|
+
* handler/agent-loop with `ctx.workspaceDir` for symmetry
|
|
30
|
+
* with the file-plugin call sites)
|
|
31
|
+
*
|
|
32
|
+
* Anything else — e.g. the global `~/.tianshu` root — is a
|
|
33
|
+
* bug; the resulting path would write into a tenant-bleeding
|
|
34
|
+
* shared location. We can't easily detect that here, so the
|
|
35
|
+
* contract is on the caller (host wires this from
|
|
36
|
+
* ctx.workspaceDir / similar). */
|
|
37
|
+
export function getTenantConfigRoot(tenantHomeDir) {
|
|
38
|
+
// Try `<root>/_tenant/config/` first — matches the
|
|
39
|
+
// tenantHomeDir = workspaceDir form. Fall back to
|
|
40
|
+
// `<root>/workspace/_tenant/config/` for callers passing the
|
|
41
|
+
// tenant root proper.
|
|
42
|
+
const direct = path.resolve(tenantHomeDir, "_tenant", "config");
|
|
43
|
+
const viaWorkspace = path.resolve(tenantHomeDir, "workspace", "_tenant", "config");
|
|
44
|
+
// We can't `existsSync()` here without making this fs-aware
|
|
45
|
+
// (and the helper is also used to *create* paths). Pick the
|
|
46
|
+
// workspace form when `tenantHomeDir` looks like a workspace
|
|
47
|
+
// dir already, else the via-workspace form. Heuristic: ends
|
|
48
|
+
// in `workspace` or `workspace/`.
|
|
49
|
+
const trimmed = tenantHomeDir.replace(/[/\\]+$/, "");
|
|
50
|
+
if (trimmed.endsWith("workspace"))
|
|
51
|
+
return direct;
|
|
52
|
+
return viaWorkspace;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a tool-supplied `tenant-config:///<rel>` URI (or a bare
|
|
56
|
+
* relative path) into an absolute on-disk path under the tenant
|
|
57
|
+
* config root. Throws if the path escapes the root, contains `..`,
|
|
58
|
+
* or is empty.
|
|
59
|
+
*/
|
|
60
|
+
export function resolveInTenantConfig(tenantHomeDir, requested) {
|
|
61
|
+
if (typeof requested !== "string") {
|
|
62
|
+
throw new TenantConfigPathError(String(requested), "not a string");
|
|
63
|
+
}
|
|
64
|
+
let rel = requested.replace(/\\/g, "/");
|
|
65
|
+
if (rel.startsWith("tenant-config:///")) {
|
|
66
|
+
rel = rel.slice("tenant-config:///".length);
|
|
67
|
+
}
|
|
68
|
+
else if (rel.startsWith("tenant-config://")) {
|
|
69
|
+
rel = rel.slice("tenant-config://".length);
|
|
70
|
+
}
|
|
71
|
+
else if (rel === "tenant-config:") {
|
|
72
|
+
rel = "";
|
|
73
|
+
}
|
|
74
|
+
if (rel.startsWith("/"))
|
|
75
|
+
rel = rel.slice(1);
|
|
76
|
+
const segments = rel.split("/").filter((s) => s.length > 0);
|
|
77
|
+
if (segments.some((s) => s === "..")) {
|
|
78
|
+
throw new TenantConfigPathError(requested, "contains '..' segment");
|
|
79
|
+
}
|
|
80
|
+
const root = getTenantConfigRoot(tenantHomeDir);
|
|
81
|
+
const resolved = path.resolve(root, ...segments);
|
|
82
|
+
if (resolved !== root && !resolved.startsWith(root + path.sep)) {
|
|
83
|
+
throw new TenantConfigPathError(requested, "escapes tenant-config root");
|
|
84
|
+
}
|
|
85
|
+
return resolved;
|
|
86
|
+
}
|
|
87
|
+
/** Convert an absolute path back into a `tenant-config:///<rel>`
|
|
88
|
+
* URI for use in tool result text. Throws if `abs` is outside the
|
|
89
|
+
* tenant-config root. */
|
|
90
|
+
export function toTenantConfigUri(tenantHomeDir, abs) {
|
|
91
|
+
const root = getTenantConfigRoot(tenantHomeDir);
|
|
92
|
+
const rel = path.relative(root, abs).replace(/\\/g, "/");
|
|
93
|
+
if (rel.startsWith("..")) {
|
|
94
|
+
throw new TenantConfigPathError(abs, "escapes tenant-config root");
|
|
95
|
+
}
|
|
96
|
+
if (rel === "" || rel === ".")
|
|
97
|
+
return "tenant-config:///";
|
|
98
|
+
return "tenant-config:///" + rel;
|
|
99
|
+
}
|
|
100
|
+
export function checkWritable(tenantHomeDir, abs, scope) {
|
|
101
|
+
const root = getTenantConfigRoot(tenantHomeDir);
|
|
102
|
+
const rel = path.relative(root, abs).replace(/\\/g, "/");
|
|
103
|
+
if (rel === "" || rel === "." || rel.startsWith("..")) {
|
|
104
|
+
return { ok: false, reason: "outside tenant-config root" };
|
|
105
|
+
}
|
|
106
|
+
const segments = rel.split("/");
|
|
107
|
+
// Mirror tree (`skills/_host/...`) is a read-only window onto
|
|
108
|
+
// host- and plugin-shipped SKILL.md bundles. Writing there is
|
|
109
|
+
// pointless because the host overwrites the tree on every
|
|
110
|
+
// boot from the source-of-truth files in the plugin / host
|
|
111
|
+
// repo. Refuse explicitly so the agent gets a clear message
|
|
112
|
+
// instead of editing a doomed file.
|
|
113
|
+
if (segments[0] === "skills" && segments[1] === "_host") {
|
|
114
|
+
return {
|
|
115
|
+
ok: false,
|
|
116
|
+
reason: "skills/_host/ is a read-only mirror of host & plugin skills (overwritten on every boot). Edit the source SKILL.md in the plugin or host repo instead.",
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// Main agent. Allowed prefixes:
|
|
120
|
+
// skills/... → shared skill bundle
|
|
121
|
+
// main/skills/... → main-only skill bundle
|
|
122
|
+
// workers/<slug>/... → author / edit any worker
|
|
123
|
+
// bundle (agent.json,
|
|
124
|
+
// SOUL.md, skills/, etc).
|
|
125
|
+
// Anything else (root files, future top-level surfaces) is
|
|
126
|
+
// rejected so the agent can't accidentally write SOUL/MEMORY
|
|
127
|
+
// for the tenant itself.
|
|
128
|
+
if (scope.kind === "main") {
|
|
129
|
+
if (segments[0] === "skills") {
|
|
130
|
+
return { ok: true, scopeLabel: "shared" };
|
|
131
|
+
}
|
|
132
|
+
if (segments[0] === "main" && segments[1] === "skills") {
|
|
133
|
+
return { ok: true, scopeLabel: "main" };
|
|
134
|
+
}
|
|
135
|
+
if (segments[0] === "workers" &&
|
|
136
|
+
segments[1] &&
|
|
137
|
+
segments[1].length > 0) {
|
|
138
|
+
return { ok: true, scopeLabel: `workers/${segments[1]}` };
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
reason: "main agent may only write under skills/, main/skills/, or workers/<slug>/ in tenant-config",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
// Worker. Strict: only the worker's own skills/ directory.
|
|
146
|
+
// Workers should not edit their own agent.json / SOUL.md (loop
|
|
147
|
+
// would self-reload mid-run). The slug is preferred because the
|
|
148
|
+
// filesystem keys off slug, not kind. If a slug isn't supplied
|
|
149
|
+
// we fall back to kind for legacy callers — mostly the
|
|
150
|
+
// existing pre-PR-A path.
|
|
151
|
+
const workerSegment = scope.slug || scope.workerKind;
|
|
152
|
+
if (segments[0] === "workers" &&
|
|
153
|
+
segments[1] === workerSegment &&
|
|
154
|
+
segments[2] === "skills") {
|
|
155
|
+
return { ok: true, scopeLabel: `worker:${workerSegment}` };
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
ok: false,
|
|
159
|
+
reason: `worker (slug=${scope.slug ?? "—"}, kind=${scope.workerKind}) may only write under workers/${workerSegment}/skills/`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=tenant-config-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-helper.js","sourceRoot":"","sources":["../../src/tools/tenant-config-helper.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,0DAA0D;AAC1D,oEAAoE;AACpE,mEAAmE;AACnE,6CAA6C;AAC7C,EAAE;AACF,iEAAiE;AACjE,gEAAgE;AAChE,mEAAmE;AACnE,kEAAkE;AAClE,uDAAuD;AAEvD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAElB;IADnB,IAAI,GAAG,0BAAmC,CAAC;IACpD,YAA4B,SAAiB,EA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,CAAC,UAAU,kCAAkC,aAAa,UAAU;KAC7H,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Tool } from "@earendil-works/pi-ai";
|
|
2
|
+
interface ListEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
type: "directory" | "file" | "other";
|
|
6
|
+
size: number;
|
|
7
|
+
modifiedMs: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TenantConfigListResult {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
text: string;
|
|
12
|
+
entries?: ListEntry[];
|
|
13
|
+
truncated?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function tenantConfigListSchema(): Tool;
|
|
16
|
+
export declare function executeTenantConfigList(tenantHomeDir: string, args: {
|
|
17
|
+
path?: string;
|
|
18
|
+
}): TenantConfigListResult;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=tenant-config-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-list.d.ts","sourceRoot":"","sources":["../../src/tools/tenant-config-list.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAUlD,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAiB7C;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACtB,sBAAsB,CAsExB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// tenant_config_list — agent tool that lists entries inside the
|
|
2
|
+
// tenant-shared config tree. The path is rooted at
|
|
3
|
+
// `<tenant>/workspace/_tenant/config/` so an empty argument lists
|
|
4
|
+
// the top-level layers (skills/, main/, workers/, ...).
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { Type } from "typebox";
|
|
8
|
+
import { resolveInTenantConfig, toTenantConfigUri, TenantConfigPathError, getTenantConfigRoot, } from "./tenant-config-helper.js";
|
|
9
|
+
const MAX_ENTRIES = 5000;
|
|
10
|
+
export function tenantConfigListSchema() {
|
|
11
|
+
return {
|
|
12
|
+
name: "tenant_config_list",
|
|
13
|
+
description: "List entries in the tenant-shared config tree (the root of " +
|
|
14
|
+
"every tenant_config:// path). Use this to discover skills " +
|
|
15
|
+
"under `skills/`, `main/skills/`, or `workers/<kind>/skills/` — " +
|
|
16
|
+
'the path is relative to the config root ("/" = root).',
|
|
17
|
+
parameters: Type.Object({
|
|
18
|
+
path: Type.Optional(Type.String({
|
|
19
|
+
description: 'Path under the config root (e.g. "/", "/main/skills", "tenant-config:///main/skills"). Default "/".',
|
|
20
|
+
})),
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function executeTenantConfigList(tenantHomeDir, args) {
|
|
25
|
+
const requested = args.path ?? "/";
|
|
26
|
+
let resolved;
|
|
27
|
+
try {
|
|
28
|
+
resolved = resolveInTenantConfig(tenantHomeDir, requested);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
if (err instanceof TenantConfigPathError) {
|
|
32
|
+
return { ok: false, text: err.message };
|
|
33
|
+
}
|
|
34
|
+
throw err;
|
|
35
|
+
}
|
|
36
|
+
// Auto-create the root on first read so an empty `_tenant/`
|
|
37
|
+
// doesn't 404.
|
|
38
|
+
const root = getTenantConfigRoot(tenantHomeDir);
|
|
39
|
+
if (resolved === root && !fs.existsSync(resolved)) {
|
|
40
|
+
fs.mkdirSync(resolved, { recursive: true });
|
|
41
|
+
}
|
|
42
|
+
if (!fs.existsSync(resolved)) {
|
|
43
|
+
return { ok: false, text: `not found: ${requested}` };
|
|
44
|
+
}
|
|
45
|
+
const stat = fs.statSync(resolved);
|
|
46
|
+
if (!stat.isDirectory()) {
|
|
47
|
+
return { ok: false, text: `not a directory: ${requested}` };
|
|
48
|
+
}
|
|
49
|
+
const dirents = fs.readdirSync(resolved, { withFileTypes: true });
|
|
50
|
+
const truncated = dirents.length > MAX_ENTRIES;
|
|
51
|
+
const slice = dirents.slice(0, MAX_ENTRIES);
|
|
52
|
+
const entries = slice.map((d) => {
|
|
53
|
+
const full = path.join(resolved, d.name);
|
|
54
|
+
let size = 0;
|
|
55
|
+
let modifiedMs = 0;
|
|
56
|
+
try {
|
|
57
|
+
const s = fs.statSync(full);
|
|
58
|
+
size = s.size;
|
|
59
|
+
modifiedMs = s.mtimeMs;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
/* swallow — broken symlinks etc. */
|
|
63
|
+
}
|
|
64
|
+
const type = d.isDirectory()
|
|
65
|
+
? "directory"
|
|
66
|
+
: d.isFile()
|
|
67
|
+
? "file"
|
|
68
|
+
: "other";
|
|
69
|
+
return {
|
|
70
|
+
name: d.name,
|
|
71
|
+
path: toTenantConfigUri(tenantHomeDir, full),
|
|
72
|
+
type,
|
|
73
|
+
size,
|
|
74
|
+
modifiedMs,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
entries.sort((a, b) => {
|
|
78
|
+
if (a.type !== b.type) {
|
|
79
|
+
if (a.type === "directory")
|
|
80
|
+
return -1;
|
|
81
|
+
if (b.type === "directory")
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
return a.name.localeCompare(b.name);
|
|
85
|
+
});
|
|
86
|
+
const lines = entries.map((e) => e.type === "directory" ? `${e.path}/` : `${e.path} (${e.size} bytes)`);
|
|
87
|
+
const header = `Tenant config ${toTenantConfigUri(tenantHomeDir, resolved)} (${entries.length} ${entries.length === 1 ? "entry" : "entries"}${truncated ? ", truncated" : ""}):`;
|
|
88
|
+
return {
|
|
89
|
+
ok: true,
|
|
90
|
+
text: [header, ...lines].join("\n"),
|
|
91
|
+
entries,
|
|
92
|
+
truncated,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=tenant-config-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-list.js","sourceRoot":"","sources":["../../src/tools/tenant-config-list.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,mDAAmD;AACnD,kEAAkE;AAClE,wDAAwD;AAExD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,GAAG,IAAI,CAAC;AAiBzB,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,6DAA6D;YAC7D,4DAA4D;YAC5D,iEAAiE;YACjE,uDAAuD;QACzD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,QAAQ,CACjB,IAAI,CAAC,MAAM,CAAC;gBACV,WAAW,EACT,qGAAqG;aACxG,CAAC,CACH;SACF,CAAC;KACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,aAAqB,EACrB,IAAuB;IAEvB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;IACnC,IAAI,QAAgB,CAAC;IACrB,IA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C,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,IAAI,SAAS,CACvE,CAAC;IACF,MAAM,MAAM,GAAG,iBAAiB,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,KAAK,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;IACjL,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACnC,OAAO;QACP,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Tool } from "@earendil-works/pi-ai";
|
|
2
|
+
export declare const TC_MAX_TEXT_BYTES = 500000;
|
|
3
|
+
export interface TenantConfigReadResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
text: string;
|
|
6
|
+
binary?: boolean;
|
|
7
|
+
size?: number;
|
|
8
|
+
bytesReturned?: number;
|
|
9
|
+
nextOffset?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function tenantConfigReadSchema(): Tool;
|
|
12
|
+
export declare function executeTenantConfigRead(tenantHomeDir: string, args: {
|
|
13
|
+
path: string;
|
|
14
|
+
offset?: number;
|
|
15
|
+
limit?: number;
|
|
16
|
+
}): TenantConfigReadResult;
|
|
17
|
+
//# sourceMappingURL=tenant-config-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-read.d.ts","sourceRoot":"","sources":["../../src/tools/tenant-config-read.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAOlD,eAAO,MAAM,iBAAiB,SAAU,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CA6B7C;AAED,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACtD,sBAAsB,CAyDxB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// tenant_config_read — read a file inside the tenant config tree.
|
|
2
|
+
// Mirrors `read_file` but rooted at `<tenant>/workspace/_tenant/config/`.
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { Type } from "typebox";
|
|
5
|
+
import { resolveInTenantConfig, toTenantConfigUri, TenantConfigPathError, } from "./tenant-config-helper.js";
|
|
6
|
+
export const TC_MAX_TEXT_BYTES = 500_000;
|
|
7
|
+
export function tenantConfigReadSchema() {
|
|
8
|
+
return {
|
|
9
|
+
name: "tenant_config_read",
|
|
10
|
+
description: `Read a file from the tenant config tree (skills, etc). ` +
|
|
11
|
+
`Returns up to ${TC_MAX_TEXT_BYTES / 1000} KB per call; for ` +
|
|
12
|
+
`larger files page through with offset+limit. Path is rooted ` +
|
|
13
|
+
`at the tenant-config root, so e.g. ` +
|
|
14
|
+
`"main/skills/skill-creator/SKILL.md" or the URI form ` +
|
|
15
|
+
`"tenant-config:///main/skills/skill-creator/SKILL.md" both work.`,
|
|
16
|
+
parameters: Type.Object({
|
|
17
|
+
path: Type.String({
|
|
18
|
+
description: 'Path under the tenant-config root (or a tenant-config:/// URI).',
|
|
19
|
+
}),
|
|
20
|
+
offset: Type.Optional(Type.Integer({
|
|
21
|
+
minimum: 0,
|
|
22
|
+
description: "Byte offset to start reading from. Default 0.",
|
|
23
|
+
})),
|
|
24
|
+
limit: Type.Optional(Type.Integer({
|
|
25
|
+
minimum: 1,
|
|
26
|
+
description: `Max bytes to return. Capped at ${TC_MAX_TEXT_BYTES}.`,
|
|
27
|
+
})),
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function executeTenantConfigRead(tenantHomeDir, args) {
|
|
32
|
+
let resolved;
|
|
33
|
+
try {
|
|
34
|
+
resolved = resolveInTenantConfig(tenantHomeDir, args.path);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
if (err instanceof TenantConfigPathError) {
|
|
38
|
+
return { ok: false, text: err.message };
|
|
39
|
+
}
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
if (!fs.existsSync(resolved)) {
|
|
43
|
+
return { ok: false, text: `not found: ${args.path}` };
|
|
44
|
+
}
|
|
45
|
+
const stat = fs.statSync(resolved);
|
|
46
|
+
if (stat.isDirectory()) {
|
|
47
|
+
return { ok: false, text: `is a directory, not a file: ${args.path}` };
|
|
48
|
+
}
|
|
49
|
+
const offset = Math.max(0, Math.floor(args.offset ?? 0));
|
|
50
|
+
const limit = Math.max(1, Math.min(args.limit ?? TC_MAX_TEXT_BYTES, TC_MAX_TEXT_BYTES));
|
|
51
|
+
const fd = fs.openSync(resolved, "r");
|
|
52
|
+
try {
|
|
53
|
+
const buf = Buffer.alloc(limit);
|
|
54
|
+
const bytesRead = fs.readSync(fd, buf, 0, limit, offset);
|
|
55
|
+
const slice = buf.subarray(0, bytesRead);
|
|
56
|
+
const probe = slice.subarray(0, Math.min(slice.length, 4096));
|
|
57
|
+
if (probe.includes(0)) {
|
|
58
|
+
return {
|
|
59
|
+
ok: true,
|
|
60
|
+
text: `(binary file: ${stat.size} bytes; not shown)`,
|
|
61
|
+
binary: true,
|
|
62
|
+
size: stat.size,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const content = slice.toString("utf8");
|
|
66
|
+
const nextOffset = offset + bytesRead;
|
|
67
|
+
const more = nextOffset < stat.size;
|
|
68
|
+
const uri = toTenantConfigUri(tenantHomeDir, resolved);
|
|
69
|
+
const header = stat.size <= TC_MAX_TEXT_BYTES
|
|
70
|
+
? `// ${uri} (${stat.size} bytes)`
|
|
71
|
+
: `// ${uri} bytes ${offset}–${nextOffset} of ${stat.size}` +
|
|
72
|
+
(more
|
|
73
|
+
? ` — call tenant_config_read again with offset=${nextOffset} for the next chunk`
|
|
74
|
+
: " (final chunk)");
|
|
75
|
+
return {
|
|
76
|
+
ok: true,
|
|
77
|
+
text: `${header}\n${content}`,
|
|
78
|
+
size: stat.size,
|
|
79
|
+
bytesReturned: bytesRead,
|
|
80
|
+
nextOffset: more ? nextOffset : undefined,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
fs.closeSync(fd);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=tenant-config-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-read.js","sourceRoot":"","sources":["../../src/tools/tenant-config-read.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,0EAA0E;AAE1E,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAWzC,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,yDAAyD;YACzD,iBAAiB,iBAAiB,GAAG,IAAI,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,CAAC,IAAI,CAAC;QACpC,MAAM,GAAG,GAAG,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACvD,MAAM,MAAM,GACV,IAAI,CAAC,IAAI,IAAI,iBAAiB;YAC5B,CAAC,CAAC,MAAM,GAAG,KAAK,IAAI,CAAC,IAAI,SAAS;YAClC,CAAC,CAAC,MAAM,GAAG,UAAU,MAAM,IAAI,UAAU,OAAO,IAAI,CAAC,IAAI,EAAE;gBACzD,CAAC,IAAI;oBACH,CAAC,CAAC,gDAAgD,UAAU,qBAAqB;oBACjF,CAAC,CAAC,gBAAgB,CAAC,CAAC;QAC5B,OAAO;YACL,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,GAAG,MAAM,KAAK,OAAO,EAAE;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,SAAS;YACxB,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SAC1C,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Tool } from "@earendil-works/pi-ai";
|
|
2
|
+
import { AgentScope } from "./tenant-config-helper.js";
|
|
3
|
+
export interface TenantConfigWriteResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
text: string;
|
|
6
|
+
bytesWritten?: number;
|
|
7
|
+
scope?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function tenantConfigWriteSchema(): Tool;
|
|
10
|
+
export declare function executeTenantConfigWrite(tenantHomeDir: string, scope: AgentScope, args: {
|
|
11
|
+
path: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}): TenantConfigWriteResult;
|
|
14
|
+
//# sourceMappingURL=tenant-config-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-write.d.ts","sourceRoot":"","sources":["../../src/tools/tenant-config-write.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACL,UAAU,EAKX,MAAM,2BAA2B,CAAC;AAInC,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAwB9C;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtC,uBAAuB,CAqCzB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// tenant_config_write — create / overwrite a file in the tenant
|
|
2
|
+
// config tree. Write boundary is enforced by `checkWritable`:
|
|
3
|
+
//
|
|
4
|
+
// main agent → skills/..., main/skills/...
|
|
5
|
+
// worker:<kind> → workers/<kind>/skills/...
|
|
6
|
+
//
|
|
7
|
+
// Reads are unrestricted (see tenant_config_list / read), but writes
|
|
8
|
+
// outside the agent's allowed scope are rejected so a worker can't
|
|
9
|
+
// rewrite the main agent's skills and a misbehaved main agent can't
|
|
10
|
+
// touch a worker's tree.
|
|
11
|
+
import fs from "node:fs";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { Type } from "typebox";
|
|
14
|
+
import { checkWritable, resolveInTenantConfig, toTenantConfigUri, TenantConfigPathError, } from "./tenant-config-helper.js";
|
|
15
|
+
const MAX_WRITE_BYTES = 5_000_000; // 5 MB
|
|
16
|
+
export function tenantConfigWriteSchema() {
|
|
17
|
+
return {
|
|
18
|
+
name: "tenant_config_write",
|
|
19
|
+
description: "Create or overwrite a file in the tenant config tree. The " +
|
|
20
|
+
"write boundary is scope-aware: main agents may write under " +
|
|
21
|
+
"`skills/` or `main/skills/`; workers may write only under " +
|
|
22
|
+
"`workers/<their-kind>/skills/`. Reads are unrestricted. Use " +
|
|
23
|
+
"this to author or update a SKILL.md (and its sibling files " +
|
|
24
|
+
"like scripts/foo.py, references/bar.md, assets/baz.txt).\n\n" +
|
|
25
|
+
"Guidelines:\n" +
|
|
26
|
+
"- Use `tenant_config_write` for new files or complete " +
|
|
27
|
+
"rewrites. For targeted changes to an existing file prefer " +
|
|
28
|
+
"`tenant_config_edit`.",
|
|
29
|
+
parameters: Type.Object({
|
|
30
|
+
path: Type.String({
|
|
31
|
+
description: 'Path under the tenant-config root, e.g. "main/skills/foo/SKILL.md".',
|
|
32
|
+
}),
|
|
33
|
+
content: Type.String({
|
|
34
|
+
description: "Full UTF-8 file contents to write.",
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function executeTenantConfigWrite(tenantHomeDir, scope, args) {
|
|
40
|
+
let resolved;
|
|
41
|
+
try {
|
|
42
|
+
resolved = resolveInTenantConfig(tenantHomeDir, args.path);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
if (err instanceof TenantConfigPathError) {
|
|
46
|
+
return { ok: false, text: err.message };
|
|
47
|
+
}
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
50
|
+
const writable = checkWritable(tenantHomeDir, resolved, scope);
|
|
51
|
+
if (!writable.ok) {
|
|
52
|
+
return {
|
|
53
|
+
ok: false,
|
|
54
|
+
text: `not writable: ${writable.reason}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (fs.existsSync(resolved) && fs.statSync(resolved).isDirectory()) {
|
|
58
|
+
return { ok: false, text: `is a directory: ${args.path}` };
|
|
59
|
+
}
|
|
60
|
+
const buf = Buffer.from(args.content, "utf8");
|
|
61
|
+
if (buf.length > MAX_WRITE_BYTES) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
text: `content too large: ${buf.length} bytes > ${MAX_WRITE_BYTES} cap`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
fs.mkdirSync(path.dirname(resolved), { recursive: true });
|
|
68
|
+
const tmp = `${resolved}.tmp.${process.pid}.${Date.now()}`;
|
|
69
|
+
fs.writeFileSync(tmp, buf);
|
|
70
|
+
fs.renameSync(tmp, resolved);
|
|
71
|
+
return {
|
|
72
|
+
ok: true,
|
|
73
|
+
text: `wrote ${buf.length} bytes to ${toTenantConfigUri(tenantHomeDir, resolved)} [scope=${writable.scopeLabel}]`,
|
|
74
|
+
bytesWritten: buf.length,
|
|
75
|
+
scope: writable.scopeLabel,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=tenant-config-write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-config-write.js","sourceRoot":"","sources":["../../src/tools/tenant-config-write.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,8DAA8D;AAC9D,EAAE;AACF,4DAA4D;AAC5D,+CAA+C;AAC/C,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AACnE,oEAAoE;AACpE,yBAAyB;AAEzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAEL,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,eAAe,GAAG,SAAS,CAAC,CAAC,OAAO;AAS1C,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,4DAA4D;YAC5D,6DAA6D;YAC7D,4DAA4D;YAC5D,8DAA8D;YAC9D,6DAA6D;YAC7D,8DAA8D;YAC9D,eAAe;YACf,wDAAwD;YACxD,4DAA4D;YAC5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,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;QACjC,OAAO;YACL,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,sBAAsB,GAAG,CAAC,MAAM,YAAY,eAAe,MAAM;SACxE,CAAC;IACJ,CAAC;IACD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,GAAG,QAAQ,QAAQ,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IAC3D,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7B,OAAO;QACL,EAAE,EAAE,IAAI;QACR,IAAI,EAAE,SAAS,GAAG,CAAC,MAAM,aAAa,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,WAAW,QAAQ,CAAC,UAAU,GAAG;QACjH,YAAY,EAAE,GAAG,CAAC,MAAM;QACxB,KAAK,EAAE,QAAQ,CAAC,UAAU;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ShapedSource {
|
|
2
|
+
/** File contents with any leading UTF-8 BOM removed. */
|
|
3
|
+
text: string;
|
|
4
|
+
/** True if the original bytes started with a UTF-8 BOM. */
|
|
5
|
+
hadBom: boolean;
|
|
6
|
+
/** "\r\n" if the file uses CRLF anywhere, else "\n". */
|
|
7
|
+
ending: "\n" | "\r\n";
|
|
8
|
+
}
|
|
9
|
+
/** Inspect a freshly-read file's contents and return the
|
|
10
|
+
* normalised text plus shape metadata for round-tripping. */
|
|
11
|
+
export declare function shapeOf(raw: string): ShapedSource;
|
|
12
|
+
/** Normalise a model-supplied snippet to a target line ending.
|
|
13
|
+
* Collapses any \r\n in the input to \n first (so mixed input is
|
|
14
|
+
* cleaned), then expands to the target. Idempotent for already-
|
|
15
|
+
* normalised input. */
|
|
16
|
+
export declare function normaliseEnding(input: string, target: "\n" | "\r\n"): string;
|
|
17
|
+
/** Re-prepend a BOM if the source had one. Always pass the
|
|
18
|
+
* already-edited text in. */
|
|
19
|
+
export declare function applyShape(text: string, source: ShapedSource): string;
|
|
20
|
+
//# sourceMappingURL=text-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-shape.d.ts","sourceRoot":"","sources":["../../src/tools/text-shape.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;CACvB;AAED;8DAC8D;AAC9D,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAKjD;AAED;;;wBAGwB;AACxB,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,IAAI,GAAG,MAAM,GACpB,MAAM,CAIR;AAED;8BAC8B;AAC9B,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAErE"}
|