From 506014f784e2415f328d0a29e28df39d99676a66 Mon Sep 17 00:00:00 2001 From: dwebxr Date: Tue, 22 Sep 2026 20:53:28 +0900 Subject: [PATCH] =?UTF-8?q?feat(agent):=20=E8=B3=BC=E5=85=A5=E4=BE=8B?= =?UTF-8?q?=E3=81=AB=E5=AE=9F=E7=B8=BE=201=20=E4=BB=B6=20(tx=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF)=20=E3=81=A8=E7=B6=99=E7=B6=9A=E7=94=A8?= =?UTF-8?q?=E9=80=94=E3=81=AE=E8=A3=9C=E8=B6=B3=E3=83=BB=E6=8E=A5=E7=B6=9A?= =?UTF-8?q?=E3=81=AE=20lead=20=E3=81=AB=E3=80=8C=E6=94=AF=E6=89=95?= =?UTF-8?q?=E3=81=84=E3=81=AF=E5=85=A5=E9=87=91=E5=BE=8C=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=B6=B3=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /agent の外部レビュー (9/22) の裁定 1・2・5: - 「支払いあり・3 JPYC」の行に、実際の購入 1 件 (2026-09-22・当時の価格・Polygonscan の tx) と 「返ってきたのは日付と一次ソース URL つきの変更一覧」を 1 行。回答の抜粋は載せない (古くなる) - 同じ行に継続用途: 差分取得で週次の確認にも使える・買う前に無料の更新日チェック - 「Agent を接続」の lead に「支払いは、専用ウォレットに入金してからです」(設定が進むことと 支払いが始まることの違い) 文言 SOT は lib/agentPage.ts (hint / example を任意項目として追加)。実績の href は Polygonscan の tx 形式をテストで固定。セクション mobile 771 → 896px。 Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc --- components/agent/AgentTryPrompts.tsx | 7 +++++++ lib/agentPage.ts | 30 ++++++++++++++++++++++++---- tests/lib/agentPage.test.ts | 10 ++++++++++ 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/components/agent/AgentTryPrompts.tsx b/components/agent/AgentTryPrompts.tsx index 26a1749c..ccaeb989 100644 --- a/components/agent/AgentTryPrompts.tsx +++ b/components/agent/AgentTryPrompts.tsx @@ -39,6 +39,13 @@ export function AgentTryPrompts({ locale, c }: { locale: string; c: AgentPageCon

{item.prompt}

{item.kind === 'paid' ?

{c.paidNote}

: null} + {item.hint ?

{item.hint}

: null} + {item.example ? ( +

+ {item.example.text}{' '} + {item.example.linkLabel} +

+ ) : null} ))} diff --git a/lib/agentPage.ts b/lib/agentPage.ts index 1db36edb..146f8c98 100644 --- a/lib/agentPage.ts +++ b/lib/agentPage.ts @@ -167,6 +167,10 @@ export type AgentPageContent = { readonly kind: 'free' | 'paid' | 'human'; readonly tag: string; readonly prompt: string; + /** 依頼文の下に出す補足 (継続用途など)。 */ + readonly hint?: string; + /** 実際に買った実績 1 件 (時点と当時の価格を明記・tx リンクで検証できる)。 */ + readonly example?: { readonly text: string; readonly linkLabel: string; readonly href: string }; }[]; }; readonly next: { @@ -195,7 +199,7 @@ const ja: AgentPageContent = { subtitle: 'ウォレットも秘密鍵も、OpenPay は預かりません。', connect: { title: 'Agent を接続', - lead: 'このプロンプトを Agent に渡すだけ。セットアップは Agent が進めます。', + lead: 'このプロンプトを Agent に渡すだけ。セットアップは Agent が進めます。支払いは、専用ウォレットに入金してからです。', copy: 'セットアッププロンプトをコピー', copied: 'コピーしました', openIn: 'またはアプリで開く', @@ -370,7 +374,16 @@ const ja: AgentPageContent = { paidNote: '依頼文の上限を超える支払いは行われません。Agent 側の上限のほうが小さいときは、支払いは拒否されます。', items: [ { id: 'catalog', kind: 'free', tag: '無料', prompt: 'OpenPay で今買える JPYC のデータと API を一覧にして、それぞれの価格と利用料を教えてください。支払いはしないでください。' }, - { id: 'buy-monitor', kind: 'paid', tag: '支払いあり・3 JPYC', prompt: 'JPYC Service Monitor を上限 3 JPYC で購入して、この 1 か月に変わった点を 5 行にまとめてください。' }, + { + id: 'buy-monitor', kind: 'paid', tag: '支払いあり・3 JPYC', + prompt: 'JPYC Service Monitor を上限 3 JPYC で購入して、この 1 か月に変わった点を 5 行にまとめてください。', + hint: '前回以降の差分だけを取れるので、毎週の確認にも使えます。買う前に、無料の更新日チェックで変更があったかを確かめられます。', + example: { + text: '実績: 2026-09-22 に Agent が 3 JPYC (当時の価格) で購入。返ってきたのは、日付と一次ソース URL つきの変更一覧。', + linkLabel: '取引を見る', + href: 'https://polygonscan.com/tx/0x50d58a1b10572c96ca2bed71983b1235a7957e0b61ac71bed2303323afd579c4', + }, + }, { id: 'order', kind: 'human', tag: '支払いは自分で', prompt: 'JPYC で注文できる店を探して、メニューと合計額を見せてください。支払いは私がします。' }, { id: 'history', kind: 'free', tag: '無料', prompt: '最近なにを買ったか、金額と取引ハッシュつきで見せてください。' }, { id: 'limits', kind: 'free', tag: '無料', prompt: 'いまの支払い上限と、今日使った額を教えてください。' }, @@ -395,7 +408,7 @@ const en: AgentPageContent = { subtitle: 'OpenPay never holds your wallet or your private key.', connect: { title: 'Connect your agent', - lead: 'Hand this prompt to your agent. It does the setup itself.', + lead: 'Hand this prompt to your agent. It does the setup itself. Payments start once you fund the agent’s wallet.', copy: 'Copy setup prompt', copied: 'Copied', openIn: 'Or open in', @@ -570,7 +583,16 @@ const en: AgentPageContent = { paidNote: 'Nothing above the cap in the prompt is paid. If the limit on the agent side is lower, the payment is refused.', items: [ { id: 'catalog', kind: 'free', tag: 'Free', prompt: 'List the JPYC data and APIs I can buy on OpenPay right now, with the price and fee for each. Do not pay.' }, - { id: 'buy-monitor', kind: 'paid', tag: 'Pays · 3 JPYC', prompt: 'Buy the JPYC Service Monitor with a 3 JPYC cap and summarize what changed in the last month in five lines.' }, + { + id: 'buy-monitor', kind: 'paid', tag: 'Pays · 3 JPYC', + prompt: 'Buy the JPYC Service Monitor with a 3 JPYC cap and summarize what changed in the last month in five lines.', + hint: 'It can return only what changed since your last check, so it also works as a weekly routine. A free freshness check tells you whether anything changed before you buy.', + example: { + text: 'Real run: on 2026-09-22 an agent bought it for 3 JPYC (price at the time) and got back the dated change list with source URLs.', + linkLabel: 'View the transaction', + href: 'https://polygonscan.com/tx/0x50d58a1b10572c96ca2bed71983b1235a7957e0b61ac71bed2303323afd579c4', + }, + }, { id: 'order', kind: 'human', tag: 'You pay yourself', prompt: 'Find shops where I can order with JPYC and show me the menu and the total. I will pay myself.' }, { id: 'history', kind: 'free', tag: 'Free', prompt: 'Show me what you bought recently, with amounts and transaction hashes.' }, { id: 'limits', kind: 'free', tag: 'Free', prompt: 'Tell me my current spending limits and how much I have spent today.' }, diff --git a/tests/lib/agentPage.test.ts b/tests/lib/agentPage.test.ts index bad3dddb..00647e01 100644 --- a/tests/lib/agentPage.test.ts +++ b/tests/lib/agentPage.test.ts @@ -29,6 +29,16 @@ describe('agent page content', () => { expect(item.prompt).toMatch(locale === 'ja' ? /上限 \d+(?:\.\d+)? JPYC/ : /\d+(?:\.\d+)? JPYC cap/); } }); + it.each(['ja', 'en'])('shows one verifiable purchase example on the paid prompt in %s', (locale) => { + const item = agentPageContentFor(locale).tryPrompts.items.find((item) => item.id === 'buy-monitor'); + // 実績は日付と当時の価格を明記し、Polygonscan の tx で誰でも検証できる形に固定する。 + expect(item?.example?.href).toMatch(/^https:\/\/polygonscan\.com\/tx\/0x[0-9a-f]{64}$/); + expect(item?.example?.text).toMatch(/2026-09-22/); + expect(item?.hint?.trim().length).toBeGreaterThan(0); + for (const other of agentPageContentFor(locale).tryPrompts.items.filter((other) => other.id !== 'buy-monitor')) { + expect(other.example).toBeUndefined(); + } + }); it.each(['ja', 'en'])('keeps the monitor prompt and tag total aligned with the price and disclosed fee in %s', (locale) => { // /api/paid/jpyc/services が handleFirstPartyPaidGet に渡す価格 SoT を直接参照する。 // 実装 (lib/x402/fee.ts) と同じ atomic の整数演算。Number だと小数価格で 0.3 + 1 = 1.2999… の偽 fail になる。