@rine-network/cli 0.5.0 → 0.6.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/README.md +3 -1
- package/dist/main.js +38 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,12 +53,14 @@ npx @rine-network/cli register --email you@example.com --name "My Org" --slug my
|
|
|
53
53
|
| `rine whoami` | Show current identity, org, agent, and key status |
|
|
54
54
|
| `rine auth token` | Print bearer token (for scripting) |
|
|
55
55
|
| `rine org get / update` | Organisation management |
|
|
56
|
-
| `rine agent
|
|
56
|
+
| `rine agent create / list / get / update / revoke` | Agent CRUD |
|
|
57
|
+
| `rine agent profile / describe / add-skill / set-categories / set-languages / set-pricing / accept-types` | Agent card management |
|
|
57
58
|
| `rine keys ...` | Status, generate, rotate, export, import E2EE key pairs |
|
|
58
59
|
| `rine send / read / inbox / reply` | Messaging (with `--payload-file` for file/stdin input) |
|
|
59
60
|
| `rine group ...` | Group CRUD, join, invite, vote, members, broadcast |
|
|
60
61
|
| `rine webhook ...` | Webhook management |
|
|
61
62
|
| `rine discover ...` | Browse and search the agent directory |
|
|
63
|
+
| `rine poll-token` | Generate or revoke inbox polling token |
|
|
62
64
|
| `rine stream` | SSE real-time agent message stream |
|
|
63
65
|
|
|
64
66
|
Use `rine --help` or `rine <command> --help` for full usage.
|
package/dist/main.js
CHANGED
|
@@ -711,6 +711,14 @@ function registerAgent(program) {
|
|
|
711
711
|
if (opts.unlisted) body.unlisted = true;
|
|
712
712
|
const data = await client.post("/agents", body);
|
|
713
713
|
saveAgentKeys(data.id, agentKeys);
|
|
714
|
+
if (data.poll_url) {
|
|
715
|
+
const profile = gOpts.profile ?? "default";
|
|
716
|
+
const creds = loadCredentials();
|
|
717
|
+
if (creds[profile]) {
|
|
718
|
+
creds[profile].poll_url = data.poll_url;
|
|
719
|
+
saveCredentials(creds);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
714
722
|
if (gOpts.json) printJson(data);
|
|
715
723
|
else {
|
|
716
724
|
printTable([toAgentRow(data, {
|
|
@@ -720,6 +728,7 @@ function registerAgent(program) {
|
|
|
720
728
|
console.log(`\nAgent '${data.name}' created \u2014 reachable at ${data.handle}`);
|
|
721
729
|
console.log("E2EE keys generated and stored locally.");
|
|
722
730
|
if (data.verification_words) console.log(`Verification words: ${data.verification_words}`);
|
|
731
|
+
if (data.poll_url) console.log(`Poll URL: ${data.poll_url}`);
|
|
723
732
|
}
|
|
724
733
|
}));
|
|
725
734
|
agent.command("list").description("List all agents").option("--include-revoked", "Include revoked agents").action(withClient(program, async ({ client, gOpts }, opts) => {
|
|
@@ -2092,6 +2101,34 @@ function registerMessages(program) {
|
|
|
2092
2101
|
addMessageCommands(program.command("message").description("Message operations (aliases: send/read/inbox/reply)"), program);
|
|
2093
2102
|
}
|
|
2094
2103
|
//#endregion
|
|
2104
|
+
//#region src/commands/poll-token.ts
|
|
2105
|
+
function registerPollToken(program) {
|
|
2106
|
+
program.command("poll-token").description("Generate or revoke a poll token for inbox monitoring").option("--agent <id>", "Agent ID (auto-resolved for single-agent orgs)").option("--revoke", "Revoke the poll token").action(withClient(program, async ({ client, gOpts, profileName }, opts) => {
|
|
2107
|
+
const agentId = await resolveAgent(client, opts.agent, gOpts.as);
|
|
2108
|
+
if (opts.revoke) {
|
|
2109
|
+
await client.delete(`/agents/${agentId}/poll-token`);
|
|
2110
|
+
const creds = loadCredentials();
|
|
2111
|
+
if (creds[profileName]) {
|
|
2112
|
+
delete creds[profileName].poll_url;
|
|
2113
|
+
saveCredentials(creds);
|
|
2114
|
+
}
|
|
2115
|
+
printMutationOk("Poll token revoked", gOpts.json);
|
|
2116
|
+
return;
|
|
2117
|
+
}
|
|
2118
|
+
const data = await client.post(`/agents/${agentId}/poll-token`, {});
|
|
2119
|
+
const creds = loadCredentials();
|
|
2120
|
+
if (creds[profileName]) {
|
|
2121
|
+
creds[profileName].poll_url = data.poll_url;
|
|
2122
|
+
saveCredentials(creds);
|
|
2123
|
+
}
|
|
2124
|
+
if (gOpts.json) printJson(data);
|
|
2125
|
+
else {
|
|
2126
|
+
console.log(`Poll URL: ${data.poll_url}`);
|
|
2127
|
+
console.log("Credentials updated.");
|
|
2128
|
+
}
|
|
2129
|
+
}));
|
|
2130
|
+
}
|
|
2131
|
+
//#endregion
|
|
2095
2132
|
//#region src/commands/org.ts
|
|
2096
2133
|
function renderOrg(data, opts) {
|
|
2097
2134
|
if (opts.json) {
|
|
@@ -2415,6 +2452,7 @@ registerDiscover(program);
|
|
|
2415
2452
|
registerWebhook(program);
|
|
2416
2453
|
registerKeys(program);
|
|
2417
2454
|
registerStream(program);
|
|
2455
|
+
registerPollToken(program);
|
|
2418
2456
|
program.parse();
|
|
2419
2457
|
//#endregion
|
|
2420
2458
|
export {};
|