From 0a3da20d7a32545ac9605e4e82a6e849663233aa Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Mon, 13 Jul 2026 17:33:19 +0800 Subject: [PATCH 1/4] update packages --- package-lock.json | 62 ++++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 791e9b6..54a6fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "1.2.2", "license": "MIT", "dependencies": { + "@bankofai/agent-wallet": "^2.3.0", "@scure/bip32": "^2.0.1", "@scure/bip39": "^2.0.1", - "@bankofai/agent-wallet": "^2.3.0", "@sun-protocol/sun-kit": "^1.2.0", "chalk": "^4.1.2", "cli-table3": "^0.6.5", @@ -545,6 +545,25 @@ "node": ">=6.9.0" } }, + "node_modules/@bankofai/agent-wallet": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@bankofai/agent-wallet/-/agent-wallet-2.3.0.tgz", + "integrity": "sha512-Jezo0ffhZrsF0HQMV74wTJlLUtHoY4d7TeYbjqjkWketCqBdhiX9/90hS4qwk99QZwnbt+1HRUschOaSA1wkRw==", + "license": "MIT", + "dependencies": { + "@inquirer/prompts": "^8.3.0", + "@noble/curves": "^1.9.1", + "bs58check": "^4.0.0", + "viem": "^2.0.0", + "zod": "^3.22.0" + }, + "bin": { + "agent-wallet": "dist/delivery/bin.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -1721,25 +1740,6 @@ "url": "https://opencollective.com/pkgr" } }, - "node_modules/@bankofai/agent-wallet": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@bankofai/agent-wallet/-/agent-wallet-2.3.0.tgz", - "integrity": "sha512-Jezo0ffhZrsF0HQMV74wTJlLUtHoY4d7TeYbjqjkWketCqBdhiX9/90hS4qwk99QZwnbt+1HRUschOaSA1wkRw==", - "license": "MIT", - "dependencies": { - "@inquirer/prompts": "^8.3.0", - "@noble/curves": "^1.9.1", - "bs58check": "^4.0.0", - "viem": "^2.0.0", - "zod": "^3.22.0" - }, - "bin": { - "agent-wallet": "dist/delivery/bin.js" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@scure/base": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.0.0.tgz", @@ -2027,6 +2027,28 @@ "node": ">=20" } }, + "node_modules/@sun-protocol/sun-kit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sun-protocol/sun-kit/-/sun-kit-1.2.0.tgz", + "integrity": "sha512-UH5LIxC6WRno+OYVHSyCACqyujh8de0PQYRRzQV/IUxXxpsQADIVnO8w1Awn7ENbkN4imZh+9O2IkT+l4AP6qA==", + "license": "MIT", + "dependencies": { + "@sun-protocol/permit2-sdk": "^1.0.0", + "@sun-protocol/universal-router-sdk": "^1.0.1", + "viem": "^2.0.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "tronweb": "^6.2.1" + }, + "peerDependenciesMeta": { + "tronweb": { + "optional": true + } + } + }, "node_modules/@sun-protocol/universal-router-sdk": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@sun-protocol/universal-router-sdk/-/universal-router-sdk-1.0.1.tgz", diff --git a/package.json b/package.json index c512c07..94be3e2 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,9 @@ }, "dependencies": { "@bankofai/agent-wallet": "^2.3.0", - "@sun-protocol/sun-kit": "^1.2.0", "@scure/bip32": "^2.0.1", "@scure/bip39": "^2.0.1", + "@sun-protocol/sun-kit": "^1.2.0", "chalk": "^4.1.2", "cli-table3": "^0.6.5", "commander": "^12.1.0", From fff89086b0eef59968a99f518c5b8434805b5351 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Mon, 13 Jul 2026 17:44:17 +0800 Subject: [PATCH 2/4] remove dependabot --- .github/dependabot.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 99c16bd..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -updates: - - package-ecosystem: 'npm' - directory: '/' - schedule: - interval: 'weekly' - open-pull-requests-limit: 10 - groups: - dev-dependencies: - dependency-type: 'development' - update-types: - - 'minor' - - 'patch' - - - package-ecosystem: 'github-actions' - directory: '/' - schedule: - interval: 'weekly' From 625b1c4a68126832634b35184ec14efb8aa89385 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Mon, 13 Jul 2026 17:48:04 +0800 Subject: [PATCH 3/4] add dependabot --- .github/dependabot.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..99c16bd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'weekly' + open-pull-requests-limit: 10 + groups: + dev-dependencies: + dependency-type: 'development' + update-types: + - 'minor' + - 'patch' + + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' From 912a47ec6d3d8559cf3f29cb8ece0fb76c738997 Mon Sep 17 00:00:00 2001 From: "Leon.Zhang" Date: Mon, 13 Jul 2026 17:57:27 +0800 Subject: [PATCH 4/4] remove pr audit ci --- .github/workflows/audit-pr.yml | 307 --------------------------------- 1 file changed, 307 deletions(-) delete mode 100644 .github/workflows/audit-pr.yml diff --git a/.github/workflows/audit-pr.yml b/.github/workflows/audit-pr.yml deleted file mode 100644 index 9bc2141..0000000 --- a/.github/workflows/audit-pr.yml +++ /dev/null @@ -1,307 +0,0 @@ -name: Audit PR - -on: - pull_request: - branches: - - main - types: [opened, synchronize, reopened, ready_for_review] - issue_comment: - types: [created] - workflow_dispatch: - -permissions: - contents: read - pull-requests: write - issues: write - -concurrency: - group: audit-pr-${{ github.event.pull_request.number || github.event.issue.number || github.ref }} - cancel-in-progress: true - -jobs: - audit-on-pr: - name: Audit on pull request - if: github.event_name == 'pull_request' - runs-on: [self-hosted, Linux, ARM64, audit-linux] - - steps: - - name: Checkout PR head - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Check required tools - run: | - which zip - which jq - which python3 - - - name: Create source archive - id: archive - shell: bash - run: | - ARCHIVE_NAME="${{ github.event.repository.name }}.zip" - rm -f "/tmp/${ARCHIVE_NAME}" - zip -r "/tmp/${ARCHIVE_NAME}" . - echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT" - - - name: Submit audit job - id: submit - shell: bash - run: | - RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-pr/${{ vars.AUDIT_PR_SKILL }}" \ - -H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \ - -F "file=@/tmp/${{ steps.archive.outputs.archive_name }}" \ - -F "from_branch=${{ github.event.pull_request.base.ref }}" \ - -F "to_branch=${{ github.event.pull_request.head.ref }}") - - echo "Submit response:" - echo "$RESPONSE" | jq . - - REPORT_URL=$(echo "$RESPONSE" | jq -r '.report_url // empty') - - if [ -z "$REPORT_URL" ]; then - echo "Audit service did not return report_url" - exit 1 - fi - - echo "report_url=$REPORT_URL" >> "$GITHUB_OUTPUT" - - - name: Poll report until ready - id: poll - shell: bash - run: | - REPORT_PATH="${{ steps.submit.outputs.report_url }}" - if [ -z "$REPORT_PATH" ]; then - echo "Missing report_url" - exit 1 - fi - - echo "Polling report URL: ${{ vars.AUDIT_SERVICE_URL }}${REPORT_PATH}" - - for i in $(seq 1 20); do - HTTP_CODE=$(curl -s -o /tmp/audit-report.html -w "%{http_code}" "${{ vars.AUDIT_SERVICE_URL }}${REPORT_PATH}") - echo "Poll #$i HTTP_CODE=$HTTP_CODE" - - if [ "$HTTP_CODE" = "200" ] && [ -s /tmp/audit-report.html ]; then - echo "Report is ready" - exit 0 - fi - - sleep 60 - done - - echo "Audit report did not become available within timeout" - exit 1 - - - name: Fetch markdown report - shell: bash - run: | - REPORT_PATH="${{ steps.submit.outputs.report_url }}" - MD_PATH="${REPORT_PATH%audit-report.html}audit-report.md" - - echo "Markdown path: ${MD_PATH}" - HTTP_CODE=$(curl -s -o /tmp/audit-report.md -w "%{http_code}" "${{ vars.AUDIT_SERVICE_URL }}${MD_PATH}") - echo "Markdown fetch HTTP_CODE=$HTTP_CODE" - - if [ "$HTTP_CODE" != "200" ] || [ ! -s /tmp/audit-report.md ]; then - echo "Failed to fetch markdown report" - exit 1 - fi - - - name: Normalize markdown for GitHub comment - shell: bash - run: | - python3 <<'PY' - import re - from pathlib import Path - - p = Path("/tmp/audit-report.md") - text = p.read_text(encoding="utf-8", errors="ignore") - - # 去掉首尾空白,压缩多余空行 - text = re.sub(r'\n{3,}', '\n\n', text).strip() + '\n' - - # 如果首行已经是一级标题,保留;否则不额外加头 - Path("/tmp/audit-report-clean.md").write_text(text, encoding="utf-8") - PY - - - name: Comment markdown report to PR - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const reportText = fs.readFileSync('/tmp/audit-report-clean.md', 'utf8').trim(); - - const limit = 60000; - const chunks = []; - - for (let i = 0; i < reportText.length; i += limit) { - chunks.push(reportText.slice(i, i + limit)); - } - - for (let i = 0; i < chunks.length; i++) { - const body = chunks.length > 1 - ? `${chunks[i]}\n\n---\nPart ${i + 1}/${chunks.length}` - : chunks[i]; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - body - }); - } - - audit-by-comment: - name: Audit by PR comment - if: > - github.event_name == 'issue_comment' && - github.event.issue.pull_request && - contains(github.event.comment.body, '/audit-pr') && - contains(format(',{0},', vars.AUDIT_ALLOWED_USERS), format(',{0},', github.event.comment.user.login)) - runs-on: [self-hosted, Linux, ARM64, audit-linux] - - steps: - - name: Get PR info - id: pr - uses: actions/github-script@v7 - with: - script: | - const pr = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - core.setOutput('head_ref', pr.data.head.ref); - core.setOutput('base_ref', pr.data.base.ref); - core.setOutput('head_sha', pr.data.head.sha); - - - name: Checkout PR head - uses: actions/checkout@v4 - with: - ref: ${{ steps.pr.outputs.head_sha }} - fetch-depth: 0 - - - name: Check required tools - run: | - which zip - which jq - which python3 - - - name: Create source archive - id: archive - shell: bash - run: | - ARCHIVE_NAME="${{ github.event.repository.name }}.zip" - rm -f "/tmp/${ARCHIVE_NAME}" - zip -r "/tmp/${ARCHIVE_NAME}" . - echo "archive_name=${ARCHIVE_NAME}" >> "$GITHUB_OUTPUT" - - - name: Submit audit job - id: submit - shell: bash - run: | - RESPONSE=$(curl -s -X POST "${{ vars.AUDIT_SERVICE_URL }}/audit-pr/${{ vars.AUDIT_PR_SKILL }}" \ - -H "X-API-Key: ${{ secrets.AUDIT_API_KEY }}" \ - -F "file=@/tmp/${{ steps.archive.outputs.archive_name }}" \ - -F "from_branch=${{ steps.pr.outputs.base_ref }}" \ - -F "to_branch=${{ steps.pr.outputs.head_ref }}") - - echo "Submit response:" - echo "$RESPONSE" | jq . - - REPORT_URL=$(echo "$RESPONSE" | jq -r '.report_url // empty') - - if [ -z "$REPORT_URL" ]; then - echo "Audit service did not return report_url" - exit 1 - fi - - echo "report_url=$REPORT_URL" >> "$GITHUB_OUTPUT" - - - name: Poll report until ready - id: poll - shell: bash - run: | - REPORT_PATH="${{ steps.submit.outputs.report_url }}" - if [ -z "$REPORT_PATH" ]; then - echo "Missing report_url" - exit 1 - fi - - echo "Polling report URL: ${{ vars.AUDIT_SERVICE_URL }}${REPORT_PATH}" - - for i in $(seq 1 20); do - HTTP_CODE=$(curl -s -o /tmp/audit-report.html -w "%{http_code}" "${{ vars.AUDIT_SERVICE_URL }}${REPORT_PATH}") - echo "Poll #$i HTTP_CODE=$HTTP_CODE" - - if [ "$HTTP_CODE" = "200" ] && [ -s /tmp/audit-report.html ]; then - echo "Report is ready" - exit 0 - fi - - sleep 60 - done - - echo "Audit report did not become available within timeout" - exit 1 - - - name: Fetch markdown report - shell: bash - run: | - REPORT_PATH="${{ steps.submit.outputs.report_url }}" - MD_PATH="${REPORT_PATH%audit-report.html}audit-report.md" - - echo "Markdown path: ${MD_PATH}" - HTTP_CODE=$(curl -s -o /tmp/audit-report.md -w "%{http_code}" "${{ vars.AUDIT_SERVICE_URL }}${MD_PATH}") - echo "Markdown fetch HTTP_CODE=$HTTP_CODE" - - if [ "$HTTP_CODE" != "200" ] || [ ! -s /tmp/audit-report.md ]; then - echo "Failed to fetch markdown report" - exit 1 - fi - - - name: Normalize markdown for GitHub comment - shell: bash - run: | - python3 <<'PY' - import re - from pathlib import Path - - p = Path("/tmp/audit-report.md") - text = p.read_text(encoding="utf-8", errors="ignore") - - text = re.sub(r'\n{3,}', '\n\n', text).strip() + '\n' - - Path("/tmp/audit-report-clean.md").write_text(text, encoding="utf-8") - PY - - - name: Comment markdown report to PR - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const reportText = fs.readFileSync('/tmp/audit-report-clean.md', 'utf8').trim(); - - const limit = 60000; - const chunks = []; - - for (let i = 0; i < reportText.length; i += limit) { - chunks.push(reportText.slice(i, i + limit)); - } - - for (let i = 0; i < chunks.length; i++) { - const body = chunks.length > 1 - ? `${chunks[i]}\n\n---\nPart ${i + 1}/${chunks.length}` - : chunks[i]; - - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body - }); - }