@highway1/cli 0.1.47 → 0.1.49
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/LICENSE +21 -0
- package/dist/index.js +41 -12
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/commands/send.ts +4 -2
- package/src/daemon/server.ts +3 -2
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highway1/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
4
4
|
"description": "CLI tool for Clawiverse network",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"clawiverse": "./dist/index.js",
|
|
8
8
|
"hw1": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsup",
|
|
12
|
-
"dev": "tsup --watch",
|
|
13
|
-
"clean": "rm -rf dist"
|
|
14
|
-
},
|
|
15
10
|
"dependencies": {
|
|
16
11
|
"@highway1/core": "^0.1.46",
|
|
17
12
|
"chalk": "^5.3.0",
|
|
@@ -28,5 +23,10 @@
|
|
|
28
23
|
},
|
|
29
24
|
"engines": {
|
|
30
25
|
"node": ">=22.0.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"dev": "tsup --watch",
|
|
30
|
+
"clean": "rm -rf dist"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
package/src/commands/send.ts
CHANGED
|
@@ -128,6 +128,7 @@ export function registerSendCommand(program: Command): void {
|
|
|
128
128
|
return;
|
|
129
129
|
} catch (err) {
|
|
130
130
|
spin.fail('Daemon send failed, falling back to ephemeral node');
|
|
131
|
+
info(`Daemon error: ${(err as Error).message}`);
|
|
131
132
|
console.log();
|
|
132
133
|
info('Tip: Restart daemon with "clawiverse daemon restart" if issues persist');
|
|
133
134
|
console.log();
|
|
@@ -153,6 +154,7 @@ export function registerSendCommand(program: Command): void {
|
|
|
153
154
|
keyPair,
|
|
154
155
|
bootstrapPeers,
|
|
155
156
|
enableDHT: true,
|
|
157
|
+
reserveRelaySlot: bootstrapPeers.length > 0,
|
|
156
158
|
});
|
|
157
159
|
|
|
158
160
|
// Register peer:identify listener BEFORE start() so we don't miss the event
|
|
@@ -211,9 +213,9 @@ export function registerSendCommand(program: Command): void {
|
|
|
211
213
|
if (options.peer) {
|
|
212
214
|
// Extract peerId from multiaddr (last component after /p2p/)
|
|
213
215
|
const parts = options.peer.split('/p2p/');
|
|
214
|
-
if (parts.length
|
|
216
|
+
if (parts.length >= 2) {
|
|
215
217
|
peerHint = {
|
|
216
|
-
peerId: parts[1],
|
|
218
|
+
peerId: parts[parts.length - 1],
|
|
217
219
|
multiaddrs: [options.peer],
|
|
218
220
|
};
|
|
219
221
|
info(`Direct peer: ${options.peer}`);
|
package/src/daemon/server.ts
CHANGED
|
@@ -65,6 +65,7 @@ export class ClawDaemon {
|
|
|
65
65
|
keyPair,
|
|
66
66
|
bootstrapPeers: this.bootstrapPeers,
|
|
67
67
|
enableDHT: true,
|
|
68
|
+
reserveRelaySlot: this.bootstrapPeers.length > 0,
|
|
68
69
|
});
|
|
69
70
|
|
|
70
71
|
await this.node.start();
|
|
@@ -189,9 +190,9 @@ export class ClawDaemon {
|
|
|
189
190
|
let peerHint = undefined;
|
|
190
191
|
if (peer) {
|
|
191
192
|
const parts = peer.split('/p2p/');
|
|
192
|
-
if (parts.length
|
|
193
|
+
if (parts.length >= 2) {
|
|
193
194
|
peerHint = {
|
|
194
|
-
peerId: parts[1],
|
|
195
|
+
peerId: parts[parts.length - 1],
|
|
195
196
|
multiaddrs: [peer],
|
|
196
197
|
};
|
|
197
198
|
}
|