Example: one complete agent workflow (local mock, tests, then Base Sepolia)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with the offline example section in docs/DEVELOPERS.md (#test-without-a-chain) and the startMockServer helper exported from @deepfirstsearch/agent-pay/testing, then check how the newcomer CI job runs those examples. Build examples/agent-workflow/ around a free tool call, a paid x402 call and one hostile 402, with a vitest file asserting all three outcomes. Done means npm test passes offline and the newcomer CI job runs the example.
由索引模型根据 Issue 内容生成。
描述
Suggested by @Priyadharshan2003 in #29. Today the docs show each piece on its own:
npx @deepfirstsearch/agent-pay demo;- a short offline example per framework in docs/DEVELOPERS.md, which CI runs verbatim;
- the MCP server.
What's missing is one example that goes through a whole agent workflow, start to finish.
What: examples/agent-workflow/, a small agent (AI SDK or LangChain) that:
- reads a task;
- calls a free tool and a paid x402 API;
- hits one hostile 402 along the way, and shows the refusal code it gets back and what the agent does with it (
report,ask_owner,retry_later).
The agent should meet all four outcomes a seller can produce, and handle each one as a value, not an exception. dryRun in agent-pay 0.10.0 returns the first three (suggested by @baianomarceloeduardo-jpg below):
allow: pay, and keep the receipt.denywith a code: act on itsaction(report,ask_owner,fix_config,retry_later).no_challenge: nothing to decide. That covers a free route, a free trial, or a stranger's404, and the same URL can flip betweenno_challengeandallow.- Transport failure: retry or give up. It isn't a payment decision.
Read-only live URLs for the no_challenge and two-scheme allow fixtures: https://api.automaton-sovereign.workers.dev/pricing (200, no challenge) and https://api.automaton-sovereign.workers.dev/v2/oracle/base (402 with exact + eip3009, or 200 while a caller's free trial lasts).
It should cover three ways to run it:
- Local development: against
startMockServerfrom@deepfirstsearch/agent-pay/testing, no keys, no chain. - Tests: a vitest file that asserts the paid call succeeds, the hostile one is refused with its code, and the budget is enforced.
- Base Sepolia: the same agent pointed at a real testnet merchant, with the steps to fund a payer (overlaps with #36).
Done when: a newcomer can clone, npm i, npm test and see all three outcomes, and the README walks through what the agent saw at each step. It also needs to be added to the newcomer CI job.
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 3 小时 51 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeepFirstHQ/deepfirstsearch 的其他 Issue
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 72/100
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 3/5 1-2 天 新手友好度 28/100
-
enhancement
难度 3/5 1-2 天 新手友好度 58/100
-
enhancement good first issue
难度 3/5 1-2 天 新手友好度 55/100
查看 DeepFirstHQ/deepfirstsearch 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
melgarafael/DeskcommCRM#3104 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug service: webapp
难度 2/5 1-3 小时 新手友好度 82/100
Ocelot-Social-Community/Ocelot-Social#10684 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nicobailon/pi-subagents#2978 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
getsentry/sentry-conventions#732 · 1 条评论 ·
维护者通常 1 天内回复