@atolis-hq/corum 0.1.0 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +188 -223
- package/dist/src/bin/corum.js +40 -39
- package/package.json +40 -36
- package/web/app.jsx +668 -668
- package/web/index.html +41 -41
- package/web/nav.js +141 -141
- package/web/primitives.jsx +583 -583
- package/web/router.js +49 -49
- package/web/style.css +827 -827
- package/dist/src/cli.js +0 -20
- package/dist/src/openapi-to-api-endpoints.js +0 -240
package/README.md
CHANGED
|
@@ -1,223 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
npm
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
## MCP Smoke Test
|
|
190
|
-
|
|
191
|
-
Run a local MCP client against the configured server and print graph data:
|
|
192
|
-
|
|
193
|
-
```powershell
|
|
194
|
-
npm run mcp:smoke
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
The smoke test starts the MCP server over stdio and calls:
|
|
198
|
-
|
|
199
|
-
- `list_nodes`
|
|
200
|
-
- `list_nodes` filtered to `APIEndpoint`
|
|
201
|
-
- `get_cluster` for `orders.DomainModel.order`
|
|
202
|
-
- `get_linked_fields` for `orders.DomainModel.order`
|
|
203
|
-
|
|
204
|
-
## Useful Development Commands
|
|
205
|
-
|
|
206
|
-
Type-check without emitting files:
|
|
207
|
-
|
|
208
|
-
```powershell
|
|
209
|
-
npx tsc --noEmit
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Run one compiled test file after building:
|
|
213
|
-
|
|
214
|
-
```powershell
|
|
215
|
-
npm run build
|
|
216
|
-
node --test dist/test/loader.test.js
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Clean generated build output manually if needed:
|
|
220
|
-
|
|
221
|
-
```powershell
|
|
222
|
-
Remove-Item -Recurse -Force dist
|
|
223
|
-
```
|
|
1
|
+
# Corum
|
|
2
|
+
|
|
3
|
+
Corum is a Git-native design graph for service architecture. It models components (APIs, domain models, schemas, fields) as nodes with typed edges, and exposes the graph through MCP tools so AI assistants can reason about your architecture.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @atolis-hq/corum
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run without installing:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @atolis-hq/corum <command>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Windows:** If you see an "execution policy" error in PowerShell, run this once:
|
|
18
|
+
|
|
19
|
+
```powershell
|
|
20
|
+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This is a standard one-time setup step for Node.js development on Windows. Alternatively, `npx @atolis-hq/corum <command>` works without any setup on all platforms.
|
|
24
|
+
|
|
25
|
+
## Update
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm update -g @atolis-hq/corum
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
Scaffold a config file in your project:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
corum init
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This creates `.corum/config.yaml` with commented defaults. Edit it to point at your graph directory or git repository, then start the MCP server:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
corum mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
### `corum mcp`
|
|
48
|
+
|
|
49
|
+
Start the MCP stdio server. Also starts a web UI by default.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
corum mcp [options]
|
|
53
|
+
|
|
54
|
+
Options:
|
|
55
|
+
--no-web Suppress the web UI
|
|
56
|
+
--watch Reload graph on file changes
|
|
57
|
+
--graph <path> Override the graph directory
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `corum web`
|
|
61
|
+
|
|
62
|
+
Start the web UI only.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
corum web [options]
|
|
66
|
+
|
|
67
|
+
Options:
|
|
68
|
+
--port <n> Port to listen on (default: 3000)
|
|
69
|
+
--graph <path> Override the graph directory
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### `corum init`
|
|
73
|
+
|
|
74
|
+
Scaffold `.corum/config.yaml` with commented defaults. Does not overwrite an existing file.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
corum init
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `corum import`
|
|
81
|
+
|
|
82
|
+
Import specifications into the graph.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
corum import --config <path> Import using a config YAML file
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### `corum import openapi <spec>`
|
|
89
|
+
|
|
90
|
+
Import an OpenAPI spec directly.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
corum import openapi <spec> [options]
|
|
94
|
+
|
|
95
|
+
Options:
|
|
96
|
+
--component-strategy <strategy> Component mapping: uri-segment (default), tag, hardcoded
|
|
97
|
+
--segment <n> URI segment index (uri-segment strategy)
|
|
98
|
+
--pattern <regex> Regex pattern (uri-segment strategy)
|
|
99
|
+
--component <name> Component name (hardcoded strategy)
|
|
100
|
+
--graph <path> Override the graph directory
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Configuration
|
|
104
|
+
|
|
105
|
+
Run `corum init` to generate a `.corum/config.yaml` with all available options. Corum walks up from the current directory to find it, so you can place it at your project root.
|
|
106
|
+
|
|
107
|
+
**Precedence (highest to lowest):** CLI flags → environment variables → `.corum/config.yaml`
|
|
108
|
+
|
|
109
|
+
| Config key | Environment variable | Description |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| `source` | `CORUM_SOURCE` | `file` (default) or `git` |
|
|
112
|
+
| `graph` | `CORUM_GRAPH_PATH` | Path to the graph directory |
|
|
113
|
+
| `git_local_path` | `CORUM_GIT_LOCAL_PATH` | Local git repo path |
|
|
114
|
+
| `git_remote_url` | `CORUM_GIT_REMOTE_URL` | Remote git repo URL |
|
|
115
|
+
| `git_branch` | `CORUM_GIT_BRANCH` | Branch to load |
|
|
116
|
+
| `git_poll_seconds` | `CORUM_GIT_POLL_SECONDS` | Polling interval for remote git |
|
|
117
|
+
| `git_token` | `CORUM_GIT_TOKEN` | Auth token for private repos |
|
|
118
|
+
| `git_username` | `CORUM_GIT_USERNAME` | Auth username (default: `x-access-token`) |
|
|
119
|
+
|
|
120
|
+
### File source (default)
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
# .corum/config.yaml
|
|
124
|
+
source: file
|
|
125
|
+
graph: .corum/graph
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Git source
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
# .corum/config.yaml
|
|
132
|
+
source: git
|
|
133
|
+
git_remote_url: https://github.com/org/design-repo
|
|
134
|
+
git_branch: main
|
|
135
|
+
git_poll_seconds: 30
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
For private repositories, set `CORUM_GIT_TOKEN` as an environment variable rather than storing it in the config file.
|
|
139
|
+
|
|
140
|
+
## MCP Client Configuration
|
|
141
|
+
|
|
142
|
+
Configure your MCP client to run Corum. For Claude Code or Claude Desktop:
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"mcpServers": {
|
|
147
|
+
"corum": {
|
|
148
|
+
"command": "npx",
|
|
149
|
+
"args": ["@atolis-hq/corum", "mcp", "--no-web"],
|
|
150
|
+
"env": {
|
|
151
|
+
"CORUM_GRAPH_PATH": "/path/to/your/graph"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Or if installed globally:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"mcpServers": {
|
|
163
|
+
"corum": {
|
|
164
|
+
"command": "corum",
|
|
165
|
+
"args": ["mcp", "--no-web"],
|
|
166
|
+
"env": {
|
|
167
|
+
"CORUM_GRAPH_PATH": "/path/to/your/graph"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## MCP Tools
|
|
175
|
+
|
|
176
|
+
| Tool | Description |
|
|
177
|
+
|---|---|
|
|
178
|
+
| `list_nodes` | List graph nodes, optionally filtered by `template`, `component`, `state`, or `stability` |
|
|
179
|
+
| `list_templates` | List loaded templates with summary metadata |
|
|
180
|
+
| `get_template` | Return full details for a template |
|
|
181
|
+
| `get_cluster` | Return a root node, its owned children, and internal edges |
|
|
182
|
+
| `get_linked_fields` | Return `maps-to` edges touching fields owned by a root node |
|
|
183
|
+
|
|
184
|
+
All tools accept an optional `format` argument: `yaml` (default), `json`, or `toon`. All tools also accept `compact_keys: true` to shorten common keys before serialization, reducing token usage.
|
|
185
|
+
|
|
186
|
+
## Contributing
|
|
187
|
+
|
|
188
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for build, test, and local development instructions.
|
package/dist/src/bin/corum.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { Command } from 'commander';
|
|
2
3
|
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
3
4
|
import path from 'node:path';
|
|
@@ -49,45 +50,45 @@ program
|
|
|
49
50
|
});
|
|
50
51
|
});
|
|
51
52
|
// ── init ─────────────────────────────────────────────────────────────────────
|
|
52
|
-
const CONFIG_TEMPLATE = `# Corum project configuration
|
|
53
|
-
# Uncomment and set the options relevant to your setup.
|
|
54
|
-
# All values can be overridden by environment variables (CORUM_*) or CLI flags.
|
|
55
|
-
|
|
56
|
-
# Source type: 'file' (default) or 'git'
|
|
57
|
-
# Maps to: CORUM_SOURCE
|
|
58
|
-
# source: file
|
|
59
|
-
|
|
60
|
-
# ── File source (default) ─────────────────────────────────────────────────────
|
|
61
|
-
# Local path to the graph directory.
|
|
62
|
-
# Maps to: CORUM_GRAPH_PATH
|
|
63
|
-
# graph: .corum/graph
|
|
64
|
-
|
|
65
|
-
# ── Git source ────────────────────────────────────────────────────────────────
|
|
66
|
-
# Uncomment 'source: git' above and configure one of the following:
|
|
67
|
-
|
|
68
|
-
# Local path to a git repository containing the graph.
|
|
69
|
-
# Maps to: CORUM_GIT_LOCAL_PATH
|
|
70
|
-
# git_local_path: /path/to/repo
|
|
71
|
-
|
|
72
|
-
# Remote URL of a git repository containing the graph.
|
|
73
|
-
# Maps to: CORUM_GIT_REMOTE_URL
|
|
74
|
-
# git_remote_url: https://github.com/org/repo
|
|
75
|
-
|
|
76
|
-
# Default branch to load (git source only).
|
|
77
|
-
# Maps to: CORUM_GIT_BRANCH
|
|
78
|
-
# git_branch: main
|
|
79
|
-
|
|
80
|
-
# How often to poll the remote for changes, in seconds (remote git only).
|
|
81
|
-
# Maps to: CORUM_GIT_POLL_SECONDS
|
|
82
|
-
# git_poll_seconds: 30
|
|
83
|
-
|
|
84
|
-
# Auth token for private repositories. Prefer setting CORUM_GIT_TOKEN as an
|
|
85
|
-
# environment variable rather than storing a token in this file.
|
|
86
|
-
# git_token: ""
|
|
87
|
-
|
|
88
|
-
# Auth username (default: x-access-token, suits GitHub PATs and Actions tokens).
|
|
89
|
-
# Maps to: CORUM_GIT_USERNAME
|
|
90
|
-
# git_username: x-access-token
|
|
53
|
+
const CONFIG_TEMPLATE = `# Corum project configuration
|
|
54
|
+
# Uncomment and set the options relevant to your setup.
|
|
55
|
+
# All values can be overridden by environment variables (CORUM_*) or CLI flags.
|
|
56
|
+
|
|
57
|
+
# Source type: 'file' (default) or 'git'
|
|
58
|
+
# Maps to: CORUM_SOURCE
|
|
59
|
+
# source: file
|
|
60
|
+
|
|
61
|
+
# ── File source (default) ─────────────────────────────────────────────────────
|
|
62
|
+
# Local path to the graph directory.
|
|
63
|
+
# Maps to: CORUM_GRAPH_PATH
|
|
64
|
+
# graph: .corum/graph
|
|
65
|
+
|
|
66
|
+
# ── Git source ────────────────────────────────────────────────────────────────
|
|
67
|
+
# Uncomment 'source: git' above and configure one of the following:
|
|
68
|
+
|
|
69
|
+
# Local path to a git repository containing the graph.
|
|
70
|
+
# Maps to: CORUM_GIT_LOCAL_PATH
|
|
71
|
+
# git_local_path: /path/to/repo
|
|
72
|
+
|
|
73
|
+
# Remote URL of a git repository containing the graph.
|
|
74
|
+
# Maps to: CORUM_GIT_REMOTE_URL
|
|
75
|
+
# git_remote_url: https://github.com/org/repo
|
|
76
|
+
|
|
77
|
+
# Default branch to load (git source only).
|
|
78
|
+
# Maps to: CORUM_GIT_BRANCH
|
|
79
|
+
# git_branch: main
|
|
80
|
+
|
|
81
|
+
# How often to poll the remote for changes, in seconds (remote git only).
|
|
82
|
+
# Maps to: CORUM_GIT_POLL_SECONDS
|
|
83
|
+
# git_poll_seconds: 30
|
|
84
|
+
|
|
85
|
+
# Auth token for private repositories. Prefer setting CORUM_GIT_TOKEN as an
|
|
86
|
+
# environment variable rather than storing a token in this file.
|
|
87
|
+
# git_token: ""
|
|
88
|
+
|
|
89
|
+
# Auth username (default: x-access-token, suits GitHub PATs and Actions tokens).
|
|
90
|
+
# Maps to: CORUM_GIT_USERNAME
|
|
91
|
+
# git_username: x-access-token
|
|
91
92
|
`;
|
|
92
93
|
program
|
|
93
94
|
.command('init')
|
package/package.json
CHANGED
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atolis-hq/corum",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@atolis-hq/corum",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/atolis-hq/corum"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist/src/",
|
|
11
|
+
"web/"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"corum": "dist/src/bin/corum.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"test": "tsc && node scripts/run-tests.mjs",
|
|
19
|
+
"wireframes": "node design/wireframes/server.mjs",
|
|
20
|
+
"mcp": "node dist/src/mcp/index.js",
|
|
21
|
+
"mcp:smoke": "npm run build && node scripts/mcp-smoke.mjs",
|
|
22
|
+
"web": "node dist/src/web/server.js"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@apidevtools/swagger-parser": "^12.1.0",
|
|
26
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
27
|
+
"@toon-format/toon": "^2.1.0",
|
|
28
|
+
"commander": "^14.0.3",
|
|
29
|
+
"express": "^4.22.1",
|
|
30
|
+
"isomorphic-git": "^1.37.6",
|
|
31
|
+
"openapi-types": "^12.1.3",
|
|
32
|
+
"yaml": "^2.3.4"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/express": "^4.17.25",
|
|
36
|
+
"@types/node": "^24.0.0",
|
|
37
|
+
"@types/swagger-parser": "^4.0.3",
|
|
38
|
+
"typescript": "^5.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|