@mindbricks/genesis-set 0.1.0 → 0.2.1

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
@@ -3,6 +3,24 @@
3
3
  The package follows semantic versioning. Each release names the mind-set range it needs
4
4
  (`dependencies["@mindbricks/mind-set"]` in `package.json`).
5
5
 
6
+ ## 0.2.1 (pre-release)
7
+
8
+ - A stored key is shown as its type prefix and last four characters (`sk_mbx_...9f3a`,
9
+ `sk_test_...a1b2`) in `genesis config show`, `genesis doctor`, the install key step and the
10
+ key page, so the user can tell which key is set and whether it is a test or a live key. At
11
+ least eight characters always stay hidden; a shorter value is only shown as "set". The agent
12
+ tools still answer set or empty only.
13
+
14
+ ## 0.2.0 (pre-release)
15
+
16
+ Needs mind-set `^0.2.0`.
17
+
18
+ - The command is `genesis`, the same name as its MCP server; `genesis-set` still works as an
19
+ alias (and keeps `npx @mindbricks/genesis-set ...` working). Every message, skill and
20
+ guide names `genesis`. The data folder stays `~/.genesis-set`.
21
+ - The MCP server exits only after its answers are written out; before, an answer over 8 KiB
22
+ could be cut when the client closed stdin.
23
+
6
24
  ## 0.1.0 (pre-release)
7
25
 
8
26
  First version, published with the Genesis Compiler API open for dry-run builds.
package/README.md CHANGED
@@ -16,24 +16,25 @@ mind-set when it is missing. Node 18 or newer.
16
16
 
17
17
  ```bash
18
18
  npm install -g @mindbricks/genesis-set
19
- genesis-set install
19
+ genesis install
20
20
  ```
21
21
 
22
- The npm package is `@mindbricks/genesis-set`; the command is `genesis-set`. It depends on
22
+ The npm package is `@mindbricks/genesis-set`; the command is `genesis` (`genesis-set` still works
23
+ as an alias). It depends on
23
24
  `@mindbricks/mind-set`, so the global install brings mind-set's package too, and
24
- `genesis-set install` runs `mind-set install` when mind-set is not installed yet.
25
+ `genesis install` runs `mindset install` when mind-set is not installed yet.
25
26
 
26
27
  ## Commands
27
28
 
28
29
  | Command | What it does |
29
30
  |---|---|
30
- | `genesis-set install [--claude] [--codex] [--force] [--no-mcp] [--no-key] [--dry-run]` | Makes sure a compatible mind-set is installed (it comes with this package and is installed by its own CLI), copies the corpus to `~/.genesis-set/<version>/` (linked as `~/.genesis-set/current`), writes each `genesis-*` skill to Claude Code (`~/.claude/skills/`) and Codex (`~/.agents/skills/`), registers the MCP server (below), and ends with the API key step (below). |
31
- | `genesis-set update [...]` | Installs this version for every agent installed before (and every detected one), then deletes older corpus versions. |
32
- | `genesis-set uninstall [--dry-run]` | Removes only what `install` recorded in `~/.genesis-set/installed.json`, including the MCP registrations. mind-set and your API key file stay. |
33
- | `genesis-set doctor` | Both versions (genesis-set and mind-set) and whether they are compatible, the skills of each package and the MCP server per agent, where the API key comes from (never its value) and the API base. |
34
- | `genesis-set config [show \| set-key \| unset-key \| set-base <url> \| unset-base]` | The API key and API base in `~/.genesis-set/config.json` (mode 0600). `set-key` reads the key from stdin (hidden on a terminal), never from the command line. |
35
- | `genesis-set keys [--no-open]` | Opens the local key page in your browser: add, change, clear or delete the keys your agent uses. The link is new each time; the page closes after 15 idle minutes or on Ctrl+C. `--no-open` only prints the link. |
36
- | `genesis-set mcp` | Runs the MCP server on stdio from the package (for a registration by hand). |
31
+ | `genesis install [--claude] [--codex] [--force] [--no-mcp] [--no-key] [--dry-run]` | Makes sure a compatible mind-set is installed (it comes with this package and is installed by its own CLI), copies the corpus to `~/.genesis-set/<version>/` (linked as `~/.genesis-set/current`), writes each `genesis-*` skill to Claude Code (`~/.claude/skills/`) and Codex (`~/.agents/skills/`), registers the MCP server (below), and ends with the API key step (below). |
32
+ | `genesis update [...]` | Installs this version for every agent installed before (and every detected one), then deletes older corpus versions. |
33
+ | `genesis uninstall [--dry-run]` | Removes only what `install` recorded in `~/.genesis-set/installed.json`, including the MCP registrations. mind-set and your API key file stay. |
34
+ | `genesis doctor` | Both versions (genesis-set and mind-set) and whether they are compatible, the skills of each package and the MCP server per agent, where the API key comes from and which key it is (its type prefix and last four characters, such as `sk_mbx_...9f3a`, never the whole key) and the API base. |
35
+ | `genesis config [show \| set-key \| unset-key \| set-base <url> \| unset-base]` | The API key and API base in `~/.genesis-set/config.json` (mode 0600). `set-key` reads the key from stdin (hidden on a terminal), never from the command line. |
36
+ | `genesis keys [--no-open]` | Opens the local key page in your browser: add, change, clear or delete the keys your agent uses. The link is new each time; the page closes after 15 idle minutes or on Ctrl+C. `--no-open` only prints the link. |
37
+ | `genesis mcp` | Runs the MCP server on stdio from the package (for a registration by hand). |
37
38
 
38
39
  ### The MCP server
39
40
 
@@ -76,13 +77,14 @@ without a Genesis API key:
76
77
  2. "Open this link and save the key there".
77
78
  3. `genesis_listKeys` until the key is `set`.
78
79
  4. `genesis_writeKeyToEnvFile` when a service needs it.
79
- - **Opening the page yourself:** `genesis-set keys` in any terminal opens it in the browser. The
80
+ - **Opening the page yourself:** `genesis keys` in any terminal opens it in the browser. The
80
81
  port and the link change every time, so there is nothing to remember or bookmark. Asking the
81
82
  agent ("open my keys") works too: it calls `genesis_openKeyManager`.
82
83
  - **Where the keys live:** in `~/.genesis-set/config.json` (mode 0600).
83
84
  - The Genesis API key is the built-in key `genesis-api-key`, the same value `config set-key` stores.
84
85
  - Every other key is `keys.<name>`.
85
- - **What the page shows:** whether a key is set, and the last four characters of a long value. A
86
+ - **What the page shows:** whether a key is set and, for a long value, its type prefix and last
87
+ four characters (`sk_test_...a1b2`), so test and live keys can be told apart. A
86
88
  value is sent once, when the user saves it. The field the user types into is hidden, with a
87
89
  Show / Hide toggle; the stored value is never shown again.
88
90
  - **Env files:** `genesis_writeKeyToEnvFile` accepts only a file named `.env`, `.env.local` or
@@ -114,18 +116,18 @@ without a Genesis API key:
114
116
  - **Getting the key:** the user signs in to the Genesis portal and creates one on its API keys
115
117
  page, `https://portal.genesiscompiler.com/keys` (the stage API `sapi.genesiscompiler.com`
116
118
  has `https://stage.genesiscompiler.com/keys`). The key is shown once.
117
- - **The install key step:** with no key set, `genesis-set install` names that page.
119
+ - **The install key step:** with no key set, `genesis install` names that page.
118
120
  - On a terminal it reads the key with hidden input and stores it as `set-key` does; Enter
119
121
  skips.
120
122
  - Without a terminal (an agent runs the install) it only prints the page and the command, and
121
123
  never waits.
122
124
  - `--no-key` skips the step.
123
125
  - The Compiler API key lives in the environment variable `GENESIS_API_KEY` or in
124
- `~/.genesis-set/config.json` (`genesis-set config set-key`), never in a file of the project,
126
+ `~/.genesis-set/config.json` (`genesis config set-key`), never in a file of the project,
125
127
  the blueprint or a commit. The environment variable wins. The MCP server never reads the
126
128
  folder it runs in for a key or a setting.
127
129
  - The API base is `https://api.genesiscompiler.com` unless `GENESIS_API_BASE` or
128
- `genesis-set config set-base` says otherwise; a plain-http base is accepted only on a
130
+ `genesis config set-base` says otherwise; a plain-http base is accepted only on a
129
131
  loopback address.
130
132
 
131
133
  ### Environment
@@ -14,17 +14,17 @@ const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8
14
14
  const out = (line) => process.stdout.write(`${line}\n`);
15
15
  const err = (line) => process.stderr.write(`${line}\n`);
16
16
 
17
- const HELP = `genesis-set ${pkg.version}: Genesis compiler skills for coding agents (PRE-RELEASE)
17
+ const HELP = `genesis ${pkg.version}: Genesis compiler skills for coding agents (PRE-RELEASE; genesis-set is an alias)
18
18
 
19
19
  Usage:
20
- genesis-set install [--claude] [--codex] [--force] [--no-mcp] [--no-key] [--dry-run]
21
- genesis-set update [--claude] [--codex] [--force] [--no-mcp] [--dry-run]
22
- genesis-set uninstall [--dry-run]
23
- genesis-set doctor
24
- genesis-set config [show | set-key | unset-key | set-base <url> | unset-base]
25
- genesis-set keys [--no-open]
26
- genesis-set mcp
27
- genesis-set --version | --help
20
+ genesis install [--claude] [--codex] [--force] [--no-mcp] [--no-key] [--dry-run]
21
+ genesis update [--claude] [--codex] [--force] [--no-mcp] [--dry-run]
22
+ genesis uninstall [--dry-run]
23
+ genesis doctor
24
+ genesis config [show | set-key | unset-key | set-base <url> | unset-base]
25
+ genesis keys [--no-open]
26
+ genesis mcp
27
+ genesis --version | --help
28
28
 
29
29
  install makes sure mind-set ${pkg.dependencies?.['@mindbricks/mind-set'] ?? ''} is installed (installs the
30
30
  mind-set that comes with this package when it is missing or older),
@@ -101,7 +101,7 @@ async function main(argv) {
101
101
  return command || flags.help ? 0 : 2;
102
102
  }
103
103
  if (!KNOWN_FLAGS[command]) {
104
- err(`error: unknown command "${command}" (see genesis-set --help)`);
104
+ err(`error: unknown command "${command}" (see genesis --help)`);
105
105
  return 2;
106
106
  }
107
107
  const unknown = Object.keys(flags).filter((f) => !KNOWN_FLAGS[command].includes(f));
package/corpus/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # genesis-set corpus
2
2
 
3
- The documents the genesis-set skills read. `genesis-set install` copies this folder to
3
+ The documents the genesis-set skills read. `genesis install` copies this folder to
4
4
  `~/.genesis-set/<version>/` and links it as `~/.genesis-set/current`; every skill names its
5
5
  files by their absolute path in that copy.
6
6
 
@@ -22,4 +22,4 @@ genesis/
22
22
  README.md procedure that has Genesis-specific steps, and their index
23
23
  ```
24
24
 
25
- Do not edit the files here: a new `genesis-set update` replaces them.
25
+ Do not edit the files here: a new `genesis update` replaces them.
@@ -41,15 +41,15 @@ Genesis never deploys anything and never runs your services.
41
41
 
42
42
  ## 3. Setup
43
43
 
44
- 1. `genesis-set install` registers the MCP server `genesis` for Claude Code and Codex. Restart
44
+ 1. `genesis install` registers the MCP server `genesis` for Claude Code and Codex. Restart
45
45
  the agent afterwards so it loads the tools.
46
46
  2. The API key.
47
47
  - **Getting it:** the user creates it on the Genesis portal's API keys page,
48
48
  `https://portal.genesiscompiler.com/keys` (for the stage API `sapi.genesiscompiler.com`,
49
49
  `https://stage.genesiscompiler.com/keys`). It is shown once. Give the user that link.
50
- - **Setting it:** the environment variable `GENESIS_API_KEY`, or `genesis-set config set-key`
50
+ - **Setting it:** the environment variable `GENESIS_API_KEY`, or `genesis config set-key`
51
51
  run by the user in their own terminal. That command reads the key from stdin and stores it
52
- in `~/.genesis-set/config.json`, readable only by the user. `genesis-set install` offers the
52
+ in `~/.genesis-set/config.json`, readable only by the user. `genesis install` offers the
53
53
  same prompt at its end when it runs on a terminal.
54
54
  - **Easiest with an agent:** `genesis_requestKey` with `name: "genesis-api-key"` answers the
55
55
  local key page link; the user pastes the key there, and the genesis_* tools use it at once.
@@ -58,8 +58,9 @@ Genesis never deploys anything and never runs your services.
58
58
  - A call without a key answers `GENESIS_API_KEY_MISSING`. Its message names the portal page
59
59
  and how to set the key: pass it on as it is.
60
60
  3. The API base is `https://api.genesiscompiler.com`. Change it only when the user names
61
- another one (`GENESIS_API_BASE`, or `genesis-set config set-base <url>`).
62
- 4. `genesis-set doctor` says where the key comes from (never its value), the API base and
61
+ another one (`GENESIS_API_BASE`, or `genesis config set-base <url>`).
62
+ 4. `genesis doctor` says where the key comes from and which key it is (type prefix and last four
63
+ characters, never the whole key), the API base and
63
64
  whether each agent has the MCP server.
64
65
 
65
66
  ## 4. The tools
@@ -102,7 +103,7 @@ can be built).
102
103
  - `200 { "valid": true, "codename", "language", "blueprintHash", "services": [...] }`: `services`
103
104
  is the build order Genesis uses.
104
105
  - `422 { "valid": false, "error": { "code": "GENESIS_BLUEPRINT_INVALID", "details": { "errors", "warnings" } } }`:
105
- every finding has `path`, `code` and `message`. Fix the blueprint, run `mind-set validate`
106
+ every finding has `path`, `code` and `message`. Fix the blueprint, run `mindset validate`
106
107
  again, then call again.
107
108
  - `429 GENESIS_RATE_LIMITED`: the validation budget (per user, per minute, shared with
108
109
  `genesis_validateService`) is spent; wait a minute. Do not loop on validation.
@@ -165,7 +166,7 @@ a `jobId` again after a lost session, and to show the user what was compiled.
165
166
 
166
167
  ## 5. How to compile a project
167
168
 
168
- 1. Author the blueprint with mind-set and validate it with `mind-set validate blueprint.json`.
169
+ 1. Author the blueprint with mind-set and validate it with `mindset validate blueprint.json`.
169
170
  2. `genesis_validateApplication` with the whole blueprint; repair until it is valid. While you
170
171
  work on one service, `genesis_validateService` with its fragment is the fast loop; finish with
171
172
  the whole blueprint.
@@ -232,7 +233,7 @@ a `jobId` again after a lost session, and to show the user what was compiled.
232
233
  | `GENESIS_UNREACHABLE`, `GENESIS_TIMEOUT`, `GENESIS_BAD_RESPONSE` | local | The API did not answer properly. Say so; do not retry in a loop. A build retry reuses its key. |
233
234
  | `GENESIS_RATE_LIMITED` | 429 | Validation budget spent: wait a minute. |
234
235
  | `GENESIS_BLUEPRINT_INVALID` | 422 | Fix the findings in `details`. |
235
- | `GENESIS_BLUEPRINT_UNREADABLE` | 422 | The blueprint could not be loaded at all: check its structure with `mind-set validate`. |
236
+ | `GENESIS_BLUEPRINT_UNREADABLE` | 422 | The blueprint could not be loaded at all: check its structure with `mindset validate`. |
236
237
  | `GENESIS_BLUEPRINT_TOO_LARGE`, `GENESIS_PAYLOAD_TOO_LARGE` | local, 413 | Over the size limit. |
237
238
  | `GENESIS_SERVICE_UNKNOWN`, `GENESIS_SERVICE_NOT_AVAILABLE` | 422 | Wrong service name, or panel / sdk. |
238
239
  | `GENESIS_LANGUAGE_NOT_ALLOWED`, `GENESIS_LANGUAGE_NOT_SUPPORTED` | 422 | Use a language the API lists (today `nodejs` and `rust`). |
@@ -11,7 +11,7 @@ Instead of the mind-set step that starts "## 8. Validate Validate the blueprint
11
11
 
12
12
  #### 8. Validate, then verify the running service - the ladder
13
13
 
14
- Validate every module you touched (`mind-set validate`, then the Genesis
14
+ Validate every module you touched (`mindset validate`, then the Genesis
15
15
  Compiler API's validation), compile, and start the service. Then climb,
16
16
  recording what you OBSERVED per rung; log a rung you could not climb as a
17
17
  finding, not as success.
@@ -1,4 +1,4 @@
1
- // `genesis-set config`: the Genesis API key and API base in the genesis-set
1
+ // `genesis config`: the Genesis API key and API base in the genesis-set
2
2
  // config file (<data>/config.json, mode 0600; <data> = GENESIS_SET_HOME or
3
3
  // ~/.genesis-set). The key is read from stdin, never from the command line (it
4
4
  // would land in the shell history), and never printed back.
@@ -8,6 +8,7 @@ import {
8
8
  API_KEY_ENV,
9
9
  DEFAULT_API_BASE,
10
10
  configPathOf,
11
+ maskSecret,
11
12
  normalizeApiBase,
12
13
  portalKeysUrl,
13
14
  readConfigFile,
@@ -54,6 +55,11 @@ async function readSecretLine(prompt, errOut) {
54
55
  return text.split(/\r?\n/)[0] ?? '';
55
56
  }
56
57
 
58
+ /** A set key as the user sees it: `sk_mbx_...9f3a`, or "set" when it is too short to show any of it. */
59
+ export function shownKey(key) {
60
+ return maskSecret(key) ?? 'set';
61
+ }
62
+
57
63
  /** Why a key cannot be stored, or null when it can. */
58
64
  function keyProblem(key) {
59
65
  if (!key) return 'no key read';
@@ -62,7 +68,7 @@ function keyProblem(key) {
62
68
  }
63
69
 
64
70
  /**
65
- * The key step at the end of `genesis-set install`. A set key is only reported (never its
71
+ * The key step at the end of `genesis install`. A set key is only reported (never its
66
72
  * value). Without one: on a terminal the user is pointed at the portal and the key is read
67
73
  * hidden (Enter skips); without a terminal (an agent runs the install) the link and the
68
74
  * command are printed and nothing waits for input. Never fails the install.
@@ -78,10 +84,10 @@ export async function offerApiKey({
78
84
  const s = resolveSettings(env);
79
85
  const url = portalKeysUrl(s.apiBase);
80
86
  if (s.apiKey) {
81
- out(`Genesis API key: set (from ${s.keySource}); its value is never printed.`);
87
+ out(`Genesis API key: ${shownKey(s.apiKey)} (from ${s.keySource}).`);
82
88
  return;
83
89
  }
84
- const later = `"genesis-set config set-key" in a terminal, or set ${API_KEY_ENV} in the environment the agent starts from`;
90
+ const later = `"genesis config set-key" in a terminal, or set ${API_KEY_ENV} in the environment the agent starts from`;
85
91
  if (dryRun) {
86
92
  out(`dry run: no API key asked. Create one at ${url}, then ${later}.`);
87
93
  return;
@@ -93,7 +99,7 @@ export async function offerApiKey({
93
99
  const file = configPathOf(env);
94
100
  const current = readConfigFile(file);
95
101
  if (current.__error) {
96
- err(`No API key stored: ${current.__error}. Fix or delete it, then run "genesis-set config set-key".`);
102
+ err(`No API key stored: ${current.__error}. Fix or delete it, then run "genesis config set-key".`);
97
103
  return;
98
104
  }
99
105
  out(`No Genesis API key yet. Create one at ${url} (it is shown once).`);
@@ -104,17 +110,17 @@ export async function offerApiKey({
104
110
  }
105
111
  const problem = keyProblem(key);
106
112
  if (problem) {
107
- err(`No API key stored: ${problem}. Run "genesis-set config set-key" to try again.`);
113
+ err(`No API key stored: ${problem}. Run "genesis config set-key" to try again.`);
108
114
  return;
109
115
  }
110
116
  writeConfigFile(file, Object.fromEntries(Object.entries({ ...current, apiKey: key }).filter(([k, v]) => k !== '__error' && v !== undefined)));
111
- out(`API key stored in ${file} (readable only by you). Manage it and your other keys any time with "genesis-set keys".`);
117
+ out(`API key stored in ${file} (readable only by you). Manage it and your other keys any time with "genesis keys".`);
112
118
  }
113
119
 
114
120
  function show(env, out) {
115
121
  const s = resolveSettings(env);
116
122
  out(`config file: ${s.configFile}`);
117
- out(`API key: ${s.apiKey ? `set (from ${s.keySource}); the value is never printed` : `not set (${API_KEY_ENV} or "genesis-set config set-key"; create one at ${portalKeysUrl(s.apiBase)})`}`);
123
+ out(`API key: ${s.apiKey ? `${shownKey(s.apiKey)} (from ${s.keySource})` : `not set (${API_KEY_ENV} or "genesis config set-key"; create one at ${portalKeysUrl(s.apiBase)})`}`);
118
124
  out(`API base: ${s.apiBase} (${s.baseSource})`);
119
125
  for (const p of s.problems) out(`problem: ${p}`);
120
126
  return s.problems.length ? 1 : 0;
package/lib/install.mjs CHANGED
@@ -11,7 +11,7 @@
11
11
  // registered with each agent at user scope
12
12
  // (~/.claude.json, ~/.codex/config.toml); see mcp-config.mjs
13
13
  // <data>/config.json the Genesis API key and API base, when the user
14
- // stores them with `genesis-set config` (never a project file)
14
+ // stores them with `genesis config` (never a project file)
15
15
  // <data> is ~/.genesis-set unless GENESIS_SET_HOME names another folder.
16
16
  // mind-set keeps its own data folder (~/.mind-set, or MIND_SET_HOME) and is
17
17
  // installed by its own CLI: when it is missing, or older than the range in
@@ -25,7 +25,7 @@ import os from 'node:os';
25
25
  import path from 'node:path';
26
26
  import { REGISTER, REGISTRATION, UNREGISTER, copyServer, mcpServerDir, mcpServerFile } from './mcp-config.mjs';
27
27
  import { compareVersions, satisfies } from './semver.mjs';
28
- import { portalKeysUrl, resolveSettings } from '../mcp/config.mjs';
28
+ import { maskSecret, portalKeysUrl, resolveSettings } from '../mcp/config.mjs';
29
29
 
30
30
  export const PACKAGE_NAME = 'genesis-set';
31
31
  export const MARKER = '.genesis-set.json';
@@ -267,7 +267,7 @@ export function ensureMindSet(ctx, agentNames) {
267
267
  }
268
268
  const bundled = bundledMindSet(ctx);
269
269
  if (!bundled) {
270
- ctx.out(`mind-set ${st.version} has no skills for ${missing.map((a) => ctx.agents[a].label).join(', ')}; run "mind-set install"`);
270
+ ctx.out(`mind-set ${st.version} has no skills for ${missing.map((a) => ctx.agents[a].label).join(', ')}; run "mindset install"`);
271
271
  return 1;
272
272
  }
273
273
  ctx.out(`mind-set ${st.version}: adding its skills for ${missing.map((a) => ctx.agents[a].label).join(', ')}`);
@@ -276,7 +276,7 @@ export function ensureMindSet(ctx, agentNames) {
276
276
  if (st.state === 'incompatible') {
277
277
  ctx.out(
278
278
  `error: mind-set ${st.version} is installed but genesis-set ${ctx.version} needs ${range}; ` +
279
- `install a genesis-set release made for it, or a mind-set in that range ("npm install -g ${MIND_SET_NPM}@<version>", then "mind-set install")`,
279
+ `install a genesis-set release made for it, or a mind-set in that range ("npm install -g ${MIND_SET_NPM}@<version>", then "mindset install")`,
280
280
  );
281
281
  return 1;
282
282
  }
@@ -284,7 +284,7 @@ export function ensureMindSet(ctx, agentNames) {
284
284
  if (!bundled) {
285
285
  ctx.out(
286
286
  `error: mind-set is ${st.state === 'missing' ? 'not installed' : `${st.version}, older than ${range}`} ` +
287
- `and the mind-set package that comes with genesis-set was not found; run "npm install -g ${MIND_SET_NPM}" and "mind-set install" first`,
287
+ `and the mind-set package that comes with genesis-set was not found; run "npm install -g ${MIND_SET_NPM}" and "mindset install" first`,
288
288
  );
289
289
  return 1;
290
290
  }
@@ -538,8 +538,8 @@ export function uninstall(ctx) {
538
538
  }
539
539
  ctx.out(
540
540
  `${ctx.dryRun ? 'dry run: nothing removed. ' : ''}genesis-set uninstalled; mind-set is left as it is ` +
541
- '("mind-set uninstall" removes it)' +
542
- (exists(path.join(ctx.dataDir, 'config.json')) ? `; your API key file ${path.join(ctx.dataDir, 'config.json')} is kept ("genesis-set config unset-key" clears it)` : ''),
541
+ '("mindset uninstall" removes it)' +
542
+ (exists(path.join(ctx.dataDir, 'config.json')) ? `; your API key file ${path.join(ctx.dataDir, 'config.json')} is kept ("genesis config unset-key" clears it)` : ''),
543
543
  );
544
544
  return 0;
545
545
  }
@@ -565,16 +565,16 @@ export function doctor(ctx) {
565
565
  const ok = manifest.corpus && exists(manifest.corpus);
566
566
  say(`corpus: ${manifest.version} at ${manifest.corpus}${ok ? '' : ' (MISSING)'}`);
567
567
  if (!ok) problems.push(`corpus folder ${manifest.corpus} is missing`);
568
- if (manifest.version !== ctx.version) say(`note: installed ${manifest.version}, this package is ${ctx.version}; run "genesis-set update"`);
568
+ if (manifest.version !== ctx.version) say(`note: installed ${manifest.version}, this package is ${ctx.version}; run "genesis update"`);
569
569
  } else {
570
- say('corpus: not installed (run "genesis-set install")');
570
+ say('corpus: not installed (run "genesis install")');
571
571
  }
572
572
  const st = mindSetState(ctx);
573
573
  const range = ctx.mindSetRange ?? 'any';
574
574
  const verdict = {
575
575
  ok: 'compatible',
576
576
  missing: 'NOT INSTALLED',
577
- old: 'INCOMPATIBLE (older; "genesis-set update" updates it)',
577
+ old: 'INCOMPATIBLE (older; "genesis update" updates it)',
578
578
  incompatible: 'INCOMPATIBLE',
579
579
  }[st.state];
580
580
  say(`mind-set: ${st.version ?? 'not installed'} at ${ctx.mindSetDir}; genesis-set needs ${range}: ${verdict}`);
@@ -584,8 +584,8 @@ export function doctor(ctx) {
584
584
  if (manifest && !exists(mindSetCorpus(ctx))) problems.push(`the mind-set corpus ${mindSetCorpus(ctx)} the skills point at is missing`);
585
585
  const settings = resolveSettings(ctx.env);
586
586
  say(
587
- `Genesis Compiler API key: ${settings.apiKey ? `set (from ${settings.keySource})` : `not set (${API_KEY_ENV}, or "genesis-set config set-key"; create one at ${portalKeysUrl(settings.apiBase)})`}; ` +
588
- 'its value is never printed',
587
+ `Genesis Compiler API key: ${settings.apiKey ? `${maskSecret(settings.apiKey) ?? 'set'} (from ${settings.keySource})` : `not set (${API_KEY_ENV}, or "genesis config set-key"; create one at ${portalKeysUrl(settings.apiBase)})`}; ` +
588
+ 'only its type prefix and last four characters are ever printed',
589
589
  );
590
590
  say(`Genesis Compiler API base: ${settings.apiBase} (${settings.baseSource})`);
591
591
  for (const p of settings.problems) problems.push(p);
@@ -598,7 +598,7 @@ export function doctor(ctx) {
598
598
  say(`MCP server: ${mcpServerFile(ctx)}${ok ? '' : ' (MISSING)'}`);
599
599
  if (!ok) problems.push(`the MCP server ${mcpServerFile(ctx)} is missing`);
600
600
  } else {
601
- say('MCP server: not installed (run "genesis-set install")');
601
+ say('MCP server: not installed (run "genesis install")');
602
602
  }
603
603
  say('agents:');
604
604
  for (const name of ['claude', 'codex']) {
@@ -632,7 +632,7 @@ export function doctor(ctx) {
632
632
  if (problems.length) {
633
633
  say('problems:');
634
634
  for (const p of problems) say(` - ${p}`);
635
- say('run "genesis-set install" (or "genesis-set update") to repair');
635
+ say('run "genesis install" (or "genesis update") to repair');
636
636
  return 1;
637
637
  }
638
638
  return 0;
@@ -11,6 +11,8 @@ import fs from 'node:fs';
11
11
  import path from 'node:path';
12
12
 
13
13
  export const MCP_SERVER_NAME = 'genesis';
14
+ // The exact text of this marker is how update / uninstall find the block in an
15
+ // existing config.toml: it keeps the old command names on purpose (#9355).
14
16
  const TOML_BEGIN = '# >>> genesis-set: managed block, written by "genesis-set install"; "genesis-set uninstall" removes it';
15
17
  const TOML_END = '# <<< genesis-set';
16
18
 
@@ -180,7 +182,7 @@ export function registerCodex(ctx) {
180
182
  if (FOREIGN_TABLE.test(stripped.text)) {
181
183
  return {
182
184
  status: 'blocked',
183
- message: `${file} already defines [mcp_servers.${MCP_SERVER_NAME}] outside the genesis-set block; remove or rename it, then run "genesis-set install" again`,
185
+ message: `${file} already defines [mcp_servers.${MCP_SERVER_NAME}] outside the genesis-set block; remove or rename it, then run "genesis install" again`,
184
186
  };
185
187
  }
186
188
  if (!ctx.dryRun) {
package/mcp/client.mjs CHANGED
@@ -30,7 +30,7 @@ function authHint(status, configFile) {
30
30
  if (status === 401) {
31
31
  return (
32
32
  'The Genesis API did not accept the API key. Check the key in the Genesis portal and set the right one ' +
33
- `(GENESIS_API_KEY, or "genesis-set config set-key", which writes ${configFile}).`
33
+ `(GENESIS_API_KEY, or "genesis config set-key", which writes ${configFile}).`
34
34
  );
35
35
  }
36
36
  if (status === 403) return 'This key is not allowed to call the Genesis Compiler API (a user API key is needed).';
package/mcp/config.mjs CHANGED
@@ -29,6 +29,29 @@ export function portalKeysUrl(apiBase) {
29
29
  return PORTAL_KEYS_URL;
30
30
  }
31
31
  export const CONFIG_FILE = 'config.json';
32
+
33
+ /** How many characters of a stored key always stay hidden when it is shown. */
34
+ export const MASK_HIDDEN_MIN = 8;
35
+ /** The longest type prefix a masked key shows. */
36
+ export const MASK_PREFIX_MAX = 12;
37
+
38
+ /**
39
+ * A stored key as the user may see it: its type prefix and its last four
40
+ * characters, for example `sk_test_...a1b2` or `sk_mbx_...9f3a`, so the user can
41
+ * tell which key is set (test or live, which account) without the key being
42
+ * shown. The prefix is the leading marker, one or two letter segments that end
43
+ * in `_` or `-` (at most MASK_PREFIX_MAX characters), else the first four
44
+ * characters. Answers null when fewer than MASK_HIDDEN_MIN characters would stay
45
+ * hidden: a short value is only ever "set". Never for an agent's answer.
46
+ */
47
+ export function maskSecret(value) {
48
+ if (typeof value !== 'string') return null;
49
+ const v = value.trim();
50
+ const marker = v.match(/^[A-Za-z]{1,8}[_-](?:[A-Za-z]{1,8}[_-])?/);
51
+ const prefix = marker && marker[0].length <= MASK_PREFIX_MAX ? marker[0] : v.slice(0, 4);
52
+ if (v.length - prefix.length - 4 < MASK_HIDDEN_MIN) return null;
53
+ return `${prefix}...${v.slice(-4)}`;
54
+ }
32
55
  /** The server's default inline-blueprint limit (bytes of the compact JSON text). */
33
56
  export const DEFAULT_MAX_BLUEPRINT_BYTES = 10 * 1024 * 1024;
34
57
  export const DEFAULT_TIMEOUT_MS = 120_000;
@@ -158,7 +181,7 @@ export function missingKeyMessage(configFile, apiBase) {
158
181
  return (
159
182
  `No Genesis API key is set. The user creates one on the Genesis portal (${portalKeysUrl(apiBase)}; ` +
160
183
  'it is shown once) and sets it in the environment the agent starts from ' +
161
- `(export ${API_KEY_ENV}=<your key>), or store it once with "genesis-set config set-key" ` +
184
+ `(export ${API_KEY_ENV}=<your key>), or store it once with "genesis config set-key" ` +
162
185
  `(it reads the key from stdin and writes ${configFile}, readable only by you). ` +
163
186
  'Never put the key in the project folder, the blueprint, a commit or the chat. ' +
164
187
  'The config file is read on every call; a new environment variable needs an agent restart.'
@@ -112,7 +112,7 @@ const SCRIPT = `
112
112
  c.append(head);
113
113
  if (k.description) c.append(el('p', 'desc', k.description));
114
114
  const meta = [];
115
- if (k.tail) meta.push('ends with ' + k.tail);
115
+ if (k.masked) meta.push('key ' + k.masked);
116
116
  if (k.status === 'set' && k.updatedAt) meta.push('saved ' + when(k.updatedAt));
117
117
  if (meta.length) c.append(el('p', 'meta', meta.join(' · ')));
118
118
  if (k.source) c.append(el('p', 'note', 'The environment variable ' + k.source + ' is set and wins over a value saved here.'));
@@ -250,7 +250,7 @@ export function renderKeyPage({ nonce, idleMinutes = 15, expired = false }) {
250
250
  return (
251
251
  head +
252
252
  '<body><main class="expired"><h1>This link has expired</h1>' +
253
- '<p class="lead">The key page closes when it is idle or when the agent session ends. Run <code>genesis-set keys</code> in a terminal for a new one, or ask the agent.</p>' +
253
+ '<p class="lead">The key page closes when it is idle or when the agent session ends. Run <code>genesis keys</code> in a terminal for a new one, or ask the agent.</p>' +
254
254
  '</main></body></html>'
255
255
  );
256
256
  }
@@ -269,7 +269,7 @@ export function renderKeyPage({ nonce, idleMinutes = 15, expired = false }) {
269
269
  '<div class="row"><textarea name="description" placeholder="What it is for and where to get it" aria-label="Description"></textarea></div>' +
270
270
  '<div class="row"><button class="primary" type="submit">Add key</button></div>' +
271
271
  '</form></section>' +
272
- `<footer>This page runs on 127.0.0.1 inside genesis-set and closes after ${idleMinutes} idle minutes. Open it again any time with <code>genesis-set keys</code> in a terminal.</footer>` +
272
+ `<footer>This page runs on 127.0.0.1 inside genesis-set and closes after ${idleMinutes} idle minutes. Open it again any time with <code>genesis keys</code> in a terminal.</footer>` +
273
273
  `</main><script nonce="${nonce}">${SCRIPT}</script></body></html>`
274
274
  );
275
275
  }
package/mcp/key-store.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // The local key store of genesis-set (#9352): the keys a coding agent needs (the
2
2
  // Genesis API key, provider keys for the generated services), kept in the
3
- // genesis-set config file (<data>/config.json, mode 0600) next to the API key.
3
+ // genesis config file (<data>/config.json, mode 0600) next to the API key.
4
4
  //
5
5
  // apiKey the Genesis API key; shown as the built-in key
6
6
  // "genesis-api-key"
@@ -12,7 +12,7 @@
12
12
  // the last four characters for the page, and `keyValue` is for the code that
13
13
  // uses a key (writing a gitignored env file), never for a tool answer.
14
14
 
15
- import { API_KEY_ENV, configPathOf, readConfigFile, writeConfigFile } from './config.mjs';
15
+ import { API_KEY_ENV, configPathOf, maskSecret, readConfigFile, writeConfigFile } from './config.mjs';
16
16
 
17
17
  export const BUILTIN_KEY = 'genesis-api-key';
18
18
  const BUILTIN_LABEL = 'Genesis API key';
@@ -80,13 +80,9 @@ function checkValue(value) {
80
80
  return v;
81
81
  }
82
82
 
83
- /** The last four characters, for a long value only (a short one would give most of it away). */
84
- function tailOf(value) {
85
- return typeof value === 'string' && value.length >= 12 ? value.slice(-4) : null;
86
- }
87
-
88
- function row(name, entry, { builtin = false, envOverride = false } = {}) {
83
+ function row(name, entry, { builtin = false, envOverride = false, envValue = null } = {}) {
89
84
  const value = typeof entry.value === 'string' && entry.value ? entry.value : null;
85
+ // The key in effect: for the Genesis API key the environment variable wins over the file.
90
86
  return {
91
87
  name,
92
88
  label: entry.label || name,
@@ -94,14 +90,14 @@ function row(name, entry, { builtin = false, envOverride = false } = {}) {
94
90
  builtin,
95
91
  status: value || envOverride ? 'set' : 'empty',
96
92
  ...(envOverride ? { source: API_KEY_ENV } : {}),
97
- tail: tailOf(value),
93
+ masked: maskSecret(envOverride ? envValue : value),
98
94
  updatedAt: entry.updatedAt ?? null,
99
95
  };
100
96
  }
101
97
 
102
98
  /**
103
- * Every key, the built-in Genesis API key first. `tail` (the last four
104
- * characters) is for the page; the tools drop it.
99
+ * Every key, the built-in Genesis API key first. `masked` (the type prefix and
100
+ * the last four characters, see maskSecret) is for the page; the tools drop it.
105
101
  */
106
102
  export function listKeys(env = process.env) {
107
103
  const { cfg, keys } = load(env);
@@ -110,7 +106,7 @@ export function listKeys(env = process.env) {
110
106
  row(
111
107
  BUILTIN_KEY,
112
108
  { label: BUILTIN_LABEL, description: BUILTIN_DESCRIPTION, value: cfg.apiKey, updatedAt: cfg.apiKeyUpdatedAt },
113
- { builtin: true, envOverride: envKey },
109
+ { builtin: true, envOverride: envKey, envValue: envKey ? env[API_KEY_ENV] : null },
114
110
  ),
115
111
  ];
116
112
  for (const name of Object.keys(keys).sort()) {
package/mcp/key-tools.mjs CHANGED
@@ -91,10 +91,10 @@ export function isKeyTool(name) {
91
91
  return KEY_TOOL_NAMES.has(name);
92
92
  }
93
93
 
94
- /** A row for the agent: the page's row without the value's tail. */
94
+ /** A row for the agent: the page's row without any part of the value. */
95
95
  function forAgent(row) {
96
96
  if (!row) return row;
97
- const { tail: _tail, ...rest } = row;
97
+ const { masked: _masked, ...rest } = row;
98
98
  return rest;
99
99
  }
100
100
 
@@ -189,7 +189,7 @@ const HANDLERS = {
189
189
  key.status === 'set'
190
190
  ? `"${key.label}" is already set. Use it; the user can change it on the key page.`
191
191
  : `Ask the user to open ${link.url} on this machine and save "${key.label}" there, then call genesis_listKeys to see it set. ` +
192
- 'Never ask for the value in the chat. Later the user can open the page themselves with "genesis-set keys" in a terminal.',
192
+ 'Never ask for the value in the chat. Later the user can open the page themselves with "genesis keys" in a terminal.',
193
193
  };
194
194
  },
195
195
  async genesis_listKeys(_args, settings) {
package/mcp/server.mjs CHANGED
@@ -4,10 +4,10 @@
4
4
  // per line on stdin / stdout, logs on stderr only. No dependencies besides
5
5
  // Node >= 18.
6
6
  //
7
- // `genesis-set install` copies this folder to ~/.genesis-set/mcp/ and registers
8
- // it with each installed agent; `genesis-set mcp` runs it from the package.
7
+ // `genesis install` copies this folder to ~/.genesis-set/mcp/ and registers
8
+ // it with each installed agent; `genesis mcp` runs it from the package.
9
9
  // The API key and the API base are resolved on every call (./config.mjs), so a
10
- // key stored with `genesis-set config set-key` works without a restart.
10
+ // key stored with `genesis config set-key` works without a restart.
11
11
 
12
12
  import fs from 'node:fs';
13
13
  import path from 'node:path';
@@ -103,7 +103,7 @@ export function serve({ input = process.stdin, output = process.stdout, log = (l
103
103
  inflight.set(msg.id, ctl);
104
104
  try {
105
105
  const settings = { ...resolveSettings(env), env, cwd, userAgent: `genesis-set/${version} (mcp)` };
106
- for (const p of settings.problems) log(`genesis-set mcp: ${p}`);
106
+ for (const p of settings.problems) log(`genesis mcp: ${p}`);
107
107
  const result = await runTool(name, params.arguments, settings, ctl.signal);
108
108
  if (!ctl.signal.aborted) reply(msg.id, result);
109
109
  } finally {
@@ -119,7 +119,7 @@ export function serve({ input = process.stdin, output = process.stdout, log = (l
119
119
 
120
120
  const dispatch = (msg) => {
121
121
  handle(msg).catch((err) => {
122
- log(`genesis-set mcp: ${err?.stack ?? err}`);
122
+ log(`genesis mcp: ${err?.stack ?? err}`);
123
123
  if (msg?.id !== undefined && msg?.id !== null) fail(msg.id, -32603, 'Internal error');
124
124
  });
125
125
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindbricks/genesis-set",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "PRE-RELEASE. Genesis compiler skills for coding agents (Claude Code, Codex): the generated code, its runtime and the Genesis Compiler API, on top of mind-set.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "type": "module",
15
15
  "bin": {
16
+ "genesis": "bin/genesis-set.mjs",
16
17
  "genesis-set": "bin/genesis-set.mjs"
17
18
  },
18
19
  "files": [
@@ -40,6 +41,6 @@
40
41
  "agent-skills"
41
42
  ],
42
43
  "dependencies": {
43
- "@mindbricks/mind-set": "^0.1.0"
44
+ "@mindbricks/mind-set": "^0.2.0"
44
45
  }
45
46
  }
@@ -15,16 +15,16 @@ service build's result is `{{CORPUS}}/genesis/compile-results.md`.
15
15
  ## Before you call
16
16
 
17
17
  1. The blueprint is written and validated with mind-set (the openappl-blueprint-authoring skill
18
- and `mind-set validate blueprint.json`, schema `{{MIND_SET}}/openappl.json`). Follow the
18
+ and `mindset validate blueprint.json`, schema `{{MIND_SET}}/openappl.json`). Follow the
19
19
  mind-set procedure `{{MIND_SET}}/procedures/project-lifecycle.md` with its Genesis additions
20
20
  `{{CORPUS}}/genesis/procedures/project-lifecycle.md`.
21
21
  2. Identity is the blueprint's: the codename is `projectSettings.basicSettings.name`; a new
22
22
  blueprint gets a stable project id (a UUID) once. Write no binding file or other compiler file
23
23
  into the project folder.
24
- 3. The `genesis_*` tools are there (the MCP server `genesis`; `genesis-set install` registers it,
24
+ 3. The `genesis_*` tools are there (the MCP server `genesis`; `genesis install` registers it,
25
25
  then restart the agent). A call that answers `GENESIS_API_KEY_MISSING` carries the message that
26
26
  tells the user where to create the key (the Genesis portal's API keys page) and how to set it
27
- (`GENESIS_API_KEY`, or `genesis-set config set-key` in their own terminal): pass it on. The
27
+ (`GENESIS_API_KEY`, or `genesis config set-key` in their own terminal): pass it on. The
28
28
  easiest way for the user is the local key page: `genesis_requestKey` with
29
29
  `name: "genesis-api-key"` answers its link; then check `genesis_listKeys`. Never ask for the key
30
30
  in the chat, never write it into a file, never print it.