@atolis-hq/corum 0.1.5 → 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 +114 -146
- package/dist/src/bin/corum.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,220 +1,188 @@
|
|
|
1
1
|
# Corum
|
|
2
2
|
|
|
3
|
-
Corum
|
|
4
|
-
|
|
5
|
-
## Requirements
|
|
6
|
-
|
|
7
|
-
- Node.js 20 or newer
|
|
8
|
-
- npm
|
|
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.
|
|
9
4
|
|
|
10
5
|
## Install
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
```powershell
|
|
15
|
-
npm install
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @atolis-hq/corum
|
|
16
9
|
```
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
Or run without installing:
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
```bash
|
|
14
|
+
npx @atolis-hq/corum <command>
|
|
15
|
+
```
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
**Windows:** If you see an "execution policy" error in PowerShell, run this once:
|
|
23
18
|
|
|
24
19
|
```powershell
|
|
25
|
-
|
|
20
|
+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
26
21
|
```
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Test
|
|
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.
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
## Update
|
|
33
26
|
|
|
34
|
-
```
|
|
35
|
-
npm
|
|
27
|
+
```bash
|
|
28
|
+
npm update -g @atolis-hq/corum
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
## Quick Start
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
- `test/loader.test.ts`
|
|
42
|
-
- `test/graph.test.ts`
|
|
43
|
-
- `test/mcp.test.ts`
|
|
44
|
-
- `test/writer.test.ts`
|
|
45
|
-
- `test/serializer.test.ts`
|
|
33
|
+
Scaffold a config file in your project:
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
```bash
|
|
36
|
+
corum init
|
|
37
|
+
```
|
|
50
38
|
|
|
51
|
-
|
|
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:
|
|
52
40
|
|
|
53
|
-
```
|
|
54
|
-
|
|
41
|
+
```bash
|
|
42
|
+
corum mcp
|
|
55
43
|
```
|
|
56
44
|
|
|
57
|
-
|
|
45
|
+
## Commands
|
|
58
46
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
### `corum mcp`
|
|
48
|
+
|
|
49
|
+
Start the MCP stdio server. Also starts a web UI by default.
|
|
62
50
|
|
|
63
|
-
|
|
51
|
+
```bash
|
|
52
|
+
corum mcp [options]
|
|
64
53
|
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
Options:
|
|
55
|
+
--no-web Suppress the web UI
|
|
56
|
+
--watch Reload graph on file changes
|
|
57
|
+
--graph <path> Override the graph directory
|
|
67
58
|
```
|
|
68
59
|
|
|
69
|
-
|
|
60
|
+
### `corum web`
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
$env:CORUM_GRAPH_PATH = "fixtures/sample-graph"
|
|
73
|
-
npm run mcp
|
|
74
|
-
```
|
|
62
|
+
Start the web UI only.
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
```bash
|
|
65
|
+
corum web [options]
|
|
77
66
|
|
|
78
|
-
|
|
79
|
-
|
|
67
|
+
Options:
|
|
68
|
+
--port <n> Port to listen on (default: 3000)
|
|
69
|
+
--graph <path> Override the graph directory
|
|
80
70
|
```
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
### `corum init`
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
$env:CORUM_FILE_WATCHER="true";
|
|
89
|
-
npm run web
|
|
74
|
+
Scaffold `.corum/config.yaml` with commented defaults. Does not overwrite an existing file.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
corum init
|
|
90
78
|
```
|
|
91
79
|
|
|
92
|
-
|
|
80
|
+
### `corum import`
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
Import specifications into the graph.
|
|
95
83
|
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
$env:CORUM_GIT_LOCAL_PATH = "C:\git\atolis-hq\corum-design-graph"
|
|
99
|
-
$env:CORUM_GIT_BRANCH = "main"
|
|
100
|
-
$env:CORUM_GIT_POLL_SECONDS = 10
|
|
101
|
-
$env:CORUM_WEB_PORT = 3001
|
|
102
|
-
npm run web
|
|
84
|
+
```bash
|
|
85
|
+
corum import --config <path> Import using a config YAML file
|
|
103
86
|
```
|
|
104
87
|
|
|
105
|
-
|
|
88
|
+
#### `corum import openapi <spec>`
|
|
106
89
|
|
|
107
|
-
|
|
108
|
-
$env:CORUM_SOURCE = "git"
|
|
109
|
-
$env:CORUM_GIT_REMOTE_URL = "https://github.com/org/design-repo.git"
|
|
110
|
-
$env:CORUM_GIT_BRANCH = "main"
|
|
111
|
-
$env:CORUM_GIT_POLL_SECONDS = 10
|
|
112
|
-
$env:CORUM_WEB_PORT = 3001
|
|
113
|
-
npm run web
|
|
114
|
-
```
|
|
90
|
+
Import an OpenAPI spec directly.
|
|
115
91
|
|
|
116
|
-
|
|
92
|
+
```bash
|
|
93
|
+
corum import openapi <spec> [options]
|
|
117
94
|
|
|
118
|
-
|
|
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
|
+
```
|
|
119
102
|
|
|
120
|
-
|
|
103
|
+
## Configuration
|
|
121
104
|
|
|
122
|
-
`
|
|
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.
|
|
123
106
|
|
|
124
|
-
|
|
107
|
+
**Precedence (highest to lowest):** CLI flags → environment variables → `.corum/config.yaml`
|
|
125
108
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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`) |
|
|
131
119
|
|
|
132
|
-
|
|
120
|
+
### File source (default)
|
|
133
121
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
```yaml
|
|
123
|
+
# .corum/config.yaml
|
|
124
|
+
source: file
|
|
125
|
+
graph: .corum/graph
|
|
126
|
+
```
|
|
137
127
|
|
|
138
|
-
|
|
128
|
+
### Git source
|
|
139
129
|
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
schemaVersion -> sv
|
|
147
|
-
lastModifiedAt -> lm
|
|
148
|
-
extractedFrom -> xf
|
|
149
|
-
properties -> p
|
|
150
|
-
root -> r
|
|
151
|
-
children -> ch
|
|
152
|
-
edges -> e
|
|
153
|
-
nodes -> n
|
|
154
|
-
from -> fr
|
|
155
|
-
to -> to
|
|
156
|
-
type -> ty
|
|
157
|
-
notes -> nt
|
|
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
|
|
158
136
|
```
|
|
159
137
|
|
|
138
|
+
For private repositories, set `CORUM_GIT_TOKEN` as an environment variable rather than storing it in the config file.
|
|
139
|
+
|
|
160
140
|
## MCP Client Configuration
|
|
161
141
|
|
|
162
|
-
|
|
142
|
+
Configure your MCP client to run Corum. For Claude Code or Claude Desktop:
|
|
163
143
|
|
|
164
144
|
```json
|
|
165
145
|
{
|
|
166
146
|
"mcpServers": {
|
|
167
147
|
"corum": {
|
|
168
|
-
"command": "
|
|
169
|
-
"args": ["
|
|
148
|
+
"command": "npx",
|
|
149
|
+
"args": ["@atolis-hq/corum", "mcp", "--no-web"],
|
|
170
150
|
"env": {
|
|
171
|
-
"CORUM_GRAPH_PATH": "
|
|
151
|
+
"CORUM_GRAPH_PATH": "/path/to/your/graph"
|
|
172
152
|
}
|
|
173
153
|
}
|
|
174
154
|
}
|
|
175
155
|
}
|
|
176
156
|
```
|
|
177
157
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```powershell
|
|
181
|
-
npm run build
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
The checked-in config points at `fixtures/sample-graph` so the tools return sample nodes immediately. Change `CORUM_GRAPH_PATH` to `.corum/graph` when you have graph component files there.
|
|
185
|
-
|
|
186
|
-
## MCP Smoke Test
|
|
158
|
+
Or if installed globally:
|
|
187
159
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
}
|
|
192
172
|
```
|
|
193
173
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
- `list_nodes`
|
|
197
|
-
- `list_nodes` filtered to `APIEndpoint`
|
|
198
|
-
- `get_cluster` for `orders.DomainModel.order`
|
|
199
|
-
- `get_linked_fields` for `orders.DomainModel.order`
|
|
200
|
-
|
|
201
|
-
## Useful Development Commands
|
|
202
|
-
|
|
203
|
-
Type-check without emitting files:
|
|
204
|
-
|
|
205
|
-
```powershell
|
|
206
|
-
npx tsc --noEmit
|
|
207
|
-
```
|
|
174
|
+
## MCP Tools
|
|
208
175
|
|
|
209
|
-
|
|
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 |
|
|
210
183
|
|
|
211
|
-
|
|
212
|
-
npm run build
|
|
213
|
-
node --test dist/test/loader.test.js
|
|
214
|
-
```
|
|
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.
|
|
215
185
|
|
|
216
|
-
|
|
186
|
+
## Contributing
|
|
217
187
|
|
|
218
|
-
|
|
219
|
-
Remove-Item -Recurse -Force dist
|
|
220
|
-
```
|
|
188
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for build, test, and local development instructions.
|
package/dist/src/bin/corum.js
CHANGED