UNPKG

@extenshi/mcp

Version:

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

82 lines • 4.15 kB
/** * Welcome-page goal presets + the AI-agent brief. * * SELF-CONTAINED ON PURPOSE — no imports, so it can be copied verbatim into the * published `@extenshi/mcp` package, which cannot depend on unpublished * workspace packages (same constraint and same solution as svg-scrub.ts). * * SINGLE SOURCE, TWO COPIES, byte-identical: * shared-types/welcome-agent-brief.ts (canonical — edit here) * tools/extenshi-mcp/src/welcome-agent-brief.ts (synced copy for @extenshi/mcp) * after editing, run: * cp shared-types/welcome-agent-brief.ts tools/extenshi-mcp/src/welcome-agent-brief.ts * A test in tools/extenshi-mcp/src/welcome-workflow.test.ts fails CI on drift. * * Why the sync is load-bearing rather than tidy: the brief tells an agent what * to build AND states the limits the save path enforces. If the MCP copy drifts, * an agent produces blocks against one spec and catalog-bff rejects them against * another — and the author sees a validation error for work they were told to do. */ export declare const WELCOME_MAX_BLOCKS = 14; export declare const WELCOME_MAX_ANNOTATIONS = 8; export declare const WELCOME_TEXT_MAX_LEN = 600; export declare const WELCOME_TITLE_MAX_LEN = 120; export declare const WELCOME_ALT_MAX_LEN = 200; /** Inline SVG cap — an instructional diagram, not an embedded illustration set. */ export declare const WELCOME_SVG_MAX_LEN = 24000; export declare const WELCOME_UPLOAD_MAX_BYTES: number; export declare const WELCOME_DEFAULT_ACCENT = "#5e5ce6"; /** * A welcome page exists to drive exactly one action. Naming that action is the * single highest-leverage input to both the default copy and the agent brief: * in ~90% of extensions the valuable action is "find and pin the extension", * but a new-tab replacement instead needs the user to accept the override, and * a content-script widget needs them to visit the target site and spot it. */ export type WelcomeGoal = 'PIN_EXTENSION' | 'NEW_TAB_OPT_IN' | 'VISIT_SITE' | 'CUSTOM'; export interface WelcomeGoalPreset { goal: WelcomeGoal; label: string; /** One-line description of the action, shown in the constructor. */ summary: string; defaultHeadline: string; defaultMessage: string; /** Starting checklist — the author edits these, they are not fixed. */ defaultSteps: string[]; /** * What an illustration for this goal must actually show. Fed verbatim into * the agent brief, so it has to describe pixels, not intent. */ illustrationTargets: string[]; } export declare const WELCOME_GOAL_PRESETS: Record<WelcomeGoal, WelcomeGoalPreset>; export declare const WELCOME_GOALS: WelcomeGoal[]; export declare function isWelcomeGoal(v: unknown): v is WelcomeGoal; export interface WelcomeAgentBriefInput { extensionName: string; goal: WelcomeGoal; /** Free-text description of what the extension actually does. */ whatItDoes?: string | null; /** Site the extension acts on — required to make VISIT_SITE illustrations concrete. */ targetSite?: string | null; /** Store screenshot URLs we already host, offered as ready-made illustration material. */ storeScreenshots?: string[]; /** Steps the author has already written, if any. */ existingSteps?: string[]; accentColor?: string; /** Where the finished blocks get pasted back. */ constructorUrl?: string; } /** * Render the welcome-page content specification for this config. * * An author who opens the constructor knows what their extension does but not * what a good welcome page contains; whoever produces the illustrations (the * author, a designer, or a coding tool the author uses) needs the goal, the * store assets we already hold, and the block JSON format the constructor * accepts. The spec states all three as neutral reference material — goal, * requirements, limits, file format — and is a pure function of the config (no * network, no key, no credits) so both dojo and the MCP server can render it. */ export declare function buildWelcomeAgentBrief(input: WelcomeAgentBriefInput): string; //# sourceMappingURL=welcome-agent-brief.d.ts.map