@rine-network/cli 0.9.4 → 0.9.5

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 (2) hide show
  1. package/dist/main.js +50 -26
  2. package/package.json +1 -1
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
- const result = await updateCard(client, agentId, (card) => {
193
+ await updateCard(client, agentId, (card) => {
168
194
  card.description = opts.description;
169
195
  });
170
- if (gOpts.json) printJson(result);
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
- const result = await updateCard(client, agentId, (card) => {
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
- if (gOpts.json) printJson(result);
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
- const result = await updateCard(client, agentId, (card) => setRineField(card, "pricing_model", opts.model));
208
- if (gOpts.json) printJson(result);
209
- else printSuccess("Pricing updated");
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("accept-types").description("Set accepted message types").argument("<agent-id>", "Agent ID").requiredOption("--types <types>", "Comma-separated message types").action(withClient(program, async ({ client, gOpts }, agentId, opts) => {
212
- const types = opts.types.split(",").map((t) => t.trim());
213
- const result = await updateCard(client, agentId, (card) => setRineField(card, "message_types_accepted", types));
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@rine-network/cli",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
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",