|
90 | 90 | if [ -f "$INSTALL_DIR/scripts/autoflow_command.py" ]; then |
91 | 91 | chmod +x "$INSTALL_DIR/scripts/autoflow_command.py" |
92 | 92 | fi |
| 93 | +if [ -f "$INSTALL_DIR/scripts/pr_review_analyzer.py" ]; then |
| 94 | + chmod +x "$INSTALL_DIR/scripts/pr_review_analyzer.py" |
| 95 | +fi |
| 96 | +if [ -f "$INSTALL_DIR/scripts/pr_review_command.py" ]; then |
| 97 | + chmod +x "$INSTALL_DIR/scripts/pr_review_command.py" |
| 98 | +fi |
93 | 99 | ln -sfn "$INSTALL_DIR/opencode.json" "$CONFIG_PATH" |
94 | 100 |
|
95 | 101 | if [ "$RUN_WIZARD" = true ]; then |
@@ -141,12 +147,13 @@ if [ "$SKIP_SELF_CHECK" = false ]; then |
141 | 147 | fi |
142 | 148 | if [ -f "$INSTALL_DIR/scripts/resume_command.py" ]; then |
143 | 149 | python3 "$INSTALL_DIR/scripts/resume_command.py" status --json || true |
144 | | - python3 -c "import json,pathlib; p=pathlib.Path('$CONFIG_PATH'); data=json.loads(p.read_text(encoding='utf-8')); pe=data.get('plan_execution', {}); steps=pe.get('steps', []); pe['status']='failed'; pe['resume']={'enabled': True, 'attempt_count': 0, 'max_attempts': 3, 'trail': []}; |
| 150 | + RUNTIME_PATH="$HOME/.config/opencode/my_opencode/runtime/plan_execution.json" |
| 151 | + python3 -c "import json,pathlib; p=pathlib.Path('$RUNTIME_PATH'); data=json.loads(p.read_text(encoding='utf-8')) if p.exists() else {}; steps=data.get('steps', []); data['status']='failed'; data['resume']={'enabled': True, 'attempt_count': 0, 'max_attempts': 3, 'trail': []}; |
145 | 152 | if isinstance(steps, list) and len(steps) >= 2: |
146 | 153 | steps[0]['state']='done'; |
147 | 154 | steps[1]['state']='pending'; |
148 | 155 | steps[1]['idempotent']=False; |
149 | | -data['plan_execution']=pe; p.write_text(json.dumps(data, indent=2)+'\n', encoding='utf-8')" |
| 156 | +p.parent.mkdir(parents=True, exist_ok=True); p.write_text(json.dumps(data, indent=2)+'\n', encoding='utf-8')" |
150 | 157 | python3 "$INSTALL_DIR/scripts/resume_command.py" now --interruption-class tool_failure --json || true |
151 | 158 | python3 "$INSTALL_DIR/scripts/resume_command.py" now --interruption-class tool_failure --approve-step 2 --json |
152 | 159 | fi |
@@ -174,6 +181,13 @@ data['plan_execution']=pe; p.write_text(json.dumps(data, indent=2)+'\n', encodin |
174 | 181 | python3 "$INSTALL_DIR/scripts/autoflow_command.py" stop --reason install-self-check --json |
175 | 182 | python3 "$INSTALL_DIR/scripts/start_work_command.py" "$SELF_CHECK_PLAN" --deviation "install self-check" --json |
176 | 183 | fi |
| 184 | + if [ -f "$INSTALL_DIR/scripts/pr_review_command.py" ]; then |
| 185 | + SELF_CHECK_DIFF="$HOME/.config/opencode/my_opencode/.install-selfcheck-pr.diff" |
| 186 | + python3 -c "from pathlib import Path; Path('$SELF_CHECK_DIFF').write_text('diff --git a/scripts/install_selfcheck.py b/scripts/install_selfcheck.py\nindex 0000000..1111111 100644\n--- a/scripts/install_selfcheck.py\n+++ b/scripts/install_selfcheck.py\n@@ -0,0 +1,1 @@\n+print(\"install\")\n', encoding='utf-8')" |
| 187 | + python3 "$INSTALL_DIR/scripts/pr_review_command.py" --diff-file "$SELF_CHECK_DIFF" --json |
| 188 | + python3 "$INSTALL_DIR/scripts/pr_review_command.py" checklist --diff-file "$SELF_CHECK_DIFF" --json |
| 189 | + python3 "$INSTALL_DIR/scripts/pr_review_command.py" doctor --json |
| 190 | + fi |
177 | 191 | python3 "$INSTALL_DIR/scripts/nvim_integration_command.py" status |
178 | 192 | python3 "$INSTALL_DIR/scripts/devtools_command.py" status |
179 | 193 | python3 "$INSTALL_DIR/scripts/doctor_command.py" run || true |
@@ -245,6 +259,9 @@ printf " /autoflow dry-run ~/.config/opencode/my_opencode/plan.md --json\n" |
245 | 259 | printf " /autoflow status --json\n" |
246 | 260 | printf " /autoflow report --json\n" |
247 | 261 | printf " /autoflow stop --reason manual --json\n" |
| 262 | +printf " /pr-review --base main --head HEAD --json\n" |
| 263 | +printf " /pr-review-checklist --base main --head HEAD\n" |
| 264 | +printf " /pr-review-doctor\n" |
248 | 265 | printf " /todo status --json\n" |
249 | 266 | printf " /todo enforce --json\n" |
250 | 267 | printf " /resume status --json\n" |
|
0 commit comments