@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,895 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Workboard plugin - client side.
|
|
3
|
+
//
|
|
4
|
+
// Right-column kanban panel inside the chat shell. 3 horizontal
|
|
5
|
+
// columns (todo / in-progress / done), sized for the narrow right
|
|
6
|
+
// rail. Add tasks inline (Todo column), drag across columns,
|
|
7
|
+
// dependency chips show 1f512 / 1f517 state.
|
|
8
|
+
//
|
|
9
|
+
// `WorkboardAdminPage` is kept in this file but NOT contributed via
|
|
10
|
+
// the manifest - it lived as a /admin/workboard/main page in earlier
|
|
11
|
+
// drafts; Yu asked to drop the admin surface for v0.2 because the
|
|
12
|
+
// right-rail panel covers everything the human needs. We keep the
|
|
13
|
+
// component so re-exposing it later is a one-line manifest change
|
|
14
|
+
// instead of re-deriving the full editor.
|
|
15
|
+
//
|
|
16
|
+
// Layout follows the closed-source Tianshu TaskBoard:
|
|
17
|
+
// - 3 columns side-by-side, vertical scroll inside each column;
|
|
18
|
+
// - project chips at the top (horizontal scroller), Inbox sticks
|
|
19
|
+
// last so the user's named projects come first;
|
|
20
|
+
// - per-column `+` button opens an inline title input; Enter submits;
|
|
21
|
+
// - cards are draggable across columns (HTML5 dnd, optimistic move).
|
|
22
|
+
//
|
|
23
|
+
// Both surfaces hit /api/p/workboard/*.
|
|
24
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
25
|
+
import { createPortal } from "react-dom";
|
|
26
|
+
import { AlertTriangle, Bot, CheckCircle2, ChevronDown, ChevronRight, Clock, FileText, Hammer, Kanban, Link2, Loader2, Lock, Plus, RefreshCw, ScrollText, Trash2, User, X, XCircle, Zap, } from "lucide-react";
|
|
27
|
+
import { useOpenFile, } from "@tianshu/plugin-sdk/client";
|
|
28
|
+
import WorkerAgentsPage from "./worker-agents-page.js";
|
|
29
|
+
const API_BASE = "/api/p/workboard";
|
|
30
|
+
const PROJECT_INBOX_KEY = "***";
|
|
31
|
+
const BOARD_COLUMNS = [
|
|
32
|
+
{ status: "ready", label: "Ready", color: "border-indigo-500/40 bg-indigo-500/5", dot: "bg-indigo-400" },
|
|
33
|
+
{ status: "in_progress", label: "In progress", color: "border-amber-500/40 bg-amber-500/5", dot: "bg-amber-400 animate-pulse" },
|
|
34
|
+
{ status: "done", label: "Done", color: "border-emerald-500/40 bg-emerald-500/5", dot: "bg-emerald-400" },
|
|
35
|
+
];
|
|
36
|
+
// `stalled` is no longer a column - it's a label that paints a
|
|
37
|
+
// warning chip on the ready card. See LABELED_BADGES below.
|
|
38
|
+
async function getJson(url) {
|
|
39
|
+
const r = await fetch(url, { credentials: "include" });
|
|
40
|
+
if (!r.ok)
|
|
41
|
+
throw new Error(`${r.status} ${r.statusText}`);
|
|
42
|
+
return (await r.json());
|
|
43
|
+
}
|
|
44
|
+
async function sendJson(url, body, method = "POST") {
|
|
45
|
+
const init = {
|
|
46
|
+
method,
|
|
47
|
+
credentials: "include",
|
|
48
|
+
};
|
|
49
|
+
if (method !== "DELETE") {
|
|
50
|
+
init.headers = { "Content-Type": "application/json" };
|
|
51
|
+
init.body = JSON.stringify(body ?? {});
|
|
52
|
+
}
|
|
53
|
+
const r = await fetch(url, init);
|
|
54
|
+
if (!r.ok) {
|
|
55
|
+
let msg = `${r.status} ${r.statusText}`;
|
|
56
|
+
try {
|
|
57
|
+
const err = (await r.json());
|
|
58
|
+
if (err.error)
|
|
59
|
+
msg += ` (${err.error})`;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
/* swallow */
|
|
63
|
+
}
|
|
64
|
+
throw new Error(msg);
|
|
65
|
+
}
|
|
66
|
+
if (r.status === 204)
|
|
67
|
+
return undefined;
|
|
68
|
+
return (await r.json());
|
|
69
|
+
}
|
|
70
|
+
function fmtRelative(ms) {
|
|
71
|
+
if (!ms)
|
|
72
|
+
return "";
|
|
73
|
+
const diff = Date.now() - ms;
|
|
74
|
+
if (diff < 60_000)
|
|
75
|
+
return "just now";
|
|
76
|
+
if (diff < 3_600_000)
|
|
77
|
+
return `${Math.floor(diff / 60_000)}m ago`;
|
|
78
|
+
if (diff < 86_400_000)
|
|
79
|
+
return `${Math.floor(diff / 3_600_000)}h ago`;
|
|
80
|
+
return `${Math.floor(diff / 86_400_000)}d ago`;
|
|
81
|
+
}
|
|
82
|
+
function projectChipsFromSummary(projects, visibleStatuses) {
|
|
83
|
+
const sumFor = (p) => {
|
|
84
|
+
let n = 0;
|
|
85
|
+
if (visibleStatuses.includes("ready"))
|
|
86
|
+
n += p.ready;
|
|
87
|
+
if (visibleStatuses.includes("in_progress"))
|
|
88
|
+
n += p.inProgress;
|
|
89
|
+
if (visibleStatuses.includes("done"))
|
|
90
|
+
n += p.done;
|
|
91
|
+
return n;
|
|
92
|
+
};
|
|
93
|
+
const filtered = projects
|
|
94
|
+
.map((p) => ({ key: p.project, label: p.project, count: sumFor(p) }))
|
|
95
|
+
.filter((p) => p.count > 0);
|
|
96
|
+
// Real projects first, alphabetical. Inbox sticks at the end.
|
|
97
|
+
const real = filtered
|
|
98
|
+
.filter((p) => p.key !== PROJECT_INBOX_KEY)
|
|
99
|
+
.sort((a, b) => a.label.localeCompare(b.label));
|
|
100
|
+
const inbox = filtered.filter((p) => p.key === PROJECT_INBOX_KEY);
|
|
101
|
+
return [...real, ...inbox.map((p) => ({ ...p, label: "Inbox" }))];
|
|
102
|
+
}
|
|
103
|
+
function useBoardController(opts) {
|
|
104
|
+
const [tasks, setTasks] = useState(null);
|
|
105
|
+
const [projects, setProjects] = useState([]);
|
|
106
|
+
const [worker, setWorker] = useState(null);
|
|
107
|
+
const [agentNames, setAgentNames] = useState(() => new Map());
|
|
108
|
+
const [error, setError] = useState(null);
|
|
109
|
+
const [busyId, setBusyId] = useState(null);
|
|
110
|
+
const dragTaskId = useRef(null);
|
|
111
|
+
const reload = useCallback(async () => {
|
|
112
|
+
try {
|
|
113
|
+
const params = new URLSearchParams();
|
|
114
|
+
if (opts.includeArchived)
|
|
115
|
+
params.set("include_aborted", "1");
|
|
116
|
+
const url = params.toString().length === 0
|
|
117
|
+
? `${API_BASE}/tasks`
|
|
118
|
+
: `${API_BASE}/tasks?${params.toString()}`;
|
|
119
|
+
const requests = [
|
|
120
|
+
getJson(url),
|
|
121
|
+
getJson(`${API_BASE}/projects`),
|
|
122
|
+
getJson(`${API_BASE}/agents`),
|
|
123
|
+
];
|
|
124
|
+
if (opts.withWorker) {
|
|
125
|
+
requests.push(getJson(`${API_BASE}/workers/status`));
|
|
126
|
+
}
|
|
127
|
+
const results = await Promise.all(requests);
|
|
128
|
+
setTasks(results[0].tasks);
|
|
129
|
+
setProjects(results[1].projects);
|
|
130
|
+
const agentList = results[2].agents;
|
|
131
|
+
setAgentNames(new Map(agentList.map((a) => [a.id, a.name])));
|
|
132
|
+
if (opts.withWorker) {
|
|
133
|
+
setWorker(results[3]);
|
|
134
|
+
}
|
|
135
|
+
setError(null);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
139
|
+
}
|
|
140
|
+
}, [opts.includeArchived, opts.withWorker]);
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
void reload();
|
|
143
|
+
const id = window.setInterval(() => void reload(), 3000);
|
|
144
|
+
return () => window.clearInterval(id);
|
|
145
|
+
}, [reload]);
|
|
146
|
+
const moveTask = useCallback(async (id, status) => {
|
|
147
|
+
// Optimistic update so the card lands in the new column without
|
|
148
|
+
// the 3s polling lag.
|
|
149
|
+
setTasks((prev) => prev ? prev.map((t) => (t.id === id ? { ...t, status } : t)) : prev);
|
|
150
|
+
setBusyId(id);
|
|
151
|
+
try {
|
|
152
|
+
await sendJson(`${API_BASE}/tasks/${id}`, { status }, "PATCH");
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
156
|
+
}
|
|
157
|
+
finally {
|
|
158
|
+
setBusyId(null);
|
|
159
|
+
await reload();
|
|
160
|
+
}
|
|
161
|
+
}, [reload]);
|
|
162
|
+
const addTaskInColumn = useCallback(async (input, status) => {
|
|
163
|
+
try {
|
|
164
|
+
const project = input.project && input.project !== PROJECT_INBOX_KEY
|
|
165
|
+
? input.project
|
|
166
|
+
: undefined;
|
|
167
|
+
// POST /tasks is now a batch endpoint. For single-card adds
|
|
168
|
+
// (the kanban + button) we wrap into a 1-element batch and
|
|
169
|
+
// surface the per-row error if it failed.
|
|
170
|
+
const resp = await sendJson(`${API_BASE}/tasks`, {
|
|
171
|
+
tasks: [
|
|
172
|
+
{
|
|
173
|
+
title: input.title,
|
|
174
|
+
status,
|
|
175
|
+
project,
|
|
176
|
+
priority: input.priority || 0,
|
|
177
|
+
workerRole: input.workerRole || null,
|
|
178
|
+
description: input.description || null,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
});
|
|
182
|
+
const row = resp?.results?.[0];
|
|
183
|
+
if (row && !row.ok) {
|
|
184
|
+
throw new Error(row.error ?? "create_failed");
|
|
185
|
+
}
|
|
186
|
+
await reload();
|
|
187
|
+
}
|
|
188
|
+
catch (err) {
|
|
189
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
190
|
+
}
|
|
191
|
+
}, [reload]);
|
|
192
|
+
const patchTask = useCallback(async (id, patch) => {
|
|
193
|
+
setBusyId(id);
|
|
194
|
+
try {
|
|
195
|
+
await sendJson(`${API_BASE}/tasks/${id}`, patch, "PATCH");
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
setBusyId(null);
|
|
202
|
+
await reload();
|
|
203
|
+
}
|
|
204
|
+
}, [reload]);
|
|
205
|
+
const deleteTask = useCallback(async (id) => {
|
|
206
|
+
setBusyId(id);
|
|
207
|
+
try {
|
|
208
|
+
// DELETE is now a batch endpoint at POST /tasks/delete.
|
|
209
|
+
// Wrap the single-id case into a 1-element ids array so the
|
|
210
|
+
// existing modal "Delete" button keeps working unchanged.
|
|
211
|
+
const resp = await sendJson(`${API_BASE}/tasks/delete`, { ids: [id] });
|
|
212
|
+
const row = resp?.results?.[0];
|
|
213
|
+
if (row && !row.ok) {
|
|
214
|
+
throw new Error(row.error ?? "delete_failed");
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
219
|
+
}
|
|
220
|
+
finally {
|
|
221
|
+
setBusyId(null);
|
|
222
|
+
await reload();
|
|
223
|
+
}
|
|
224
|
+
}, [reload]);
|
|
225
|
+
const bindDrag = useCallback(() => {
|
|
226
|
+
return {
|
|
227
|
+
onDragStart: (e, taskId) => {
|
|
228
|
+
dragTaskId.current = taskId;
|
|
229
|
+
e.dataTransfer.effectAllowed = "move";
|
|
230
|
+
e.dataTransfer.setData("text/plain", taskId);
|
|
231
|
+
},
|
|
232
|
+
onDragEnd: () => {
|
|
233
|
+
dragTaskId.current = null;
|
|
234
|
+
},
|
|
235
|
+
onDrop: (e, targetStatus) => {
|
|
236
|
+
const taskId = dragTaskId.current || e.dataTransfer.getData("text/plain");
|
|
237
|
+
if (!taskId)
|
|
238
|
+
return;
|
|
239
|
+
const task = (tasks ?? []).find((t) => t.id === taskId);
|
|
240
|
+
if (!task || task.status === targetStatus)
|
|
241
|
+
return;
|
|
242
|
+
void moveTask(taskId, targetStatus);
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}, [tasks, moveTask]);
|
|
246
|
+
return {
|
|
247
|
+
tasks,
|
|
248
|
+
projects,
|
|
249
|
+
worker,
|
|
250
|
+
agentNames,
|
|
251
|
+
error,
|
|
252
|
+
busyId,
|
|
253
|
+
reload,
|
|
254
|
+
moveTask,
|
|
255
|
+
addTaskInColumn,
|
|
256
|
+
patchTask,
|
|
257
|
+
deleteTask,
|
|
258
|
+
bindDrag,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
// ─── Right panel: compact kanban ─────────────────────────────────
|
|
262
|
+
function WorkboardPanel(_props) {
|
|
263
|
+
const ctrl = useBoardController({ includeArchived: false, withWorker: false });
|
|
264
|
+
const [projectFilter, setProjectFilter] = useState("");
|
|
265
|
+
const visibleTasks = useMemo(() => {
|
|
266
|
+
if (!ctrl.tasks)
|
|
267
|
+
return null;
|
|
268
|
+
return projectFilter
|
|
269
|
+
? ctrl.tasks.filter((t) => (t.project || PROJECT_INBOX_KEY) === projectFilter)
|
|
270
|
+
: ctrl.tasks;
|
|
271
|
+
}, [ctrl.tasks, projectFilter]);
|
|
272
|
+
const chips = useMemo(() => projectChipsFromSummary(ctrl.projects, ["ready", "in_progress", "done"]), [ctrl.projects]);
|
|
273
|
+
const drag = ctrl.bindDrag();
|
|
274
|
+
return (_jsxs("div", { className: "flex flex-col h-full bg-gray-950 text-gray-100", children: [_jsxs("header", { className: "flex items-center justify-between px-3 py-2 border-b border-gray-800 flex-shrink-0", children: [_jsxs("h2", { className: "flex items-center gap-1.5 font-semibold text-sm", children: [_jsx(Kanban, { className: "w-4 h-4" }), " Tasks"] }), _jsx("button", { type: "button", onClick: () => void ctrl.reload(), className: "text-[10px] uppercase tracking-wide text-gray-400 hover:text-gray-100", children: "Refresh" })] }), chips.length > 1 && (_jsx(ProjectChips, { chips: chips, active: projectFilter, onPick: setProjectFilter })), ctrl.error && (_jsx("div", { className: "px-3 py-1.5 text-[10px] bg-red-900/40 border-b border-red-800 text-red-100 flex-shrink-0", children: ctrl.error })), _jsx("div", { className: "flex-1 overflow-x-auto overflow-y-hidden", children: ctrl.tasks === null ? (_jsx("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: _jsx(Loader2, { className: "w-4 h-4 animate-spin" }) })) : (_jsx("div", { className: "flex gap-1.5 p-2 h-full items-stretch", children: BOARD_COLUMNS.map((col) => (_jsx(KanbanColumn, { column: col, tasks: (visibleTasks ?? [])
|
|
275
|
+
.filter((t) => t.status === col.status)
|
|
276
|
+
.sort((a, b) => col.status === "done"
|
|
277
|
+
? b.createdAt - a.createdAt
|
|
278
|
+
: a.createdAt - b.createdAt), busyId: ctrl.busyId, compact: true, onAddTask: (input) => void ctrl.addTaskInColumn({ ...input, project: input.project ?? projectFilter }, col.status), projects: ctrl.projects, workerRoles: KNOWN_WORKER_ROLES, agentNames: ctrl.agentNames, allTasks: ctrl.tasks ?? [], onPatchTask: ctrl.patchTask, onDragStart: drag.onDragStart, onDragEnd: drag.onDragEnd, onDrop: drag.onDrop }, col.status))) })) })] }));
|
|
279
|
+
}
|
|
280
|
+
// ─── Admin page: full board ──────────────────────────────────────
|
|
281
|
+
function WorkboardAdminPage(_props) {
|
|
282
|
+
const ctrl = useBoardController({ includeArchived: false, withWorker: true });
|
|
283
|
+
const [projectFilter, setProjectFilter] = useState("");
|
|
284
|
+
const [selected, setSelected] = useState(null);
|
|
285
|
+
// Re-sync the modal's task with the latest reload (or close it if the
|
|
286
|
+
// task was deleted out from under us).
|
|
287
|
+
useEffect(() => {
|
|
288
|
+
if (!selected || !ctrl.tasks)
|
|
289
|
+
return;
|
|
290
|
+
const fresh = ctrl.tasks.find((t) => t.id === selected.id);
|
|
291
|
+
if (!fresh) {
|
|
292
|
+
setSelected(null);
|
|
293
|
+
}
|
|
294
|
+
else if (fresh !== selected) {
|
|
295
|
+
setSelected(fresh);
|
|
296
|
+
}
|
|
297
|
+
}, [ctrl.tasks, selected]);
|
|
298
|
+
const visibleStatuses = ["ready", "in_progress", "done"];
|
|
299
|
+
const visibleTasks = useMemo(() => {
|
|
300
|
+
if (!ctrl.tasks)
|
|
301
|
+
return null;
|
|
302
|
+
const inProject = projectFilter
|
|
303
|
+
? ctrl.tasks.filter((t) => (t.project || PROJECT_INBOX_KEY) === projectFilter)
|
|
304
|
+
: ctrl.tasks;
|
|
305
|
+
return inProject.filter((t) => visibleStatuses.includes(t.status));
|
|
306
|
+
}, [ctrl.tasks, projectFilter, visibleStatuses]);
|
|
307
|
+
const chips = useMemo(() => projectChipsFromSummary(ctrl.projects, visibleStatuses), [ctrl.projects, visibleStatuses]);
|
|
308
|
+
const renderColumns = BOARD_COLUMNS;
|
|
309
|
+
const drag = ctrl.bindDrag();
|
|
310
|
+
return (_jsxs("div", { className: "flex flex-col h-full bg-gray-950 text-gray-100", children: [_jsxs("header", { className: "px-6 py-4 border-b border-gray-800 flex-shrink-0", children: [_jsxs("h1", { className: "text-xl font-semibold flex items-center gap-2", children: [_jsx(Kanban, { className: "w-5 h-5" }), " Workboard"] }), _jsxs("p", { className: "text-xs text-gray-500 mt-1 max-w-3xl", children: ["Drag cards across columns. Click ", _jsx(Plus, { className: "inline w-3 h-3 align-text-bottom" }), " ", "on a column to add a task in place. Workers in the pool claim ready tasks and report back with a result summary.", _jsxs("span", { className: "text-gray-600", children: [" ", "v0.2 ships an echo worker (30s sleep + reflect title) so the loop is visible end-to-end; real worker roles land in follow-up PRs."] })] })] }), ctrl.error && (_jsx("div", { className: "mx-6 mt-3 px-3 py-2 rounded bg-red-900/40 border border-red-800 text-xs text-red-100 flex-shrink-0", children: ctrl.error })), chips.length > 0 && (_jsx(ProjectChips, { chips: chips, active: projectFilter, onPick: setProjectFilter, showAll: true })), _jsx(WorkerStatusRow, { snapshot: ctrl.worker, onNudge: () => void sendJson(`${API_BASE}/workers/restart`, {}) }), _jsx("div", { className: "flex-1 overflow-x-auto overflow-y-hidden", children: ctrl.tasks === null ? (_jsx("div", { className: "flex items-center text-gray-500 py-12 justify-center h-full", children: _jsx(Loader2, { className: "w-5 h-5 animate-spin" }) })) : (_jsx("div", { className: "flex gap-3 p-4 h-full items-stretch", style: { minWidth: `${renderColumns.length * 240}px` }, children: renderColumns.map((col) => (_jsx(KanbanColumn, { column: col, tasks: (visibleTasks ?? [])
|
|
311
|
+
.filter((t) => t.status === col.status)
|
|
312
|
+
.sort((a, b) => col.status === "done"
|
|
313
|
+
? b.createdAt - a.createdAt
|
|
314
|
+
: a.createdAt - b.createdAt), busyId: ctrl.busyId, onAddTask: (input) => void ctrl.addTaskInColumn({ ...input, project: input.project ?? projectFilter }, col.status), projects: ctrl.projects, workerRoles: KNOWN_WORKER_ROLES, agentNames: ctrl.agentNames, allTasks: ctrl.tasks ?? [], onPatchTask: ctrl.patchTask, onDragStart: drag.onDragStart, onDragEnd: drag.onDragEnd, onDrop: drag.onDrop }, col.status))) })) }), selected && (_jsx(TaskModal, { task: selected, allTasks: ctrl.tasks ?? [], busy: ctrl.busyId === selected.id, onClose: () => setSelected(null), onPatch: (patch) => ctrl.patchTask(selected.id, patch), onDelete: () => ctrl.deleteTask(selected.id) }))] }));
|
|
315
|
+
}
|
|
316
|
+
// ─── Kanban column ───────────────────────────────────────────────
|
|
317
|
+
function KanbanColumn({ column, tasks, allTasks, busyId, compact, onAddTask, onPatchTask, projects, workerRoles, agentNames, onDragStart, onDragEnd, onDrop, }) {
|
|
318
|
+
const [showAdd, setShowAdd] = useState(false);
|
|
319
|
+
const [isDragOver, setIsDragOver] = useState(false);
|
|
320
|
+
return (_jsxs("div", { className: `flex flex-col flex-1 min-w-[160px] rounded-lg border transition-colors ${isDragOver
|
|
321
|
+
? "border-blue-500/60 bg-gray-900/80"
|
|
322
|
+
: column.color}`, onDragOver: (e) => {
|
|
323
|
+
e.preventDefault();
|
|
324
|
+
setIsDragOver(true);
|
|
325
|
+
}, onDragLeave: () => setIsDragOver(false), onDrop: (e) => {
|
|
326
|
+
e.preventDefault();
|
|
327
|
+
setIsDragOver(false);
|
|
328
|
+
onDrop(e, column.status);
|
|
329
|
+
}, children: [_jsxs("header", { className: "px-2 py-1.5 border-b border-gray-800/60 flex items-center gap-1.5 sticky top-0", children: [_jsx("span", { className: `w-2 h-2 rounded-full ${column.dot}` }), _jsx("span", { className: `${compact ? "text-[11px]" : "text-xs"} font-medium`, children: column.label }), _jsx("span", { className: `ml-auto ${compact ? "text-[10px]" : "text-[11px]"} text-gray-500`, children: tasks.length }), column.status === "ready" && (_jsx("button", { type: "button", title: "Add task", onClick: () => setShowAdd(true), className: "p-0.5 text-gray-600 hover:text-gray-200 rounded", children: _jsx(Plus, { className: "w-3 h-3" }) }))] }), _jsxs("ul", { className: "flex-1 overflow-y-auto p-1.5 space-y-1.5 min-h-[40px]", children: [tasks.map((t) => (_jsx(BoardCard, { task: t, meta: computeMeta(t, allTasks), busy: busyId === t.id, compact: compact, agentNames: agentNames, onDragStart: onDragStart, onDragEnd: onDragEnd, onPatch: onPatchTask }, t.id))), showAdd && (_jsx(AddTaskRow, { projects: projects, workerRoles: workerRoles, allTasks: allTasks, onSubmit: (input) => {
|
|
330
|
+
onAddTask(input);
|
|
331
|
+
setShowAdd(false);
|
|
332
|
+
}, onCancel: () => setShowAdd(false) })), !showAdd && tasks.length === 0 && (_jsx("li", { className: `text-center text-[10px] text-gray-600 py-3 ${column.status === "ready"
|
|
333
|
+
? "cursor-pointer hover:text-gray-400"
|
|
334
|
+
: ""}`, onClick: column.status === "ready" ? () => setShowAdd(true) : undefined, children: column.status === "ready"
|
|
335
|
+
? "empty - click to add"
|
|
336
|
+
: "empty" }))] })] }));
|
|
337
|
+
}
|
|
338
|
+
function computeMeta(task, allTasks) {
|
|
339
|
+
const byId = new Map(allTasks.map((t) => [t.id, t]));
|
|
340
|
+
const deps = [];
|
|
341
|
+
const pendingDeps = [];
|
|
342
|
+
for (const id of task.dependsOn ?? []) {
|
|
343
|
+
const dep = byId.get(id);
|
|
344
|
+
if (!dep)
|
|
345
|
+
continue;
|
|
346
|
+
deps.push(dep);
|
|
347
|
+
if (dep.status !== "done")
|
|
348
|
+
pendingDeps.push(dep);
|
|
349
|
+
}
|
|
350
|
+
// A deleted prerequisite counts as unsatisfied so the card stays
|
|
351
|
+
// visibly blocked until the user re-points or removes it.
|
|
352
|
+
const missingDepCount = (task.dependsOn?.length ?? 0) - deps.length;
|
|
353
|
+
const blocked = task.status === "ready" &&
|
|
354
|
+
(pendingDeps.length > 0 || missingDepCount > 0);
|
|
355
|
+
return { deps, pendingDeps, blocked };
|
|
356
|
+
}
|
|
357
|
+
function BoardCard({ task, meta, busy, compact, agentNames, onDragStart, onDragEnd, onPatch, }) {
|
|
358
|
+
const [expanded, setExpanded] = useState(false);
|
|
359
|
+
const hasMore = Boolean(task.description?.trim()) ||
|
|
360
|
+
Boolean(task.resultSummary?.trim()) ||
|
|
361
|
+
meta.deps.length > 0 ||
|
|
362
|
+
// Anything with a session_id has a worker transcript worth
|
|
363
|
+
// showing — even an in-progress task with no description.
|
|
364
|
+
Boolean(task.sessionId) ||
|
|
365
|
+
task.status === "in_progress";
|
|
366
|
+
return (_jsxs("li", { draggable: true, onDragStart: (e) => {
|
|
367
|
+
// Visual feedback: dim the card while dragging.
|
|
368
|
+
e.currentTarget.style.opacity = "0.4";
|
|
369
|
+
onDragStart(e, task.id);
|
|
370
|
+
}, onDragEnd: (e) => {
|
|
371
|
+
e.currentTarget.style.opacity = "1";
|
|
372
|
+
onDragEnd();
|
|
373
|
+
}, onClick: (e) => {
|
|
374
|
+
// Don't fight click-vs-drag heuristics: only flip on real
|
|
375
|
+
// mouse clicks, not when dragstart bubbled up. The browser
|
|
376
|
+
// suppresses click after a drag, so this is mostly belt &
|
|
377
|
+
// braces - but we do swallow the event so the column-level
|
|
378
|
+
// drop handler doesn't see it.
|
|
379
|
+
e.stopPropagation();
|
|
380
|
+
if (hasMore)
|
|
381
|
+
setExpanded((v) => !v);
|
|
382
|
+
}, className: `rounded border bg-gray-900/60 hover:border-gray-700 ${meta.blocked
|
|
383
|
+
? "border-indigo-500/40"
|
|
384
|
+
: "border-gray-800"} ${hasMore ? "cursor-pointer" : "cursor-grab"} ${busy ? "opacity-60" : ""}`, children: [_jsxs("div", { className: "px-2 py-1.5 flex items-start gap-1.5", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 flex-wrap", children: [_jsx("span", { className: `${compact ? "text-[11.5px]" : "text-xs"} font-medium text-gray-100 break-words`, children: task.title }), task.priority > 0 && (_jsxs("span", { className: "text-[9px] px-1 rounded bg-amber-900/50 text-amber-100", children: ["p", task.priority] })), task.workerAgentId && (_jsxs("span", { className: "text-[9px] px-1 rounded bg-indigo-900/50 text-indigo-100", title: `Assigned to ${task.workerAgentId} (slug)`, children: ["@", agentNames.get(task.workerAgentId) ?? task.workerAgentId] })), !task.workerAgentId && task.workerRole && (_jsx("span", { className: "text-[9px] px-1 rounded bg-gray-800 text-gray-400", title: "Legacy: dispatched by kind, not pinned to a slug", children: task.workerRole })), task.project && task.project !== PROJECT_INBOX_KEY && (_jsxs("span", { className: "text-[9px] px-1 rounded bg-gray-800 text-gray-400", children: ["#", task.project] })), (task.dependsOn?.length ?? 0) > 0 && (_jsxs("span", { className: `inline-flex items-center gap-0.5 text-[9px] px-1 rounded border ${meta.blocked
|
|
385
|
+
? "text-indigo-200 bg-indigo-500/15 border-indigo-500/40"
|
|
386
|
+
: "text-gray-400 bg-gray-700/30 border-gray-700"}`, title: meta.blocked
|
|
387
|
+
? `Waiting on: ${meta.pendingDeps.map((d) => d.title).join(", ")}`
|
|
388
|
+
: `${meta.deps.length} dependenc${meta.deps.length === 1 ? "y" : "ies"} satisfied`, children: [meta.blocked ? (_jsx(Lock, { className: "w-2.5 h-2.5" })) : (_jsx(Link2, { className: "w-2.5 h-2.5" })), meta.blocked
|
|
389
|
+
? `${meta.pendingDeps.length}/${task.dependsOn.length}`
|
|
390
|
+
: task.dependsOn.length] }))] }), (task.labels ?? []).includes("awaiting-intervention") && (_jsxs("div", { className: "mt-1 flex items-start gap-1 rounded border border-rose-500/50 bg-rose-500/10 px-1.5 py-1 text-[10px] text-rose-200", title: task.interventionReason ?? task.failureReason ?? "", onClick: (e) => e.stopPropagation(), children: [_jsx(AlertTriangle, { className: "w-3 h-3 mt-px shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1 break-words line-clamp-3", children: [_jsx("span", { className: "font-medium", children: "awaiting intervention" }), task.interventionAt
|
|
391
|
+
? ` (${formatRelative(task.interventionAt)})`
|
|
392
|
+
: "", (task.interventionReason ?? task.failureReason)
|
|
393
|
+
? `: ${task.interventionReason ?? task.failureReason}`
|
|
394
|
+
: ""] }), _jsx("button", { type: "button", disabled: busy, onClick: (e) => {
|
|
395
|
+
e.stopPropagation();
|
|
396
|
+
void onPatch(task.id, {
|
|
397
|
+
labels: (task.labels ?? []).filter((l) => l !== "awaiting-intervention" && l !== "stalled"),
|
|
398
|
+
attempts: 0,
|
|
399
|
+
failureReason: null,
|
|
400
|
+
interventionReason: null,
|
|
401
|
+
interventionAt: null,
|
|
402
|
+
});
|
|
403
|
+
}, className: "shrink-0 rounded border border-rose-500/40 px-1 py-px text-[9.5px] font-medium text-rose-100 hover:bg-rose-500/20 disabled:opacity-50", children: "Retry" })] })), (task.labels ?? []).includes("stalled") && (_jsxs("div", { className: "mt-1 flex items-start gap-1 rounded border border-orange-500/40 bg-orange-500/5 px-1.5 py-1 text-[10px] text-orange-200", title: task.failureReason ?? "", onClick: (e) => e.stopPropagation(), children: [_jsx(AlertTriangle, { className: "w-3 h-3 mt-px shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1 break-words line-clamp-3", children: ["stalled", (task.attempts ?? 0) > 0 ? ` after ${task.attempts} attempts` : "", task.failureReason ? `: ${task.failureReason}` : ""] }), _jsx("button", { type: "button", disabled: busy, onClick: (e) => {
|
|
404
|
+
e.stopPropagation();
|
|
405
|
+
void onPatch(task.id, {
|
|
406
|
+
labels: (task.labels ?? []).filter((l) => l !== "stalled"),
|
|
407
|
+
attempts: 0,
|
|
408
|
+
failureReason: null,
|
|
409
|
+
});
|
|
410
|
+
}, className: "shrink-0 rounded border border-orange-500/40 px-1 py-px text-[9.5px] font-medium text-orange-100 hover:bg-orange-500/15 disabled:opacity-50", children: "Retry" })] })), (task.labels ?? []).includes("draft") && (_jsxs("div", { className: "mt-1 flex items-center gap-1.5", onClick: (e) => e.stopPropagation(), children: [_jsx("span", { className: "inline-block rounded border border-yellow-500/40 bg-yellow-500/5 px-1.5 py-px text-[10px] text-yellow-200", children: "draft - pool will skip" }), _jsx("button", { type: "button", disabled: busy, onClick: (e) => {
|
|
411
|
+
e.stopPropagation();
|
|
412
|
+
void onPatch(task.id, {
|
|
413
|
+
labels: (task.labels ?? []).filter((l) => l !== "draft"),
|
|
414
|
+
});
|
|
415
|
+
}, className: "rounded border border-yellow-500/40 px-1 py-px text-[9.5px] font-medium text-yellow-100 hover:bg-yellow-500/15 disabled:opacity-50", children: "Publish" })] })), task.description && !expanded && (_jsx("div", { className: "text-[10.5px] text-gray-400 mt-0.5 line-clamp-2 whitespace-pre-line", children: task.description })), task.resultSummary && !expanded && (_jsxs("div", { className: `${compact ? "text-[10px]" : "text-[10.5px]"} text-emerald-300/80 mt-0.5 italic line-clamp-2 whitespace-pre-line`, children: ["\u2192 ", task.resultSummary] })), _jsxs("div", { className: "text-[9.5px] text-gray-500 mt-0.5 flex items-center gap-1", children: [_jsx(Clock, { className: "w-2.5 h-2.5" }), fmtRelative(task.endedAt ?? task.startedAt ?? task.createdAt)] })] }), hasMore && (_jsx(ChevronDown, { className: `w-3 h-3 mt-0.5 text-gray-500 shrink-0 transition-transform ${expanded ? "rotate-180" : ""}` })), busy && _jsx(Loader2, { className: "w-3 h-3 animate-spin text-gray-400" })] }), expanded && (_jsxs("div", { className: "px-2 pb-2 pt-0 border-t border-gray-800/60 space-y-1.5", onClick: (e) => e.stopPropagation(), children: [task.description && (_jsx(Section, { label: "Description", children: _jsx("div", { className: "text-[10.5px] text-gray-300 whitespace-pre-line break-words max-h-48 overflow-y-auto", children: task.description }) })), task.resultSummary && (_jsx(Section, { label: "Result", children: _jsxs("div", { className: "text-[10.5px] text-emerald-300/90 italic whitespace-pre-line break-words max-h-48 overflow-y-auto", children: ["\u2192 ", task.resultSummary] }) })), task.resultFiles.length > 0 && (_jsx(Section, { label: `Files (${task.resultFiles.length})`, children: _jsx("ul", { className: "space-y-0.5", children: task.resultFiles.map((p) => (_jsx("li", { children: _jsx(DeliveryFile, { path: p }) }, p))) }) })), meta.deps.length > 0 && (_jsx(Section, { label: "Depends on", children: _jsx("ul", { className: "space-y-0.5", children: meta.deps.map((d) => (_jsxs("li", { className: "text-[10px] flex items-center gap-1", children: [d.status === "done" ? (_jsx(CheckCircle2, { className: "w-2.5 h-2.5 text-emerald-400 shrink-0" })) : (_jsx(Lock, { className: "w-2.5 h-2.5 text-indigo-400 shrink-0" })), _jsx("span", { className: `truncate ${d.status === "done"
|
|
416
|
+
? "text-gray-400 line-through"
|
|
417
|
+
: "text-indigo-200"}`, children: d.title }), _jsx("span", { className: "ml-auto text-[9px] text-gray-600 shrink-0", children: d.status.replace("_", " ") })] }, d.id))) }) })), _jsxs("div", { className: "grid grid-cols-2 gap-x-3 gap-y-0 text-[9.5px] text-gray-500 pt-1", children: [_jsxs("div", { children: ["Created", _jsx("span", { className: "text-gray-300", children: new Date(task.createdAt).toLocaleString() })] }), task.startedAt && (_jsxs("div", { children: ["Started", _jsx("span", { className: "text-gray-300", children: new Date(task.startedAt).toLocaleString() })] })), task.endedAt && (_jsxs("div", { children: ["Ended", _jsx("span", { className: "text-gray-300", children: new Date(task.endedAt).toLocaleString() })] }))] }), _jsx(ExecutionSection, { task: task })] }))] }));
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Trigger row that opens the worker transcript in a full dialog.
|
|
421
|
+
*
|
|
422
|
+
* The card body is too narrow for a chat-style transcript, so we
|
|
423
|
+
* render a thin button on the expanded card and pop a modal when
|
|
424
|
+
* clicked. The modal owns the polling loop — closed cards do no
|
|
425
|
+
* background work.
|
|
426
|
+
*/
|
|
427
|
+
function ExecutionSection({ task }) {
|
|
428
|
+
const [open, setOpen] = useState(false);
|
|
429
|
+
const showButton = task.status === "in_progress" || Boolean(task.sessionId);
|
|
430
|
+
if (!showButton)
|
|
431
|
+
return null;
|
|
432
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "pt-1", children: _jsxs("button", { type: "button", onClick: (e) => {
|
|
433
|
+
e.stopPropagation();
|
|
434
|
+
setOpen(true);
|
|
435
|
+
}, className: "inline-flex items-center gap-1.5 rounded border border-gray-700 px-1.5 py-0.5 text-[10px] text-gray-300 hover:border-gray-500 hover:bg-gray-800", children: [_jsx(ScrollText, { className: "w-3 h-3" }), "View transcript", task.status === "in_progress" && (_jsxs("span", { className: "flex items-center gap-1 text-amber-300", children: [_jsx("span", { className: "w-1 h-1 rounded-full bg-amber-400 animate-pulse" }), "live"] }))] }) }), open && (_jsx(ExecutionDialog, { task: task, onClose: () => setOpen(false) }))] }));
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Modal that renders the worker session transcript.
|
|
439
|
+
*
|
|
440
|
+
* Visual model lifted from packages/web's MessageBubble:
|
|
441
|
+
* - role=user → right-aligned brand-tinted card
|
|
442
|
+
* - role=assistant → left-aligned dark card; tool calls render
|
|
443
|
+
* as collapsible chips below
|
|
444
|
+
* - role=tool → not shown directly — the result is folded
|
|
445
|
+
* back into its calling assistant turn
|
|
446
|
+
*
|
|
447
|
+
* While `task.status === "in_progress"` the dialog polls every 3s
|
|
448
|
+
* so the user can watch the LLM type. Stops on close or terminal
|
|
449
|
+
* status. Auto-scrolls to the bottom on new entries unless the
|
|
450
|
+
* user has scrolled away (so reading old messages doesn't yank).
|
|
451
|
+
*/
|
|
452
|
+
function ExecutionDialog({ task, onClose, }) {
|
|
453
|
+
const [entries, setEntries] = useState(null);
|
|
454
|
+
const [loading, setLoading] = useState(false);
|
|
455
|
+
const [error, setError] = useState(null);
|
|
456
|
+
const [sessionId, setSessionId] = useState(null);
|
|
457
|
+
const scrollRef = useRef(null);
|
|
458
|
+
const stickToBottomRef = useRef(true);
|
|
459
|
+
const fetchHistory = useCallback(async () => {
|
|
460
|
+
if (!task.id)
|
|
461
|
+
return;
|
|
462
|
+
setLoading(true);
|
|
463
|
+
try {
|
|
464
|
+
const data = await getJson(`${API_BASE}/tasks/${task.id}/history`);
|
|
465
|
+
setEntries(data.entries ?? []);
|
|
466
|
+
setSessionId(data.sessionId ?? null);
|
|
467
|
+
setError(null);
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
471
|
+
}
|
|
472
|
+
finally {
|
|
473
|
+
setLoading(false);
|
|
474
|
+
}
|
|
475
|
+
}, [task.id]);
|
|
476
|
+
useEffect(() => {
|
|
477
|
+
void fetchHistory();
|
|
478
|
+
}, [fetchHistory]);
|
|
479
|
+
// Tail while the task is running.
|
|
480
|
+
useEffect(() => {
|
|
481
|
+
if (task.status !== "in_progress")
|
|
482
|
+
return;
|
|
483
|
+
const t = setInterval(() => void fetchHistory(), 3000);
|
|
484
|
+
return () => clearInterval(t);
|
|
485
|
+
}, [task.status, fetchHistory]);
|
|
486
|
+
// Auto-scroll to bottom on new entries when user is at bottom.
|
|
487
|
+
useEffect(() => {
|
|
488
|
+
if (!stickToBottomRef.current)
|
|
489
|
+
return;
|
|
490
|
+
const el = scrollRef.current;
|
|
491
|
+
if (!el)
|
|
492
|
+
return;
|
|
493
|
+
el.scrollTop = el.scrollHeight;
|
|
494
|
+
}, [entries]);
|
|
495
|
+
const onScroll = (e) => {
|
|
496
|
+
const el = e.currentTarget;
|
|
497
|
+
const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
|
|
498
|
+
stickToBottomRef.current = distance < 80;
|
|
499
|
+
};
|
|
500
|
+
const merged = useMemo(() => mergeAssistantToolResults(entries ?? []), [entries]);
|
|
501
|
+
// The card itself is `<li draggable>`, so anything we render
|
|
502
|
+
// INSIDE it inherits the drag intent — selecting text would
|
|
503
|
+
// grab the whole card. Portal the dialog to document.body so
|
|
504
|
+
// it sits next to the kanban column, not under it.
|
|
505
|
+
return createPortal(_jsx("div", { className: "fixed inset-0 z-40 flex items-center justify-center bg-black/60 p-4", onClick: (e) => {
|
|
506
|
+
e.stopPropagation();
|
|
507
|
+
onClose();
|
|
508
|
+
},
|
|
509
|
+
// Belt + braces: even portalled, an ancestor draggable
|
|
510
|
+
// boundary on document body wouldn't apply, but if a
|
|
511
|
+
// dragstart somehow bubbles up from inside the dialog we
|
|
512
|
+
// suppress it so text selection wins.
|
|
513
|
+
onDragStart: (e) => e.stopPropagation(), children: _jsxs("div", { onClick: (e) => e.stopPropagation(), draggable: false, className: "flex h-[80vh] w-full max-w-3xl flex-col overflow-hidden rounded-lg border border-gray-800 bg-gray-950 shadow-xl", children: [_jsxs("header", { className: "flex items-center gap-2 border-b border-gray-800 px-4 py-2.5", children: [_jsx(ScrollText, { className: "h-4 w-4 text-gray-500" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-sm font-medium text-gray-100", children: task.title }), _jsxs("div", { className: "flex items-center gap-2 text-[10px] text-gray-500", children: [_jsx("span", { children: "worker transcript" }), sessionId && (_jsxs("span", { className: "font-mono text-gray-600", children: ["\u00B7 ", sessionId] })), task.status === "in_progress" && (_jsxs("span", { className: "flex items-center gap-1 text-amber-300", children: ["\u00B7", _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse" }), "tailing"] }))] })] }), _jsx("button", { type: "button", onClick: () => void fetchHistory(), disabled: loading, className: "rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-200 disabled:opacity-50", title: "Refresh", children: _jsx(RefreshCw, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` }) }), _jsx("button", { type: "button", onClick: onClose, className: "rounded p-1 text-gray-400 hover:bg-gray-800 hover:text-gray-100", children: _jsx(X, { className: "h-4 w-4" }) })] }), _jsxs("div", { ref: scrollRef, onScroll: onScroll, className: "flex-1 overflow-y-auto p-4 space-y-3", children: [error && (_jsx("div", { className: "rounded border border-rose-700/40 bg-rose-950/30 px-3 py-2 text-xs text-rose-200", children: error })), entries === null && loading && (_jsx("div", { className: "text-xs italic text-gray-500", children: "Loading\u2026" })), entries !== null && merged.length === 0 && !loading && (_jsx("div", { className: "text-xs italic text-gray-500", children: task.sessionId
|
|
514
|
+
? "No messages yet."
|
|
515
|
+
: "Worker hasn't started yet." })), merged.map((row) => (_jsx(ExecutionTurn, { row: row }, row.id)))] })] }) }), document.body);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Walk the raw chronologically-ordered entries and merge tool
|
|
519
|
+
* results back into the assistant turn that called them. Mirrors
|
|
520
|
+
* `mergeToolTurns` in packages/web but works on our flat
|
|
521
|
+
* HistoryEntry shape. Tool rows themselves are dropped from the
|
|
522
|
+
* output — the result text lives on the call's chip.
|
|
523
|
+
*/
|
|
524
|
+
function mergeAssistantToolResults(entries) {
|
|
525
|
+
// Index tool results by callId once.
|
|
526
|
+
const resultByCallId = new Map();
|
|
527
|
+
for (const e of entries) {
|
|
528
|
+
if (e.role === "tool" && e.toolResult?.callId) {
|
|
529
|
+
resultByCallId.set(e.toolResult.callId, e.toolResult);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
const out = [];
|
|
533
|
+
for (const e of entries) {
|
|
534
|
+
if (e.role === "tool")
|
|
535
|
+
continue;
|
|
536
|
+
const calls = (e.toolCalls ?? []).map((tc) => ({
|
|
537
|
+
call: tc,
|
|
538
|
+
result: resultByCallId.get(tc.callId),
|
|
539
|
+
}));
|
|
540
|
+
out.push({
|
|
541
|
+
id: e.id,
|
|
542
|
+
createdAt: e.createdAt,
|
|
543
|
+
role: e.role === "user" ? "user" : e.role === "assistant" ? "assistant" : "system",
|
|
544
|
+
text: e.text,
|
|
545
|
+
calls,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
return out;
|
|
549
|
+
}
|
|
550
|
+
/** One assistant / user turn rendered MessageBubble-style. */
|
|
551
|
+
function ExecutionTurn({ row }) {
|
|
552
|
+
const isUser = row.role === "user";
|
|
553
|
+
return (_jsx("div", { className: isUser ? "flex justify-end" : "flex justify-start", children: _jsxs("div", { className: `flex max-w-[85%] flex-col ${isUser ? "items-end" : "items-start"}`, children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-[10px] uppercase tracking-wider text-gray-500", children: [isUser ? (_jsx(User, { className: "h-3 w-3" })) : (_jsx(Bot, { className: "h-3 w-3 text-blue-400" })), _jsx("span", { children: isUser ? "you" : row.role }), _jsx("span", { className: "text-gray-700", children: "\u00B7" }), _jsx("span", { className: "text-gray-600", children: new Date(row.createdAt).toLocaleTimeString() })] }), row.text && (_jsx("div", { className: `whitespace-pre-line break-words rounded-lg border px-3 py-2 text-[13px] leading-relaxed ${isUser
|
|
554
|
+
? "border-brand-400/30 bg-brand-500/10 text-gray-100"
|
|
555
|
+
: "border-gray-800 bg-gray-900/60 text-gray-100"}`, children: row.text })), row.calls.length > 0 && (_jsx("div", { className: `mt-1.5 flex flex-col gap-1 ${isUser ? "items-end" : "items-start"}`, children: row.calls.map((c, i) => (_jsx(ToolCallChip, { ...c }, c.call.callId || `c${i}`))) }))] }) }));
|
|
556
|
+
}
|
|
557
|
+
/** Collapsible tool-call chip; click to reveal the result body. */
|
|
558
|
+
function ToolCallChip({ call, result, }) {
|
|
559
|
+
const [expanded, setExpanded] = useState(false);
|
|
560
|
+
const running = !result;
|
|
561
|
+
const isError = !!result && result.ok === false;
|
|
562
|
+
return (_jsxs("div", { className: "flex flex-col", children: [_jsxs("button", { type: "button", onClick: () => !running && setExpanded((v) => !v), className: `flex select-none items-center gap-1.5 py-0.5 text-xs ${running
|
|
563
|
+
? "cursor-default text-gray-500"
|
|
564
|
+
: "cursor-pointer text-gray-500 hover:text-gray-300"}`, children: [running ? (_jsx(Loader2, { className: "h-3 w-3 animate-spin text-amber-400" })) : isError ? (_jsx(XCircle, { className: "h-3 w-3 text-rose-400/70" })) : (_jsx(CheckCircle2, { className: "h-3 w-3 text-emerald-500/60" })), _jsx("code", { className: "font-mono text-[12px] text-blue-300", children: call.toolName }), _jsx("span", { className: "font-mono text-[11px] text-gray-600", children: summariseArgsJson(call.argsJson) }), running ? (_jsx("span", { className: "text-[11px] text-gray-600", children: "running\u2026" })) : expanded ? (_jsx(ChevronDown, { className: "h-3 w-3 text-gray-600" })) : (_jsx(ChevronRight, { className: "h-3 w-3 text-gray-600" }))] }), expanded && result && (_jsx("pre", { className: `mt-1 max-h-64 max-w-2xl overflow-auto whitespace-pre-wrap break-all rounded-md border px-3 py-2 text-[11px] ${isError
|
|
565
|
+
? "border-rose-700/40 bg-rose-950/30 text-rose-200"
|
|
566
|
+
: "border-gray-800/60 bg-gray-900/60 text-gray-300"}`, children: truncateText(result.text || "(empty)", 4000) }))] }));
|
|
567
|
+
}
|
|
568
|
+
function summariseArgsJson(argsJson) {
|
|
569
|
+
if (!argsJson)
|
|
570
|
+
return "()";
|
|
571
|
+
let parsed;
|
|
572
|
+
try {
|
|
573
|
+
parsed = JSON.parse(argsJson);
|
|
574
|
+
}
|
|
575
|
+
catch {
|
|
576
|
+
// Not JSON — just truncate.
|
|
577
|
+
return argsJson.length > 60 ? `(${argsJson.slice(0, 57)}…)` : `(${argsJson})`;
|
|
578
|
+
}
|
|
579
|
+
if (!parsed || typeof parsed !== "object")
|
|
580
|
+
return `(${argsJson})`;
|
|
581
|
+
const obj = parsed;
|
|
582
|
+
const keys = Object.keys(obj);
|
|
583
|
+
if (keys.length === 0)
|
|
584
|
+
return "()";
|
|
585
|
+
return keys
|
|
586
|
+
.slice(0, 3)
|
|
587
|
+
.map((k) => `${k}=${shortVal(obj[k])}`)
|
|
588
|
+
.join(" ");
|
|
589
|
+
}
|
|
590
|
+
function shortVal(v) {
|
|
591
|
+
if (typeof v === "string")
|
|
592
|
+
return v.length > 40 ? `"${v.slice(0, 37)}…"` : `"${v}"`;
|
|
593
|
+
if (typeof v === "number" || typeof v === "boolean")
|
|
594
|
+
return String(v);
|
|
595
|
+
if (v == null)
|
|
596
|
+
return String(v);
|
|
597
|
+
return JSON.stringify(v).slice(0, 40);
|
|
598
|
+
}
|
|
599
|
+
function truncateText(s, max) {
|
|
600
|
+
if (s.length <= max)
|
|
601
|
+
return s;
|
|
602
|
+
return s.slice(0, max - 1) + "\n…(truncated)";
|
|
603
|
+
}
|
|
604
|
+
function Section({ label, children, }) {
|
|
605
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "text-[9px] uppercase tracking-wide text-gray-500 mb-0.5", children: label }), children] }));
|
|
606
|
+
}
|
|
607
|
+
/** One row of the task's `resultFiles[]`. Renders the path as a
|
|
608
|
+
* monospace chip; clicking opens the raw file in a new tab via
|
|
609
|
+
* the files plugin's GET /raw endpoint. The path is whatever the
|
|
610
|
+
* worker passed to task_complete — typically a workspace-rooted
|
|
611
|
+
* path like `/projects/<slug>/foo.py` or a `workspace:///...`
|
|
612
|
+
* URI. We strip the URI prefix before handing it to the API.
|
|
613
|
+
* Files outside the user's workspace will 404 from the raw
|
|
614
|
+
* endpoint; we don't pre-validate here. */
|
|
615
|
+
function DeliveryFile({ path }) {
|
|
616
|
+
const open = useOpenFile();
|
|
617
|
+
const stripped = path.replace(/^workspace:\/\/+/, "/");
|
|
618
|
+
// Display the basename in the chip and the full path in the
|
|
619
|
+
// tooltip so the row stays compact on small cards.
|
|
620
|
+
const display = stripped.split("/").filter(Boolean).pop() || stripped;
|
|
621
|
+
return (_jsxs("button", { type: "button", onClick: (e) => {
|
|
622
|
+
e.stopPropagation();
|
|
623
|
+
open(stripped);
|
|
624
|
+
}, className: "inline-flex items-center gap-1 max-w-full text-[10.5px] font-mono text-emerald-300 hover:text-emerald-200 hover:underline truncate", title: stripped, children: [_jsx(FileText, { className: "w-3 h-3 shrink-0 opacity-70" }), _jsx("span", { className: "truncate", children: display })] }));
|
|
625
|
+
}
|
|
626
|
+
function nextStatus(status) {
|
|
627
|
+
if (status === "ready")
|
|
628
|
+
return "in_progress";
|
|
629
|
+
if (status === "in_progress")
|
|
630
|
+
return "done";
|
|
631
|
+
return null;
|
|
632
|
+
}
|
|
633
|
+
/** Worker roles the UI hints at. v0.2 only ships `echo`; the four
|
|
634
|
+
* ADR-0002 roles are listed so the autocomplete is ready when the
|
|
635
|
+
* follow-up PRs land them. */
|
|
636
|
+
const KNOWN_WORKER_ROLES = [
|
|
637
|
+
"echo",
|
|
638
|
+
"qianliyan",
|
|
639
|
+
"luban",
|
|
640
|
+
"xihe",
|
|
641
|
+
"nvwa",
|
|
642
|
+
];
|
|
643
|
+
function AddTaskRow({ projects, workerRoles, allTasks, onSubmit, onCancel, }) {
|
|
644
|
+
const [title, setTitle] = useState("");
|
|
645
|
+
const [description, setDescription] = useState("");
|
|
646
|
+
const [project, setProject] = useState("");
|
|
647
|
+
const [priority, setPriority] = useState(0);
|
|
648
|
+
const [workerRole, setWorkerRole] = useState("");
|
|
649
|
+
const [dependsOn, setDependsOn] = useState([]);
|
|
650
|
+
const [showMore, setShowMore] = useState(false);
|
|
651
|
+
const inputRef = useRef(null);
|
|
652
|
+
useEffect(() => {
|
|
653
|
+
inputRef.current?.focus();
|
|
654
|
+
}, []);
|
|
655
|
+
const submit = () => {
|
|
656
|
+
const t = title.trim();
|
|
657
|
+
if (!t) {
|
|
658
|
+
onCancel();
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
onSubmit({
|
|
662
|
+
title: t,
|
|
663
|
+
description: description.trim() || undefined,
|
|
664
|
+
project: project.trim() || undefined,
|
|
665
|
+
priority: priority || undefined,
|
|
666
|
+
workerRole: workerRole.trim() || undefined,
|
|
667
|
+
dependsOn: dependsOn.length > 0 ? dependsOn : undefined,
|
|
668
|
+
});
|
|
669
|
+
};
|
|
670
|
+
return (_jsxs("li", { className: "rounded border border-blue-500/50 bg-gray-900/70 p-1.5 space-y-1", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("input", { ref: inputRef, value: title, onChange: (e) => setTitle(e.target.value), onKeyDown: (e) => {
|
|
671
|
+
if (e.nativeEvent.isComposing || e.keyCode === 229)
|
|
672
|
+
return;
|
|
673
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
674
|
+
e.preventDefault();
|
|
675
|
+
submit();
|
|
676
|
+
}
|
|
677
|
+
else if (e.key === "Escape") {
|
|
678
|
+
onCancel();
|
|
679
|
+
}
|
|
680
|
+
}, placeholder: "Task title...", className: "flex-1 min-w-0 bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11.5px] text-gray-100 outline-none focus:border-blue-500" }), _jsx("button", { type: "button", title: showMore ? "Less" : "More fields", onClick: () => setShowMore((v) => !v), className: "p-0.5 text-gray-500 hover:text-gray-200", children: _jsx(ChevronDown, { className: `w-3 h-3 transition-transform ${showMore ? "rotate-180" : ""}` }) }), _jsx("button", { type: "button", onClick: onCancel, className: "p-0.5 text-gray-500 hover:text-gray-200", title: "Cancel", children: _jsx(X, { className: "w-3 h-3" }) })] }), showMore && (_jsxs("div", { className: "space-y-2 pt-0.5", children: [_jsx(FieldRow, { label: "Description", children: _jsx("textarea", { value: description, onChange: (e) => setDescription(e.target.value), placeholder: "Optional notes for the worker...", rows: 2, className: "w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100 outline-none focus:border-blue-500 resize-y" }) }), _jsx(FieldRow, { label: "Project", children: _jsx("input", { list: "workboard-add-projects", value: project, onChange: (e) => setProject(e.target.value), placeholder: "inbox", className: "w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100 outline-none focus:border-blue-500" }) }), _jsxs("div", { className: "grid grid-cols-[1fr_72px] gap-2", children: [_jsx(FieldRow, { label: "Worker", children: _jsx("input", { list: "workboard-add-roles", value: workerRole, onChange: (e) => setWorkerRole(e.target.value), placeholder: "any", className: "w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100 outline-none focus:border-blue-500" }) }), _jsx(FieldRow, { label: "Priority", children: _jsx("input", { type: "number", value: priority, onChange: (e) => setPriority(Number(e.target.value) || 0), className: "w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100 outline-none focus:border-blue-500" }) })] }), _jsx(FieldRow, { label: "Depends on", children: _jsx(DependencyPicker, { value: dependsOn, onChange: setDependsOn, candidates: allTasks, project: project }) }), _jsx("datalist", { id: "workboard-add-roles", children: workerRoles.map((r) => (_jsx("option", { value: r }, r))) }), _jsx("datalist", { id: "workboard-add-projects", children: projects.map((p) => (_jsx("option", { value: p.project }, p.project))) })] })), _jsxs("div", { className: "flex items-center gap-1 pt-1", children: [_jsx("span", { className: "text-[9.5px] text-gray-600 truncate", children: showMore ? "Enter saves" : "Enter · Esc cancel" }), _jsx("button", { type: "button", onClick: submit, disabled: !title.trim(), className: "ml-auto px-2.5 py-0.5 text-[10.5px] rounded bg-blue-700 hover:bg-blue-600 text-white disabled:opacity-50 disabled:cursor-not-allowed", children: "Add" })] })] }));
|
|
681
|
+
}
|
|
682
|
+
function FieldRow({ label, children, }) {
|
|
683
|
+
return (_jsxs("label", { className: "block", children: [_jsx("span", { className: "block text-[9px] uppercase tracking-wide text-gray-500 mb-0.5", children: label }), children] }));
|
|
684
|
+
}
|
|
685
|
+
// ─── Dependency picker ───────────────────────────────────────
|
|
686
|
+
//
|
|
687
|
+
// Multi-select tag chips. Candidates are filtered to the same
|
|
688
|
+
// project (when set) so the user doesn't have to scroll past every
|
|
689
|
+
// task they own. Picking a candidate adds a chip; clicking the chip
|
|
690
|
+
// removes it. The blank "select..." option in the dropdown is the
|
|
691
|
+
// affordance for adding more.
|
|
692
|
+
function DependencyPicker({ value, onChange, candidates, project, excludeId, }) {
|
|
693
|
+
const candidateMap = useMemo(() => new Map(candidates.map((t) => [t.id, t])), [candidates]);
|
|
694
|
+
const filtered = useMemo(() => {
|
|
695
|
+
const norm = (project ?? "").trim();
|
|
696
|
+
return candidates.filter((t) => {
|
|
697
|
+
if (t.id === excludeId)
|
|
698
|
+
return false;
|
|
699
|
+
if (value.includes(t.id))
|
|
700
|
+
return false;
|
|
701
|
+
if (!norm)
|
|
702
|
+
return true;
|
|
703
|
+
if (norm === PROJECT_INBOX_KEY)
|
|
704
|
+
return !t.project || t.project === PROJECT_INBOX_KEY;
|
|
705
|
+
return t.project === norm;
|
|
706
|
+
});
|
|
707
|
+
}, [candidates, project, value, excludeId]);
|
|
708
|
+
const remove = (id) => onChange(value.filter((x) => x !== id));
|
|
709
|
+
const add = (id) => {
|
|
710
|
+
if (!id || value.includes(id))
|
|
711
|
+
return;
|
|
712
|
+
onChange([...value, id]);
|
|
713
|
+
};
|
|
714
|
+
return (_jsxs("div", { className: "space-y-1", children: [value.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1", children: value.map((id) => {
|
|
715
|
+
const t = candidateMap.get(id);
|
|
716
|
+
const label = t
|
|
717
|
+
? t.title
|
|
718
|
+
: `${id.slice(0, 6)}... (deleted)`;
|
|
719
|
+
const done = t?.status === "done";
|
|
720
|
+
return (_jsxs("span", { className: `inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded border ${done
|
|
721
|
+
? "text-emerald-200 bg-emerald-500/10 border-emerald-500/30"
|
|
722
|
+
: "text-indigo-200 bg-indigo-500/15 border-indigo-500/40"}`, title: t ? `${t.status} · ${t.id}` : id, children: [done ? (_jsx(CheckCircle2, { className: "w-2.5 h-2.5" })) : (_jsx(Lock, { className: "w-2.5 h-2.5" })), _jsx("span", { className: "truncate max-w-[140px]", children: label }), _jsx("button", { type: "button", onClick: () => remove(id), className: "text-gray-400 hover:text-gray-100", title: "Remove", children: _jsx(X, { className: "w-2.5 h-2.5" }) })] }, id));
|
|
723
|
+
}) })), _jsxs("select", { value: "", onChange: (e) => {
|
|
724
|
+
if (e.target.value) {
|
|
725
|
+
add(e.target.value);
|
|
726
|
+
// Reset the select so the same option can be re-picked
|
|
727
|
+
// after a remove without page-state weirdness.
|
|
728
|
+
e.target.value = "";
|
|
729
|
+
}
|
|
730
|
+
}, className: "w-full bg-gray-800 border border-gray-700 rounded px-2 py-1 text-[11px] text-gray-100 outline-none focus:border-blue-500", children: [_jsx("option", { value: "", children: filtered.length === 0
|
|
731
|
+
? value.length === 0
|
|
732
|
+
? "(no other tasks)"
|
|
733
|
+
: "(no more candidates)"
|
|
734
|
+
: "Add prerequisite..." }), filtered.map((t) => (_jsxs("option", { value: t.id, children: ["[", t.status, "] ", t.title] }, t.id)))] })] }));
|
|
735
|
+
}
|
|
736
|
+
// ─── Project chips strip ─────────────────────────────────────────
|
|
737
|
+
function ProjectChips({ chips, active, onPick, showAll, rightExtras, }) {
|
|
738
|
+
return (_jsxs("div", { className: "flex items-center gap-1 px-2 py-1.5 border-b border-gray-800 bg-gray-950/40 overflow-x-auto scrollbar-none flex-shrink-0", children: [showAll && (_jsx(Chip, { active: !active, label: "All", count: chips.reduce((n, c) => n + c.count, 0), onClick: () => onPick("") })), chips.map((p) => (_jsx(Chip, { active: active === p.key, label: p.label, count: p.count, onClick: () => onPick(active === p.key ? "" : p.key) }, p.key || "all"))), rightExtras] }));
|
|
739
|
+
}
|
|
740
|
+
function Chip({ active, label, count, onClick, }) {
|
|
741
|
+
return (_jsxs("button", { onClick: onClick, className: [
|
|
742
|
+
"shrink-0 inline-flex items-center gap-1 rounded-full text-[11px] transition-colors px-2.5 py-0.5",
|
|
743
|
+
active
|
|
744
|
+
? "bg-blue-500/20 border border-blue-400/50 text-blue-200"
|
|
745
|
+
: "text-gray-400 hover:text-gray-200 hover:bg-gray-800/60 border border-transparent",
|
|
746
|
+
].join(" "), children: [_jsx("span", { children: label }), _jsx("span", { className: active ? "text-blue-300/80" : "text-gray-600", children: count })] }));
|
|
747
|
+
}
|
|
748
|
+
function WorkerStatusRow({ snapshot, onNudge, }) {
|
|
749
|
+
if (!snapshot) {
|
|
750
|
+
return (_jsx("div", { className: "px-6 py-1.5 border-b border-gray-800 text-[11px] text-gray-500 flex-shrink-0", children: "Workers: loading..." }));
|
|
751
|
+
}
|
|
752
|
+
return (_jsxs("div", { className: "px-6 py-1.5 border-b border-gray-800 text-[11px] flex items-center gap-2 text-gray-300 flex-wrap flex-shrink-0", children: [_jsx(Hammer, { className: "w-3 h-3 text-gray-500" }), _jsx("span", { className: "text-gray-500", children: "Worker types:" }), snapshot.workers.map((w) => (_jsxs("span", { title: `Type: ${w.kind}\nAgent: ${w.name}`, className: `inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] border font-mono uppercase tracking-wide ${w.busy
|
|
753
|
+
? "bg-blue-900/40 border-blue-700 text-blue-100"
|
|
754
|
+
: "bg-gray-900 border-gray-700 text-gray-400"}`, children: [w.busy ? (_jsx(Loader2, { className: "w-2.5 h-2.5 animate-spin" })) : (_jsx(CheckCircle2, { className: "w-2.5 h-2.5" })), w.kind] }, w.agentId))), snapshot.running.length > 0 && (_jsxs("span", { className: "text-gray-500", children: ["running ", snapshot.running.length, " task", snapshot.running.length === 1 ? "" : "s"] })), _jsx("button", { type: "button", onClick: onNudge, className: "ml-auto text-[10px] uppercase tracking-wide text-gray-400 hover:text-gray-100", children: "Nudge pool" })] }));
|
|
755
|
+
}
|
|
756
|
+
// ─── Modal: full task editor (admin only) ────────────────────────
|
|
757
|
+
function TaskModal({ task, allTasks, busy, onClose, onPatch, onDelete, }) {
|
|
758
|
+
const [title, setTitle] = useState(task.title);
|
|
759
|
+
const [description, setDescription] = useState(task.description || "");
|
|
760
|
+
const [project, setProject] = useState(task.project || "");
|
|
761
|
+
const [priority, setPriority] = useState(task.priority);
|
|
762
|
+
const [workerRole, setWorkerRole] = useState(task.workerRole || "");
|
|
763
|
+
const [dependsOn, setDependsOn] = useState(task.dependsOn ?? []);
|
|
764
|
+
// Re-sync local form state when the parent reloads with fresh data.
|
|
765
|
+
useEffect(() => {
|
|
766
|
+
setTitle(task.title);
|
|
767
|
+
setDescription(task.description || "");
|
|
768
|
+
setProject(task.project || "");
|
|
769
|
+
setPriority(task.priority);
|
|
770
|
+
setWorkerRole(task.workerRole || "");
|
|
771
|
+
setDependsOn(task.dependsOn ?? []);
|
|
772
|
+
}, [
|
|
773
|
+
task.id,
|
|
774
|
+
task.title,
|
|
775
|
+
task.description,
|
|
776
|
+
task.project,
|
|
777
|
+
task.priority,
|
|
778
|
+
task.workerRole,
|
|
779
|
+
task.dependsOn,
|
|
780
|
+
]);
|
|
781
|
+
const allStatuses = ["ready", "in_progress", "done"];
|
|
782
|
+
const save = async () => {
|
|
783
|
+
await onPatch({
|
|
784
|
+
title,
|
|
785
|
+
description: description || null,
|
|
786
|
+
project: project || PROJECT_INBOX_KEY,
|
|
787
|
+
priority,
|
|
788
|
+
workerRole: workerRole.trim() || null,
|
|
789
|
+
dependsOn,
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
return (_jsx("div", { className: "fixed inset-0 bg-black/60 z-40 flex items-center justify-center p-4", onClick: onClose, children: _jsxs("div", { onClick: (e) => e.stopPropagation(), className: "w-full max-w-xl bg-gray-950 border border-gray-800 rounded-lg shadow-xl flex flex-col max-h-[80vh] overflow-hidden", children: [_jsxs("header", { className: "px-4 py-3 border-b border-gray-800 flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-[10px] uppercase text-gray-500 tracking-wide", children: "Task" }), _jsx("span", { className: "text-[10px] text-gray-600 font-mono truncate", children: task.id }), _jsx("button", { type: "button", onClick: onClose, className: "ml-auto p-1 rounded text-gray-400 hover:text-gray-100 hover:bg-gray-800", children: _jsx(X, { className: "w-4 h-4" }) })] }), task.sandboxName && (_jsxs("div", { className: "flex items-center gap-1.5", title: "Microsandbox VM bound to this task. Running while the worker is active, stopped after release (disk preserved), removed when the task is deleted.", children: [_jsx("span", { className: "text-[10px] uppercase text-gray-500 tracking-wide", children: "Sandbox" }), _jsx("code", { className: "text-[10px] text-gray-500 font-mono truncate cursor-pointer hover:text-gray-300", onClick: (e) => {
|
|
793
|
+
if (!task.sandboxName)
|
|
794
|
+
return;
|
|
795
|
+
void navigator.clipboard
|
|
796
|
+
?.writeText(task.sandboxName)
|
|
797
|
+
.catch(() => { });
|
|
798
|
+
// Brief visual ack: bump opacity via title swap.
|
|
799
|
+
const t = e.currentTarget;
|
|
800
|
+
const orig = t.title;
|
|
801
|
+
t.title = "copied";
|
|
802
|
+
setTimeout(() => {
|
|
803
|
+
t.title = orig;
|
|
804
|
+
}, 800);
|
|
805
|
+
}, title: "Click to copy", children: task.sandboxName })] }))] }), _jsxs("div", { className: "flex-1 overflow-y-auto p-4 space-y-3 text-xs", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Title" }), _jsx("input", { value: title, onChange: (e) => setTitle(e.target.value), className: "w-full px-2 py-1.5 bg-gray-900 border border-gray-700 rounded outline-none focus:border-blue-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Description" }), _jsx("textarea", { value: description, onChange: (e) => setDescription(e.target.value), rows: 4, className: "w-full px-2 py-1.5 bg-gray-900 border border-gray-700 rounded outline-none focus:border-blue-600 resize-y" })] }), _jsxs("div", { className: "grid grid-cols-3 gap-2", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Project" }), _jsx("input", { value: project, onChange: (e) => setProject(e.target.value), placeholder: PROJECT_INBOX_KEY, className: "w-full px-2 py-1.5 bg-gray-900 border border-gray-700 rounded outline-none focus:border-blue-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Priority" }), _jsx("input", { type: "number", value: priority, onChange: (e) => setPriority(Number(e.target.value) || 0), className: "w-full px-2 py-1.5 bg-gray-900 border border-gray-700 rounded outline-none focus:border-blue-600" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Worker role" }), _jsx("input", { value: workerRole, onChange: (e) => setWorkerRole(e.target.value), placeholder: "any", className: "w-full px-2 py-1.5 bg-gray-900 border border-gray-700 rounded outline-none focus:border-blue-600" })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Status" }), _jsx("div", { className: "flex flex-wrap gap-1", children: allStatuses.map((s) => (_jsx("button", { type: "button", disabled: busy || s === task.status, onClick: () => void onPatch({ status: s }), className: `text-[10px] px-2 py-1 rounded border ${s === task.status
|
|
806
|
+
? "bg-blue-700/40 border-blue-600 text-blue-100 cursor-default"
|
|
807
|
+
: "border-gray-700 text-gray-400 hover:bg-gray-800 hover:text-gray-100"} disabled:cursor-not-allowed`, children: s.replace("_", " ") }, s))) })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Depends on" }), _jsx(DependencyPicker, { value: dependsOn, onChange: setDependsOn, candidates: allTasks, project: project, excludeId: task.id })] }), task.resultSummary && (_jsxs("div", { children: [_jsx("label", { className: "block text-[10px] uppercase tracking-wide text-gray-500 mb-1", children: "Result" }), _jsx("div", { className: "bg-gray-900 border border-gray-800 rounded px-2 py-1.5 text-emerald-200 italic whitespace-pre-line", children: task.resultSummary })] })), _jsxs("div", { className: "grid grid-cols-3 gap-2 text-[10px] text-gray-500 border-t border-gray-800 pt-2", children: [_jsxs("div", { children: ["Created", _jsx("div", { className: "text-gray-300", children: new Date(task.createdAt).toLocaleString() })] }), task.startedAt && (_jsxs("div", { children: ["Started", _jsx("div", { className: "text-gray-300", children: new Date(task.startedAt).toLocaleString() })] })), task.endedAt && (_jsxs("div", { children: ["Ended", _jsx("div", { className: "text-gray-300", children: new Date(task.endedAt).toLocaleString() })] }))] })] }), _jsxs("footer", { className: "px-4 py-3 border-t border-gray-800 flex items-center gap-2", children: [_jsxs("button", { type: "button", disabled: busy, onClick: () => {
|
|
808
|
+
if (window.confirm(`Delete task "${task.title}"? This is permanent.`)) {
|
|
809
|
+
void onDelete();
|
|
810
|
+
}
|
|
811
|
+
}, className: "inline-flex items-center gap-1 px-2 py-1 text-[11px] rounded border border-red-800 text-red-200 hover:bg-red-900/30 disabled:opacity-50", children: [_jsx(Trash2, { className: "w-3 h-3" }), " Delete"] }), _jsx("button", { type: "button", onClick: onClose, className: "ml-auto px-3 py-1 text-[11px] rounded border border-gray-700 text-gray-300 hover:bg-gray-800", children: "Cancel" }), _jsx("button", { type: "button", onClick: () => void save(), disabled: busy, className: "px-3 py-1 text-[11px] rounded bg-blue-700 hover:bg-blue-600 text-white disabled:opacity-50", children: busy ? _jsx(Loader2, { className: "w-3.5 h-3.5 animate-spin" }) : "Save" })] })] }) }));
|
|
812
|
+
}
|
|
813
|
+
// `WorkboardAdminPage` is intentionally not in `components` - the
|
|
814
|
+
// manifest's `adminPages` contribution was removed; resurrect it by
|
|
815
|
+
// re-adding both at the same time.
|
|
816
|
+
void WorkboardAdminPage;
|
|
817
|
+
// ─── Sidebar Workers section ──────────────────────────────
|
|
818
|
+
//
|
|
819
|
+
// Renders the workers contributed by THIS plugin in the host
|
|
820
|
+
// sidebar. v0.2 only ships the `echo` worker; future ADR-0002
|
|
821
|
+
// roles (qianliyan / luban / xihe / nvwa) ship as their own
|
|
822
|
+
// plugins and will append their own rows by claiming the same
|
|
823
|
+
// `sidebarSections.after = "workers"` anchor.
|
|
824
|
+
//
|
|
825
|
+
// The header and the row chrome live here too; the host
|
|
826
|
+
// `PluginSidebarSections` will stack rendered sections in order, so
|
|
827
|
+
// only the FIRST plugin's section paints the "Workers" header.
|
|
828
|
+
// (When more plugins arrive we will probably move the header into
|
|
829
|
+
// host code; for now keeping it here keeps the contract visible.)
|
|
830
|
+
function WorkersSidebarSection(_props) {
|
|
831
|
+
const [snapshot, setSnapshot] = useState(null);
|
|
832
|
+
const reload = useCallback(async () => {
|
|
833
|
+
try {
|
|
834
|
+
const r = await getJson(`${API_BASE}/workers/status`);
|
|
835
|
+
setSnapshot(r);
|
|
836
|
+
}
|
|
837
|
+
catch {
|
|
838
|
+
setSnapshot(null);
|
|
839
|
+
}
|
|
840
|
+
}, []);
|
|
841
|
+
useEffect(() => {
|
|
842
|
+
void reload();
|
|
843
|
+
const id = window.setInterval(() => void reload(), 5000);
|
|
844
|
+
return () => window.clearInterval(id);
|
|
845
|
+
}, [reload]);
|
|
846
|
+
const realWorkers = snapshot?.workers ?? [];
|
|
847
|
+
const busyCount = realWorkers.filter((w) => w.busy).length;
|
|
848
|
+
return (_jsxs("div", { className: "px-3 py-2", children: [_jsxs("div", { className: "mb-2 flex items-center gap-2", children: [_jsx(Zap, { size: 14, className: "flex-shrink-0 text-gray-600" }), _jsx("span", { className: "flex-1 text-sm font-medium text-gray-300", children: "Workers" }), _jsxs("span", { className: "rounded bg-gray-800 px-1.5 py-0.5 text-[9px] text-gray-600", children: [busyCount, "/", realWorkers.length, " busy"] })] }), _jsx("div", { className: "space-y-1.5", children: realWorkers.length === 0 ? (_jsx("div", { className: "text-[10px] text-gray-600 px-1", children: "No workers running. Toggle echo on under Settings \u2192 Plugins \u2192 Workboard." })) : (realWorkers.map((w) => (_jsx(SidebarWorkerRow, { name: w.name, kind: w.kind, busy: w.busy }, w.agentId)))) })] }));
|
|
849
|
+
}
|
|
850
|
+
function SidebarWorkerRow({ name, kind, busy, }) {
|
|
851
|
+
// The agent's display name (set in Settings → Plugins → Worker
|
|
852
|
+
// agents) is the primary identity - the user wants to know which
|
|
853
|
+
// configured instance this is at a glance. The worker *kind*
|
|
854
|
+
// (echo / llm / future ADR-0002 roles) is shown as a small
|
|
855
|
+
// secondary tag so two agents of the same kind stay
|
|
856
|
+
// distinguishable without making the kind dominate the row.
|
|
857
|
+
const emoji = kindEmoji(kind);
|
|
858
|
+
return (_jsxs("div", { className: "flex cursor-default items-center gap-2 rounded py-0.5 pl-1 hover:bg-gray-700/30", title: `Agent: ${name}\nWorker type: ${kind}`, children: [_jsx("span", { className: "w-5 flex-shrink-0 text-center text-base", children: emoji }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "truncate text-xs font-medium text-gray-200", children: name }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "truncate rounded bg-gray-800/80 px-1 py-px font-mono text-[9px] font-semibold uppercase tracking-wide text-gray-400", children: kind }), _jsx("span", { className: `rounded px-1 py-px text-[9px] ${busy
|
|
859
|
+
? "bg-blue-900/40 text-blue-100 border border-blue-700"
|
|
860
|
+
: "bg-gray-800/60 text-gray-600"}`, children: busy ? "busy" : "idle" })] })] })] }));
|
|
861
|
+
}
|
|
862
|
+
function kindEmoji(kind) {
|
|
863
|
+
if (kind === "echo")
|
|
864
|
+
return "🔁";
|
|
865
|
+
return "⚙️";
|
|
866
|
+
}
|
|
867
|
+
/** Compact "5m ago" / "2h ago" / "3d ago" rendering for an ms
|
|
868
|
+
* timestamp. Used by the awaiting-intervention chip so the
|
|
869
|
+
* operator sees how long the task has been parked at a glance.
|
|
870
|
+
* We deliberately avoid `Intl.RelativeTimeFormat` because its
|
|
871
|
+
* output ("5 minutes ago") is too verbose for a chip. */
|
|
872
|
+
function formatRelative(ms) {
|
|
873
|
+
const delta = Math.max(0, Date.now() - ms);
|
|
874
|
+
const sec = Math.round(delta / 1000);
|
|
875
|
+
if (sec < 60)
|
|
876
|
+
return `${sec}s ago`;
|
|
877
|
+
const min = Math.round(sec / 60);
|
|
878
|
+
if (min < 60)
|
|
879
|
+
return `${min}m ago`;
|
|
880
|
+
const hr = Math.round(min / 60);
|
|
881
|
+
if (hr < 24)
|
|
882
|
+
return `${hr}h ago`;
|
|
883
|
+
const day = Math.round(hr / 24);
|
|
884
|
+
return `${day}d ago`;
|
|
885
|
+
}
|
|
886
|
+
const clientExports = {
|
|
887
|
+
components: {
|
|
888
|
+
WorkboardPanel: WorkboardPanel,
|
|
889
|
+
WorkersSidebarSection: WorkersSidebarSection,
|
|
890
|
+
WorkerAgentsPage: WorkerAgentsPage,
|
|
891
|
+
},
|
|
892
|
+
};
|
|
893
|
+
export const components = clientExports.components;
|
|
894
|
+
export default clientExports;
|
|
895
|
+
//# sourceMappingURL=client.js.map
|