@fiber-pay/cli 0.1.0-rc.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/README.md +21 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +4647 -0
- package/dist/cli.js.map +1 -0
- package/error-codes.json +140 -0
- package/package.json +40 -0
package/error-codes.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2026-02-16",
|
|
3
|
+
"errorObject": {
|
|
4
|
+
"required": ["code", "message"],
|
|
5
|
+
"optional": ["recoverable", "suggestion", "details"]
|
|
6
|
+
},
|
|
7
|
+
"streaming": {
|
|
8
|
+
"format": "ndjson",
|
|
9
|
+
"eventEnvelope": {
|
|
10
|
+
"required": ["event", "ts", "data"]
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"codes": [
|
|
14
|
+
{
|
|
15
|
+
"code": "CLI_FATAL",
|
|
16
|
+
"meaning": "Unexpected top-level CLI failure",
|
|
17
|
+
"agentAction": "Inspect error message and command arguments; retry only after configuration correction"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "CONFIG_NOT_FOUND",
|
|
21
|
+
"meaning": "Configuration file does not exist",
|
|
22
|
+
"agentAction": "Run `fiber-pay config init --network testnet --json`"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"code": "NODE_ALREADY_RUNNING",
|
|
26
|
+
"meaning": "Node process is already running",
|
|
27
|
+
"agentAction": "Skip start or stop existing process before retry"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"code": "NODE_NOT_RUNNING",
|
|
31
|
+
"meaning": "Node process is not running or PID is stale",
|
|
32
|
+
"agentAction": "Start node via `fiber-pay node start`"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"code": "NODE_KEY_INIT_FAILED",
|
|
36
|
+
"meaning": "Key manager initialization failed",
|
|
37
|
+
"agentAction": "Verify key password and data directory permissions"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"code": "NODE_RPC_NOT_READY",
|
|
41
|
+
"meaning": "Node process started but RPC did not become ready in time",
|
|
42
|
+
"agentAction": "Retry with delay and inspect node stderr/stdout logs"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"code": "NODE_EVENT_STREAM_INVALID",
|
|
46
|
+
"meaning": "Invalid event stream format was provided",
|
|
47
|
+
"agentAction": "Use `--event-stream jsonl` in JSON mode"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"code": "NODE_STARTUP_EXITED",
|
|
51
|
+
"meaning": "Underlying fnn process exited during startup",
|
|
52
|
+
"agentAction": "Inspect start logs and config ports; avoid immediate retry loops"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"code": "NODE_RUNTIME_START_FAILED",
|
|
56
|
+
"meaning": "Node started but embedded runtime watcher/proxy failed to initialize",
|
|
57
|
+
"agentAction": "Retry with a free runtime proxy listen port"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"code": "NODE_STOPPED_UNEXPECTEDLY",
|
|
61
|
+
"meaning": "Running node exited unexpectedly",
|
|
62
|
+
"agentAction": "Capture logs and restart after root-cause check"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"code": "CHANNEL_NOT_FOUND",
|
|
66
|
+
"meaning": "Requested channel id is unknown",
|
|
67
|
+
"agentAction": "Query `channel list --include-closed --json` and retry with valid channel id"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"code": "CHANNEL_WATCH_TIMEOUT",
|
|
71
|
+
"meaning": "Channel watch timed out before terminal condition",
|
|
72
|
+
"agentAction": "Continue polling or increase timeout"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"code": "PAYMENT_SEND_INPUT_INVALID",
|
|
76
|
+
"meaning": "Payment send arguments are incomplete or invalid",
|
|
77
|
+
"agentAction": "Provide invoice, or provide `--to` with `--amount`"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"code": "PAYMENT_WATCH_TIMEOUT",
|
|
81
|
+
"meaning": "Payment did not reach terminal state in timeout window",
|
|
82
|
+
"agentAction": "Use `payment get --json` for follow-up status checks and optionally extend watch timeout"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"code": "PAYMENT_WATCH_INPUT_INVALID",
|
|
86
|
+
"meaning": "Unsupported watch parameter value",
|
|
87
|
+
"agentAction": "Fix `--until` or `--on-timeout` values"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"code": "PAYMENT_WATCH_UNEXPECTED_TERMINAL",
|
|
91
|
+
"meaning": "Payment reached a terminal state different from requested --until target",
|
|
92
|
+
"agentAction": "Adjust `--until` target or handle terminal status in caller"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"code": "CHANNEL_WATCH_INPUT_INVALID",
|
|
96
|
+
"meaning": "Unsupported channel watch parameter value",
|
|
97
|
+
"agentAction": "Fix `--on-timeout` value to fail or success"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"code": "INVOICE_CREATE_INPUT_INVALID",
|
|
101
|
+
"meaning": "Invoice creation amount is missing or invalid",
|
|
102
|
+
"agentAction": "Provide valid numeric amount with `--amount`"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"code": "RUNTIME_ALREADY_RUNNING",
|
|
106
|
+
"meaning": "Runtime process is already running",
|
|
107
|
+
"agentAction": "Query `runtime status` or stop the existing runtime before restarting"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"code": "RUNTIME_NOT_RUNNING",
|
|
111
|
+
"meaning": "Runtime PID is missing or stale",
|
|
112
|
+
"agentAction": "Start runtime with `runtime start --daemon` or clean stale files"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"code": "RUNTIME_START_FAILED",
|
|
116
|
+
"meaning": "Runtime failed to start due to config, RPC, or port issues",
|
|
117
|
+
"agentAction": "Verify RPC reachability and runtime options, then retry"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"code": "LOG_SOURCE_INVALID",
|
|
121
|
+
"meaning": "Unsupported logs source option was provided",
|
|
122
|
+
"agentAction": "Retry with --source all|runtime|fnn-stdout|fnn-stderr"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"code": "LOG_FILE_NOT_FOUND",
|
|
126
|
+
"meaning": "Requested log source does not have a persisted log file yet",
|
|
127
|
+
"agentAction": "Start node/runtime or generate activity, then retry log query"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"code": "LOG_READ_FAILED",
|
|
131
|
+
"meaning": "CLI failed to read persisted log content",
|
|
132
|
+
"agentAction": "Check file permissions/path in data dir and retry"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"code": "LOG_FOLLOW_JSON_UNSUPPORTED",
|
|
136
|
+
"meaning": "Streaming follow mode cannot be combined with single-envelope JSON output",
|
|
137
|
+
"agentAction": "Use --follow without --json, or remove --follow for JSON output"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fiber-pay/cli",
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"description": "Command-line tool for managing Fiber Network nodes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"fiber-pay": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"error-codes.json"
|
|
13
|
+
],
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ckb",
|
|
16
|
+
"lightning",
|
|
17
|
+
"fiber",
|
|
18
|
+
"cli",
|
|
19
|
+
"nervos"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"commander": "^13.1.0",
|
|
30
|
+
"yaml": "^2.8.2",
|
|
31
|
+
"@fiber-pay/runtime": "0.1.0-rc.1",
|
|
32
|
+
"@fiber-pay/sdk": "0.1.0-rc.1",
|
|
33
|
+
"@fiber-pay/node": "0.1.0-rc.1"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"dev": "tsup --watch",
|
|
38
|
+
"typecheck": "tsc --noEmit"
|
|
39
|
+
}
|
|
40
|
+
}
|