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
@@ -1,147 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- usage() {
5
- cat <<'EOF'
6
- Usage:
7
- agent-project-retry-state --state-root <path> --kind issue|pr|provider --item-id <id> --action get|schedule|clear [--reason <text>] [--cooldowns <csv>]
8
-
9
- Generic retry/cooldown state manager for project adapters.
10
-
11
- Examples:
12
- agent-project-retry-state --state-root /tmp/state --kind issue --item-id 123 --action get
13
- agent-project-retry-state --state-root /tmp/state --kind pr --item-id 77 --action schedule --reason worker-exit-failed
14
- agent-project-retry-state --state-root /tmp/state --kind provider --item-id openclaw-stepfun-free --action schedule --reason provider-quota-limit
15
- EOF
16
- }
17
-
18
- state_root="${AGENT_PROJECT_STATE_ROOT:-}"
19
- kind=""
20
- item_id=""
21
- action=""
22
- reason=""
23
- cooldowns_csv="${AGENT_PROJECT_RETRY_COOLDOWNS:-300,900,1800,3600}"
24
-
25
- while [[ $# -gt 0 ]]; do
26
- case "$1" in
27
- --state-root) state_root="${2:-}"; shift 2 ;;
28
- --kind) kind="${2:-}"; shift 2 ;;
29
- --item-id) item_id="${2:-}"; shift 2 ;;
30
- --action) action="${2:-}"; shift 2 ;;
31
- --reason) reason="${2:-}"; shift 2 ;;
32
- --cooldowns) cooldowns_csv="${2:-}"; shift 2 ;;
33
- --help|-h) usage; exit 0 ;;
34
- *) echo "Unknown argument: $1" >&2; usage >&2; exit 1 ;;
35
- esac
36
- done
37
-
38
- if [[ -z "$state_root" || -z "$kind" || -z "$item_id" || -z "$action" ]]; then
39
- usage >&2
40
- exit 1
41
- fi
42
-
43
- case "$kind" in
44
- issue|pr|provider) ;;
45
- *) echo "--kind must be issue, pr, or provider" >&2; exit 1 ;;
46
- esac
47
-
48
- case "$action" in
49
- get|schedule|clear) ;;
50
- *) echo "--action must be get, schedule, or clear" >&2; exit 1 ;;
51
- esac
52
-
53
- retry_root="${state_root}/retries/${kind}s"
54
- state_file="${retry_root}/${item_id}.env"
55
-
56
- mkdir -p "$retry_root"
57
-
58
- attempts=0
59
- next_attempt_epoch=0
60
- next_attempt_at=""
61
- last_reason=""
62
- updated_at=""
63
-
64
- if [[ -f "$state_file" ]]; then
65
- set -a
66
- # shellcheck source=/dev/null
67
- source "$state_file"
68
- set +a
69
- attempts="${ATTEMPTS:-0}"
70
- next_attempt_epoch="${NEXT_ATTEMPT_EPOCH:-0}"
71
- next_attempt_at="${NEXT_ATTEMPT_AT:-}"
72
- last_reason="${LAST_REASON:-}"
73
- updated_at="${UPDATED_AT:-}"
74
- fi
75
-
76
- IFS=',' read -r -a cooldowns <<<"$cooldowns_csv"
77
- now_epoch="$(date +%s)"
78
-
79
- cooldown_seconds_for_attempt() {
80
- local attempt="${1:?attempt required}"
81
- local index=$((attempt - 1))
82
- local last_index=$(( ${#cooldowns[@]} - 1 ))
83
- if (( index < 0 )); then
84
- index=0
85
- fi
86
- if (( index > last_index )); then
87
- index=$last_index
88
- fi
89
- printf '%s\n' "${cooldowns[$index]}"
90
- }
91
-
92
- write_state() {
93
- local new_attempts="${1:?attempts required}"
94
- local new_next_epoch="${2:?next epoch required}"
95
- local new_reason="${3:-}"
96
- local new_updated_at
97
- local new_next_at=""
98
-
99
- new_updated_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
100
- if [[ "$new_next_epoch" != "0" ]]; then
101
- new_next_at="$(date -u -r "$new_next_epoch" +"%Y-%m-%dT%H:%M:%SZ")"
102
- fi
103
-
104
- cat >"$state_file" <<EOF
105
- ATTEMPTS=${new_attempts}
106
- NEXT_ATTEMPT_EPOCH=${new_next_epoch}
107
- NEXT_ATTEMPT_AT=${new_next_at}
108
- LAST_REASON=$(printf '%q' "$new_reason")
109
- UPDATED_AT=${new_updated_at}
110
- EOF
111
- }
112
-
113
- case "$action" in
114
- get)
115
- ;;
116
- schedule)
117
- attempts=$((attempts + 1))
118
- cooldown_seconds="$(cooldown_seconds_for_attempt "$attempts")"
119
- next_attempt_epoch=$((now_epoch + cooldown_seconds))
120
- write_state "$attempts" "$next_attempt_epoch" "$reason"
121
- next_attempt_at="$(date -u -r "$next_attempt_epoch" +"%Y-%m-%dT%H:%M:%SZ")"
122
- last_reason="$reason"
123
- updated_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
124
- ;;
125
- clear)
126
- rm -f "$state_file"
127
- attempts=0
128
- next_attempt_epoch=0
129
- next_attempt_at=""
130
- last_reason=""
131
- updated_at=""
132
- ;;
133
- esac
134
-
135
- ready="yes"
136
- if [[ "$next_attempt_epoch" =~ ^[0-9]+$ ]] && (( next_attempt_epoch > now_epoch )); then
137
- ready="no"
138
- fi
139
-
140
- printf 'KIND=%s\n' "$kind"
141
- printf 'ITEM_ID=%s\n' "$item_id"
142
- printf 'ATTEMPTS=%s\n' "$attempts"
143
- printf 'NEXT_ATTEMPT_EPOCH=%s\n' "$next_attempt_epoch"
144
- printf 'NEXT_ATTEMPT_AT=%s\n' "$next_attempt_at"
145
- printf 'READY=%s\n' "$ready"
146
- printf 'LAST_REASON=%s\n' "$last_reason"
147
- printf 'UPDATED_AT=%s\n' "$updated_at"