@mercury-fw/cli-engine 0.38.0 → 0.39.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @mercury-fw/cli-engine
2
2
 
3
+ ## 0.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 881835c: A CLI's login is set up inside the app's container, no longer carried in the env file.
8
+
9
+ - A plugin declares in `mercury.cliCredentials` the commands that set its CLI's login up (`setup`, required), check it (`check`) and log an identity out (`logout`), each a binary followed by its arguments.
10
+ - `mfw credentials setup <plugin>` runs the declared setup in a one-off container on your terminal, so the CLI writes its login straight onto the credentials volume; `mfw credentials check <plugin>` runs the declared check.
11
+ - `mfw credentials reset <plugin> [--user <key>]` runs the declared logout, of the identity Mercury runs as or of one person, instead of deleting the CLI's folder.
12
+ - `mfw credentials set` is removed, and the core no longer unpacks `*_CONFIG_TAR_B64` variables at startup: it reports a declared login that isn't set up yet, and still links a login kept outside `~/.config` to the volume.
13
+ - A command the model writes with `--user` is refused: which person a CLI acts as is never the model's to pick.
14
+ - `cliUserId` (`@mercury-fw/utils`) maps a user key to the id a CLI knows a person by.
15
+ - plugin-jira and plugin-bitbucket pin their CLIs at 2.1.0, which keep the service identity and each person apart and refuse the old login folder. After updating, remove the plugin's `*_CONFIG_TAR_B64` line from the env file and run `mfw credentials setup` once; on Jira, Mercury now runs as an Atlassian Service Account.
16
+ - plugin-atlassian-admin keeps its CLI at 0.1.2, whose `init` doesn't prompt for the organization key: until it does, write the key from `mfw shell` with `atlassian-admin init --api-key <KEY> --org-id <ORG_ID>` (the plugin's README says so).
17
+
18
+ ### Patch Changes
19
+
20
+ - @mercury-fw/plugin-types@0.39.0
21
+
22
+ ## 0.38.1
23
+
24
+ ### Patch Changes
25
+
26
+ - @mercury-fw/plugin-types@0.38.1
27
+
3
28
  ## 0.38.0
4
29
 
5
30
  ### Patch Changes
package/cli-tool.ts CHANGED
@@ -128,8 +128,8 @@ export function omitDisplayForModel(output: unknown): unknown {
128
128
  /**
129
129
  * Builds the `runCommand` tool: the model writes a whole CLI invocation as
130
130
  * one string, `execute` parses it (`parseCommand`), checks the binary
131
- * against `configs`, then classifies the argv via `matchCommand` — each
132
- * failure mode (unparseable / unknown binary / confirm-required /
131
+ * against `configs`, refuses an identity flag (`--user`), then classifies the argv via `matchCommand` — each
132
+ * failure mode (unparseable / identity flag / unknown binary / confirm-required /
133
133
  * not-allowed) gets a distinct, self-correctable error message — before
134
134
  * ever calling `runCliFn`. `runCliFn` is injected (defaulting to the real
135
135
  * `runCli` in production) so tests can supply a fake without spawning a
@@ -181,6 +181,16 @@ export function createCliTool(
181
181
  return { ok: false, error: `could not parse "${command}": ${parsed.error}` };
182
182
  }
183
183
 
184
+ // The CLIs act as whoever `--user <id>` names: which identity a command
185
+ // runs as is Mercury's decision, never something the model writes.
186
+ if (parsed.args.some((a) => a === "--user" || a.startsWith("--user="))) {
187
+ return {
188
+ ok: false,
189
+ error:
190
+ "--user is not allowed: Mercury decides whose account a command runs as, never the command itself. Run it again without --user.",
191
+ };
192
+ }
193
+
184
194
  const config = configs[parsed.binary];
185
195
  if (!config) {
186
196
  const known = Object.keys(configs).join(", ") || "(none configured)";
@@ -70,8 +70,8 @@ export declare function omitDisplayForModel(output: unknown): unknown;
70
70
  /**
71
71
  * Builds the `runCommand` tool: the model writes a whole CLI invocation as
72
72
  * one string, `execute` parses it (`parseCommand`), checks the binary
73
- * against `configs`, then classifies the argv via `matchCommand` — each
74
- * failure mode (unparseable / unknown binary / confirm-required /
73
+ * against `configs`, refuses an identity flag (`--user`), then classifies the argv via `matchCommand` — each
74
+ * failure mode (unparseable / identity flag / unknown binary / confirm-required /
75
75
  * not-allowed) gets a distinct, self-correctable error message — before
76
76
  * ever calling `runCliFn`. `runCliFn` is injected (defaulting to the real
77
77
  * `runCli` in production) so tests can supply a fake without spawning a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercury-fw/cli-engine",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,7 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@mercury-fw/plugin-types": "0.38.0",
26
+ "@mercury-fw/plugin-types": "0.39.0",
27
27
  "ai": "^7.0.126",
28
28
  "shell-quote": "^1.11.0",
29
29
  "zod": "^4.6.5"