|
|
@@ -14,7 +14,7 @@ permissions:
|
|
|
|
contents: write
|
|
|
|
contents: write
|
|
|
|
issues: write
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
|
|
|
pull-requests: write
|
|
|
|
actions: write
|
|
|
|
actions: read
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
jobs:
|
|
|
|
agent-dispatch:
|
|
|
|
agent-dispatch:
|
|
|
@@ -26,15 +26,7 @@ jobs:
|
|
|
|
(contains(github.event.comment.body, '/plan') ||
|
|
|
|
(contains(github.event.comment.body, '/plan') ||
|
|
|
|
contains(github.event.comment.body, '/implement') ||
|
|
|
|
contains(github.event.comment.body, '/implement') ||
|
|
|
|
contains(github.event.comment.body, '/fix'))
|
|
|
|
contains(github.event.comment.body, '/fix'))
|
|
|
|
runs-on: [self-hosted, eliza]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
|
|
|
|
image: node:20-bookworm
|
|
|
|
|
|
|
|
options: --add-host host.docker.internal:host-gateway
|
|
|
|
|
|
|
|
env:
|
|
|
|
|
|
|
|
HTTP_PROXY: http://host.docker.internal:1080
|
|
|
|
|
|
|
|
HTTPS_PROXY: http://host.docker.internal:1080
|
|
|
|
|
|
|
|
ALL_PROXY: http://host.docker.internal:1080
|
|
|
|
|
|
|
|
NO_PROXY: localhost,127.0.0.1
|
|
|
|
|
|
|
|
timeout-minutes: 30
|
|
|
|
timeout-minutes: 30
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
steps:
|
|
|
@@ -48,13 +40,6 @@ jobs:
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
- name: Ensure GitHub CLI is Installed
|
|
|
|
|
|
|
|
run: |
|
|
|
|
|
|
|
|
if ! command -v gh &> /dev/null; then
|
|
|
|
|
|
|
|
echo "Installing GitHub CLI..."
|
|
|
|
|
|
|
|
curl -fsSL https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_linux_amd64.tar.gz | tar -xz -C /usr/local --strip-components=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Acknowledge Command (Add Eyes Reaction)
|
|
|
|
- name: Acknowledge Command (Add Eyes Reaction)
|
|
|
|
if: success()
|
|
|
|
if: success()
|
|
|
|
env:
|
|
|
|
env:
|
|
|
@@ -98,48 +83,19 @@ jobs:
|
|
|
|
|
|
|
|
|
|
|
|
- name: Setup Antigravity CLI & Credentials
|
|
|
|
- name: Setup Antigravity CLI & Credentials
|
|
|
|
env:
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITOPS_TOKEN || secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
AGY_AUTH_TOKEN: ${{ secrets.AGY_AUTH_TOKEN }}
|
|
|
|
AGY_AUTH_TOKEN: ${{ secrets.AGY_AUTH_TOKEN }}
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
# 1. Download official Antigravity CLI binary from google-antigravity/antigravity-cli
|
|
|
|
# 1. Install Antigravity CLI (agy) if not present
|
|
|
|
mkdir -p "$HOME/.local/bin"
|
|
|
|
|
|
|
|
if ! command -v agy &> /dev/null; then
|
|
|
|
if ! command -v agy &> /dev/null; then
|
|
|
|
echo "Fetching Antigravity CLI from google-antigravity/antigravity-cli..."
|
|
|
|
echo "Installing Antigravity CLI (agy)..."
|
|
|
|
gh release download --repo google-antigravity/antigravity-cli -p "agy_cli_linux_x64.tar.gz" -O - | tar -xz -C "$HOME/.local/bin"
|
|
|
|
curl -fsSL https://antigravity.google/install.sh | bash || true
|
|
|
|
if [ -f "$HOME/.local/bin/antigravity" ] && [ ! -f "$HOME/.local/bin/agy" ]; then
|
|
|
|
mkdir -p "$HOME/.local/bin"
|
|
|
|
mv "$HOME/.local/bin/antigravity" "$HOME/.local/bin/agy"
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
fi
|
|
|
|
echo "$HOME/.gemini/antigravity-cli/bin" >> $GITHUB_PATH
|
|
|
|
ln -sf "$HOME/.local/bin/agy" "$HOME/.local/bin/antigravity"
|
|
|
|
export PATH="$HOME/.local/bin:$HOME/.gemini/antigravity-cli/bin:$PATH"
|
|
|
|
chmod +x "$HOME/.local/bin/agy" "$HOME/.local/bin/antigravity"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
echo "$HOME/.gemini/antigravity-cli/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
export PATH="$HOME/.local/bin:$HOME/.gemini/antigravity-cli/bin:$PATH"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 2. Patch location eligibility check (open-antigravity-patcher CLI_GATE_X64)
|
|
|
|
# 2. Inject OAuth Token
|
|
|
|
node -e '
|
|
|
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
|
|
|
const file = process.env.HOME + "/.local/bin/agy";
|
|
|
|
|
|
|
|
if (!fs.existsSync(file)) process.exit(0);
|
|
|
|
|
|
|
|
const buf = fs.readFileSync(file);
|
|
|
|
|
|
|
|
let count = 0;
|
|
|
|
|
|
|
|
for (let i = 0; i < buf.length - 18; i++) {
|
|
|
|
|
|
|
|
if (buf[i] === 0x48 && buf[i+1] === 0x85 && buf[i+2] === 0xc0 && buf[i+3] === 0x0f && buf[i+4] === 0x84 &&
|
|
|
|
|
|
|
|
buf[i+9] === 0x80 && buf[i+10] === 0x78 && buf[i+11] === 0x08 && buf[i+12] === 0x00 &&
|
|
|
|
|
|
|
|
buf[i+13] === 0x0f && buf[i+14] === 0x85) {
|
|
|
|
|
|
|
|
buf[i+9] = 0x48; buf[i+10] = 0x85; buf[i+11] = 0xc0; buf[i+12] = 0x90;
|
|
|
|
|
|
|
|
count++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
|
|
|
fs.writeFileSync(file, buf);
|
|
|
|
|
|
|
|
console.log(`Applied open-antigravity-patcher: ${count} gates patched.`);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log("Antigravity CLI is already patched or signature not found.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 3. Inject OAuth Token
|
|
|
|
|
|
|
|
mkdir -p ~/.gemini/antigravity-cli
|
|
|
|
mkdir -p ~/.gemini/antigravity-cli
|
|
|
|
if [ -n "$AGY_AUTH_TOKEN" ]; then
|
|
|
|
if [ -n "$AGY_AUTH_TOKEN" ]; then
|
|
|
|
if echo "$AGY_AUTH_TOKEN" | base64 --decode >/dev/null 2>&1; then
|
|
|
|
if echo "$AGY_AUTH_TOKEN" | base64 --decode >/dev/null 2>&1; then
|
|
|
@@ -154,9 +110,8 @@ jobs:
|
|
|
|
|
|
|
|
|
|
|
|
- name: Configure Git Bot Identity
|
|
|
|
- name: Configure Git Bot Identity
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
git config --global user.name "Adam Jensen [bot]"
|
|
|
|
git config --global user.name "AI Assistant Bot"
|
|
|
|
git config --global user.email "adam@ermnvldmr.com"
|
|
|
|
git config --global user.email "bot@users.noreply.github.com"
|
|
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# --- COMMAND: /plan ---
|
|
|
|
# --- COMMAND: /plan ---
|
|
|
|
- name: Handle /plan (Issue Planning)
|
|
|
|
- name: Handle /plan (Issue Planning)
|
|
|
@@ -174,9 +129,9 @@ jobs:
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
PROMPT="You are operating via GitHub Actions in non-interactive headless mode on Issue #${ISSUE_NUMBER}.\n\nIssue Context:\n${ISSUE_DATA}\n\nLatest instruction:\n${COMMENT_BODY}\n\nPlease generate/update a detailed technical implementation plan adhering to project GEMINI.md guidelines."
|
|
|
|
PROMPT="You are operating via GitHub Actions on Issue #${ISSUE_NUMBER}.\n\nIssue Context:\n${ISSUE_DATA}\n\nLatest instruction:\n${COMMENT_BODY}\n\nPlease generate/update a detailed technical implementation plan adhering to project GEMINI.md guidelines."
|
|
|
|
|
|
|
|
|
|
|
|
PLAN_OUTPUT=$(agy $CONTINUE_FLAG --mode plan --print-timeout 20m -p "$PROMPT" || echo "Agent encountered an error generating the plan.")
|
|
|
|
PLAN_OUTPUT=$(agy $CONTINUE_FLAG --mode plan -p "$PROMPT" || echo "Agent encountered an error generating the plan.")
|
|
|
|
|
|
|
|
|
|
|
|
DISCLOSURE="\n\n---\n*Disclosure: I'm an AI assistant helping deytenit; I'm not deytenit.*"
|
|
|
|
DISCLOSURE="\n\n---\n*Disclosure: I'm an AI assistant helping deytenit; I'm not deytenit.*"
|
|
|
|
gh issue comment "$ISSUE_NUMBER" --body "${PLAN_OUTPUT}${DISCLOSURE}"
|
|
|
|
gh issue comment "$ISSUE_NUMBER" --body "${PLAN_OUTPUT}${DISCLOSURE}"
|
|
|
@@ -199,8 +154,8 @@ jobs:
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
PROMPT="You are operating via GitHub Actions in non-interactive headless mode to implement Issue #${ISSUE_NUMBER}.\n\nContext:\n${ISSUE_DATA}\n\nLatest instruction:\n${COMMENT_BODY}\n\nTask: Inspect relevant files, implement the necessary code changes directly in the workspace adhering to GEMINI.md rules, and verify them. Do not exit or stop before applying edits to the source code."
|
|
|
|
PROMPT="You are operating via GitHub Actions to implement Issue #${ISSUE_NUMBER}.\n\nContext:\n${ISSUE_DATA}\n\nLatest instruction:\n${COMMENT_BODY}\n\nImplement the changes cleanly in the repository according to GEMINI.md rules."
|
|
|
|
agy $CONTINUE_FLAG --dangerously-skip-permissions --print-timeout 25m -p "$PROMPT"
|
|
|
|
agy $CONTINUE_FLAG --dangerously-skip-permissions -p "$PROMPT"
|
|
|
|
|
|
|
|
|
|
|
|
echo "Running repository verification gates..."
|
|
|
|
echo "Running repository verification gates..."
|
|
|
|
pnpm typecheck
|
|
|
|
pnpm typecheck
|
|
|
@@ -235,7 +190,6 @@ jobs:
|
|
|
|
run: |
|
|
|
|
run: |
|
|
|
|
IS_PR="${{ github.event.issue.pull_request != null }}"
|
|
|
|
IS_PR="${{ github.event.issue.pull_request != null }}"
|
|
|
|
if [ "$IS_PR" = "true" ]; then
|
|
|
|
if [ "$IS_PR" = "true" ]; then
|
|
|
|
# Verify PR is not from an untrusted cross-repository fork
|
|
|
|
|
|
|
|
IS_CROSS_REPO=$(gh pr view "$ISSUE_OR_PR_NUMBER" --json isCrossRepository -q .isCrossRepository)
|
|
|
|
IS_CROSS_REPO=$(gh pr view "$ISSUE_OR_PR_NUMBER" --json isCrossRepository -q .isCrossRepository)
|
|
|
|
if [ "$IS_CROSS_REPO" = "true" ]; then
|
|
|
|
if [ "$IS_CROSS_REPO" = "true" ]; then
|
|
|
|
echo "::error::Cross-repository fork PRs cannot be automatically processed in privileged context."
|
|
|
|
echo "::error::Cross-repository fork PRs cannot be automatically processed in privileged context."
|
|
|
@@ -258,8 +212,8 @@ jobs:
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
CONTINUE_FLAG="--continue"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
PROMPT="You are operating via GitHub Actions in non-interactive headless mode to fix/adjust PR #${ISSUE_OR_PR_NUMBER} on branch ${BRANCH_NAME}.\n\nFeedback / Comment:\n${COMMENT_BODY}\n\nPR Diff:\n${PR_DIFF}\n\nFailed CI Logs (if any):\n${CI_LOGS}\n\nTask: Apply the necessary fixes directly to the files, ensuring all lint, typecheck, and test checks pass. Do not exit without applying the changes."
|
|
|
|
PROMPT="You are operating via GitHub Actions to fix/adjust PR #${ISSUE_OR_PR_NUMBER} on branch ${BRANCH_NAME}.\n\nFeedback / Comment:\n${COMMENT_BODY}\n\nPR Diff:\n${PR_DIFF}\n\nFailed CI Logs (if any):\n${CI_LOGS}\n\nApply the necessary fixes, making sure all lint, typecheck, and test checks pass."
|
|
|
|
agy $CONTINUE_FLAG --dangerously-skip-permissions --print-timeout 25m -p "$PROMPT"
|
|
|
|
agy $CONTINUE_FLAG --dangerously-skip-permissions -p "$PROMPT"
|
|
|
|
|
|
|
|
|
|
|
|
echo "Running repository verification gates..."
|
|
|
|
echo "Running repository verification gates..."
|
|
|
|
pnpm typecheck
|
|
|
|
pnpm typecheck
|
|
|
@@ -283,8 +237,8 @@ jobs:
|
|
|
|
git checkout -b "$BRANCH_NAME"
|
|
|
|
git checkout -b "$BRANCH_NAME"
|
|
|
|
|
|
|
|
|
|
|
|
ISSUE_DATA=$(gh issue view "$ISSUE_OR_PR_NUMBER" --comments --json title,body,comments)
|
|
|
|
ISSUE_DATA=$(gh issue view "$ISSUE_OR_PR_NUMBER" --comments --json title,body,comments)
|
|
|
|
PROMPT="You are operating via GitHub Actions in non-interactive headless mode to fix issue #${ISSUE_OR_PR_NUMBER}.\n\nContext:\n${ISSUE_DATA}\n\nInstruction:\n${COMMENT_BODY}\n\nTask: Apply the necessary fixes directly to the files adhering to GEMINI.md rules."
|
|
|
|
PROMPT="Fix issue #${ISSUE_OR_PR_NUMBER}.\n\nContext:\n${ISSUE_DATA}\n\nInstruction:\n${COMMENT_BODY}"
|
|
|
|
agy --dangerously-skip-permissions --print-timeout 25m -p "$PROMPT"
|
|
|
|
agy --dangerously-skip-permissions -p "$PROMPT"
|
|
|
|
|
|
|
|
|
|
|
|
pnpm typecheck
|
|
|
|
pnpm typecheck
|
|
|
|
pnpm lint
|
|
|
|
pnpm lint
|
|
|
|