@mindbricks/genesis-set 0.0.0-stage → 0.1.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 +34 -0
- package/LICENSE +202 -0
- package/README.md +147 -2
- package/bin/genesis-set.mjs +153 -0
- package/corpus/README.md +25 -0
- package/corpus/genesis/compile-results.md +246 -0
- package/corpus/genesis/compiler-api.md +265 -0
- package/corpus/genesis/custom-code.md +519 -0
- package/corpus/genesis/deploy.md +190 -0
- package/corpus/genesis/pitfalls.md +231 -0
- package/corpus/genesis/procedures/README.md +17 -0
- package/corpus/genesis/procedures/agent-hub-blueprint.md +13 -0
- package/corpus/genesis/procedures/auth-blueprint.md +14 -0
- package/corpus/genesis/procedures/bff-blueprint.md +16 -0
- package/corpus/genesis/procedures/blueprint-authoring.md +16 -0
- package/corpus/genesis/procedures/howto-mail-to-tasks.md +26 -0
- package/corpus/genesis/procedures/howto-payment-flow.md +112 -0
- package/corpus/genesis/procedures/howto-subscription.md +33 -0
- package/corpus/genesis/procedures/notifications-blueprint.md +13 -0
- package/corpus/genesis/procedures/patterns-catalog.md +12 -0
- package/corpus/genesis/procedures/project-lifecycle.md +27 -0
- package/corpus/genesis/run-locally.md +310 -0
- package/corpus/genesis/testing.md +532 -0
- package/lib/config-cli.mjs +179 -0
- package/lib/install.mjs +639 -0
- package/lib/mcp-config.mjs +220 -0
- package/lib/semver.mjs +94 -0
- package/mcp/blueprint.mjs +64 -0
- package/mcp/client.mjs +141 -0
- package/mcp/config.mjs +166 -0
- package/mcp/key-page-html.mjs +275 -0
- package/mcp/key-page.mjs +217 -0
- package/mcp/key-store.mjs +204 -0
- package/mcp/key-tools.mjs +225 -0
- package/mcp/server.mjs +164 -0
- package/mcp/tools.mjs +270 -0
- package/package.json +43 -4
- package/skills/genesis-compiler-api/SKILL.md +56 -0
- package/skills/genesis-deploy/SKILL.md +36 -0
- package/skills/genesis-generated-code/SKILL.md +48 -0
- package/skills/genesis-run-and-test/SKILL.md +43 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The package follows semantic versioning. Each release names the mind-set range it needs
|
|
4
|
+
(`dependencies["@mindbricks/mind-set"]` in `package.json`).
|
|
5
|
+
|
|
6
|
+
## 0.1.0 (pre-release)
|
|
7
|
+
|
|
8
|
+
First version, published with the Genesis Compiler API open for dry-run builds.
|
|
9
|
+
|
|
10
|
+
- Published as `@mindbricks/genesis-set` (the command is `genesis-set`), like
|
|
11
|
+
`@mindbricks/mind-set`.
|
|
12
|
+
- `genesis-set install | update | uninstall | doctor` for Claude Code (`~/.claude/skills`)
|
|
13
|
+
and Codex (`~/.agents/skills`); installs or updates mind-set `^0.1.0` when needed and never
|
|
14
|
+
replaces a mind-set skill.
|
|
15
|
+
- A local MCP server (no dependencies) with the tools `genesis_validateApplication`,
|
|
16
|
+
`genesis_validateService`, `genesis_buildService`, `genesis_getBuilds` and
|
|
17
|
+
`genesis_getServiceBuild`; `install` registers it for Claude Code (`~/.claude.json`) and
|
|
18
|
+
Codex (`~/.codex/config.toml`). It reads the blueprint from the local file and sends it
|
|
19
|
+
inline, checks the size first, and authenticates with `GENESIS_API_KEY` or the home config
|
|
20
|
+
file (`genesis-set config set-key`).
|
|
21
|
+
- Keys without the chat: the MCP server serves a local key page (127.0.0.1, token link, closes
|
|
22
|
+
when idle). Four more tools (`genesis_requestKey`, `genesis_listKeys`, `genesis_openKeyManager`,
|
|
23
|
+
`genesis_writeKeyToEnvFile`) register a key, hand the user the page link, report set / empty,
|
|
24
|
+
and copy a stored key into a gitignored env file. The agent never sees a value.
|
|
25
|
+
- `genesis-set install` ends with a key step that names the portal's API keys page and, on a
|
|
26
|
+
terminal, reads the Genesis API key hidden; the missing-key message and `doctor` name the page.
|
|
27
|
+
- Four skills: `genesis-compiler-api` (the five tools), `genesis-generated-code` (procedure
|
|
28
|
+
additions, custom code, runtime pitfalls), `genesis-run-and-test` and `genesis-deploy`.
|
|
29
|
+
- The corpus pages `compile-results`, `custom-code`, `run-locally`, `testing`, `deploy` and
|
|
30
|
+
`pitfalls` (#9168): the shared compiler knowledge genesis-set needs, written in genesis-set's own
|
|
31
|
+
sources (the platform side stays as it is).
|
|
32
|
+
- The corpus: the Compiler API guide and the Genesis additions to the mind-set procedures
|
|
33
|
+
(payment and subscription runtime ladders, webhook and plan provisioning, the mailbox
|
|
34
|
+
runtime check, per-language support, compile steps).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# genesis-set
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **PRE-RELEASE.** The Genesis Compiler API is open at `https://api.genesiscompiler.com`.
|
|
4
|
+
> Builds are dry runs for now: the code is generated and measured, nothing is pushed yet.
|
|
5
|
+
|
|
6
|
+
Skills that teach a coding agent (Claude Code, Codex) to use the **Genesis compiler** on an
|
|
7
|
+
OpenAPPL blueprint: what the generated services do at run time, the Genesis steps next to the
|
|
8
|
+
blueprint procedures, and the Genesis Compiler API (validate, build, follow a build). A local
|
|
9
|
+
MCP server gives the agent the Compiler API as five `genesis_*` tools, plus four tools and a
|
|
10
|
+
local page for the keys the agent needs.
|
|
11
|
+
|
|
12
|
+
genesis-set sits on [mind-set](https://github.com/Mindbricks/mind-set), the OpenAPPL layer.
|
|
13
|
+
mind-set teaches designing and writing the blueprint; genesis-set adds what is specific to
|
|
14
|
+
the Genesis compiler and never repeats a mind-set document. Installing genesis-set installs
|
|
15
|
+
mind-set when it is missing. Node 18 or newer.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @mindbricks/genesis-set
|
|
19
|
+
genesis-set install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The npm package is `@mindbricks/genesis-set`; the command is `genesis-set`. It depends on
|
|
23
|
+
`@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
|
+
|
|
26
|
+
## Commands
|
|
27
|
+
|
|
28
|
+
| Command | What it does |
|
|
29
|
+
|---|---|
|
|
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). |
|
|
37
|
+
|
|
38
|
+
### The MCP server
|
|
39
|
+
|
|
40
|
+
`install` copies the server to `~/.genesis-set/mcp/` and registers it at user scope as the MCP
|
|
41
|
+
server `genesis`: in `~/.claude.json` (`mcpServers.genesis`) for Claude Code and as a marked
|
|
42
|
+
block in `~/.codex/config.toml` (`[mcp_servers.genesis]`, `CODEX_HOME` moves it) for Codex. An
|
|
43
|
+
existing `genesis` entry that genesis-set did not write is left alone (Claude Code: `--force`
|
|
44
|
+
replaces it after a backup). Restart the agent after the install. The server has no
|
|
45
|
+
dependencies besides Node 18.
|
|
46
|
+
|
|
47
|
+
| Tool | Endpoint (below `{apiBase}/genesis/compiler/v1`) |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `genesis_validateApplication` | `POST /validate` |
|
|
50
|
+
| `genesis_validateService` | `POST /validate/service` |
|
|
51
|
+
| `genesis_buildService` | `POST /builds` with one service |
|
|
52
|
+
| `genesis_getBuilds` | `GET /builds` |
|
|
53
|
+
| `genesis_getServiceBuild` | `GET /jobs/:jobId` |
|
|
54
|
+
|
|
55
|
+
A blueprint path is read on your machine, checked against the size limit (10 MiB of compact
|
|
56
|
+
JSON; `GENESIS_MAX_BLUEPRINT_BYTES` when your API says otherwise) and sent inline; the path
|
|
57
|
+
itself is never sent. A repository source (`repo`) is passed through as it is. Every failure
|
|
58
|
+
comes back in the Genesis error shape `{ "error": { "code", "message", "details" } }`.
|
|
59
|
+
|
|
60
|
+
### Keys: the local key page
|
|
61
|
+
|
|
62
|
+
A coding agent keeps needing secrets: the Genesis API key, and provider keys (payment, mail,
|
|
63
|
+
storage, AI) to run the generated services. The rule is that no value is ever typed into the chat.
|
|
64
|
+
Instead the MCP server serves a local key page, and four tools that never call the API and work
|
|
65
|
+
without a Genesis API key:
|
|
66
|
+
|
|
67
|
+
| Tool | What it does |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `genesis_requestKey` | Registers a key by name (`stripe-secret-key`) with a readable label and a description, empty, and answers the page link. An existing key keeps its value. |
|
|
70
|
+
| `genesis_listKeys` | Every key with its label, description and status (`set` / `empty`); never a value. |
|
|
71
|
+
| `genesis_openKeyManager` | The page link, to add, change, clear or delete keys. |
|
|
72
|
+
| `genesis_writeKeyToEnvFile` | Copies a stored key into a service's env file as `VARIABLE=value`, without the value passing through the agent. |
|
|
73
|
+
|
|
74
|
+
- **The agent's flow:**
|
|
75
|
+
1. `genesis_requestKey`.
|
|
76
|
+
2. "Open this link and save the key there".
|
|
77
|
+
3. `genesis_listKeys` until the key is `set`.
|
|
78
|
+
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
|
+
port and the link change every time, so there is nothing to remember or bookmark. Asking the
|
|
81
|
+
agent ("open my keys") works too: it calls `genesis_openKeyManager`.
|
|
82
|
+
- **Where the keys live:** in `~/.genesis-set/config.json` (mode 0600).
|
|
83
|
+
- The Genesis API key is the built-in key `genesis-api-key`, the same value `config set-key` stores.
|
|
84
|
+
- 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
|
+
value is sent once, when the user saves it. The field the user types into is hidden, with a
|
|
87
|
+
Show / Hide toggle; the stored value is never shown again.
|
|
88
|
+
- **Env files:** `genesis_writeKeyToEnvFile` accepts only a file named `.env`, `.env.local` or
|
|
89
|
+
`*.secrets.env`. Inside a git repository the file must be one git ignores and does not track.
|
|
90
|
+
- **Security:**
|
|
91
|
+
- The page listens on `127.0.0.1` on a random port, behind a random token in its link.
|
|
92
|
+
- It answers only to its own `Host`, takes writes only from its own `Origin` and only as JSON.
|
|
93
|
+
- It sends `no-store`, `no-referrer` and a nonce Content-Security-Policy.
|
|
94
|
+
- It closes after 15 idle minutes and when the agent session ends. The next key tool call
|
|
95
|
+
gives a new link.
|
|
96
|
+
- **Where it does not work:** on a platform without a local disk and browser (a hosted builder).
|
|
97
|
+
|
|
98
|
+
### mind-set
|
|
99
|
+
|
|
100
|
+
- The mind-set range is `dependencies["@mindbricks/mind-set"]` in `package.json`. `install` installs the
|
|
101
|
+
bundled mind-set when none is installed, updates an older one, and stops with an error
|
|
102
|
+
when the installed mind-set is outside the range and cannot be updated (it never
|
|
103
|
+
downgrades someone's mind-set).
|
|
104
|
+
- genesis-set skills are all named `genesis-*`. A skill folder that carries mind-set's marker
|
|
105
|
+
is never replaced, not even with `--force`; a folder of another owner is replaced only with
|
|
106
|
+
`--force` (it is backed up to `~/.genesis-set/backup/` first).
|
|
107
|
+
- In a skill's Markdown, `{{CORPUS}}` becomes the genesis-set corpus and `{{MIND_SET}}` the
|
|
108
|
+
mind-set corpus (`~/.mind-set/current`).
|
|
109
|
+
|
|
110
|
+
### Projects and credentials
|
|
111
|
+
|
|
112
|
+
- The project's identity is the blueprint's (`projectSettings.basicSettings.name`); there is
|
|
113
|
+
no binding file, and genesis-set writes nothing into a project folder.
|
|
114
|
+
- **Getting the key:** the user signs in to the Genesis portal and creates one on its API keys
|
|
115
|
+
page, `https://portal.genesiscompiler.com/keys` (the stage API `sapi.genesiscompiler.com`
|
|
116
|
+
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.
|
|
118
|
+
- On a terminal it reads the key with hidden input and stores it as `set-key` does; Enter
|
|
119
|
+
skips.
|
|
120
|
+
- Without a terminal (an agent runs the install) it only prints the page and the command, and
|
|
121
|
+
never waits.
|
|
122
|
+
- `--no-key` skips the step.
|
|
123
|
+
- 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,
|
|
125
|
+
the blueprint or a commit. The environment variable wins. The MCP server never reads the
|
|
126
|
+
folder it runs in for a key or a setting.
|
|
127
|
+
- 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
|
|
129
|
+
loopback address.
|
|
130
|
+
|
|
131
|
+
### Environment
|
|
132
|
+
|
|
133
|
+
- `HOME`: where the agents' folders are looked up.
|
|
134
|
+
- `GENESIS_SET_HOME` moves `~/.genesis-set`; `MIND_SET_HOME` moves `~/.mind-set`;
|
|
135
|
+
`CODEX_HOME` moves `~/.codex`.
|
|
136
|
+
- `GENESIS_API_KEY`, `GENESIS_API_BASE`, `GENESIS_MAX_BLUEPRINT_BYTES`, `GENESIS_TIMEOUT_MS`
|
|
137
|
+
(default 120000): read by the MCP server on every call.
|
|
138
|
+
|
|
139
|
+
## Development
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npm test
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
runs the `node:test` suites in `test/` against a throwaway package, a fake mind-set package
|
|
146
|
+
and a fake `HOME`; the MCP suites run the server against a local stub of the Compiler API. In a built package (one with a `corpus/` folder) it also packs the package
|
|
147
|
+
with `npm pack`, installs the tarball next to a mind-set tarball into a throwaway project,
|
|
148
|
+
and runs `install`, `doctor` and `uninstall` from there.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// genesis-set: install the Genesis compiler skills for coding agents, on top of
|
|
3
|
+
// mind-set (the OpenAPPL skills). No runtime dependency besides mind-set, Node >= 18.
|
|
4
|
+
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { configCommand, offerApiKey } from '../lib/config-cli.mjs';
|
|
9
|
+
import { chooseAgents, doctor, install, resolveContext, uninstall, update } from '../lib/install.mjs';
|
|
10
|
+
|
|
11
|
+
const pkgRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8'));
|
|
13
|
+
|
|
14
|
+
const out = (line) => process.stdout.write(`${line}\n`);
|
|
15
|
+
const err = (line) => process.stderr.write(`${line}\n`);
|
|
16
|
+
|
|
17
|
+
const HELP = `genesis-set ${pkg.version}: Genesis compiler skills for coding agents (PRE-RELEASE)
|
|
18
|
+
|
|
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
|
|
28
|
+
|
|
29
|
+
install makes sure mind-set ${pkg.dependencies?.['@mindbricks/mind-set'] ?? ''} is installed (installs the
|
|
30
|
+
mind-set that comes with this package when it is missing or older),
|
|
31
|
+
copies the genesis-set corpus to ~/.genesis-set/<version>/ (linked as
|
|
32
|
+
~/.genesis-set/current) and writes the genesis-* skills to every
|
|
33
|
+
detected agent: Claude Code (~/.claude/skills) and Codex
|
|
34
|
+
(~/.agents/skills). --claude / --codex pick the agents. A mind-set
|
|
35
|
+
skill folder is never replaced; another foreign folder only with
|
|
36
|
+
--force (backed up first). It also copies the genesis-set MCP server
|
|
37
|
+
(the genesis_* tools) to ~/.genesis-set/mcp/ and registers it as the
|
|
38
|
+
MCP server "genesis" at user scope: ~/.claude.json for Claude Code,
|
|
39
|
+
~/.codex/config.toml for Codex (--no-mcp skips that). Last, the
|
|
40
|
+
API key: with none set, it names the portal page that creates one
|
|
41
|
+
and, on a terminal, reads it hidden (Enter skips; --no-key skips
|
|
42
|
+
the step). Nothing is written into a project folder.
|
|
43
|
+
update install for this version (and every agent installed before), then
|
|
44
|
+
delete older genesis-set corpus versions.
|
|
45
|
+
uninstall removes only what install recorded in ~/.genesis-set/installed.json;
|
|
46
|
+
mind-set stays.
|
|
47
|
+
doctor both versions (genesis-set and mind-set) and whether they are
|
|
48
|
+
compatible, the skills and the MCP server per agent, where the API
|
|
49
|
+
key comes from (never its value) and the API base.
|
|
50
|
+
keys opens the local key page in your browser (the page the agent
|
|
51
|
+
links to): add, change, clear or delete the keys your agent uses.
|
|
52
|
+
The link is new every time; the page closes after 15 idle minutes
|
|
53
|
+
or on Ctrl+C. --no-open only prints the link.
|
|
54
|
+
config the Genesis API key and API base in ~/.genesis-set/config.json
|
|
55
|
+
(mode 0600). set-key reads the key from stdin, never from the
|
|
56
|
+
command line. GENESIS_API_KEY / GENESIS_API_BASE win over the file.
|
|
57
|
+
mcp runs the MCP server on stdio from this package (what the agents
|
|
58
|
+
start; for a manual registration).
|
|
59
|
+
|
|
60
|
+
The Genesis Compiler API builds are dry runs for now: the code is generated
|
|
61
|
+
and measured, nothing is pushed yet.
|
|
62
|
+
|
|
63
|
+
Environment: HOME is where the agents live; GENESIS_SET_HOME moves
|
|
64
|
+
~/.genesis-set; MIND_SET_HOME moves ~/.mind-set; CODEX_HOME moves ~/.codex;
|
|
65
|
+
GENESIS_API_KEY holds the Compiler API key and GENESIS_API_BASE the API base
|
|
66
|
+
(default https://api.genesiscompiler.com). Never put the key in a project.`;
|
|
67
|
+
|
|
68
|
+
function parseArgs(argv) {
|
|
69
|
+
const flags = {};
|
|
70
|
+
const positional = [];
|
|
71
|
+
for (const a of argv) {
|
|
72
|
+
if (a.startsWith('--')) {
|
|
73
|
+
const name = a.slice(2).replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
74
|
+
flags[name] = true;
|
|
75
|
+
} else if (a === '-h') flags.help = true;
|
|
76
|
+
else if (a === '-v') flags.version = true;
|
|
77
|
+
else positional.push(a);
|
|
78
|
+
}
|
|
79
|
+
return { flags, positional };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const KNOWN_FLAGS = {
|
|
83
|
+
install: ['claude', 'codex', 'force', 'noMcp', 'noKey', 'dryRun'],
|
|
84
|
+
update: ['claude', 'codex', 'force', 'noMcp', 'dryRun'],
|
|
85
|
+
uninstall: ['dryRun'],
|
|
86
|
+
doctor: [],
|
|
87
|
+
config: [],
|
|
88
|
+
keys: ['noOpen'],
|
|
89
|
+
mcp: [],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
async function main(argv) {
|
|
93
|
+
const { flags, positional } = parseArgs(argv);
|
|
94
|
+
if (flags.version) {
|
|
95
|
+
out(pkg.version);
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
const command = positional[0];
|
|
99
|
+
if (flags.help || !command || command === 'help') {
|
|
100
|
+
out(HELP);
|
|
101
|
+
return command || flags.help ? 0 : 2;
|
|
102
|
+
}
|
|
103
|
+
if (!KNOWN_FLAGS[command]) {
|
|
104
|
+
err(`error: unknown command "${command}" (see genesis-set --help)`);
|
|
105
|
+
return 2;
|
|
106
|
+
}
|
|
107
|
+
const unknown = Object.keys(flags).filter((f) => !KNOWN_FLAGS[command].includes(f));
|
|
108
|
+
if (unknown.length) {
|
|
109
|
+
err(`error: unknown option for ${command}: ${unknown.map((f) => `--${f}`).join(', ')}`);
|
|
110
|
+
return 2;
|
|
111
|
+
}
|
|
112
|
+
if (command === 'keys') {
|
|
113
|
+
const { ensureKeyPage, keyPageClosed, closeKeyPage } = await import('../mcp/key-page.mjs');
|
|
114
|
+
const { openInBrowser } = await import('../mcp/key-tools.mjs');
|
|
115
|
+
const link = await ensureKeyPage({ env: process.env });
|
|
116
|
+
out(`Genesis keys: ${link.url}`);
|
|
117
|
+
out(`This link works on this machine only. The page closes after ${link.expiresAfterIdleMinutes} idle minutes, or press Ctrl+C.`);
|
|
118
|
+
if (flags.noOpen !== true && !openInBrowser(link.url)) out('Could not open a browser: open the link yourself.');
|
|
119
|
+
process.once('SIGINT', () => closeKeyPage());
|
|
120
|
+
process.once('SIGTERM', () => closeKeyPage());
|
|
121
|
+
const keepAlive = setInterval(() => {}, 1 << 30);
|
|
122
|
+
await keyPageClosed();
|
|
123
|
+
clearInterval(keepAlive);
|
|
124
|
+
out('The key page is closed.');
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
if (command === 'mcp') {
|
|
128
|
+
const { serve } = await import('../mcp/server.mjs');
|
|
129
|
+
await serve();
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
const ctx = resolveContext({ pkgRoot, pkg, out, dryRun: flags.dryRun === true });
|
|
133
|
+
const opts = { force: flags.force === true, mcp: flags.noMcp !== true };
|
|
134
|
+
switch (command) {
|
|
135
|
+
case 'install': {
|
|
136
|
+
const code = install(ctx, chooseAgents(ctx, flags), opts);
|
|
137
|
+
if (flags.noKey !== true) await offerApiKey({ env: process.env, out, err, dryRun: ctx.dryRun });
|
|
138
|
+
return code;
|
|
139
|
+
}
|
|
140
|
+
case 'update':
|
|
141
|
+
return update(ctx, chooseAgents(ctx, flags, { includeManifest: true }), opts);
|
|
142
|
+
case 'config':
|
|
143
|
+
return configCommand(positional.slice(1), { env: process.env, out, err });
|
|
144
|
+
case 'uninstall':
|
|
145
|
+
return uninstall(ctx);
|
|
146
|
+
case 'doctor':
|
|
147
|
+
return doctor(ctx);
|
|
148
|
+
default:
|
|
149
|
+
return 2;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
process.exitCode = await main(process.argv.slice(2));
|
package/corpus/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# genesis-set corpus
|
|
2
|
+
|
|
3
|
+
The documents the genesis-set skills read. `genesis-set install` copies this folder to
|
|
4
|
+
`~/.genesis-set/<version>/` and links it as `~/.genesis-set/current`; every skill names its
|
|
5
|
+
files by their absolute path in that copy.
|
|
6
|
+
|
|
7
|
+
genesis-set sits on mind-set and adds to it; nothing here repeats a mind-set document. The
|
|
8
|
+
OpenAPPL corpus (procedures, specification, schema, examples) is mind-set's, at
|
|
9
|
+
`~/.mind-set/current/`. A path written `procedures/<name>.md` in these files is a mind-set
|
|
10
|
+
procedure.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
genesis/
|
|
14
|
+
compiler-api.md the Genesis Compiler API and its genesis_* tools
|
|
15
|
+
compile-results.md reading a service build: statuses, job fields, failure codes
|
|
16
|
+
custom-code.md extending the generated code: LIB, API, dbLayer, edge controllers
|
|
17
|
+
run-locally.md running and debugging the generated services on your machine
|
|
18
|
+
testing.md the API test suite, the test transport, the sample-data seed
|
|
19
|
+
deploy.md deploying with your own login: docker-compose, Railway, Fly.io, Render (Genesis never deploys)
|
|
20
|
+
pitfalls.md compiler facts that look like bugs
|
|
21
|
+
procedures/ Genesis additions to the mind-set procedures, one file per
|
|
22
|
+
README.md procedure that has Genesis-specific steps, and their index
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Do not edit the files here: a new `genesis-set update` replaces them.
|