@needmoretruth/nmts-cli 0.52.1 → 0.52.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  Each version's entry is what changed for the person or the program using `nmts`. The product's own
4
4
  update history, which covers the site and the server too, is at https://nmts.me/updates.
5
5
 
6
+ ## 0.52.3 — 2026-11-08
7
+
8
+ - The crypto engine uses ml-dsa 0.1.2, whose key generation no longer branches on secret values.
9
+ Keys, shared identities and signatures are byte for byte the same as before.
10
+ - `nmts s3`: two multipart uploads of one key begun in the same millisecond could list in the wrong
11
+ order, and a `ListMultipartUploads` page resumed after the earlier one could skip the later one.
12
+ Upload ids now sort in the order the uploads began.
13
+
14
+ ## 0.52.2 — 2026-11-07
15
+
16
+ - `nmts wallet activity` and `nmts wallet list` still failed on a node that keeps fewer checkpoints
17
+ than 0.52.1 skipped above its lowest one (Suiscan's testnet node keeps about 13 seconds): the node
18
+ refused that start as above its newest checkpoint. The read now starts in the middle of such a
19
+ node's range, and when no start is accepted (Suiscan's testnet servers disagree by more than their
20
+ range) the older history comes from Sui's GraphQL service instead of the command failing.
21
+
6
22
  ## 0.52.1 — 2026-11-07
7
23
 
8
24
  - `nmts wallet activity` and `nmts wallet list` failed on mainnet from about 5 November: the Sui
package/README.ko.md CHANGED
@@ -50,7 +50,7 @@ nmts --help
50
50
 
51
51
  ```sh
52
52
  npm install -g github:needmoretruth/nmts-cli # 기본 브랜치
53
- npm install -g github:needmoretruth/nmts-cli#v0.52.1 # 버전을 고정할 때
53
+ npm install -g github:needmoretruth/nmts-cli#v0.52.3 # 버전을 고정할 때
54
54
  npm install -g https://github.com/needmoretruth/nmts-cli/releases/latest/download/nmts.tgz
55
55
  ```
56
56
 
package/README.md CHANGED
@@ -51,7 +51,7 @@ default branch, from a pinned version, or from the tarball attached to the
51
51
 
52
52
  ```sh
53
53
  npm install -g github:needmoretruth/nmts-cli # the default branch
54
- npm install -g github:needmoretruth/nmts-cli#v0.52.1 # a pinned version
54
+ npm install -g github:needmoretruth/nmts-cli#v0.52.3 # a pinned version
55
55
  npm install -g https://github.com/needmoretruth/nmts-cli/releases/latest/download/nmts.tgz
56
56
  ```
57
57
 
@@ -11,7 +11,7 @@ export declare const CRYPTO_SPEC_URL = "https://github.com/needmoretruth/nmts-re
11
11
  * is the field's own contract — what the writer says about itself — and a person holding two
12
12
  * copies of one account's artefacts can then tell which program made each.
13
13
  */
14
- export declare const WRITTEN_BY = "nmts-cli 0.52.1";
14
+ export declare const WRITTEN_BY = "nmts-cli 0.52.3";
15
15
  /** Which of the three artefacts a wrapper is. A reader holding several can sort them. */
16
16
  export type ArtifactKind = "recovery-list" | "file-list" | "recovery-kit";
17
17
  /**
@@ -7,5 +7,5 @@ export type ClientKind = "cli" | "mcp" | "sdk";
7
7
  * points with `"sdk"` and the SDK's own version.
8
8
  */
9
9
  export declare function identifyClient(next: ClientKind, nextVersion?: string): void;
10
- /** `cli/0.52.1`, `mcp/0.52.1`, `sdk/0.17.0`. */
10
+ /** `cli/0.52.3`, `mcp/0.52.3`, `sdk/0.17.0`. */
11
11
  export declare function clientHeaderValue(): string;
package/dist/client-id.js CHANGED
@@ -24,7 +24,7 @@ export function identifyClient(next, nextVersion = VERSION) {
24
24
  kind = next;
25
25
  version = nextVersion;
26
26
  }
27
- /** `cli/0.52.1`, `mcp/0.52.1`, `sdk/0.17.0`. */
27
+ /** `cli/0.52.3`, `mcp/0.52.3`, `sdk/0.17.0`. */
28
28
  export function clientHeaderValue() {
29
29
  return `${kind}/${version}`;
30
30
  }
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.52.1";
12
+ export declare const VERSION = "0.52.3";
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.52.1";
21
+ export const VERSION = "0.52.3";
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. */
@@ -42,4 +42,5 @@ export interface UploadBook {
42
42
  /** Remove what nobody has touched for a day, from memory and from disk. */
43
43
  sweepMemory(): Promise<void>;
44
44
  }
45
+ export declare function newUploadId(now: number): string;
45
46
  export declare function bucketView(book: UploadBook, bucket: string, account: UploadAccount): Staging;
@@ -21,14 +21,35 @@ function bare(etag) {
21
21
  return etag.trim().replace(/^W\//, "").replace(/^"|"$/g, "");
22
22
  }
23
23
  /**
24
- * A new upload id: the time it began, then randomness, all hex.
24
+ * A new upload id: the millisecond it began, a sequence within that millisecond, then randomness,
25
+ * all hex, 32 characters (`multipart-sweep.ts` reads the directory name by that shape).
25
26
  *
26
27
  * ⛔ SORTED BY TIME AS A STRING. `ListMultipartUploads` resumes after an id, and S3 lists one key's
27
28
  * uploads by when they began; an id that sorts the same way lets a listing resume after an id
28
29
  * even once that upload is gone, without skipping the key's later ones.
30
+ * ⛔ STRICTLY INCREASING, not only by the millisecond (2026-11-08). Two uploads begun in the same
31
+ * millisecond used to sort by their random tail, so half the time the later one sorted first and
32
+ * a listing resumed after the earlier one skipped it — seen on a fast macOS runner, where the
33
+ * test's two `begin` calls landed in one millisecond. The sequence breaks the tie in order, and a
34
+ * clock that steps back keeps the last time it gave.
29
35
  */
30
- function newUploadId(now) {
31
- return `${Math.max(0, Math.floor(now)).toString(16).padStart(12, "0")}${randomBytes(10).toString("hex")}`;
36
+ let lastMs = -1;
37
+ let sequence = 0;
38
+ export function newUploadId(now) {
39
+ let ms = Math.max(0, Math.floor(now));
40
+ if (ms <= lastMs) {
41
+ ms = lastMs;
42
+ sequence += 1;
43
+ if (sequence > 0xffff) {
44
+ ms += 1;
45
+ sequence = 0;
46
+ }
47
+ }
48
+ else {
49
+ sequence = 0;
50
+ }
51
+ lastMs = ms;
52
+ return `${ms.toString(16).padStart(12, "0")}${sequence.toString(16).padStart(4, "0")}${randomBytes(8).toString("hex")}`;
32
53
  }
33
54
  export function bucketView(book, bucket, account) {
34
55
  const { inFlight, finished, clock } = book;
@@ -21,11 +21,19 @@ export type DeeperHistory = (address: string, limit: number, signal?: AbortSigna
21
21
  */
22
22
  export declare const SUI_GRAPHQL_URLS: Readonly<Record<"mainnet" | "testnet", string>>;
23
23
  /**
24
- * How far above a node's lowest checkpoint a read starts. Mainnet seals about four checkpoints a
25
- * second, so 20,000 is over an hour of the node pruning before the start falls out of its window
26
- * again — and a refusal then simply moves it up (same margin as the chain service's gift reader).
24
+ * How far above a node's lowest checkpoint a read starts, at most. Mainnet seals about four
25
+ * checkpoints a second, so 20,000 is over an hour of pruning before the start falls out of the window
26
+ * again. A node whose whole window is shorter (Suiscan's testnet node held 54 checkpoints, about
27
+ * 13 seconds, on 2026-11-07) refuses that start as above its top and names the top; the start is then
28
+ * the middle of the window it named. Same rule as the chain service's gift reader.
27
29
  */
28
30
  export declare const WINDOW_MARGIN = 20000n;
31
+ /**
32
+ * The checkpoint a node's window ends below, read from its refusal of a start above it, or `null`
33
+ * for any other error. Suiscan and Mysten Labs answered `requested data above latest available;
34
+ * start_checkpoint is <s>, and only checkpoints below <n> are available` on 2026-11-07.
35
+ */
36
+ export declare function highestAvailable(e: unknown): bigint | null;
29
37
  /**
30
38
  * The lowest checkpoint a node said it holds, read from its refusal, or `null` for any other error.
31
39
  * Suiscan and Mysten Labs both answered `requested data below earliest available; lowest available
@@ -20,14 +20,13 @@
20
20
  // filter back to 2023 on both networks; its rows are read by the SAME parser as the node's (its
21
21
  // `transactionJson` and `balanceChangesJson` are the gRPC messages written as JSON).
22
22
  //
23
- // ⛔ A REQUEST WITHOUT A START IS REFUSED (measured 2026-11-07). `ListTransactions` without
24
- // `startCheckpoint` starts at genesis, and since about 2026-11-05 both Suiscan and Mysten Labs refuse
25
- // that outright — "requested data below earliest available; lowest available checkpoint is <n>" —
26
- // instead of stopping quietly at their window's edge. Every wallet walk and activity list then
27
- // failed on Suiscan, and on Mysten for any address idle for a few weeks, before the deeper source
28
- // was ever asked. So a refused read is sent again from a little above the checkpoint the refusal
29
- // names, that floor is remembered per network, and the scan then ends at that start, which is the
30
- // window's edge: what lies below it is the deeper source's to answer.
23
+ // ⛔ A REQUEST WITHOUT A START IS REFUSED (measured 2026-11-07). Without `startCheckpoint` a scan
24
+ // starts at genesis, and since about 2026-11-05 Suiscan and Mysten Labs refuse that ("requested data
25
+ // below earliest available; lowest available checkpoint is <n>"), which failed every wallet walk and
26
+ // activity list before the deeper source was asked. A refused read is sent again from just above the
27
+ // floor it names (or, when the node holds fewer checkpoints than the margin and refuses that as above
28
+ // its top, from the middle of the window), the window is remembered per network, and the scan ends
29
+ // at that start: what lies below it is the deeper source's to answer.
31
30
  //
32
31
  // ⛔ A SCAN THAT STOPPED SHORT IS NOT "NOTHING THERE". The node also bounds how much of its index one
33
32
  // request reads; a request can end with fewer items than asked — even none — and say it stopped
@@ -51,30 +50,64 @@ export const SUI_GRAPHQL_URLS = {
51
50
  /** How many requests one question may take before it answers with what it has. */
52
51
  const MAX_REQUESTS = 8;
53
52
  /**
54
- * How far above a node's lowest checkpoint a read starts. Mainnet seals about four checkpoints a
55
- * second, so 20,000 is over an hour of the node pruning before the start falls out of its window
56
- * again — and a refusal then simply moves it up (same margin as the chain service's gift reader).
53
+ * How far above a node's lowest checkpoint a read starts, at most. Mainnet seals about four
54
+ * checkpoints a second, so 20,000 is over an hour of pruning before the start falls out of the window
55
+ * again. A node whose whole window is shorter (Suiscan's testnet node held 54 checkpoints, about
56
+ * 13 seconds, on 2026-11-07) refuses that start as above its top and names the top; the start is then
57
+ * the middle of the window it named. Same rule as the chain service's gift reader.
57
58
  */
58
59
  export const WINDOW_MARGIN = 20000n;
59
- /** Refusals answered by moving the start up before the read counts as failed. */
60
- const MAX_WINDOW_RETRIES = 2;
61
- // The lowest checkpoint a node has named in a refusal, per network (or per client when it names none,
62
- // as a test's fake does). Remembered so a page that asks many times pays the refusal once.
63
- const floorByNetwork = new Map();
64
- const floorByClient = new WeakMap();
60
+ /** Refusals answered by moving the start before the read counts as failed (floor, top, one stale floor). */
61
+ const MAX_WINDOW_RETRIES = 3;
62
+ // Per network (or per client when it names none, as a test's fake does), so a page that asks many
63
+ // times pays the refusals once. Hosts of one network share it: a floor too low for another host is
64
+ // refused and corrected, and half the shortest span is inside every host's window.
65
+ const windowByNetwork = new Map();
66
+ const windowByClient = new WeakMap();
65
67
  function networkOf(client) {
66
68
  return "network" in client && typeof client.network === "string" ? client.network : undefined;
67
69
  }
68
- function knownFloor(client) {
70
+ function knownWindow(client) {
69
71
  const network = networkOf(client);
70
- return network === undefined ? floorByClient.get(client) : floorByNetwork.get(network);
72
+ return network === undefined ? windowByClient.get(client) : windowByNetwork.get(network);
71
73
  }
72
- function rememberFloor(client, floor) {
74
+ function rememberWindow(client, window) {
73
75
  const network = networkOf(client);
74
76
  if (network === undefined)
75
- floorByClient.set(client, floor);
77
+ windowByClient.set(client, window);
76
78
  else
77
- floorByNetwork.set(network, floor);
79
+ windowByNetwork.set(network, window);
80
+ }
81
+ /** Where a read starts inside what is known of the window; `undefined` (genesis) until a refusal said. */
82
+ function startInside(window) {
83
+ if (window === undefined)
84
+ return undefined;
85
+ const half = window.span === null ? WINDOW_MARGIN : window.span / 2n;
86
+ return window.floor + (half < WINDOW_MARGIN ? half : WINDOW_MARGIN);
87
+ }
88
+ /** Learns from a window refusal and says whether it was one; any other error teaches nothing. */
89
+ function learnWindow(client, e) {
90
+ const known = knownWindow(client);
91
+ const lowest = lowestAvailable(e);
92
+ if (lowest !== null) {
93
+ rememberWindow(client, { floor: lowest, span: known?.span ?? null });
94
+ return true;
95
+ }
96
+ const below = highestAvailable(e);
97
+ if (below === null || known === undefined)
98
+ return false;
99
+ rememberWindow(client, { floor: known.floor, span: below > known.floor ? below - known.floor : 1n });
100
+ return true;
101
+ }
102
+ /**
103
+ * The checkpoint a node's window ends below, read from its refusal of a start above it, or `null`
104
+ * for any other error. Suiscan and Mysten Labs answered `requested data above latest available;
105
+ * start_checkpoint is <s>, and only checkpoints below <n> are available` on 2026-11-07.
106
+ */
107
+ export function highestAvailable(e) {
108
+ const message = e instanceof Error ? e.message : typeof e === "string" ? e : "";
109
+ const found = /only checkpoints below (\d{1,20}) are available/.exec(message);
110
+ return found === null || found[1] === undefined ? null : BigInt(found[1]);
78
111
  }
79
112
  /**
80
113
  * The lowest checkpoint a node said it holds, read from its refusal, or `null` for any other error.
@@ -108,8 +141,7 @@ async function recentTransactions(client, address, limit, signal) {
108
141
  let reachedCheckpoint;
109
142
  let reason;
110
143
  for (let attempt = 0;; attempt += 1) {
111
- const floor = knownFloor(client);
112
- const startCheckpoint = floor === undefined ? undefined : floor + WINDOW_MARGIN;
144
+ const startCheckpoint = startInside(knownWindow(client));
113
145
  // Rows of one attempt are kept only if the attempt finishes: a refusal mid-stream adds nothing.
114
146
  const rows = [];
115
147
  frontier = undefined;
@@ -154,11 +186,12 @@ async function recentTransactions(client, address, limit, signal) {
154
186
  break;
155
187
  }
156
188
  catch (e) {
157
- const lowest = lowestAvailable(e);
158
- // Anything else is a real failure, and so is a window that keeps moving past a fresh floor.
159
- if (lowest === null || attempt >= MAX_WINDOW_RETRIES)
189
+ if (!learnWindow(client, e))
160
190
  throw e;
161
- rememberFloor(client, lowest);
191
+ // ⛔ A window no start can hit (Suiscan's testnet replicas disagreed by more than its 54
192
+ // checkpoints, 2026-11-07) leaves the node nothing to give, as when it stopped at its edge.
193
+ if (attempt >= MAX_WINDOW_RETRIES)
194
+ return { transactions, fromGenesis: false };
162
195
  }
163
196
  }
164
197
  if (transactions.length >= limit)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needmoretruth/nmts-cli",
3
- "version": "0.52.1",
3
+ "version": "0.52.3",
4
4
  "description": "Command-line and MCP access to NMTS (NeedMoreTruthStorage, https://nmts.me): open-source, end-to-end encrypted storage on the Walrus network. No fee to NMTS; you pay the network from your own wallet. For people and for their agents.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
package/server.json CHANGED
@@ -6,13 +6,13 @@
6
6
  "url": "https://github.com/needmoretruth/nmts-cli",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.52.1",
9
+ "version": "0.52.3",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "registryBaseUrl": "https://registry.npmjs.org",
14
14
  "identifier": "@needmoretruth/nmts-cli",
15
- "version": "0.52.1",
15
+ "version": "0.52.3",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },