@commercelayer/agent-cli 0.1.5 → 0.1.7

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.
@@ -18,14 +18,14 @@ export function createApi(auth) {
18
18
  data = res.body ? JSON.parse(res.body) : null;
19
19
  }
20
20
  catch {
21
- fail('api_error', `${base} answered ${res.status} with something that is not JSON.`, 'Try again. If it keeps happening, report it at https://commercelayer.ai/support with the output of `c11r status`.');
21
+ fail('api_error', `${base} answered ${res.status} with something that is not JSON.`, 'Try again. If it keeps happening, tell the human, with the output of `c11r status`.');
22
22
  }
23
23
  if (res.status < 400)
24
24
  return data;
25
25
  const err = data?.error;
26
26
  if (err)
27
27
  fail(err.code, err.message, err.hint);
28
- fail('api_error', `The API answered ${res.status}.`, 'Try again. If it keeps happening, report it at https://commercelayer.ai/support with the output of `c11r status`.');
28
+ fail('api_error', `The API answered ${res.status}.`, 'Try again. If it keeps happening, tell the human, with the output of `c11r status`.');
29
29
  };
30
30
  return {
31
31
  createSandbox: (name) => request('POST', '/sandboxes', { name }),
package/dist/bin.js CHANGED
@@ -77,7 +77,7 @@ run()
77
77
  }
78
78
  else {
79
79
  const message = e instanceof Error ? e.message : String(e);
80
- print({ error: { code: 'internal', message, hint: 'This is a bug in the CLI. Report it at https://commercelayer.ai/support with this output.' } });
80
+ print({ error: { code: 'internal', message, hint: 'This is a bug in the CLI. Tell the human, with this output, and try again with npx -y @commercelayer/agent-cli@latest in case it is already fixed.' } });
81
81
  }
82
82
  process.exit(1);
83
83
  });
@@ -46,6 +46,8 @@ ${p.description ? ` <p>${esc(p.description)}</p>\n` : ''} <cl-pric
46
46
  cl-price-amount[type="compare-at"] { color: var(--muted); font-weight: 400; text-decoration: line-through; }
47
47
  cl-availability { font-size: 13px; color: var(--muted); }
48
48
  cl-add-to-cart { margin-top: auto; }
49
+ /* drop-in.css styles the count as a badge beside a cart icon (absolute, pushed right). The link is text here, so render it inline: "Cart (3)". */
50
+ cl-cart-link cl-cart-count { position: static; transform: none; display: inline; min-width: 0; height: auto; padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; }
49
51
  cl-add-to-cart::part(button), cl-checkout-link::part(a) { display: inline-block; padding: 10px 16px; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; border: 0; cursor: pointer; text-decoration: none; }
50
52
  footer { padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
51
53
  </style>
@@ -65,7 +65,7 @@ export async function discover(origin) {
65
65
  profile = JSON.parse(res.body);
66
66
  }
67
67
  catch {
68
- fail('ucp_profile_malformed', `${origin}/.well-known/ucp is not JSON.`, 'Report it at https://commercelayer.ai/support with the output of `c11r status`.');
68
+ fail('ucp_profile_malformed', `${origin}/.well-known/ucp is not JSON.`, 'The store host answered badly. Try again; if it keeps happening, tell the human, with the output of `c11r status`.');
69
69
  }
70
70
  const ucp = profile.ucp ?? {};
71
71
  if (ucp.version !== UCP_VERSION) {
@@ -74,7 +74,7 @@ export async function discover(origin) {
74
74
  const rest = (name) => (ucp.services?.[name] ?? []).find((s) => s.transport === 'rest')?.endpoint ?? null;
75
75
  const endpoint = rest('dev.ucp.shopping');
76
76
  if (!endpoint)
77
- fail('ucp_no_rest_service', 'The store profile has no REST dev.ucp.shopping service.', 'Report it at https://commercelayer.ai/support.');
77
+ fail('ucp_no_rest_service', 'The store profile has no REST dev.ucp.shopping service.', 'The store host serves a profile this CLI cannot use. Tell the human, with the output of `c11r ucp profile`.');
78
78
  const capabilities = new Set();
79
79
  for (const [name, entries] of Object.entries(ucp.capabilities ?? {})) {
80
80
  if (entries.some((e) => e.version === UCP_VERSION))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/agent-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
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": [