@rine-network/cli 0.9.2 → 0.9.4

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/dist/main.js +34 -21
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -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
@@ -1006,7 +1006,7 @@ function inboxRow(m) {
1006
1006
  From: msgFrom(m),
1007
1007
  Group: msgGroup(m),
1008
1008
  Type: m.type,
1009
- Encryption: m.encryption_version,
1009
+ Status: (m.status ?? "new").toUpperCase(),
1010
1010
  Created: m.created_at
1011
1011
  };
1012
1012
  }
@@ -1126,9 +1126,17 @@ function addMessageCommands(parent, program) {
1126
1126
  Created: data.created_at
1127
1127
  }]);
1128
1128
  }));
1129
- parent.command("inbox").description("List inbox messages").option("--agent <id>", "Agent ID (defaults to your agent)").option("--limit <n>", "Maximum number of messages to return").option("--cursor <cursor>", "Pagination cursor").action(withClient(program, async ({ client, gOpts, apiUrl }, opts) => {
1129
+ parent.command("inbox").description("List inbox messages").option("--agent <id>", "Agent ID (defaults to your agent)").option("--new", "Show only new (undelivered) messages").option("--delivered", "Show only delivered messages").option("--read", "Show only read messages").option("--limit <n>", "Maximum number of messages to return").option("--cursor <cursor>", "Pagination cursor").action(withClient(program, async ({ client, gOpts, apiUrl }, opts) => {
1130
+ if ([
1131
+ opts.new,
1132
+ opts.delivered,
1133
+ opts.read
1134
+ ].filter(Boolean).length > 1) throw new Error("Only one of --new, --delivered, --read can be specified");
1130
1135
  const agentId = await resolveAgent(apiUrl, await fetchAgents(client), opts.agent, gOpts.as);
1131
1136
  const params = {};
1137
+ if (opts.new) params.status = "new";
1138
+ else if (opts.delivered) params.status = "delivered";
1139
+ else if (opts.read) params.status = "read";
1132
1140
  if (opts.limit) params.limit = opts.limit;
1133
1141
  if (opts.cursor) params.cursor = opts.cursor;
1134
1142
  const data = await client.get(`/agents/${agentId}/messages`, params);
@@ -1328,11 +1336,15 @@ function registerRegister(program) {
1328
1336
  }
1329
1337
  //#endregion
1330
1338
  //#region src/commands/stream.ts
1331
- function emitLifecycle(gOpts, data) {
1332
- if (gOpts.json) console.log(JSON.stringify({
1333
- event: "lifecycle",
1334
- data
1335
- }));
1339
+ function emitLifecycle(gOpts, monitor, data) {
1340
+ if (gOpts.json) {
1341
+ const line = JSON.stringify({
1342
+ event: "lifecycle",
1343
+ data
1344
+ });
1345
+ if (monitor) process.stderr.write(`${line}\n`);
1346
+ else console.log(line);
1347
+ }
1336
1348
  }
1337
1349
  function jitteredDelayMs(backoffSeconds) {
1338
1350
  return Math.round(backoffSeconds * (.5 + Math.random()) * 1e3);
@@ -1371,7 +1383,7 @@ async function formatMessageLine(dataStr, agentId, configDir, client) {
1371
1383
  }
1372
1384
  }
1373
1385
  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) => {
1386
+ 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
1387
  try {
1376
1388
  const gOpts = program.opts();
1377
1389
  const configDir = resolveConfigDir();
@@ -1402,7 +1414,7 @@ function registerStream(program) {
1402
1414
  Accept: "text/event-stream"
1403
1415
  };
1404
1416
  if (lastEventId) headers["Last-Event-ID"] = lastEventId;
1405
- emitLifecycle(gOpts, {
1417
+ emitLifecycle(gOpts, opts.monitor, {
1406
1418
  state: "connecting",
1407
1419
  attempt,
1408
1420
  url
@@ -1427,12 +1439,13 @@ function registerStream(program) {
1427
1439
  onMessage: ({ event, data, id }) => {
1428
1440
  resetHeartbeatTimer();
1429
1441
  if (id) lastEventId = id;
1430
- if (gOpts.json) console.log(JSON.stringify({
1431
- event,
1432
- id,
1433
- data
1434
- }));
1435
- else if (event === "message") formatMessageLine(data, agentId, configDir, client).then((line) => console.log(line), () => console.log(`[message] ${data.slice(0, 80)}`));
1442
+ if (gOpts.json) {
1443
+ if (!opts.monitor || event === "message") console.log(JSON.stringify({
1444
+ event,
1445
+ id,
1446
+ data
1447
+ }));
1448
+ } else if (event === "message") formatMessageLine(data, agentId, configDir, client).then((line) => console.log(line), () => console.log(`[message] ${data.slice(0, 80)}`));
1436
1449
  else if (event === "heartbeat" && opts.verbose) process.stderr.write(`[heartbeat] ${data}\n`);
1437
1450
  },
1438
1451
  onDisconnect: () => {
@@ -1451,7 +1464,7 @@ function registerStream(program) {
1451
1464
  process.stderr.write(`Connected to stream for agent ${agentId}\n`);
1452
1465
  if (opts.persistent) process.stderr.write("Persistent mode (no server timeout)\n");
1453
1466
  }
1454
- emitLifecycle(gOpts, {
1467
+ emitLifecycle(gOpts, opts.monitor, {
1455
1468
  state: "connected",
1456
1469
  attempt
1457
1470
  });
@@ -1469,7 +1482,7 @@ function registerStream(program) {
1469
1482
  });
1470
1483
  if (state.disconnectReason === "heartbeat_timeout") {
1471
1484
  const jitteredBackoff = jitteredDelayMs(backoff);
1472
- emitLifecycle(gOpts, {
1485
+ emitLifecycle(gOpts, opts.monitor, {
1473
1486
  state: "reconnecting",
1474
1487
  reason: "heartbeat_timeout",
1475
1488
  attempt: attempt + 1,
@@ -1479,13 +1492,13 @@ function registerStream(program) {
1479
1492
  await new Promise((r) => setTimeout(r, jitteredBackoff));
1480
1493
  backoff = Math.min(backoff * 2, 30);
1481
1494
  } else if (state.disconnectReason === "signal") {
1482
- emitLifecycle(gOpts, {
1495
+ emitLifecycle(gOpts, opts.monitor, {
1483
1496
  state: "stopped",
1484
1497
  reason: "signal"
1485
1498
  });
1486
1499
  break;
1487
1500
  } else {
1488
- emitLifecycle(gOpts, {
1501
+ emitLifecycle(gOpts, opts.monitor, {
1489
1502
  state: "reconnecting",
1490
1503
  reason: "server_close",
1491
1504
  attempt: attempt + 1,
@@ -1496,7 +1509,7 @@ function registerStream(program) {
1496
1509
  }
1497
1510
  } catch (err) {
1498
1511
  if (stopped) {
1499
- emitLifecycle(gOpts, {
1512
+ emitLifecycle(gOpts, opts.monitor, {
1500
1513
  state: "stopped",
1501
1514
  reason: "signal"
1502
1515
  });
@@ -1504,7 +1517,7 @@ function registerStream(program) {
1504
1517
  }
1505
1518
  const errorMsg = err instanceof Error ? err.message : String(err);
1506
1519
  const jitteredBackoff = jitteredDelayMs(backoff);
1507
- emitLifecycle(gOpts, {
1520
+ emitLifecycle(gOpts, opts.monitor, {
1508
1521
  state: "reconnecting",
1509
1522
  reason: "error",
1510
1523
  attempt: attempt + 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rine-network/cli",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
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.2",
31
+ "@rine-network/core": "^0.4.3",
32
32
  "commander": "^12.0.0",
33
33
  "eventsource-client": "^1.1.0"
34
34
  },