Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .env.sample

This file was deleted.

37 changes: 17 additions & 20 deletions .github/workflows/note.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 || '';
Expand All @@ -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

Expand Down Expand Up @@ -591,8 +586,10 @@ jobs:
page.setDefaultTimeout(180000);

await page.goto(START_URL, { waitUntil: 'domcontentloaded' });
await page.waitForSelector('textarea[placeholder*="タイトル"]');
await page.fill('textarea[placeholder*="タイトル"]', TITLE);
const html = await page.content();
console.log(html);
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' });
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ note-state.json

# Node.js
node_modules/

# 環境変数
.env