From 720b3617d05474fade1cb08d9a0a51b2ec5f23a7 Mon Sep 17 00:00:00 2001 From: hiroki ito Date: Fri, 17 Apr 2026 21:58:37 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20AI=E3=83=8B=E3=83=A5=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E5=8F=8E=E9=9B=86=E3=83=BB=E5=88=86=E6=9E=90?= =?UTF-8?q?=E3=83=84=E3=83=BC=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- .env.example | 20 + .github/workflows/daily-news.yml | 59 + .gitignore | 4 + .nvmrc | 1 + CLAUDE.md | 61 + README.md | 317 ++++ docs/troubleshooting.md | 50 + fixtures/sample-tweets.json | 182 ++ package-lock.json | 2520 +++++++++++++++++++++++++++ package.json | 27 + src/analysis/analyze.test.ts | 87 + src/analysis/analyze.ts | 80 + src/analysis/prompts.ts | 33 + src/analysis/schema.test.ts | 98 ++ src/analysis/schema.ts | 21 + src/analysis/url-summarizer.test.ts | 84 + src/analysis/url-summarizer.ts | 77 + src/config.test.ts | 109 ++ src/config.ts | 58 + src/delivery/slack.test.ts | 82 + src/delivery/slack.ts | 84 + src/main.ts | 53 + src/settings.ts | 37 + src/sources/url-content.test.ts | 129 ++ src/sources/url-content.ts | 96 + src/sources/x-timeline.test.ts | 32 + src/sources/x-timeline.ts | 118 ++ src/types.ts | 11 + src/utils/chunk.ts | 7 + src/utils/errors.test.ts | 22 + src/utils/errors.ts | 6 + src/utils/post-optimizer.test.ts | 102 ++ src/utils/post-optimizer.ts | 67 + tsconfig.json | 14 + vitest.config.ts | 8 + 35 files changed, 4756 insertions(+) create mode 100644 .env.example create mode 100644 .github/workflows/daily-news.yml create mode 100644 .gitignore create mode 100644 .nvmrc create mode 100644 CLAUDE.md create mode 100644 README.md create mode 100644 docs/troubleshooting.md create mode 100644 fixtures/sample-tweets.json create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/analysis/analyze.test.ts create mode 100644 src/analysis/analyze.ts create mode 100644 src/analysis/prompts.ts create mode 100644 src/analysis/schema.test.ts create mode 100644 src/analysis/schema.ts create mode 100644 src/analysis/url-summarizer.test.ts create mode 100644 src/analysis/url-summarizer.ts create mode 100644 src/config.test.ts create mode 100644 src/config.ts create mode 100644 src/delivery/slack.test.ts create mode 100644 src/delivery/slack.ts create mode 100644 src/main.ts create mode 100644 src/settings.ts create mode 100644 src/sources/url-content.test.ts create mode 100644 src/sources/url-content.ts create mode 100644 src/sources/x-timeline.test.ts create mode 100644 src/sources/x-timeline.ts create mode 100644 src/types.ts create mode 100644 src/utils/chunk.ts create mode 100644 src/utils/errors.test.ts create mode 100644 src/utils/errors.ts create mode 100644 src/utils/post-optimizer.test.ts create mode 100644 src/utils/post-optimizer.ts create mode 100644 tsconfig.json create mode 100644 vitest.config.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c2e68a6 --- /dev/null +++ b/.env.example @@ -0,0 +1,20 @@ +# X API (OAuth 1.0a user context) — console.x.com のアプリから取得 +# 「キーとトークン」タブ → 「コンシューマーキー」セクション +X_CONSUMER_KEY= +X_CONSUMER_SECRET= +# 「キーとトークン」タブ → 「OAuth 1.0 キー」セクション → アクセストークンを生成 +X_ACCESS_TOKEN= +X_ACCESS_TOKEN_SECRET= + +# Jina Reader — jina.ai のダッシュボードから取得 +JINA_API_KEY= + +# Gemini — aistudio.google.com から取得 +GEMINI_API_KEY= + +# Slack — api.slack.com の Bot アプリから取得 +SLACK_BOT_TOKEN= +SLACK_CHANNEL= + +# モックルート(true にすると X API を使わず fixtures/sample-tweets.json を読む) +USE_SAMPLE_DATA=false diff --git a/.github/workflows/daily-news.yml b/.github/workflows/daily-news.yml new file mode 100644 index 0000000..9642cb3 --- /dev/null +++ b/.github/workflows/daily-news.yml @@ -0,0 +1,59 @@ +name: Daily AI News + +on: + workflow_dispatch: + inputs: + use_sample_data: + description: 'fixtures/sample-tweets.json を使って動作確認する(X連携なし)' + type: boolean + default: false + schedule: + - cron: '30 22 * * *' # 毎日 07:30 JST + +permissions: + contents: read + +concurrency: + group: daily-news + cancel-in-progress: false + +jobs: + run: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v5 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - run: npm ci + + - run: npm start + env: + USE_SAMPLE_DATA: ${{ inputs.use_sample_data }} + X_CONSUMER_KEY: ${{ secrets.X_CONSUMER_KEY }} + X_CONSUMER_SECRET: ${{ secrets.X_CONSUMER_SECRET }} + X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }} + X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }} + JINA_API_KEY: ${{ secrets.JINA_API_KEY }} + GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} + + - name: Notify failure to Slack + if: failure() + run: | + curl -X POST "https://slack.com/api/chat.postMessage" \ + -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "channel": "'"${SLACK_CHANNEL}"'", + "text": ":x: *AIニュース エラー発生*\nワークフロー実行: <'"${FAILED_RUN_URL}"'|詳細を確認>" + }' + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} + FAILED_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dafa699 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +.env +.env.local diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4bf803d --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,61 @@ +# AIニュース + +Xのホームタイムラインから24時間以内のAI関連ニュースを収集し、Geminiで分析してSlackに投稿する自動配信ツール。 + +## プロジェクト構造 + +``` +src/ +├── main.ts # エントリポイント(最初にここを読む) +├── settings.ts # 受講生が触る全設定(TS定数) +├── config.ts # 環境変数の zod 検証 +├── types.ts # 共通型定義 +├── sources/ +│ ├── x-timeline.ts # X API タイムライン取得 + モックルート分岐 +│ └── url-content.ts # Jina Reader で URL 本文並列取得 +├── analysis/ +│ ├── url-summarizer.ts # Gemini Flash で各URL要約 +│ ├── analyze.ts # Gemini Pro で最終トレンド分析 +│ ├── schema.ts # zod スキーマ(SSoT) +│ └── prompts.ts # プロンプト2つ +├── delivery/ +│ └── slack.ts # Block Kit 組み立て + Slack投稿 +└── utils/ + ├── chunk.ts # 配列チャンク分割 + ├── errors.ts # UserFacingError + assertSlackOk + └── post-optimizer.ts # URL抽出・t.co展開・テキスト整形 +``` + +## 実行方法 + +```bash +npm start # 通常実行 +USE_SAMPLE_DATA=true npm start # モックルート(X API 不要) +``` + +## 読む順番 + +1. `src/main.ts` — 4ステップの全体像 +2. `src/sources/x-timeline.ts` — ソース元 +3. `src/analysis/analyze.ts` — 処理 +4. `src/delivery/slack.ts` — 届ける先 +5. `src/settings.ts` — 設定を変えたいとき + +## GitHub Secrets + +| シークレット名 | 用途 | +|---|---| +| `X_CONSUMER_KEY` | X OAuth 1.0a consumer key(console.x.com 「コンシューマーキー」の API Key) | +| `X_CONSUMER_SECRET` | X OAuth 1.0a consumer secret(同 API Key Secret) | +| `X_ACCESS_TOKEN` | X OAuth 1.0a access token(console.x.com 「OAuth 1.0 キー」のアクセストークン) | +| `X_ACCESS_TOKEN_SECRET` | X OAuth 1.0a access token secret(同 アクセストークンシークレット) | +| `JINA_API_KEY` | Jina Reader | +| `GEMINI_API_KEY` | Gemini Flash + Pro | +| `SLACK_BOT_TOKEN` | Slack Bot(`chat:write` スコープ) | +| `SLACK_CHANNEL` | 投稿先チャンネルID | + +## 禁止事項 + +- curl で直接 Slack API / X API を叩かない +- `src/settings.ts` 以外のファイルで設定値をハードコードしない +- 受講生に見せたいエラー文言は `UserFacingError` の `message` に入れる(`main.ts` が `[USER-FACING]` プレフィックス付きで出力する)。`throw new Error(...)` だけだと `[INTERNAL]` 扱いになり、受講生が混乱する diff --git a/README.md b/README.md new file mode 100644 index 0000000..19a90f8 --- /dev/null +++ b/README.md @@ -0,0 +1,317 @@ +# AIニュース + +Xのタイムラインから24時間以内のAI関連ニュースを自動収集し、Geminiで分析してSlackに投稿するツールです。 + +``` +┌──────────────────────────────────────────────────────────┐ +│ 🤖 24時間以内のAIトレンド │ +│ │ +│ 🔥 主要なニュース・話題 │ +│ ────────────────────────────── │ +│ GPT-5.5が発表、ネイティブtool useに対応 │ +│ - エージェント時代の到来を示す大型アップデート │ +│ - 複数のMCPサーバーを同時接続して自動実行が可能に │ +│ │ +│ ⚡️ 注目のアップデート │ +│ ────────────────────────────── │ +│ Cursor Background Agent — 寝ている間にPRを作成 │ +│ - コードレビューコメントまで自動付与 │ +│ │ +│ 💡 技術トレンド │ +│ ────────────────────────────── │ +│ テスト時計算量スケーリングへのパラダイムシフト │ +│ - より大きなモデルからよりスマートな推論へ │ +│ │ +│ AIニュースで自動生成 │ +└──────────────────────────────────────────────────────────┘ +``` + +Slackにはこのようなニュース分析レポートが毎朝届きます。 + +--- + +## 全体像 + +``` +┌─────────────┐ +│ トリガー │ GitHub Actions +│ (いつ動く) │ → 毎朝 07:30 JST(定期実行を有効化した場合) +└──────┬──────┘ + ▼ +┌─────────────┐ +│ ソース元 │ X(旧Twitter) +│ (データ) │ → ホームタイムラインから24時間以内のツイートを取得 +└──────┬──────┘ + ▼ +┌─────────────┐ +│ 処理する場所 │ GitHub Actions 上の Node.js +│ (加工) │ → Gemini でトレンド分析し、構造化JSONに変換 +└──────┬──────┘ + ▼ +┌─────────────┐ +│ 届ける先 │ Slack +│ (配信) │ → チャンネルにニュース分析レポートを投稿 +└─────────────┘ +``` + +--- + +## 料金について + +| サービス | 料金 | +|---|---| +| GitHub Actions | 毎月2,000分無料(実行は数分で完了) | +| X API(pay-per-use) | Post Read $0.005/件。500件/日×30日 = **約$75/月**。100件/日なら約$15/月 | +| Jina Reader | 無料枠あり(1Mトークン、使い切り型) | +| Gemini(Flash + Pro) | 無料枠で完結(1日1回の実行なら超過しない) | +| Slack | 無料ワークスペースで可 | + +X API 以外は全て無料枠で動きます。X API のコストを抑えたい場合は `src/settings.ts` の `maxTweets` を 100〜200 に下げてください。 + +> Jina Reader の無料1Mトークンは**アカウントに対する一括付与で、月次リセットされません**。枯渇してもツール自体は壊れず、ツイート本文だけで分析を続行します。 + +--- + +## セットアップ + +### 準備するもの + +- **GitHub アカウント** +- **Slack ワークスペース**(無料プランで可) +- **Google アカウント**(Gemini API キー取得用) +- **Jina AI アカウント**(無料登録) + +> このツールは GitHub Actions が全自動で実行します。あなたの PC で `npm install` を実行する必要はありません。 + +### Part A: ツール本体を GitHub に置く + +1. https://github.com/new にアクセス +2. **Repository name** に `ai-news` と入力 +3. **Private** を選択(APIキーの設定を含むため、**必ず Private** にしてください) +4. 「Add a README file」のチェックは**外したまま**にする +5. 「Create repository」をクリック + +Cursor で AI に以下のように依頼してください: + +> 「このコードを GitHub にpushして。リポジトリは `あなたのユーザー名/ai-news` です」 + +### Part B: Slack App を作成する + +1. https://api.slack.com/apps にアクセスし「Create New App」をクリック +2. 「From scratch」を選択し、アプリ名(例: AIニュース)とワークスペースを設定 +3. 左メニュー「OAuth & Permissions」→ Bot Token Scopes に **`chat:write`** を追加 +4. 「Install to Workspace」→ 許可する +5. 表示される **Bot User OAuth Token**(`xoxb-` で始まる)をコピー +6. レポートを投稿したいチャンネルにボットを追加(チャンネル設定 → インテグレーション → アプリを追加) +7. チャンネルの **チャンネルID** を確認(チャンネル名を右クリック → チャンネル詳細 → 最下部に表示) + +GitHub Secrets に登録: +- `SLACK_BOT_TOKEN` — Bot User OAuth Token(`xoxb-...`) +- `SLACK_CHANNEL` — チャンネルID(`C...`) + +### Part C: Gemini API キーを取得する + +1. https://aistudio.google.com/apikey にアクセス +2. 「Create API Key」をクリック +3. 表示されたキーをコピー + +GitHub Secrets に登録: +- `GEMINI_API_KEY` — コピーしたキー + +> 無料枠で動きます。クレジットカードの登録は不要です。 + +### Part D: Jina API キーを取得する + +1. https://jina.ai にアクセスし、アカウントを作成(またはログイン) +2. ダッシュボードで API キーを確認 + +GitHub Secrets に登録: +- `JINA_API_KEY` — コピーしたキー + +> 無料枠(1Mトークン)で動きます。個人の学習・ニュース収集用途なら問題ありません。業務利用する場合は Paid プラン(jina.ai/pricing)への移行が必要です。 + +### Part E: モックルートで初回実行 + +X API の設定なしで動作確認できます。 + +1. リポジトリの「**Actions**」タブを開く +2. **左サイドバー**から「**Daily AI News**」をクリック +3. 「**Run workflow**」ボタンをクリック +4. **use_sample_data** にチェックを入れる +5. 緑の「**Run workflow**」ボタンをクリック + +数分後、Slack にサンプルデータによる分析レポートが届きます。 + +> ここまでで「Gemini による分析 → Slack 投稿」の流れが確認できました。以降は本番の X 連携に進みます。 + +--- + +### Part F: X Developer アプリを作成する + +**このツールで一番大変なステップです。** ここを越えれば、あとは動かすだけです。 + +#### 2026年の X API 料金体系 + +2026年2月以降、X API は **pay-per-use**(従量課金)型に移行しました。以前の月額 $200 の Basic プランは新規受付を停止しています。 + +- **初期費用なし**。クレジットカードを登録して、使った分だけ請求される仕組みです +- Post Read(ツイート取得)は 1件あたり $0.005 + +#### 手順 + +1. [console.x.com](https://console.x.com/) にアクセスし、自分の X アカウントでログイン +2. 開発者規約が表示されたら内容を確認して同意 +3. 左メニューの「クレジット」→「クレジットを購入」で最低 $5 をチャージ +4. プロジェクト名を入力(例: `ai-news`)し、ユースケースを選択 +5. アプリケーション名を入力(例: `ai-news-2026`。世界中で一意の名前が必要) + +アプリ情報の入力例(Use case の Description): + +> Personal project to collect AI-related tweets from my timeline and summarize them using Gemini API. The summaries are posted to my private Slack workspace for personal news curation. Non-commercial, personal use only. + +6. 左メニュー「アプリ」→ 作成したアプリを開き、**User authentication settings(ユーザー認証設定)** を入力: + - **アプリの権限**: 「読む」を選択(タイムライン取得だけなので読み取り専用で十分) + - **アプリの種類**: 「ウェブアプリ、自動化アプリまたはボット」を選択 + - **コールバックURI / リダイレクトURL(必須)**: `https://example.com`(このツールでは使わないが空にできない) + - **ウェブサイトURL(必須)**: `https://example.com` + - 「変更を保存する」をクリック + +7. 「**キーとトークン**」タブを開く。このタブには4つのセクションが並んでいるが、**このツールで使うのは2つだけ**。 + + ``` + ┌─ 使う(2つ)─────────────────────────────────────┐ + │ コンシューマーキー │ + │ → API Key / API Key Secret │ + │ OAuth 1.0 キー │ + │ → アクセストークン / アクセストークンシークレット │ + └──────────────────────────────────────────────────┘ + ┌─ 使わない(触らなくてよい)─────────────────────────┐ + │ ベアラートークン │ + │ OAuth 2.0 クライアントID・シークレット │ + └──────────────────────────────────────────────────┘ + ``` + + - **「コンシューマーキー」** セクションの「再生成」をクリック → **API Key** と **API Key Secret** を即メモ + - **「OAuth 1.0 キー」** セクションの「アクセストークン」の「生成する」をクリック → **Access Token** と **Access Token Secret** を即メモ + +> どちらも画面を閉じるとキーは二度と表示されません。必ず全4つをコピーしてから次に進んでください。 + +GitHub Secrets に登録: +- `X_CONSUMER_KEY` — 「コンシューマーキー」の API Key +- `X_CONSUMER_SECRET` — 「コンシューマーキー」の API Key Secret +- `X_ACCESS_TOKEN` — 「OAuth 1.0 キー」のアクセストークン +- `X_ACCESS_TOKEN_SECRET` — 「OAuth 1.0 キー」のアクセストークンシークレット + +> 申請が通らない場合や時間がかかる場合は、Part E のモックルートで開発・カスタマイズを進めてください。X 連携は後からいつでも有効にできます。 + +### Part G: 本番ルートで実行 + +1. リポジトリの「**Actions**」タブを開く +2. 「**Daily AI News**」→「**Run workflow**」 +3. **use_sample_data のチェックは外したまま**実行 +4. Slack に自分のタイムラインからの本物のニュース分析が届く + +### チェックポイント + +- [ ] Slack に AI トレンド分析レポートが届いた +- [ ] レポートに自分がフォローしているアカウントの情報が含まれている + +--- + +## 定期実行を有効にする + +`.github/workflows/daily-news.yml` の `schedule` ブロック(2行)のコメントを外す: + +変更前: +```yaml + # schedule: + # - cron: '30 22 * * *' # 毎日 07:30 JST +``` + +変更後: +```yaml + schedule: + - cron: '30 22 * * *' # 毎日 07:30 JST +``` + +先頭のスペース(インデント)はそのまま残してください。時刻は UTC で指定します。 + +--- + +## テストで動作確認 + +ツールの核心ロジックが正しく動いているか、テストで確認できます。 + +```bash +npm test +``` + +全てのテストが通れば、ツールのロジックは正常です。 + +設定を変更した後(`src/settings.ts` や `src/analysis/prompts.ts` を編集した後)は、`npm test` を走らせて変更が壊れていないことを確認してください。 + +--- + +## カスタマイズ + +設定は `src/settings.ts` に集約されています。 + +### レシピ 1: 分析カテゴリを変える + +`src/analysis/schema.ts` の `tech_trends` を `design_trends` にリネームし、`src/analysis/prompts.ts` のプロンプトも合わせて変更すると、デザイン系トレンドの分析ツールになります。 + +### レシピ 2: 特定キーワードだけ分析する + +`src/sources/x-timeline.ts` の取得後に以下のフィルタを挿入: + +```ts +const filtered = tweets.filter(t => /GPT|Claude|Gemini/i.test(t.text)); +``` + +### レシピ 3: 複数チャンネルに分けて投稿 + +`src/delivery/slack.ts` で `main_news` は `#ai-news`、`tech_trends` は `#ai-tech` のように section ごとにチャンネルを分けられます。 + +--- + +## 応用例 + +4パーツの一部を差し替えると、まったく別のツールになります。 + +- **ソース元を RSS に差し替える** → 毎朝のニュース要約ツール +- **処理を感情分析に差し替える** → 競合の口コミ見張り番 +- **届ける先を Notion に差し替える** → 毎朝の社内ニュースDB + +--- + +## セキュリティ + +- **リポジトリは Private に**: API キーを GitHub Secrets に保存しているため、公開リポジトリにしないでください +- **Slack Bot Token**: Bot Token Scopes は `chat:write` のみに制限してください +- **トークンが漏洩した場合**: + - X: console.x.com → アプリ → キーとトークン → 該当セクションの「再生成」で即時失効 + - Gemini: aistudio.google.com でキーを削除して再発行 + - Slack: api.slack.com でトークンをローテーション + +--- + +## 困ったとき + +1. **まず AI に聞く**: Cursor で「セットアップで〇〇のエラーが出ました」と伝えてください +2. **GitHub Actions のログを確認**: Actions タブ → 失敗したジョブ → `[USER-FACING]` の行を読む +3. **エラー別の対処法**: [docs/troubleshooting.md](docs/troubleshooting.md) に主要なエラーと対処法をまとめています +4. **Slack で相談**: ADS Slack の質問チャンネルに投稿してください + +--- + +## 技術スタック + +| 項目 | 選定 | 理由 | +|---|---|---| +| 実行基盤 | GitHub Actions | 無料枠で十分、セットアップが簡単 | +| 言語 | TypeScript(Node.js 22) | X API公式SDKがTS対応、型安全 | +| X API | twitter-api-v2 | OAuth 1.0a対応のデファクト | +| URL本文取得 | Jina Reader | LLM最適化されたMarkdown化 | +| AI(URL要約) | Gemini 2.5 Flash | 大量処理に適した軽量モデル | +| AI(最終分析) | Gemini 2.5 Pro | 高品質な構造化出力 | +| 通知 | Slack API(Block Kit) | 構造化された見やすいレポート | diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 0000000..42ff8d7 --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,50 @@ +# 困ったとき + +## GitHub Actions のログの読み方 + +1. リポジトリの **Actions** タブを開く +2. 実行したワークフローをクリック +3. **run** ジョブをクリックして各ステップを展開 +4. `[USER-FACING]` で始まる行を最優先で読む — 次に何をすべきかが書いてある +5. `[INTERNAL]` で始まる行は開発者向けの詳細情報 + +--- + +## エラー別の対処法 + +### X API + +| 症状 | 原因 | 対処 | +|---|---|---| +| `401 Unauthorized` | 4つのキーのいずれかが間違っているか期限切れ | console.x.com → アプリ → キーとトークン → 「OAuth 1.0 キー」のアクセストークンを再生成し、GitHub Secrets を更新 | +| `429 Too Many Requests` | レート制限に到達 | 15分待機してから再実行。`src/settings.ts` の `maxTweets` を下げる | +| X API が使えない / 申請が通らない | pay-per-use の Billing 未設定、または申請待ち | X Developer Portal → Billing → Add payment method。申請中は `USE_SAMPLE_DATA=true` のモックルートで動作確認 | + +### Jina Reader + +| 症状 | 原因 | 対処 | +|---|---|---| +| `402 Payment Required` | 1Mトークンの無料枠が枯渇 | **自動フォールバック済み**のため配布物は壊れない。長期利用なら Paid プラン (jina.ai/pricing) へ、または `src/settings.ts` の `urlContent.enabled` を `false` に | + +### Gemini + +| 症状 | 原因 | 対処 | +|---|---|---| +| `400 API key not valid` | APIキーの誤り | aistudio.google.com で再発行し、GitHub Secrets の `GEMINI_API_KEY` を更新 | +| `429 Resource exhausted` | Free枠の1日上限超過(Flash 250/day, Pro 100/day) | 明日まで待つ。手動実行は1日1〜2回に抑える | +| `SAFETY filter` | ツイート内容がセーフティフィルタに抵触 | `maxTweets` を減らす。タイムラインのフォロー先を見直す | + +### Slack + +| 症状 | 原因 | 対処 | +|---|---|---| +| `channel_not_found` | `SLACK_CHANNEL` のIDが間違っている | Slackでチャンネルを右クリック → チャンネル詳細 → 最下部のID(`C`で始まる文字列)をコピーし直す | +| `not_in_channel` | BotアプリがチャンネルにいないBot | チャンネルで `/invite @あなたのBot名` を実行 | +| `not_authed` / `invalid_auth` | `SLACK_BOT_TOKEN` が間違っているか期限切れ | api.slack.com → アプリ → OAuth & Permissions → Bot User OAuth Token を再コピー | + +### その他 + +| 症状 | 原因 | 対処 | +|---|---|---| +| 成功扱い(緑)だが Slack に投稿がない | `maxTweets: 0` や `lookbackHours: 0` の誤設定 | `src/settings.ts` の値を確認 | +| Actions がずっと黄色(実行中) | Jina Reader の大量タイムアウト | `src/settings.ts` の `urlContent.parallelism` を `5` に下げる、または `urlContent.enabled` を `false` にして再実行 | diff --git a/fixtures/sample-tweets.json b/fixtures/sample-tweets.json new file mode 100644 index 0000000..93598d5 --- /dev/null +++ b/fixtures/sample-tweets.json @@ -0,0 +1,182 @@ +[ + { + "authorId": "OpenAI", + "text": "Introducing GPT-5.5 — our most capable model yet. Improved reasoning, faster response times, and native tool use. Available today in the API.", + "createdAt": "2026-04-16T22:00:00.000Z", + "url": "https://x.com/OpenAI/status/100000000000000001" + }, + { + "authorId": "AnthropicAI", + "text": "Claude Opus 4.7 is here. Extended thinking with thought signatures enables multi-step reasoning chains that persist across conversations.", + "createdAt": "2026-04-16T21:30:00.000Z", + "url": "https://x.com/AnthropicAI/status/100000000000000002" + }, + { + "authorId": "GoogleDeepMind", + "text": "Gemini 3.1 Pro achieves state-of-the-art on mathematical reasoning benchmarks with our new thinking_level parameter.", + "createdAt": "2026-04-16T20:15:00.000Z", + "url": "https://x.com/GoogleDeepMind/status/100000000000000003" + }, + { + "authorId": "kaborosu", + "text": "GPT-5.5のtool useがやばい。MCPサーバー3つ同時に繋いで、指示一発で調査→コード生成→テスト実行まで全自動で回った。エージェント時代が本当に来た。", + "createdAt": "2026-04-16T23:00:00.000Z", + "url": "https://x.com/kaborosu/status/100000000000000004" + }, + { + "authorId": "ai_database", + "text": "速報: MicrosoftがGitHub Copilot Workspaceを全ユーザーに無料開放。リポジトリ単位でエージェントが動き、Issue→PR→マージまで自動化。", + "createdAt": "2026-04-16T19:00:00.000Z", + "url": "https://x.com/ai_database/status/100000000000000005" + }, + { + "authorId": "ylecun", + "text": "New paper from FAIR: 'World Models for Robotic Manipulation' — our approach achieves 94% success rate on unseen objects using learned physics priors.", + "createdAt": "2026-04-16T18:30:00.000Z", + "url": "https://x.com/ylecun/status/100000000000000006" + }, + { + "authorId": "sama", + "text": "We're releasing the OpenAI Agents SDK v2 today. Build production-grade agents with built-in memory, tool orchestration, and safety guardrails.", + "createdAt": "2026-04-16T17:00:00.000Z", + "url": "https://x.com/sama/status/100000000000000007" + }, + { + "authorId": "emaborai", + "text": "Cursorの新機能Background Agentを使ってみた。寝てる間にPR作ってレビューコメントまで付けてくれた。朝起きたらマージするだけ。生産性が次元変わる。", + "createdAt": "2026-04-16T22:30:00.000Z", + "url": "https://x.com/emaborai/status/100000000000000008" + }, + { + "authorId": "MetaAI", + "text": "Llama 4 Behemoth is now available. 2T parameter MoE with 256 experts. Open weights for research and commercial use.", + "createdAt": "2026-04-16T16:00:00.000Z", + "url": "https://x.com/MetaAI/status/100000000000000009" + }, + { + "authorId": "hardmaru", + "text": "The gap between open and closed models continues to shrink. Llama 4 Behemoth matches GPT-5 on most benchmarks. Exciting times for the open source community.", + "createdAt": "2026-04-16T16:30:00.000Z", + "url": "https://x.com/hardmaru/status/100000000000000010" + }, + { + "authorId": "ai_and_design", + "text": "Figma AIの新機能、コンポーネントの意味を理解してデザインシステムに沿った提案をしてくれる。デザイナーの仕事が設計判断に集中できるようになる。", + "createdAt": "2026-04-16T15:00:00.000Z", + "url": "https://x.com/ai_and_design/status/100000000000000011" + }, + { + "authorId": "StabilityAI", + "text": "Stable Diffusion 4 is here. Real-time generation at 60fps, native video support, and unprecedented prompt adherence. Try it now on stability.ai.", + "createdAt": "2026-04-16T14:00:00.000Z", + "url": "https://x.com/StabilityAI/status/100000000000000012" + }, + { + "authorId": "tech_and_future", + "text": "AI Agent同士が自律的に交渉してタスクを分担する研究が出た。マルチエージェント協調がいよいよ実用段階に入ってきている。", + "createdAt": "2026-04-16T13:00:00.000Z", + "url": "https://x.com/tech_and_future/status/100000000000000013" + }, + { + "authorId": "GoogleAI", + "text": "Announcing Gemini Nano 2 — on-device AI that runs entirely on your phone. No internet needed. Privacy-first design with 3B parameters.", + "createdAt": "2026-04-16T12:00:00.000Z", + "url": "https://x.com/GoogleAI/status/100000000000000014" + }, + { + "authorId": "aisafety_news", + "text": "EU AI Act enforcement begins today. Companies deploying high-risk AI systems must now demonstrate compliance with transparency and safety requirements.", + "createdAt": "2026-04-16T11:00:00.000Z", + "url": "https://x.com/aisafety_news/status/100000000000000015" + }, + { + "authorId": "kaggle", + "text": "New competition: $1M prize for building an AI system that can reliably detect AI-generated scientific papers. Submissions open until June 2026.", + "createdAt": "2026-04-16T10:00:00.000Z", + "url": "https://x.com/kaggle/status/100000000000000016" + }, + { + "authorId": "ai_business_jp", + "text": "日本のAIスタートアップの資金調達額が2025年比で3倍に。特にエンタープライズ向けRAGとエージェント基盤に投資が集中。", + "createdAt": "2026-04-16T09:00:00.000Z", + "url": "https://x.com/ai_business_jp/status/100000000000000017" + }, + { + "authorId": "nvidia", + "text": "Blackwell Ultra GPUs now shipping. 2x the inference performance of H200 at the same power. Built for the age of AI agents.", + "createdAt": "2026-04-16T08:00:00.000Z", + "url": "https://x.com/nvidia/status/100000000000000018" + }, + { + "authorId": "dev_tools_ai", + "text": "GitHub Actions now supports native AI agent steps. Define an agent in YAML, give it tools, and let it solve issues autonomously in your CI pipeline.", + "createdAt": "2026-04-16T07:00:00.000Z", + "url": "https://x.com/dev_tools_ai/status/100000000000000019" + }, + { + "authorId": "amasaki", + "text": "Claude Codeのスキル機能を使い始めて2週間。同じ作業を3回やったらスキルにする、というルールを徹底したら作業速度が5倍になった。", + "createdAt": "2026-04-16T22:45:00.000Z", + "url": "https://x.com/amasaki/status/100000000000000020" + }, + { + "authorId": "veraborai", + "text": "Vercel v0がついにフルスタック対応。フロントだけじゃなくAPIルートもDBスキーマも一発で生成してくれる。プロトタイピングの速度が異次元。", + "createdAt": "2026-04-16T21:00:00.000Z", + "url": "https://x.com/veraborai/status/100000000000000021" + }, + { + "authorId": "research_ml", + "text": "Interesting trend: more papers using 'test-time compute' scaling instead of pre-training scaling. The paradigm shift from bigger models to smarter inference is real.", + "createdAt": "2026-04-16T20:00:00.000Z", + "url": "https://x.com/research_ml/status/100000000000000022" + }, + { + "authorId": "aicoding_daily", + "text": "Cursor、Windsurf、Claude Code、GitHub Copilot Workspace。AIコーディングツールの選択肢が増えすぎて逆に迷う時代。結局はコンテキスト管理が上手いツールが勝つ。", + "createdAt": "2026-04-16T19:30:00.000Z", + "url": "https://x.com/aicoding_daily/status/100000000000000023" + }, + { + "authorId": "huggingface", + "text": "Introducing SmolAgent 2.0 — build agents in 10 lines of Python. Now with native MCP support and automatic tool discovery.", + "createdAt": "2026-04-16T18:00:00.000Z", + "url": "https://x.com/huggingface/status/100000000000000024" + }, + { + "authorId": "ai_regulation", + "text": "米国AIガバナンス法案が上院を通過。企業はAI利用の透明性レポートを四半期ごとに公開することが義務化される見込み。", + "createdAt": "2026-04-16T17:30:00.000Z", + "url": "https://x.com/ai_regulation/status/100000000000000025" + }, + { + "authorId": "robotics_ai", + "text": "Boston Dynamics Atlas now powered by Gemini. The robot can understand natural language instructions and plan multi-step physical tasks autonomously.", + "createdAt": "2026-04-16T15:30:00.000Z", + "url": "https://x.com/robotics_ai/status/100000000000000026" + }, + { + "authorId": "indie_hacker_jp", + "text": "AIツールだけで月収100万円のSaaSを一人で運営する人が増えてきた。技術力じゃなくて課題発見力が差になる時代。まさにAI-Drivenの世界。", + "createdAt": "2026-04-16T14:30:00.000Z", + "url": "https://x.com/indie_hacker_jp/status/100000000000000027" + }, + { + "authorId": "perplexity_ai", + "text": "Perplexity Pro now includes real-time web search with citations, code execution, and file analysis. All in one conversational interface.", + "createdAt": "2026-04-16T13:30:00.000Z", + "url": "https://x.com/perplexity_ai/status/100000000000000028" + }, + { + "authorId": "edge_ai_news", + "text": "Apple Intelligence 2.0 launches with on-device reasoning capabilities. Siri can now complete multi-step tasks without sending data to the cloud.", + "createdAt": "2026-04-16T12:30:00.000Z", + "url": "https://x.com/edge_ai_news/status/100000000000000029" + }, + { + "authorId": "ml_ops_daily", + "text": "The real bottleneck in AI deployment isn't the model — it's evaluation. Teams spending 60% of their time building eval frameworks instead of shipping features.", + "createdAt": "2026-04-16T11:30:00.000Z", + "url": "https://x.com/ml_ops_daily/status/100000000000000030" + } +] diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3b2d908 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2520 @@ +{ + "name": "ai-news", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ai-news", + "version": "1.0.0", + "dependencies": { + "@google/genai": "^1.1.0", + "@slack/web-api": "^7.8.0", + "twitter-api-v2": "^1.18.2", + "zod": "^3.24.2", + "zod-to-json-schema": "^3.24.1" + }, + "devDependencies": { + "tsx": "^4.19.0", + "typescript": "^5.7.0", + "vitest": "^3.2.4" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@google/genai": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/@google/genai/-/genai-1.50.1.tgz", + "integrity": "sha512-YbkX7H9+1Pt8wOt7DDREy8XSoiL6fRDzZQRyaVBarFf8MR3zHGqVdvM4cLbDXqPhxqvegZShgfxb8kw9C7YhAQ==", + "license": "Apache-2.0", + "dependencies": { + "google-auth-library": "^10.3.0", + "p-retry": "^4.6.2", + "protobufjs": "^7.5.4", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "@modelcontextprotocol/sdk": "^1.25.2" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": { + "optional": true + } + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.1.tgz", + "integrity": "sha512-d6FinEBLdIiK+1uACUttJKfgZREXrF0Qc2SmLII7W2AD8FfiZ9Wjd+rD/iRuf5s5dWrr1GgwXCvPqOuDquOowA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.1.tgz", + "integrity": "sha512-YjG/EwIDvvYI1YvYbHvDz/BYHtkY4ygUIXHnTdLhG+hKIQFBiosfWiACWortsKPKU/+dUwQQCKQM3qrDe8c9BA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.1.tgz", + "integrity": "sha512-mjCpF7GmkRtSJwon+Rq1N8+pI+8l7w5g9Z3vWj4T7abguC4Czwi3Yu/pFaLvA3TTeMVjnu3ctigusqWUfjZzvw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.1.tgz", + "integrity": "sha512-haZ7hJ1JT4e9hqkoT9R/19XW2QKqjfJVv+i5AGg57S+nLk9lQnJ1F/eZloRO3o9Scy9CM3wQ9l+dkXtcBgN5Ew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.1.tgz", + "integrity": "sha512-czw90wpQq3ZsAVBlinZjAYTKduOjTywlG7fEeWKUA7oCmpA8xdTkxZZlwNJKWqILlq0wehoZcJYfBvOyhPTQ6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.1.tgz", + "integrity": "sha512-KVB2rqsxTHuBtfOeySEyzEOB7ltlB/ux38iu2rBQzkjbwRVlkhAGIEDiiYnO2kFOkJp+Z7pUXKyrRRFuFUKt+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.1.tgz", + "integrity": "sha512-L+34Qqil+v5uC0zEubW7uByo78WOCIrBvci69E7sFASRl0X7b/MB6Cqd1lky/CtcSVTydWa2WZwFuWexjS5o6g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.1.tgz", + "integrity": "sha512-n83O8rt4v34hgFzlkb1ycniJh7IR5RCIqt6mz1VRJD6pmhRi0CXdmfnLu9dIUS6buzh60IvACM842Ffb3xd6Gg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.1.tgz", + "integrity": "sha512-Nql7sTeAzhTAja3QXeAI48+/+GjBJ+QmAH13snn0AJSNL50JsDqotyudHyMbO2RbJkskbMbFJfIJKWA6R1LCJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.1.tgz", + "integrity": "sha512-+pUymDhd0ys9GcKZPPWlFiZ67sTWV5UU6zOJat02M1+PiuSGDziyRuI/pPue3hoUwm2uGfxdL+trT6Z9rxnlMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.1.tgz", + "integrity": "sha512-VSvgvQeIcsEvY4bKDHEDWcpW4Yw7BtlKG1GUT4FzBUlEKQK0rWHYBqQt6Fm2taXS+1bXvJT6kICu5ZwqKCnvlQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.1.tgz", + "integrity": "sha512-4LqhUomJqwe641gsPp6xLfhqWMbQV04KtPp7/dIp0nzPxAkNY1AbwL5W0MQpcalLYk07vaW9Kp1PBhdpZYYcEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.1.tgz", + "integrity": "sha512-tLQQ9aPvkBxOc/EUT6j3pyeMD6Hb8QF2BTBnCQWP/uu1lhc9AIrIjKnLYMEroIz/JvtGYgI9dF3AxHZNaEH0rw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.1.tgz", + "integrity": "sha512-RMxFhJwc9fSXP6PqmAz4cbv3kAyvD1etJFjTx4ONqFP9DkTkXsAMU4v3Vyc5BgzC+anz7nS/9tp4obsKfqkDHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.1.tgz", + "integrity": "sha512-QKgFl+Yc1eEk6MmOBfRHYF6lTxiiiV3/z/BRrbSiW2I7AFTXoBFvdMEyglohPj//2mZS4hDOqeB0H1ACh3sBbg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.1.tgz", + "integrity": "sha512-RAjXjP/8c6ZtzatZcA1RaQr6O1TRhzC+adn8YZDnChliZHviqIjmvFwHcxi4JKPSDAt6Uhf/7vqcBzQJy0PDJg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.1.tgz", + "integrity": "sha512-wcuocpaOlaL1COBYiA89O6yfjlp3RwKDeTIA0hM7OpmhR1Bjo9j31G1uQVpDlTvwxGn2nQs65fBFL5UFd76FcQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.1.tgz", + "integrity": "sha512-77PpsFQUCOiZR9+LQEFg9GClyfkNXj1MP6wRnzYs0EeWbPcHs02AXu4xuUbM1zhwn3wqaizle3AEYg5aeoohhg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.1.tgz", + "integrity": "sha512-5cIATbk5vynAjqqmyBjlciMJl1+R/CwX9oLk/EyiFXDWd95KpHdrOJT//rnUl4cUcskrd0jCCw3wpZnhIHdD9w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.1.tgz", + "integrity": "sha512-cl0w09WsCi17mcmWqqglez9Gk8isgeWvoUZ3WiJFYSR3zjBQc2J5/ihSjpl+VLjPqjQ/1hJRcqBfLjssREQILw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.1.tgz", + "integrity": "sha512-4Cv23ZrONRbNtbZa37mLSueXUCtN7MXccChtKpUnQNgF010rjrjfHx3QxkS2PI7LqGT5xXyYs1a7LbzAwT0iCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.1.tgz", + "integrity": "sha512-i1okWYkA4FJICtr7KpYzFpRTHgy5jdDbZiWfvny21iIKky5YExiDXP+zbXzm3dUcFpkEeYNHgQ5fuG236JPq0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.1.tgz", + "integrity": "sha512-u09m3CuwLzShA0EYKMNiFgcjjzwqtUMLmuCJLeZWjjOYA3IT2Di09KaxGBTP9xVztWyIWjVdsB2E9goMjZvTQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.1.tgz", + "integrity": "sha512-k+600V9Zl1CM7eZxJgMyTUzmrmhB/0XZnF4pRypKAlAgxmedUA+1v9R+XOFv56W4SlHEzfeMtzujLJD22Uz5zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.1.tgz", + "integrity": "sha512-lWMnixq/QzxyhTV6NjQJ4SFo1J6PvOX8vUx5Wb4bBPsEb+8xZ89Bz6kOXpfXj9ak9AHTQVQzlgzBEc1SyM27xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@slack/logger": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@slack/logger/-/logger-4.0.1.tgz", + "integrity": "sha512-6cmdPrV/RYfd2U0mDGiMK8S7OJqpCTm7enMLRR3edccsPX8j7zXTLnaEF4fhxxJJTAIOil6+qZrnUPTuaLvwrQ==", + "license": "MIT", + "dependencies": { + "@types/node": ">=18" + }, + "engines": { + "node": ">= 18", + "npm": ">= 8.6.0" + } + }, + "node_modules/@slack/types": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/@slack/types/-/types-2.20.1.tgz", + "integrity": "sha512-eWX2mdt1ktpn8+40iiMc404uGrih+2fxiky3zBcPjtXKj6HLRdYlmhrPkJi7JTJm8dpXR6BWVWEDBXtaWMKD6A==", + "license": "MIT", + "engines": { + "node": ">= 12.13.0", + "npm": ">= 6.12.0" + } + }, + "node_modules/@slack/web-api": { + "version": "7.15.1", + "resolved": "https://registry.npmjs.org/@slack/web-api/-/web-api-7.15.1.tgz", + "integrity": "sha512-y+TAF7TszcmFzbVtBkFqAdBwKSoD+8shkNxhp4WIfFwXmCKdFje9WD6evROApPa2FTy1v1uc9yBaJs3609PPgg==", + "license": "MIT", + "dependencies": { + "@slack/logger": "^4.0.1", + "@slack/types": "^2.20.1", + "@types/node": ">=18", + "@types/retry": "0.12.0", + "axios": "^1.15.0", + "eventemitter3": "^5.0.1", + "form-data": "^4.0.4", + "is-electron": "2.2.2", + "is-stream": "^2", + "p-queue": "^6", + "p-retry": "^4", + "retry": "^0.13.1" + }, + "engines": { + "node": ">= 18", + "npm": ">= 8.6.0" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "25.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz", + "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.19.0" + } + }, + "node_modules/@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", + "license": "MIT" + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", + "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.4", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", + "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.4", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", + "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz", + "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bignumber.js": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz", + "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gaxios": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.4.tgz", + "integrity": "sha512-bTIgTsM2bWn3XklZISBTQX7ZSddGW+IO3bMdGaemHZ3tbqExMENHLx6kKZ/KlejgrMtj8q7wBItt51yegqalrA==", + "license": "Apache-2.0", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^7.0.1", + "node-fetch": "^3.3.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/gcp-metadata": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.2.tgz", + "integrity": "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==", + "license": "Apache-2.0", + "dependencies": { + "gaxios": "^7.0.0", + "google-logging-utils": "^1.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-tsconfig": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", + "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/google-auth-library": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.6.2.tgz", + "integrity": "sha512-e27Z6EThmVNNvtYASwQxose/G57rkRuaRbQyxM2bvYLLX/GqWZ5chWq2EBoUchJbCc57eC9ArzO5wMsEmWftCw==", + "license": "Apache-2.0", + "dependencies": { + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "gaxios": "^7.1.4", + "gcp-metadata": "8.1.2", + "google-logging-utils": "1.1.3", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/google-logging-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz", + "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/is-electron": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-electron/-/is-electron-2.2.2.tgz", + "integrity": "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg==", + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/p-queue": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", + "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.4", + "p-timeout": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue/node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "license": "MIT", + "dependencies": { + "@types/retry": "0.12.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "license": "MIT", + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz", + "integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/protobufjs": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz", + "integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/rollup": { + "version": "4.60.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.1.tgz", + "integrity": "sha512-VmtB2rFU/GroZ4oL8+ZqXgSA38O6GR8KSIvWmEFv63pQ0G6KaBH9s07PO8XTXP4vI+3UJUEypOfjkGfmSBBR0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.60.1", + "@rollup/rollup-android-arm64": "4.60.1", + "@rollup/rollup-darwin-arm64": "4.60.1", + "@rollup/rollup-darwin-x64": "4.60.1", + "@rollup/rollup-freebsd-arm64": "4.60.1", + "@rollup/rollup-freebsd-x64": "4.60.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.60.1", + "@rollup/rollup-linux-arm-musleabihf": "4.60.1", + "@rollup/rollup-linux-arm64-gnu": "4.60.1", + "@rollup/rollup-linux-arm64-musl": "4.60.1", + "@rollup/rollup-linux-loong64-gnu": "4.60.1", + "@rollup/rollup-linux-loong64-musl": "4.60.1", + "@rollup/rollup-linux-ppc64-gnu": "4.60.1", + "@rollup/rollup-linux-ppc64-musl": "4.60.1", + "@rollup/rollup-linux-riscv64-gnu": "4.60.1", + "@rollup/rollup-linux-riscv64-musl": "4.60.1", + "@rollup/rollup-linux-s390x-gnu": "4.60.1", + "@rollup/rollup-linux-x64-gnu": "4.60.1", + "@rollup/rollup-linux-x64-musl": "4.60.1", + "@rollup/rollup-openbsd-x64": "4.60.1", + "@rollup/rollup-openharmony-arm64": "4.60.1", + "@rollup/rollup-win32-arm64-msvc": "4.60.1", + "@rollup/rollup-win32-ia32-msvc": "4.60.1", + "@rollup/rollup-win32-x64-gnu": "4.60.1", + "@rollup/rollup-win32-x64-msvc": "4.60.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/twitter-api-v2": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/twitter-api-v2/-/twitter-api-v2-1.29.0.tgz", + "integrity": "sha512-v473q5bwme4N+DWSg6qY+JCvfg1nSJRWwui3HUALafxfqCvVkKiYmS/5x/pVeJwTmyeBxexMbzHwnzrH4h6oYQ==", + "license": "Apache-2.0" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.19.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz", + "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==", + "license": "MIT" + }, + "node_modules/vite": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.2.tgz", + "integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", + "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.4", + "@vitest/mocker": "3.2.4", + "@vitest/pretty-format": "^3.2.4", + "@vitest/runner": "3.2.4", + "@vitest/snapshot": "3.2.4", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.4", + "@vitest/ui": "3.2.4", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz", + "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..1108ea5 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "ai-news", + "version": "1.0.0", + "private": true, + "type": "module", + "engines": { + "node": ">=22" + }, + "scripts": { + "start": "tsx src/main.ts", + "test": "vitest run", + "test:watch": "vitest", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@google/genai": "^1.1.0", + "@slack/web-api": "^7.8.0", + "twitter-api-v2": "^1.18.2", + "zod": "^3.24.2", + "zod-to-json-schema": "^3.24.1" + }, + "devDependencies": { + "tsx": "^4.19.0", + "typescript": "^5.7.0", + "vitest": "^3.2.4" + } +} diff --git a/src/analysis/analyze.test.ts b/src/analysis/analyze.test.ts new file mode 100644 index 0000000..889aaac --- /dev/null +++ b/src/analysis/analyze.test.ts @@ -0,0 +1,87 @@ +import { describe, it, expect, vi } from "vitest"; +import { UserFacingError } from "../utils/errors.js"; +import type { Settings } from "../settings.js"; +import type { Config } from "../config.js"; +import type { EnrichedTweet } from "../types.js"; + +const { mockGenerateContent } = vi.hoisted(() => ({ + mockGenerateContent: vi.fn(), +})); + +vi.mock("@google/genai", () => ({ + GoogleGenAI: class { + models = { generateContent: mockGenerateContent }; + }, +})); + +const { analyzeTrends } = await import("./analyze.js"); + +const mockConfig: Config = { + JINA_API_KEY: "test", + GEMINI_API_KEY: "test", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + USE_SAMPLE_DATA: true, +}; + +const mockSettings: Settings = { + schedule: { lookbackHours: 24, maxTweets: 100 }, + urlContent: { + enabled: false, + timeoutMs: 5000, + parallelism: 5, + maxSummaryChars: 200, + inputCharsMultiplier: 20, + }, + analysis: { + urlSummaryModel: "gemini-2.5-flash", + trendAnalysisModel: "gemini-2.5-pro", + temperature: 0, + }, +}; + +const sampleTweets: EnrichedTweet[] = [ + { + authorId: "test", + text: "AI news", + createdAt: "2026-04-16T10:00:00.000Z", + url: "https://x.com/test/status/1", + enrichedText: "AI news", + }, +]; + +const validResponse = { + main_news: [ + { + title: "Test News", + details: ["Detail"], + sources: ["https://x.com/test/status/1"], + }, + ], + updates: [], + tech_trends: [], +}; + +describe("analyzeTrends", () => { + it("正常な JSON を返すと Analysis を返す", async () => { + mockGenerateContent.mockResolvedValue({ + text: JSON.stringify(validResponse), + candidates: [{ finishReason: "STOP" }], + }); + + const result = await analyzeTrends(sampleTweets, mockConfig, mockSettings); + expect(result.main_news).toHaveLength(1); + expect(result.main_news[0]!.title).toBe("Test News"); + }); + + it("SAFETY finishReason で UserFacingError をスローする", async () => { + mockGenerateContent.mockResolvedValue({ + text: undefined, + candidates: [{ finishReason: "SAFETY" }], + }); + + await expect( + analyzeTrends(sampleTweets, mockConfig, mockSettings), + ).rejects.toThrow(UserFacingError); + }); +}); diff --git a/src/analysis/analyze.ts b/src/analysis/analyze.ts new file mode 100644 index 0000000..af28219 --- /dev/null +++ b/src/analysis/analyze.ts @@ -0,0 +1,80 @@ +import { GoogleGenAI } from "@google/genai"; +import { + AnalysisSchema, + analysisResponseSchema, + type Analysis, +} from "./schema.js"; +import { TREND_ANALYSIS_PROMPT } from "./prompts.js"; +import type { Config } from "../config.js"; +import type { Settings } from "../settings.js"; +import type { EnrichedTweet } from "../types.js"; +import { UserFacingError } from "../utils/errors.js"; +import { cleanText } from "../utils/post-optimizer.js"; + +export async function analyzeTrends( + tweets: EnrichedTweet[], + config: Config, + settings: Settings, +): Promise { + console.info("[3b/4] タイムライン全体を Gemini Pro で分析中..."); + const ai = new GoogleGenAI({ apiKey: config.GEMINI_API_KEY }); + + const tweetsForPrompt = Object.entries(groupByAuthor(tweets)).map( + ([author, items]) => ({ + author, + posts: items.map((t) => ({ + text: cleanText(t.enrichedText), + url: t.url, + })), + }), + ); + + const prompt = TREND_ANALYSIS_PROMPT.replace( + "{json_data}", + JSON.stringify(tweetsForPrompt, null, 2), + ); + + const res = await ai.models.generateContent({ + model: settings.analysis.trendAnalysisModel, + contents: prompt, + config: { + temperature: settings.analysis.temperature, + responseMimeType: "application/json", + responseSchema: analysisResponseSchema as Record, + }, + }); + + const candidate = (res as { candidates?: Array<{ finishReason?: string }> }) + .candidates?.[0]; + + if (candidate?.finishReason === "SAFETY") { + throw new UserFacingError( + "Geminiのセーフティフィルタで分析結果がブロックされました。ツイート内容を減らして再実行してください。", + ); + } + + const text = res.text; + if (!text) { + throw new UserFacingError("Geminiから空の応答が返りました。"); + } + + try { + return AnalysisSchema.parse(JSON.parse(text)); + } catch (cause) { + throw new UserFacingError( + "Geminiの応答をパースできませんでした。再実行してみてください。", + { cause }, + ); + } +} + +function groupByAuthor( + tweets: EnrichedTweet[], +): Record { + const groups: Record = {}; + for (const tweet of tweets) { + const key = tweet.authorId || "unknown"; + (groups[key] ??= []).push(tweet); + } + return groups; +} diff --git a/src/analysis/prompts.ts b/src/analysis/prompts.ts new file mode 100644 index 0000000..0202389 --- /dev/null +++ b/src/analysis/prompts.ts @@ -0,0 +1,33 @@ +export const URL_SUMMARY_PROMPT = `以下の記事本文を200文字以内の日本語で要約してください。要点だけを簡潔にまとめてください。 + +--- +{article_text} +--- + +要約:`; + +export const TREND_ANALYSIS_PROMPT = `あなたはAI技術に精通したアナリストです。以下のJSONデータは、X(旧Twitter)から収集した最新24時間以内のAI関連のツイートです。 + +タスク: +このデータを分析して、以下の観点で最新のAIトレンドをまとめてください: +- 主要な話題やニュース +- 新しいAIツールやサービスのアップデート +- 注目を集めている技術動向 + +出力は以下のJSON構造に従ってください: +{ + "main_news": [{"title": "トピック名", "details": ["詳細1", "詳細2"], "sources": ["https://x.com/..."]}], + "updates": [{"title": "製品名と内容", "details": ["更新内容", "特徴"], "sources": ["https://x.com/..."]}], + "tech_trends": [{"title": "トレンド名", "details": ["概要", "影響"], "sources": ["https://x.com/..."]}] +} + +制約: +- 見出し(title)はそれを読むだけで内容がわかるように具体的に書いてください +- 事実に基づいた客観的な分析を心がけてください +- 複数のソースで言及されている話題を優先してください +- 誇張や推測は避け、データに現れている内容に基づいて記述してください +- detailsの各項目は200文字程度に収めてください +- sourcesにはツイートのURLをそのまま入れてください + +以下のJSONデータを分析してください: +{json_data}`; diff --git a/src/analysis/schema.test.ts b/src/analysis/schema.test.ts new file mode 100644 index 0000000..9149cda --- /dev/null +++ b/src/analysis/schema.test.ts @@ -0,0 +1,98 @@ +import { describe, it, expect } from "vitest"; +import { AnalysisSchema, analysisResponseSchema } from "./schema.js"; + +const validAnalysis = { + main_news: [ + { + title: "GPT-5.5が発表", + details: ["ネイティブtool use対応", "推論速度が大幅向上"], + sources: ["https://x.com/OpenAI/status/123"], + }, + ], + updates: [ + { + title: "Cursor Background Agent", + details: ["寝ている間にPRを作成"], + sources: ["https://x.com/cursor/status/456"], + }, + ], + tech_trends: [ + { + title: "テスト時計算量スケーリング", + details: ["より大きなモデルからスマートな推論へ", "推論コスト削減"], + sources: ["https://x.com/research/status/789"], + }, + ], +}; + +describe("AnalysisSchema", () => { + it("正常なデータをパースできる", () => { + const result = AnalysisSchema.parse(validAnalysis); + expect(result.main_news).toHaveLength(1); + expect(result.updates).toHaveLength(1); + expect(result.tech_trends).toHaveLength(1); + }); + + it("空セクションを許容する", () => { + const result = AnalysisSchema.parse({ + main_news: [], + updates: [], + tech_trends: [], + }); + expect(result.main_news).toHaveLength(0); + }); + + it("必須フィールドが欠けるとエラー", () => { + expect(() => + AnalysisSchema.parse({ main_news: [], updates: [] }), + ).toThrow(); + }); + + it("details が3つを超えるとエラー", () => { + expect(() => + AnalysisSchema.parse({ + main_news: [ + { + title: "test", + details: ["1", "2", "3", "4"], + sources: [], + }, + ], + updates: [], + tech_trends: [], + }), + ).toThrow(); + }); + + it("details が3つちょうどは許容する", () => { + const result = AnalysisSchema.parse({ + main_news: [ + { + title: "test", + details: ["1", "2", "3"], + sources: [], + }, + ], + updates: [], + tech_trends: [], + }); + expect(result.main_news[0]!.details).toHaveLength(3); + }); +}); + +describe("analysisResponseSchema", () => { + it("JSON Schema オブジェクトが生成される", () => { + expect(analysisResponseSchema).toBeDefined(); + expect(typeof analysisResponseSchema).toBe("object"); + }); + + it("3つのセクションプロパティを含む", () => { + const schema = analysisResponseSchema as Record; + const props = (schema as { properties?: Record }) + .properties; + expect(props).toBeDefined(); + expect(props).toHaveProperty("main_news"); + expect(props).toHaveProperty("updates"); + expect(props).toHaveProperty("tech_trends"); + }); +}); diff --git a/src/analysis/schema.ts b/src/analysis/schema.ts new file mode 100644 index 0000000..0b38259 --- /dev/null +++ b/src/analysis/schema.ts @@ -0,0 +1,21 @@ +import { z } from "zod"; +import { zodToJsonSchema } from "zod-to-json-schema"; + +const TopicSchema = z.object({ + title: z.string(), + details: z.array(z.string()).max(3), + sources: z.array(z.string()), +}); + +export const AnalysisSchema = z.object({ + main_news: z.array(TopicSchema), + updates: z.array(TopicSchema), + tech_trends: z.array(TopicSchema), +}); + +export type Analysis = z.infer; + +export const analysisResponseSchema = zodToJsonSchema(AnalysisSchema, { + target: "openApi3", + $refStrategy: "none", +}); diff --git a/src/analysis/url-summarizer.test.ts b/src/analysis/url-summarizer.test.ts new file mode 100644 index 0000000..b5a4882 --- /dev/null +++ b/src/analysis/url-summarizer.test.ts @@ -0,0 +1,84 @@ +import { describe, it, expect, vi } from "vitest"; +import type { Settings } from "../settings.js"; +import type { Config } from "../config.js"; +import type { RawTweet } from "../types.js"; + +const { mockGenerateContent } = vi.hoisted(() => ({ + mockGenerateContent: vi.fn(), +})); + +vi.mock("@google/genai", () => ({ + GoogleGenAI: class { + models = { generateContent: mockGenerateContent }; + }, +})); + +const { summarizeUrls } = await import("./url-summarizer.js"); + +const mockConfig: Config = { + JINA_API_KEY: "test", + GEMINI_API_KEY: "test", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + USE_SAMPLE_DATA: true, +}; + +const mockSettings: Settings = { + schedule: { lookbackHours: 24, maxTweets: 100 }, + urlContent: { + enabled: true, + timeoutMs: 5000, + parallelism: 5, + maxSummaryChars: 200, + inputCharsMultiplier: 20, + }, + analysis: { + urlSummaryModel: "gemini-2.5-flash", + trendAnalysisModel: "gemini-2.5-pro", + temperature: 0, + }, +}; + +const sampleTweets: RawTweet[] = [ + { + authorId: "user1", + text: "Check out https://example.com/article", + createdAt: "2026-04-16T10:00:00.000Z", + url: "https://x.com/user1/status/1", + }, +]; + +describe("summarizeUrls", () => { + it("urlContents が空のとき元テキストをそのまま返す", async () => { + const result = await summarizeUrls( + sampleTweets, + new Map(), + mockConfig, + mockSettings, + ); + expect(result).toHaveLength(1); + expect(result[0]!.enrichedText).toBe( + "Check out https://example.com/article", + ); + }); + + it("urlContents があるとき [補足情報] を挿入する", async () => { + mockGenerateContent.mockResolvedValue({ + text: "記事の要約テキスト", + }); + + const urlContents = new Map([ + ["https://example.com/article", "Full article body text here..."], + ]); + + const result = await summarizeUrls( + sampleTweets, + urlContents, + mockConfig, + mockSettings, + ); + expect(result).toHaveLength(1); + expect(result[0]!.enrichedText).toContain("[補足情報]"); + expect(result[0]!.enrichedText).toContain("記事の要約テキスト"); + }); +}); diff --git a/src/analysis/url-summarizer.ts b/src/analysis/url-summarizer.ts new file mode 100644 index 0000000..cae4033 --- /dev/null +++ b/src/analysis/url-summarizer.ts @@ -0,0 +1,77 @@ +import { GoogleGenAI } from "@google/genai"; +import type { Config } from "../config.js"; +import type { Settings } from "../settings.js"; +import type { RawTweet, EnrichedTweet } from "../types.js"; +import { extractUrls } from "../utils/post-optimizer.js"; +import { chunkArray } from "../utils/chunk.js"; +import { URL_SUMMARY_PROMPT } from "./prompts.js"; + +export async function summarizeUrls( + tweets: RawTweet[], + urlContents: Map, + config: Config, + settings: Settings, +): Promise { + if (urlContents.size === 0) { + return tweets.map((t) => ({ ...t, enrichedText: buildFullText(t) })); + } + + console.info("[3a/4] 各URLを Gemini Flash で要約中..."); + const ai = new GoogleGenAI({ apiKey: config.GEMINI_API_KEY }); + const summaryCache = new Map(); + const entries = [...urlContents.entries()]; + + const chunks = chunkArray(entries, settings.urlContent.parallelism); + for (const chunk of chunks) { + const results = await Promise.allSettled( + chunk.map(async ([url, content]) => { + const truncated = content.slice( + 0, + settings.urlContent.maxSummaryChars * + settings.urlContent.inputCharsMultiplier, + ); + const prompt = URL_SUMMARY_PROMPT.replace( + "{article_text}", + truncated, + ); + + const res = await ai.models.generateContent({ + model: settings.analysis.urlSummaryModel, + contents: prompt, + config: { temperature: 0 }, + }); + + const text = res.text?.slice(0, settings.urlContent.maxSummaryChars); + return { url, summary: text ?? "" }; + }), + ); + + for (const r of results) { + if (r.status === "fulfilled" && r.value.summary) { + summaryCache.set(r.value.url, r.value.summary); + } + } + } + + console.info(`→ URL要約完了: ${summaryCache.size}件`); + + return tweets.map((tweet) => { + let enrichedText = buildFullText(tweet); + for (const url of extractUrls(tweet.text)) { + const summary = summaryCache.get(url); + if (summary) { + enrichedText += `\n[補足情報]: ${summary}`; + } + } + return { ...tweet, enrichedText }; + }); +} + +function buildFullText(tweet: RawTweet): string { + let text = tweet.text; + if (tweet.quotedText) { + text += `\n${tweet.quotedText}`; + } + return text; +} + diff --git a/src/config.test.ts b/src/config.test.ts new file mode 100644 index 0000000..dc5b53d --- /dev/null +++ b/src/config.test.ts @@ -0,0 +1,109 @@ +import { describe, it, expect, vi, beforeEach, afterAll } from "vitest"; +import { loadConfig } from "./config.js"; + +describe("loadConfig", () => { + const original = process.env; + + beforeEach(() => { + process.env = { ...original }; + }); + + afterAll(() => { + process.env = original; + }); + + const commonEnv = { + JINA_API_KEY: "test", + GEMINI_API_KEY: "test", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + }; + + it("正常な環境変数をパースできる", () => { + process.env = { + ...original, + ...commonEnv, + X_CONSUMER_KEY: "ck", + X_CONSUMER_SECRET: "cs", + X_ACCESS_TOKEN: "at", + X_ACCESS_TOKEN_SECRET: "ats", + }; + const config = loadConfig(); + expect(config.USE_SAMPLE_DATA).toBe(false); + expect(config.GEMINI_API_KEY).toBe("test"); + }); + + it("USE_SAMPLE_DATA=true を boolean に変換する", () => { + process.env = { ...original, ...commonEnv, USE_SAMPLE_DATA: "true" }; + const config = loadConfig(); + expect(config.USE_SAMPLE_DATA).toBe(true); + }); + + it("必須キーが欠落すると process.exit(1) を呼ぶ", () => { + process.env = {}; + const exitSpy = vi + .spyOn(process, "exit") + .mockImplementation((() => { + throw new Error("process.exit called"); + }) as never); + vi.spyOn(console, "error").mockImplementation(() => {}); + + expect(() => loadConfig()).toThrow("process.exit called"); + expect(exitSpy).toHaveBeenCalledWith(1); + }); + + it("USE_SAMPLE_DATA=true のとき X_* なしで成功する", () => { + process.env = { ...original, ...commonEnv, USE_SAMPLE_DATA: "true" }; + const config = loadConfig(); + expect(config.USE_SAMPLE_DATA).toBe(true); + }); + + it("USE_SAMPLE_DATA=false かつ X_* なしで process.exit(1)", () => { + process.env = { ...original, ...commonEnv, USE_SAMPLE_DATA: "false" }; + const exitSpy = vi + .spyOn(process, "exit") + .mockImplementation((() => { + throw new Error("process.exit called"); + }) as never); + vi.spyOn(console, "error").mockImplementation(() => {}); + + expect(() => loadConfig()).toThrow("process.exit called"); + expect(exitSpy).toHaveBeenCalledWith(1); + }); + + it("USE_SAMPLE_DATA=false かつ X_* 全てありで成功する", () => { + process.env = { + ...original, + ...commonEnv, + USE_SAMPLE_DATA: "false", + X_CONSUMER_KEY: "ck", + X_CONSUMER_SECRET: "cs", + X_ACCESS_TOKEN: "at", + X_ACCESS_TOKEN_SECRET: "ats", + }; + const config = loadConfig(); + expect(config.USE_SAMPLE_DATA).toBe(false); + if (!config.USE_SAMPLE_DATA) { + expect(config.X_CONSUMER_KEY).toBe("ck"); + } + }); + + it("USE_SAMPLE_DATA=false かつ X_* が一部だけだと process.exit(1)", () => { + process.env = { + ...original, + ...commonEnv, + USE_SAMPLE_DATA: "false", + X_CONSUMER_KEY: "ck", + X_CONSUMER_SECRET: "cs", + }; + const exitSpy = vi + .spyOn(process, "exit") + .mockImplementation((() => { + throw new Error("process.exit called"); + }) as never); + vi.spyOn(console, "error").mockImplementation(() => {}); + + expect(() => loadConfig()).toThrow("process.exit called"); + expect(exitSpy).toHaveBeenCalledWith(1); + }); +}); diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..8e27680 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,58 @@ +import { z } from "zod"; + +const baseSchema = z.object({ + JINA_API_KEY: z.string().min(1), + GEMINI_API_KEY: z.string().min(1), + SLACK_BOT_TOKEN: z.string().startsWith("xoxb-"), + SLACK_CHANNEL: z.string().startsWith("C"), + USE_SAMPLE_DATA: z + .enum(["true", "false", ""]) + .default("false") + .transform((v) => v === "true"), +}); + +const xSchema = z.object({ + X_CONSUMER_KEY: z.string().min(1), + X_CONSUMER_SECRET: z.string().min(1), + X_ACCESS_TOKEN: z.string().min(1), + X_ACCESS_TOKEN_SECRET: z.string().min(1), +}); + +type BaseParsed = z.infer; +type XParsed = z.infer; +type Common = Omit; + +export type Config = + | (Common & { USE_SAMPLE_DATA: true }) + | (Common & { USE_SAMPLE_DATA: false } & XParsed); + +export function loadConfig(): Config { + const baseResult = baseSchema.safeParse(process.env); + if (!baseResult.success) { + reportAndExit("環境変数の検証に失敗しました", baseResult.error); + } + + const { USE_SAMPLE_DATA, ...common } = baseResult.data; + + if (USE_SAMPLE_DATA) { + return { ...common, USE_SAMPLE_DATA: true }; + } + + const xResult = xSchema.safeParse(process.env); + if (!xResult.success) { + reportAndExit( + "X API の環境変数が揃っていません(USE_SAMPLE_DATA=false のとき X_CONSUMER_KEY / X_CONSUMER_SECRET / X_ACCESS_TOKEN / X_ACCESS_TOKEN_SECRET の4つが必須)。モックで動作確認したい場合は USE_SAMPLE_DATA=true を指定してください", + xResult.error, + ); + } + + return { ...common, USE_SAMPLE_DATA: false, ...xResult.data }; +} + +function reportAndExit(title: string, error: z.ZodError): never { + const missing = error.issues + .map((i) => ` - ${i.path.join(".")}: ${i.message}`) + .join("\n"); + console.error(`[CONFIG] ${title}:\n${missing}`); + process.exit(1); +} diff --git a/src/delivery/slack.test.ts b/src/delivery/slack.test.ts new file mode 100644 index 0000000..9f42211 --- /dev/null +++ b/src/delivery/slack.test.ts @@ -0,0 +1,82 @@ +import { describe, it, expect, vi, beforeEach } from "vitest"; +import type { Config } from "../config.js"; +import type { Analysis } from "../analysis/schema.js"; + +const mockPostMessage = vi.fn(); + +vi.mock("@slack/web-api", () => ({ + WebClient: class { + chat = { postMessage: mockPostMessage }; + }, +})); + +const { postToSlack } = await import("./slack.js"); + +const mockConfig: Config = { + JINA_API_KEY: "test-jina", + GEMINI_API_KEY: "test-gemini", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + USE_SAMPLE_DATA: true, +}; + +const validAnalysis: Analysis = { + main_news: [ + { + title: "GPT-5.5が発表", + details: ["ネイティブtool use対応"], + sources: ["https://x.com/OpenAI/status/123"], + }, + ], + updates: [ + { + title: "Cursor Background Agent", + details: ["寝ている間にPR作成"], + sources: ["https://x.com/cursor/status/456"], + }, + ], + tech_trends: [], +}; + +beforeEach(() => { + mockPostMessage.mockResolvedValue({ ok: true }); +}); + +describe("postToSlack", () => { + it("正常な Analysis を投稿できる", async () => { + await postToSlack(validAnalysis, mockConfig); + + expect(mockPostMessage).toHaveBeenCalledOnce(); + const call = mockPostMessage.mock.calls[0]![0] as { + channel: string; + text: string; + blocks: unknown[]; + }; + expect(call.channel).toBe("C123"); + expect(call.text).toBe("24時間以内のAIトレンド"); + expect(call.blocks.length).toBeGreaterThan(0); + }); + + it("空の Analysis でもエラーにならない", async () => { + const emptyAnalysis: Analysis = { + main_news: [], + updates: [], + tech_trends: [], + }; + await expect( + postToSlack(emptyAnalysis, mockConfig), + ).resolves.not.toThrow(); + }); + + it("Block Kit にヘッダーとセクションが含まれる", async () => { + await postToSlack(validAnalysis, mockConfig); + + const call = mockPostMessage.mock.calls[0]![0] as { + blocks: Array<{ type: string }>; + }; + const types = call.blocks.map((b) => b.type); + expect(types).toContain("header"); + expect(types).toContain("section"); + expect(types).toContain("divider"); + }); +}); diff --git a/src/delivery/slack.ts b/src/delivery/slack.ts new file mode 100644 index 0000000..a847ba9 --- /dev/null +++ b/src/delivery/slack.ts @@ -0,0 +1,84 @@ +import { WebClient, type KnownBlock, type ChatPostMessageResponse } from "@slack/web-api"; +import type { Config } from "../config.js"; +import type { Analysis } from "../analysis/schema.js"; +import { UserFacingError } from "../utils/errors.js"; + +export async function postToSlack( + analysis: Analysis, + config: Config, +): Promise { + const client = new WebClient(config.SLACK_BOT_TOKEN); + const blocks = buildBlocks(analysis); + + const res = await client.chat.postMessage({ + channel: config.SLACK_CHANNEL, + text: "24時間以内のAIトレンド", + blocks, + }); + + assertSlackOk(res); + console.info("Slack 投稿完了"); +} + +function assertSlackOk(res: ChatPostMessageResponse): void { + if (res.ok) return; + const msg = + res.error === "not_in_channel" + ? "SlackチャンネルにBotが招待されていません。チャンネルで `/invite @あなたのBot名` を実行してください。" + : res.error === "channel_not_found" + ? "SLACK_CHANNEL のIDが見つかりません。GitHub Secrets を確認してください。" + : `Slack投稿に失敗: ${res.error}`; + throw new UserFacingError(msg); +} + +function buildBlocks(analysis: Analysis): KnownBlock[] { + const blocks: KnownBlock[] = []; + + blocks.push({ + type: "header", + text: { type: "plain_text", text: "🤖 24時間以内のAIトレンド", emoji: true }, + }); + blocks.push({ type: "divider" }); + + const sections: Array<{ title: string; items: Analysis["main_news"] }> = [ + { title: "🔥 主要なニュース・話題", items: analysis.main_news }, + { title: "⚡️ 注目のアップデート", items: analysis.updates }, + { title: "💡 技術トレンド", items: analysis.tech_trends }, + ]; + + for (const section of sections) { + if (section.items.length === 0) continue; + + blocks.push({ + type: "header", + text: { type: "plain_text", text: section.title, emoji: true }, + }); + blocks.push({ type: "divider" }); + + for (const topic of section.items) { + blocks.push({ + type: "section", + text: { type: "mrkdwn", text: `*${topic.title}*` }, + }); + + if (topic.details.length > 0) { + blocks.push({ + type: "section", + text: { type: "mrkdwn", text: topic.details.join("\n") }, + }); + } + + if (topic.sources.length > 0) { + const sourceLinks = topic.sources + .map((url) => `<${url}>`) + .join("\n"); + blocks.push({ + type: "context", + elements: [{ type: "mrkdwn", text: sourceLinks }], + }); + } + } + } + + return blocks; +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..6269649 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,53 @@ +// ┌──────────────────────────────────────────────────────┐ +// │ 読み順ガイド │ +// │ この main() の4ステップを上から読めば全体が分かる。 │ +// │ 詳しく見たくなったら各 import 先にジャンプ。 │ +// │ 設定を変えたい場合は src/settings.ts を開く。 │ +// └──────────────────────────────────────────────────────┘ + +import { loadConfig } from "./config.js"; +import { settings } from "./settings.js"; +import { fetchHomeTimeline } from "./sources/x-timeline.js"; +import { fetchUrlContents } from "./sources/url-content.js"; +import { summarizeUrls } from "./analysis/url-summarizer.js"; +import { analyzeTrends } from "./analysis/analyze.js"; +import { postToSlack } from "./delivery/slack.js"; +import { UserFacingError } from "./utils/errors.js"; + +async function main() { + const config = loadConfig(); + + console.info("[1/4] X のホームタイムラインを取得中..."); + const tweets = await fetchHomeTimeline(config, settings); + console.info(`→ ツイート ${tweets.length}件 を取得`); + + console.info("[2/4] URL本文を Jina Reader で取得中..."); + const urlContents = await fetchUrlContents(tweets, config, settings); + console.info(`→ 本文取得済みURL: ${urlContents.size}件`); + + const enrichedTweets = await summarizeUrls( + tweets, + urlContents, + config, + settings, + ); + const analysis = await analyzeTrends(enrichedTweets, config, settings); + + console.info("[4/4] Slack へ投稿中..."); + await postToSlack(analysis, config); + + console.info("すべての処理が完了しました"); +} + +main().catch((error: unknown) => { + if (error instanceof UserFacingError) { + console.error(`\n[USER-FACING] ${error.message}`); + console.error("対処法の詳細は docs/troubleshooting.md を参照してください。"); + if (error.cause) { + console.error("[DETAIL]", error.cause); + } + } else { + console.error("\n[INTERNAL] Unexpected error:", error); + } + process.exit(1); +}); diff --git a/src/settings.ts b/src/settings.ts new file mode 100644 index 0000000..a99dc70 --- /dev/null +++ b/src/settings.ts @@ -0,0 +1,37 @@ +export interface Settings { + schedule: { + lookbackHours: number; + maxTweets: number; + }; + urlContent: { + enabled: boolean; + timeoutMs: number; + parallelism: number; + maxSummaryChars: number; + inputCharsMultiplier: number; + }; + analysis: { + urlSummaryModel: string; + trendAnalysisModel: string; + temperature: number; + }; +} + +export const settings: Settings = { + schedule: { + lookbackHours: 24, + maxTweets: 500, + }, + urlContent: { + enabled: true, + timeoutMs: 10_000, + parallelism: 10, + maxSummaryChars: 200, + inputCharsMultiplier: 20, + }, + analysis: { + urlSummaryModel: "gemini-2.5-flash", + trendAnalysisModel: "gemini-2.5-pro", + temperature: 0, + }, +}; diff --git a/src/sources/url-content.test.ts b/src/sources/url-content.test.ts new file mode 100644 index 0000000..ea9119b --- /dev/null +++ b/src/sources/url-content.test.ts @@ -0,0 +1,129 @@ +import { describe, it, expect, vi } from "vitest"; +import { fetchUrlContents } from "./url-content.js"; +import type { Config } from "../config.js"; +import type { Settings } from "../settings.js"; +import type { RawTweet } from "../types.js"; + +const mockConfig: Config = { + JINA_API_KEY: "test-jina", + GEMINI_API_KEY: "test-gemini", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + USE_SAMPLE_DATA: true, +}; + +const baseSettings: Settings = { + schedule: { lookbackHours: 24, maxTweets: 100 }, + urlContent: { + enabled: true, + timeoutMs: 5000, + parallelism: 5, + maxSummaryChars: 200, + inputCharsMultiplier: 20, + }, + analysis: { + urlSummaryModel: "gemini-2.5-flash", + trendAnalysisModel: "gemini-2.5-pro", + temperature: 0, + }, +}; + +const disabledSettings: Settings = { + ...baseSettings, + urlContent: { ...baseSettings.urlContent, enabled: false }, +}; + +const tweetsNoUrl: RawTweet[] = [ + { + authorId: "user1", + text: "URLなしのツイート", + createdAt: "2026-04-16T10:00:00.000Z", + url: "https://x.com/user1/status/1", + }, +]; + +function makeTweetsWithUrls(...urls: string[]): RawTweet[] { + return urls.map((u, i) => ({ + authorId: "user1", + text: `Check out ${u}`, + createdAt: "2026-04-16T10:00:00.000Z", + url: `https://x.com/user1/status/${i + 1}`, + })); +} + +describe("fetchUrlContents", () => { + it("urlContent.enabled=false のとき空Mapを返す", async () => { + const result = await fetchUrlContents( + makeTweetsWithUrls("https://example.com/article"), + mockConfig, + disabledSettings, + ); + expect(result.size).toBe(0); + }); + + it("URLがないツイートでは空Mapを返す", async () => { + const result = await fetchUrlContents( + tweetsNoUrl, + mockConfig, + baseSettings, + ); + expect(result.size).toBe(0); + }); + + it("Jina 200 OK で本文を取得できる", async () => { + vi.stubGlobal( + "fetch", + vi.fn((input: string | URL | Request, init?: RequestInit) => { + const url = typeof input === "string" ? input : input.toString(); + // HEAD展開: 展開後URLとしてそのまま返す(x.com系でないので通過する) + if (init?.method === "HEAD") { + return Promise.resolve({ url }); + } + // Jina Reader 呼び出し + if (url.startsWith("https://r.jina.ai/")) { + return Promise.resolve(new Response("Article body content", { status: 200 })); + } + return Promise.resolve(new Response(null, { status: 404 })); + }), + ); + + const tweets = makeTweetsWithUrls("https://example.com/article"); + const result = await fetchUrlContents(tweets, mockConfig, baseSettings); + expect(result.size).toBe(1); + const content = [...result.values()][0]; + expect(content).toBe("Article body content"); + }); + + it("Jina 402 でフォールバックし残りをスキップする", async () => { + let jinaCallCount = 0; + vi.stubGlobal( + "fetch", + vi.fn((input: string | URL | Request, init?: RequestInit) => { + const url = typeof input === "string" ? input : input.toString(); + if (init?.method === "HEAD") { + return Promise.resolve({ url }); + } + if (url.startsWith("https://r.jina.ai/")) { + jinaCallCount++; + if (jinaCallCount === 1) { + return Promise.resolve(new Response("First article", { status: 200 })); + } + return Promise.resolve(new Response(null, { status: 402 })); + } + return Promise.resolve(new Response(null, { status: 404 })); + }), + ); + + const tweets = makeTweetsWithUrls( + "https://a.example.com/1", + "https://b.example.com/2", + "https://c.example.com/3", + ); + const result = await fetchUrlContents(tweets, mockConfig, { + ...baseSettings, + urlContent: { ...baseSettings.urlContent, parallelism: 1 }, + }); + expect(result.size).toBe(1); + expect([...result.values()][0]).toBe("First article"); + }); +}); diff --git a/src/sources/url-content.ts b/src/sources/url-content.ts new file mode 100644 index 0000000..5f12fe0 --- /dev/null +++ b/src/sources/url-content.ts @@ -0,0 +1,96 @@ +import type { Config } from "../config.js"; +import type { Settings } from "../settings.js"; +import type { RawTweet } from "../types.js"; +import { extractUrls, expandUrls } from "../utils/post-optimizer.js"; +import { chunkArray } from "../utils/chunk.js"; + +/** + * ツイート内URLの本文を Jina Reader で取得する。 + * 返す Map のキーはツイート内に出現する短縮URL(extractUrls で抽出したもの)。 + * url-summarizer がそのまま Map.get(url) で引けるようにする。 + */ +export async function fetchUrlContents( + tweets: RawTweet[], + config: Config, + settings: Settings, +): Promise> { + const contents = new Map(); + + if (!settings.urlContent.enabled) { + console.info("URL本文取得は src/settings.ts の urlContent.enabled=false のため無効"); + return contents; + } + + const allRawUrls = tweets.flatMap((t) => extractUrls(t.text)); + const uniqueRawUrls = [...new Set(allRawUrls)]; + + if (uniqueRawUrls.length === 0) return contents; + + console.info(`→ ${uniqueRawUrls.length}件 のURLをHEADで展開中`); + const urlMapping = await expandUrls(uniqueRawUrls); + console.info( + `→ 外部URL: ${urlMapping.size}件(x.com/twitter.com を除外済み)`, + ); + + if (urlMapping.size === 0) return contents; + + let jina402Detected = false; + const entries = [...urlMapping.entries()]; + const chunks = chunkArray(entries, settings.urlContent.parallelism); + + for (const chunk of chunks) { + if (jina402Detected) break; + + const results = await Promise.allSettled( + chunk.map(async ([originalUrl, expandedUrl]) => { + const ctl = new AbortController(); + const timer = setTimeout( + () => ctl.abort(), + settings.urlContent.timeoutMs, + ); + try { + const res = await fetch(`https://r.jina.ai/${expandedUrl}`, { + headers: { + Accept: "text/plain", + ...(config.JINA_API_KEY + ? { Authorization: `Bearer ${config.JINA_API_KEY}` } + : {}), + }, + signal: ctl.signal, + }); + + if (res.status === 402 || res.status === 401) { + jina402Detected = true; + console.warn( + `[Jina] ${res.status} — 無料枠が枯渇しました。URL本文なしで分析を続行します。`, + ); + return { originalUrl, content: undefined }; + } + if (!res.ok) { + return { originalUrl, content: undefined }; + } + const text = await res.text(); + return { originalUrl, content: text }; + } finally { + clearTimeout(timer); + } + }), + ); + + for (const r of results) { + if (r.status === "fulfilled" && r.value.content) { + contents.set(r.value.originalUrl, r.value.content); + } + } + } + + if (jina402Detected) { + console.warn( + `[Jina] フォールバック: ${contents.size} URLs の本文を取得済み。残りはスキップします。`, + ); + } else { + console.info(`→ 本文取得完了: ${contents.size}件`); + } + + return contents; +} diff --git a/src/sources/x-timeline.test.ts b/src/sources/x-timeline.test.ts new file mode 100644 index 0000000..875a8db --- /dev/null +++ b/src/sources/x-timeline.test.ts @@ -0,0 +1,32 @@ +import { describe, it, expect } from "vitest"; +import { fetchHomeTimeline } from "./x-timeline.js"; +import type { Config } from "../config.js"; +import { settings } from "../settings.js"; + +const mockConfig: Config = { + JINA_API_KEY: "test-jina", + GEMINI_API_KEY: "test-gemini", + SLACK_BOT_TOKEN: "xoxb-test", + SLACK_CHANNEL: "C123", + USE_SAMPLE_DATA: true, +}; + +describe("fetchHomeTimeline (モックルート)", () => { + it("USE_SAMPLE_DATA=true で fixtures/sample-tweets.json を読み込む", async () => { + const tweets = await fetchHomeTimeline(mockConfig, settings); + expect(tweets.length).toBe(30); + }); + + it("各ツイートに必須フィールドがある", async () => { + const tweets = await fetchHomeTimeline(mockConfig, settings); + for (const tweet of tweets) { + expect(tweet.authorId).toBeDefined(); + expect(typeof tweet.authorId).toBe("string"); + expect(tweet.text).toBeDefined(); + expect(typeof tweet.text).toBe("string"); + expect(tweet.createdAt).toBeDefined(); + expect(tweet.url).toBeDefined(); + expect(tweet.url).toMatch(/^https:\/\/x\.com\//); + } + }); +}); diff --git a/src/sources/x-timeline.ts b/src/sources/x-timeline.ts new file mode 100644 index 0000000..8978f9f --- /dev/null +++ b/src/sources/x-timeline.ts @@ -0,0 +1,118 @@ +import { TwitterApi } from "twitter-api-v2"; +import { readFile } from "node:fs/promises"; +import { resolve } from "node:path"; +import type { Config } from "../config.js"; +import type { Settings } from "../settings.js"; +import type { RawTweet } from "../types.js"; + +export async function fetchHomeTimeline( + config: Config, + settings: Settings, +): Promise { + if (config.USE_SAMPLE_DATA) { + return loadSampleTweets(); + } + return fetchFromX(config, settings); +} + +async function loadSampleTweets(): Promise { + const path = resolve(import.meta.dirname, "../../fixtures/sample-tweets.json"); + const raw = await readFile(path, "utf-8"); + return JSON.parse(raw) as RawTweet[]; +} + +type RealConfig = Extract; + +async function fetchFromX( + config: RealConfig, + settings: Settings, +): Promise { + const client = new TwitterApi({ + appKey: config.X_CONSUMER_KEY, + appSecret: config.X_CONSUMER_SECRET, + accessToken: config.X_ACCESS_TOKEN, + accessSecret: config.X_ACCESS_TOKEN_SECRET, + }); + + const me = await client.v2.me(); + const userId = me.data.id; + console.info(`X 認証成功: @${me.data.username} (${userId})`); + + const cutoff = new Date( + Date.now() - settings.schedule.lookbackHours * 60 * 60 * 1000, + ); + const posts: RawTweet[] = []; + let paginationToken: string | undefined; + + while (posts.length < settings.schedule.maxTweets) { + const timeline = await client.v2.homeTimeline({ + max_results: 100, + ...(paginationToken ? { pagination_token: paginationToken } : {}), + "tweet.fields": "created_at,text,author_id,referenced_tweets,note_tweet", + "user.fields": "username", + expansions: "author_id,referenced_tweets.id", + exclude: "retweets", + }); + + if (!timeline.data.data?.length) break; + + const users = new Map(); + for (const user of timeline.includes?.users ?? []) { + users.set(user.id, user.username); + } + + const quotedTweets = new Map(); + for (const tweet of timeline.includes?.tweets ?? []) { + quotedTweets.set(tweet.id, tweet); + } + + for (const tweet of timeline.data.data) { + const createdAt = tweet.created_at ?? ""; + if (new Date(createdAt) < cutoff) { + return posts; + } + + const text = getNoteText(tweet) ?? tweet.text; + + let quotedText: string | undefined; + for (const ref of tweet.referenced_tweets ?? []) { + if (ref.type === "quoted") { + const quoted = quotedTweets.get(ref.id); + if (quoted) { + const quoteAuthor = users.get(quoted.author_id ?? "") ?? "unknown"; + const qText = getNoteText(quoted) ?? quoted.text; + quotedText = `引用ツイート by @${quoteAuthor}: ${qText}`; + } + } + } + + const author = users.get(tweet.author_id ?? "") ?? ""; + posts.push({ + authorId: author, + text, + createdAt, + url: `https://x.com/${author}/status/${tweet.id}`, + ...(quotedText ? { quotedText } : {}), + }); + } + + console.info(`→ これまでに ${posts.length}件 取得`); + + paginationToken = timeline.data.meta?.next_token; + if (!paginationToken) break; + + await sleep(1_000); + } + + return posts; +} + +function sleep(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +// twitter-api-v2 の型定義には note_tweet が含まれないため unknown 経由でアクセス +function getNoteText(tweet: unknown): string | undefined { + const obj = tweet as { note_tweet?: { text?: string } }; + return obj.note_tweet?.text; +} diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..27b2acd --- /dev/null +++ b/src/types.ts @@ -0,0 +1,11 @@ +export interface RawTweet { + authorId: string; + text: string; + createdAt: string; + url: string; + quotedText?: string; +} + +export interface EnrichedTweet extends RawTweet { + enrichedText: string; +} diff --git a/src/utils/chunk.ts b/src/utils/chunk.ts new file mode 100644 index 0000000..db6b5f5 --- /dev/null +++ b/src/utils/chunk.ts @@ -0,0 +1,7 @@ +export function chunkArray(arr: T[], size: number): T[][] { + const chunks: T[][] = []; + for (let i = 0; i < arr.length; i += size) { + chunks.push(arr.slice(i, i + size)); + } + return chunks; +} diff --git a/src/utils/errors.test.ts b/src/utils/errors.test.ts new file mode 100644 index 0000000..54ab8d1 --- /dev/null +++ b/src/utils/errors.test.ts @@ -0,0 +1,22 @@ +import { describe, it, expect } from "vitest"; +import { UserFacingError } from "./errors.js"; + +describe("UserFacingError", () => { + it("message を保持する", () => { + const err = new UserFacingError("APIキーが無効です"); + expect(err.message).toBe("APIキーが無効です"); + expect(err.name).toBe("UserFacingError"); + }); + + it("cause を保持する", () => { + const cause = new Error("original"); + const err = new UserFacingError("パース失敗", { cause }); + expect(err.cause).toBe(cause); + }); + + it("instanceof Error が true", () => { + const err = new UserFacingError("test"); + expect(err).toBeInstanceOf(Error); + expect(err).toBeInstanceOf(UserFacingError); + }); +}); diff --git a/src/utils/errors.ts b/src/utils/errors.ts new file mode 100644 index 0000000..09adfe9 --- /dev/null +++ b/src/utils/errors.ts @@ -0,0 +1,6 @@ +export class UserFacingError extends Error { + constructor(message: string, options?: { cause?: unknown }) { + super(message, options); + this.name = "UserFacingError"; + } +} diff --git a/src/utils/post-optimizer.test.ts b/src/utils/post-optimizer.test.ts new file mode 100644 index 0000000..c138e25 --- /dev/null +++ b/src/utils/post-optimizer.test.ts @@ -0,0 +1,102 @@ +import { describe, it, expect, vi } from "vitest"; +import { extractUrls, cleanText, expandUrls } from "./post-optimizer.js"; + +describe("extractUrls", () => { + it("テキストからURLを抽出する", () => { + const text = "Check out https://example.com and http://foo.bar/path"; + expect(extractUrls(text)).toEqual([ + "https://example.com", + "http://foo.bar/path", + ]); + }); + + it("URLがなければ空配列を返す", () => { + expect(extractUrls("no urls here")).toEqual([]); + }); + + it("t.co短縮URLも抽出する", () => { + const text = "見て https://t.co/abc123 すごい"; + expect(extractUrls(text)).toEqual(["https://t.co/abc123"]); + }); +}); + +describe("cleanText", () => { + it("URLを除去する", () => { + expect(cleanText("hello https://example.com world")).toBe("hello world"); + }); + + it("絵文字を除去する", () => { + expect(cleanText("すごい🔥ニュース")).toBe("すごいニュース"); + }); + + it("改行をスペースに変換する", () => { + expect(cleanText("line1\nline2")).toBe("line1 line2"); + }); + + it("全角スペースを除去する", () => { + expect(cleanText("全角\u3000スペース")).toBe("全角スペース"); + }); + + it("連続スペースを1つにまとめる", () => { + expect(cleanText("multiple spaces")).toBe("multiple spaces"); + }); + + it("連続する!を1つにまとめる", () => { + expect(cleanText("すごい!!!")).toBe("すごい!"); + }); + + it("連続する。を1つにまとめる", () => { + expect(cleanText("終わり。。。")).toBe("終わり。"); + }); + + it("複合的なクリーニングが正しく動く", () => { + const input = + "🔥 新モデル https://example.com が発表!!! すごい。。。"; + const expected = "新モデル が発表! すごい。"; + expect(cleanText(input)).toBe(expected); + }); +}); + +describe("expandUrls", () => { + it("空配列を渡すと空Mapを返す", async () => { + const result = await expandUrls([]); + expect(result.size).toBe(0); + }); + + it("x.com のURLを除外する", async () => { + vi.stubGlobal( + "fetch", + vi.fn().mockResolvedValue({ url: "https://x.com/user/status/123" }), + ); + const result = await expandUrls(["https://t.co/abc"]); + expect(result.size).toBe(0); + }); + + it("twitter.com のURLを除外する", async () => { + vi.stubGlobal( + "fetch", + vi.fn().mockResolvedValue({ url: "https://twitter.com/user/status/123" }), + ); + const result = await expandUrls(["https://t.co/def"]); + expect(result.size).toBe(0); + }); + + it("外部URLは元URL→展開URLのMapで返す", async () => { + vi.stubGlobal( + "fetch", + vi.fn().mockResolvedValue({ url: "https://openai.com/blog/gpt5" }), + ); + const result = await expandUrls(["https://t.co/ghi"]); + expect(result.size).toBe(1); + expect(result.get("https://t.co/ghi")).toBe("https://openai.com/blog/gpt5"); + }); + + it("fetchが失敗したURLはスキップする", async () => { + vi.stubGlobal( + "fetch", + vi.fn().mockRejectedValue(new Error("network error")), + ); + const result = await expandUrls(["https://t.co/fail"]); + expect(result.size).toBe(0); + }); +}); diff --git a/src/utils/post-optimizer.ts b/src/utils/post-optimizer.ts new file mode 100644 index 0000000..79a84a3 --- /dev/null +++ b/src/utils/post-optimizer.ts @@ -0,0 +1,67 @@ +const URL_RE = /https?:\/\/\S+/g; +const EMOJI_RE = + /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu; +const MULTI_SPACE_RE = /\s+/g; +const MULTI_BANG_RE = /!+/g; +const MULTI_PERIOD_RE = /。+/g; + +export function extractUrls(text: string): string[] { + return text.match(URL_RE) ?? []; +} + +export function cleanText(text: string): string { + let s = text; + s = s.replace(URL_RE, ""); + s = s.replace(EMOJI_RE, ""); + s = s.replace(/\n/g, " "); + s = s.replace(/\u3000/g, ""); + s = s.replace(MULTI_SPACE_RE, " "); + s = s.replace(MULTI_BANG_RE, "!"); + s = s.replace(MULTI_PERIOD_RE, "。"); + return s.trim(); +} + +const X_HOSTS = new Set(["x.com", "twitter.com", "t.co"]); + +/** + * 短縮URLを並列HEAD展開し、x.com/twitter.com/t.co 系を除外した + * Map<元の短縮URL, 展開後URL> を返す。 + */ +export async function expandUrls( + urls: string[], + timeoutMs = 5_000, +): Promise> { + const mapping = new Map(); + if (urls.length === 0) return mapping; + + const results = await Promise.allSettled( + urls.map(async (originalUrl) => { + const ctl = new AbortController(); + const timer = setTimeout(() => ctl.abort(), timeoutMs); + try { + const res = await fetch(originalUrl, { + method: "HEAD", + redirect: "follow", + signal: ctl.signal, + }); + return { originalUrl, expandedUrl: res.url }; + } finally { + clearTimeout(timer); + } + }), + ); + + for (const r of results) { + if (r.status !== "fulfilled") continue; + const { originalUrl, expandedUrl } = r.value; + try { + if (!X_HOSTS.has(new URL(expandedUrl).hostname)) { + mapping.set(originalUrl, expandedUrl); + } + } catch { + // invalid URL — skip + } + } + + return mapping; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f035f7d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "noUncheckedIndexedAccess": true, + "outDir": "dist" + }, + "include": ["src/**/*.ts"] +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..686d668 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + unstubGlobals: true, + restoreMocks: true, + }, +});