@koda-sl/baker-cli 0.547.0 → 0.549.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.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/landing/inspiration/search.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { InspirationSearchRequest, InspirationSearchResponse } from \"@baker/api/landing-library\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../../client.ts\";\nimport { writeJson } from \"../../../output.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { favoritesScopeHints, INSPIRATION_HINTS, parseNumber, reportError, splitList } from \"./shared.ts\";\nimport { downloadReadableShot, READABLE_SHOT } from \"./shot.ts\";\n\nregisterSchema({\n command: \"landing.inspiration.search\",\n description:\n \"Search the shared library of real landing-page sections for reference before you design. Start here: baker landing inspiration search 'pricing with a monthly/annual toggle'. Returns the idea behind each section plus a downloaded screenshot you can Read. Defaults to this company's saved sections; pass --scope all for the whole library.\",\n args: {\n query: { type: \"string\", description: \"What you want to see, in plain English\", required: false },\n type: {\n type: \"string\",\n description: \"Comma list of section types: hero,pricing,faq,testimonials,…\",\n required: false,\n },\n composition: {\n type: \"string\",\n description: \"Comma list of composition patterns (references/composition.md)\",\n required: false,\n },\n register: {\n type: \"string\",\n description: \"Comma list of visual registers: dev-tool-minimal,luxury-high-end,…\",\n required: false,\n },\n interaction: { type: \"string\", description: \"Comma list of interaction patterns\", required: false },\n motion: {\n type: \"string\",\n description: \"Comma list of motion kinds: scroll-reveal,marquee,parallax,…\",\n required: false,\n },\n media: { type: \"string\", description: \"Comma list of media kinds\", required: false },\n device: { type: \"string\", description: \"Comma list of content devices\", required: false },\n theme: { type: \"string\", description: \"light | dark | mixed\", required: false },\n \"max-rank\": {\n type: \"number\",\n description: \"Show>Tell rank ceiling 1-7; 3 means 'rank 3 or better'\",\n required: false,\n },\n \"min-craft\": { type: \"number\", description: \"Craft floor 0-1\", required: false },\n \"min-fidelity\": {\n type: \"number\",\n description: \"Only sections whose markup reproduces this well (0-1)\",\n required: false,\n },\n domain: { type: \"string\", description: \"Restrict to one site\", required: false },\n \"similar-to\": {\n type: \"string\",\n description: \"Section id — find sections that look like this one\",\n required: false,\n },\n scope: { type: \"string\", description: \"favorites (default) | all\", required: false },\n limit: { type: \"number\", description: \"Max results (default 8)\", required: false },\n \"no-images\": { type: \"boolean\", description: \"Skip downloading screenshots\", required: false },\n full: {\n type: \"boolean\",\n description:\n \"Add every classification facet (theme, density, rank, interactions, media, devices, tags, headline)\",\n required: false,\n },\n },\n});\n\nexport function buildSearchBody(args: Record<string, unknown>): InspirationSearchRequest {\n const body: InspirationSearchRequest = {};\n const setList = (key: keyof InspirationSearchRequest, value: unknown) => {\n const list = splitList(value as string | undefined);\n if (list) Object.assign(body, { [key]: list });\n };\n\n if (args.query) body.query = String(args.query);\n if (args[\"similar-to\"]) body.similarToSectionId = String(args[\"similar-to\"]);\n setList(\"sectionType\", args.type);\n setList(\"composition\", args.composition);\n setList(\"visualRegister\", args.register);\n setList(\"interaction\", args.interaction);\n setList(\"motion\", args.motion);\n setList(\"mediaKind\", args.media);\n setList(\"contentDevice\", args.device);\n if (args.theme) body.theme = String(args.theme) as InspirationSearchRequest[\"theme\"];\n if (args.domain) body.domain = String(args.domain);\n\n const maxRank = parseNumber(args[\"max-rank\"] as string | undefined);\n if (maxRank !== undefined) body.maxShowTellRank = maxRank;\n const minCraft = parseNumber(args[\"min-craft\"] as string | undefined);\n if (minCraft !== undefined) body.minCraftScore = minCraft;\n const minFidelity = parseNumber(args[\"min-fidelity\"] as string | undefined);\n if (minFidelity !== undefined) body.minFidelity = minFidelity;\n const limit = parseNumber(args.limit as string | undefined);\n body.limit = limit ?? 8;\n body.scope = args.scope === \"all\" ? \"all\" : \"favorites\";\n return body;\n}\n\n/**\n * Put the screenshots on disk.\n *\n * The whole library is a visual one, and an agent that can only read a text\n * description of a section is working from exactly the second-hand doctrine this\n * was built to replace. Downloading each hit so it can be `Read` is the point.\n *\n * At the readable size, not the archive size — see `shot.ts`. This runs at the\n * default limit of eight hits, so the difference is eight 2x PNGs of context\n * against eight design-width renditions.\n */\nasync function downloadShots(results: InspirationSearchResponse[\"results\"]): Promise<Map<string, string>> {\n const dir = path.join(process.cwd(), \".baker\", \"inspiration\");\n const saved = new Map<string, string>();\n await Promise.all(\n results.map(async (result) => {\n const file = await downloadReadableShot(\n result.desktopShotUrl,\n path.join(dir, `${result.id}.${READABLE_SHOT.extension}`),\n );\n if (file) saved.set(result.id, file);\n }),\n );\n return saved;\n}\n\nexport const searchCommand = defineCommand({\n meta: {\n name: \"search\",\n description:\n \"Search real landing-page sections for reference. Example: baker landing inspiration search 'dark developer hero with a terminal' --register dev-tool-minimal --scope all\",\n },\n args: {\n query: { type: \"positional\", description: \"What you want to see, in plain English\", required: false },\n type: { type: \"string\", description: \"Comma list of section types\", required: false },\n composition: { type: \"string\", description: \"Comma list of composition patterns\", required: false },\n register: { type: \"string\", description: \"Comma list of visual registers\", required: false },\n interaction: { type: \"string\", description: \"Comma list of interaction patterns\", required: false },\n motion: { type: \"string\", description: \"Comma list of motion kinds\", required: false },\n media: { type: \"string\", description: \"Comma list of media kinds\", required: false },\n device: { type: \"string\", description: \"Comma list of content devices\", required: false },\n theme: { type: \"string\", description: \"light | dark | mixed\", required: false },\n \"max-rank\": { type: \"string\", description: \"Show>Tell rank ceiling 1-7\", required: false },\n \"min-craft\": { type: \"string\", description: \"Craft floor 0-1\", required: false },\n \"min-fidelity\": { type: \"string\", description: \"Reproduction-fidelity floor 0-1\", required: false },\n domain: { type: \"string\", description: \"Restrict to one site\", required: false },\n \"similar-to\": { type: \"string\", description: \"Section id to find lookalikes of\", required: false },\n scope: { type: \"string\", description: \"favorites (default) | all\", required: false, default: \"favorites\" },\n limit: { type: \"string\", description: \"Max results (default 8)\", required: false },\n \"no-images\": { type: \"boolean\", description: \"Skip downloading screenshots\", required: false, default: false },\n full: { type: \"boolean\", description: \"Include every classification facet\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const body = buildSearchBody(args as Record<string, unknown>);\n const data = await apiPost<InspirationSearchResponse>(\"/api/landing-inspiration/search\", body);\n const results = Array.isArray(data?.results) ? data.results : [];\n const shots = (args[\"no-images\"] as boolean) ? new Map<string, string>() : await downloadShots(results);\n\n const full = args.full as boolean;\n const rows = results.map((result) => ({\n id: result.id,\n // The id `page` takes. Its own schema says \"from a search result's source\n // id\", and until this line no projection emitted one — so the ordering\n // view could only be reached straight after `add`, never from a search.\n page_id: result.sourceId,\n section: result.sectionType,\n composition: result.composition,\n look: result.visualRegister,\n motion: result.motionSummary,\n why_it_works: result.whyItWorks,\n craft: Number(result.craftScore?.toFixed?.(2) ?? result.craftScore),\n fidelity: result.fidelity,\n domain: result.domain,\n // Only worth saying when it means something: >1 marks a section the site\n // reuses across its pages, which is a stronger signal than a one-off.\n ...(result.pageCount > 1 ? { used_on_pages: result.pageCount } : {}),\n // With --no-images there is no file, so hand back the URL instead. A row\n // with neither is a section the agent is asked to judge sight unseen,\n // which is the one thing a visual library must never produce.\n ...((args[\"no-images\"] as boolean)\n ? { screenshot_url: result.desktopShotUrl ?? null }\n : { screenshot: shots.get(result.id) ?? null }),\n ...(full\n ? {\n theme: result.theme,\n density: result.density,\n show_tell_rank: result.showTellRank,\n interactions: result.interactions,\n media: result.mediaKinds,\n devices: result.contentDevices,\n tags: result.tags,\n headline: result.headline,\n source_url: result.sourceUrl,\n }\n : {}),\n }));\n\n const hints = [INSPIRATION_HINTS.adapt];\n // A thin favorites result is explained by the state of the saved set, not\n // by the search — and the three states it can be in call for opposite\n // next moves. The scope is never widened here; it is only made legible.\n const scopeHints = body.scope === \"favorites\" ? favoritesScopeHints(data.favoritesHealth, rows.length) : [];\n if (scopeHints.length > 0) {\n hints.push(...scopeHints);\n } else if (rows.length === 0) {\n hints.push(\n body.scope === \"favorites\"\n ? \"No matches in this company's saved sections. Retry with --scope all to search the whole library, or add a page with `baker landing inspiration add <url>`.\"\n : \"No matches. Loosen the filters, or add reference pages with `baker landing inspiration add <url>`.\",\n );\n }\n if (rows.length > 0 && data.moreInFullLibrary > 0) {\n hints.push(`${data.moreInFullLibrary} more match in the full library — re-run with --scope all.`);\n }\n if (shots.size > 0) hints.push(`Screenshots saved to .baker/inspiration/ — Read them before deciding.`);\n\n writeJson({\n ok: true,\n data: {\n results: rows,\n scope: data.scope,\n more_in_full_library: data.moreInFullLibrary,\n total: data.total,\n // Only present when there was something to explain, so a healthy\n // search pays nothing for it.\n ...(data.favoritesHealth ? { saved_pages: data.favoritesHealth } : {}),\n },\n hints,\n });\n } catch (error) {\n reportError(error);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AAEjB,SAAS,qBAAqB;AAO9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM;AAAA,IACJ,OAAO,EAAE,MAAM,UAAU,aAAa,0CAA0C,UAAU,MAAM;AAAA,IAChG,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,aAAa,EAAE,MAAM,UAAU,aAAa,sCAAsC,UAAU,MAAM;AAAA,IAClG,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,OAAO,EAAE,MAAM,UAAU,aAAa,6BAA6B,UAAU,MAAM;AAAA,IACnF,QAAQ,EAAE,MAAM,UAAU,aAAa,iCAAiC,UAAU,MAAM;AAAA,IACxF,OAAO,EAAE,MAAM,UAAU,aAAa,wBAAwB,UAAU,MAAM;AAAA,IAC9E,YAAY;AAAA,MACV,MAAM;AAAA,MACN,aAAa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,EAAG,OAAM,KAAK,4EAAuE;AAEtG,gBAAU;AAAA,QACR,IAAI;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,OAAO,KAAK;AAAA,UACZ,sBAAsB,KAAK;AAAA,UAC3B,OAAO,KAAK;AAAA;AAAA;AAAA,UAGZ,GAAI,KAAK,kBAAkB,EAAE,aAAa,KAAK,gBAAgB,IAAI,CAAC;AAAA,QACtE;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,SAAS,OAAO;AACd,kBAAY,KAAK;AAAA,IACnB;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/landing/inspiration/view.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { InspirationSectionResponse } from \"@baker/api/landing-library\";\nimport { defineCommand } from \"citty\";\nimport { apiGet } from \"../../../client.ts\";\nimport { writeJson } from \"../../../output.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { fidelityHint, INSPIRATION_HINTS, reportError } from \"./shared.ts\";\nimport { downloadReadableShot, READABLE_SHOT } from \"./shot.ts\";\n\nregisterSchema({\n command: \"landing.inspiration.view\",\n description:\n \"Everything known about one section: composition, motion, design tokens, the copy it uses, why it works, and what must change to make it yours. Downloads the desktop and mobile screenshots plus the motion filmstrip so you can look at them.\",\n args: {\n id: { type: \"string\", description: \"Section id from search\", required: true },\n full: {\n type: \"boolean\",\n description:\n \"Add the classification facets (theme, density, rank, interactions, media, devices, tags) and the reproduction notes\",\n required: false,\n },\n },\n});\n\nexport const viewCommand = defineCommand({\n meta: {\n name: \"view\",\n description:\n \"Full detail for one reference section. Example: baker landing inspiration view k57abc… — read the screenshots it saves before you build.\",\n },\n args: {\n id: { type: \"positional\", description: \"Section id from search\", required: true },\n full: {\n type: \"boolean\",\n description: \"Include classification facets and reproduction notes\",\n required: false,\n default: false,\n },\n },\n run: async ({ args }) => {\n try {\n const id = args.id as string;\n const data = await apiGet<InspirationSectionResponse>(\"/api/landing-inspiration/section\", { id });\n const section = data.section;\n const dir = path.join(process.cwd(), \".baker\", \"inspiration\", id);\n\n const ext = READABLE_SHOT.extension;\n const [desktop, mobile, filmstrip] = await Promise.all([\n downloadReadableShot(section.desktopShotUrl, path.join(dir, `desktop.${ext}`)),\n downloadReadableShot(section.mobileShotUrl, path.join(dir, `mobile.${ext}`)),\n downloadReadableShot(section.motionFilmstripUrl, path.join(dir, `motion-filmstrip.${ext}`)),\n ]);\n\n const full = args.full as boolean;\n const hints = [INSPIRATION_HINTS.structureNotCopy, INSPIRATION_HINTS.adapt];\n if (desktop) hints.push(`Read ${desktop} before you build — the description is not the section.`);\n hints.push(\"Need the mechanics? `baker landing inspiration code <id>` writes the standalone HTML+CSS to disk.\");\n const fidelity = fidelityHint(section.fidelity);\n if (fidelity) hints.push(fidelity);\n if (filmstrip) {\n hints.push(\n `${filmstrip} shows this section animating in, six frames left-to-right then top-to-bottom, with the elapsed time on each. Read it if you want the motion, not just the layout.`,\n );\n }\n\n writeJson({\n ok: true,\n data: {\n id: section.id,\n page_id: section.sourceId,\n section: section.sectionType,\n composition: section.composition,\n look: section.visualRegister,\n motion: section.motionSummary,\n design_tokens: section.designTokens,\n size: section.boundingBox,\n copy: {\n headline: section.headline,\n subhead: section.subhead,\n ctas: section.ctaLabels,\n proof: section.proofSignals,\n },\n why_it_works: section.whyItWorks,\n adaptation_notes: section.adaptationNotes,\n craft: section.craftScore,\n fidelity: section.fidelity,\n source_url: section.sourceUrl,\n screenshots: { desktop, mobile, motion_filmstrip: filmstrip },\n // Behind --full: exactly the block `search` already gates, plus the\n // reproduction notes, which `code` returns again for the one caller\n // that acts on them. Everything above is what you design *from*;\n // these are how the section was filed and how it rebuilds.\n ...(full\n ? {\n theme: section.theme,\n density: section.density,\n show_tell_rank: section.showTellRank,\n interactions: section.interactions,\n media: section.mediaKinds,\n devices: section.contentDevices,\n tags: section.tags,\n reproduction_notes: section.reproductionNotes,\n }\n : {}),\n },\n hints,\n });\n } catch (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