agent-control-plane 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +141 -28
  2. package/assets/workflow-catalog.json +1 -1
  3. package/bin/pr-risk.sh +22 -7
  4. package/bin/sync-pr-labels.sh +1 -1
  5. package/hooks/heartbeat-hooks.sh +125 -12
  6. package/hooks/issue-reconcile-hooks.sh +1 -1
  7. package/hooks/pr-reconcile-hooks.sh +1 -1
  8. package/npm/bin/agent-control-plane.js +257 -59
  9. package/package.json +39 -32
  10. package/tools/bin/debug-session.sh +106 -0
  11. package/tools/bin/flow-config-lib.sh +1203 -60
  12. package/tools/bin/flow-runtime-doctor-linux.sh +136 -0
  13. package/tools/bin/flow-runtime-doctor.sh +5 -1
  14. package/tools/bin/flow-shell-lib.sh +32 -0
  15. package/tools/bin/github-core-rate-limit-state.sh +77 -0
  16. package/tools/bin/github-write-outbox.sh +470 -0
  17. package/tools/bin/heartbeat-loop-scheduling-lib.sh +7 -7
  18. package/tools/bin/heartbeat-safe-auto.sh +42 -0
  19. package/tools/bin/install-project-launchd.sh +17 -2
  20. package/tools/bin/install-project-systemd.sh +255 -0
  21. package/tools/bin/project-init.sh +21 -1
  22. package/tools/bin/project-launchd-bootstrap.sh +5 -1
  23. package/tools/bin/project-runtimectl.sh +91 -2
  24. package/tools/bin/project-systemd-bootstrap.sh +74 -0
  25. package/tools/bin/scaffold-profile.sh +61 -3
  26. package/tools/bin/uninstall-project-systemd.sh +87 -0
  27. package/tools/dashboard/app.js +228 -6
  28. package/tools/dashboard/dashboard_snapshot.py +55 -0
  29. package/tools/dashboard/issue_queue_state.py +101 -0
  30. package/tools/dashboard/server.py +123 -1
  31. package/tools/dashboard/styles.css +526 -455
  32. package/tools/templates/pr-fix-template.md +3 -1
  33. package/tools/templates/pr-merge-repair-template.md +2 -1
  34. package/references/architecture.md +0 -217
  35. package/references/commands.md +0 -128
  36. package/references/control-plane-map.md +0 -124
  37. package/references/docs-map.md +0 -73
  38. package/references/release-checklist.md +0 -65
  39. package/references/repo-map.md +0 -36
  40. package/tools/bin/agent-cleanup-worktree +0 -247
  41. package/tools/bin/agent-github-update-labels +0 -71
  42. package/tools/bin/agent-init-worktree +0 -216
  43. package/tools/bin/agent-project-archive-run +0 -52
  44. package/tools/bin/agent-project-capture-worker +0 -46
  45. package/tools/bin/agent-project-catch-up-issue-pr-links +0 -118
  46. package/tools/bin/agent-project-catch-up-merged-prs +0 -194
  47. package/tools/bin/agent-project-catch-up-scheduled-issue-retries +0 -123
  48. package/tools/bin/agent-project-cleanup-session +0 -513
  49. package/tools/bin/agent-project-detached-launch +0 -127
  50. package/tools/bin/agent-project-heartbeat-loop +0 -1029
  51. package/tools/bin/agent-project-open-issue-worktree +0 -89
  52. package/tools/bin/agent-project-open-pr-worktree +0 -80
  53. package/tools/bin/agent-project-publish-issue-pr +0 -465
  54. package/tools/bin/agent-project-reconcile-issue-session +0 -1398
  55. package/tools/bin/agent-project-reconcile-pr-session +0 -1230
  56. package/tools/bin/agent-project-retry-state +0 -147
  57. package/tools/bin/agent-project-run-claude-session +0 -805
  58. package/tools/bin/agent-project-run-codex-resilient +0 -955
  59. package/tools/bin/agent-project-run-codex-session +0 -435
  60. package/tools/bin/agent-project-run-kilo-session +0 -369
  61. package/tools/bin/agent-project-run-ollama-session +0 -658
  62. package/tools/bin/agent-project-run-openclaw-session +0 -1309
  63. package/tools/bin/agent-project-run-opencode-session +0 -377
  64. package/tools/bin/agent-project-run-pi-session +0 -479
  65. package/tools/bin/agent-project-sync-anchor-repo +0 -139
  66. package/tools/bin/agent-project-worker-status +0 -188
  67. package/tools/bin/branch-verification-guard.sh +0 -364
  68. package/tools/bin/capture-worker.sh +0 -18
  69. package/tools/bin/cleanup-worktree.sh +0 -52
  70. package/tools/bin/codex-quota +0 -31
  71. package/tools/bin/create-follow-up-issue.sh +0 -114
  72. package/tools/bin/dashboard-launchd-bootstrap.sh +0 -50
  73. package/tools/bin/issue-publish-localization-guard.sh +0 -142
  74. package/tools/bin/issue-publish-scope-guard.sh +0 -242
  75. package/tools/bin/issue-requires-local-workspace-install.sh +0 -31
  76. package/tools/bin/issue-resource-class.sh +0 -12
  77. package/tools/bin/kick-scheduler.sh +0 -75
  78. package/tools/bin/label-follow-up-issues.sh +0 -14
  79. package/tools/bin/new-pr-worktree.sh +0 -50
  80. package/tools/bin/new-worktree.sh +0 -49
  81. package/tools/bin/pr-risk.sh +0 -12
  82. package/tools/bin/prepare-worktree.sh +0 -142
  83. package/tools/bin/provider-cooldown-state.sh +0 -204
  84. package/tools/bin/publish-issue-worker.sh +0 -31
  85. package/tools/bin/reconcile-bootstrap-lib.sh +0 -113
  86. package/tools/bin/reconcile-issue-worker.sh +0 -34
  87. package/tools/bin/reconcile-pr-worker.sh +0 -34
  88. package/tools/bin/record-verification.sh +0 -71
  89. package/tools/bin/render-flow-config.sh +0 -98
  90. package/tools/bin/resident-issue-controller-lib.sh +0 -448
  91. package/tools/bin/resident-issue-queue-status.py +0 -35
  92. package/tools/bin/retry-state.sh +0 -31
  93. package/tools/bin/reuse-issue-worktree.sh +0 -121
  94. package/tools/bin/run-codex-bypass.sh +0 -3
  95. package/tools/bin/run-codex-safe.sh +0 -3
  96. package/tools/bin/run-codex-task.sh +0 -280
  97. package/tools/bin/serve-dashboard.sh +0 -5
  98. package/tools/bin/split-retained-slice.sh +0 -124
  99. package/tools/bin/start-issue-worker.sh +0 -943
  100. package/tools/bin/start-pr-fix-worker.sh +0 -491
  101. package/tools/bin/start-pr-merge-repair-worker.sh +0 -8
  102. package/tools/bin/start-pr-review-worker.sh +0 -261
  103. package/tools/bin/start-resident-issue-loop.sh +0 -499
  104. package/tools/bin/update-github-labels.sh +0 -14
  105. package/tools/bin/worker-status.sh +0 -19
  106. package/tools/bin/workflow-catalog.sh +0 -77
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-control-plane",
3
- "version": "0.3.0",
3
+ "version": "0.6.0",
4
4
  "description": "Help a repo keep GitHub-driven coding agents running reliably without constant human babysitting",
5
5
  "homepage": "https://github.com/ducminhnguyen0319/agent-control-plane",
6
6
  "bugs": {
@@ -17,6 +17,23 @@
17
17
  "bin": {
18
18
  "agent-control-plane": "./bin/agent-control-plane"
19
19
  },
20
+ "keywords": [
21
+ "agents",
22
+ "automation",
23
+ "background-jobs",
24
+ "dashboard",
25
+ "control-plane",
26
+ "developer-tools",
27
+ "github-actions",
28
+ "github",
29
+ "npm",
30
+ "runtime"
31
+ ],
32
+ "scripts": {
33
+ "doctor": "node ./npm/bin/agent-control-plane.js doctor",
34
+ "smoke": "node ./npm/bin/agent-control-plane.js smoke",
35
+ "test": "bash tools/tests/test-package-surface.sh && bash tools/tests/test-package-public-metadata.sh"
36
+ },
20
37
  "files": [
21
38
  "README.md",
22
39
  "assets/workflow-catalog.json",
@@ -25,46 +42,36 @@
25
42
  "bin/label-follow-up-issues.sh",
26
43
  "bin/pr-risk.sh",
27
44
  "bin/sync-pr-labels.sh",
28
- "hooks",
29
- "npm/bin",
30
- "references",
31
- "tools/bin",
32
- "!tools/bin/audit-*.sh",
33
- "!tools/bin/check-skill-contracts.sh",
34
- "!tools/bin/render-dashboard-snapshot.py",
35
- "tools/dashboard/app.js",
36
- "tools/dashboard/dashboard_snapshot.py",
37
- "tools/dashboard/index.html",
38
- "tools/dashboard/server.py",
39
- "tools/dashboard/styles.css",
40
- "tools/templates",
41
- "!tools/templates/legacy/",
45
+ "hooks/",
46
+ "npm/",
47
+ "tools/bin/agent-project-run-*.sh",
48
+ "tools/bin/flow-*.sh",
49
+ "tools/bin/project-*.sh",
50
+ "tools/bin/scaffold-*.sh",
51
+ "tools/bin/sync-*.sh",
52
+ "tools/bin/install-*.sh",
53
+ "tools/bin/uninstall-*.sh",
54
+ "tools/bin/debug-session.sh",
55
+ "tools/bin/ensure-*.sh",
56
+ "tools/bin/heartbeat-*.sh",
57
+ "tools/bin/github-*.sh",
58
+ "tools/bin/profile-*.sh",
59
+ "tools/bin/test-smoke.sh",
60
+ "tools/dashboard/",
61
+ "tools/templates/issue-prompt-template.md",
62
+ "tools/templates/pr-fix-template.md",
63
+ "tools/templates/pr-merge-repair-template.md",
64
+ "tools/templates/pr-review-template.md",
65
+ "tools/templates/scheduled-issue-prompt-template.md",
42
66
  "tools/vendor/codex-quota/LICENSE",
43
67
  "tools/vendor/codex-quota/codex-quota.js",
44
68
  "tools/vendor/codex-quota/lib",
45
69
  "tools/vendor/codex-quota-manager/scripts"
46
70
  ],
47
- "scripts": {
48
- "doctor": "node ./npm/bin/agent-control-plane.js doctor",
49
- "smoke": "node ./npm/bin/agent-control-plane.js smoke",
50
- "test": "bash tools/tests/test-agent-control-plane-npm-cli.sh && bash tools/tests/test-agent-project-detached-launch-stable-cwd.sh && bash tools/tests/test-agent-project-claude-session-wrapper-reaps-child-on-term.sh && bash tools/tests/test-agent-project-claude-session-wrapper-does-not-retry-provider-quota.sh && bash tools/tests/test-agent-project-run-codex-resilient-uses-path-python-and-gnu-stat.sh && bash tools/tests/test-heartbeat-safe-auto-uses-path-python.sh && bash tools/tests/test-heartbeat-safe-auto-skips-self-sync.sh && bash tools/tests/test-agent-project-catch-up-terminal-prs-defaults-closed-hook.sh && bash tools/tests/test-agent-project-codex-session-wrapper-prefers-path-codex.sh && bash tools/tests/test-agent-project-codex-session-wrapper-recovers-var-tmp-logged-artifacts.sh && bash tools/tests/test-agent-project-cleanup-session-removes-registered-worktree-without-rg.sh && bash tools/tests/test-agent-project-cleanup-session-propagates-failure-with-session.sh && bash tools/tests/test-cleanup-worktree-syncs-workspace-after-cleanup-failure.sh && bash tools/tests/test-resident-issue-queue-status-contract.sh && bash tools/tests/test-agent-project-reconcile-issue-provider-quota-schedules-provider-cooldown.sh && bash tools/tests/test-agent-project-reconcile-issue-session-warns-on-cleanup-failure.sh && bash tools/tests/test-agent-project-reconcile-pr-session-warns-on-cleanup-failure.sh && bash tools/tests/test-pr-reconcile-hooks-refreshes-recurring-issue-checklist.sh && bash tools/tests/test-issue-reconcile-hooks-kick-scheduler-uses-profile.sh && bash tools/tests/test-profile-adopt-skip-anchor-sync-creates-agent-repo-root.sh && bash tools/tests/test-vendored-codex-quota-claude-oauth-only.sh && bash tools/tests/test-package-smoke-command.sh"
51
- },
52
71
  "publishConfig": {
53
72
  "access": "public",
54
73
  "provenance": true
55
74
  },
56
- "keywords": [
57
- "agents",
58
- "automation",
59
- "background-jobs",
60
- "dashboard",
61
- "control-plane",
62
- "developer-tools",
63
- "github-actions",
64
- "github",
65
- "npx",
66
- "runtime"
67
- ],
68
75
  "engines": {
69
76
  "node": ">=18"
70
77
  }
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env bash
2
+ # debug-session.sh - Troubleshoot ACP worker sessions
3
+ # Usage: debug-session.sh [session-name]
4
+ # If no session name given, lists all agent- sessions with diagnostics
5
+ set -euo pipefail
6
+
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+
9
+ SESSION_NAME="${1:-}"
10
+
11
+ echo "=== ACP Session Debugger ==="
12
+ echo ""
13
+
14
+ # --- Check tmux ---
15
+ if ! command -v tmux &>/dev/null; then
16
+ echo "ERROR: tmux is not installed. Cannot debug sessions."
17
+ exit 1
18
+ fi
19
+
20
+ # --- List or Debug Specific ---
21
+ if [[ -z "${SESSION_NAME}" ]]; then
22
+ echo "--- All agent- tmux sessions ---"
23
+ tmux ls 2>/dev/null | grep "^agent-" || echo "No agent- sessions found."
24
+ echo ""
25
+ echo "Usage: $0 <session-name>"
26
+ echo " $0 agent-control-plane"
27
+ exit 0
28
+ fi
29
+
30
+ # --- Check if session exists ---
31
+ if ! tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then
32
+ echo "ERROR: Session '${SESSION_NAME}' not found."
33
+ echo ""
34
+ echo "Available sessions:"
35
+ tmux ls 2>/dev/null | grep "^agent-" || echo " (none)"
36
+ exit 1
37
+ fi
38
+
39
+ echo "--- Session: ${SESSION_NAME} ---"
40
+ echo ""
41
+
42
+ # --- Session Info ---
43
+ echo "1. Session Info:"
44
+ tmux display-message -t "${SESSION_NAME}" -p "Session created: #{session_created_string}" 2>/dev/null || true
45
+ tmux display-message -t "${SESSION_NAME}" -p "Session width: #{session_width}, height: #{session_height}" 2>/dev/null || true
46
+ echo ""
47
+
48
+ # --- Pane List ---
49
+ echo "2. Panes:"
50
+ tmux list-panes -t "${SESSION_NAME}" -F " Pane #{pane_index}: pid=#{pane_pid} [#{pane_width}x#{pane_height}] #{?pane_active,(active),}"
51
+ echo ""
52
+
53
+ # --- Recent Output (last 50 lines) ---
54
+ echo "3. Recent Output (last 50 lines):"
55
+ echo "--- START ---"
56
+ tmux capture-pane -t "${SESSION_NAME}" -p -S -50 2>/dev/null || echo "(no output captured)"
57
+ echo "--- END ---"
58
+ echo ""
59
+
60
+ # --- Process Tree ---
61
+ echo "4. Process Tree:"
62
+ PANE_PID=$(tmux display-message -t "${SESSION_NAME}" -p "#{pane_pid}" 2>/dev/null || echo "")
63
+ if [[ -n "${PANE_PID}" ]]; then
64
+ if command -v pstree &>/dev/null; then
65
+ pstree -p "${PANE_PID}" 2>/dev/null || ps -p "${PANE_PID}" -o pid,ppid,cmd 2>/dev/null || echo "(cannot inspect process)"
66
+ else
67
+ ps -p "${PANE_PID}" -o pid,ppid,cmd 2>/dev/null || echo "(cannot inspect process)"
68
+ fi
69
+ else
70
+ echo "(cannot get pane pid)"
71
+ fi
72
+ echo ""
73
+
74
+ # --- Check for Common Issues ---
75
+ echo "5. Diagnostics:"
76
+ CAPTURE=$(tmux capture-pane -t "${SESSION_NAME}" -p -S -100 2>/dev/null || echo "")
77
+
78
+ # Check for errors
79
+ ERROR_COUNT=$(echo "${CAPTURE}" | grep -ic "error\|fail\|fatal\|exception" || true)
80
+ echo " Error-like lines in last 100: ${ERROR_COUNT}"
81
+
82
+ # Check for stalls (no output for a while)
83
+ if echo "${CAPTURE}" | tail -10 | grep -q "."; then
84
+ echo " Recent output: yes"
85
+ else
86
+ echo " Recent output: NO (may be stalled)"
87
+ fi
88
+
89
+ # Check for specific worker patterns
90
+ if echo "${CAPTURE}" | grep -q "streaming\|tool_use\|thinking"; then
91
+ echo " Worker activity: active (streaming/tool_use detected)"
92
+ elif echo "${CAPTURE}" | grep -q "IDLE\|waiting\|queue"; then
93
+ echo " Worker activity: idle/waiting"
94
+ else
95
+ echo " Worker activity: unknown"
96
+ fi
97
+ echo ""
98
+
99
+ # --- Offer Actions ---
100
+ echo "6. Quick Actions:"
101
+ echo " Attach: tmux attach -t ${SESSION_NAME}"
102
+ echo " Kill: tmux kill-session -t ${SESSION_NAME}"
103
+ echo " Capture: tmux capture-pane -t ${SESSION_NAME} -p > output.txt"
104
+ echo ""
105
+
106
+ echo "=== Debug Complete ==="