@needmoretruth/nmts-cli 0.59.1 → 0.61.1
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/AGENTS.md +49 -49
- package/CHANGELOG.md +128 -99
- package/LICENSING.md +8 -8
- package/README.ko.md +156 -156
- package/README.md +111 -111
- package/dist/api-advice.js +34 -34
- package/dist/api-key.js +2 -2
- package/dist/artifact-about.d.ts +1 -1
- package/dist/autonomy.js +12 -12
- package/dist/code-access.js +3 -3
- package/dist/code-vault.js +1 -1
- package/dist/commands/accept-terms.js +4 -4
- package/dist/commands/ai-account.js +10 -10
- package/dist/commands/balance.js +7 -7
- package/dist/commands/create-code-file.js +3 -3
- package/dist/commands/create-link.js +36 -41
- package/dist/commands/create-pass.js +3 -3
- package/dist/commands/create.js +4 -4
- package/dist/commands/credits.js +2 -2
- package/dist/commands/delete-account.js +3 -3
- package/dist/commands/deposit.js +3 -3
- package/dist/commands/devices.js +3 -3
- package/dist/commands/documents.js +1 -1
- package/dist/commands/env.js +13 -13
- package/dist/commands/erase.js +5 -5
- package/dist/commands/expiring.js +4 -4
- package/dist/commands/extend.js +8 -8
- package/dist/commands/get.js +2 -2
- package/dist/commands/handover.js +2 -2
- package/dist/commands/key-manage.js +2 -2
- package/dist/commands/key.js +5 -5
- package/dist/commands/link.js +2 -2
- package/dist/commands/links.js +1 -1
- package/dist/commands/listfile.js +3 -3
- package/dist/commands/login-passphrase.js +4 -4
- package/dist/commands/login.js +9 -9
- package/dist/commands/logout.js +1 -1
- package/dist/commands/losses.js +7 -7
- package/dist/commands/ls.js +7 -7
- package/dist/commands/marks.js +1 -1
- package/dist/commands/mcp.js +4 -4
- package/dist/commands/mode.js +8 -8
- package/dist/commands/on-collision.js +4 -4
- package/dist/commands/openers-attach.js +1 -1
- package/dist/commands/organise.js +1 -1
- package/dist/commands/padding.js +3 -3
- package/dist/commands/platform.js +2 -2
- package/dist/commands/public-code-manage.js +4 -4
- package/dist/commands/public-code.js +4 -4
- package/dist/commands/pull.js +1 -1
- package/dist/commands/push-heavy.js +1 -1
- package/dist/commands/push-wallet.js +1 -1
- package/dist/commands/push.js +2 -2
- package/dist/commands/put-heavy.js +2 -2
- package/dist/commands/put-payer.js +1 -1
- package/dist/commands/put-wallet.js +5 -5
- package/dist/commands/put.js +3 -3
- package/dist/commands/rebuild.js +13 -13
- package/dist/commands/receive.js +2 -2
- package/dist/commands/recovery-list.js +1 -1
- package/dist/commands/recovery.js +7 -7
- package/dist/commands/rollback.js +2 -2
- package/dist/commands/s3.js +3 -3
- package/dist/commands/share.js +7 -7
- package/dist/commands/shares-sent.js +2 -2
- package/dist/commands/support.js +1 -1
- package/dist/commands/sweep.js +3 -3
- package/dist/commands/tip.js +2 -2
- package/dist/commands/trial.js +8 -8
- package/dist/commands/unlock.js +6 -6
- package/dist/commands/update.js +3 -3
- package/dist/commands/usage.js +4 -4
- package/dist/commands/verify.js +1 -1
- package/dist/commands/wallet-activity.js +3 -3
- package/dist/commands/wallet-donate.js +4 -4
- package/dist/commands/wallet-hall.js +5 -5
- package/dist/commands/wallet-list.js +2 -2
- package/dist/commands/wallet-send.js +5 -5
- package/dist/commands/wallet-storage-buy.js +1 -1
- package/dist/commands/wallet-storage-extend.js +1 -1
- package/dist/commands/wallet-storage-ops.js +5 -5
- package/dist/commands/wallet-storage.js +1 -1
- package/dist/commands/wallet-swap.js +14 -14
- package/dist/commands/wallet-use.js +2 -2
- package/dist/commands/wallet.js +6 -6
- package/dist/consent.js +7 -7
- package/dist/credentials.js +1 -1
- package/dist/deposit.js +1 -1
- package/dist/download-part.js +1 -1
- package/dist/download-sink-node.js +3 -3
- package/dist/download.js +1 -1
- package/dist/drive-edit/errors.js +1 -1
- package/dist/drive-edit/folders.js +1 -1
- package/dist/drive-edit/trash.js +2 -2
- package/dist/drive-erase.js +1 -1
- package/dist/environment.js +5 -5
- package/dist/errors.js +1 -1
- package/dist/extend-budget.js +5 -5
- package/dist/extend-chain.js +1 -1
- package/dist/extend-plan.js +4 -4
- package/dist/gate.js +1 -1
- package/dist/handover.js +2 -2
- package/dist/heavy-copy.d.ts +1 -1
- package/dist/heavy-copy.js +7 -7
- package/dist/help-options.js +13 -13
- package/dist/help.js +54 -40
- package/dist/human-check.js +2 -2
- package/dist/kit-file.js +6 -6
- package/dist/list-file.js +1 -1
- package/dist/manifest-chunk-flow.js +1 -1
- package/dist/manifest-create.js +2 -2
- package/dist/manifest-write.js +1 -1
- package/dist/manifest.js +6 -3
- package/dist/mcp-args.js +1 -1
- package/dist/mcp-tools/credits.js +5 -5
- package/dist/mcp-tools/files.js +6 -6
- package/dist/mcp-tools/organise.js +7 -7
- package/dist/mcp-tools/reads.js +17 -17
- package/dist/mcp-tools/share.js +6 -6
- package/dist/mcp-tools/support.js +3 -3
- package/dist/mcp-tools/tiers.js +4 -4
- package/dist/notice.js +1 -1
- package/dist/openers/wallet.js +1 -1
- package/dist/platform-sign.js +2 -2
- package/dist/product.d.ts +1 -1
- package/dist/product.js +1 -1
- package/dist/public-codes.js +2 -2
- package/dist/recovery-assemble.js +1 -1
- package/dist/recovery-map-file.js +1 -1
- package/dist/recovery-map.js +1 -1
- package/dist/recovery-source.js +1 -1
- package/dist/recovery.js +1 -1
- package/dist/risk.d.ts +4 -4
- package/dist/risk.js +4 -4
- package/dist/s3/call.js +1 -1
- package/dist/s3/same-file.js +1 -1
- package/dist/setup-questions.js +1 -1
- package/dist/shared/lib/drive/manifest-index.d.ts +9 -0
- package/dist/shared/lib/drive/manifest-index.js +11 -0
- package/dist/shared/lib/heavy/order-plan.js +4 -4
- package/dist/shared/lib/heavy/sp-upload.js +1 -1
- package/dist/shared/lib/upload/relay-limit.d.ts +30 -0
- package/dist/shared/lib/upload/relay-limit.js +74 -0
- package/dist/shared/lib/vendor/nmt-pow.d.ts +21 -0
- package/dist/shared/lib/vendor/nmt-pow.js +56 -0
- package/dist/shared/lib/walrus/node-certificate.js +1 -1
- package/dist/shared/lib/walrus/node-quorum.js +1 -1
- package/dist/sharing-inbox.js +1 -1
- package/dist/sharing.js +4 -4
- package/dist/standing-tip.js +1 -1
- package/dist/storage-control/extend.js +2 -2
- package/dist/storage-control/reshape.js +3 -3
- package/dist/support-copy.js +4 -4
- package/dist/support-wire.js +4 -4
- package/dist/update-source.js +1 -1
- package/dist/upload-price.d.ts +10 -0
- package/dist/upload-price.js +21 -0
- package/dist/upload-quote.js +2 -2
- package/dist/upload-run.js +1 -1
- package/dist/upload-steps.js +1 -1
- package/dist/upload-store.js +1 -1
- package/dist/upload-wallet-chain.js +1 -1
- package/dist/upload-wallet-plan.js +12 -12
- package/dist/upload-wallet-put.js +1 -1
- package/dist/upload-wallet.js +2 -2
- package/dist/upload.js +2 -2
- package/dist/wallet-grant.js +3 -3
- package/dist/wallet-pay-index.js +1 -1
- package/dist/wallet-sign-external.js +5 -5
- package/dist/wallet-sign.js +6 -6
- package/dist/wallet-swap-words.js +3 -3
- package/dist/walrus.js +2 -2
- package/docs/commands/accept-terms.md +3 -3
- package/docs/commands/ai-account.md +4 -4
- package/docs/commands/create.md +8 -8
- package/docs/commands/credits.md +9 -9
- package/docs/commands/delete-account.md +4 -4
- package/docs/commands/deposit.md +7 -7
- package/docs/commands/devices.md +4 -4
- package/docs/commands/documents.md +5 -5
- package/docs/commands/env.md +10 -10
- package/docs/commands/extend.md +4 -4
- package/docs/commands/folders.md +3 -3
- package/docs/commands/get.md +4 -4
- package/docs/commands/handover.md +12 -12
- package/docs/commands/heavy.md +4 -4
- package/docs/commands/key.md +8 -8
- package/docs/commands/link.md +9 -9
- package/docs/commands/login.md +4 -4
- package/docs/commands/logout.md +2 -2
- package/docs/commands/losses.md +3 -3
- package/docs/commands/ls.md +5 -5
- package/docs/commands/marks.md +5 -5
- package/docs/commands/mcp.md +9 -9
- package/docs/commands/mode.md +6 -6
- package/docs/commands/on-collision.md +4 -4
- package/docs/commands/openers.md +5 -5
- package/docs/commands/padding.md +7 -7
- package/docs/commands/platform.md +2 -2
- package/docs/commands/public-code.md +8 -8
- package/docs/commands/pull.md +2 -2
- package/docs/commands/push.md +3 -3
- package/docs/commands/put.md +11 -11
- package/docs/commands/rebuild.md +5 -5
- package/docs/commands/recovery.md +4 -4
- package/docs/commands/s3.md +6 -6
- package/docs/commands/share.md +8 -8
- package/docs/commands/support.md +7 -7
- package/docs/commands/tip.md +7 -7
- package/docs/commands/trash.md +8 -8
- package/docs/commands/trial.md +5 -5
- package/docs/commands/unlock.md +4 -4
- package/docs/commands/update.md +3 -3
- package/docs/commands/usage.md +4 -4
- package/docs/commands/verify.md +5 -5
- package/docs/commands/wallet.md +25 -25
- package/docs/commands/whoami.md +5 -5
- package/examples/podman.sh +3 -3
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -24,7 +24,7 @@ export function organiseTools(ctx) {
|
|
|
24
24
|
{
|
|
25
25
|
name: "nmts_mkdir",
|
|
26
26
|
description: "Make a folder in the NMTS account, including any parent folders that are missing. " +
|
|
27
|
-
"Folders exist only inside the account's sealed list
|
|
27
|
+
"Folders exist only inside the account's sealed list. Making one costs nothing.",
|
|
28
28
|
inputSchema: {
|
|
29
29
|
type: "object",
|
|
30
30
|
properties: { path: { type: "string", description: "The folder path to make." } },
|
|
@@ -36,7 +36,7 @@ export function organiseTools(ctx) {
|
|
|
36
36
|
{
|
|
37
37
|
name: "nmts_move",
|
|
38
38
|
description: "Move one or more entries into a folder in the NMTS account. Nothing is re-uploaded and " +
|
|
39
|
-
"nothing is charged
|
|
39
|
+
"nothing is charged. Only the sealed list changes. A name already taken in the " +
|
|
40
40
|
"destination is numbered rather than replacing what is there.",
|
|
41
41
|
inputSchema: {
|
|
42
42
|
type: "object",
|
|
@@ -104,7 +104,7 @@ export function organiseTools(ctx) {
|
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
name: "nmts_label_rename",
|
|
107
|
-
description: "Rename a label on every file that carries it. Changes only the file list
|
|
107
|
+
description: "Rename a label on every file that carries it. Changes only the file list. Costs nothing.",
|
|
108
108
|
inputSchema: {
|
|
109
109
|
type: "object",
|
|
110
110
|
properties: {
|
|
@@ -122,7 +122,7 @@ export function organiseTools(ctx) {
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
name: "nmts_unlabel_all",
|
|
125
|
-
description: "Take one label off every file that carries it. Changes only the file list
|
|
125
|
+
description: "Take one label off every file that carries it. Changes only the file list. Costs nothing.",
|
|
126
126
|
inputSchema: {
|
|
127
127
|
type: "object",
|
|
128
128
|
properties: { name: { type: "string", description: "The label to take off." } },
|
|
@@ -135,7 +135,7 @@ export function organiseTools(ctx) {
|
|
|
135
135
|
name: "nmts_padding",
|
|
136
136
|
description: "Read or set how file sizes are hidden on the storage network: standard (a few fixed " +
|
|
137
137
|
"sizes per doubling), pow2 (one per doubling, hides more, costs more storage on " +
|
|
138
|
-
"average), or off (no padding
|
|
138
|
+
"average), or off (no padding: the file's exact length is visible to the network and " +
|
|
139
139
|
"to anyone who reads the blob, and about 1 % less storage is used). Applies to the next " +
|
|
140
140
|
"uploads from every device.",
|
|
141
141
|
inputSchema: {
|
|
@@ -161,7 +161,7 @@ export function organiseTools(ctx) {
|
|
|
161
161
|
`upload, 0 to ${DEPOSIT_CREDITS_MAX}. Nothing here spends: it records what the next uploads will ` +
|
|
162
162
|
"set aside, from every device. The deposit pays the chain fee of a later operation on " +
|
|
163
163
|
"that file, measured rather than spent whole, and what is left comes back when the " +
|
|
164
|
-
"storage period ends. 0 is a real answer
|
|
164
|
+
"storage period ends. 0 is a real answer: a file with no deposit still releases, but " +
|
|
165
165
|
"pays twice the same fee out of the balance at that moment.",
|
|
166
166
|
inputSchema: {
|
|
167
167
|
type: "object",
|
|
@@ -183,7 +183,7 @@ export function organiseTools(ctx) {
|
|
|
183
183
|
name: "nmts_trash",
|
|
184
184
|
description: "Put files in the NMTS account's trash. Nothing is destroyed and nothing is refunded: the " +
|
|
185
185
|
"storage stays bought and the file can be brought back with nmts_restore. Emptying the " +
|
|
186
|
-
"trash for good is not something this surface can do
|
|
186
|
+
"trash for good is not something this surface can do. That is a person's decision at the " +
|
|
187
187
|
"command line.",
|
|
188
188
|
inputSchema: {
|
|
189
189
|
type: "object",
|
package/dist/mcp-tools/reads.js
CHANGED
|
@@ -62,7 +62,7 @@ export function readTools(ctx) {
|
|
|
62
62
|
{
|
|
63
63
|
name: "nmts_usage",
|
|
64
64
|
description: "How much this account holds: how many files and folders, how many bytes, how much is in " +
|
|
65
|
-
"the trash, and the largest few. Reads the account's own sealed list
|
|
65
|
+
"the trash, and the largest few. Reads the account's own sealed list. It costs nothing " +
|
|
66
66
|
"and says nothing about credits.",
|
|
67
67
|
inputSchema: NO_ARGS,
|
|
68
68
|
run: () => say((write) => usage({ ...common(ctx), json: true, write })),
|
|
@@ -78,9 +78,9 @@ export function readTools(ctx) {
|
|
|
78
78
|
{
|
|
79
79
|
name: "nmts_losses",
|
|
80
80
|
description: "Storage objects paid with this account's credits that NMTS's daily check could not find " +
|
|
81
|
-
"on the chain, newest first. Read-only
|
|
81
|
+
"on the chain, newest first. Read-only. Costs nothing. A program uploading with a key is " +
|
|
82
82
|
"the caller that keeps writing into storage that is gone, so read this before a long run. " +
|
|
83
|
-
"Each row is a public chain object id and the day a check first missed it
|
|
83
|
+
"Each row is a public chain object id and the day a check first missed it. There is no file name, " +
|
|
84
84
|
"because the server cannot pair them.",
|
|
85
85
|
inputSchema: NO_ARGS,
|
|
86
86
|
run: () => say((write) => losses({ ...common(ctx), json: true, write })),
|
|
@@ -97,17 +97,17 @@ export function readTools(ctx) {
|
|
|
97
97
|
{
|
|
98
98
|
name: "nmts_wallet_activity",
|
|
99
99
|
description: "The recent transactions of the wallet this account derives (newest first, 20 at most), " +
|
|
100
|
-
"each named only where the chain proves it
|
|
101
|
-
"otherwise 'other'
|
|
102
|
-
"developer appear as sends here
|
|
100
|
+
"each named only where the chain proves it (seal, extend, erase, exchange, send, receive, " +
|
|
101
|
+
"otherwise 'other'), with its balance changes and an explorer link. Read-only. Gifts to the " +
|
|
102
|
+
"developer appear as sends here. This tool does not know that address.",
|
|
103
103
|
inputSchema: NO_ARGS,
|
|
104
104
|
run: () => say((write) => walletActivity({ ...common(ctx), json: true, write })),
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
name: "nmts_wallet_storage",
|
|
108
|
-
description: "The storage resources (size × time on the storage network) this wallet holds unbound
|
|
109
|
-
"what deleting a file from the network gave back
|
|
110
|
-
"Read-only
|
|
108
|
+
description: "The storage resources (size × time on the storage network) this wallet holds unbound " +
|
|
109
|
+
"(what deleting a file from the network gave back), with whether each is usable now. " +
|
|
110
|
+
"Read-only. Nothing here spends or signs.",
|
|
111
111
|
inputSchema: NO_ARGS,
|
|
112
112
|
run: () => say((write) => walletStorage({ ...common(ctx), json: true, write })),
|
|
113
113
|
},
|
|
@@ -115,7 +115,7 @@ export function readTools(ctx) {
|
|
|
115
115
|
name: "nmts_devices",
|
|
116
116
|
description: "What is signed in to this NMTS account: for each device, when it was first signed in, " +
|
|
117
117
|
"when it was last used, and when it runs out. ⛔ READ-ONLY. Signing a device out is a " +
|
|
118
|
-
"person's act at nmts.me and no API key can do it
|
|
118
|
+
"person's act at nmts.me and no API key can do it, including this one, so if a row " +
|
|
119
119
|
"looks wrong, say so and let the person end it rather than looking for a way to do it " +
|
|
120
120
|
"here. ⚠ The name each device was given is encrypted with the NMTS key, which the " +
|
|
121
121
|
"server has never had, so no name is returned.",
|
|
@@ -124,12 +124,12 @@ export function readTools(ctx) {
|
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
name: "nmts_public_code",
|
|
127
|
-
description: "The account's PUBLIC CODES
|
|
127
|
+
description: "The account's PUBLIC CODES: the values other accounts send files to. `code` is the " +
|
|
128
128
|
"default one (the lowest-numbered live code) and whether it is published; `codes` lists " +
|
|
129
129
|
"every code with its number, whether it is live or revoked, and how many shares and " +
|
|
130
130
|
"messages went through it; `live`, `liveMax`, `madeToday` and `dayCap` are the server's " +
|
|
131
131
|
"ceilings. With `activity`, each code also lists its shares. Until a code is published " +
|
|
132
|
-
"nobody can send to this account
|
|
132
|
+
"nobody can send to this account. Nmts_public_code_new publishes one. ⚠ Not the NMTS " +
|
|
133
133
|
"key, which opens every file and is never given away.",
|
|
134
134
|
inputSchema: {
|
|
135
135
|
type: "object",
|
|
@@ -147,7 +147,7 @@ export function readTools(ctx) {
|
|
|
147
147
|
{
|
|
148
148
|
name: "nmts_shares",
|
|
149
149
|
description: "Files this account has shared with somebody, and files somebody has shared with it. The " +
|
|
150
|
-
"ids in the received list are what nmts_receive takes
|
|
150
|
+
"ids in the received list are what nmts_receive takes. The ids in the sent list are what " +
|
|
151
151
|
"nmts_unshare takes.",
|
|
152
152
|
inputSchema: NO_ARGS,
|
|
153
153
|
run: () => say((write) => shares({ ...common(ctx), json: true, write })),
|
|
@@ -155,7 +155,7 @@ export function readTools(ctx) {
|
|
|
155
155
|
{
|
|
156
156
|
name: "nmts_shares_sent",
|
|
157
157
|
description: "Who one file in the account was shared with: recipient address, since when, and the " +
|
|
158
|
-
"share id. Read-only
|
|
158
|
+
"share id. Read-only. Costs nothing.",
|
|
159
159
|
inputSchema: {
|
|
160
160
|
type: "object",
|
|
161
161
|
properties: {
|
|
@@ -179,13 +179,13 @@ export function readTools(ctx) {
|
|
|
179
179
|
name: "nmts_notices",
|
|
180
180
|
description: "The NMTS notice board as JSON, newest first: interruptions, incidents, and the notice " +
|
|
181
181
|
"given before a new version of the Terms takes effect. Ids here are what nmts_notice " +
|
|
182
|
-
"takes. Public and read-only
|
|
182
|
+
"takes. Public and read-only. It costs nothing and needs no account.",
|
|
183
183
|
inputSchema: NO_ARGS,
|
|
184
184
|
run: () => say((write) => notices({ ...common(ctx), json: true, write })),
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
name: "nmts_notice",
|
|
188
|
-
description: "One notice in full, as the dated text the board's download button writes
|
|
188
|
+
description: "One notice in full, as the dated text the board's download button writes, the same " +
|
|
189
189
|
"bytes. Read this before acting on anything nmts_notices only summarised.",
|
|
190
190
|
inputSchema: {
|
|
191
191
|
type: "object",
|
|
@@ -221,7 +221,7 @@ export function readTools(ctx) {
|
|
|
221
221
|
{
|
|
222
222
|
name: "nmts_privacy",
|
|
223
223
|
description: "The NMTS Privacy Policy in force, as text, with its version and effective date at the " +
|
|
224
|
-
"head. It is what the service says it collects and keeps
|
|
224
|
+
"head. It is what the service says it collects and keeps. Read it rather than describing " +
|
|
225
225
|
"it from memory.",
|
|
226
226
|
inputSchema: {
|
|
227
227
|
type: "object",
|
package/dist/mcp-tools/share.js
CHANGED
|
@@ -43,10 +43,10 @@ export function shareTools(ctx) {
|
|
|
43
43
|
return [
|
|
44
44
|
{
|
|
45
45
|
name: "nmts_public_code_new",
|
|
46
|
-
description: "Make a new public code for this account
|
|
46
|
+
description: "Make a new public code for this account (the next number from the same NMTS key) and " +
|
|
47
47
|
"publish it, so other accounts can send files to it. `replace` names a live code to revoke " +
|
|
48
48
|
"in the same step: nobody can send to that one again and nobody can bring it back. The " +
|
|
49
|
-
"server caps how many codes are live at once and how many are made per UTC day
|
|
49
|
+
"server caps how many codes are live at once and how many are made per UTC day. The reply " +
|
|
50
50
|
"of nmts_public_code says both.",
|
|
51
51
|
inputSchema: {
|
|
52
52
|
type: "object",
|
|
@@ -63,8 +63,8 @@ export function shareTools(ctx) {
|
|
|
63
63
|
{
|
|
64
64
|
name: "nmts_public_code_revoke",
|
|
65
65
|
description: "Revoke one of this account's public codes, by its number from nmts_public_code. Nobody can " +
|
|
66
|
-
"send to it again and nobody can bring it back
|
|
67
|
-
"still open. The account's last live code cannot be revoked
|
|
66
|
+
"send to it again and nobody can bring it back. Files already received with it stay and " +
|
|
67
|
+
"still open. The account's last live code cannot be revoked. Make a new one with " +
|
|
68
68
|
"nmts_public_code_new and `replace` instead.",
|
|
69
69
|
inputSchema: {
|
|
70
70
|
type: "object",
|
|
@@ -81,9 +81,9 @@ export function shareTools(ctx) {
|
|
|
81
81
|
description: "Give another NMTS account the key to one file in this account. ⛔ IT CANNOT BE TAKEN " +
|
|
82
82
|
"BACK: withdrawing the share stops further downloads and cannot reach a copy the " +
|
|
83
83
|
"recipient already fetched, and a public code typed wrongly is a share sent to whoever " +
|
|
84
|
-
"holds that code. The first share on a machine stops and asks the person to agree
|
|
84
|
+
"holds that code. The first share on a machine stops and asks the person to agree. Show " +
|
|
85
85
|
"them what it says rather than agreeing for them. Nothing is uploaded and nothing is " +
|
|
86
|
-
"charged
|
|
86
|
+
"charged. The recipient pays nothing either. Every call puts the file and the code in " +
|
|
87
87
|
"front of the person to confirm, unless they have turned on a mode that says an agent " +
|
|
88
88
|
"may decide.",
|
|
89
89
|
inputSchema: {
|
|
@@ -28,7 +28,7 @@ const LOG = ATTACH_LOG_TEXT.join(" ");
|
|
|
28
28
|
const OMIT_ARG = {
|
|
29
29
|
type: "array",
|
|
30
30
|
items: { type: "string" },
|
|
31
|
-
description: "Values that must not travel
|
|
31
|
+
description: "Values that must not travel, such as a file name or a folder path. Every occurrence in the message " +
|
|
32
32
|
"and in the attached log becomes [omitted]. At least 3 characters each.",
|
|
33
33
|
};
|
|
34
34
|
export function supportTools(ctx) {
|
|
@@ -38,7 +38,7 @@ export function supportTools(ctx) {
|
|
|
38
38
|
description: "File a report with the developer of NMTS: a bug, a confusing message, an idea, a " +
|
|
39
39
|
`question. ${CARE} The NMTS key, API key, passphrase, tokens and key material are ` +
|
|
40
40
|
"replaced by labels on this machine before anything is sent, and file contents are never " +
|
|
41
|
-
`read at all
|
|
41
|
+
`read at all. File names and the account's public code may go. ${LOG} The answer to this ` +
|
|
42
42
|
"call is exactly what was sent, so it can be checked afterwards. One report per problem.",
|
|
43
43
|
inputSchema: {
|
|
44
44
|
type: "object",
|
|
@@ -83,7 +83,7 @@ export function supportTools(ctx) {
|
|
|
83
83
|
name: "nmts_support_list",
|
|
84
84
|
description: "The reports this account has filed from the command line, with their codes, what each " +
|
|
85
85
|
"is about, whether it has been answered, and how many threads hold something unread. " +
|
|
86
|
-
"Read-only
|
|
86
|
+
"Read-only. Costs nothing.",
|
|
87
87
|
inputSchema: NO_ARGS,
|
|
88
88
|
run: () => say((write) => support("list", [], { ...common(ctx), json: true, write })),
|
|
89
89
|
},
|
package/dist/mcp-tools/tiers.js
CHANGED
|
@@ -60,7 +60,7 @@ export const TOOL_TIERS = {
|
|
|
60
60
|
nmts_credits_transfer: {
|
|
61
61
|
act: "credits.transfer",
|
|
62
62
|
question: (args) => `Move ${String(args["credits"])} credits from this account to ${String(args["to"])}?\n\n` +
|
|
63
|
-
"Both are accounts of yours
|
|
63
|
+
"Both are accounts of yours. The server refuses any other recipient. Nothing is spent by " +
|
|
64
64
|
"moving them and the same move the other way puts them back, but the credits keep the date " +
|
|
65
65
|
"they were already going to lapse on: moving them does not renew them.",
|
|
66
66
|
},
|
|
@@ -72,7 +72,7 @@ export const TOOL_TIERS = {
|
|
|
72
72
|
`${typeof args["as"] === "number" ? `, from this account's public code #${String(args["as"])}` : ""}?\n\n` +
|
|
73
73
|
"Whoever holds that code can then download the file. Withdrawing the share afterwards stops " +
|
|
74
74
|
"further downloads and cannot reach a copy already fetched. The code is not checked against " +
|
|
75
|
-
"a person
|
|
75
|
+
"a person: if it is the wrong one, the file goes to whoever holds it.",
|
|
76
76
|
},
|
|
77
77
|
nmts_unshare: { act: "unshare" },
|
|
78
78
|
nmts_support_send: { act: "support.send" },
|
|
@@ -99,7 +99,7 @@ export function tierLine(tier) {
|
|
|
99
99
|
case "low":
|
|
100
100
|
return "Tier low: asked in the default mode, runs unasked in the auto modes. ";
|
|
101
101
|
case "medium":
|
|
102
|
-
return "Tier medium: asked in the default mode
|
|
102
|
+
return "Tier medium: asked in the default mode. In an auto mode it is your judgement whether this is what the person wants. ";
|
|
103
103
|
case "high":
|
|
104
104
|
return `Tier high: locked until a person runs \`${BINARY_NAME} unlock\` at a terminal, and asked every time in every mode but skip-permissions. `;
|
|
105
105
|
case "ultra-high":
|
|
@@ -109,7 +109,7 @@ export function tierLine(tier) {
|
|
|
109
109
|
/** The refusal for a client that cannot be asked, and the way round it. */
|
|
110
110
|
export function cannotAsk(what) {
|
|
111
111
|
return (`Refused: ${what} needs the person's yes in this mode, and this client cannot put a question in ` +
|
|
112
|
-
`front of them. Ask them in your own words
|
|
112
|
+
`front of them. Ask them in your own words. Once they agree, run the same thing with \`${BINARY_NAME}\` ` +
|
|
113
113
|
`at the command line with --yes, or use a client that supports MCP elicitation. Nothing was done.`);
|
|
114
114
|
}
|
|
115
115
|
/** The refusal after the question was put and not agreed to. */
|
package/dist/notice.js
CHANGED
|
@@ -33,7 +33,7 @@ export function firstRunNotice() {
|
|
|
33
33
|
` means any program that can read your files can read it, including any`,
|
|
34
34
|
` agent you run on this machine.`,
|
|
35
35
|
``,
|
|
36
|
-
` If it leaves this machine
|
|
36
|
+
` If it leaves this machine (in a log line, in a prompt, in a repository),`,
|
|
37
37
|
` whoever holds it can read every file in the account and spend from the`,
|
|
38
38
|
` wallet. NMTS cannot undo that: requests made with your NMTS key cannot be`,
|
|
39
39
|
` told apart from your own, and it cannot be changed while keeping`,
|
package/dist/openers/wallet.js
CHANGED
|
@@ -204,7 +204,7 @@ function keyBytes(parse, accountCode) {
|
|
|
204
204
|
catch {
|
|
205
205
|
throw new NmtsError("ACCOUNT_CODE_INVALID: that is not a valid NMTS key.", {
|
|
206
206
|
exitCode: 2,
|
|
207
|
-
nextStep: "Nothing was stored. The last character is a check symbol
|
|
207
|
+
nextStep: "Nothing was stored. The last character is a check symbol. Look for a mistyped one.",
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
}
|
package/dist/platform-sign.js
CHANGED
|
@@ -156,7 +156,7 @@ export function mintDelegation(request) {
|
|
|
156
156
|
if (request.ttlSecs > DELEGATION_MAX_TTL_SECS) {
|
|
157
157
|
throw new NmtsError(`A delegation token may last at most ${DELEGATION_MAX_TTL_SECS} seconds (30 days); ${request.ttlSecs} was asked for.`, {
|
|
158
158
|
exitCode: 2,
|
|
159
|
-
nextStep: "Nothing was minted. Mint a shorter one and mint it again when it runs out
|
|
159
|
+
nextStep: "Nothing was minted. Mint a shorter one and mint it again when it runs out. A token " +
|
|
160
160
|
"cannot be withdrawn, so its life is the only bound on it.",
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -258,7 +258,7 @@ function exactly(text, length, what) {
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
if (bytes.length !== length) {
|
|
261
|
-
throw new NmtsError(`That ${what} is ${bytes.length} bytes
|
|
261
|
+
throw new NmtsError(`That ${what} is ${bytes.length} bytes. It must be ${length}.`, {
|
|
262
262
|
exitCode: 2,
|
|
263
263
|
nextStep: `Nothing was signed. Check that the right value was passed as the ${what}.`,
|
|
264
264
|
});
|
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.61.1";
|
|
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.61.1";
|
|
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. */
|
package/dist/public-codes.js
CHANGED
|
@@ -62,7 +62,7 @@ export async function readPublicCodes(server, token, accountProof) {
|
|
|
62
62
|
function noNextNumber(index) {
|
|
63
63
|
return new NmtsError(`The server wants public code #${index} next, and refuses it as revoked.`, {
|
|
64
64
|
exitCode: 4,
|
|
65
|
-
nextStep: "Nothing was published. The server has to let this account skip that number
|
|
65
|
+
nextStep: "Nothing was published. The server has to let this account skip that number. Report it.",
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
/** The live codes, lowest number first. */
|
|
@@ -136,7 +136,7 @@ export async function publishCode(crypt, code, door, from, replace) {
|
|
|
136
136
|
ring.wipe();
|
|
137
137
|
}
|
|
138
138
|
throw new NmtsError(`${PUBLISH_TRIES} public code numbers in a row were refused as revoked.`, {
|
|
139
|
-
nextStep: "Nothing was published. Try again later
|
|
139
|
+
nextStep: "Nothing was published. Try again later. If it repeats, report it.",
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
@@ -56,7 +56,7 @@ export async function recordRecoveryList(assembled, destination) {
|
|
|
56
56
|
if (error instanceof ServerError && error.code === "VERSION_CONFLICT") {
|
|
57
57
|
throw new NmtsError(`The file was written, and the server did not record it: ${error.message}`, {
|
|
58
58
|
exitCode: 4,
|
|
59
|
-
nextStep: `${destination} IS usable
|
|
59
|
+
nextStep: `${destination} IS usable. Keep it. What did not happen is the note on the server that ` +
|
|
60
60
|
`says which list is newest, because this account already has one numbered ${seq} or ` +
|
|
61
61
|
`higher: a browser or another machine wrote one this machine has not seen. This run has ` +
|
|
62
62
|
`been remembered, so running the command again offers a higher number.`,
|
|
@@ -84,7 +84,7 @@ const NOTE = [
|
|
|
84
84
|
`The original file list lives on the NMTS server. If the server can no longer be reached, this ` +
|
|
85
85
|
`list together with the NMTS key carries the information needed to find the files still ` +
|
|
86
86
|
`on the storage network and open them.`,
|
|
87
|
-
`A list with a higher number in its filename is newer
|
|
87
|
+
`A list with a higher number in its filename is newer. Keep the newest. Store this file ` +
|
|
88
88
|
`somewhere other than the NMTS key. The program that reads it is at ` +
|
|
89
89
|
`github.com/needmoretruth/nmts-recovery.`,
|
|
90
90
|
];
|
package/dist/recovery-map.js
CHANGED
|
@@ -95,7 +95,7 @@ export function buildRecoveryListDoc(input) {
|
|
|
95
95
|
}
|
|
96
96
|
const items = input.items.map((it) => {
|
|
97
97
|
if (it.parts.length === 0) {
|
|
98
|
-
throw new RecoveryListProblem(`item ${it.id} has no parts
|
|
98
|
+
throw new RecoveryListProblem(`item ${it.id} has no parts. Nothing to recover from`);
|
|
99
99
|
}
|
|
100
100
|
const partBytes = it.parts.reduce((sum, p) => sum + p.plaintext_len, 0);
|
|
101
101
|
if (partBytes !== it.size) {
|
package/dist/recovery-source.js
CHANGED
|
@@ -28,7 +28,7 @@ function unreadable(what) {
|
|
|
28
28
|
return new NmtsError(`The server described ${what} in a shape this version cannot read.`, {
|
|
29
29
|
exitCode: 1,
|
|
30
30
|
nextStep: "Nothing was written. Update this tool, or build the recovery list from the account " +
|
|
31
|
-
"screen in a browser
|
|
31
|
+
"screen in a browser. A list that skipped what it could not read would claim to cover " +
|
|
32
32
|
"files it does not.",
|
|
33
33
|
});
|
|
34
34
|
}
|
package/dist/recovery.js
CHANGED
|
@@ -110,7 +110,7 @@ export async function makeRecoveryList(account, options = {}) {
|
|
|
110
110
|
throw new NmtsError("This account has no file list, so nothing can be described.", {
|
|
111
111
|
exitCode: 4,
|
|
112
112
|
nextStep: `Nothing was written. A recovery list says what each stored file is CALLED and which key ` +
|
|
113
|
-
`opens it, and both come from the account's own file list
|
|
113
|
+
`opens it, and both come from the account's own file list. The storage network holds ` +
|
|
114
114
|
`neither. Run \`${BINARY_NAME} rebuild\` if this account has stored files but no list.`,
|
|
115
115
|
});
|
|
116
116
|
}
|
package/dist/risk.d.ts
CHANGED
|
@@ -453,25 +453,25 @@ export declare const ACTS: {
|
|
|
453
453
|
readonly "wallet.storage.reshape": {
|
|
454
454
|
readonly tier: "high";
|
|
455
455
|
readonly lock: "wallet";
|
|
456
|
-
readonly what: "Cut or join a storage resource the wallet holds
|
|
456
|
+
readonly what: "Cut or join a storage resource the wallet holds. A signed transaction.";
|
|
457
457
|
readonly asksItself: true;
|
|
458
458
|
};
|
|
459
459
|
readonly "wallet.storage.give": {
|
|
460
460
|
readonly tier: "high";
|
|
461
461
|
readonly lock: "wallet";
|
|
462
|
-
readonly what: "Hand a storage resource to another address
|
|
462
|
+
readonly what: "Hand a storage resource to another address. Signed, and not undoable.";
|
|
463
463
|
readonly asksItself: true;
|
|
464
464
|
};
|
|
465
465
|
readonly "wallet.storage.buy": {
|
|
466
466
|
readonly tier: "high";
|
|
467
467
|
readonly lock: "wallet";
|
|
468
|
-
readonly what: "Buy a storage resource with WAL from the wallet
|
|
468
|
+
readonly what: "Buy a storage resource with WAL from the wallet. Signed, and not undoable.";
|
|
469
469
|
readonly asksItself: true;
|
|
470
470
|
};
|
|
471
471
|
readonly "wallet.storage.extend": {
|
|
472
472
|
readonly tier: "high";
|
|
473
473
|
readonly lock: "wallet";
|
|
474
|
-
readonly what: "Extend a user's files with WAL from the wallet
|
|
474
|
+
readonly what: "Extend a user's files with WAL from the wallet. Signed, and not undoable.";
|
|
475
475
|
readonly asksItself: true;
|
|
476
476
|
};
|
|
477
477
|
};
|
package/dist/risk.js
CHANGED
|
@@ -207,12 +207,12 @@ export const ACTS = {
|
|
|
207
207
|
"wallet.use": { tier: "low", what: "Change which of this key's wallets pays for storage." },
|
|
208
208
|
"wallet.hall": { tier: "none" },
|
|
209
209
|
"wallet.hall.set": { tier: "medium", what: "Publish this name beside your wallet's address in the gift hall of fame." },
|
|
210
|
-
"wallet.storage.reshape": { tier: "high", lock: "wallet", what: "Cut or join a storage resource the wallet holds
|
|
211
|
-
"wallet.storage.give": { tier: "high", lock: "wallet", what: "Hand a storage resource to another address
|
|
210
|
+
"wallet.storage.reshape": { tier: "high", lock: "wallet", what: "Cut or join a storage resource the wallet holds. A signed transaction.", asksItself: true },
|
|
211
|
+
"wallet.storage.give": { tier: "high", lock: "wallet", what: "Hand a storage resource to another address. Signed, and not undoable.", asksItself: true },
|
|
212
212
|
// ⛔ BOTH SPEND WAL. Until 2026-11-11 `buy` fell through to the bare `wallet` read, tier none, so
|
|
213
213
|
// an auto mode ran a WAL purchase without the gate knowing a payment was coming.
|
|
214
|
-
"wallet.storage.buy": { tier: "high", lock: "wallet", what: "Buy a storage resource with WAL from the wallet
|
|
215
|
-
"wallet.storage.extend": { tier: "high", lock: "wallet", what: "Extend a user's files with WAL from the wallet
|
|
214
|
+
"wallet.storage.buy": { tier: "high", lock: "wallet", what: "Buy a storage resource with WAL from the wallet. Signed, and not undoable.", asksItself: true },
|
|
215
|
+
"wallet.storage.extend": { tier: "high", lock: "wallet", what: "Extend a user's files with WAL from the wallet. Signed, and not undoable.", asksItself: true },
|
|
216
216
|
};
|
|
217
217
|
export const ACT_IDS = Object.keys(ACTS);
|
|
218
218
|
/**
|
package/dist/s3/call.js
CHANGED
|
@@ -33,7 +33,7 @@ export function metaOf(req) {
|
|
|
33
33
|
/** The one sentence a write gets from `nmts s3` when this machine has not agreed to spending. */
|
|
34
34
|
export function readOnlyOnThisMachine() {
|
|
35
35
|
return ("This gateway is read only. Uploading spends credits, and this machine has not agreed to " +
|
|
36
|
-
"spending
|
|
36
|
+
"spending. `nmts consent grant spend`, run by the person whose account this is, is what " +
|
|
37
37
|
"changes that. Nothing was written.");
|
|
38
38
|
}
|
|
39
39
|
/** Why this drive takes no writes, in the words of whoever runs the gateway. */
|
package/dist/s3/same-file.js
CHANGED
|
@@ -119,7 +119,7 @@ export function refusalFor(verdict, key, standing = key) {
|
|
|
119
119
|
}
|
|
120
120
|
return new KeyConflict(verdict === "differs"
|
|
121
121
|
? `A different file is already at ${key}, and this drive does not replace files. Delete it ` +
|
|
122
|
-
"first
|
|
122
|
+
"first. A delete puts it in the trash, where it stays recoverable for thirty days."
|
|
123
123
|
: `A file is already at ${key} and this drive has no recorded hash for it, so it cannot tell ` +
|
|
124
124
|
"whether yours is the same one. Files stored before hashes were recorded are in this state. " +
|
|
125
125
|
"Delete it first if you mean to replace it.");
|
package/dist/setup-questions.js
CHANGED
|
@@ -27,5 +27,5 @@ export async function askAboutCollisions(say) {
|
|
|
27
27
|
say(` ${ANSWER_NUMBER.overwrite} ${COLLISION_MEANS.overwrite}`);
|
|
28
28
|
const choice = readAnswer(await promptLine(`[${ANSWER_NUMBER.rename}] `));
|
|
29
29
|
await setChoice(choice, VERSION, new Date());
|
|
30
|
-
say(`${choice}
|
|
30
|
+
say(`${choice}: ${COLLISION_MEANS[choice]} Change it: ${BINARY_NAME} on-collision <rename|overwrite>`);
|
|
31
31
|
}
|
|
@@ -42,6 +42,15 @@ export declare function hasLiveFile(index: ManifestIndex): boolean;
|
|
|
42
42
|
* Sorting belongs to the view: the same folder is shown by name, size and date in different places.
|
|
43
43
|
*/
|
|
44
44
|
export declare function childrenOf(index: ManifestIndex, parentId: string | null): readonly ManifestEntry[];
|
|
45
|
+
/**
|
|
46
|
+
* Does a live entry in that folder (`null` = drive root) already use `name`?
|
|
47
|
+
*
|
|
48
|
+
* The same rule as the command line and the SDK (cli/src/drive-edit/move.ts, `NAME_TAKEN`): a new
|
|
49
|
+
* folder, a rename and a move all refuse a name the destination already shows, file or folder.
|
|
50
|
+
* Exact match: `A.txt` and `a.txt` are two names, as in `unique-name.ts`. `except` holds the entries
|
|
51
|
+
* being renamed or moved, which do not collide with themselves.
|
|
52
|
+
*/
|
|
53
|
+
export declare function nameTakenIn(index: ManifestIndex, parentId: string | null, name: string, except?: ReadonlySet<string>): boolean;
|
|
45
54
|
/**
|
|
46
55
|
* What the trash view shows: items the person deleted directly, newest first.
|
|
47
56
|
* A child whose parent is also trashed is deliberately absent — it is restored with its parent.
|
|
@@ -82,6 +82,17 @@ export function childrenOf(index, parentId) {
|
|
|
82
82
|
return [];
|
|
83
83
|
return bucket.filter((e) => shown(index, e) && isLive(index, e));
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Does a live entry in that folder (`null` = drive root) already use `name`?
|
|
87
|
+
*
|
|
88
|
+
* The same rule as the command line and the SDK (cli/src/drive-edit/move.ts, `NAME_TAKEN`): a new
|
|
89
|
+
* folder, a rename and a move all refuse a name the destination already shows, file or folder.
|
|
90
|
+
* Exact match: `A.txt` and `a.txt` are two names, as in `unique-name.ts`. `except` holds the entries
|
|
91
|
+
* being renamed or moved, which do not collide with themselves.
|
|
92
|
+
*/
|
|
93
|
+
export function nameTakenIn(index, parentId, name, except = new Set()) {
|
|
94
|
+
return childrenOf(index, parentId).some((e) => e.name === name && !except.has(e.id));
|
|
95
|
+
}
|
|
85
96
|
/**
|
|
86
97
|
* What the trash view shows: items the person deleted directly, newest first.
|
|
87
98
|
* A child whose parent is also trashed is deliberately absent — it is restored with its parent.
|
|
@@ -37,14 +37,14 @@ export function planSlots(files) {
|
|
|
37
37
|
}
|
|
38
38
|
parts.forEach((part, position) => {
|
|
39
39
|
if (part.partIndex !== position) {
|
|
40
|
-
throw new HeavyOrderError("slot_count", `File "${file.key}" has no part ${position}
|
|
40
|
+
throw new HeavyOrderError("slot_count", `File "${file.key}" has no part ${position}. Its parts must be numbered 0..n-1.`);
|
|
41
41
|
}
|
|
42
42
|
if (!Number.isSafeInteger(part.sealedLen) || part.sealedLen < HEAVY_PIECE_MIN_BYTES) {
|
|
43
|
-
throw new HeavyOrderError("piece_too_small", `Part ${part.partIndex} of "${file.key}" seals to ${part.sealedLen} bytes
|
|
43
|
+
throw new HeavyOrderError("piece_too_small", `Part ${part.partIndex} of "${file.key}" seals to ${part.sealedLen} bytes. A piece needs ` +
|
|
44
44
|
`${HEAVY_PIECE_MIN_BYTES}. Pad it to at least ${HEAVY_MIN_SEAL_FROM_BYTES} bytes of plaintext.`);
|
|
45
45
|
}
|
|
46
46
|
if (part.sealedLen > HEAVY_PIECE_MAX_BYTES) {
|
|
47
|
-
throw new HeavyOrderError("piece_too_large", `Part ${part.partIndex} of "${file.key}" seals to ${part.sealedLen} bytes
|
|
47
|
+
throw new HeavyOrderError("piece_too_large", `Part ${part.partIndex} of "${file.key}" seals to ${part.sealedLen} bytes. A piece holds ` +
|
|
48
48
|
`at most ${HEAVY_PIECE_MAX_BYTES}.`);
|
|
49
49
|
}
|
|
50
50
|
plans.push({
|
|
@@ -57,7 +57,7 @@ export function planSlots(files) {
|
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
if (plans.length === 0 || plans.length > HEAVY_MAX_SLOTS) {
|
|
60
|
-
throw new HeavyOrderError("slot_count", `An order holds 1..${HEAVY_MAX_SLOTS} parts
|
|
60
|
+
throw new HeavyOrderError("slot_count", `An order holds 1..${HEAVY_MAX_SLOTS} parts. This upload has ${plans.length}.`);
|
|
61
61
|
}
|
|
62
62
|
return plans;
|
|
63
63
|
}
|
|
@@ -57,7 +57,7 @@ export async function uploadPieceToProvider(input) {
|
|
|
57
57
|
}
|
|
58
58
|
const total = sizeOf(bytes);
|
|
59
59
|
if (total < MIN_BYTES || total > MAX_BYTES) {
|
|
60
|
-
throw new PieceUploadError("size_out_of_range", `A piece must be ${MIN_BYTES}..${MAX_BYTES} bytes
|
|
60
|
+
throw new PieceUploadError("size_out_of_range", `A piece must be ${MIN_BYTES}..${MAX_BYTES} bytes. This part is ${total}.`);
|
|
61
61
|
}
|
|
62
62
|
const withSignal = signal === undefined ? {} : { signal };
|
|
63
63
|
// 1. Open an upload session.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type SealingShape } from "../crypto/size-padding.ts";
|
|
2
|
+
/** Largest request body the Walrus upload relay accepts, in bytes (hardcoded in the relay). */
|
|
3
|
+
export declare const RELAY_BODY_LIMIT_BYTES: number;
|
|
4
|
+
/**
|
|
5
|
+
* What NCF-3 adds to one part: a 72-byte header, and a 16-byte tag per 4 MiB chunk
|
|
6
|
+
* (CRYPTO-FORMAT-NCF3.md §4.1). Each program's own sealing constants are tested equal to this.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NCF3_PART_SHAPE: SealingShape;
|
|
9
|
+
/**
|
|
10
|
+
* The billing unit the free padding floor fills up to (one credit's worth of bytes). Each
|
|
11
|
+
* program's own `CREDIT_BYTES` is tested equal to this.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PADDING_UNIT_BYTES: number;
|
|
14
|
+
/**
|
|
15
|
+
* The largest relay body a part size can produce: a full part, or a final part padded by any rule.
|
|
16
|
+
* Padding only ever grows with the length, so the full-size final part is the worst case.
|
|
17
|
+
*/
|
|
18
|
+
export declare function largestSealedPartBytes(partSizeBytes: number): number;
|
|
19
|
+
/** True when every part this size can produce goes through the relay. */
|
|
20
|
+
export declare function partFitsRelay(partSizeBytes: number): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The largest whole-MiB part size that fits, derived from the two numbers above: 512 MiB, because
|
|
23
|
+
* `pow2` pads anything larger to 1 GiB and 1 GiB plus its envelope is over the limit.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MAX_PART_SIZE_BYTES: number;
|
|
26
|
+
/**
|
|
27
|
+
* Throw before anything is priced or signed when a part size could produce a part the relay will
|
|
28
|
+
* refuse. The message names both numbers so a caller sees what to choose instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare function requirePartFitsRelay(partSizeBytes: number): void;
|