@needmoretruth/nmts-cli 0.36.2 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/dist/artifact-about.d.ts +1 -1
- package/dist/commands/erase.js +1 -1
- package/dist/commands/organise.d.ts +5 -27
- package/dist/commands/organise.js +33 -193
- package/dist/commands/push.js +1 -1
- package/dist/commands/s3.d.ts +0 -10
- package/dist/commands/s3.js +46 -121
- package/dist/commands/trash.d.ts +0 -9
- package/dist/commands/trash.js +23 -223
- package/dist/drive-edit.d.ts +189 -0
- package/dist/drive-edit.js +541 -0
- package/dist/help.js +3 -3
- package/dist/product.d.ts +1 -1
- package/dist/product.js +1 -1
- package/dist/s3/drive.d.ts +108 -0
- package/dist/s3/drive.js +136 -0
- package/dist/s3/listing.d.ts +8 -1
- package/dist/s3/listing.js +8 -1
- package/dist/s3/server.d.ts +42 -3
- package/dist/s3/server.js +59 -20
- package/dist/s3/sigv4.d.ts +26 -0
- package/dist/s3/sigv4.js +37 -0
- package/dist/s3/xml.d.ts +8 -1
- package/dist/s3/xml.js +13 -4
- package/dist/s3-gateway.d.ts +8 -0
- package/dist/s3-gateway.js +13 -0
- package/docs/commands/create.md +2 -2
- package/docs/commands/env.md +1 -1
- package/docs/commands/extend.md +0 -3
- package/docs/commands/login.md +1 -1
- package/docs/commands/logout.md +1 -1
- package/docs/commands/marks.md +1 -1
- package/docs/commands/mcp.md +1 -1
- package/docs/commands/put.md +2 -2
- package/docs/commands/wallet.md +7 -9
- package/docs/commands/whoami.md +2 -2
- package/package.json +9 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createGateway, gatewayHandler } from "./s3/server.ts";
|
|
2
|
+
export type { DriveSource, DriveWriter, GatewayHandler, GatewayOptions } from "./s3/server.ts";
|
|
3
|
+
export { createDriveSource, fetchObject, placeOf, LIST_CACHE_MS } from "./s3/drive.ts";
|
|
4
|
+
export type { DriveAccount, DriveSourceOptions, ObjectReader } from "./s3/drive.ts";
|
|
5
|
+
export { createStaging } from "./s3/staging.ts";
|
|
6
|
+
export type { Staging, StoreFile } from "./s3/staging.ts";
|
|
7
|
+
export type { GatewayCredential } from "./s3/sigv4.ts";
|
|
8
|
+
export type { DriveObject } from "./s3/listing.ts";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// The S3 gateway as a library: the server `nmts s3` runs, for somebody else's infrastructure.
|
|
2
|
+
//
|
|
3
|
+
// ⛔ ONE IMPLEMENTATION, AND THIS IS THE DOOR TO IT. A business putting NMTS behind its own storage
|
|
4
|
+
// adapters needs the protocol this package already speaks, in its own process, in front of
|
|
5
|
+
// whichever of its customers' accounts a request names. A copy of the server in the SDK would
|
|
6
|
+
// be a second place for a signature check, a listing and a multipart upload to be got right,
|
|
7
|
+
// and the copy nobody re-reads is the one that quietly disagrees.
|
|
8
|
+
//
|
|
9
|
+
// ⚠ WHAT IS NOT HERE: the bucket name `nmts s3` uses, the address it binds, and the pair it prints
|
|
10
|
+
// when it starts. Those are that command's answers to questions a business answers for itself.
|
|
11
|
+
export { createGateway, gatewayHandler } from "./s3/server.js";
|
|
12
|
+
export { createDriveSource, fetchObject, placeOf, LIST_CACHE_MS } from "./s3/drive.js";
|
|
13
|
+
export { createStaging } from "./s3/staging.js";
|
package/docs/commands/create.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Commands: create
|
|
4
4
|
Tiers: create=high
|
|
5
5
|
|
|
6
|
-
Signs in with one account's key and creates another, printing the new
|
|
7
|
-
print it again, because the server stores a one-way verifier and never the NMTS key. This is how a
|
|
6
|
+
Signs in with one account's key and creates another, printing the new NMTS key once — nothing
|
|
7
|
+
can print it again, because the server stores a one-way verifier and never the NMTS key. This is how a
|
|
8
8
|
service that keeps its customers' files in NMTS gives each customer a drive; the first account of
|
|
9
9
|
all has to be made in a browser. It needs a key with `files:write` and a live human check behind
|
|
10
10
|
it, and the server allows two a day and five a week per key.
|
package/docs/commands/env.md
CHANGED
|
@@ -8,7 +8,7 @@ gives the same thing to parse. It reports the operating system; whether this is
|
|
|
8
8
|
container and whether root here is root on the host; whether a file written here can be kept
|
|
9
9
|
private (measured, not guessed); whether there is a terminal and whether a browser could be
|
|
10
10
|
opened; whether an NMTS key and an API key were found and where each came from; if the stored
|
|
11
|
-
|
|
11
|
+
NMTS key is sealed, whether a passphrase is actually reachable; which agent left a marker here; and
|
|
12
12
|
what the version check last found. The `advice` it returns is written to be repeated to the person
|
|
13
13
|
as-is — do that when something in it is a `warn`.
|
|
14
14
|
|
package/docs/commands/extend.md
CHANGED
|
@@ -15,9 +15,6 @@ nmts extend notes/report.pdf --epochs 4 # how many epochs to add (default 2)
|
|
|
15
15
|
If the account holds a standing share (`nmts tip`), that share of the WAL just paid goes to the
|
|
16
16
|
developer right after the extension, without a question.
|
|
17
17
|
|
|
18
|
-
```sh
|
|
19
|
-
```
|
|
20
|
-
|
|
21
18
|
Both forms print the price in WAL, the chain fee in SUI measured by a dry run of the exact
|
|
22
19
|
transaction (`null` in `--json` when it could not be measured, never 0), and what the wallet
|
|
23
20
|
holds. A wallet short of either exits 4 with the two numbers before anything else; a balance the
|
package/docs/commands/login.md
CHANGED
|
@@ -7,7 +7,7 @@ Tiers: login=none · login.plain=high(unsafe-code-storage) · login.env=high(pla
|
|
|
7
7
|
(`NMTS_API_KEY_FILE`, `NMTS_API_KEY`) with the server, and stores that too. It prints the key's
|
|
8
8
|
public handle and never the key. It does not replace a stored key unless the run says so.
|
|
9
9
|
|
|
10
|
-
Every later command needs the passphrase, from `NMTS_PASSPHRASE` or a terminal. A sealed
|
|
10
|
+
Every later command needs the passphrase, from `NMTS_PASSPHRASE` or a terminal. A sealed key with
|
|
11
11
|
no passphrase in reach is not a usable credential; `nmts env` says which case this machine is in.
|
|
12
12
|
|
|
13
13
|
Two other shapes exist and both are locked until a person opens them once, at a terminal:
|
package/docs/commands/logout.md
CHANGED
|
@@ -5,7 +5,7 @@ Tiers: logout=none
|
|
|
5
5
|
|
|
6
6
|
Removes the NMTS key and API key this tool stored on this machine. Nothing on the server
|
|
7
7
|
changes: the key stays valid until revoked (`nmts key revoke`, or the account screen), and the
|
|
8
|
-
account is untouched.
|
|
8
|
+
account is untouched. An NMTS key that came from an environment variable or a file is not touched
|
|
9
9
|
either — this only forgets what `nmts login` wrote.
|
|
10
10
|
|
|
11
11
|
Run it when a machine is handed over or a task is finished on a machine the person does not keep.
|
package/docs/commands/marks.md
CHANGED
|
@@ -5,5 +5,5 @@ Tiers: star=none · unstar=none · pin=none · unpin=none · label=none · unlab
|
|
|
5
5
|
|
|
6
6
|
Free and reversible; nothing here asks. `star <files>` gathers files in favourites, `pin <files>`
|
|
7
7
|
holds them at the top of their folder, and `label <name> <files>` attaches a word you choose; the
|
|
8
|
-
`un-` forms take each off. A label exists while a file
|
|
8
|
+
`un-` forms take each off. A label exists while a file has it. `label --rename <old> <new>`
|
|
9
9
|
renames a label on every file that carries it; `unlabel <name> --all` takes it off all of them.
|
package/docs/commands/mcp.md
CHANGED
|
@@ -28,6 +28,6 @@ codex mcp add nmts -- nmts mcp --out /where/files/should/land
|
|
|
28
28
|
opencode mcp add nmts -- nmts mcp --out /where/files/should/land
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
A sealed stored
|
|
31
|
+
A sealed stored NMTS key is opened once, at startup; `nmts mcp` never prompts, so a sealed key with
|
|
32
32
|
no `NMTS_PASSPHRASE` exits 3 at startup rather than hang. Arguments are checked against what each
|
|
33
33
|
tool declares — `"dry_run": "true"` is a refusal, not an upload.
|
package/docs/commands/put.md
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Commands: put
|
|
4
4
|
Tiers: put=medium · put.wallet=high(wallet)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
`put` spends credits: one per started mebibyte, and the price is printed before the upload
|
|
7
|
+
starts. In the default mode it asks first (answer at the terminal, or run with `--yes`);
|
|
8
8
|
in an auto mode it runs when you judge it is what the person wants.
|
|
9
9
|
|
|
10
10
|
```sh
|
package/docs/commands/wallet.md
CHANGED
|
@@ -74,12 +74,10 @@ Three coin subcommands sign, and every signed transaction is irreversible by any
|
|
|
74
74
|
explorer. It is outside the wallet unlock and its ceiling. A standing share of every WAL
|
|
75
75
|
payment is `nmts tip`, not a gift on its own.
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
address. Reading which wallet that is opens the file list, so naming yourself needs an API key
|
|
85
|
-
where reading the hall needs none.
|
|
77
|
+
`wallet hall` prints the gift hall of fame — the developer, then the ten largest senders as read
|
|
78
|
+
from the public chain, with the rest of the list at nmts.me/hall; reading it signs nothing and
|
|
79
|
+
needs no NMTS key. `--name <name>` (1 to 24 characters, no links, not an address) signs a
|
|
80
|
+
short message with the wallet this account pays from — the wallet a gift left from — so the
|
|
81
|
+
server shows that name beside its address, and `--remove` puts the entry back to a shortened
|
|
82
|
+
address. Reading which wallet that is opens the file list, so naming yourself needs an API key
|
|
83
|
+
where reading the hall needs none.
|
package/docs/commands/whoami.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Commands: whoami
|
|
4
4
|
Tiers: whoami=none · whoami.reveal=high(reveal)
|
|
5
5
|
|
|
6
|
-
Prints the account id the stored
|
|
6
|
+
Prints the account id the stored NMTS key belongs to, offline, with no server call. `--json` gives it
|
|
7
7
|
to a program.
|
|
8
8
|
|
|
9
9
|
`--reveal` prints the NMTS key itself. An agent never needs this — the tool already holds the
|
|
10
|
-
|
|
10
|
+
key — so it is locked until a person runs `nmts unlock reveal` at a terminal, and then asked about
|
|
11
11
|
on every run in every mode but skip-permissions. Never write the NMTS key anywhere it can be read
|
|
12
12
|
again: a log, a commit, a file, a message. It is the only key to the account and cannot be rotated.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needmoretruth/nmts-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
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": {
|
|
@@ -77,6 +77,14 @@
|
|
|
77
77
|
"types": "./dist/drive-paths.d.ts",
|
|
78
78
|
"default": "./dist/drive-paths.js"
|
|
79
79
|
},
|
|
80
|
+
"./drive-edit": {
|
|
81
|
+
"types": "./dist/drive-edit.d.ts",
|
|
82
|
+
"default": "./dist/drive-edit.js"
|
|
83
|
+
},
|
|
84
|
+
"./s3-gateway": {
|
|
85
|
+
"types": "./dist/s3-gateway.d.ts",
|
|
86
|
+
"default": "./dist/s3-gateway.js"
|
|
87
|
+
},
|
|
80
88
|
"./upload-file": {
|
|
81
89
|
"types": "./dist/upload-file.d.ts",
|
|
82
90
|
"default": "./dist/upload-file.js"
|