import { HelpText } from './HelpText'; import { FieldLabel, FieldInput } from './formUtils'; import { StringArrayEditor } from './StringArrayEditor'; import type { SectionFormProps } from './types'; /** * External Services settings — credentials and gates for third-party * API integrations (X / Twitter, Maps, Amazon / Keepa) plus the * user-supplied scripts security gate. * * Replaces the `x` / `maps` / `amazon` / `user-folder` tabs of the * legacy grab-bag `ToolsForm`. The config keys are unchanged: * * tools.x_auth_token / x_ct0 / x_cli_command / x_timeout / x_proxy / x_chrome_profile * tools.google_maps_api_key * tools.amazon_affiliate_tag / keepa_api_key * tools.user_scripts_enabled / user_scripts_allow_userids * * Note: trash_retention_days lives in Paths & Storage (storage.*) since * config v2 normalization (#360/#362). It is intentionally NOT shown * here — see PathsStorageForm. */ export function ToolsExternalForm({ config, onChange }: SectionFormProps) { const tools = config.tools ?? {}; return (

External Services

X / Twitter

X Auth Token onChange('tools.xAuthToken', v)} /> X / Twitter の auth_token cookie
X ct0 onChange('tools.xCt0', v)} /> X / Twitter の ct0 cookie
X CLI Command onChange('tools.xCliCommand', v)} /> twitter-cli の実行コマンド。
X Timeout (秒) onChange('tools.xTimeout', Number(v))} />
X Proxy onChange('tools.xProxy', v)} placeholder="http://proxy:port" />
X Chrome Profile onChange('tools.xChromeProfile', v)} placeholder="/path/to/chrome/profile" /> Cookie 抽出用の Chrome プロファイルディレクトリ。
X Media Download X 投稿の画像等メディアの自動ダウンロード。デフォルト: auto
X Video Download X 投稿の動画の取得モード。デフォルト: thumbnail(帯域節約)
X Media Max (MB) onChange('tools.xMediaMaxMb', v ? Number(v) : undefined)} /> 1 メディアあたりの最大ダウンロードサイズ(MB)
X Media Fetch Timeout (秒) onChange('tools.xMediaFetchTimeoutSeconds', v ? Number(v) : undefined)} /> メディア取得のタイムアウト(秒)

Maps

Google Maps API Key onChange('tools.googleMapsApiKey', v)} /> Google Maps Places / Directions API キー。未設定時は Nominatim / OSRM(無料)を使用。
Maps Timeout (秒) onChange('tools.mapsTimeout', v ? Number(v) : undefined)} /> Maps / Nominatim / OSRM 呼び出しのタイムアウト(秒)。デフォルト: 30

Amazon / Keepa

Amazon Affiliate Tag onChange('tools.amazonAffiliateTag', v)} placeholder="your-tag-22" /> SearchAmazon で使用するアソシエイトタグ。
Keepa API Key onChange('tools.keepaApiKey', v)} /> Keepa API キー(価格履歴データ取得用)。未設定でもグラフ画像リンクは提供されます。

User-supplied Scripts

RunUserScript を有効化 plain runtime は Node --permission で sandbox 化され child_process / worker / tmpdir 外の FS アクセスを deny。 browser-macros は Playwright の要件 (child_process / native bindings / network) で sandbox 不可、フル Node.js capability。 信頼できるユーザーのみに有効化。
実行許可ユーザー allowlist (空欄 = 全員) onChange('tools.userScriptsAllowUserids', v)} placeholder="user id (例: 12345)" /> 未指定なら user_scripts_enabled のみで制御。設定すると指定 ID のみ RunUserScript / scheduled script task が許可される。
); }