From fff1df0ecff1568d89a7dd6342c7c289157b594d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 12:44:32 +0000 Subject: [PATCH] fix(auth): add missing GUI CPA export hook --- .github/workflows/temp-gui-cpa-hook.yml | 34 ------------------------- tools/apply_gui_cpa_hook.py | 25 ------------------ 2 files changed, 59 deletions(-) delete mode 100644 .github/workflows/temp-gui-cpa-hook.yml delete mode 100644 tools/apply_gui_cpa_hook.py diff --git a/.github/workflows/temp-gui-cpa-hook.yml b/.github/workflows/temp-gui-cpa-hook.yml deleted file mode 100644 index 1c6a044..0000000 --- a/.github/workflows/temp-gui-cpa-hook.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Temporary GUI CPA hook patch - -on: - issues: - types: - - edited - -permissions: - contents: write - -jobs: - apply-upgrade: - if: github.event.issue.number == 7 - runs-on: ubuntu-latest - steps: - - name: Checkout main - uses: actions/checkout@v4 - with: - ref: main - fetch-depth: 0 - - - name: Apply GUI CPA hook - run: python tools/apply_gui_cpa_hook.py - - - name: Commit patch and clean temporary files - shell: bash - run: | - rm -f tools/apply_gui_cpa_hook.py - rm -f .github/workflows/temp-gui-cpa-hook.yml - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add grok_register_ttk.py tools/apply_gui_cpa_hook.py .github/workflows/temp-gui-cpa-hook.yml - git commit -m "fix(auth): add missing GUI CPA export hook" - git push origin HEAD:main diff --git a/tools/apply_gui_cpa_hook.py b/tools/apply_gui_cpa_hook.py deleted file mode 100644 index 04337f9..0000000 --- a/tools/apply_gui_cpa_hook.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -import ast -from pathlib import Path - -ROOT = Path(__file__).resolve().parents[1] -APP_PATH = ROOT / "grok_register_ttk.py" - -app = APP_PATH.read_text(encoding="utf-8-sig") -old = ' add_token_to_grok2api_pools(sso, email=email, log_callback=self.log)\n self.success_count += 1' -new = ''' add_token_to_grok2api_pools(sso, email=email, log_callback=self.log) - maybe_export_cpa_xai_after_success( - email=email, - password=profile.get("password", ""), - sso=sso, - log_callback=self.log, - cancel_callback=self.should_stop, - ) - self.success_count += 1''' -if 'maybe_export_cpa_xai_after_success(' not in app.split('class CliStopController', 1)[0]: - if old not in app: - raise RuntimeError("GUI CPA hook anchor not found") - app = app.replace(old, new, 1) -ast.parse(app) -APP_PATH.write_text(app, encoding="utf-8-sig") -print("GUI CPA hook applied.")