kubun 0.12.1 → 0.14.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/lib/commands/mcp.js +1 -1
- package/lib/engine.js +14 -10
- package/lib/identity.js +10 -1
- package/package.json +26 -24
package/lib/commands/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createConfig } from '@kubun/mcp';
|
|
2
|
-
import { serveProcess } from '@mokei/context-server';
|
|
2
|
+
import { serveProcess } from '@mokei/context-server-node';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
import { getSigner } from '../account.js';
|
|
5
5
|
import { withPrivateKey } from '../options.js';
|
package/lib/engine.js
CHANGED
|
@@ -5,7 +5,8 @@ import { PostgresAdapter } from '@kubun/db-postgres';
|
|
|
5
5
|
import { KubunEngine } from '@kubun/engine';
|
|
6
6
|
import { createHTTPPlugin } from '@kubun/plugin-http';
|
|
7
7
|
import { createP2PPlugin, MERKLE_SYNC_PROTOCOL } from '@kubun/plugin-p2p';
|
|
8
|
-
import {
|
|
8
|
+
import { createServiceServerPlugin } from '@kubun/plugin-service-server';
|
|
9
|
+
import { createGraphServicePlugin } from '@kubun/service-graph-api';
|
|
9
10
|
import { resolvePath } from './fs.js';
|
|
10
11
|
/**
|
|
11
12
|
* The graph a peer device serves its own p2p surface from.
|
|
@@ -40,7 +41,17 @@ export function createAdapter(db) {
|
|
|
40
41
|
*/ export function buildEngine(params) {
|
|
41
42
|
const { adapter, identity, http, p2p } = params;
|
|
42
43
|
const plugins = [
|
|
43
|
-
|
|
44
|
+
createServiceServerPlugin(),
|
|
45
|
+
createGraphServicePlugin({
|
|
46
|
+
allowDelegatedMutations: p2p != null
|
|
47
|
+
})
|
|
48
|
+
];
|
|
49
|
+
if (http != null) {
|
|
50
|
+
plugins.push(createHTTPPlugin({
|
|
51
|
+
port: http.port,
|
|
52
|
+
allowedOrigin: http.allowedOrigin,
|
|
53
|
+
// The graph service is served through the HTTP plugin, so its access
|
|
54
|
+
// posture rides this option rather than the graph provider default.
|
|
44
55
|
...p2p?.autoAcceptPeers != null ? {
|
|
45
56
|
accessRules: {
|
|
46
57
|
'*': {
|
|
@@ -50,14 +61,7 @@ export function createAdapter(db) {
|
|
|
50
61
|
]
|
|
51
62
|
}
|
|
52
63
|
}
|
|
53
|
-
} : undefined
|
|
54
|
-
allowDelegatedMutations: p2p != null
|
|
55
|
-
})
|
|
56
|
-
];
|
|
57
|
-
if (http != null) {
|
|
58
|
-
plugins.push(createHTTPPlugin({
|
|
59
|
-
port: http.port,
|
|
60
|
-
allowedOrigin: http.allowedOrigin
|
|
64
|
+
} : undefined
|
|
61
65
|
}));
|
|
62
66
|
}
|
|
63
67
|
if (p2p != null) {
|
package/lib/identity.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { createFullIdentity, randomIdentity } from '@kokuin/token';
|
|
2
2
|
import { fromB64 } from '@sozai/codec';
|
|
3
|
+
/**
|
|
4
|
+
* `--id` is free-form input. A malformed value used to flow through unchecked and
|
|
5
|
+
* fail later at resolution, where the message names neither the flag nor the value.
|
|
6
|
+
*/ function asDID(id) {
|
|
7
|
+
if (!/^did:[a-z0-9]+:.+/.test(id)) {
|
|
8
|
+
throw new Error(`Invalid --id: ${id} is not a DID (expected did:<method>:<identifier>).`);
|
|
9
|
+
}
|
|
10
|
+
return id;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Resolve the server signing identity from CLI options.
|
|
5
14
|
*
|
|
@@ -20,7 +29,7 @@ import { fromB64 } from '@sozai/codec';
|
|
|
20
29
|
throw new Error('P2P mode requires a signing identity. Use --private-key instead of --id.');
|
|
21
30
|
}
|
|
22
31
|
return {
|
|
23
|
-
id: opts.id
|
|
32
|
+
id: asDID(opts.id)
|
|
24
33
|
};
|
|
25
34
|
}
|
|
26
35
|
const generated = randomIdentity();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Kubun CLI",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "see LICENSE.md",
|
|
@@ -15,10 +15,26 @@
|
|
|
15
15
|
"/lib"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hono/node-server": "^2.1.
|
|
19
|
-
"@kokuin/token": "^0.
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
18
|
+
"@hono/node-server": "^2.1.1",
|
|
19
|
+
"@kokuin/token": "^0.5.0",
|
|
20
|
+
"@kubun/client": "^0.14.0",
|
|
21
|
+
"@kubun/db": "^0.14.0",
|
|
22
|
+
"@kubun/db-node-sqlite": "^0.14.0",
|
|
23
|
+
"@kubun/db-postgres": "^0.14.0",
|
|
24
|
+
"@kubun/engine": "^0.14.0",
|
|
25
|
+
"@kubun/graphql": "^0.14.0",
|
|
26
|
+
"@kubun/http-client": "^0.14.0",
|
|
27
|
+
"@kubun/hub": "^0.14.0",
|
|
28
|
+
"@kubun/logger": "^0.14.0",
|
|
29
|
+
"@kubun/mcp": "^0.14.0",
|
|
30
|
+
"@kubun/plugin-http": "^0.14.0",
|
|
31
|
+
"@kubun/plugin-http-api": "^0.14.0",
|
|
32
|
+
"@kubun/plugin-p2p": "^0.14.0",
|
|
33
|
+
"@kubun/plugin-service-server": "^0.14.0",
|
|
34
|
+
"@kubun/protocol": "^0.14.0",
|
|
35
|
+
"@kubun/service-graph-api": "^0.14.0",
|
|
36
|
+
"@logtape/logtape": "^2.3.2",
|
|
37
|
+
"@mokei/context-server-node": "^0.13.0",
|
|
22
38
|
"@sozai/codec": "^0.4.0",
|
|
23
39
|
"@tejika/cli": "^0.4.1",
|
|
24
40
|
"@tejika/env": "^0.5.0",
|
|
@@ -26,27 +42,13 @@
|
|
|
26
42
|
"commander": "^15.0.0",
|
|
27
43
|
"graphql": "^16.14.2",
|
|
28
44
|
"ink": "^7.1.1",
|
|
29
|
-
"react": "19.2.3"
|
|
30
|
-
"@kubun/client": "^0.12.1",
|
|
31
|
-
"@kubun/db-postgres": "^0.12.1",
|
|
32
|
-
"@kubun/db": "^0.12.1",
|
|
33
|
-
"@kubun/db-node-sqlite": "^0.12.1",
|
|
34
|
-
"@kubun/engine": "^0.12.1",
|
|
35
|
-
"@kubun/graphql": "^0.13.0",
|
|
36
|
-
"@kubun/http-client": "^0.12.1",
|
|
37
|
-
"@kubun/logger": "^0.12.0",
|
|
38
|
-
"@kubun/mcp": "^0.12.1",
|
|
39
|
-
"@kubun/plugin-http": "^0.12.1",
|
|
40
|
-
"@kubun/hub": "^0.12.1",
|
|
41
|
-
"@kubun/plugin-p2p": "^0.12.1",
|
|
42
|
-
"@kubun/protocol": "^0.13.0",
|
|
43
|
-
"@kubun/plugin-rpc": "^0.12.1"
|
|
45
|
+
"react": "19.2.3"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"
|
|
47
|
-
"@kubun/
|
|
48
|
-
"@kubun/store-
|
|
49
|
-
"
|
|
48
|
+
"@kubun/id": "^0.14.0",
|
|
49
|
+
"@kubun/store-graph": "^0.14.0",
|
|
50
|
+
"@kubun/store-p2p": "^0.14.0",
|
|
51
|
+
"ink-testing-library": "^4.0.0"
|
|
50
52
|
},
|
|
51
53
|
"engines": {
|
|
52
54
|
"node": ">=22.0.0"
|