@agentxv2/gateway 0.1.1

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.
Files changed (175) hide show
  1. package/.env.example +53 -0
  2. package/db/migrations/001_init.sql +117 -0
  3. package/db/migrations/002_agents.sql +20 -0
  4. package/db/migrations/003_a2a_results.sql +23 -0
  5. package/deploy/.env.deploy.example +23 -0
  6. package/deploy/add_swap_build.py +45 -0
  7. package/deploy/build_and_deploy.py +110 -0
  8. package/deploy/build_deploy_a2a.py +190 -0
  9. package/deploy/build_no_lint.py +52 -0
  10. package/deploy/build_on_fe.py +86 -0
  11. package/deploy/build_on_gw.py +98 -0
  12. package/deploy/build_prod.py +54 -0
  13. package/deploy/check_bal.py +31 -0
  14. package/deploy/check_code.py +47 -0
  15. package/deploy/check_deploy.sh +20 -0
  16. package/deploy/check_docs.py +16 -0
  17. package/deploy/check_frontend.py +42 -0
  18. package/deploy/check_frontend2.py +35 -0
  19. package/deploy/check_pks.py +34 -0
  20. package/deploy/check_status.py +32 -0
  21. package/deploy/check_v2.py +8 -0
  22. package/deploy/clean_install.py +28 -0
  23. package/deploy/deploy_a2a.py +58 -0
  24. package/deploy/deploy_a2a.sh +33 -0
  25. package/deploy/deploy_a2a_bg.sh +40 -0
  26. package/deploy/deploy_a2a_v2.py +151 -0
  27. package/deploy/deploy_a2a_v2.sh +36 -0
  28. package/deploy/deploy_bin.py +64 -0
  29. package/deploy/deploy_config.py +34 -0
  30. package/deploy/deploy_final.py +42 -0
  31. package/deploy/deploy_frontend.py +108 -0
  32. package/deploy/deploy_mcp.py +108 -0
  33. package/deploy/deploy_now.py +49 -0
  34. package/deploy/deploy_push_all.py +128 -0
  35. package/deploy/deploy_script.py +64 -0
  36. package/deploy/deploy_sep_a2a.sh +18 -0
  37. package/deploy/dev_mode.py +51 -0
  38. package/deploy/diag.py +12 -0
  39. package/deploy/diff_test.py +22 -0
  40. package/deploy/final_check.py +33 -0
  41. package/deploy/final_deploy.py +50 -0
  42. package/deploy/final_fix.py +54 -0
  43. package/deploy/final_push.py +114 -0
  44. package/deploy/find_frontend.py +38 -0
  45. package/deploy/fix_a2a.py +43 -0
  46. package/deploy/fix_and_build.py +77 -0
  47. package/deploy/fix_and_verify.py +56 -0
  48. package/deploy/fix_build.py +51 -0
  49. package/deploy/forge_deploy.py +67 -0
  50. package/deploy/full_push.py +101 -0
  51. package/deploy/full_push2.py +106 -0
  52. package/deploy/go_prod.py +59 -0
  53. package/deploy/gw_deploy.py +133 -0
  54. package/deploy/gw_final.py +206 -0
  55. package/deploy/gw_restart.py +28 -0
  56. package/deploy/gw_status.py +18 -0
  57. package/deploy/inline_build.py +99 -0
  58. package/deploy/one_shot.py +84 -0
  59. package/deploy/ox_deploy.py +32 -0
  60. package/deploy/pg_setup.py +36 -0
  61. package/deploy/prod_deploy.py +126 -0
  62. package/deploy/prod_final.py +140 -0
  63. package/deploy/prod_go.py +61 -0
  64. package/deploy/prod_one_shot.py +139 -0
  65. package/deploy/prod_setup.sh +62 -0
  66. package/deploy/prod_v2.py +91 -0
  67. package/deploy/prod_v3.py +103 -0
  68. package/deploy/push_docs.py +93 -0
  69. package/deploy/push_mcp.py +66 -0
  70. package/deploy/push_mcp_doc.py +28 -0
  71. package/deploy/push_v063.py +80 -0
  72. package/deploy/push_v2.py +71 -0
  73. package/deploy/qcheck.py +13 -0
  74. package/deploy/qcheck2.py +18 -0
  75. package/deploy/quick_check.py +8 -0
  76. package/deploy/rebuild.py +47 -0
  77. package/deploy/rebuild_frontend.py +44 -0
  78. package/deploy/restart.py +28 -0
  79. package/deploy/restore_frontend.py +42 -0
  80. package/deploy/restore_frontend2.py +41 -0
  81. package/deploy/restore_gateway.py +34 -0
  82. package/deploy/restore_quick.py +33 -0
  83. package/deploy/run_bash.py +19 -0
  84. package/deploy/run_sep.py +20 -0
  85. package/deploy/sdk_upgrade.py +50 -0
  86. package/deploy/server_prepare.py +41 -0
  87. package/deploy/server_setup.py +41 -0
  88. package/deploy/ssh_check.py +14 -0
  89. package/deploy/ssh_push.py +24 -0
  90. package/deploy/start_deploy.py +35 -0
  91. package/deploy/start_frontend.py +12 -0
  92. package/deploy/start_v2.py +29 -0
  93. package/deploy/stat.py +18 -0
  94. package/deploy/tail_log.py +11 -0
  95. package/deploy/update_env.py +32 -0
  96. package/deploy/upload_and_start.py +107 -0
  97. package/deploy/verify_a2a.py +13 -0
  98. package/deploy/verify_mcp.py +37 -0
  99. package/deploy/verify_sdk.py +21 -0
  100. package/dist/config.d.ts +26 -0
  101. package/dist/config.js +41 -0
  102. package/dist/config.js.map +1 -0
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +149 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/lib/crypto.d.ts +2 -0
  107. package/dist/lib/crypto.js +43 -0
  108. package/dist/lib/crypto.js.map +1 -0
  109. package/dist/lib/db.d.ts +3 -0
  110. package/dist/lib/db.js +26 -0
  111. package/dist/lib/db.js.map +1 -0
  112. package/dist/lib/ethers-utils.d.ts +60 -0
  113. package/dist/lib/ethers-utils.js +186 -0
  114. package/dist/lib/ethers-utils.js.map +1 -0
  115. package/dist/middleware/adminAuth.d.ts +2 -0
  116. package/dist/middleware/adminAuth.js +31 -0
  117. package/dist/middleware/adminAuth.js.map +1 -0
  118. package/dist/middleware/auth.d.ts +22 -0
  119. package/dist/middleware/auth.js +192 -0
  120. package/dist/middleware/auth.js.map +1 -0
  121. package/dist/middleware/error-handler.d.ts +36 -0
  122. package/dist/middleware/error-handler.js +100 -0
  123. package/dist/middleware/error-handler.js.map +1 -0
  124. package/dist/middleware/rate-limiter.d.ts +5 -0
  125. package/dist/middleware/rate-limiter.js +107 -0
  126. package/dist/middleware/rate-limiter.js.map +1 -0
  127. package/dist/routes/a2a.d.ts +2 -0
  128. package/dist/routes/a2a.js +84 -0
  129. package/dist/routes/a2a.js.map +1 -0
  130. package/dist/routes/admin.d.ts +2 -0
  131. package/dist/routes/admin.js +180 -0
  132. package/dist/routes/admin.js.map +1 -0
  133. package/dist/routes/agents.d.ts +2 -0
  134. package/dist/routes/agents.js +43 -0
  135. package/dist/routes/agents.js.map +1 -0
  136. package/dist/routes/chat.d.ts +2 -0
  137. package/dist/routes/chat.js +183 -0
  138. package/dist/routes/chat.js.map +1 -0
  139. package/dist/routes/history.d.ts +2 -0
  140. package/dist/routes/history.js +92 -0
  141. package/dist/routes/history.js.map +1 -0
  142. package/dist/routes/mcp.d.ts +13 -0
  143. package/dist/routes/mcp.js +513 -0
  144. package/dist/routes/mcp.js.map +1 -0
  145. package/dist/routes/tenant.d.ts +2 -0
  146. package/dist/routes/tenant.js +154 -0
  147. package/dist/routes/tenant.js.map +1 -0
  148. package/dist/services/a2a-worker.d.ts +7 -0
  149. package/dist/services/a2a-worker.js +406 -0
  150. package/dist/services/a2a-worker.js.map +1 -0
  151. package/dist/services/agent-indexer.d.ts +4 -0
  152. package/dist/services/agent-indexer.js +124 -0
  153. package/dist/services/agent-indexer.js.map +1 -0
  154. package/e2e_wallet.js +175 -0
  155. package/ecosystem.config.js +17 -0
  156. package/package.json +33 -0
  157. package/src/config.ts +47 -0
  158. package/src/index.ts +143 -0
  159. package/src/lib/crypto.ts +44 -0
  160. package/src/lib/db.ts +25 -0
  161. package/src/lib/ethers-utils.ts +229 -0
  162. package/src/middleware/adminAuth.ts +34 -0
  163. package/src/middleware/auth.ts +244 -0
  164. package/src/middleware/error-handler.ts +109 -0
  165. package/src/middleware/rate-limiter.ts +115 -0
  166. package/src/routes/a2a.ts +97 -0
  167. package/src/routes/admin.ts +219 -0
  168. package/src/routes/agents.ts +52 -0
  169. package/src/routes/chat.ts +219 -0
  170. package/src/routes/history.ts +114 -0
  171. package/src/routes/mcp.ts +567 -0
  172. package/src/routes/tenant.ts +196 -0
  173. package/src/services/a2a-worker.ts +486 -0
  174. package/src/services/agent-indexer.ts +127 -0
  175. package/tsconfig.json +18 -0
@@ -0,0 +1,86 @@
1
+ import paramiko
2
+ import time
3
+ import os
4
+ import tarfile
5
+
6
+ host_fe = '43.156.78.59'
7
+ password = 'Asdf1234!'
8
+
9
+ local_dir = r'c:\Users\apply\Downloads\code\agentx\extracted\Agentx\frontend'
10
+ tar_path = r'c:\Users\apply\Downloads\code\agentx_fe_src.tar.gz'
11
+
12
+ # Recreate tar
13
+ print("=== Creating tar ===")
14
+ with tarfile.open(tar_path, 'w:gz') as tar:
15
+ for root, dirs, files in os.walk(local_dir):
16
+ dirs[:] = [d for d in dirs if d not in ('node_modules', '.next', '.git', '__pycache__')]
17
+ for f in files:
18
+ if f.endswith('.tsbuildinfo'): continue
19
+ if f == 'pnpm-lock.yaml': continue
20
+ full = os.path.join(root, f)
21
+ arc = os.path.relpath(full, local_dir).replace('\\', '/')
22
+ tar.add(full, arcname=arc)
23
+ print(f"Size: {os.path.getsize(tar_path)}")
24
+
25
+ # Upload via SFTP
26
+ c = paramiko.Transport((host_fe, 22))
27
+ c.connect(username='ubuntu', password=password)
28
+ sftp = paramiko.SFTPClient.from_transport(c)
29
+
30
+ print("=== Uploading tar ===")
31
+ sftp.put(tar_path, '/tmp/fe_src.tar.gz')
32
+ sftp.close()
33
+ c.close()
34
+
35
+ # Now run SSH commands
36
+ def run(cmd):
37
+ c2 = paramiko.SSHClient()
38
+ c2.set_missing_host_key_policy(paramiko.AutoAddPolicy())
39
+ c2.connect(host_fe, username='ubuntu', password=password, timeout=15)
40
+ print(f"> {cmd[:120]}")
41
+ stdin, stdout, stderr = c2.exec_command(cmd)
42
+ out = stdout.read().decode()
43
+ err = stderr.read().decode()
44
+ ec = stdout.channel.recv_exit_status()
45
+ if out and len(out) > 0: print(out[-600:])
46
+ if err and 'deprecat' not in err.lower() and 'warn' not in err.lower(): print("ERR:", err[-300:])
47
+ c2.close()
48
+ return ec, out
49
+
50
+ # Extract source over existing agentx-platform
51
+ print("\n=== Extracting source files ===")
52
+ run("cd /tmp && rm -rf fe_src && mkdir fe_src && cd fe_src && tar xzf /tmp/fe_src.tar.gz && echo extracted")
53
+
54
+ # Copy source files to agentx-platform (overwrite changed files only)
55
+ run("cp -r /tmp/fe_src/app/* /home/ubuntu/agentx-platform/app/ && cp -r /tmp/fe_src/components/* /home/ubuntu/agentx-platform/components/ && cp -r /tmp/fe_src/hooks/* /home/ubuntu/agentx-platform/hooks/ && cp /tmp/fe_src/.env.local /home/ubuntu/agentx-platform/ && cp /tmp/fe_src/.env.production /home/ubuntu/agentx-platform/ && cp /tmp/fe_src/package.json /home/ubuntu/agentx-platform/ && echo 'source copied'")
56
+
57
+ # Remove old build
58
+ print("\n=== Cleaning ===")
59
+ run("rm -rf /home/ubuntu/agentx-platform/.next && echo cleaned")
60
+
61
+ # Install new SDK
62
+ print("\n=== Install SDK ===")
63
+ run("cd /home/ubuntu/agentx-platform && npm install @agentxv2/sdk@0.6.1 2>&1 | tail -5")
64
+
65
+ # Kill old server
66
+ run("fuser -k 8080/tcp 2>/dev/null; pkill -f 'next' 2>/dev/null; sleep 2; echo done")
67
+
68
+ # Build
69
+ print("\n=== Building ===")
70
+ ec, out = run("cd /home/ubuntu/agentx-platform && NODE_OPTIONS='--max-old-space-size=1536' npx next build 2>&1 | tail -30")
71
+ print(f"BUILD EXIT CODE: {ec}")
72
+
73
+ # Check
74
+ ec, out = run("ls /home/ubuntu/agentx-platform/.next/BUILD_ID 2>/dev/null && echo BUILD_OK || echo BUILD_FAILED")
75
+ if 'FAILED' in out:
76
+ print("BUILD FAILED - aborting")
77
+ exit(1)
78
+
79
+ # Start
80
+ print("\n=== Starting ===")
81
+ run("cd /home/ubuntu/agentx-platform && nohup npx next start -p 8080 > /tmp/fe-final.log 2>&1 &")
82
+ time.sleep(6)
83
+ run("ss -tlnp | grep 8080")
84
+ run("tail -5 /tmp/fe-final.log")
85
+
86
+ print("\n=== DONE! ===")
@@ -0,0 +1,98 @@
1
+ import paramiko
2
+ import time
3
+ import os
4
+ import tarfile
5
+
6
+ host_w = '101.33.109.117' # gateway - has swap + Ubuntu (fast npm)
7
+ host_fe = '43.156.78.59' # frontend - target
8
+ password = 'Asdf1234!'
9
+
10
+ # Step 1: Create a lightweight tar with ONLY the source files (no data files)
11
+ local_dir = r'c:\Users\apply\Downloads\code\agentx\extracted\Agentx\frontend'
12
+ tar_path = r'c:\Users\apply\Downloads\code\agentx_fe_src.tar.gz'
13
+
14
+ print("=== Creating lightweight source tar ===")
15
+ with tarfile.open(tar_path, 'w:gz') as tar:
16
+ for root, dirs, files in os.walk(local_dir):
17
+ dirs[:] = [d for d in dirs if d not in ('node_modules', '.next', '.git', '__pycache__')]
18
+ for f in files:
19
+ if f.endswith('.tsbuildinfo'): continue
20
+ if f == 'pnpm-lock.yaml': continue
21
+ full = os.path.join(root, f)
22
+ arc = os.path.relpath(full, local_dir).replace('\\', '/')
23
+ tar.add(full, arcname=arc)
24
+ print(f"Size: {os.path.getsize(tar_path)} bytes")
25
+
26
+ # Step 2: Upload via SCP to gateway server
27
+ print("\n=== Uploading to gateway server ===")
28
+ c = paramiko.SSHClient()
29
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
30
+ c.connect(host_w, username='ubuntu', password=password, timeout=10)
31
+
32
+ sftp = c.open_sftp()
33
+ sftp.put(tar_path, '/tmp/fe_src.tar.gz')
34
+ sftp.close()
35
+
36
+ def run(client, cmd, desc=""):
37
+ print(f"[{desc}] > {cmd[:120]}")
38
+ stdin, stdout, stderr = client.exec_command(cmd)
39
+ out = stdout.read().decode()
40
+ err = stderr.read().decode()
41
+ ec = stdout.channel.recv_exit_status()
42
+ if out and len(out) > 0: print(out[-500:])
43
+ if err and 'deprecated' not in err.lower() and 'warn' not in err.lower():
44
+ print("ERR:", err[-300:])
45
+ return ec, out, err
46
+
47
+ # Extract
48
+ run(c, "cd /tmp && rm -rf fe_build && mkdir fe_build && cd fe_build && tar xzf /tmp/fe_src.tar.gz && echo extracted")
49
+
50
+ # Install npm (fast on Ubuntu)
51
+ print("\n=== npm install ===")
52
+ ec, out, err = run(c, "cd /tmp/fe_build && npm install 2>&1 | tail -10", "npm install")
53
+
54
+ # Build
55
+ print("\n=== next build ===")
56
+ ec, out, err = run(c, "cd /tmp/fe_build && NODE_OPTIONS='--max-old-space-size=1536' npx next build 2>&1 | tail -30", "build")
57
+
58
+ # Check
59
+ ec, out, err = run(c, "test -f /tmp/fe_build/.next/BUILD_ID && echo BUILD_OK && cat /tmp/fe_build/.next/BUILD_ID || echo BUILD_FAILED")
60
+ if 'BUILD_FAILED' in out:
61
+ run(c, "tail -30 /tmp/fe_build/.next/trace 2>/dev/null; echo '---'; df -h /tmp")
62
+ c.close()
63
+ sys.exit(1)
64
+
65
+ # Pack .next
66
+ print("\n=== Packing .next ===")
67
+ run(c, "cd /tmp/fe_build && tar czf /tmp/fe_next.tar.gz .next .env.local .env.production 2>&1", "pack")
68
+
69
+ # SCP to frontend server
70
+ print("\n=== SCP to frontend ===")
71
+ ec, out, err = run(c, f"sshpass -p '{password}' scp -o StrictHostKeyChecking=no /tmp/fe_next.tar.gz ubuntu@{host_fe}:/tmp/fe_next.tar.gz 2>&1", "scp")
72
+ if ec != 0:
73
+ print("Trying apt install sshpass...")
74
+ run(c, "sudo apt-get install -y sshpass 2>&1 | tail -3")
75
+ run(c, f"sshpass -p '{password}' scp -o StrictHostKeyChecking=no /tmp/fe_next.tar.gz ubuntu@{host_fe}:/tmp/fe_next.tar.gz 2>&1")
76
+
77
+ # Deploy on frontend
78
+ print("\n=== Deploy on frontend server ===")
79
+ c2 = paramiko.SSHClient()
80
+ c2.set_missing_host_key_policy(paramiko.AutoAddPolicy())
81
+ c2.connect(host_fe, username='ubuntu', password=password, timeout=10)
82
+
83
+ run(c2, "fuser -k 8080/tcp 2>/dev/null; pkill -f 'next' 2>/dev/null; sleep 2; echo cleaned")
84
+ run(c2, "cd /tmp && rm -rf /tmp/fe_deploy && mkdir fe_deploy && cd fe_deploy && tar xzf /tmp/fe_next.tar.gz && echo extracted")
85
+ run(c2, "rm -rf /home/ubuntu/agentx-platform/.next && cp -r /tmp/fe_deploy/.next /home/ubuntu/agentx-platform/ && echo '.next copied'")
86
+ run(c2, "cp /tmp/fe_deploy/.env.local /home/ubuntu/agentx-platform/ 2>/dev/null && echo 'env copied'")
87
+ run(c2, "cp /tmp/fe_deploy/.env.production /home/ubuntu/agentx-platform/ 2>/dev/null && echo 'env-prod copied'")
88
+
89
+ # Start
90
+ print("\n=== Starting ===")
91
+ run(c2, "cd /home/ubuntu/agentx-platform && nohup npx next start -p 8080 > /tmp/next-run.log 2>&1 &")
92
+ time.sleep(5)
93
+ ec, out, err = run(c2, "ss -tlnp | grep 8080")
94
+ run(c2, "tail -5 /tmp/next-run.log")
95
+
96
+ c.close()
97
+ c2.close()
98
+ print("\n=== DONE ===")
@@ -0,0 +1,54 @@
1
+ import paramiko, time
2
+
3
+ c = paramiko.SSHClient()
4
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
5
+ c.connect('43.156.225.164', username='ubuntu', password='Asdf1234!', timeout=30)
6
+
7
+ print("=== Build ===")
8
+ stdin, stdout, stderr = c.exec_command(
9
+ "cd /home/ubuntu/agentx-platform && NODE_OPTIONS='--max-old-space-size=2560' ./node_modules/.bin/next build 2>&1 | tail -20",
10
+ timeout=600
11
+ )
12
+ out = stdout.read().decode()
13
+ err = stderr.read().decode()
14
+ ec = stdout.channel.recv_exit_status()
15
+ print(out[-600:])
16
+ if err: print("E:", err[-200:])
17
+
18
+ # Check actual build result
19
+ stdin2, stdout2, stderr2 = c.exec_command(
20
+ "ls /home/ubuntu/agentx-platform/.next/BUILD_ID 2>/dev/null && echo 'BUILD_OK' || echo 'BUILD_FAILED'"
21
+ )
22
+ print(stdout2.read().decode().strip())
23
+
24
+ build_ok = False
25
+ if 'BUILD_OK' in stdout2.read().decode() if hasattr(stdout2, 'read') else False:
26
+ build_ok = True
27
+
28
+ # If failed, show errors
29
+ stdin3, stdout3, stderr3 = c.exec_command("ls /home/ubuntu/agentx-platform/.next/BUILD_ID 2>/dev/null")
30
+ build_id = stdout3.read().decode().strip()
31
+ if build_id:
32
+ print("BUILD SUCCESS!")
33
+
34
+ # Start
35
+ print("\n=== Start ===")
36
+ c.exec_command("fuser -k 3000/tcp 2>/dev/null; sleep 2", timeout=10)
37
+ c.exec_command(
38
+ "cd /home/ubuntu/agentx-platform && nohup ./node_modules/.bin/next start -p 3000 > /tmp/agentx-run.log 2>&1 & disown",
39
+ timeout=5
40
+ )
41
+ time.sleep(6)
42
+
43
+ stdin4, stdout4, stderr4 = c.exec_command("ss -tlnp | grep 3000 && echo '---' && curl -sI http://localhost:3000/ 2>&1 | head -5")
44
+ print(stdout4.read().decode())
45
+ print("\n✅ http://43.156.225.164:3000")
46
+ else:
47
+ print("BUILD FAILED")
48
+ stdin3, stdout3, stderr3 = c.exec_command(
49
+ "cd /home/ubuntu/agentx-platform && ./node_modules/.bin/next build 2>&1 | grep -E 'error|Error|Module|Failed' | tail -10",
50
+ timeout=120
51
+ )
52
+ print(stdout3.read().decode())
53
+
54
+ c.close()
@@ -0,0 +1,31 @@
1
+ import paramiko, base64
2
+ c=paramiko.SSHClient()
3
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
4
+ c.connect('43.156.78.59',username='ubuntu',password='Asdf1234!',timeout=10)
5
+
6
+ script = '''#!/bin/bash
7
+ export PATH=$HOME/.foundry/bin:$PATH
8
+ echo "=== Balances for 0x0918272f68C39483737eeB48F4Adb2C09CBD6A55 ==="
9
+ echo "Sepolia:"
10
+ cast balance 0x0918272f68C39483737eeB48F4Adb2C09CBD6A55 --rpc-url https://ethereum-sepolia-rpc.publicnode.com
11
+ echo "OxaChain:"
12
+ cast balance 0x0918272f68C39483737eeB48F4Adb2C09CBD6A55 --rpc-url http://43.156.99.215:18545
13
+ echo "=== pk2 ==="
14
+ cat ~/pk2.txt
15
+ echo "=== pk3 ==="
16
+ cat ~/pk3.txt
17
+ echo "=== pk2 balances ==="
18
+ PK2_ADDR=$(cat ~/signer2.json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['address'])")
19
+ echo "Addr: $PK2_ADDR"
20
+ cast balance $PK2_ADDR --rpc-url https://ethereum-sepolia-rpc.publicnode.com 2>/dev/null || echo "Sepolia: error"
21
+ echo "=== pk3 balances ==="
22
+ PK3_ADDR=$(cat ~/signer3.json | python3 -c "import sys,json; print(json.load(sys.stdin)[0]['address'])")
23
+ echo "Addr: $PK3_ADDR"
24
+ cast balance $PK3_ADDR --rpc-url https://ethereum-sepolia-rpc.publicnode.com 2>/dev/null || echo "Sepolia: error"
25
+ '''
26
+ b64=base64.b64encode(script.encode()).decode()
27
+ stdin,stdout,stderr=c.exec_command('echo "'+b64+'"|base64 -d|bash 2>&1')
28
+ out=stdout.read().decode(); err=stderr.read().decode()
29
+ print(out)
30
+ if err: print("E:",err[-500:])
31
+ c.close()
@@ -0,0 +1,47 @@
1
+ import os
2
+
3
+ root = r'c:\Users\apply\Downloads\code\agentx\extracted\Agentx'
4
+
5
+ checks = {
6
+ 'SDK package.json': 'sdk/package.json',
7
+ 'SDK v0.6.2': ('sdk/package.json', '0.6.2'),
8
+ 'SDK Sepolia A2A': ('sdk/src/config/config.ts', '0x309C7447d89f3087A9924BB686d88df020F7e9cB'),
9
+ 'SDK OxaChain A2A': ('sdk/src/config/config.ts', '0xDF2939EFafEe6439eB2226DbEd07AD6F5Ae2112B'),
10
+ 'Frontend A2A page': 'frontend/app/a2a/page.tsx',
11
+ 'Frontend chat page': 'frontend/app/user/chat/[agentId]/page.tsx',
12
+ 'next.config ignoreBuildErrors': ('frontend/next.config.js', 'ignoreBuildErrors: true'),
13
+ 'Gateway src/index': 'gateway/src/index.ts',
14
+ 'Gateway routes/chat': 'gateway/src/routes/chat.ts',
15
+ 'Gateway middleware/auth': 'gateway/src/middleware/auth.ts',
16
+ 'A2A Solidity getUserTasks': ('contracts/src/erc8004-extensions/A2AProtocolRegistry.sol', 'getUserTasks'),
17
+ 'AgentLoop': 'sdk/src/agent-loop/index.ts',
18
+ 'LLM module': 'sdk/src/llm/index.ts',
19
+ '.env.production GATEWAY': ('frontend/.env.production', '43.156.225.164:3090'),
20
+ 'PROGRESS.md': 'memory/AGENTX_PROGRESS.md',
21
+ 'README.md': 'README.md',
22
+ 'INTEGRATION.md': 'INTEGRATION.md',
23
+ }
24
+
25
+ all_ok = True
26
+ for name, path in checks.items():
27
+ if isinstance(path, tuple):
28
+ fname, keyword = path
29
+ else:
30
+ fname, keyword = path, None
31
+ full = os.path.join(root, fname)
32
+ if not os.path.exists(full):
33
+ print(f'MISSING: {name}')
34
+ all_ok = False
35
+ elif keyword:
36
+ with open(full, 'r', encoding='utf-8', errors='ignore') as f:
37
+ content = f.read()
38
+ if keyword in content:
39
+ print(f'OK: {name}')
40
+ else:
41
+ print(f'CONTENT MISSING: {name} - keyword not found')
42
+ all_ok = False
43
+ else:
44
+ print(f'OK: {name}')
45
+
46
+ print()
47
+ print('CODEBASE COMPLETE' if all_ok else 'CODEBASE HAS ISSUES')
@@ -0,0 +1,20 @@
1
+ #!/bin/bash
2
+ export PATH=$HOME/.foundry/bin:$PATH
3
+ echo "=== checking deployment ==="
4
+ # Check broadcast file
5
+ BROADCAST="/tmp/a2a_build/broadcast/DeployA2A.s.sol/11155111/run-latest.json"
6
+ if [ -f "$BROADCAST" ]; then
7
+ echo "Found broadcast file"
8
+ cat "$BROADCAST" | head -30
9
+ else
10
+ echo "NO broadcast file"
11
+ fi
12
+
13
+ echo ""
14
+ echo "=== logs ==="
15
+ ls -la /tmp/a2a_build/broadcast/DeployA2A.s.sol/11155111/ 2>/dev/null
16
+ cat /tmp/sep_deploy.log 2>/dev/null | tail -20 || echo "no log file"
17
+
18
+ echo ""
19
+ echo "=== A2A address on Sepolia ==="
20
+ cast call 0xEdb0022c250B38e281B3EF1418037889fC5C6092 "getAllSkills()(tuple(uint256,string,string,string,string,string[],uint256,bool,uint256)[])" --rpc-url https://ethereum-sepolia-rpc.publicnode.com 2>&1 | head -3
@@ -0,0 +1,16 @@
1
+ import os
2
+
3
+ root = r'c:\Users\apply\Downloads\code\agentx\extracted\Agentx'
4
+ docs = ['README.md', 'INTEGRATION.md', 'DEPLOYMENT.md', 'MCP_SETUP.md', 'sdk/README.md', 'memory/AGENTX_PROGRESS.md']
5
+
6
+ for d in docs:
7
+ full = os.path.join(root, d)
8
+ if os.path.exists(full):
9
+ with open(full, 'r', encoding='utf-8', errors='ignore') as f:
10
+ content = f.read()
11
+ has_oxa = 'OxaChain' in content or '0xbf5F' in content
12
+ has_19505 = '19505' in content
13
+ ok = "OK" if (has_oxa and has_19505) else "MISSING L1"
14
+ print(f" {ok:12s} {d}")
15
+ else:
16
+ print(f" MISSING {d}")
@@ -0,0 +1,42 @@
1
+ import paramiko
2
+
3
+ # Check if same server has different IPs, and find frontend
4
+ host = '101.33.109.117'
5
+ user = 'ubuntu'
6
+ password = 'Asdf1234!'
7
+
8
+ client = paramiko.SSHClient()
9
+ client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
10
+ client.connect(host, username=user, password=password)
11
+
12
+ def run(cmd):
13
+ stdin, stdout, stderr = client.exec_command(cmd)
14
+ out = stdout.read().decode()
15
+ err = stderr.read().decode()
16
+ stdout.channel.recv_exit_status()
17
+ if out: print(out)
18
+ if err: print("E:", err[:200])
19
+ return out
20
+
21
+ # Check network interfaces
22
+ print("=== Network Interfaces ===")
23
+ run("ip addr show 2>/dev/null | grep -E 'inet ' | head -10")
24
+ run("hostname -I 2>/dev/null")
25
+
26
+ # Check if port 8080 is open on this server
27
+ print("\n=== Port 8080? ===")
28
+ run("ss -tlnp | grep 8080 || echo 'Port 8080 not open on this server'")
29
+
30
+ # Check archive directory for any agentx frontend
31
+ print("\n=== Archive contents ===")
32
+ run("ls ~/archive/ 2>/dev/null")
33
+
34
+ # Check smart-menu (might host the frontend)
35
+ print("\n=== Smart-menu check ===")
36
+ run("ls ~/smart-menu/ 2>/dev/null | head -20")
37
+
38
+ client.close()
39
+
40
+ print("\n\n=== Need to update frontend on 43.156.78.59 ===")
41
+ print("The frontend server is at 43.156.78.59:8080")
42
+ print("Gateway is running at 101.33.109.117:3090")
@@ -0,0 +1,35 @@
1
+ import paramiko
2
+
3
+ host = '43.156.78.59'
4
+ user = 'ubuntu'
5
+ password = 'Asdf1234!'
6
+
7
+ print(f"Trying to connect to frontend server {host}...")
8
+
9
+ try:
10
+ client = paramiko.SSHClient()
11
+ client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
12
+ client.connect(host, username=user, password=password, timeout=10)
13
+
14
+ def run(cmd):
15
+ stdin, stdout, stderr = client.exec_command(cmd)
16
+ out = stdout.read().decode()
17
+ err = stderr.read().decode()
18
+ stdout.channel.recv_exit_status()
19
+ if out: print(out)
20
+ if err: print("E:", err[:300])
21
+ return out
22
+
23
+ print("=== Connected! ===")
24
+
25
+ # Find AgentX frontend
26
+ print("\n=== Finding frontend ===")
27
+ run("ls ~/ 2>/dev/null")
28
+ run("find /home -name 'next.config.js' -maxdepth 5 2>/dev/null | head -5")
29
+ run("pm2 list 2>/dev/null")
30
+ run("ss -tlnp | grep -E '8080|3000' 2>/dev/null")
31
+
32
+ client.close()
33
+ except Exception as e:
34
+ print(f"Connection failed: {e}")
35
+ print("Will try with different credentials or check reachability...")
@@ -0,0 +1,34 @@
1
+ import paramiko
2
+
3
+ # User's Sepolia private keys
4
+ pks = [
5
+ '0x9ff7f5511067c86fdd8c1dee11799e4778e4b1e86e5093d53eae8d4af356a424',
6
+ '0x23632a1517bc5c41a8f21d9e2818231f7878335d2d22e41274fc5ad067ab631b',
7
+ ]
8
+
9
+ c = paramiko.SSHClient()
10
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
11
+ c.connect('43.156.78.59', username='ubuntu', password='Asdf1234!', timeout=10)
12
+
13
+ for i, pk in enumerate(pks):
14
+ print(f"\n=== PK {i+1} ===")
15
+ stdin, stdout, stderr = c.exec_command(
16
+ f"export PATH=$HOME/.foundry/bin:$PATH && "
17
+ f"cast w a {pk} 2>&1"
18
+ )
19
+ addr = stdout.read().decode().strip()
20
+ err = stderr.read().decode().strip()
21
+ if err:
22
+ print(f" Error: {err}")
23
+ continue
24
+ print(f" Address: {addr}")
25
+
26
+ stdin, stdout, stderr = c.exec_command(
27
+ f"export PATH=$HOME/.foundry/bin:$PATH && "
28
+ f"cast balance {addr} --rpc-url https://ethereum-sepolia-rpc.publicnode.com 2>&1"
29
+ )
30
+ bal = stdout.read().decode().strip()
31
+ err = stderr.read().decode().strip()
32
+ print(f" Sepolia wei: {bal}")
33
+
34
+ c.close()
@@ -0,0 +1,32 @@
1
+ import paramiko
2
+ import time
3
+
4
+ host_f = '43.156.78.59'
5
+ c = paramiko.SSHClient()
6
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
7
+ c.connect(host_f, username='ubuntu', password='Asdf1234!', timeout=10)
8
+
9
+ def run(cmd):
10
+ stdin, stdout, stderr = c.exec_command(cmd)
11
+ out = stdout.read().decode()
12
+ err = stderr.read().decode()
13
+ stdout.channel.recv_exit_status()
14
+ if out: print(out)
15
+ if err: print("ERR:", err[-300:])
16
+
17
+ print("Waiting for Next.js to compile...")
18
+ time.sleep(5)
19
+
20
+ # Check log
21
+ print("=== Log (last 15 lines) ===")
22
+ run("tail -15 /tmp/n8080.log 2>/dev/null")
23
+
24
+ # Check if port is listening
25
+ print("\n=== Port 8080 ===")
26
+ run("ss -tlnp | grep 8080")
27
+
28
+ # Try HTTP
29
+ print("\n=== HTTP Test ===")
30
+ run("curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://localhost:8080/ 2>&1")
31
+
32
+ c.close()
@@ -0,0 +1,8 @@
1
+ import paramiko
2
+ c = paramiko.SSHClient()
3
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
4
+ c.connect('43.156.78.59', username='ubuntu', password='Asdf1234!', timeout=10)
5
+ stdin, stdout, stderr = c.exec_command('cat /tmp/a2a_deploy2.log 2>/dev/null || echo "NO V2 LOG"; echo "---"; ps aux | grep forge | grep -v grep')
6
+ out = stdout.read().decode()
7
+ print(out)
8
+ c.close()
@@ -0,0 +1,28 @@
1
+ import paramiko
2
+ c = paramiko.SSHClient()
3
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
4
+ c.connect('43.156.225.164', username='ubuntu', password='Asdf1234!', timeout=10)
5
+
6
+ # Kill everything
7
+ c.exec_command("pkill -f 'npm install' 2>/dev/null; pkill -f 'next' 2>/dev/null; sleep 2; echo 'killed'", timeout=10)
8
+
9
+ # Check what's left
10
+ stdin, stdout, stderr = c.exec_command("ps aux | grep -v grep | grep -E 'next|npm' | head -3 || echo 'none'")
11
+ print("After kill:", stdout.read().decode()[:200])
12
+
13
+ # Now do npm install cleanly
14
+ print("\n=== npm install --legacy-peer-deps ===")
15
+ stdin, stdout, stderr = c.exec_command(
16
+ "cd /home/ubuntu/agentx-platform && npm install --legacy-peer-deps 2>&1 | tail -8",
17
+ timeout=600
18
+ )
19
+ out = stdout.read().decode()
20
+ err = stderr.read().decode()
21
+ print(out)
22
+ if err: print("ERR:", err[-300:])
23
+
24
+ # Verify next exists
25
+ stdin, stdout, stderr = c.exec_command("ls /home/ubuntu/agentx-platform/node_modules/next/package.json && echo 'NEXT_OK'")
26
+ print(stdout.read().decode())
27
+
28
+ c.close()
@@ -0,0 +1,58 @@
1
+ import paramiko
2
+ import tarfile
3
+ import os
4
+ import time
5
+
6
+ host = '43.156.78.59'
7
+
8
+ # Create tar of contracts
9
+ local_dir = r'c:\Users\apply\Downloads\code\agentx\extracted\Agentx\contracts'
10
+ tar_path = r'c:\Users\apply\Downloads\code\agentx_contracts.tar.gz'
11
+
12
+ print("=== Creating contracts tar ===")
13
+ with tarfile.open(tar_path, 'w:gz') as tar:
14
+ for root, dirs, files in os.walk(local_dir):
15
+ dirs[:] = [d for d in dirs if d not in ('node_modules', 'lib', 'out', 'cache', 'broadcast', '.git')]
16
+ for f in files:
17
+ if f.endswith('.json') and 'out' in root: continue
18
+ full = os.path.join(root, f)
19
+ arc = os.path.relpath(full, local_dir).replace('\\', '/')
20
+ tar.add(full, arcname=arc)
21
+ print(f"Size: {os.path.getsize(tar_path)}")
22
+
23
+ # Upload via SFTP
24
+ print("\n=== Uploading ===")
25
+ transport = paramiko.Transport((host, 22))
26
+ transport.connect(username='ubuntu', password='Asdf1234!')
27
+ sftp = paramiko.SFTPClient.from_transport(transport)
28
+ sftp.put(tar_path, '/tmp/a2a_contracts.tar.gz')
29
+ sftp.close()
30
+ transport.close()
31
+
32
+ def run(cmd, desc=""):
33
+ c = paramiko.SSHClient()
34
+ c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
35
+ c.connect(host, username='ubuntu', password='Asdf1234!', timeout=300)
36
+ print(f"[{desc}] > {cmd[:120]}")
37
+ stdin, stdout, stderr = c.exec_command(cmd, timeout=600)
38
+ out = stdout.read().decode()
39
+ err = stderr.read().decode()
40
+ ec = stdout.channel.recv_exit_status()
41
+ if out: print(out[-800:])
42
+ if err and 'Warning' not in err and 'warn' not in err.lower(): print("ERR:", err[-300:])
43
+ c.close()
44
+ return ec, out
45
+
46
+ # Extract
47
+ print("\n=== Extracting ===")
48
+ run("cd /tmp && rm -rf a2a_contracts && mkdir a2a_contracts && cd a2a_contracts && tar xzf /tmp/a2a_contracts.tar.gz && echo extracted")
49
+
50
+ # Check if git submodules (forge-std) are present
51
+ print("\n=== Checking deps ===")
52
+ run("ls /tmp/a2a_contracts/lib/forge-std/src/Script.sol 2>/dev/null && echo 'forge-std OK' || echo 'MISSING forge-std'")
53
+ run("ls /tmp/a2a_contracts/lib/openzeppelin-contracts/contracts/access/Ownable.sol 2>/dev/null && echo 'OZ OK' || echo 'MISSING OZ'")
54
+
55
+ # If deps missing, try to find them elsewhere
56
+ print("\n=== Finding existing contract deps ===")
57
+ run("find /home -name 'forge-std' -type d -maxdepth 5 2>/dev/null | head -5")
58
+ run("find /home -name 'Script.sol' -path '*/forge-std/*' -maxdepth 6 2>/dev/null | head -5")
@@ -0,0 +1,33 @@
1
+ #!/bin/bash
2
+ export PATH=$HOME/.foundry/bin:$PATH
3
+ cd /tmp/a2a_build
4
+ ln -sf erc8004-interfaces src/interfaces
5
+
6
+ PK=0x9ff7f5511067c86fdd8c1dee11799e4778e4b1e86e5093d53eae8d4af356a424
7
+ SEP_IR=0xe94ad380d3F8d08a7590eda0C84f354a93F96e5F
8
+
9
+ echo "===== SEPOLIA ====="
10
+ # Use forge create directly with constructor args
11
+ ARGS_HEX=$(cast abi-encode 'constructor(address)' $SEP_IR)
12
+ echo "constructor args: $ARGS_HEX"
13
+
14
+ forge create \
15
+ --rpc-url https://ethereum-sepolia-rpc.publicnode.com \
16
+ --private-key $PK \
17
+ --legacy \
18
+ src/erc8004-extensions/A2AProtocolRegistry.sol:A2AProtocolRegistry \
19
+ --constructor-args $ARGS_HEX \
20
+ 2>&1
21
+
22
+ echo ""
23
+ echo "===== OXACHAIN L1 ====="
24
+ OX_IR=0xbf5F9db266c8c97E3334466C88597Eb758AfE212
25
+ OX_ARGS_HEX=$(cast abi-encode 'constructor(address)' $OX_IR)
26
+
27
+ forge create \
28
+ --rpc-url http://43.156.99.215:18545 \
29
+ --private-key $PK \
30
+ --legacy \
31
+ src/erc8004-extensions/A2AProtocolRegistry.sol:A2AProtocolRegistry \
32
+ --constructor-args $OX_ARGS_HEX \
33
+ 2>&1