@commercelayer/agent-cli 0.1.4 → 0.1.5

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.
package/README.md CHANGED
@@ -16,7 +16,7 @@ npx -y @commercelayer/agent-cli@latest init --name "The Blue Brand" # runs c11
16
16
  | `init [--name <business name>]` | Create a sandbox store, with no login. The name (the folder name when absent) names the organization; the org slug and store hostname derive from it, numbered when taken. Writes `store.yml` (a commented template) and `credentials`. Reuses the store if they exist. |
17
17
  | `plan` | Validate `store.yml` and the product files, and list what `apply` would create, update or delete: markets, products, and the store's name and policies. |
18
18
  | `apply [--allow-delete]` | Make the store match the files. Refuses deletes without the flag. |
19
- | `storefront init [--force]` | Write `storefront/index.html`: a static page on [drop-in.js](https://commercelayer.github.io/drop-in.js/) listing the products in `store.yml`, with the hosted cart and checkout, wired to the sandbox's sales channel. Refuses to overwrite without the flag. |
19
+ | `storefront init [--force]` | Write `storefront/index.html`: a static page on [drop-in.js](https://commercelayer.github.io/drop-in.js/) listing the products in `store.yml`, with a minicart that slides in on add to cart, and the hosted cart and checkout, wired to the sandbox's sales channel. Refuses to overwrite without the flag. |
20
20
  | `storefront publish` | Upload the folder at `storefront.path` (default `storefront`) to the store host. |
21
21
  | `orders test [--sku <id>] [--quantity <n>] [--country <CC>] [--code <discount>] [--via-cart] [--decline]` | Buy from the store over UCP as a shopping agent would: discover, search, (cart,) checkout, address, pay with the sandbox handler, read the order back. Prints the order and every step. |
22
22
  | `orders list` | The orders placed in the store, newest first, as UCP order entities. |
package/dist/commands.js CHANGED
@@ -18,7 +18,7 @@ export const HELP = {
18
18
  init: 'Create a sandbox store for this repo, with no login: c11r init --name "<business name>" (the folder name when --name is absent). The name becomes the organization\'s name, and the org slug and store hostname derive from it. Writes .commercelayer/store.yml and .commercelayer/credentials. Reuses the store if store.yml already exists.',
19
19
  plan: 'Show what apply would create, update or delete: markets, products and the store\'s name and policies, from .commercelayer/store.yml and the product files under .commercelayer/products/ (*.yml lists, *.csv rows, merged by sku).',
20
20
  apply: 'Make the store match .commercelayer/store.yml and .commercelayer/products/. Refuses deletes unless --allow-delete is given.',
21
- 'storefront init': 'Write storefront/index.html: a static page on drop-in.js listing the products in store.yml, with the hosted cart and checkout. Refuses to overwrite unless --force is given.',
21
+ 'storefront init': 'Write storefront/index.html: a static page on drop-in.js listing the products in store.yml, with a minicart that opens on add to cart, and the hosted cart and checkout. Refuses to overwrite unless --force is given.',
22
22
  'storefront publish': 'Upload the storefront folder (store.yml storefront.path, default storefront) to the sandbox preview URL.',
23
23
  'orders test': 'Buy from the store over UCP as a shopping agent would, paying with the sandbox handler: discover, search, checkout, address, pay, read the order. Options: --sku <id> --quantity <n> --country <CC> --code <discount> --via-cart --decline.',
24
24
  'orders list': 'List the orders placed in the store, newest first, as UCP order entities.',
@@ -1,5 +1,5 @@
1
1
  // The storefront scaffold: one static page on drop-in.js listing the products in
2
- // store.yml, with the hosted cart and checkout. The agent then makes it the human's.
2
+ // store.yml, with the minicart, the hosted cart and checkout. The agent then makes it the human's.
3
3
  const esc = (t) => String(t ?? '').replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
4
4
  export function storefrontHtml(store, clientId) {
5
5
  const name = esc(store.name);
@@ -18,8 +18,9 @@ ${p.description ? ` <p>${esc(p.description)}</p>\n` : ''} <cl-pric
18
18
  <meta charset="utf-8">
19
19
  <meta name="viewport" content="width=device-width, initial-scale=1">
20
20
  <title>${name}</title>
21
- <!-- Commerce Layer drop-in.js: prices, availability, add to cart, and links to the hosted cart and checkout. -->
21
+ <!-- Commerce Layer drop-in.js: prices, availability, add to cart, the minicart (a slide-in panel, styled by minicart.css) and links to the hosted cart and checkout. -->
22
22
  <link href="https://cdn.jsdelivr.net/npm/@commercelayer/drop-in.js@2/dist/drop-in/drop-in.css" rel="stylesheet">
23
+ <link href="https://cdn.jsdelivr.net/npm/@commercelayer/drop-in.js@2/dist/drop-in/minicart.css" rel="stylesheet">
23
24
  <script>
24
25
  // The market comes from ?market=<code>; the first market in store.yml is the default. Keep clientId as it is.
25
26
  var market = new URLSearchParams(location.search).get('market') || '${esc(store.markets[0].code)}';
@@ -58,7 +59,7 @@ ${p.description ? ` <p>${esc(p.description)}</p>\n` : ''} <cl-pric
58
59
  ${options}
59
60
  </select>
60
61
  </label>
61
- <cl-cart-link>Cart (<cl-cart-count></cl-cart-count>)</cl-cart-link>
62
+ <cl-cart-link aria-label="Cart">Cart (<cl-cart-count></cl-cart-count>)<cl-cart type="mini" open-on-add></cl-cart></cl-cart-link>
62
63
  <cl-checkout-link>Checkout</cl-checkout-link>
63
64
  </nav>
64
65
  </header>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/agent-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "c11r: the Commerce Layer CLI for coding agents. Builds a sandbox store that people and shopping agents can buy from.",
5
5
  "homepage": "https://commercelayer.ai",
6
6
  "keywords": [