{"_id":"@af-mobile/prompt","_rev":"6-4eaeb317ef0be44709355757e78f8e63","name":"@af-mobile/prompt","dist-tags":{"latest":"2.1.1"},"versions":{"2.0.0":{"name":"@af-mobile/prompt","version":"2.0.0","license":"MIT","_id":"@af-mobile/prompt@2.0.0","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"dist":{"shasum":"d7764c4bdb03b9da739905a46a8a22399cd1892c","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.0.0.tgz","fileCount":11,"integrity":"sha512-0ukRf4QU0BTa8sIrSxsWZcO6bkwFAcO9IOBN+A4OsB7Pv/ntguOUpoa9LvzJDHdBRgXn/spKlvGtiy0W8RRjWg==","signatures":[{"sig":"MEQCIEW8YYNoEkNakbQVpUCkdTVa4RMhbnT1eYJ/tfwB+yAHAiAhZDAMPligQFcLFg/lbQO3tF0dc2K1ioQjJCSBvjvxxA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98002},"type":"module","exports":{".":"./index.mjs"},"gitHead":"8fcae530a604c2785b5bf75057547a8b87105294","_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"_npmVersion":"11.9.0","description":"AIFlow UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"prepublishOnly":"node ../scripts/sync-pkg-assets.mjs && node ../scripts/build-prompt-pkg.mjs","_npmOperationalInternal":{"tmp":"tmp/prompt_2.0.0_1786944217456_0.33564232712263986","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@af-mobile/prompt","version":"2.0.1","license":"MIT","_id":"@af-mobile/prompt@2.0.1","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"dist":{"shasum":"03839efe3cb437e69d27604603cc6eb5222f7e7a","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.0.1.tgz","fileCount":12,"integrity":"sha512-LFBQ3l0mHk99NxlULphvorTi/rIB3oXSesXVkSmeo8Ye+Km0Ftu0WlvmnMn5N2331/soDkmPUFvNXIzrmE9qRQ==","signatures":[{"sig":"MEUCIH9trNGKkRDbIS5LJJGC5bntZSNcqbMY/zVPNa9laMt5AiEA58ksGzvugVorEH0/SDg2pLND51AZz4EVmvfTUAWQT7s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99538},"type":"module","exports":{".":"./index.mjs"},"gitHead":"c22bdc91899afdc725600040511a27699a59df74","_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"_npmVersion":"11.9.0","description":"AIFlow UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"prepublishOnly":"node ../scripts/sync-pkg-assets.mjs && node ../scripts/build-prompt-pkg.mjs","_npmOperationalInternal":{"tmp":"tmp/prompt_2.0.1_1786944973831_0.44567510851222236","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@af-mobile/prompt","version":"2.0.2","license":"MIT","_id":"@af-mobile/prompt@2.0.2","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"dist":{"shasum":"636dee4d1fb62203081ef413b4a86f72399d02fa","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.0.2.tgz","fileCount":12,"integrity":"sha512-JCbnbSRHWhJC70uE7yQZEx8KSgnH4s+xZDvl7B765HKML2YAS0ii+LX0ey6jzOXpwu8h37mHndQ+2Pwrr8TCSw==","signatures":[{"sig":"MEUCICImluJddpRm1ldV9m1m7QCsxH+9Wu8NJdu019H4CQ8aAiEAri1467jq09Zr0T6E7XQbdtLQWtrMxUH5yQI3cE6TizA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110524},"type":"module","exports":{".":"./index.mjs"},"gitHead":"7ddd5f04edd186b9d0f139e1affce1b4a8b98592","_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"_npmVersion":"11.9.0","description":"AIFlow UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"prepublishOnly":"node ../scripts/sync-pkg-assets.mjs && node ../scripts/build-prompt-pkg.mjs","_npmOperationalInternal":{"tmp":"tmp/prompt_2.0.2_1786964570313_0.40918186569657267","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@af-mobile/prompt","version":"2.0.3","license":"MIT","_id":"@af-mobile/prompt@2.0.3","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"bin":{"af-mobile-prompt":"bin.mjs"},"dist":{"shasum":"d231a3042027eaaf294a55bbf48144b7afcaabaa","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.0.3.tgz","fileCount":13,"integrity":"sha512-9gPKh5jgIsDCnIB3bpRBl47TsGJ3Mh93SXXz0YeR/f7wObw+tuWmXPGZ881H50q7J+9ghZBAlln4h9D2GiIgTg==","signatures":[{"sig":"MEQCIE4f2kUYQdWRsxv5LRQs6LwXl7xxbDY4qyQFhJUXX58rAiAdr1DBDtMZauAmCjju7QWMYv2R1xR71DfwEC3UVuRmsg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":131557},"type":"module","exports":{".":"./index.mjs"},"gitHead":"ecc54817f459e4611bb772e290d61cc95e2991a2","_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"_npmVersion":"11.9.0","description":"af-mobile UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"prepublishOnly":"node ../scripts/sync-pkg-assets.mjs && node ../scripts/build-prompt-pkg.mjs","_npmOperationalInternal":{"tmp":"tmp/prompt_2.0.3_1787142615923_0.28937044823679337","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@af-mobile/prompt","version":"2.1.0","license":"MIT","_id":"@af-mobile/prompt@2.1.0","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"bin":{"af-mobile-prompt":"bin.mjs"},"dist":{"shasum":"6fa4fbcd9c556b3770a3b27bb7a384dd28838e87","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.1.0.tgz","fileCount":14,"integrity":"sha512-9C+ejTfwfdxK1J/BoUYBMvUoxcY0NjUg+/dVMsWAVRcNr/l3XVIw/FovcVljNHX2ifluBxd6UtM+LEM/LCzKRQ==","signatures":[{"sig":"MEUCIQDoF1G0OhiqgmxF1rfBPfZbbYjoI0/HiREYHIwB0fcwqwIgW+Dt5Od22Vo1hmTyxyYZCxP8w1jG7QZu10irjVyDlV8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":188957},"type":"module","exports":{".":"./index.mjs"},"gitHead":"a17f0ad93a89cf08c02fc98e0aaf4a61996bce57","_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"_npmVersion":"11.9.0","description":"af-mobile UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","directories":{},"_nodeVersion":"24.14.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/prompt_2.1.0_1787876720310_0.9972829915017885","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@af-mobile/prompt","version":"2.1.1","type":"module","description":"af-mobile UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","bin":{"af-mobile-prompt":"bin.mjs"},"exports":{".":"./index.mjs"},"scripts":{"prepublishOnly":"node ../scripts/build-prompt-pkg.mjs"},"repository":{"type":"git","url":"git+https://github.com/soulor8908/af-mobile.git"},"license":"MIT","gitHead":"3190f9b480b9aa942aebff21ebb222ab356c7952","_id":"@af-mobile/prompt@2.1.1","bugs":{"url":"https://github.com/soulor8908/af-mobile/issues"},"homepage":"https://github.com/soulor8908/af-mobile#readme","_nodeVersion":"24.19.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-hawRmfV00WmLi8g1FJh6d15Jl3Q0TV3piwHHTa2UK7iQWZGtXvyT8siTdlADFX8sUab09IraqC129A4Ld0ciwA==","shasum":"528731e86feb6dcfd93c9bc0c5c652dca64e5e77","tarball":"https://registry.npmjs.org/@af-mobile/prompt/-/prompt-2.1.1.tgz","fileCount":14,"unpackedSize":190225,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@af-mobile%2fprompt@2.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICayqaWJ0Y14GO9Mjub8X+Y0/9EURiM8RC0w6kuanjKpAiEAzElrnUKHBrn+rpboywha+YgDUXEXx/q8ny+O6o8lW10="}]},"_npmUser":{"name":"soulor8908","email":"871816706@qq.com"},"directories":{},"maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prompt_2.1.1_1787997657960_0.7210281720404954"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-17T05:23:36.537Z","modified":"2026-08-29T10:00:58.509Z","2.0.0":"2026-08-17T05:23:37.594Z","2.0.1":"2026-08-17T05:36:13.970Z","2.0.2":"2026-08-17T11:02:50.468Z","2.0.3":"2026-08-19T12:30:16.091Z","2.1.0":"2026-08-28T00:25:20.484Z","2.1.1":"2026-08-29T10:00:58.113Z"},"license":"MIT","description":"af-mobile UI System Prompt builder — modular (role + whitelist + component API + few-shot + model)","maintainers":[{"name":"soulor8908","email":"871816706@qq.com"}],"readme":"# @af-mobile/prompt\n\naf-mobile UI 的 **Prompt 即 API** 薄入口。将 af-mobile UI 分层设计体系（角色 / 白名单 / 组件 API / few-shot / 模型）编译成一份可用的 System Prompt。\n\n## 安装\n\n```bash\nnpm i @af-mobile/prompt\n```\n\n## 用法\n\n```js\nimport { buildPrompt } from '@af-mobile/prompt';\n\n// 按需求裁剪 few-shot；返回完整的 System Prompt 字符串（含白名单 + 组件 API + 精选 few-shot）\nconst system = buildPrompt({ userPrompt: '商品列表页带图，支持搜索' });\n```\n\n### CLI（MCP 不可达时的降级入口）\n\n```bash\nnpx @af-mobile/prompt \"商品列表页带图\"        # 按需求裁剪，输出到 stdout\nnpx @af-mobile/prompt \"需求\" --full           # 全量 prompt\nnpx @af-mobile/prompt \"需求\" -o prompt.md     # 写入文件\n```\n\n与 MCP `get_prompt` 工具同构，适合未接入 MCP 的 Agent / 脚本环境。\n\n## API\n\n| 导出 | 说明 |\n|---|---|\n| `buildPrompt({ userPrompt, components, categories, projectRecipes, model, theme }?)` | 主入口；按 `userPrompt`（或显式 `categories`）裁剪 few-shot，返回 System Prompt 字符串 |\n| `pickCategories` | 按需求关键词分派到相关 few-shot 类别 |\n| `filterFewshots` | 裁剪最相关的 few-shot 样本 |\n| `buildWhitelistSection` | 生成白名单约束段落 |\n| `buildComponentTableSection` | 生成组件 API 段落 |\n| `buildProjectExtensionSection` | 生成项目扩展段落 |\n| `extractGroupsFromCss` | 从 CSS 提取 token 分组 |\n| `extractProjectExtensions` | 提取项目扩展能力 |\n\n> 该包是**纯函数 + 资产快照**，无外部运行时依赖，Tree Shaking 友好（ESM）。\n> 若与 MCP 一起使用，推荐直接用 `@af-mobile/mcp` 的 `get_prompt` 工具，无需手动拼装。\n\n## 资产\n\n内部 assets（whitelist / CSS / template / models）在发布时快照进 `assets/`，读包内副本，不依赖编译时生成。","readmeFilename":"README.md","homepage":"https://github.com/soulor8908/af-mobile#readme","repository":{"type":"git","url":"git+https://github.com/soulor8908/af-mobile.git"},"bugs":{"url":"https://github.com/soulor8908/af-mobile/issues"}}