@rine-network/cli 0.16.1 → 0.17.0
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/dist/main.js +17 -6
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -236,7 +236,7 @@ function registerAgentProfile(program) {
|
|
|
236
236
|
});
|
|
237
237
|
printMutationOk("Skill added", gOpts.json);
|
|
238
238
|
}));
|
|
239
|
-
agent.command("set-pricing").description("Set agent pricing model and/or x402 payment terms (rine.x402.terms)").argument("<agent-id>", "Agent ID").option("--model <model>", `Pricing model (${VALID_PRICING.join("|")})`).option("--x402-terms <json>", "x402 card terms as a JSON array
|
|
239
|
+
agent.command("set-pricing").description("Set agent pricing model and/or x402 payment terms (rine.x402.terms)").argument("<agent-id>", "Agent ID").option("--model <model>", `Pricing model (${VALID_PRICING.join("|")})`).option("--x402-terms <json>", "x402 card terms as a JSON array; advisory only").option("--x402-terms-file <path>", "Read the x402 terms JSON array from a file (use - for stdin)").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
240
240
|
if (opts.model === void 0 && opts.x402Terms === void 0 && opts.x402TermsFile === void 0) {
|
|
241
241
|
printError("Nothing to set. Provide --model and/or --x402-terms/--x402-terms-file.");
|
|
242
242
|
process.exitCode = 2;
|
|
@@ -2363,9 +2363,9 @@ var UnsupportedTierError = class extends Error {
|
|
|
2363
2363
|
}
|
|
2364
2364
|
};
|
|
2365
2365
|
/**
|
|
2366
|
-
*
|
|
2366
|
+
* Assert the zero-trust hostname resolves to an A record before
|
|
2367
2367
|
* declaring the listener ready. The per-agent `*.{agentLabel}.hook` A is a
|
|
2368
|
-
* DELIVERY prerequisite written best-effort by the backend
|
|
2368
|
+
* DELIVERY prerequisite written best-effort by the backend; a
|
|
2369
2369
|
* healthy cert does NOT imply a routable name (DNS-01 validates the independent
|
|
2370
2370
|
* challenge TXT). Non-fatal — emit a loud `dns_a_missing` event and continue (the
|
|
2371
2371
|
* cert is valid and the backend self-heals the A on the next ZT-hook create), so
|
|
@@ -2437,6 +2437,17 @@ function emitLifecycle(gOpts, monitor, data) {
|
|
|
2437
2437
|
function jitteredDelayMs(backoffSeconds) {
|
|
2438
2438
|
return Math.round(backoffSeconds * (.5 + Math.random()) * 1e3);
|
|
2439
2439
|
}
|
|
2440
|
+
/**
|
|
2441
|
+
* Encryption versions the stream preview can decrypt. A payload carrying one of
|
|
2442
|
+
* these that still fails is reported as "[decrypt failed]" rather than the
|
|
2443
|
+
* misleading "[encrypted]", which is reserved for versions we never attempt.
|
|
2444
|
+
*/
|
|
2445
|
+
const DECRYPTABLE_VERSIONS = new Set([
|
|
2446
|
+
"hpke-v1",
|
|
2447
|
+
"hpke-hybrid-v1",
|
|
2448
|
+
"sender-key-v1",
|
|
2449
|
+
"mls-v1"
|
|
2450
|
+
]);
|
|
2440
2451
|
async function formatMessageLine(dataStr, agentId, configDir, client) {
|
|
2441
2452
|
try {
|
|
2442
2453
|
const data = JSON.parse(dataStr);
|
|
@@ -2447,7 +2458,7 @@ async function formatMessageLine(dataStr, agentId, configDir, client) {
|
|
|
2447
2458
|
let preview = "[encrypted]";
|
|
2448
2459
|
if (data.encrypted_payload && agentKeysExist(configDir, agentId)) {
|
|
2449
2460
|
let result;
|
|
2450
|
-
if (data.encryption_version === "sender-key-v1" && data.group_id) try {
|
|
2461
|
+
if ((data.encryption_version === "sender-key-v1" || data.encryption_version === "mls-v1") && data.group_id) try {
|
|
2451
2462
|
result = await decryptGroupMessage(configDir, agentId, data.group_id, data.encrypted_payload, client);
|
|
2452
2463
|
} catch (err) {
|
|
2453
2464
|
const match = err instanceof Error && err.message.match(/^unknown sender key id: (.+)$/);
|
|
@@ -2457,13 +2468,13 @@ async function formatMessageLine(dataStr, agentId, configDir, client) {
|
|
|
2457
2468
|
} catch {}
|
|
2458
2469
|
}
|
|
2459
2470
|
}
|
|
2460
|
-
else if (data.encryption_version === "hpke-v1") try {
|
|
2471
|
+
else if (data.encryption_version === "hpke-v1" || data.encryption_version === "hpke-hybrid-v1") try {
|
|
2461
2472
|
result = await decryptMessage(configDir, agentId, data.encrypted_payload, client);
|
|
2462
2473
|
} catch {}
|
|
2463
2474
|
if (result) {
|
|
2464
2475
|
ingestSenderKeyDistribution(configDir, agentId, data.type ?? "", result);
|
|
2465
2476
|
preview = `[${result.verified ? "✓" : "?"}] ${result.plaintext.slice(0, 60)}`;
|
|
2466
|
-
} else if (
|
|
2477
|
+
} else if (DECRYPTABLE_VERSIONS.has(data.encryption_version ?? "")) preview = "[decrypt failed]";
|
|
2467
2478
|
}
|
|
2468
2479
|
return `[${ts}] ${sender} \u2192 ${target}: ${preview}`;
|
|
2469
2480
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rine-network/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
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.
|
|
31
|
+
"@rine-network/core": "^0.12.0",
|
|
32
32
|
"commander": "^12.0.0",
|
|
33
33
|
"eventsource-client": "^1.1.0"
|
|
34
34
|
},
|