agent-control-plane 0.1.2 → 0.1.4
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 +6 -0
- package/npm/bin/agent-control-plane.js +149 -5
- package/package.json +1 -2
- package/tools/bin/render-architecture-infographics.sh +0 -110
- package/tools/bin/render-dashboard-demo-media.sh +0 -333
- package/tools/tests/test-agent-control-plane-npm-cli.sh +0 -280
- package/tools/tests/test-agent-github-update-labels-falls-back-to-repository-id.sh +0 -56
- package/tools/tests/test-agent-project-claude-session-wrapper-clears-stale-sandbox-artifacts.sh +0 -89
- package/tools/tests/test-agent-project-claude-session-wrapper-does-not-retry-provider-quota.sh +0 -82
- package/tools/tests/test-agent-project-claude-session-wrapper-retries-transient-failures.sh +0 -90
- package/tools/tests/test-agent-project-claude-session-wrapper-times-out.sh +0 -73
- package/tools/tests/test-agent-project-claude-session-wrapper.sh +0 -103
- package/tools/tests/test-agent-project-cleanup-session-orphan-fallback.sh +0 -90
- package/tools/tests/test-agent-project-cleanup-session-skip-worktree-cleanup.sh +0 -90
- package/tools/tests/test-agent-project-codex-live-thread-persist.sh +0 -76
- package/tools/tests/test-agent-project-codex-recovery.sh +0 -731
- package/tools/tests/test-agent-project-codex-session-wrapper-clears-stale-sandbox-artifacts.sh +0 -105
- package/tools/tests/test-agent-project-codex-session-wrapper.sh +0 -97
- package/tools/tests/test-agent-project-open-pr-worktree-config-prefix.sh +0 -81
- package/tools/tests/test-agent-project-openclaw-session-wrapper-clears-stale-sandbox-artifacts.sh +0 -109
- package/tools/tests/test-agent-project-openclaw-session-wrapper-infers-blocked-result-contract.sh +0 -89
- package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-literal-env-artifacts.sh +0 -113
- package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-version-mismatch.sh +0 -135
- package/tools/tests/test-agent-project-openclaw-session-wrapper-resident.sh +0 -179
- package/tools/tests/test-agent-project-openclaw-session-wrapper-reuses-existing-agent-after-add-race.sh +0 -119
- package/tools/tests/test-agent-project-openclaw-session-wrapper-terminates-rate-limit-hang.sh +0 -91
- package/tools/tests/test-agent-project-openclaw-session-wrapper.sh +0 -117
- package/tools/tests/test-agent-project-publish-issue-pr-prunes-stale-worktree-entry.sh +0 -148
- package/tools/tests/test-agent-project-publish-issue-pr-reads-archived-session.sh +0 -146
- package/tools/tests/test-agent-project-publish-issue-pr-recovers-final-head.sh +0 -145
- package/tools/tests/test-agent-project-publish-issue-pr-reuses-existing-worktree.sh +0 -147
- package/tools/tests/test-agent-project-reconcile-failure-reason.sh +0 -456
- package/tools/tests/test-agent-project-reconcile-issue-archived-session-fallback.sh +0 -96
- package/tools/tests/test-agent-project-reconcile-issue-before-blocked.sh +0 -90
- package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery-uses-recovered-worktree.sh +0 -212
- package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery.sh +0 -207
- package/tools/tests/test-agent-project-reconcile-issue-provider-quota-schedules-provider-cooldown.sh +0 -101
- package/tools/tests/test-agent-project-reconcile-issue-session-backfills-lane-metadata-from-worker-key.sh +0 -113
- package/tools/tests/test-agent-project-reconcile-issue-session-clears-stale-failed-summary.sh +0 -117
- package/tools/tests/test-agent-project-reconcile-issue-session-initializes-shared-agent-home.sh +0 -55
- package/tools/tests/test-agent-project-reconcile-issue-session-normalizes-runner-state.sh +0 -125
- package/tools/tests/test-agent-project-reconcile-issue-session-records-invalid-contract-summary.sh +0 -118
- package/tools/tests/test-agent-project-reconcile-issue-session-skips-duplicate-blocked-comment.sh +0 -144
- package/tools/tests/test-agent-project-reconcile-issue-session-standardizes-no-commits-blocker.sh +0 -145
- package/tools/tests/test-agent-project-reconcile-issue-session-synthesizes-blocked-comment.sh +0 -139
- package/tools/tests/test-agent-project-reconcile-pr-blocked-host-recovery.sh +0 -242
- package/tools/tests/test-agent-project-reconcile-pr-guard-blocked-no-commit.sh +0 -142
- package/tools/tests/test-agent-project-reconcile-pr-provider-quota-schedules-provider-cooldown.sh +0 -106
- package/tools/tests/test-agent-project-reconcile-pr-session-initializes-shared-agent-home.sh +0 -66
- package/tools/tests/test-agent-project-reconcile-pr-updated-branch-noop.sh +0 -129
- package/tools/tests/test-audit-agent-worktrees-active-launch-skips-git-inspection.sh +0 -69
- package/tools/tests/test-audit-agent-worktrees-broken-worktree.sh +0 -43
- package/tools/tests/test-audit-agent-worktrees-pending-launch-owner.sh +0 -46
- package/tools/tests/test-audit-agent-worktrees-unreconciled-owner.sh +0 -79
- package/tools/tests/test-audit-issue-routing-managed-branch-globs.sh +0 -56
- package/tools/tests/test-branch-verification-guard-generated-artifacts.sh +0 -72
- package/tools/tests/test-branch-verification-guard-targeted-coverage.sh +0 -125
- package/tools/tests/test-codex-quota-manager-failure-driven-rotation.sh +0 -178
- package/tools/tests/test-codex-quota-wrapper.sh +0 -37
- package/tools/tests/test-contribution-docs.sh +0 -18
- package/tools/tests/test-control-plane-dashboard-runtime-smoke.sh +0 -343
- package/tools/tests/test-create-follow-up-issue.sh +0 -73
- package/tools/tests/test-dashboard-launchd-bootstrap.sh +0 -55
- package/tools/tests/test-flow-export-execution-env-exports-repo-id.sh +0 -30
- package/tools/tests/test-flow-export-github-cli-auth-env-prefers-git-credential.sh +0 -48
- package/tools/tests/test-flow-github-api-repo-fallback-preserves-input.sh +0 -85
- package/tools/tests/test-flow-github-api-repo-prefers-explicit-repository-id.sh +0 -60
- package/tools/tests/test-flow-github-issue-list-falls-back-to-repository-id.sh +0 -64
- package/tools/tests/test-flow-github-pr-list-falls-back-to-repository-id.sh +0 -77
- package/tools/tests/test-flow-resident-can-reuse-does-not-leak-metadata.sh +0 -52
- package/tools/tests/test-flow-resident-reap-stale-controllers.sh +0 -63
- package/tools/tests/test-flow-resolve-codex-quota-tools.sh +0 -104
- package/tools/tests/test-flow-runtime-doctor-profile-selection.sh +0 -27
- package/tools/tests/test-heartbeat-codex-pr-linked-issue-exclusion.sh +0 -79
- package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-idle-controller.sh +0 -115
- package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-live-lane-controller.sh +0 -117
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-claude.sh +0 -96
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-codex.sh +0 -96
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop.sh +0 -96
- package/tools/tests/test-heartbeat-loop-auth-wait-does-not-consume-capacity.sh +0 -170
- package/tools/tests/test-heartbeat-loop-blocked-recovery-lane.sh +0 -201
- package/tools/tests/test-heartbeat-loop-blocked-recovery-vs-pr-reservation.sh +0 -201
- package/tools/tests/test-heartbeat-loop-idle-resident-controller-does-not-block-launches.sh +0 -160
- package/tools/tests/test-heartbeat-loop-pr-launch-dedup.sh +0 -133
- package/tools/tests/test-heartbeat-loop-provider-cooldown-suppresses-launches.sh +0 -157
- package/tools/tests/test-heartbeat-loop-reaps-stale-resident-controller.sh +0 -181
- package/tools/tests/test-heartbeat-loop-waiting-provider-resident-controller-does-not-block-launches.sh +0 -160
- package/tools/tests/test-heartbeat-ready-issues-blocked-recovery.sh +0 -134
- package/tools/tests/test-heartbeat-safe-auto-dynamic-concurrency.sh +0 -162
- package/tools/tests/test-heartbeat-safe-auto-no-tmux-sessions.sh +0 -136
- package/tools/tests/test-heartbeat-safe-auto-openclaw-skips-codex-quota.sh +0 -139
- package/tools/tests/test-heartbeat-safe-auto-quota-health-signal.sh +0 -119
- package/tools/tests/test-heartbeat-safe-auto-stale-shared-loop-pid-does-not-skip.sh +0 -140
- package/tools/tests/test-heartbeat-safe-auto-static-capacity-without-quota-cache.sh +0 -142
- package/tools/tests/test-heartbeat-safe-auto-zero-healthy-pools.sh +0 -141
- package/tools/tests/test-heartbeat-sync-issue-labels-empty-schedule.sh +0 -65
- package/tools/tests/test-heartbeat-sync-open-agent-prs-terminal-clears-running.sh +0 -179
- package/tools/tests/test-install-dashboard-launchd.sh +0 -78
- package/tools/tests/test-install-project-launchd-adds-tool-paths.sh +0 -87
- package/tools/tests/test-install-project-launchd.sh +0 -110
- package/tools/tests/test-issue-local-workspace-install-policy.sh +0 -81
- package/tools/tests/test-issue-publish-scope-guard-docs-signal.sh +0 -70
- package/tools/tests/test-issue-reconcile-hooks-success-clears-blocked.sh +0 -36
- package/tools/tests/test-kick-scheduler-requires-explicit-profile.sh +0 -47
- package/tools/tests/test-label-follow-up-issues-falls-back-to-repository-id.sh +0 -132
- package/tools/tests/test-manual-operator-entrypoints-require-explicit-profile.sh +0 -64
- package/tools/tests/test-package-funding-metadata.sh +0 -21
- package/tools/tests/test-package-public-metadata.sh +0 -62
- package/tools/tests/test-placeholder-worker-adapters.sh +0 -38
- package/tools/tests/test-pr-reconcile-hooks-refreshes-recurring-issue-checklist.sh +0 -110
- package/tools/tests/test-pr-risk-cohesive-mobile-locale-scope.sh +0 -70
- package/tools/tests/test-pr-risk-fix-label-semantics.sh +0 -114
- package/tools/tests/test-pr-risk-local-first-no-checks.sh +0 -70
- package/tools/tests/test-prepare-worktree-simple-repo-baseline.sh +0 -67
- package/tools/tests/test-profile-activate.sh +0 -33
- package/tools/tests/test-profile-adopt-allow-missing-repo.sh +0 -68
- package/tools/tests/test-profile-adopt-skip-workspace-sync-missing-file.sh +0 -61
- package/tools/tests/test-profile-adopt-syncs-anchor-and-workspace.sh +0 -90
- package/tools/tests/test-profile-smoke-collision.sh +0 -44
- package/tools/tests/test-profile-smoke-invalid-claude-config.sh +0 -31
- package/tools/tests/test-profile-smoke-invalid-provider-pool.sh +0 -68
- package/tools/tests/test-profile-smoke-repo-slug-mismatch.sh +0 -36
- package/tools/tests/test-profile-smoke.sh +0 -45
- package/tools/tests/test-project-init-force-and-skip-sync.sh +0 -61
- package/tools/tests/test-project-init-repo-slug-mismatch.sh +0 -29
- package/tools/tests/test-project-init.sh +0 -66
- package/tools/tests/test-project-launchd-bootstrap.sh +0 -66
- package/tools/tests/test-project-remove.sh +0 -150
- package/tools/tests/test-project-runtime-supervisor.sh +0 -47
- package/tools/tests/test-project-runtimectl-launchd.sh +0 -115
- package/tools/tests/test-project-runtimectl-missing-profile.sh +0 -54
- package/tools/tests/test-project-runtimectl-start-falls-back-to-bootstrap.sh +0 -108
- package/tools/tests/test-project-runtimectl-status-reports-supervisor-as-heartbeat-parent.sh +0 -95
- package/tools/tests/test-project-runtimectl-status-supervisor-running.sh +0 -59
- package/tools/tests/test-project-runtimectl-stop-cancels-pending-kick.sh +0 -85
- package/tools/tests/test-project-runtimectl-stop-clears-running-labels.sh +0 -78
- package/tools/tests/test-project-runtimectl.sh +0 -212
- package/tools/tests/test-provider-cooldown-state-prefers-runtime-worker-context.sh +0 -39
- package/tools/tests/test-provider-cooldown-state.sh +0 -59
- package/tools/tests/test-public-repo-docs.sh +0 -161
- package/tools/tests/test-reconcile-pr-worker-acp-config-routing.sh +0 -75
- package/tools/tests/test-render-dashboard-snapshot.sh +0 -149
- package/tools/tests/test-render-flow-config-demo-profile.sh +0 -36
- package/tools/tests/test-render-flow-config-provider-pool-fallback.sh +0 -81
- package/tools/tests/test-render-flow-config.sh +0 -52
- package/tools/tests/test-run-codex-task-claude-routing.sh +0 -125
- package/tools/tests/test-run-codex-task-codex-resident-routing.sh +0 -108
- package/tools/tests/test-run-codex-task-kilo-routing.sh +0 -98
- package/tools/tests/test-run-codex-task-openclaw-resident-routing.sh +0 -117
- package/tools/tests/test-run-codex-task-openclaw-routing.sh +0 -113
- package/tools/tests/test-run-codex-task-opencode-routing.sh +0 -98
- package/tools/tests/test-run-codex-task-provider-pool-fallback-routing.sh +0 -146
- package/tools/tests/test-scaffold-profile.sh +0 -108
- package/tools/tests/test-serve-dashboard.sh +0 -93
- package/tools/tests/test-start-issue-worker-blocked-context.sh +0 -129
- package/tools/tests/test-start-issue-worker-blocks-complete-recurring-checklist.sh +0 -189
- package/tools/tests/test-start-issue-worker-local-install-routing.sh +0 -157
- package/tools/tests/test-start-issue-worker-profile-template-routing.sh +0 -149
- package/tools/tests/test-start-issue-worker-recurring-resident-reuse-codex.sh +0 -212
- package/tools/tests/test-start-issue-worker-recurring-resident-reuse.sh +0 -219
- package/tools/tests/test-start-issue-worker-renders-verification-snippet.sh +0 -155
- package/tools/tests/test-start-issue-worker-resident-reuse-falls-back-to-new-worktree.sh +0 -199
- package/tools/tests/test-start-pr-fix-worker-host-blocker-context.sh +0 -275
- package/tools/tests/test-start-resident-issue-loop-adopts-next-recurring-issue.sh +0 -185
- package/tools/tests/test-start-resident-issue-loop-clears-pending-while-waiting-due.sh +0 -152
- package/tools/tests/test-start-resident-issue-loop-consumes-queued-lease.sh +0 -186
- package/tools/tests/test-start-resident-issue-loop-fails-over-provider-pool.sh +0 -212
- package/tools/tests/test-start-resident-issue-loop-immediate-cycles.sh +0 -148
- package/tools/tests/test-start-resident-issue-loop-waits-for-provider.sh +0 -194
- package/tools/tests/test-start-resident-issue-loop-waits-for-terminal-reconcile-status.sh +0 -198
- package/tools/tests/test-start-resident-issue-loop-yields-to-live-lane-controller.sh +0 -145
- package/tools/tests/test-sync-pr-labels-fix-lane-uses-repair-queued.sh +0 -67
- package/tools/tests/test-sync-recurring-issue-checklist-backfills-workflow-complete-blocker.sh +0 -70
- package/tools/tests/test-sync-recurring-issue-checklist.sh +0 -95
- package/tools/tests/test-sync-shared-agent-home-local-source-root.sh +0 -66
- package/tools/tests/test-sync-shared-agent-home-preserves-unrelated-workflow-catalog-skill.sh +0 -47
- package/tools/tests/test-test-smoke.sh +0 -86
- package/tools/tests/test-uninstall-project-launchd.sh +0 -37
- package/tools/tests/test-update-github-labels-prefers-sibling-helper.sh +0 -49
- package/tools/tests/test-vendored-codex-quota-claude-oauth-only.sh +0 -38
- package/tools/tests/test-workflow-catalog.sh +0 -43
- package/tools/vendor/codex-quota/README.md +0 -451
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
-
OUTPUT_DIR="${ROOT_DIR}/assets/readme"
|
|
6
|
-
PNG_OUT="${OUTPUT_DIR}/dashboard-demo.png"
|
|
7
|
-
GIF_OUT="${OUTPUT_DIR}/dashboard-demo.gif"
|
|
8
|
-
|
|
9
|
-
require_bin() {
|
|
10
|
-
local name="$1"
|
|
11
|
-
if ! command -v "$name" >/dev/null 2>&1; then
|
|
12
|
-
echo "missing required dependency: $name" >&2
|
|
13
|
-
exit 1
|
|
14
|
-
fi
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
require_bin python3
|
|
18
|
-
require_bin ffmpeg
|
|
19
|
-
require_bin playwright
|
|
20
|
-
require_bin curl
|
|
21
|
-
|
|
22
|
-
PLAYWRIGHT_CLI="$(command -v playwright)"
|
|
23
|
-
PLAYWRIGHT_PACKAGE_ROOT="$(
|
|
24
|
-
python3 - "$PLAYWRIGHT_CLI" <<'PY'
|
|
25
|
-
import os
|
|
26
|
-
import sys
|
|
27
|
-
|
|
28
|
-
print(os.path.dirname(os.path.realpath(sys.argv[1])))
|
|
29
|
-
PY
|
|
30
|
-
)"
|
|
31
|
-
|
|
32
|
-
tmpdir="$(mktemp -d)"
|
|
33
|
-
server_pid=""
|
|
34
|
-
controller_pid=""
|
|
35
|
-
port="$(
|
|
36
|
-
python3 - <<'PY'
|
|
37
|
-
import socket
|
|
38
|
-
|
|
39
|
-
sock = socket.socket()
|
|
40
|
-
sock.bind(("127.0.0.1", 0))
|
|
41
|
-
print(sock.getsockname()[1])
|
|
42
|
-
sock.close()
|
|
43
|
-
PY
|
|
44
|
-
)"
|
|
45
|
-
|
|
46
|
-
cleanup() {
|
|
47
|
-
if [[ -n "${server_pid}" ]]; then
|
|
48
|
-
kill "${server_pid}" >/dev/null 2>&1 || true
|
|
49
|
-
wait "${server_pid}" 2>/dev/null || true
|
|
50
|
-
fi
|
|
51
|
-
if [[ -n "${controller_pid}" ]]; then
|
|
52
|
-
kill "${controller_pid}" >/dev/null 2>&1 || true
|
|
53
|
-
wait "${controller_pid}" 2>/dev/null || true
|
|
54
|
-
fi
|
|
55
|
-
rm -rf "${tmpdir}"
|
|
56
|
-
}
|
|
57
|
-
trap cleanup EXIT
|
|
58
|
-
|
|
59
|
-
profile_registry_root="${tmpdir}/profiles"
|
|
60
|
-
profile_dir="${profile_registry_root}/demo-retail"
|
|
61
|
-
runs_root="${tmpdir}/runtime/demo-retail/runs"
|
|
62
|
-
state_root="${tmpdir}/runtime/demo-retail/state"
|
|
63
|
-
frames_dir="${tmpdir}/frames"
|
|
64
|
-
mkdir -p \
|
|
65
|
-
"${profile_dir}" \
|
|
66
|
-
"${runs_root}/demo-issue-14" \
|
|
67
|
-
"${runs_root}/demo-issue-17" \
|
|
68
|
-
"${runs_root}/demo-issue-21" \
|
|
69
|
-
"${state_root}/resident-workers/issues/14" \
|
|
70
|
-
"${state_root}/resident-workers/issues/issue-lane-recurring-general-openclaw-safe" \
|
|
71
|
-
"${state_root}/retries/providers" \
|
|
72
|
-
"${state_root}/scheduled-issues" \
|
|
73
|
-
"${state_root}/resident-workers/issue-queue/pending" \
|
|
74
|
-
"${frames_dir}" \
|
|
75
|
-
"${OUTPUT_DIR}"
|
|
76
|
-
|
|
77
|
-
sleep 600 &
|
|
78
|
-
controller_pid="$!"
|
|
79
|
-
|
|
80
|
-
cat >"${profile_dir}/control-plane.yaml" <<EOF
|
|
81
|
-
schema_version: "1"
|
|
82
|
-
id: "demo-retail"
|
|
83
|
-
repo:
|
|
84
|
-
slug: "example/retail-agent-demo"
|
|
85
|
-
root: "${tmpdir}/repo"
|
|
86
|
-
default_branch: "main"
|
|
87
|
-
runtime:
|
|
88
|
-
orchestrator_agent_root: "${tmpdir}/runtime/demo-retail"
|
|
89
|
-
worktree_root: "${tmpdir}/worktrees"
|
|
90
|
-
agent_repo_root: "${tmpdir}/repo"
|
|
91
|
-
runs_root: "${runs_root}"
|
|
92
|
-
state_root: "${state_root}"
|
|
93
|
-
history_root: "${tmpdir}/runtime/demo-retail/history"
|
|
94
|
-
retained_repo_root: "${tmpdir}/repo"
|
|
95
|
-
vscode_workspace_file: "${tmpdir}/demo-retail.code-workspace"
|
|
96
|
-
session_naming:
|
|
97
|
-
issue_prefix: "demo-issue-"
|
|
98
|
-
pr_prefix: "demo-pr-"
|
|
99
|
-
execution:
|
|
100
|
-
coding_worker: "openclaw"
|
|
101
|
-
openclaw:
|
|
102
|
-
model: "openrouter/sonic"
|
|
103
|
-
thinking: "adaptive"
|
|
104
|
-
timeout_seconds: 900
|
|
105
|
-
EOF
|
|
106
|
-
|
|
107
|
-
cat >"${runs_root}/demo-issue-14/run.env" <<'EOF'
|
|
108
|
-
TASK_KIND=issue
|
|
109
|
-
TASK_ID=14
|
|
110
|
-
SESSION=demo-issue-14
|
|
111
|
-
MODE=safe
|
|
112
|
-
STARTED_AT=2026-03-27T15:00:00Z
|
|
113
|
-
CODING_WORKER=openclaw
|
|
114
|
-
WORKTREE=/tmp/demo-worktree-14
|
|
115
|
-
BRANCH=agent/demo/issue-14
|
|
116
|
-
RESIDENT_WORKER_KEY=issue-lane-recurring-general-openclaw-safe
|
|
117
|
-
OPENCLAW_MODEL=openrouter/sonic
|
|
118
|
-
EOF
|
|
119
|
-
|
|
120
|
-
cat >"${runs_root}/demo-issue-14/runner.env" <<'EOF'
|
|
121
|
-
RUNNER_STATE=succeeded
|
|
122
|
-
THREAD_ID=thread-demo-14
|
|
123
|
-
LAST_EXIT_CODE=0
|
|
124
|
-
UPDATED_AT=2026-03-27T15:04:00Z
|
|
125
|
-
EOF
|
|
126
|
-
|
|
127
|
-
cat >"${runs_root}/demo-issue-14/result.env" <<'EOF'
|
|
128
|
-
OUTCOME=implemented
|
|
129
|
-
ACTION=host-publish-issue-pr
|
|
130
|
-
EOF
|
|
131
|
-
|
|
132
|
-
cat >"${runs_root}/demo-issue-17/run.env" <<'EOF'
|
|
133
|
-
TASK_KIND=issue
|
|
134
|
-
TASK_ID=17
|
|
135
|
-
SESSION=demo-issue-17
|
|
136
|
-
MODE=safe
|
|
137
|
-
STARTED_AT=2026-03-27T15:05:00Z
|
|
138
|
-
CODING_WORKER=openclaw
|
|
139
|
-
WORKTREE=/tmp/demo-worktree-17
|
|
140
|
-
BRANCH=agent/demo/issue-17
|
|
141
|
-
OPENCLAW_MODEL=openrouter/sonic
|
|
142
|
-
EOF
|
|
143
|
-
|
|
144
|
-
cat >"${runs_root}/demo-issue-17/runner.env" <<'EOF'
|
|
145
|
-
RUNNER_STATE=succeeded
|
|
146
|
-
THREAD_ID=thread-demo-17
|
|
147
|
-
LAST_EXIT_CODE=0
|
|
148
|
-
UPDATED_AT=2026-03-27T15:08:00Z
|
|
149
|
-
EOF
|
|
150
|
-
|
|
151
|
-
cat >"${runs_root}/demo-issue-17/result.env" <<'EOF'
|
|
152
|
-
OUTCOME=reported
|
|
153
|
-
ACTION=host-comment-scheduled-report
|
|
154
|
-
EOF
|
|
155
|
-
|
|
156
|
-
cat >"${runs_root}/demo-issue-21/run.env" <<'EOF'
|
|
157
|
-
TASK_KIND=issue
|
|
158
|
-
TASK_ID=21
|
|
159
|
-
SESSION=demo-issue-21
|
|
160
|
-
MODE=safe
|
|
161
|
-
STARTED_AT=2026-03-27T15:10:00Z
|
|
162
|
-
CODING_WORKER=openclaw
|
|
163
|
-
WORKTREE=/tmp/demo-worktree-21
|
|
164
|
-
BRANCH=agent/demo/issue-21
|
|
165
|
-
OPENCLAW_MODEL=openrouter/sonic
|
|
166
|
-
EOF
|
|
167
|
-
|
|
168
|
-
cat >"${runs_root}/demo-issue-21/runner.env" <<'EOF'
|
|
169
|
-
RUNNER_STATE=succeeded
|
|
170
|
-
THREAD_ID=thread-demo-21
|
|
171
|
-
LAST_EXIT_CODE=0
|
|
172
|
-
UPDATED_AT=2026-03-27T15:12:00Z
|
|
173
|
-
EOF
|
|
174
|
-
|
|
175
|
-
cat >"${runs_root}/demo-issue-21/result.env" <<'EOF'
|
|
176
|
-
OUTCOME=blocked
|
|
177
|
-
ACTION=host-comment-blocked
|
|
178
|
-
FAILURE_REASON=provider-quota-limit
|
|
179
|
-
EOF
|
|
180
|
-
|
|
181
|
-
cat >"${state_root}/resident-workers/issues/14/controller.env" <<EOF
|
|
182
|
-
ISSUE_ID=14
|
|
183
|
-
SESSION=demo-issue-14
|
|
184
|
-
CONTROLLER_PID=${controller_pid}
|
|
185
|
-
CONTROLLER_MODE=safe
|
|
186
|
-
CONTROLLER_LOOP_COUNT=4
|
|
187
|
-
CONTROLLER_STATE=waiting-provider
|
|
188
|
-
CONTROLLER_REASON=provider-cooldown
|
|
189
|
-
ACTIVE_RESIDENT_WORKER_KEY=issue-lane-recurring-general-openclaw-safe
|
|
190
|
-
ACTIVE_RESIDENT_LANE_KIND=recurring
|
|
191
|
-
ACTIVE_RESIDENT_LANE_VALUE=general
|
|
192
|
-
ACTIVE_PROVIDER_BACKEND=openclaw
|
|
193
|
-
ACTIVE_PROVIDER_MODEL=openrouter/sonic
|
|
194
|
-
PROVIDER_SWITCH_COUNT=1
|
|
195
|
-
PROVIDER_FAILOVER_COUNT=1
|
|
196
|
-
PROVIDER_WAIT_COUNT=2
|
|
197
|
-
PROVIDER_WAIT_TOTAL_SECONDS=45
|
|
198
|
-
PROVIDER_LAST_WAIT_SECONDS=21
|
|
199
|
-
UPDATED_AT=2026-03-27T15:13:00Z
|
|
200
|
-
EOF
|
|
201
|
-
|
|
202
|
-
cat >"${state_root}/resident-workers/issues/issue-lane-recurring-general-openclaw-safe/metadata.env" <<'EOF'
|
|
203
|
-
RESIDENT_WORKER_KIND=issue
|
|
204
|
-
RESIDENT_WORKER_SCOPE=lane
|
|
205
|
-
RESIDENT_WORKER_KEY=issue-lane-recurring-general-openclaw-safe
|
|
206
|
-
ISSUE_ID=14
|
|
207
|
-
CODING_WORKER=openclaw
|
|
208
|
-
TASK_COUNT=9
|
|
209
|
-
LAST_STATUS=running
|
|
210
|
-
LAST_STARTED_AT=2026-03-27T15:00:00Z
|
|
211
|
-
LAST_RUN_SESSION=demo-issue-14
|
|
212
|
-
LAST_OUTCOME=implemented
|
|
213
|
-
LAST_ACTION=host-publish-issue-pr
|
|
214
|
-
EOF
|
|
215
|
-
|
|
216
|
-
cat >"${state_root}/retries/providers/openclaw-openrouter-sonic.env" <<'EOF'
|
|
217
|
-
ATTEMPTS=2
|
|
218
|
-
NEXT_ATTEMPT_EPOCH=4102444800
|
|
219
|
-
NEXT_ATTEMPT_AT=2100-01-01T00:00:00Z
|
|
220
|
-
LAST_REASON=provider-quota-limit
|
|
221
|
-
UPDATED_AT=2026-03-27T15:14:00Z
|
|
222
|
-
EOF
|
|
223
|
-
|
|
224
|
-
cat >"${state_root}/scheduled-issues/17.env" <<'EOF'
|
|
225
|
-
INTERVAL_SECONDS=1800
|
|
226
|
-
LAST_STARTED_AT=2026-03-27T15:05:00Z
|
|
227
|
-
NEXT_DUE_AT=2026-03-27T15:35:00Z
|
|
228
|
-
UPDATED_AT=2026-03-27T15:05:00Z
|
|
229
|
-
EOF
|
|
230
|
-
|
|
231
|
-
cat >"${state_root}/scheduled-issues/44.env" <<'EOF'
|
|
232
|
-
INTERVAL_SECONDS=3600
|
|
233
|
-
LAST_STARTED_AT=2026-03-27T14:30:00Z
|
|
234
|
-
NEXT_DUE_AT=2026-03-27T15:30:00Z
|
|
235
|
-
UPDATED_AT=2026-03-27T14:30:00Z
|
|
236
|
-
EOF
|
|
237
|
-
|
|
238
|
-
cat >"${state_root}/resident-workers/issue-queue/pending/issue-27.env" <<'EOF'
|
|
239
|
-
ISSUE_ID=27
|
|
240
|
-
SESSION=demo-issue-27
|
|
241
|
-
UPDATED_AT=2026-03-27T15:14:00Z
|
|
242
|
-
EOF
|
|
243
|
-
|
|
244
|
-
cat >"${state_root}/resident-workers/issue-queue/pending/issue-28.env" <<'EOF'
|
|
245
|
-
ISSUE_ID=28
|
|
246
|
-
SESSION=demo-issue-28
|
|
247
|
-
UPDATED_AT=2026-03-27T15:15:00Z
|
|
248
|
-
EOF
|
|
249
|
-
|
|
250
|
-
ACP_PROFILE_REGISTRY_ROOT="${profile_registry_root}" \
|
|
251
|
-
python3 "${ROOT_DIR}/tools/dashboard/server.py" \
|
|
252
|
-
--host 127.0.0.1 \
|
|
253
|
-
--port "${port}" \
|
|
254
|
-
>"${tmpdir}/server.log" 2>&1 &
|
|
255
|
-
server_pid="$!"
|
|
256
|
-
|
|
257
|
-
dashboard_url="http://127.0.0.1:${port}"
|
|
258
|
-
|
|
259
|
-
for _ in $(seq 1 40); do
|
|
260
|
-
if curl -sf "${dashboard_url}/api/snapshot.json" >/dev/null 2>&1; then
|
|
261
|
-
break
|
|
262
|
-
fi
|
|
263
|
-
sleep 0.25
|
|
264
|
-
done
|
|
265
|
-
|
|
266
|
-
if ! curl -sf "${dashboard_url}/api/snapshot.json" >/dev/null 2>&1; then
|
|
267
|
-
cat "${tmpdir}/server.log" >&2
|
|
268
|
-
echo "failed to start dashboard demo server" >&2
|
|
269
|
-
exit 1
|
|
270
|
-
fi
|
|
271
|
-
|
|
272
|
-
cat >"${tmpdir}/capture-demo.js" <<'EOF'
|
|
273
|
-
const fs = require("fs");
|
|
274
|
-
const path = require("path");
|
|
275
|
-
const { chromium } = require(process.env.PLAYWRIGHT_PACKAGE_ROOT);
|
|
276
|
-
|
|
277
|
-
async function captureFrame(page, target, filename) {
|
|
278
|
-
await page.evaluate((top) => window.scrollTo({ top, behavior: "instant" }), target);
|
|
279
|
-
await page.waitForTimeout(350);
|
|
280
|
-
await page.screenshot({ path: filename });
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
(async () => {
|
|
284
|
-
const pngOut = process.env.ACP_PNG_OUT;
|
|
285
|
-
const framesDir = process.env.ACP_FRAMES_DIR;
|
|
286
|
-
const url = process.env.ACP_DEMO_URL;
|
|
287
|
-
|
|
288
|
-
fs.mkdirSync(path.dirname(pngOut), { recursive: true });
|
|
289
|
-
fs.mkdirSync(framesDir, { recursive: true });
|
|
290
|
-
|
|
291
|
-
const browser = await chromium.launch({ headless: true });
|
|
292
|
-
const page = await browser.newPage({
|
|
293
|
-
viewport: { width: 1440, height: 1080 },
|
|
294
|
-
deviceScaleFactor: 1,
|
|
295
|
-
colorScheme: "light",
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
await page.goto(url, { waitUntil: "networkidle" });
|
|
299
|
-
await page.waitForTimeout(800);
|
|
300
|
-
await page.screenshot({ path: pngOut, fullPage: true });
|
|
301
|
-
|
|
302
|
-
await captureFrame(page, 0, path.join(framesDir, "frame-00.png"));
|
|
303
|
-
await page.click("#refresh-button");
|
|
304
|
-
await page.waitForTimeout(500);
|
|
305
|
-
await captureFrame(page, 0, path.join(framesDir, "frame-01.png"));
|
|
306
|
-
await captureFrame(page, 900, path.join(framesDir, "frame-02.png"));
|
|
307
|
-
await captureFrame(page, 1700, path.join(framesDir, "frame-03.png"));
|
|
308
|
-
await captureFrame(page, 0, path.join(framesDir, "frame-04.png"));
|
|
309
|
-
|
|
310
|
-
await browser.close();
|
|
311
|
-
})().catch((error) => {
|
|
312
|
-
console.error(error);
|
|
313
|
-
process.exit(1);
|
|
314
|
-
});
|
|
315
|
-
EOF
|
|
316
|
-
|
|
317
|
-
PLAYWRIGHT_PACKAGE_ROOT="${PLAYWRIGHT_PACKAGE_ROOT}" \
|
|
318
|
-
ACP_DEMO_URL="${dashboard_url}" \
|
|
319
|
-
ACP_PNG_OUT="${PNG_OUT}" \
|
|
320
|
-
ACP_FRAMES_DIR="${frames_dir}" \
|
|
321
|
-
node "${tmpdir}/capture-demo.js"
|
|
322
|
-
|
|
323
|
-
ffmpeg \
|
|
324
|
-
-y \
|
|
325
|
-
-framerate 1.25 \
|
|
326
|
-
-i "${frames_dir}/frame-%02d.png" \
|
|
327
|
-
-vf "fps=10,scale=1200:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse=dither=bayer" \
|
|
328
|
-
"${GIF_OUT}" \
|
|
329
|
-
>/dev/null 2>&1
|
|
330
|
-
|
|
331
|
-
echo "DASHBOARD_DEMO_URL=${dashboard_url}"
|
|
332
|
-
echo "PNG_OUT=${PNG_OUT}"
|
|
333
|
-
echo "GIF_OUT=${GIF_OUT}"
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
-
FLOW_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
|
6
|
-
CLI_SCRIPT="${FLOW_ROOT}/npm/bin/agent-control-plane.js"
|
|
7
|
-
PACKAGE_VERSION="$(node -p "require('${FLOW_ROOT}/package.json').version")"
|
|
8
|
-
|
|
9
|
-
tmpdir="$(mktemp -d)"
|
|
10
|
-
trap 'rm -rf "${tmpdir}"' EXIT
|
|
11
|
-
|
|
12
|
-
platform_home="${tmpdir}/platform"
|
|
13
|
-
home_dir="${tmpdir}/home"
|
|
14
|
-
fake_bin="${tmpdir}/fake-bin"
|
|
15
|
-
mkdir -p "${platform_home}" "${home_dir}"
|
|
16
|
-
mkdir -p "${fake_bin}"
|
|
17
|
-
|
|
18
|
-
cat >"${fake_bin}/gh" <<'EOF'
|
|
19
|
-
#!/usr/bin/env bash
|
|
20
|
-
set -euo pipefail
|
|
21
|
-
|
|
22
|
-
if [[ "${1:-}" == "auth" && "${2:-}" == "status" ]]; then
|
|
23
|
-
echo "gh auth ok"
|
|
24
|
-
exit 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
if [[ "${1:-}" == "auth" && "${2:-}" == "login" ]]; then
|
|
28
|
-
echo "gh auth login stub"
|
|
29
|
-
exit 0
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
echo "gh stub: unsupported invocation: $*" >&2
|
|
33
|
-
exit 0
|
|
34
|
-
EOF
|
|
35
|
-
|
|
36
|
-
cat >"${fake_bin}/jq" <<'EOF'
|
|
37
|
-
#!/usr/bin/env bash
|
|
38
|
-
exit 0
|
|
39
|
-
EOF
|
|
40
|
-
|
|
41
|
-
cat >"${fake_bin}/codex" <<'EOF'
|
|
42
|
-
#!/usr/bin/env bash
|
|
43
|
-
if [[ "${1:-}" == "--version" ]]; then
|
|
44
|
-
echo "codex stub 0.0.0"
|
|
45
|
-
exit 0
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
if [[ "${1:-}" == "login" && "${2:-}" == "status" ]]; then
|
|
49
|
-
echo "codex login ok"
|
|
50
|
-
exit 0
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
echo "codex stub"
|
|
54
|
-
exit 0
|
|
55
|
-
EOF
|
|
56
|
-
|
|
57
|
-
chmod +x "${fake_bin}/gh" "${fake_bin}/jq" "${fake_bin}/codex"
|
|
58
|
-
|
|
59
|
-
help_output="$(
|
|
60
|
-
HOME="${home_dir}" \
|
|
61
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
62
|
-
node "${CLI_SCRIPT}" help
|
|
63
|
-
)"
|
|
64
|
-
|
|
65
|
-
grep -q '^Usage:$' <<<"${help_output}"
|
|
66
|
-
grep -q '^ setup' <<<"${help_output}"
|
|
67
|
-
grep -q '^ sync' <<<"${help_output}"
|
|
68
|
-
grep -q '^ profile-smoke' <<<"${help_output}"
|
|
69
|
-
grep -q '^ launchd-install' <<<"${help_output}"
|
|
70
|
-
grep -q '^ remove' <<<"${help_output}"
|
|
71
|
-
|
|
72
|
-
version_output="$(
|
|
73
|
-
HOME="${home_dir}" \
|
|
74
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
75
|
-
node "${CLI_SCRIPT}" version
|
|
76
|
-
)"
|
|
77
|
-
|
|
78
|
-
grep -q "^${PACKAGE_VERSION}$" <<<"${version_output}"
|
|
79
|
-
|
|
80
|
-
HOME="${home_dir}" \
|
|
81
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
82
|
-
node "${CLI_SCRIPT}" sync >/dev/null
|
|
83
|
-
|
|
84
|
-
test -f "${platform_home}/runtime-home/skills/openclaw/agent-control-plane/SKILL.md"
|
|
85
|
-
test -f "${platform_home}/runtime-home/tools/bin/flow-runtime-doctor.sh"
|
|
86
|
-
test -f "${platform_home}/runtime-home/skills/openclaw/agent-control-plane/tools/bin/codex-quota"
|
|
87
|
-
test -f "${platform_home}/runtime-home/skills/openclaw/agent-control-plane/tools/vendor/codex-quota-manager/scripts/auto-switch.sh"
|
|
88
|
-
|
|
89
|
-
doctor_output="$(
|
|
90
|
-
HOME="${home_dir}" \
|
|
91
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
92
|
-
node "${CLI_SCRIPT}" doctor
|
|
93
|
-
)"
|
|
94
|
-
|
|
95
|
-
grep -q '^CONTROL_PLANE_NAME=agent-control-plane$' <<<"${doctor_output}"
|
|
96
|
-
grep -q '^SOURCE_READY=yes$' <<<"${doctor_output}"
|
|
97
|
-
|
|
98
|
-
init_output="$(
|
|
99
|
-
HOME="${home_dir}" \
|
|
100
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
101
|
-
node "${CLI_SCRIPT}" init \
|
|
102
|
-
--profile-id alpha \
|
|
103
|
-
--repo-slug example-owner/alpha \
|
|
104
|
-
--allow-missing-repo \
|
|
105
|
-
--skip-anchor-sync \
|
|
106
|
-
--skip-workspace-sync
|
|
107
|
-
)"
|
|
108
|
-
|
|
109
|
-
grep -q '^PROJECT_INIT_STATUS=ok$' <<<"${init_output}"
|
|
110
|
-
grep -q '^PROFILE_ID=alpha$' <<<"${init_output}"
|
|
111
|
-
grep -q "^RUNTIME_HOME=${platform_home}/runtime-home$" <<<"${init_output}"
|
|
112
|
-
|
|
113
|
-
profile_smoke_output="$(
|
|
114
|
-
HOME="${home_dir}" \
|
|
115
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
116
|
-
node "${CLI_SCRIPT}" profile-smoke --profile-id alpha
|
|
117
|
-
)"
|
|
118
|
-
|
|
119
|
-
grep -q '^PROFILE_ID=alpha$' <<<"${profile_smoke_output}"
|
|
120
|
-
grep -q '^PROFILE_STATUS=ok$' <<<"${profile_smoke_output}"
|
|
121
|
-
|
|
122
|
-
runtime_status_output="$(
|
|
123
|
-
HOME="${home_dir}" \
|
|
124
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
125
|
-
node "${CLI_SCRIPT}" runtime status --profile-id alpha
|
|
126
|
-
)"
|
|
127
|
-
|
|
128
|
-
grep -q '^PROFILE_ID=alpha$' <<<"${runtime_status_output}"
|
|
129
|
-
grep -q "^CONFIG_YAML=${platform_home}/control-plane/profiles/alpha/control-plane.yaml$" <<<"${runtime_status_output}"
|
|
130
|
-
|
|
131
|
-
launchd_help="$(
|
|
132
|
-
HOME="${home_dir}" \
|
|
133
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
134
|
-
node "${CLI_SCRIPT}" launchd-install --help
|
|
135
|
-
)"
|
|
136
|
-
|
|
137
|
-
grep -q '^Usage:$' <<<"${launchd_help}"
|
|
138
|
-
|
|
139
|
-
remove_help="$(
|
|
140
|
-
HOME="${home_dir}" \
|
|
141
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
142
|
-
node "${CLI_SCRIPT}" remove --help
|
|
143
|
-
)"
|
|
144
|
-
|
|
145
|
-
grep -q '^Usage:$' <<<"${remove_help}"
|
|
146
|
-
|
|
147
|
-
setup_help="$(
|
|
148
|
-
HOME="${home_dir}" \
|
|
149
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
150
|
-
node "${CLI_SCRIPT}" setup --help
|
|
151
|
-
)"
|
|
152
|
-
|
|
153
|
-
grep -q -- '--install-missing-deps' <<<"${setup_help}"
|
|
154
|
-
grep -q -- '--no-install-missing-deps' <<<"${setup_help}"
|
|
155
|
-
grep -q -- '--install-missing-backend' <<<"${setup_help}"
|
|
156
|
-
grep -q -- '--no-install-missing-backend' <<<"${setup_help}"
|
|
157
|
-
grep -q -- '--gh-auth-login' <<<"${setup_help}"
|
|
158
|
-
grep -q -- '--no-gh-auth-login' <<<"${setup_help}"
|
|
159
|
-
grep -q -- '--dry-run' <<<"${setup_help}"
|
|
160
|
-
grep -q -- '--plan' <<<"${setup_help}"
|
|
161
|
-
grep -q -- '--json' <<<"${setup_help}"
|
|
162
|
-
|
|
163
|
-
setup_repo="${tmpdir}/setup-demo"
|
|
164
|
-
mkdir -p "${setup_repo}"
|
|
165
|
-
git -C "${setup_repo}" init -q -b main
|
|
166
|
-
git -C "${setup_repo}" config user.name "ACP Test"
|
|
167
|
-
git -C "${setup_repo}" config user.email "acp-test@example.com"
|
|
168
|
-
printf '# setup demo\n' >"${setup_repo}/README.md"
|
|
169
|
-
git -C "${setup_repo}" add README.md
|
|
170
|
-
git -C "${setup_repo}" commit -q -m "init"
|
|
171
|
-
git -C "${setup_repo}" remote add origin "https://github.com/example-owner/setup-demo.git"
|
|
172
|
-
|
|
173
|
-
setup_output="$(
|
|
174
|
-
HOME="${home_dir}" \
|
|
175
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
176
|
-
PATH="${fake_bin}:${PATH}" \
|
|
177
|
-
node "${CLI_SCRIPT}" setup \
|
|
178
|
-
--non-interactive \
|
|
179
|
-
--repo-root "${setup_repo}" \
|
|
180
|
-
--no-start-runtime \
|
|
181
|
-
--skip-anchor-sync \
|
|
182
|
-
--skip-workspace-sync
|
|
183
|
-
)"
|
|
184
|
-
|
|
185
|
-
grep -q '^SETUP_STATUS=ok$' <<<"${setup_output}"
|
|
186
|
-
grep -q '^PROFILE_ID=setup-demo$' <<<"${setup_output}"
|
|
187
|
-
grep -q '^REPO_SLUG=example-owner/setup-demo$' <<<"${setup_output}"
|
|
188
|
-
grep -q '^CODING_WORKER=' <<<"${setup_output}"
|
|
189
|
-
grep -q '^CORE_TOOLS_STATUS=ok$' <<<"${setup_output}"
|
|
190
|
-
grep -q '^WORKER_BACKEND_COMMAND=' <<<"${setup_output}"
|
|
191
|
-
grep -q '^WORKER_BACKEND_STATUS=ok$' <<<"${setup_output}"
|
|
192
|
-
grep -q '^WORKER_SETUP_GUIDE_STATUS=' <<<"${setup_output}"
|
|
193
|
-
grep -q '^WORKER_BACKEND_INSTALL_STATUS=' <<<"${setup_output}"
|
|
194
|
-
grep -q '^WORKER_SETUP_DOCS_OPENED=' <<<"${setup_output}"
|
|
195
|
-
grep -q '^WORKER_BACKEND_DOCS_URL=' <<<"${setup_output}"
|
|
196
|
-
grep -q '^WORKER_BACKEND_AUTH_EXAMPLE=' <<<"${setup_output}"
|
|
197
|
-
grep -q '^WORKER_BACKEND_VERIFY_EXAMPLE=' <<<"${setup_output}"
|
|
198
|
-
grep -q '^GITHUB_AUTH_STATUS=' <<<"${setup_output}"
|
|
199
|
-
grep -q '^FINAL_FIXUP_STATUS=' <<<"${setup_output}"
|
|
200
|
-
grep -q '^FINAL_FIXUP_ACTIONS=' <<<"${setup_output}"
|
|
201
|
-
grep -q '^DEPENDENCY_INSTALL_STATUS=' <<<"${setup_output}"
|
|
202
|
-
grep -q '^GITHUB_AUTH_STEP_STATUS=' <<<"${setup_output}"
|
|
203
|
-
grep -q '^PROJECT_INIT_STATUS=ok$' <<<"${setup_output}"
|
|
204
|
-
grep -q '^DOCTOR_STATUS=ok$' <<<"${setup_output}"
|
|
205
|
-
grep -q '^RUNTIME_START_STATUS=skipped$' <<<"${setup_output}"
|
|
206
|
-
grep -q '^RUNTIME_START_REASON=not-requested$' <<<"${setup_output}"
|
|
207
|
-
test -f "${platform_home}/control-plane/profiles/setup-demo/control-plane.yaml"
|
|
208
|
-
|
|
209
|
-
setup_dry_run_output="$(
|
|
210
|
-
HOME="${home_dir}" \
|
|
211
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
212
|
-
PATH="${fake_bin}:${PATH}" \
|
|
213
|
-
node "${CLI_SCRIPT}" setup \
|
|
214
|
-
--dry-run \
|
|
215
|
-
--non-interactive \
|
|
216
|
-
--repo-root "${setup_repo}" \
|
|
217
|
-
--no-start-runtime \
|
|
218
|
-
--skip-anchor-sync \
|
|
219
|
-
--skip-workspace-sync
|
|
220
|
-
)"
|
|
221
|
-
|
|
222
|
-
grep -q '^SETUP_STATUS=dry-run$' <<<"${setup_dry_run_output}"
|
|
223
|
-
grep -q '^SETUP_MODE=dry-run$' <<<"${setup_dry_run_output}"
|
|
224
|
-
grep -q '^PROJECT_INIT_STATUS=would-run$' <<<"${setup_dry_run_output}"
|
|
225
|
-
grep -q '^DOCTOR_STATUS=would-run$' <<<"${setup_dry_run_output}"
|
|
226
|
-
grep -q '^FINAL_FIXUP_STATUS=planned$' <<<"${setup_dry_run_output}"
|
|
227
|
-
grep -q '^FINAL_FIXUP_ACTIONS=review-plan$' <<<"${setup_dry_run_output}"
|
|
228
|
-
|
|
229
|
-
setup_json_output="$(
|
|
230
|
-
HOME="${home_dir}" \
|
|
231
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
232
|
-
PATH="${fake_bin}:${PATH}" \
|
|
233
|
-
node "${CLI_SCRIPT}" setup \
|
|
234
|
-
--json \
|
|
235
|
-
--repo-root "${setup_repo}" \
|
|
236
|
-
--profile-id setup-json \
|
|
237
|
-
--no-start-runtime \
|
|
238
|
-
--skip-anchor-sync \
|
|
239
|
-
--skip-workspace-sync
|
|
240
|
-
)"
|
|
241
|
-
|
|
242
|
-
printf '%s' "${setup_json_output}" | node -e '
|
|
243
|
-
const fs = require("fs");
|
|
244
|
-
const data = JSON.parse(fs.readFileSync(0, "utf8"));
|
|
245
|
-
if (data.setupStatus !== "ok") process.exit(1);
|
|
246
|
-
if (data.setupMode !== "run") process.exit(1);
|
|
247
|
-
if (data.profileId !== "setup-json") process.exit(1);
|
|
248
|
-
if (data.projectInitStatus !== "ok") process.exit(1);
|
|
249
|
-
if (data.doctorStatus !== "ok") process.exit(1);
|
|
250
|
-
if (!data.workerBackend || !data.githubAuth || !data.finalFixup) process.exit(1);
|
|
251
|
-
'
|
|
252
|
-
|
|
253
|
-
setup_dry_run_json_output="$(
|
|
254
|
-
HOME="${home_dir}" \
|
|
255
|
-
AGENT_PLATFORM_HOME="${platform_home}" \
|
|
256
|
-
PATH="${fake_bin}:${PATH}" \
|
|
257
|
-
node "${CLI_SCRIPT}" setup \
|
|
258
|
-
--json \
|
|
259
|
-
--dry-run \
|
|
260
|
-
--repo-root "${setup_repo}" \
|
|
261
|
-
--profile-id dry-run-json \
|
|
262
|
-
--no-start-runtime \
|
|
263
|
-
--skip-anchor-sync \
|
|
264
|
-
--skip-workspace-sync
|
|
265
|
-
)"
|
|
266
|
-
|
|
267
|
-
printf '%s' "${setup_dry_run_json_output}" | node -e '
|
|
268
|
-
const fs = require("fs");
|
|
269
|
-
const data = JSON.parse(fs.readFileSync(0, "utf8"));
|
|
270
|
-
if (data.setupStatus !== "dry-run") process.exit(1);
|
|
271
|
-
if (data.setupMode !== "dry-run") process.exit(1);
|
|
272
|
-
if (data.profileId !== "dry-run-json") process.exit(1);
|
|
273
|
-
if (data.projectInitStatus !== "would-run") process.exit(1);
|
|
274
|
-
if (data.doctorStatus !== "would-run") process.exit(1);
|
|
275
|
-
if (!data.finalFixup || data.finalFixup.status !== "planned") process.exit(1);
|
|
276
|
-
if (data.dependencyInstall && data.dependencyInstall.status === "not-needed" && data.dependencyInstall.command !== "") process.exit(1);
|
|
277
|
-
if (data.workerBackend && data.workerBackend.installStatus === "not-needed" && data.workerBackend.installCommand !== "") process.exit(1);
|
|
278
|
-
'
|
|
279
|
-
|
|
280
|
-
test ! -e "${platform_home}/control-plane/profiles/dry-run-json/control-plane.yaml"
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
FLOW_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
5
|
-
SCRIPT_SRC="${FLOW_ROOT}/tools/bin/agent-github-update-labels"
|
|
6
|
-
CONFIG_LIB_SRC="${FLOW_ROOT}/tools/bin/flow-config-lib.sh"
|
|
7
|
-
SHELL_LIB_SRC="${FLOW_ROOT}/tools/bin/flow-shell-lib.sh"
|
|
8
|
-
|
|
9
|
-
tmpdir="$(mktemp -d)"
|
|
10
|
-
trap 'rm -rf "$tmpdir"' EXIT
|
|
11
|
-
|
|
12
|
-
bin_dir="$tmpdir/bin"
|
|
13
|
-
payload_file="$tmpdir/payload.json"
|
|
14
|
-
mkdir -p "$bin_dir"
|
|
15
|
-
|
|
16
|
-
cp "$SCRIPT_SRC" "$bin_dir/agent-github-update-labels"
|
|
17
|
-
cp "$CONFIG_LIB_SRC" "$bin_dir/flow-config-lib.sh"
|
|
18
|
-
cp "$SHELL_LIB_SRC" "$bin_dir/flow-shell-lib.sh"
|
|
19
|
-
|
|
20
|
-
cat >"$bin_dir/gh" <<'EOF'
|
|
21
|
-
#!/usr/bin/env bash
|
|
22
|
-
set -euo pipefail
|
|
23
|
-
|
|
24
|
-
if [[ "${1:-}" == "api" ]]; then
|
|
25
|
-
route="${2:-}"
|
|
26
|
-
if [[ "$route" == "repos/example/demo/issues/42" ]]; then
|
|
27
|
-
echo '{"message":"Not Found"}' >&2
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
if [[ "$route" == user/repos\?* ]]; then
|
|
31
|
-
printf '[[{"id":123,"full_name":"example/demo"}]]\n'
|
|
32
|
-
exit 0
|
|
33
|
-
fi
|
|
34
|
-
if [[ "$route" == "repositories/123/issues/42" ]]; then
|
|
35
|
-
if [[ " $* " == *" --method PATCH "* ]]; then
|
|
36
|
-
cat >"${TEST_PAYLOAD_FILE:?}"
|
|
37
|
-
exit 0
|
|
38
|
-
fi
|
|
39
|
-
printf '{"labels":[{"name":"agent-blocked"}]}\n'
|
|
40
|
-
exit 0
|
|
41
|
-
fi
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
echo "unexpected gh invocation: $*" >&2
|
|
45
|
-
exit 1
|
|
46
|
-
EOF
|
|
47
|
-
chmod +x "$bin_dir/gh" "$bin_dir/agent-github-update-labels"
|
|
48
|
-
|
|
49
|
-
TEST_PAYLOAD_FILE="$payload_file" \
|
|
50
|
-
PATH="$bin_dir:$PATH" \
|
|
51
|
-
bash "$bin_dir/agent-github-update-labels" --repo-slug example/demo --number 42 --add agent-running --remove agent-blocked
|
|
52
|
-
|
|
53
|
-
test "$(jq -r '.labels[0]' "$payload_file")" = "agent-running"
|
|
54
|
-
test "$(jq '.labels | length' "$payload_file")" -eq 1
|
|
55
|
-
|
|
56
|
-
echo "agent github update labels falls back to repository id test passed"
|