@rine-network/cli 0.9.4 → 0.9.6
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 +50 -26
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -156,6 +156,32 @@ function getAgentCmd(program) {
|
|
|
156
156
|
if (!cmd) throw new Error("registerAgent must be called before registerAgentProfile");
|
|
157
157
|
return cmd;
|
|
158
158
|
}
|
|
159
|
+
const CSV_FIELD_CMDS = [
|
|
160
|
+
{
|
|
161
|
+
name: "set-categories",
|
|
162
|
+
desc: "Set agent categories",
|
|
163
|
+
flag: "--categories <cats>",
|
|
164
|
+
flagDesc: "Comma-separated category names",
|
|
165
|
+
field: "categories",
|
|
166
|
+
msg: "Categories updated"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "set-languages",
|
|
170
|
+
desc: "Set agent supported languages",
|
|
171
|
+
flag: "--languages <langs>",
|
|
172
|
+
flagDesc: "Comma-separated language codes",
|
|
173
|
+
field: "languages",
|
|
174
|
+
msg: "Languages updated"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "accept-types",
|
|
178
|
+
desc: "Set accepted message types",
|
|
179
|
+
flag: "--types <types>",
|
|
180
|
+
flagDesc: "Comma-separated message types",
|
|
181
|
+
field: "message_types_accepted",
|
|
182
|
+
msg: "Accept types updated"
|
|
183
|
+
}
|
|
184
|
+
];
|
|
159
185
|
function registerAgentProfile(program) {
|
|
160
186
|
const agent = getAgentCmd(program);
|
|
161
187
|
agent.command("profile").description("Get agent card").argument("<agent-id>", "Agent ID").action(withClient(program, async ({ client, gOpts }, agentId) => {
|
|
@@ -164,14 +190,13 @@ function registerAgentProfile(program) {
|
|
|
164
190
|
else printTable([toRow(card)]);
|
|
165
191
|
}));
|
|
166
192
|
agent.command("describe").description("Update agent description").argument("<agent-id>", "Agent ID").requiredOption("--description <desc>", "Agent description").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
167
|
-
|
|
193
|
+
await updateCard(client, agentId, (card) => {
|
|
168
194
|
card.description = opts.description;
|
|
169
195
|
});
|
|
170
|
-
|
|
171
|
-
else printSuccess("Description updated");
|
|
196
|
+
printMutationOk("Description updated", gOpts.json);
|
|
172
197
|
}));
|
|
173
198
|
agent.command("add-skill").description("Add a skill to the agent card").argument("<agent-id>", "Agent ID").requiredOption("--skill-id <id>", "Skill ID").requiredOption("--skill-name <name>", "Skill name").option("--skill-description <desc>", "Skill description").option("--tags <tags>", "Comma-separated tags").option("--examples <examples>", "Comma-separated examples").option("--input-modes <modes>", "Comma-separated input modes").option("--output-modes <modes>", "Comma-separated output modes").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
174
|
-
|
|
199
|
+
await updateCard(client, agentId, (card) => {
|
|
175
200
|
const skill = {
|
|
176
201
|
id: opts.skillId,
|
|
177
202
|
name: opts.skillName,
|
|
@@ -183,20 +208,7 @@ function registerAgentProfile(program) {
|
|
|
183
208
|
if (opts.outputModes) skill.outputModes = opts.outputModes.split(",").map((m) => m.trim());
|
|
184
209
|
card.skills = [...Array.isArray(card.skills) ? card.skills : [], skill];
|
|
185
210
|
});
|
|
186
|
-
|
|
187
|
-
else printSuccess("Skill added");
|
|
188
|
-
}));
|
|
189
|
-
agent.command("set-categories").description("Set agent categories").argument("<agent-id>", "Agent ID").requiredOption("--categories <cats>", "Comma-separated category names").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
190
|
-
const cats = opts.categories.split(",").map((c) => c.trim());
|
|
191
|
-
const result = await updateCard(client, agentId, (card) => setRineField(card, "categories", cats));
|
|
192
|
-
if (gOpts.json) printJson(result);
|
|
193
|
-
else printSuccess("Categories updated");
|
|
194
|
-
}));
|
|
195
|
-
agent.command("set-languages").description("Set agent supported languages").argument("<agent-id>", "Agent ID").requiredOption("--languages <langs>", "Comma-separated language codes").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
196
|
-
const langs = opts.languages.split(",").map((l) => l.trim());
|
|
197
|
-
const result = await updateCard(client, agentId, (card) => setRineField(card, "languages", langs));
|
|
198
|
-
if (gOpts.json) printJson(result);
|
|
199
|
-
else printSuccess("Languages updated");
|
|
211
|
+
printMutationOk("Skill added", gOpts.json);
|
|
200
212
|
}));
|
|
201
213
|
agent.command("set-pricing").description("Set agent pricing model").argument("<agent-id>", "Agent ID").requiredOption("--model <model>", `Pricing model (${VALID_PRICING.join("|")})`).action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
202
214
|
if (!VALID_PRICING.includes(opts.model)) {
|
|
@@ -204,15 +216,27 @@ function registerAgentProfile(program) {
|
|
|
204
216
|
process.exitCode = 2;
|
|
205
217
|
return;
|
|
206
218
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
await updateCard(client, agentId, (card) => setRineField(card, "pricing_model", opts.model));
|
|
220
|
+
printMutationOk("Pricing updated", gOpts.json);
|
|
221
|
+
}));
|
|
222
|
+
for (const def of CSV_FIELD_CMDS) agent.command(def.name).description(def.desc).argument("<agent-id>", "Agent ID").requiredOption(def.flag, def.flagDesc).action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
|
|
223
|
+
const raw = Object.values(opts)[0];
|
|
224
|
+
await updateCard(client, agentId, (card) => setRineField(card, def.field, raw.split(",").map((s) => s.trim())));
|
|
225
|
+
printMutationOk(def.msg, gOpts.json);
|
|
226
|
+
}));
|
|
227
|
+
agent.command("enable-a2a").description("Enable A2A protocol bridge for this agent").argument("<agent-id>", "Agent ID").action(withClient(program, async ({ client, gOpts }, agentId) => {
|
|
228
|
+
const result = await updateCard(client, agentId, (card) => setRineField(card, "a2a_enabled", true));
|
|
229
|
+
if (gOpts.json) {
|
|
230
|
+
printJson(result);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const endpoint = (result.rine ?? {}).a2a_endpoint;
|
|
234
|
+
if (endpoint) printSuccess(`A2A enabled. Endpoint: ${endpoint}`);
|
|
235
|
+
else printSuccess("A2A enabled (endpoint not yet set by server)");
|
|
210
236
|
}));
|
|
211
|
-
agent.command("
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (gOpts.json) printJson(result);
|
|
215
|
-
else printSuccess("Accept types updated");
|
|
237
|
+
agent.command("disable-a2a").description("Disable A2A protocol bridge for this agent").argument("<agent-id>", "Agent ID").action(withClient(program, async ({ client, gOpts }, agentId) => {
|
|
238
|
+
await updateCard(client, agentId, (card) => setRineField(card, "a2a_enabled", false));
|
|
239
|
+
printMutationOk("A2A disabled", gOpts.json);
|
|
216
240
|
}));
|
|
217
241
|
}
|
|
218
242
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rine-network/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
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",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
9
|
+
"node": ">=20"
|
|
10
10
|
},
|
|
11
11
|
"bin": {
|
|
12
12
|
"rine": "bin/rine.js"
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"dev": "tsx src/main.ts"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@rine-network/core": "^0.4.
|
|
31
|
+
"@rine-network/core": "^0.4.4",
|
|
32
32
|
"commander": "^12.0.0",
|
|
33
33
|
"eventsource-client": "^1.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@biomejs/biome": "^1.9.0",
|
|
37
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^20.0.0",
|
|
38
38
|
"tsdown": "^0.12.0",
|
|
39
39
|
"tsx": "^4.19.0",
|
|
40
40
|
"typescript": "^5.8.0",
|