@did-btcr2/cli 0.16.0 → 0.18.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/README.md +33 -8
- package/dist/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +640 -128
- package/dist/esm/src/cli.js +2 -1
- package/dist/esm/src/cli.js.map +1 -1
- package/dist/esm/src/commands/create.js +4 -0
- package/dist/esm/src/commands/create.js.map +1 -1
- package/dist/esm/src/commands/deactivate.js +2 -0
- package/dist/esm/src/commands/deactivate.js.map +1 -1
- package/dist/esm/src/commands/index.js +1 -0
- package/dist/esm/src/commands/index.js.map +1 -1
- package/dist/esm/src/commands/init.js +89 -40
- package/dist/esm/src/commands/init.js.map +1 -1
- package/dist/esm/src/commands/keystore.js +126 -8
- package/dist/esm/src/commands/keystore.js.map +1 -1
- package/dist/esm/src/commands/quickstart.js +158 -0
- package/dist/esm/src/commands/quickstart.js.map +1 -0
- package/dist/esm/src/commands/update.js +2 -0
- package/dist/esm/src/commands/update.js.map +1 -1
- package/dist/esm/src/config.js +93 -6
- package/dist/esm/src/config.js.map +1 -1
- package/dist/esm/src/hints.js +54 -0
- package/dist/esm/src/hints.js.map +1 -0
- package/dist/esm/src/keystore/file-key-store.js +48 -0
- package/dist/esm/src/keystore/file-key-store.js.map +1 -1
- package/dist/esm/src/keystore/passphrase.js +13 -0
- package/dist/esm/src/keystore/passphrase.js.map +1 -1
- package/dist/esm/src/keystore/session.js +250 -0
- package/dist/esm/src/keystore/session.js.map +1 -0
- package/dist/esm/src/paths.js +12 -0
- package/dist/esm/src/paths.js.map +1 -1
- package/dist/esm/src/types.js.map +1 -1
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/commands/create.d.ts.map +1 -1
- package/dist/types/src/commands/deactivate.d.ts.map +1 -1
- package/dist/types/src/commands/index.d.ts +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -1
- package/dist/types/src/commands/init.d.ts +52 -5
- package/dist/types/src/commands/init.d.ts.map +1 -1
- package/dist/types/src/commands/keystore.d.ts +41 -4
- package/dist/types/src/commands/keystore.d.ts.map +1 -1
- package/dist/types/src/commands/quickstart.d.ts +12 -0
- package/dist/types/src/commands/quickstart.d.ts.map +1 -0
- package/dist/types/src/commands/update.d.ts.map +1 -1
- package/dist/types/src/config.d.ts +35 -0
- package/dist/types/src/config.d.ts.map +1 -1
- package/dist/types/src/hints.d.ts +24 -0
- package/dist/types/src/hints.d.ts.map +1 -0
- package/dist/types/src/keystore/file-key-store.d.ts +16 -0
- package/dist/types/src/keystore/file-key-store.d.ts.map +1 -1
- package/dist/types/src/keystore/passphrase.d.ts +10 -0
- package/dist/types/src/keystore/passphrase.d.ts.map +1 -1
- package/dist/types/src/keystore/session.d.ts +105 -0
- package/dist/types/src/keystore/session.d.ts.map +1 -0
- package/dist/types/src/paths.d.ts +10 -0
- package/dist/types/src/paths.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +32 -0
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/cli.ts +2 -0
- package/src/commands/create.ts +4 -0
- package/src/commands/deactivate.ts +2 -0
- package/src/commands/index.ts +1 -0
- package/src/commands/init.ts +148 -50
- package/src/commands/keystore.ts +183 -9
- package/src/commands/quickstart.ts +209 -0
- package/src/commands/update.ts +2 -0
- package/src/config.ts +103 -6
- package/src/hints.ts +51 -0
- package/src/keystore/file-key-store.ts +43 -0
- package/src/keystore/passphrase.ts +23 -0
- package/src/keystore/session.ts +303 -0
- package/src/paths.ts +13 -0
- package/src/types.ts +16 -2
|
@@ -227,6 +227,41 @@ export declare function resolveActiveProfile(file: ConfigFile | undefined, overr
|
|
|
227
227
|
* identifier encodes.
|
|
228
228
|
*/
|
|
229
229
|
export declare function resolveDefaultNetwork(overrides?: ConnectionOverrides): NetworkOption;
|
|
230
|
+
/**
|
|
231
|
+
* The network recorded at `defaults.network` in the config file, validated, or
|
|
232
|
+
* `undefined` when the file is absent, malformed, or the value is unset/unknown.
|
|
233
|
+
* Unlike {@link resolveDefaultNetwork} this consults ONLY the raw
|
|
234
|
+
* `defaults.network` (no profile fallback, no regtest default), so `quickstart`
|
|
235
|
+
* can distinguish "the operator set a default" from "there is none yet" before
|
|
236
|
+
* it writes (ADR 083). Never throws: a malformed config is surfaced loudly by
|
|
237
|
+
* the write path, so this pre-write read stays quiet.
|
|
238
|
+
*/
|
|
239
|
+
export declare function readConfiguredDefaultNetwork(overrides?: ConnectionOverrides): NetworkOption | undefined;
|
|
240
|
+
/**
|
|
241
|
+
* Persists `defaults.network` idempotently and returns the resolved network,
|
|
242
|
+
* the shared network-recording step behind `btcr2 init -n` and `btcr2 quickstart`
|
|
243
|
+
* (ADR 083). Writes when `explicit` (an explicit `-n`) is given, or when a
|
|
244
|
+
* `fallback` is given and the raw config has no `defaults.network` yet. Keyed on
|
|
245
|
+
* the **raw** file value (not {@link resolveDefaultNetwork}, which never returns
|
|
246
|
+
* undefined), so a defaulted re-run never clobbers a network the operator set
|
|
247
|
+
* earlier. When neither condition writes, the existing default is returned
|
|
248
|
+
* unchanged. Assumes `configPath` names a parseable config (the caller has just
|
|
249
|
+
* scaffolded one, or an existing one that a malformed-JSON read surfaces loudly).
|
|
250
|
+
*/
|
|
251
|
+
export declare function persistDefaultNetwork(configPath: string, opts: {
|
|
252
|
+
explicit?: NetworkOption;
|
|
253
|
+
fallback?: NetworkOption;
|
|
254
|
+
overrides?: ConnectionOverrides;
|
|
255
|
+
}): {
|
|
256
|
+
network: NetworkOption;
|
|
257
|
+
wrote: boolean;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Validates an explicit network string against {@link SUPPORTED_NETWORKS},
|
|
261
|
+
* returning it typed as a {@link NetworkOption} or throwing a {@link CLIError}.
|
|
262
|
+
* Shared by the `-n/--network` flags on `init` and `quickstart` (ADR 083).
|
|
263
|
+
*/
|
|
264
|
+
export declare function assertSupportedNetwork(value: string): NetworkOption;
|
|
230
265
|
/**
|
|
231
266
|
* Reports a coherence conflict between the network a `create` run is about to
|
|
232
267
|
* encode and the network the active profile declares, so the CLI can warn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8E,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrK,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8E,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrK,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAU1D,OAAO,EAAE,iBAAiB,EAAsB,MAAM,YAAY,CAAC;AACnE,OAAO,EAAoC,KAAK,uBAAuB,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnI,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAU,MAAM,CAAC;IACzB,SAAS,CAAC,EAAQ,MAAM,CAAC;IACzB,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,mDAAmD;IACnD,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,kEAAkE;IAClE,SAAS,CAAC,EAAQ,MAAM,CAAC;IACzB,8EAA8E;IAC9E,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,+EAA+E;IAC/E,UAAU,CAAC,EAAO,MAAM,CAAC;IACzB,+EAA+E;IAC/E,aAAa,CAAC,EAAI,MAAM,EAAE,CAAC;IAC3B,2DAA2D;IAC3D,YAAY,CAAC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OAAO,CAAC,YAAY,CAAC,CAmC9G;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAEvG;AAwCD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,uBAAuB,CAElG;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAW7G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAa5G;AAoBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAKxG;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAUxD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GlobalOptions, NetworkOption } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Text-mode stderr hints derived from the per-network presets (ADR 082). All of
|
|
4
|
+
* these are suppressed under `--quiet` and `--output json` so machine output is
|
|
5
|
+
* never touched, and they never throw: a presentation hint must never break the
|
|
6
|
+
* command that produced the real result.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Prints a funding hint after a KEY `create` on a network with a public faucet:
|
|
10
|
+
* the derived initial P2WPKH beacon address next to the faucet and explorer
|
|
11
|
+
* links the operator would otherwise hand-copy. A no-op on a network without a
|
|
12
|
+
* faucet (regtest/mainnet), which also keeps mainnet from showing a fund-me
|
|
13
|
+
* affordance. The beacon address is derived from the DID string alone via
|
|
14
|
+
* {@link BeaconUtils.createBeaconService}, so it matches the resolver's
|
|
15
|
+
* `#initialP2WPKH` service rather than a divergent re-derivation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function printCreateFundingHint(g: GlobalOptions, network: NetworkOption, did: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Prints a watch link after an `update`/`deactivate` broadcast: the
|
|
20
|
+
* block-explorer URL for the signal txid. A no-op on a network without an
|
|
21
|
+
* explorer (regtest).
|
|
22
|
+
*/
|
|
23
|
+
export declare function printWatchHint(g: GlobalOptions, network: NetworkOption, txid: string): void;
|
|
24
|
+
//# sourceMappingURL=hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../../../src/hints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAmBlG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAI3F"}
|
|
@@ -115,6 +115,22 @@ export interface KeystoreSummary {
|
|
|
115
115
|
export declare function keystoreSummary(path: string): KeystoreSummary;
|
|
116
116
|
/** The protection label of a keystore file, without decrypting or prompting. */
|
|
117
117
|
export declare function keystoreProtection(path: string): KeystoreProtectionLabel;
|
|
118
|
+
/**
|
|
119
|
+
* A stable fingerprint of a keystore's passphrase verifier, or `undefined` when
|
|
120
|
+
* the file is absent, unparsable, or carries no verifier. Compared by equality
|
|
121
|
+
* to detect a rotated passphrase (`change-passphrase`, `init --force`) or a
|
|
122
|
+
* re-established keystore, so a cached session (ADR 081) stops matching a
|
|
123
|
+
* keystore whose passphrase has changed. Never decrypts, never throws.
|
|
124
|
+
*/
|
|
125
|
+
export declare function keystoreVerifierId(path: string): string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Checks a candidate passphrase against the keystore's verifier without
|
|
128
|
+
* constructing a store or opening any key. Returns `false` for an absent,
|
|
129
|
+
* unparsable, dev, or verifier-less keystore and for a wrong passphrase; `true`
|
|
130
|
+
* only when the passphrase opens the verifier sentinel. Never throws. Used by
|
|
131
|
+
* `keystore unlock` (ADR 081) to refuse caching a wrong passphrase.
|
|
132
|
+
*/
|
|
133
|
+
export declare function verifyKeystorePassphrase(path: string, passphrase: string): boolean;
|
|
118
134
|
/** Options for {@link initKeystore}. */
|
|
119
135
|
export interface InitKeystoreOptions {
|
|
120
136
|
protection: KeystoreProtection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-key-store.d.ts","sourceRoot":"","sources":["../../../../src/keystore/file-key-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-key-store.d.ts","sourceRoot":"","sources":["../../../../src/keystore/file-key-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAG3D,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,EAAG,CAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,G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MAAM,GAAG,MAAM;CA0DvE;AAED,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAI,uBAAuB,CAAC;IACtC,WAAW,EAAG,OAAO,CAAC;IACtB,QAAQ,EAAM,MAAM,CAAC;IACrB,MAAM,EAAQ,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CA0B7D;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUnE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAclF;AAED,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAM,kBAAkB,CAAC;IACnC,aAAa,EAAG,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,CAAC;IACzD,WAAW,CAAC,EAAI,WAAW,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAW7E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAY,MAAM,EACtB,aAAa,EAAG,MAAM,EACtB,aAAa,EAAG,MAAM,EACtB,WAAW,CAAC,EAAI,WAAW,GAC1B,MAAM,CAaR"}
|
|
@@ -15,6 +15,16 @@ export type PassphraseOptions = {
|
|
|
15
15
|
* satisfy the new one (which would make the change a no-op).
|
|
16
16
|
*/
|
|
17
17
|
forcePrompt?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* An optional non-interactive source consulted *after* the env var and
|
|
20
|
+
* passphrase file and *before* the terminal prompt (and before the "no TTY"
|
|
21
|
+
* failure). The session unlock agent (ADR 081) wires this to a cached
|
|
22
|
+
* passphrase, so a returning command consumes the session instead of
|
|
23
|
+
* prompting, and a non-interactive follow-on command does not hard-fail. It
|
|
24
|
+
* returns `undefined` when no session is available. Skipped when `forcePrompt`
|
|
25
|
+
* is set, and never wired during passphrase establishment (`confirm`).
|
|
26
|
+
*/
|
|
27
|
+
beforePrompt?: () => string | undefined;
|
|
18
28
|
};
|
|
19
29
|
/**
|
|
20
30
|
* Acquires a passphrase without ever reading it from a command-line flag value
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passphrase.d.ts","sourceRoot":"","sources":["../../../../src/keystore/passphrase.ts"],"names":[],"mappings":"AAGA,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"passphrase.d.ts","sourceRoot":"","sources":["../../../../src/keystore/passphrase.ts"],"names":[],"mappings":"AAGA,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AAEnE,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAwCzE;AAuBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAGtD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session unlock agent (ADR 081). `keystore unlock` caches the verified
|
|
3
|
+
* keystore passphrase in a single `<home>/session.json`, and subsequent commands
|
|
4
|
+
* read it in place of a prompt until it expires or `keystore lock` revokes it.
|
|
5
|
+
*
|
|
6
|
+
* This is an on-disk v1 design. The cached passphrase is base64url-*encoded*, not
|
|
7
|
+
* encrypted: its only protection at rest is the file's `0600` mode. That is the
|
|
8
|
+
* deliberate, documented cost of a portable, minimal-diff convenience; a future
|
|
9
|
+
* in-memory agent (v2) that never persists the secret is the real fix. Every read
|
|
10
|
+
* here is defensive and never throws, so a bad or hostile session degrades to a
|
|
11
|
+
* passphrase prompt rather than a crash.
|
|
12
|
+
*/
|
|
13
|
+
/** Current session-file format version. */
|
|
14
|
+
export declare const SESSION_VERSION: 1;
|
|
15
|
+
/** Default session lifetime: one hour. */
|
|
16
|
+
export declare const DEFAULT_SESSION_TTL_MS: number;
|
|
17
|
+
/** Hard cap on a cached-passphrase lifetime: 24 hours. A longer TTL is refused. */
|
|
18
|
+
export declare const MAX_SESSION_TTL_MS: number;
|
|
19
|
+
/** Environment variable supplying a default TTL below the `--ttl` flag. */
|
|
20
|
+
export declare const ENV_KEYSTORE_TTL = "BTCR2_KEYSTORE_TTL";
|
|
21
|
+
/**
|
|
22
|
+
* The on-disk session file. `passphrase` is base64url(utf8(passphrase)): an
|
|
23
|
+
* encoding, not encryption. `keystore` binds the session to one keystore, and
|
|
24
|
+
* `verifierId` (a hash of that keystore's verifier) invalidates the session when
|
|
25
|
+
* the passphrase is rotated. `allowMainnet` records whether the operator unlocked
|
|
26
|
+
* with `--allow-mainnet`; a session without it is withheld from a `bitcoin`
|
|
27
|
+
* operation so mainnet keeps per-use authentication (ADR 081). No derived key,
|
|
28
|
+
* keystore ciphertext, or signing-key bytes ever appear here.
|
|
29
|
+
*/
|
|
30
|
+
export interface SessionFile {
|
|
31
|
+
v: typeof SESSION_VERSION;
|
|
32
|
+
keystore: string;
|
|
33
|
+
verifierId: string;
|
|
34
|
+
passphrase: string;
|
|
35
|
+
allowMainnet: boolean;
|
|
36
|
+
createdAt: number;
|
|
37
|
+
expiresAt: number;
|
|
38
|
+
ttlSeconds: number;
|
|
39
|
+
}
|
|
40
|
+
/** Inputs for {@link writeSession}. */
|
|
41
|
+
export interface WriteSessionInput {
|
|
42
|
+
/** The keystore this session unlocks (stored resolved/normalized). */
|
|
43
|
+
keystorePath: string;
|
|
44
|
+
/** Fingerprint of the keystore verifier, from `keystoreVerifierId`. */
|
|
45
|
+
verifierId: string;
|
|
46
|
+
/** The verified passphrase to cache. */
|
|
47
|
+
passphrase: string;
|
|
48
|
+
/** Lifetime in milliseconds. */
|
|
49
|
+
ttlMs: number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this session may be consumed for a mainnet (`bitcoin`) operation,
|
|
52
|
+
* from the `unlock --allow-mainnet` flag. Defaults to `false` (deny), so
|
|
53
|
+
* mainnet operations fall through to a per-use passphrase prompt (ADR 081).
|
|
54
|
+
*/
|
|
55
|
+
allowMainnet?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Writes the session file atomically at `0600` (temp sibling + rename), returning
|
|
59
|
+
* the written record so the caller can report expiry without re-reading. The
|
|
60
|
+
* caller is responsible for verifying the passphrase first; this only persists it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function writeSession(sessionPath: string, input: WriteSessionInput): SessionFile;
|
|
63
|
+
/**
|
|
64
|
+
* Deletes the session file and any crash-orphaned `writeFileAtomic` temp sibling
|
|
65
|
+
* (each of which would hold a plaintext passphrase). Idempotent; needs no
|
|
66
|
+
* passphrase. Returns whether a session file was present. Unlink is best-effort:
|
|
67
|
+
* it removes the name, it does not securely erase the bytes (see ADR 081).
|
|
68
|
+
*/
|
|
69
|
+
export declare function clearSession(sessionPath: string): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the cached passphrase for `keystorePath` when a live, matching session
|
|
72
|
+
* exists, else `undefined`. Never throws. A session that is expired, stale (the
|
|
73
|
+
* keystore passphrase rotated), future-dated, or malformed is pruned on read; a
|
|
74
|
+
* live session bound to a *different* keystore is left in place (it prompts for
|
|
75
|
+
* the current keystore instead).
|
|
76
|
+
*
|
|
77
|
+
* `isMainnetOperation` gates the one case the network is known at consumption: a
|
|
78
|
+
* live session that was not unlocked with `--allow-mainnet` is withheld from a
|
|
79
|
+
* `bitcoin` operation (returning `undefined` so the caller falls through to a
|
|
80
|
+
* per-use prompt) but *not* pruned, since it remains valid for the non-mainnet
|
|
81
|
+
* operations the operator unlocked for (ADR 081).
|
|
82
|
+
*/
|
|
83
|
+
export declare function readLiveSessionPassphrase(sessionPath: string, keystorePath: string, currentVerifierId: string | undefined, isMainnetOperation?: boolean): string | undefined;
|
|
84
|
+
/** Public, redacted view of the session state for `keystore status`. Never emits the passphrase. */
|
|
85
|
+
export interface SessionStatus {
|
|
86
|
+
active: boolean;
|
|
87
|
+
expiresAt?: number;
|
|
88
|
+
secondsRemaining?: number;
|
|
89
|
+
/** Whether the session may sign a mainnet operation prompt-free (unlocked with `--allow-mainnet`). */
|
|
90
|
+
allowMainnet?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Reports whether a live session exists for `keystorePath` and its remaining
|
|
94
|
+
* lifetime, without decrypting, prompting, throwing, or emitting the passphrase.
|
|
95
|
+
* An expired, foreign, stale, or malformed session reports inactive. Read-only:
|
|
96
|
+
* unlike {@link readLiveSessionPassphrase}, it does not prune.
|
|
97
|
+
*/
|
|
98
|
+
export declare function readSessionStatus(sessionPath: string, keystorePath: string, currentVerifierId: string | undefined): SessionStatus;
|
|
99
|
+
/**
|
|
100
|
+
* Parses a TTL string into milliseconds: a bare integer is seconds; an `s`, `m`,
|
|
101
|
+
* or `h` suffix scales it. Returns `undefined` for any malformed input. The
|
|
102
|
+
* caller applies the default, the 24h cap, and the `<= 0` rejection.
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseTtlToMs(raw: string): number | undefined;
|
|
105
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../src/keystore/session.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AAEH,2CAA2C;AAC3C,eAAO,MAAM,eAAe,EAAG,CAAU,CAAC;AAE1C,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,QAAiB,CAAC;AACrD,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,QAAsB,CAAC;AACtD,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAc,OAAO,eAAe,CAAC;IACtC,QAAQ,EAAO,MAAM,CAAC;IACtB,UAAU,EAAK,MAAM,CAAC;IACtB,UAAU,EAAK,MAAM,CAAC;IACtB,YAAY,EAAG,OAAO,CAAC;IACvB,SAAS,EAAM,MAAM,CAAC;IACtB,SAAS,EAAM,MAAM,CAAC;IACtB,UAAU,EAAK,MAAM,CAAC;CACvB;AAED,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,YAAY,EAAI,MAAM,CAAC;IACvB,uEAAuE;IACvE,UAAU,EAAM,MAAM,CAAC;IACvB,wCAAwC;IACxC,UAAU,EAAM,MAAM,CAAC;IACvB,gCAAgC;IAChC,KAAK,EAAW,MAAM,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAG,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAevF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAWzD;AAqBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAU,MAAM,EAC3B,YAAY,EAAS,MAAM,EAC3B,iBAAiB,EAAI,MAAM,GAAG,SAAS,EACvC,kBAAkB,UAAQ,GACzB,MAAM,GAAG,SAAS,CAqBpB;AAED,oGAAoG;AACpG,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAc,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAU,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAG,MAAM,CAAC;IAC3B,sGAAsG;IACtG,YAAY,CAAC,EAAO,OAAO,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAS,MAAM,EAC1B,YAAY,EAAQ,MAAM,EAC1B,iBAAiB,EAAG,MAAM,GAAG,SAAS,GACrC,aAAa,CAUf;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO5D"}
|
|
@@ -17,6 +17,8 @@ export declare const ENV_HOME = "BTCR2_HOME";
|
|
|
17
17
|
/** The config and keystore file names, kept side by side under the home root. */
|
|
18
18
|
export declare const CONFIG_FILENAME = "config.json";
|
|
19
19
|
export declare const KEYSTORE_FILENAME = "keystore.json";
|
|
20
|
+
/** The session file name, holding the unlock agent's cached passphrase (ADR 081). */
|
|
21
|
+
export declare const SESSION_FILENAME = "session.json";
|
|
20
22
|
/**
|
|
21
23
|
* Resolves the CLI home directory: the single root that holds `config.json` and
|
|
22
24
|
* `keystore.json` side by side (ADR 079). Resolution order, highest wins:
|
|
@@ -51,4 +53,12 @@ export declare function defaultConfigPath(overrides?: PathOverrides): string;
|
|
|
51
53
|
* function is the final fallback in that chain.
|
|
52
54
|
*/
|
|
53
55
|
export declare function defaultKeystorePath(overrides?: PathOverrides): string;
|
|
56
|
+
/**
|
|
57
|
+
* Session file path: `<home>/session.json`, where the unlock agent caches the
|
|
58
|
+
* keystore passphrase (ADR 081). Deliberately derived from the home root alone,
|
|
59
|
+
* never from `--config` / `--keystore` or the config file, so `keystore lock`
|
|
60
|
+
* can revoke a session even under a malformed config, and so the read and write
|
|
61
|
+
* paths always agree on one location per home.
|
|
62
|
+
*/
|
|
63
|
+
export declare function defaultSessionPath(overrides?: PathOverrides): string;
|
|
54
64
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAO,MAAM,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAK,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAG,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,iFAAiF;AACjF,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/paths.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAO,MAAM,CAAC;IACnB,sFAAsF;IACtF,MAAM,CAAC,EAAK,MAAM,CAAC;IACnB,qFAAqF;IACrF,QAAQ,CAAC,EAAG,MAAM,CAAC;CACpB;AAED,gFAAgF;AAChF,eAAO,MAAM,QAAQ,eAAe,CAAC;AAErC,iFAAiF;AACjF,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,qFAAqF;AACrF,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAI7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAQ5C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,MAAM,CAEpE"}
|
|
@@ -4,6 +4,7 @@ import type { Btcr2DidDocument, ResolutionOptions } from '@did-btcr2/method';
|
|
|
4
4
|
import type { DidResolutionResult } from '@web5/dids';
|
|
5
5
|
import type { DoctorReport, EffectiveConfig } from './config.js';
|
|
6
6
|
import type { ConfigIssue } from './config-schema.js';
|
|
7
|
+
import type { SessionStatus } from './keystore/session.js';
|
|
7
8
|
export type NetworkOption = 'bitcoin' | 'testnet3' | 'testnet4' | 'signet' | 'mutinynet' | 'regtest';
|
|
8
9
|
export type OutputFormat = 'json' | 'text';
|
|
9
10
|
/**
|
|
@@ -100,9 +101,26 @@ export type CommandResult = {
|
|
|
100
101
|
home: string;
|
|
101
102
|
config: string;
|
|
102
103
|
keystore: string;
|
|
104
|
+
network: NetworkOption;
|
|
103
105
|
created: string[];
|
|
104
106
|
protection: KeystoreProtectionLabel;
|
|
105
107
|
};
|
|
108
|
+
} | {
|
|
109
|
+
action: 'quickstart';
|
|
110
|
+
data: {
|
|
111
|
+
home: string;
|
|
112
|
+
config: string;
|
|
113
|
+
keystore: string;
|
|
114
|
+
network: NetworkOption;
|
|
115
|
+
created: string[];
|
|
116
|
+
protection: KeystoreProtectionLabel;
|
|
117
|
+
unlocked: boolean;
|
|
118
|
+
session?: {
|
|
119
|
+
expiresAt: number;
|
|
120
|
+
ttlSeconds: number;
|
|
121
|
+
};
|
|
122
|
+
doctor?: DoctorReport;
|
|
123
|
+
};
|
|
106
124
|
} | {
|
|
107
125
|
action: 'config-init';
|
|
108
126
|
data: {
|
|
@@ -157,6 +175,7 @@ export type CommandResult = {
|
|
|
157
175
|
established: boolean;
|
|
158
176
|
keyCount: number;
|
|
159
177
|
active: string | undefined;
|
|
178
|
+
session: SessionStatus;
|
|
160
179
|
};
|
|
161
180
|
} | {
|
|
162
181
|
action: 'keystore-change-passphrase';
|
|
@@ -164,6 +183,19 @@ export type CommandResult = {
|
|
|
164
183
|
path: string;
|
|
165
184
|
rekeyed: number;
|
|
166
185
|
};
|
|
186
|
+
} | {
|
|
187
|
+
action: 'keystore-unlock';
|
|
188
|
+
data: {
|
|
189
|
+
keystore: string;
|
|
190
|
+
expiresAt: number;
|
|
191
|
+
ttlSeconds: number;
|
|
192
|
+
};
|
|
193
|
+
} | {
|
|
194
|
+
action: 'keystore-lock';
|
|
195
|
+
data: {
|
|
196
|
+
path: string;
|
|
197
|
+
cleared: boolean;
|
|
198
|
+
};
|
|
167
199
|
} | {
|
|
168
200
|
action: 'profile-add';
|
|
169
201
|
data: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAA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UAAU,CAAC,EAAM,MAAM,CAAC;IACxB,aAAa,CAAC,EAAG,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAI,MAAM,CAAC;IACxB,YAAY,CAAC,EAAI,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAQ,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAM,MAAM,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-btcr2/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for interacting with did-btcr2-js, the JavaScript/TypeScript reference implementation of the did:btcr2 method. Exposes various parts of multiple packages in the did-btcr2-js monorepo.",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@scure/base": "^1.2.6",
|
|
62
62
|
"@web5/dids": "^1.2.0",
|
|
63
63
|
"commander": "^13.1.0",
|
|
64
|
-
"@did-btcr2/api": "^0.
|
|
65
|
-
"@did-btcr2/keypair": "^0.13.1",
|
|
66
|
-
"@did-btcr2/common": "^9.1.0",
|
|
64
|
+
"@did-btcr2/api": "^0.17.0",
|
|
67
65
|
"@did-btcr2/key-manager": "^0.7.0",
|
|
68
|
-
"@did-btcr2/
|
|
66
|
+
"@did-btcr2/keypair": "^0.13.1",
|
|
67
|
+
"@did-btcr2/method": "^0.54.1",
|
|
68
|
+
"@did-btcr2/common": "^9.1.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@eslint/js": "^9.21.0",
|
package/src/cli.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
registerKeyCommand,
|
|
10
10
|
registerKeystoreCommand,
|
|
11
11
|
registerProfileCommand,
|
|
12
|
+
registerQuickstartCommand,
|
|
12
13
|
registerResolveCommand,
|
|
13
14
|
registerUpdateCommand,
|
|
14
15
|
} from './commands/index.js';
|
|
@@ -77,6 +78,7 @@ export class DidBtcr2Cli {
|
|
|
77
78
|
});
|
|
78
79
|
|
|
79
80
|
registerInitCommand(this.program, globals);
|
|
81
|
+
registerQuickstartCommand(this.program, globals);
|
|
80
82
|
registerCreateCommand(this.program, factory, keystoreFactory, globals);
|
|
81
83
|
registerResolveCommand(this.program, factory, globals);
|
|
82
84
|
registerUpdateCommand(this.program, keystoreFactory, globals);
|
package/src/commands/create.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Command } from 'commander';
|
|
|
3
3
|
import type { ApiFactory, ConnectionOverrides } from '../config.js';
|
|
4
4
|
import { assertKeystoreAllowedForNetwork, profileNetworkMismatch, resolveDefaultNetwork } from '../config.js';
|
|
5
5
|
import { CLIError } from '../error.js';
|
|
6
|
+
import { printCreateFundingHint } from '../hints.js';
|
|
6
7
|
import { resolveKeyRef } from '../keystore/resolve-key-ref.js';
|
|
7
8
|
import { formatResult } from '../output.js';
|
|
8
9
|
import type { CommandResult, GlobalOptions, NetworkOption } from '../types.js';
|
|
@@ -115,6 +116,7 @@ export function registerCreateCommand(
|
|
|
115
116
|
const genesisBytes = parseGenesisBytes(options.bytes, 'k');
|
|
116
117
|
const did = factory().createDid('deterministic', genesisBytes, { network });
|
|
117
118
|
print({ action: 'create', data: did });
|
|
119
|
+
printCreateFundingHint(g, network, did);
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -128,6 +130,7 @@ export function registerCreateCommand(
|
|
|
128
130
|
{ action: 'create', data: did, keyId, publicKey: bytesToHex(publicKey) },
|
|
129
131
|
`Using stored key ${keyId}.`,
|
|
130
132
|
);
|
|
133
|
+
printCreateFundingHint(g, network, did);
|
|
131
134
|
return;
|
|
132
135
|
}
|
|
133
136
|
|
|
@@ -141,6 +144,7 @@ export function registerCreateCommand(
|
|
|
141
144
|
{ action: 'create', data: did, keyId, publicKey },
|
|
142
145
|
`Generated and stored key ${keyId} (now the active key).`,
|
|
143
146
|
);
|
|
147
|
+
printCreateFundingHint(g, network, did);
|
|
144
148
|
});
|
|
145
149
|
}
|
|
146
150
|
|
|
@@ -3,6 +3,7 @@ import { KeyManagerSigner } from '@did-btcr2/key-manager';
|
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
4
|
import { assertKeystoreAllowedForNetwork, deriveNetwork, resolveBroadcastOptions, resolveSigningKeyRef, type ApiFactory } from '../config.js';
|
|
5
5
|
import { CLIError } from '../error.js';
|
|
6
|
+
import { printWatchHint } from '../hints.js';
|
|
6
7
|
import { resolveKeyRef } from '../keystore/resolve-key-ref.js';
|
|
7
8
|
import { formatResult } from '../output.js';
|
|
8
9
|
import type { GlobalOptions, UpdateCommandOptions } from '../types.js';
|
|
@@ -117,6 +118,7 @@ export function registerDeactivateCommand(
|
|
|
117
118
|
...(broadcastOptions ? { broadcastOptions } : {}),
|
|
118
119
|
});
|
|
119
120
|
console.log(formatResult({ action: 'deactivate', data }, globals()));
|
|
121
|
+
printWatchHint(globals(), network, data.txid);
|
|
120
122
|
});
|
|
121
123
|
}
|
|
122
124
|
|
package/src/commands/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { registerInitCommand } from './init.js';
|
|
2
|
+
export { registerQuickstartCommand } from './quickstart.js';
|
|
2
3
|
export { registerCreateCommand } from './create.js';
|
|
3
4
|
export { registerResolveCommand } from './resolve.js';
|
|
4
5
|
export { registerUpdateCommand } from './update.js';
|