@moredrive/cli 1.3.0 → 1.5.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/docs/security.md CHANGED
@@ -3,23 +3,27 @@
3
3
  Sensitive values:
4
4
 
5
5
  - MoreDrive JWT
6
+ - refresh token
6
7
  - share token
7
8
  - password
8
9
  - cookie
9
10
  - `Authorization`
10
11
  - Baidu dlink query values such as `access_token`
12
+ - local player `stream` session URL
11
13
 
12
- Prefer `MOREDRIVE_TOKEN`, `--password-stdin`, `MOREDRIVE_SHARE_TOKEN`, `--share-token-file`, and `config set token --stdin`. Credential argv may be visible in process lists and shell history. Select exactly one source for each credential. `share access --save-token-to` creates a new 0600 handoff file, refuses existing files and symbolic links, and omits the token from JSON; otherwise its token output is explicitly sensitive.
14
+ Prefer `MOREDRIVE_TOKEN`, `--password-stdin`, `MOREDRIVE_SHARE_TOKEN`, `--share-token-file`, and `config set token --stdin`. Credential argv may be visible in process lists and shell history. App tokens use the first non-empty value from argv, environment, profile access token, then legacy profile token; conflicting app-token sources are accepted with that precedence. Password flags, share-token sources and `config set token` value sources are mutually exclusive within each group. `share access --save-token-to` creates a new 0600 handoff file, refuses existing files and symbolic links, and omits the token from JSON; otherwise its token output is explicitly sensitive.
13
15
 
14
- The CLI and client redact these values from errors and default JSON outputs. `moredrive link --raw --json` is the only MVP command path that intentionally returns a full dlink.
16
+ The CLI and client redact credentials and provider dlinks from errors and default command outputs. `moredrive link --raw --json` intentionally returns a full provider dlink. `share access` without a handoff file returns the share token, and `stream` emits its local session URL in `ready`; handle those outputs as secrets.
15
17
 
16
18
  Config storage:
17
19
 
18
- - The MVP stores tokens in the local JSON config file.
20
+ - Access and refresh tokens are stored in the local JSON config file, not encrypted at rest.
19
21
  - POSIX writes attempt `0600` permissions.
20
22
  - Windows ACL hardening is deferred.
21
23
  - Token storage is isolated behind config helpers so a future keychain store can replace plaintext storage.
22
24
 
25
+ Saved sessions refresh automatically. Explicit token/base-URL overrides disable profile refresh for that invocation to avoid sending the saved refresh token to an override endpoint. `logout` attempts server revocation and always clears local credentials; `serverRevocation: "unavailable"` or `"not-attempted"` must not be reported as confirmed revocation.
26
+
23
27
  Destructive operations:
24
28
 
25
29
  - `rm` requires `--yes` or `MOREDRIVE_ASSUME_YES=1`.
@@ -37,3 +41,9 @@ Transfer safety:
37
41
  - If a dlink host ignores `Range`, CLI falls back to single-stream instead of combining unsafe byte ranges.
38
42
  - Upload requires `slice_upload_ticket`; Worker proxy slice upload is not used by CLI MVP.
39
43
  - If the Worker does not issue a ticket, CLI returns `unsupported`.
44
+
45
+ Local media and playback:
46
+
47
+ - `stream` binds only to `127.0.0.1`, checks Host and the random session path, and rejects browser Origin requests. Its URL grants local access; do not publish it or forward the port. Stop the CLI after playback to invalidate it.
48
+ - Ordinary upload/download preserves bytes. `media encrypt`/`media decrypt` and `stream --decrypt` require explicit conversion intent. The supported weak-media XOR format is obfuscation, not protection for secrets.
49
+ - `media thumbnails` reads remote media and writes a new local pack; generation does not upload it. FFmpeg must be explicitly selected by absolute path and is never automatically installed. Publishing or replacing the cloud pack is a separate upload subject to normal conflict rules.
package/json-contract.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # JSON Contract
2
2
 
3
- Every `--json` command writes exactly one JSON object to stdout.
3
+ Completed `--json` actions write exactly one result envelope to stdout. Help/version are discovery output, and offline `schema output`/`schema jsonl` print the schema itself without an envelope. Long-running `stream` rejects `--json`; use `--jsonl`.
4
4
 
5
5
  Success:
6
6
 
@@ -54,5 +54,9 @@ Rules:
54
54
  - The JSONL schema is self-contained and can be compiled directly. Whole-stream validation additionally enforces command-family consistency, event ordering, terminal polarity, and no blank or trailing events.
55
55
  - `--json` and `--jsonl` are mutually exclusive.
56
56
  - `schema output/jsonl --revision 2` selects the legacy artifact; `2.1` and the default select the batch-aware artifact.
57
- - URLs containing `access_token`, token values, passwords, cookies, and Authorization headers are redacted unless the user explicitly asks for `link --raw`.
57
+ - Revision `2.1` also describes current media/stream commands; artifact revision `2.1` is distinct from envelope `schemaVersion: "moredrive.cli.v2"`.
58
+ - Credentials and provider URLs are redacted from ordinary outputs. Intentional sensitive outputs are the provider URL from `link --raw`, the token from `share access` without `--save-token-to`, and the local session URL from `stream`.
58
59
  - Recursive download success data uses `kind: "batch"` with stable item ordering. Batch items never expose provider `fsId`, raw metadata, dlinks, or headers; partial batch success still uses a success envelope and exits 1.
60
+ - `ok: true` reports a successful action/status request, not necessarily a completed operation. Inspect `data.status`, item outcomes and exit code for file operations, external saves and media batches. `--no-wait` allows accepted submissions to exit 0.
61
+ - `stream --jsonl` emits `ready` with `command: "stream"`, `url`, `fsId`, `size`, and `decrypted`, then exactly one `result` or `failed`. Keep reading while the player uses the service; Ctrl+C/SIGTERM normally returns a result with `status: "stopped"` and `bytesServed`.
62
+ - Media conversion and thumbnail generation report per-item status/reason in the final result. Progress diagnostics go to stderr; JSONL still has one top-level terminal event. Thumbnail results include `uploaded: false` and a local pack path; creation alone does not publish a cloud pack.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moredrive/cli",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "description": "MoreDrive command-line client",
6
6
  "license": "UNLICENSED",
package/release-notes.md CHANGED
@@ -1,4 +1,29 @@
1
- # MoreDrive CLI 1.3
1
+ # MoreDrive CLI
2
+
3
+ ## 1.5.0
4
+
5
+ v1.5.0 发行候选;正式上架状态以官网下载目录为准。
6
+
7
+ - 普通传输默认 auto;支持策略驱动弱媒体转换,raw 可固定原字节行为,SDK 默认不变。
8
+ - 新成功上传使用本批本地来源生成并发布兼容封面;FFmpeg 显式配置,缺失仅影响派生结果。
9
+ - 支持 `media.mode`、`media.thumbnails`、`media.decoderPath` 与命令覆盖;JSON revision 2.1 扩展,revision 2 保持不变。
10
+ - 原件转换失败停止该项;封面失败显式补齐,持久发布记录仅用于已发起操作的核对及必要回退。
11
+
12
+ - 修复 macOS 临时目录别名导致自动封面被误判为不安全输出的问题。
13
+
14
+ ## 1.4.0
15
+
16
+ - `stream` serves one Personal Drive file to a local VLC/mpv player over loopback, with bounded Range reads, optional explicit decryption, JSONL `ready` discovery and foreground lifetime until shutdown. `--json` is rejected for this long-running command.
17
+ - `media encrypt` and `media decrypt` provide explicit offline conversion without changing input files or overwriting outputs. `media thumbnails` reads the current account's remote directory and creates a local compatible pack using an explicitly provided FFmpeg; uploading the pack is a separate step. Ordinary transfers preserve bytes.
18
+ - Upload/download limits can be configured per profile or overridden with `--upload-limit`/`--download-limit`. Each direction shares one budget across transfers within a CLI process.
19
+ - Saved login sessions support access-token refresh and best-effort server revocation on logout. Token or base-URL overrides disable profile refresh for that invocation. App tokens use argv/environment/profile precedence; password and share-token input groups remain mutually exclusive.
20
+ - This historical release used package version `1.4.0`; envelope version remains `moredrive.cli.v2`, and current offline schema artifacts are revision `2.1`.
21
+
22
+ ### Documentation maintenance after release
23
+
24
+ The source documentation now covers playback, media tools, limits and session recovery; examples default to create-only writes. Packaging preserves offline schema guidance in the Skill and renders the README filename from the package version. These maintenance changes apply to subsequent builds; already published/frozen 1.4.0 bytes are not rewritten.
25
+
26
+ ## 1.3.0 (historical)
2
27
 
3
28
  - Recursive Personal Drive downloads are available with `download <directory> --recursive`; they preserve remote paths, use bounded file/Range concurrency, and report completed/partial/failed batch results. Scan limits are 5,000 files, 10,000 entries, and 32 MiB metadata.
4
29
  - Batch-aware schema artifacts are published as `v2.1`; offline schema discovery accepts explicit revisions `2` and `2.1`. Revision `2` remains byte-for-byte immutable and validates only the legacy command surface; recursive batch consumers must use `2.1`.
@@ -10,6 +35,6 @@
10
35
  - Offline `schema output` and `schema jsonl` are available without config, token, or network access.
11
36
  - Corrupt or incompatible config is `config-error`/exit 3 and must not be retried as a network failure.
12
37
  - Credential argv remains supported for compatibility but is not recommended. Prefer environment, stdin, and file handoff options.
13
- - Credential sources are mutually exclusive. Share-token file handoff creates a new 0600 file and refuses existing files or symbolic links.
38
+ - Password flags, share-token sources and config token value sources are mutually exclusive. App tokens use argv/environment/profile precedence. Share-token file handoff creates a new 0600 file and refuses existing files or symbolic links.
14
39
  - SIGINT is carried through destructive `rm` preflight and submission, so cancellation during stat cannot continue into deletion.
15
40
  - The file package now contains the Skill, release docs, and schemas. The package filename, manifest, executable, and User-Agent use the CLI package version (`1.3.0`).
@@ -112,6 +112,28 @@
112
112
  "required": [],
113
113
  "additionalProperties": false
114
114
  },
115
+ "media": {
116
+ "type": "object",
117
+ "properties": {
118
+ "mode": {
119
+ "enum": [
120
+ "auto",
121
+ "raw"
122
+ ]
123
+ },
124
+ "thumbnails": {
125
+ "enum": [
126
+ "auto",
127
+ "off"
128
+ ]
129
+ },
130
+ "decoderPath": {
131
+ "type": "string"
132
+ }
133
+ },
134
+ "required": [],
135
+ "additionalProperties": false
136
+ },
115
137
  "createdAt": {
116
138
  "type": "string"
117
139
  },