hivehq 2.0.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 +592 -0
- package/LICENSE +208 -0
- package/LICENSE.BSL +101 -0
- package/NOTICE +15 -0
- package/README.en.md +451 -0
- package/README.md +329 -0
- package/SECURITY.md +59 -0
- package/TRADEMARK.md +41 -0
- package/assets/hive-hero.png +0 -0
- package/assets/hive-team-view.png +0 -0
- package/assets/logo.png +0 -0
- package/assets/qq-group.jpg +0 -0
- package/dist/bin/team +7 -0
- package/dist/bin/team.cmd +3 -0
- package/dist/src/cli/hive-remote.d.ts +46 -0
- package/dist/src/cli/hive-remote.js +257 -0
- package/dist/src/cli/hive-update.d.ts +75 -0
- package/dist/src/cli/hive-update.js +215 -0
- package/dist/src/cli/hive.d.ts +78 -0
- package/dist/src/cli/hive.js +336 -0
- package/dist/src/cli/team.d.ts +38 -0
- package/dist/src/cli/team.js +762 -0
- package/dist/src/server/agent-command-resolver.d.ts +17 -0
- package/dist/src/server/agent-command-resolver.js +106 -0
- package/dist/src/server/agent-exit-classification.d.ts +6 -0
- package/dist/src/server/agent-exit-classification.js +6 -0
- package/dist/src/server/agent-launch-cache.d.ts +20 -0
- package/dist/src/server/agent-launch-cache.js +75 -0
- package/dist/src/server/agent-launch-resolver.d.ts +4 -0
- package/dist/src/server/agent-launch-resolver.js +38 -0
- package/dist/src/server/agent-manager-support.d.ts +36 -0
- package/dist/src/server/agent-manager-support.js +318 -0
- package/dist/src/server/agent-manager.d.ts +54 -0
- package/dist/src/server/agent-manager.js +104 -0
- package/dist/src/server/agent-run-bootstrap.d.ts +83 -0
- package/dist/src/server/agent-run-bootstrap.js +101 -0
- package/dist/src/server/agent-run-exit-handler.d.ts +8 -0
- package/dist/src/server/agent-run-exit-handler.js +32 -0
- package/dist/src/server/agent-run-start-context.d.ts +24 -0
- package/dist/src/server/agent-run-start-context.js +1 -0
- package/dist/src/server/agent-run-starter.d.ts +30 -0
- package/dist/src/server/agent-run-starter.js +155 -0
- package/dist/src/server/agent-run-store.d.ts +51 -0
- package/dist/src/server/agent-run-store.js +137 -0
- package/dist/src/server/agent-run-sync.d.ts +10 -0
- package/dist/src/server/agent-run-sync.js +32 -0
- package/dist/src/server/agent-runtime-active-run.d.ts +3 -0
- package/dist/src/server/agent-runtime-active-run.js +10 -0
- package/dist/src/server/agent-runtime-close.d.ts +5 -0
- package/dist/src/server/agent-runtime-close.js +36 -0
- package/dist/src/server/agent-runtime-contract.d.ts +48 -0
- package/dist/src/server/agent-runtime-contract.js +1 -0
- package/dist/src/server/agent-runtime-flow-adapter.d.ts +10 -0
- package/dist/src/server/agent-runtime-flow-adapter.js +14 -0
- package/dist/src/server/agent-runtime-list-runs.d.ts +3 -0
- package/dist/src/server/agent-runtime-list-runs.js +18 -0
- package/dist/src/server/agent-runtime-ports.d.ts +22 -0
- package/dist/src/server/agent-runtime-ports.js +1 -0
- package/dist/src/server/agent-runtime-stop-run.d.ts +4 -0
- package/dist/src/server/agent-runtime-stop-run.js +19 -0
- package/dist/src/server/agent-runtime-types.d.ts +5 -0
- package/dist/src/server/agent-runtime-types.js +1 -0
- package/dist/src/server/agent-runtime.d.ts +10 -0
- package/dist/src/server/agent-runtime.js +143 -0
- package/dist/src/server/agent-session-store.d.ts +7 -0
- package/dist/src/server/agent-session-store.js +45 -0
- package/dist/src/server/agent-startup-instructions.d.ts +20 -0
- package/dist/src/server/agent-startup-instructions.js +36 -0
- package/dist/src/server/agent-stdin-dispatcher.d.ts +52 -0
- package/dist/src/server/agent-stdin-dispatcher.js +224 -0
- package/dist/src/server/agent-tokens.d.ts +15 -0
- package/dist/src/server/agent-tokens.js +25 -0
- package/dist/src/server/app-state-store.d.ts +10 -0
- package/dist/src/server/app-state-store.js +12 -0
- package/dist/src/server/app.d.ts +20 -0
- package/dist/src/server/app.js +211 -0
- package/dist/src/server/claude-command-defaults.d.ts +1 -0
- package/dist/src/server/claude-command-defaults.js +5 -0
- package/dist/src/server/claude-session-coordinator.d.ts +10 -0
- package/dist/src/server/claude-session-coordinator.js +68 -0
- package/dist/src/server/claude-session-support.d.ts +1 -0
- package/dist/src/server/claude-session-support.js +1 -0
- package/dist/src/server/command-preset-defaults.d.ts +11 -0
- package/dist/src/server/command-preset-defaults.js +63 -0
- package/dist/src/server/command-preset-store.d.ts +49 -0
- package/dist/src/server/command-preset-store.js +83 -0
- package/dist/src/server/cron-util.d.ts +7 -0
- package/dist/src/server/cron-util.js +19 -0
- package/dist/src/server/dispatch-ledger-serializer.d.ts +15 -0
- package/dist/src/server/dispatch-ledger-serializer.js +14 -0
- package/dist/src/server/dispatch-ledger-store.d.ts +108 -0
- package/dist/src/server/dispatch-ledger-store.js +241 -0
- package/dist/src/server/env-sync-message.d.ts +9 -0
- package/dist/src/server/env-sync-message.js +29 -0
- package/dist/src/server/feature-flags.d.ts +42 -0
- package/dist/src/server/feature-flags.js +24 -0
- package/dist/src/server/fs-browse.d.ts +40 -0
- package/dist/src/server/fs-browse.js +306 -0
- package/dist/src/server/fs-pick-folder.d.ts +25 -0
- package/dist/src/server/fs-pick-folder.js +115 -0
- package/dist/src/server/fs-sandbox.d.ts +15 -0
- package/dist/src/server/fs-sandbox.js +56 -0
- package/dist/src/server/hive-team-guidance.d.ts +39 -0
- package/dist/src/server/hive-team-guidance.js +295 -0
- package/dist/src/server/http-errors.d.ts +22 -0
- package/dist/src/server/http-errors.js +44 -0
- package/dist/src/server/live-run-registry.d.ts +22 -0
- package/dist/src/server/live-run-registry.js +52 -0
- package/dist/src/server/local-request-guard.d.ts +3 -0
- package/dist/src/server/local-request-guard.js +41 -0
- package/dist/src/server/machine-name.d.ts +2 -0
- package/dist/src/server/machine-name.js +13 -0
- package/dist/src/server/marketplace-store.d.ts +38 -0
- package/dist/src/server/marketplace-store.js +85 -0
- package/dist/src/server/message-log-store.d.ts +51 -0
- package/dist/src/server/message-log-store.js +90 -0
- package/dist/src/server/open-target-commands.d.ts +54 -0
- package/dist/src/server/open-target-commands.js +204 -0
- package/dist/src/server/orchestrator-autostart.d.ts +42 -0
- package/dist/src/server/orchestrator-autostart.js +114 -0
- package/dist/src/server/orchestrator-launch.d.ts +24 -0
- package/dist/src/server/orchestrator-launch.js +71 -0
- package/dist/src/server/package-version.d.ts +17 -0
- package/dist/src/server/package-version.js +32 -0
- package/dist/src/server/path-canonicalization.d.ts +3 -0
- package/dist/src/server/path-canonicalization.js +29 -0
- package/dist/src/server/platform-path.d.ts +4 -0
- package/dist/src/server/platform-path.js +26 -0
- package/dist/src/server/post-start-input-writer.d.ts +6 -0
- package/dist/src/server/post-start-input-writer.js +242 -0
- package/dist/src/server/preset-launch-support.d.ts +6 -0
- package/dist/src/server/preset-launch-support.js +98 -0
- package/dist/src/server/pty-output-bus.d.ts +8 -0
- package/dist/src/server/pty-output-bus.js +32 -0
- package/dist/src/server/recovery-summary.d.ts +15 -0
- package/dist/src/server/recovery-summary.js +92 -0
- package/dist/src/server/remote-audit-store.d.ts +51 -0
- package/dist/src/server/remote-audit-store.js +108 -0
- package/dist/src/server/remote-config-keys.d.ts +17 -0
- package/dist/src/server/remote-config-keys.js +27 -0
- package/dist/src/server/remote-control-constants.d.ts +30 -0
- package/dist/src/server/remote-control-constants.js +29 -0
- package/dist/src/server/remote-device-session.d.ts +40 -0
- package/dist/src/server/remote-device-session.js +22 -0
- package/dist/src/server/remote-device-store.d.ts +36 -0
- package/dist/src/server/remote-device-store.js +67 -0
- package/dist/src/server/remote-frame-bridge.d.ts +102 -0
- package/dist/src/server/remote-frame-bridge.js +791 -0
- package/dist/src/server/remote-gateway-client.d.ts +14 -0
- package/dist/src/server/remote-gateway-client.js +36 -0
- package/dist/src/server/remote-loopback-auth.d.ts +6 -0
- package/dist/src/server/remote-loopback-auth.js +112 -0
- package/dist/src/server/remote-pairing-tunnel.d.ts +59 -0
- package/dist/src/server/remote-pairing-tunnel.js +146 -0
- package/dist/src/server/remote-pairing.d.ts +58 -0
- package/dist/src/server/remote-pairing.js +237 -0
- package/dist/src/server/remote-tunnel.d.ts +113 -0
- package/dist/src/server/remote-tunnel.js +514 -0
- package/dist/src/server/report-outbox-store.d.ts +36 -0
- package/dist/src/server/report-outbox-store.js +33 -0
- package/dist/src/server/restart-policy-support.d.ts +30 -0
- package/dist/src/server/restart-policy-support.js +21 -0
- package/dist/src/server/restart-policy.d.ts +18 -0
- package/dist/src/server/restart-policy.js +77 -0
- package/dist/src/server/role-template-store.d.ts +45 -0
- package/dist/src/server/role-template-store.js +76 -0
- package/dist/src/server/role-templates.d.ts +7 -0
- package/dist/src/server/role-templates.js +54 -0
- package/dist/src/server/route-helpers.d.ts +9 -0
- package/dist/src/server/route-helpers.js +61 -0
- package/dist/src/server/route-types.d.ts +121 -0
- package/dist/src/server/route-types.js +1 -0
- package/dist/src/server/routes-dispatches.d.ts +2 -0
- package/dist/src/server/routes-dispatches.js +54 -0
- package/dist/src/server/routes-fs.d.ts +2 -0
- package/dist/src/server/routes-fs.js +24 -0
- package/dist/src/server/routes-marketplace.d.ts +2 -0
- package/dist/src/server/routes-marketplace.js +54 -0
- package/dist/src/server/routes-open-workspace.d.ts +2 -0
- package/dist/src/server/routes-open-workspace.js +47 -0
- package/dist/src/server/routes-remote.d.ts +2 -0
- package/dist/src/server/routes-remote.js +166 -0
- package/dist/src/server/routes-runtime.d.ts +2 -0
- package/dist/src/server/routes-runtime.js +79 -0
- package/dist/src/server/routes-settings.d.ts +2 -0
- package/dist/src/server/routes-settings.js +213 -0
- package/dist/src/server/routes-tasks.d.ts +2 -0
- package/dist/src/server/routes-tasks.js +47 -0
- package/dist/src/server/routes-team-memory.d.ts +2 -0
- package/dist/src/server/routes-team-memory.js +154 -0
- package/dist/src/server/routes-team-recall.d.ts +2 -0
- package/dist/src/server/routes-team-recall.js +119 -0
- package/dist/src/server/routes-team.d.ts +2 -0
- package/dist/src/server/routes-team.js +351 -0
- package/dist/src/server/routes-ui.d.ts +2 -0
- package/dist/src/server/routes-ui.js +17 -0
- package/dist/src/server/routes-version.d.ts +2 -0
- package/dist/src/server/routes-version.js +6 -0
- package/dist/src/server/routes-workflow-schedules.d.ts +2 -0
- package/dist/src/server/routes-workflow-schedules.js +58 -0
- package/dist/src/server/routes-workflows.d.ts +2 -0
- package/dist/src/server/routes-workflows.js +83 -0
- package/dist/src/server/routes-workspace-memory-dreams.d.ts +2 -0
- package/dist/src/server/routes-workspace-memory-dreams.js +105 -0
- package/dist/src/server/routes-workspace-memory.d.ts +2 -0
- package/dist/src/server/routes-workspace-memory.js +215 -0
- package/dist/src/server/routes-workspaces.d.ts +2 -0
- package/dist/src/server/routes-workspaces.js +177 -0
- package/dist/src/server/routes.d.ts +6 -0
- package/dist/src/server/routes.js +55 -0
- package/dist/src/server/runtime-database.d.ts +3 -0
- package/dist/src/server/runtime-database.js +41 -0
- package/dist/src/server/runtime-message-builders.d.ts +7 -0
- package/dist/src/server/runtime-message-builders.js +60 -0
- package/dist/src/server/runtime-restart-policy.d.ts +18 -0
- package/dist/src/server/runtime-restart-policy.js +12 -0
- package/dist/src/server/runtime-store-contract.d.ts +162 -0
- package/dist/src/server/runtime-store-contract.js +1 -0
- package/dist/src/server/runtime-store-dream.d.ts +23 -0
- package/dist/src/server/runtime-store-dream.js +16 -0
- package/dist/src/server/runtime-store-helpers.d.ts +115 -0
- package/dist/src/server/runtime-store-helpers.js +411 -0
- package/dist/src/server/runtime-store-memory.d.ts +33 -0
- package/dist/src/server/runtime-store-memory.js +37 -0
- package/dist/src/server/runtime-store-remote.d.ts +5 -0
- package/dist/src/server/runtime-store-remote.js +45 -0
- package/dist/src/server/runtime-store-workflows.d.ts +6 -0
- package/dist/src/server/runtime-store-workflows.js +108 -0
- package/dist/src/server/runtime-store.d.ts +4 -0
- package/dist/src/server/runtime-store.js +165 -0
- package/dist/src/server/session-capture-claude.d.ts +34 -0
- package/dist/src/server/session-capture-claude.js +103 -0
- package/dist/src/server/session-capture-codex.d.ts +6 -0
- package/dist/src/server/session-capture-codex.js +108 -0
- package/dist/src/server/session-capture-gemini.d.ts +5 -0
- package/dist/src/server/session-capture-gemini.js +81 -0
- package/dist/src/server/session-capture-opencode.d.ts +22 -0
- package/dist/src/server/session-capture-opencode.js +75 -0
- package/dist/src/server/session-capture.d.ts +77 -0
- package/dist/src/server/session-capture.js +123 -0
- package/dist/src/server/settings-store.d.ts +22 -0
- package/dist/src/server/settings-store.js +22 -0
- package/dist/src/server/sqlite-schema-v10.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v10.js +13 -0
- package/dist/src/server/sqlite-schema-v11.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v11.js +10 -0
- package/dist/src/server/sqlite-schema-v12.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v12.js +21 -0
- package/dist/src/server/sqlite-schema-v13.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v13.js +4 -0
- package/dist/src/server/sqlite-schema-v14.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v14.js +84 -0
- package/dist/src/server/sqlite-schema-v15.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v15.js +73 -0
- package/dist/src/server/sqlite-schema-v16.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v16.js +6 -0
- package/dist/src/server/sqlite-schema-v17.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v17.js +15 -0
- package/dist/src/server/sqlite-schema-v18.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v18.js +6 -0
- package/dist/src/server/sqlite-schema-v19.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v19.js +17 -0
- package/dist/src/server/sqlite-schema-v20.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v20.js +20 -0
- package/dist/src/server/sqlite-schema-v21.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v21.js +20 -0
- package/dist/src/server/sqlite-schema-v22.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v22.js +27 -0
- package/dist/src/server/sqlite-schema-v23.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v23.js +43 -0
- package/dist/src/server/sqlite-schema-v24.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v24.js +34 -0
- package/dist/src/server/sqlite-schema-v25.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v25.js +127 -0
- package/dist/src/server/sqlite-schema-v26.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v26.js +56 -0
- package/dist/src/server/sqlite-schema-v27.d.ts +6 -0
- package/dist/src/server/sqlite-schema-v27.js +92 -0
- package/dist/src/server/sqlite-schema-v28.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v28.js +19 -0
- package/dist/src/server/sqlite-schema-v5.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v5.js +61 -0
- package/dist/src/server/sqlite-schema-v7.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v7.js +70 -0
- package/dist/src/server/sqlite-schema-v8.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v8.js +6 -0
- package/dist/src/server/sqlite-schema-v9.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v9.js +6 -0
- package/dist/src/server/sqlite-schema.d.ts +3 -0
- package/dist/src/server/sqlite-schema.js +353 -0
- package/dist/src/server/startup-command-parser.d.ts +20 -0
- package/dist/src/server/startup-command-parser.js +72 -0
- package/dist/src/server/system-message.d.ts +8 -0
- package/dist/src/server/system-message.js +8 -0
- package/dist/src/server/task-deps.d.ts +32 -0
- package/dist/src/server/task-deps.js +40 -0
- package/dist/src/server/tasks-file-watcher.d.ts +47 -0
- package/dist/src/server/tasks-file-watcher.js +200 -0
- package/dist/src/server/tasks-file.d.ts +23 -0
- package/dist/src/server/tasks-file.js +101 -0
- package/dist/src/server/tasks-websocket-server.d.ts +8 -0
- package/dist/src/server/tasks-websocket-server.js +95 -0
- package/dist/src/server/team-authz.d.ts +13 -0
- package/dist/src/server/team-authz.js +53 -0
- package/dist/src/server/team-autostaff.d.ts +16 -0
- package/dist/src/server/team-autostaff.js +16 -0
- package/dist/src/server/team-list-enrichment.d.ts +22 -0
- package/dist/src/server/team-list-enrichment.js +40 -0
- package/dist/src/server/team-list-serializer.d.ts +2 -0
- package/dist/src/server/team-list-serializer.js +11 -0
- package/dist/src/server/team-memory-digest.d.ts +52 -0
- package/dist/src/server/team-memory-digest.js +200 -0
- package/dist/src/server/team-memory-dream-applier.d.ts +5 -0
- package/dist/src/server/team-memory-dream-applier.js +234 -0
- package/dist/src/server/team-memory-dream-http-serializers.d.ts +13 -0
- package/dist/src/server/team-memory-dream-http-serializers.js +12 -0
- package/dist/src/server/team-memory-dream-ops.d.ts +40 -0
- package/dist/src/server/team-memory-dream-ops.js +153 -0
- package/dist/src/server/team-memory-dream-reverter.d.ts +22 -0
- package/dist/src/server/team-memory-dream-reverter.js +221 -0
- package/dist/src/server/team-memory-dream-run-store.d.ts +23 -0
- package/dist/src/server/team-memory-dream-run-store.js +211 -0
- package/dist/src/server/team-memory-dream-runner.d.ts +37 -0
- package/dist/src/server/team-memory-dream-runner.js +178 -0
- package/dist/src/server/team-memory-dream-scheduler.d.ts +32 -0
- package/dist/src/server/team-memory-dream-scheduler.js +115 -0
- package/dist/src/server/team-memory-dream-store.d.ts +19 -0
- package/dist/src/server/team-memory-dream-store.js +16 -0
- package/dist/src/server/team-memory-dream-types.d.ts +104 -0
- package/dist/src/server/team-memory-dream-types.js +23 -0
- package/dist/src/server/team-memory-export.d.ts +22 -0
- package/dist/src/server/team-memory-export.js +220 -0
- package/dist/src/server/team-memory-feature.d.ts +12 -0
- package/dist/src/server/team-memory-feature.js +12 -0
- package/dist/src/server/team-memory-http-serializers.d.ts +102 -0
- package/dist/src/server/team-memory-http-serializers.js +46 -0
- package/dist/src/server/team-memory-injection.d.ts +31 -0
- package/dist/src/server/team-memory-injection.js +49 -0
- package/dist/src/server/team-memory-store.d.ts +116 -0
- package/dist/src/server/team-memory-store.js +513 -0
- package/dist/src/server/team-operations.d.ts +102 -0
- package/dist/src/server/team-operations.js +387 -0
- package/dist/src/server/team-recall-store.d.ts +38 -0
- package/dist/src/server/team-recall-store.js +205 -0
- package/dist/src/server/terminal-flow-control.d.ts +19 -0
- package/dist/src/server/terminal-flow-control.js +116 -0
- package/dist/src/server/terminal-input-profile.d.ts +10 -0
- package/dist/src/server/terminal-input-profile.js +9 -0
- package/dist/src/server/terminal-protocol.d.ts +29 -0
- package/dist/src/server/terminal-protocol.js +47 -0
- package/dist/src/server/terminal-state-mirror.d.ts +21 -0
- package/dist/src/server/terminal-state-mirror.js +67 -0
- package/dist/src/server/terminal-stream-hub.d.ts +9 -0
- package/dist/src/server/terminal-stream-hub.js +192 -0
- package/dist/src/server/terminal-ws-server.d.ts +6 -0
- package/dist/src/server/terminal-ws-server.js +115 -0
- package/dist/src/server/ui-auth-helpers.d.ts +4 -0
- package/dist/src/server/ui-auth-helpers.js +28 -0
- package/dist/src/server/ui-auth.d.ts +8 -0
- package/dist/src/server/ui-auth.js +32 -0
- package/dist/src/server/version-service.d.ts +16 -0
- package/dist/src/server/version-service.js +72 -0
- package/dist/src/server/webhook-notifier.d.ts +34 -0
- package/dist/src/server/webhook-notifier.js +47 -0
- package/dist/src/server/websocket-upgrade-safety.d.ts +10 -0
- package/dist/src/server/websocket-upgrade-safety.js +35 -0
- package/dist/src/server/windows-command-line.d.ts +3 -0
- package/dist/src/server/windows-command-line.js +9 -0
- package/dist/src/server/windows-filename.d.ts +2 -0
- package/dist/src/server/windows-filename.js +33 -0
- package/dist/src/server/worker-output-tracker.d.ts +14 -0
- package/dist/src/server/worker-output-tracker.js +50 -0
- package/dist/src/server/workflow-cli-policy.d.ts +60 -0
- package/dist/src/server/workflow-cli-policy.js +110 -0
- package/dist/src/server/workflow-dispatch-awaiter.d.ts +12 -0
- package/dist/src/server/workflow-dispatch-awaiter.js +80 -0
- package/dist/src/server/workflow-feature.d.ts +15 -0
- package/dist/src/server/workflow-feature.js +15 -0
- package/dist/src/server/workflow-http-serializers.d.ts +64 -0
- package/dist/src/server/workflow-http-serializers.js +58 -0
- package/dist/src/server/workflow-output-schema.d.ts +18 -0
- package/dist/src/server/workflow-output-schema.js +41 -0
- package/dist/src/server/workflow-run-log-store.d.ts +19 -0
- package/dist/src/server/workflow-run-log-store.js +45 -0
- package/dist/src/server/workflow-run-store.d.ts +50 -0
- package/dist/src/server/workflow-run-store.js +103 -0
- package/dist/src/server/workflow-runner.d.ts +147 -0
- package/dist/src/server/workflow-runner.js +411 -0
- package/dist/src/server/workflow-schedule-create.d.ts +14 -0
- package/dist/src/server/workflow-schedule-create.js +41 -0
- package/dist/src/server/workflow-schedule-store.d.ts +43 -0
- package/dist/src/server/workflow-schedule-store.js +112 -0
- package/dist/src/server/workflow-scheduler.d.ts +36 -0
- package/dist/src/server/workflow-scheduler.js +97 -0
- package/dist/src/server/workflow-script-loader.d.ts +34 -0
- package/dist/src/server/workflow-script-loader.js +106 -0
- package/dist/src/server/workspace-path-validation.d.ts +1 -0
- package/dist/src/server/workspace-path-validation.js +42 -0
- package/dist/src/server/workspace-shell-runtime.d.ts +35 -0
- package/dist/src/server/workspace-shell-runtime.js +228 -0
- package/dist/src/server/workspace-store-contract.d.ts +32 -0
- package/dist/src/server/workspace-store-contract.js +1 -0
- package/dist/src/server/workspace-store-hydration.d.ts +5 -0
- package/dist/src/server/workspace-store-hydration.js +76 -0
- package/dist/src/server/workspace-store-mutations.d.ts +14 -0
- package/dist/src/server/workspace-store-mutations.js +48 -0
- package/dist/src/server/workspace-store-support.d.ts +33 -0
- package/dist/src/server/workspace-store-support.js +36 -0
- package/dist/src/server/workspace-store.d.ts +5 -0
- package/dist/src/server/workspace-store.js +153 -0
- package/dist/src/shared/fs-browse.d.ts +1 -0
- package/dist/src/shared/fs-browse.js +1 -0
- package/dist/src/shared/open-targets.d.ts +20 -0
- package/dist/src/shared/open-targets.js +36 -0
- package/dist/src/shared/path-input.d.ts +12 -0
- package/dist/src/shared/path-input.js +22 -0
- package/dist/src/shared/remote-bridge-routing.d.ts +19 -0
- package/dist/src/shared/remote-bridge-routing.js +141 -0
- package/dist/src/shared/remote-crypto.d.ts +138 -0
- package/dist/src/shared/remote-crypto.js +427 -0
- package/dist/src/shared/remote-pairing-code.d.ts +7 -0
- package/dist/src/shared/remote-pairing-code.js +47 -0
- package/dist/src/shared/remote-protocol.d.ts +160 -0
- package/dist/src/shared/remote-protocol.js +526 -0
- package/dist/src/shared/team-memory.d.ts +11 -0
- package/dist/src/shared/team-memory.js +10 -0
- package/dist/src/shared/team-recall.d.ts +1 -0
- package/dist/src/shared/team-recall.js +1 -0
- package/dist/src/shared/types.d.ts +66 -0
- package/dist/src/shared/types.js +1 -0
- 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 +131 -0
- package/scripts/postinstall-native-artifacts.mjs +113 -0
- package/web/dist/assets/AddWorkerDialog-BU2Fn-Mx.js +2 -0
- package/web/dist/assets/AddWorkspaceFlow-BV04MkRt.js +1 -0
- package/web/dist/assets/FirstRunWizard-DS4IYOrd.js +1 -0
- package/web/dist/assets/MarketplaceDrawer-CIQ2B6Fx.js +76 -0
- package/web/dist/assets/TaskGraphDrawer-BPMcRocd.js +1 -0
- package/web/dist/assets/WhatsNewDialog-DEgVY_LD.js +1 -0
- package/web/dist/assets/WorkerModal-DiCcTPpc.js +1 -0
- package/web/dist/assets/WorkflowsDrawer-M2CgAJWK.js +1 -0
- package/web/dist/assets/WorkspaceMemoryDrawer-ClJIqWck.js +1 -0
- package/web/dist/assets/WorkspaceTaskDrawer-gjvXuZ2K.js +1 -0
- package/web/dist/assets/addon-clipboard-wHJhZAA4.js +1 -0
- package/web/dist/assets/addon-fit-DX4qG4td.js +1 -0
- package/web/dist/assets/addon-unicode11-Bt8F3D7-.js +7 -0
- package/web/dist/assets/addon-web-links-DIbG5aQx.js +1 -0
- package/web/dist/assets/addon-webgl-DCtw1yLn.js +64 -0
- package/web/dist/assets/finder-C4Jmsb0B.png +0 -0
- package/web/dist/assets/ghostty-D-Js4rdm.png +0 -0
- package/web/dist/assets/index-bOMtwrkA.js +73 -0
- package/web/dist/assets/index-i9YgsMdD.css +1 -0
- package/web/dist/assets/path-join-7MR1s7b1.js +1 -0
- package/web/dist/assets/search-CmzeVhy0.js +1 -0
- package/web/dist/assets/xterm-B-qIQCd3.js +16 -0
- package/web/dist/assets/zed-C5BQT8X3.png +0 -0
- package/web/dist/bilibili.ico +0 -0
- package/web/dist/cli-icons/claude.png +0 -0
- package/web/dist/cli-icons/codex.png +0 -0
- package/web/dist/cli-icons/gemini.png +0 -0
- package/web/dist/cli-icons/hermes.png +0 -0
- package/web/dist/cli-icons/opencode.svg +18 -0
- package/web/dist/icons/apple-touch-icon-180.png +0 -0
- package/web/dist/icons/icon-192.png +0 -0
- package/web/dist/icons/icon-32.png +0 -0
- package/web/dist/icons/icon-512-maskable.png +0 -0
- package/web/dist/icons/icon-512.png +0 -0
- package/web/dist/index.html +39 -0
- package/web/dist/logo.png +0 -0
- package/web/dist/manifest.webmanifest +60 -0
- package/web/dist/screenshots/wide-overview.png +0 -0
- package/web/dist/sounds/LICENSE-KENNEY.txt +22 -0
- package/web/dist/sounds/hive-beacon.ogg +0 -0
- package/web/dist/sounds/hive-cascade.ogg +0 -0
- package/web/dist/sounds/hive-chime.ogg +0 -0
- package/web/dist/sounds/hive-ping.ogg +0 -0
- package/web/dist/sounds/hive-resolve.ogg +0 -0
- package/web/dist/sounds/hive-soft.ogg +0 -0
- package/web/dist/sw.js +99 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface ResolvedSpawnCommand {
|
|
2
|
+
/**
|
|
3
|
+
* `args` is a `string[]` for plain executables (node-pty's serializer is
|
|
4
|
+
* fine for them) and a verbatim `string` for Windows `.cmd`/`.bat` shim
|
|
5
|
+
* launches. The verbatim form bypasses node-pty's `argsToCommandLine`,
|
|
6
|
+
* because that function backslash-escapes any embedded `"` and cmd.exe
|
|
7
|
+
* does NOT recognize `\"` as an escape — it treats `\` as literal, which
|
|
8
|
+
* leaves cmd looking up a program name containing literal quote chars.
|
|
9
|
+
* See `node-pty/src/windowsPtyAgent.ts` `argsToCommandLine` for the rule.
|
|
10
|
+
*/
|
|
11
|
+
args: string | string[];
|
|
12
|
+
command: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const resolveCommandPath: (command: string, cwd: string, env: NodeJS.ProcessEnv, platform?: NodeJS.Platform) => string;
|
|
15
|
+
export declare const resolveSpawnCommand: (command: string, cwd: string, env: NodeJS.ProcessEnv, args?: string[], platform?: NodeJS.Platform) => ResolvedSpawnCommand;
|
|
16
|
+
export declare const assertCommandIsExecutable: (command: string, cwd: string, env: NodeJS.ProcessEnv) => void;
|
|
17
|
+
export type { ResolvedSpawnCommand };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { accessSync, constants } from 'node:fs';
|
|
2
|
+
import { basename, delimiter, extname, isAbsolute, join } from 'node:path';
|
|
3
|
+
import { buildCmdCallCommand } from './windows-command-line.js';
|
|
4
|
+
const hasPathSeparator = (command) => command.includes('/') || command.includes('\\');
|
|
5
|
+
const canExecute = (path, platform = process.platform) => {
|
|
6
|
+
try {
|
|
7
|
+
accessSync(path, platform === 'win32' ? constants.F_OK : constants.X_OK);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const createCommandNotFoundError = (command) => Object.assign(new Error(`${command} CLI not found in PATH`), {
|
|
15
|
+
code: 'ENOENT',
|
|
16
|
+
path: command,
|
|
17
|
+
});
|
|
18
|
+
const getEnvValue = (env, key, platform = process.platform) => {
|
|
19
|
+
if (platform !== 'win32')
|
|
20
|
+
return env[key];
|
|
21
|
+
if (Object.hasOwn(env, key))
|
|
22
|
+
return env[key];
|
|
23
|
+
const matchedKey = Object.keys(env)
|
|
24
|
+
.filter((item) => item.toLowerCase() === key.toLowerCase())
|
|
25
|
+
.at(-1);
|
|
26
|
+
return matchedKey ? env[matchedKey] : undefined;
|
|
27
|
+
};
|
|
28
|
+
const getWindowsExecutableNames = (command, env, platform = process.platform) => {
|
|
29
|
+
if (extname(command))
|
|
30
|
+
return [command];
|
|
31
|
+
const extensions = (getEnvValue(env, 'PATHEXT', platform) ?? '.COM;.EXE;.BAT;.CMD')
|
|
32
|
+
.split(';')
|
|
33
|
+
.map((item) => item.trim())
|
|
34
|
+
.filter(Boolean);
|
|
35
|
+
return extensions.map((extension) => `${command}${extension}`);
|
|
36
|
+
};
|
|
37
|
+
const getExecutableNames = (command, env, platform = process.platform) => platform === 'win32' ? getWindowsExecutableNames(command, env, platform) : [command];
|
|
38
|
+
export const resolveCommandPath = (command, cwd, env, platform = process.platform) => {
|
|
39
|
+
if (hasPathSeparator(command)) {
|
|
40
|
+
for (const name of getExecutableNames(command, env, platform)) {
|
|
41
|
+
const candidate = isAbsolute(name) ? name : join(cwd, name);
|
|
42
|
+
if (canExecute(candidate, platform))
|
|
43
|
+
return candidate;
|
|
44
|
+
}
|
|
45
|
+
throw createCommandNotFoundError(command);
|
|
46
|
+
}
|
|
47
|
+
for (const pathEntry of (getEnvValue(env, 'PATH', platform) ?? '').split(delimiter)) {
|
|
48
|
+
if (!pathEntry)
|
|
49
|
+
continue;
|
|
50
|
+
for (const name of getExecutableNames(command, env, platform)) {
|
|
51
|
+
const candidate = join(pathEntry, name);
|
|
52
|
+
if (canExecute(candidate, platform))
|
|
53
|
+
return candidate;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
throw createCommandNotFoundError(command);
|
|
57
|
+
};
|
|
58
|
+
const isWindowsBatchFile = (command) => {
|
|
59
|
+
const extension = extname(command).toLowerCase();
|
|
60
|
+
return extension === '.cmd' || extension === '.bat';
|
|
61
|
+
};
|
|
62
|
+
const buildWindowsBatchCommandLine = (command, args) => {
|
|
63
|
+
// `call` is cmd's built-in batch invocation; it handles quoted .cmd / .bat
|
|
64
|
+
// paths reliably (this is the same pattern Node.js's child_process uses
|
|
65
|
+
// internally on Windows since the CVE-2024-27980 fix).
|
|
66
|
+
// Most Windows agent CLIs are npm .cmd shims. Set the console code page to
|
|
67
|
+
// UTF-8 before launching them so Hive's injected CJK startup guidance is not
|
|
68
|
+
// interpreted through the machine's OEM code page.
|
|
69
|
+
return `/d /s /c chcp 65001 >nul && ${buildCmdCallCommand(command, args)}`;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Recognize the exact shape that `createStartupCommandLaunch` produces on
|
|
73
|
+
* Windows: `cmd.exe` with args `['/d', '/s', '/c', '<raw user command>']`.
|
|
74
|
+
* Pinned to length 4 so this branch only fires for that single contract;
|
|
75
|
+
* any other cmd.exe invocation (e.g. someone explicitly composing custom
|
|
76
|
+
* shell args via the launch config) keeps the default node-pty path.
|
|
77
|
+
*
|
|
78
|
+
* We need this repackaging because the user's raw command often contains `"`
|
|
79
|
+
* (Windows users habitually wrap paths) and node-pty's `argsToCommandLine`
|
|
80
|
+
* backslash-escapes those — cmd.exe then sees `\"...\"` and looks up a
|
|
81
|
+
* program whose name starts with `\`.
|
|
82
|
+
*/
|
|
83
|
+
const isCmdExeShellLaunch = (resolvedCommand, args) => basename(resolvedCommand).toLowerCase() === 'cmd.exe' &&
|
|
84
|
+
args.length === 4 &&
|
|
85
|
+
args[0] === '/d' &&
|
|
86
|
+
args[1] === '/s' &&
|
|
87
|
+
(args[2] === '/c' || args[2] === '/k');
|
|
88
|
+
export const resolveSpawnCommand = (command, cwd, env, args = [], platform = process.platform) => {
|
|
89
|
+
const resolvedCommand = resolveCommandPath(command, cwd, env, platform);
|
|
90
|
+
if (platform === 'win32' && isWindowsBatchFile(resolvedCommand)) {
|
|
91
|
+
return {
|
|
92
|
+
args: buildWindowsBatchCommandLine(resolvedCommand, args),
|
|
93
|
+
command: getEnvValue(env, 'ComSpec', platform) ?? 'cmd.exe',
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (platform === 'win32' && isCmdExeShellLaunch(resolvedCommand, args)) {
|
|
97
|
+
return {
|
|
98
|
+
args: args.join(' '),
|
|
99
|
+
command: resolvedCommand,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return { args, command: resolvedCommand };
|
|
103
|
+
};
|
|
104
|
+
export const assertCommandIsExecutable = (command, cwd, env) => {
|
|
105
|
+
resolveCommandPath(command, cwd, env);
|
|
106
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PersistedAgentRun } from './agent-run-store.js';
|
|
2
|
+
export declare const WINDOWS_CONTROL_C_EXIT_CODE = 3221225786;
|
|
3
|
+
export declare const isUserInterruptExitCode: (exitCode: number | null) => boolean;
|
|
4
|
+
export declare const isCleanRunExitCode: (exitCode: number | null) => boolean;
|
|
5
|
+
export declare const classifyCompletedRunStatus: (exitCode: number | null) => PersistedAgentRun["status"];
|
|
6
|
+
export declare const shouldClearResumedSessionOnExit: (exitCode: number | null) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const WINDOWS_CONTROL_C_EXIT_CODE = 0xc000013a;
|
|
2
|
+
const USER_INTERRUPT_EXIT_CODES = new Set([130, 143, WINDOWS_CONTROL_C_EXIT_CODE]);
|
|
3
|
+
export const isUserInterruptExitCode = (exitCode) => exitCode !== null && USER_INTERRUPT_EXIT_CODES.has(exitCode);
|
|
4
|
+
export const isCleanRunExitCode = (exitCode) => exitCode === 0 || isUserInterruptExitCode(exitCode);
|
|
5
|
+
export const classifyCompletedRunStatus = (exitCode) => isCleanRunExitCode(exitCode) ? 'exited' : 'error';
|
|
6
|
+
export const shouldClearResumedSessionOnExit = (exitCode) => !isCleanRunExitCode(exitCode);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentLaunchConfigInput } from './agent-run-store.js';
|
|
2
|
+
export interface AgentLaunchConfigRow {
|
|
3
|
+
agentId: string;
|
|
4
|
+
config: AgentLaunchConfigInput;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
}
|
|
7
|
+
interface AgentLaunchCacheStore {
|
|
8
|
+
deleteLaunchConfig: (workspaceId: string, agentId: string) => void;
|
|
9
|
+
listLaunchConfigs: () => AgentLaunchConfigRow[];
|
|
10
|
+
saveLaunchConfig: (workspaceId: string, agentId: string, input: AgentLaunchConfigInput) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const createAgentLaunchCache: (store: AgentLaunchCacheStore) => {
|
|
13
|
+
get(workspaceId: string, agentId: string): AgentLaunchConfigInput;
|
|
14
|
+
peek(workspaceId: string, agentId: string): AgentLaunchConfigInput | undefined;
|
|
15
|
+
getWorkspaceId(agentId: string): string | undefined;
|
|
16
|
+
save(workspaceId: string, agentId: string, input: AgentLaunchConfigInput): void;
|
|
17
|
+
remove(workspaceId: string, agentId: string): void;
|
|
18
|
+
setWorkspaceId(agentId: string, workspaceId: string): void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const createAgentLaunchCache = (store) => {
|
|
2
|
+
const launchConfigs = new Map();
|
|
3
|
+
const workspaceByAgentId = new Map();
|
|
4
|
+
const missingLaunchConfigs = new Set();
|
|
5
|
+
const cacheKey = (workspaceId, agentId) => `${workspaceId}:${agentId}`;
|
|
6
|
+
const load = () => {
|
|
7
|
+
launchConfigs.clear();
|
|
8
|
+
workspaceByAgentId.clear();
|
|
9
|
+
for (const row of store.listLaunchConfigs()) {
|
|
10
|
+
launchConfigs.set(cacheKey(row.workspaceId, row.agentId), row.config);
|
|
11
|
+
workspaceByAgentId.set(row.agentId, row.workspaceId);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
load();
|
|
15
|
+
return {
|
|
16
|
+
get(workspaceId, agentId) {
|
|
17
|
+
const key = cacheKey(workspaceId, agentId);
|
|
18
|
+
const config = launchConfigs.get(key);
|
|
19
|
+
if (config)
|
|
20
|
+
return config;
|
|
21
|
+
if (missingLaunchConfigs.has(key)) {
|
|
22
|
+
throw new Error(`Agent launch config not found: ${agentId}`);
|
|
23
|
+
}
|
|
24
|
+
load();
|
|
25
|
+
const reloadedConfig = launchConfigs.get(key);
|
|
26
|
+
if (reloadedConfig)
|
|
27
|
+
return reloadedConfig;
|
|
28
|
+
missingLaunchConfigs.add(key);
|
|
29
|
+
throw new Error(`Agent launch config not found: ${agentId}`);
|
|
30
|
+
},
|
|
31
|
+
peek(workspaceId, agentId) {
|
|
32
|
+
const key = cacheKey(workspaceId, agentId);
|
|
33
|
+
const config = launchConfigs.get(key);
|
|
34
|
+
if (config)
|
|
35
|
+
return config;
|
|
36
|
+
if (missingLaunchConfigs.has(key))
|
|
37
|
+
return undefined;
|
|
38
|
+
load();
|
|
39
|
+
const reloadedConfig = launchConfigs.get(key);
|
|
40
|
+
if (reloadedConfig)
|
|
41
|
+
return reloadedConfig;
|
|
42
|
+
missingLaunchConfigs.add(key);
|
|
43
|
+
return undefined;
|
|
44
|
+
},
|
|
45
|
+
getWorkspaceId(agentId) {
|
|
46
|
+
return workspaceByAgentId.get(agentId);
|
|
47
|
+
},
|
|
48
|
+
save(workspaceId, agentId, input) {
|
|
49
|
+
const normalized = {
|
|
50
|
+
command: input.command,
|
|
51
|
+
args: input.args ?? [],
|
|
52
|
+
commandPresetId: input.commandPresetId ?? null,
|
|
53
|
+
interactiveCommand: input.interactiveCommand ?? null,
|
|
54
|
+
presetAugmentationDisabled: input.presetAugmentationDisabled ?? false,
|
|
55
|
+
resumeArgsTemplate: input.resumeArgsTemplate ?? null,
|
|
56
|
+
sessionIdCapture: input.sessionIdCapture ?? null,
|
|
57
|
+
};
|
|
58
|
+
store.saveLaunchConfig(workspaceId, agentId, normalized);
|
|
59
|
+
const key = cacheKey(workspaceId, agentId);
|
|
60
|
+
launchConfigs.set(key, normalized);
|
|
61
|
+
missingLaunchConfigs.delete(key);
|
|
62
|
+
workspaceByAgentId.set(agentId, workspaceId);
|
|
63
|
+
},
|
|
64
|
+
remove(workspaceId, agentId) {
|
|
65
|
+
store.deleteLaunchConfig(workspaceId, agentId);
|
|
66
|
+
const key = cacheKey(workspaceId, agentId);
|
|
67
|
+
launchConfigs.delete(key);
|
|
68
|
+
missingLaunchConfigs.add(key);
|
|
69
|
+
workspaceByAgentId.delete(agentId);
|
|
70
|
+
},
|
|
71
|
+
setWorkspaceId(agentId, workspaceId) {
|
|
72
|
+
workspaceByAgentId.set(agentId, workspaceId);
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentLaunchConfigInput } from './agent-run-store.js';
|
|
2
|
+
import type { SettingsStore } from './settings-store.js';
|
|
3
|
+
export declare const resolveCommandPresetLaunchConfig: (settings: SettingsStore, commandPresetId: string) => AgentLaunchConfigInput | undefined;
|
|
4
|
+
export declare const resolveStartupCommandLaunchConfig: (settings: SettingsStore, startupCommand: string, commandPresetId?: string | null) => AgentLaunchConfigInput | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createStartupCommandLaunch, getStartupCommandExecutable, normalizeExecutableToken, } from './startup-command-parser.js';
|
|
2
|
+
export const resolveCommandPresetLaunchConfig = (settings, commandPresetId) => {
|
|
3
|
+
const preset = settings.getCommandPreset(commandPresetId);
|
|
4
|
+
if (!preset)
|
|
5
|
+
return undefined;
|
|
6
|
+
return {
|
|
7
|
+
args: preset.args,
|
|
8
|
+
command: preset.command,
|
|
9
|
+
commandPresetId: preset.id,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const findPresetForStartupCommand = (settings, startupCommand, commandPresetId) => {
|
|
13
|
+
if (commandPresetId)
|
|
14
|
+
return settings.getCommandPreset(commandPresetId);
|
|
15
|
+
// Reduce the raw token (which may be a bare command, an absolute path,
|
|
16
|
+
// or a Windows path with spaces and a .cmd suffix) to the canonical
|
|
17
|
+
// brand id before looking up the preset. Without this normalization
|
|
18
|
+
// step `getCommandPreset` only matched bare command names — Windows
|
|
19
|
+
// users typing the full nvm4w path lost CLI brand identification,
|
|
20
|
+
// session capture, and post-start input strategy in one swoop.
|
|
21
|
+
const brandId = normalizeExecutableToken(getStartupCommandExecutable(startupCommand));
|
|
22
|
+
return brandId ? settings.getCommandPreset(brandId) : undefined;
|
|
23
|
+
};
|
|
24
|
+
export const resolveStartupCommandLaunchConfig = (settings, startupCommand, commandPresetId = null) => {
|
|
25
|
+
const trimmedStartupCommand = startupCommand.trim();
|
|
26
|
+
if (!trimmedStartupCommand)
|
|
27
|
+
return undefined;
|
|
28
|
+
const parsed = createStartupCommandLaunch(trimmedStartupCommand);
|
|
29
|
+
const preset = findPresetForStartupCommand(settings, trimmedStartupCommand, commandPresetId);
|
|
30
|
+
return {
|
|
31
|
+
command: parsed.command,
|
|
32
|
+
args: parsed.args,
|
|
33
|
+
commandPresetId: null,
|
|
34
|
+
interactiveCommand: preset?.command ?? getStartupCommandExecutable(trimmedStartupCommand),
|
|
35
|
+
presetAugmentationDisabled: true,
|
|
36
|
+
sessionIdCapture: preset?.sessionIdCapture ?? null,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IPty } from 'node-pty';
|
|
2
|
+
import type { AgentRunRecord, AgentRunSnapshot } from './agent-manager.js';
|
|
3
|
+
import type { PtyOutputBus } from './pty-output-bus.js';
|
|
4
|
+
export declare const MAX_RUN_OUTPUT_LENGTH = 1000000;
|
|
5
|
+
type ExecRunner = (cmd: string, args: readonly string[], done: (success: boolean) => void) => void;
|
|
6
|
+
export declare const withSilencedConptyConsoleListAgent: <T>(platform: NodeJS.Platform, action: () => T) => T;
|
|
7
|
+
/**
|
|
8
|
+
* Windows analogue of POSIX `process.kill(-pgid, SIGKILL)`. node-pty on
|
|
9
|
+
* Windows hands `pty.kill()` to TerminateProcess against the PTY's main
|
|
10
|
+
* process only — children that the worker spawned (npm install, build
|
|
11
|
+
* scripts, custom tooling) become orphans and keep writing to the
|
|
12
|
+
* filesystem after the worker card flips to stopped.
|
|
13
|
+
*
|
|
14
|
+
* `taskkill /pid <pid> /t /f` walks the process tree (`/t`) and forces
|
|
15
|
+
* termination (`/f`), matching what task manager would do.
|
|
16
|
+
*
|
|
17
|
+
* IMPORTANT — call this BEFORE any other termination of the parent
|
|
18
|
+
* process. taskkill /T builds the tree by querying the parent for its
|
|
19
|
+
* descendants; if the parent is already gone (e.g. pty.kill() ran
|
|
20
|
+
* first) the enumeration returns empty and the children become
|
|
21
|
+
* orphans. /F also terminates the parent itself, so a parent-kill
|
|
22
|
+
* after this call is only useful as a fallback when taskkill itself
|
|
23
|
+
* failed (taskkill missing from PATH, restricted PowerShell, etc.).
|
|
24
|
+
*
|
|
25
|
+
* Best-effort: non-zero exits (process already gone, taskkill missing
|
|
26
|
+
* from PATH, access denied) are swallowed and surface as a `false`
|
|
27
|
+
* return. The caller is expected to fall back to pty.kill().
|
|
28
|
+
*
|
|
29
|
+
* Exported for unit testing — the `runner` parameter lets tests assert
|
|
30
|
+
* the exact argv without mocking node:child_process.
|
|
31
|
+
*/
|
|
32
|
+
export declare const taskkillProcessTree: (pid: number, platform?: NodeJS.Platform, runner?: ExecRunner, onFailure?: () => void) => boolean;
|
|
33
|
+
export declare const toAgentRunSnapshot: (run: AgentRunRecord) => AgentRunSnapshot;
|
|
34
|
+
export declare const finishAgentRun: (run: AgentRunRecord, exitCode: number | null, ptyOutputBus: PtyOutputBus) => void;
|
|
35
|
+
export declare const attachAgentPty: (run: AgentRunRecord, pty: IPty, ptyOutputBus: PtyOutputBus, platform?: NodeJS.Platform, execRunner?: ExecRunner) => void;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { execFile, execFileSync } from 'node:child_process';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { classifyCompletedRunStatus } from './agent-exit-classification.js';
|
|
4
|
+
export const MAX_RUN_OUTPUT_LENGTH = 1_000_000;
|
|
5
|
+
const FORCE_KILL_DELAY_MS = 750;
|
|
6
|
+
const TASKKILL_TIMEOUT_MS = 3000;
|
|
7
|
+
const PTY_READ_EOF_EXIT_GRACE_MS = 1000;
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const childProcess = require('node:child_process');
|
|
10
|
+
const isConptyConsoleListAgentPath = (modulePath) => {
|
|
11
|
+
const normalized = String(modulePath).replaceAll('\\', '/');
|
|
12
|
+
return (normalized.endsWith('/conpty_console_list_agent') ||
|
|
13
|
+
normalized.endsWith('/conpty_console_list_agent.js'));
|
|
14
|
+
};
|
|
15
|
+
export const withSilencedConptyConsoleListAgent = (platform, action) => {
|
|
16
|
+
if (platform !== 'win32')
|
|
17
|
+
return action();
|
|
18
|
+
const originalFork = childProcess.fork;
|
|
19
|
+
const patchedFork = (modulePath, argsOrOptions, options) => {
|
|
20
|
+
if (!isConptyConsoleListAgentPath(modulePath)) {
|
|
21
|
+
return Array.isArray(argsOrOptions)
|
|
22
|
+
? originalFork.call(childProcess, modulePath, argsOrOptions, options)
|
|
23
|
+
: originalFork.call(childProcess, modulePath, argsOrOptions);
|
|
24
|
+
}
|
|
25
|
+
const forkOptions = Array.isArray(argsOrOptions) ? options : argsOrOptions;
|
|
26
|
+
const silentOptions = { ...(forkOptions ?? {}), silent: true };
|
|
27
|
+
const child = Array.isArray(argsOrOptions)
|
|
28
|
+
? originalFork.call(childProcess, modulePath, argsOrOptions, silentOptions)
|
|
29
|
+
: originalFork.call(childProcess, modulePath, silentOptions);
|
|
30
|
+
child.stderr?.resume();
|
|
31
|
+
child.stdout?.resume();
|
|
32
|
+
return child;
|
|
33
|
+
};
|
|
34
|
+
childProcess.fork = patchedFork;
|
|
35
|
+
try {
|
|
36
|
+
return action();
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
childProcess.fork = originalFork;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const isPtyReadEofError = (error, platform = process.platform) => {
|
|
43
|
+
const candidate = error;
|
|
44
|
+
return platform !== 'win32' && candidate?.code === 'EIO' && candidate.syscall === 'read';
|
|
45
|
+
};
|
|
46
|
+
const serializePtyInput = (input) => Buffer.isBuffer(input) ? input.toString('latin1') : input;
|
|
47
|
+
const defaultExecRunner = (cmd, args, done) => {
|
|
48
|
+
let settled = false;
|
|
49
|
+
const settle = (success) => {
|
|
50
|
+
if (settled)
|
|
51
|
+
return;
|
|
52
|
+
settled = true;
|
|
53
|
+
done(success);
|
|
54
|
+
};
|
|
55
|
+
const child = execFile(cmd, [...args], { maxBuffer: 64 * 1024, timeout: TASKKILL_TIMEOUT_MS, windowsHide: true }, (error) => settle(!error));
|
|
56
|
+
child.once('error', () => settle(false));
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Windows analogue of POSIX `process.kill(-pgid, SIGKILL)`. node-pty on
|
|
60
|
+
* Windows hands `pty.kill()` to TerminateProcess against the PTY's main
|
|
61
|
+
* process only — children that the worker spawned (npm install, build
|
|
62
|
+
* scripts, custom tooling) become orphans and keep writing to the
|
|
63
|
+
* filesystem after the worker card flips to stopped.
|
|
64
|
+
*
|
|
65
|
+
* `taskkill /pid <pid> /t /f` walks the process tree (`/t`) and forces
|
|
66
|
+
* termination (`/f`), matching what task manager would do.
|
|
67
|
+
*
|
|
68
|
+
* IMPORTANT — call this BEFORE any other termination of the parent
|
|
69
|
+
* process. taskkill /T builds the tree by querying the parent for its
|
|
70
|
+
* descendants; if the parent is already gone (e.g. pty.kill() ran
|
|
71
|
+
* first) the enumeration returns empty and the children become
|
|
72
|
+
* orphans. /F also terminates the parent itself, so a parent-kill
|
|
73
|
+
* after this call is only useful as a fallback when taskkill itself
|
|
74
|
+
* failed (taskkill missing from PATH, restricted PowerShell, etc.).
|
|
75
|
+
*
|
|
76
|
+
* Best-effort: non-zero exits (process already gone, taskkill missing
|
|
77
|
+
* from PATH, access denied) are swallowed and surface as a `false`
|
|
78
|
+
* return. The caller is expected to fall back to pty.kill().
|
|
79
|
+
*
|
|
80
|
+
* Exported for unit testing — the `runner` parameter lets tests assert
|
|
81
|
+
* the exact argv without mocking node:child_process.
|
|
82
|
+
*/
|
|
83
|
+
export const taskkillProcessTree = (pid, platform = process.platform, runner = defaultExecRunner, onFailure) => {
|
|
84
|
+
if (platform !== 'win32' || pid <= 0)
|
|
85
|
+
return false;
|
|
86
|
+
try {
|
|
87
|
+
runner('taskkill', ['/pid', String(pid), '/t', '/f'], (success) => {
|
|
88
|
+
if (!success)
|
|
89
|
+
onFailure?.();
|
|
90
|
+
});
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export const toAgentRunSnapshot = (run) => ({
|
|
98
|
+
runId: run.runId,
|
|
99
|
+
agentId: run.agentId,
|
|
100
|
+
pid: run.process.pid,
|
|
101
|
+
status: run.process.isStopped() && run.status !== 'exited' && run.status !== 'error'
|
|
102
|
+
? 'error'
|
|
103
|
+
: run.status,
|
|
104
|
+
output: run.output,
|
|
105
|
+
exitCode: run.exitCode,
|
|
106
|
+
});
|
|
107
|
+
export const finishAgentRun = (run, exitCode, ptyOutputBus) => {
|
|
108
|
+
if (run.status === 'exited' || run.status === 'error')
|
|
109
|
+
return;
|
|
110
|
+
run.status = classifyCompletedRunStatus(exitCode);
|
|
111
|
+
run.exitCode = exitCode;
|
|
112
|
+
try {
|
|
113
|
+
run.onExit?.({ runId: run.runId, exitCode });
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
ptyOutputBus.clear(run.runId);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
export const attachAgentPty = (run, pty, ptyOutputBus, platform = process.platform, execRunner = defaultExecRunner) => {
|
|
120
|
+
let stdinClosed = false;
|
|
121
|
+
let forceKillTimer;
|
|
122
|
+
let ptyReadEofTimer;
|
|
123
|
+
const resolveProcessGroupId = () => {
|
|
124
|
+
if (platform === 'win32' || pty.pid <= 0)
|
|
125
|
+
return null;
|
|
126
|
+
try {
|
|
127
|
+
const value = execFileSync('ps', ['-o', 'pgid=', '-p', String(pty.pid)], {
|
|
128
|
+
encoding: 'utf8',
|
|
129
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
130
|
+
}).trim();
|
|
131
|
+
const groupId = Number(value);
|
|
132
|
+
if (Number.isInteger(groupId) && groupId > 0)
|
|
133
|
+
return groupId;
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return pty.pid;
|
|
137
|
+
}
|
|
138
|
+
return pty.pid;
|
|
139
|
+
};
|
|
140
|
+
const processGroupId = resolveProcessGroupId();
|
|
141
|
+
const stopped = () => run.status === 'exited' || run.status === 'error';
|
|
142
|
+
const ignoreMissingProcess = (error) => {
|
|
143
|
+
if (error?.code !== 'ESRCH')
|
|
144
|
+
throw error;
|
|
145
|
+
};
|
|
146
|
+
const ignoreBestEffortGroupKillError = (error) => {
|
|
147
|
+
const code = error?.code;
|
|
148
|
+
if (code !== 'ESRCH' && code !== 'EPERM')
|
|
149
|
+
throw error;
|
|
150
|
+
};
|
|
151
|
+
const killProcessGroup = (signal) => {
|
|
152
|
+
if (platform === 'win32' || processGroupId === null)
|
|
153
|
+
return;
|
|
154
|
+
try {
|
|
155
|
+
process.kill(-processGroupId, signal);
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
ignoreBestEffortGroupKillError(error);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const killPtyDirect = (signal) => {
|
|
162
|
+
try {
|
|
163
|
+
if (platform === 'win32')
|
|
164
|
+
withSilencedConptyConsoleListAgent(platform, () => pty.kill());
|
|
165
|
+
else
|
|
166
|
+
pty.kill(signal);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
ignoreMissingProcess(error);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const killPty = (signal) => {
|
|
173
|
+
if (platform === 'win32') {
|
|
174
|
+
// taskkill /pid <pid> /t /f walks the parent's process tree
|
|
175
|
+
// BEFORE terminating it — so we have to run it while the parent
|
|
176
|
+
// is still alive. Calling pty.kill() first (the previous
|
|
177
|
+
// ordering) detaches the children: taskkill /T then fails with
|
|
178
|
+
// "process not found" and the npm-installs / build scripts
|
|
179
|
+
// become orphans. taskkill /f also terminates the parent, so
|
|
180
|
+
// pty.kill() is the fallback for the rare case where taskkill
|
|
181
|
+
// is missing from PATH or refused (e.g. restricted PowerShell).
|
|
182
|
+
if (!taskkillProcessTree(pty.pid, platform, execRunner, () => killPtyDirect()))
|
|
183
|
+
killPtyDirect();
|
|
184
|
+
}
|
|
185
|
+
else
|
|
186
|
+
killPtyDirect(signal);
|
|
187
|
+
killProcessGroup(signal);
|
|
188
|
+
};
|
|
189
|
+
const clearForceKillTimer = () => {
|
|
190
|
+
if (!forceKillTimer)
|
|
191
|
+
return;
|
|
192
|
+
clearTimeout(forceKillTimer);
|
|
193
|
+
forceKillTimer = undefined;
|
|
194
|
+
};
|
|
195
|
+
const clearPtyReadEofTimer = () => {
|
|
196
|
+
if (!ptyReadEofTimer)
|
|
197
|
+
return;
|
|
198
|
+
clearTimeout(ptyReadEofTimer);
|
|
199
|
+
ptyReadEofTimer = undefined;
|
|
200
|
+
};
|
|
201
|
+
const schedulePtyReadEofExitGuard = (error) => {
|
|
202
|
+
if (ptyReadEofTimer)
|
|
203
|
+
return;
|
|
204
|
+
ptyReadEofTimer = setTimeout(() => {
|
|
205
|
+
ptyReadEofTimer = undefined;
|
|
206
|
+
if (stopped())
|
|
207
|
+
return;
|
|
208
|
+
console.error(`[hive] PTY read EOF without exit for run ${run.runId}`, error);
|
|
209
|
+
finishAgentRun(run, null, ptyOutputBus);
|
|
210
|
+
try {
|
|
211
|
+
killPty('SIGTERM');
|
|
212
|
+
scheduleForceKill();
|
|
213
|
+
}
|
|
214
|
+
catch (killError) {
|
|
215
|
+
ignoreMissingProcess(killError);
|
|
216
|
+
}
|
|
217
|
+
}, PTY_READ_EOF_EXIT_GRACE_MS);
|
|
218
|
+
ptyReadEofTimer.unref?.();
|
|
219
|
+
};
|
|
220
|
+
const cleanupProcessGroup = () => {
|
|
221
|
+
clearForceKillTimer();
|
|
222
|
+
clearPtyReadEofTimer();
|
|
223
|
+
killProcessGroup('SIGKILL');
|
|
224
|
+
};
|
|
225
|
+
const scheduleForceKill = () => {
|
|
226
|
+
if (forceKillTimer)
|
|
227
|
+
return;
|
|
228
|
+
forceKillTimer = setTimeout(() => {
|
|
229
|
+
forceKillTimer = undefined;
|
|
230
|
+
try {
|
|
231
|
+
if (platform === 'win32') {
|
|
232
|
+
// Same ordering as killPty(): tree-kill before terminating the
|
|
233
|
+
// parent, so taskkill /T can still enumerate the process tree.
|
|
234
|
+
// pty.kill() is the cleanup fallback for taskkill-missing hosts;
|
|
235
|
+
// its noisy dependency helper is silenced in killPtyDirect().
|
|
236
|
+
if (!taskkillProcessTree(pty.pid, platform, execRunner, () => killPtyDirect()))
|
|
237
|
+
killPtyDirect();
|
|
238
|
+
}
|
|
239
|
+
else
|
|
240
|
+
killPtyDirect('SIGKILL');
|
|
241
|
+
}
|
|
242
|
+
catch (error) {
|
|
243
|
+
ignoreMissingProcess(error);
|
|
244
|
+
}
|
|
245
|
+
killProcessGroup('SIGKILL');
|
|
246
|
+
}, FORCE_KILL_DELAY_MS);
|
|
247
|
+
forceKillTimer.unref?.();
|
|
248
|
+
};
|
|
249
|
+
run.process = {
|
|
250
|
+
isStopped() {
|
|
251
|
+
return stopped();
|
|
252
|
+
},
|
|
253
|
+
pause() {
|
|
254
|
+
pty.pause();
|
|
255
|
+
},
|
|
256
|
+
pid: pty.pid,
|
|
257
|
+
resize(cols, rows) {
|
|
258
|
+
if (!Number.isInteger(cols) || !Number.isInteger(rows) || cols <= 0 || rows <= 0) {
|
|
259
|
+
throw new Error(`Invalid terminal size for run: ${run.runId}`);
|
|
260
|
+
}
|
|
261
|
+
pty.resize(cols, rows);
|
|
262
|
+
},
|
|
263
|
+
resume() {
|
|
264
|
+
pty.resume();
|
|
265
|
+
},
|
|
266
|
+
stop() {
|
|
267
|
+
if (stopped()) {
|
|
268
|
+
cleanupProcessGroup();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
clearPtyReadEofTimer();
|
|
272
|
+
killPty('SIGTERM');
|
|
273
|
+
stdinClosed = true;
|
|
274
|
+
scheduleForceKill();
|
|
275
|
+
},
|
|
276
|
+
write(text) {
|
|
277
|
+
if (stdinClosed || run.status === 'exited' || run.status === 'error') {
|
|
278
|
+
throw new Error(`PTY is not active for run: ${run.runId}`);
|
|
279
|
+
}
|
|
280
|
+
pty.write(serializePtyInput(text));
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
pty.onData((chunk) => {
|
|
284
|
+
if (run.status === 'starting')
|
|
285
|
+
run.status = 'running';
|
|
286
|
+
run.output += chunk;
|
|
287
|
+
if (run.output.length > MAX_RUN_OUTPUT_LENGTH)
|
|
288
|
+
run.output = run.output.slice(-MAX_RUN_OUTPUT_LENGTH);
|
|
289
|
+
ptyOutputBus.publish(run.runId, chunk);
|
|
290
|
+
});
|
|
291
|
+
pty.on?.('error', (error) => {
|
|
292
|
+
if (stopped())
|
|
293
|
+
return;
|
|
294
|
+
if (isPtyReadEofError(error, platform)) {
|
|
295
|
+
// Unix PTYs can surface a closed slave as read/EIO just before
|
|
296
|
+
// node-pty delivers the real onExit event. Treat it as EOF, not
|
|
297
|
+
// as the run's terminal status.
|
|
298
|
+
stdinClosed = true;
|
|
299
|
+
schedulePtyReadEofExitGuard(error);
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
console.error(`[hive] PTY error for run ${run.runId}`, error);
|
|
303
|
+
stdinClosed = true;
|
|
304
|
+
finishAgentRun(run, null, ptyOutputBus);
|
|
305
|
+
try {
|
|
306
|
+
killPty('SIGTERM');
|
|
307
|
+
}
|
|
308
|
+
catch (killError) {
|
|
309
|
+
ignoreMissingProcess(killError);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
pty.onExit((event) => {
|
|
313
|
+
stdinClosed = true;
|
|
314
|
+
clearPtyReadEofTimer();
|
|
315
|
+
cleanupProcessGroup();
|
|
316
|
+
finishAgentRun(run, event.exitCode, ptyOutputBus);
|
|
317
|
+
});
|
|
318
|
+
};
|