From e3bb8be7c21601f88ebb721af473329551a9d88d Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sat, 25 Oct 2025 10:43:54 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.sample | 4 ---- .gitignore | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 .env.sample diff --git a/.env.sample b/.env.sample deleted file mode 100644 index feb34c3..0000000 --- a/.env.sample +++ /dev/null @@ -1,4 +0,0 @@ -ANTHROPIC_API_KEY -TAVILY_API_KEY -NOTE_STORAGE_STATE_JSON -PERPLEXITY_API_KEY diff --git a/.gitignore b/.gitignore index df9ce98..1ab6cf5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ note-state.json # Node.js node_modules/ + +# 環境変数 +.env From c63b3fdeb70ee3db7924766a255ddf7688bec806 Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sat, 25 Oct 2025 11:56:49 +0900 Subject: [PATCH 2/6] =?UTF-8?q?yaml=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/note.yaml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/note.yaml b/.github/workflows/note.yaml index ddddc82..155f909 100644 --- a/.github/workflows/note.yaml +++ b/.github/workflows/note.yaml @@ -66,15 +66,16 @@ jobs: with: node-version: '20' - - name: Install Claude Code SDK + - name: Install AI SDK run: | npm init -y - npm i @anthropic-ai/claude-code + npm i ai @ai-sdk/anthropic - - name: Research with Claude Code SDK + - name: Research with AI SDK run: | cat > research.mjs <<'EOF' - import { query } from '@anthropic-ai/claude-code'; + import { generateText } from 'ai'; + import { anthropic } from '@ai-sdk/anthropic'; import fs from 'fs'; const theme = process.env.THEME || ''; const target = process.env.TARGET || ''; @@ -85,23 +86,17 @@ jobs: 'あなたは最新情報の収集と要約に特化した超一流のリサーチャーです。', '事実ベース・一次情報優先・本文内にMarkdownリンクで出典を埋め込むこと。', '十分な分量(目安: 2,000語以上)。各節で出典を本文に埋め込む。', - 'WebSearch と WebFetch を必ず使用し、一次情報(公的機関・規格・論文・公式)を優先する。', + 'WebSearch と WebFetch を利用して、一次情報(公的機関・規格・論文・公式)を優先する。', ].join('\n'); const userPrompt = `以下のテーマとターゲットに対する最終版のリサーチレポートを作成してください。\n【重要】途中経過や確認質問は一切せず、最終レポートのみを返してください。不明点がある場合は「前提と仮定」セクションで簡潔に仮定を明記してから続行してください。事実ベースで一次情報を最優先し、本文にMarkdownリンクで出典を埋め込んでください。\n---\nテーマ: ${theme}\nターゲット: ${target}\n現在日付: ${today}`; - const messages = []; - for await (const msg of query({ + const { text } = await generateText({ + model: anthropic('claude-sonnet-4-5-20250929'), + system: sys, prompt: userPrompt, - options: { - customSystemPrompt: sys, - allowedTools: ['WebSearch','WebFetch'], - permissionMode: 'acceptEdits', - }, - })) { messages.push(msg); } - const assistantTexts = messages.filter(m=>m.type==='assistant').map(m=>{ - const c=m.message?.content; if(Array.isArray(c)){return c.filter(b=>b?.type==='text').map(b=>b.text).join('\n');} return ''; - }).filter(Boolean).join('\n\n'); - fs.writeFileSync(`${artifactsDir}/research.md`, assistantTexts || ''); - try { fs.writeFileSync(`${artifactsDir}/research_trace.json`, JSON.stringify(messages, null, 2)); } catch {} + temperature: 0.7, + maxTokens: 30000, + }); + fs.writeFileSync(`${artifactsDir}/research.md`, text || ''); EOF node research.mjs From 346c5986bf0e2a8e20324c7aac184fb7f6e81288 Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sat, 25 Oct 2025 12:03:03 +0900 Subject: [PATCH 3/6] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81=E3=81=AE=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/note.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/note.yaml b/.github/workflows/note.yaml index 155f909..cd7f971 100644 --- a/.github/workflows/note.yaml +++ b/.github/workflows/note.yaml @@ -2,6 +2,8 @@ name: Note Workflow on: workflow_dispatch: + branches: + - develop inputs: theme: description: '記事テーマ' From 0a6758992419a032bf9e7e273f6560b4e26f353e Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sat, 25 Oct 2025 12:11:34 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/note.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/note.yaml b/.github/workflows/note.yaml index cd7f971..155f909 100644 --- a/.github/workflows/note.yaml +++ b/.github/workflows/note.yaml @@ -2,8 +2,6 @@ name: Note Workflow on: workflow_dispatch: - branches: - - develop inputs: theme: description: '記事テーマ' From f86dc74bf85083f3e82fae2bf5e2da95dcddb478 Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sun, 26 Oct 2025 10:41:59 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E9=83=A8=E5=88=86=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/note.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/note.yaml b/.github/workflows/note.yaml index 155f909..76313a3 100644 --- a/.github/workflows/note.yaml +++ b/.github/workflows/note.yaml @@ -586,8 +586,8 @@ jobs: page.setDefaultTimeout(180000); await page.goto(START_URL, { waitUntil: 'domcontentloaded' }); - await page.waitForSelector('textarea[placeholder*="タイトル"]'); - await page.fill('textarea[placeholder*="タイトル"]', TITLE); + await page.waitForSelector('textarea[placeholder*="記事タイトル"]'); + await page.fill('textarea[placeholder*="記事タイトル"]', TITLE); const bodyBox = page.locator('div[contenteditable="true"][role="textbox"]').first(); await bodyBox.waitFor({ state: 'visible' }); From 511004a209515f4e3f58af9b4ed07652ddc0f7d4 Mon Sep 17 00:00:00 2001 From: Ryusei0216 <86142665+Ryusei0216@users.noreply.github.com> Date: Sun, 26 Oct 2025 14:32:58 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E3=83=AD=E3=82=B0=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E6=8C=BF=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/note.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/note.yaml b/.github/workflows/note.yaml index 76313a3..966ed02 100644 --- a/.github/workflows/note.yaml +++ b/.github/workflows/note.yaml @@ -586,6 +586,8 @@ jobs: page.setDefaultTimeout(180000); await page.goto(START_URL, { waitUntil: 'domcontentloaded' }); + const html = await page.content(); + console.log(html); await page.waitForSelector('textarea[placeholder*="記事タイトル"]'); await page.fill('textarea[placeholder*="記事タイトル"]', TITLE);