[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F88BPJTCEXY4B0ZV98BW9R":3,"skill-same:01M7F88BPJTCEXY4B0ZV98BW9R":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7F88BPJTCEXY4B0ZV98BW9R","commerce-ui-tools",null,"The reference presentation-tool contract, covering server-side enrichment, suggestion chips, the event stream, progressive rendering, both roles' built-in components, and adding a vertical component. Load when building or reviewing how a commerce agent's output reaches a frontend.","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fcommerce-ui-tools\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: commerce-ui-tools\ndescription: The reference presentation-tool contract, covering server-side enrichment, suggestion chips, the event stream, progressive rendering, both roles' built-in components, and adding a vertical component. Load when building or reviewing how a commerce agent's output reaches a frontend.\n---\n\n# Presentation tools\n\nPaths are in the reference repo: `commerce_common\u002F` is `commerce-common\u002Fcommerce_common\u002F`, `shopping_agent\u002F` is\n`shopping-agent\u002Fcore\u002Fshopping_agent\u002F`, `merchant_agent\u002F` is `merchant-agent\u002Fcore\u002Fmerchant_agent\u002F`.\n\n## The contract\n\n- A component is a tool. The model's arguments carry its judgment: which ids, in what order, the reason or the\n  note for each, what to compare on. The server joins every fact (title, price, image, metric value, change\n  record) from records tools returned this session, so the frontend never renders a model-authored value.\n- One spec per component: `PresentationComponent` in `commerce_common\u002Fpresentation.py` names the tool, the\n  `component` string the host renders, the `payload_model` that validates the arguments (each role's\n  `tools\u002Fpresentation.py`), and the `enrich` hook (each role's `enrichment.py`, collected in `PRESENTATION_COMPONENTS`).\n- `run_presentation` in `commerce_common\u002Fpresentation.py` is the one runner: validate, enrich, emit the `ui` event.\n  The model reads the executor's `displayed_text` plus the hook's notes; the enriched payload goes to the host only.\n- An enrich hook drops ids without provenance and appends a note naming them; with nothing left it raises\n  `PresentationRefused`, which comes back as a held call when it names a gate and as an error otherwise.\n- Shopping joins from `ShoppingSessionState.seen_products`, the cart, or an order read; merchant joins from\n  `MerchantSessionState.latest_snapshot`, `seen_series`, `seen_campaigns`, `seen_analyses`, `seen_listings`, and `seen_changes`.\n  `enrich_change_preview` also removes model text whose currency or weekday disagrees with the change record.\n- Composition rules (which component ends a turn, text carries the reasoning, cards carry the data) are static\n  prompt material; each component's when-to-use line is its tool description (commerce-architecture's layer table).\n\n## Suggestions\n\n- `present_suggestions` is the one tool that carries the turn's chips, up to four; the model calls it in the same\n  round as the turn's last component, or after its text when the turn has none, and a tapped chip is sent as the next\n  user message. No other payload, built-in or extension, carries chips.\n- `sanitize_suggestion_chips` in `commerce_common\u002Ffencing.py` runs on `PresentSuggestionsPayload`: invisible and control\n  characters out, whitespace collapsed, empties dropped, 80 characters each, four at most. The payload fails when no\n  chip survives sanitizing.\n- A round of clean presentation calls that includes `present_suggestions` ends the turn (`round_closes_turn` in\n  `commerce_common\u002Fturn.py`, `close_on_presentation` in the config): the Messages API loop stops there, and the Agent\n  SDK runtimes stop through a `PostToolBatch` hook (`close_on_presentation_hook` in `commerce_common\u002Fagent_sdk.py`).\n  Under host approval the merchant prompt says no chip approves or applies.\n\n## Streaming\n\nThe event list is the docstring of `commerce_common\u002Fstreaming.py`; `to_sse` frames each event and a host ignores\ntypes it does not know. `ui` carries one enriched component, `ui_partial` the same while its call still streams,\n`cart_update` the whole cart after a cart write, and `change_update` a change record after it moved. `outcome_events`\nin `commerce_common\u002Fturn.py` stamps each `ui` event with its call id as `stream_id` and follows it with the\n`tool_result`, whose `status` is `ok`, `error`, or `blocked`. Every tool that is not a presentation tool may take a\n`status` argument first (`with_status` in `commerce_common\u002Fexecution.py`): a few words for the person waiting, which\nthe executor drops before the call runs and the runtime emits as the `tool_call` event's `label`; the web layer shows\nit as the activity line. The MCP servers build their tools without it. The Agent SDK runtimes run the same executor but return the payloads together in `result.ui`\nafter the turn.\n\n## Progressive rendering\n\nA spec with an `enrich_partial` hook is rendered while its arguments arrive: the request marks its tool\n`eager_input_streaming` (`with_eager_input` in `commerce_common\u002Fprompt_assembly.py`), the orchestrator parses the\nbuffer with `parse_partial_json` (a string still being written is left out with its key), calls `enrich_partial`\n(`commerce_common\u002Fpresentation.py`), and yields `ui_partial` whenever `partial_signature` changes (`StreamedRound.frame`\nin `commerce_common\u002Fturn.py`; every visible change with `eager_partial_frames` on the config); the final `ui` event\ncarries the same `stream_id` and replaces it. Input that streams as text that is not JSON comes back to the model as\nan error result and the round goes on (`StreamedRound`). Partial\nhooks are synchronous and join from session state only (`partial_products`, `partial_comparison`, `partial_plan`,\n`partial_guide` in `shopping_agent\u002Fenrichment.py`; `partial_metrics`, `partial_digest`, `partial_change_preview` in\n`merchant_agent\u002Fenrichment.py`).\n\n## Built-in components\n\n- Shopping (`shopping_agent\u002Fenrichment.py`): `present_products`, `present_comparison`, `present_plan`, `present_guide`,\n  `present_order_status`, `checkout` (renders the cart; charges nothing), `present_suggestions`, and `present_disclosure`,\n  registered only with `enable_disclosures` and filled from `StorefrontBackend.get_disclosure`.\n- Merchant (`merchant_agent\u002Fenrichment.py`): `present_metrics`, `present_digest`, `present_change_preview`, `present_suggestions`.\n\n## Adding a vertical component\n\n- Build a `PresentationExtension` (`commerce_common\u002Fpresentation.py`): the tool description and `input_schema` the\n  model sees, the `payload_model` that validates the same shape, the `component` name, and the enrich hook.\n- Pass it as `extra_presentation_tools` to `ShoppingAgent` or `MerchantAgent` (`examples\u002Ftravel\u002Fapi\u002Fmain.py`); on\n  the Agent SDK and MCP paths, subclass the toolset or pass `executor_class=` so the executor receives it as\n  `extensions`. `build_tools` rejects a name that collides with a built-in,\n  and the extension's bytes join the cached tool list (commerce-prompt-caching).\n- The seven in the repo: `examples\u002Ftravel\u002Fapi\u002Fitinerary.py`, `examples\u002Ftravel\u002Fapi\u002Foccupancy.py`,\n  `examples\u002Ftelecom\u002Fapi\u002Fplan_matrix.py`, `examples\u002Ftelecom\u002Fapi\u002Fplan_mix.py`, `examples\u002Fentertainment\u002Fapi\u002Fvenue_map.py`,\n  `examples\u002Fentertainment\u002Fapi\u002Fhold_view.py`, `examples\u002Fentertainment\u002Fapi\u002Fevent_pacing.py`. Each keeps its types and\n  its card in the vertical; nothing is added to a core package.\n","# Presentation tools\n\nPaths are in the reference repo: `commerce_common\u002F` is `commerce-common\u002Fcommerce_common\u002F`, `shopping_agent\u002F` is\n`shopping-agent\u002Fcore\u002Fshopping_agent\u002F`, `merchant_agent\u002F` is `merchant-agent\u002Fcore\u002Fmerchant_agent\u002F`.\n\n## The contract\n\n- A component is a tool. The model's arguments carry its judgment: which ids, in what order, the reason or the\n  note for each, what to compare on. The server joins every fact (title, price, image, metric value, change\n  record) from records tools returned this session, so the frontend never renders a model-authored value.\n- One spec per component: `PresentationComponent` in `commerce_common\u002Fpresentation.py` names the tool, the\n  `component` string the host renders, the `payload_model` that validates the arguments (each role's\n  `tools\u002Fpresentation.py`), and the `enrich` hook (each role's `enrichment.py`, collected in `PRESENTATION_COMPONENTS`).\n- `run_presentation` in `commerce_common\u002Fpresentation.py` is the one runner: validate, enrich, emit the `ui` event.\n  The model reads the executor's `displayed_text` plus the hook's notes; the enriched payload goes to the host only.\n- An enrich hook drops ids without provenance and appends a note naming them; with nothing left it raises\n  `PresentationRefused`, which comes back as a held call when it names a gate and as an error otherwise.\n- Shopping joins from `ShoppingSessionState.seen_products`, the cart, or an order read; merchant joins from\n  `MerchantSessionState.latest_snapshot`, `seen_series`, `seen_campaigns`, `seen_analyses`, `seen_listings`, and `seen_changes`.\n  `enrich_change_preview` also removes model text whose currency or weekday disagrees with the change record.\n- Composition rules (which component ends a turn, text carries the reasoning, cards carry the data) are static\n  prompt material; each component's when-to-use line is its tool description (commerce-architecture's layer table).\n\n## Suggestions\n\n- `present_suggestions` is the one tool that carries the turn's chips, up to four; the model calls it in the same\n  round as the turn's last component, or after its text when the turn has none, and a tapped chip is sent as the next\n  user message. No other payload, built-in or extension, carries chips.\n- `sanitize_suggestion_chips` in `commerce_common\u002Ffencing.py` runs on `PresentSuggestionsPayload`: invisible and control\n  characters out, whitespace collapsed, empties dropped, 80 characters each, four at most. The payload fails when no\n  chip survives sanitizing.\n- A round of clean presentation calls that includes `present_suggestions` ends the turn (`round_closes_turn` in\n  `commerce_common\u002Fturn.py`, `close_on_presentation` in the config): the Messages API loop stops there, and the Agent\n  SDK runtimes stop through a `PostToolBatch` hook (`close_on_presentation_hook` in `commerce_common\u002Fagent_sdk.py`).\n  Under host approval the merchant prompt says no chip approves or applies.\n\n## Streaming\n\nThe event list is the docstring of `commerce_common\u002Fstreaming.py`; `to_sse` frames each event and a host ignores\ntypes it does not know. `ui` carries one enriched component, `ui_partial` the same while its call still streams,\n`cart_update` the whole cart after a cart write, and `change_update` a change record after it moved. `outcome_events`\nin `commerce_common\u002Fturn.py` stamps each `ui` event with its call id as `stream_id` and follows it with the\n`tool_result`, whose `status` is `ok`, `error`, or `blocked`. Every tool that is not a presentation tool may take a\n`status` argument first (`with_status` in `commerce_common\u002Fexecution.py`): a few words for the person waiting, which\nthe executor drops before the call runs and the runtime emits as the `tool_call` event's `label`; the web layer shows\nit as the activity line. The MCP servers build their tools without it. The Agent SDK runtimes run the same executor but return the payloads together in `result.ui`\nafter the turn.\n\n## Progressive rendering\n\nA spec with an `enrich_partial` hook is rendered while its arguments arrive: the request marks its tool\n`eager_input_streaming` (`with_eager_input` in `commerce_common\u002Fprompt_assembly.py`), the orchestrator parses the\nbuffer with `parse_partial_json` (a string still being written is left out with its key), calls `enrich_partial`\n(`commerce_common\u002Fpresentation.py`), and yields `ui_partial` whenever `partial_signature` changes (`StreamedRound.frame`\nin `commerce_common\u002Fturn.py`; every visible change with `eager_partial_frames` on the config); the final `ui` event\ncarries the same `stream_id` and replaces it. Input that streams as text that is not JSON comes back to the model as\nan error result and the round goes on (`StreamedRound`). Partial\nhooks are synchronous and join from session state only (`partial_products`, `partial_comparison`, `partial_plan`,\n`partial_guide` in `shopping_agent\u002Fenrichment.py`; `partial_metrics`, `partial_digest`, `partial_change_preview` in\n`merchant_agent\u002Fenrichment.py`).\n\n## Built-in components\n\n- Shopping (`shopping_agent\u002Fenrichment.py`): `present_products`, `present_comparison`, `present_plan`, `present_guide`,\n  `present_order_status`, `checkout` (renders the cart; charges nothing), `present_suggestions`, and `present_disclosure`,\n  registered only with `enable_disclosures` and filled from `StorefrontBackend.get_disclosure`.\n- Merchant (`merchant_agent\u002Fenrichment.py`): `present_metrics`, `present_digest`, `present_change_preview`, `present_suggestions`.\n\n## Adding a vertical component\n\n- Build a `PresentationExtension` (`commerce_common\u002Fpresentation.py`): the tool description and `input_schema` the\n  model sees, the `payload_model` that validates the same shape, the `component` name, and the enrich hook.\n- Pass it as `extra_presentation_tools` to `ShoppingAgent` or `MerchantAgent` (`examples\u002Ftravel\u002Fapi\u002Fmain.py`); on\n  the Agent SDK and MCP paths, subclass the toolset or pass `executor_class=` so the executor receives it as\n  `extensions`. `build_tools` rejects a name that collides with a built-in,\n  and the extension's bytes join the cached tool list (commerce-prompt-caching).\n- The seven in the repo: `examples\u002Ftravel\u002Fapi\u002Fitinerary.py`, `examples\u002Ftravel\u002Fapi\u002Foccupancy.py`,\n  `examples\u002Ftelecom\u002Fapi\u002Fplan_matrix.py`, `examples\u002Ftelecom\u002Fapi\u002Fplan_mix.py`, `examples\u002Fentertainment\u002Fapi\u002Fvenue_map.py`,\n  `examples\u002Fentertainment\u002Fapi\u002Fhold_view.py`, `examples\u002Fentertainment\u002Fapi\u002Fevent_pacing.py`. Each keeps its types and\n  its card in the vertical; nothing is added to a core package.\n",{"name":5,"description":7},"main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","06-前端与设计\u002Fcommerce-ui-tools",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill commerce-ui-tools",{"tool":38,"command":39},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill commerce-ui-tools",{"tool":41,"command":42},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill commerce-ui-tools","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F06-前端与设计\u002Fcommerce-ui-tools\u002FSKILL.md",true,[],[47,54,59,66,73,80],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],{"skillNo":55,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]