@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
package/lib/cli/cloud/command.js
CHANGED
|
@@ -14,6 +14,8 @@ function createCloudCommandHelpers(env) {
|
|
|
14
14
|
extractCancellationReason,
|
|
15
15
|
CancellationRequestedError,
|
|
16
16
|
CANCELLED_ERROR_CODE,
|
|
17
|
+
scheduleTermination,
|
|
18
|
+
getProcessManager,
|
|
17
19
|
} = env || {};
|
|
18
20
|
|
|
19
21
|
async function updateCloudTask(taskId, updates) {
|
|
@@ -48,12 +50,17 @@ function createCloudCommandHelpers(env) {
|
|
|
48
50
|
let stdoutTail = '';
|
|
49
51
|
let stderrTail = '';
|
|
50
52
|
let settled = false;
|
|
53
|
+
let killHandle = null;
|
|
51
54
|
|
|
52
55
|
const childArgs = sanitizeCliArgs([process.argv[1], ...args]);
|
|
53
56
|
logExecutionFlow('runAgxCommand', 'input', `label=${label}, args=${childArgs.join(' ')}, timeout=${timeoutMs}`);
|
|
54
57
|
const cancellationWatcher = handlers.cancellationWatcher || null;
|
|
55
|
-
const child = spawnCloudTaskProcess(childArgs
|
|
58
|
+
const child = spawnCloudTaskProcess(childArgs, {
|
|
59
|
+
cwd: handlers.cwd,
|
|
60
|
+
env: handlers.env,
|
|
61
|
+
});
|
|
56
62
|
logExecutionFlow('runAgxCommand', 'processing', `spawning child process (pid: ${child.pid})`);
|
|
63
|
+
const childPid = child?.pid || null;
|
|
57
64
|
|
|
58
65
|
const controller = new AbortController();
|
|
59
66
|
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
@@ -91,16 +98,19 @@ function createCloudCommandHelpers(env) {
|
|
|
91
98
|
}
|
|
92
99
|
};
|
|
93
100
|
|
|
101
|
+
const killChild = () => {
|
|
102
|
+
if (!childPid) return;
|
|
103
|
+
if (killHandle) return;
|
|
104
|
+
try {
|
|
105
|
+
killHandle = scheduleTermination(childPid, { graceMs: 800, forceMs: 2500 });
|
|
106
|
+
} catch { }
|
|
107
|
+
};
|
|
108
|
+
|
|
94
109
|
const handleCancellation = (payload) => {
|
|
95
110
|
if (settled) return;
|
|
96
111
|
settled = true;
|
|
97
112
|
clearTimeout(timeout);
|
|
98
|
-
|
|
99
|
-
child.kill('SIGTERM');
|
|
100
|
-
setTimeout(() => {
|
|
101
|
-
child.kill('SIGKILL');
|
|
102
|
-
}, 500);
|
|
103
|
-
}
|
|
113
|
+
killChild();
|
|
104
114
|
const reason = extractCancellationReason(payload) || 'Cancelled by operator';
|
|
105
115
|
const err = new CancellationRequestedError(reason);
|
|
106
116
|
err.code = CANCELLED_ERROR_CODE;
|
|
@@ -132,7 +142,7 @@ function createCloudCommandHelpers(env) {
|
|
|
132
142
|
controller.signal.addEventListener('abort', () => {
|
|
133
143
|
if (settled) return;
|
|
134
144
|
settled = true;
|
|
135
|
-
|
|
145
|
+
killChild();
|
|
136
146
|
const err = new Error(`${label || 'command'} timed out`);
|
|
137
147
|
err.code = 'ETIMEDOUT';
|
|
138
148
|
clearTimeout(timeout);
|
|
@@ -154,16 +164,20 @@ function createCloudCommandHelpers(env) {
|
|
|
154
164
|
reject(err);
|
|
155
165
|
});
|
|
156
166
|
|
|
167
|
+
const pm = typeof getProcessManager === 'function' ? getProcessManager() : null;
|
|
168
|
+
|
|
157
169
|
child.stdout.on('data', (data) => {
|
|
158
170
|
const chunk = data.toString();
|
|
159
171
|
stdout += chunk;
|
|
160
172
|
stdoutTail = appendTail(stdoutTail, chunk);
|
|
173
|
+
if (pm && childPid) pm.recordActivity(childPid);
|
|
161
174
|
if (handlers.onStdout) handlers.onStdout(data);
|
|
162
175
|
});
|
|
163
176
|
child.stderr.on('data', (data) => {
|
|
164
177
|
const chunk = data.toString();
|
|
165
178
|
stderr += chunk;
|
|
166
179
|
stderrTail = appendTail(stderrTail, chunk);
|
|
180
|
+
if (pm && childPid) pm.recordActivity(childPid);
|
|
167
181
|
if (handlers.onStderr) handlers.onStderr(data);
|
|
168
182
|
});
|
|
169
183
|
|
|
@@ -187,6 +201,7 @@ function createCloudCommandHelpers(env) {
|
|
|
187
201
|
error: err?.message || String(err),
|
|
188
202
|
});
|
|
189
203
|
cleanupCancellation();
|
|
204
|
+
try { killHandle?.cancel?.(); } catch { }
|
|
190
205
|
reject(err);
|
|
191
206
|
});
|
|
192
207
|
|
|
@@ -200,7 +215,7 @@ function createCloudCommandHelpers(env) {
|
|
|
200
215
|
phase: 'exit',
|
|
201
216
|
label,
|
|
202
217
|
args: childArgs,
|
|
203
|
-
pid:
|
|
218
|
+
pid: childPid,
|
|
204
219
|
timeout_ms: timeoutMs,
|
|
205
220
|
started_at: startedAtIso,
|
|
206
221
|
finished_at: new Date().toISOString(),
|
|
@@ -210,6 +225,7 @@ function createCloudCommandHelpers(env) {
|
|
|
210
225
|
stderr_tail: truncateForTemporalTrace(stderrTail),
|
|
211
226
|
});
|
|
212
227
|
cleanupCancellation();
|
|
228
|
+
try { killHandle?.cancel?.(); } catch { }
|
|
213
229
|
if (code === 0) {
|
|
214
230
|
resolve({ stdout, stderr, code });
|
|
215
231
|
} else {
|
|
@@ -227,4 +243,3 @@ function createCloudCommandHelpers(env) {
|
|
|
227
243
|
}
|
|
228
244
|
|
|
229
245
|
module.exports = { createCloudCommandHelpers };
|
|
230
|
-
|
|
@@ -33,6 +33,8 @@ function createCloudExecuteVerifySingle(env) {
|
|
|
33
33
|
buildNextPromptWithDecisionContext,
|
|
34
34
|
} = env || {};
|
|
35
35
|
|
|
36
|
+
const baseProcEnv = typeof process !== 'undefined' && process.env ? process.env : {};
|
|
37
|
+
|
|
36
38
|
async function runSingleAgentExecuteVerifyLoop({ taskId, task, provider, model, logger, storage, projectSlug, taskSlug, stageLocal, initialPromptContext, cancellationWatcher }) {
|
|
37
39
|
logExecutionFlow('runSingleAgentExecuteVerifyLoop', 'input', `taskId=${taskId}, provider=${provider}, model=${model}`);
|
|
38
40
|
const stageKey = task?.stage || 'unknown';
|
|
@@ -75,12 +77,19 @@ function createCloudExecuteVerifySingle(env) {
|
|
|
75
77
|
const executePrompt = buildExecuteIterationPrompt(nextPrompt, iteration);
|
|
76
78
|
let output = '';
|
|
77
79
|
try {
|
|
80
|
+
const runEnv = {
|
|
81
|
+
...baseProcEnv,
|
|
82
|
+
AGX_RUN_ROOT: executeRun?.paths?.root || '',
|
|
83
|
+
AGX_RUN_PLAN_DIR: executeRun?.paths?.plan || '',
|
|
84
|
+
AGX_RUN_ARTIFACTS_DIR: executeRun?.paths?.artifacts || '',
|
|
85
|
+
};
|
|
78
86
|
output = await runSingleAgentIteration({
|
|
79
87
|
taskId,
|
|
80
88
|
task,
|
|
81
89
|
provider,
|
|
82
90
|
model,
|
|
83
91
|
prompt: executePrompt,
|
|
92
|
+
env: runEnv,
|
|
84
93
|
logger,
|
|
85
94
|
onStdout: (chunk) => {
|
|
86
95
|
try { execStdoutStream?.write(chunk.toString()); } catch { }
|
|
@@ -155,8 +164,15 @@ function createCloudExecuteVerifySingle(env) {
|
|
|
155
164
|
|
|
156
165
|
let verifyRes;
|
|
157
166
|
try {
|
|
167
|
+
const verifyEnv = {
|
|
168
|
+
...baseProcEnv,
|
|
169
|
+
AGX_RUN_ROOT: verifyRun?.paths?.root || '',
|
|
170
|
+
AGX_RUN_PLAN_DIR: verifyRun?.paths?.plan || '',
|
|
171
|
+
AGX_RUN_ARTIFACTS_DIR: verifyRun?.paths?.artifacts || '',
|
|
172
|
+
};
|
|
158
173
|
verifyRes = await pRetryFn(
|
|
159
174
|
() => runAgxCommand(verifyArgs, VERIFY_TIMEOUT_MS, `agx ${provider} verify`, {
|
|
175
|
+
env: verifyEnv,
|
|
160
176
|
onStdout: (data) => {
|
|
161
177
|
try { verifyStdoutStream?.write(data.toString()); } catch { }
|
|
162
178
|
logger?.log('checkpoint', data);
|
|
@@ -34,6 +34,8 @@ function createCloudExecuteVerifySwarm(env) {
|
|
|
34
34
|
buildNextPromptWithDecisionContext,
|
|
35
35
|
} = env || {};
|
|
36
36
|
|
|
37
|
+
const baseProcEnv = typeof process !== 'undefined' && process.env ? process.env : {};
|
|
38
|
+
|
|
37
39
|
async function runSwarmExecuteVerifyLoop({ taskId, task, logger, storage, projectSlug, taskSlug, stageLocal, initialPromptContext, cancellationWatcher }) {
|
|
38
40
|
logExecutionFlow('runSwarmExecuteVerifyLoop', 'input', `taskId=${taskId}`);
|
|
39
41
|
const stageKey = task?.stage || 'unknown';
|
|
@@ -77,10 +79,17 @@ function createCloudExecuteVerifySwarm(env) {
|
|
|
77
79
|
// EXECUTE (swarm iteration)
|
|
78
80
|
let results;
|
|
79
81
|
try {
|
|
82
|
+
const runEnv = {
|
|
83
|
+
...baseProcEnv,
|
|
84
|
+
AGX_RUN_ROOT: executeRun?.paths?.root || '',
|
|
85
|
+
AGX_RUN_PLAN_DIR: executeRun?.paths?.plan || '',
|
|
86
|
+
AGX_RUN_ARTIFACTS_DIR: executeRun?.paths?.artifacts || '',
|
|
87
|
+
};
|
|
80
88
|
results = await runSwarmIteration({
|
|
81
89
|
taskId,
|
|
82
90
|
task,
|
|
83
91
|
prompt: nextPrompt ? buildExecuteIterationPrompt(nextPrompt, iteration) : buildExecuteIterationPrompt('', iteration),
|
|
92
|
+
env: runEnv,
|
|
84
93
|
logger,
|
|
85
94
|
artifacts: executeArtifacts,
|
|
86
95
|
cancellationWatcher,
|
|
@@ -160,8 +169,15 @@ function createCloudExecuteVerifySwarm(env) {
|
|
|
160
169
|
let verifyRes;
|
|
161
170
|
try {
|
|
162
171
|
await abortIfCancelled(cancellationWatcher);
|
|
172
|
+
const verifyEnv = {
|
|
173
|
+
...baseProcEnv,
|
|
174
|
+
AGX_RUN_ROOT: verifyRun?.paths?.root || '',
|
|
175
|
+
AGX_RUN_PLAN_DIR: verifyRun?.paths?.plan || '',
|
|
176
|
+
AGX_RUN_ARTIFACTS_DIR: verifyRun?.paths?.artifacts || '',
|
|
177
|
+
};
|
|
163
178
|
verifyRes = await pRetryFn(
|
|
164
179
|
() => runAgxCommand(verifyArgs, VERIFY_TIMEOUT_MS, `agx ${verifierProvider} verify`, {
|
|
180
|
+
env: verifyEnv,
|
|
165
181
|
onStdout: (data) => {
|
|
166
182
|
try { verifyStdoutStream?.write(data.toString()); } catch { }
|
|
167
183
|
logger?.log('checkpoint', data);
|
|
@@ -16,7 +16,7 @@ function createCloudIterationHelpers(env) {
|
|
|
16
16
|
// Note: additional helpers (comments, artifacts) are handled by higher-level loops.
|
|
17
17
|
} = env || {};
|
|
18
18
|
|
|
19
|
-
async function runSwarmIteration({ taskId, task, prompt, logger, artifacts, cancellationWatcher, onProviderStdout, onProviderStderr }) {
|
|
19
|
+
async function runSwarmIteration({ taskId, task, prompt, logger, artifacts, cancellationWatcher, onProviderStdout, onProviderStderr, env, cwd }) {
|
|
20
20
|
logExecutionFlow('runSwarmIteration', 'input', `taskId=${taskId}, prompt=${Boolean(prompt)}`);
|
|
21
21
|
const swarmModels = Array.isArray(task?.swarm_models)
|
|
22
22
|
? task.swarm_models
|
|
@@ -54,6 +54,8 @@ function createCloudIterationHelpers(env) {
|
|
|
54
54
|
|
|
55
55
|
return pRetryFn(
|
|
56
56
|
() => runAgxCommand(args, SWARM_TIMEOUT_MS, `agx ${provider}`, {
|
|
57
|
+
env,
|
|
58
|
+
cwd,
|
|
57
59
|
onStdout: (data) => {
|
|
58
60
|
if (typeof onProviderStdout === 'function') onProviderStdout(provider, data);
|
|
59
61
|
logger?.log('output', data);
|
|
@@ -94,7 +96,7 @@ function createCloudIterationHelpers(env) {
|
|
|
94
96
|
return results;
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
async function runSingleAgentIteration({ taskId, task, provider, model, prompt, logger, onStdout, onStderr, artifacts, cancellationWatcher }) {
|
|
99
|
+
async function runSingleAgentIteration({ taskId, task, provider, model, prompt, logger, onStdout, onStderr, artifacts, cancellationWatcher, env, cwd }) {
|
|
98
100
|
logExecutionFlow('runSingleAgentIteration', 'input', `taskId=${taskId}, provider=${provider}, model=${model}, prompt=${Boolean(prompt) ? 'present' : 'none'}`);
|
|
99
101
|
logExecutionFlow('runSingleAgentIteration', 'processing', 'preparing runAgxCommand');
|
|
100
102
|
const args = [provider, '--cloud-task', taskId];
|
|
@@ -119,6 +121,8 @@ function createCloudIterationHelpers(env) {
|
|
|
119
121
|
await abortIfCancelled(cancellationWatcher);
|
|
120
122
|
const res = await pRetryFn(
|
|
121
123
|
() => runAgxCommand(args, SWARM_TIMEOUT_MS, `agx ${provider}`, {
|
|
124
|
+
env,
|
|
125
|
+
cwd,
|
|
122
126
|
onStdout: (data) => {
|
|
123
127
|
if (onStdout) onStdout(data);
|
|
124
128
|
logger?.log('output', data);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
function createCloudTaskHelpers(env) {
|
|
5
5
|
const {
|
|
6
6
|
loadCloudConfigFile,
|
|
7
|
+
loadConfig,
|
|
7
8
|
fetch,
|
|
8
9
|
logExecutionFlow,
|
|
9
10
|
postTaskLog,
|
|
@@ -12,6 +13,38 @@ function createCloudTaskHelpers(env) {
|
|
|
12
13
|
appendTail,
|
|
13
14
|
} = env || {};
|
|
14
15
|
|
|
16
|
+
function readTaskSectionSettings() {
|
|
17
|
+
// Prefer ~/.agx/config.json over env vars.
|
|
18
|
+
// Example:
|
|
19
|
+
// {
|
|
20
|
+
// "taskSectionUpdates": { "enabled": false, "flushMs": 2000 }
|
|
21
|
+
// }
|
|
22
|
+
const cfg = typeof loadConfig === 'function' ? loadConfig() : null;
|
|
23
|
+
const sectionCfg = cfg?.taskSectionUpdates || cfg?.daemon?.taskSectionUpdates || null;
|
|
24
|
+
|
|
25
|
+
const enabledFromConfig = typeof sectionCfg?.enabled === 'boolean' ? sectionCfg.enabled : null;
|
|
26
|
+
const flushMsFromConfig = Number.isFinite(Number(sectionCfg?.flushMs)) ? Number(sectionCfg.flushMs) : null;
|
|
27
|
+
|
|
28
|
+
// Back-compat: allow env override if set.
|
|
29
|
+
const enabledFromEnv = process.env.AGX_TASK_SECTION_UPDATES ? (String(process.env.AGX_TASK_SECTION_UPDATES) === '1') : null;
|
|
30
|
+
const flushMsFromEnv = process.env.AGX_TASK_SECTION_FLUSH_MS && Number.isFinite(Number(process.env.AGX_TASK_SECTION_FLUSH_MS))
|
|
31
|
+
? Number(process.env.AGX_TASK_SECTION_FLUSH_MS)
|
|
32
|
+
: null;
|
|
33
|
+
|
|
34
|
+
const enabled = enabledFromEnv ?? enabledFromConfig ?? false;
|
|
35
|
+
const flushMs = flushMsFromEnv ?? flushMsFromConfig ?? 2000;
|
|
36
|
+
return { enabled, flushMs };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function normalizeTailChunk(chunk) {
|
|
40
|
+
const text = Buffer.isBuffer(chunk) ? chunk.toString() : String(chunk || '');
|
|
41
|
+
// Reduce churn from TTY control sequences and carriage returns.
|
|
42
|
+
// This is only used for the small "tail" that gets PUT into task.content.
|
|
43
|
+
return text
|
|
44
|
+
.replace(/\r/g, '')
|
|
45
|
+
.replace(/\x1b\[[0-9;?]*[A-Za-z]/g, '');
|
|
46
|
+
}
|
|
47
|
+
|
|
15
48
|
async function patchTaskState(taskId, state) {
|
|
16
49
|
const cloudConfig = loadCloudConfigFile();
|
|
17
50
|
if (!cloudConfig?.apiUrl) return;
|
|
@@ -36,6 +69,7 @@ function createCloudTaskHelpers(env) {
|
|
|
36
69
|
}
|
|
37
70
|
|
|
38
71
|
function createTaskLogger(taskId) {
|
|
72
|
+
const { enabled: enableSectionUpdates, flushMs: sectionFlushMs } = readTaskSectionSettings();
|
|
39
73
|
const buffers = {
|
|
40
74
|
output: '',
|
|
41
75
|
error: '',
|
|
@@ -52,6 +86,14 @@ function createCloudTaskHelpers(env) {
|
|
|
52
86
|
system: null,
|
|
53
87
|
checkpoint: null
|
|
54
88
|
};
|
|
89
|
+
const sectionTimers = {
|
|
90
|
+
output: null,
|
|
91
|
+
error: null,
|
|
92
|
+
};
|
|
93
|
+
const lastSection = {
|
|
94
|
+
output: '',
|
|
95
|
+
error: '',
|
|
96
|
+
};
|
|
55
97
|
let updateChain = Promise.resolve();
|
|
56
98
|
|
|
57
99
|
const scheduleFlush = (type) => {
|
|
@@ -59,6 +101,37 @@ function createCloudTaskHelpers(env) {
|
|
|
59
101
|
timers[type] = setTimeout(() => flush(type), SWARM_LOG_FLUSH_MS);
|
|
60
102
|
};
|
|
61
103
|
|
|
104
|
+
const scheduleSectionUpdate = (type) => {
|
|
105
|
+
if (!enableSectionUpdates) return;
|
|
106
|
+
if (sectionTimers[type]) return;
|
|
107
|
+
sectionTimers[type] = setTimeout(() => {
|
|
108
|
+
sectionTimers[type] = null;
|
|
109
|
+
const heading = type === 'output' ? 'Output' : 'Error';
|
|
110
|
+
const next = tails[type] || '';
|
|
111
|
+
if (!next) return;
|
|
112
|
+
if (next === lastSection[type]) return;
|
|
113
|
+
lastSection[type] = next;
|
|
114
|
+
updateChain = updateChain.then(() => updateTaskSection(heading, next, 'replace'));
|
|
115
|
+
}, sectionFlushMs);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const flushSectionUpdates = async () => {
|
|
119
|
+
if (!enableSectionUpdates) return;
|
|
120
|
+
for (const type of ['output', 'error']) {
|
|
121
|
+
if (sectionTimers[type]) {
|
|
122
|
+
clearTimeout(sectionTimers[type]);
|
|
123
|
+
sectionTimers[type] = null;
|
|
124
|
+
}
|
|
125
|
+
const heading = type === 'output' ? 'Output' : 'Error';
|
|
126
|
+
const next = tails[type] || '';
|
|
127
|
+
if (!next) continue;
|
|
128
|
+
if (next === lastSection[type]) continue;
|
|
129
|
+
lastSection[type] = next;
|
|
130
|
+
updateChain = updateChain.then(() => updateTaskSection(heading, next, 'replace'));
|
|
131
|
+
}
|
|
132
|
+
await updateChain.catch(() => { });
|
|
133
|
+
};
|
|
134
|
+
|
|
62
135
|
const flush = async (type) => {
|
|
63
136
|
if (timers[type]) {
|
|
64
137
|
clearTimeout(timers[type]);
|
|
@@ -127,25 +200,22 @@ function createCloudTaskHelpers(env) {
|
|
|
127
200
|
const chunk = Buffer.isBuffer(data) ? data.toString() : String(data || '');
|
|
128
201
|
|
|
129
202
|
if (type === 'output' || type === 'error') {
|
|
130
|
-
tails[type] = appendTail(tails[type], chunk, SWARM_LOG_MAX_BYTES);
|
|
203
|
+
tails[type] = appendTail(tails[type], normalizeTailChunk(chunk), SWARM_LOG_MAX_BYTES);
|
|
131
204
|
buffers[type] += chunk;
|
|
132
205
|
} else {
|
|
133
206
|
buffers[type] += chunk;
|
|
134
207
|
}
|
|
135
208
|
|
|
136
|
-
// Keep the main task content updated with smaller tails (avoid huge PUT)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (type === 'error') {
|
|
141
|
-
updateChain = updateChain.then(() => updateTaskSection('Error', tails.error, 'replace'));
|
|
142
|
-
}
|
|
209
|
+
// Keep the main task content updated with smaller tails (avoid huge PUT),
|
|
210
|
+
// but debounce updates to avoid a PUT per output chunk.
|
|
211
|
+
if (type === 'output') scheduleSectionUpdate('output');
|
|
212
|
+
if (type === 'error') scheduleSectionUpdate('error');
|
|
143
213
|
|
|
144
214
|
scheduleFlush(type);
|
|
145
215
|
};
|
|
146
216
|
|
|
147
217
|
const flushAll = async () => {
|
|
148
|
-
await
|
|
218
|
+
await flushSectionUpdates();
|
|
149
219
|
await Promise.all(Object.keys(buffers).map((t) => flush(t)));
|
|
150
220
|
};
|
|
151
221
|
|
|
@@ -156,4 +226,3 @@ function createCloudTaskHelpers(env) {
|
|
|
156
226
|
}
|
|
157
227
|
|
|
158
228
|
module.exports = { createCloudTaskHelpers };
|
|
159
|
-
|
package/lib/cli/daemon.js
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const path = require('path');
|
|
7
|
-
const
|
|
7
|
+
const execa = require('execa');
|
|
8
8
|
|
|
9
9
|
const { c } = require('../ui/colors');
|
|
10
10
|
const { CONFIG_DIR, DAEMON_PID_FILE, DAEMON_LOG_FILE, DAEMON_STATE_FILE, TASK_LOGS_DIR, BOARD_PID_FILE, BOARD_LOG_FILE, BOARD_ENV_FILE } = require('../config/paths');
|
|
11
|
+
const { getDescendants } = require('../proc/killProcessTree');
|
|
11
12
|
const { prompt } = require('./configStore');
|
|
12
13
|
const { sleep } = require('./util');
|
|
13
14
|
|
|
@@ -100,13 +101,21 @@ async function stopDaemonProcessTree(pid, timeoutMs = 5000) {
|
|
|
100
101
|
const deadline = Date.now() + timeoutMs;
|
|
101
102
|
|
|
102
103
|
const killTree = (signal) => {
|
|
104
|
+
// Kill descendants bottom-up (leaves first) via ps enumeration
|
|
105
|
+
const descendants = getDescendants(pid);
|
|
106
|
+
for (let i = descendants.length - 1; i >= 0; i--) {
|
|
107
|
+
try { process.kill(descendants[i], signal); } catch { }
|
|
108
|
+
}
|
|
109
|
+
// Then kill root — try group first, fall back to individual
|
|
103
110
|
try {
|
|
104
111
|
process.kill(-pid, signal);
|
|
105
112
|
return true;
|
|
106
113
|
} catch (err) {
|
|
107
114
|
if (err.code === 'ESRCH') return false;
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
try {
|
|
116
|
+
process.kill(pid, signal);
|
|
117
|
+
return true;
|
|
118
|
+
} catch { return false; }
|
|
110
119
|
}
|
|
111
120
|
};
|
|
112
121
|
|
|
@@ -302,25 +311,29 @@ const DOCKER_DEFAULT_DB_URL = 'postgresql://agx:agx@localhost:55432/agx';
|
|
|
302
311
|
|
|
303
312
|
function isDockerPostgresRunning() {
|
|
304
313
|
try {
|
|
305
|
-
const result =
|
|
306
|
-
|
|
314
|
+
const result = execa.sync('docker', ['inspect', '-f', '{{.State.Running}}', DOCKER_POSTGRES_CONTAINER], {
|
|
315
|
+
timeout: 3000,
|
|
316
|
+
encoding: 'utf8',
|
|
317
|
+
reject: false,
|
|
318
|
+
});
|
|
319
|
+
return String(result.stdout || '').trim() === 'true';
|
|
307
320
|
} catch {
|
|
308
321
|
return false;
|
|
309
322
|
}
|
|
310
323
|
}
|
|
311
324
|
|
|
312
325
|
function dockerExecPsql({ sql, timeoutMs = 60000 }) {
|
|
313
|
-
return
|
|
326
|
+
return execa.sync('docker', [
|
|
314
327
|
'exec', '-i', DOCKER_POSTGRES_CONTAINER,
|
|
315
328
|
'psql', '-U', 'agx', '-d', 'agx',
|
|
316
|
-
], { input: sql, timeout: timeoutMs });
|
|
329
|
+
], { input: sql, timeout: timeoutMs, encoding: 'utf8', reject: false });
|
|
317
330
|
}
|
|
318
331
|
|
|
319
332
|
function dockerHasRelation(qualifiedName) {
|
|
320
333
|
const safe = String(qualifiedName).replace(/'/g, "''");
|
|
321
334
|
const res = dockerExecPsql({ sql: `select to_regclass('${safe}') as rel;\\n`, timeoutMs: 10000 });
|
|
322
|
-
if (res.
|
|
323
|
-
const out = (res.stdout ||
|
|
335
|
+
if (res.exitCode !== 0) return false;
|
|
336
|
+
const out = String(res.stdout || '');
|
|
324
337
|
return out.includes(qualifiedName.split('.').pop()) && !out.includes('null');
|
|
325
338
|
}
|
|
326
339
|
|
|
@@ -335,8 +348,8 @@ function ensureDockerSchemaInitialized() {
|
|
|
335
348
|
console.log(`${c.dim}Initializing database schema...${c.reset}`);
|
|
336
349
|
const initSql = fs.readFileSync(initSqlPath, 'utf8');
|
|
337
350
|
const psqlResult = dockerExecPsql({ sql: initSql, timeoutMs: 60000 });
|
|
338
|
-
if (psqlResult.
|
|
339
|
-
const stderr = (psqlResult.stderr ||
|
|
351
|
+
if (psqlResult.exitCode !== 0) {
|
|
352
|
+
const stderr = String(psqlResult.stderr || '').trim();
|
|
340
353
|
console.log(`${c.yellow}Schema init returned non-zero${c.reset}${stderr ? `: ${stderr}` : ''}`);
|
|
341
354
|
}
|
|
342
355
|
}
|
|
@@ -351,17 +364,17 @@ function ensureSchemaInitialized(dbUrl) {
|
|
|
351
364
|
if (!isDockerPostgresRunning()) return;
|
|
352
365
|
console.log(`${c.dim}Initializing database schema...${c.reset}`);
|
|
353
366
|
const psqlResult = dockerExecPsql({ sql: initSql, timeoutMs: 60000 });
|
|
354
|
-
if (psqlResult.
|
|
355
|
-
const stderr = (psqlResult.stderr ||
|
|
367
|
+
if (psqlResult.exitCode !== 0) {
|
|
368
|
+
const stderr = String(psqlResult.stderr || '').trim();
|
|
356
369
|
console.log(`${c.yellow}Schema init returned non-zero${c.reset}${stderr ? `: ${stderr}` : ''}`);
|
|
357
370
|
}
|
|
358
371
|
return;
|
|
359
372
|
}
|
|
360
373
|
|
|
361
374
|
console.log(`${c.dim}Initializing database schema...${c.reset}`);
|
|
362
|
-
const psqlResult =
|
|
363
|
-
if (psqlResult.
|
|
364
|
-
const stderr = (psqlResult.stderr ||
|
|
375
|
+
const psqlResult = execa.sync('psql', [dbUrl], { input: initSql, timeout: 60000, encoding: 'utf8', reject: false });
|
|
376
|
+
if (psqlResult.exitCode !== 0) {
|
|
377
|
+
const stderr = String(psqlResult.stderr || '').trim();
|
|
365
378
|
console.log(`${c.yellow}Schema init returned non-zero${c.reset}${stderr ? `: ${stderr}` : ''}`);
|
|
366
379
|
}
|
|
367
380
|
}
|
|
@@ -373,8 +386,8 @@ async function ensurePostgresReady() {
|
|
|
373
386
|
const dbUrl = new URL(boardEnv.DATABASE_URL);
|
|
374
387
|
const host = dbUrl.hostname;
|
|
375
388
|
const port = dbUrl.port || '5432';
|
|
376
|
-
const result =
|
|
377
|
-
if (result.
|
|
389
|
+
const result = execa.sync('pg_isready', ['-h', host, '-p', port], { timeout: 3000, reject: false });
|
|
390
|
+
if (result.exitCode === 0) {
|
|
378
391
|
ensureSchemaInitialized(boardEnv.DATABASE_URL);
|
|
379
392
|
return boardEnv.DATABASE_URL;
|
|
380
393
|
}
|
|
@@ -406,7 +419,7 @@ async function ensurePostgresReady() {
|
|
|
406
419
|
}
|
|
407
420
|
|
|
408
421
|
console.log(`${c.dim}Starting postgres via Docker...${c.reset}`);
|
|
409
|
-
const dockerResult =
|
|
422
|
+
const dockerResult = execa.sync('docker', [
|
|
410
423
|
'run', '-d',
|
|
411
424
|
'--name', 'agx-postgres',
|
|
412
425
|
'-e', 'POSTGRES_DB=agx',
|
|
@@ -415,12 +428,12 @@ async function ensurePostgresReady() {
|
|
|
415
428
|
'-p', '55432:5432',
|
|
416
429
|
'-v', 'agx_pg_data:/var/lib/postgresql/data',
|
|
417
430
|
'postgres:16-alpine',
|
|
418
|
-
], { stdio: 'pipe', timeout: 60000 });
|
|
431
|
+
], { stdio: 'pipe', timeout: 60000, encoding: 'utf8', reject: false });
|
|
419
432
|
|
|
420
|
-
if (dockerResult.
|
|
421
|
-
const stderr = dockerResult.stderr
|
|
433
|
+
if (dockerResult.exitCode !== 0) {
|
|
434
|
+
const stderr = String(dockerResult.stderr || '');
|
|
422
435
|
if (stderr.includes('already in use')) {
|
|
423
|
-
|
|
436
|
+
execa.sync('docker', ['start', 'agx-postgres'], { timeout: 10000, reject: false });
|
|
424
437
|
} else {
|
|
425
438
|
console.error(`${c.red}Failed to start postgres:${c.reset} ${stderr}`);
|
|
426
439
|
process.exit(1);
|
|
@@ -430,8 +443,8 @@ async function ensurePostgresReady() {
|
|
|
430
443
|
console.log(`${c.dim}Waiting for postgres to be ready...${c.reset}`);
|
|
431
444
|
const deadline = Date.now() + 30000;
|
|
432
445
|
while (Date.now() < deadline) {
|
|
433
|
-
const check =
|
|
434
|
-
if (check.
|
|
446
|
+
const check = execa.sync('docker', ['exec', 'agx-postgres', 'pg_isready', '-U', 'agx'], { timeout: 3000, reject: false });
|
|
447
|
+
if (check.exitCode === 0) break;
|
|
435
448
|
await sleep(1000);
|
|
436
449
|
}
|
|
437
450
|
|
|
@@ -511,18 +524,20 @@ async function ensureBoardRunning() {
|
|
|
511
524
|
let proc;
|
|
512
525
|
try {
|
|
513
526
|
if (boardInfo.mode === 'bundled') {
|
|
514
|
-
proc =
|
|
527
|
+
proc = execa('node', ['server.js'], {
|
|
515
528
|
cwd: boardInfo.dir,
|
|
516
529
|
detached: true,
|
|
517
530
|
stdio: ['ignore', logFd, logFd],
|
|
518
531
|
env: boardEnv,
|
|
532
|
+
reject: false,
|
|
519
533
|
});
|
|
520
534
|
} else {
|
|
521
|
-
proc =
|
|
535
|
+
proc = execa('npm', ['run', 'dev'], {
|
|
522
536
|
cwd: boardInfo.dir,
|
|
523
537
|
detached: true,
|
|
524
538
|
stdio: ['ignore', logFd, logFd],
|
|
525
539
|
env: boardEnv,
|
|
540
|
+
reject: false,
|
|
526
541
|
});
|
|
527
542
|
}
|
|
528
543
|
} catch (err) {
|
|
@@ -533,7 +548,7 @@ async function ensureBoardRunning() {
|
|
|
533
548
|
}
|
|
534
549
|
|
|
535
550
|
fs.closeSync(logFd);
|
|
536
|
-
proc.unref();
|
|
551
|
+
proc.unref?.();
|
|
537
552
|
fs.writeFileSync(BOARD_PID_FILE, String(proc.pid));
|
|
538
553
|
|
|
539
554
|
console.log(`${c.dim}Waiting for board server (pid ${proc.pid})...${c.reset}`);
|
|
@@ -633,11 +648,12 @@ function startTemporalWorker() {
|
|
|
633
648
|
fs.closeSync(logFd);
|
|
634
649
|
return null;
|
|
635
650
|
}
|
|
636
|
-
worker =
|
|
651
|
+
worker = execa('npm', ['run', script], {
|
|
637
652
|
cwd: projectDir,
|
|
638
653
|
detached: true,
|
|
639
654
|
stdio: ['ignore', logFd, logFd],
|
|
640
655
|
env: { ...process.env, ...boardEnv },
|
|
656
|
+
reject: false,
|
|
641
657
|
});
|
|
642
658
|
} catch (err) {
|
|
643
659
|
fs.closeSync(logFd);
|
|
@@ -646,7 +662,7 @@ function startTemporalWorker() {
|
|
|
646
662
|
}
|
|
647
663
|
|
|
648
664
|
fs.closeSync(logFd);
|
|
649
|
-
worker.unref();
|
|
665
|
+
worker.unref?.();
|
|
650
666
|
fs.writeFileSync(WORKER_PID_FILE, String(worker.pid));
|
|
651
667
|
|
|
652
668
|
console.log(`${c.green}✓${c.reset} Orchestrator worker started (pid ${worker.pid})`);
|
|
@@ -706,7 +722,7 @@ function startDaemon(options = {}) {
|
|
|
706
722
|
daemonArgs.push('--workers', String(options.maxWorkers));
|
|
707
723
|
}
|
|
708
724
|
|
|
709
|
-
const daemon =
|
|
725
|
+
const daemon = execa(process.execPath, daemonArgs, {
|
|
710
726
|
detached: true,
|
|
711
727
|
stdio: ['ignore',
|
|
712
728
|
fs.openSync(DAEMON_LOG_FILE, 'a'),
|
|
@@ -719,7 +735,7 @@ function startDaemon(options = {}) {
|
|
|
719
735
|
}
|
|
720
736
|
});
|
|
721
737
|
|
|
722
|
-
daemon.unref();
|
|
738
|
+
daemon.unref?.();
|
|
723
739
|
fs.writeFileSync(DAEMON_PID_FILE, String(daemon.pid));
|
|
724
740
|
|
|
725
741
|
console.log(`${c.green}✓${c.reset} Daemon started (pid ${daemon.pid})`);
|