agent-control-plane 0.1.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/LICENSE +21 -0
- package/README.md +589 -0
- package/SKILL.md +149 -0
- package/assets/workflow-catalog.json +57 -0
- package/bin/audit-issue-routing.sh +74 -0
- package/bin/issue-resource-class.sh +58 -0
- package/bin/label-follow-up-issues.sh +114 -0
- package/bin/pr-risk.sh +532 -0
- package/bin/sync-pr-labels.sh +112 -0
- package/hooks/heartbeat-hooks.sh +573 -0
- package/hooks/issue-reconcile-hooks.sh +217 -0
- package/hooks/pr-reconcile-hooks.sh +225 -0
- package/npm/bin/agent-control-plane.js +1984 -0
- package/npm/public-bin/agent-control-plane +3 -0
- package/package.json +61 -0
- package/tools/bin/agent-cleanup-worktree +247 -0
- package/tools/bin/agent-github-update-labels +66 -0
- package/tools/bin/agent-init-worktree +216 -0
- package/tools/bin/agent-project-archive-run +52 -0
- package/tools/bin/agent-project-capture-worker +46 -0
- package/tools/bin/agent-project-catch-up-merged-prs +137 -0
- package/tools/bin/agent-project-cleanup-session +244 -0
- package/tools/bin/agent-project-detached-launch +107 -0
- package/tools/bin/agent-project-heartbeat-loop +2347 -0
- package/tools/bin/agent-project-open-issue-worktree +89 -0
- package/tools/bin/agent-project-open-pr-worktree +80 -0
- package/tools/bin/agent-project-publish-issue-pr +349 -0
- package/tools/bin/agent-project-reconcile-issue-session +1128 -0
- package/tools/bin/agent-project-reconcile-pr-session +1005 -0
- package/tools/bin/agent-project-retry-state +147 -0
- package/tools/bin/agent-project-run-claude-session +657 -0
- package/tools/bin/agent-project-run-codex-resilient +718 -0
- package/tools/bin/agent-project-run-codex-session +316 -0
- package/tools/bin/agent-project-run-kilo-session +27 -0
- package/tools/bin/agent-project-run-openclaw-session +984 -0
- package/tools/bin/agent-project-run-opencode-session +27 -0
- package/tools/bin/agent-project-sync-anchor-repo +128 -0
- package/tools/bin/agent-project-worker-status +143 -0
- package/tools/bin/audit-agent-worktrees.sh +310 -0
- package/tools/bin/audit-issue-routing.sh +11 -0
- package/tools/bin/audit-retained-layout.sh +58 -0
- package/tools/bin/audit-retained-overlap.sh +135 -0
- package/tools/bin/audit-retained-worktrees.sh +228 -0
- package/tools/bin/branch-verification-guard.sh +351 -0
- package/tools/bin/capture-worker.sh +18 -0
- package/tools/bin/check-skill-contracts.sh +324 -0
- package/tools/bin/cleanup-worktree.sh +44 -0
- package/tools/bin/codex-quota +31 -0
- package/tools/bin/create-follow-up-issue.sh +114 -0
- package/tools/bin/dashboard-launchd-bootstrap.sh +38 -0
- package/tools/bin/flow-config-lib.sh +2127 -0
- package/tools/bin/flow-resident-worker-lib.sh +683 -0
- package/tools/bin/flow-runtime-doctor.sh +97 -0
- package/tools/bin/flow-shell-lib.sh +266 -0
- package/tools/bin/heartbeat-recovery-preflight.sh +106 -0
- package/tools/bin/heartbeat-safe-auto.sh +551 -0
- package/tools/bin/install-dashboard-launchd.sh +152 -0
- package/tools/bin/install-project-launchd.sh +219 -0
- package/tools/bin/issue-publish-scope-guard.sh +242 -0
- package/tools/bin/issue-requires-local-workspace-install.sh +31 -0
- package/tools/bin/issue-resource-class.sh +12 -0
- package/tools/bin/kick-scheduler.sh +75 -0
- package/tools/bin/label-follow-up-issues.sh +14 -0
- package/tools/bin/new-pr-worktree.sh +50 -0
- package/tools/bin/new-worktree.sh +49 -0
- package/tools/bin/pr-risk.sh +12 -0
- package/tools/bin/prepare-worktree.sh +140 -0
- package/tools/bin/profile-activate.sh +109 -0
- package/tools/bin/profile-adopt.sh +219 -0
- package/tools/bin/profile-smoke.sh +461 -0
- package/tools/bin/project-init.sh +189 -0
- package/tools/bin/project-launchd-bootstrap.sh +54 -0
- package/tools/bin/project-remove.sh +155 -0
- package/tools/bin/project-runtime-supervisor.sh +56 -0
- package/tools/bin/project-runtimectl.sh +586 -0
- package/tools/bin/provider-cooldown-state.sh +166 -0
- package/tools/bin/publish-issue-worker.sh +31 -0
- package/tools/bin/reconcile-issue-worker.sh +34 -0
- package/tools/bin/reconcile-pr-worker.sh +34 -0
- package/tools/bin/record-verification.sh +71 -0
- package/tools/bin/render-architecture-infographics.sh +110 -0
- package/tools/bin/render-dashboard-demo-media.sh +333 -0
- package/tools/bin/render-dashboard-snapshot.py +16 -0
- package/tools/bin/render-flow-config.sh +86 -0
- package/tools/bin/retry-state.sh +31 -0
- package/tools/bin/reuse-issue-worktree.sh +75 -0
- package/tools/bin/run-codex-bypass.sh +3 -0
- package/tools/bin/run-codex-safe.sh +3 -0
- package/tools/bin/run-codex-task.sh +231 -0
- package/tools/bin/scaffold-profile.sh +374 -0
- package/tools/bin/serve-dashboard.sh +5 -0
- package/tools/bin/split-retained-slice.sh +124 -0
- package/tools/bin/start-issue-worker.sh +796 -0
- package/tools/bin/start-pr-fix-worker.sh +458 -0
- package/tools/bin/start-pr-merge-repair-worker.sh +8 -0
- package/tools/bin/start-pr-review-worker.sh +227 -0
- package/tools/bin/start-resident-issue-loop.sh +908 -0
- package/tools/bin/sync-agent-repo.sh +52 -0
- package/tools/bin/sync-dependency-baseline.sh +247 -0
- package/tools/bin/sync-pr-labels.sh +12 -0
- package/tools/bin/sync-recurring-issue-checklist.sh +274 -0
- package/tools/bin/sync-shared-agent-home.sh +214 -0
- package/tools/bin/sync-vscode-workspace.sh +157 -0
- package/tools/bin/test-smoke.sh +63 -0
- package/tools/bin/uninstall-project-launchd.sh +55 -0
- package/tools/bin/update-github-labels.sh +14 -0
- package/tools/bin/worker-status.sh +19 -0
- package/tools/bin/workflow-catalog.sh +77 -0
- package/tools/dashboard/app.js +286 -0
- package/tools/dashboard/dashboard_snapshot.py +466 -0
- package/tools/dashboard/index.html +41 -0
- package/tools/dashboard/server.py +64 -0
- package/tools/dashboard/styles.css +351 -0
- package/tools/templates/issue-prompt-template.md +109 -0
- package/tools/templates/pr-fix-template.md +120 -0
- package/tools/templates/pr-merge-repair-template.md +91 -0
- package/tools/templates/pr-review-template.md +62 -0
- package/tools/templates/scheduled-issue-prompt-template.md +62 -0
- package/tools/tests/test-agent-control-plane-npm-cli.sh +279 -0
- package/tools/tests/test-agent-github-update-labels-falls-back-to-repository-id.sh +56 -0
- package/tools/tests/test-agent-project-claude-session-wrapper-clears-stale-sandbox-artifacts.sh +89 -0
- package/tools/tests/test-agent-project-claude-session-wrapper-does-not-retry-provider-quota.sh +82 -0
- package/tools/tests/test-agent-project-claude-session-wrapper-retries-transient-failures.sh +90 -0
- package/tools/tests/test-agent-project-claude-session-wrapper-times-out.sh +73 -0
- package/tools/tests/test-agent-project-claude-session-wrapper.sh +103 -0
- package/tools/tests/test-agent-project-cleanup-session-orphan-fallback.sh +90 -0
- package/tools/tests/test-agent-project-cleanup-session-skip-worktree-cleanup.sh +90 -0
- package/tools/tests/test-agent-project-codex-live-thread-persist.sh +76 -0
- package/tools/tests/test-agent-project-codex-recovery.sh +731 -0
- package/tools/tests/test-agent-project-codex-session-wrapper-clears-stale-sandbox-artifacts.sh +105 -0
- package/tools/tests/test-agent-project-codex-session-wrapper.sh +97 -0
- package/tools/tests/test-agent-project-open-pr-worktree-config-prefix.sh +81 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-clears-stale-sandbox-artifacts.sh +109 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-infers-blocked-result-contract.sh +89 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-literal-env-artifacts.sh +113 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-recovers-version-mismatch.sh +135 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-resident.sh +179 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-reuses-existing-agent-after-add-race.sh +119 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper-terminates-rate-limit-hang.sh +91 -0
- package/tools/tests/test-agent-project-openclaw-session-wrapper.sh +117 -0
- package/tools/tests/test-agent-project-publish-issue-pr-prunes-stale-worktree-entry.sh +148 -0
- package/tools/tests/test-agent-project-publish-issue-pr-reads-archived-session.sh +146 -0
- package/tools/tests/test-agent-project-publish-issue-pr-recovers-final-head.sh +145 -0
- package/tools/tests/test-agent-project-publish-issue-pr-reuses-existing-worktree.sh +147 -0
- package/tools/tests/test-agent-project-reconcile-failure-reason.sh +456 -0
- package/tools/tests/test-agent-project-reconcile-issue-archived-session-fallback.sh +96 -0
- package/tools/tests/test-agent-project-reconcile-issue-before-blocked.sh +90 -0
- package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery-uses-recovered-worktree.sh +212 -0
- package/tools/tests/test-agent-project-reconcile-issue-host-verification-recovery.sh +207 -0
- package/tools/tests/test-agent-project-reconcile-issue-provider-quota-schedules-provider-cooldown.sh +101 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-backfills-lane-metadata-from-worker-key.sh +113 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-clears-stale-failed-summary.sh +117 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-initializes-shared-agent-home.sh +55 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-normalizes-runner-state.sh +125 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-records-invalid-contract-summary.sh +118 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-skips-duplicate-blocked-comment.sh +144 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-standardizes-no-commits-blocker.sh +145 -0
- package/tools/tests/test-agent-project-reconcile-issue-session-synthesizes-blocked-comment.sh +139 -0
- package/tools/tests/test-agent-project-reconcile-pr-blocked-host-recovery.sh +242 -0
- package/tools/tests/test-agent-project-reconcile-pr-guard-blocked-no-commit.sh +142 -0
- package/tools/tests/test-agent-project-reconcile-pr-provider-quota-schedules-provider-cooldown.sh +106 -0
- package/tools/tests/test-agent-project-reconcile-pr-session-initializes-shared-agent-home.sh +66 -0
- package/tools/tests/test-agent-project-reconcile-pr-updated-branch-noop.sh +129 -0
- package/tools/tests/test-audit-agent-worktrees-active-launch-skips-git-inspection.sh +69 -0
- package/tools/tests/test-audit-agent-worktrees-broken-worktree.sh +43 -0
- package/tools/tests/test-audit-agent-worktrees-pending-launch-owner.sh +46 -0
- package/tools/tests/test-audit-agent-worktrees-unreconciled-owner.sh +79 -0
- package/tools/tests/test-audit-issue-routing-managed-branch-globs.sh +56 -0
- package/tools/tests/test-branch-verification-guard-generated-artifacts.sh +72 -0
- package/tools/tests/test-branch-verification-guard-targeted-coverage.sh +125 -0
- package/tools/tests/test-codex-quota-manager-failure-driven-rotation.sh +178 -0
- package/tools/tests/test-codex-quota-wrapper.sh +37 -0
- package/tools/tests/test-contribution-docs.sh +18 -0
- package/tools/tests/test-control-plane-dashboard-runtime-smoke.sh +343 -0
- package/tools/tests/test-create-follow-up-issue.sh +73 -0
- package/tools/tests/test-dashboard-launchd-bootstrap.sh +55 -0
- package/tools/tests/test-flow-export-execution-env-exports-repo-id.sh +30 -0
- package/tools/tests/test-flow-export-github-cli-auth-env-prefers-git-credential.sh +48 -0
- package/tools/tests/test-flow-github-api-repo-fallback-preserves-input.sh +85 -0
- package/tools/tests/test-flow-github-api-repo-prefers-explicit-repository-id.sh +60 -0
- package/tools/tests/test-flow-github-issue-list-falls-back-to-repository-id.sh +64 -0
- package/tools/tests/test-flow-github-pr-list-falls-back-to-repository-id.sh +77 -0
- package/tools/tests/test-flow-resident-can-reuse-does-not-leak-metadata.sh +52 -0
- package/tools/tests/test-flow-resident-reap-stale-controllers.sh +63 -0
- package/tools/tests/test-flow-resolve-codex-quota-tools.sh +104 -0
- package/tools/tests/test-flow-runtime-doctor-profile-selection.sh +27 -0
- package/tools/tests/test-heartbeat-codex-pr-linked-issue-exclusion.sh +79 -0
- package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-idle-controller.sh +115 -0
- package/tools/tests/test-heartbeat-hooks-enqueue-resident-issue-for-live-lane-controller.sh +117 -0
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-claude.sh +96 -0
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop-codex.sh +96 -0
- package/tools/tests/test-heartbeat-hooks-start-resident-issue-loop.sh +96 -0
- package/tools/tests/test-heartbeat-loop-auth-wait-does-not-consume-capacity.sh +170 -0
- package/tools/tests/test-heartbeat-loop-blocked-recovery-lane.sh +201 -0
- package/tools/tests/test-heartbeat-loop-blocked-recovery-vs-pr-reservation.sh +201 -0
- package/tools/tests/test-heartbeat-loop-idle-resident-controller-does-not-block-launches.sh +160 -0
- package/tools/tests/test-heartbeat-loop-pr-launch-dedup.sh +133 -0
- package/tools/tests/test-heartbeat-loop-provider-cooldown-suppresses-launches.sh +157 -0
- package/tools/tests/test-heartbeat-loop-reaps-stale-resident-controller.sh +181 -0
- package/tools/tests/test-heartbeat-loop-waiting-provider-resident-controller-does-not-block-launches.sh +160 -0
- package/tools/tests/test-heartbeat-ready-issues-blocked-recovery.sh +134 -0
- package/tools/tests/test-heartbeat-safe-auto-dynamic-concurrency.sh +162 -0
- package/tools/tests/test-heartbeat-safe-auto-no-tmux-sessions.sh +136 -0
- package/tools/tests/test-heartbeat-safe-auto-openclaw-skips-codex-quota.sh +139 -0
- package/tools/tests/test-heartbeat-safe-auto-quota-health-signal.sh +119 -0
- package/tools/tests/test-heartbeat-safe-auto-stale-shared-loop-pid-does-not-skip.sh +140 -0
- package/tools/tests/test-heartbeat-safe-auto-static-capacity-without-quota-cache.sh +142 -0
- package/tools/tests/test-heartbeat-safe-auto-zero-healthy-pools.sh +141 -0
- package/tools/tests/test-heartbeat-sync-issue-labels-empty-schedule.sh +65 -0
- package/tools/tests/test-heartbeat-sync-open-agent-prs-terminal-clears-running.sh +179 -0
- package/tools/tests/test-install-dashboard-launchd.sh +78 -0
- package/tools/tests/test-install-project-launchd-adds-tool-paths.sh +87 -0
- package/tools/tests/test-install-project-launchd.sh +110 -0
- package/tools/tests/test-issue-local-workspace-install-policy.sh +81 -0
- package/tools/tests/test-issue-publish-scope-guard-docs-signal.sh +70 -0
- package/tools/tests/test-issue-reconcile-hooks-success-clears-blocked.sh +36 -0
- package/tools/tests/test-kick-scheduler-requires-explicit-profile.sh +47 -0
- package/tools/tests/test-label-follow-up-issues-falls-back-to-repository-id.sh +132 -0
- package/tools/tests/test-manual-operator-entrypoints-require-explicit-profile.sh +64 -0
- package/tools/tests/test-package-funding-metadata.sh +21 -0
- package/tools/tests/test-package-public-metadata.sh +62 -0
- package/tools/tests/test-placeholder-worker-adapters.sh +38 -0
- package/tools/tests/test-pr-reconcile-hooks-refreshes-recurring-issue-checklist.sh +110 -0
- package/tools/tests/test-pr-risk-cohesive-mobile-locale-scope.sh +70 -0
- package/tools/tests/test-pr-risk-fix-label-semantics.sh +114 -0
- package/tools/tests/test-pr-risk-local-first-no-checks.sh +70 -0
- package/tools/tests/test-prepare-worktree-simple-repo-baseline.sh +67 -0
- package/tools/tests/test-profile-activate.sh +33 -0
- package/tools/tests/test-profile-adopt-allow-missing-repo.sh +68 -0
- package/tools/tests/test-profile-adopt-skip-workspace-sync-missing-file.sh +61 -0
- package/tools/tests/test-profile-adopt-syncs-anchor-and-workspace.sh +90 -0
- package/tools/tests/test-profile-smoke-collision.sh +44 -0
- package/tools/tests/test-profile-smoke-invalid-claude-config.sh +31 -0
- package/tools/tests/test-profile-smoke-invalid-provider-pool.sh +68 -0
- package/tools/tests/test-profile-smoke-repo-slug-mismatch.sh +36 -0
- package/tools/tests/test-profile-smoke.sh +45 -0
- package/tools/tests/test-project-init-force-and-skip-sync.sh +61 -0
- package/tools/tests/test-project-init-repo-slug-mismatch.sh +29 -0
- package/tools/tests/test-project-init.sh +66 -0
- package/tools/tests/test-project-launchd-bootstrap.sh +66 -0
- package/tools/tests/test-project-remove.sh +150 -0
- package/tools/tests/test-project-runtime-supervisor.sh +47 -0
- package/tools/tests/test-project-runtimectl-launchd.sh +115 -0
- package/tools/tests/test-project-runtimectl-missing-profile.sh +54 -0
- package/tools/tests/test-project-runtimectl-start-falls-back-to-bootstrap.sh +108 -0
- package/tools/tests/test-project-runtimectl-status-reports-supervisor-as-heartbeat-parent.sh +95 -0
- package/tools/tests/test-project-runtimectl-status-supervisor-running.sh +59 -0
- package/tools/tests/test-project-runtimectl-stop-cancels-pending-kick.sh +85 -0
- package/tools/tests/test-project-runtimectl-stop-clears-running-labels.sh +78 -0
- package/tools/tests/test-project-runtimectl.sh +212 -0
- package/tools/tests/test-provider-cooldown-state-prefers-runtime-worker-context.sh +39 -0
- package/tools/tests/test-provider-cooldown-state.sh +59 -0
- package/tools/tests/test-public-repo-docs.sh +159 -0
- package/tools/tests/test-reconcile-pr-worker-acp-config-routing.sh +75 -0
- package/tools/tests/test-render-dashboard-snapshot.sh +149 -0
- package/tools/tests/test-render-flow-config-demo-profile.sh +36 -0
- package/tools/tests/test-render-flow-config-provider-pool-fallback.sh +81 -0
- package/tools/tests/test-render-flow-config.sh +52 -0
- package/tools/tests/test-run-codex-task-claude-routing.sh +125 -0
- package/tools/tests/test-run-codex-task-codex-resident-routing.sh +108 -0
- package/tools/tests/test-run-codex-task-kilo-routing.sh +98 -0
- package/tools/tests/test-run-codex-task-openclaw-resident-routing.sh +117 -0
- package/tools/tests/test-run-codex-task-openclaw-routing.sh +113 -0
- package/tools/tests/test-run-codex-task-opencode-routing.sh +98 -0
- package/tools/tests/test-run-codex-task-provider-pool-fallback-routing.sh +146 -0
- package/tools/tests/test-scaffold-profile.sh +108 -0
- package/tools/tests/test-serve-dashboard.sh +93 -0
- package/tools/tests/test-start-issue-worker-blocked-context.sh +129 -0
- package/tools/tests/test-start-issue-worker-blocks-complete-recurring-checklist.sh +189 -0
- package/tools/tests/test-start-issue-worker-local-install-routing.sh +157 -0
- package/tools/tests/test-start-issue-worker-profile-template-routing.sh +149 -0
- package/tools/tests/test-start-issue-worker-recurring-resident-reuse-codex.sh +212 -0
- package/tools/tests/test-start-issue-worker-recurring-resident-reuse.sh +219 -0
- package/tools/tests/test-start-issue-worker-renders-verification-snippet.sh +155 -0
- package/tools/tests/test-start-issue-worker-resident-reuse-falls-back-to-new-worktree.sh +199 -0
- package/tools/tests/test-start-pr-fix-worker-host-blocker-context.sh +275 -0
- package/tools/tests/test-start-resident-issue-loop-adopts-next-recurring-issue.sh +185 -0
- package/tools/tests/test-start-resident-issue-loop-clears-pending-while-waiting-due.sh +152 -0
- package/tools/tests/test-start-resident-issue-loop-consumes-queued-lease.sh +186 -0
- package/tools/tests/test-start-resident-issue-loop-fails-over-provider-pool.sh +212 -0
- package/tools/tests/test-start-resident-issue-loop-immediate-cycles.sh +148 -0
- package/tools/tests/test-start-resident-issue-loop-waits-for-provider.sh +194 -0
- package/tools/tests/test-start-resident-issue-loop-waits-for-terminal-reconcile-status.sh +198 -0
- package/tools/tests/test-start-resident-issue-loop-yields-to-live-lane-controller.sh +145 -0
- package/tools/tests/test-sync-pr-labels-fix-lane-uses-repair-queued.sh +67 -0
- package/tools/tests/test-sync-recurring-issue-checklist-backfills-workflow-complete-blocker.sh +70 -0
- package/tools/tests/test-sync-recurring-issue-checklist.sh +95 -0
- package/tools/tests/test-sync-shared-agent-home-local-source-root.sh +66 -0
- package/tools/tests/test-sync-shared-agent-home-preserves-unrelated-workflow-catalog-skill.sh +47 -0
- package/tools/tests/test-test-smoke.sh +86 -0
- package/tools/tests/test-uninstall-project-launchd.sh +37 -0
- package/tools/tests/test-update-github-labels-prefers-sibling-helper.sh +49 -0
- package/tools/tests/test-workflow-catalog.sh +43 -0
- package/tools/vendor/codex-quota/LICENSE +21 -0
- package/tools/vendor/codex-quota/README.md +459 -0
- package/tools/vendor/codex-quota/codex-quota.js +261 -0
- package/tools/vendor/codex-quota/lib/claude-accounts.js +226 -0
- package/tools/vendor/codex-quota/lib/claude-oauth.js +174 -0
- package/tools/vendor/codex-quota/lib/claude-tokens.js +471 -0
- package/tools/vendor/codex-quota/lib/claude-usage.js +929 -0
- package/tools/vendor/codex-quota/lib/codex-accounts.js +205 -0
- package/tools/vendor/codex-quota/lib/codex-tokens.js +326 -0
- package/tools/vendor/codex-quota/lib/codex-usage.js +32 -0
- package/tools/vendor/codex-quota/lib/color.js +72 -0
- package/tools/vendor/codex-quota/lib/constants.js +57 -0
- package/tools/vendor/codex-quota/lib/container.js +143 -0
- package/tools/vendor/codex-quota/lib/display.js +1111 -0
- package/tools/vendor/codex-quota/lib/fs.js +63 -0
- package/tools/vendor/codex-quota/lib/handlers.js +2060 -0
- package/tools/vendor/codex-quota/lib/jwt.js +33 -0
- package/tools/vendor/codex-quota/lib/oauth.js +486 -0
- package/tools/vendor/codex-quota/lib/paths.js +34 -0
- package/tools/vendor/codex-quota/lib/prompts.js +44 -0
- package/tools/vendor/codex-quota/lib/sync.js +1438 -0
- package/tools/vendor/codex-quota/lib/token-match.js +96 -0
- package/tools/vendor/codex-quota-manager/scripts/auto-switch.sh +500 -0
- package/tools/vendor/codex-quota-manager/scripts/batch-add.sh +123 -0
|
@@ -0,0 +1,333 @@
|
|
|
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}"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import pathlib
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
ROOT = pathlib.Path(__file__).resolve().parents[1] / "dashboard"
|
|
9
|
+
if str(ROOT) not in sys.path:
|
|
10
|
+
sys.path.insert(0, str(ROOT))
|
|
11
|
+
|
|
12
|
+
from dashboard_snapshot import main
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,86 @@
|
|
|
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-config-lib.sh"
|
|
7
|
+
|
|
8
|
+
FLOW_SKILL_DIR="$(resolve_flow_skill_dir "${BASH_SOURCE[0]}")"
|
|
9
|
+
PROFILE_REGISTRY_ROOT="$(resolve_flow_profile_registry_root)"
|
|
10
|
+
CONFIG_YAML="$(resolve_flow_config_yaml "${BASH_SOURCE[0]}")"
|
|
11
|
+
flow_export_execution_env "${CONFIG_YAML}"
|
|
12
|
+
AVAILABLE_PROFILES="$(flow_list_profile_ids "${FLOW_SKILL_DIR}" | paste -sd, -)"
|
|
13
|
+
INSTALLED_PROFILES="$(flow_list_installed_profile_ids | paste -sd, -)"
|
|
14
|
+
PROFILE_ID="$(flow_resolve_adapter_id "${CONFIG_YAML}")"
|
|
15
|
+
PROFILE_SELECTION_MODE="$(flow_profile_selection_mode "${FLOW_SKILL_DIR}")"
|
|
16
|
+
PROFILE_SELECTION_HINT="$(flow_profile_selection_hint "${FLOW_SKILL_DIR}")"
|
|
17
|
+
PROFILE_NOTES="$(flow_resolve_profile_notes_file "${CONFIG_YAML}")"
|
|
18
|
+
|
|
19
|
+
config_or_env() {
|
|
20
|
+
local env_names="${1:?env names required}"
|
|
21
|
+
local config_key="${2:-}"
|
|
22
|
+
local env_name=""
|
|
23
|
+
local value=""
|
|
24
|
+
|
|
25
|
+
for env_name in ${env_names}; do
|
|
26
|
+
value="${!env_name:-}"
|
|
27
|
+
if [[ -n "${value}" ]]; then
|
|
28
|
+
printf '%s\n' "${value}"
|
|
29
|
+
return 0
|
|
30
|
+
fi
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
if [[ -n "${config_key}" && -f "${CONFIG_YAML}" ]]; then
|
|
34
|
+
flow_config_get "${CONFIG_YAML}" "${config_key}"
|
|
35
|
+
return 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
printf '\n'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
printf 'FLOW_SKILL_DIR=%s\n' "${FLOW_SKILL_DIR}"
|
|
42
|
+
printf 'PROFILE_REGISTRY_ROOT=%s\n' "${PROFILE_REGISTRY_ROOT}"
|
|
43
|
+
printf 'CONFIG_YAML=%s\n' "${CONFIG_YAML}"
|
|
44
|
+
printf 'PROFILE_ID=%s\n' "${PROFILE_ID}"
|
|
45
|
+
printf 'PROFILE_SELECTION_MODE=%s\n' "${PROFILE_SELECTION_MODE}"
|
|
46
|
+
if [[ -n "${PROFILE_SELECTION_HINT}" ]]; then
|
|
47
|
+
printf 'PROFILE_SELECTION_HINT=%s\n' "${PROFILE_SELECTION_HINT}"
|
|
48
|
+
fi
|
|
49
|
+
printf 'AVAILABLE_PROFILES=%s\n' "${AVAILABLE_PROFILES}"
|
|
50
|
+
printf 'INSTALLED_PROFILES=%s\n' "${INSTALLED_PROFILES}"
|
|
51
|
+
printf 'PROFILE_NOTES=%s\n' "${PROFILE_NOTES}"
|
|
52
|
+
if [[ -f "${PROFILE_NOTES}" ]]; then
|
|
53
|
+
printf 'PROFILE_NOTES_EXISTS=yes\n'
|
|
54
|
+
else
|
|
55
|
+
printf 'PROFILE_NOTES_EXISTS=no\n'
|
|
56
|
+
fi
|
|
57
|
+
printf 'EFFECTIVE_REPO_ROOT=%s\n' "$(config_or_env 'ACP_REPO_ROOT F_LOSNING_REPO_ROOT' repo.root)"
|
|
58
|
+
printf 'EFFECTIVE_AGENT_REPO_ROOT=%s\n' "$(config_or_env 'ACP_AGENT_REPO_ROOT F_LOSNING_AGENT_REPO_ROOT' runtime.agent_repo_root)"
|
|
59
|
+
printf 'EFFECTIVE_WORKTREE_ROOT=%s\n' "$(config_or_env 'ACP_WORKTREE_ROOT F_LOSNING_WORKTREE_ROOT' runtime.worktree_root)"
|
|
60
|
+
printf 'EFFECTIVE_RUNS_ROOT=%s\n' "$(config_or_env 'ACP_RUNS_ROOT F_LOSNING_RUNS_ROOT' runtime.runs_root)"
|
|
61
|
+
printf 'EFFECTIVE_STATE_ROOT=%s\n' "$(config_or_env 'ACP_STATE_ROOT F_LOSNING_STATE_ROOT' runtime.state_root)"
|
|
62
|
+
printf 'EFFECTIVE_RETAINED_REPO_ROOT=%s\n' "$(config_or_env 'ACP_RETAINED_REPO_ROOT F_LOSNING_RETAINED_REPO_ROOT' runtime.retained_repo_root)"
|
|
63
|
+
printf 'EFFECTIVE_VSCODE_WORKSPACE_FILE=%s\n' "$(config_or_env 'ACP_VSCODE_WORKSPACE_FILE F_LOSNING_VSCODE_WORKSPACE_FILE' runtime.vscode_workspace_file)"
|
|
64
|
+
printf 'EFFECTIVE_CODING_WORKER=%s\n' "$(config_or_env 'ACP_CODING_WORKER F_LOSNING_CODING_WORKER' execution.coding_worker)"
|
|
65
|
+
printf 'EFFECTIVE_PROVIDER_QUOTA_COOLDOWNS=%s\n' "$(config_or_env 'ACP_PROVIDER_QUOTA_COOLDOWNS F_LOSNING_PROVIDER_QUOTA_COOLDOWNS' execution.provider_quota.cooldowns)"
|
|
66
|
+
printf 'EFFECTIVE_PROVIDER_POOL_ORDER=%s\n' "$(config_or_env 'ACP_PROVIDER_POOL_ORDER F_LOSNING_PROVIDER_POOL_ORDER' execution.provider_pool_order)"
|
|
67
|
+
printf 'EFFECTIVE_PROVIDER_POOL_NAME=%s\n' "$(config_or_env 'ACP_ACTIVE_PROVIDER_POOL_NAME F_LOSNING_ACTIVE_PROVIDER_POOL_NAME')"
|
|
68
|
+
printf 'EFFECTIVE_PROVIDER_POOL_BACKEND=%s\n' "$(config_or_env 'ACP_ACTIVE_PROVIDER_BACKEND F_LOSNING_ACTIVE_PROVIDER_BACKEND')"
|
|
69
|
+
printf 'EFFECTIVE_PROVIDER_POOL_MODEL=%s\n' "$(config_or_env 'ACP_ACTIVE_PROVIDER_MODEL F_LOSNING_ACTIVE_PROVIDER_MODEL')"
|
|
70
|
+
printf 'EFFECTIVE_PROVIDER_POOL_KEY=%s\n' "$(config_or_env 'ACP_ACTIVE_PROVIDER_KEY F_LOSNING_ACTIVE_PROVIDER_KEY')"
|
|
71
|
+
printf 'EFFECTIVE_PROVIDER_POOLS_EXHAUSTED=%s\n' "$(config_or_env 'ACP_PROVIDER_POOLS_EXHAUSTED F_LOSNING_PROVIDER_POOLS_EXHAUSTED')"
|
|
72
|
+
printf 'EFFECTIVE_PROVIDER_POOL_SELECTION_REASON=%s\n' "$(config_or_env 'ACP_PROVIDER_POOL_SELECTION_REASON F_LOSNING_PROVIDER_POOL_SELECTION_REASON')"
|
|
73
|
+
printf 'EFFECTIVE_PROVIDER_POOL_NEXT_ATTEMPT_EPOCH=%s\n' "$(config_or_env 'ACP_PROVIDER_POOL_NEXT_ATTEMPT_EPOCH F_LOSNING_PROVIDER_POOL_NEXT_ATTEMPT_EPOCH')"
|
|
74
|
+
printf 'EFFECTIVE_PROVIDER_POOL_NEXT_ATTEMPT_AT=%s\n' "$(config_or_env 'ACP_PROVIDER_POOL_NEXT_ATTEMPT_AT F_LOSNING_PROVIDER_POOL_NEXT_ATTEMPT_AT')"
|
|
75
|
+
printf 'EFFECTIVE_PROVIDER_POOL_LAST_REASON=%s\n' "$(config_or_env 'ACP_PROVIDER_POOL_LAST_REASON F_LOSNING_PROVIDER_POOL_LAST_REASON')"
|
|
76
|
+
printf 'EFFECTIVE_CODEX_PROFILE_SAFE=%s\n' "$(config_or_env 'ACP_CODEX_PROFILE_SAFE F_LOSNING_CODEX_PROFILE_SAFE' execution.safe_profile)"
|
|
77
|
+
printf 'EFFECTIVE_CODEX_PROFILE_BYPASS=%s\n' "$(config_or_env 'ACP_CODEX_PROFILE_BYPASS F_LOSNING_CODEX_PROFILE_BYPASS' execution.bypass_profile)"
|
|
78
|
+
printf 'EFFECTIVE_CLAUDE_MODEL=%s\n' "$(config_or_env 'ACP_CLAUDE_MODEL F_LOSNING_CLAUDE_MODEL' execution.claude.model)"
|
|
79
|
+
printf 'EFFECTIVE_CLAUDE_PERMISSION_MODE=%s\n' "$(config_or_env 'ACP_CLAUDE_PERMISSION_MODE F_LOSNING_CLAUDE_PERMISSION_MODE' execution.claude.permission_mode)"
|
|
80
|
+
printf 'EFFECTIVE_CLAUDE_EFFORT=%s\n' "$(config_or_env 'ACP_CLAUDE_EFFORT F_LOSNING_CLAUDE_EFFORT' execution.claude.effort)"
|
|
81
|
+
printf 'EFFECTIVE_CLAUDE_TIMEOUT_SECONDS=%s\n' "$(config_or_env 'ACP_CLAUDE_TIMEOUT_SECONDS F_LOSNING_CLAUDE_TIMEOUT_SECONDS' execution.claude.timeout_seconds)"
|
|
82
|
+
printf 'EFFECTIVE_CLAUDE_MAX_ATTEMPTS=%s\n' "$(config_or_env 'ACP_CLAUDE_MAX_ATTEMPTS F_LOSNING_CLAUDE_MAX_ATTEMPTS' execution.claude.max_attempts)"
|
|
83
|
+
printf 'EFFECTIVE_CLAUDE_RETRY_BACKOFF_SECONDS=%s\n' "$(config_or_env 'ACP_CLAUDE_RETRY_BACKOFF_SECONDS F_LOSNING_CLAUDE_RETRY_BACKOFF_SECONDS' execution.claude.retry_backoff_seconds)"
|
|
84
|
+
printf 'EFFECTIVE_OPENCLAW_MODEL=%s\n' "$(config_or_env 'ACP_OPENCLAW_MODEL F_LOSNING_OPENCLAW_MODEL' execution.openclaw.model)"
|
|
85
|
+
printf 'EFFECTIVE_OPENCLAW_THINKING=%s\n' "$(config_or_env 'ACP_OPENCLAW_THINKING F_LOSNING_OPENCLAW_THINKING' execution.openclaw.thinking)"
|
|
86
|
+
printf 'EFFECTIVE_OPENCLAW_TIMEOUT_SECONDS=%s\n' "$(config_or_env 'ACP_OPENCLAW_TIMEOUT_SECONDS F_LOSNING_OPENCLAW_TIMEOUT_SECONDS' execution.openclaw.timeout_seconds)"
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
# shellcheck source=/dev/null
|
|
8
|
+
source "${SCRIPT_DIR}/flow-config-lib.sh"
|
|
9
|
+
|
|
10
|
+
KIND="${1:?usage: retry-state.sh issue|pr ID get|schedule|clear [reason]}"
|
|
11
|
+
ITEM_ID="${2:?usage: retry-state.sh issue|pr ID get|schedule|clear [reason]}"
|
|
12
|
+
ACTION="${3:?usage: retry-state.sh issue|pr ID get|schedule|clear [reason]}"
|
|
13
|
+
REASON="${4:-}"
|
|
14
|
+
|
|
15
|
+
CONFIG_YAML="$(resolve_flow_config_yaml "${BASH_SOURCE[0]}")"
|
|
16
|
+
AGENT_ROOT="$(flow_resolve_agent_root "${CONFIG_YAML}")"
|
|
17
|
+
STATE_ROOT="$(flow_resolve_state_root "${CONFIG_YAML}")"
|
|
18
|
+
COOLDOWNS="$(flow_resolve_retry_cooldowns "${CONFIG_YAML}")"
|
|
19
|
+
FLOW_SKILL_DIR="$(resolve_flow_skill_dir "${BASH_SOURCE[0]}")"
|
|
20
|
+
FLOW_TOOLS_DIR="${FLOW_SKILL_DIR}/tools/bin"
|
|
21
|
+
|
|
22
|
+
ACP_AGENT_ROOT="$AGENT_ROOT" \
|
|
23
|
+
ACP_STATE_ROOT="$STATE_ROOT" \
|
|
24
|
+
ACP_RETRY_COOLDOWNS="$COOLDOWNS" \
|
|
25
|
+
exec bash "${FLOW_TOOLS_DIR}/agent-project-retry-state" \
|
|
26
|
+
--state-root "$STATE_ROOT" \
|
|
27
|
+
--kind "$KIND" \
|
|
28
|
+
--item-id "$ITEM_ID" \
|
|
29
|
+
--action "$ACTION" \
|
|
30
|
+
--reason "$REASON" \
|
|
31
|
+
--cooldowns "$COOLDOWNS"
|
|
@@ -0,0 +1,75 @@
|
|
|
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-config-lib.sh"
|
|
7
|
+
|
|
8
|
+
usage() {
|
|
9
|
+
cat <<'EOF'
|
|
10
|
+
Usage:
|
|
11
|
+
reuse-issue-worktree.sh WORKTREE ISSUE_ID [SLUG]
|
|
12
|
+
|
|
13
|
+
Reset and re-branch an existing managed issue worktree so a recurring issue can
|
|
14
|
+
reuse the same workspace path across multiple cycles.
|
|
15
|
+
EOF
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
WORKTREE="${1:-}"
|
|
19
|
+
ISSUE_ID="${2:-}"
|
|
20
|
+
SLUG_INPUT="${3:-task}"
|
|
21
|
+
|
|
22
|
+
if [[ -z "${WORKTREE}" || -z "${ISSUE_ID}" ]]; then
|
|
23
|
+
usage >&2
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
FLOW_SKILL_DIR="$(resolve_flow_skill_dir "${BASH_SOURCE[0]}")"
|
|
28
|
+
if ! flow_require_explicit_profile_selection "${FLOW_SKILL_DIR}" "reuse-issue-worktree.sh"; then
|
|
29
|
+
exit 64
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
CONFIG_YAML="$(resolve_flow_config_yaml "${BASH_SOURCE[0]}")"
|
|
33
|
+
AGENT_REPO_ROOT="$(flow_resolve_agent_repo_root "${CONFIG_YAML}")"
|
|
34
|
+
ISSUE_BRANCH_PREFIX="$(flow_resolve_issue_branch_prefix "${CONFIG_YAML}")"
|
|
35
|
+
DEFAULT_BRANCH="$(flow_resolve_default_branch "${CONFIG_YAML}")"
|
|
36
|
+
BASE_REF="origin/${DEFAULT_BRANCH}"
|
|
37
|
+
PREPARE_SCRIPT="${SCRIPT_DIR}/prepare-worktree.sh"
|
|
38
|
+
|
|
39
|
+
safe_slug="$(printf '%s' "${SLUG_INPUT}" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-')"
|
|
40
|
+
safe_slug="${safe_slug#-}"
|
|
41
|
+
safe_slug="${safe_slug%-}"
|
|
42
|
+
if [[ -z "${safe_slug}" ]]; then
|
|
43
|
+
safe_slug="task"
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
stamp="$(date +%Y%m%d-%H%M%S)"
|
|
47
|
+
branch_name="${ISSUE_BRANCH_PREFIX}-${ISSUE_ID}-${safe_slug}-${stamp}"
|
|
48
|
+
previous_branch="$(git -C "${WORKTREE}" branch --show-current 2>/dev/null || true)"
|
|
49
|
+
|
|
50
|
+
if ! git -C "${WORKTREE}" rev-parse --git-dir >/dev/null 2>&1; then
|
|
51
|
+
echo "invalid managed worktree: ${WORKTREE}" >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
git -C "${AGENT_REPO_ROOT}" fetch \
|
|
56
|
+
origin \
|
|
57
|
+
"+refs/heads/${DEFAULT_BRANCH}:refs/remotes/origin/${DEFAULT_BRANCH}" \
|
|
58
|
+
--prune >/dev/null
|
|
59
|
+
|
|
60
|
+
# Reset the resident workspace to the latest baseline before switching to the
|
|
61
|
+
# next focused cycle branch.
|
|
62
|
+
git -C "${WORKTREE}" reset --hard >/dev/null
|
|
63
|
+
git -C "${WORKTREE}" clean -fd >/dev/null
|
|
64
|
+
git -C "${WORKTREE}" checkout -B "${branch_name}" "${BASE_REF}" >/dev/null
|
|
65
|
+
|
|
66
|
+
if [[ -n "${previous_branch}" && "${previous_branch}" != "${branch_name}" ]]; then
|
|
67
|
+
git -C "${AGENT_REPO_ROOT}" branch -D "${previous_branch}" >/dev/null 2>&1 || true
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
"${PREPARE_SCRIPT}" "${WORKTREE}" >/dev/null
|
|
71
|
+
|
|
72
|
+
printf 'WORKTREE=%s\n' "${WORKTREE}"
|
|
73
|
+
printf 'BRANCH=%s\n' "${branch_name}"
|
|
74
|
+
printf 'BASE_REF=%s\n' "${BASE_REF}"
|
|
75
|
+
printf 'REUSED=yes\n'
|