oneie 3.6.40 → 3.8.0

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 (984) hide show
  1. package/README.md +28 -9
  2. package/dist/admin/build.d.ts +15 -0
  3. package/dist/admin/build.d.ts.map +1 -0
  4. package/dist/admin/build.js +295 -0
  5. package/dist/admin/build.js.map +1 -0
  6. package/dist/admin/index.d.ts +24 -0
  7. package/dist/admin/index.d.ts.map +1 -0
  8. package/dist/admin/index.js +98 -0
  9. package/dist/admin/index.js.map +1 -0
  10. package/dist/admin/list.d.ts +14 -0
  11. package/dist/admin/list.d.ts.map +1 -0
  12. package/dist/admin/list.js +90 -0
  13. package/dist/admin/list.js.map +1 -0
  14. package/dist/admin/manifest.d.ts +86 -0
  15. package/dist/admin/manifest.d.ts.map +1 -0
  16. package/dist/admin/manifest.js +183 -0
  17. package/dist/admin/manifest.js.map +1 -0
  18. package/dist/admin/monorepo.d.ts +25 -0
  19. package/dist/admin/monorepo.d.ts.map +1 -0
  20. package/dist/admin/monorepo.js +59 -0
  21. package/dist/admin/monorepo.js.map +1 -0
  22. package/dist/admin/release.d.ts +17 -0
  23. package/dist/admin/release.d.ts.map +1 -0
  24. package/dist/admin/release.js +144 -0
  25. package/dist/admin/release.js.map +1 -0
  26. package/dist/admin/sync.d.ts +14 -0
  27. package/dist/admin/sync.d.ts.map +1 -0
  28. package/dist/admin/sync.js +104 -0
  29. package/dist/admin/sync.js.map +1 -0
  30. package/dist/admin/validate.d.ts +15 -0
  31. package/dist/admin/validate.d.ts.map +1 -0
  32. package/dist/admin/validate.js +169 -0
  33. package/dist/admin/validate.js.map +1 -0
  34. package/dist/commands/agent.d.ts +2 -0
  35. package/dist/commands/agent.d.ts.map +1 -1
  36. package/dist/commands/agent.js +44 -0
  37. package/dist/commands/agent.js.map +1 -1
  38. package/dist/commands/ask.d.ts +4 -0
  39. package/dist/commands/ask.d.ts.map +1 -0
  40. package/dist/commands/ask.js +8 -0
  41. package/dist/commands/ask.js.map +1 -0
  42. package/dist/commands/bounty.d.ts +4 -0
  43. package/dist/commands/bounty.d.ts.map +1 -0
  44. package/dist/commands/bounty.js +24 -0
  45. package/dist/commands/bounty.js.map +1 -0
  46. package/dist/commands/capabilities.d.ts +4 -0
  47. package/dist/commands/capabilities.d.ts.map +1 -0
  48. package/dist/commands/capabilities.js +18 -0
  49. package/dist/commands/capabilities.js.map +1 -0
  50. package/dist/commands/claw.d.ts +4 -0
  51. package/dist/commands/claw.d.ts.map +1 -0
  52. package/dist/commands/claw.js +14 -0
  53. package/dist/commands/claw.js.map +1 -0
  54. package/dist/commands/commend.d.ts +4 -0
  55. package/dist/commands/commend.d.ts.map +1 -0
  56. package/dist/commands/commend.js +13 -0
  57. package/dist/commands/commend.js.map +1 -0
  58. package/dist/commands/completion.d.ts +4 -0
  59. package/dist/commands/completion.d.ts.map +1 -0
  60. package/dist/commands/completion.js +49 -0
  61. package/dist/commands/completion.js.map +1 -0
  62. package/dist/commands/config.d.ts +4 -0
  63. package/dist/commands/config.d.ts.map +1 -0
  64. package/dist/commands/config.js +78 -0
  65. package/dist/commands/config.js.map +1 -0
  66. package/dist/commands/deploy.d.ts +4 -0
  67. package/dist/commands/deploy.d.ts.map +1 -0
  68. package/dist/commands/deploy.js +10 -0
  69. package/dist/commands/deploy.js.map +1 -0
  70. package/dist/commands/doctor.d.ts +4 -0
  71. package/dist/commands/doctor.d.ts.map +1 -0
  72. package/dist/commands/doctor.js +72 -0
  73. package/dist/commands/doctor.js.map +1 -0
  74. package/dist/commands/export.d.ts +4 -0
  75. package/dist/commands/export.d.ts.map +1 -0
  76. package/dist/commands/export.js +15 -0
  77. package/dist/commands/export.js.map +1 -0
  78. package/dist/commands/fade.d.ts +4 -0
  79. package/dist/commands/fade.d.ts.map +1 -0
  80. package/dist/commands/fade.js +15 -0
  81. package/dist/commands/fade.js.map +1 -0
  82. package/dist/commands/flag.d.ts +4 -0
  83. package/dist/commands/flag.d.ts.map +1 -0
  84. package/dist/commands/flag.js +13 -0
  85. package/dist/commands/flag.js.map +1 -0
  86. package/dist/commands/forget.d.ts +4 -0
  87. package/dist/commands/forget.d.ts.map +1 -0
  88. package/dist/commands/forget.js +16 -0
  89. package/dist/commands/forget.js.map +1 -0
  90. package/dist/commands/frontier.d.ts +4 -0
  91. package/dist/commands/frontier.d.ts.map +1 -0
  92. package/dist/commands/frontier.js +11 -0
  93. package/dist/commands/frontier.js.map +1 -0
  94. package/dist/commands/health.d.ts +4 -0
  95. package/dist/commands/health.d.ts.map +1 -0
  96. package/dist/commands/health.js +11 -0
  97. package/dist/commands/health.js.map +1 -0
  98. package/dist/commands/highways.d.ts +4 -0
  99. package/dist/commands/highways.d.ts.map +1 -0
  100. package/dist/commands/highways.js +14 -0
  101. package/dist/commands/highways.js.map +1 -0
  102. package/dist/commands/hire.d.ts +4 -0
  103. package/dist/commands/hire.d.ts.map +1 -0
  104. package/dist/commands/hire.js +16 -0
  105. package/dist/commands/hire.js.map +1 -0
  106. package/dist/commands/init.d.ts.map +1 -1
  107. package/dist/commands/init.js +69 -42
  108. package/dist/commands/init.js.map +1 -1
  109. package/dist/commands/know.d.ts +4 -0
  110. package/dist/commands/know.d.ts.map +1 -0
  111. package/dist/commands/know.js +8 -0
  112. package/dist/commands/know.js.map +1 -0
  113. package/dist/commands/launch.d.ts +4 -0
  114. package/dist/commands/launch.d.ts.map +1 -0
  115. package/dist/commands/launch.js +16 -0
  116. package/dist/commands/launch.js.map +1 -0
  117. package/dist/commands/mark.d.ts +4 -0
  118. package/dist/commands/mark.d.ts.map +1 -0
  119. package/dist/commands/mark.js +15 -0
  120. package/dist/commands/mark.js.map +1 -0
  121. package/dist/commands/pay.d.ts +4 -0
  122. package/dist/commands/pay.d.ts.map +1 -0
  123. package/dist/commands/pay.js +21 -0
  124. package/dist/commands/pay.js.map +1 -0
  125. package/dist/commands/pipe.d.ts +4 -0
  126. package/dist/commands/pipe.d.ts.map +1 -0
  127. package/dist/commands/pipe.js +35 -0
  128. package/dist/commands/pipe.js.map +1 -0
  129. package/dist/commands/publish.d.ts +4 -0
  130. package/dist/commands/publish.d.ts.map +1 -0
  131. package/dist/commands/publish.js +23 -0
  132. package/dist/commands/publish.js.map +1 -0
  133. package/dist/commands/recall.d.ts +4 -0
  134. package/dist/commands/recall.d.ts.map +1 -0
  135. package/dist/commands/recall.js +12 -0
  136. package/dist/commands/recall.js.map +1 -0
  137. package/dist/commands/repl.d.ts +4 -0
  138. package/dist/commands/repl.d.ts.map +1 -0
  139. package/dist/commands/repl.js +56 -0
  140. package/dist/commands/repl.js.map +1 -0
  141. package/dist/commands/reveal.d.ts +4 -0
  142. package/dist/commands/reveal.d.ts.map +1 -0
  143. package/dist/commands/reveal.js +11 -0
  144. package/dist/commands/reveal.js.map +1 -0
  145. package/dist/commands/revenue.d.ts +4 -0
  146. package/dist/commands/revenue.d.ts.map +1 -0
  147. package/dist/commands/revenue.js +11 -0
  148. package/dist/commands/revenue.js.map +1 -0
  149. package/dist/commands/select.d.ts +4 -0
  150. package/dist/commands/select.d.ts.map +1 -0
  151. package/dist/commands/select.js +19 -0
  152. package/dist/commands/select.js.map +1 -0
  153. package/dist/commands/signal.d.ts +4 -0
  154. package/dist/commands/signal.d.ts.map +1 -0
  155. package/dist/commands/signal.js +8 -0
  156. package/dist/commands/signal.js.map +1 -0
  157. package/dist/commands/stats.d.ts +4 -0
  158. package/dist/commands/stats.d.ts.map +1 -0
  159. package/dist/commands/stats.js +11 -0
  160. package/dist/commands/stats.js.map +1 -0
  161. package/dist/commands/status.d.ts +4 -0
  162. package/dist/commands/status.d.ts.map +1 -0
  163. package/dist/commands/status.js +18 -0
  164. package/dist/commands/status.js.map +1 -0
  165. package/dist/commands/sync.d.ts +4 -0
  166. package/dist/commands/sync.d.ts.map +1 -0
  167. package/dist/commands/sync.js +20 -0
  168. package/dist/commands/sync.js.map +1 -0
  169. package/dist/commands/tail.d.ts +4 -0
  170. package/dist/commands/tail.d.ts.map +1 -0
  171. package/dist/commands/tail.js +51 -0
  172. package/dist/commands/tail.js.map +1 -0
  173. package/dist/commands/warn.d.ts +4 -0
  174. package/dist/commands/warn.d.ts.map +1 -0
  175. package/dist/commands/warn.js +15 -0
  176. package/dist/commands/warn.js.map +1 -0
  177. package/dist/create-org-profile.js +2 -2
  178. package/dist/create-user-profile.js +2 -2
  179. package/dist/index.js +135 -7
  180. package/dist/index.js.map +1 -1
  181. package/dist/lib/args.d.ts +11 -0
  182. package/dist/lib/args.d.ts.map +1 -0
  183. package/dist/lib/args.js +57 -0
  184. package/dist/lib/args.js.map +1 -0
  185. package/dist/lib/config.d.ts +12 -0
  186. package/dist/lib/config.d.ts.map +1 -0
  187. package/dist/lib/config.js +38 -0
  188. package/dist/lib/config.js.map +1 -0
  189. package/dist/lib/http.d.ts +9 -0
  190. package/dist/lib/http.d.ts.map +1 -0
  191. package/dist/lib/http.js +25 -0
  192. package/dist/lib/http.js.map +1 -0
  193. package/dist/lib/output.d.ts +5 -0
  194. package/dist/lib/output.d.ts.map +1 -0
  195. package/dist/lib/output.js +32 -0
  196. package/dist/lib/output.js.map +1 -0
  197. package/dist/lib/sdk.d.ts +10 -0
  198. package/dist/lib/sdk.d.ts.map +1 -0
  199. package/dist/lib/sdk.js +22 -0
  200. package/dist/lib/sdk.js.map +1 -0
  201. package/dist/lib/telemetry.d.ts +4 -0
  202. package/dist/lib/telemetry.d.ts.map +1 -0
  203. package/dist/lib/telemetry.js +61 -0
  204. package/dist/lib/telemetry.js.map +1 -0
  205. package/dist/utils/file-resolver.js +1 -3
  206. package/dist/utils/file-resolver.js.map +1 -1
  207. package/dist/utils/installation-setup.d.ts +15 -0
  208. package/dist/utils/installation-setup.d.ts.map +1 -1
  209. package/dist/utils/installation-setup.js +71 -8
  210. package/dist/utils/installation-setup.js.map +1 -1
  211. package/package.json +5 -21
  212. package/.claude/agents/TROUBLESHOOTING.md +0 -530
  213. package/.claude/agents/agent-backend.md +0 -574
  214. package/.claude/agents/agent-builder.md +0 -911
  215. package/.claude/agents/agent-claude.md +0 -645
  216. package/.claude/agents/agent-clean.md +0 -477
  217. package/.claude/agents/agent-clone.md +0 -554
  218. package/.claude/agents/agent-designer.md +0 -1080
  219. package/.claude/agents/agent-director.md +0 -2254
  220. package/.claude/agents/agent-documenter.md +0 -688
  221. package/.claude/agents/agent-frontend.md +0 -1199
  222. package/.claude/agents/agent-integrator.md +0 -670
  223. package/.claude/agents/agent-lawyer.md +0 -1320
  224. package/.claude/agents/agent-news.md +0 -363
  225. package/.claude/agents/agent-onboard.md +0 -613
  226. package/.claude/agents/agent-ontology.md +0 -585
  227. package/.claude/agents/agent-ops.md +0 -1275
  228. package/.claude/agents/agent-problem-solver.md +0 -669
  229. package/.claude/agents/agent-quality.md +0 -1042
  230. package/.claude/agents/agent-sales.md +0 -507
  231. package/.claude/agents/agent-writer.md +0 -1068
  232. package/.claude/commands/cascade.md +0 -742
  233. package/.claude/commands/chat.md +0 -728
  234. package/.claude/commands/commit.md +0 -95
  235. package/.claude/commands/create.md +0 -544
  236. package/.claude/commands/deploy.md +0 -309
  237. package/.claude/commands/fast.md +0 -636
  238. package/.claude/commands/mcp-on.md +0 -191
  239. package/.claude/commands/media-upload.md +0 -186
  240. package/.claude/commands/news.md +0 -274
  241. package/.claude/commands/onboard.md +0 -440
  242. package/.claude/commands/one.md +0 -398
  243. package/.claude/commands/optimize.md +0 -74
  244. package/.claude/commands/plan.md +0 -719
  245. package/.claude/commands/push.md +0 -214
  246. package/.claude/commands/release.md +0 -105
  247. package/.claude/commands/review.md +0 -99
  248. package/.claude/commands/server.md +0 -487
  249. package/.claude/commands/start.md +0 -227
  250. package/.claude/commands/test.md +0 -197
  251. package/.claude/commands/validate.md +0 -140
  252. package/.claude/hooks/.last-news-context +0 -1
  253. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
  254. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  255. package/.claude/hooks/README-news-generation.md +0 -364
  256. package/.claude/hooks/README-root-cleanup.md +0 -200
  257. package/.claude/hooks/README.md +0 -284
  258. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  259. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  260. package/.claude/hooks/auto-format.sh +0 -106
  261. package/.claude/hooks/check-filenames.py +0 -177
  262. package/.claude/hooks/clean-post.py +0 -468
  263. package/.claude/hooks/clean-pre.py +0 -393
  264. package/.claude/hooks/clean-root-markdown.sh +0 -73
  265. package/.claude/hooks/commit-push.sh +0 -95
  266. package/.claude/hooks/done.py +0 -236
  267. package/.claude/hooks/format-hook.sh +0 -163
  268. package/.claude/hooks/formatting.py +0 -187
  269. package/.claude/hooks/hook-logger.sh +0 -173
  270. package/.claude/hooks/knowledge-post.py +0 -355
  271. package/.claude/hooks/knowledge-pre.py +0 -245
  272. package/.claude/hooks/mcp-on.sh +0 -134
  273. package/.claude/hooks/notification-hook.sh +0 -279
  274. package/.claude/hooks/ontology-validation.py +0 -255
  275. package/.claude/hooks/push.sh +0 -153
  276. package/.claude/hooks/release-cli.sh +0 -205
  277. package/.claude/hooks/root-cleanup.py +0 -217
  278. package/.claude/hooks/security-hook.sh +0 -397
  279. package/.claude/hooks/tag-all-docs.py +0 -464
  280. package/.claude/hooks/test-validate-ontology.sh +0 -170
  281. package/.claude/hooks/todo.py +0 -368
  282. package/.claude/hooks/track-changes.sh +0 -101
  283. package/.claude/hooks/validate-imports.py +0 -182
  284. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  285. package/.claude/hooks/validate-ontology-structure.py +0 -558
  286. package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
  287. package/.claude/hooks/validate-ontology.py +0 -140
  288. package/.claude/hooks/write-news.sh +0 -194
  289. package/.claude/skills/INDEX.md +0 -523
  290. package/.claude/skills/REGISTRY.md +0 -529
  291. package/.claude/skills/agent-backend-create-mutation.md +0 -319
  292. package/.claude/skills/agent-designer-create-wireframe.md +0 -341
  293. package/.claude/skills/agent-frontend-create-page.md +0 -413
  294. package/.claude/skills/agents/README.md +0 -238
  295. package/.claude/skills/astro/add-content-collection.md +0 -30
  296. package/.claude/skills/astro/check-build.md +0 -29
  297. package/.claude/skills/astro/create-component.md +0 -29
  298. package/.claude/skills/astro/create-page.md +0 -30
  299. package/.claude/skills/astro/optimize-performance.md +0 -21
  300. package/.claude/skills/convex/check-deployment.md +0 -46
  301. package/.claude/skills/convex/create-mutation.md +0 -405
  302. package/.claude/skills/convex/create-query.md +0 -52
  303. package/.claude/skills/convex/read-schema.md +0 -373
  304. package/.claude/skills/convex/test-function.md +0 -50
  305. package/.claude/skills/deployment/check-deployment-health.md +0 -20
  306. package/.claude/skills/deployment/create-release.md +0 -21
  307. package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
  308. package/.claude/skills/deployment/deploy-convex.md +0 -30
  309. package/.claude/skills/deployment/sync-repositories.md +0 -19
  310. package/.claude/skills/design/check-accessibility.md +0 -21
  311. package/.claude/skills/design/create-component-spec.md +0 -27
  312. package/.claude/skills/design/generate-design-tokens.md +0 -24
  313. package/.claude/skills/design/generate-wireframe.md +0 -30
  314. package/.claude/skills/documentation/create-migration-guide.md +0 -20
  315. package/.claude/skills/documentation/generate-api-docs.md +0 -27
  316. package/.claude/skills/documentation/generate-readme.md +0 -22
  317. package/.claude/skills/documentation/update-knowledge.md +0 -20
  318. package/.claude/skills/integration/connect-external-system.md +0 -21
  319. package/.claude/skills/integration/implement-a2a.md +0 -20
  320. package/.claude/skills/integration/implement-acp.md +0 -20
  321. package/.claude/skills/integration/verify-integration.md +0 -20
  322. package/.claude/skills/ontology/README.md +0 -255
  323. package/.claude/skills/ontology/check-dimension.md +0 -307
  324. package/.claude/skills/ontology/generate-entity-type.md +0 -339
  325. package/.claude/skills/ontology/validate-schema.md +0 -229
  326. package/.claude/skills/ontology/verify-relationships.md +0 -310
  327. package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
  328. package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
  329. package/.claude/skills/problem-solving/propose-solution.md +0 -29
  330. package/.claude/skills/problem-solving/verify-fix.md +0 -21
  331. package/.claude/skills/sales/generate-demo-script.md +0 -21
  332. package/.claude/skills/sales/qualify-lead.md +0 -30
  333. package/.claude/skills/sales/track-trial.md +0 -20
  334. package/.claude/skills/sales/verify-kyc.md +0 -20
  335. package/.claude/skills/testing/analyze-coverage.md +0 -24
  336. package/.claude/skills/testing/generate-tests.md +0 -24
  337. package/.claude/skills/testing/run-tests.md +0 -27
  338. package/.claude/skills/testing/validate-e2e.md +0 -25
  339. package/AGENTS.md +0 -60
  340. package/CLAUDE.md +0 -321
  341. package/CREATE-WEBSITE.md +0 -458
  342. package/SECURITY.md +0 -31
  343. package/dist/commands/create-website.d.ts +0 -19
  344. package/dist/commands/create-website.d.ts.map +0 -1
  345. package/dist/commands/create-website.js +0 -231
  346. package/dist/commands/create-website.js.map +0 -1
  347. package/folders.yaml +0 -92
  348. package/one/README.md +0 -760
  349. package/one/connections/a2a.md +0 -600
  350. package/one/connections/acp.md +0 -808
  351. package/one/connections/acps.md +0 -749
  352. package/one/connections/agentkit.md +0 -367
  353. package/one/connections/agui.md +0 -785
  354. package/one/connections/any-backend.md +0 -1720
  355. package/one/connections/ap2.md +0 -1072
  356. package/one/connections/api/queries-reference.md +0 -860
  357. package/one/connections/api-docs.md +0 -1909
  358. package/one/connections/api-reference.md +0 -1029
  359. package/one/connections/api.md +0 -2208
  360. package/one/connections/architecture-diagram.md +0 -112
  361. package/one/connections/communications.md +0 -467
  362. package/one/connections/connections.md +0 -357
  363. package/one/connections/copilotkit.md +0 -1577
  364. package/one/connections/cryptonetworks.md +0 -799
  365. package/one/connections/documentation.md +0 -1138
  366. package/one/connections/effect.md +0 -297
  367. package/one/connections/elizaos.md +0 -1308
  368. package/one/connections/groups.md +0 -814
  369. package/one/connections/inference.md +0 -76
  370. package/one/connections/integration-examples.md +0 -893
  371. package/one/connections/integration-guide.md +0 -887
  372. package/one/connections/integration-phase2.md +0 -754
  373. package/one/connections/kyc.md +0 -650
  374. package/one/connections/mcp.md +0 -860
  375. package/one/connections/membership.md +0 -1170
  376. package/one/connections/middleware.md +0 -1085
  377. package/one/connections/multitenant.md +0 -1359
  378. package/one/connections/n8n.md +0 -1033
  379. package/one/connections/patterns.md +0 -107
  380. package/one/connections/protocols.md +0 -297
  381. package/one/connections/relationships.md +0 -125
  382. package/one/connections/schema.md +0 -605
  383. package/one/connections/service-layer.md +0 -568
  384. package/one/connections/vectors.md +0 -225
  385. package/one/connections/wordpress.md +0 -1320
  386. package/one/connections/workflow-copy.md +0 -923
  387. package/one/connections/workflow-examples.md +0 -759
  388. package/one/connections/workflow-onboarding.md +0 -701
  389. package/one/connections/workflow.md +0 -923
  390. package/one/connections/workflows/delegation.md +0 -903
  391. package/one/connections/workflows/frontend.md +0 -1055
  392. package/one/connections/workflows/strategy.md +0 -921
  393. package/one/connections/workflows/tasks.md +0 -716
  394. package/one/connections/x402-baazar.md +0 -131
  395. package/one/connections/x402.md +0 -1353
  396. package/one/groups/features.md +0 -2904
  397. package/one/groups/groups.md +0 -587
  398. package/one/groups/one.md +0 -619
  399. package/one/groups/strategy-copy.md +0 -887
  400. package/one/knowledge/.obsidian/app.json +0 -1
  401. package/one/knowledge/.obsidian/appearance.json +0 -1
  402. package/one/knowledge/.obsidian/core-plugins.json +0 -33
  403. package/one/knowledge/.obsidian/ecommerce-ontology.md +0 -210
  404. package/one/knowledge/.obsidian/workspace.json +0 -211
  405. package/one/knowledge/100-inference-quick-reference.md +0 -449
  406. package/one/knowledge/ag-ui-protocol.md +0 -613
  407. package/one/knowledge/agent-onboard-usage.md +0 -630
  408. package/one/knowledge/agentic-commerce.md +0 -146
  409. package/one/knowledge/ai-agents-vs-memecoins-thesis.md +0 -683
  410. package/one/knowledge/ai-api-reference.md +0 -715
  411. package/one/knowledge/ai-platform.md +0 -323
  412. package/one/knowledge/ai-quickstart.md +0 -355
  413. package/one/knowledge/ai-sdk-implementation.md +0 -436
  414. package/one/knowledge/ai-token-crypto-analysis-framework.md +0 -1191
  415. package/one/knowledge/ai-token-paradigm-shift-2025.md +0 -732
  416. package/one/knowledge/altcoin-cycle-prediction-ontology.md +0 -884
  417. package/one/knowledge/altcoin-cycle-trading-strategy.md +0 -642
  418. package/one/knowledge/architecture-any-backend.md +0 -1589
  419. package/one/knowledge/architecture-diagram.md +0 -404
  420. package/one/knowledge/architecture-frontend.md +0 -1014
  421. package/one/knowledge/architecture.md +0 -1742
  422. package/one/knowledge/archived/ontology.old.md +0 -2840
  423. package/one/knowledge/astro-effect-complete-vision.md +0 -2148
  424. package/one/knowledge/astro-effect-simple-architecture.md +0 -750
  425. package/one/knowledge/audit-agent-onboard-alignment.md +0 -481
  426. package/one/knowledge/audit-agent-sales-alignment.md +0 -444
  427. package/one/knowledge/backend-api-reference.md +0 -728
  428. package/one/knowledge/cascading-context-specification.md +0 -1617
  429. package/one/knowledge/claude-code-integration.md +0 -1293
  430. package/one/knowledge/cli-claude-handoff.md +0 -736
  431. package/one/knowledge/context-engineering.md +0 -610
  432. package/one/knowledge/crypto-analysis-strategy.md +0 -1276
  433. package/one/knowledge/crypto-cycle-2024-2025-analysis.md +0 -44
  434. package/one/knowledge/crypto.md +0 -978
  435. package/one/knowledge/develop/design.md +0 -364
  436. package/one/knowledge/develop/index.md +0 -145
  437. package/one/knowledge/development-commands.md +0 -251
  438. package/one/knowledge/docs.md +0 -627
  439. package/one/knowledge/dsl.md +0 -1678
  440. package/one/knowledge/event-driven-documentation.md +0 -270
  441. package/one/knowledge/files.md +0 -2489
  442. package/one/knowledge/frontend.md +0 -1056
  443. package/one/knowledge/games-english.md +0 -691
  444. package/one/knowledge/games.md +0 -1082
  445. package/one/knowledge/generative-ui-patterns.md +0 -559
  446. package/one/knowledge/guidelines.md +0 -314
  447. package/one/knowledge/hono.md +0 -2127
  448. package/one/knowledge/implementation-examples.md +0 -2554
  449. package/one/knowledge/installation-folders.md +0 -366
  450. package/one/knowledge/institutional-cycle-paradigm-2025.md +0 -555
  451. package/one/knowledge/knowledge.md +0 -660
  452. package/one/knowledge/language.md +0 -998
  453. package/one/knowledge/lessons-learned.md +0 -378
  454. package/one/knowledge/lessons-website-building-focus.md +0 -382
  455. package/one/knowledge/merge-report.md +0 -254
  456. package/one/knowledge/metadata-system.md +0 -504
  457. package/one/knowledge/nine-padel-playbook.md +0 -229
  458. package/one/knowledge/one-protocol-ai-agents.md +0 -892
  459. package/one/knowledge/one-protocol-executive-report.md +0 -617
  460. package/one/knowledge/one-protocol-standard.md +0 -869
  461. package/one/knowledge/one-protocol-whitepaper.md +0 -756
  462. package/one/knowledge/ontology-blog.yaml +0 -47
  463. package/one/knowledge/ontology-cheatsheet.md +0 -617
  464. package/one/knowledge/ontology-community.yaml +0 -65
  465. package/one/knowledge/ontology-core-universal.md +0 -740
  466. package/one/knowledge/ontology-core.yaml +0 -63
  467. package/one/knowledge/ontology-courses.yaml +0 -76
  468. package/one/knowledge/ontology-creator.md +0 -402
  469. package/one/knowledge/ontology-crypto.md +0 -1603
  470. package/one/knowledge/ontology-developer-guide.md +0 -814
  471. package/one/knowledge/ontology-documentation.md +0 -377
  472. package/one/knowledge/ontology-ecommerce.md +0 -269
  473. package/one/knowledge/ontology-education-game.md +0 -1654
  474. package/one/knowledge/ontology-education.md +0 -938
  475. package/one/knowledge/ontology-engineering-specification.md +0 -1310
  476. package/one/knowledge/ontology-engineering.md +0 -1676
  477. package/one/knowledge/ontology-files.yaml +0 -525
  478. package/one/knowledge/ontology-frontend-master.md +0 -2898
  479. package/one/knowledge/ontology-frontend-specifications.md +0 -2196
  480. package/one/knowledge/ontology-frontend.md +0 -2475
  481. package/one/knowledge/ontology-index.md +0 -397
  482. package/one/knowledge/ontology-minimal.yaml +0 -301
  483. package/one/knowledge/ontology-portfolio.yaml +0 -45
  484. package/one/knowledge/ontology-quickstart.md +0 -602
  485. package/one/knowledge/ontology-release.md +0 -317
  486. package/one/knowledge/ontology-shop.yaml +0 -148
  487. package/one/knowledge/ontology-tokens.yaml +0 -51
  488. package/one/knowledge/ontology-tutorial.md +0 -455
  489. package/one/knowledge/ontology-v2.md +0 -4449
  490. package/one/knowledge/ontology-video-script.md +0 -939
  491. package/one/knowledge/ontology-visual-guide.md +0 -378
  492. package/one/knowledge/ontology.md +0 -3847
  493. package/one/knowledge/ontology.yaml +0 -1653
  494. package/one/knowledge/parallel-agents.md +0 -932
  495. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +0 -130
  496. package/one/knowledge/patterns/backend/convex-query-pattern.md +0 -143
  497. package/one/knowledge/patterns/backend/mutation-template.md +0 -249
  498. package/one/knowledge/patterns/backend/query-template.md +0 -286
  499. package/one/knowledge/patterns/backend/service-template.md +0 -258
  500. package/one/knowledge/patterns/design/component-architecture.md +0 -435
  501. package/one/knowledge/patterns/design/index.md +0 -160
  502. package/one/knowledge/patterns/design/test-driven-design-pattern.md +0 -196
  503. package/one/knowledge/patterns/design/wireframe-template.md +0 -250
  504. package/one/knowledge/patterns/frontend/component-template.md +0 -246
  505. package/one/knowledge/patterns/frontend/form-template.md +0 -348
  506. package/one/knowledge/patterns/frontend/page-template.md +0 -209
  507. package/one/knowledge/patterns/frontend/react-component-pattern.md +0 -188
  508. package/one/knowledge/patterns/test/acceptance-criteria-template.md +0 -396
  509. package/one/knowledge/patterns/test/technical-test-template.md +0 -566
  510. package/one/knowledge/patterns/test/test-driven-pattern.md +0 -160
  511. package/one/knowledge/patterns/test/user-flow-template.md +0 -272
  512. package/one/knowledge/performance.md +0 -459
  513. package/one/knowledge/provider-agnostic-content.md +0 -995
  514. package/one/knowledge/provider-creation-guide.md +0 -1082
  515. package/one/knowledge/quality-loop.md +0 -419
  516. package/one/knowledge/quick-start-ontology-mapping.md +0 -773
  517. package/one/knowledge/readme-architecture.md +0 -158
  518. package/one/knowledge/readme.md +0 -149
  519. package/one/knowledge/rules.md +0 -644
  520. package/one/knowledge/score.md +0 -85
  521. package/one/knowledge/specifications.md +0 -873
  522. package/one/knowledge/tags.md +0 -148
  523. package/one/knowledge/todo-template.md +0 -269
  524. package/one/knowledge/todo.md +0 -269
  525. package/one/knowledge/troubleshooting.md +0 -434
  526. package/one/knowledge/typescript-patterns.md +0 -321
  527. package/one/knowledge/universal-generation-language.md +0 -827
  528. package/one/knowledge/x402-research.md +0 -104
  529. package/one/license.md +0 -107
  530. package/one/people/anthony-o-connell.md +0 -469
  531. package/one/people/people.md +0 -590
  532. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
  533. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
  534. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
  535. package/one/things/CHECKLIST.md +0 -407
  536. package/one/things/IMPLEMENTATION_STATUS.md +0 -379
  537. package/one/things/ONE.md +0 -529
  538. package/one/things/agents/agent-backend.md +0 -1501
  539. package/one/things/agents/agent-builder.md +0 -1064
  540. package/one/things/agents/agent-clean.md +0 -1112
  541. package/one/things/agents/agent-clone.md +0 -1324
  542. package/one/things/agents/agent-deploy.md +0 -986
  543. package/one/things/agents/agent-designer.md +0 -2305
  544. package/one/things/agents/agent-director.md +0 -1526
  545. package/one/things/agents/agent-documenter.md +0 -1129
  546. package/one/things/agents/agent-frontend.md +0 -1201
  547. package/one/things/agents/agent-integrator.md +0 -1269
  548. package/one/things/agents/agent-lawyer.md +0 -1371
  549. package/one/things/agents/agent-problem-solver.md +0 -1457
  550. package/one/things/agents/agent-quality.md +0 -1483
  551. package/one/things/agents/agent-sales.md +0 -1074
  552. package/one/things/cascade/cascade.yaml +0 -481
  553. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
  554. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
  555. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
  556. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
  557. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
  558. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
  559. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
  560. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
  561. package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
  562. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
  563. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
  564. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
  565. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
  566. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
  567. package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
  568. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
  569. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
  570. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
  571. package/one/things/cascade/docs/examples/readme.md +0 -259
  572. package/one/things/cascade/docs/getting-started.md +0 -533
  573. package/one/things/cascade/docs/workflow.md +0 -1378
  574. package/one/things/cascade/readme.md +0 -379
  575. package/one/things/cascade/templates/feature-template.md +0 -289
  576. package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
  577. package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
  578. package/one/things/claude/agents/analyst.md +0 -508
  579. package/one/things/claude/agents/architect.md +0 -505
  580. package/one/things/claude/agents/brand-identity-specialist.md +0 -538
  581. package/one/things/claude/agents/bstp-token-strategist.md +0 -690
  582. package/one/things/claude/agents/builder-repo.md +0 -532
  583. package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
  584. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
  585. package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
  586. package/one/things/claude/agents/company-bullstamp-character.md +0 -602
  587. package/one/things/claude/agents/company-bullstamp-community.md +0 -307
  588. package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
  589. package/one/things/claude/agents/company-bullstamp-token.md +0 -307
  590. package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
  591. package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
  592. package/one/things/claude/agents/content-calendar-planner.md +0 -473
  593. package/one/things/claude/agents/content-chapter-formatter.md +0 -513
  594. package/one/things/claude/agents/content-formatter.md +0 -571
  595. package/one/things/claude/agents/content-hook-specialist.md +0 -485
  596. package/one/things/claude/agents/content-image-formatter.md +0 -560
  597. package/one/things/claude/agents/content-introduction-formatter.md +0 -510
  598. package/one/things/claude/agents/content-multiplication-engine.md +0 -579
  599. package/one/things/claude/agents/content-playbook-writer.md +0 -473
  600. package/one/things/claude/agents/content-team-manager.md +0 -647
  601. package/one/things/claude/agents/content-toc-formatter.md +0 -547
  602. package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
  603. package/one/things/claude/agents/core-manager.md +0 -607
  604. package/one/things/claude/agents/core-master.md +0 -426
  605. package/one/things/claude/agents/cross-functional-manager.md +0 -476
  606. package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
  607. package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
  608. package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
  609. package/one/things/claude/agents/crypto-community-analyst.md +0 -314
  610. package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
  611. package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
  612. package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
  613. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
  614. package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
  615. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
  616. package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
  617. package/one/things/claude/agents/crypto-market-researcher.md +0 -307
  618. package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
  619. package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
  620. package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
  621. package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
  622. package/one/things/claude/agents/crypto-team-manager.md +0 -392
  623. package/one/things/claude/agents/crypto-token-analyst.md +0 -319
  624. package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
  625. package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
  626. package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
  627. package/one/things/claude/agents/customer-journey-designer.md +0 -474
  628. package/one/things/claude/agents/customer-success-manager.md +0 -574
  629. package/one/things/claude/agents/dev.md +0 -406
  630. package/one/things/claude/agents/documenter.md +0 -548
  631. package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
  632. package/one/things/claude/agents/engagement-specialist.md +0 -502
  633. package/one/things/claude/agents/engineering-architect.md +0 -387
  634. package/one/things/claude/agents/engineering-business-analyst.md +0 -527
  635. package/one/things/claude/agents/engineering-developer.md +0 -386
  636. package/one/things/claude/agents/engineering-director.md +0 -322
  637. package/one/things/claude/agents/engineering-ingestor.md +0 -659
  638. package/one/things/claude/agents/engineering-product-manager.md +0 -525
  639. package/one/things/claude/agents/engineering-product-owner.md +0 -527
  640. package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
  641. package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
  642. package/one/things/claude/agents/engineering-team-manager.md +0 -515
  643. package/one/things/claude/agents/engineering-user-experience.md +0 -386
  644. package/one/things/claude/agents/framework-elevate-manager.md +0 -309
  645. package/one/things/claude/agents/improver.md +0 -805
  646. package/one/things/claude/agents/intelligence-team-manager.md +0 -390
  647. package/one/things/claude/agents/lead-capture-expert.md +0 -459
  648. package/one/things/claude/agents/lead-magnet-creator.md +0 -446
  649. package/one/things/claude/agents/market-research-analyst.md +0 -435
  650. package/one/things/claude/agents/marketing-brand-identity.md +0 -344
  651. package/one/things/claude/agents/marketing-content-hooks.md +0 -455
  652. package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
  653. package/one/things/claude/agents/marketing-content-poster.md +0 -372
  654. package/one/things/claude/agents/marketing-customer-journey.md +0 -331
  655. package/one/things/claude/agents/marketing-director.md +0 -402
  656. package/one/things/claude/agents/marketing-engagement.md +0 -331
  657. package/one/things/claude/agents/marketing-lead-capture.md +0 -331
  658. package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
  659. package/one/things/claude/agents/marketing-network-effects.md +0 -331
  660. package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
  661. package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
  662. package/one/things/claude/agents/marketing-team-manager.md +0 -451
  663. package/one/things/claude/agents/marketing-viral-growth.md +0 -232
  664. package/one/things/claude/agents/mission-commander.md +0 -378
  665. package/one/things/claude/agents/network-effect-analyst.md +0 -604
  666. package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
  667. package/one/things/claude/agents/npx.md +0 -946
  668. package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
  669. package/one/things/claude/agents/one-master.md +0 -378
  670. package/one/things/claude/agents/one-orchestrator.md +0 -345
  671. package/one/things/claude/agents/one.md +0 -658
  672. package/one/things/claude/agents/playbook-generator.md +0 -526
  673. package/one/things/claude/agents/pm.md +0 -349
  674. package/one/things/claude/agents/po.md +0 -370
  675. package/one/things/claude/agents/qa.md +0 -361
  676. package/one/things/claude/agents/research-foundation-analyst.md +0 -324
  677. package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
  678. package/one/things/claude/agents/research-market-analyst.md +0 -324
  679. package/one/things/claude/agents/research-team-manager.md +0 -489
  680. package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
  681. package/one/things/claude/agents/sales-team-manager.md +0 -407
  682. package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
  683. package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
  684. package/one/things/claude/agents/service-advocacy-manager.md +0 -324
  685. package/one/things/claude/agents/service-success-manager.md +0 -324
  686. package/one/things/claude/agents/service-team-manager.md +0 -405
  687. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
  688. package/one/things/claude/agents/share-optimization-specialist.md +0 -576
  689. package/one/things/claude/agents/sm.md +0 -352
  690. package/one/things/claude/agents/story-teller.md +0 -498
  691. package/one/things/claude/agents/task-master.md +0 -621
  692. package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
  693. package/one/things/claude/agents/tester.md +0 -595
  694. package/one/things/claude/agents/the-bull-character-manager.md +0 -603
  695. package/one/things/claude/agents/tools-playbook-generator.md +0 -492
  696. package/one/things/claude/agents/turbo-repo-builder.md +0 -346
  697. package/one/things/claude/agents/upsell-strategist.md +0 -503
  698. package/one/things/claude/agents/ux-expert.md +0 -360
  699. package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
  700. package/one/things/claude/claude-code-hooks-development.json +0 -21
  701. package/one/things/claude/claude-code-hooks-production.json +0 -21
  702. package/one/things/claude/claude-code-hooks.json +0 -25
  703. package/one/things/claude/commands/agent.md +0 -124
  704. package/one/things/claude/commands/cascade-status.md +0 -153
  705. package/one/things/claude/commands/ingest.md +0 -343
  706. package/one/things/claude/commands/ingestor.md +0 -158
  707. package/one/things/claude/commands/mission.md +0 -103
  708. package/one/things/claude/commands/npx.md +0 -156
  709. package/one/things/claude/commands/one.md +0 -486
  710. package/one/things/claude/commands/quality-check.md +0 -252
  711. package/one/things/claude/commands/smart-route.md +0 -261
  712. package/one/things/claude/commands/start.md +0 -139
  713. package/one/things/claude/commands/story.md +0 -103
  714. package/one/things/claude/commands/task.md +0 -193
  715. package/one/things/claude/hook-bypass.json +0 -32
  716. package/one/things/claude/hooks/agent-hook-config.json +0 -427
  717. package/one/things/claude/hooks/build-hook.sh +0 -156
  718. package/one/things/claude/hooks/cleanup-hook.sh +0 -201
  719. package/one/things/claude/hooks/file-organization-hook.sh +0 -80
  720. package/one/things/claude/hooks/format-hook.sh +0 -43
  721. package/one/things/claude/hooks/hook-bypass.sh +0 -293
  722. package/one/things/claude/hooks/hook-debouncer.sh +0 -62
  723. package/one/things/claude/hooks/hook-logger.sh +0 -89
  724. package/one/things/claude/hooks/lint-hook.sh +0 -140
  725. package/one/things/claude/hooks/notification-hook.sh +0 -204
  726. package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
  727. package/one/things/claude/hooks/performance-metrics.json +0 -25
  728. package/one/things/claude/hooks/security-hook.sh +0 -256
  729. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
  730. package/one/things/claude/hooks/story-validation-hook.sh +0 -145
  731. package/one/things/claude/hooks/test-hook.sh +0 -145
  732. package/one/things/claude/hooks/test-story-validation.sh +0 -170
  733. package/one/things/claude/settings-local.json +0 -86
  734. package/one/things/cli/cli-code.md +0 -677
  735. package/one/things/cli/cli-compiler-code.md +0 -677
  736. package/one/things/cli/cli.md +0 -871
  737. package/one/things/components/card-shadcn.md +0 -953
  738. package/one/things/components/card.md +0 -1041
  739. package/one/things/components.md +0 -1743
  740. package/one/things/componets.md +0 -19
  741. package/one/things/contracts/Move.toml +0 -12
  742. package/one/things/contracts/README.md +0 -288
  743. package/one/things/contracts/one.move +0 -762
  744. package/one/things/contracts/sdk.ts +0 -578
  745. package/one/things/creator-diagram.md +0 -184
  746. package/one/things/crypto/FEATURES.md +0 -78
  747. package/one/things/crypto/ONECORE.md +0 -62
  748. package/one/things/crypto/ONECOREFAQ.md +0 -22
  749. package/one/things/crypto/ONECOREHOW.md +0 -46
  750. package/one/things/crypto/ONEENTERPRISE.md +0 -64
  751. package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
  752. package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
  753. package/one/things/crypto/ONEPRO.md +0 -60
  754. package/one/things/crypto/ONEPROFAQ.md +0 -22
  755. package/one/things/crypto/ONEPROHOW.md +0 -53
  756. package/one/things/crypto/READMEAGENCY.md +0 -64
  757. package/one/things/crypto/VSL.md +0 -45
  758. package/one/things/crypto/WebsiteCopy.md +0 -176
  759. package/one/things/demo-accessibility-animations.md +0 -1025
  760. package/one/things/demo-components.md +0 -1310
  761. package/one/things/demo-design-summary.md +0 -692
  762. package/one/things/demo-design-system.md +0 -973
  763. package/one/things/demo-page-layouts.md +0 -1016
  764. package/one/things/design-system.md +0 -832
  765. package/one/things/designs/accessibility-audit.md +0 -877
  766. package/one/things/designs/component-specifications.md +0 -855
  767. package/one/things/designs/design-overview.md +0 -377
  768. package/one/things/designs/design-tokens.md +0 -448
  769. package/one/things/designs/wireframes-dashboard.md +0 -710
  770. package/one/things/docs/api-requests.md +0 -987
  771. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
  772. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
  773. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
  774. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
  775. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
  776. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
  777. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
  778. package/one/things/docs/ecommerce/QUICK-START.md +0 -405
  779. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
  780. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
  781. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
  782. package/one/things/docs/ecommerce/demo.astro +0 -309
  783. package/one/things/examples/children/lemonade-stand.md +0 -404
  784. package/one/things/examples/enterprise/crm-saas.md +0 -1444
  785. package/one/things/features/1-1-agent-prompts.md +0 -562
  786. package/one/things/features/1-2-yaml-orchestrator.md +0 -548
  787. package/one/things/features/1-3-event-coordination.md +0 -547
  788. package/one/things/features/1-4-knowledge-management.md +0 -652
  789. package/one/things/features/1-5-quality-loops.md +0 -725
  790. package/one/things/features/1-6-numbering-structure.md +0 -639
  791. package/one/things/features/2-1-dataprovider-interface.md +0 -2583
  792. package/one/things/features/2-2-config-system.md +0 -3242
  793. package/one/things/features/2-3-effectts-services.md +0 -1645
  794. package/one/things/features/2-4-react-hooks.md +0 -2136
  795. package/one/things/features/2-5-auth-migration.md +0 -2144
  796. package/one/things/features/2-6-dashboard-migration.md +0 -2084
  797. package/one/things/features/2-7-alternative-providers.md +0 -2578
  798. package/one/things/features/2-7-implementation-report.md +0 -724
  799. package/one/things/features/2-cli.md +0 -1720
  800. package/one/things/features/2-design.md +0 -1770
  801. package/one/things/features/2-tests.md +0 -576
  802. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
  803. package/one/things/features/DECOUPLING.md +0 -290
  804. package/one/things/features/DEPLOYMENT.md +0 -470
  805. package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
  806. package/one/things/features/improve.md +0 -861
  807. package/one/things/features/remove-convex-deps.md +0 -63
  808. package/one/things/features/top-features.md +0 -87
  809. package/one/things/features/use-one-backend.md +0 -1217
  810. package/one/things/features-in-english.md +0 -200
  811. package/one/things/files.yaml +0 -721
  812. package/one/things/ideas/1-create-workflow.md +0 -207
  813. package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
  814. package/one/things/implementation/backend-guide.md +0 -457
  815. package/one/things/interface.md +0 -257
  816. package/one/things/landing-page-implementation.md +0 -455
  817. package/one/things/legal/README.md +0 -234
  818. package/one/things/legal/privacy-policy.md +0 -1227
  819. package/one/things/legal/terms-of-service.md +0 -1432
  820. package/one/things/master-workflow-plan.md +0 -806
  821. package/one/things/pay.one.ie.md +0 -53
  822. package/one/things/plans/0-in-sync.md +0 -136
  823. package/one/things/plans/0-timeline.md +0 -36
  824. package/one/things/plans/1-create-workflow.md +0 -732
  825. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
  826. package/one/things/plans/README-SIMPLIFICATION.md +0 -349
  827. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
  828. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
  829. package/one/things/plans/ai-elements-integration.md +0 -483
  830. package/one/things/plans/ai-elements.md +0 -1278
  831. package/one/things/plans/ai-integration-plan.md +0 -263
  832. package/one/things/plans/ai-integration.md +0 -996
  833. package/one/things/plans/ai-sdk.md +0 -798
  834. package/one/things/plans/ai-tools.md +0 -621
  835. package/one/things/plans/app.md +0 -832
  836. package/one/things/plans/architecture-summary.md +0 -312
  837. package/one/things/plans/async-ai-agents.md +0 -233
  838. package/one/things/plans/backend-agnostic-frontend.md +0 -390
  839. package/one/things/plans/backend-cleanup-quickstart.md +0 -380
  840. package/one/things/plans/backend-ontology-conformance.md +0 -475
  841. package/one/things/plans/backend-status.md +0 -599
  842. package/one/things/plans/backend-structure.md +0 -847
  843. package/one/things/plans/backend-target-structure.md +0 -482
  844. package/one/things/plans/backend.md +0 -1175
  845. package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
  846. package/one/things/plans/better-auth-any-backend.md +0 -1896
  847. package/one/things/plans/better-auth-available-features.md +0 -273
  848. package/one/things/plans/big-plan.md +0 -52
  849. package/one/things/plans/cli-updates-required.md +0 -320
  850. package/one/things/plans/complete-step-by-step.md +0 -1409
  851. package/one/things/plans/components.md +0 -709
  852. package/one/things/plans/convex-agents.md +0 -1034
  853. package/one/things/plans/convex-better-auth.md +0 -1141
  854. package/one/things/plans/convex-on-off.md +0 -407
  855. package/one/things/plans/crypto-token-researcher.md +0 -629
  856. package/one/things/plans/data-quality-metrics.md +0 -745
  857. package/one/things/plans/deep-researcher-agent.md +0 -466
  858. package/one/things/plans/deploy-to-cloudflare.md +0 -623
  859. package/one/things/plans/deployment-architecture.md +0 -469
  860. package/one/things/plans/desktop.md +0 -1139
  861. package/one/things/plans/development-plan.md +0 -1283
  862. package/one/things/plans/development-workflow-tldr.md +0 -207
  863. package/one/things/plans/development-workflow.md +0 -959
  864. package/one/things/plans/dsl-claude-code.md +0 -1011
  865. package/one/things/plans/effect-components.md +0 -1743
  866. package/one/things/plans/effect-patterns-reference.md +0 -2235
  867. package/one/things/plans/effect.md +0 -1806
  868. package/one/things/plans/email.md +0 -966
  869. package/one/things/plans/enhance-auth.md +0 -1692
  870. package/one/things/plans/execution-strategy.md +0 -1291
  871. package/one/things/plans/existing-infrastructure.md +0 -712
  872. package/one/things/plans/feature-based-sites.md +0 -894
  873. package/one/things/plans/frontend-effects.md +0 -1276
  874. package/one/things/plans/group-folder-multi-tenancy.md +0 -893
  875. package/one/things/plans/improve-codebase.md +0 -1811
  876. package/one/things/plans/install-components.md +0 -215
  877. package/one/things/plans/integrate-frontend-and-backend.md +0 -603
  878. package/one/things/plans/landing.md +0 -820
  879. package/one/things/plans/layout.md +0 -249
  880. package/one/things/plans/mail-backend.md +0 -1361
  881. package/one/things/plans/mail.md +0 -2677
  882. package/one/things/plans/mcp-clear-context-prompt.md +0 -81
  883. package/one/things/plans/mcp-simple.md +0 -248
  884. package/one/things/plans/multi-ontology-architecture.md +0 -885
  885. package/one/things/plans/next-features.md +0 -114
  886. package/one/things/plans/npx-agent-safety.md +0 -785
  887. package/one/things/plans/npx-agent.md +0 -1089
  888. package/one/things/plans/onboarding.md +0 -51
  889. package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
  890. package/one/things/plans/one.md +0 -677
  891. package/one/things/plans/ontology-6-dimensions.md +0 -2201
  892. package/one/things/plans/ontology-compliance-audit.md +0 -342
  893. package/one/things/plans/ontology-driven-strategy.md +0 -882
  894. package/one/things/plans/ontology-refine.md +0 -586
  895. package/one/things/plans/ontology-ui-approach.md +0 -375
  896. package/one/things/plans/open-agent.md +0 -840
  897. package/one/things/plans/performace.md +0 -122
  898. package/one/things/plans/phase-1-foundation.md +0 -620
  899. package/one/things/plans/phase-3-implementation.md +0 -1037
  900. package/one/things/plans/plan-connect-to-api.md +0 -146
  901. package/one/things/plans/quick-wins.md +0 -1428
  902. package/one/things/plans/r2.md +0 -777
  903. package/one/things/plans/readme-backend-cleanup.md +0 -402
  904. package/one/things/plans/release.md +0 -507
  905. package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
  906. package/one/things/plans/repos.md +0 -98
  907. package/one/things/plans/separate-copy-2.md +0 -1349
  908. package/one/things/plans/separate-copy-3.md +0 -2479
  909. package/one/things/plans/separate-copy.md +0 -1349
  910. package/one/things/plans/separate-demo.md +0 -864
  911. package/one/things/plans/separate.md +0 -1999
  912. package/one/things/plans/sequence.md +0 -2040
  913. package/one/things/plans/shadcn-integration-summary.md +0 -510
  914. package/one/things/plans/sidebar.md +0 -206
  915. package/one/things/plans/skills.md +0 -709
  916. package/one/things/plans/small-fixes.md +0 -23
  917. package/one/things/plans/start-new.md +0 -764
  918. package/one/things/plans/switch-off-auth.md +0 -42
  919. package/one/things/plans/sync-checklist.md +0 -351
  920. package/one/things/plans/test-backend-connection.md +0 -514
  921. package/one/things/plans/unified-implementation-plan.md +0 -934
  922. package/one/things/plans/update-demos.md +0 -581
  923. package/one/things/plans/use-our-backend.md +0 -572
  924. package/one/things/plans/video-backend.md +0 -638
  925. package/one/things/plans/video-frontend.md +0 -490
  926. package/one/things/plans/video-old-archived.md +0 -656
  927. package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
  928. package/one/things/plans/wave1-onboarding-vision.md +0 -744
  929. package/one/things/plans/wave1-orchestration-summary.md +0 -604
  930. package/one/things/plans/wave1-specialist-assignments.md +0 -1413
  931. package/one/things/plans/workflow-files.md +0 -1210
  932. package/one/things/plans/workflow.md +0 -1378
  933. package/one/things/plans-u.md +0 -905
  934. package/one/things/products/Blockchain Products.md +0 -6278
  935. package/one/things/products/cascade-landing-page.md +0 -841
  936. package/one/things/products/cascade.md +0 -1568
  937. package/one/things/products/context-engineering.md +0 -1488
  938. package/one/things/products/onthology.md +0 -15
  939. package/one/things/products/ontology-ui-shadcn.md +0 -1302
  940. package/one/things/products/ontology-ui.md +0 -1429
  941. package/one/things/products/ontology.md +0 -789
  942. package/one/things/products/sdk.md +0 -573
  943. package/one/things/promptkit.md +0 -930
  944. package/one/things/repos/all-repos.md +0 -0
  945. package/one/things/scripts-clean-mac.sh +0 -409
  946. package/one/things/service-providers-new.md +0 -1052
  947. package/one/things/service-providers.md +0 -1121
  948. package/one/things/structure.md +0 -532
  949. package/one/things/system.md +0 -618
  950. package/one/things/templates.md +0 -294
  951. package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
  952. package/one/things/tests/2-1-test-analysis.md +0 -544
  953. package/one/things/things.md +0 -384
  954. package/one/things/todo-acp-integration.md +0 -744
  955. package/one/things/todo-ai.md +0 -933
  956. package/one/things/todo-api.md +0 -1078
  957. package/one/things/todo-assignment.md +0 -580
  958. package/one/things/todo-buy-chatgpt.md +0 -1450
  959. package/one/things/todo-components.md +0 -1683
  960. package/one/things/todo-connections.md +0 -278
  961. package/one/things/todo-ecommerce-frontend.md +0 -1313
  962. package/one/things/todo-ecommerce.md +0 -569
  963. package/one/things/todo-effects.md +0 -1075
  964. package/one/things/todo-frontend-effects.md +0 -977
  965. package/one/things/todo-landing-page.md +0 -1091
  966. package/one/things/todo-mail.md +0 -1160
  967. package/one/things/todo-master-plan.md +0 -490
  968. package/one/things/todo-onboard.md +0 -666
  969. package/one/things/todo-one-ie.md +0 -538
  970. package/one/things/todo-page.md +0 -606
  971. package/one/things/todo-plans.md +0 -282
  972. package/one/things/todo-projects.md +0 -241
  973. package/one/things/todo-refactoring-plan.md +0 -366
  974. package/one/things/todo-release.md +0 -654
  975. package/one/things/todo-sequence.md +0 -1621
  976. package/one/things/todo-use-our-backend.md +0 -1908
  977. package/one/things/todo-workflow.md +0 -626
  978. package/one/things/todo-x402.md +0 -2047
  979. package/one/things/todo.md +0 -21
  980. package/one/things/video/scripts-crypto.md +0 -835
  981. package/one/things/video-script-backup.md +0 -318
  982. package/one/things/video-script-demo.md +0 -382
  983. package/one/things/video-script-ontology.md +0 -333
  984. package/one/things/video-script.md +0 -361
@@ -1,2047 +0,0 @@
1
- ---
2
- title: Todo X402
3
- dimension: things
4
- primary_dimension: things
5
- category: todo-x402.md
6
- tags: agent, ai, architecture, connections, groups, cycle, ontology, people, protocol, things
7
- related_dimensions: connections, events, groups, knowledge, people
8
- scope: global
9
- created: 2025-11-03
10
- updated: 2025-11-03
11
- version: 1.0.0
12
- ai_context: |
13
- This document is part of the things dimension in the todo-x402.md category.
14
- Location: one/things/todo-x402.md
15
- Purpose: Documents one platform: x402 integration roadmap v1.0.0
16
- Related dimensions: connections, events, groups, knowledge, people
17
- For AI agents: Read this to understand todo x402.
18
- ---
19
-
20
- # ONE Platform: X402 Integration Roadmap v1.0.0
21
-
22
- **Focus:** Integrate X402 HTTP-native payments into the web platform
23
- **Protocol:** https://www.x402.org/ (HTTP 402 Payment Required)
24
- **Timeline:** 100 cycles (cycle-based planning, not time-based)
25
- **Target:** AI agent micropayments, API monetization, provider discovery via Bazar
26
-
27
- ---
28
-
29
- ## PHASE 1: FOUNDATION & SETUP (Cycle 1-10)
30
-
31
- **Purpose:** Validate architecture, map to 6-dimension ontology, plan implementation
32
-
33
- ### Cycle 1: Validate X402 Protocol Alignment with Ontology
34
-
35
- - [ ] Read `/one/connections/x402.md` (protocol spec)
36
- - [ ] Map X402 payment flow to 6-dimension ontology:
37
- - [ ] **Groups:** Merchant group owns API service, customer group initiates payment
38
- - [ ] **People:** Platform owner authorizes payment schemes, merchant/customer actors
39
- - [ ] **Things:** payment (transaction), external_agent (service provider), product (API listing)
40
- - [ ] **Connections:** transacted (payment relationship), communicated (X402 protocol handshake)
41
- - [ ] **Events:** payment_event (402 response, payment verified, settled)
42
- - [ ] **Knowledge:** payment_method label, x402_scheme, blockchain_network labels
43
- - [ ] Identify 3 core use cases:
44
- - [ ] Agent-to-agent API calls (internal agents)
45
- - [ ] External provider access (ElizaOS agents via A2A)
46
- - [ ] Bazar marketplace discovery + payment
47
-
48
- ### Cycle 2: Review Existing Payment Infrastructure
49
-
50
- - [ ] Examine `backend/convex/schema.ts` for payment thing type
51
- - [ ] Check `web/src/components/` for any existing payment UI
52
- - [ ] Review `backend/convex/mutations/` for payment flows
53
- - [ ] Document current payment handling:
54
- - [ ] Stripe integration (if any)
55
- - [ ] Token purchase flows
56
- - [ ] Invoice/subscription patterns
57
- - [ ] Note: **Goal is X402 as PRIMARY payment, not replacement**
58
-
59
- ### Cycle 3: Map X402 to Web Application Layers
60
-
61
- - [ ] **Frontend (Astro):**
62
- - [ ] X402 payment prompt components (402 handling)
63
- - [ ] Wallet connection UI (viem, wagmi)
64
- - [ ] Payment status display
65
- - [ ] **API Routes (Astro):**
66
- - [ ] GET routes that can respond 402
67
- - [ ] Handle X-PAYMENT header verification
68
- - [ ] Return protected resources on valid payment
69
- - [ ] **Backend (Convex):**
70
- - [ ] X402PaymentService (Effect.ts)
71
- - [ ] Blockchain provider integrations
72
- - [ ] Payment verification + settlement
73
- - [ ] **Database (Convex):**
74
- - [ ] payment thing type schema
75
- - [ ] payment_event event types
76
- - [ ] transacted connection metadata
77
-
78
- ### Cycle 4: Define X402 Integration Scope
79
-
80
- - [ ] **Phase 1 (Cycle 1-100):** Core X402 infrastructure
81
- - [ ] HTTP 402 protocol implementation
82
- - [ ] Base network support (preferred for low fees)
83
- - [ ] Permit + Transfer payment schemes
84
- - [ ] Payment verification via facilitator
85
- - [ ] **Future phases (separate todos):**
86
- - [ ] Bazar marketplace discovery layer
87
- - [ ] Multi-chain support (Ethereum, Solana)
88
- - [ ] Advanced payment schemes (invoice, signature)
89
- - [ ] Revenue distribution to merchants
90
- - [ ] Document assumptions:
91
- - [ ] Base USDC as primary token
92
- - [ ] Coinbase facilitator for verification
93
- - [ ] Pay-per-request model (not subscriptions initially)
94
-
95
- ### Cycle 5: Set Up Development Environment
96
-
97
- - [ ] Ensure `.env.local` in `/web` contains:
98
- - [ ] `PUBLIC_CONVEX_URL` (Convex endpoint)
99
- - [ ] `BETTER_AUTH_SECRET` (auth)
100
- - [ ] Add (new): `VITE_X402_FACILITATOR_URL` (e.g., Coinbase CDP)
101
- - [ ] Add (new): `VITE_BLOCKCHAIN_RPC_BASE` (Base network RPC)
102
- - [ ] Ensure `backend/.env.local` contains:
103
- - [ ] `CONVEX_DEPLOYMENT` (Convex)
104
- - [ ] Add (new): `X402_PAYMENT_ADDRESS_BASE` (treasury address)
105
- - [ ] Add (new): `X402_PAYMENT_ADDRESS_ETHEREUM` (treasury address)
106
- - [ ] Add (new): `X402_PAYMENT_ADDRESS_SOLANA` (future)
107
- - [ ] Add (new): `FACILITATOR_URL` (Coinbase CDP)
108
- - [ ] Add (new): `FACILITATOR_API_KEY` (if needed)
109
- - [ ] Add to `package.json` dependencies:
110
- - [ ] `viem` (blockchain client)
111
- - [ ] `wagmi` (React hooks)
112
- - [ ] `@coinbase/cdp-sdk` (facilitator)
113
- - [ ] `effect` (Effect.ts already included)
114
-
115
- ### Cycle 6: Review Convex Schema for Payment Thing Type
116
-
117
- - [ ] Open `backend/convex/schema.ts`
118
- - [ ] Verify payment thing type exists:
119
- ```typescript
120
- {
121
- type: "payment",
122
- properties: {
123
- protocol: "x402", // NEW: add protocol field
124
- amount: number,
125
- currency: "USDC",
126
- paymentMethod: "crypto",
127
- scheme: "permit" | "transfer",
128
- network: "base" | "ethereum" | "solana",
129
- status: "pending" | "verified" | "settled" | "failed",
130
- txHash: string,
131
- paymentId: string,
132
- payTo: string,
133
- facilitatorResponse: any, // NEW: store facilitator verification
134
- }
135
- }
136
- ```
137
- - [ ] If missing, add payment thing type to schema
138
- - [ ] Verify indexes on payment things:
139
- - [ ] by_type(type = "payment")
140
- - [ ] by_status(status)
141
- - [ ] by_protocol(protocol)
142
-
143
- ### Cycle 7: Create X402 Protocol Type Definitions File
144
-
145
- - [ ] Create `backend/convex/protocols/x402.ts` with:
146
- - [ ] PaymentRequired interface (402 response)
147
- - [ ] PaymentRequirement interface (per-scheme/network)
148
- - [ ] PaymentPayload interface (X-PAYMENT header)
149
- - [ ] PermitPayload, TransferPayload interfaces
150
- - [ ] FacilitatorEndpoints, VerifyPaymentRequest/Response
151
- - [ ] SupportedSchemesResponse interface
152
- - [ ] Convex validators for all above
153
- - [ ] X402_VERSION = 1 constant
154
- - [ ] Document TypeScript patterns for each interface
155
- - [ ] Note: Copy from `/one/connections/x402.md` "TypeScript Protocol Interfaces" section
156
-
157
- ### Cycle 8: Understand X402 Protocol Flow in Web Context
158
-
159
- - [ ] Study the 4-step HTTP 402 flow:
160
- 1. Client requests protected resource
161
- 2. Server responds 402 with PaymentRequired
162
- 3. Client sends payment in X-PAYMENT header + retries
163
- 4. Server verifies, returns resource + X-PAYMENT-ID header
164
- - [ ] Map to Astro patterns:
165
- - [ ] `GET /api/agent/execute` (Astro API route)
166
- - [ ] Check if payment required (config-based)
167
- - [ ] Return 402 if unpaid
168
- - [ ] Handle POST with X-PAYMENT header
169
- - [ ] Verify via Convex effect service
170
- - [ ] Execute agent + return 200
171
- - [ ] Identify which endpoints need X402 protection:
172
- - [ ] Agent execution: `/api/agent/[agentId]/execute`
173
- - [ ] Provider access: `/api/provider/[providerId]/call`
174
- - [ ] N8N workflows: `/api/workflow/[workflowId]/trigger`
175
- - [ ] Custom API: `/api/custom/[name]` (future)
176
-
177
- ### Cycle 9: Plan Blockchain Integration
178
-
179
- - [ ] Choose primary network: **Base (Coinbase L2)**
180
- - [ ] Lowest fees (~$0.001 per transaction)
181
- - [ ] USDC natively supported
182
- - [ ] ERC-2612 permit support
183
- - [ ] Fast finality (~2 seconds)
184
- - [ ] Secondary networks (future):
185
- - [ ] Ethereum mainnet (if higher value txns)
186
- - [ ] Solana (if volume justifies)
187
- - [ ] Choose permit scheme (preferred):
188
- - [ ] ERC-2612 permit (gasless approval)
189
- - [ ] No approval tx needed
190
- - [ ] Saves gas + UX
191
- - [ ] Identify token: **USDC on Base**
192
- - [ ] Address: `0x833589fcd6edb6e08f4c7c32d4f71b54bda02913` (Base)
193
- - [ ] Decimals: 6
194
- - [ ] Facilitator: Coinbase CDP (pre-hosted)
195
-
196
- ### Cycle 10: Define Success Metrics for X402 Phase
197
-
198
- - [ ] Integration complete when:
199
- - [ ] [ ] HTTP 402 responses sent from Astro API routes
200
- - [ ] [ ] X-PAYMENT header validation working
201
- - [ ] [ ] Blockchain payment verification functional
202
- - [ ] [ ] Payment events logged in Convex
203
- - [ ] [ ] UI shows payment prompt + wallet connection
204
- - [ ] [ ] Demo: Agent request → 402 prompt → payment → resource delivered
205
- - [ ] Test targets:
206
- - [ ] 3+ protected endpoints (agent, provider, workflow)
207
- - [ ] 2+ payment schemes (permit, transfer)
208
- - [ ] Payment history queryable
209
- - [ ] E2E test: Request → payment → access
210
- - [ ] Document in: `one/events/deployments/x402-phase1.md`
211
-
212
- ---
213
-
214
- ## PHASE 2: BACKEND SCHEMA & SERVICES (Cycle 11-20)
215
-
216
- **Purpose:** Implement Effect.ts payment services, update Convex schema
217
-
218
- ### Cycle 11: Extend Payment Thing Type in Schema
219
-
220
- - [ ] Edit `backend/convex/schema.ts`
221
- - [ ] Update payment thing properties:
222
-
223
- ```typescript
224
- properties: {
225
- protocol: v.literal('x402'), // X402-specific
226
- scheme: v.union(
227
- v.literal('permit'),
228
- v.literal('transfer'),
229
- v.literal('signature'),
230
- v.literal('invoice')
231
- ),
232
- network: v.union(
233
- v.literal('base'),
234
- v.literal('ethereum'),
235
- v.literal('solana'),
236
- v.literal('arbitrum'),
237
- v.literal('optimism'),
238
- v.literal('polygon')
239
- ),
240
- amount: v.string(), // Decimal string
241
- currency: v.literal('USDC'),
242
- paymentMethod: v.literal('crypto'),
243
-
244
- // Payment details
245
- payTo: v.string(), // Recipient address
246
- payFrom: v.string(), // Payer address
247
- txHash: v.optional(v.string()),
248
- paymentId: v.string(), // Unique ID
249
-
250
- // Status tracking
251
- status: v.union(
252
- v.literal('pending'),
253
- v.literal('payment_required'),
254
- v.literal('verified'),
255
- v.literal('settled'),
256
- v.literal('failed')
257
- ),
258
-
259
- // X402 request/response
260
- resource: v.string(), // Protected endpoint
261
- payload: v.optional(v.any()), // X-PAYMENT payload
262
- facilitatorResponse: v.optional(v.any()), // Verification response
263
-
264
- // Metadata
265
- description: v.optional(v.string()),
266
- invoiceId: v.optional(v.string()),
267
- metadata: v.optional(v.any()),
268
- }
269
- ```
270
-
271
- - [ ] Add payment indexes:
272
- - [ ] by_type("payment")
273
- - [ ] by_status(status)
274
- - [ ] by_network(network)
275
- - [ ] by_payto(payTo)
276
- - [ ] Create migration if needed (Convex migrations)
277
-
278
- ### Cycle 12: Create X402PaymentService (Effect.ts)
279
-
280
- - [ ] Create `backend/convex/services/x402-payment.ts`
281
- - [ ] Implement X402PaymentService class:
282
- ```typescript
283
- export class X402PaymentService extends Effect.Service<...>() {
284
- // Service methods (from /one/connections/x402.md)
285
- }
286
- ```
287
- - [ ] Implement core methods:
288
- - [ ] `createPaymentRequest()` → PaymentRequired (402 response)
289
- - [ ] `verifyPayment()` → boolean (X-PAYMENT validation)
290
- - [ ] `settlePayment()` → string (txHash)
291
- - [ ] `getPaymentHistory()` → Payment[]
292
- - [ ] `recordPayment()` → void (log event)
293
- - [ ] Document each method with:
294
- - [ ] Input types
295
- - [ ] Output types
296
- - [ ] Effect.ts error handling
297
- - [ ] Blockchain interaction
298
- - [ ] Note: Reference `/one/connections/x402.md` Part 2 for code
299
-
300
- ### Cycle 13: Create X402FacilitatorService (Effect.ts)
301
-
302
- - [ ] Create `backend/convex/services/x402-facilitator.ts`
303
- - [ ] Implement X402FacilitatorService class:
304
- ```typescript
305
- export class X402FacilitatorService extends Effect.Service<...>() {
306
- // Facilitator interaction methods
307
- }
308
- ```
309
- - [ ] Implement methods to interact with Coinbase CDP:
310
- - [ ] `verifyPayment(paymentPayload)` → VerifyPaymentResponse
311
- - [ ] `settlePayment(settlementRequest)` → SettlePaymentResponse
312
- - [ ] `getSupportedSchemes()` → SupportedSchemesResponse
313
- - [ ] `checkNetworkSupport(network)` → boolean
314
- - [ ] Handle facilitator API calls:
315
- - [ ] POST /verify (validate X402 payment)
316
- - [ ] POST /settle (execute settlement)
317
- - [ ] GET /supported (list schemes)
318
- - [ ] Implement error handling:
319
- - [ ] Network errors (retry logic)
320
- - [ ] Invalid payment (return error)
321
- - [ ] Unsupported scheme/network
322
-
323
- ### Cycle 14: Create Blockchain Provider Service (Effect.ts)
324
-
325
- - [ ] Create `backend/convex/services/blockchain-provider.ts`
326
- - [ ] Implement BlockchainProviderService class:
327
- ```typescript
328
- export class BlockchainProviderService extends Effect.Service<...>() {
329
- // Multi-chain provider methods
330
- }
331
- ```
332
- - [ ] Support networks:
333
- - [ ] **Base:** via viem/ethers client
334
- - [ ] **Ethereum:** via viem/ethers client
335
- - [ ] **Solana:** (stub for now, full in future)
336
- - [ ] Implement methods:
337
- - [ ] `getProvider(network)` → Client instance
338
- - [ ] `getTokenContract(network)` → Contract ABI
339
- - [ ] `verifyTransaction(txHash, network)` → tx details
340
- - [ ] `estimateGas(tx, network)` → gas estimate
341
- - [ ] `getGasPrice(network)` → current gas price
342
- - [ ] Cache provider instances for efficiency
343
-
344
- ### Cycle 15: Implement Payment Event Logging
345
-
346
- - [ ] Ensure payment_event exists in events table (from ontology)
347
- - [ ] Create `backend/convex/services/payment-event-logger.ts`
348
- - [ ] Log event types:
349
- - [ ] `payment_event` with metadata.status = "requested" (402 sent)
350
- - [ ] `payment_event` with metadata.status = "verified" (X-PAYMENT valid)
351
- - [ ] `payment_event` with metadata.status = "settled" (blockchain confirmed)
352
- - [ ] `payment_event` with metadata.status = "failed" (error occurred)
353
- - [ ] Event structure:
354
- ```typescript
355
- {
356
- type: 'payment_event',
357
- actorId: userId, // Who initiated payment
358
- targetId: paymentId, // Payment thing ID
359
- timestamp: Date.now(),
360
- metadata: {
361
- protocol: 'x402',
362
- status: 'requested' | 'verified' | 'settled' | 'failed',
363
- network: 'base' | 'ethereum' | ...,
364
- scheme: 'permit' | 'transfer' | ...,
365
- amount: amount,
366
- txHash: txHash, // if settled
367
- resource: resourcePath,
368
- facilitatorResponse: response,
369
- }
370
- }
371
- ```
372
- - [ ] Create helper function to log events
373
- - [ ] Test event logging in dev environment
374
-
375
- ### Cycle 16: Create X402Middleware for Astro API Routes
376
-
377
- - [ ] Create `web/src/middleware/x402-middleware.ts`
378
- - [ ] Implement middleware that:
379
- - [ ] Intercepts API route requests
380
- - [ ] Checks if endpoint requires X402 payment
381
- - [ ] Validates X-PAYMENT header if present
382
- - [ ] Returns 402 if payment required + not provided
383
- - [ ] Returns 200 + X-PAYMENT-ID if valid payment
384
- - [ ] Middleware signature:
385
- ```typescript
386
- export function x402Middleware(
387
- request: Request,
388
- endpoint: X402ProtectedEndpoint,
389
- ): {
390
- requiresPayment: boolean;
391
- statusCode: number;
392
- paymentRequired?: PaymentRequired;
393
- xPaymentId?: string;
394
- };
395
- ```
396
- - [ ] Handle edge cases:
397
- - [ ] Missing X-PAYMENT header
398
- - [ ] Invalid X-PAYMENT JSON
399
- - [ ] Payment amount < required
400
- - [ ] Payment already used (replay protection)
401
-
402
- ### Cycle 17: Set Up X402 Configuration
403
-
404
- - [ ] Create `backend/convex/config/x402-config.ts`
405
- - [ ] Define configuration object:
406
- ```typescript
407
- export const x402Config = {
408
- enabled: true,
409
- facilitator: {
410
- url: process.env.FACILITATOR_URL,
411
- apiKey: process.env.FACILITATOR_API_KEY,
412
- },
413
- networks: {
414
- base: {
415
- rpcUrl: process.env.VITE_BLOCKCHAIN_RPC_BASE,
416
- chainId: 8453,
417
- usdcAddress: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
418
- treasury: process.env.X402_PAYMENT_ADDRESS_BASE,
419
- },
420
- ethereum: {
421
- rpcUrl: process.env.VITE_BLOCKCHAIN_RPC_ETHEREUM,
422
- chainId: 1,
423
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
424
- treasury: process.env.X402_PAYMENT_ADDRESS_ETHEREUM,
425
- },
426
- },
427
- payments: {
428
- minAmount: "0.001", // $0.001 minimum
429
- defaultAmount: "0.01", // $0.01 default for API calls
430
- defaultNetwork: "base",
431
- defaultScheme: "permit",
432
- expirationTime: 5 * 60 * 1000, // 5 minutes
433
- },
434
- };
435
- ```
436
- - [ ] Load config from env vars in both `.env` files
437
- - [ ] Document required env vars
438
-
439
- ### Cycle 18: Implement Payment Verification Logic
440
-
441
- - [ ] Create `backend/convex/lib/x402-verify.ts`
442
- - [ ] Implement verification function:
443
- ```typescript
444
- export async function verifyX402Payment(
445
- paymentPayload: PaymentPayload,
446
- requirement: PaymentRequirement,
447
- resource: string,
448
- ): Promise<{ valid: boolean; paymentId: string; error?: string }>;
449
- ```
450
- - [ ] Verification steps:
451
- 1. Validate payload structure (JSON schema)
452
- 2. Verify X402 version matches
453
- 3. Validate scheme (permit/transfer/etc)
454
- 4. Call facilitator API to verify payment
455
- 5. Check payment amount >= required
456
- 6. Verify recipient address matches
457
- 7. Check replay (txHash not used before)
458
- 8. Log result in events table
459
- 9. Return validation result
460
- - [ ] Handle each error case with descriptive message
461
-
462
- ### Cycle 19: Implement Payment Settlement
463
-
464
- - [ ] Create `backend/convex/lib/x402-settle.ts`
465
- - [ ] Implement settlement function:
466
- ```typescript
467
- export async function settleX402Payment(
468
- paymentPayload: PaymentPayload,
469
- paymentId: string,
470
- ): Promise<{ settled: boolean; txHash: string; error?: string }>;
471
- ```
472
- - [ ] Settlement steps:
473
- 1. Get verified payment from database
474
- 2. Check status = "verified"
475
- 3. Call facilitator to execute settlement
476
- 4. Update payment status to "settled"
477
- 5. Log settlement event
478
- 6. Return settlement result
479
- - [ ] Handle settlement errors:
480
- - [ ] Blockchain errors (retry)
481
- - [ ] Insufficient gas (recommend amount)
482
- - [ ] Network issues (queue for retry)
483
-
484
- ### Cycle 20: Create Convex Mutations for Payment Handling
485
-
486
- - [ ] Create `backend/convex/mutations/payments.ts`
487
- - [ ] Implement mutations:
488
- - [ ] `createPaymentRequest(resource, amount)` → PaymentRequired
489
- - [ ] `verifyPayment(paymentPayload, requirement)` → verification result
490
- - [ ] `recordPayment(paymentPayload, resource)` → paymentId
491
- - [ ] `updatePaymentStatus(paymentId, status)` → void
492
- - [ ] Each mutation:
493
- - [ ] Takes typed arguments (Convex v)
494
- - [ ] Calls appropriate Effect.ts service
495
- - [ ] Handles errors gracefully
496
- - [ ] Returns structured result
497
- - [ ] Logs events
498
- - [ ] Document expected flow:
499
- - [ ] Frontend requests resource
500
- - [ ] Astro calls `createPaymentRequest` mutation
501
- - [ ] Returns 402 to frontend
502
- - [ ] Frontend shows payment prompt
503
- - [ ] User connects wallet + makes payment
504
- - [ ] Frontend calls `verifyPayment` mutation
505
- - [ ] If valid, calls `recordPayment` mutation
506
- - [ ] Astro re-processes original request
507
-
508
- ---
509
-
510
- ## PHASE 3: FRONTEND COMPONENTS & PAGES (Cycle 21-30)
511
-
512
- **Purpose:** Build React components and Astro pages for payment flow
513
-
514
- ### Cycle 21: Create PaymentRequired Component
515
-
516
- - [ ] Create `web/src/components/features/PaymentRequired.tsx`
517
- - [ ] Component displays:
518
- - [ ] Payment amount in USD + tokens
519
- - [ ] Multiple network options (Base, Ethereum)
520
- - [ ] Multiple scheme options (Permit, Transfer)
521
- - [ ] "Connect Wallet" button
522
- - [ ] Error messages
523
- - [ ] Loading state during payment
524
- - [ ] Props:
525
- ```typescript
526
- interface PaymentRequiredProps {
527
- paymentRequired: PaymentRequired; // 402 response
528
- onPaymentComplete: (payload: PaymentPayload) => void;
529
- onCancel: () => void;
530
- }
531
- ```
532
- - [ ] Features:
533
- - [ ] Responsive design
534
- - [ ] Dark mode support
535
- - [ ] Accessibility (WCAG)
536
- - [ ] Mobile wallet support
537
-
538
- ### Cycle 22: Create WalletConnection Component
539
-
540
- - [ ] Create `web/src/components/features/WalletConnection.tsx`
541
- - [ ] Component handles:
542
- - [ ] Connecting wallet (MetaMask, Rainbow Kit, etc)
543
- - [ ] Displaying connected address
544
- - [ ] Showing wallet balance (USDC)
545
- - [ ] Switching networks (to Base, Ethereum)
546
- - [ ] Disconnecting wallet
547
- - [ ] Use libraries:
548
- - [ ] `wagmi` (React hooks for wallet)
549
- - [ ] `viem` (blockchain client)
550
- - [ ] `@rainbow-me/rainbowkit` (UI kit)
551
- - [ ] Features:
552
- - [ ] One-click connect
553
- - [ ] Auto-switch to required network
554
- - [ ] Display balance in USD + tokens
555
- - [ ] Error handling for network mismatch
556
-
557
- ### Cycle 23: Create PaymentProcessor Component
558
-
559
- - [ ] Create `web/src/components/features/PaymentProcessor.tsx`
560
- - [ ] Component orchestrates:
561
- - [ ] Taking PaymentRequired + PaymentPayload
562
- - [ ] Calling Convex to verify payment
563
- - [ ] Handling verification response
564
- - [ ] Showing success/error to user
565
- - [ ] Retrying if transaction pending
566
- - [ ] Handles payment schemes:
567
- - [ ] **Permit:** ERC-2612 signature + transfer in one tx
568
- - [ ] **Transfer:** Direct token transfer (requires approval first)
569
- - [ ] Features:
570
- - [ ] Retry logic for network timeouts
571
- - [ ] Shows tx hash when sent
572
- - [ ] Polls for confirmation (~2 seconds on Base)
573
- - [ ] Timeout after 5 minutes
574
-
575
- ### Cycle 24: Create PaymentPrompt Modal
576
-
577
- - [ ] Create `web/src/components/features/PaymentPromptModal.tsx`
578
- - [ ] Modal that combines:
579
- - [ ] PaymentRequired display
580
- - [ ] WalletConnection
581
- - [ ] PaymentProcessor
582
- - [ ] Success/error states
583
- - [ ] Behavior:
584
- - [ ] Shows when backend returns 402
585
- - [ ] User connects wallet
586
- - [ ] Processes payment
587
- - [ ] Auto-closes + retries original request on success
588
- - [ ] Design:
589
- - [ ] Centered modal with overlay
590
- - [ ] Progress indicator (step 1/3, etc)
591
- - [ ] Clear instructions for user
592
- - [ ] Cancel button to dismiss
593
-
594
- ### Cycle 25: Create PaymentHistory Component
595
-
596
- - [ ] Create `web/src/components/features/PaymentHistory.tsx`
597
- - [ ] Component displays:
598
- - [ ] List of past payments
599
- - [ ] Amount, date, status, network
600
- - [ ] Tx hash link to explorer
601
- - [ ] Filter by status, network, date range
602
- - [ ] Search by tx hash
603
- - [ ] Table columns:
604
- - [ ] Timestamp
605
- - [ ] Resource (API endpoint)
606
- - [ ] Amount (USD + tokens)
607
- - [ ] Network
608
- - [ ] Status badge (✓ settled, ⏳ verified, ✗ failed)
609
- - [ ] Tx hash (link to block explorer)
610
- - [ ] Action button (view details)
611
- - [ ] Fetches data from Convex query
612
- - [ ] Pagination for many transactions
613
-
614
- ### Cycle 26: Create BalanceDisplay Component
615
-
616
- - [ ] Create `web/src/components/features/BalanceDisplay.tsx`
617
- - [ ] Component shows:
618
- - [ ] Wallet USDC balance
619
- - [ ] Formatted in USD + token units
620
- - [ ] Network indicator (Base, Ethereum, etc)
621
- - [ ] Refresh button
622
- - [ ] Low balance warning (if < $0.05)
623
- - [ ] Real-time updates:
624
- - [ ] Subscribes to Convex changes
625
- - [ ] Updates when new payment made
626
- - [ ] Design:
627
- - [ ] Card layout
628
- - [ ] Badge showing network
629
- - [ ] Loading skeleton
630
- - [ ] Error message if balance fetch fails
631
-
632
- ### Cycle 27: Create AgentExecutionFlow with X402
633
-
634
- - [ ] Create `web/src/components/features/AgentExecutionFlow.tsx`
635
- - [ ] Component orchestrates:
636
- - [ ] User selects agent + parameters
637
- - [ ] Clicks "Execute" button
638
- - [ ] Backend returns 402 if payment required
639
- - [ ] Shows PaymentPromptModal
640
- - [ ] User pays
641
- - [ ] Retries agent execution
642
- - [ ] Shows agent result
643
- - [ ] Handles all payment states:
644
- - [ ] Payment required
645
- - [ ] Payment processing
646
- - [ ] Payment verified
647
- - [ ] Agent executing
648
- - [ ] Agent complete
649
- - [ ] Payment failed (show retry)
650
- - [ ] UX flow:
651
- ```
652
- Agent Selection → Execute → [Payment Modal if 402] → Agent Results
653
- ```
654
-
655
- ### Cycle 28: Update ExternalProviderAccess Component
656
-
657
- - [ ] Modify `web/src/components/features/ExternalProviderAccess.tsx`
658
- - [ ] Add X402 payment flow:
659
- - [ ] Show provider listing from Bazar (future)
660
- - [ ] Compare pricing + availability
661
- - [ ] Select provider + call API
662
- - [ ] Handle 402 payment prompt
663
- - [ ] Execute provider request
664
- - [ ] Show results
665
- - [ ] Features:
666
- - [ ] Provider comparison table
667
- - [ ] Price in USD per request
668
- - [ ] Network availability badge
669
- - [ ] Success rate %
670
-
671
- ### Cycle 29: Create X402 Demo Page
672
-
673
- - [ ] Create `web/src/pages/demo/x402-payments.astro`
674
- - [ ] Interactive demo showing:
675
- - [ ] Protected API endpoint (returns 402)
676
- - [ ] Payment requirement breakdown
677
- - [ ] Wallet connection flow
678
- - [ ] Payment execution
679
- - [ ] Transaction confirmation
680
- - [ ] Final resource access
681
- - [ ] Demo scenarios:
682
- - [ ] Minimum payment ($0.001)
683
- - [ ] Standard payment ($0.01)
684
- - [ ] Higher amount ($1.00)
685
- - [ ] Educational content:
686
- - [ ] How X402 works (animation)
687
- - [ ] Why X402 > API keys
688
- - [ ] Integration for developers
689
- - [ ] FAQ section
690
-
691
- ### Cycle 30: Create X402 Documentation Page
692
-
693
- - [ ] Create `web/src/pages/docs/x402-integration.astro`
694
- - [ ] Document for developers:
695
- - [ ] X402 protocol overview
696
- - [ ] How to protect endpoints
697
- - [ ] How to handle 402 responses
698
- - [ ] Integration examples (curl, JS, Python)
699
- - [ ] Error handling
700
- - [ ] Retry logic
701
- - [ ] Code examples:
702
- - [ ] Backend: Mark endpoint as requiring payment
703
- - [ ] Frontend: Handle 402 + show payment modal
704
- - [ ] Wallet: Connect + sign permit
705
- - [ ] Settlement: Verify payment + grant access
706
- - [ ] Deploy to `/docs/x402-integration`
707
-
708
- ---
709
-
710
- ## PHASE 4: API ROUTES & ASTRO INTEGRATION (Cycle 31-40)
711
-
712
- **Purpose:** Implement X402-protected API routes in Astro
713
-
714
- ### Cycle 31: Create X402 Astro API Route Handler
715
-
716
- - [ ] Create `web/src/lib/x402-route-handler.ts`
717
- - [ ] Export function:
718
- ```typescript
719
- export async function handleX402Request(
720
- request: Request,
721
- handler: (req: Request) => Promise<Response>,
722
- options: X402RouteOptions,
723
- ): Promise<Response>;
724
- ```
725
- - [ ] Implements full X402 flow:
726
- 1. Check if X-PAYMENT header exists
727
- 2. If not → return 402 PaymentRequired
728
- 3. If yes → verify payment via Convex
729
- 4. If invalid → return 402 with error
730
- 5. If valid → call handler to get resource
731
- 6. Return 200 + X-PAYMENT-ID header + resource
732
- - [ ] Options interface:
733
- ```typescript
734
- interface X402RouteOptions {
735
- requiresPayment: boolean;
736
- amount?: string;
737
- description?: string;
738
- resource: string; // endpoint path
739
- }
740
- ```
741
- - [ ] Error handling:
742
- - [ ] Invalid payload format
743
- - [ ] Verification failed
744
- - [ ] Facilitator error (return 502)
745
- - [ ] Payment expired
746
-
747
- ### Cycle 32: Create Agent Execution API Route
748
-
749
- - [ ] Create `web/src/pages/api/agent/execute.ts`
750
- - [ ] Astro API route that:
751
- - [ ] Accepts POST request with agent config
752
- - [ ] Checks if payment required (config-based)
753
- - [ ] Uses handleX402Request to enforce payment
754
- - [ ] Calls Convex to execute agent
755
- - [ ] Returns agent result
756
- - [ ] Request body:
757
- ```typescript
758
- {
759
- agentId: string;
760
- parameters: Record<string, any>;
761
- userId: string;
762
- }
763
- ```
764
- - [ ] Response on success (200):
765
- ```typescript
766
- {
767
- success: true;
768
- result: any;
769
- executionTime: number;
770
- paymentId: string; // X-PAYMENT-ID
771
- }
772
- ```
773
- - [ ] Response on payment required (402):
774
- ```typescript
775
- {
776
- x402Version: 1;
777
- accepts: PaymentRequirement[];
778
- }
779
- ```
780
-
781
- ### Cycle 33: Create Provider API Call Route
782
-
783
- - [ ] Create `web/src/pages/api/provider/[providerId]/call.ts`
784
- - [ ] Astro API route that:
785
- - [ ] Accepts POST request with provider method + params
786
- - [ ] Enforces X402 payment
787
- - [ ] Forwards request to external provider
788
- - [ ] Returns provider response
789
- - [ ] Request body:
790
- ```typescript
791
- {
792
- method: string;
793
- parameters: Record<string, any>;
794
- }
795
- ```
796
- - [ ] Handles:
797
- - [ ] Rate limiting per provider
798
- - [ ] Provider availability check
799
- - [ ] Timeout handling
800
- - [ ] Error forwarding from provider
801
-
802
- ### Cycle 34: Create Workflow Trigger Route
803
-
804
- - [ ] Create `web/src/pages/api/workflow/[workflowId]/trigger.ts`
805
- - [ ] Astro API route that:
806
- - [ ] Accepts POST with workflow inputs
807
- - [ ] Enforces X402 payment
808
- - [ ] Triggers N8N workflow
809
- - [ ] Returns workflow execution status
810
- - [ ] Workflow payment tiers (future):
811
- - [ ] Small workflow ($0.001)
812
- - [ ] Medium workflow ($0.01)
813
- - [ ] Large workflow ($0.10)
814
- - [ ] Integration with N8N:
815
- - [ ] POST to N8N webhook URL
816
- - [ ] Include payment ID in headers
817
- - [ ] Track execution in Convex
818
-
819
- ### Cycle 35: Create Payment Verification Route
820
-
821
- - [ ] Create `web/src/pages/api/payments/verify.ts`
822
- - [ ] POST route that:
823
- - [ ] Takes X-PAYMENT payload
824
- - [ ] Calls Convex to verify
825
- - [ ] Returns verification result
826
- - [ ] Request body:
827
- ```typescript
828
- {
829
- paymentPayload: PaymentPayload;
830
- resource: string;
831
- }
832
- ```
833
- - [ ] Response:
834
- ```typescript
835
- {
836
- valid: boolean;
837
- paymentId: string;
838
- txHash: string;
839
- error?: string;
840
- }
841
- ```
842
-
843
- ### Cycle 36: Create Payment Settlement Route
844
-
845
- - [ ] Create `web/src/pages/api/payments/settle.ts`
846
- - [ ] POST route that:
847
- - [ ] Takes verified payment
848
- - [ ] Calls Convex to settle on blockchain
849
- - [ ] Returns settlement result
850
- - [ ] Request body:
851
- ```typescript
852
- {
853
- paymentId: string;
854
- }
855
- ```
856
- - [ ] Response:
857
- ```typescript
858
- {
859
- settled: boolean;
860
- txHash: string;
861
- blockNumber: number;
862
- error?: string;
863
- }
864
- ```
865
-
866
- ### Cycle 37: Create Payment Query Route
867
-
868
- - [ ] Create `web/src/pages/api/payments/history.ts`
869
- - [ ] GET route that:
870
- - [ ] Requires authentication
871
- - [ ] Returns user's payment history
872
- - [ ] Supports filtering + pagination
873
- - [ ] Query params:
874
- ```
875
- ?status=settled&network=base&limit=20&offset=0&sortBy=date
876
- ```
877
- - [ ] Response:
878
- ```typescript
879
- {
880
- payments: Payment[];
881
- total: number;
882
- page: number;
883
- }
884
- ```
885
-
886
- ### Cycle 38: Create Payment Configuration Route
887
-
888
- - [ ] Create `web/src/pages/api/x402/config.ts`
889
- - [ ] GET route that returns:
890
- - [ ] Supported networks
891
- - [ ] Supported payment schemes
892
- - [ ] Min/max payment amounts
893
- - [ ] Accepted tokens
894
- - [ ] Facilitator details
895
- - [ ] Used by frontend to:
896
- - [ ] Display payment options
897
- - [ ] Validate amounts
898
- - [ ] Show available networks
899
- - [ ] Response:
900
- ```typescript
901
- {
902
- version: 1;
903
- networks: BlockchainNetwork[];
904
- schemes: PaymentScheme[];
905
- tokens: Token[];
906
- minAmount: string;
907
- maxAmount: string;
908
- facilitator: FacilitatorInfo;
909
- }
910
- ```
911
-
912
- ### Cycle 39: Add Error Handling Middleware
913
-
914
- - [ ] Create `web/src/middleware/error-handler.ts`
915
- - [ ] Handle X402-specific errors:
916
- - [ ] 402: Payment Required
917
- - [ ] 402 with error: Payment Invalid
918
- - [ ] 503: Facilitator Down
919
- - [ ] 500: Internal Server Error
920
- - [ ] Error response format:
921
- ```typescript
922
- {
923
- error: string;
924
- code: string;
925
- details: any;
926
- x402Info?: PaymentRequired; // If 402
927
- }
928
- ```
929
-
930
- ### Cycle 40: Test All API Routes
931
-
932
- - [ ] Write tests for each route:
933
- - [ ] Test without payment (expect 402)
934
- - [ ] Test with invalid payment (expect error)
935
- - [ ] Test with valid payment (expect 200)
936
- - [ ] Test payment history query
937
- - [ ] Test config endpoint
938
- - [ ] Test error scenarios:
939
- - [ ] Malformed X-PAYMENT header
940
- - [ ] Expired payment request
941
- - [ ] Replay attack (same txHash twice)
942
- - [ ] Insufficient amount
943
- - [ ] Document test results
944
-
945
- ---
946
-
947
- ## PHASE 5: BLOCKCHAIN & PAYMENT MECHANICS (Cycle 41-50)
948
-
949
- **Purpose:** Implement blockchain payment processing
950
-
951
- ### Cycle 41: Implement Permit-Based Payment Flow
952
-
953
- - [ ] Create `backend/convex/lib/permit-payment.ts`
954
- - [ ] Implement permit generation:
955
- ```typescript
956
- export async function generatePermit(
957
- token: string, // USDC address
958
- owner: string, // User's wallet
959
- spender: string, // Treasury contract
960
- amount: string, // Amount in token units
961
- deadline: number, // Unix timestamp
962
- nonce: number, // Permit nonce
963
- ): Promise<{
964
- permit: PermitData;
965
- signature: string;
966
- }>;
967
- ```
968
- - [ ] Permit structure (ERC-2612):
969
- - [ ] Token holder (owner) can authorize transfer
970
- - [ ] Without separate approval transaction
971
- - [ ] Signature proves authorization
972
- - [ ] Spender executes transfer with permit
973
- - [ ] Frontend flow:
974
- 1. Show permit details to user
975
- 2. User signs with wallet (MetaMask popup)
976
- 3. Signature sent to backend
977
- 4. Backend calls facilitator to execute transfer
978
-
979
- ### Cycle 42: Implement Transfer-Based Payment Flow
980
-
981
- - [ ] Create `backend/convex/lib/transfer-payment.ts`
982
- - [ ] For chains without permit support (Solana):
983
- - [ ] User approves spender in separate tx
984
- - [ ] User signs transfer in second tx
985
- - [ ] Both txHashes submitted to backend
986
- - [ ] Flow:
987
- 1. Generate approval tx (user can preview)
988
- 2. User submits + signs approval
989
- 3. Wait for approval confirmation
990
- 4. Generate transfer tx
991
- 5. User submits + signs transfer
992
- 6. Backend verifies both on-chain
993
- - [ ] Handle edge cases:
994
- - [ ] User cancels approval
995
- - [ ] Approval expires (re-generate)
996
- - [ ] Insufficient allowance (show error)
997
-
998
- ### Cycle 43: Integrate with Coinbase CDP Facilitator
999
-
1000
- - [ ] Create `backend/convex/lib/coinbase-facilitator.ts`
1001
- - [ ] Implement facilitator client:
1002
- ```typescript
1003
- export class CoinbaseFacilitator {
1004
- async verifyPayment(payload: PaymentPayload): Promise<VerifyResponse>;
1005
- async settlePayment(txHash: string): Promise<SettleResponse>;
1006
- async getSupportedSchemes(): Promise<SupportedSchemesResponse>;
1007
- }
1008
- ```
1009
- - [ ] API calls to Coinbase:
1010
- - [ ] POST /verify - Check payment validity
1011
- - [ ] POST /settle - Execute on-chain settlement
1012
- - [ ] GET /supported - List supported schemes/networks
1013
- - [ ] Authentication:
1014
- - [ ] API key in env var
1015
- - [ ] Include in Authorization header
1016
- - [ ] Error handling:
1017
- - [ ] Retry on 5xx errors
1018
- - [ ] Propagate validation errors
1019
- - [ ] Log all facilitator calls
1020
-
1021
- ### Cycle 44: Implement Gas Estimation
1022
-
1023
- - [ ] Create `backend/convex/lib/gas-estimation.ts`
1024
- - [ ] Estimate gas for:
1025
- - [ ] Permit signature (no gas)
1026
- - [ ] Transfer transaction (gas cost on Base ~$0.0001)
1027
- - [ ] Settlement on Base (gas cost)
1028
- - [ ] Functions:
1029
- ```typescript
1030
- async function estimateTransferGas(network: string): Promise<string>;
1031
- async function estimateTxCost(network: string, gas: string): Promise<string>;
1032
- ```
1033
- - [ ] Show to user:
1034
- - [ ] Gas cost in USD
1035
- - [ ] Total cost = amount + gas
1036
- - [ ] On Base: Gas typically negligible (~$0.0001)
1037
-
1038
- ### Cycle 45: Implement Transaction Verification
1039
-
1040
- - [ ] Create `backend/convex/lib/tx-verification.ts`
1041
- - [ ] Verify on-chain transaction:
1042
- ```typescript
1043
- async function verifyTransaction(
1044
- txHash: string,
1045
- network: string,
1046
- expectedAmount: string,
1047
- expectedRecipient: string,
1048
- ): Promise<{
1049
- valid: boolean;
1050
- blockNumber: number;
1051
- confirmations: number;
1052
- error?: string;
1053
- }>;
1054
- ```
1055
- - [ ] Checks:
1056
- - [ ] Tx exists on-chain
1057
- - [ ] Status = success
1058
- - [ ] Amount >= required
1059
- - [ ] Recipient = treasury address
1060
- - [ ] Token = USDC
1061
- - [ ] Enough confirmations (1 on Base)
1062
- - [ ] Handle cases:
1063
- - [ ] Tx pending (return confirmations = 0)
1064
- - [ ] Tx failed (return error)
1065
- - [ ] Wrong recipient (return error)
1066
- - [ ] Insufficient amount (return error)
1067
-
1068
- ### Cycle 46: Implement Replay Protection
1069
-
1070
- - [ ] Create `backend/convex/lib/replay-protection.ts`
1071
- - [ ] Prevent using same payment twice:
1072
- ```typescript
1073
- async function checkReplayProtection(
1074
- paymentPayload: PaymentPayload,
1075
- ): Promise<boolean>;
1076
- ```
1077
- - [ ] Methods:
1078
- - [ ] Check txHash not in used payments
1079
- - [ ] Check nonce unique (if present)
1080
- - [ ] Check timestamp recent (< 5 minutes)
1081
- - [ ] Mark txHash as used after payment
1082
- - [ ] Store used txHashes:
1083
- - [ ] In Convex `payments` table (status = "settled")
1084
- - [ ] Add index: by_txHash(txHash)
1085
- - [ ] Query existing payments:
1086
- ```typescript
1087
- const existing = await db
1088
- .query("entities")
1089
- .withIndex("by_type", (q) => q.eq("type", "payment"))
1090
- .filter((q) => q.eq(q.field("properties.txHash"), txHash))
1091
- .first();
1092
- ```
1093
-
1094
- ### Cycle 47: Implement Rate Limiting per User
1095
-
1096
- - [ ] Create `backend/convex/lib/rate-limiter.ts`
1097
- - [ ] Rate limit payment attempts:
1098
- - [ ] Per user: 10 requests/minute (prevent spam)
1099
- - [ ] Per endpoint: 100 payments/minute (per-resource)
1100
- - [ ] Sliding window counter
1101
- - [ ] Store rates in Convex or in-memory (fast)
1102
- - [ ] Return 429 Too Many Requests if exceeded
1103
- - [ ] Log rate limit violations
1104
-
1105
- ### Cycle 48: Implement Payment Reconciliation
1106
-
1107
- - [ ] Create `backend/convex/services/payment-reconciliation.ts`
1108
- - [ ] Scheduled job to:
1109
- - [ ] Check pending payments (every minute)
1110
- - [ ] Verify status with blockchain
1111
- - [ ] Update payment status in DB
1112
- - [ ] Log discrepancies
1113
- - [ ] States:
1114
- - [ ] payment_required: Awaiting user action
1115
- - [ ] verified: User signed, awaiting settlement
1116
- - [ ] settled: Confirmed on-chain
1117
- - [ ] failed: Error, mark for cleanup
1118
- - [ ] Reconciliation logic:
1119
- ```typescript
1120
- async function reconcilePendingPayments() {
1121
- // Get all payments with status != "settled"
1122
- // For each, check blockchain
1123
- // Update status + log event
1124
- }
1125
- ```
1126
-
1127
- ### Cycle 49: Implement Refund Logic (Future)
1128
-
1129
- - [ ] Create `backend/convex/lib/refund-handler.ts`
1130
- - [ ] Handle refunds if:
1131
- - [ ] Service fails after payment
1132
- - [ ] User cancels within timeout
1133
- - [ ] Overpayment (refund difference)
1134
- - [ ] Refund flow:
1135
- 1. Receive refund request
1136
- 2. Verify eligibility
1137
- 3. Call facilitator to issue refund
1138
- 4. Update payment status to "refunded"
1139
- 5. Log refund event
1140
- - [ ] Note: Implement in Phase 2+ (not required for MVP)
1141
-
1142
- ### Cycle 50: Document Payment Architecture
1143
-
1144
- - [ ] Write `one/connections/x402-architecture.md`
1145
- - [ ] Document:
1146
- - [ ] Payment flow diagram
1147
- - [ ] Components + responsibilities
1148
- - [ ] Data structures
1149
- - [ ] Error scenarios + recovery
1150
- - [ ] Security considerations
1151
- - [ ] Performance characteristics
1152
- - [ ] Add to `/one` documentation
1153
-
1154
- ---
1155
-
1156
- ## PHASE 6: QUALITY & TESTING (Cycle 51-60)
1157
-
1158
- **Purpose:** Test all payment flows end-to-end
1159
-
1160
- ### Cycle 51: Write Unit Tests for X402 Services
1161
-
1162
- - [ ] Create `backend/convex/__tests__/x402-payment.test.ts`
1163
- - [ ] Test X402PaymentService:
1164
- - [ ] createPaymentRequest returns 402 structure
1165
- - [ ] verifyPayment validates payload
1166
- - [ ] getPaymentHistory returns user's payments
1167
- - [ ] Test X402FacilitatorService:
1168
- - [ ] verifyPayment calls Coinbase API
1169
- - [ ] settlePayment executes transaction
1170
- - [ ] Error handling + retries
1171
- - [ ] Mock external calls:
1172
- - [ ] Mock Convex database
1173
- - [ ] Mock HTTP calls to facilitator
1174
- - [ ] Mock blockchain calls
1175
-
1176
- ### Cycle 52: Write Integration Tests
1177
-
1178
- - [ ] Create `backend/convex/__tests__/x402-integration.test.ts`
1179
- - [ ] Test complete flow:
1180
- 1. Create payment request (get 402)
1181
- 2. Create payment payload (sign)
1182
- 3. Verify payment (call facilitator)
1183
- 4. Settle payment (on-chain)
1184
- 5. Verify recorded in DB
1185
- - [ ] Test error scenarios:
1186
- - [ ] Invalid signature
1187
- - [ ] Insufficient balance
1188
- - [ ] Wrong recipient
1189
- - [ ] Replay attack
1190
- - [ ] Network timeout
1191
-
1192
- ### Cycle 53: Write Frontend Component Tests
1193
-
1194
- - [ ] Create `web/src/components/__tests__/PaymentRequired.test.tsx`
1195
- - [ ] Test PaymentRequired component:
1196
- - [ ] Renders correctly
1197
- - [ ] Shows network/scheme options
1198
- - [ ] Handles wallet connection
1199
- - [ ] Displays error messages
1200
- - [ ] Callback on payment
1201
- - [ ] Test WalletConnection component:
1202
- - [ ] Connect button works
1203
- - [ ] Wallet list shows
1204
- - [ ] Balance displays
1205
- - [ ] Network switching
1206
- - [ ] Test PaymentProcessor:
1207
- - [ ] Calls verify endpoint
1208
- - [ ] Handles verification result
1209
- - [ ] Retries on failure
1210
- - [ ] Shows success message
1211
-
1212
- ### Cycle 54: Write E2E Tests
1213
-
1214
- - [ ] Create `web/src/__tests__/x402-e2e.test.ts`
1215
- - [ ] Test full user flow:
1216
- 1. Visit protected endpoint
1217
- 2. Get 402 response
1218
- 3. Modal shows payment prompt
1219
- 4. User connects wallet
1220
- 5. User approves permit
1221
- 6. Payment verified
1222
- 7. Endpoint returns resource
1223
- - [ ] Use test wallet (e.g., testnet USDC)
1224
- - [ ] Verify in block explorer
1225
- - [ ] Test retry flows
1226
-
1227
- ### Cycle 55: Write API Route Tests
1228
-
1229
- - [ ] Create `web/src/pages/api/__tests__/agent-execute.test.ts`
1230
- - [ ] Test agent execution endpoint:
1231
- - [ ] Without payment → 402
1232
- - [ ] With invalid payment → error
1233
- - [ ] With valid payment → 200 + result
1234
- - [ ] Test other routes similarly:
1235
- - [ ] Provider call
1236
- - [ ] Workflow trigger
1237
- - [ ] Payment history
1238
-
1239
- ### Cycle 56: Create Test Fixtures
1240
-
1241
- - [ ] Create `web/src/__fixtures__/x402-fixtures.ts`
1242
- - [ ] Define test data:
1243
- - [ ] Sample payment payloads
1244
- - [ ] Sample facilitator responses
1245
- - [ ] Sample blockchain transactions
1246
- - [ ] Mock wallet addresses
1247
- - [ ] Test amounts
1248
- - [ ] Reuse across all tests
1249
-
1250
- ### Cycle 57: Test Error Scenarios
1251
-
1252
- - [ ] Create `web/src/__tests__/x402-error-scenarios.test.ts`
1253
- - [ ] Test error handling:
1254
- - [ ] Facilitator down (503)
1255
- - [ ] Invalid payment (402 with error)
1256
- - [ ] Expired request
1257
- - [ ] Malformed payload
1258
- - [ ] Network timeout
1259
- - [ ] Gas estimation error
1260
- - [ ] Insufficient gas
1261
- - [ ] Verify error messages are helpful
1262
-
1263
- ### Cycle 58: Test Security
1264
-
1265
- - [ ] Create `web/src/__tests__/x402-security.test.ts`
1266
- - [ ] Test security aspects:
1267
- - [ ] Replay protection works
1268
- - [ ] Signature verification
1269
- - [ ] Recipient validation
1270
- - [ ] Amount validation
1271
- - [ ] Rate limiting
1272
- - [ ] XSS protection (payment modal)
1273
- - [ ] CSRF protection
1274
-
1275
- ### Cycle 59: Test Performance
1276
-
1277
- - [ ] Create `web/src/__tests__/x402-performance.test.ts`
1278
- - [ ] Measure:
1279
- - [ ] Payment creation time (< 100ms)
1280
- - [ ] Verification time (< 500ms)
1281
- - [ ] Settlement time (< 2s on Base)
1282
- - [ ] UI responsiveness during payment
1283
- - [ ] Load test: 100 concurrent payments
1284
- - [ ] Document results in metrics file
1285
-
1286
- ### Cycle 60: Final Test Coverage Report
1287
-
1288
- - [ ] Run full test suite: `bun test`
1289
- - [ ] Generate coverage report
1290
- - [ ] Target: 80%+ coverage
1291
- - [ ] Document:
1292
- - [ ] Test count
1293
- - [ ] Coverage %
1294
- - [ ] Known gaps
1295
- - [ ] Performance metrics
1296
- - [ ] Save to: `one/events/x402-test-report.md`
1297
-
1298
- ---
1299
-
1300
- ## PHASE 7: DESIGN & WIREFRAMES (Cycle 61-70)
1301
-
1302
- **Purpose:** Finalize UI/UX design for payment flow
1303
-
1304
- ### Cycle 61: Design Payment Prompt Modal
1305
-
1306
- - [ ] Create wireframe: PaymentPromptModal
1307
- - [ ] Layout:
1308
- - [ ] Title: "Payment Required"
1309
- - [ ] Amount display (USD + tokens)
1310
- - [ ] Network selector dropdown
1311
- - [ ] Scheme selector (Permit, Transfer)
1312
- - [ ] "Connect Wallet" button
1313
- - [ ] "Cancel" button
1314
- - [ ] States:
1315
- - [ ] Initial (awaiting wallet connect)
1316
- - [ ] Connected (show address + balance)
1317
- - [ ] Signing (show "Please sign in wallet")
1318
- - [ ] Processing (show spinner)
1319
- - [ ] Success (show checkmark + close)
1320
- - [ ] Error (show error message + retry)
1321
-
1322
- ### Cycle 62: Design Payment History Page
1323
-
1324
- - [ ] Create wireframe: PaymentHistory
1325
- - [ ] Components:
1326
- - [ ] Header: "Payment History"
1327
- - [ ] Filter bar (status, network, date)
1328
- - [ ] Table with columns:
1329
- - [ ] Date/time
1330
- - [ ] Resource (API endpoint)
1331
- - [ ] Amount
1332
- - [ ] Network badge
1333
- - [ ] Status badge
1334
- - [ ] Tx hash (clickable)
1335
- - [ ] Pagination controls
1336
- - [ ] Empty state (no payments)
1337
- - [ ] Error state (failed to load)
1338
-
1339
- ### Cycle 63: Design Balance Display
1340
-
1341
- - [ ] Create wireframe: BalanceDisplay
1342
- - [ ] Card layout:
1343
- - [ ] Title: "Wallet Balance"
1344
- - [ ] Network badge (Base, Ethereum)
1345
- - [ ] Large balance display ($X.XX)
1346
- - [ ] Token display (Y USDC)
1347
- - [ ] Refresh button
1348
- - [ ] Low balance warning (if < $0.05)
1349
- - [ ] "Add Funds" link (future)
1350
-
1351
- ### Cycle 64: Design Agent Execution Flow
1352
-
1353
- - [ ] Create wireframe: AgentExecutionFlow
1354
- - [ ] States:
1355
- - [ ] Initial: Agent selection + parameters
1356
- - [ ] Submitted: Show spinner "Executing..."
1357
- - [ ] Payment required: Show PaymentPromptModal
1358
- - [ ] Retrying: Show spinner "Retrying execution..."
1359
- - [ ] Success: Show agent result
1360
- - [ ] Error: Show error message + retry button
1361
- - [ ] Include payment info in result:
1362
- - [ ] Payment ID
1363
- - [ ] Tx hash
1364
- - [ ] Network used
1365
- - [ ] Cost in USD
1366
-
1367
- ### Cycle 65: Design X402 Demo Page
1368
-
1369
- - [ ] Create wireframe: DemoPage (/demo/x402-payments)
1370
- - [ ] Sections:
1371
- - [ ] Hero: "Try X402 Payments"
1372
- - [ ] How it works (3-step animation)
1373
- - [ ] Live demo (test payment)
1374
- - [ ] Pricing comparison (X402 vs traditional)
1375
- - [ ] FAQ section
1376
- - [ ] CTA: "Integrate X402"
1377
- - [ ] Interactive elements:
1378
- - [ ] Animated flow chart
1379
- - [ ] Live payment example
1380
- - [ ] Code snippets (copy-able)
1381
-
1382
- ### Cycle 66: Create Design Tokens for X402
1383
-
1384
- - [ ] Update `web/src/styles/x402-tokens.css`:
1385
-
1386
- ```css
1387
- :root {
1388
- --x402-primary: hsl(180, 82%, 50%); /* X402 blue */
1389
- --x402-success: hsl(120, 100%, 50%); /* Payment success */
1390
- --x402-warning: hsl(45, 100%, 50%); /* Awaiting user */
1391
- --x402-error: hsl(0, 100%, 50%); /* Payment failed */
1392
- --x402-pending: hsl(45, 100%, 50%); /* Processing */
1393
-
1394
- --blockchain-base: hsl(220, 90%, 50%); /* Base blue */
1395
- --blockchain-ethereum: hsl(250, 60%, 50%); /* Ethereum purple */
1396
- --blockchain-solana: hsl(280, 80%, 50%); /* Solana pink */
1397
-
1398
- --x402-border-radius: 12px;
1399
- --x402-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1400
- }
1401
- ```
1402
-
1403
- ### Cycle 67: Ensure Accessibility (WCAG 2.1 AA)
1404
-
1405
- - [ ] Update components for accessibility:
1406
- - [ ] PaymentPromptModal: Add aria-modal, role, keyboard nav
1407
- - [ ] WalletConnection: Add labels, focus states
1408
- - [ ] PaymentProcessor: Add aria-live for status updates
1409
- - [ ] PaymentHistory: Add table headers, sort buttons
1410
- - [ ] BalanceDisplay: Add aria-label for amount
1411
- - [ ] Test with:
1412
- - [ ] Screen reader (NVDA, JAWS)
1413
- - [ ] Keyboard navigation (Tab, Enter, Escape)
1414
- - [ ] Color contrast (ratio 4.5:1 minimum)
1415
- - [ ] Focus indicators (visible)
1416
-
1417
- ### Cycle 68: Test Mobile Responsiveness
1418
-
1419
- - [ ] Test PaymentPromptModal on:
1420
- - [ ] iPhone 12 (390px)
1421
- - [ ] iPad (768px)
1422
- - [ ] Android phone (360px)
1423
- - [ ] Issues to fix:
1424
- - [ ] Modal overflow
1425
- - [ ] Button sizes (tap targets 48px+)
1426
- - [ ] Text readability
1427
- - [ ] Wallet connect dropdown
1428
- - [ ] Test touch interactions:
1429
- - [ ] Network selector (dropdown)
1430
- - [ ] Scheme selector (radio buttons)
1431
- - [ ] Buttons (click area)
1432
-
1433
- ### Cycle 69: Design Dark Mode Styles
1434
-
1435
- - [ ] Update CSS for dark mode:
1436
- ```css
1437
- @media (prefers-color-scheme: dark) {
1438
- --x402-bg: hsl(220, 13%, 13%);
1439
- --x402-text: hsl(0, 0%, 100%);
1440
- --x402-border: hsl(220, 13%, 23%);
1441
- --x402-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
1442
- }
1443
- ```
1444
- - [ ] Test all components in dark mode
1445
- - [ ] Verify contrast ratios still valid
1446
-
1447
- ### Cycle 70: Create Component Library Documentation
1448
-
1449
- - [ ] Document all X402 components:
1450
- - [ ] PaymentPromptModal
1451
- - [ ] WalletConnection
1452
- - [ ] PaymentProcessor
1453
- - [ ] PaymentHistory
1454
- - [ ] BalanceDisplay
1455
- - [ ] AgentExecutionFlow
1456
- - [ ] For each: Props, states, usage examples
1457
- - [ ] Add Storybook stories (future):
1458
- - [ ] Story for each state
1459
- - [ ] Interactive playground
1460
- - [ ] Component docs
1461
-
1462
- ---
1463
-
1464
- ## PHASE 8: PERFORMANCE & OPTIMIZATION (Cycle 71-80)
1465
-
1466
- **Purpose:** Optimize payment flow for speed + efficiency
1467
-
1468
- ### Cycle 71: Optimize Frontend Bundle Size
1469
-
1470
- - [ ] Audit bundle:
1471
- - [ ] Run `bun run build` with analysis
1472
- - [ ] Identify large dependencies (wagmi, viem)
1473
- - [ ] Tree-shake unused code
1474
- - [ ] Optimize:
1475
- - [ ] Code-split payment components (lazy load)
1476
- - [ ] Minimize Redux/state duplicates
1477
- - [ ] Remove unused shadcn/ui components
1478
- - [ ] Target: Payment modal < 50KB gzipped
1479
-
1480
- ### Cycle 72: Implement Payment Caching
1481
-
1482
- - [ ] Cache frequently accessed data:
1483
- - [ ] X402 config (supported networks, amounts)
1484
- - [ ] User payment history (first 50 records)
1485
- - [ ] Facilitator status
1486
- - [ ] Cache strategy:
1487
- - [ ] Config: 1 hour (update on page load)
1488
- - [ ] History: 5 minutes (refresh on new payment)
1489
- - [ ] Facilitator: 5 minutes (health check)
1490
- - [ ] Use Convex caching + browser localStorage
1491
-
1492
- ### Cycle 73: Implement Pagination for Payment History
1493
-
1494
- - [ ] Load payments in batches:
1495
- - [ ] Initial load: 20 most recent
1496
- - [ ] On scroll: Load next 20
1497
- - [ ] User can jump to page
1498
- - [ ] Database query optimization:
1499
- - [ ] Index: by_timestamp(createdAt)
1500
- - [ ] Limit + offset in query
1501
- - [ ] Count total for pagination info
1502
-
1503
- ### Cycle 74: Optimize Blockchain RPC Calls
1504
-
1505
- - [ ] Batch RPC requests:
1506
- - [ ] Use eth_call for read-only operations
1507
- - [ ] Batch multiple calls in single JSON-RPC batch
1508
- - [ ] Cache results (gas prices, contract state)
1509
- - [ ] Reduce RPC calls:
1510
- - [ ] Cache token balances (poll every 10 seconds)
1511
- - [ ] Cache gas prices (poll every 30 seconds)
1512
- - [ ] Cache supported schemes (poll on demand)
1513
- - [ ] Monitor RPC usage:
1514
- - [ ] Track calls per second
1515
- - [ ] Alert if quota exceeded
1516
-
1517
- ### Cycle 75: Implement Permit Caching
1518
-
1519
- - [ ] Cache permit data to avoid re-generating:
1520
- - [ ] Store permit in localStorage + Convex
1521
- - [ ] Reuse for 5 minutes (before expiry)
1522
- - [ ] User can view previous permits
1523
- - [ ] Cache structure:
1524
- ```typescript
1525
- {
1526
- paymentId: string;
1527
- permit: PermitData;
1528
- signature: string;
1529
- expiresAt: number;
1530
- usedAt?: number;
1531
- }
1532
- ```
1533
-
1534
- ### Cycle 76: Implement Progressive Enhancement
1535
-
1536
- - [ ] Website works without JavaScript (server-rendered):
1537
- - [ ] Show payment form with standard HTML
1538
- - [ ] POST to API endpoint
1539
- - [ ] Server returns 402 with HTML form
1540
- - [ ] User can submit (without client-side validation)
1541
- - [ ] With JavaScript: Enhanced UX
1542
- - [ ] Client-side validation
1543
- - [ ] Real-time feedback
1544
- - [ ] Wallet integration
1545
- - [ ] Goal: Graceful degradation
1546
-
1547
- ### Cycle 77: Monitor Payment Latency
1548
-
1549
- - [ ] Add performance metrics:
1550
- - [ ] Payment creation time
1551
- - [ ] Verification time
1552
- - [ ] Settlement time
1553
- - [ ] UI render time
1554
- - [ ] Track in Convex events:
1555
- ```typescript
1556
- {
1557
- type: 'payment_event',
1558
- metadata: {
1559
- status: 'settled',
1560
- createdAt: 1234567890,
1561
- verifiedAt: 1234567900,
1562
- settledAt: 1234567910,
1563
- creationMs: 10,
1564
- verificationMs: 10,
1565
- settlementMs: 10,
1566
- }
1567
- }
1568
- ```
1569
- - [ ] Alert if > expected time
1570
-
1571
- ### Cycle 78: Implement Connection Pooling
1572
-
1573
- - [ ] Reuse blockchain client connections:
1574
- - [ ] Create single viem client per network
1575
- - [ ] Share across multiple requests
1576
- - [ ] Avoid creating new clients per request
1577
- - [ ] Connection pooling strategy:
1578
- - [ ] Singleton pattern for viem clients
1579
- - [ ] Base client created on startup
1580
- - [ ] Reuse for all requests
1581
-
1582
- ### Cycle 79: Optimize Payment Settlement
1583
-
1584
- - [ ] Parallelize settlement tasks:
1585
- - [ ] Verify payment on blockchain (parallel)
1586
- - [ ] Update DB (parallel)
1587
- - [ ] Log event (parallel)
1588
- - [ ] Notify user (parallel)
1589
- - [ ] Use Convex's scheduler for batch operations
1590
- - [ ] Goal: Settlement < 2 seconds on Base
1591
-
1592
- ### Cycle 80: Performance Baseline & Regression Testing
1593
-
1594
- - [ ] Establish baseline metrics:
1595
- - [ ] Payment creation: 50-100ms
1596
- - [ ] Verification: 300-500ms
1597
- - [ ] Settlement: 1-2s (blockchain dependent)
1598
- - [ ] UI responsiveness: 60 FPS
1599
- - [ ] CI/CD integration:
1600
- - [ ] Run performance tests on every PR
1601
- - [ ] Fail if regression > 10%
1602
- - [ ] Report metrics in PR
1603
- - [ ] Document in: `one/events/x402-performance.md`
1604
-
1605
- ---
1606
-
1607
- ## PHASE 9: DEPLOYMENT & DOCUMENTATION (Cycle 81-90)
1608
-
1609
- **Purpose:** Deploy to production, document for users + developers
1610
-
1611
- ### Cycle 81: Set Up Production Environment Variables
1612
-
1613
- - [ ] Update `.env` (root) with production values:
1614
- - [ ] VITE_BLOCKCHAIN_RPC_BASE (Coinbase mainnet RPC)
1615
- - [ ] VITE_BLOCKCHAIN_RPC_ETHEREUM (if needed)
1616
- - [ ] X402_PAYMENT_ADDRESS_BASE (production treasury)
1617
- - [ ] FACILITATOR_URL (production Coinbase endpoint)
1618
- - [ ] FACILITATOR_API_KEY (production API key)
1619
- - [ ] Secure env vars:
1620
- - [ ] Use Cloudflare secrets (not .env.local)
1621
- - [ ] Rotate API keys quarterly
1622
- - [ ] Audit access logs monthly
1623
- - [ ] Document in: `DEPLOYMENT.md`
1624
-
1625
- ### Cycle 82: Deploy Backend to Convex
1626
-
1627
- - [ ] Ensure all backend changes committed:
1628
- - [ ] `backend/convex/schema.ts` updated
1629
- - [ ] `backend/convex/protocols/x402.ts` created
1630
- - [ ] `backend/convex/services/x402-*.ts` created
1631
- - [ ] `backend/convex/mutations/payments.ts` created
1632
- - [ ] `backend/convex/queries/payments.ts` created
1633
- - [ ] Run deployment checks:
1634
- - [ ] `npx convex dev` (local test)
1635
- - [ ] TypeScript check passes
1636
- - [ ] No schema breaking changes
1637
- - [ ] Deploy: `npx convex deploy`
1638
- - [ ] Verify in Convex dashboard
1639
-
1640
- ### Cycle 83: Build + Deploy Frontend to Cloudflare
1641
-
1642
- - [ ] Build frontend:
1643
- - [ ] `cd web && bun run build`
1644
- - [ ] Type check: `bunx astro check`
1645
- - [ ] Verify dist/ created
1646
- - [ ] Deploy to Cloudflare Pages:
1647
- - [ ] `wrangler pages deploy dist --project-name=web`
1648
- - [ ] Verify deployment URL: https://web.one.ie
1649
- - [ ] Test in browser (smoke test)
1650
- - [ ] Monitor for errors:
1651
- - [ ] Check DevTools console
1652
- - [ ] Monitor Cloudflare logs
1653
-
1654
- ### Cycle 84: Verify Production Endpoints
1655
-
1656
- - [ ] Test in production:
1657
- - [ ] GET /api/agent/execute (without payment) → 402
1658
- - [ ] POST /api/agent/execute (with payment) → 200
1659
- - [ ] GET /api/payments/history → user's payments
1660
- - [ ] GET /api/x402/config → config object
1661
- - [ ] Verify payment flows:
1662
- - [ ] Create payment request
1663
- - [ ] Verify payment
1664
- - [ ] Settle payment
1665
- - [ ] Check Convex logs
1666
- - [ ] Monitor for issues:
1667
- - [ ] Error rates
1668
- - [ ] Slow requests
1669
- - [ ] Failed payments
1670
-
1671
- ### Cycle 85: Create User Documentation
1672
-
1673
- - [ ] Write `web/public/docs/x402-user-guide.md`:
1674
- - [ ] How to connect wallet
1675
- - [ ] How to approve payments
1676
- - [ ] How to view payment history
1677
- - [ ] Supported networks
1678
- - [ ] Minimum/maximum amounts
1679
- - [ ] Troubleshooting section
1680
- - [ ] FAQ
1681
- - [ ] Include screenshots:
1682
- - [ ] Payment prompt
1683
- - [ ] Wallet connection
1684
- - [ ] Payment confirmation
1685
- - [ ] Payment history
1686
-
1687
- ### Cycle 86: Create Developer Documentation
1688
-
1689
- - [ ] Write `one/connections/x402-developer-guide.md`:
1690
- - [ ] X402 protocol overview
1691
- - [ ] How to protect endpoints with X402
1692
- - [ ] How to handle 402 responses
1693
- - [ ] Integration examples:
1694
- - [ ] cURL
1695
- - [ ] JavaScript/fetch
1696
- - [ ] Python
1697
- - [ ] Go
1698
- - [ ] Error codes + meanings
1699
- - [ ] Rate limiting info
1700
- - [ ] Security best practices
1701
- - [ ] Code examples:
1702
-
1703
- ```bash
1704
- # Request protected resource
1705
- curl https://one.ie/api/agent/execute
1706
- # → 402 Payment Required (with PaymentRequired body)
1707
-
1708
- # Make payment + retry
1709
- curl -H "X-PAYMENT: {...}" https://one.ie/api/agent/execute
1710
- # → 200 OK (with X-PAYMENT-ID header)
1711
- ```
1712
-
1713
- ### Cycle 87: Create Integration Guide for Partners
1714
-
1715
- - [ ] Write `one/connections/x402-integration-guide.md`:
1716
- - [ ] High-level overview
1717
- - [ ] When to use X402
1718
- - [ ] How to onboard:
1719
- 1. Set payment requirements on endpoints
1720
- 2. Choose amount + description
1721
- 3. Choose networks
1722
- 4. Configure payout address
1723
- - [ ] How to test:
1724
- 1. Use testnet (if available)
1725
- 2. Test 402 responses
1726
- 3. Test payment flows
1727
- - [ ] How to monitor:
1728
- - [ ] Payment history
1729
- - [ ] Error rates
1730
- - [ ] Settlement times
1731
- - [ ] Support + troubleshooting
1732
-
1733
- ### Cycle 88: Write Architecture Decision Record (ADR)
1734
-
1735
- - [ ] Create `one/events/adr-x402-integration.md`:
1736
- - [ ] Context: Why X402?
1737
- - [ ] Decision: Use X402 for micropayments
1738
- - [ ] Consequences:
1739
- - [ ] Positive: No payment infrastructure needed
1740
- - [ ] Positive: Instant settlement
1741
- - [ ] Positive: Blockchain transparent
1742
- - [ ] Negative: Requires user wallet
1743
- - [ ] Negative: Blockchain dependent
1744
- - [ ] Alternatives considered:
1745
- - [ ] Stripe/PayPal
1746
- - [ ] Custom payment solution
1747
- - [ ] Status: APPROVED/IN PROGRESS
1748
-
1749
- ### Cycle 89: Create Monitoring + Alerting
1750
-
1751
- - [ ] Set up monitoring for:
1752
- - [ ] Payment success rate (target 99%+)
1753
- - [ ] Settlement time (target < 2s)
1754
- - [ ] Facilitator availability (target 99.9%)
1755
- - [ ] Blockchain RPC uptime (target 99.99%)
1756
- - [ ] Alerting rules:
1757
- - [ ] Payment success rate < 95% → alert
1758
- - [ ] Settlement time > 5s → alert
1759
- - [ ] Facilitator down → alert
1760
- - [ ] RPC down → alert
1761
- - [ ] Dashboard:
1762
- - [ ] Real-time metrics
1763
- - [ ] Payment volume
1764
- - [ ] Revenue tracked
1765
- - [ ] Error rate by type
1766
-
1767
- ### Cycle 90: Plan Maintenance + Updates
1768
-
1769
- - [ ] Document maintenance schedule:
1770
- - [ ] Monthly: Security updates
1771
- - [ ] Quarterly: Dependency updates
1772
- - [ ] Annually: Major version upgrades
1773
- - [ ] Runbooks:
1774
- - [ ] How to handle facilitator outage
1775
- - [ ] How to handle blockchain outage
1776
- - [ ] How to handle security incident
1777
- - [ ] How to rollback deployment
1778
- - [ ] Store in: `one/events/x402-maintenance.md`
1779
-
1780
- ---
1781
-
1782
- ## PHASE 10: KNOWLEDGE & LESSONS LEARNED (Cycle 91-100)
1783
-
1784
- **Purpose:** Document learnings, capture institutional knowledge
1785
-
1786
- ### Cycle 91: Document Ontology Mapping
1787
-
1788
- - [ ] Write `one/knowledge/x402-ontology-mapping.md`:
1789
- - [ ] **Groups:** Merchant group, customer group, platform
1790
- - [ ] **People:** Platform owner, merchant, customer
1791
- - [ ] **Things:** payment, external_agent, product
1792
- - [ ] **Connections:** transacted, communicated, delegated
1793
- - [ ] **Events:** payment_event (with protocol: x402)
1794
- - [ ] **Knowledge:** payment_method, x402_scheme labels
1795
- - [ ] Use 6-dimension framework throughout
1796
- - [ ] Show examples of real data structures
1797
-
1798
- ### Cycle 92: Create Payment Flow State Diagram
1799
-
1800
- - [ ] Create `one/events/x402-state-diagram.md` with diagram:
1801
- ```
1802
- [ initial ] --request_payment--> [ payment_required ]
1803
- ^ |
1804
- | user_initiates_payment
1805
- | ↓
1806
- +--- [verify_failed] <-- [ payment_signing ]
1807
- | |
1808
- | user_signs_permit
1809
- | ↓
1810
- +--- [verify_success] <-- [ verification ]
1811
- |
1812
- facilitator_confirms
1813
- ↓
1814
- [ settled ]
1815
- ```
1816
- - [ ] Document transitions:
1817
- - [ ] Timeout: 5 minutes in any state
1818
- - [ ] Retry: User can retry on failure
1819
- - [ ] Settlement: Happens automatically after verification
1820
-
1821
- ### Cycle 93: Document Security Considerations
1822
-
1823
- - [ ] Write `one/connections/x402-security.md`:
1824
- - [ ] **Signature Verification:** User signature proves authorization
1825
- - [ ] **Replay Protection:** Each txHash used only once
1826
- - [ ] **Amount Validation:** Check >= required
1827
- - [ ] **Recipient Validation:** Check = treasury address
1828
- - [ ] **Expiry:** Payment request valid 5 minutes
1829
- - [ ] **Rate Limiting:** 10 requests/min per user
1830
- - [ ] **Facilitator Verification:** Trust Coinbase CDP
1831
- - [ ] **Blockchain Finality:** Verify 1+ confirmations on Base
1832
- - [ ] Known risks:
1833
- - [ ] User sends to wrong address (no recovery)
1834
- - [ ] Private key compromised (wallet issue, not ours)
1835
- - [ ] Blockchain reorg (very unlikely on Base)
1836
- - [ ] Facilitator breach (trust issue)
1837
-
1838
- ### Cycle 94: Document Blockchain Specifics
1839
-
1840
- - [ ] Write `one/connections/x402-blockchain.md`:
1841
- - [ ] **Base Network:**
1842
- - [ ] Chain ID: 8453
1843
- - [ ] Block time: ~2 seconds
1844
- - [ ] Finality: 1 block (~2 seconds)
1845
- - [ ] USDC address: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
1846
- - [ ] Average cost per transaction: $0.0001
1847
- - [ ] **Permit Support:**
1848
- - [ ] ERC-2612 standard
1849
- - [ ] No separate approval needed
1850
- - [ ] Deadline: must be > current block timestamp
1851
- - [ ] Nonce: auto-incrementing for each permit
1852
- - [ ] **Token Contracts:**
1853
- - [ ] USDC decimals: 6
1854
- - [ ] Balance queries: eth_call (read-only)
1855
- - [ ] Transfer: state-changing transaction
1856
-
1857
- ### Cycle 95: Capture Performance Benchmarks
1858
-
1859
- - [ ] Write `one/events/x402-performance-benchmarks.md`:
1860
- - [ ] **Payment Creation:** 50-100ms
1861
- - [ ] **Permit Generation:** 30-50ms
1862
- - [ ] **User Signature:** 2-5s (user-dependent)
1863
- - [ ] **Facilitator Verification:** 200-300ms
1864
- - [ ] **Blockchain Settlement:** 1-2s (on Base)
1865
- - [ ] **Total E2E Time:** 4-8s
1866
- - [ ] **UI Responsiveness:** 60 FPS (payment modal)
1867
- - [ ] **Bundle Size:** 45KB gzipped (payment module)
1868
- - [ ] **Cache Hit Rate:** 85%+ for config/history
1869
- - [ ] Comparison to alternatives:
1870
- - [ ] Stripe: 1-3s (no blockchain wait)
1871
- - [ ] PayPal: 2-5s (no blockchain wait)
1872
- - [ ] X402: 4-8s (includes blockchain settlement)
1873
-
1874
- ### Cycle 96: Document Common Issues + Solutions
1875
-
1876
- - [ ] Write `one/connections/x402-troubleshooting.md`:
1877
- - [ ] **Issue: Payment times out**
1878
- - [ ] Cause: Facilitator slow or down
1879
- - [ ] Solution: Retry after 5 minutes
1880
- - [ ] **Issue: "Insufficient Balance"**
1881
- - [ ] Cause: User balance < payment amount
1882
- - [ ] Solution: Show user balance, suggest adding funds
1883
- - [ ] **Issue: "Wrong Recipient"**
1884
- - [ ] Cause: Payment sent to wrong address
1885
- - [ ] Solution: Show treasury address before signing
1886
- - [ ] **Issue: "Permit Signature Invalid"**
1887
- - [ ] Cause: User canceled signing
1888
- - [ ] Solution: Show error, let user retry
1889
- - [ ] **Issue: "Network Mismatch"**
1890
- - [ ] Cause: User on wrong blockchain
1891
- - [ ] Solution: Auto-switch or show dialog
1892
- - [ ] **Issue: "Replay Protection Triggered"**
1893
- - [ ] Cause: User tried same payment twice
1894
- - [ ] Solution: Create new payment request
1895
-
1896
- ### Cycle 97: Create Cost Analysis Report
1897
-
1898
- - [ ] Write `one/events/x402-cost-analysis.md`:
1899
- - [ ] **Blockchain Costs:**
1900
- - [ ] Base: $0.0001 per payment
1901
- - [ ] Ethereum: $1-5 per payment (high)
1902
- - [ ] Solana: $0.00001 per payment (future)
1903
- - [ ] **Facilitator Costs:**
1904
- - [ ] Coinbase CDP: Free (for now)
1905
- - [ ] **Infrastructure Costs:**
1906
- - [ ] Convex: Included in platform costs
1907
- - [ ] Cloudflare: Included in platform costs
1908
- - [ ] RPC Provider: $100-500/month (if own node)
1909
- - [ ] **Revenue Potential:**
1910
- - [ ] If 1000 payments/day at $0.01 = $10/day
1911
- - [ ] At 80% markup = $2/day profit
1912
- - [ ] Annualized: $730/year at current volume
1913
- - [ ] **Break-even Analysis:**
1914
- - [ ] Need 10+ payments/day to offset costs
1915
-
1916
- ### Cycle 98: Plan Future Enhancements
1917
-
1918
- - [ ] Document Phase 2+ features in `one/things/todo-x402-phase2.md`:
1919
- - [ ] [ ] Bazar marketplace discovery layer
1920
- - [ ] [ ] Multi-chain support (Ethereum, Solana, Polygon)
1921
- - [ ] [ ] Invoice payment scheme
1922
- - [ ] [ ] Signature-based payments
1923
- - [ ] [ ] Refund mechanism
1924
- - [ ] [ ] Revenue distribution to merchants
1925
- - [ ] [ ] Subscription-based payments
1926
- - [ ] [ ] Conditional payments (if/then logic)
1927
- - [ ] [ ] Payment analytics dashboard
1928
- - [ ] [ ] Webhook notifications on payment
1929
- - [ ] [ ] Custom facilitator support
1930
- - [ ] [ ] Stablecoin alternatives (USDT, DAI)
1931
- - [ ] Prioritize by impact + effort
1932
-
1933
- ### Cycle 99: Create Lessons Learned Document
1934
-
1935
- - [ ] Write `one/events/x402-lessons-learned.md`:
1936
- - [ ] **What went well:**
1937
- - [ ] Coinbase CDP integration smooth
1938
- - [ ] Permit-based payments have great UX
1939
- - [ ] Base network perfect for micropayments
1940
- - [ ] **What was challenging:**
1941
- - [ ] Wallet integration complexity
1942
- - [ ] Blockchain async operations
1943
- - [ ] Testing with real wallets
1944
- - [ ] **What we'd do differently:**
1945
- - [ ] Start with testnet longer
1946
- - [ ] Build more test utilities earlier
1947
- - [ ] Design payment history upfront
1948
- - [ ] **Skills gained:**
1949
- - [ ] ERC-2612 permits
1950
- - [ ] Facilitator patterns
1951
- - [ ] Blockchain integration testing
1952
- - [ ] **Team feedback:**
1953
- - [ ] Quotes from team members
1954
- - [ ] What they learned
1955
-
1956
- ### Cycle 100: Final Summary + Celebration
1957
-
1958
- - [ ] Create `one/events/x402-phase1-complete.md`:
1959
- - [ ] **Project Status:** ✅ COMPLETE
1960
- - [ ] **Timeline:** Cycle 1-100 (100 cycles)
1961
- - [ ] **Delivered:**
1962
- - [ ] [x] HTTP 402 protocol implementation
1963
- - [ ] [x] X402PaymentService (Effect.ts)
1964
- - [ ] [x] Blockchain integration (Base)
1965
- - [ ] [x] Frontend components (React)
1966
- - [ ] [x] Astro API routes (protected)
1967
- - [ ] [x] Payment history tracking
1968
- - [ ] [x] Full E2E testing
1969
- - [ ] [x] Production deployment
1970
- - [ ] [x] Complete documentation
1971
- - [ ] **Next Steps:**
1972
- - [ ] Monitor production metrics
1973
- - [ ] Gather user feedback
1974
- - [ ] Plan Phase 2 features
1975
- - [ ] **Thank you message:**
1976
- - [ ] Credit to team
1977
- - [ ] Thanks to Coinbase for CDP
1978
- - [ ] Thanks to users for feedback
1979
- - [ ] 🎉 **X402 Phase 1 Complete!**
1980
-
1981
- ---
1982
-
1983
- ## SUCCESS CRITERIA
1984
-
1985
- X402 integration is complete when:
1986
-
1987
- - ✅ HTTP 402 responses sent from Astro API routes
1988
- - ✅ X-PAYMENT header validation working end-to-end
1989
- - ✅ Blockchain payment verification via Coinbase facilitator
1990
- - ✅ Payment events logged in Convex events table
1991
- - ✅ Payment history queryable + filterable
1992
- - ✅ Frontend components (React) render correctly
1993
- - ✅ UI shows payment prompt + wallet connection
1994
- - ✅ Demo: Request → 402 → payment → access
1995
- - ✅ 3+ protected endpoints (agent, provider, workflow)
1996
- - ✅ All tests passing (80%+ coverage)
1997
- - ✅ Performance baselines established
1998
- - ✅ Production deployment verified
1999
- - ✅ Documentation complete (user + developer)
2000
- - ✅ Architecture documented in ontology
2001
- - ✅ Lessons learned captured
2002
-
2003
- ---
2004
-
2005
- ## QUICK REFERENCE
2006
-
2007
- **Files Created:**
2008
-
2009
- - `backend/convex/protocols/x402.ts` - Type definitions
2010
- - `backend/convex/services/x402-payment.ts` - Payment service
2011
- - `backend/convex/services/x402-facilitator.ts` - Facilitator service
2012
- - `backend/convex/services/blockchain-provider.ts` - Blockchain client
2013
- - `backend/convex/config/x402-config.ts` - Configuration
2014
- - `backend/convex/mutations/payments.ts` - Convex mutations
2015
- - `backend/convex/queries/payments.ts` - Convex queries
2016
- - `web/src/components/features/PaymentRequired.tsx` - Component
2017
- - `web/src/components/features/WalletConnection.tsx` - Component
2018
- - `web/src/components/features/PaymentProcessor.tsx` - Component
2019
- - `web/src/pages/api/agent/execute.ts` - API route
2020
- - `web/src/pages/api/provider/[providerId]/call.ts` - API route
2021
- - `web/src/pages/api/payments/verify.ts` - API route
2022
- - `web/src/pages/demo/x402-payments.astro` - Demo page
2023
- - `one/connections/x402-architecture.md` - Architecture docs
2024
- - `one/connections/x402-developer-guide.md` - Developer docs
2025
- - `one/connections/x402-security.md` - Security docs
2026
-
2027
- **Environment Variables Required:**
2028
-
2029
- - `VITE_BLOCKCHAIN_RPC_BASE` - Base network RPC URL
2030
- - `X402_PAYMENT_ADDRESS_BASE` - Treasury address
2031
- - `FACILITATOR_URL` - Coinbase CDP endpoint
2032
- - `FACILITATOR_API_KEY` - API key (if needed)
2033
-
2034
- **Tests to Write:**
2035
-
2036
- - Unit tests (payment services)
2037
- - Integration tests (E2E payment flow)
2038
- - Component tests (React components)
2039
- - API route tests (Astro endpoints)
2040
- - Security tests (replay, validation)
2041
- - Performance tests (benchmarks)
2042
-
2043
- ---
2044
-
2045
- **Remember:** Plan in cycles, not days. Where in the sequence does each thing belong?
2046
-
2047
- **Status:** Ready for execution. Begin with Cycle 1-10 (Foundation).