kubun 0.12.0 → 0.13.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/identity.d.ts +2 -2
- package/lib/identity.js +10 -1
- package/package.json +28 -25
package/lib/identity.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Identity, OwnIdentity } from '@kokuin/token';
|
|
1
|
+
import type { DIDString, Identity, OwnIdentity } from '@kokuin/token';
|
|
2
2
|
type Logger = {
|
|
3
3
|
warn: (message: string, properties?: Record<string, unknown>) => void;
|
|
4
4
|
};
|
|
5
5
|
export type IdentityOptions = {
|
|
6
6
|
privateKey?: string;
|
|
7
|
-
id?:
|
|
7
|
+
id?: DIDString;
|
|
8
8
|
p2p?: boolean;
|
|
9
9
|
};
|
|
10
10
|
/**
|
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.13.0",
|
|
4
4
|
"description": "Kubun CLI",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "see LICENSE.md",
|
|
@@ -15,42 +15,45 @@
|
|
|
15
15
|
"/lib"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hono/node-server": "^2.1.
|
|
19
|
-
"@kokuin/token": "^0.
|
|
20
|
-
"@logtape/logtape": "^2.3.
|
|
21
|
-
"@mokei/context-server": "^0.
|
|
18
|
+
"@hono/node-server": "^2.1.1",
|
|
19
|
+
"@kokuin/token": "^0.5.0",
|
|
20
|
+
"@logtape/logtape": "^2.3.1",
|
|
21
|
+
"@mokei/context-server": "^0.12.0",
|
|
22
22
|
"@sozai/codec": "^0.4.0",
|
|
23
|
-
"@tejika/cli": "^0.4.
|
|
24
|
-
"@tejika/env": "^0.
|
|
25
|
-
"@tejika/ui": "^0.4.
|
|
23
|
+
"@tejika/cli": "^0.4.1",
|
|
24
|
+
"@tejika/env": "^0.5.0",
|
|
25
|
+
"@tejika/ui": "^0.4.1",
|
|
26
26
|
"commander": "^15.0.0",
|
|
27
27
|
"graphql": "^16.14.2",
|
|
28
28
|
"ink": "^7.1.1",
|
|
29
29
|
"react": "19.2.3",
|
|
30
|
-
"@kubun/
|
|
31
|
-
"@kubun/
|
|
32
|
-
"@kubun/db
|
|
33
|
-
"@kubun/
|
|
34
|
-
"@kubun/
|
|
35
|
-
"@kubun/
|
|
36
|
-
"@kubun/
|
|
37
|
-
"@kubun/
|
|
38
|
-
"@kubun/
|
|
39
|
-
"@kubun/
|
|
40
|
-
"@kubun/
|
|
41
|
-
"@kubun/
|
|
42
|
-
"@kubun/
|
|
43
|
-
"@kubun/
|
|
30
|
+
"@kubun/client": "^0.13.0",
|
|
31
|
+
"@kubun/db-postgres": "^0.13.0",
|
|
32
|
+
"@kubun/db": "^0.13.0",
|
|
33
|
+
"@kubun/db-node-sqlite": "^0.13.0",
|
|
34
|
+
"@kubun/graphql": "^0.13.0",
|
|
35
|
+
"@kubun/http-client": "^0.13.0",
|
|
36
|
+
"@kubun/engine": "^0.13.0",
|
|
37
|
+
"@kubun/hub": "^0.13.0",
|
|
38
|
+
"@kubun/plugin-rpc": "^0.13.0",
|
|
39
|
+
"@kubun/plugin-p2p": "^0.13.0",
|
|
40
|
+
"@kubun/mcp": "^0.13.0",
|
|
41
|
+
"@kubun/logger": "^0.13.0",
|
|
42
|
+
"@kubun/plugin-http": "^0.13.0",
|
|
43
|
+
"@kubun/protocol": "^0.13.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"ink-testing-library": "^4.0.0",
|
|
47
|
-
"@kubun/store-graph": "^0.
|
|
48
|
-
"@kubun/id": "^0.
|
|
49
|
-
"@kubun/store-p2p": "^0.
|
|
47
|
+
"@kubun/store-graph": "^0.13.0",
|
|
48
|
+
"@kubun/id": "^0.13.0",
|
|
49
|
+
"@kubun/store-p2p": "^0.13.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=22.0.0"
|
|
53
53
|
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
54
57
|
"scripts": {
|
|
55
58
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|
|
56
59
|
"build:clean": "del lib",
|