mergestorm 0.3.54 → 0.3.55

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
@@ -45,12 +45,12 @@ On a TTY, bare `mergestorm` (or `mergestorm shell`) opens a branded REPL: a comp
45
45
 
46
46
  ```
47
47
  ╭──────────────────────────────────────────────────────────────────────────────╮
48
- │ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.54 │
48
+ │ ▀▀▀▀▀▀▀▀▀▀▘ mergestorm v0.3.55 │
49
49
  │ ▀▀▀▀▀▀▀▀▀ ● msk_live_… · maelstrom │
50
50
  │ ▀▀▀▀▀▀ [████████░░░░░░░░░░░░░░░░░░░░░░] 25% used │
51
51
  │ ▝▀▀▀▀▀ local reviews + stacked PRs · mergestorm.ai │
52
52
  │ ▝▀▀▘ review a diff · usage for tabs · /help for all commands │
53
- │ ▀ New in v0.3.54: Publish without gh: stack submit --server-side │
53
+ │ ▀ New in v0.3.55: MERGESTORM_HOME moves login and stack state │
54
54
  ╰──────────────────────────────────────────────────────────────────────────────╯
55
55
  mergestorm
56
56
  ╭──────────────────────────────────────────────────────────────────────────────╮
@@ -164,13 +164,14 @@ mg stack publish --status # absent | pushed | opened | registered
164
164
  - **Exact contents.** Every commit travels with its Git tree SHA and the whole content of each changed file, so binaries, deletions, renames, executable bits and symlinks arrive unchanged. Mergestorm moves the branch only when GitHub builds the same tree, and `mg` checks the returned tree against your local branch.
165
165
  - **Never overwrites surprises.** `mg` looks at the branch on GitHub first. If its files match one of your local commits, only the commits after that one are appended. If they match none (someone else pushed, or you rebased), `mg` stops with `head_changed`; `--replace-head <sha>` replaces exactly that head and nothing else. Mergestorm refuses `main`, `master`, the default branch, protected branches and its own `mg-stack-*`, `mg-park-*` and `mq-batch-*` branches.
166
166
  - **Safe to run again.** After a timeout or an error, run the same command again. It finds the branch, pull request and stack it already made and finishes the missing step; it does not create duplicates.
167
+ - **Read-only home directory.** `mg` keeps the saved login and the local stack state of `stack create` / `stack submit` under `~/.mergestorm`. Where the home directory cannot be written, set `MERGESTORM_HOME` to a writable directory (outside the repository) and every command uses that instead. `MERGESTORM_API_KEY` supplies the key without `mg login`.
167
168
  - **Limits.** 20 commits, 500 changed paths, 2 MiB a file and 8 MiB in total per publication. Submodules and merge commits are refused with the path or the reason. `stack submit --server-side` publishes the first two layers of a stack; a third layer needs a park freeze, which this mode does not create, so add it once the first two are registered.
168
169
 
169
170
  Legacy repo-local `.mergestorm/stack.json` state migrates automatically on the next stack command. If local authoring state is stale or malformed, use `mg stack reset --force`; this clears only pre-submit CLI state and never deletes branches, PRs, or registered stacks.
170
171
 
171
172
  ### `login`
172
173
 
173
- Runs a browser device-authorization flow: prints a short code, opens `https://mergestorm.ai/cli/auth`, and — once you approve — mints and stores an API key in `~/.mergestorm/config.json` (mode `600`). No key copy/paste needed.
174
+ Runs a browser device-authorization flow: prints a short code, opens `https://mergestorm.ai/cli/auth`, and — once you approve — mints and stores an API key in `~/.mergestorm/config.json` (mode `600`), or in `$MERGESTORM_HOME/config.json` when `MERGESTORM_HOME` is set. No key copy/paste needed.
174
175
 
175
176
  For headless or CI environments, use `mergestorm login --key` to paste an existing `msk_live_…` key (create one on the dashboard [Settings → API](https://mergestorm.ai/settings#api)). On a TTY the paste is hidden (not echoed); the CLI verifies the key with the API before saving.
176
177
 
@@ -178,7 +179,7 @@ For an agent, which cannot sit in a prompt while a person signs in, use two step
178
179
 
179
180
  ### `logout`
180
181
 
181
- Removes `~/.mergestorm/config.json` so the stored key is no longer used.
182
+ Removes `~/.mergestorm/config.json` (or `$MERGESTORM_HOME/config.json` when `MERGESTORM_HOME` is set) so the stored key is no longer used.
182
183
 
183
184
  ### `review [base] [head]`
184
185
 
@@ -229,6 +230,7 @@ Require a logged-in key and API support for `GET /api/v1/me` and `GET /api/v1/re
229
230
  |----------|---------|---------|
230
231
  | `MERGESTORM_API_KEY` | API key (overrides the stored config) | — |
231
232
  | `MERGESTORM_API_URL` | API base URL | `https://api.mergestorm.ai` |
233
+ | `MERGESTORM_HOME` | Directory for the saved login and local stack state, for machines whose home directory is read-only | `~/.mergestorm` |
232
234
  | `NO_COLOR` | Disable ANSI colors | — |
233
235
 
234
236
  ## Verify (public source vs npm)
@@ -331,6 +331,7 @@ export function formatUsageBody() {
331
331
  Env:
332
332
  MERGESTORM_API_KEY API key (overrides config)
333
333
  MERGESTORM_API_URL API base (default ${DEFAULT_API})
334
+ MERGESTORM_HOME State directory for login and stack state (default ~/.mergestorm)
334
335
  `;
335
336
  }
336
337
  /**
package/dist/config.d.ts CHANGED
@@ -3,7 +3,7 @@ export type Config = {
3
3
  apiKey?: string;
4
4
  apiBase?: string;
5
5
  };
6
- export declare function mergestormHome(): string;
6
+ export declare function mergestormHome(env?: NodeJS.ProcessEnv): string;
7
7
  export declare function configPath(): string;
8
8
  export declare function loadConfig(): Promise<Config>;
9
9
  export declare function saveConfig(cfg: Config): Promise<void>;
package/dist/config.js CHANGED
@@ -2,8 +2,9 @@ import { mkdir, readFile, writeFile, rm } from "node:fs/promises";
2
2
  import { homedir } from "node:os";
3
3
  import path from "node:path";
4
4
  export const DEFAULT_API = "https://api.mergestorm.ai";
5
- export function mergestormHome() {
6
- return path.join(homedir(), ".mergestorm");
5
+ export function mergestormHome(env = process.env) {
6
+ const override = env.MERGESTORM_HOME?.trim();
7
+ return override ? path.resolve(override) : path.join(homedir(), ".mergestorm");
7
8
  }
8
9
  export function configPath() {
9
10
  return path.join(mergestormHome(), "config.json");
package/dist/ui/banner.js CHANGED
@@ -200,6 +200,9 @@ const WHATS_NEW = {
200
200
  "0.3.54": [
201
201
  "Publish without gh: stack submit --server-side",
202
202
  ],
203
+ "0.3.55": [
204
+ "MERGESTORM_HOME moves login and stack state",
205
+ ],
203
206
  };
204
207
  function densityFromVariant(variant) {
205
208
  if (variant === "mini" || variant === "nano")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergestorm",
3
- "version": "0.3.54",
3
+ "version": "0.3.55",
4
4
  "description": "Mergestorm CLI (mg) — local reviews & stacked PRs. MIT; build from source: https://github.com/marginsystems/mergestorm-cli",
5
5
  "license": "MIT",
6
6
  "type": "module",