@greatstore/cli 0.1.7 → 0.1.8

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cli.js +98 -130
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to `@greatstore/cli` are recorded here. The format
4
4
  follows [Keep a Changelog](https://keepachangelog.com/).
5
5
 
6
+ ## 0.1.8 — 2026-09-12
7
+
8
+ ### Changed
9
+ - When your session has expired, commands now say so and stop, instead of
10
+ opening a browser to sign you back in. Run `gs login` when you're ready.
11
+
6
12
  ## 0.1.7 — 2026-09-12
7
13
 
8
14
  ### Changed
package/dist/cli.js CHANGED
@@ -284,99 +284,8 @@ function isENOENT(err) {
284
284
  return typeof err === "object" && err !== null && err.code === "ENOENT";
285
285
  }
286
286
 
287
- // src/config.ts
288
- import * as fs2 from "fs";
289
- import * as path2 from "path";
290
- var DASHBOARD_BASE_DEFAULT = "https://my.greatstore.ai";
291
- var StoreResolutionError = class extends Error {
292
- constructor(message) {
293
- super(message);
294
- this.name = "StoreResolutionError";
295
- }
296
- };
297
- function requireProjectStore(input = {}) {
298
- const fromRc = findGsrc(input.cwd ?? process.cwd());
299
- if (fromRc) return assertMatchesSignedInStore(fromRc);
300
- throw new StoreResolutionError(
301
- "No .gsrc found in this directory or any ancestor. Run `gs apps init --store <slug>` first to scaffold a GreatStore project."
302
- );
303
- }
304
- function resolveReadStore(cwd = process.cwd()) {
305
- const fromRc = findGsrc(cwd);
306
- if (fromRc) return assertMatchesSignedInStore(fromRc);
307
- const pinned = signedInStore();
308
- if (pinned) return pinned;
309
- throw new StoreResolutionError(
310
- "No store selected. Run `gs login`, or run from a project with a .gsrc."
311
- );
312
- }
313
- function signedInStore() {
314
- try {
315
- return read()?.store ?? null;
316
- } catch {
317
- return null;
318
- }
319
- }
320
- function assertMatchesSignedInStore(slug) {
321
- const pinned = signedInStore();
322
- if (pinned && pinned !== slug) {
323
- throw new StoreResolutionError(
324
- `This targets store "${slug}" but you're signed in to "${pinned}". Run \`gs switch ${slug}\` to change stores.`
325
- );
326
- }
327
- return slug;
328
- }
329
- function findGsrc(cwd) {
330
- let dir = path2.resolve(cwd);
331
- const root = path2.parse(dir).root;
332
- while (true) {
333
- const candidate = path2.join(dir, ".gsrc");
334
- if (fs2.existsSync(candidate)) {
335
- try {
336
- const raw = fs2.readFileSync(candidate, "utf8");
337
- const parsed = JSON.parse(raw);
338
- if (typeof parsed.store === "string" && parsed.store.trim()) {
339
- return parsed.store.trim();
340
- }
341
- } catch {
342
- }
343
- }
344
- if (dir === root) return null;
345
- const parent = path2.dirname(dir);
346
- if (parent === dir) return null;
347
- dir = parent;
348
- }
349
- }
350
- function resolveAdminStore(args) {
351
- const explicit = flagString(args.flags, "store")?.trim();
352
- if (explicit) return assertMatchesSignedInStore(explicit);
353
- const fromRc = findGsrc(process.cwd());
354
- if (fromRc) return assertMatchesSignedInStore(fromRc);
355
- const pinned = signedInStore();
356
- if (pinned) return pinned;
357
- throw new StoreResolutionError(
358
- "No store selected. Pass --store <slug>, or run from a project with a .gsrc."
359
- );
360
- }
361
- function apiBaseFor(slug, env = process.env) {
362
- const override = env.GS_API_BASE?.trim();
363
- if (override) return stripTrailingSlash(override);
364
- return `https://${slug}.greatstore.ai`;
365
- }
366
- function dashboardBase(env = process.env) {
367
- const override = env.GS_DASHBOARD_BASE?.trim();
368
- if (override) return stripTrailingSlash(override);
369
- return DASHBOARD_BASE_DEFAULT;
370
- }
371
- function adminApiBase(slug, env = process.env) {
372
- return `${dashboardBase(env)}/${slug}/admin`;
373
- }
374
- function stripTrailingSlash(s) {
375
- return s.endsWith("/") ? s.slice(0, -1) : s;
376
- }
377
-
378
287
  // src/version.ts
379
- var CLI_VERSION = true ? "0.1.7" : "0.0.0-dev";
288
+ var CLI_VERSION = true ? "0.1.8" : "0.0.0-dev";
380
289
 
381
290
  // src/http.ts
382
291
  var HttpError = class extends Error {
@@ -393,18 +302,18 @@ var AuthRequiredError = class extends Error {
393
302
  this.name = "AuthRequiredError";
394
303
  }
395
304
  };
305
+ var SESSION_EXPIRED = "Session expired. Run `gs login` to sign in again.";
396
306
  async function request(url, options = {}) {
397
- const interactive = options.interactive ?? true;
398
307
  const stored = read();
399
308
  if (!stored) throw new AuthRequiredError();
309
+ if (isExpired(stored)) throw new AuthRequiredError(SESSION_EXPIRED);
400
310
  try {
401
311
  return await sendOnce(url, options, stored.access_token);
402
312
  } catch (err) {
403
- if (!interactive || !(err instanceof HttpError) || err.status !== 401) {
404
- throw err;
313
+ if (err instanceof HttpError && err.status === 401) {
314
+ throw new AuthRequiredError(SESSION_EXPIRED);
405
315
  }
406
- const refreshed = await reauthenticate(url);
407
- return await sendOnce(url, options, refreshed.access_token);
316
+ throw err;
408
317
  }
409
318
  }
410
319
  async function sendOnce(url, options, accessToken) {
@@ -504,38 +413,6 @@ function genericMessage(status) {
504
413
  if (status >= 400) return "Request rejected.";
505
414
  return "Unexpected response.";
506
415
  }
507
- function storeFromRequestUrl(rawUrl) {
508
- let u;
509
- try {
510
- u = new URL(rawUrl);
511
- } catch {
512
- return void 0;
513
- }
514
- const segments = u.pathname.split("/").filter(Boolean);
515
- if (segments[1] === "admin" && segments[0]) return segments[0];
516
- const label = u.hostname.split(".")[0];
517
- const reserved = /* @__PURE__ */ new Set(["my", "www", "app", "api", "admin", "localhost"]);
518
- if (u.hostname.includes(".") && label && !reserved.has(label)) return label;
519
- return void 0;
520
- }
521
- async function reauthenticate(requestUrl) {
522
- const target = storeFromRequestUrl(requestUrl) ?? read()?.store;
523
- process.stderr.write("Sign-in expired \u2014 opening browser.\n");
524
- try {
525
- const { token, store } = await captureLoopbackToken({
526
- dashboardBaseUrl: dashboardBase(),
527
- ...target ? { requestedStore: target } : {}
528
- });
529
- const next = buildCredentials(token, store);
530
- write(next);
531
- return next;
532
- } catch (err) {
533
- if (err instanceof LoopbackError) {
534
- throw new AuthRequiredError(err.message);
535
- }
536
- throw err;
537
- }
538
- }
539
416
  function buildCredentials(token, store) {
540
417
  const claims = decodeJwtPayload(token);
541
418
  const sub = readString(claims, "sub");
@@ -572,6 +449,97 @@ function maybeBool(obj, src, dst) {
572
449
  return {};
573
450
  }
574
451
 
452
+ // src/config.ts
453
+ import * as fs2 from "fs";
454
+ import * as path2 from "path";
455
+ var DASHBOARD_BASE_DEFAULT = "https://my.greatstore.ai";
456
+ var StoreResolutionError = class extends Error {
457
+ constructor(message) {
458
+ super(message);
459
+ this.name = "StoreResolutionError";
460
+ }
461
+ };
462
+ function requireProjectStore(input = {}) {
463
+ const fromRc = findGsrc(input.cwd ?? process.cwd());
464
+ if (fromRc) return assertMatchesSignedInStore(fromRc);
465
+ throw new StoreResolutionError(
466
+ "No .gsrc found in this directory or any ancestor. Run `gs apps init --store <slug>` first to scaffold a GreatStore project."
467
+ );
468
+ }
469
+ function resolveReadStore(cwd = process.cwd()) {
470
+ const fromRc = findGsrc(cwd);
471
+ if (fromRc) return assertMatchesSignedInStore(fromRc);
472
+ const pinned = signedInStore();
473
+ if (pinned) return pinned;
474
+ throw new StoreResolutionError(
475
+ "No store selected. Run `gs login`, or run from a project with a .gsrc."
476
+ );
477
+ }
478
+ function signedInStore() {
479
+ try {
480
+ return read()?.store ?? null;
481
+ } catch {
482
+ return null;
483
+ }
484
+ }
485
+ function assertMatchesSignedInStore(slug) {
486
+ const pinned = signedInStore();
487
+ if (pinned && pinned !== slug) {
488
+ throw new StoreResolutionError(
489
+ `This targets store "${slug}" but you're signed in to "${pinned}". Run \`gs switch ${slug}\` to change stores.`
490
+ );
491
+ }
492
+ return slug;
493
+ }
494
+ function findGsrc(cwd) {
495
+ let dir = path2.resolve(cwd);
496
+ const root = path2.parse(dir).root;
497
+ while (true) {
498
+ const candidate = path2.join(dir, ".gsrc");
499
+ if (fs2.existsSync(candidate)) {
500
+ try {
501
+ const raw = fs2.readFileSync(candidate, "utf8");
502
+ const parsed = JSON.parse(raw);
503
+ if (typeof parsed.store === "string" && parsed.store.trim()) {
504
+ return parsed.store.trim();
505
+ }
506
+ } catch {
507
+ }
508
+ }
509
+ if (dir === root) return null;
510
+ const parent = path2.dirname(dir);
511
+ if (parent === dir) return null;
512
+ dir = parent;
513
+ }
514
+ }
515
+ function resolveAdminStore(args) {
516
+ const explicit = flagString(args.flags, "store")?.trim();
517
+ if (explicit) return assertMatchesSignedInStore(explicit);
518
+ const fromRc = findGsrc(process.cwd());
519
+ if (fromRc) return assertMatchesSignedInStore(fromRc);
520
+ const pinned = signedInStore();
521
+ if (pinned) return pinned;
522
+ throw new StoreResolutionError(
523
+ "No store selected. Pass --store <slug>, or run from a project with a .gsrc."
524
+ );
525
+ }
526
+ function apiBaseFor(slug, env = process.env) {
527
+ const override = env.GS_API_BASE?.trim();
528
+ if (override) return stripTrailingSlash(override);
529
+ return `https://${slug}.greatstore.ai`;
530
+ }
531
+ function dashboardBase(env = process.env) {
532
+ const override = env.GS_DASHBOARD_BASE?.trim();
533
+ if (override) return stripTrailingSlash(override);
534
+ return DASHBOARD_BASE_DEFAULT;
535
+ }
536
+ function adminApiBase(slug, env = process.env) {
537
+ return `${dashboardBase(env)}/${slug}/admin`;
538
+ }
539
+ function stripTrailingSlash(s) {
540
+ return s.endsWith("/") ? s.slice(0, -1) : s;
541
+ }
542
+
575
543
  // src/commands/login.ts
576
544
  async function loginCommand(args) {
577
545
  const requestedStore = flagString(args.flags, "store")?.trim();
@@ -3001,7 +2969,7 @@ function recentChangelog(text, minItems = 15) {
3001
2969
  }
3002
2970
 
3003
2971
  // src/index.ts
3004
- var CHANGELOG = true ? "# Changelog\n\nAll notable changes to `@greatstore/cli` are recorded here. The format\nfollows [Keep a Changelog](https://keepachangelog.com/).\n\n## 0.1.7 \u2014 2026-09-12\n\n### Changed\n- Commands no longer check for a new release before running, so they start\n without waiting on the network. Running a supported version is still\n required: the server says so when it isn't, and this release is the minimum\n it accepts \u2014 earlier ones stop working. Run\n `npm install -g @greatstore/cli@latest` to upgrade.\n\n## 0.1.6 \u2014 2026-09-12\n\n### Fixed\n- `gs apps push <name>` skips a component nothing changed in, like a push with\n no arguments does. Naming a component used to upload it regardless, burning\n a version number on identical code. Pass `--force` to upload anyway.\n\n## 0.1.5 \u2014 2026-09-12\n\n### Fixed\n- `gs apps push` says when a component's source changed but its bundle did\n not \u2014 \"did you forget to build?\" \u2014 instead of reporting a successful push\n of code that was never built.\n- A rebuilt bundle is now pushed even when the source is untouched. Such a\n change was reported as \"unchanged\" and never uploaded.\n\n## 0.1.4 \u2014 2026-09-12\n\n### Added\n- Edit one theme field at a time: `gs configure set --theme.fontFamily Manrope\n --theme.radius sharp`. Theme writes merge into the stored theme, so a\n one-field change no longer means retyping the whole object (and no longer\n drops the keys you left out). `--replace` writes a theme outright.\n- `gs configure set --help` prints every field it accepts with its type and\n legal values, and a mistyped field name or value is now rejected with the\n valid list before anything is sent.\n\n### Changed\n- Rejected configuration writes say what was wrong with them \u2014 the field and\n the values it accepts \u2014 instead of \"Request rejected.\"\n- Commands no longer wait on a version check every run, which takes about half\n a second off each one.\n\n## 0.1.3 \u2014 2026-09-12\n\n### Changed\n- `gs skill` prints the steps for installing the GreatStore agent skill\n instead of installing it itself, so any AI coding agent can set it up in\n whichever skills directory it uses \u2014 no `--global` or `--dir` to pick.\n- The installed skill is a link to the copy that ships with the CLI, so\n upgrading `@greatstore/cli` keeps it current with nothing to re-run.\n\n## 0.1.2 \u2014 2026-09-04\n\n### Fixed\n- `gs apps pull` now downloads components that aren't published yet. Pulling\n one used to report that it wasn't found on the server.\n\n## 0.1.1 \u2014 2026-08-20\n\n### Changed\n- Signing in now asks you to authorize the store you picked before the CLI\n gets access to it, and that access can be ended anytime from **Team \u2192 CLI\n access** in the dashboard. Ending it there signs this computer out on its\n next command.\n- For each store, you're signed in on one computer at a time. Signing in to\n that store again from another machine replaces the previous one, which then\n has to sign in again; your other stores are unaffected.\n- This release is required: earlier versions no longer work. Run\n `npm install -g @greatstore/cli` to upgrade.\n\n## 0.1.0 \u2014 2026-08-19\n\n### Changed\n- When a component's `inputSchema` declares fields the component doesn't\n accept, validation now reports them on a single line \u2014 naming the fields\n (capped, with a `(+N more)` count past that) \u2014 instead of one error per\n field. A schema/component mismatch stays readable instead of burying the\n other diagnostics.\n\n## 0.0.48 \u2014 2026-08-19\n\n### Changed\n- Component validation now warns when a component reaches for the page-level\n `window.GreatStore` API. Components should interact with GreatStore through\n the lifecycle props passed into them (`onSendMessage`, `onCallTool`,\n `onGenerateStructuredContent`, \u2026), which are wired to the surface the\n component is mounted in; the warning points you there. It's a nudge, not a\n build failure.\n\n## 0.0.47 \u2014 2026-08-18\n\n### Changed\n- `onGenerateStructuredContent` now takes a required third argument,\n `fallback` \u2014 a schema-shaped object you supply. The component preview\n renders it (there's no live store to generate against there), so a\n generation-driven component previews as it would live. It's validated\n against the schema and throws if the two don't line up.\n\n## 0.0.46 \u2014 2026-08-18\n\n### Added\n- Components now receive an `onGenerateStructuredContent(schema, prompt)`\n prop: ask the store's assistant for content matching a JSON Schema (or a\n Zod schema) and render what it returns, personalized to the shopper. It\n works the same in the conversation on the storefront and every embed.\n Added to the component template, the scaffolded `AGENTS.md` reference, and\n prop validation.\n\n## 0.0.45 \u2014 2026-08-18\n\n### Changed\n- The auto-generated `AGENTS.md` banner now records the CLI version that\n wrote it, so you can tell at a glance when it trails your installed CLI\n and a `gs apps init` refresh is due.\n\n## 0.0.44 \u2014 2026-08-18\n\n### Added\n- New check: a component that still declares `onError` gets a warning\n pointing at the async-component pattern that replaced it, with the\n throw-vs-fallback caveat (a throw asks the assistant to retry, so\n permanent failures should render a fallback rather than throw). Earlier\n this surfaced as the generic \"prop isn't declared in the schema\"\n warning, whose suggested fix was wrong for a former lifecycle callback.\n\n### Changed\n- `gs apps init` now always refreshes `AGENTS.md` (the agent guidance\n file) so it tracks the installed CLI version instead of going stale.\n The file carries a \"do not edit \u2014 auto-generated\" banner; your own\n project files are still left untouched.\n\n## 0.0.43 \u2014 2026-08-18\n\n### Added\n- `gs apps build` and `gs apps push` now check each component before\n building or uploading it. Findings are reported as **errors** (a\n blocker \u2014 the component isn't built or uploaded) or **warnings** (it\n builds and is ready to publish, but something is worth improving),\n and a single run reports everything it found rather than stopping at\n the first problem.\n- New check: a component's props and its `inputSchema.properties` must\n agree. A schema field the component doesn't accept is an error; a prop\n the schema doesn't declare is a warning, since nothing will ever pass\n it. The props GreatStore injects (`onSendMessage`, `onCallTool`,\n `onUpdateModelContext`, `onShowLightbox`, `onClose`, `storeData`,\n `Image`) are exempt.\n\n## 0.0.42 \u2014 2026-08-15\n\n### Changed\n- `gs apps list` now works outside a project. With no `.gsrc` it lists the\n components of the store you're signed in to, instead of erroring. The\n commands that write files or change the store \u2014 `push`, `pull`, `publish`,\n `unpublish`, `delete` \u2014 still require a project.\n\n## 0.0.41 \u2014 2026-08-14\n\n### Changed\n- Internal authentication rework. Re-run `gs login` after updating.\n\n## 0.0.40 \u2014 2026-07-24\n\n### Removed\n- `gs configure set` no longer accepts `--salesGuide` or\n `--salesGuideFile`, and `gs configure show` no longer lists the field.\n\n## 0.0.39 \u2014 2026-07-21\n\n### Added\n- Components now receive an `Image` prop \u2014 a drop-in for `<img>` that\n serves images at the size they're displayed. Render `<Image src=\u2026 />`\n instead of `<img>`; pass `Image={\"img\"}` to preview a component\n outside a store. Scaffolded into `gs apps init` and documented in\n `AGENTS.md`.\n\n## 0.0.38 \u2014 2026-07-13\n\n### Added\n- `gs login --store <slug>` skips the store picker and signs in\n directly to that store \u2014 fails immediately if your account doesn't\n have access to it, instead of falling back to the picker.\n\n## 0.0.37 \u2014 2026-07-10\n\n### Added\n- Signing in now ends by choosing which store to work on \u2014 skipped\n automatically when your account has exactly one. Commands default to\n that store, so `--store` is rarely needed anymore.\n- `gs switch [<slug>]` changes the working store without signing in\n again.\n- `gs apps init` no longer requires `--store` when your sign-in already\n selected a store.\n\n### Changed\n- A `--store` flag or project `.gsrc` that names a different store than\n the one you signed in to is now an error, so work can't accidentally\n target the wrong store. Run `gs switch` to change stores.\n\n## 0.0.33 \u2014 2026-07-10\n\n### Changed\n- `gs apps push` now rejects a component whose `inputSchema` is too\n complex for the assistant to call reliably: union keywords\n (`anyOf`/`oneOf`/`allOf`/`$ref`/`not`), more than 8 KB serialized, or\n more than 50 declared fields. Keep schemas to a small set of flat,\n single-type fields \u2014 one canonical name per concept \u2014 and handle\n aliases or edge cases in component code instead.\n\n## 0.0.32 \u2014 2026-06-18\n\n### Added\n- Chat components can expand an image into a full-screen, on-brand\n lightbox via a new `onShowLightbox({ src, originRect })` prop. Wire it\n to an image's `onClick` \u2014 pass the image URL and, for a smooth zoom,\n the clicked element's `getBoundingClientRect()`. Use it for product\n photos, swatches, or size charts the shopper may want to inspect up\n close, instead of building your own overlay.\n\n## 0.0.31 \u2014 2026-06-18\n\n### Added\n- Components can read a secondary brand font from `--font-secondary`,\n for a second layer of typography. Falls back to the primary font.\n\n### Changed\n- The brand font variable is now `--font-primary` (was `--font-sans`).\n\n## 0.0.30 \u2014 2026-06-17\n\n### Added\n- The agent skill documents a new way to give the assistant background\n context without sending a visible message:\n `window.GreatStore.updateModelContext(text)` on the page, and the\n matching `onUpdateModelContext(text)` prop inside a chat component. Use\n it to keep the assistant aware of what the shopper is doing \u2014 the\n product they're viewing, what's in their cart, the variant they just\n selected \u2014 so its replies stay on point. Each call replaces the previous\n value, and nothing renders in the chat.\n\n## 0.0.29 \u2014 2026-06-12\n\n### Fixed\n- The \"update available\" notice actually fires now. It previously raced\n a 1-second timeout against the npm registry and usually lost, so most\n installs never saw it. The notice is now served instantly from a local\n cache, refreshed in the background after each day's first invocation \u2014\n it can lag one run behind a release, but it no longer adds latency or\n goes silent on slow networks.\n\n## 0.0.28 \u2014 2026-06-12\n\n### Added\n- `gs configure` \u2014 view and edit the store configuration from the CLI:\n display name, assistant name, sales guide, store link, extra origins,\n theme, CSP host lists, and icon/logo uploads. Same fields and\n behaviour as the dashboard's Configure panel.\n- `gs connectors` \u2014 manage the store's MCP connectors: list, add (with\n a discovery probe before saving), remove, enable/disable, toggle the\n Maker MCP, and health-check. Same behaviour as the dashboard's\n Connectors panel.\n- `--store <slug>` on the new admin commands, so they work outside a\n scaffolded component project (a `.gsrc` is still used when present).\n- The agent skill gains a store-administration reference: coding agents\n can read the store's configuration and connectors to ground their\n work, self-serve additive changes like origin allowlists and CSP\n hosts (read-merge-write), and are told which changes need the\n merchant's go-ahead first.\n\n### Changed\n- Component commands now live under `gs apps` (`gs apps push`,\n `gs apps build`, \u2026), matching the dashboard's Apps panel. The old\n top-level forms keep working as aliases, so existing scripts and\n scaffolded projects are unaffected.\n- The skill's structured-content guide now teaches \"point, don't\n paste\": name the SKU/product/collection and let GreatStore research\n the catalog itself instead of inlining fetched specs; validate with\n `gs connectors` that a connector exists for the data a prompt or\n schema depends on (research can't exceed the wired-up connectors);\n and never put shopper data in prompts \u2014 GreatStore already knows the\n shopper, and identified shoppers get per-shopper cached responses.\n\n## 0.0.27 \u2014 2026-06-11\n\n### Changed\n- Skill code samples now carry an explicit reference-only disclaimer:\n coding agents are told to re-express the logic in the host repo's\n framework (React, Vue, Shopify Liquid, Svelte, \u2026) instead of\n retrofitting the framework-free samples as-is.\n\n## 0.0.26 \u2014 2026-06-11\n\n### Added\n- The agent skill gains a \"GreatStore launchers\" recipe: a horizontally\n scrollable row of AI-generated chips, each an engaging first-person\n question about the current page that's sent to the assistant on tap.\n\n### Changed\n- Skill recipes are now one file each under `recipes/`, indexed from\n SKILL.md by a table with description and use-case columns.\n\n## 0.0.25 \u2014 2026-06-11\n\n### Added\n- `gs skill` installs the GreatStore agent skill \u2014 a guide AI coding\n agents use to build with GreatStore: AI content for your own UI, chat\n entry points, page tools, custom in-chat components, push\n notifications, and the store's MCP endpoints. Installs into\n `./.claude/skills/`; use `--global` for `~/.claude/skills/`, or\n `--dir <path>` for agents that read skills from somewhere else. Run\n it again any time to update an installed copy.\n\n## 0.0.24 \u2014 2026-06-03\n\n### Changed\n- `gs init` in an existing project now fills in any scaffold files that\n are missing (for example, the `AGENTS.md` design guide added in\n 0.0.23) and leaves your own files alone. Pass `--force` to refresh\n every scaffold file to the latest version. Your pinned store\n (`.gsrc`) is never rewritten either way.\n\n## 0.0.23 \u2014 2026-06-03\n\n### Added\n- `gs init` now scaffolds an `AGENTS.md` (with `CLAUDE.md` and\n `GEMINI.md` symlinked to it) documenting the design rules every\n component should follow \u2014 use `em` rather than `rem` for sizing, and\n style from the provided brand CSS variables so components match the\n store's theme. It doubles as guidance for AI coding agents.\n\n## 0.0.22 \u2014 2026-06-02\n\n### Added\n- `gs list` now shows a link to each component's page in the dashboard,\n so you can jump straight to a component to preview or publish it. The\n link is also included in `gs list --json`.\n\n## 0.0.21 \u2014 2026-05-31\n\n### Changed\n- The `gs init` component scaffold now shows how to write **async**\n components that load data before they render \u2014 including validating\n inputs up front and signalling a failure by throwing. The scaffolded\n component no longer includes an `onError` prop; throw from an async\n component to report a failure instead.\n\n## 0.0.20 \u2014 2026-05-29\n\n### Added\n- `gs pull`, `gs push`, and `gs publish` now accept several component\n names at once (e.g. `gs publish header footer cart`). Each component\n is reported on its own line and one failure no longer stops the rest.\n\n## 0.0.19 \u2014 2026-05-28\n\n### Fixed\n- `gs login` on Windows no longer opens a sign-in URL with parameters\n stripped, which surfaced as a \"Missing redirect_uri or state\n parameter\" page in the browser.\n\n## 0.0.18 \u2014 2026-05-28\n\n### Changed\n- Push and publish errors now name the specific reason \u2014 including\n every failing field in `manifest.json` \u2014 instead of the previous\n generic message.\n\n## 0.0.17 \u2014 2026-05-28\n\n### Added\n- Each command now prints a one-line upgrade notice when a newer\n `@greatstore/cli` is available on npm.\n\n## 0.0.16 \u2014 2026-05-28\n\n### Changed\n- Simplified error messages.\n\n## 0.0.15 \u2014 2026-05-24\n\n### Added\n- Scaffolded `component.tsx` now declares the four injected lifecycle\n props (`onSendMessage`, `onCallTool`, `onClose`, `onError`) on\n `Props`. Use `onError(message)` to report expected failures (failed\n fetch, host action rejected, invalid host state) so the AI can\n recover on its next turn. Render-time crashes are reported for you.\n\n## 0.0.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified \u2014 typically ~50% smaller.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` prints the next-step hint (`gs push`, then `gs publish`).\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failing to load Vite in some setups.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects. `gs init` (no args) scaffolds the project\n root; `gs init <name>` adds a component under `components/<name>/`.\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js`.\n- `gs push` (no args) uploads only the components that changed.\n- `gs pull` (no args, or `*`) downloads every component. Locally\n edited components are skipped; pass `--force` to overwrite.\n- Public `CHANGELOG.md`; `gs --version` prints recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts\n `--store`; every other command reads the slug from `.gsrc`. The old\n single-component layout is rejected with a migration hint.\n- `gs init` requires `--store <slug>` for a fresh root, and rejects\n `--store` on an existing root.\n- `gs init` no longer writes `build.mjs` \u2014 scripts call `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The sign-in browser tab auto-closes once `gs login` finishes.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- Scaffolded manifests include a `displayName` so the admin UI has a\n friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a link to view the component.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads from the published package version.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles out of the box.\n\n## 0.0.3 \u2014 2026-05-23\n\n### Changed\n- Trimmed public README to the essentials.\n\n## 0.0.2 \u2014 2026-05-23\n\n### Fixed\n- Sign-in callback parameter handling.\n" : "";
2972
+ var CHANGELOG = true ? "# Changelog\n\nAll notable changes to `@greatstore/cli` are recorded here. The format\nfollows [Keep a Changelog](https://keepachangelog.com/).\n\n## 0.1.8 \u2014 2026-09-12\n\n### Changed\n- When your session has expired, commands now say so and stop, instead of\n opening a browser to sign you back in. Run `gs login` when you're ready.\n\n## 0.1.7 \u2014 2026-09-12\n\n### Changed\n- Commands no longer check for a new release before running, so they start\n without waiting on the network. Running a supported version is still\n required: the server says so when it isn't, and this release is the minimum\n it accepts \u2014 earlier ones stop working. Run\n `npm install -g @greatstore/cli@latest` to upgrade.\n\n## 0.1.6 \u2014 2026-09-12\n\n### Fixed\n- `gs apps push <name>` skips a component nothing changed in, like a push with\n no arguments does. Naming a component used to upload it regardless, burning\n a version number on identical code. Pass `--force` to upload anyway.\n\n## 0.1.5 \u2014 2026-09-12\n\n### Fixed\n- `gs apps push` says when a component's source changed but its bundle did\n not \u2014 \"did you forget to build?\" \u2014 instead of reporting a successful push\n of code that was never built.\n- A rebuilt bundle is now pushed even when the source is untouched. Such a\n change was reported as \"unchanged\" and never uploaded.\n\n## 0.1.4 \u2014 2026-09-12\n\n### Added\n- Edit one theme field at a time: `gs configure set --theme.fontFamily Manrope\n --theme.radius sharp`. Theme writes merge into the stored theme, so a\n one-field change no longer means retyping the whole object (and no longer\n drops the keys you left out). `--replace` writes a theme outright.\n- `gs configure set --help` prints every field it accepts with its type and\n legal values, and a mistyped field name or value is now rejected with the\n valid list before anything is sent.\n\n### Changed\n- Rejected configuration writes say what was wrong with them \u2014 the field and\n the values it accepts \u2014 instead of \"Request rejected.\"\n- Commands no longer wait on a version check every run, which takes about half\n a second off each one.\n\n## 0.1.3 \u2014 2026-09-12\n\n### Changed\n- `gs skill` prints the steps for installing the GreatStore agent skill\n instead of installing it itself, so any AI coding agent can set it up in\n whichever skills directory it uses \u2014 no `--global` or `--dir` to pick.\n- The installed skill is a link to the copy that ships with the CLI, so\n upgrading `@greatstore/cli` keeps it current with nothing to re-run.\n\n## 0.1.2 \u2014 2026-09-04\n\n### Fixed\n- `gs apps pull` now downloads components that aren't published yet. Pulling\n one used to report that it wasn't found on the server.\n\n## 0.1.1 \u2014 2026-08-20\n\n### Changed\n- Signing in now asks you to authorize the store you picked before the CLI\n gets access to it, and that access can be ended anytime from **Team \u2192 CLI\n access** in the dashboard. Ending it there signs this computer out on its\n next command.\n- For each store, you're signed in on one computer at a time. Signing in to\n that store again from another machine replaces the previous one, which then\n has to sign in again; your other stores are unaffected.\n- This release is required: earlier versions no longer work. Run\n `npm install -g @greatstore/cli` to upgrade.\n\n## 0.1.0 \u2014 2026-08-19\n\n### Changed\n- When a component's `inputSchema` declares fields the component doesn't\n accept, validation now reports them on a single line \u2014 naming the fields\n (capped, with a `(+N more)` count past that) \u2014 instead of one error per\n field. A schema/component mismatch stays readable instead of burying the\n other diagnostics.\n\n## 0.0.48 \u2014 2026-08-19\n\n### Changed\n- Component validation now warns when a component reaches for the page-level\n `window.GreatStore` API. Components should interact with GreatStore through\n the lifecycle props passed into them (`onSendMessage`, `onCallTool`,\n `onGenerateStructuredContent`, \u2026), which are wired to the surface the\n component is mounted in; the warning points you there. It's a nudge, not a\n build failure.\n\n## 0.0.47 \u2014 2026-08-18\n\n### Changed\n- `onGenerateStructuredContent` now takes a required third argument,\n `fallback` \u2014 a schema-shaped object you supply. The component preview\n renders it (there's no live store to generate against there), so a\n generation-driven component previews as it would live. It's validated\n against the schema and throws if the two don't line up.\n\n## 0.0.46 \u2014 2026-08-18\n\n### Added\n- Components now receive an `onGenerateStructuredContent(schema, prompt)`\n prop: ask the store's assistant for content matching a JSON Schema (or a\n Zod schema) and render what it returns, personalized to the shopper. It\n works the same in the conversation on the storefront and every embed.\n Added to the component template, the scaffolded `AGENTS.md` reference, and\n prop validation.\n\n## 0.0.45 \u2014 2026-08-18\n\n### Changed\n- The auto-generated `AGENTS.md` banner now records the CLI version that\n wrote it, so you can tell at a glance when it trails your installed CLI\n and a `gs apps init` refresh is due.\n\n## 0.0.44 \u2014 2026-08-18\n\n### Added\n- New check: a component that still declares `onError` gets a warning\n pointing at the async-component pattern that replaced it, with the\n throw-vs-fallback caveat (a throw asks the assistant to retry, so\n permanent failures should render a fallback rather than throw). Earlier\n this surfaced as the generic \"prop isn't declared in the schema\"\n warning, whose suggested fix was wrong for a former lifecycle callback.\n\n### Changed\n- `gs apps init` now always refreshes `AGENTS.md` (the agent guidance\n file) so it tracks the installed CLI version instead of going stale.\n The file carries a \"do not edit \u2014 auto-generated\" banner; your own\n project files are still left untouched.\n\n## 0.0.43 \u2014 2026-08-18\n\n### Added\n- `gs apps build` and `gs apps push` now check each component before\n building or uploading it. Findings are reported as **errors** (a\n blocker \u2014 the component isn't built or uploaded) or **warnings** (it\n builds and is ready to publish, but something is worth improving),\n and a single run reports everything it found rather than stopping at\n the first problem.\n- New check: a component's props and its `inputSchema.properties` must\n agree. A schema field the component doesn't accept is an error; a prop\n the schema doesn't declare is a warning, since nothing will ever pass\n it. The props GreatStore injects (`onSendMessage`, `onCallTool`,\n `onUpdateModelContext`, `onShowLightbox`, `onClose`, `storeData`,\n `Image`) are exempt.\n\n## 0.0.42 \u2014 2026-08-15\n\n### Changed\n- `gs apps list` now works outside a project. With no `.gsrc` it lists the\n components of the store you're signed in to, instead of erroring. The\n commands that write files or change the store \u2014 `push`, `pull`, `publish`,\n `unpublish`, `delete` \u2014 still require a project.\n\n## 0.0.41 \u2014 2026-08-14\n\n### Changed\n- Internal authentication rework. Re-run `gs login` after updating.\n\n## 0.0.40 \u2014 2026-07-24\n\n### Removed\n- `gs configure set` no longer accepts `--salesGuide` or\n `--salesGuideFile`, and `gs configure show` no longer lists the field.\n\n## 0.0.39 \u2014 2026-07-21\n\n### Added\n- Components now receive an `Image` prop \u2014 a drop-in for `<img>` that\n serves images at the size they're displayed. Render `<Image src=\u2026 />`\n instead of `<img>`; pass `Image={\"img\"}` to preview a component\n outside a store. Scaffolded into `gs apps init` and documented in\n `AGENTS.md`.\n\n## 0.0.38 \u2014 2026-07-13\n\n### Added\n- `gs login --store <slug>` skips the store picker and signs in\n directly to that store \u2014 fails immediately if your account doesn't\n have access to it, instead of falling back to the picker.\n\n## 0.0.37 \u2014 2026-07-10\n\n### Added\n- Signing in now ends by choosing which store to work on \u2014 skipped\n automatically when your account has exactly one. Commands default to\n that store, so `--store` is rarely needed anymore.\n- `gs switch [<slug>]` changes the working store without signing in\n again.\n- `gs apps init` no longer requires `--store` when your sign-in already\n selected a store.\n\n### Changed\n- A `--store` flag or project `.gsrc` that names a different store than\n the one you signed in to is now an error, so work can't accidentally\n target the wrong store. Run `gs switch` to change stores.\n\n## 0.0.33 \u2014 2026-07-10\n\n### Changed\n- `gs apps push` now rejects a component whose `inputSchema` is too\n complex for the assistant to call reliably: union keywords\n (`anyOf`/`oneOf`/`allOf`/`$ref`/`not`), more than 8 KB serialized, or\n more than 50 declared fields. Keep schemas to a small set of flat,\n single-type fields \u2014 one canonical name per concept \u2014 and handle\n aliases or edge cases in component code instead.\n\n## 0.0.32 \u2014 2026-06-18\n\n### Added\n- Chat components can expand an image into a full-screen, on-brand\n lightbox via a new `onShowLightbox({ src, originRect })` prop. Wire it\n to an image's `onClick` \u2014 pass the image URL and, for a smooth zoom,\n the clicked element's `getBoundingClientRect()`. Use it for product\n photos, swatches, or size charts the shopper may want to inspect up\n close, instead of building your own overlay.\n\n## 0.0.31 \u2014 2026-06-18\n\n### Added\n- Components can read a secondary brand font from `--font-secondary`,\n for a second layer of typography. Falls back to the primary font.\n\n### Changed\n- The brand font variable is now `--font-primary` (was `--font-sans`).\n\n## 0.0.30 \u2014 2026-06-17\n\n### Added\n- The agent skill documents a new way to give the assistant background\n context without sending a visible message:\n `window.GreatStore.updateModelContext(text)` on the page, and the\n matching `onUpdateModelContext(text)` prop inside a chat component. Use\n it to keep the assistant aware of what the shopper is doing \u2014 the\n product they're viewing, what's in their cart, the variant they just\n selected \u2014 so its replies stay on point. Each call replaces the previous\n value, and nothing renders in the chat.\n\n## 0.0.29 \u2014 2026-06-12\n\n### Fixed\n- The \"update available\" notice actually fires now. It previously raced\n a 1-second timeout against the npm registry and usually lost, so most\n installs never saw it. The notice is now served instantly from a local\n cache, refreshed in the background after each day's first invocation \u2014\n it can lag one run behind a release, but it no longer adds latency or\n goes silent on slow networks.\n\n## 0.0.28 \u2014 2026-06-12\n\n### Added\n- `gs configure` \u2014 view and edit the store configuration from the CLI:\n display name, assistant name, sales guide, store link, extra origins,\n theme, CSP host lists, and icon/logo uploads. Same fields and\n behaviour as the dashboard's Configure panel.\n- `gs connectors` \u2014 manage the store's MCP connectors: list, add (with\n a discovery probe before saving), remove, enable/disable, toggle the\n Maker MCP, and health-check. Same behaviour as the dashboard's\n Connectors panel.\n- `--store <slug>` on the new admin commands, so they work outside a\n scaffolded component project (a `.gsrc` is still used when present).\n- The agent skill gains a store-administration reference: coding agents\n can read the store's configuration and connectors to ground their\n work, self-serve additive changes like origin allowlists and CSP\n hosts (read-merge-write), and are told which changes need the\n merchant's go-ahead first.\n\n### Changed\n- Component commands now live under `gs apps` (`gs apps push`,\n `gs apps build`, \u2026), matching the dashboard's Apps panel. The old\n top-level forms keep working as aliases, so existing scripts and\n scaffolded projects are unaffected.\n- The skill's structured-content guide now teaches \"point, don't\n paste\": name the SKU/product/collection and let GreatStore research\n the catalog itself instead of inlining fetched specs; validate with\n `gs connectors` that a connector exists for the data a prompt or\n schema depends on (research can't exceed the wired-up connectors);\n and never put shopper data in prompts \u2014 GreatStore already knows the\n shopper, and identified shoppers get per-shopper cached responses.\n\n## 0.0.27 \u2014 2026-06-11\n\n### Changed\n- Skill code samples now carry an explicit reference-only disclaimer:\n coding agents are told to re-express the logic in the host repo's\n framework (React, Vue, Shopify Liquid, Svelte, \u2026) instead of\n retrofitting the framework-free samples as-is.\n\n## 0.0.26 \u2014 2026-06-11\n\n### Added\n- The agent skill gains a \"GreatStore launchers\" recipe: a horizontally\n scrollable row of AI-generated chips, each an engaging first-person\n question about the current page that's sent to the assistant on tap.\n\n### Changed\n- Skill recipes are now one file each under `recipes/`, indexed from\n SKILL.md by a table with description and use-case columns.\n\n## 0.0.25 \u2014 2026-06-11\n\n### Added\n- `gs skill` installs the GreatStore agent skill \u2014 a guide AI coding\n agents use to build with GreatStore: AI content for your own UI, chat\n entry points, page tools, custom in-chat components, push\n notifications, and the store's MCP endpoints. Installs into\n `./.claude/skills/`; use `--global` for `~/.claude/skills/`, or\n `--dir <path>` for agents that read skills from somewhere else. Run\n it again any time to update an installed copy.\n\n## 0.0.24 \u2014 2026-06-03\n\n### Changed\n- `gs init` in an existing project now fills in any scaffold files that\n are missing (for example, the `AGENTS.md` design guide added in\n 0.0.23) and leaves your own files alone. Pass `--force` to refresh\n every scaffold file to the latest version. Your pinned store\n (`.gsrc`) is never rewritten either way.\n\n## 0.0.23 \u2014 2026-06-03\n\n### Added\n- `gs init` now scaffolds an `AGENTS.md` (with `CLAUDE.md` and\n `GEMINI.md` symlinked to it) documenting the design rules every\n component should follow \u2014 use `em` rather than `rem` for sizing, and\n style from the provided brand CSS variables so components match the\n store's theme. It doubles as guidance for AI coding agents.\n\n## 0.0.22 \u2014 2026-06-02\n\n### Added\n- `gs list` now shows a link to each component's page in the dashboard,\n so you can jump straight to a component to preview or publish it. The\n link is also included in `gs list --json`.\n\n## 0.0.21 \u2014 2026-05-31\n\n### Changed\n- The `gs init` component scaffold now shows how to write **async**\n components that load data before they render \u2014 including validating\n inputs up front and signalling a failure by throwing. The scaffolded\n component no longer includes an `onError` prop; throw from an async\n component to report a failure instead.\n\n## 0.0.20 \u2014 2026-05-29\n\n### Added\n- `gs pull`, `gs push`, and `gs publish` now accept several component\n names at once (e.g. `gs publish header footer cart`). Each component\n is reported on its own line and one failure no longer stops the rest.\n\n## 0.0.19 \u2014 2026-05-28\n\n### Fixed\n- `gs login` on Windows no longer opens a sign-in URL with parameters\n stripped, which surfaced as a \"Missing redirect_uri or state\n parameter\" page in the browser.\n\n## 0.0.18 \u2014 2026-05-28\n\n### Changed\n- Push and publish errors now name the specific reason \u2014 including\n every failing field in `manifest.json` \u2014 instead of the previous\n generic message.\n\n## 0.0.17 \u2014 2026-05-28\n\n### Added\n- Each command now prints a one-line upgrade notice when a newer\n `@greatstore/cli` is available on npm.\n\n## 0.0.16 \u2014 2026-05-28\n\n### Changed\n- Simplified error messages.\n\n## 0.0.15 \u2014 2026-05-24\n\n### Added\n- Scaffolded `component.tsx` now declares the four injected lifecycle\n props (`onSendMessage`, `onCallTool`, `onClose`, `onError`) on\n `Props`. Use `onError(message)` to report expected failures (failed\n fetch, host action rejected, invalid host state) so the AI can\n recover on its next turn. Render-time crashes are reported for you.\n\n## 0.0.14 \u2014 2026-05-24\n\n### Changed\n- `gs build` output is now whitespace-minified \u2014 typically ~50% smaller.\n\n## 0.0.13 \u2014 2026-05-24\n\n### Changed\n- `gs build` prints the next-step hint (`gs push`, then `gs publish`).\n\n## 0.0.12 \u2014 2026-05-24\n\n### Fixed\n- `gs build` failing to load Vite in some setups.\n\n## 0.0.11 \u2014 2026-05-24\n\n### Added\n- Multi-component projects. `gs init` (no args) scaffolds the project\n root; `gs init <name>` adds a component under `components/<name>/`.\n- `gs build [<name>]` \u2014 compiles every `components/<name>/bundle.js`.\n- `gs push` (no args) uploads only the components that changed.\n- `gs pull` (no args, or `*`) downloads every component. Locally\n edited components are skipped; pass `--force` to overwrite.\n- Public `CHANGELOG.md`; `gs --version` prints recent entries.\n\n### Changed\n- A project folder ships to exactly one store. Only `gs init` accepts\n `--store`; every other command reads the slug from `.gsrc`. The old\n single-component layout is rejected with a migration hint.\n- `gs init` requires `--store <slug>` for a fresh root, and rejects\n `--store` on an existing root.\n- `gs init` no longer writes `build.mjs` \u2014 scripts call `gs build`.\n\n## 0.0.10 \u2014 2026-05-23\n\n### Changed\n- The sign-in browser tab auto-closes once `gs login` finishes.\n\n## 0.0.9 \u2014 2026-05-23\n\n### Changed\n- Scaffolded manifests include a `displayName` so the admin UI has a\n friendlier label.\n\n## 0.0.8 \u2014 2026-05-23\n\n### Changed\n- `gs push` and `gs publish` print a link to view the component.\n\n## 0.0.6 \u2014 2026-05-23\n\n### Changed\n- `gs --version` reads from the published package version.\n\n## 0.0.4 \u2014 2026-05-23\n\n### Changed\n- Scaffolded projects produce browser-ready bundles out of the box.\n\n## 0.0.3 \u2014 2026-05-23\n\n### Changed\n- Trimmed public README to the essentials.\n\n## 0.0.2 \u2014 2026-05-23\n\n### Fixed\n- Sign-in callback parameter handling.\n" : "";
3005
2973
  var HELP = `gs \u2014 GreatStore CLI (v${CLI_VERSION})
3006
2974
 
3007
2975
  Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatstore/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "CLI for administering GreatStore stores and authoring custom components.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",