@genex-ai/cli-demo 1.7.0-dev.449 → 1.7.1-dev.450

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/dist/index.js CHANGED
@@ -1881,6 +1881,21 @@ function isStale(local, remote) {
1881
1881
  if (!local || !remote) return false;
1882
1882
  return local !== remote;
1883
1883
  }
1884
+ function inHostedSession() {
1885
+ return process.env.GENEX_HOSTED_SESSION === "1";
1886
+ }
1887
+ function mayForceOverAnotherDevice() {
1888
+ return !inHostedSession();
1889
+ }
1890
+ function reportForceRefused(log) {
1891
+ log.error("`--force` is not available inside a Genex chat session.");
1892
+ log.dim(" It would replace work shipped from another machine, and that is not yours to discard here.");
1893
+ log.dim(` Do this instead \u2014 it keeps both sides:`);
1894
+ log.dim(` 1. ${c.cyan("npx genex pull --force")} takes the other machine's work (a copy of this folder is kept under .genex/replaced-*)`);
1895
+ log.dim(` 2. redo your change on top of it \u2014 you know what you just changed`);
1896
+ log.dim(` 3. ${c.cyan("npx genex preview")}`);
1897
+ log.dim(" If the user explicitly wants their chat version to win, ask them to run `npx genex preview --force` themselves.");
1898
+ }
1884
1899
  function reportStale(log, slug, local, remote) {
1885
1900
  log.error(`${c.cyan(slug)} was updated from another device \u2014 nothing was deployed.`);
1886
1901
  if (remote && local) {
@@ -4726,6 +4741,10 @@ function isSecretEnvFile(name) {
4726
4741
  async function deployGame(ctx, opts, log) {
4727
4742
  const cwd = process.cwd();
4728
4743
  const meta = await readProject(cwd);
4744
+ if (opts.force && !mayForceOverAnotherDevice()) {
4745
+ reportForceRefused(log);
4746
+ return false;
4747
+ }
4729
4748
  const expectStagingCommit = opts.force ? void 0 : meta?.stagingCommit;
4730
4749
  if (expectStagingCommit) {
4731
4750
  const remote = await readRemoteSource(ctx.apiUrl, ctx.token, ctx.projectId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "1.7.0-dev.449",
3
+ "version": "1.7.1-dev.450",
4
4
  "description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -200,6 +200,11 @@ Either way **say which version you are keeping before you run it** — both comm
200
200
  are irreversible for one side, and the user may know something you don't about what
201
201
  is on the other machine.
202
202
 
203
+ Inside a Genex chat session `preview --force` is **refused** — you cannot discard
204
+ what somebody shipped from their own machine, because you cannot see it. Pull, redo
205
+ your change, preview. If the user wants their chat version to win, they can run the
206
+ forced deploy from their terminal themselves.
207
+
203
208
  `link` never creates a project: it signs in if needed (the browser opens once)
204
209
  and rewrites the local link (source pushes authorize over HTTPS, so there's no
205
210
  key to set up — it works from any machine).