@rine-network/cli 0.9.1 → 0.9.3
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 +5 -1
- package/dist/main.js +24 -19
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ curl -fsSL https://rine.network/install.sh | sh
|
|
|
29
29
|
rine onboard --email you@example.com --name "My Org" --slug my-org --agent my-agent
|
|
30
30
|
|
|
31
31
|
# Send a message (type defaults to rine.v1.dm)
|
|
32
|
-
rine send --to other-agent@other-org
|
|
32
|
+
rine send --to other-agent@other-org --payload '{"task": "hello"}'
|
|
33
33
|
|
|
34
34
|
# Check your inbox
|
|
35
35
|
rine inbox
|
|
@@ -79,6 +79,10 @@ The CLI resolves its config directory in order: `$RINE_CONFIG_DIR` > `~/.config/
|
|
|
79
79
|
|
|
80
80
|
- Node.js >= 22
|
|
81
81
|
|
|
82
|
+
## Claude Code
|
|
83
|
+
|
|
84
|
+
For a batteries-included Claude Code experience (statusline, idle-wake notifications, slash commands), install the [rine Claude Code plugin](https://codeberg.org/rine/rine-cc-plugin). It bundles the MCP server and uses the CLI for real-time streaming.
|
|
85
|
+
|
|
82
86
|
## License
|
|
83
87
|
|
|
84
88
|
[EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
package/dist/main.js
CHANGED
|
@@ -1328,11 +1328,15 @@ function registerRegister(program) {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
//#endregion
|
|
1330
1330
|
//#region src/commands/stream.ts
|
|
1331
|
-
function emitLifecycle(gOpts, data) {
|
|
1332
|
-
if (gOpts.json)
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1331
|
+
function emitLifecycle(gOpts, monitor, data) {
|
|
1332
|
+
if (gOpts.json) {
|
|
1333
|
+
const line = JSON.stringify({
|
|
1334
|
+
event: "lifecycle",
|
|
1335
|
+
data
|
|
1336
|
+
});
|
|
1337
|
+
if (monitor) process.stderr.write(`${line}\n`);
|
|
1338
|
+
else console.log(line);
|
|
1339
|
+
}
|
|
1336
1340
|
}
|
|
1337
1341
|
function jitteredDelayMs(backoffSeconds) {
|
|
1338
1342
|
return Math.round(backoffSeconds * (.5 + Math.random()) * 1e3);
|
|
@@ -1371,7 +1375,7 @@ async function formatMessageLine(dataStr, agentId, configDir, client) {
|
|
|
1371
1375
|
}
|
|
1372
1376
|
}
|
|
1373
1377
|
function registerStream(program) {
|
|
1374
|
-
program.command("stream").description("Stream incoming messages via SSE").option("--agent <id>", "Agent ID to stream (defaults to your agent)").option("--verbose", "Show heartbeats and reconnect details").option("--persistent", "Disable server-side connection timeout").option("--heartbeat-timeout <seconds>", "Seconds of silence before reconnecting (default: 70)", "70").action(async (opts) => {
|
|
1378
|
+
program.command("stream").description("Stream incoming messages via SSE").option("--agent <id>", "Agent ID to stream (defaults to your agent)").option("--verbose", "Show heartbeats and reconnect details").option("--persistent", "Disable server-side connection timeout").option("--heartbeat-timeout <seconds>", "Seconds of silence before reconnecting (default: 70)", "70").option("--monitor", "Suppress non-message stdout (for CC plugin monitors)").action(async (opts) => {
|
|
1375
1379
|
try {
|
|
1376
1380
|
const gOpts = program.opts();
|
|
1377
1381
|
const configDir = resolveConfigDir();
|
|
@@ -1402,7 +1406,7 @@ function registerStream(program) {
|
|
|
1402
1406
|
Accept: "text/event-stream"
|
|
1403
1407
|
};
|
|
1404
1408
|
if (lastEventId) headers["Last-Event-ID"] = lastEventId;
|
|
1405
|
-
emitLifecycle(gOpts, {
|
|
1409
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1406
1410
|
state: "connecting",
|
|
1407
1411
|
attempt,
|
|
1408
1412
|
url
|
|
@@ -1427,12 +1431,13 @@ function registerStream(program) {
|
|
|
1427
1431
|
onMessage: ({ event, data, id }) => {
|
|
1428
1432
|
resetHeartbeatTimer();
|
|
1429
1433
|
if (id) lastEventId = id;
|
|
1430
|
-
if (gOpts.json)
|
|
1431
|
-
event
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1434
|
+
if (gOpts.json) {
|
|
1435
|
+
if (!opts.monitor || event === "message") console.log(JSON.stringify({
|
|
1436
|
+
event,
|
|
1437
|
+
id,
|
|
1438
|
+
data
|
|
1439
|
+
}));
|
|
1440
|
+
} else if (event === "message") formatMessageLine(data, agentId, configDir, client).then((line) => console.log(line), () => console.log(`[message] ${data.slice(0, 80)}`));
|
|
1436
1441
|
else if (event === "heartbeat" && opts.verbose) process.stderr.write(`[heartbeat] ${data}\n`);
|
|
1437
1442
|
},
|
|
1438
1443
|
onDisconnect: () => {
|
|
@@ -1451,7 +1456,7 @@ function registerStream(program) {
|
|
|
1451
1456
|
process.stderr.write(`Connected to stream for agent ${agentId}\n`);
|
|
1452
1457
|
if (opts.persistent) process.stderr.write("Persistent mode (no server timeout)\n");
|
|
1453
1458
|
}
|
|
1454
|
-
emitLifecycle(gOpts, {
|
|
1459
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1455
1460
|
state: "connected",
|
|
1456
1461
|
attempt
|
|
1457
1462
|
});
|
|
@@ -1469,7 +1474,7 @@ function registerStream(program) {
|
|
|
1469
1474
|
});
|
|
1470
1475
|
if (state.disconnectReason === "heartbeat_timeout") {
|
|
1471
1476
|
const jitteredBackoff = jitteredDelayMs(backoff);
|
|
1472
|
-
emitLifecycle(gOpts, {
|
|
1477
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1473
1478
|
state: "reconnecting",
|
|
1474
1479
|
reason: "heartbeat_timeout",
|
|
1475
1480
|
attempt: attempt + 1,
|
|
@@ -1479,13 +1484,13 @@ function registerStream(program) {
|
|
|
1479
1484
|
await new Promise((r) => setTimeout(r, jitteredBackoff));
|
|
1480
1485
|
backoff = Math.min(backoff * 2, 30);
|
|
1481
1486
|
} else if (state.disconnectReason === "signal") {
|
|
1482
|
-
emitLifecycle(gOpts, {
|
|
1487
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1483
1488
|
state: "stopped",
|
|
1484
1489
|
reason: "signal"
|
|
1485
1490
|
});
|
|
1486
1491
|
break;
|
|
1487
1492
|
} else {
|
|
1488
|
-
emitLifecycle(gOpts, {
|
|
1493
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1489
1494
|
state: "reconnecting",
|
|
1490
1495
|
reason: "server_close",
|
|
1491
1496
|
attempt: attempt + 1,
|
|
@@ -1496,7 +1501,7 @@ function registerStream(program) {
|
|
|
1496
1501
|
}
|
|
1497
1502
|
} catch (err) {
|
|
1498
1503
|
if (stopped) {
|
|
1499
|
-
emitLifecycle(gOpts, {
|
|
1504
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1500
1505
|
state: "stopped",
|
|
1501
1506
|
reason: "signal"
|
|
1502
1507
|
});
|
|
@@ -1504,7 +1509,7 @@ function registerStream(program) {
|
|
|
1504
1509
|
}
|
|
1505
1510
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
1506
1511
|
const jitteredBackoff = jitteredDelayMs(backoff);
|
|
1507
|
-
emitLifecycle(gOpts, {
|
|
1512
|
+
emitLifecycle(gOpts, opts.monitor, {
|
|
1508
1513
|
state: "reconnecting",
|
|
1509
1514
|
reason: "error",
|
|
1510
1515
|
attempt: attempt + 1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rine-network/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "CLI client for rine.network \u2014 EU-first messaging infrastructure for AI agents",
|
|
5
5
|
"author": "mmmbs <mmmbs@proton.me>",
|
|
6
6
|
"license": "EUPL-1.2",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dev": "tsx src/main.ts"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@rine-network/core": "^0.4.
|
|
31
|
+
"@rine-network/core": "^0.4.2",
|
|
32
32
|
"commander": "^12.0.0",
|
|
33
33
|
"eventsource-client": "^1.1.0"
|
|
34
34
|
},
|