@mndrk/agx 1.4.30 → 1.4.33
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/README.md +83 -54
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/BUILD_ID +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-build-manifest.json +89 -68
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-path-routes-manifest.json +12 -9
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/build-manifest.json +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/prerender-manifest.json +21 -21
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/routes-manifest.json +8 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found/page.js +7 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.rsc +16 -15
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/audit/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/[...nextauth]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/daemon-secret/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/code/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/token/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/[id]/route.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/[id]/route.js.nft.json +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/[id]/route_client-reference-manifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/route.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/route.js.nft.json +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/route_client-reference-manifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/health/route.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/health/route.js.nft.json +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/health/route_client-reference-manifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/learnings/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/logs/stream/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/start/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/status/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/[id]/route.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/route.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/complete/route.js +4 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/complete/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/stage-prompts/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/[commentId]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/heartbeat/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/history/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/logs/route.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/logs/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/stream/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/user-settings/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/nodes/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page.js +10 -5
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.rsc +20 -19
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page.js +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.rsc +20 -19
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.rsc +25 -23
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login/page.js +7 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.rsc +20 -19
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/page.js +7 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page.js +6 -5
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page.js +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/workflow/page.js +7 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/workflow/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/workflow/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page.js +2 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.rsc +20 -19
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings/page.js +7 -2
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings/page.js.nft.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.rsc +20 -19
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app-paths-manifest.json +12 -9
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/2298.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/{8361.js → 3224.js} +3 -3
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/7143.js +1 -4
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/9773.js +6 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/middleware-manifest.json +5 -5
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/404.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/500.html +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.js +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.json +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/DMNQmUkQjUP3zxWUwUUqb/_buildManifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/{2456-5577fa071bb78cca.js → 2456-fb622a24e9609222.js} +1 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/_error.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/audit/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/[...nextauth]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/daemon-secret/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/device/code/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/device/token/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/refresh/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/status/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/domains/[id]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/domains/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/health/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/learnings/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/logs/stream/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/cancel/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/signal/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/start/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/status/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/projects/[id]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/projects/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/providers/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/queue/complete/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/queue/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/stage-prompts/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/comments/[commentId]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/comments/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/heartbeat/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/history/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/logs/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/stream/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/user-settings/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/[id]/nodes/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/[id]/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/callback/route-99c56d5659a15bdb.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-ccd70ca63478d630.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/layout-a88b659f348808e1.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/layout-11d4290500b37271.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/page-98b32955971a9b89.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/amp.js +1015 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/main-app.js +1893 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/main.js +1616 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/pages/_app.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/pages/_error.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/react-refresh.js +62 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/fallback/webpack.js +1368 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/main.js +1616 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/pages/_app.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/pages/_error.js +28 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/polyfills.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/react-refresh.js +62 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/webpack.js +1405 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/css/684e3dda28b1eb43.css +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/development/_buildManifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/development/_ssgManifest.js +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/webpack/3f44f671f4861aa9.webpack.hot-update.json +1 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/webpack/webpack.3f44f671f4861aa9.hot-update.js +12 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/worker/index.js +16 -20
- package/index.js +9 -8188
- package/lib/cli/cloud/command.js +25 -10
- package/lib/cli/cloud/executeVerifySingle.js +16 -0
- package/lib/cli/cloud/executeVerifySwarm.js +16 -0
- package/lib/cli/cloud/iterations.js +6 -2
- package/lib/cli/cloud/taskLogger.js +79 -10
- package/lib/cli/cloudArtifacts.js +2 -1
- package/lib/cli/daemon.js +48 -32
- package/lib/cli/interactiveMenu.js +11 -9
- package/lib/cli/providers.js +26 -19
- package/lib/cli/runCli.js +681 -645
- package/lib/commands/daemonBoard.js +9 -9
- package/lib/executor.js +4 -11
- package/lib/orchestrator/httpClient.js +6 -2
- package/lib/proc/ProcessManager.js +197 -0
- package/lib/proc/commandExists.js +4 -4
- package/lib/proc/killProcessTree.js +157 -0
- package/lib/proc/spawnCloudTaskProcess.js +32 -5
- package/lib/prompts/cloudTask.js +72 -23
- package/lib/storage/paths.js +3 -0
- package/lib/storage/runs.js +1 -0
- package/lib/verifier.js +10 -9
- package/package.json +2 -1
- package/templates/stack/postgres/init/001_agx_board_schema.sql +17 -0
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/6125.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/M4AQWpnhTFqFD3HFlSHd9/_buildManifest.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/audit/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/[...nextauth]/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/daemon-secret/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/device/code/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/device/token/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/refresh/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/auth/status/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/learnings/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/logs/stream/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/cancel/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/signal/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/start/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/orchestrator/tasks/[taskId]/status/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/projects/[id]/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/projects/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/providers/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/queue/complete/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/queue/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/stage-prompts/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/comments/[commentId]/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/comments/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/heartbeat/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/history/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/logs/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/[id]/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/tasks/stream/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/user-settings/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/[id]/nodes/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/[id]/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/api/workflows/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/callback/route-a73121242529c10c.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-e2c2560ec12b421d.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/layout-2d6cff09e6c1e2b2.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/layout-c77e54e6c377c70a.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/page-253ca8286e8f1d68.js +0 -1
- package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/css/72371329e4c91108.css +0 -1
- /package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/{M4AQWpnhTFqFD3HFlSHd9 → DMNQmUkQjUP3zxWUwUUqb}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
|
-
const
|
|
2
|
+
const execa = require('execa');
|
|
3
3
|
|
|
4
4
|
function getBoardUrl({ getBoardPort }) {
|
|
5
5
|
const apiUrl = process.env.AGX_CLOUD_URL || process.env.AGX_BOARD_URL || 'http://localhost:41741';
|
|
@@ -23,17 +23,17 @@ function openInBrowser(url) {
|
|
|
23
23
|
try {
|
|
24
24
|
if (!url) return false;
|
|
25
25
|
if (process.platform === 'darwin') {
|
|
26
|
-
const p =
|
|
27
|
-
p.unref();
|
|
26
|
+
const p = execa('open', [url], { stdio: 'ignore', detached: true, reject: false });
|
|
27
|
+
p.unref?.();
|
|
28
28
|
return true;
|
|
29
29
|
}
|
|
30
30
|
if (process.platform === 'win32') {
|
|
31
|
-
const p =
|
|
32
|
-
p.unref();
|
|
31
|
+
const p = execa('cmd', ['/c', 'start', '', url], { stdio: 'ignore', detached: true, reject: false });
|
|
32
|
+
p.unref?.();
|
|
33
33
|
return true;
|
|
34
34
|
}
|
|
35
|
-
const p =
|
|
36
|
-
p.unref();
|
|
35
|
+
const p = execa('xdg-open', [url], { stdio: 'ignore', detached: true, reject: false });
|
|
36
|
+
p.unref?.();
|
|
37
37
|
return true;
|
|
38
38
|
} catch {
|
|
39
39
|
return false;
|
|
@@ -158,7 +158,7 @@ async function maybeHandleDaemonBoardCommand({ cmd, args, ctx }) {
|
|
|
158
158
|
process.exit(0);
|
|
159
159
|
}
|
|
160
160
|
console.log(`${c.dim}Tailing ${DAEMON_LOG_FILE}... (Ctrl+C to stop)${c.reset}\n`);
|
|
161
|
-
const tail =
|
|
161
|
+
const tail = execa('tail', ['-f', DAEMON_LOG_FILE], { stdio: 'inherit', reject: false });
|
|
162
162
|
tail.on('close', () => process.exit(0));
|
|
163
163
|
return true;
|
|
164
164
|
} else {
|
|
@@ -259,7 +259,7 @@ async function maybeHandleDaemonBoardCommand({ cmd, args, ctx }) {
|
|
|
259
259
|
process.exit(0);
|
|
260
260
|
}
|
|
261
261
|
console.log(`${c.dim}Tailing ${BOARD_LOG_FILE}... (Ctrl+C to stop)${c.reset}\n`);
|
|
262
|
-
const tail =
|
|
262
|
+
const tail = execa('tail', ['-f', BOARD_LOG_FILE], { stdio: 'inherit', reject: false });
|
|
263
263
|
tail.on('close', () => process.exit(0));
|
|
264
264
|
return true;
|
|
265
265
|
} else {
|
package/lib/executor.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* The executor spawns the appropriate CLI and captures output.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const execa = require('execa');
|
|
9
9
|
const fs = require('fs');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const os = require('os');
|
|
12
|
+
const { commandExists } = require('./proc/commandExists');
|
|
12
13
|
|
|
13
14
|
const DEFAULT_STAGE_PROMPT = 'Execute this stage using the latest stage prompt from the cloud task context.';
|
|
14
15
|
|
|
@@ -45,15 +46,6 @@ const ENGINES = {
|
|
|
45
46
|
},
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
function commandExists(cmd) {
|
|
49
|
-
try {
|
|
50
|
-
spawnSync('which', [cmd], { stdio: 'ignore' });
|
|
51
|
-
return true;
|
|
52
|
-
} catch {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
49
|
function findStagePromptRecord(stagePrompts, stage) {
|
|
58
50
|
if (!stagePrompts) return null;
|
|
59
51
|
if (!stage) return null;
|
|
@@ -156,10 +148,11 @@ async function executeTask(options) {
|
|
|
156
148
|
args.push(prompt);
|
|
157
149
|
}
|
|
158
150
|
|
|
159
|
-
const proc =
|
|
151
|
+
const proc = execa(engineConfig.cmd, args, {
|
|
160
152
|
cwd: workDir,
|
|
161
153
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
162
154
|
env: { ...process.env, ...engineConfig.env, TERM: 'dumb' },
|
|
155
|
+
reject: false,
|
|
163
156
|
});
|
|
164
157
|
|
|
165
158
|
let output = '';
|
|
@@ -92,8 +92,12 @@ function createHttpClient(config) {
|
|
|
92
92
|
|
|
93
93
|
async queryTask(taskId, query = 'getStatus', args = null) {
|
|
94
94
|
const normalizedTaskId = normalizeTaskId(taskId);
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
const endpoint = `${orchestratorBase}/tasks/${encodeURIComponent(normalizedTaskId)}/status`;
|
|
96
|
+
// New API expects GET /status for simple status reads; keep POST for advanced queries.
|
|
97
|
+
if (query === 'getStatus' && !args) {
|
|
98
|
+
return apiRequest(config, 'GET', endpoint);
|
|
99
|
+
}
|
|
100
|
+
return apiRequest(config, 'POST', endpoint, {
|
|
97
101
|
query,
|
|
98
102
|
...(args ? { args } : {})
|
|
99
103
|
});
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { getDescendants } = require('./killProcessTree');
|
|
6
|
+
|
|
7
|
+
const CONFIG_DIR = path.join(require('os').homedir(), '.agx');
|
|
8
|
+
const HEARTBEAT_DIR = path.join(CONFIG_DIR, 'heartbeat');
|
|
9
|
+
|
|
10
|
+
class ProcessManager {
|
|
11
|
+
/** @type {Map<number, {proc: import('child_process').ChildProcess, label: string, spawnedAt: number, timeout: number|null, timeoutTimer: NodeJS.Timeout|null, lastActivity: number}>} */
|
|
12
|
+
#processes = new Map();
|
|
13
|
+
#heartbeatInterval = null;
|
|
14
|
+
#cleanupInstalled = false;
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
this.#ensureHeartbeatDir();
|
|
18
|
+
this.#installCleanupHooks();
|
|
19
|
+
this.#startHeartbeatMonitor();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#ensureHeartbeatDir() {
|
|
23
|
+
try {
|
|
24
|
+
if (!fs.existsSync(HEARTBEAT_DIR)) {
|
|
25
|
+
fs.mkdirSync(HEARTBEAT_DIR, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
} catch { }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Register a spawned child process for tracking.
|
|
32
|
+
* @param {import('child_process').ChildProcess} proc
|
|
33
|
+
* @param {object} opts
|
|
34
|
+
* @param {string} [opts.label]
|
|
35
|
+
* @param {number} [opts.timeoutMs] - Hard timeout; kills process after this many ms.
|
|
36
|
+
* @param {boolean} [opts.heartbeat=true] - Enable activity-based heartbeat monitoring.
|
|
37
|
+
* @returns {import('child_process').ChildProcess}
|
|
38
|
+
*/
|
|
39
|
+
register(proc, opts = {}) {
|
|
40
|
+
const pid = proc.pid;
|
|
41
|
+
if (!pid) return proc;
|
|
42
|
+
|
|
43
|
+
const timeoutMs = opts.timeoutMs ?? (process.env.AGX_TASK_TIMEOUT_MS ? Number(process.env.AGX_TASK_TIMEOUT_MS) : null);
|
|
44
|
+
const now = Date.now();
|
|
45
|
+
|
|
46
|
+
const entry = {
|
|
47
|
+
proc,
|
|
48
|
+
label: opts.label || `pid-${pid}`,
|
|
49
|
+
spawnedAt: now,
|
|
50
|
+
lastActivity: now,
|
|
51
|
+
timeout: timeoutMs,
|
|
52
|
+
timeoutTimer: null,
|
|
53
|
+
heartbeat: opts.heartbeat !== false,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Hard timeout
|
|
57
|
+
if (timeoutMs && Number.isFinite(timeoutMs) && timeoutMs > 0) {
|
|
58
|
+
entry.timeoutTimer = setTimeout(() => {
|
|
59
|
+
if (this.#processes.has(pid)) {
|
|
60
|
+
this.kill(pid);
|
|
61
|
+
}
|
|
62
|
+
}, timeoutMs);
|
|
63
|
+
entry.timeoutTimer.unref();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
this.#processes.set(pid, entry);
|
|
67
|
+
|
|
68
|
+
// Auto-remove on exit
|
|
69
|
+
proc.on('exit', () => {
|
|
70
|
+
this.#cleanup(pid);
|
|
71
|
+
});
|
|
72
|
+
proc.on('error', () => {
|
|
73
|
+
this.#cleanup(pid);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return proc;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Record activity for a tracked process (extends heartbeat).
|
|
81
|
+
*/
|
|
82
|
+
recordActivity(pid) {
|
|
83
|
+
const entry = this.#processes.get(pid);
|
|
84
|
+
if (entry) {
|
|
85
|
+
entry.lastActivity = Date.now();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Kill a tracked process and its entire tree.
|
|
91
|
+
*/
|
|
92
|
+
kill(pid, { signal = 'SIGTERM', graceMs = 2000 } = {}) {
|
|
93
|
+
const descendants = getDescendants(pid);
|
|
94
|
+
// Kill bottom-up (leaves first)
|
|
95
|
+
for (let i = descendants.length - 1; i >= 0; i--) {
|
|
96
|
+
try { process.kill(descendants[i], signal); } catch { }
|
|
97
|
+
}
|
|
98
|
+
try { process.kill(pid, signal); } catch { }
|
|
99
|
+
|
|
100
|
+
// Schedule SIGKILL escalation
|
|
101
|
+
if (signal !== 'SIGKILL') {
|
|
102
|
+
const timer = setTimeout(() => {
|
|
103
|
+
for (let i = descendants.length - 1; i >= 0; i--) {
|
|
104
|
+
try { process.kill(descendants[i], 'SIGKILL'); } catch { }
|
|
105
|
+
}
|
|
106
|
+
try { process.kill(pid, 'SIGKILL'); } catch { }
|
|
107
|
+
}, graceMs);
|
|
108
|
+
timer.unref();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
this.#cleanup(pid);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Kill all tracked processes.
|
|
116
|
+
*/
|
|
117
|
+
killAll() {
|
|
118
|
+
for (const pid of [...this.#processes.keys()]) {
|
|
119
|
+
this.kill(pid);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#cleanup(pid) {
|
|
124
|
+
const entry = this.#processes.get(pid);
|
|
125
|
+
if (!entry) return;
|
|
126
|
+
if (entry.timeoutTimer) clearTimeout(entry.timeoutTimer);
|
|
127
|
+
this.#processes.delete(pid);
|
|
128
|
+
// Clean heartbeat file
|
|
129
|
+
try { fs.unlinkSync(path.join(HEARTBEAT_DIR, String(pid))); } catch { }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#startHeartbeatMonitor() {
|
|
133
|
+
const STALE_THRESHOLD_MS = 120_000; // 2 minutes
|
|
134
|
+
const CHECK_INTERVAL_MS = 60_000; // 1 minute
|
|
135
|
+
|
|
136
|
+
this.#heartbeatInterval = setInterval(() => {
|
|
137
|
+
const now = Date.now();
|
|
138
|
+
for (const [pid, entry] of this.#processes) {
|
|
139
|
+
if (!entry.heartbeat) continue;
|
|
140
|
+
if (now - entry.lastActivity > STALE_THRESHOLD_MS) {
|
|
141
|
+
console.error(`[ProcessManager] Process ${pid} (${entry.label}) stale for >${Math.round((now - entry.lastActivity) / 1000)}s — killing`);
|
|
142
|
+
this.kill(pid);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, CHECK_INTERVAL_MS);
|
|
146
|
+
this.#heartbeatInterval.unref();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
#installCleanupHooks() {
|
|
150
|
+
if (this.#cleanupInstalled) return;
|
|
151
|
+
this.#cleanupInstalled = true;
|
|
152
|
+
|
|
153
|
+
const cleanup = () => {
|
|
154
|
+
if (this.#heartbeatInterval) {
|
|
155
|
+
clearInterval(this.#heartbeatInterval);
|
|
156
|
+
this.#heartbeatInterval = null;
|
|
157
|
+
}
|
|
158
|
+
this.killAll();
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
process.on('exit', cleanup);
|
|
162
|
+
process.on('SIGINT', () => { cleanup(); process.exit(130); });
|
|
163
|
+
process.on('SIGTERM', () => { cleanup(); process.exit(143); });
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sweep orphaned heartbeat files whose PIDs no longer exist.
|
|
168
|
+
*/
|
|
169
|
+
sweepOrphanedHeartbeats() {
|
|
170
|
+
try {
|
|
171
|
+
const files = fs.readdirSync(HEARTBEAT_DIR);
|
|
172
|
+
for (const file of files) {
|
|
173
|
+
const pid = parseInt(file, 10);
|
|
174
|
+
if (!Number.isFinite(pid)) continue;
|
|
175
|
+
try {
|
|
176
|
+
process.kill(pid, 0);
|
|
177
|
+
} catch {
|
|
178
|
+
// Process doesn't exist, clean up
|
|
179
|
+
try { fs.unlinkSync(path.join(HEARTBEAT_DIR, file)); } catch { }
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
} catch { }
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
get tracked() {
|
|
186
|
+
return this.#processes.size;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Singleton
|
|
191
|
+
let _instance;
|
|
192
|
+
function getProcessManager() {
|
|
193
|
+
if (!_instance) _instance = new ProcessManager();
|
|
194
|
+
return _instance;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
module.exports = { ProcessManager, getProcessManager };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const execa = require('execa');
|
|
2
2
|
|
|
3
3
|
// Check if a command exists on PATH
|
|
4
4
|
function commandExists(cmd) {
|
|
5
5
|
try {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const tool = process.platform === 'win32' ? 'where' : 'which';
|
|
7
|
+
const res = execa.sync(tool, [cmd], { stdio: 'ignore', reject: false });
|
|
8
|
+
return res.exitCode === 0;
|
|
8
9
|
} catch {
|
|
9
10
|
return false;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
module.exports = { commandExists };
|
|
14
|
-
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const execa = require('execa');
|
|
4
|
+
|
|
5
|
+
function isPidAlive(pid) {
|
|
6
|
+
if (!pid || typeof pid !== 'number' || !Number.isFinite(pid) || pid <= 0) return false;
|
|
7
|
+
try {
|
|
8
|
+
process.kill(pid, 0);
|
|
9
|
+
return true;
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get all descendant PIDs of a process using `ps -o pid=,ppid= -ax`.
|
|
17
|
+
* Returns descendants in bottom-up order (leaves first).
|
|
18
|
+
*/
|
|
19
|
+
function getDescendants(rootPid) {
|
|
20
|
+
if (process.platform === 'win32') return [];
|
|
21
|
+
try {
|
|
22
|
+
const output = execa.sync('ps', ['-o', 'pid=,ppid=', '-ax'], {
|
|
23
|
+
encoding: 'utf8',
|
|
24
|
+
timeout: 3000,
|
|
25
|
+
reject: false,
|
|
26
|
+
}).stdout || '';
|
|
27
|
+
const children = new Map();
|
|
28
|
+
for (const line of output.trim().split('\n')) {
|
|
29
|
+
const parts = line.trim().split(/\s+/);
|
|
30
|
+
if (parts.length < 2) continue;
|
|
31
|
+
const pid = parseInt(parts[0], 10);
|
|
32
|
+
const ppid = parseInt(parts[1], 10);
|
|
33
|
+
if (!Number.isFinite(pid) || !Number.isFinite(ppid)) continue;
|
|
34
|
+
if (!children.has(ppid)) children.set(ppid, []);
|
|
35
|
+
children.get(ppid).push(pid);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// BFS to collect all descendants, then reverse for bottom-up order
|
|
39
|
+
const result = [];
|
|
40
|
+
const queue = [rootPid];
|
|
41
|
+
while (queue.length) {
|
|
42
|
+
const parent = queue.shift();
|
|
43
|
+
const kids = children.get(parent);
|
|
44
|
+
if (!kids) continue;
|
|
45
|
+
for (const kid of kids) {
|
|
46
|
+
if (kid !== rootPid) {
|
|
47
|
+
result.push(kid);
|
|
48
|
+
queue.push(kid);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result.reverse(); // leaves first
|
|
53
|
+
} catch {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function tryKillPid(pid, signal) {
|
|
59
|
+
try {
|
|
60
|
+
process.kill(pid, signal);
|
|
61
|
+
return true;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
if (err && err.code === 'ESRCH') return false;
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function tryKillUnixProcessGroup(pid, signal) {
|
|
69
|
+
try {
|
|
70
|
+
process.kill(-pid, signal);
|
|
71
|
+
return true;
|
|
72
|
+
} catch (err) {
|
|
73
|
+
if (err && err.code === 'ESRCH') return false;
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function tryTaskkillWindows(pid, force) {
|
|
79
|
+
try {
|
|
80
|
+
const args = ['/pid', String(pid), '/T'];
|
|
81
|
+
if (force) args.push('/F');
|
|
82
|
+
const res = execa.sync('taskkill', args, { stdio: 'ignore', timeout: 3000, reject: false });
|
|
83
|
+
return res.exitCode === 0;
|
|
84
|
+
} catch {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Kill the entire process tree rooted at `pid`.
|
|
91
|
+
* Uses ps-based descendant enumeration for reliable tree killing,
|
|
92
|
+
* with process group kill as fallback.
|
|
93
|
+
*/
|
|
94
|
+
function tryKillTree(pid, signal) {
|
|
95
|
+
if (!pid) return false;
|
|
96
|
+
|
|
97
|
+
if (process.platform === 'win32') {
|
|
98
|
+
return tryTaskkillWindows(pid, signal === 'SIGKILL' || signal === 'SIGTERM');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Enumerate descendants and kill bottom-up (leaves first)
|
|
102
|
+
const descendants = getDescendants(pid);
|
|
103
|
+
let killed = false;
|
|
104
|
+
|
|
105
|
+
for (const desc of descendants) {
|
|
106
|
+
if (tryKillPid(desc, signal)) killed = true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Kill root — try group first, then individual
|
|
110
|
+
if (tryKillUnixProcessGroup(pid, signal)) {
|
|
111
|
+
killed = true;
|
|
112
|
+
} else if (tryKillPid(pid, signal)) {
|
|
113
|
+
killed = true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return killed;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function scheduleTermination(pid, { graceMs = 800, forceMs = 2500 } = {}) {
|
|
120
|
+
if (!pid) return { cancel: () => { } };
|
|
121
|
+
|
|
122
|
+
if (isPidAlive(pid)) {
|
|
123
|
+
tryKillTree(pid, 'SIGTERM');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
let killTimer = null;
|
|
127
|
+
let forceTimer = null;
|
|
128
|
+
|
|
129
|
+
killTimer = setTimeout(() => {
|
|
130
|
+
if (!isPidAlive(pid)) return;
|
|
131
|
+
tryKillTree(pid, 'SIGKILL');
|
|
132
|
+
}, Math.max(0, graceMs));
|
|
133
|
+
|
|
134
|
+
forceTimer = setTimeout(() => {
|
|
135
|
+
if (!isPidAlive(pid)) return;
|
|
136
|
+
tryKillTree(pid, 'SIGKILL');
|
|
137
|
+
}, Math.max(0, forceMs));
|
|
138
|
+
|
|
139
|
+
try { killTimer.unref(); } catch { }
|
|
140
|
+
try { forceTimer.unref(); } catch { }
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
cancel: () => {
|
|
144
|
+
if (killTimer) clearTimeout(killTimer);
|
|
145
|
+
if (forceTimer) clearTimeout(forceTimer);
|
|
146
|
+
killTimer = null;
|
|
147
|
+
forceTimer = null;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
module.exports = {
|
|
153
|
+
isPidAlive,
|
|
154
|
+
tryKillTree,
|
|
155
|
+
scheduleTermination,
|
|
156
|
+
getDescendants,
|
|
157
|
+
};
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
const
|
|
1
|
+
const execa = require('execa');
|
|
2
2
|
const { commandExists } = require('./commandExists');
|
|
3
|
+
const { getProcessManager } = require('./ProcessManager');
|
|
3
4
|
|
|
4
5
|
function spawnCloudTaskProcess(childArgs, options = {}) {
|
|
5
|
-
|
|
6
|
+
// A PTY wrapper (`script`) tends to inject control characters and can explode log churn
|
|
7
|
+
// when stdout is streamed back into cloud task content. Only enable when explicitly requested.
|
|
8
|
+
const useScriptTty = options.tty === true && commandExists('script');
|
|
6
9
|
const spawnCmd = useScriptTty ? 'script' : process.execPath;
|
|
7
10
|
const spawnArgs = useScriptTty
|
|
8
11
|
? ['-q', '/dev/null', process.execPath, ...childArgs]
|
|
9
12
|
: childArgs;
|
|
10
|
-
|
|
13
|
+
|
|
14
|
+
// Put spawned tasks in their own process group so we can reliably terminate the whole tree
|
|
15
|
+
// (handles grandchild processes started by providers).
|
|
16
|
+
const detachedDefault = process.platform !== 'win32';
|
|
17
|
+
const env = {
|
|
18
|
+
...process.env,
|
|
19
|
+
...(options.env || {}),
|
|
20
|
+
// Child can self-terminate if the parent crashes, preventing orphaned processes.
|
|
21
|
+
AGX_PARENT_PID: String(process.pid),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const { timeoutMs, heartbeat, label, ...spawnOpts } = options;
|
|
25
|
+
|
|
26
|
+
const child = execa(spawnCmd, spawnArgs, {
|
|
11
27
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
12
|
-
|
|
28
|
+
detached: spawnOpts.detached ?? detachedDefault,
|
|
29
|
+
env,
|
|
30
|
+
reject: false,
|
|
31
|
+
...spawnOpts,
|
|
13
32
|
});
|
|
33
|
+
|
|
34
|
+
// Register with ProcessManager for tracking, heartbeat, and cleanup
|
|
35
|
+
getProcessManager().register(child, {
|
|
36
|
+
label: label || childArgs.join(' ').slice(0, 80),
|
|
37
|
+
timeoutMs,
|
|
38
|
+
heartbeat: heartbeat !== false,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return child;
|
|
14
42
|
}
|
|
15
43
|
|
|
16
44
|
module.exports = { spawnCloudTaskProcess };
|
|
17
|
-
|
package/lib/prompts/cloudTask.js
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
function stripMarkdownSection(markdown, heading) {
|
|
2
|
+
if (!markdown) return '';
|
|
3
|
+
const h = String(heading || '').trim();
|
|
4
|
+
if (!h) return String(markdown || '');
|
|
5
|
+
|
|
6
|
+
// Remove "## Heading ... until next ##" blocks to prevent prompt self-reinforcement
|
|
7
|
+
// when agent output is persisted into the task content.
|
|
8
|
+
const sectionRegex = new RegExp(
|
|
9
|
+
`^##\\s+${h.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}\\s*$[\\s\\S]*?(?=^##\\s+|\\Z)`,
|
|
10
|
+
'gim'
|
|
11
|
+
);
|
|
12
|
+
return String(markdown || '').replace(sectionRegex, '').trim();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function collapseBlankLines(text) {
|
|
16
|
+
return String(text || '').replace(/\n{3,}/g, '\n\n').trim();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function sanitizeTaskContentForPrompt(content) {
|
|
20
|
+
// Critical: don't inline the continuously-updated sections (Output/Error) into the prompt.
|
|
21
|
+
// Otherwise every iteration includes prior agent output, which tends to explode the context.
|
|
22
|
+
let out = String(content || '').replace(/\r/g, '');
|
|
23
|
+
|
|
24
|
+
// First, drop known noisy sections if present.
|
|
25
|
+
out = stripMarkdownSection(out, 'Output');
|
|
26
|
+
out = stripMarkdownSection(out, 'Error');
|
|
27
|
+
out = stripMarkdownSection(out, 'Cloud Task Context');
|
|
28
|
+
out = stripMarkdownSection(out, 'Extracted State');
|
|
29
|
+
out = stripMarkdownSection(out, 'Instructions');
|
|
30
|
+
|
|
31
|
+
// Then, keep only the preamble (everything before the first "##" heading).
|
|
32
|
+
// Task bodies are expected to keep the user-facing request up top, with
|
|
33
|
+
// derived/agent/system sections below.
|
|
34
|
+
const firstSubheading = out.search(/^##\s+/m);
|
|
35
|
+
if (firstSubheading !== -1) {
|
|
36
|
+
out = out.slice(0, firstSubheading);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hard cap to avoid accidental large prompts from corrupted content.
|
|
40
|
+
const MAX_CHARS = 8000;
|
|
41
|
+
if (out.length > MAX_CHARS) out = out.slice(0, MAX_CHARS);
|
|
42
|
+
return collapseBlankLines(out);
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
function buildContinueCloudTaskPrompt({
|
|
2
46
|
task,
|
|
3
47
|
taskComments,
|
|
@@ -5,11 +49,15 @@ function buildContinueCloudTaskPrompt({
|
|
|
5
49
|
stagePrompt,
|
|
6
50
|
stageRequirement,
|
|
7
51
|
extracted,
|
|
52
|
+
runContext,
|
|
8
53
|
}) {
|
|
9
54
|
const plan = extracted?.plan || '';
|
|
10
55
|
const todo = extracted?.todo || '';
|
|
11
56
|
const checkpoints = extracted?.checkpoints || '';
|
|
12
57
|
const learnings = extracted?.learnings || '';
|
|
58
|
+
const runRoot = typeof runContext?.run_root === 'string' ? runContext.run_root.trim() : '';
|
|
59
|
+
const planDir = typeof runContext?.plan_dir === 'string' ? runContext.plan_dir.trim() : '';
|
|
60
|
+
const artifactsDir = typeof runContext?.artifacts_dir === 'string' ? runContext.artifacts_dir.trim() : '';
|
|
13
61
|
|
|
14
62
|
let augmentedPrompt = task?.prompt || `## Cloud Task Context
|
|
15
63
|
|
|
@@ -21,14 +69,14 @@ Stage: ${task.stage || 'ideation'}
|
|
|
21
69
|
Stage Objective: ${stagePrompt}
|
|
22
70
|
Stage Completion Requirement: ${stageRequirement}
|
|
23
71
|
|
|
24
|
-
User Request:
|
|
25
|
-
"""
|
|
26
|
-
${task?.title}
|
|
27
|
-
${task?.content}
|
|
28
|
-
---
|
|
29
|
-
Task Thread:
|
|
30
|
-
${(taskComments || []).map(c => `${c.author}: ${c.content}`).join('\n')}
|
|
31
|
-
"""
|
|
72
|
+
User Request:
|
|
73
|
+
"""
|
|
74
|
+
${task?.title}
|
|
75
|
+
${sanitizeTaskContentForPrompt(task?.content)}
|
|
76
|
+
---
|
|
77
|
+
Task Thread:
|
|
78
|
+
${(taskComments || []).map(c => `${c.author}: ${c.content}`).join('\n')}
|
|
79
|
+
"""
|
|
32
80
|
|
|
33
81
|
## Extracted State
|
|
34
82
|
|
|
@@ -50,6 +98,8 @@ Learnings: ${learnings || '(none)'}
|
|
|
50
98
|
Continue working on this task. Use the cloud API to sync progress.
|
|
51
99
|
Respect the Stage Completion Requirement before using [complete] or [done].
|
|
52
100
|
|
|
101
|
+
${(runRoot || planDir || artifactsDir) ? `\nLocal run paths (scratch space):\n- Run root: ${runRoot || '(unset)'}\n- Plan dir: ${planDir || '(unset)'}\n- Artifacts dir: ${artifactsDir || '(unset)'}\n\nPrefer writing scratch planning docs under the run's Plan dir to avoid polluting the repo.\n` : ''}
|
|
102
|
+
|
|
53
103
|
To update the task:
|
|
54
104
|
- [done] - Mark task complete
|
|
55
105
|
- [complete: message] - Complete current stage
|
|
@@ -74,20 +124,20 @@ function buildNewAutonomousCloudTaskPrompt({
|
|
|
74
124
|
}) {
|
|
75
125
|
return `## Cloud Task Context
|
|
76
126
|
|
|
77
|
-
Task ID: ${task.id}
|
|
78
|
-
Title: ${task.title || finalPrompt}
|
|
79
|
-
Stage: ${task.stage}
|
|
80
|
-
Stage Objective: ${stagePrompt}
|
|
81
|
-
Stage Completion Requirement: ${stageRequirement}
|
|
82
|
-
|
|
83
|
-
User Request:
|
|
84
|
-
"""
|
|
85
|
-
${task?.title}
|
|
86
|
-
${task?.content}
|
|
87
|
-
---
|
|
88
|
-
Task Thread:
|
|
89
|
-
${(taskComments || []).map(c => `${c.author}: ${c.content}`).join('\n')}
|
|
90
|
-
"""
|
|
127
|
+
Task ID: ${task.id}
|
|
128
|
+
Title: ${task.title || finalPrompt}
|
|
129
|
+
Stage: ${task.stage}
|
|
130
|
+
Stage Objective: ${stagePrompt}
|
|
131
|
+
Stage Completion Requirement: ${stageRequirement}
|
|
132
|
+
|
|
133
|
+
User Request:
|
|
134
|
+
"""
|
|
135
|
+
${task?.title}
|
|
136
|
+
${sanitizeTaskContentForPrompt(task?.content)}
|
|
137
|
+
---
|
|
138
|
+
Task Thread:
|
|
139
|
+
${(taskComments || []).map(c => `${c.author}: ${c.content}`).join('\n')}
|
|
140
|
+
"""
|
|
91
141
|
|
|
92
142
|
---
|
|
93
143
|
|
|
@@ -109,4 +159,3 @@ module.exports = {
|
|
|
109
159
|
buildContinueCloudTaskPrompt,
|
|
110
160
|
buildNewAutonomousCloudTaskPrompt,
|
|
111
161
|
};
|
|
112
|
-
|
package/lib/storage/paths.js
CHANGED
|
@@ -362,6 +362,8 @@ function runPaths(projectSlug, taskSlug, stage, runId) {
|
|
|
362
362
|
output: path.join(root, 'output.md'),
|
|
363
363
|
decision: path.join(root, 'decision.json'),
|
|
364
364
|
events: path.join(root, 'events.ndjson'),
|
|
365
|
+
// Scratch space for agents that want a stable "plan/" folder without polluting the repo.
|
|
366
|
+
plan: path.join(root, 'plan'),
|
|
365
367
|
artifacts: path.join(root, 'artifacts'),
|
|
366
368
|
logs: path.join(root, 'artifacts', 'logs.txt'),
|
|
367
369
|
diff: path.join(root, 'artifacts', 'diff.patch'),
|
|
@@ -383,6 +385,7 @@ function runPathsLegacy(projectSlug, taskSlug, stage, runId) {
|
|
|
383
385
|
output: path.join(root, 'output.md'),
|
|
384
386
|
decision: path.join(root, 'decision.json'),
|
|
385
387
|
events: path.join(root, 'events.ndjson'),
|
|
388
|
+
plan: path.join(root, 'plan'),
|
|
386
389
|
artifacts: path.join(root, 'artifacts'),
|
|
387
390
|
logs: path.join(root, 'artifacts', 'logs.txt'),
|
|
388
391
|
diff: path.join(root, 'artifacts', 'diff.patch'),
|
package/lib/storage/runs.js
CHANGED
|
@@ -108,6 +108,7 @@ async function createRun({ projectSlug, taskSlug, stage, runId: explicitRunId, e
|
|
|
108
108
|
|
|
109
109
|
// Create run directory
|
|
110
110
|
await ensureDir(paths.root);
|
|
111
|
+
await ensureDir(paths.plan);
|
|
111
112
|
await ensureDir(paths.artifacts);
|
|
112
113
|
|
|
113
114
|
// If run already exists, return handle to existing run (idempotent)
|