@mindbricks/genesis-set 0.1.0 → 0.2.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 +10 -0
- package/README.md +15 -14
- package/bin/genesis-set.mjs +10 -10
- package/corpus/README.md +2 -2
- package/corpus/genesis/compiler-api.md +8 -8
- package/corpus/genesis/procedures/howto-subscription.md +1 -1
- package/lib/config-cli.mjs +7 -7
- package/lib/install.mjs +12 -12
- package/lib/mcp-config.mjs +3 -1
- package/mcp/client.mjs +1 -1
- package/mcp/config.mjs +1 -1
- package/mcp/key-page-html.mjs +2 -2
- package/mcp/key-store.mjs +1 -1
- package/mcp/key-tools.mjs +1 -1
- package/mcp/server.mjs +5 -5
- package/package.json +3 -2
- package/skills/genesis-compiler-api/SKILL.md +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.0 (pre-release)
|
|
7
|
+
|
|
8
|
+
Needs mind-set `^0.2.0`.
|
|
9
|
+
|
|
10
|
+
- The command is `genesis`, the same name as its MCP server; `genesis-set` still works as an
|
|
11
|
+
alias (and keeps `npx @mindbricks/genesis-set ...` working). Every message, skill and
|
|
12
|
+
guide names `genesis`. The data folder stays `~/.genesis-set`.
|
|
13
|
+
- The MCP server exits only after its answers are written out; before, an answer over 8 KiB
|
|
14
|
+
could be cut when the client closed stdin.
|
|
15
|
+
|
|
6
16
|
## 0.1.0 (pre-release)
|
|
7
17
|
|
|
8
18
|
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
|
|
19
|
+
genesis install
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
The npm package is `@mindbricks/genesis-set`; the command is `genesis-set
|
|
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
|
|
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
|
|
31
|
-
| `genesis
|
|
32
|
-
| `genesis
|
|
33
|
-
| `genesis
|
|
34
|
-
| `genesis
|
|
35
|
-
| `genesis
|
|
36
|
-
| `genesis
|
|
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 (never its value) 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,7 +77,7 @@ 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
|
|
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).
|
|
@@ -114,18 +115,18 @@ without a Genesis API key:
|
|
|
114
115
|
- **Getting the key:** the user signs in to the Genesis portal and creates one on its API keys
|
|
115
116
|
page, `https://portal.genesiscompiler.com/keys` (the stage API `sapi.genesiscompiler.com`
|
|
116
117
|
has `https://stage.genesiscompiler.com/keys`). The key is shown once.
|
|
117
|
-
- **The install key step:** with no key set, `genesis
|
|
118
|
+
- **The install key step:** with no key set, `genesis install` names that page.
|
|
118
119
|
- On a terminal it reads the key with hidden input and stores it as `set-key` does; Enter
|
|
119
120
|
skips.
|
|
120
121
|
- Without a terminal (an agent runs the install) it only prints the page and the command, and
|
|
121
122
|
never waits.
|
|
122
123
|
- `--no-key` skips the step.
|
|
123
124
|
- The Compiler API key lives in the environment variable `GENESIS_API_KEY` or in
|
|
124
|
-
`~/.genesis-set/config.json` (`genesis
|
|
125
|
+
`~/.genesis-set/config.json` (`genesis config set-key`), never in a file of the project,
|
|
125
126
|
the blueprint or a commit. The environment variable wins. The MCP server never reads the
|
|
126
127
|
folder it runs in for a key or a setting.
|
|
127
128
|
- The API base is `https://api.genesiscompiler.com` unless `GENESIS_API_BASE` or
|
|
128
|
-
`genesis
|
|
129
|
+
`genesis config set-base` says otherwise; a plain-http base is accepted only on a
|
|
129
130
|
loopback address.
|
|
130
131
|
|
|
131
132
|
### Environment
|
package/bin/genesis-set.mjs
CHANGED
|
@@ -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
|
|
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
|
|
21
|
-
genesis
|
|
22
|
-
genesis
|
|
23
|
-
genesis
|
|
24
|
-
genesis
|
|
25
|
-
genesis
|
|
26
|
-
genesis
|
|
27
|
-
genesis
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,8 @@ 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
|
|
62
|
-
4. `genesis
|
|
61
|
+
another one (`GENESIS_API_BASE`, or `genesis config set-base <url>`).
|
|
62
|
+
4. `genesis doctor` says where the key comes from (never its value), the API base and
|
|
63
63
|
whether each agent has the MCP server.
|
|
64
64
|
|
|
65
65
|
## 4. The tools
|
|
@@ -102,7 +102,7 @@ can be built).
|
|
|
102
102
|
- `200 { "valid": true, "codename", "language", "blueprintHash", "services": [...] }`: `services`
|
|
103
103
|
is the build order Genesis uses.
|
|
104
104
|
- `422 { "valid": false, "error": { "code": "GENESIS_BLUEPRINT_INVALID", "details": { "errors", "warnings" } } }`:
|
|
105
|
-
every finding has `path`, `code` and `message`. Fix the blueprint, run `
|
|
105
|
+
every finding has `path`, `code` and `message`. Fix the blueprint, run `mindset validate`
|
|
106
106
|
again, then call again.
|
|
107
107
|
- `429 GENESIS_RATE_LIMITED`: the validation budget (per user, per minute, shared with
|
|
108
108
|
`genesis_validateService`) is spent; wait a minute. Do not loop on validation.
|
|
@@ -165,7 +165,7 @@ a `jobId` again after a lost session, and to show the user what was compiled.
|
|
|
165
165
|
|
|
166
166
|
## 5. How to compile a project
|
|
167
167
|
|
|
168
|
-
1. Author the blueprint with mind-set and validate it with `
|
|
168
|
+
1. Author the blueprint with mind-set and validate it with `mindset validate blueprint.json`.
|
|
169
169
|
2. `genesis_validateApplication` with the whole blueprint; repair until it is valid. While you
|
|
170
170
|
work on one service, `genesis_validateService` with its fragment is the fast loop; finish with
|
|
171
171
|
the whole blueprint.
|
|
@@ -232,7 +232,7 @@ a `jobId` again after a lost session, and to show the user what was compiled.
|
|
|
232
232
|
| `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
233
|
| `GENESIS_RATE_LIMITED` | 429 | Validation budget spent: wait a minute. |
|
|
234
234
|
| `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 `
|
|
235
|
+
| `GENESIS_BLUEPRINT_UNREADABLE` | 422 | The blueprint could not be loaded at all: check its structure with `mindset validate`. |
|
|
236
236
|
| `GENESIS_BLUEPRINT_TOO_LARGE`, `GENESIS_PAYLOAD_TOO_LARGE` | local, 413 | Over the size limit. |
|
|
237
237
|
| `GENESIS_SERVICE_UNKNOWN`, `GENESIS_SERVICE_NOT_AVAILABLE` | 422 | Wrong service name, or panel / sdk. |
|
|
238
238
|
| `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 (`
|
|
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.
|
package/lib/config-cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `genesis
|
|
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.
|
|
@@ -62,7 +62,7 @@ function keyProblem(key) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* The key step at the end of `genesis
|
|
65
|
+
* The key step at the end of `genesis install`. A set key is only reported (never its
|
|
66
66
|
* value). Without one: on a terminal the user is pointed at the portal and the key is read
|
|
67
67
|
* hidden (Enter skips); without a terminal (an agent runs the install) the link and the
|
|
68
68
|
* command are printed and nothing waits for input. Never fails the install.
|
|
@@ -81,7 +81,7 @@ export async function offerApiKey({
|
|
|
81
81
|
out(`Genesis API key: set (from ${s.keySource}); its value is never printed.`);
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
|
-
const later = `"genesis
|
|
84
|
+
const later = `"genesis config set-key" in a terminal, or set ${API_KEY_ENV} in the environment the agent starts from`;
|
|
85
85
|
if (dryRun) {
|
|
86
86
|
out(`dry run: no API key asked. Create one at ${url}, then ${later}.`);
|
|
87
87
|
return;
|
|
@@ -93,7 +93,7 @@ export async function offerApiKey({
|
|
|
93
93
|
const file = configPathOf(env);
|
|
94
94
|
const current = readConfigFile(file);
|
|
95
95
|
if (current.__error) {
|
|
96
|
-
err(`No API key stored: ${current.__error}. Fix or delete it, then run "genesis
|
|
96
|
+
err(`No API key stored: ${current.__error}. Fix or delete it, then run "genesis config set-key".`);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
out(`No Genesis API key yet. Create one at ${url} (it is shown once).`);
|
|
@@ -104,17 +104,17 @@ export async function offerApiKey({
|
|
|
104
104
|
}
|
|
105
105
|
const problem = keyProblem(key);
|
|
106
106
|
if (problem) {
|
|
107
|
-
err(`No API key stored: ${problem}. Run "genesis
|
|
107
|
+
err(`No API key stored: ${problem}. Run "genesis config set-key" to try again.`);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
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
|
|
111
|
+
out(`API key stored in ${file} (readable only by you). Manage it and your other keys any time with "genesis keys".`);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
function show(env, out) {
|
|
115
115
|
const s = resolveSettings(env);
|
|
116
116
|
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
|
|
117
|
+
out(`API key: ${s.apiKey ? `set (from ${s.keySource}); the value is never printed` : `not set (${API_KEY_ENV} or "genesis config set-key"; create one at ${portalKeysUrl(s.apiBase)})`}`);
|
|
118
118
|
out(`API base: ${s.apiBase} (${s.baseSource})`);
|
|
119
119
|
for (const p of s.problems) out(`problem: ${p}`);
|
|
120
120
|
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
|
|
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
|
|
@@ -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 "
|
|
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 "
|
|
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 "
|
|
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
|
-
'("
|
|
542
|
-
(exists(path.join(ctx.dataDir, 'config.json')) ? `; your API key file ${path.join(ctx.dataDir, 'config.json')} is kept ("genesis
|
|
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
|
|
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
|
|
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
|
|
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,7 +584,7 @@ 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
|
|
587
|
+
`Genesis Compiler API key: ${settings.apiKey ? `set (from ${settings.keySource})` : `not set (${API_KEY_ENV}, or "genesis config set-key"; create one at ${portalKeysUrl(settings.apiBase)})`}; ` +
|
|
588
588
|
'its value is never printed',
|
|
589
589
|
);
|
|
590
590
|
say(`Genesis Compiler API base: ${settings.apiBase} (${settings.baseSource})`);
|
|
@@ -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
|
|
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
|
|
635
|
+
say('run "genesis install" (or "genesis update") to repair');
|
|
636
636
|
return 1;
|
|
637
637
|
}
|
|
638
638
|
return 0;
|
package/lib/mcp-config.mjs
CHANGED
|
@@ -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
|
|
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
|
|
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
|
@@ -158,7 +158,7 @@ export function missingKeyMessage(configFile, apiBase) {
|
|
|
158
158
|
return (
|
|
159
159
|
`No Genesis API key is set. The user creates one on the Genesis portal (${portalKeysUrl(apiBase)}; ` +
|
|
160
160
|
'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
|
|
161
|
+
`(export ${API_KEY_ENV}=<your key>), or store it once with "genesis config set-key" ` +
|
|
162
162
|
`(it reads the key from stdin and writes ${configFile}, readable only by you). ` +
|
|
163
163
|
'Never put the key in the project folder, the blueprint, a commit or the chat. ' +
|
|
164
164
|
'The config file is read on every call; a new environment variable needs an agent restart.'
|
package/mcp/key-page-html.mjs
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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"
|
package/mcp/key-tools.mjs
CHANGED
|
@@ -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
|
|
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
|
|
8
|
-
// it with each installed agent; `genesis
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.2.0",
|
|
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.
|
|
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 `
|
|
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
|
|
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
|
|
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.
|