@tt-a1i/hive 1.3.0 → 1.4.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/CHANGELOG.md +61 -14
- package/README.en.md +65 -8
- package/README.md +49 -6
- package/assets/hive-team-view.png +0 -0
- package/dist/src/cli/hive.js +34 -8
- package/dist/src/cli/team.d.ts +6 -0
- package/dist/src/cli/team.js +48 -0
- package/dist/src/server/agent-launch-cache.js +25 -6
- package/dist/src/server/agent-manager.d.ts +2 -2
- package/dist/src/server/agent-runtime-contract.d.ts +3 -0
- package/dist/src/server/agent-runtime.js +3 -0
- package/dist/src/server/agent-startup-instructions.js +1 -1
- package/dist/src/server/agent-stdin-dispatcher.d.ts +4 -0
- package/dist/src/server/agent-stdin-dispatcher.js +12 -0
- package/dist/src/server/app.js +1 -1
- package/dist/src/server/dispatch-ledger-store.d.ts +22 -1
- package/dist/src/server/dispatch-ledger-store.js +34 -3
- package/dist/src/server/hive-team-guidance.js +3 -1
- package/dist/src/server/marketplace-store.d.ts +38 -0
- package/dist/src/server/marketplace-store.js +69 -0
- package/dist/src/server/route-types.d.ts +7 -0
- package/dist/src/server/routes-dispatches.js +4 -2
- package/dist/src/server/routes-marketplace.d.ts +2 -0
- package/dist/src/server/routes-marketplace.js +54 -0
- package/dist/src/server/routes-runtime.js +1 -0
- package/dist/src/server/routes-team.js +22 -0
- package/dist/src/server/routes.js +2 -0
- package/dist/src/server/runtime-store-helpers.d.ts +2 -1
- package/dist/src/server/runtime-store-helpers.js +14 -4
- package/dist/src/server/runtime-store.d.ts +5 -8
- package/dist/src/server/runtime-store.js +1 -0
- package/dist/src/server/tasks-websocket-server.d.ts +2 -1
- package/dist/src/server/tasks-websocket-server.js +18 -2
- package/dist/src/server/team-authz.d.ts +1 -1
- package/dist/src/server/team-authz.js +1 -1
- package/dist/src/server/team-operations.d.ts +16 -1
- package/dist/src/server/team-operations.js +28 -1
- package/dist/src/server/terminal-input-profile.d.ts +10 -0
- package/dist/src/server/terminal-input-profile.js +15 -0
- package/dist/src/server/terminal-stream-hub.js +10 -2
- package/dist/src/server/terminal-ws-server.d.ts +2 -1
- package/dist/src/server/terminal-ws-server.js +2 -2
- package/dist/src/server/workspace-shell-runtime.d.ts +2 -1
- package/dist/src/server/workspace-shell-runtime.js +3 -2
- package/dist/src/server/workspace-store-contract.d.ts +1 -0
- package/dist/src/server/workspace-store-mutations.d.ts +1 -0
- package/dist/src/server/workspace-store-mutations.js +6 -3
- package/dist/src/server/workspace-store.js +2 -1
- package/dist/vendor/marketplace/en/LICENSE +21 -0
- package/dist/vendor/marketplace/en/SOURCES.md +12 -0
- package/dist/vendor/marketplace/en/academic/academic-anthropologist.md +125 -0
- package/dist/vendor/marketplace/en/academic/academic-geographer.md +127 -0
- package/dist/vendor/marketplace/en/academic/academic-historian.md +123 -0
- package/dist/vendor/marketplace/en/academic/academic-narratologist.md +118 -0
- package/dist/vendor/marketplace/en/academic/academic-psychologist.md +118 -0
- package/dist/vendor/marketplace/en/design/design-brand-guardian.md +322 -0
- package/dist/vendor/marketplace/en/design/design-image-prompt-engineer.md +236 -0
- package/dist/vendor/marketplace/en/design/design-inclusive-visuals-specialist.md +71 -0
- package/dist/vendor/marketplace/en/design/design-ui-designer.md +383 -0
- package/dist/vendor/marketplace/en/design/design-ux-architect.md +469 -0
- package/dist/vendor/marketplace/en/design/design-ux-researcher.md +329 -0
- package/dist/vendor/marketplace/en/design/design-visual-storyteller.md +149 -0
- package/dist/vendor/marketplace/en/design/design-whimsy-injector.md +438 -0
- package/dist/vendor/marketplace/en/engineering/engineering-ai-data-remediation-engineer.md +211 -0
- package/dist/vendor/marketplace/en/engineering/engineering-ai-engineer.md +146 -0
- package/dist/vendor/marketplace/en/engineering/engineering-autonomous-optimization-architect.md +107 -0
- package/dist/vendor/marketplace/en/engineering/engineering-backend-architect.md +235 -0
- package/dist/vendor/marketplace/en/engineering/engineering-cms-developer.md +536 -0
- package/dist/vendor/marketplace/en/engineering/engineering-code-reviewer.md +76 -0
- package/dist/vendor/marketplace/en/engineering/engineering-codebase-onboarding-engineer.md +173 -0
- package/dist/vendor/marketplace/en/engineering/engineering-data-engineer.md +306 -0
- package/dist/vendor/marketplace/en/engineering/engineering-database-optimizer.md +176 -0
- package/dist/vendor/marketplace/en/engineering/engineering-devops-automator.md +376 -0
- package/dist/vendor/marketplace/en/engineering/engineering-email-intelligence-engineer.md +353 -0
- package/dist/vendor/marketplace/en/engineering/engineering-embedded-firmware-engineer.md +173 -0
- package/dist/vendor/marketplace/en/engineering/engineering-feishu-integration-developer.md +598 -0
- package/dist/vendor/marketplace/en/engineering/engineering-filament-optimization-specialist.md +283 -0
- package/dist/vendor/marketplace/en/engineering/engineering-frontend-developer.md +225 -0
- package/dist/vendor/marketplace/en/engineering/engineering-git-workflow-master.md +84 -0
- package/dist/vendor/marketplace/en/engineering/engineering-incident-response-commander.md +444 -0
- package/dist/vendor/marketplace/en/engineering/engineering-minimal-change-engineer.md +207 -0
- package/dist/vendor/marketplace/en/engineering/engineering-mobile-app-builder.md +493 -0
- package/dist/vendor/marketplace/en/engineering/engineering-rapid-prototyper.md +462 -0
- package/dist/vendor/marketplace/en/engineering/engineering-security-engineer.md +304 -0
- package/dist/vendor/marketplace/en/engineering/engineering-senior-developer.md +176 -0
- package/dist/vendor/marketplace/en/engineering/engineering-software-architect.md +81 -0
- package/dist/vendor/marketplace/en/engineering/engineering-solidity-smart-contract-engineer.md +522 -0
- package/dist/vendor/marketplace/en/engineering/engineering-sre.md +90 -0
- package/dist/vendor/marketplace/en/engineering/engineering-technical-writer.md +393 -0
- package/dist/vendor/marketplace/en/engineering/engineering-threat-detection-engineer.md +534 -0
- package/dist/vendor/marketplace/en/engineering/engineering-voice-ai-integration-engineer.md +561 -0
- package/dist/vendor/marketplace/en/engineering/engineering-wechat-mini-program-developer.md +350 -0
- package/dist/vendor/marketplace/en/finance/finance-bookkeeper-controller.md +260 -0
- package/dist/vendor/marketplace/en/finance/finance-financial-analyst.md +234 -0
- package/dist/vendor/marketplace/en/finance/finance-fpa-analyst.md +263 -0
- package/dist/vendor/marketplace/en/finance/finance-investment-researcher.md +272 -0
- package/dist/vendor/marketplace/en/finance/finance-tax-strategist.md +239 -0
- package/dist/vendor/marketplace/en/game-development/blender/blender-addon-engineer.md +234 -0
- package/dist/vendor/marketplace/en/game-development/game-audio-engineer.md +264 -0
- package/dist/vendor/marketplace/en/game-development/game-designer.md +167 -0
- package/dist/vendor/marketplace/en/game-development/godot/godot-gameplay-scripter.md +334 -0
- package/dist/vendor/marketplace/en/game-development/godot/godot-multiplayer-engineer.md +297 -0
- package/dist/vendor/marketplace/en/game-development/godot/godot-shader-developer.md +266 -0
- package/dist/vendor/marketplace/en/game-development/level-designer.md +208 -0
- package/dist/vendor/marketplace/en/game-development/narrative-designer.md +243 -0
- package/dist/vendor/marketplace/en/game-development/roblox-studio/roblox-avatar-creator.md +297 -0
- package/dist/vendor/marketplace/en/game-development/roblox-studio/roblox-experience-designer.md +305 -0
- package/dist/vendor/marketplace/en/game-development/roblox-studio/roblox-systems-scripter.md +325 -0
- package/dist/vendor/marketplace/en/game-development/technical-artist.md +229 -0
- package/dist/vendor/marketplace/en/game-development/unity/unity-architect.md +271 -0
- package/dist/vendor/marketplace/en/game-development/unity/unity-editor-tool-developer.md +310 -0
- package/dist/vendor/marketplace/en/game-development/unity/unity-multiplayer-engineer.md +321 -0
- package/dist/vendor/marketplace/en/game-development/unity/unity-shader-graph-artist.md +269 -0
- package/dist/vendor/marketplace/en/game-development/unreal-engine/unreal-multiplayer-architect.md +313 -0
- package/dist/vendor/marketplace/en/game-development/unreal-engine/unreal-systems-engineer.md +310 -0
- package/dist/vendor/marketplace/en/game-development/unreal-engine/unreal-technical-artist.md +256 -0
- package/dist/vendor/marketplace/en/game-development/unreal-engine/unreal-world-builder.md +273 -0
- package/dist/vendor/marketplace/en/integrations/mcp-memory/backend-architect-with-memory.md +247 -0
- package/dist/vendor/marketplace/en/manifest.json +1869 -0
- package/dist/vendor/marketplace/en/marketing/marketing-agentic-search-optimizer.md +311 -0
- package/dist/vendor/marketplace/en/marketing/marketing-ai-citation-strategist.md +170 -0
- package/dist/vendor/marketplace/en/marketing/marketing-app-store-optimizer.md +321 -0
- package/dist/vendor/marketplace/en/marketing/marketing-baidu-seo-specialist.md +226 -0
- package/dist/vendor/marketplace/en/marketing/marketing-bilibili-content-strategist.md +199 -0
- package/dist/vendor/marketplace/en/marketing/marketing-book-co-author.md +110 -0
- package/dist/vendor/marketplace/en/marketing/marketing-carousel-growth-engine.md +199 -0
- package/dist/vendor/marketplace/en/marketing/marketing-china-ecommerce-operator.md +283 -0
- package/dist/vendor/marketplace/en/marketing/marketing-china-market-localization-strategist.md +283 -0
- package/dist/vendor/marketplace/en/marketing/marketing-content-creator.md +54 -0
- package/dist/vendor/marketplace/en/marketing/marketing-cross-border-ecommerce.md +259 -0
- package/dist/vendor/marketplace/en/marketing/marketing-douyin-strategist.md +149 -0
- package/dist/vendor/marketplace/en/marketing/marketing-growth-hacker.md +54 -0
- package/dist/vendor/marketplace/en/marketing/marketing-instagram-curator.md +113 -0
- package/dist/vendor/marketplace/en/marketing/marketing-kuaishou-strategist.md +223 -0
- package/dist/vendor/marketplace/en/marketing/marketing-linkedin-content-creator.md +214 -0
- package/dist/vendor/marketplace/en/marketing/marketing-livestream-commerce-coach.md +305 -0
- package/dist/vendor/marketplace/en/marketing/marketing-podcast-strategist.md +277 -0
- package/dist/vendor/marketplace/en/marketing/marketing-private-domain-operator.md +308 -0
- package/dist/vendor/marketplace/en/marketing/marketing-reddit-community-builder.md +123 -0
- package/dist/vendor/marketplace/en/marketing/marketing-seo-specialist.md +321 -0
- package/dist/vendor/marketplace/en/marketing/marketing-short-video-editing-coach.md +412 -0
- package/dist/vendor/marketplace/en/marketing/marketing-social-media-strategist.md +125 -0
- package/dist/vendor/marketplace/en/marketing/marketing-tiktok-strategist.md +125 -0
- package/dist/vendor/marketplace/en/marketing/marketing-twitter-engager.md +126 -0
- package/dist/vendor/marketplace/en/marketing/marketing-video-optimization-specialist.md +119 -0
- package/dist/vendor/marketplace/en/marketing/marketing-wechat-official-account.md +145 -0
- package/dist/vendor/marketplace/en/marketing/marketing-weibo-strategist.md +240 -0
- package/dist/vendor/marketplace/en/marketing/marketing-xiaohongshu-specialist.md +138 -0
- package/dist/vendor/marketplace/en/marketing/marketing-zhihu-strategist.md +162 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-auditor.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-creative-strategist.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-paid-social-strategist.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-ppc-strategist.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-programmatic-buyer.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-search-query-analyst.md +71 -0
- package/dist/vendor/marketplace/en/paid-media/paid-media-tracking-specialist.md +71 -0
- package/dist/vendor/marketplace/en/product/product-behavioral-nudge-engine.md +80 -0
- package/dist/vendor/marketplace/en/product/product-feedback-synthesizer.md +119 -0
- package/dist/vendor/marketplace/en/product/product-manager.md +469 -0
- package/dist/vendor/marketplace/en/product/product-sprint-prioritizer.md +154 -0
- package/dist/vendor/marketplace/en/product/product-trend-researcher.md +159 -0
- package/dist/vendor/marketplace/en/project-management/project-management-experiment-tracker.md +198 -0
- package/dist/vendor/marketplace/en/project-management/project-management-jira-workflow-steward.md +230 -0
- package/dist/vendor/marketplace/en/project-management/project-management-project-shepherd.md +194 -0
- package/dist/vendor/marketplace/en/project-management/project-management-studio-operations.md +200 -0
- package/dist/vendor/marketplace/en/project-management/project-management-studio-producer.md +203 -0
- package/dist/vendor/marketplace/en/project-management/project-manager-senior.md +135 -0
- package/dist/vendor/marketplace/en/sales/sales-account-strategist.md +227 -0
- package/dist/vendor/marketplace/en/sales/sales-coach.md +271 -0
- package/dist/vendor/marketplace/en/sales/sales-deal-strategist.md +180 -0
- package/dist/vendor/marketplace/en/sales/sales-discovery-coach.md +225 -0
- package/dist/vendor/marketplace/en/sales/sales-engineer.md +182 -0
- package/dist/vendor/marketplace/en/sales/sales-outbound-strategist.md +201 -0
- package/dist/vendor/marketplace/en/sales/sales-pipeline-analyst.md +267 -0
- package/dist/vendor/marketplace/en/sales/sales-proposal-strategist.md +217 -0
- package/dist/vendor/marketplace/en/spatial-computing/macos-spatial-metal-engineer.md +337 -0
- package/dist/vendor/marketplace/en/spatial-computing/terminal-integration-specialist.md +70 -0
- package/dist/vendor/marketplace/en/spatial-computing/visionos-spatial-engineer.md +54 -0
- package/dist/vendor/marketplace/en/spatial-computing/xr-cockpit-interaction-specialist.md +32 -0
- package/dist/vendor/marketplace/en/spatial-computing/xr-immersive-developer.md +32 -0
- package/dist/vendor/marketplace/en/spatial-computing/xr-interface-architect.md +32 -0
- package/dist/vendor/marketplace/en/specialized/accounts-payable-agent.md +185 -0
- package/dist/vendor/marketplace/en/specialized/agentic-identity-trust.md +387 -0
- package/dist/vendor/marketplace/en/specialized/agents-orchestrator.md +367 -0
- package/dist/vendor/marketplace/en/specialized/automation-governance-architect.md +216 -0
- package/dist/vendor/marketplace/en/specialized/blockchain-security-auditor.md +463 -0
- package/dist/vendor/marketplace/en/specialized/compliance-auditor.md +158 -0
- package/dist/vendor/marketplace/en/specialized/corporate-training-designer.md +192 -0
- package/dist/vendor/marketplace/en/specialized/customer-service.md +398 -0
- package/dist/vendor/marketplace/en/specialized/data-consolidation-agent.md +60 -0
- package/dist/vendor/marketplace/en/specialized/government-digital-presales-consultant.md +363 -0
- package/dist/vendor/marketplace/en/specialized/healthcare-customer-service.md +389 -0
- package/dist/vendor/marketplace/en/specialized/healthcare-marketing-compliance.md +395 -0
- package/dist/vendor/marketplace/en/specialized/hospitality-guest-services.md +603 -0
- package/dist/vendor/marketplace/en/specialized/hr-onboarding.md +451 -0
- package/dist/vendor/marketplace/en/specialized/identity-graph-operator.md +260 -0
- package/dist/vendor/marketplace/en/specialized/language-translator.md +264 -0
- package/dist/vendor/marketplace/en/specialized/legal-billing-time-tracking.md +569 -0
- package/dist/vendor/marketplace/en/specialized/legal-client-intake.md +492 -0
- package/dist/vendor/marketplace/en/specialized/legal-document-review.md +454 -0
- package/dist/vendor/marketplace/en/specialized/loan-officer-assistant.md +555 -0
- package/dist/vendor/marketplace/en/specialized/lsp-index-engineer.md +314 -0
- package/dist/vendor/marketplace/en/specialized/real-estate-buyer-seller.md +596 -0
- package/dist/vendor/marketplace/en/specialized/recruitment-specialist.md +509 -0
- package/dist/vendor/marketplace/en/specialized/report-distribution-agent.md +65 -0
- package/dist/vendor/marketplace/en/specialized/retail-customer-returns.md +566 -0
- package/dist/vendor/marketplace/en/specialized/sales-data-extraction-agent.md +67 -0
- package/dist/vendor/marketplace/en/specialized/sales-outreach.md +425 -0
- package/dist/vendor/marketplace/en/specialized/specialized-chief-of-staff.md +279 -0
- package/dist/vendor/marketplace/en/specialized/specialized-civil-engineer.md +356 -0
- package/dist/vendor/marketplace/en/specialized/specialized-cultural-intelligence-strategist.md +88 -0
- package/dist/vendor/marketplace/en/specialized/specialized-developer-advocate.md +317 -0
- package/dist/vendor/marketplace/en/specialized/specialized-document-generator.md +55 -0
- package/dist/vendor/marketplace/en/specialized/specialized-french-consulting-market.md +192 -0
- package/dist/vendor/marketplace/en/specialized/specialized-korean-business-navigator.md +216 -0
- package/dist/vendor/marketplace/en/specialized/specialized-mcp-builder.md +248 -0
- package/dist/vendor/marketplace/en/specialized/specialized-model-qa.md +488 -0
- package/dist/vendor/marketplace/en/specialized/specialized-salesforce-architect.md +180 -0
- package/dist/vendor/marketplace/en/specialized/specialized-workflow-architect.md +597 -0
- package/dist/vendor/marketplace/en/specialized/study-abroad-advisor.md +282 -0
- package/dist/vendor/marketplace/en/specialized/supply-chain-strategist.md +582 -0
- package/dist/vendor/marketplace/en/support/support-analytics-reporter.md +365 -0
- package/dist/vendor/marketplace/en/support/support-executive-summary-generator.md +212 -0
- package/dist/vendor/marketplace/en/support/support-finance-tracker.md +442 -0
- package/dist/vendor/marketplace/en/support/support-infrastructure-maintainer.md +618 -0
- package/dist/vendor/marketplace/en/support/support-legal-compliance-checker.md +588 -0
- package/dist/vendor/marketplace/en/support/support-support-responder.md +585 -0
- package/dist/vendor/marketplace/en/testing/testing-accessibility-auditor.md +316 -0
- package/dist/vendor/marketplace/en/testing/testing-api-tester.md +306 -0
- package/dist/vendor/marketplace/en/testing/testing-evidence-collector.md +210 -0
- package/dist/vendor/marketplace/en/testing/testing-performance-benchmarker.md +268 -0
- package/dist/vendor/marketplace/en/testing/testing-reality-checker.md +236 -0
- package/dist/vendor/marketplace/en/testing/testing-test-results-analyzer.md +305 -0
- package/dist/vendor/marketplace/en/testing/testing-tool-evaluator.md +394 -0
- package/dist/vendor/marketplace/en/testing/testing-workflow-optimizer.md +450 -0
- package/dist/vendor/marketplace/zh/LICENSE +22 -0
- package/dist/vendor/marketplace/zh/SOURCES.md +12 -0
- package/dist/vendor/marketplace/zh/academic/academic-anthropologist.md +124 -0
- package/dist/vendor/marketplace/zh/academic/academic-geographer.md +126 -0
- package/dist/vendor/marketplace/zh/academic/academic-historian.md +122 -0
- package/dist/vendor/marketplace/zh/academic/academic-narratologist.md +117 -0
- package/dist/vendor/marketplace/zh/academic/academic-psychologist.md +117 -0
- package/dist/vendor/marketplace/zh/academic/academic-study-planner.md +214 -0
- package/dist/vendor/marketplace/zh/design/design-brand-guardian.md +321 -0
- package/dist/vendor/marketplace/zh/design/design-image-prompt-engineer.md +255 -0
- package/dist/vendor/marketplace/zh/design/design-inclusive-visuals-specialist.md +177 -0
- package/dist/vendor/marketplace/zh/design/design-ui-designer.md +382 -0
- package/dist/vendor/marketplace/zh/design/design-ux-architect.md +482 -0
- package/dist/vendor/marketplace/zh/design/design-ux-researcher.md +328 -0
- package/dist/vendor/marketplace/zh/design/design-visual-storyteller.md +159 -0
- package/dist/vendor/marketplace/zh/design/design-whimsy-injector.md +453 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-ai-data-remediation-engineer.md +209 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-ai-engineer.md +161 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-autonomous-optimization-architect.md +115 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-backend-architect.md +234 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-cms-developer.md +534 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-code-reviewer.md +172 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-codebase-onboarding-engineer.md +172 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-data-engineer.md +324 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-database-optimizer.md +175 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-devops-automator.md +375 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-dingtalk-integration-developer.md +574 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-email-intelligence-engineer.md +349 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-embedded-firmware-engineer.md +168 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-embedded-linux-driver-engineer.md +255 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-feishu-integration-developer.md +597 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-filament-optimization-specialist.md +283 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-fpga-digital-design-engineer.md +227 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-frontend-developer.md +224 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-git-workflow-master.md +220 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-incident-response-commander.md +465 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-iot-solution-architect.md +220 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-mechanical-design-engineer.md +311 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-minimal-change-engineer.md +206 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-mobile-app-builder.md +434 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-pc-host-engineer.md +231 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-rapid-prototyper.md +461 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-security-engineer.md +303 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-senior-developer.md +177 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-software-architect.md +200 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-solidity-smart-contract-engineer.md +541 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-sre.md +233 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-technical-writer.md +409 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-threat-detection-engineer.md +553 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-voice-ai-integration-engineer.md +560 -0
- package/dist/vendor/marketplace/zh/engineering/engineering-wechat-mini-program-developer.md +288 -0
- package/dist/vendor/marketplace/zh/finance/finance-bookkeeper-controller.md +271 -0
- package/dist/vendor/marketplace/zh/finance/finance-financial-analyst.md +244 -0
- package/dist/vendor/marketplace/zh/finance/finance-financial-forecaster.md +213 -0
- package/dist/vendor/marketplace/zh/finance/finance-fpa-analyst.md +272 -0
- package/dist/vendor/marketplace/zh/finance/finance-fraud-detector.md +241 -0
- package/dist/vendor/marketplace/zh/finance/finance-investment-researcher.md +283 -0
- package/dist/vendor/marketplace/zh/finance/finance-invoice-manager.md +242 -0
- package/dist/vendor/marketplace/zh/finance/finance-tax-strategist.md +250 -0
- package/dist/vendor/marketplace/zh/game-development/blender/blender-addon-engineer.md +233 -0
- package/dist/vendor/marketplace/zh/game-development/game-audio-engineer.md +265 -0
- package/dist/vendor/marketplace/zh/game-development/game-designer.md +168 -0
- package/dist/vendor/marketplace/zh/game-development/godot/godot-gameplay-scripter.md +335 -0
- package/dist/vendor/marketplace/zh/game-development/godot/godot-multiplayer-engineer.md +296 -0
- package/dist/vendor/marketplace/zh/game-development/godot/godot-shader-developer.md +267 -0
- package/dist/vendor/marketplace/zh/game-development/level-designer.md +209 -0
- package/dist/vendor/marketplace/zh/game-development/narrative-designer.md +244 -0
- package/dist/vendor/marketplace/zh/game-development/roblox-studio/roblox-avatar-creator.md +298 -0
- package/dist/vendor/marketplace/zh/game-development/roblox-studio/roblox-experience-designer.md +306 -0
- package/dist/vendor/marketplace/zh/game-development/roblox-studio/roblox-systems-scripter.md +325 -0
- package/dist/vendor/marketplace/zh/game-development/technical-artist.md +230 -0
- package/dist/vendor/marketplace/zh/game-development/unity/unity-architect.md +272 -0
- package/dist/vendor/marketplace/zh/game-development/unity/unity-editor-tool-developer.md +300 -0
- package/dist/vendor/marketplace/zh/game-development/unity/unity-multiplayer-engineer.md +238 -0
- package/dist/vendor/marketplace/zh/game-development/unity/unity-shader-graph-artist.md +270 -0
- package/dist/vendor/marketplace/zh/game-development/unreal-engine/unreal-multiplayer-architect.md +314 -0
- package/dist/vendor/marketplace/zh/game-development/unreal-engine/unreal-systems-engineer.md +311 -0
- package/dist/vendor/marketplace/zh/game-development/unreal-engine/unreal-technical-artist.md +256 -0
- package/dist/vendor/marketplace/zh/game-development/unreal-engine/unreal-world-builder.md +274 -0
- package/dist/vendor/marketplace/zh/hr/hr-performance-reviewer.md +248 -0
- package/dist/vendor/marketplace/zh/hr/hr-recruiter.md +232 -0
- package/dist/vendor/marketplace/zh/legal/legal-contract-reviewer.md +240 -0
- package/dist/vendor/marketplace/zh/legal/legal-policy-writer.md +308 -0
- package/dist/vendor/marketplace/zh/manifest.json +2181 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-agentic-search-optimizer.md +312 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-ai-citation-strategist.md +169 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-app-store-optimizer.md +319 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-baidu-seo-specialist.md +220 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-bilibili-strategist.md +194 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-book-co-author.md +109 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-carousel-growth-engine.md +215 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-china-ecommerce-operator.md +277 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-china-market-localization-strategist.md +282 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-content-creator.md +145 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-cross-border-ecommerce.md +260 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-daily-news-briefing.md +303 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-douyin-strategist.md +150 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-ecommerce-operator.md +216 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-growth-hacker.md +121 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-instagram-curator.md +179 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-knowledge-commerce-strategist.md +384 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-kuaishou-strategist.md +182 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-linkedin-content-creator.md +232 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-livestream-commerce-coach.md +303 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-podcast-strategist.md +278 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-private-domain-operator.md +309 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-reddit-community-builder.md +127 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-seo-specialist.md +298 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-short-video-editing-coach.md +413 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-social-media-strategist.md +118 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-tiktok-strategist.md +124 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-twitter-engager.md +132 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-video-optimization-specialist.md +128 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-wechat-official-account.md +158 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-wechat-operator.md +156 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-weibo-strategist.md +241 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-weixin-channels-strategist.md +297 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-xiaohongshu-operator.md +139 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-xiaohongshu-specialist.md +151 -0
- package/dist/vendor/marketplace/zh/marketing/marketing-zhihu-strategist.md +175 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-auditor.md +170 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-creative-strategist.md +173 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-paid-social-strategist.md +180 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-ppc-strategist.md +180 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-programmatic-buyer.md +177 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-search-query-analyst.md +182 -0
- package/dist/vendor/marketplace/zh/paid-media/paid-media-tracking-specialist.md +199 -0
- package/dist/vendor/marketplace/zh/product/product-behavioral-nudge-engine.md +246 -0
- package/dist/vendor/marketplace/zh/product/product-feedback-synthesizer.md +175 -0
- package/dist/vendor/marketplace/zh/product/product-manager.md +474 -0
- package/dist/vendor/marketplace/zh/product/product-sprint-prioritizer.md +133 -0
- package/dist/vendor/marketplace/zh/product/product-trend-researcher.md +143 -0
- package/dist/vendor/marketplace/zh/project-management/project-management-experiment-tracker.md +206 -0
- package/dist/vendor/marketplace/zh/project-management/project-management-jira-workflow-steward.md +249 -0
- package/dist/vendor/marketplace/zh/project-management/project-management-project-shepherd.md +202 -0
- package/dist/vendor/marketplace/zh/project-management/project-management-studio-operations.md +208 -0
- package/dist/vendor/marketplace/zh/project-management/project-management-studio-producer.md +211 -0
- package/dist/vendor/marketplace/zh/project-management/project-manager-senior.md +135 -0
- package/dist/vendor/marketplace/zh/sales/sales-account-strategist.md +243 -0
- package/dist/vendor/marketplace/zh/sales/sales-coach.md +291 -0
- package/dist/vendor/marketplace/zh/sales/sales-deal-strategist.md +204 -0
- package/dist/vendor/marketplace/zh/sales/sales-discovery-coach.md +230 -0
- package/dist/vendor/marketplace/zh/sales/sales-engineer.md +200 -0
- package/dist/vendor/marketplace/zh/sales/sales-outbound-strategist.md +208 -0
- package/dist/vendor/marketplace/zh/sales/sales-pipeline-analyst.md +284 -0
- package/dist/vendor/marketplace/zh/sales/sales-proposal-strategist.md +233 -0
- package/dist/vendor/marketplace/zh/spatial-computing/macos-spatial-metal-engineer.md +337 -0
- package/dist/vendor/marketplace/zh/spatial-computing/terminal-integration-specialist.md +236 -0
- package/dist/vendor/marketplace/zh/spatial-computing/visionos-spatial-engineer.md +282 -0
- package/dist/vendor/marketplace/zh/spatial-computing/xr-cockpit-interaction-specialist.md +220 -0
- package/dist/vendor/marketplace/zh/spatial-computing/xr-immersive-developer.md +229 -0
- package/dist/vendor/marketplace/zh/spatial-computing/xr-interface-architect.md +253 -0
- package/dist/vendor/marketplace/zh/specialized/accounts-payable-agent.md +212 -0
- package/dist/vendor/marketplace/zh/specialized/agentic-identity-trust.md +388 -0
- package/dist/vendor/marketplace/zh/specialized/agents-orchestrator.md +366 -0
- package/dist/vendor/marketplace/zh/specialized/automation-governance-architect.md +215 -0
- package/dist/vendor/marketplace/zh/specialized/blockchain-security-auditor.md +484 -0
- package/dist/vendor/marketplace/zh/specialized/compliance-auditor.md +172 -0
- package/dist/vendor/marketplace/zh/specialized/corporate-training-designer.md +191 -0
- package/dist/vendor/marketplace/zh/specialized/data-consolidation-agent.md +327 -0
- package/dist/vendor/marketplace/zh/specialized/gaokao-college-advisor.md +333 -0
- package/dist/vendor/marketplace/zh/specialized/government-digital-presales-consultant.md +362 -0
- package/dist/vendor/marketplace/zh/specialized/healthcare-customer-service.md +388 -0
- package/dist/vendor/marketplace/zh/specialized/healthcare-marketing-compliance.md +394 -0
- package/dist/vendor/marketplace/zh/specialized/hospitality-guest-services.md +597 -0
- package/dist/vendor/marketplace/zh/specialized/hr-onboarding.md +450 -0
- package/dist/vendor/marketplace/zh/specialized/identity-graph-operator.md +270 -0
- package/dist/vendor/marketplace/zh/specialized/language-translator.md +275 -0
- package/dist/vendor/marketplace/zh/specialized/legal-billing-time-tracking.md +566 -0
- package/dist/vendor/marketplace/zh/specialized/legal-client-intake.md +487 -0
- package/dist/vendor/marketplace/zh/specialized/legal-document-review.md +452 -0
- package/dist/vendor/marketplace/zh/specialized/livestock-archive-auditor.md +135 -0
- package/dist/vendor/marketplace/zh/specialized/loan-officer-assistant.md +549 -0
- package/dist/vendor/marketplace/zh/specialized/lsp-index-engineer.md +334 -0
- package/dist/vendor/marketplace/zh/specialized/prompt-engineer.md +176 -0
- package/dist/vendor/marketplace/zh/specialized/real-estate-buyer-seller.md +594 -0
- package/dist/vendor/marketplace/zh/specialized/recruitment-specialist.md +508 -0
- package/dist/vendor/marketplace/zh/specialized/report-distribution-agent.md +354 -0
- package/dist/vendor/marketplace/zh/specialized/retail-customer-returns.md +564 -0
- package/dist/vendor/marketplace/zh/specialized/sales-data-extraction-agent.md +159 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-ai-policy-writer.md +217 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-chief-of-staff.md +278 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-civil-engineer.md +355 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-cultural-intelligence-strategist.md +168 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-developer-advocate.md +334 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-document-generator.md +346 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-french-consulting-market.md +191 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-korean-business-navigator.md +215 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-mcp-builder.md +351 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-meeting-assistant.md +236 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-model-qa.md +507 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-pricing-optimizer.md +254 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-risk-assessor.md +240 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-salesforce-architect.md +179 -0
- package/dist/vendor/marketplace/zh/specialized/specialized-workflow-architect.md +596 -0
- package/dist/vendor/marketplace/zh/specialized/study-abroad-advisor.md +281 -0
- package/dist/vendor/marketplace/zh/specialized/technical-translator-agent.md +167 -0
- package/dist/vendor/marketplace/zh/specialized/zk-steward.md +228 -0
- package/dist/vendor/marketplace/zh/supply-chain/supply-chain-inventory-forecaster.md +212 -0
- package/dist/vendor/marketplace/zh/supply-chain/supply-chain-route-optimizer.md +224 -0
- package/dist/vendor/marketplace/zh/supply-chain/supply-chain-strategist.md +581 -0
- package/dist/vendor/marketplace/zh/supply-chain/supply-chain-vendor-evaluator.md +232 -0
- package/dist/vendor/marketplace/zh/support/support-analytics-reporter.md +364 -0
- package/dist/vendor/marketplace/zh/support/support-executive-summary-generator.md +217 -0
- package/dist/vendor/marketplace/zh/support/support-finance-tracker.md +447 -0
- package/dist/vendor/marketplace/zh/support/support-infrastructure-maintainer.md +623 -0
- package/dist/vendor/marketplace/zh/support/support-legal-compliance-checker.md +587 -0
- package/dist/vendor/marketplace/zh/support/support-recruitment-specialist.md +508 -0
- package/dist/vendor/marketplace/zh/support/support-support-responder.md +584 -0
- package/dist/vendor/marketplace/zh/testing/testing-accessibility-auditor.md +329 -0
- package/dist/vendor/marketplace/zh/testing/testing-api-tester.md +305 -0
- package/dist/vendor/marketplace/zh/testing/testing-embedded-qa-engineer.md +258 -0
- package/dist/vendor/marketplace/zh/testing/testing-evidence-collector.md +153 -0
- package/dist/vendor/marketplace/zh/testing/testing-performance-benchmarker.md +196 -0
- package/dist/vendor/marketplace/zh/testing/testing-reality-checker.md +235 -0
- package/dist/vendor/marketplace/zh/testing/testing-test-results-analyzer.md +313 -0
- package/dist/vendor/marketplace/zh/testing/testing-tool-evaluator.md +402 -0
- package/dist/vendor/marketplace/zh/testing/testing-workflow-optimizer.md +458 -0
- package/package.json +7 -2
- package/web/dist/assets/AddWorkerDialog-TAWWMQti.js +75 -0
- package/web/dist/assets/AddWorkspaceDialog-DVqabcvo.js +1 -0
- package/web/dist/assets/FirstRunWizard-DOM6bcpn.js +1 -0
- package/web/dist/assets/WorkerModal-ALxWif7E.js +1 -0
- package/web/dist/assets/WorkspaceTaskDrawer-8IVJMUe-.js +1 -0
- package/web/dist/assets/chevron-right-39MYBReb.js +1 -0
- package/web/dist/assets/index-7NLKrr1z.js +81 -0
- package/web/dist/assets/index-DsdHICGY.css +1 -0
- package/web/dist/index.html +2 -2
- package/web/dist/sw.js +1 -1
- package/web/dist/assets/index-CSEt-Qiy.js +0 -66
- package/web/dist/assets/index-RsXXnrVz.css +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Database } from 'better-sqlite3';
|
|
2
|
-
export type DispatchStatus = 'queued' | 'submitted' | 'reported';
|
|
2
|
+
export type DispatchStatus = 'queued' | 'submitted' | 'reported' | 'cancelled';
|
|
3
3
|
export interface DispatchRecord {
|
|
4
4
|
artifacts: string[];
|
|
5
5
|
createdAt: number;
|
|
@@ -28,6 +28,11 @@ interface ReportDispatchInput {
|
|
|
28
28
|
toAgentId: string;
|
|
29
29
|
workspaceId: string;
|
|
30
30
|
}
|
|
31
|
+
interface CancelDispatchInput {
|
|
32
|
+
dispatchId: string;
|
|
33
|
+
reason: string;
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
}
|
|
31
36
|
export interface ListDispatchesOptions {
|
|
32
37
|
limit?: number;
|
|
33
38
|
offset?: number;
|
|
@@ -39,12 +44,28 @@ export declare const createDispatchLedgerStore: (db: Database) => {
|
|
|
39
44
|
deleteWorkerDispatches: (workspaceId: string, workerId: string) => void;
|
|
40
45
|
deleteWorkspaceDispatches: (workspaceId: string) => void;
|
|
41
46
|
findOpenDispatch: (workspaceId: string, toAgentId: string, dispatchId?: string) => DispatchRecord | undefined;
|
|
47
|
+
findOpenDispatchById: (workspaceId: string, dispatchId: string) => DispatchRecord | undefined;
|
|
42
48
|
listOpenDispatchKinds: () => Array<{
|
|
43
49
|
type: "send";
|
|
44
50
|
worker_id: string;
|
|
45
51
|
workspace_id: string;
|
|
46
52
|
}>;
|
|
47
53
|
listWorkspaceDispatches: (workspaceId: string, options?: ListDispatchesOptions) => DispatchRecord[];
|
|
54
|
+
markCancelled: (input: CancelDispatchInput) => {
|
|
55
|
+
reportedAt: number;
|
|
56
|
+
reportText: string;
|
|
57
|
+
status: "cancelled";
|
|
58
|
+
artifacts: string[];
|
|
59
|
+
createdAt: number;
|
|
60
|
+
deliveredAt: number | null;
|
|
61
|
+
fromAgentId: string | null;
|
|
62
|
+
id: string;
|
|
63
|
+
sequence: number | null;
|
|
64
|
+
submittedAt: number | null;
|
|
65
|
+
text: string;
|
|
66
|
+
toAgentId: string;
|
|
67
|
+
workspaceId: string;
|
|
68
|
+
} | undefined;
|
|
48
69
|
markReportedByWorker: (input: ReportDispatchInput) => {
|
|
49
70
|
artifacts: string[];
|
|
50
71
|
reportedAt: number;
|
|
@@ -77,7 +77,7 @@ export const createDispatchLedgerStore = (db) => {
|
|
|
77
77
|
WHERE id = ?
|
|
78
78
|
AND workspace_id = ?
|
|
79
79
|
AND to_agent_id = ?
|
|
80
|
-
AND status
|
|
80
|
+
AND status IN ('queued', 'submitted')
|
|
81
81
|
LIMIT 1`)
|
|
82
82
|
.get(dispatchId, workspaceId, toAgentId);
|
|
83
83
|
return row ? toRecord(row) : undefined;
|
|
@@ -87,12 +87,23 @@ export const createDispatchLedgerStore = (db) => {
|
|
|
87
87
|
FROM dispatches
|
|
88
88
|
WHERE workspace_id = ?
|
|
89
89
|
AND to_agent_id = ?
|
|
90
|
-
AND status
|
|
90
|
+
AND status IN ('queued', 'submitted')
|
|
91
91
|
ORDER BY sequence ASC
|
|
92
92
|
LIMIT 1`)
|
|
93
93
|
.get(workspaceId, toAgentId);
|
|
94
94
|
return row ? toRecord(row) : undefined;
|
|
95
95
|
};
|
|
96
|
+
const findOpenDispatchById = (workspaceId, dispatchId) => {
|
|
97
|
+
const row = db
|
|
98
|
+
.prepare(`SELECT *
|
|
99
|
+
FROM dispatches
|
|
100
|
+
WHERE id = ?
|
|
101
|
+
AND workspace_id = ?
|
|
102
|
+
AND status IN ('queued', 'submitted')
|
|
103
|
+
LIMIT 1`)
|
|
104
|
+
.get(dispatchId, workspaceId);
|
|
105
|
+
return row ? toRecord(row) : undefined;
|
|
106
|
+
};
|
|
96
107
|
const markReportedByWorker = (input) => {
|
|
97
108
|
const dispatch = findOpenDispatch(input.workspaceId, input.toAgentId, input.dispatchId);
|
|
98
109
|
if (!dispatch) {
|
|
@@ -113,6 +124,24 @@ export const createDispatchLedgerStore = (db) => {
|
|
|
113
124
|
status: 'reported',
|
|
114
125
|
};
|
|
115
126
|
};
|
|
127
|
+
const markCancelled = (input) => {
|
|
128
|
+
const dispatch = findOpenDispatchById(input.workspaceId, input.dispatchId);
|
|
129
|
+
if (!dispatch) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const cancelledAt = Date.now();
|
|
133
|
+
db.prepare(`UPDATE dispatches
|
|
134
|
+
SET status = ?,
|
|
135
|
+
reported_at = ?,
|
|
136
|
+
report_text = ?
|
|
137
|
+
WHERE id = ?`).run('cancelled', cancelledAt, input.reason, dispatch.id);
|
|
138
|
+
return {
|
|
139
|
+
...dispatch,
|
|
140
|
+
reportedAt: cancelledAt,
|
|
141
|
+
reportText: input.reason,
|
|
142
|
+
status: 'cancelled',
|
|
143
|
+
};
|
|
144
|
+
};
|
|
116
145
|
const listWorkspaceDispatches = (workspaceId, options = {}) => {
|
|
117
146
|
const offset = options.offset ?? 0;
|
|
118
147
|
const limit = options.limit ?? 100;
|
|
@@ -138,7 +167,7 @@ export const createDispatchLedgerStore = (db) => {
|
|
|
138
167
|
return db
|
|
139
168
|
.prepare(`SELECT workspace_id, to_agent_id AS worker_id, 'send' AS type
|
|
140
169
|
FROM dispatches
|
|
141
|
-
WHERE status
|
|
170
|
+
WHERE status IN ('queued', 'submitted')
|
|
142
171
|
ORDER BY sequence ASC`)
|
|
143
172
|
.all();
|
|
144
173
|
};
|
|
@@ -154,8 +183,10 @@ export const createDispatchLedgerStore = (db) => {
|
|
|
154
183
|
deleteWorkerDispatches,
|
|
155
184
|
deleteWorkspaceDispatches,
|
|
156
185
|
findOpenDispatch,
|
|
186
|
+
findOpenDispatchById,
|
|
157
187
|
listOpenDispatchKinds,
|
|
158
188
|
listWorkspaceDispatches,
|
|
189
|
+
markCancelled,
|
|
159
190
|
markReportedByWorker,
|
|
160
191
|
markSubmitted,
|
|
161
192
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* abstract identity restatement.
|
|
15
15
|
*/
|
|
16
16
|
export const ORCHESTRATOR_REMINDER_TAIL = '<hive-system-reminder>\n' +
|
|
17
|
-
'You are the Hive Orchestrator. Reply by either: (a) `team send "<worker-name>" "<task>"` to dispatch follow-up work to a Hive worker, or (
|
|
17
|
+
'You are the Hive Orchestrator. Reply by either: (a) `team send "<worker-name>" "<task>"` to dispatch follow-up work to a Hive worker, (b) `team cancel --dispatch <id> "<reason>"` to cancel an obsolete dispatch, or (c) plain text to the user. Never call your CLI\'s built-in subagent tools (Task / Explore / etc.) — they bypass Hive and will not appear in the UI.\n' +
|
|
18
18
|
'</hive-system-reminder>';
|
|
19
19
|
/**
|
|
20
20
|
* Tail reminder appended to dispatches sent TO a worker. Reinforces the
|
|
@@ -31,6 +31,7 @@ const ORCHESTRATOR_RULES = [
|
|
|
31
31
|
'普通、低风险、几分钟内能直接完成的小任务可以自己做;不要为了形式感派 worker。需要并行、长时间执行、独立 review/test、专门角色,或 user 明确要求 worker/成员处理时,再用 `team send`。',
|
|
32
32
|
'如果只有一个可用 worker,直接用 `team send <worker-name> "<task>"` 派给它;不要把选择题丢回给 user。',
|
|
33
33
|
'当 user 要你“让 worker ...”时,必须用 `team send <worker-name> "<task>"` 派给 Hive worker。',
|
|
34
|
+
'方向变更或 user 明确取消某个未完成派单时,使用 `team cancel --dispatch <id> "<reason>"` 显式关闭旧 dispatch;不要只用自然语言说“取消”。',
|
|
34
35
|
'不要使用你所在 CLI 的内置 subagent / 子代理工具(如 Task / Explore 等)来代替 Hive worker;它们不会出现在 Hive UI,也不会更新 Hive 调度状态。',
|
|
35
36
|
'`team list` 返回的 `last_pty_line` 是该 worker PTY 终端的最后一行原始输出(含任意 stdout / help / 控制序列噪声),**不是** worker 的正式汇报。正式汇报只来自 stdin 注入的 `[Hive 系统消息:来自 @<name> 的汇报]` 或 `[Hive 系统消息:来自 @<name> 的状态更新]`——只把这两种来源当作 reply。',
|
|
36
37
|
];
|
|
@@ -74,6 +75,7 @@ export const buildProtocolDoc = () => [
|
|
|
74
75
|
'',
|
|
75
76
|
'- `team list` — show workspace members and their status',
|
|
76
77
|
'- `team send "<worker-name>" "<task>"` — dispatch to a worker by name (never id)',
|
|
78
|
+
'- `team cancel --dispatch <id> "<reason>"` — cancel an obsolete open dispatch',
|
|
77
79
|
'',
|
|
78
80
|
'## `team` CLI — worker',
|
|
79
81
|
'',
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type MarketplaceLanguage = 'en' | 'zh';
|
|
2
|
+
export interface MarketplaceAgentEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
category: string;
|
|
5
|
+
name: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
nameOverflows?: boolean;
|
|
8
|
+
description: string;
|
|
9
|
+
emoji: string | null;
|
|
10
|
+
color: string | null;
|
|
11
|
+
vibe: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface MarketplaceManifest {
|
|
14
|
+
source: {
|
|
15
|
+
repo: string;
|
|
16
|
+
commit: string;
|
|
17
|
+
fetched_at: string;
|
|
18
|
+
};
|
|
19
|
+
language: MarketplaceLanguage;
|
|
20
|
+
categories: string[];
|
|
21
|
+
agents: MarketplaceAgentEntry[];
|
|
22
|
+
}
|
|
23
|
+
export interface MarketplaceAgentDetail {
|
|
24
|
+
path: string;
|
|
25
|
+
frontmatter: Record<string, unknown>;
|
|
26
|
+
body: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class MarketplaceNotFoundError extends Error {
|
|
29
|
+
constructor(message: string);
|
|
30
|
+
}
|
|
31
|
+
export declare const isMarketplaceLanguage: (value: unknown) => value is MarketplaceLanguage;
|
|
32
|
+
/**
|
|
33
|
+
* Where on disk the bundled marketplace lives. Tests inject a fixture via
|
|
34
|
+
* `HIVE_MARKETPLACE_VENDOR_ROOT` (mirrors fs-sandbox's HIVE_FS_BROWSE_ROOT).
|
|
35
|
+
*/
|
|
36
|
+
export declare const getMarketplaceVendorRoot: () => string;
|
|
37
|
+
export declare const loadManifest: (language: MarketplaceLanguage) => MarketplaceManifest;
|
|
38
|
+
export declare const readAgent: (language: MarketplaceLanguage, relativePath: string) => MarketplaceAgentDetail;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Marketplace store — read-only access to the bundled `vendor/marketplace/`
|
|
2
|
+
// snapshot of upstream agent prompt repos (one per UI language).
|
|
3
|
+
//
|
|
4
|
+
// **Vendor path invariant**: `new URL('../../vendor/marketplace', import.meta.url)`
|
|
5
|
+
// resolves the same in dev and dist because `tsconfig.json` has `rootDir: "."`.
|
|
6
|
+
// - dev: this file is `src/server/marketplace-store.ts` → repo-root `vendor/`
|
|
7
|
+
// - dist: this file is `dist/src/server/marketplace-store.js` → `dist/vendor/`
|
|
8
|
+
//
|
|
9
|
+
// The build hook (`scripts/prepare-build-artifacts.mjs`) copies the source-of-
|
|
10
|
+
// truth `vendor/marketplace/` into `dist/vendor/marketplace/` at pack time. If
|
|
11
|
+
// either the `rootDir` setting or the build hook changes, that invariant must
|
|
12
|
+
// be re-verified — there is no fallback path.
|
|
13
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
14
|
+
import { resolve } from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import matter from 'gray-matter';
|
|
17
|
+
import { isPathWithinRoot } from './fs-sandbox.js';
|
|
18
|
+
export class MarketplaceNotFoundError extends Error {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = 'MarketplaceNotFoundError';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const SUPPORTED_LANGUAGES = new Set(['en', 'zh']);
|
|
25
|
+
export const isMarketplaceLanguage = (value) => typeof value === 'string' && SUPPORTED_LANGUAGES.has(value);
|
|
26
|
+
const defaultVendorRoot = () => fileURLToPath(new URL('../../vendor/marketplace', import.meta.url));
|
|
27
|
+
/**
|
|
28
|
+
* Where on disk the bundled marketplace lives. Tests inject a fixture via
|
|
29
|
+
* `HIVE_MARKETPLACE_VENDOR_ROOT` (mirrors fs-sandbox's HIVE_FS_BROWSE_ROOT).
|
|
30
|
+
*/
|
|
31
|
+
export const getMarketplaceVendorRoot = () => {
|
|
32
|
+
const override = process.env.HIVE_MARKETPLACE_VENDOR_ROOT;
|
|
33
|
+
return override && override.length > 0 ? resolve(override) : defaultVendorRoot();
|
|
34
|
+
};
|
|
35
|
+
const languageRoot = (language) => resolve(getMarketplaceVendorRoot(), language);
|
|
36
|
+
export const loadManifest = (language) => {
|
|
37
|
+
const manifestPath = resolve(languageRoot(language), 'manifest.json');
|
|
38
|
+
if (!existsSync(manifestPath)) {
|
|
39
|
+
throw new MarketplaceNotFoundError(`Marketplace manifest missing for language: ${language}`);
|
|
40
|
+
}
|
|
41
|
+
const raw = readFileSync(manifestPath, 'utf8');
|
|
42
|
+
return JSON.parse(raw);
|
|
43
|
+
};
|
|
44
|
+
export const readAgent = (language, relativePath) => {
|
|
45
|
+
if (!relativePath.endsWith('.md')) {
|
|
46
|
+
throw new MarketplaceNotFoundError(`Marketplace agent path must end with .md: ${relativePath}`);
|
|
47
|
+
}
|
|
48
|
+
const root = languageRoot(language);
|
|
49
|
+
const candidate = resolve(root, relativePath);
|
|
50
|
+
if (!isPathWithinRoot(root, candidate)) {
|
|
51
|
+
throw new MarketplaceNotFoundError(`Marketplace agent path escapes language root: ${relativePath}`);
|
|
52
|
+
}
|
|
53
|
+
if (!existsSync(candidate)) {
|
|
54
|
+
throw new MarketplaceNotFoundError(`Marketplace agent not found: ${language}/${relativePath}`);
|
|
55
|
+
}
|
|
56
|
+
// Guard against upstream pushing a directory whose name ends in `.md` —
|
|
57
|
+
// the suffix check would pass, existsSync would pass, but readFileSync
|
|
58
|
+
// would throw EISDIR. Surface as a 404 instead of a 500.
|
|
59
|
+
if (!statSync(candidate).isFile()) {
|
|
60
|
+
throw new MarketplaceNotFoundError(`Marketplace agent not a file: ${language}/${relativePath}`);
|
|
61
|
+
}
|
|
62
|
+
const raw = readFileSync(candidate, 'utf8');
|
|
63
|
+
const parsed = matter(raw);
|
|
64
|
+
return {
|
|
65
|
+
path: relativePath,
|
|
66
|
+
frontmatter: parsed.data,
|
|
67
|
+
body: parsed.content,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -22,6 +22,13 @@ export interface ReportTaskBody {
|
|
|
22
22
|
status?: string;
|
|
23
23
|
artifacts?: unknown[];
|
|
24
24
|
}
|
|
25
|
+
export interface CancelTaskBody {
|
|
26
|
+
dispatch_id?: string;
|
|
27
|
+
project_id: string;
|
|
28
|
+
from_agent_id: string;
|
|
29
|
+
token?: string;
|
|
30
|
+
reason?: string;
|
|
31
|
+
}
|
|
25
32
|
export interface CreateWorkspaceBody {
|
|
26
33
|
path: string;
|
|
27
34
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { serializeDispatchRecord } from './dispatch-ledger-serializer.js';
|
|
2
2
|
import { getRequiredParam, route, sendJson } from './route-helpers.js';
|
|
3
3
|
import { requireUiTokenFromRequest } from './ui-auth-helpers.js';
|
|
4
|
-
const DISPATCH_STATUSES = new Set(['queued', 'submitted', 'reported']);
|
|
4
|
+
const DISPATCH_STATUSES = new Set(['queued', 'submitted', 'reported', 'cancelled']);
|
|
5
5
|
const MAX_DISPATCH_LIMIT = 100;
|
|
6
6
|
const MAX_DISPATCH_OFFSET = 100_000;
|
|
7
7
|
const readBoundedInt = (response, value, name, fallback, max) => {
|
|
@@ -33,7 +33,9 @@ export const dispatchRoutes = [
|
|
|
33
33
|
}
|
|
34
34
|
const state = url.searchParams.get('state');
|
|
35
35
|
if (state !== null && !isDispatchStatus(state)) {
|
|
36
|
-
sendJson(response, 400, {
|
|
36
|
+
sendJson(response, 400, {
|
|
37
|
+
error: 'state must be queued, submitted, reported, or cancelled',
|
|
38
|
+
});
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
41
|
const limit = readBoundedInt(response, url.searchParams.get('limit'), 'limit', MAX_DISPATCH_LIMIT, MAX_DISPATCH_LIMIT);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isMarketplaceLanguage, loadManifest, MarketplaceNotFoundError, readAgent, } from './marketplace-store.js';
|
|
2
|
+
import { route, sendJson } from './route-helpers.js';
|
|
3
|
+
import { requireUiTokenFromRequest } from './ui-auth-helpers.js';
|
|
4
|
+
const readLanguageParam = (request) => {
|
|
5
|
+
const url = new URL(request.url ?? '/', 'http://127.0.0.1');
|
|
6
|
+
return url.searchParams.get('lang');
|
|
7
|
+
};
|
|
8
|
+
const readPathParam = (request) => {
|
|
9
|
+
const url = new URL(request.url ?? '/', 'http://127.0.0.1');
|
|
10
|
+
return url.searchParams.get('path') ?? '';
|
|
11
|
+
};
|
|
12
|
+
export const marketplaceRoutes = [
|
|
13
|
+
route('GET', '/api/marketplace/manifest', ({ request, response, store }) => {
|
|
14
|
+
requireUiTokenFromRequest(request, store.validateUiToken);
|
|
15
|
+
const lang = readLanguageParam(request);
|
|
16
|
+
if (!isMarketplaceLanguage(lang)) {
|
|
17
|
+
sendJson(response, 400, { error: 'Invalid or missing lang parameter (expected en|zh)' });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
sendJson(response, 200, loadManifest(lang));
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (error instanceof MarketplaceNotFoundError) {
|
|
25
|
+
sendJson(response, 404, { error: error.message });
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
route('GET', '/api/marketplace/agent', ({ request, response, store }) => {
|
|
32
|
+
requireUiTokenFromRequest(request, store.validateUiToken);
|
|
33
|
+
const lang = readLanguageParam(request);
|
|
34
|
+
if (!isMarketplaceLanguage(lang)) {
|
|
35
|
+
sendJson(response, 400, { error: 'Invalid or missing lang parameter (expected en|zh)' });
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const relativePath = readPathParam(request);
|
|
39
|
+
if (!relativePath) {
|
|
40
|
+
sendJson(response, 400, { error: 'Missing path parameter' });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
sendJson(response, 200, readAgent(lang, relativePath));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error instanceof MarketplaceNotFoundError) {
|
|
48
|
+
sendJson(response, 404, { error: error.message });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
];
|
|
@@ -25,6 +25,7 @@ export const runtimeRoutes = [
|
|
|
25
25
|
agent_name: summary?.agent_name ?? 'Shell',
|
|
26
26
|
run_id: run.runId,
|
|
27
27
|
status: run.status,
|
|
28
|
+
terminal_input_profile: summary?.terminal_input_profile ?? 'default',
|
|
28
29
|
});
|
|
29
30
|
}),
|
|
30
31
|
route('DELETE', '/api/workspaces/:workspaceId/shell/:runId', ({ params, request, response, store }) => {
|
|
@@ -29,6 +29,28 @@ export const teamRoutes = [
|
|
|
29
29
|
});
|
|
30
30
|
sendJson(response, 202, { dispatch_id: dispatch.id, ok: true });
|
|
31
31
|
}),
|
|
32
|
+
route('POST', '/api/team/cancel', async ({ request, response, store }) => {
|
|
33
|
+
const body = await readJsonBody(request);
|
|
34
|
+
const projectId = requireNonEmptyString(body.project_id, 'project_id');
|
|
35
|
+
const fromAgentId = requireNonEmptyString(body.from_agent_id, 'from_agent_id');
|
|
36
|
+
const dispatchId = requireNonEmptyString(body.dispatch_id, 'dispatch_id');
|
|
37
|
+
const reason = requireNonEmptyString(body.reason, 'reason');
|
|
38
|
+
const agent = authenticateCliAgent({
|
|
39
|
+
fromAgentId,
|
|
40
|
+
getAgent: store.getAgent,
|
|
41
|
+
token: body.token,
|
|
42
|
+
validateToken: store.validateAgentToken,
|
|
43
|
+
workspaceId: projectId,
|
|
44
|
+
});
|
|
45
|
+
requireCommandForRole(agent, 'cancel');
|
|
46
|
+
const result = store.cancelTask(projectId, dispatchId, { fromAgentId, reason });
|
|
47
|
+
sendJson(response, 202, {
|
|
48
|
+
dispatch_id: result.dispatch?.id ?? null,
|
|
49
|
+
forward_error: result.forwardError,
|
|
50
|
+
forwarded: result.forwarded,
|
|
51
|
+
ok: true,
|
|
52
|
+
});
|
|
53
|
+
}),
|
|
32
54
|
route('POST', '/api/team/report', async ({ request, response, store }) => {
|
|
33
55
|
const body = await readJsonBody(request);
|
|
34
56
|
const projectId = requireNonEmptyString(body.project_id, 'project_id');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { matchPath } from './route-helpers.js';
|
|
2
2
|
import { dispatchRoutes } from './routes-dispatches.js';
|
|
3
3
|
import { fsRoutes } from './routes-fs.js';
|
|
4
|
+
import { marketplaceRoutes } from './routes-marketplace.js';
|
|
4
5
|
import { openWorkspaceRoutes } from './routes-open-workspace.js';
|
|
5
6
|
import { runtimeRoutes } from './routes-runtime.js';
|
|
6
7
|
import { settingsRoutes } from './routes-settings.js';
|
|
@@ -20,6 +21,7 @@ const routes = [
|
|
|
20
21
|
...runtimeRoutes,
|
|
21
22
|
...teamRoutes,
|
|
22
23
|
...fsRoutes,
|
|
24
|
+
...marketplaceRoutes,
|
|
23
25
|
];
|
|
24
26
|
export const matchRoute = (method, pathname) => {
|
|
25
27
|
for (const routeDefinition of routes) {
|
|
@@ -52,6 +52,7 @@ export declare const createRuntimeStoreLifecycle: ({ agentManager, services, }:
|
|
|
52
52
|
agent_name: string;
|
|
53
53
|
run_id: string;
|
|
54
54
|
status: import("./agent-manager.js").RunStatus;
|
|
55
|
+
terminal_input_profile: import("./terminal-input-profile.js").TerminalInputProfile;
|
|
55
56
|
}[];
|
|
56
57
|
startAgent: (workspaceId: string, agentId: string, input: {
|
|
57
58
|
hivePort: string;
|
|
@@ -74,7 +75,7 @@ export declare const createRuntimeStoreLifecycle: ({ agentManager, services, }:
|
|
|
74
75
|
})[]>;
|
|
75
76
|
registerTasksListener: (listener: (workspaceId: string, content: string) => void) => () => void;
|
|
76
77
|
startWorkspaceWatch: (workspaceId: string) => Promise<void>;
|
|
77
|
-
writeRunInput: (runId: string,
|
|
78
|
+
writeRunInput: (runId: string, input: Buffer | string) => void;
|
|
78
79
|
pauseTerminalRun: (runId: string) => void;
|
|
79
80
|
resizeTerminalRun: (runId: string, cols: number, rows: number) => void;
|
|
80
81
|
resumeTerminalRun: (runId: string) => void;
|
|
@@ -10,6 +10,7 @@ import { createSettingsStore } from './settings-store.js';
|
|
|
10
10
|
import { createTasksFileService } from './tasks-file.js';
|
|
11
11
|
import { createTasksFileWatcher } from './tasks-file-watcher.js';
|
|
12
12
|
import { createTeamOperations } from './team-operations.js';
|
|
13
|
+
import { resolveTerminalInputProfile } from './terminal-input-profile.js';
|
|
13
14
|
import { createUiAuth } from './ui-auth.js';
|
|
14
15
|
import { createWorkerOutputTracker } from './worker-output-tracker.js';
|
|
15
16
|
import { createWorkspaceShellRuntime } from './workspace-shell-runtime.js';
|
|
@@ -63,7 +64,9 @@ export const createRuntimeStoreServices = (options = {}) => {
|
|
|
63
64
|
deleteDispatch: dispatchLedgerStore.deleteDispatch,
|
|
64
65
|
deleteMessage: messageLogStore.deleteMessage,
|
|
65
66
|
findOpenDispatch: dispatchLedgerStore.findOpenDispatch,
|
|
67
|
+
findOpenDispatchById: dispatchLedgerStore.findOpenDispatchById,
|
|
66
68
|
insertMessage: messageLogStore.insertMessage,
|
|
69
|
+
markDispatchCancelled: dispatchLedgerStore.markCancelled,
|
|
67
70
|
markDispatchReportedByWorker: dispatchLedgerStore.markReportedByWorker,
|
|
68
71
|
markDispatchSubmitted: dispatchLedgerStore.markSubmitted,
|
|
69
72
|
workspaceStore,
|
|
@@ -167,8 +170,15 @@ export const createRuntimeStoreLifecycle = ({ agentManager, services, }) => {
|
|
|
167
170
|
const run = services.agentRuntime.getActiveRunByAgentId(workspaceId, agent.id);
|
|
168
171
|
if (!run)
|
|
169
172
|
return [];
|
|
173
|
+
const launchConfig = services.agentRuntime.peekAgentLaunchConfig(workspaceId, agent.id);
|
|
170
174
|
return [
|
|
171
|
-
{
|
|
175
|
+
{
|
|
176
|
+
agent_id: agent.id,
|
|
177
|
+
agent_name: agent.name,
|
|
178
|
+
run_id: run.runId,
|
|
179
|
+
status: run.status,
|
|
180
|
+
terminal_input_profile: resolveTerminalInputProfile(launchConfig),
|
|
181
|
+
},
|
|
172
182
|
];
|
|
173
183
|
}),
|
|
174
184
|
...services.shellRuntime.listTerminalRuns(workspaceId),
|
|
@@ -186,14 +196,14 @@ export const createRuntimeStoreLifecycle = ({ agentManager, services, }) => {
|
|
|
186
196
|
const workspace = services.workspaceStore.getWorkspaceSnapshot(workspaceId);
|
|
187
197
|
await services.tasksFileWatcher.start(workspaceId, workspace.summary.path);
|
|
188
198
|
},
|
|
189
|
-
writeRunInput: (runId,
|
|
199
|
+
writeRunInput: (runId, input) => {
|
|
190
200
|
if (!agentManager)
|
|
191
201
|
throw new Error('Agent manager is required for PTY stdin writes');
|
|
192
202
|
if (services.shellRuntime.hasRun(runId)) {
|
|
193
|
-
services.shellRuntime.writeInput(runId,
|
|
203
|
+
services.shellRuntime.writeInput(runId, input);
|
|
194
204
|
return;
|
|
195
205
|
}
|
|
196
|
-
agentManager.writeInput(runId,
|
|
206
|
+
agentManager.writeInput(runId, input);
|
|
197
207
|
},
|
|
198
208
|
pauseTerminalRun: (runId) => {
|
|
199
209
|
if (services.shellRuntime.hasRun(runId))
|
|
@@ -6,7 +6,8 @@ import type { DispatchRecord, ListDispatchesOptions } from './dispatch-ledger-st
|
|
|
6
6
|
import type { RecoveryMessage } from './message-log-store.js';
|
|
7
7
|
import type { PtyOutputBus } from './pty-output-bus.js';
|
|
8
8
|
import type { SettingsStore } from './settings-store.js';
|
|
9
|
-
import type { DispatchTaskInput, ReportTaskInput, ReportTaskResult, StatusTaskInput } from './team-operations.js';
|
|
9
|
+
import type { CancelTaskInput, DispatchTaskInput, ReportTaskInput, ReportTaskResult, StatusTaskInput } from './team-operations.js';
|
|
10
|
+
import type { TerminalRunSummary } from './terminal-input-profile.js';
|
|
10
11
|
import type { WorkerInput, WorkspaceRecord } from './workspace-store.js';
|
|
11
12
|
interface RuntimeStore {
|
|
12
13
|
close: () => Promise<void>;
|
|
@@ -21,6 +22,7 @@ interface RuntimeStore {
|
|
|
21
22
|
dispatchTaskByWorkerName: (workspaceId: string, workerName: string, text: string, input?: DispatchTaskInput) => Promise<DispatchRecord>;
|
|
22
23
|
reportTask: (workspaceId: string, workerId: string, input?: ReportTaskInput) => ReportTaskResult;
|
|
23
24
|
statusTask: (workspaceId: string, workerId: string, input?: StatusTaskInput) => ReportTaskResult;
|
|
25
|
+
cancelTask: (workspaceId: string, dispatchId: string, input: CancelTaskInput) => ReportTaskResult;
|
|
24
26
|
listDispatches: (workspaceId: string, options?: ListDispatchesOptions) => DispatchRecord[];
|
|
25
27
|
listWorkers: (workspaceId: string) => TeamListItem[];
|
|
26
28
|
getLastPtyLineForAgent: (workspaceId: string, agentId: string) => string | null;
|
|
@@ -28,12 +30,7 @@ interface RuntimeStore {
|
|
|
28
30
|
getWorker: (workspaceId: string, workerId: string) => AgentSummary;
|
|
29
31
|
getAgent: (workspaceId: string, agentId: string) => AgentSummary;
|
|
30
32
|
getPtyOutputBus: () => PtyOutputBus;
|
|
31
|
-
listTerminalRuns: (workspaceId: string) =>
|
|
32
|
-
agent_id: string;
|
|
33
|
-
agent_name: string;
|
|
34
|
-
run_id: string;
|
|
35
|
-
status: string;
|
|
36
|
-
}>;
|
|
33
|
+
listTerminalRuns: (workspaceId: string) => TerminalRunSummary[];
|
|
37
34
|
closeWorkspaceShell: (workspaceId: string, runId: string) => boolean;
|
|
38
35
|
startWorkspaceShell: (workspaceId: string) => Promise<LiveAgentRun>;
|
|
39
36
|
configureAgentLaunch: (workspaceId: string, agentId: string, input: AgentLaunchConfigInput) => void;
|
|
@@ -57,7 +54,7 @@ interface RuntimeStore {
|
|
|
57
54
|
resizeAgentRun: (runId: string, cols: number, rows: number) => void;
|
|
58
55
|
resumeTerminalRun: (runId: string) => void;
|
|
59
56
|
settings: SettingsStore;
|
|
60
|
-
writeRunInput: (runId: string,
|
|
57
|
+
writeRunInput: (runId: string, input: Buffer | string) => void;
|
|
61
58
|
getUiToken: () => string;
|
|
62
59
|
stopAgentRun: (runId: string) => void;
|
|
63
60
|
validateAgentToken: (agentId: string, token: string | undefined) => boolean;
|
|
@@ -48,6 +48,7 @@ export const createRuntimeStore = (options = {}) => {
|
|
|
48
48
|
});
|
|
49
49
|
},
|
|
50
50
|
recordUserInput: services.teamOps.recordUserInput,
|
|
51
|
+
cancelTask: services.teamOps.cancelTask,
|
|
51
52
|
dispatchTask: services.teamOps.dispatchTask,
|
|
52
53
|
dispatchTaskByWorkerName: services.teamOps.dispatchTaskByWorkerName,
|
|
53
54
|
reportTask: services.teamOps.reportTask,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { RuntimeStore } from './runtime-store.js';
|
|
3
|
+
import type { TasksFileService } from './tasks-file.js';
|
|
3
4
|
export interface TasksWebSocketServer {
|
|
4
5
|
close: () => void;
|
|
5
6
|
publish: (workspaceId: string, content: string) => void;
|
|
6
7
|
}
|
|
7
|
-
export declare const createTasksWebSocketServer: (server: Server, store: RuntimeStore) => TasksWebSocketServer;
|
|
8
|
+
export declare const createTasksWebSocketServer: (server: Server, store: RuntimeStore, tasksFileService: Pick<TasksFileService, "readTasks">) => TasksWebSocketServer;
|
|
@@ -10,7 +10,7 @@ const rejectUpgrade = (socket, status) => {
|
|
|
10
10
|
socket.write(`HTTP/1.1 ${status}\r\n\r\n`);
|
|
11
11
|
socket.destroy();
|
|
12
12
|
};
|
|
13
|
-
export const createTasksWebSocketServer = (server, store) => {
|
|
13
|
+
export const createTasksWebSocketServer = (server, store, tasksFileService) => {
|
|
14
14
|
const wss = new WebSocketServer({ noServer: true });
|
|
15
15
|
const socketsByWorkspaceId = new Map();
|
|
16
16
|
const validateUpgradeSession = (request) => {
|
|
@@ -33,8 +33,9 @@ export const createTasksWebSocketServer = (server, store) => {
|
|
|
33
33
|
rejectUpgrade(socket, '401 Unauthorized');
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
+
let workspacePath = '';
|
|
36
37
|
try {
|
|
37
|
-
store.getWorkspaceSnapshot(workspaceId);
|
|
38
|
+
workspacePath = store.getWorkspaceSnapshot(workspaceId).summary.path;
|
|
38
39
|
}
|
|
39
40
|
catch {
|
|
40
41
|
rejectUpgrade(socket, '404 Not Found');
|
|
@@ -50,6 +51,21 @@ export const createTasksWebSocketServer = (server, store) => {
|
|
|
50
51
|
socketsByWorkspaceId.delete(workspaceId);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
54
|
+
setImmediate(() => {
|
|
55
|
+
if (ws.readyState !== ws.OPEN)
|
|
56
|
+
return;
|
|
57
|
+
try {
|
|
58
|
+
ws.send(JSON.stringify({
|
|
59
|
+
type: 'tasks-snapshot',
|
|
60
|
+
content: tasksFileService.readTasks(workspacePath),
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
if (ws.readyState === ws.OPEN) {
|
|
65
|
+
ws.send(JSON.stringify({ type: 'tasks-snapshot', content: '' }));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
53
69
|
});
|
|
54
70
|
});
|
|
55
71
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentSummary } from '../shared/types.js';
|
|
2
|
-
export type TeamCommand = 'send' | 'list' | 'report' | 'status' | 'help';
|
|
2
|
+
export type TeamCommand = 'send' | 'list' | 'report' | 'status' | 'cancel' | 'help';
|
|
3
3
|
export declare const commandAllowedForRole: (role: AgentSummary["role"], command: TeamCommand) => boolean;
|
|
4
4
|
interface AuthenticateInput {
|
|
5
5
|
fromAgentId: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ForbiddenError, UnauthorizedError } from './http-errors.js';
|
|
2
|
-
const ORCHESTRATOR_COMMANDS = new Set(['send', 'list', 'help']);
|
|
2
|
+
const ORCHESTRATOR_COMMANDS = new Set(['send', 'list', 'cancel', 'help']);
|
|
3
3
|
const WORKER_COMMANDS = new Set(['report', 'status', 'help']);
|
|
4
4
|
const WORKER_ROLES = new Set(['coder', 'reviewer', 'tester', 'custom']);
|
|
5
5
|
export const commandAllowedForRole = (role, command) => {
|
|
@@ -13,7 +13,13 @@ export interface TeamOperationsInput {
|
|
|
13
13
|
deleteDispatch: (dispatchId: string) => void;
|
|
14
14
|
deleteMessage: (handle: MessageLogHandle) => void;
|
|
15
15
|
findOpenDispatch: (workspaceId: string, toAgentId: string, dispatchId?: string) => DispatchRecord | undefined;
|
|
16
|
+
findOpenDispatchById: (workspaceId: string, dispatchId: string) => DispatchRecord | undefined;
|
|
16
17
|
insertMessage: (record: MessageLogRecord) => MessageLogHandle;
|
|
18
|
+
markDispatchCancelled: (input: {
|
|
19
|
+
dispatchId: string;
|
|
20
|
+
reason: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
}) => DispatchRecord | undefined;
|
|
17
23
|
markDispatchReportedByWorker: (input: {
|
|
18
24
|
artifacts: string[];
|
|
19
25
|
dispatchId?: string;
|
|
@@ -40,12 +46,21 @@ export interface StatusTaskInput {
|
|
|
40
46
|
requireActiveRun?: boolean;
|
|
41
47
|
text?: string;
|
|
42
48
|
}
|
|
49
|
+
export interface CancelTaskInput {
|
|
50
|
+
fromAgentId: string;
|
|
51
|
+
reason: string;
|
|
52
|
+
}
|
|
43
53
|
export interface ReportTaskResult {
|
|
44
54
|
dispatch: DispatchRecord | null;
|
|
45
55
|
forwardError: string | null;
|
|
46
56
|
forwarded: boolean;
|
|
47
57
|
}
|
|
48
|
-
export declare const createTeamOperations: ({ agentRuntime, createDispatch, deleteDispatch, deleteMessage, findOpenDispatch, insertMessage, markDispatchReportedByWorker, markDispatchSubmitted, workspaceStore, }: TeamOperationsInput) => {
|
|
58
|
+
export declare const createTeamOperations: ({ agentRuntime, createDispatch, deleteDispatch, deleteMessage, findOpenDispatch, findOpenDispatchById, insertMessage, markDispatchCancelled, markDispatchReportedByWorker, markDispatchSubmitted, workspaceStore, }: TeamOperationsInput) => {
|
|
59
|
+
cancelTask(workspaceId: string, dispatchId: string, input: CancelTaskInput): {
|
|
60
|
+
dispatch: DispatchRecord;
|
|
61
|
+
forwardError: string | null;
|
|
62
|
+
forwarded: boolean;
|
|
63
|
+
};
|
|
49
64
|
dispatchTask: (workspaceId: string, workerId: string, text: string, input?: DispatchTaskInput) => Promise<DispatchRecord>;
|
|
50
65
|
dispatchTaskByWorkerName(workspaceId: string, workerName: string, text: string, input?: DispatchTaskInput): Promise<DispatchRecord>;
|
|
51
66
|
recordUserInput(workspaceId: string, orchestratorId: string, text: string): void;
|