UNPKG

@extenshi/mcp

Version:

Extenshi MCP server — bring the extension catalog (search, security, market research) and pre-publish scanning into your AI tools

73 lines • 3.65 kB
/** * Pin guide captions — the step titles, bodies and alt text of the "find the * extension and pin it" sequence, in every language our end-user pages ship in. * * SELF-CONTAINED ON PURPOSE — no imports, so it can be copied verbatim into the * published `@extenshi/mcp` and `@extenshi/cli` packages, which cannot depend on * unpublished workspace packages (same constraint as welcome-agent-brief.ts). * * SINGLE SOURCE, THREE COPIES. The three pin-guide files (pin-guide.ts, * pin-guide-strings.ts, pin-guide-kit.ts) live canonically in shared-types and * are copied into tools/extenshi-mcp/src and tools/extenshi-cli/src with their * `shared-types/` import specifiers rewritten to `./` — otherwise identical. * After editing any of them, run from the repo root: * for f in pin-guide pin-guide-strings pin-guide-kit; do for d in tools/extenshi-mcp/src tools/extenshi-cli/src; do * sed "s#from 'shared-types\/#from './#" shared-types/$f.ts > $d/$f.ts * done; done * Sync tests in both packages fail CI on drift. * * The English text is the text the hosted welcome pages have always rendered, * byte for byte — `buildPinGuideBlocks` without a locale must not change. * * Naming the browser's own controls is the part that has to be right: a guide * that tells the user to click a menu item their browser does not have is * worse than no guide. So a control is quoted only where we hold the browser's * actual string for that language: * - Firefox "Pin to Toolbar" — from Mozilla's localization repository * (mozilla-l10n/firefox-l10n, browser/browser/unifiedExtensions.ftl, * `unified-extensions-context-menu-pin-to-toolbar`, checked 2026-11-04). * - Edge — a pushpin glyph with no visible label, like Chrome. (Earlier * Edge versions showed an eye captioned "Show in toolbar"; the current * menu has an outlined pin followed by a ⋯ button.) * - Chrome — the control is a pushpin glyph with no visible label. */ /** Same list as END_USER_LOCALES (shared-types/end-user-locale.ts), pinned by a test. */ export declare const PIN_GUIDE_LOCALES: readonly ["en", "es", "pt-BR", "fr", "de", "it", "ru", "ja", "ko", "zh-CN", "ar"]; export type PinGuideLocale = (typeof PIN_GUIDE_LOCALES)[number]; type PerBrowser = Record<'chrome' | 'edge' | 'firefox', string>; /** * Templates take two placeholders: `{name}` (the extension's display name) and * `{browser}` (Chrome / Edge / Firefox). Fill them with `pinGuideText`. */ export interface PinGuideStrings { step1Title: string; step1Body: string; step1Alt: string; step2Title: string; step2Alt: string; /** Step 3 is the toggle, which is the one control that differs per browser. */ step3Title: PerBrowser; step3Body: PerBrowser; step3Alt: PerBrowser; /** * Firefox's own label for the menu item, drawn inside the step-3 * illustration. The same string the Firefox step3Title quotes. */ step3MenuItem: string; step4Title: string; step4Body: string; step4Alt: string; } export declare const PIN_GUIDE_STRINGS: Record<PinGuideLocale, PinGuideStrings>; /** Resolve a BCP 47 tag (`pt_BR`, `zh-cn`, `fr-CA`) to a supported locale, else English. */ export declare function pinGuideLocale(tag: string | null | undefined): PinGuideLocale; /** * Fill `{name}` and `{browser}` in one pass, so a name that itself contains * `{browser}` is printed literally rather than substituted twice. */ export declare function pinGuideText(template: string, vars: { name: string; browser: string; }): string; export {}; //# sourceMappingURL=pin-guide-strings.d.ts.map