@first-ch/tools-mcp 0.44.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP server exposing [First CH Tools](https://tools.first-ch.com)' free web-tool logic — WCAG contrast, JP character/X-weight counting, WebP conversion, JSON-LD generation, llms.txt generation, encoding/line-ending conversion, Marp Markdown→slide rendering, Japanese/English test-data generation, text/code diffing, cron-expression explanation, Base64/data-URI encoding, URL query-parameter editing, HTML entity escaping/unescaping, JSON⇄YAML conversion, px ⇄ rem/em unit conversion, colour-code conversion with alpha compositing, MD5/SHA-1/SHA-256/SHA-384/SHA-512 hashing, JWT decoding with expiry and signature checks, User-Agent parsing with device/bot detection, bulk UUID v4 / ULID generation, aspect-ratio calculation with responsive sizing, case conversion between camelCase, snake_case and kebab-case, CSV/TSV ⇄ JSON conversion, IP/CIDR calculation with subnet splitting and IP-range reduction, business-day date calculation with Japanese public holidays, HTML-to-Markdown conversion, Japanese era ⇄ Western date conversion with age calculation, and URL-slug generation from Japanese titles — to AI agents such as Claude Code. All of those run on your machine.
4
4
 
5
- It also ships **`app_*` tools** for the 37 web apps at [apps.first-ch.com](https://apps.first-ch.com) (site checks such as GEO/AI-search readiness, meta tags, security headers, SSL certificates, DNS and email DNS, redirects, broken links, structured data, AI-crawler access, Japanese readability, and AI-assisted business-tone and LP-copy checks). Unlike the local tools, **an `app_*` tool sends its input (a URL, domain name or text) to apps.first-ch.com** and returns the JSON the app's API responds with — see [Network access, files and privacy](#network-access-files-and-privacy).
5
+ It also ships **`app_*` tools** for the 38 web apps at [apps.first-ch.com](https://apps.first-ch.com) (site checks such as GEO/AI-search readiness, meta tags, security headers, SSL certificates, DNS and email DNS, redirects, broken links, structured data, AI-crawler access, Japanese readability, and AI-assisted business-tone and LP-copy checks). Unlike the local tools, **an `app_*` tool sends its input (a URL, domain name or text) to apps.first-ch.com** and returns the JSON the app's API responds with — see [Network access, files and privacy](#network-access-files-and-privacy).
6
6
 
7
7
  日本語版は [後半セクション](#日本語) を参照してください。
8
8
 
@@ -90,6 +90,7 @@ This server is also registered in the [MCP Registry](https://registry.modelconte
90
90
  | `css_layout_generate` | Builds copy-ready CSS and HTML for a Flexbox or CSS Grid layout (same logic as tools.first-ch.com/css-layout/). Only non-default declarations are written, repeated tracks fold into `repeat()`. Validates `grid-template-areas` (equal cell counts per row, rectangular names, valid names, track-count mismatch) and emits `grid-area` rules. Notes flag combinations that do nothing (flex-grow vs justify-content, align-content with nowrap, 1fr tracks leaving no free space) and common pitfalls (min-width: auto overflow, 1fr minimum, reverse/dense reading order). Eight presets (holy grail, auto-fit grid, sidebar, header…) | `mode?` (`flex` / `grid` / `presets`), `preset?`, flex: `direction?`, `wrap?`, `justifyContent?`, `alignItems?`…; grid: `columns?`, `rows?`, `areas?`, `autoFit?`, `flow?`…; `gap?`, `count?`, `items?`, `lang?` |
91
91
  | `wiki_doc_lint` | Audits an exported internal wiki — Markdown, HTML or text exported from Notion, Backlog Wiki, Confluence and the like (same logic as tools.first-ch.com/wiki-doc-lint/). Returns **near-duplicate page pairs** (`duplicates`: Jaccard index of four-character fragments of the text with symbols and spaces removed, at or above `threshold`, with the lines only one side has and a fix that keeps the page with more incoming links, or the longer one on a tie), **orphan pages that no other page links to** (`orphans`, with `addLine` — the link line to add to a Notion-style parent or a contents page; index/README/home pages are not counted unless `entryPages=false`), **inconsistent and outdated terms** (`terms`: a "preferred ← variant" dictionary — your `dictionary` is added to the default one — plus Japanese katakana words found both with and without a final long-vowel mark, suggesting the majority form; every hit has its line and the line before/after the fix), **broken links** (`broken`: relative links with a document extension and `[[Page name]]` links whose target is not among the files) and a Markdown `report` of suggested fixes. Links are read from `[text](path)`, `[[Page name]]` and `<a href>`, matched by relative path, title, Notion file names with their IDs and the page name at the end of Notion/Confluence URLs. Code blocks, inline code, URLs and tags are skipped for terms, and matches inside a longer word (ユーザ in ユーザビリティ, Javascript in Javascripts) are ignored. Pass `paths` (absolute files or folders, read recursively; hidden folders and node_modules are skipped) or `files`. UTF-8, Shift_JIS and UTF-16 (BOM) are detected; up to 3,000 files / 60 MB. Read-only — it never edits the files | `paths?` or `files?` (`[{ path, text }]`), `threshold?` (0.5–1, default 0.8), `dictionary?`, `useDefaultDictionary?`, `autoChoon?`, `entryPages?`, `format?` (`both` default / `json` / `markdown`), `lang?` (`ja` default / `en`) |
92
92
  | `fit_to_box` | Character size and line breaks for writing a string by hand into a printed box — e.g. the address, amount and name boxes on the inner envelope (nakabukuro) of a Japanese wedding or condolence money envelope (same logic as tools.first-ch.com/en/nakabukuro-ran/). From the box width and height (mm) and direction, returns the character size that fits (mm, rounded down to 0.1 mm), the line count and each line. Size uses a 1.5 mm margin inside each side and a 0.3× line gap, limited by both line length and line count (half-width letters/digits count as 0.6 in horizontal boxes; caps of 9 mm for addresses, 14 mm for amount/name). `kind: "address"` breaks between the street number and the building/room first, and only when that cannot reach 4 mm also after the prefecture/city or before the street number (runs like 12番地の18 or 1203号室 are never split; a line break in `text` marks the building; up to 4 lines); `postalCode` adds a 〒 line; vertical boxes get kanji street numbers (`numerals`: `digits` = 一〇, `tens` = 十). Below 4 mm, `alternatives` gives the size and lines with the prefecture dropped and with the building on two lines (it does not decide what may be dropped); `asIs` is how many characters spill out when written unbroken at 5 mm. `kind: "amount"` writes 30000 / 3万 / 30,000円 in formal numerals (daiji) as 金参萬円 (1–99,999,999; 圓, 也 and pre-printed 金/円 supported); `name` breaks only at spaces; `plain` takes any text | `text`, `width`, `height` (mm), `orientation?` (`vertical` default / `horizontal`), `kind?` (`address` default / `name` / `amount` / `plain`), `postalCode?`, `numerals?`, `thousandChar?` (阡 default / 千 / 仟), `yenChar?` (円 / 圓), `nari?`, `kinEnPrinted?`, `lang?` |
93
+ | `invoice_nebiki_check` | For a freelancer in Japan who is **not a registered invoice issuer** and is asked for a price cut (same logic as tools.first-ch.com/invoice-nebiki/). From three answers — the client's consumption tax `method` (`general` / `simplified` / `niwari` 20% rule / `sanwari` 30% rule / `exempt` / `unknown`), `party` (`individual` / `corporation`, required for the special rules) and `small` (is one invoice under ¥10,000 incl. tax) — returns `rows` per period from `today`: `diff` (monthly difference = amount × 10/110 × 20/30/50/70/100%, rounded down), `none` or `check`. The 20% rule gives no difference to 2026 for sole proprietors and to the tax period including Sep 30, 2026 for corporations; the 30% rule covers sole proprietors' 2027–2028 only; after that `recheck: true` (no assumption of simplified taxation). Purchases that may fall under the small-amount rule (to Sep 30, 2029) are `check`. Optional `monthly`, `cutRate` / `cutAmount` add a comparison; `message` asks only the open points (`format: "md"` for Markdown) and always carries the four assumptions; `showAmount: false` hides yen amounts. |
93
94
 
94
95
  ### App tools (`app_*`, sent to apps.first-ch.com)
95
96
 
@@ -117,6 +118,7 @@ Each `app_*` tool calls one app's public JSON API (`POST https://apps.first-ch.c
117
118
  | `app_mixed_content` | [Mixed Content Checker](https://apps.first-ch.com/en/mixed-content/) — Enter a URL to list every http:// reference left inside an https page (img, script, link, iframe, video, source and CSS url()), with its line number, the offending tag and how to fix it. References browsers block are separated from the ones they auto-upgrade. | `url` |
118
119
  | `app_image_audit` | [Page Image Audit](https://apps.first-ch.com/en/image-audit/) — Enter a URL to audit every img / picture on the page: format (WebP / AVIF adoption), loading=lazy, width/height attributes and alt text. For the first 30 images the real file size and served format are measured with a HEAD request. | `url` |
119
120
  | `app_gazou_ichijouhou` | [Photo Location Leak Check](https://apps.first-ch.com/en/gazou-ichijouhou/) — Pairs each JPEG on a page with its WordPress original (the URL without the -WIDTHxHEIGHT / -scaled suffix on the same server) and checks whether the Exif still holds the shooting location (GPS latitude and longitude). Each call judges five pairs from `offset` and returns the list of pairs (first 20), a state and reason per image and the next `offset`; call again until `next` is null. Coordinates, capture dates and image bytes are never returned, and "none" is not a guarantee. | `url`, `offset?` |
121
+ | `app_shashin_sozai_moto` | [Photo License Check Before Switching Web Agencies](https://apps.first-ch.com/en/shashin-sozai-moto/) — Lists up to 30 photos in the img / srcset / picture tags of one page, flags file names in a stock-site format (currently AdobeStock_number only) and, for JPEGs, returns the creator, credit and copyright text in the XMP / IPTC of the first 128KB (up to 60 characters each). Each call judges ten photos from `offset` and returns the photo list, a state and reason per photo and the next `offset`; call again until `next` is null. CSS background images and images added by JavaScript are out of scope. Image bytes and the page itself are never returned, and rights or legality are not judged. | `url`, `offset?` |
120
122
  | `app_hp_sumaho_check` | [Look at Our Site on Your Phone — 3-Question Check Card](https://apps.first-ch.com/en/hp-sumaho-check/) — Reads the page's HTML and up to 3 same-site stylesheets (96KB / 2,000 rules parsed in total) for three mobile points: a tel: link for every phone number in the text, sideways scrolling (viewport width=device-width, fixed width / min-width of 900px+ on body, #wrapper and similar) and text & zoom (user-scalable=no, maximum-scale=1, body / p below 12px). Each point is `check` / `none` / `unknown` (with reasons), with locations (HTML line, CSS file and line) and fix hints, plus up to 3 yes/no questions to ask someone checking on a real phone and a share URL with `ref`. No pass/fail or score, not a judgement of real rendering; the page and CSS are never returned. | `url` |
121
123
  | `app_tech_detect` | [Tech Stack Detector](https://apps.first-ch.com/en/tech-detect/) — Enter a URL to infer the CMS (WordPress, Shopify, Wix, STUDIO and more), framework, CDN, analytics tags (GA4/GTM) and web fonts from HTML and header signatures — always with the evidence behind each guess. | `url` |
122
124
  | `app_gaibu_soushinsaki` | [Third-Party Tag Inventory](https://apps.first-ch.com/en/gaibu-soushinsaki/) — Fetches one page and matches the script src, img and iframe hosts and inline install snippets in its HTML against a table of 18 major analytics, advertising and social-embed services (Google, Meta, Microsoft, LinkedIn, LY Corporation, X). Returns the company count, per-service details (typical purpose, where to stop it, official source), discontinued services such as Universal Analytics, external hosts not in the table, and a CSV checklist. It only reads what is written in the HTML: it does not verify actual data transmission or legal compliance, and tags inside a tag manager are invisible. | `url` |
@@ -191,7 +193,7 @@ Release rule: a push to `main` automatically publishes a new package version thr
191
193
 
192
194
  `@first-ch/tools-mcp` は、[First CH Tools](https://tools.first-ch.com)(無料Webツール集)の計算ロジック — WCAGコントラスト比・日本語文字数/Xウェイト計測・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/編集/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4 / ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・camelCase / snake_case / kebab-case などの文字列ケース変換・CSV/TSV ⇄ JSON の相互変換・日数/営業日の計算(日本の祝日を内蔵)・HTML→Markdownの変換・和暦⇄西暦の変換と満年齢の計算・日本語タイトルからのURLスラッグ生成 — をAIエージェント(Claude Code等)向けMCPツールとして提供するサーバーです。これらは全て端末内で処理します。
193
195
 
194
- あわせて、[apps.first-ch.com](https://apps.first-ch.com) のWebアプリ37本(GEO・メタタグ・セキュリティヘッダー・SSL証明書・DNS/メールDNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・AIによるビジネス文面/LP文言のチェックなど)を呼ぶ **`app_*` ツール**も提供します。**`app_*` ツールは入力(URL・ドメイン名・文面)を apps.first-ch.com のサーバーへ送り**、アプリの API が返した JSON を返します(端末内で完結する他のツールとはここが違います)。詳しくは [通信・ファイル・プライバシー](#通信ファイルプライバシー) を参照してください。
196
+ あわせて、[apps.first-ch.com](https://apps.first-ch.com) のWebアプリ38本(GEO・メタタグ・セキュリティヘッダー・SSL証明書・DNS/メールDNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・AIによるビジネス文面/LP文言のチェックなど)を呼ぶ **`app_*` ツール**も提供します。**`app_*` ツールは入力(URL・ドメイン名・文面)を apps.first-ch.com のサーバーへ送り**、アプリの API が返した JSON を返します(端末内で完結する他のツールとはここが違います)。詳しくは [通信・ファイル・プライバシー](#通信ファイルプライバシー) を参照してください。
195
197
 
196
198
  ### インストール
197
199
 
@@ -277,6 +279,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
277
279
  | `css_layout_generate` | Flexbox / CSS Grid の指定から、コピーして使える CSS と HTML を作る(tools.first-ch.com/css-layout/ と同一ロジック)。既定値と同じ宣言は書かず、同じトラックは repeat() に畳む。grid-template-areas を検証し(行ごとのマス数・名前が長方形か・使えない名前・列トラック数との食い違い)、名前ごとの grid-area を出す。効かない組み合わせ(flex-grow と justify-content・nowrap の align-content・1fr で余白が無い)と落とし穴(min-width: auto のあふれ・1fr の最小値・reverse/dense の読む順)を notes で指摘。定番8種のプリセット | `mode?`(`flex` / `grid` / `presets`), `preset?`, flex: `direction?`・`wrap?`・`justifyContent?`・`alignItems?` ほか、grid: `columns?`・`rows?`・`areas?`・`autoFit?`・`flow?` ほか、`gap?`, `count?`, `items?`, `lang?` |
278
280
  | `wiki_doc_lint` | Notion・Backlog Wiki・Confluence などから書き出した社内文書(Markdown / HTML / テキスト)を点検する(tools.first-ch.com/wiki-doc-lint/ と同一ロジック)。**内容がほぼ同じページの組**(`duplicates`: 記号と空白を除いた本文の4文字単位の断片の Jaccard 係数が `threshold` 以上の組・それぞれにしかない行・被リンクの多い方〔同数なら本文が長い方〕を残す修正案)、**ほかのどのページからもリンクされていない孤立ページ**(`orphans`: Notion 型の親ページか目次ページに足すリンクの1行 `addLine` つき。index・README・home などの目次ページは `entryPages=false` にしない限り数えない)、**表記ゆれ・旧称**(`terms`: 「揃える表記 ← ゆれ」の辞書〔`dictionary` は既定の辞書に足す〕と、辞書に無いカタカナ語の語末の長音ゆれ〔多い方に揃える案〕。各箇所の行番号と修正前後の文)、**リンク切れ**(`broken`: 文書の拡張子を持つ相対リンクと `[[ページ名]]` のうち行き先が無いもの)、修正案をまとめた Markdown の `report` を返す。リンクは `[文字](パス)`・`[[ページ名]]`・a タグを読み、相対パス・ページ名・Notion のIDつきファイル名・Notion/Confluence のURL末尾のページ名で照合する。コードブロック・インラインコード・URL・タグは表記ゆれの対象外で、語の途中(ユーザビリティの中のユーザ)は拾わない。`paths`(ファイル・フォルダーの絶対パス。サブフォルダーまで読み、隠しフォルダーと node_modules は飛ばす)か `files` を渡す。UTF-8・Shift_JIS・UTF-16(BOM)を自動判別し、3,000ファイル・合計60MBまで。ファイルは読むだけで書き換えない | `paths?` または `files?`(`[{ path, text }]`)、`threshold?`(0.5〜1・既定 0.8)、`dictionary?`、`useDefaultDictionary?`、`autoChoon?`、`entryPages?`、`format?`(既定 `both` / `json` / `markdown`)、`lang?`(既定 `ja` / `en`) |
279
281
  | `fit_to_box` | 印刷済みの記入欄(市販の中袋〔ご祝儀袋・香典袋〕の「住所」「金額」「氏名」の欄など)に手で書くとき、欄の幅・高さ(mm)と向きから、収まる1字の大きさ(mm・0.1mm単位で切り捨て)・行数・改行した後の各行を返す(tools.first-ch.com/nakabukuro-ran/ と同一ロジック)。欄の線から内側へ1.5mmずつ余白を取り、行間を字の0.3倍として、行の長さと行数の両方から決める(横書きの半角英数は0.6字分・上限は住所9mm・金額と氏名14mm)。`kind: "address"` は「〜番地」と「建物名・部屋番号」の境目で改行し、そこで4mmに届かないときだけ都道府県・市区町村の後や番地の前でも区切る(「12番地の18」「1203号室」など数字の並びの途中では切らない・`text` の改行は建物名の前として扱う・最大4行)。`postalCode` で「〒」の行を先頭に足し、縦書きの欄では番地を漢数字にする(`numerals`: `digits`=一〇型 / `tens`=十型)。1字が4mm未満なら `alternatives` に「都道府県を省いた場合」「建物名を2行にした場合」の大きさと行を返す(省いてよいかは判断しない)。`asIs` は改行せずに1字5mmで書いたときにはみ出す字数。`kind: "amount"` は 30000・3万・30,000円 を大字の「金参萬円」にして欄に合わせる(1〜99,999,999円・圓/也/「金」「円」が印刷済みに対応)。`name` は空白でだけ改行し、`plain` は任意の文字列 | `text`、`width`・`height`(mm)、`orientation?`(既定 `vertical` / `horizontal`)、`kind?`(既定 `address` / `name` / `amount` / `plain`)、`postalCode?`、`numerals?`、`thousandChar?`(既定 阡 / 千 / 仟)、`yenChar?`(円 / 圓)、`nari?`、`kinEnPrinted?`、`lang?` |
282
+ | `invoice_nebiki_check` | インボイス未登録のまま取引先から値下げを求められた個人の制作者向け(tools.first-ch.com/invoice-nebiki/ と同一ロジック)。取引先の申告方式 `method`(`general` 一般課税・`simplified` 簡易課税・`niwari` 2割特例・`sanwari` 3割特例・`exempt` 免税・`unknown`)、`party`(個人・法人。特例では必須)、`small`(1回の請求が税込1万円未満か)の3問から、`today` を含む時期以降を `diff`(差あり・月額=税込×10/110×20/30/50/70/100% の1円未満切り捨て)・`none`(差なし)・`check`(要確認)で返す。2割特例は個人2026年分・法人は2026年9月30日を含む課税期間まで、3割特例は個人の2027・2028年分だけで、期限後は `recheck: true`(簡易課税へ移ったとは仮定しない)。少額特例(2029年9月30日まで)が効きうる取引は要確認。任意の `monthly`・`cutRate`/`cutAmount` で値下げと比べ、`message` は要確認の点だけを尋ねる確認文(前提4点つき・`format: "md"` で Markdown)。`showAmount: false` で金額を出さない。 |
280
283
 
281
284
  #### apps のツール(`app_*`・apps.first-ch.com へ送信)
282
285
 
@@ -304,6 +307,7 @@ claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
304
307
  | `app_mixed_content` | [混在コンテンツチェッカー](https://apps.first-ch.com/mixed-content/) — https のページに残った http:// の参照(img・script・link・iframe・video・source・CSS の url())を抽出し、行番号・タグ・直し方と、ブラウザがブロックするか自動で https 化されるかを返す。見つかった http:// のURLへはアクセスしない。 | `url` |
305
308
  | `app_image_audit` | [ページ内画像診断](https://apps.first-ch.com/image-audit/) — URLのページ内の img / picture を抽出し、フォーマット(WebP・AVIF 対応)・loading=lazy・width/height の指定・alt を診断する。先頭30枚は HEAD リクエストで実際のファイルサイズと形式まで測る。 | `url` |
306
309
  | `app_gazou_ichijouhou` | [写真の位置情報チェック](https://apps.first-ch.com/gazou-ichijouhou/) — URLのページの JPEG と、WordPress の元画像の候補(-幅x高さ・-scaled を外した同じサーバーのURL)を組にして、Exif に撮影場所(GPS の緯度・経度)が残っていないかを調べる。1回で offset から5組を判定し、組の一覧(先頭20組)・画像ごとの状態と理由・次の offset を返す(next が null になるまで呼ぶ)。座標・撮影日時の値と画像のバイト列は返さない。「none」は安全の保証ではない。 | `url`, `offset?` |
310
+ | `app_shashin_sozai_moto` | [HP乗り換え前の写真名義チェック](https://apps.first-ch.com/shashin-sozai-moto/) — URLのページの img・srcset・picture の写真を最大30枚拾い、素材サイト形式のファイル名(現在は AdobeStock_数字 のみ)と、JPEG の先頭128KBの XMP・IPTC にある撮影者・クレジット・著作権表記(各60字まで)を返す。1回で offset から10枚を判定し、写真の一覧・写真ごとの状態と理由・次の offset を返す(next が null になるまで呼ぶ)。CSS の背景画像と JavaScript で足される画像は対象外。画像のバイト列とページの原文は返さず、権利関係や違法性は判定しない。 | `url`, `offset?` |
307
311
  | `app_hp_sumaho_check` | [うちのHP、スマホで見て3つ教えて|確認依頼カード](https://apps.first-ch.com/hp-sumaho-check/) — ページの HTML と同じサイトの CSS(最大3本・解析は合計96KB/2,000規則まで)から、①本文の電話番号ごとの tel: リンク ②横ずれ(viewport の width=device-width・body や #wrapper 等の900px以上の固定幅) ③文字と拡大(user-scalable=no・maximum-scale=1・body/p の12px未満)を check/none/unknown(理由つき)で返し、記述の位置・直し方の要点と、実機で見てもらう人に聞く「はい/いいえ」の質問(最大3問)・ref 付きの共有URLを返す。合否・点数は出さず、実機の表示の判定ではない。原文は返さない。 | `url` |
308
312
  | `app_tech_detect` | [技術スタック検出](https://apps.first-ch.com/tech-detect/) — URLのページの HTML と応答ヘッダーのシグネチャから、CMS(WordPress・Shopify・Wix・STUDIO 等)・フレームワーク・CDN・解析タグ(GA4/GTM)・Webフォントを推定し、そう判断した根拠(どこで何に合致したか)と一緒に返す。 | `url` |
309
313
  | `app_gaibu_soushinsaki` | [外部タグ棚卸し(解析・広告・SNS埋め込み)](https://apps.first-ch.com/gaibu-soushinsaki/) — URLのページを1回だけ取得し、HTMLに書かれた script の src・img・iframe の外部ホストとインラインの設置スニペットを、主要18サービス(Google・Meta・Microsoft・LinkedIn・LINEヤフー・X)の対応表と照合する。会社数・サービスごとの明細(一般的な用途・止める場所・公式資料の出典)・終了済みサービス(UA など)・表にない外部ホストと、確認用の棚卸し表(CSV)を返す。HTMLに書かれたタグだけを見るもので、実際の送信や法令への適合は判定しない(タグマネージャー経由のタグは見えない)。 | `url` |
package/apps.mjs CHANGED
@@ -233,6 +233,28 @@ const DEFS = [
233
233
  lang: LANG,
234
234
  },
235
235
  },
236
+ {
237
+ slug: 'shashin-sozai-moto',
238
+ apiPath: '/shashin-sozai-moto/api/check',
239
+ title: 'HP乗り換え前の写真名義チェック(素材サイト形式の名前・撮影者や権利者の記載)',
240
+ summary:
241
+ 'URLのページの HTML にある img・srcset・picture の写真を最大30枚拾い、①ファイル名が素材サイト形式(現在は AdobeStock_数字 のみ)か(stock)、' +
242
+ '②JPEG だけ先頭128KBの XMP・IPTC にある撮影者・クレジット・著作権表記(credits。各60字まで・URL も文字列のまま)を返す。' +
243
+ '1回の呼び出しで offset から10枚を判定し、写真の一覧(ファイル名・URL・形式・stock)・各写真の状態(found=記載あり/none=JPEG を読み切って記載なし/unsupported=JPEG 以外/unknown=取得や解析が完了しない)と理由・次に呼ぶ offset(next)を返す。' +
244
+ '30枚すべてを調べるには next が null になるまで offset を 0・10・20 と変えて呼ぶ。31件目以降は一覧だけで未検査。CSS の背景画像と JavaScript で後から足される画像は対象外。' +
245
+ '画像のバイト列とページの原文は返さない。権利関係や違法性は判定しない(制作会社へ名義・譲渡・乗り換え後の利用を確かめる手がかり)。同じIPから10分に30回まで(超えると HTTP 429)。',
246
+ sends: '入力したURL',
247
+ fetches: true,
248
+ slow: true,
249
+ inputSchema: {
250
+ url: URL_PARAM('写真を載せているページのURL'),
251
+ offset: z
252
+ .union([z.literal(0), z.literal(10), z.literal(20)])
253
+ .optional()
254
+ .describe('何枚目から10枚を調べるか(0・10・20。既定 0)。前回の応答の next を渡す'),
255
+ lang: LANG,
256
+ },
257
+ },
236
258
  {
237
259
  slug: 'hp-sumaho-check',
238
260
  apiPath: '/hp-sumaho-check/api/check',
@@ -0,0 +1,412 @@
1
+ /* インボイス値下げ、応じる前に相手へ聞く3問チェック(invoice_nebiki_check)
2
+ * 判定と文面のコアは FirstCHTools の site/invoice-nebiki/lib.mjs と同一
3
+ * (2箇所ルール: site側が正本・片方を直したらもう片方も同じ内容で反映する)。
4
+ * 両ファイルの「ここからコア」〜「ここまでコア」はバイト一致する(どちらも ES module):
5
+ * diff <(sed -n '/^\/\/ ===== ここから/,/^\/\/ ===== ここまで/p' site/invoice-nebiki/lib.mjs) <(sed -n '/^\/\/ ===== ここから/,/^\/\/ ===== ここまで/p' invoice-nebiki.mjs)
6
+ *
7
+ * インボイス発行事業者でない側(個人の制作者など)が取引先から値下げを求められたとき、取引先の申告方式・個人か法人か・
8
+ * 1回の請求が税込1万円未満かの3問から、時期別に「差あり(月額)・差なし・要確認」を返し、要確認の点だけを尋ねる確認文を作る。
9
+ * 制度の数字(2026-11-05 確認): 国税庁「インボイス制度に関する令和8年度税制改正について」・「少額特例の概要」。
10
+ * 自分の納税額・登録の要否・違法かどうか・相手の方式や規模の推定・法人税等は扱わない。完全ローカル処理・ネットワーク送信なし。 */
11
+
12
+ // ===== ここからコア =====
13
+ export const METHODS = ['general', 'simplified', 'niwari', 'sanwari', 'exempt', 'unknown'];
14
+ export const PARTIES = ['individual', 'corporation'];
15
+ export const SMALLS = ['yes', 'no', 'unknown'];
16
+
17
+ // 時期の区切り(この日から)。pct は、登録事業者からの仕入れなら控除できた税額のうち、相手が控除できなくなる割合
18
+ // (経過措置で控除できる割合 80→70→50→30→0% の残り)。同じ pct が続く区切りは、特例の終わりで行を分けるためのもの
19
+ export const SEGMENTS = [
20
+ { from: '2023-10-01', pct: 20 },
21
+ { from: '2026-10-01', pct: 30 },
22
+ { from: '2027-01-01', pct: 30 }, // 個人の2割特例は2026年分まで
23
+ { from: '2027-10-01', pct: 30 }, // 法人の「2026年9月30日を含む課税期間」は遅くともこの前日までに終わる
24
+ { from: '2028-10-01', pct: 50 },
25
+ { from: '2029-01-01', pct: 50 }, // 個人の3割特例は2028年分まで
26
+ { from: '2029-10-01', pct: 50 }, // 少額特例は2029年9月30日までの仕入れ
27
+ { from: '2030-10-01', pct: 70 },
28
+ { from: '2031-10-01', pct: 100 },
29
+ ];
30
+
31
+ export class InvoiceNebikiError extends Error {
32
+ constructor(code, message) { super(message); this.code = code; }
33
+ }
34
+
35
+ export const T = {
36
+ ja: {
37
+ method: { general: '一般課税', simplified: '簡易課税', niwari: '2割特例', sanwari: '3割特例', exempt: '免税事業者・消費者', unknown: 'わからない' },
38
+ party: { individual: '個人', corporation: '法人' },
39
+ small: { yes: '税込1万円未満', no: '税込1万円以上', unknown: 'わからない' },
40
+ status: { diff: '差あり', none: '差なし', check: '要確認' },
41
+ recheck: '方式の再確認が必要',
42
+ month: function (ym) { return Number(ym.slice(0, 4)) + '年' + Number(ym.slice(5, 7)) + '月'; },
43
+ range: function (a, b) { return a + '〜' + (b || ''); },
44
+ yen: function (n) { return '月' + n.toLocaleString('ja-JP') + '円'; },
45
+ pctOf: function (p) { return '税込額の約' + p + '%'; },
46
+ note: {
47
+ exempt: '相手は仕入税額控除をしないため、登録の有無で差は出ません(相手が課税事業者になれば変わります)。',
48
+ simplified: '簡易課税は売上の税額から控除額を計算するため、登録の有無で差は出ません(相手が簡易課税を続ける間)。',
49
+ niwari: '2割特例は売上の税額から納税額を計算するため、差は出ません。',
50
+ niwari_end_ind: '2割特例は個人の2026年分まで。2027年分からの方式は相手への確認が必要です(簡易課税へ移ったとは仮定しません)。',
51
+ niwari_corp_fy: '法人の2割特例は2026年9月30日を含む課税期間まで。その課税期間の末日までは差なし、その後は方式の再確認が必要です。',
52
+ niwari_end_corp: '2026年9月30日を含む課税期間は終わっています。今の方式は相手への確認が必要です(簡易課税へ移ったとは仮定しません)。',
53
+ sanwari_before: '3割特例は個人の2027年分からです。2026年分の方式は相手への確認が必要です。',
54
+ sanwari: '3割特例は売上の税額から納税額を計算するため、差は出ません。',
55
+ sanwari_end: '3割特例は2028年分まで。2029年分からの方式は相手への確認が必要です(簡易課税へ移ったとは仮定しません)。',
56
+ sanwari_corp: '3割特例は個人事業者だけの特例です。法人である相手の方式は確認が必要です。',
57
+ general: function (pct) { return (pct >= 100 ? '相手は税額を控除できず、全額が差になります' : '相手は税額の' + (100 - pct) + '%しか控除できず、' + pct + '%分の控除が減ります') + '(少額特例など全額控除できる取引を除いた概算)。'; },
58
+ generalShort: function (pct) { return pct >= 100 ? '控除なし(経過措置の終了)' : '控除できるのは' + (100 - pct) + '%(経過措置)'; },
59
+ small_yes: '1回が税込1万円未満の取引は、相手が少額特例(2029年9月30日まで)の対象なら全額控除でき差なし。対象かは相手の売上規模で決まるため確認が必要です。',
60
+ small_unknown: '1回の請求が税込1万円未満かで変わります。1万円未満で、相手が少額特例の対象なら差なし。',
61
+ method_unknown: '相手の方式で変わります。一般課税なら差あり、簡易課税・2割特例・3割特例・免税なら差なし。',
62
+ },
63
+ paren: function (s) { return '(' + s + ')'; },
64
+ hint: function (amt, pctText) { return '一般課税で全額控除できない取引なら ' + (amt != null ? amt + '(' + pctText + ')' : pctText); },
65
+ premises: [
66
+ '概算です(税込10%の請求額から計算し、1円未満は切り捨て)。',
67
+ '相手が登録事業者からの仕入れなら全額を控除でき、帳簿と請求書の保存要件を満たしている場合に限ります。',
68
+ '法人税・所得税などへの影響は含めていません。',
69
+ '特例(2割特例・3割特例・少額特例・簡易課税)を使えるかどうかは、相手が判断します。',
70
+ ],
71
+ premisesTitle: '前提',
72
+ cut: {
73
+ none: '言われた値下げを入れると、相手側の差と比べます。',
74
+ needMonthly: '値下げを金額で比べるには、月の請求額を入れてください。',
75
+ noDiff: function (cut) { return '言われた値下げは' + cut + '。今の時期、前提のもとで相手側の差は出ない見込みです。'; },
76
+ check: function (cut) { return '言われた値下げは' + cut + '。要確認の点が分かるまで、相手側の差は確定しません。'; },
77
+ ratio: function (cut, diff, r) { return '言われた値下げ(' + cut + ')は、相手側の差(' + diff + ')の約' + r + '倍です。'; },
78
+ below: function (cut, diff) { return '言われた値下げ(' + cut + ')は、相手側の差(' + diff + ')より小さい額です。'; },
79
+ same: function (cut, diff) { return '言われた値下げ(' + cut + ')は、相手側の差(' + diff + ')とほぼ同じです。'; },
80
+ rate: function (r) { return '請求額の' + r + '%'; },
81
+ },
82
+ msg: {
83
+ to: '(取引先名)様',
84
+ hello: 'いつもお世話になっております。',
85
+ askLead: '先日ご相談いただいたお支払い額の見直しについて、こちらでも影響を正しく把握したく、次の点を教えていただけますでしょうか。',
86
+ askEnd: 'お答えいただいた内容をもとに、条件をあらためてご相談させてください。',
87
+ tellLead: function (facts) { return '先日ご相談いただいたお支払い額の見直しについて、伺った内容(' + facts + ')をもとに整理しました。'; },
88
+ tellEnd: '上の見込みを踏まえて、条件をご相談させてください。',
89
+ rowDiff: function (label, v) { return label + ':差は' + v + 'の見込み'; },
90
+ rowNone: function (label) { return label + ':差は出ない見込み'; },
91
+ premiseHead: '当方の試算の前提',
92
+ premises: [
93
+ '概算です(税込10%の請求額から計算し、1円未満は切り捨て)。',
94
+ '貴社が登録事業者からの仕入れなら全額を控除でき、帳簿と請求書の保存要件を満たしている場合に限ります。',
95
+ '法人税・所得税などへの影響は含めていません。',
96
+ '特例(2割特例・3割特例・少額特例・簡易課税)を使えるかどうかは、貴社のご判断によります。',
97
+ ],
98
+ q: {
99
+ method_unknown: '貴社の消費税の申告方式は、一般課税・簡易課税・2割特例・3割特例のどれでしょうか(免税事業者の場合もお知らせください)。',
100
+ small: '当方への1回のお支払いが税込1万円未満となる取引について、少額特例(インボイスがなくても帳簿の保存だけで全額控除できる、2029年9月30日までの特例)をお使いでしょうか。',
101
+ niwari_ind: '2割特例は2026年分までと承知しています。2027年分以降の申告方式(3割特例・簡易課税・一般課税など)のご予定を教えてください。',
102
+ niwari_corp: '2割特例は2026年9月30日を含む課税期間までと承知しています。その課税期間の末日と、その後の申告方式のご予定を教えてください。',
103
+ sanwari_2026: '3割特例は2027年分・2028年分が対象と承知しています。2026年分の申告方式を教えてください。',
104
+ sanwari_after: '3割特例は2028年分までと承知しています。2029年分以降の申告方式のご予定を教えてください。',
105
+ sanwari_corp: '3割特例は個人事業者向けの特例と承知しています。貴社の申告方式をあらためて教えてください。',
106
+ },
107
+ },
108
+ },
109
+ en: {
110
+ method: { general: 'Standard taxation', simplified: 'Simplified taxation', niwari: '20% special rule', sanwari: '30% special rule', exempt: 'Tax-exempt business / consumer', unknown: 'Not sure' },
111
+ party: { individual: 'Sole proprietor', corporation: 'Corporation' },
112
+ small: { yes: 'Under ¥10,000 incl. tax', no: '¥10,000 or more', unknown: 'Not sure' },
113
+ status: { diff: 'Difference', none: 'No difference', check: 'To confirm' },
114
+ recheck: 'Method must be reconfirmed',
115
+ month: function (ym) { return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][Number(ym.slice(5, 7)) - 1] + ' ' + ym.slice(0, 4); },
116
+ range: function (a, b) { return b ? a + ' – ' + b : 'From ' + a; },
117
+ yen: function (n) { return '¥' + n.toLocaleString('en-US') + '/month'; },
118
+ pctOf: function (p) { return 'about ' + p + '% of the tax-inclusive amount'; },
119
+ note: {
120
+ exempt: 'They do not claim input tax credits, so your registration status makes no difference (this changes if they become a taxable business).',
121
+ simplified: 'Simplified taxation computes the credit from their sales, so your registration status makes no difference (while they stay on it).',
122
+ niwari: 'The 20% special rule computes tax from their sales, so there is no difference.',
123
+ niwari_end_ind: 'The 20% special rule ends with tax year 2026 for sole proprietors. Ask which method they use from 2027 (we do not assume they moved to simplified taxation).',
124
+ niwari_corp_fy: 'For corporations, the 20% special rule covers the tax period that includes Sep 30, 2026. No difference until that period ends; after that the method must be reconfirmed.',
125
+ niwari_end_corp: 'The tax period that includes Sep 30, 2026 has ended. Ask which method they use now (we do not assume simplified taxation).',
126
+ sanwari_before: 'The 30% special rule starts with tax year 2027 for sole proprietors. Ask which method they use for 2026.',
127
+ sanwari: 'The 30% special rule computes tax from their sales, so there is no difference.',
128
+ sanwari_end: 'The 30% special rule ends with tax year 2028. Ask which method they use from 2029 (we do not assume simplified taxation).',
129
+ sanwari_corp: 'The 30% special rule is for sole proprietors only. Ask the corporation which method it uses.',
130
+ general: function (pct) { return (pct >= 100 ? 'They can no longer credit the tax at all' : 'They can credit only ' + (100 - pct) + '% of the tax, losing ' + pct + '%') + ' (an estimate that excludes fully creditable purchases such as the small-amount rule).'; },
131
+ generalShort: function (pct) { return pct >= 100 ? 'No credit (transitional measure ended)' : (100 - pct) + '% creditable (transitional measure)'; },
132
+ small_yes: 'Purchases under ¥10,000 per transaction are fully creditable if they qualify for the small-amount rule (until Sep 30, 2029). Whether they qualify depends on their sales size, so ask.',
133
+ small_unknown: 'It depends on whether one invoice is under ¥10,000 incl. tax. If it is and they qualify for the small-amount rule, there is no difference.',
134
+ method_unknown: 'It depends on their method: a difference under standard taxation, none under simplified taxation, the 20%/30% rules or if exempt.',
135
+ },
136
+ paren: function (s) { return ' (' + s + ')'; },
137
+ hint: function (amt, pctText) { return 'If standard taxation without full credit: ' + (amt != null ? amt + ' (' + pctText + ')' : pctText); },
138
+ premises: [
139
+ 'This is an estimate (from tax-inclusive amounts at 10%, fractions of a yen cut off).',
140
+ 'It assumes they could fully credit purchases from a registered business and meet the bookkeeping and invoice requirements.',
141
+ 'Corporate and income tax effects are not included.',
142
+ 'Whether they can use a special rule (20%, 30%, small-amount, simplified) is their call.',
143
+ ],
144
+ premisesTitle: 'Assumptions',
145
+ cut: {
146
+ none: 'Enter the requested cut to compare it with their difference.',
147
+ needMonthly: 'Enter the monthly invoice amount to compare a cut given in yen.',
148
+ noDiff: function (cut) { return 'The requested cut is ' + cut + '. For now, under these assumptions, they see no difference.'; },
149
+ check: function (cut) { return 'The requested cut is ' + cut + '. Their difference is not fixed until the open points are confirmed.'; },
150
+ ratio: function (cut, diff, r) { return 'The requested cut of ' + cut + ' is about ' + r + '× their difference of ' + diff + '.'; },
151
+ below: function (cut, diff) { return 'The requested cut of ' + cut + ' is smaller than their difference of ' + diff + '.'; },
152
+ same: function (cut, diff) { return 'The requested cut of ' + cut + ' is about the same as their difference of ' + diff + '.'; },
153
+ rate: function (r) { return r + '% of the invoice'; },
154
+ },
155
+ msg: {
156
+ to: 'Dear (client name),',
157
+ hello: 'Thank you for your continued business.',
158
+ askLead: 'Regarding the price adjustment you mentioned, could you tell me the following so that I can understand the impact correctly?',
159
+ askEnd: 'Based on your answers, I would like to discuss the terms again.',
160
+ tellLead: function (facts) { return 'Regarding the price adjustment you mentioned, here is my estimate based on what you told me (' + facts + ').'; },
161
+ tellEnd: 'I would like to discuss the terms with these figures in mind.',
162
+ rowDiff: function (label, v) { return label + ': an estimated difference of ' + v; },
163
+ rowNone: function (label) { return label + ': no difference expected'; },
164
+ premiseHead: 'Assumptions behind my estimate',
165
+ premises: [
166
+ 'This is an estimate (from tax-inclusive amounts at 10%, fractions of a yen cut off).',
167
+ 'It assumes you could fully credit purchases from a registered business and meet the bookkeeping and invoice requirements.',
168
+ 'Corporate and income tax effects are not included.',
169
+ 'Whether you can use a special rule (20%, 30%, small-amount, simplified) is your call.',
170
+ ],
171
+ q: {
172
+ method_unknown: 'Which consumption tax method do you use: standard taxation, simplified taxation, the 20% special rule or the 30% special rule (or are you tax-exempt)?',
173
+ small: 'For payments to me under ¥10,000 (tax included) per transaction, do you use the small-amount rule (full credit with books only, until Sep 30, 2029)?',
174
+ niwari_ind: 'I understand the 20% special rule ends with tax year 2026. Which method do you plan to use from 2027 (30% rule, simplified, standard, etc.)?',
175
+ niwari_corp: 'I understand the 20% special rule covers the tax period that includes Sep 30, 2026. When does that period end, and which method do you plan to use after it?',
176
+ sanwari_2026: 'I understand the 30% special rule covers tax years 2027 and 2028. Which method do you use for 2026?',
177
+ sanwari_after: 'I understand the 30% special rule ends with tax year 2028. Which method do you plan to use from 2029?',
178
+ sanwari_corp: 'I understand the 30% special rule is for sole proprietors. Could you confirm which method your company uses?',
179
+ },
180
+ },
181
+ },
182
+ };
183
+
184
+ // 問いの番号(同じ問いを2度聞かない)
185
+ var Q_OF = { method_unknown: 'method_unknown', small_yes: 'small', small_unknown: 'small', niwari_end_ind: 'niwari_ind', niwari_corp_fy: 'niwari_corp',
186
+ niwari_end_corp: 'niwari_corp', sanwari_before: 'sanwari_2026', sanwari_end: 'sanwari_after', sanwari_corp: 'sanwari_corp' };
187
+
188
+ function pick(v, list, name) {
189
+ if (v == null || v === '') return null;
190
+ if (list.indexOf(v) < 0) throw new InvoiceNebikiError('INVALID_' + name.toUpperCase(), name + ' must be one of ' + list.join(', '));
191
+ return v;
192
+ }
193
+
194
+ function isoDay(d) {
195
+ if (d == null || d === '') { var n = new Date(); return n.getFullYear() + '-' + String(n.getMonth() + 1).padStart(2, '0') + '-' + String(n.getDate()).padStart(2, '0'); }
196
+ if (!/^\d{4}-\d{2}-\d{2}$/.test(String(d))) throw new InvoiceNebikiError('INVALID_TODAY', 'today must be YYYY-MM-DD');
197
+ return String(d);
198
+ }
199
+
200
+ function money(v, name) {
201
+ if (v == null || v === '') return null;
202
+ var n = typeof v === 'number' ? v : Number(String(v).replace(/[,,\s円¥¥]/g, ''));
203
+ if (!isFinite(n) || n < 0 || n > 1e10) throw new InvoiceNebikiError('INVALID_' + name.toUpperCase(), name + ' must be a yen amount between 0 and 10,000,000,000');
204
+ n = Math.floor(n);
205
+ return n > 0 ? n : null;
206
+ }
207
+
208
+ // 入力をそろえる(未入力は null。範囲外は InvoiceNebikiError)
209
+ export function normalizeInput(input) {
210
+ var x = input || {};
211
+ var cut = null;
212
+ if (x.cut && x.cut.value != null && x.cut.value !== '') {
213
+ var type = x.cut.type === 'amount' ? 'amount' : 'rate';
214
+ if (type === 'rate') {
215
+ var r = Number(String(x.cut.value).replace(/[%%\s]/g, ''));
216
+ if (!isFinite(r) || r < 0 || r > 100) throw new InvoiceNebikiError('INVALID_CUT', 'cut rate must be between 0 and 100');
217
+ if (r > 0) cut = { type: 'rate', value: Math.round(r * 100) / 100 };
218
+ } else {
219
+ var a = money(x.cut.value, 'cut');
220
+ if (a) cut = { type: 'amount', value: a };
221
+ }
222
+ }
223
+ var method = pick(x.method, METHODS, 'method') || 'unknown', party = pick(x.party, PARTIES, 'party');
224
+ // 2割特例・3割特例は個人と法人で期限が違うので、どちらかが要る
225
+ if (!party && (method === 'niwari' || method === 'sanwari')) throw new InvoiceNebikiError('PARTY_REQUIRED', 'party (individual or corporation) is required for the 20%/30% special rules');
226
+ return {
227
+ method: method,
228
+ party: party,
229
+ small: pick(x.small, SMALLS, 'small') || 'unknown',
230
+ monthly: money(x.monthly, 'monthly'),
231
+ cut: cut,
232
+ today: isoDay(x.today),
233
+ };
234
+ }
235
+
236
+ // 1つの区切りでの判定。status: diff(差あり)・none(差なし)・check(要確認)
237
+ export function judgeSegment(seg, x) {
238
+ var d = seg.from;
239
+ var none = function (code) { return { status: 'none', code: code }; };
240
+ var check = function (code, recheck) { return { status: 'check', code: code, recheck: !!recheck }; };
241
+ switch (x.method) {
242
+ case 'exempt': return none('exempt');
243
+ case 'simplified': return none('simplified');
244
+ case 'niwari':
245
+ if (d < '2026-10-01') return none('niwari');
246
+ if (x.party === 'individual') return d < '2027-01-01' ? none('niwari') : check('niwari_end_ind', true);
247
+ return d < '2027-10-01' ? check('niwari_corp_fy') : check('niwari_end_corp', true);
248
+ case 'sanwari':
249
+ if (x.party === 'corporation') return check('sanwari_corp', true);
250
+ if (d < '2027-01-01') return check('sanwari_before');
251
+ if (d < '2029-01-01') return none('sanwari');
252
+ return check('sanwari_end', true);
253
+ case 'general':
254
+ if (x.small !== 'no' && d < '2029-10-01') return check(x.small === 'yes' ? 'small_yes' : 'small_unknown');
255
+ return { status: 'diff', code: 'general' };
256
+ default: return check('method_unknown');
257
+ }
258
+ }
259
+
260
+ // 月額の差(1円未満切り捨て)。税込 × 10/110 × pct% を整数のまま計算する
261
+ export function diffAmount(monthly, pct) { return monthly ? Math.floor(monthly * pct / 1100) : null; }
262
+ // 税込額に対する割合(小数1桁)
263
+ export function diffPctOfTotal(pct) { return Math.round(pct / 11 * 10) / 10; }
264
+
265
+ function ym(iso) { return iso.slice(0, 7); }
266
+ function prevMonth(iso) { var y = Number(iso.slice(0, 4)), m = Number(iso.slice(5, 7)) - 1; if (m === 0) { y--; m = 12; } return y + '-' + String(m).padStart(2, '0'); }
267
+
268
+ // 時期別の表。今日を含む区切りから、判定が同じ区切りをまとめて返す
269
+ export function judge(input) {
270
+ var x = normalizeInput(input);
271
+ var start = 0;
272
+ for (var i = 0; i < SEGMENTS.length; i++) if (SEGMENTS[i].from <= x.today) start = i;
273
+ var rows = [];
274
+ for (var j = start; j < SEGMENTS.length; j++) {
275
+ var seg = SEGMENTS[j], r = judgeSegment(seg, x);
276
+ var row = { from: ym(seg.from), to: null, status: r.status, code: r.code, recheck: !!r.recheck, pct: seg.pct, amount: null, now: j === start };
277
+ if (r.status === 'diff') row.amount = diffAmount(x.monthly, seg.pct);
278
+ if (r.status === 'check') row.hintAmount = diffAmount(x.monthly, seg.pct);
279
+ if (r.status === 'none') row.pct = null;
280
+ var last = rows[rows.length - 1];
281
+ if (last && last.status === row.status && last.code === row.code && last.pct === row.pct) continue;
282
+ if (last) last.to = prevMonth(seg.from + '');
283
+ rows.push(row);
284
+ }
285
+ var questions = [];
286
+ rows.forEach(function (row) { var q = row.status === 'check' && Q_OF[row.code]; if (q && questions.indexOf(q) < 0) questions.push(q); });
287
+ return { input: x, rows: rows, current: rows[0], questions: questions, compare: compareCut(x, rows[0]) };
288
+ }
289
+
290
+ // 言われた値下げと、今の時期の相手側の差を比べる
291
+ export function compareCut(x, row) {
292
+ if (!x.cut) return { kind: 'none' };
293
+ var cutPct = null, cutAmount = null;
294
+ if (x.cut.type === 'rate') { cutPct = x.cut.value; if (x.monthly) cutAmount = Math.floor(x.monthly * x.cut.value / 100); }
295
+ else { cutAmount = x.cut.value; if (x.monthly) cutPct = Math.round(cutAmount / x.monthly * 10000) / 100; }
296
+ var out = { cutPct: cutPct, cutAmount: cutAmount, kind: row.status === 'none' ? 'noDiff' : row.status === 'check' ? 'check' : '' };
297
+ if (out.kind) return out;
298
+ if (cutPct == null) { out.kind = 'needMonthly'; return out; }
299
+ out.diffPct = diffPctOfTotal(row.pct);
300
+ out.diffAmount = row.amount;
301
+ var ratio = cutPct / (row.pct / 11);
302
+ out.ratio = Math.round(ratio * 10) / 10;
303
+ out.kind = ratio >= 1.1 ? 'ratio' : ratio <= 0.9 ? 'below' : 'same';
304
+ return out;
305
+ }
306
+
307
+ export function rowLabel(row, lang) {
308
+ var L = T[lang] || T.ja;
309
+ return L.range(L.month(row.from), row.to ? L.month(row.to) : '');
310
+ }
311
+
312
+ // 行の中身(状態・額・説明)を文字にする。showAmount=false なら金額を出さず割合だけにする
313
+ export function rowText(row, lang, showAmount) {
314
+ var L = T[lang] || T.ja;
315
+ var note = row.code === 'general' ? L.note.general(row.pct) : L.note[row.code];
316
+ var value = '';
317
+ if (row.status === 'diff') value = showAmount !== false && row.amount != null ? L.yen(row.amount) + L.paren(L.pctOf(diffPctOfTotal(row.pct))) : L.pctOf(diffPctOfTotal(row.pct));
318
+ var hint = row.status === 'check' ? L.hint(showAmount !== false && row.hintAmount != null ? L.yen(row.hintAmount) : null, L.pctOf(diffPctOfTotal(row.pct))) : '';
319
+ return { label: rowLabel(row, lang), status: L.status[row.status], recheck: row.recheck ? L.recheck : '', value: value, note: note, hint: hint,
320
+ short: row.code === 'general' ? L.note.generalShort(row.pct) : note,
321
+ amountText: row.amount != null && showAmount !== false ? L.yen(row.amount) : '', pctText: L.pctOf(diffPctOfTotal(row.pct)) };
322
+ }
323
+
324
+ export function cutText(result, lang) {
325
+ var L = T[lang] || T.ja, c = result.compare;
326
+ if (c.kind === 'none') return L.cut.none;
327
+ if (c.kind === 'needMonthly') return L.cut.needMonthly;
328
+ var cut = c.cutAmount != null ? L.yen(c.cutAmount) + (c.cutPct != null ? L.paren(L.cut.rate(c.cutPct)) : '') : L.cut.rate(c.cutPct);
329
+ if (c.kind === 'noDiff') return L.cut.noDiff(cut);
330
+ if (c.kind === 'check') return L.cut.check(cut);
331
+ var diff = c.diffAmount != null ? L.yen(c.diffAmount) : L.pctOf(c.diffPct);
332
+ if (c.kind === 'ratio') return L.cut.ratio(cut, diff, c.ratio);
333
+ if (c.kind === 'below') return L.cut.below(cut, diff);
334
+ return L.cut.same(cut, diff);
335
+ }
336
+
337
+ // 相手へ送る確認文。要確認の項目だけを尋ねる。要確認が無ければ、見込みを伝える文にする。
338
+ // format: 'text'(メールに貼る)・'md'(/md-pdf/ で PDF にする)
339
+ export function buildMessage(result, opts) {
340
+ var o = opts || {}, lang = o.lang === 'en' ? 'en' : 'ja', md = o.format === 'md', L = T[lang], M = L.msg, x = result.input;
341
+ var bullet = md || lang === 'en' ? '- ' : '・', out = [];
342
+ out.push(M.to, '', M.hello);
343
+ if (result.questions.length) {
344
+ out.push(M.askLead, '');
345
+ result.questions.forEach(function (q, i) { out.push((i + 1) + '. ' + M.q[q]); });
346
+ out.push('', M.askEnd);
347
+ } else {
348
+ var facts = [L.method[x.method]];
349
+ if (x.method === 'general') facts.push(L.small[x.small]);
350
+ if ((x.method === 'niwari' || x.method === 'sanwari') && x.party) facts.push(L.party[x.party]);
351
+ out.push(M.tellLead(facts.join(lang === 'en' ? ', ' : '・')), '');
352
+ result.rows.forEach(function (row) {
353
+ var t = rowText(row, lang, o.showAmount);
354
+ out.push(bullet + (row.status === 'diff' ? M.rowDiff(t.label, t.value) : M.rowNone(t.label)));
355
+ });
356
+ out.push('', M.tellEnd);
357
+ }
358
+ out.push('', md || lang === 'en' ? '---' : '――', '', (md ? '**' + M.premiseHead + '**' : M.premiseHead), '');
359
+ M.premises.forEach(function (p) { out.push(bullet + p); });
360
+ return out.join('\n') + '\n';
361
+ }
362
+
363
+ // URL のフラグメント(# の後ろ)に入れる条件。サーバーへは送られない
364
+ export function encodeState(input) {
365
+ var x = normalizeInput(input), p = ['m=' + x.method, 's=' + x.small];
366
+ if (x.party) p.push('p=' + (x.party === 'individual' ? 'i' : 'c'));
367
+ if (x.monthly) p.push('a=' + x.monthly);
368
+ if (x.cut) p.push('c=' + (x.cut.type === 'rate' ? 'r' : 'y') + x.cut.value);
369
+ return p.join('&');
370
+ }
371
+
372
+ export function decodeState(hash) {
373
+ var out = {};
374
+ String(hash || '').replace(/^#/, '').split('&').forEach(function (kv) {
375
+ var i = kv.indexOf('='); if (i < 0) return;
376
+ var k = kv.slice(0, i), v = decodeURIComponent(kv.slice(i + 1));
377
+ if (k === 'm' && METHODS.indexOf(v) >= 0) out.method = v;
378
+ if (k === 's' && SMALLS.indexOf(v) >= 0) out.small = v;
379
+ if (k === 'p' && (v === 'i' || v === 'c')) out.party = v === 'i' ? 'individual' : 'corporation';
380
+ if (k === 'a' && /^\d{1,10}$/.test(v)) out.monthly = Number(v);
381
+ if (k === 'c' && /^[ry]\d+(\.\d+)?$/.test(v)) out.cut = { type: v[0] === 'r' ? 'rate' : 'amount', value: Number(v.slice(1)) };
382
+ });
383
+ return out;
384
+ }
385
+ // ===== ここまでコア =====
386
+
387
+ // ---- MCP の入口 ----
388
+ export function invoiceNebikiTool(opts = {}) {
389
+ const lang = opts.lang === 'en' ? 'en' : 'ja';
390
+ const showAmount = opts.showAmount !== false;
391
+ const cut = opts.cutRate != null ? { type: 'rate', value: opts.cutRate } : opts.cutAmount != null ? { type: 'amount', value: opts.cutAmount } : null;
392
+ if (opts.cutRate != null && opts.cutAmount != null) throw new InvoiceNebikiError('INVALID_CUT', 'pass either cutRate or cutAmount, not both');
393
+ const r = judge({ method: opts.method, party: opts.party, small: opts.small, monthly: opts.monthly, cut, today: opts.today });
394
+ const L = T[lang];
395
+ const cmp = showAmount ? r.compare : { ...r.compare, cutAmount: null, diffAmount: null };
396
+ return {
397
+ ok: true,
398
+ input: { ...r.input, methodLabel: L.method[r.input.method] },
399
+ rows: r.rows.map((row) => {
400
+ const t = rowText(row, lang, showAmount);
401
+ return { from: row.from, to: row.to, status: row.status, statusLabel: t.status, recheck: row.recheck, current: row.now,
402
+ pct: row.pct, pctOfTotal: row.pct == null ? null : diffPctOfTotal(row.pct),
403
+ monthlyDiff: showAmount ? row.amount : null, ifStandardMonthlyDiff: showAmount && row.status === 'check' ? row.hintAmount : null,
404
+ label: t.label, text: row.status === 'diff' ? t.value : row.status === 'check' ? t.hint : '', note: t.note };
405
+ }),
406
+ comparison: { ...cmp, text: cutText({ ...r, compare: cmp }, lang) },
407
+ questions: r.questions.map((q) => ({ id: q, text: L.msg.q[q] })),
408
+ message: buildMessage(r, { lang, format: opts.format === 'md' ? 'md' : 'text', showAmount }),
409
+ premises: L.premises,
410
+ fragment: encodeState({ method: r.input.method, party: r.input.party, small: r.input.small, monthly: r.input.monthly, cut: r.input.cut }),
411
+ };
412
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@first-ch/tools-mcp",
3
- "version": "0.44.0",
4
- "description": "First CH Tools の計算ロジック(WCAGコントラスト比・文字数/Xウェイト・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4/ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・TSV/CSVからMarkdownテーブルへの整形と相互変換・SQLクエリの整形と予約語の大文字化・URL/テキストからのQRコード生成・UNIXタイムスタンプと日時表記の相互変換・robots.txtの生成(AIクローラーの許可プリセット付き)・文字列のケース変換(camelCase/snake_case/kebab-case など11形式)・CSV/TSVとJSON配列の相互変換(区切りの自動判定・a.b 列と入れ子の相互展開)・全角⇄半角の変換とテキストの掃除(文字種ごとの向き指定・半角カナの合成/分解・空白と空行の整理)・IPアドレス/CIDRの計算(ネットワーク・ブロードキャスト・ホスト範囲とホスト数・IPv4/IPv6・サブネット分割・包含判定・IP範囲→最小CIDR集合の逆算)・日数/営業日の計算(2日付間の日数と営業日数・起点日+N日/N営業日の期日・締め日と支払サイトからの支払日・土日と日本の祝日を内蔵)・HTML→Markdownの変換(見出し/リスト/表/リンク/画像/コード・script/styleや装飾タグの除去・本文だけの抽出・相対URLの絶対化)・和暦⇄西暦の変換(令和〜明治・自動判定・曜日と干支・存在しない和暦の指摘・満年齢と入学/卒業の年・元号一覧と早見表)・日本語タイトルからのURLスラッグ生成(かな→ヘボン式ローマ字・記号除去・ハイフン/アンダースコア連結・小文字化・長音の省略/表記)・Basic認証用 htpasswd の生成と照合(bcrypt / apr1-md5・パスワードの自動生成・Apache / nginx の設定スニペット)・OpenAPI/Swagger仕様書から日本語のMarkdownドキュメントとTypeScript型定義の生成(OpenAPI 3.x / Swagger 2.0・YAML/JSON・$ref/allOf/oneOf 対応・エンドポイントごとの引数/レスポンス型・外部 $ref は読みに行かない)・FAQ構造化データ(FAQPage の JSON-LD・Markdown・details/summary の HTML を同時生成・回答のリンク/箇条書きを HTML 化・「Q: / A:」形式の一括貼り付けの解析)・テキストの行操作(重複行の削除・数値を認識する並べ替え・シード付きシャッフル・行番号・空行除去・前後トリム・接頭辞/接尾辞)・印刷サイズとDPIの計算(用紙×解像度×塗り足しから必要なピクセル数・手持ちの画像の実効dpiと判定・早見表・mm/inch/px/pt/級の換算)・SERPのメタタグ文字数チェック(title / description が検索結果に収まるかをピクセル幅で判定・切り詰め位置と表示行・パンくず表示・https や階層の指摘)・Flexbox / CSS GridのCSS生成(既定値を省いた宣言・repeat()への畳み込み・grid-template-areasの検証・効かない組み合わせの指摘・定番プリセット)・社内文書の点検(Notion・Confluence などから書き出した Markdown/HTML の重複ページ・孤立ページ・表記ゆれや旧称・リンク切れの検出と修正案)・記入欄に収める字の大きさと改行位置(中袋〔ご祝儀袋・香典袋〕の住所欄などの幅・高さmmから1字の大きさ・行数・改行位置・縦書きの漢数字・金額の大字))をMCPツールとして提供するサーバー。あわせて apps.first-ch.com のWebアプリ37本(GEO・メタタグ・セキュリティヘッダー・SSL・DNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・ビジネス文面チェック等)の JSON API を呼ぶ app_* ツールも提供する(こちらは入力を apps.first-ch.com へ送るため既定では無効・FIRSTCH_ENABLE_APPS=1 で有効)",
3
+ "version": "0.47.0",
4
+ "description": "First CH Tools の計算ロジック(WCAGコントラスト比・文字数/Xウェイト・WebP変換・JSON-LD生成・llms.txt生成・文字コード/改行コード変換・Marp Markdown→スライド レンダリング・テストデータ生成・テキスト/コード差分・Cron式の解説・Base64/Data URI変換・URLパラメータの分解/再構築・HTML特殊文字のエスケープ/エンティティのデコード・JSON⇄YAMLの相互変換・px⇄rem/emの単位換算とCSSの一括変換・カラーコードの相互変換とアルファ透過の合成・MD5/SHA-1/SHA-256/SHA-384/SHA-512のハッシュ生成と照合・JWTのデコードと有効期限/署名の検証・User-Agent文字列の解析とデバイス判定・UUID v4/ULIDの一括生成・アスペクト比の計算とレスポンシブサイズの算出・TSV/CSVからMarkdownテーブルへの整形と相互変換・SQLクエリの整形と予約語の大文字化・URL/テキストからのQRコード生成・UNIXタイムスタンプと日時表記の相互変換・robots.txtの生成(AIクローラーの許可プリセット付き)・文字列のケース変換(camelCase/snake_case/kebab-case など11形式)・CSV/TSVとJSON配列の相互変換(区切りの自動判定・a.b 列と入れ子の相互展開)・全角⇄半角の変換とテキストの掃除(文字種ごとの向き指定・半角カナの合成/分解・空白と空行の整理)・IPアドレス/CIDRの計算(ネットワーク・ブロードキャスト・ホスト範囲とホスト数・IPv4/IPv6・サブネット分割・包含判定・IP範囲→最小CIDR集合の逆算)・日数/営業日の計算(2日付間の日数と営業日数・起点日+N日/N営業日の期日・締め日と支払サイトからの支払日・土日と日本の祝日を内蔵)・HTML→Markdownの変換(見出し/リスト/表/リンク/画像/コード・script/styleや装飾タグの除去・本文だけの抽出・相対URLの絶対化)・和暦⇄西暦の変換(令和〜明治・自動判定・曜日と干支・存在しない和暦の指摘・満年齢と入学/卒業の年・元号一覧と早見表)・日本語タイトルからのURLスラッグ生成(かな→ヘボン式ローマ字・記号除去・ハイフン/アンダースコア連結・小文字化・長音の省略/表記)・Basic認証用 htpasswd の生成と照合(bcrypt / apr1-md5・パスワードの自動生成・Apache / nginx の設定スニペット)・OpenAPI/Swagger仕様書から日本語のMarkdownドキュメントとTypeScript型定義の生成(OpenAPI 3.x / Swagger 2.0・YAML/JSON・$ref/allOf/oneOf 対応・エンドポイントごとの引数/レスポンス型・外部 $ref は読みに行かない)・FAQ構造化データ(FAQPage の JSON-LD・Markdown・details/summary の HTML を同時生成・回答のリンク/箇条書きを HTML 化・「Q: / A:」形式の一括貼り付けの解析)・テキストの行操作(重複行の削除・数値を認識する並べ替え・シード付きシャッフル・行番号・空行除去・前後トリム・接頭辞/接尾辞)・印刷サイズとDPIの計算(用紙×解像度×塗り足しから必要なピクセル数・手持ちの画像の実効dpiと判定・早見表・mm/inch/px/pt/級の換算)・SERPのメタタグ文字数チェック(title / description が検索結果に収まるかをピクセル幅で判定・切り詰め位置と表示行・パンくず表示・https や階層の指摘)・Flexbox / CSS GridのCSS生成(既定値を省いた宣言・repeat()への畳み込み・grid-template-areasの検証・効かない組み合わせの指摘・定番プリセット)・社内文書の点検(Notion・Confluence などから書き出した Markdown/HTML の重複ページ・孤立ページ・表記ゆれや旧称・リンク切れの検出と修正案)・記入欄に収める字の大きさと改行位置(中袋〔ご祝儀袋・香典袋〕の住所欄などの幅・高さmmから1字の大きさ・行数・改行位置・縦書きの漢数字・金額の大字))をMCPツールとして提供するサーバー。あわせて apps.first-ch.com のWebアプリ38本(GEO・メタタグ・セキュリティヘッダー・SSL・DNS・リダイレクト・リンク切れ・構造化データ・AIクローラー許可・和文可読性・ビジネス文面チェック等)の JSON API を呼ぶ app_* ツールも提供する(こちらは入力を apps.first-ch.com へ送るため既定では無効・FIRSTCH_ENABLE_APPS=1 で有効)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "firstch-tools-mcp": "server.mjs"
@@ -280,6 +280,7 @@
280
280
  "lib.mjs",
281
281
  "fs-safe.mjs",
282
282
  "fit-to-box.mjs",
283
+ "invoice-nebiki.mjs",
283
284
  "webp.mjs",
284
285
  "marp.mjs",
285
286
  "marp-theme.css",
package/server.mjs CHANGED
@@ -47,6 +47,7 @@ import { serpCheckTool } from './serp.mjs';
47
47
  import { cssLayoutGenerateTool } from './css-layout.mjs';
48
48
  import { wikiDocLintTool } from './wiki-doc-lint.mjs';
49
49
  import { fitToBoxTool } from './fit-to-box.mjs';
50
+ import { invoiceNebikiTool } from './invoice-nebiki.mjs';
50
51
 
51
52
  const { version } = createRequire(import.meta.url)('./package.json');
52
53
  // SDK v2 の serveStdio は接続ごとに factory から McpServer を1つ作る(旧仕様の initialize と
@@ -2001,4 +2002,38 @@ registerTool(
2001
2002
  },
2002
2003
  );
2003
2004
 
2005
+ registerTool(
2006
+ 'invoice_nebiki_check',
2007
+ {
2008
+ title: 'インボイス値下げ、応じる前に相手へ聞く3問チェック',
2009
+ description:
2010
+ 'インボイス発行事業者でない側(個人のデザイナー・ライターなど)が取引先から値下げを求められたとき、取引先に控除の減り(差)が本当に出るかを時期別に返す' +
2011
+ '(tools.first-ch.com/invoice-nebiki/ と同一ロジック)。' +
2012
+ '入力は3問: method(取引先の申告方式 general=一般課税 / simplified=簡易課税 / niwari=2割特例 / sanwari=3割特例 / exempt=免税事業者・消費者 / unknown)、' +
2013
+ 'party(individual / corporation・2割特例と3割特例では必須)、small(1回の請求が税込1万円未満か yes / no / unknown)。monthly(月の請求額・税込10%)と cutRate(%)か cutAmount(円/月)は任意。' +
2014
+ 'rows は today を含む時期から、判定が同じ時期をまとめて status=diff(差あり・monthlyDiff=税込×10/110×pct% の1円未満切り捨て)/ none(差なし)/ check(要確認)を返す。' +
2015
+ 'pct は経過措置で控除できなくなる割合(2026年9月まで20%・2026年10月から30%・2028年10月から50%・2030年10月から70%・2031年10月から100%)。' +
2016
+ '2割特例の差なしは個人2026年分まで・法人は2026年9月30日を含む課税期間まで、3割特例は個人の2027・2028年分だけで、期限後は recheck:true(方式の再確認が必要・簡易課税へ移ったとは仮定しない)。' +
2017
+ '一般課税で small が yes/unknown なら、少額特例(2029年9月30日までの仕入れ)があるため2029年9月までは要確認。' +
2018
+ 'questions と message は要確認の項目だけを尋ねる確認文(要確認が無ければ見込みを伝える文。format="md" で Markdown)。前提(概算・全額控除と保存要件・法人税等を含めない・特例の可否は相手が判断)は premises と message に必ず付く。' +
2019
+ 'showAmount:false で金額を出さない。自分の納税額・登録の要否・違法かどうか・相手の方式や規模の推定は扱わない。入力の誤りは InvoiceNebikiError(code 付き)。完全ローカル処理・ネットワーク送信なし。',
2020
+ inputSchema: {
2021
+ method: z.enum(['general', 'simplified', 'niwari', 'sanwari', 'exempt', 'unknown']).optional().describe("取引先の消費税の申告方式(既定 'unknown')"),
2022
+ party: z.enum(['individual', 'corporation']).optional().describe('取引先が個人事業者か法人か(niwari / sanwari では必須)'),
2023
+ small: z.enum(['yes', 'no', 'unknown']).optional().describe("1回の請求が税込1万円未満か(既定 'unknown')"),
2024
+ monthly: z.number().optional().describe('月の請求額(円・税込10%。任意)'),
2025
+ cutRate: z.number().optional().describe('言われた値下げの率(%・0〜100。cutAmount とどちらか)'),
2026
+ cutAmount: z.number().optional().describe('言われた値下げの額(円/月。cutRate とどちらか)'),
2027
+ today: z.string().optional().describe('基準日 YYYY-MM-DD(省略時はサーバーの今日)'),
2028
+ format: z.enum(['text', 'md']).optional().describe("message の形式(既定 'text')"),
2029
+ showAmount: z.boolean().optional().describe('金額を返すか(既定 true。false なら割合だけ)'),
2030
+ lang: z.enum(['ja', 'en']).optional().describe("文言の言語(既定 'ja')"),
2031
+ },
2032
+ },
2033
+ async (opts) => {
2034
+ await logUsage('invoice_nebiki_check');
2035
+ return asText(invoiceNebikiTool(opts));
2036
+ },
2037
+ );
2038
+
2004
2039
  serveStdio(buildServer);