@conarium-ai/core 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,77 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- Nothing yet — 0.1.0 is the current cut.
5
+ Nothing yet — 0.1.2 is the current cut.
6
+
7
+ ## 0.1.2 — 2026-08-13
8
+
9
+ Patch. `conarium-doctor` aborted instead of exiting when a connector was
10
+ unreachable.
11
+
12
+ ### Fixed
13
+
14
+ - **The documented exit contract (`0` clean / `1` problems / `2` could not run)
15
+ was not honoured on the network path.** The TCP probe resolved on the socket's
16
+ `error` event and the process then exited while the handle was still closing;
17
+ on Windows libuv asserted (`UV_HANDLE_CLOSING`) and the run ended with **127**
18
+ — a code this tool does not define, printed under an assertion trace. Anything
19
+ gating a deployment on the exit status could not read it. Reproduced 3/3 with
20
+ a refused connection; `--no-net` was never affected.
21
+
22
+ The probe now resolves after the socket has actually closed, and the tool sets
23
+ `process.exitCode` instead of calling `process.exit()`, so the loop drains on
24
+ its own. A regression test pins it: an unreachable connector must exit `1` and
25
+ the output must not contain an assertion.
26
+
27
+ ## 0.1.1 — 2026-08-13
28
+
29
+ Patch. The shipped MCP examples told you to run a command that cannot run.
30
+
31
+ ### Fixed
32
+
33
+ - **`examples/cursor-mcp-settings.json` and `examples/claude-desktop-config.json`
34
+ proposed `npx -y @conarium-ai/core`, which fails with `could not determine
35
+ executable to run`.** The package ships eight commands and none of them is
36
+ named `core`, so npx has nothing to pick. Anyone who pasted the example into
37
+ Cursor or Claude Desktop hit a wall on their first attempt — the worst possible
38
+ moment. The working form, measured rather than assumed:
39
+
40
+ ```json
41
+ { "command": "npx",
42
+ "args": ["-y", "--package=@conarium-ai/core", "conarium",
43
+ "--config", "/path/to/your/conarium.config.json"] }
44
+ ```
45
+
46
+ - The README MCP client block said `"command": "node", "args": ["dist/index.js"]`
47
+ — the from-source path, wrong for anyone who installed the package.
48
+
49
+ ### Changed
50
+
51
+ - README Quick Start leads with the npm install path now that the package is
52
+ published; the from-source route is kept, folded into a `<details>`.
6
53
 
7
54
  ## 0.1.0 — 2026-08-13
8
55
 
9
- First product cut. The npm package is **not published yet**; this describes
10
- what the git tree and `npm pack` tarball contain. Do not read "npx works"
11
- into this entry.
56
+ First product cut, published to npm as `@conarium-ai/core@0.1.0`.
57
+
58
+ ### Fixed before it shipped — `bin` entries were being stripped
59
+
60
+ The first publish attempt failed on 2FA, and the failure was lucky. Its output
61
+ carried this, once per command:
62
+
63
+ ```
64
+ npm warn publish "bin[conarium-doctor]" ... was invalid and removed
65
+ ```
66
+
67
+ npm was dropping **all eight** command entries, because the values began with
68
+ `./`. Published that way, `npx conarium-doctor` would not have existed — the
69
+ whole point of a one-download install. `npm pack` was never affected, so the
70
+ tarball looked correct the entire time; what npm rewrote was the metadata sent
71
+ to the registry. Fixed with npm's own `npm pkg fix` (`./bin/x.mjs` → `bin/x.mjs`)
72
+ and verified against the published package: eight bins present.
73
+
74
+ **Lesson worth keeping: a correct `npm pack` does not mean a correct
75
+ `npm publish`. Read the `warn` lines in `npm publish --dry-run`.**
12
76
 
13
77
  ### Added — install without us in the loop
14
78
 
package/README.md CHANGED
@@ -51,8 +51,10 @@ silinmediğini, yeniden sıralanmadığını ve geriye dönük tarihlenmediğini
51
51
  kanıtlar. **Oluşturma anında doğru olduğunu kanıtlamaz.**
52
52
 
53
53
  ```bash
54
- # Generate an Ed25519 keypair (private PEM + .pub.pem + .keyid sidecars)
55
- node -e "import('./dist/keys.js').then(k=>console.log(JSON.stringify(k.writeKeyPairFiles('audit-ed25519','cnr-2026-07'),null,2)))"
54
+ # Generate an Ed25519 keypair (private PEM + .pub.pem + .keyid sidecars).
55
+ # The .keyid sidecars are not optional: without them the verifier answers 13
56
+ # for every receipt, which reads like tampering and is not.
57
+ npx conarium-init
56
58
 
57
59
  export CONARIUM_AUDIT_SIGNING_KEY=./audit-ed25519.pem
58
60
 
@@ -274,28 +276,42 @@ graph LR
274
276
 
275
277
  ## 🚀 Quick Start
276
278
 
277
- Conarium runs from source today. `@conarium-ai/core` is **not on the npm
278
- registry yet** — do not expect `npx @conarium-ai/core` to work until it is
279
- published. The commands below are what works now.
280
-
281
279
  ```bash
282
- # 1. Clone & install
283
- git clone https://github.com/dogrucanemek-alt/conarium.git
284
- cd conarium
285
- npm install && npm run build
280
+ # 1. Install
281
+ npm i @conarium-ai/core
286
282
 
287
283
  # 2. Write a fail-closed skeleton (config + Ed25519 pair + .keyid sidecars)
288
- node bin/conarium-init.mjs
284
+ npx conarium-init
289
285
  export CONARIUM_AUDIT_SIGNING_KEY="$PWD/audit-ed25519.pem"
290
286
 
291
287
  # 3. Check the install before trusting it
292
- node bin/conarium-doctor.mjs --no-net
288
+ npx conarium-doctor
293
289
 
294
290
  # 4. Point the generated conarium.config.json at your read-only DSN,
295
291
  # fill policy.allowTables, then run the governed MCP gateway
292
+ npx conarium
293
+ ```
294
+
295
+ Step 3 is not decoration. A missing config file does **not** stop the gateway —
296
+ it starts with zero connectors and governs nothing — and a connector that fails
297
+ to connect is logged, not raised. `conarium-doctor` names both, exits `1` when
298
+ something is wrong so it can gate a deployment, and never prints a secret, so
299
+ its output is safe to paste into an issue.
300
+
301
+ <details>
302
+ <summary>From source instead</summary>
303
+
304
+ ```bash
305
+ git clone https://github.com/dogrucanemek-alt/conarium.git
306
+ cd conarium
307
+ npm install && npm run build
308
+ node bin/conarium-init.mjs
309
+ node bin/conarium-doctor.mjs --no-net
296
310
  npm start
297
311
  ```
298
312
 
313
+ </details>
314
+
299
315
  `conarium-init` refuses to overwrite existing files unless you pass `--force`.
300
316
  It never prints the private key — only its path.
301
317
 
@@ -323,7 +339,10 @@ Conarium speaks MCP over **stdio**, so your AI assistant launches it as a comman
323
339
  ```json
324
340
  {
325
341
  "mcpServers": {
326
- "conarium": { "command": "node", "args": ["dist/index.js"] }
342
+ "conarium": {
343
+ "command": "npx",
344
+ "args": ["-y", "--package=@conarium-ai/core", "conarium", "--config", "/path/to/your/conarium.config.json"]
345
+ }
327
346
  }
328
347
  }
329
348
  ```
@@ -86,11 +86,19 @@ function tcpProbe(host, port, timeoutMs = 4000) {
86
86
  return new Promise((done) => {
87
87
  const sock = new net.Socket()
88
88
  let settled = false
89
+ // Resolve only once the socket is fully closed. Resolving on the error
90
+ // event and exiting immediately used to abort the process on Windows —
91
+ // libuv asserts when the handle is still closing (UV_HANDLE_CLOSING) —
92
+ // and the run ended with 127 instead of the documented 0/1/2.
89
93
  const finish = (r) => {
90
94
  if (settled) return
91
95
  settled = true
96
+ if (sock.destroyed) {
97
+ done(r)
98
+ return
99
+ }
100
+ sock.once('close', () => done(r))
92
101
  sock.destroy()
93
- done(r)
94
102
  }
95
103
  sock.setTimeout(timeoutMs)
96
104
  sock.once('connect', () => finish({ reachable: true }))
@@ -477,4 +485,7 @@ console.log(`${results.length} checks · ${fails} failed · ${warns} warning(s)`
477
485
  if (fails === 0 && warns === 0) console.log('This install is ready.')
478
486
  if (fails > 0) console.log('Fix the FAIL lines above; the gateway will not govern correctly until you do.')
479
487
  console.log('')
480
- process.exit(fails > 0 ? 1 : 0)
488
+ // Set the code and let the loop drain. process.exit() here raced the closing
489
+ // probe sockets and aborted the process on Windows, which surfaced as 127 —
490
+ // a code this tool does not define, and one a deployment gate cannot read.
491
+ process.exitCode = fails > 0 ? 1 : 0
@@ -3,7 +3,7 @@
3
3
  "mcpServers": {
4
4
  "conarium": {
5
5
  "command": "npx",
6
- "args": ["-y", "@conarium-ai/core", "--config", "/path/to/your/conarium.config.json"]
6
+ "args": ["-y", "--package=@conarium-ai/core", "conarium", "--config", "/path/to/your/conarium.config.json"]
7
7
  }
8
8
  }
9
9
  }
@@ -3,7 +3,7 @@
3
3
  "mcpServers": {
4
4
  "conarium": {
5
5
  "command": "npx",
6
- "args": ["-y", "@conarium-ai/core", "--config", "/path/to/your/conarium.config.json"],
6
+ "args": ["-y", "--package=@conarium-ai/core", "conarium", "--config", "/path/to/your/conarium.config.json"],
7
7
  "description": "Conarium — company-aware AI context"
8
8
  }
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "//files": "Pakete NE gireceginin izin listesi. Liste olmadan npm her seyi gonderiyordu: 296 dosya / 1.5 MB — CI workflowlari, gitleaks ayari, 137 KB pazarlama gorseli, sitenin api/chat.js dosyasi. Bir bankanin guvenlik ekibi tarball'i acip bunlari gorur. scripts/ BILEREK var: conarium-reconcile calisirken scripts/pg-snapshot.sql'e atif yapiyor, olmazsa kullanici destek maili yazar.",
5
5
  "files": [
6
6
  "dist",