@needmoretruth/nmts-cli 0.39.0 → 0.41.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/CHANGELOG.md +23 -0
- package/README.ko.md +27 -1
- package/README.md +29 -1
- package/dist/api-advice.js +6 -0
- package/dist/api.d.ts +10 -1
- package/dist/api.js +12 -2
- package/dist/arg-options.d.ts +21 -0
- package/dist/args.js +12 -1
- package/dist/artifact-about.d.ts +1 -1
- package/dist/commands/create-link.d.ts +9 -0
- package/dist/commands/create-link.js +31 -1
- package/dist/commands/create.d.ts +9 -0
- package/dist/commands/create.js +17 -0
- package/dist/commands/extend.d.ts +3 -3
- package/dist/commands/extend.js +52 -161
- package/dist/commands/login-passphrase.d.ts +13 -0
- package/dist/commands/login-passphrase.js +64 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.js +15 -55
- package/dist/commands/openers-attach.d.ts +38 -0
- package/dist/commands/openers-attach.js +97 -0
- package/dist/commands/openers.d.ts +23 -0
- package/dist/commands/openers.js +195 -0
- package/dist/commands/wallet-storage-ops.d.ts +2 -2
- package/dist/commands/wallet-storage-ops.js +108 -134
- package/dist/commands/wallet-storage.d.ts +3 -8
- package/dist/commands/wallet-storage.js +16 -37
- package/dist/crypto-surface.d.ts +28 -0
- package/dist/crypto-surface.js +7 -0
- package/dist/help.js +15 -0
- package/dist/main.js +11 -12
- package/dist/openers/doors.d.ts +65 -0
- package/dist/openers/doors.js +97 -0
- package/dist/openers/hints.d.ts +22 -0
- package/dist/openers/hints.js +11 -0
- package/dist/openers/sign.d.ts +56 -0
- package/dist/openers/sign.js +202 -0
- package/dist/openers/wallet.d.ts +71 -0
- package/dist/openers/wallet.js +210 -0
- package/dist/openers-key-file.d.ts +14 -0
- package/dist/openers-key-file.js +99 -0
- package/dist/openers.d.ts +7 -0
- package/dist/openers.js +21 -0
- package/dist/product.d.ts +1 -1
- package/dist/product.js +1 -1
- package/dist/risk.d.ts +11 -0
- package/dist/risk.js +15 -0
- package/dist/storage-control/extend.d.ts +124 -0
- package/dist/storage-control/extend.js +189 -0
- package/dist/storage-control/hints.d.ts +20 -0
- package/dist/storage-control/hints.js +11 -0
- package/dist/storage-control/list.d.ts +55 -0
- package/dist/storage-control/list.js +71 -0
- package/dist/storage-control/reshape.d.ts +120 -0
- package/dist/storage-control/reshape.js +188 -0
- package/dist/storage-control-chain.d.ts +1 -1
- package/dist/storage-control.d.ts +13 -0
- package/dist/storage-control.js +24 -0
- package/dist/wallet-storage-chain.d.ts +1 -1
- package/docs/commands/openers.md +31 -0
- package/package.json +9 -1
- package/vendor/nmts-crypto/nmts_crypto_wasm.d.ts +54 -0
- package/vendor/nmts-crypto/nmts_crypto_wasm.js +108 -0
- package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm +0 -0
- package/vendor/nmts-crypto/nmts_crypto_wasm_bg.wasm.d.ts +4 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// The bytes a wallet is asked to sign, and the one place a signature it hands back is judged.
|
|
2
|
+
//
|
|
3
|
+
// ⛔ THE MESSAGE IS THE ENGINE'S AND IS NEVER RETYPED HERE. `opener_message` builds it in Rust so
|
|
4
|
+
// that the browser, this tool and the recovery tool ask for ONE message: a character of drift
|
|
5
|
+
// between them is a different wrapping key, a different locator, and a slot that no longer
|
|
6
|
+
// opens. Nothing in this file writes a line of it, checks an address for itself, or repairs an
|
|
7
|
+
// input the engine refuses — all three are inside what a person reads in the wallet popup.
|
|
8
|
+
//
|
|
9
|
+
// ⛔ THE SERIALIZED SIGNATURE NEVER LEAVES THIS FILE'S CALL STACK. `withSignature` borrows it for
|
|
10
|
+
// the length of one piece of work and answers whatever that work answers; it is not returned,
|
|
11
|
+
// not stored on anything returned, and not closed over by anything that outlives the call. That
|
|
12
|
+
// is review finding 2-B3 kept on this side of the boundary — the Rust crate keeps it on the
|
|
13
|
+
// other (`crypto/src/opener.rs`) — and `cli/test/openers.test.ts` proves the objects these
|
|
14
|
+
// functions hand back cannot reach it.
|
|
15
|
+
//
|
|
16
|
+
// ⛔ THE SCHEME IS READ BEFORE THE SIGNATURE IS VERIFIED, and it is read with the chain library's
|
|
17
|
+
// own flag table rather than a list written here. Three schemes sign the same bytes the same
|
|
18
|
+
// way every time and can be openers; multisig, zkLogin and passkeys cannot, and each of them
|
|
19
|
+
// gets its own reason code because the answer differs — a passkey holder needs to be told that
|
|
20
|
+
// passkeys sign differently every time, not that "something was wrong". The ENGINE refuses them
|
|
21
|
+
// too, and that refusal is the authority; what is here is which sentence a caller can say.
|
|
22
|
+
//
|
|
23
|
+
// ⚠ VERIFIED AGAINST OUR OWN BYTES, ALWAYS. The wallet is asked to sign a message this file built
|
|
24
|
+
// and the signature is checked against that same message and the address it names — never
|
|
25
|
+
// against whatever the wallet says it signed. A wallet that answers `bytes` has them compared
|
|
26
|
+
// first, so "it signed something else" is reported as itself rather than as an invalid signature.
|
|
27
|
+
import { SIGNATURE_FLAG_TO_SCHEME } from "@mysten/sui/cryptography";
|
|
28
|
+
import { verifyPersonalMessageSignature } from "@mysten/sui/verify";
|
|
29
|
+
import { fromBase64Url } from "../bytes.js";
|
|
30
|
+
import { loadCrypto } from "../crypto.js";
|
|
31
|
+
import { NmtsError } from "../errors.js";
|
|
32
|
+
/** The scheme flags that can be an opener, by the chain library's own name for each. */
|
|
33
|
+
const OPENS = ["ED25519", "Secp256k1", "Secp256r1"];
|
|
34
|
+
/**
|
|
35
|
+
* Why a wallet's signing scheme cannot hold an opener. ⛔ ONE CODE PER REASON: the thing to do
|
|
36
|
+
* about a multisig wallet and about a passkey are different, so the two cannot share an answer.
|
|
37
|
+
*/
|
|
38
|
+
const REFUSED_SCHEME = {
|
|
39
|
+
// Copy facts — the sentences. Facts, in order: a multisig wallet's bytes depend on which signers
|
|
40
|
+
// took part, so the same message does not always give the same signature; zkLogin's ephemeral
|
|
41
|
+
// key and proof change every session; a passkey signs over a counter, so no two signatures over
|
|
42
|
+
// one message match. None of the three can re-open a slot tomorrow, which is why they are
|
|
43
|
+
// refused at the door rather than discovered later.
|
|
44
|
+
MultiSig: "WALLET_MULTISIG: this wallet signs differently depending on which signers take part.",
|
|
45
|
+
ZkLogin: "WALLET_ZKLOGIN: this wallet signs differently in every session.",
|
|
46
|
+
Passkey: "WALLET_PASSKEY: this wallet signs differently every time.",
|
|
47
|
+
};
|
|
48
|
+
/** The exact bytes this wallet is asked to sign. Built by the engine; refused, never repaired. */
|
|
49
|
+
export async function openerMessage(input) {
|
|
50
|
+
const glue = await loadCrypto();
|
|
51
|
+
const account = input.account ?? 1;
|
|
52
|
+
try {
|
|
53
|
+
return input.app === undefined
|
|
54
|
+
? glue.opener_message(input.address, account)
|
|
55
|
+
: glue.opener_message(input.address, account, input.app);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
// ⚠ The engine's own sentence is carried: it names which of the three inputs was not canonical,
|
|
59
|
+
// and every one of them is a value the caller passed rather than anything secret.
|
|
60
|
+
throw new NmtsError(`WALLET_MESSAGE_REFUSED: ${message(error)}`, {
|
|
61
|
+
exitCode: 2,
|
|
62
|
+
// Copy facts — the next step. Facts: the address is `0x` + 64 lowercase hex, the account
|
|
63
|
+
// number starts at 1, an app is 1–64 of a-z0-9.- starting and ending alphanumeric — and none
|
|
64
|
+
// of the three is tidied up here, because all three are inside what the person signs.
|
|
65
|
+
nextStep: "Nothing was signed. Pass the address exactly as the wallet spells it.",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get one signature over this account's message, judge it, and lend it to `use`.
|
|
71
|
+
*
|
|
72
|
+
* ⛔ THE SIGNATURE IS NOT THE ANSWER. Whatever `use` returns is; the bytes are dropped when this
|
|
73
|
+
* call ends, and there is deliberately no form of this that hands them back.
|
|
74
|
+
*/
|
|
75
|
+
export async function withSignature(input, use, hints = {}) {
|
|
76
|
+
const message = await openerMessage(input);
|
|
77
|
+
return use(await judged(await input.sign(message), message, input.address, hints));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the signature TWICE and refuse unless both are the same 64 bytes, then lend it to `use`.
|
|
81
|
+
*
|
|
82
|
+
* ⛔ THE ONE CHECK THAT MAKES AN OPENER WORTH STORING. A slot is opened by the same signature that
|
|
83
|
+
* sealed it, so a wallet that signs differently the second time seals something it can never
|
|
84
|
+
* open — and the person would learn that at their next sign-in, with the account behind it.
|
|
85
|
+
* Two signatures now is a question a wallet answers in seconds; the alternative is a slot that
|
|
86
|
+
* looks fine forever.
|
|
87
|
+
*
|
|
88
|
+
* ⚠ IT IS RUN FOR EVERY SCHEME, including the three that sign deterministically. An Ed25519 wallet
|
|
89
|
+
* held by a signing service, an MPC wallet or a hardware wallet with its own nonce rule all
|
|
90
|
+
* present as Ed25519 and all may hedge — the flag says how a signature is checked, not how it
|
|
91
|
+
* was made.
|
|
92
|
+
*/
|
|
93
|
+
export async function withRepeatedSignature(input, use, hints = {}) {
|
|
94
|
+
const message = await openerMessage(input);
|
|
95
|
+
const first = await judged(await input.sign(message), message, input.address, hints);
|
|
96
|
+
const again = await judged(await input.sign(message), message, input.address, hints);
|
|
97
|
+
if (!sameBytes(first, again)) {
|
|
98
|
+
throw new NmtsError(
|
|
99
|
+
// Copy facts — the sentence. Facts: the wallet was asked for the same signature twice and gave
|
|
100
|
+
// two different answers; a slot is opened by the signature that sealed it, so this wallet
|
|
101
|
+
// could not open what it is about to seal. Nothing was stored.
|
|
102
|
+
"WALLET_NOT_REPEATABLE: this wallet signed the same message two different ways.", {
|
|
103
|
+
exitCode: 4,
|
|
104
|
+
nextStep: hints.notRepeatable ??
|
|
105
|
+
"Nothing was stored. A wallet that signs differently each time cannot open what it seals.",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return use(first);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One wallet answer, turned into serialized bytes this layer will act on — or a named refusal.
|
|
112
|
+
*
|
|
113
|
+
* The order is deliberate: what it signed, then what it signed WITH, then whether the signature
|
|
114
|
+
* holds. Each question's failure has a different answer, and asking them in this order means the
|
|
115
|
+
* reason a caller is given is the first thing that was actually wrong.
|
|
116
|
+
*/
|
|
117
|
+
async function judged(answer, message, address, hints) {
|
|
118
|
+
const signature = typeof answer === "string" ? answer : answer.signature;
|
|
119
|
+
const said = typeof answer === "string" ? undefined : answer.bytes;
|
|
120
|
+
if (typeof signature !== "string" || signature === "") {
|
|
121
|
+
throw new NmtsError("WALLET_SIGNATURE_MISSING: the wallet answered no signature.", {
|
|
122
|
+
exitCode: 4,
|
|
123
|
+
nextStep: "Nothing was stored and nothing was opened.",
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// ⛔ FIRST, BECAUSE IT IS THE ONE FAILURE THAT IS NOT ABOUT CRYPTOGRAPHY. A wallet that signed a
|
|
127
|
+
// different message — its own wrapper, a truncation, another site's text — would otherwise be
|
|
128
|
+
// reported as an invalid signature, which sends whoever reads it to look at the wrong thing.
|
|
129
|
+
if (said !== undefined && !sameBytes(fromBase64Url(said), message)) {
|
|
130
|
+
throw new NmtsError("WALLET_SIGNED_OTHER_BYTES: the wallet signed something other than this message.", {
|
|
131
|
+
exitCode: 4,
|
|
132
|
+
// Copy facts — the next step. Facts: what the wallet returned as the signed bytes is not what
|
|
133
|
+
// it was handed; the message carries the address, the account number and the version, and
|
|
134
|
+
// opening depends on those exact bytes. Nothing was stored.
|
|
135
|
+
nextStep: "Nothing was stored. The message this asked for and the one that was signed differ.",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const serialized = decoded(signature);
|
|
139
|
+
refuseTheScheme(serialized, hints);
|
|
140
|
+
try {
|
|
141
|
+
await verifyPersonalMessageSignature(message, signature, { address });
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// ⛔ THE LIBRARY'S OWN MESSAGE IS NOT CARRIED. It differs between "not valid for this message"
|
|
145
|
+
// and "not this address", and both mean one thing to whoever asked: what came back does not
|
|
146
|
+
// belong to the wallet that was named, over the bytes it was given.
|
|
147
|
+
throw new NmtsError("WALLET_SIGNATURE_INVALID: that signature is not this wallet's, over these bytes.", {
|
|
148
|
+
exitCode: 4,
|
|
149
|
+
nextStep: "Nothing was stored and nothing was opened.",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return serialized;
|
|
153
|
+
}
|
|
154
|
+
/** The serialized signature's bytes, or a refusal that does not quote what was handed in. */
|
|
155
|
+
function decoded(signature) {
|
|
156
|
+
let bytes;
|
|
157
|
+
try {
|
|
158
|
+
bytes = fromBase64Url(signature);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
throw new NmtsError("WALLET_SIGNATURE_MALFORMED: the wallet's signature is not base64.", {
|
|
162
|
+
exitCode: 4,
|
|
163
|
+
nextStep: "Nothing was stored and nothing was opened.",
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (bytes.length === 0) {
|
|
167
|
+
throw new NmtsError("WALLET_SIGNATURE_MALFORMED: the wallet's signature is empty.", {
|
|
168
|
+
exitCode: 4,
|
|
169
|
+
nextStep: "Nothing was stored and nothing was opened.",
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return bytes;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Refuse a scheme that cannot hold an opener, by its own name.
|
|
176
|
+
*
|
|
177
|
+
* ⚠ AN ALLOW LIST. A flag nobody here has judged is refused for being unknown rather than let
|
|
178
|
+
* through for being new — the same rule the engine keeps one layer down.
|
|
179
|
+
*/
|
|
180
|
+
function refuseTheScheme(serialized, hints) {
|
|
181
|
+
const flag = serialized[0];
|
|
182
|
+
const scheme = flag === undefined ? undefined : Reflect.get(SIGNATURE_FLAG_TO_SCHEME, String(flag));
|
|
183
|
+
if (typeof scheme === "string" && OPENS.includes(scheme))
|
|
184
|
+
return;
|
|
185
|
+
const named = typeof scheme === "string" ? REFUSED_SCHEME[scheme] : undefined;
|
|
186
|
+
throw new NmtsError(named ??
|
|
187
|
+
// Copy facts — the sentence for a scheme nothing here knows. Fact: this version accepts the
|
|
188
|
+
// three Sui schemes that sign one message the same way every time.
|
|
189
|
+
`WALLET_UNKNOWN_SCHEME: this version does not know how wallet scheme 0x${(flag ?? 0).toString(16).padStart(2, "0")} signs.`, {
|
|
190
|
+
exitCode: 4,
|
|
191
|
+
nextStep: hints.wrongKind ??
|
|
192
|
+
"Nothing was stored and nothing was opened. An opener needs a wallet that signs one message the same way every time.",
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** Two runs of bytes, compared for being the same. Neither of them is secret. */
|
|
196
|
+
function sameBytes(a, b) {
|
|
197
|
+
return a.length === b.length && a.every((byte, at) => byte === b[at]);
|
|
198
|
+
}
|
|
199
|
+
/** Whatever an engine refusal said, as text. */
|
|
200
|
+
function message(error) {
|
|
201
|
+
return error instanceof Error ? error.message : String(error);
|
|
202
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type OpenerAccess } from "./doors.ts";
|
|
2
|
+
import type { OpenerHints } from "./hints.ts";
|
|
3
|
+
import { type WalletOpener } from "./sign.ts";
|
|
4
|
+
/** What a sign-in with a wallet answers. */
|
|
5
|
+
export interface WalletSignIn {
|
|
6
|
+
/** The NMTS key this wallet opened, in the form a person reads and types. */
|
|
7
|
+
accountCode: string;
|
|
8
|
+
/** The name the slot it opened is filed under — what `remove` takes. */
|
|
9
|
+
locator: string;
|
|
10
|
+
}
|
|
11
|
+
/** What attaching a wallet answers. ⛔ The signature that made it is not here and cannot be. */
|
|
12
|
+
export interface AttachedWallet {
|
|
13
|
+
locator: string;
|
|
14
|
+
kind: "wallet";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sign in with a wallet: sign once, ask for the slot that name finds, and open it.
|
|
18
|
+
*
|
|
19
|
+
* ⛔ THERE IS NO "WRONG SIGNATURE, RIGHT SLOT" CASE. The name the slot is filed under and the key
|
|
20
|
+
* that opens it come out of the same signature, so a signature that finds a slot opens it —
|
|
21
|
+
* which is why a failure to open is reported as a defect rather than as a wrong wallet.
|
|
22
|
+
*
|
|
23
|
+
* ⚠ AN ACCOUNT NUMBER IS INSIDE THE SIGNED BYTES, so nothing here can look for the others. A
|
|
24
|
+
* sign-in that finds nothing says so; trying 2, 3, 4 would mean asking the person to sign once
|
|
25
|
+
* per number, and the caller is the one that may ask.
|
|
26
|
+
*/
|
|
27
|
+
export declare function signInWithWallet(server: string, input: WalletOpener, hints?: OpenerHints): Promise<WalletSignIn>;
|
|
28
|
+
/**
|
|
29
|
+
* Attach this wallet to the account `accountCode` opens.
|
|
30
|
+
*
|
|
31
|
+
* ⛔ THE SIGNATURE IS TAKEN TWICE AND THE TWO MUST MATCH — see `withRepeatedSignature`. A wallet
|
|
32
|
+
* that signs differently the second time would seal a slot it could never open.
|
|
33
|
+
*
|
|
34
|
+
* ⛔ WHAT THIS CREATES IS A STANDING WAY INTO THE ACCOUNT. Whoever holds this wallet can open every
|
|
35
|
+
* file in it, from any machine, until the slot is removed. The server is given a locked lump it
|
|
36
|
+
* cannot open and a name it cannot trace to a wallet.
|
|
37
|
+
*
|
|
38
|
+
* ⛔ AND THE NAME IS ASKED FOR BEFORE ANYTHING IS SEALED OR SENT. One wallet at one account number
|
|
39
|
+
* reaches exactly one locator, so a slot already filed under it is either this account's — the
|
|
40
|
+
* wallet is attached already — or another account's, and a PUT would meet the server's flat
|
|
41
|
+
* "not found" (its deliberate answer for "not yours"). Both are said here instead, in the words
|
|
42
|
+
* that tell the person what to do about it.
|
|
43
|
+
*/
|
|
44
|
+
export declare function addWallet(access: OpenerAccess, accountCode: string, input: WalletOpener, hints?: OpenerHints): Promise<AttachedWallet>;
|
|
45
|
+
/**
|
|
46
|
+
* Refuse NOW if this wallet, at this account number, already opens an account on this server.
|
|
47
|
+
*
|
|
48
|
+
* ⛔ FOR THE ONE PATH WHERE THE ACCOUNT DOES NOT EXIST YET. `nmts create --wallet` would otherwise
|
|
49
|
+
* make an account, print its key, and only then learn that the wallet cannot be attached to it —
|
|
50
|
+
* leaving behind an account nobody asked for. One signature answers that before anything is
|
|
51
|
+
* created, and there is nothing to compare the slot against, so every slot found is another
|
|
52
|
+
* account's.
|
|
53
|
+
*/
|
|
54
|
+
export declare function refuseIfWalletOpensAnAccount(server: string, input: WalletOpener, hints?: OpenerHints): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Take one wallet off the account.
|
|
57
|
+
*
|
|
58
|
+
* ⛔ "FROM NOW ON", NOT "AS IF IT NEVER KNEW". A wallet that opened this account once has held the
|
|
59
|
+
* NMTS key. The only answer to that is a new account, and the screen or command that offers
|
|
60
|
+
* removal is where that sentence belongs.
|
|
61
|
+
*/
|
|
62
|
+
export declare function removeWallet(access: OpenerAccess, locator: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* The sealed 62 bytes filed under one locator — the file the recovery tool opens with a signature.
|
|
65
|
+
*
|
|
66
|
+
* ⛔ IT NEEDS NO CREDENTIAL AND PROVES NOTHING. Whoever has the locator can fetch these bytes, and
|
|
67
|
+
* they are worth nothing without the wallet: the name is derived from the same secret the key
|
|
68
|
+
* is. What it buys is that a person can keep their own copy and open their account with their
|
|
69
|
+
* wallet alone, with this server gone.
|
|
70
|
+
*/
|
|
71
|
+
export declare function walletSlot(server: string, locator: string): Promise<Uint8Array>;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// What a wallet actually does: open an account, be attached to one, be taken off one.
|
|
2
|
+
//
|
|
3
|
+
// ⛔ ONE IMPLEMENTATION, FOUR CALLERS — the command line, the SDK, a page and the recovery tool
|
|
4
|
+
// ask for the same acts with different surfaces around them. The order inside each act is the
|
|
5
|
+
// part that must not be written twice: which bytes are signed, what is compared against what,
|
|
6
|
+
// when the account's 20 key bytes exist and when they are wiped, and what the server is told.
|
|
7
|
+
//
|
|
8
|
+
// ⛔ NOTHING HERE PRINTS, PROMPTS, OR CHOOSES AN EXIT CODE. A terminal shows the address and asks;
|
|
9
|
+
// a page shows a button; a library caller decided by calling. Every refusal is thrown with a
|
|
10
|
+
// machine code at the front of it, and the sentence after that code is the caller's to replace.
|
|
11
|
+
//
|
|
12
|
+
// ⛔ THE ACCOUNT CODE IS BORROWED, NOT KEPT. `addWallet` takes it, parses it to the 20 bytes the
|
|
13
|
+
// engine seals, and wipes those bytes on every path out — including the failing one. What comes
|
|
14
|
+
// back from an attach is a locator and nothing else; what comes back from a sign-in IS the
|
|
15
|
+
// account, and it goes straight to whoever asked and nowhere else.
|
|
16
|
+
import { toBase64Url } from "../bytes.js";
|
|
17
|
+
import { loadCrypto } from "../crypto.js";
|
|
18
|
+
import { NmtsError } from "../errors.js";
|
|
19
|
+
import { fetchSlot, KIND_WALLET, putOpener, removeOpener, } from "./doors.js";
|
|
20
|
+
import { withRepeatedSignature, withSignature } from "./sign.js";
|
|
21
|
+
/**
|
|
22
|
+
* Sign in with a wallet: sign once, ask for the slot that name finds, and open it.
|
|
23
|
+
*
|
|
24
|
+
* ⛔ THERE IS NO "WRONG SIGNATURE, RIGHT SLOT" CASE. The name the slot is filed under and the key
|
|
25
|
+
* that opens it come out of the same signature, so a signature that finds a slot opens it —
|
|
26
|
+
* which is why a failure to open is reported as a defect rather than as a wrong wallet.
|
|
27
|
+
*
|
|
28
|
+
* ⚠ AN ACCOUNT NUMBER IS INSIDE THE SIGNED BYTES, so nothing here can look for the others. A
|
|
29
|
+
* sign-in that finds nothing says so; trying 2, 3, 4 would mean asking the person to sign once
|
|
30
|
+
* per number, and the caller is the one that may ask.
|
|
31
|
+
*/
|
|
32
|
+
export async function signInWithWallet(server, input, hints = {}) {
|
|
33
|
+
const glue = await loadCrypto();
|
|
34
|
+
return withSignature(input, async (serialized) => {
|
|
35
|
+
const locator = toBase64Url(glue.opener_locator(serialized));
|
|
36
|
+
const slot = await fetchSlot(server, locator);
|
|
37
|
+
if (slot === null) {
|
|
38
|
+
throw new NmtsError(
|
|
39
|
+
// Copy facts — the sentence. Facts: this wallet, at this account number, has no opener on
|
|
40
|
+
// this server; nothing was created and nothing was sent but the lookup. Another number
|
|
41
|
+
// needs another signature, because the number is inside what was signed.
|
|
42
|
+
"NO_OPENER_FOR_WALLET: no NMTS account on this server opens with this wallet.", {
|
|
43
|
+
exitCode: 4,
|
|
44
|
+
nextStep: hints.noOpener ??
|
|
45
|
+
"Nothing was opened. A different account number is a different message, so it needs a new signature.",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const key = glue.opener_open(serialized, slot);
|
|
49
|
+
try {
|
|
50
|
+
return { accountCode: glue.account_code_display(key), locator };
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
key.fill(0);
|
|
54
|
+
}
|
|
55
|
+
}, hints);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Attach this wallet to the account `accountCode` opens.
|
|
59
|
+
*
|
|
60
|
+
* ⛔ THE SIGNATURE IS TAKEN TWICE AND THE TWO MUST MATCH — see `withRepeatedSignature`. A wallet
|
|
61
|
+
* that signs differently the second time would seal a slot it could never open.
|
|
62
|
+
*
|
|
63
|
+
* ⛔ WHAT THIS CREATES IS A STANDING WAY INTO THE ACCOUNT. Whoever holds this wallet can open every
|
|
64
|
+
* file in it, from any machine, until the slot is removed. The server is given a locked lump it
|
|
65
|
+
* cannot open and a name it cannot trace to a wallet.
|
|
66
|
+
*
|
|
67
|
+
* ⛔ AND THE NAME IS ASKED FOR BEFORE ANYTHING IS SEALED OR SENT. One wallet at one account number
|
|
68
|
+
* reaches exactly one locator, so a slot already filed under it is either this account's — the
|
|
69
|
+
* wallet is attached already — or another account's, and a PUT would meet the server's flat
|
|
70
|
+
* "not found" (its deliberate answer for "not yours"). Both are said here instead, in the words
|
|
71
|
+
* that tell the person what to do about it.
|
|
72
|
+
*/
|
|
73
|
+
export async function addWallet(access, accountCode, input, hints = {}) {
|
|
74
|
+
const glue = await loadCrypto();
|
|
75
|
+
return withRepeatedSignature(input, async (serialized) => {
|
|
76
|
+
const locator = toBase64Url(glue.opener_locator(serialized));
|
|
77
|
+
const taken = await fetchSlot(access.server, locator);
|
|
78
|
+
if (taken !== null)
|
|
79
|
+
refuseTakenName(glue, serialized, taken, accountCode, input.account ?? 1, hints);
|
|
80
|
+
const key = keyBytes(glue.account_code_parse.bind(glue), accountCode);
|
|
81
|
+
let slot;
|
|
82
|
+
try {
|
|
83
|
+
slot = glue.opener_seal(serialized, key);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
key.fill(0);
|
|
87
|
+
}
|
|
88
|
+
await putOpener(access, locator, KIND_WALLET, slot);
|
|
89
|
+
return { locator, kind: "wallet" };
|
|
90
|
+
}, hints);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Refuse NOW if this wallet, at this account number, already opens an account on this server.
|
|
94
|
+
*
|
|
95
|
+
* ⛔ FOR THE ONE PATH WHERE THE ACCOUNT DOES NOT EXIST YET. `nmts create --wallet` would otherwise
|
|
96
|
+
* make an account, print its key, and only then learn that the wallet cannot be attached to it —
|
|
97
|
+
* leaving behind an account nobody asked for. One signature answers that before anything is
|
|
98
|
+
* created, and there is nothing to compare the slot against, so every slot found is another
|
|
99
|
+
* account's.
|
|
100
|
+
*/
|
|
101
|
+
export async function refuseIfWalletOpensAnAccount(server, input, hints = {}) {
|
|
102
|
+
const glue = await loadCrypto();
|
|
103
|
+
await withSignature(input, async (serialized) => {
|
|
104
|
+
const locator = toBase64Url(glue.opener_locator(serialized));
|
|
105
|
+
if ((await fetchSlot(server, locator)) !== null)
|
|
106
|
+
throw opensAnother(input.account ?? 1, hints);
|
|
107
|
+
}, hints);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* What a locator that is already taken means, said as one of two refusals.
|
|
111
|
+
*
|
|
112
|
+
* ⛔ THE PROBE'S OPENED KEY IS A SECRET LIKE ANY OTHER. It is compared and wiped on every path out,
|
|
113
|
+
* including the throwing ones, and it is never returned, printed or put in a message.
|
|
114
|
+
*
|
|
115
|
+
* ⚠ A SLOT THAT WILL NOT OPEN COUNTS AS ANOTHER ACCOUNT'S. The name comes from the same signature
|
|
116
|
+
* the opening key does, so this cannot happen to a sound slot; what it must never become is a
|
|
117
|
+
* PUT that walks into the server's "not found".
|
|
118
|
+
*/
|
|
119
|
+
function refuseTakenName(glue, serialized, slot, accountCode, account, hints) {
|
|
120
|
+
let opened = null;
|
|
121
|
+
let mine = null;
|
|
122
|
+
try {
|
|
123
|
+
try {
|
|
124
|
+
opened = glue.opener_open(serialized, slot);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
opened = null;
|
|
128
|
+
}
|
|
129
|
+
if (opened !== null) {
|
|
130
|
+
const key = keyBytes(glue.account_code_parse.bind(glue), accountCode);
|
|
131
|
+
mine = key;
|
|
132
|
+
if (opened.length === key.length && opened.every((byte, at) => byte === key[at])) {
|
|
133
|
+
throw new NmtsError("WALLET_ALREADY_ATTACHED: this wallet already opens this account.", {
|
|
134
|
+
exitCode: 4,
|
|
135
|
+
nextStep: hints.alreadyAttached ?? "Nothing was stored.",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
throw opensAnother(account, hints);
|
|
140
|
+
}
|
|
141
|
+
finally {
|
|
142
|
+
opened?.fill(0);
|
|
143
|
+
mine?.fill(0);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** The refusal for a name that belongs to an account this key does not open. */
|
|
147
|
+
function opensAnother(account, hints) {
|
|
148
|
+
return new NmtsError(`WALLET_OPENS_ANOTHER_ACCOUNT: under account number ${account}, this wallet already opens another NMTS account.`, {
|
|
149
|
+
exitCode: 4,
|
|
150
|
+
nextStep: hints.opensAnother ??
|
|
151
|
+
"Nothing was stored. One wallet and one number open one account: use another account number, and the same number when signing in.",
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Take one wallet off the account.
|
|
156
|
+
*
|
|
157
|
+
* ⛔ "FROM NOW ON", NOT "AS IF IT NEVER KNEW". A wallet that opened this account once has held the
|
|
158
|
+
* NMTS key. The only answer to that is a new account, and the screen or command that offers
|
|
159
|
+
* removal is where that sentence belongs.
|
|
160
|
+
*/
|
|
161
|
+
export async function removeWallet(access, locator) {
|
|
162
|
+
await removeOpener(access, requiredLocator(locator));
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The sealed 62 bytes filed under one locator — the file the recovery tool opens with a signature.
|
|
166
|
+
*
|
|
167
|
+
* ⛔ IT NEEDS NO CREDENTIAL AND PROVES NOTHING. Whoever has the locator can fetch these bytes, and
|
|
168
|
+
* they are worth nothing without the wallet: the name is derived from the same secret the key
|
|
169
|
+
* is. What it buys is that a person can keep their own copy and open their account with their
|
|
170
|
+
* wallet alone, with this server gone.
|
|
171
|
+
*/
|
|
172
|
+
export async function walletSlot(server, locator) {
|
|
173
|
+
const slot = await fetchSlot(server, requiredLocator(locator));
|
|
174
|
+
if (slot === null) {
|
|
175
|
+
throw new NmtsError("OPENER_NOT_FOUND: this server has no slot filed under that name.", {
|
|
176
|
+
exitCode: 4,
|
|
177
|
+
// Copy facts — the next step. Fact: an unknown name, a malformed one and somebody else's are
|
|
178
|
+
// one answer on purpose — any difference between them is a way to learn which names exist.
|
|
179
|
+
nextStep: "Nothing was fetched. The list of this account's openers has the names it holds.",
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return slot;
|
|
183
|
+
}
|
|
184
|
+
/** A locator that is at least present. What it NAMES is the server's to judge. */
|
|
185
|
+
function requiredLocator(locator) {
|
|
186
|
+
if (locator.trim() === "") {
|
|
187
|
+
throw new NmtsError("OPENER_LOCATOR_MISSING: no opener was named.", {
|
|
188
|
+
exitCode: 2,
|
|
189
|
+
nextStep: "Nothing was sent. Name the opener by the locator the list prints.",
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return locator.trim();
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The account's 20 key bytes, with the one refusal this tool words for a code that is not one.
|
|
196
|
+
*
|
|
197
|
+
* ⚠ The engine's own message is not repeated: it can contain the input, and the input here is the
|
|
198
|
+
* account itself.
|
|
199
|
+
*/
|
|
200
|
+
function keyBytes(parse, accountCode) {
|
|
201
|
+
try {
|
|
202
|
+
return parse(accountCode);
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
throw new NmtsError("ACCOUNT_CODE_INVALID: that is not a valid NMTS key.", {
|
|
206
|
+
exitCode: 2,
|
|
207
|
+
nextStep: "Nothing was stored. The last character is a check symbol; look for a mistyped one.",
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SignWallet } from "./openers.ts";
|
|
2
|
+
/** A wallet this run can ask for signatures: which address it is, and how to ask. */
|
|
3
|
+
export interface KeyFileWallet {
|
|
4
|
+
address: string;
|
|
5
|
+
sign: SignWallet;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The wallet held in `path`, ready to sign the opener message.
|
|
9
|
+
*
|
|
10
|
+
* The file holds one `suiprivkey1…` line — what `sui keytool export` writes and what every Sui
|
|
11
|
+
* tool reads. Surrounding whitespace and a trailing newline are ignored, because writing a secret
|
|
12
|
+
* to a file with `echo` appends one and refusing it would be a puzzle with no clue.
|
|
13
|
+
*/
|
|
14
|
+
export declare function walletFromKeyFile(path: string): KeyFileWallet;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// The only wallet a terminal has: one `suiprivkey1…` line in a file this run is pointed at.
|
|
2
|
+
//
|
|
3
|
+
// ⛔ THE VALUE IS NEVER AN ARGUMENT AND NEVER PRINTED. A secret on a command line is readable by
|
|
4
|
+
// any process on the machine and is recorded by the shell, which is why every option table in
|
|
5
|
+
// this tool names paths and not values (`args.ts`). What this file takes is a PATH; what it
|
|
6
|
+
// hands back is a function that signs one message, and an address.
|
|
7
|
+
//
|
|
8
|
+
// ⛔ AND THE KEY DOES NOT COME BACK OUT. `wallet-sign.ts` keeps that rule for the wallets this
|
|
9
|
+
// account's own NMTS key derives; this is the other kind — somebody else's wallet, held for one
|
|
10
|
+
// run — and the rule is the same: the keypair is built inside a closure, asked for signatures
|
|
11
|
+
// over one message, and never returned, logged or copied.
|
|
12
|
+
//
|
|
13
|
+
// ⛔ IT CATCHES ITS OWN PARSER. `errors.ts` says why: an unknown error's message goes to stderr
|
|
14
|
+
// verbatim, and a decoder that fails on a secret-bearing file has been measured quoting the
|
|
15
|
+
// input back. Every failure below is this tool's own sentence, naming the path and never the
|
|
16
|
+
// contents.
|
|
17
|
+
//
|
|
18
|
+
// ⚠ NODE ONLY, WHICH IS WHY IT IS NOT IN `openers/`. That folder is bundled into a page by the
|
|
19
|
+
// SDK's browser entry; a page's wallet is an extension, and this one is a file on a disk.
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
21
|
+
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
22
|
+
import { Secp256k1Keypair } from "@mysten/sui/keypairs/secp256k1";
|
|
23
|
+
import { Secp256r1Keypair } from "@mysten/sui/keypairs/secp256r1";
|
|
24
|
+
import { decodeSuiPrivateKey } from "@mysten/sui/cryptography";
|
|
25
|
+
import { NmtsError } from "./errors.js";
|
|
26
|
+
/**
|
|
27
|
+
* The wallet held in `path`, ready to sign the opener message.
|
|
28
|
+
*
|
|
29
|
+
* The file holds one `suiprivkey1…` line — what `sui keytool export` writes and what every Sui
|
|
30
|
+
* tool reads. Surrounding whitespace and a trailing newline are ignored, because writing a secret
|
|
31
|
+
* to a file with `echo` appends one and refusing it would be a puzzle with no clue.
|
|
32
|
+
*/
|
|
33
|
+
export function walletFromKeyFile(path) {
|
|
34
|
+
const keypair = keypairFrom(readOneLine(path), path);
|
|
35
|
+
return {
|
|
36
|
+
address: keypair.toSuiAddress(),
|
|
37
|
+
// ⛔ THE CLOSURE HOLDS THE KEYPAIR AND NOTHING HOLDS THE CLOSURE PAST THE RUN. What it answers
|
|
38
|
+
// is the wallet standard's own pair — the serialized signature, and the bytes it signed, so
|
|
39
|
+
// that the layer above compares them against the message it built rather than trusting it.
|
|
40
|
+
sign: async (message) => keypair.signPersonalMessage(message),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** The first line with anything on it, or this tool's own refusal. */
|
|
44
|
+
function readOneLine(path) {
|
|
45
|
+
let raw;
|
|
46
|
+
try {
|
|
47
|
+
raw = readFileSync(path, "utf8");
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// ⛔ THE CAUSE IS NOT CARRIED. Node's own message for a read failure quotes the path, which is
|
|
51
|
+
// fine, but a decoding failure inside it would quote the contents, which is not.
|
|
52
|
+
throw new NmtsError(`Could not read ${path}.`, {
|
|
53
|
+
exitCode: 2,
|
|
54
|
+
// Copy facts — the next step. Facts: the file holds one line beginning `suiprivkey1`, it is
|
|
55
|
+
// read and never copied or written to, and nothing was signed.
|
|
56
|
+
nextStep: "Nothing was signed. Point --sui-key-file at a file holding one `suiprivkey1…` line.",
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const line = raw.split("\n").map((l) => l.trim()).find((l) => l !== "");
|
|
60
|
+
if (line === undefined || !line.startsWith("suiprivkey1")) {
|
|
61
|
+
throw new NmtsError(`${path} does not hold a Sui private key.`, {
|
|
62
|
+
exitCode: 2,
|
|
63
|
+
nextStep: "Nothing was signed. The file holds one line beginning `suiprivkey1`.",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return line;
|
|
67
|
+
}
|
|
68
|
+
/** The keypair that line names, for the three schemes an opener may use. */
|
|
69
|
+
function keypairFrom(line, path) {
|
|
70
|
+
let decoded;
|
|
71
|
+
try {
|
|
72
|
+
decoded = decodeSuiPrivateKey(line);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
throw new NmtsError(`${path} does not hold a Sui private key this version can read.`, {
|
|
76
|
+
exitCode: 2,
|
|
77
|
+
nextStep: "Nothing was signed. The line is the one `sui keytool export` writes.",
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const { scheme, secretKey } = decoded;
|
|
81
|
+
try {
|
|
82
|
+
if (scheme === "ED25519")
|
|
83
|
+
return Ed25519Keypair.fromSecretKey(secretKey);
|
|
84
|
+
if (scheme === "Secp256k1")
|
|
85
|
+
return Secp256k1Keypair.fromSecretKey(secretKey);
|
|
86
|
+
if (scheme === "Secp256r1")
|
|
87
|
+
return Secp256r1Keypair.fromSecretKey(secretKey);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
// The keypair copied what it needed; this buffer is the only other one.
|
|
91
|
+
secretKey.fill(0);
|
|
92
|
+
}
|
|
93
|
+
// ⚠ An allow list, exactly as the layer above keeps: a scheme nobody has judged is refused for
|
|
94
|
+
// being unknown rather than let through for being new.
|
|
95
|
+
throw new NmtsError(`WALLET_UNKNOWN_SCHEME: ${path} holds a ${scheme} key.`, {
|
|
96
|
+
exitCode: 4,
|
|
97
|
+
nextStep: "Nothing was signed. An opener is held by an Ed25519, secp256k1 or secp256r1 wallet.",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { OpenerHints } from "./openers/hints.ts";
|
|
2
|
+
export { fetchSlot, KIND_PASSKEY, KIND_WALLET, listOpeners, putOpener, removeOpener, } from "./openers/doors.ts";
|
|
3
|
+
export type { OpenerAccess, OpenerInfo, OpenerListing } from "./openers/doors.ts";
|
|
4
|
+
export { openerMessage, withRepeatedSignature, withSignature } from "./openers/sign.ts";
|
|
5
|
+
export type { SignedMessage, SignWallet, WalletOpener, WalletSignature } from "./openers/sign.ts";
|
|
6
|
+
export { addWallet, refuseIfWalletOpensAnAccount, removeWallet, signInWithWallet, walletSlot, } from "./openers/wallet.ts";
|
|
7
|
+
export type { AttachedWallet, WalletSignIn } from "./openers/wallet.ts";
|
package/dist/openers.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Wallet sign-in without a terminal: the message, the signature's judgement, and the four doors an
|
|
2
|
+
// opener travels through — decided and handed back rather than printed.
|
|
3
|
+
//
|
|
4
|
+
// ⛔ ONE IMPLEMENTATION, FOUR CALLERS, which is the whole reason this entry exists. `nmts login
|
|
5
|
+
// --wallet`, `nmts openers`, the SDK and a page are surfaces over these functions: the prompt,
|
|
6
|
+
// the key file, the button, the exit code belong to them. A second implementation of "which
|
|
7
|
+
// bytes are signed, what is compared, when the key bytes are wiped" would be a second place for
|
|
8
|
+
// rules about the account's root secret to be got right — and the copy nobody re-reads is the
|
|
9
|
+
// one that quietly disagrees.
|
|
10
|
+
//
|
|
11
|
+
// ⛔ WHAT A CALLER IMPORTS IS THIS NAME — `@needmoretruth/nmts-cli/openers` — so the pieces in
|
|
12
|
+
// `openers/` can be split and joined without a single caller changing. Nothing in the folder
|
|
13
|
+
// reaches for `node:`: the SDK's browser entry bundles what this exports, and the one thing
|
|
14
|
+
// that does touch a disk (reading a `suiprivkey1…` file) is the command line's own.
|
|
15
|
+
//
|
|
16
|
+
// ⛔ AND NOTHING IN THE FOLDER KEEPS A SIGNATURE. It is lent to one piece of work and dropped;
|
|
17
|
+
// nothing exported from here answers with it, and `cli/test/openers.test.ts` proves that the
|
|
18
|
+
// objects these functions return cannot reach one.
|
|
19
|
+
export { fetchSlot, KIND_PASSKEY, KIND_WALLET, listOpeners, putOpener, removeOpener, } from "./openers/doors.js";
|
|
20
|
+
export { openerMessage, withRepeatedSignature, withSignature } from "./openers/sign.js";
|
|
21
|
+
export { addWallet, refuseIfWalletOpensAnAccount, removeWallet, signInWithWallet, walletSlot, } from "./openers/wallet.js";
|
package/dist/product.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const BINARY_NAME = "nmts";
|
|
|
9
9
|
* beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
|
|
10
10
|
* command importing the entry point is a cycle waiting to bite.
|
|
11
11
|
*/
|
|
12
|
-
export declare const VERSION = "0.
|
|
12
|
+
export declare const VERSION = "0.41.0";
|
|
13
13
|
/** Where the product lives, for messages that need to send somebody somewhere real. */
|
|
14
14
|
export declare const HOME_URL = "https://nmts.me";
|
|
15
15
|
/** The source, so a person holding only the built program can find what it was built from. */
|
package/dist/product.js
CHANGED
|
@@ -18,7 +18,7 @@ export const BINARY_NAME = "nmts";
|
|
|
18
18
|
* beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
|
|
19
19
|
* command importing the entry point is a cycle waiting to bite.
|
|
20
20
|
*/
|
|
21
|
-
export const VERSION = "0.
|
|
21
|
+
export const VERSION = "0.41.0";
|
|
22
22
|
/** Where the product lives, for messages that need to send somebody somewhere real. */
|
|
23
23
|
export const HOME_URL = "https://nmts.me";
|
|
24
24
|
/** The source, so a person holding only the built program can find what it was built from. */
|