@tamga-network/onboard 0.0.0-stage → 0.8.3

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/mcp.d.ts ADDED
@@ -0,0 +1,240 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import { type Dns, type Http } from "./checks.js";
3
+ import { type Rpc } from "./node.js";
4
+ export interface McpOptions {
5
+ /** Dosya işlemlerinin sınırı (bu klasörün dışına okunmaz/yazılmaz) */
6
+ root: string;
7
+ http?: Http;
8
+ dns?: Dns;
9
+ /** düğüm denetiminin JSON-RPC taşıyıcısı (test için); varsayılan politikayı `TAMGA_ONBOARD_PRIVATE_NODES` belirler */
10
+ rpc?: Rpc;
11
+ env?: NodeJS.ProcessEnv;
12
+ }
13
+ export declare const TOOLS: readonly [{
14
+ readonly name: "create_application";
15
+ readonly description: "Build the Tamga Network application files (issuer/verifier registration JSON + local onboarding.json) from the institution's answers and write them into a new folder under the root. No personal data: names of people are never asked and unknown fields are rejected. Nothing is sent anywhere.";
16
+ readonly inputSchema: {
17
+ readonly type: "object";
18
+ readonly properties: {
19
+ readonly answers: {
20
+ readonly type: "object";
21
+ readonly description: "Answers (same shape as `tamga-onboard init --from`).";
22
+ };
23
+ readonly out_dir: {
24
+ readonly type: "string";
25
+ readonly description: "Folder relative to the root (default tamga-onboarding/<slug>).";
26
+ };
27
+ };
28
+ readonly required: readonly ["answers"];
29
+ };
30
+ }, {
31
+ readonly name: "validate_application";
32
+ readonly description: "Validate an application (issuer or verifier registration JSON) with the same rules as the operator's registration tool, plus institution-side checks (identifier format/checksum, https addresses, no unknown fields). Give either `application` or a `path` under the root.";
33
+ readonly inputSchema: {
34
+ readonly type: "object";
35
+ readonly properties: {
36
+ readonly application: {
37
+ readonly type: "object";
38
+ };
39
+ readonly path: {
40
+ readonly type: "string";
41
+ readonly description: "JSON file relative to the root.";
42
+ };
43
+ };
44
+ };
45
+ }, {
46
+ readonly name: "generate_keys_and_csr";
47
+ readonly description: "Generate the institution's P-256 keys on this computer and write PKCS#10 certificate requests (CSRs) for the operator into <dir>/keys. Private keys stay in local files (owner-only permissions) and are never returned. Refuses to overwrite.";
48
+ readonly inputSchema: {
49
+ readonly type: "object";
50
+ readonly properties: {
51
+ readonly dir: {
52
+ readonly type: "string";
53
+ readonly description: "Onboarding folder (output of create_application), relative to the root.";
54
+ };
55
+ readonly passphrase_env: {
56
+ readonly type: "string";
57
+ readonly description: "Name of an environment variable (must start with TAMGA_) holding a passphrase of at least 12 characters to encrypt the private keys.";
58
+ };
59
+ readonly no_passphrase: {
60
+ readonly type: "boolean";
61
+ readonly description: "Write unencrypted private keys (on Windows only when this is set explicitly).";
62
+ };
63
+ };
64
+ readonly required: readonly ["dir"];
65
+ };
66
+ }, {
67
+ readonly name: "check_installation";
68
+ readonly description: "Read-only checks of the institution's own setup: application files, keys and CSRs, certificates from the operator, domain (DNS, TXT confirmation), https addresses, own-service .well-known metadata, lookup endpoint (probed with invalid requests only), verifier domain.";
69
+ readonly inputSchema: {
70
+ readonly type: "object";
71
+ readonly properties: {
72
+ readonly dir: {
73
+ readonly type: "string";
74
+ readonly description: "Onboarding folder relative to the root.";
75
+ };
76
+ readonly dns_txt: {
77
+ readonly type: "string";
78
+ readonly description: "One-time domain confirmation value from the operator (optional).";
79
+ };
80
+ readonly passphrase_env: {
81
+ readonly type: "string";
82
+ };
83
+ readonly offline: {
84
+ readonly type: "boolean";
85
+ readonly description: "Only local files, no network.";
86
+ };
87
+ };
88
+ readonly required: readonly ["dir"];
89
+ };
90
+ }, {
91
+ readonly name: "check_listing";
92
+ readonly description: "Read-only check of how the institution appears in the signed Tamga trust list (verified against the pins embedded in this package): status, registration data, credential types, issuing authority, status list anchor, registration certificates, verifier record, service metadata and certificate chain to the listed root.";
93
+ readonly inputSchema: {
94
+ readonly type: "object";
95
+ readonly properties: {
96
+ readonly environment: {
97
+ readonly type: "string";
98
+ readonly enum: readonly ["production", "sandbox"];
99
+ };
100
+ readonly slug: {
101
+ readonly type: "string";
102
+ readonly description: "Issuer short name.";
103
+ };
104
+ readonly rp: {
105
+ readonly type: "string";
106
+ readonly description: "Verifier / identity-matching DNS name.";
107
+ };
108
+ readonly dir: {
109
+ readonly type: "string";
110
+ readonly description: "Onboarding folder (fills slug/rp/environment and local certificates).";
111
+ };
112
+ };
113
+ };
114
+ }, {
115
+ readonly name: "generate_node_key";
116
+ readonly description: "For a state / operator Besu node: generate the node key (secp256k1, Besu key file format) on this computer and write a folder with the private key (owner-only, never returned, never overwritten, refused in a cloud-synced folder), key.pub, node.json and a besu.toml template (permissioned mode, RPC on 127.0.0.1 only, P2P on one internal interface — never 0.0.0.0). Returns the enode public key and the validator address plus genesis instructions. Writes nothing to the network or the chain.";
117
+ readonly inputSchema: {
118
+ readonly type: "object";
119
+ readonly properties: {
120
+ readonly dir: {
121
+ readonly type: "string";
122
+ readonly description: "New node folder relative to the root (default tamga-node).";
123
+ };
124
+ readonly state: {
125
+ readonly type: "string";
126
+ readonly description: "Governance member code, e.g. TR.";
127
+ };
128
+ readonly role: {
129
+ readonly type: "string";
130
+ readonly enum: readonly ["validator", "rpc"];
131
+ };
132
+ readonly ip: {
133
+ readonly type: "string";
134
+ readonly description: "Advertised P2P address (IPv4/IPv6 literal, as in the node declaration).";
135
+ };
136
+ readonly interface: {
137
+ readonly type: "string";
138
+ readonly description: "Internal interface P2P listens on (default: ip). Never 0.0.0.0.";
139
+ };
140
+ readonly p2p_port: {
141
+ readonly type: "integer";
142
+ readonly description: "Default 30303.";
143
+ };
144
+ readonly rpc_port: {
145
+ readonly type: "integer";
146
+ readonly description: "Local JSON-RPC port (127.0.0.1), default 8545.";
147
+ };
148
+ };
149
+ readonly required: readonly ["state", "role", "ip"];
150
+ };
151
+ }, {
152
+ readonly name: "create_node_declaration";
153
+ readonly description: "Write a tamga-node-declaration/1 file (schema network/permissions) for the operator: state, role, enode public key, IP, P2P port and the institution's operations contact (role mailbox or https page — never a person's name). Validated against the schema; the file is new (never overwritten). The declaration grants no authority: a validator enters the allowlist only if its key address is the state's active validator address in Governance.";
154
+ readonly inputSchema: {
155
+ readonly type: "object";
156
+ readonly properties: {
157
+ readonly dir: {
158
+ readonly type: "string";
159
+ readonly description: "Node folder (output of generate_node_key), relative to the root.";
160
+ };
161
+ readonly contact: {
162
+ readonly type: "string";
163
+ readonly description: "Operations mailbox (e.g. noc@…) or https page of the institution.";
164
+ };
165
+ readonly name: {
166
+ readonly type: "string";
167
+ readonly description: "File name part: <cc>-<name>.json (default: the role).";
168
+ };
169
+ readonly out: {
170
+ readonly type: "string";
171
+ readonly description: "Output .json relative to the root (default: inside dir).";
172
+ };
173
+ readonly public_key: {
174
+ readonly type: "string";
175
+ readonly description: "Node public key when there is no node folder (key made in an HSM).";
176
+ };
177
+ readonly state: {
178
+ readonly type: "string";
179
+ };
180
+ readonly role: {
181
+ readonly type: "string";
182
+ readonly enum: readonly ["validator", "rpc"];
183
+ };
184
+ readonly ip: {
185
+ readonly type: "string";
186
+ };
187
+ readonly p2p_port: {
188
+ readonly type: "integer";
189
+ };
190
+ };
191
+ readonly required: readonly ["contact"];
192
+ };
193
+ }, {
194
+ readonly name: "check_node";
195
+ readonly description: "Read-only checks of the institution's own Besu node: reachable, in sync (and same genesis) against a reference endpoint, peers, node key vs node.json/declaration, node and account allowlists vs a rendered permissions file or a reference node, validator set, external endpoint exposes only eth/net/web3 (admin/perm/qbft/debug/txpool refused), besu.toml interfaces and permissioning flags, clock. Only read-only JSON-RPC methods are called (no vote, no reload, no transaction). Loopback / private addresses only when listed in the TAMGA_ONBOARD_PRIVATE_NODES environment variable of this server; public addresses only over https.";
196
+ readonly inputSchema: {
197
+ readonly type: "object";
198
+ readonly properties: {
199
+ readonly dir: {
200
+ readonly type: "string";
201
+ readonly description: "Node folder (node.json, besu.toml) relative to the root.";
202
+ };
203
+ readonly rpc: {
204
+ readonly type: "string";
205
+ readonly description: "The node's own JSON-RPC endpoint (default http://127.0.0.1:<rpc-http-port>).";
206
+ };
207
+ readonly chain_rpc: {
208
+ readonly type: "string";
209
+ readonly description: "Another endpoint on the same chain for comparison.";
210
+ };
211
+ readonly public_rpc: {
212
+ readonly type: "string";
213
+ readonly description: "The node's externally exposed endpoint (proxy).";
214
+ };
215
+ readonly permissions_file: {
216
+ readonly type: "string";
217
+ readonly description: "Output of trust:chain-permissions render (.toml, relative to the root).";
218
+ };
219
+ readonly config: {
220
+ readonly type: "string";
221
+ readonly description: "besu.toml relative to the root (default: dir/besu.toml).";
222
+ };
223
+ readonly declaration: {
224
+ readonly type: "string";
225
+ readonly description: "Node declaration .json relative to the root.";
226
+ };
227
+ };
228
+ };
229
+ }, {
230
+ readonly name: "sandbox_info";
231
+ readonly description: "Where and how to try the sandbox ('Try your institution'). There is no machine interface for it today.";
232
+ readonly inputSchema: {
233
+ readonly type: "object";
234
+ readonly properties: {};
235
+ };
236
+ }];
237
+ export declare function createServer(o: McpOptions, version?: string): Server;
238
+ /** stdio üzerinden çalıştırır (`tamga-onboard mcp`). */
239
+ export declare function runStdioServer(o: McpOptions): Promise<void>;
240
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAInE,OAAO,EAML,KAAK,GAAG,EACR,KAAK,IAAI,EAEV,MAAM,aAAa,CAAC;AAIrB,OAAO,EAcL,KAAK,GAAG,EAET,MAAM,WAAW,CAAC;AAMnB,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,sHAAsH;IACtH,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkJR,CAAC;AAIX,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,SAAM,GAAG,MAAM,CA6QjE;AAED,wDAAwD;AACxD,wBAAsB,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CASjE"}