reallink-cli 0.1.14 → 0.1.16
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 +39 -0
- package/bin/reallink.cjs +7 -2
- package/package.json +11 -4
- package/prebuilt/linux-x64/reallink-cli +0 -0
- package/rust/Cargo.lock +212 -7
- package/rust/Cargo.toml +8 -2
- package/rust/src/logs.rs +8 -3
- package/rust/src/main.rs +2241 -167
- package/rust/src/unreal.rs +225 -2
- package/scripts/postinstall.cjs +1 -1
- package/prebuilt/win32-x64/reallink-cli.exe +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Rust-based CLI for Reallink authentication, token workflows, and workspace file CRUD.
|
|
4
4
|
|
|
5
|
+
This package now includes an agent-oriented capability surface:
|
|
6
|
+
|
|
7
|
+
- `reallink call` for direct authenticated API access
|
|
8
|
+
- `reallink ops list/search/show/invoke` for capability discovery and invocation
|
|
9
|
+
- explicit bearer token override support so agents can run without a saved interactive session
|
|
10
|
+
|
|
5
11
|
## Install
|
|
6
12
|
|
|
7
13
|
```bash
|
|
@@ -11,6 +17,13 @@ npm install -g reallink-cli
|
|
|
11
17
|
On supported published platforms, npm installs a bundled prebuilt binary so install/update is fast.
|
|
12
18
|
If a prebuilt binary is not available for your OS/arch, npm falls back to a one-time Rust release build during postinstall.
|
|
13
19
|
After install, `reallink` runs the compiled binary directly (no per-command cargo compile step).
|
|
20
|
+
Windows and Linux packaging should be validated through the package smoke test:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm run smoke:install -- --mode prebuilt
|
|
24
|
+
npm run smoke:install -- --mode build
|
|
25
|
+
```
|
|
26
|
+
|
|
14
27
|
CLI caches update metadata daily. To keep command startup fast, network update checks run during `reallink login` (or explicitly via `reallink self-update --check`) rather than every command.
|
|
15
28
|
|
|
16
29
|
Output defaults to JSON for agent-friendly automation. You can switch to human text with `--format text`.
|
|
@@ -25,6 +38,27 @@ reallink self-update
|
|
|
25
38
|
reallink whoami
|
|
26
39
|
reallink logout
|
|
27
40
|
|
|
41
|
+
reallink call GET /projects
|
|
42
|
+
reallink call POST /tools/runs --body @run.json
|
|
43
|
+
reallink call GET /projects --access-token <token> --base-url https://api.real-agent.link
|
|
44
|
+
|
|
45
|
+
reallink ops list
|
|
46
|
+
reallink ops search connect
|
|
47
|
+
reallink ops show get_v1_projects_projectId_connect_clients
|
|
48
|
+
reallink ops invoke get_v1_projects_projectId_connect_clients --project-id prj_xxx
|
|
49
|
+
reallink ops invoke post_v1_projects_projectId_connect_ticket --project-id prj_xxx
|
|
50
|
+
reallink ops invoke post_v1_tools_runs --org-id org_xxx --project-id prj_xxx --body @run.json
|
|
51
|
+
reallink ops list --access-token <token> --base-url https://api.real-agent.link
|
|
52
|
+
|
|
53
|
+
reallink call GET /projects/prj_xxx/connect/transports --access-token <token> --base-url https://api.real-agent.link
|
|
54
|
+
reallink call POST /projects/prj_xxx/workspace/read --access-token <token> --base-url https://api.real-agent.link --body '{"path":"README.txt"}'
|
|
55
|
+
reallink call POST /projects/prj_xxx/workspace/write --access-token <token> --base-url https://api.real-agent.link --body '{"path":"Docs/agent-note.txt","content":"hello from agent cli","createParents":true}'
|
|
56
|
+
reallink call POST /projects/prj_xxx/workspace/list --access-token <token> --base-url https://api.real-agent.link --body '{"path":"Docs"}'
|
|
57
|
+
|
|
58
|
+
node ./scripts/cli-connect-workspace-e2e.mjs --project-id prj_xxx
|
|
59
|
+
node ./scripts/pull-connect-workspace-e2e.mjs --project-id prj_xxx
|
|
60
|
+
node ./scripts/connect-transport-matrix-e2e.mjs --project-id prj_xxx --retries 2
|
|
61
|
+
|
|
28
62
|
reallink org list
|
|
29
63
|
reallink org create --name "My Org"
|
|
30
64
|
reallink org get --org-id org_xxx
|
|
@@ -89,6 +123,10 @@ reallink link list
|
|
|
89
123
|
reallink link use --project-id prj_xxx
|
|
90
124
|
reallink link doctor --project-id prj_xxx
|
|
91
125
|
reallink link doctor --project-id prj_xxx --verify-remote
|
|
126
|
+
reallink link source --project-id prj_xxx --path ./game-source --label project
|
|
127
|
+
reallink link connect --project-id prj_xxx
|
|
128
|
+
reallink link connect --project-id prj_xxx --workspace-id dev-mac-main --transport websocket
|
|
129
|
+
reallink link connect --project-id prj_xxx --access-token <token> --base-url https://api.real-agent.link
|
|
92
130
|
reallink link paths --project-id prj_xxx
|
|
93
131
|
reallink link open
|
|
94
132
|
reallink link open --project-id prj_xxx --arg "-game" --arg "-log"
|
|
@@ -106,6 +144,7 @@ reallink link plugin install --project-id prj_xxx --name RealLinkUnreal --url ht
|
|
|
106
144
|
- By default it requests core/assets/trace/scheduler/admin scopes plus `tools:*`.
|
|
107
145
|
- If the server rejects `tools:*` as invalid, CLI automatically retries with compatible scopes.
|
|
108
146
|
- You can always pass explicit scopes via repeated `--scope`.
|
|
147
|
+
- Agent-oriented commands can bypass the saved login session by passing `--access-token <token>` together with `--base-url`.
|
|
109
148
|
|
|
110
149
|
`tool register`, `tool enable/disable` metadata, `tool run --input-file`, and `tool prompt --input-file` accept JSONC.
|
|
111
150
|
`tool context put --text-file` accepts plain UTF-8 text files and stores scoped context via API gateway.
|
package/bin/reallink.cjs
CHANGED
|
@@ -35,6 +35,10 @@ function runBinary(binaryPath) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function resolvePreferredBinary() {
|
|
38
|
+
if (process.env.REALLINK_FORCE_BUILD === "1") {
|
|
39
|
+
return resolveExistingReleaseBinary();
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
if (fs.existsSync(prebuiltBinaryPath)) {
|
|
39
43
|
return prebuiltBinaryPath;
|
|
40
44
|
}
|
|
@@ -42,7 +46,8 @@ function resolvePreferredBinary() {
|
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
function ensureBinary() {
|
|
45
|
-
|
|
49
|
+
const preferredBinary = resolvePreferredBinary();
|
|
50
|
+
if (preferredBinary && process.env.REALLINK_FORCE_BUILD !== "1") {
|
|
46
51
|
return true;
|
|
47
52
|
}
|
|
48
53
|
|
|
@@ -63,7 +68,7 @@ function ensureBinary() {
|
|
|
63
68
|
return false;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
return build.status === 0 && !!
|
|
71
|
+
return build.status === 0 && !!resolveExistingReleaseBinary();
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
if (!ensureBinary()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reallink-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "Rust-based CLI for Reallink auth and API operations",
|
|
5
5
|
"bin": {
|
|
6
6
|
"reallink": "bin/reallink.cjs"
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"contract:codegen": "node ./scripts/generate-contract.mjs",
|
|
20
|
-
"prepack": "
|
|
20
|
+
"prepack": "node ./scripts/generate-contract.mjs && node ./scripts/prepare-prebuilt.cjs",
|
|
21
21
|
"postinstall": "node ./scripts/postinstall.cjs",
|
|
22
|
-
"build": "
|
|
22
|
+
"build": "node ./scripts/generate-contract.mjs && cargo build --manifest-path ./rust/Cargo.toml --release",
|
|
23
23
|
"dev": "node ./bin/reallink.cjs --help",
|
|
24
|
-
"pack:local": "npm pack --json"
|
|
24
|
+
"pack:local": "npm pack --json",
|
|
25
|
+
"smoke:install": "node ./scripts/smoke-install.cjs"
|
|
25
26
|
},
|
|
26
27
|
"keywords": [
|
|
27
28
|
"reallink",
|
|
@@ -30,6 +31,12 @@
|
|
|
30
31
|
"oauth"
|
|
31
32
|
],
|
|
32
33
|
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/real-link-tech/ReallinkOS.git",
|
|
37
|
+
"directory": "packages/reallink-cli"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/real-link-tech/ReallinkOS/tree/main/packages/reallink-cli",
|
|
33
40
|
"publishConfig": {
|
|
34
41
|
"access": "public"
|
|
35
42
|
}
|
|
Binary file
|
package/rust/Cargo.lock
CHANGED
|
@@ -8,6 +8,15 @@ version = "2.0.1"
|
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
9
|
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
|
10
10
|
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "aho-corasick"
|
|
13
|
+
version = "1.1.4"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
16
|
+
dependencies = [
|
|
17
|
+
"memchr",
|
|
18
|
+
]
|
|
19
|
+
|
|
11
20
|
[[package]]
|
|
12
21
|
name = "anstream"
|
|
13
22
|
version = "0.6.21"
|
|
@@ -106,6 +115,12 @@ version = "3.20.2"
|
|
|
106
115
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
116
|
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
|
|
108
117
|
|
|
118
|
+
[[package]]
|
|
119
|
+
name = "byteorder"
|
|
120
|
+
version = "1.5.0"
|
|
121
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
122
|
+
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|
123
|
+
|
|
109
124
|
[[package]]
|
|
110
125
|
name = "bytes"
|
|
111
126
|
version = "1.11.1"
|
|
@@ -246,6 +261,12 @@ dependencies = [
|
|
|
246
261
|
"typenum",
|
|
247
262
|
]
|
|
248
263
|
|
|
264
|
+
[[package]]
|
|
265
|
+
name = "data-encoding"
|
|
266
|
+
version = "2.10.0"
|
|
267
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
268
|
+
checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea"
|
|
269
|
+
|
|
249
270
|
[[package]]
|
|
250
271
|
name = "derive_arbitrary"
|
|
251
272
|
version = "1.4.2"
|
|
@@ -305,6 +326,16 @@ version = "1.0.2"
|
|
|
305
326
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
306
327
|
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
|
307
328
|
|
|
329
|
+
[[package]]
|
|
330
|
+
name = "errno"
|
|
331
|
+
version = "0.3.14"
|
|
332
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
333
|
+
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
|
334
|
+
dependencies = [
|
|
335
|
+
"libc",
|
|
336
|
+
"windows-sys 0.61.2",
|
|
337
|
+
]
|
|
338
|
+
|
|
308
339
|
[[package]]
|
|
309
340
|
name = "find-msvc-tools"
|
|
310
341
|
version = "0.1.9"
|
|
@@ -345,6 +376,23 @@ version = "0.3.32"
|
|
|
345
376
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
346
377
|
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
|
|
347
378
|
|
|
379
|
+
[[package]]
|
|
380
|
+
name = "futures-macro"
|
|
381
|
+
version = "0.3.32"
|
|
382
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
383
|
+
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
|
|
384
|
+
dependencies = [
|
|
385
|
+
"proc-macro2",
|
|
386
|
+
"quote",
|
|
387
|
+
"syn",
|
|
388
|
+
]
|
|
389
|
+
|
|
390
|
+
[[package]]
|
|
391
|
+
name = "futures-sink"
|
|
392
|
+
version = "0.3.32"
|
|
393
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
394
|
+
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
|
|
395
|
+
|
|
348
396
|
[[package]]
|
|
349
397
|
name = "futures-task"
|
|
350
398
|
version = "0.3.32"
|
|
@@ -358,6 +406,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
358
406
|
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
|
|
359
407
|
dependencies = [
|
|
360
408
|
"futures-core",
|
|
409
|
+
"futures-macro",
|
|
410
|
+
"futures-sink",
|
|
361
411
|
"futures-task",
|
|
362
412
|
"pin-project-lite",
|
|
363
413
|
"slab",
|
|
@@ -412,6 +462,17 @@ version = "0.5.0"
|
|
|
412
462
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
413
463
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
414
464
|
|
|
465
|
+
[[package]]
|
|
466
|
+
name = "hostname"
|
|
467
|
+
version = "0.4.2"
|
|
468
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
469
|
+
checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd"
|
|
470
|
+
dependencies = [
|
|
471
|
+
"cfg-if",
|
|
472
|
+
"libc",
|
|
473
|
+
"windows-link",
|
|
474
|
+
]
|
|
475
|
+
|
|
415
476
|
[[package]]
|
|
416
477
|
name = "http"
|
|
417
478
|
version = "1.4.0"
|
|
@@ -486,7 +547,7 @@ dependencies = [
|
|
|
486
547
|
"tokio",
|
|
487
548
|
"tokio-rustls",
|
|
488
549
|
"tower-service",
|
|
489
|
-
"webpki-roots",
|
|
550
|
+
"webpki-roots 1.0.6",
|
|
490
551
|
]
|
|
491
552
|
|
|
492
553
|
[[package]]
|
|
@@ -921,7 +982,7 @@ dependencies = [
|
|
|
921
982
|
"bytes",
|
|
922
983
|
"getrandom 0.3.4",
|
|
923
984
|
"lru-slab",
|
|
924
|
-
"rand",
|
|
985
|
+
"rand 0.9.2",
|
|
925
986
|
"ring",
|
|
926
987
|
"rustc-hash",
|
|
927
988
|
"rustls",
|
|
@@ -962,14 +1023,35 @@ version = "5.3.0"
|
|
|
962
1023
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
963
1024
|
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
|
|
964
1025
|
|
|
1026
|
+
[[package]]
|
|
1027
|
+
name = "rand"
|
|
1028
|
+
version = "0.8.5"
|
|
1029
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1030
|
+
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
|
1031
|
+
dependencies = [
|
|
1032
|
+
"libc",
|
|
1033
|
+
"rand_chacha 0.3.1",
|
|
1034
|
+
"rand_core 0.6.4",
|
|
1035
|
+
]
|
|
1036
|
+
|
|
965
1037
|
[[package]]
|
|
966
1038
|
name = "rand"
|
|
967
1039
|
version = "0.9.2"
|
|
968
1040
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
969
1041
|
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
|
970
1042
|
dependencies = [
|
|
971
|
-
"rand_chacha",
|
|
972
|
-
"rand_core",
|
|
1043
|
+
"rand_chacha 0.9.0",
|
|
1044
|
+
"rand_core 0.9.5",
|
|
1045
|
+
]
|
|
1046
|
+
|
|
1047
|
+
[[package]]
|
|
1048
|
+
name = "rand_chacha"
|
|
1049
|
+
version = "0.3.1"
|
|
1050
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1051
|
+
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
|
1052
|
+
dependencies = [
|
|
1053
|
+
"ppv-lite86",
|
|
1054
|
+
"rand_core 0.6.4",
|
|
973
1055
|
]
|
|
974
1056
|
|
|
975
1057
|
[[package]]
|
|
@@ -979,7 +1061,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
979
1061
|
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
|
980
1062
|
dependencies = [
|
|
981
1063
|
"ppv-lite86",
|
|
982
|
-
"rand_core",
|
|
1064
|
+
"rand_core 0.9.5",
|
|
1065
|
+
]
|
|
1066
|
+
|
|
1067
|
+
[[package]]
|
|
1068
|
+
name = "rand_core"
|
|
1069
|
+
version = "0.6.4"
|
|
1070
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1071
|
+
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
|
1072
|
+
dependencies = [
|
|
1073
|
+
"getrandom 0.2.17",
|
|
983
1074
|
]
|
|
984
1075
|
|
|
985
1076
|
[[package]]
|
|
@@ -993,17 +1084,23 @@ dependencies = [
|
|
|
993
1084
|
|
|
994
1085
|
[[package]]
|
|
995
1086
|
name = "reallink-cli"
|
|
996
|
-
version = "0.1.
|
|
1087
|
+
version = "0.1.16"
|
|
997
1088
|
dependencies = [
|
|
998
1089
|
"anyhow",
|
|
999
1090
|
"clap",
|
|
1000
1091
|
"dirs",
|
|
1092
|
+
"futures-util",
|
|
1093
|
+
"hostname",
|
|
1001
1094
|
"json5",
|
|
1095
|
+
"regex",
|
|
1002
1096
|
"reqwest",
|
|
1003
1097
|
"serde",
|
|
1004
1098
|
"serde_json",
|
|
1005
1099
|
"sha2",
|
|
1006
1100
|
"tokio",
|
|
1101
|
+
"tokio-tungstenite",
|
|
1102
|
+
"urlencoding",
|
|
1103
|
+
"walkdir",
|
|
1007
1104
|
"webbrowser",
|
|
1008
1105
|
"zip",
|
|
1009
1106
|
]
|
|
@@ -1019,6 +1116,35 @@ dependencies = [
|
|
|
1019
1116
|
"thiserror 1.0.69",
|
|
1020
1117
|
]
|
|
1021
1118
|
|
|
1119
|
+
[[package]]
|
|
1120
|
+
name = "regex"
|
|
1121
|
+
version = "1.12.3"
|
|
1122
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1123
|
+
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
|
1124
|
+
dependencies = [
|
|
1125
|
+
"aho-corasick",
|
|
1126
|
+
"memchr",
|
|
1127
|
+
"regex-automata",
|
|
1128
|
+
"regex-syntax",
|
|
1129
|
+
]
|
|
1130
|
+
|
|
1131
|
+
[[package]]
|
|
1132
|
+
name = "regex-automata"
|
|
1133
|
+
version = "0.4.14"
|
|
1134
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1135
|
+
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
|
1136
|
+
dependencies = [
|
|
1137
|
+
"aho-corasick",
|
|
1138
|
+
"memchr",
|
|
1139
|
+
"regex-syntax",
|
|
1140
|
+
]
|
|
1141
|
+
|
|
1142
|
+
[[package]]
|
|
1143
|
+
name = "regex-syntax"
|
|
1144
|
+
version = "0.8.10"
|
|
1145
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1146
|
+
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
1147
|
+
|
|
1022
1148
|
[[package]]
|
|
1023
1149
|
name = "reqwest"
|
|
1024
1150
|
version = "0.12.28"
|
|
@@ -1054,7 +1180,7 @@ dependencies = [
|
|
|
1054
1180
|
"wasm-bindgen",
|
|
1055
1181
|
"wasm-bindgen-futures",
|
|
1056
1182
|
"web-sys",
|
|
1057
|
-
"webpki-roots",
|
|
1183
|
+
"webpki-roots 1.0.6",
|
|
1058
1184
|
]
|
|
1059
1185
|
|
|
1060
1186
|
[[package]]
|
|
@@ -1188,6 +1314,17 @@ dependencies = [
|
|
|
1188
1314
|
"serde",
|
|
1189
1315
|
]
|
|
1190
1316
|
|
|
1317
|
+
[[package]]
|
|
1318
|
+
name = "sha1"
|
|
1319
|
+
version = "0.10.6"
|
|
1320
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1321
|
+
checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
|
|
1322
|
+
dependencies = [
|
|
1323
|
+
"cfg-if",
|
|
1324
|
+
"cpufeatures",
|
|
1325
|
+
"digest",
|
|
1326
|
+
]
|
|
1327
|
+
|
|
1191
1328
|
[[package]]
|
|
1192
1329
|
name = "sha2"
|
|
1193
1330
|
version = "0.10.9"
|
|
@@ -1205,6 +1342,16 @@ version = "1.3.0"
|
|
|
1205
1342
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1206
1343
|
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|
1207
1344
|
|
|
1345
|
+
[[package]]
|
|
1346
|
+
name = "signal-hook-registry"
|
|
1347
|
+
version = "1.4.8"
|
|
1348
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1349
|
+
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
|
1350
|
+
dependencies = [
|
|
1351
|
+
"errno",
|
|
1352
|
+
"libc",
|
|
1353
|
+
]
|
|
1354
|
+
|
|
1208
1355
|
[[package]]
|
|
1209
1356
|
name = "simd-adler32"
|
|
1210
1357
|
version = "0.3.8"
|
|
@@ -1357,6 +1504,7 @@ dependencies = [
|
|
|
1357
1504
|
"libc",
|
|
1358
1505
|
"mio",
|
|
1359
1506
|
"pin-project-lite",
|
|
1507
|
+
"signal-hook-registry",
|
|
1360
1508
|
"socket2",
|
|
1361
1509
|
"tokio-macros",
|
|
1362
1510
|
"windows-sys 0.61.2",
|
|
@@ -1383,6 +1531,22 @@ dependencies = [
|
|
|
1383
1531
|
"tokio",
|
|
1384
1532
|
]
|
|
1385
1533
|
|
|
1534
|
+
[[package]]
|
|
1535
|
+
name = "tokio-tungstenite"
|
|
1536
|
+
version = "0.24.0"
|
|
1537
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1538
|
+
checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9"
|
|
1539
|
+
dependencies = [
|
|
1540
|
+
"futures-util",
|
|
1541
|
+
"log",
|
|
1542
|
+
"rustls",
|
|
1543
|
+
"rustls-pki-types",
|
|
1544
|
+
"tokio",
|
|
1545
|
+
"tokio-rustls",
|
|
1546
|
+
"tungstenite",
|
|
1547
|
+
"webpki-roots 0.26.11",
|
|
1548
|
+
]
|
|
1549
|
+
|
|
1386
1550
|
[[package]]
|
|
1387
1551
|
name = "tower"
|
|
1388
1552
|
version = "0.5.3"
|
|
@@ -1453,6 +1617,26 @@ version = "0.2.5"
|
|
|
1453
1617
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1454
1618
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
|
1455
1619
|
|
|
1620
|
+
[[package]]
|
|
1621
|
+
name = "tungstenite"
|
|
1622
|
+
version = "0.24.0"
|
|
1623
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1624
|
+
checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a"
|
|
1625
|
+
dependencies = [
|
|
1626
|
+
"byteorder",
|
|
1627
|
+
"bytes",
|
|
1628
|
+
"data-encoding",
|
|
1629
|
+
"http",
|
|
1630
|
+
"httparse",
|
|
1631
|
+
"log",
|
|
1632
|
+
"rand 0.8.5",
|
|
1633
|
+
"rustls",
|
|
1634
|
+
"rustls-pki-types",
|
|
1635
|
+
"sha1",
|
|
1636
|
+
"thiserror 1.0.69",
|
|
1637
|
+
"utf-8",
|
|
1638
|
+
]
|
|
1639
|
+
|
|
1456
1640
|
[[package]]
|
|
1457
1641
|
name = "typenum"
|
|
1458
1642
|
version = "1.19.0"
|
|
@@ -1489,6 +1673,18 @@ dependencies = [
|
|
|
1489
1673
|
"serde",
|
|
1490
1674
|
]
|
|
1491
1675
|
|
|
1676
|
+
[[package]]
|
|
1677
|
+
name = "urlencoding"
|
|
1678
|
+
version = "2.1.3"
|
|
1679
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1680
|
+
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
|
|
1681
|
+
|
|
1682
|
+
[[package]]
|
|
1683
|
+
name = "utf-8"
|
|
1684
|
+
version = "0.7.6"
|
|
1685
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1686
|
+
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
|
|
1687
|
+
|
|
1492
1688
|
[[package]]
|
|
1493
1689
|
name = "utf8_iter"
|
|
1494
1690
|
version = "1.0.4"
|
|
@@ -1636,6 +1832,15 @@ dependencies = [
|
|
|
1636
1832
|
"web-sys",
|
|
1637
1833
|
]
|
|
1638
1834
|
|
|
1835
|
+
[[package]]
|
|
1836
|
+
name = "webpki-roots"
|
|
1837
|
+
version = "0.26.11"
|
|
1838
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1839
|
+
checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
|
|
1840
|
+
dependencies = [
|
|
1841
|
+
"webpki-roots 1.0.6",
|
|
1842
|
+
]
|
|
1843
|
+
|
|
1639
1844
|
[[package]]
|
|
1640
1845
|
name = "webpki-roots"
|
|
1641
1846
|
version = "1.0.6"
|
package/rust/Cargo.toml
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "reallink-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.16"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "CLI for Reallink auth and token workflows"
|
|
6
6
|
license = "MIT"
|
|
7
7
|
|
|
8
8
|
[dependencies]
|
|
9
9
|
anyhow = "1.0"
|
|
10
|
+
hostname = "0.4"
|
|
10
11
|
clap = { version = "4.5", features = ["derive"] }
|
|
11
12
|
dirs = "5.0"
|
|
12
13
|
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
|
|
13
14
|
serde = { version = "1.0", features = ["derive"] }
|
|
14
15
|
serde_json = "1.0"
|
|
15
16
|
json5 = "0.4"
|
|
17
|
+
regex = "1.11"
|
|
16
18
|
sha2 = "0.10"
|
|
17
|
-
tokio = { version = "1.42", features = ["macros", "rt-multi-thread", "time", "fs", "io-util"] }
|
|
19
|
+
tokio = { version = "1.42", features = ["macros", "rt-multi-thread", "time", "fs", "io-util", "signal"] }
|
|
20
|
+
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-webpki-roots"] }
|
|
21
|
+
futures-util = "0.3"
|
|
22
|
+
walkdir = "2.5"
|
|
18
23
|
webbrowser = "1.0"
|
|
24
|
+
urlencoding = "2.1"
|
|
19
25
|
zip = { version = "2.2", default-features = false, features = ["deflate"] }
|
package/rust/src/logs.rs
CHANGED
|
@@ -125,8 +125,8 @@ pub fn load_consent(state_root: &Path) -> Result<LogConsentConfig> {
|
|
|
125
125
|
if !path.exists() {
|
|
126
126
|
return Ok(LogConsentConfig::default());
|
|
127
127
|
}
|
|
128
|
-
let raw =
|
|
129
|
-
|
|
128
|
+
let raw = fs::read(&path)
|
|
129
|
+
.with_context(|| format!("Failed to read consent file {}", path.display()))?;
|
|
130
130
|
let parsed: LogConsentConfig = serde_json::from_slice(&raw)
|
|
131
131
|
.with_context(|| format!("Invalid consent file {}", path.display()))?;
|
|
132
132
|
Ok(parsed)
|
|
@@ -259,7 +259,12 @@ pub fn status(state_root: &Path) -> Result<LogStatus> {
|
|
|
259
259
|
let runtime_path = runtime_log_path(state_root);
|
|
260
260
|
let crash_directory = crash_dir(state_root);
|
|
261
261
|
let crash_count = fs::read_dir(&crash_directory)
|
|
262
|
-
.with_context(||
|
|
262
|
+
.with_context(|| {
|
|
263
|
+
format!(
|
|
264
|
+
"Failed to read crash directory {}",
|
|
265
|
+
crash_directory.display()
|
|
266
|
+
)
|
|
267
|
+
})?
|
|
263
268
|
.filter_map(|entry| entry.ok())
|
|
264
269
|
.filter(|entry| entry.path().is_file())
|
|
265
270
|
.count();
|