agent-control-plane 0.4.9 → 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.
- package/README.md +72 -9
- package/npm/bin/agent-control-plane.js +1 -1
- package/package.json +39 -33
- package/tools/bin/debug-session.sh +106 -0
- package/tools/bin/flow-runtime-doctor-linux.sh +136 -0
- package/tools/bin/flow-runtime-doctor.sh +5 -1
- package/tools/bin/install-project-systemd.sh +255 -0
- package/tools/bin/project-runtimectl.sh +45 -0
- package/tools/bin/project-systemd-bootstrap.sh +74 -0
- package/tools/bin/uninstall-project-systemd.sh +87 -0
- package/tools/dashboard/app.js +198 -5
- package/tools/dashboard/issue_queue_state.py +101 -0
- package/tools/dashboard/server.py +123 -1
- package/tools/dashboard/styles.css +526 -455
- package/tools/bin/agent-cleanup-worktree +0 -247
- package/tools/bin/agent-github-update-labels +0 -105
- package/tools/bin/agent-init-worktree +0 -216
- package/tools/bin/agent-project-archive-run +0 -52
- package/tools/bin/agent-project-capture-worker +0 -46
- package/tools/bin/agent-project-catch-up-issue-pr-links +0 -118
- package/tools/bin/agent-project-catch-up-merged-prs +0 -195
- package/tools/bin/agent-project-catch-up-scheduled-issue-retries +0 -123
- package/tools/bin/agent-project-cleanup-session +0 -513
- package/tools/bin/agent-project-detached-launch +0 -127
- package/tools/bin/agent-project-heartbeat-loop +0 -1029
- package/tools/bin/agent-project-open-issue-worktree +0 -89
- package/tools/bin/agent-project-open-pr-worktree +0 -80
- package/tools/bin/agent-project-publish-issue-pr +0 -468
- package/tools/bin/agent-project-reconcile-issue-session +0 -1409
- package/tools/bin/agent-project-reconcile-pr-session +0 -1288
- package/tools/bin/agent-project-retry-state +0 -158
- package/tools/bin/agent-project-run-claude-session +0 -805
- package/tools/bin/agent-project-run-codex-resilient +0 -963
- package/tools/bin/agent-project-run-codex-session +0 -435
- package/tools/bin/agent-project-run-kilo-session +0 -369
- package/tools/bin/agent-project-run-ollama-session +0 -658
- package/tools/bin/agent-project-run-openclaw-session +0 -1309
- package/tools/bin/agent-project-run-opencode-session +0 -377
- package/tools/bin/agent-project-run-pi-session +0 -479
- package/tools/bin/agent-project-sync-anchor-repo +0 -139
- package/tools/bin/agent-project-sync-source-repo-main +0 -163
- package/tools/bin/agent-project-worker-status +0 -188
- package/tools/bin/branch-verification-guard.sh +0 -364
- package/tools/bin/capture-worker.sh +0 -18
- package/tools/bin/cleanup-worktree.sh +0 -52
- package/tools/bin/codex-quota +0 -31
- package/tools/bin/create-follow-up-issue.sh +0 -114
- package/tools/bin/dashboard-launchd-bootstrap.sh +0 -50
- package/tools/bin/issue-publish-localization-guard.sh +0 -142
- package/tools/bin/issue-publish-scope-guard.sh +0 -242
- package/tools/bin/issue-requires-local-workspace-install.sh +0 -31
- package/tools/bin/issue-resource-class.sh +0 -12
- package/tools/bin/kick-scheduler.sh +0 -75
- package/tools/bin/label-follow-up-issues.sh +0 -14
- package/tools/bin/new-pr-worktree.sh +0 -50
- package/tools/bin/new-worktree.sh +0 -49
- package/tools/bin/pr-risk.sh +0 -12
- package/tools/bin/prepare-worktree.sh +0 -142
- package/tools/bin/provider-cooldown-state.sh +0 -204
- package/tools/bin/publish-issue-worker.sh +0 -31
- package/tools/bin/reconcile-bootstrap-lib.sh +0 -113
- package/tools/bin/reconcile-issue-worker.sh +0 -34
- package/tools/bin/reconcile-pr-worker.sh +0 -34
- package/tools/bin/record-verification.sh +0 -71
- package/tools/bin/render-flow-config.sh +0 -98
- package/tools/bin/resident-issue-controller-lib.sh +0 -448
- package/tools/bin/retry-state.sh +0 -31
- package/tools/bin/reuse-issue-worktree.sh +0 -121
- package/tools/bin/run-codex-bypass.sh +0 -3
- package/tools/bin/run-codex-safe.sh +0 -3
- package/tools/bin/run-codex-task.sh +0 -280
- package/tools/bin/serve-dashboard.sh +0 -5
- package/tools/bin/start-issue-worker.sh +0 -943
- package/tools/bin/start-pr-fix-worker.sh +0 -528
- package/tools/bin/start-pr-merge-repair-worker.sh +0 -8
- package/tools/bin/start-pr-review-worker.sh +0 -261
- package/tools/bin/start-resident-issue-loop.sh +0 -499
- package/tools/bin/update-github-labels.sh +0 -14
- package/tools/bin/worker-status.sh +0 -19
- package/tools/bin/workflow-catalog.sh +0 -77
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
-
# shellcheck source=/dev/null
|
|
6
|
-
source "${SCRIPT_DIR}/flow-shell-lib.sh"
|
|
7
|
-
|
|
8
|
-
usage() {
|
|
9
|
-
cat <<'EOF'
|
|
10
|
-
Usage:
|
|
11
|
-
agent-project-retry-state --state-root <path> --kind issue|pr|provider|github --item-id <id> --action get|schedule|clear [--reason <text>] [--cooldowns <csv>] [--next-at-epoch <unix-seconds>]
|
|
12
|
-
|
|
13
|
-
Generic retry/cooldown state manager for project adapters.
|
|
14
|
-
|
|
15
|
-
Examples:
|
|
16
|
-
agent-project-retry-state --state-root /tmp/state --kind issue --item-id 123 --action get
|
|
17
|
-
agent-project-retry-state --state-root /tmp/state --kind pr --item-id 77 --action schedule --reason worker-exit-failed
|
|
18
|
-
agent-project-retry-state --state-root /tmp/state --kind provider --item-id openclaw-stepfun-free --action schedule --reason provider-quota-limit
|
|
19
|
-
agent-project-retry-state --state-root /tmp/state --kind github --item-id core-api --action schedule --reason github-api-rate-limit --next-at-epoch 4102444800
|
|
20
|
-
EOF
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
state_root="${AGENT_PROJECT_STATE_ROOT:-}"
|
|
24
|
-
kind=""
|
|
25
|
-
item_id=""
|
|
26
|
-
action=""
|
|
27
|
-
reason=""
|
|
28
|
-
cooldowns_csv="${AGENT_PROJECT_RETRY_COOLDOWNS:-300,900,1800,3600}"
|
|
29
|
-
next_at_epoch_override=""
|
|
30
|
-
|
|
31
|
-
while [[ $# -gt 0 ]]; do
|
|
32
|
-
case "$1" in
|
|
33
|
-
--state-root) state_root="${2:-}"; shift 2 ;;
|
|
34
|
-
--kind) kind="${2:-}"; shift 2 ;;
|
|
35
|
-
--item-id) item_id="${2:-}"; shift 2 ;;
|
|
36
|
-
--action) action="${2:-}"; shift 2 ;;
|
|
37
|
-
--reason) reason="${2:-}"; shift 2 ;;
|
|
38
|
-
--cooldowns) cooldowns_csv="${2:-}"; shift 2 ;;
|
|
39
|
-
--next-at-epoch) next_at_epoch_override="${2:-}"; shift 2 ;;
|
|
40
|
-
--help|-h) usage; exit 0 ;;
|
|
41
|
-
*) echo "Unknown argument: $1" >&2; usage >&2; exit 1 ;;
|
|
42
|
-
esac
|
|
43
|
-
done
|
|
44
|
-
|
|
45
|
-
if [[ -z "$state_root" || -z "$kind" || -z "$item_id" || -z "$action" ]]; then
|
|
46
|
-
usage >&2
|
|
47
|
-
exit 1
|
|
48
|
-
fi
|
|
49
|
-
|
|
50
|
-
case "$kind" in
|
|
51
|
-
issue|pr|provider|github) ;;
|
|
52
|
-
*) echo "--kind must be issue, pr, provider, or github" >&2; exit 1 ;;
|
|
53
|
-
esac
|
|
54
|
-
|
|
55
|
-
case "$action" in
|
|
56
|
-
get|schedule|clear) ;;
|
|
57
|
-
*) echo "--action must be get, schedule, or clear" >&2; exit 1 ;;
|
|
58
|
-
esac
|
|
59
|
-
|
|
60
|
-
retry_root="${state_root}/retries/${kind}s"
|
|
61
|
-
state_file="${retry_root}/${item_id}.env"
|
|
62
|
-
|
|
63
|
-
mkdir -p "$retry_root"
|
|
64
|
-
|
|
65
|
-
attempts=0
|
|
66
|
-
next_attempt_epoch=0
|
|
67
|
-
next_attempt_at=""
|
|
68
|
-
last_reason=""
|
|
69
|
-
updated_at=""
|
|
70
|
-
|
|
71
|
-
if [[ -f "$state_file" ]]; then
|
|
72
|
-
set -a
|
|
73
|
-
# shellcheck source=/dev/null
|
|
74
|
-
source "$state_file"
|
|
75
|
-
set +a
|
|
76
|
-
attempts="${ATTEMPTS:-0}"
|
|
77
|
-
next_attempt_epoch="${NEXT_ATTEMPT_EPOCH:-0}"
|
|
78
|
-
next_attempt_at="${NEXT_ATTEMPT_AT:-}"
|
|
79
|
-
last_reason="${LAST_REASON:-}"
|
|
80
|
-
updated_at="${UPDATED_AT:-}"
|
|
81
|
-
fi
|
|
82
|
-
|
|
83
|
-
IFS=',' read -r -a cooldowns <<<"$cooldowns_csv"
|
|
84
|
-
now_epoch="$(date +%s)"
|
|
85
|
-
|
|
86
|
-
cooldown_seconds_for_attempt() {
|
|
87
|
-
local attempt="${1:?attempt required}"
|
|
88
|
-
local index=$((attempt - 1))
|
|
89
|
-
local last_index=$(( ${#cooldowns[@]} - 1 ))
|
|
90
|
-
if (( index < 0 )); then
|
|
91
|
-
index=0
|
|
92
|
-
fi
|
|
93
|
-
if (( index > last_index )); then
|
|
94
|
-
index=$last_index
|
|
95
|
-
fi
|
|
96
|
-
printf '%s\n' "${cooldowns[$index]}"
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
write_state() {
|
|
100
|
-
local new_attempts="${1:?attempts required}"
|
|
101
|
-
local new_next_epoch="${2:?next epoch required}"
|
|
102
|
-
local new_reason="${3:-}"
|
|
103
|
-
local new_updated_at
|
|
104
|
-
local new_next_at=""
|
|
105
|
-
|
|
106
|
-
new_updated_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
107
|
-
if [[ "$new_next_epoch" != "0" ]]; then
|
|
108
|
-
new_next_at="$(flow_format_epoch_utc "$new_next_epoch")"
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
cat >"$state_file" <<EOF
|
|
112
|
-
ATTEMPTS=${new_attempts}
|
|
113
|
-
NEXT_ATTEMPT_EPOCH=${new_next_epoch}
|
|
114
|
-
NEXT_ATTEMPT_AT=${new_next_at}
|
|
115
|
-
LAST_REASON=$(printf '%q' "$new_reason")
|
|
116
|
-
UPDATED_AT=${new_updated_at}
|
|
117
|
-
EOF
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
case "$action" in
|
|
121
|
-
get)
|
|
122
|
-
;;
|
|
123
|
-
schedule)
|
|
124
|
-
attempts=$((attempts + 1))
|
|
125
|
-
if [[ "${next_at_epoch_override}" =~ ^[0-9]+$ ]] && (( next_at_epoch_override > now_epoch )); then
|
|
126
|
-
next_attempt_epoch="${next_at_epoch_override}"
|
|
127
|
-
else
|
|
128
|
-
cooldown_seconds="$(cooldown_seconds_for_attempt "$attempts")"
|
|
129
|
-
next_attempt_epoch=$((now_epoch + cooldown_seconds))
|
|
130
|
-
fi
|
|
131
|
-
write_state "$attempts" "$next_attempt_epoch" "$reason"
|
|
132
|
-
next_attempt_at="$(flow_format_epoch_utc "$next_attempt_epoch")"
|
|
133
|
-
last_reason="$reason"
|
|
134
|
-
updated_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
135
|
-
;;
|
|
136
|
-
clear)
|
|
137
|
-
rm -f "$state_file"
|
|
138
|
-
attempts=0
|
|
139
|
-
next_attempt_epoch=0
|
|
140
|
-
next_attempt_at=""
|
|
141
|
-
last_reason=""
|
|
142
|
-
updated_at=""
|
|
143
|
-
;;
|
|
144
|
-
esac
|
|
145
|
-
|
|
146
|
-
ready="yes"
|
|
147
|
-
if [[ "$next_attempt_epoch" =~ ^[0-9]+$ ]] && (( next_attempt_epoch > now_epoch )); then
|
|
148
|
-
ready="no"
|
|
149
|
-
fi
|
|
150
|
-
|
|
151
|
-
printf 'KIND=%s\n' "$kind"
|
|
152
|
-
printf 'ITEM_ID=%s\n' "$item_id"
|
|
153
|
-
printf 'ATTEMPTS=%s\n' "$attempts"
|
|
154
|
-
printf 'NEXT_ATTEMPT_EPOCH=%s\n' "$next_attempt_epoch"
|
|
155
|
-
printf 'NEXT_ATTEMPT_AT=%s\n' "$next_attempt_at"
|
|
156
|
-
printf 'READY=%s\n' "$ready"
|
|
157
|
-
printf 'LAST_REASON=%s\n' "$last_reason"
|
|
158
|
-
printf 'UPDATED_AT=%s\n' "$updated_at"
|