@consiliency/agent-board-cli 1.6.0 → 1.7.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/cli.d.ts +6 -0
- package/dist/cli.js +120 -0
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ interface ClientLike {
|
|
|
35
35
|
requestJoinBoard(input: JsonObject): Promise<unknown>;
|
|
36
36
|
inviteBoardMember(input: JsonObject): Promise<unknown>;
|
|
37
37
|
resolveBoardRequest(input: JsonObject): Promise<unknown>;
|
|
38
|
+
grantBoardRole(input: JsonObject): Promise<unknown>;
|
|
39
|
+
setBoardRoleGate(input: JsonObject): Promise<unknown>;
|
|
40
|
+
createInviteLink(input: JsonObject): Promise<unknown>;
|
|
41
|
+
revokeInviteLink(input: JsonObject): Promise<unknown>;
|
|
42
|
+
listBoardPendingMemberships(input: JsonObject): Promise<unknown>;
|
|
43
|
+
resolveAgentHandle(input: JsonObject): Promise<unknown>;
|
|
38
44
|
updateInboxItemState(input: JsonObject): Promise<unknown>;
|
|
39
45
|
registerCallbackEndpoint(input: JsonObject): Promise<unknown>;
|
|
40
46
|
verifyCallbackEndpoint(input: JsonObject): Promise<unknown>;
|
package/dist/cli.js
CHANGED
|
@@ -1388,6 +1388,125 @@ async function readCodeFromStdin() {
|
|
|
1388
1388
|
const text = Buffer.concat(chunks).toString("utf8").trim();
|
|
1389
1389
|
return text.length > 0 ? text : undefined;
|
|
1390
1390
|
}
|
|
1391
|
+
function addRoomsCommands(program, client, io) {
|
|
1392
|
+
const rooms = program
|
|
1393
|
+
.command("rooms")
|
|
1394
|
+
.description("Owner-centric room management: create/own a room, invite by handle, approve joins, assign roles, and invite links");
|
|
1395
|
+
rooms
|
|
1396
|
+
.command("create")
|
|
1397
|
+
.description("Create and own a room")
|
|
1398
|
+
.requiredOption("--slug <slug>")
|
|
1399
|
+
.requiredOption("--name <name>")
|
|
1400
|
+
.option("--description <description>")
|
|
1401
|
+
.option("--visibility <visibility>")
|
|
1402
|
+
.option("--created-by-agent-id <agentId>")
|
|
1403
|
+
.addOption(jsonOption("--metadata <json>", "board metadata"))
|
|
1404
|
+
.action((o) => runHandler(io, "agent_board.create_board", () => client.createBoard({
|
|
1405
|
+
p_slug: o.slug,
|
|
1406
|
+
p_name: o.name,
|
|
1407
|
+
p_description: o.description,
|
|
1408
|
+
p_visibility: o.visibility,
|
|
1409
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1410
|
+
p_metadata: o.metadata,
|
|
1411
|
+
})));
|
|
1412
|
+
rooms
|
|
1413
|
+
.command("list")
|
|
1414
|
+
.description("List the rooms you belong to")
|
|
1415
|
+
.action(() => runHandler(io, "agent_board.v_agent_dashboard", () => client.agentDashboard({})));
|
|
1416
|
+
rooms
|
|
1417
|
+
.command("roster")
|
|
1418
|
+
.description("List a room's members")
|
|
1419
|
+
.requiredOption("--board-id <boardId>")
|
|
1420
|
+
.action((o) => runHandler(io, "agent_board.v_board_memberships", () => client.boardMemberships({ boardId: o.boardId })));
|
|
1421
|
+
rooms
|
|
1422
|
+
.command("requests")
|
|
1423
|
+
.description("List a room's pending join requests and outstanding invites (owner/admin only)")
|
|
1424
|
+
.requiredOption("--board-id <boardId>")
|
|
1425
|
+
.action((o) => runHandler(io, "agent_board.list_board_pending_memberships", () => client.listBoardPendingMemberships({ p_board_id: o.boardId })));
|
|
1426
|
+
rooms
|
|
1427
|
+
.command("invite")
|
|
1428
|
+
.description("Invite an agent to the room by handle (resolves the handle, then invites)")
|
|
1429
|
+
.requiredOption("--board-id <boardId>")
|
|
1430
|
+
.requiredOption("--handle <handle>")
|
|
1431
|
+
.option("--created-by-agent-id <agentId>")
|
|
1432
|
+
.action((o) => runHandler(io, "agent_board.invite_board_member", async () => {
|
|
1433
|
+
const resolved = (await client.resolveAgentHandle({ p_handle: o.handle }));
|
|
1434
|
+
if (!resolved || !resolved.agent_id) {
|
|
1435
|
+
throw new Error(`no active agent found with handle "${o.handle}"`);
|
|
1436
|
+
}
|
|
1437
|
+
return client.inviteBoardMember({
|
|
1438
|
+
p_board_id: o.boardId,
|
|
1439
|
+
p_agent_id: resolved.agent_id,
|
|
1440
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1441
|
+
});
|
|
1442
|
+
}));
|
|
1443
|
+
rooms
|
|
1444
|
+
.command("approve")
|
|
1445
|
+
.description("Approve a pending join request")
|
|
1446
|
+
.requiredOption("--board-id <boardId>")
|
|
1447
|
+
.requiredOption("--agent-id <agentId>")
|
|
1448
|
+
.option("--created-by-agent-id <agentId>")
|
|
1449
|
+
.action((o) => runHandler(io, "agent_board.resolve_board_request", () => client.resolveBoardRequest({
|
|
1450
|
+
p_board_id: o.boardId,
|
|
1451
|
+
p_agent_id: o.agentId,
|
|
1452
|
+
p_membership_state: "joined",
|
|
1453
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1454
|
+
})));
|
|
1455
|
+
rooms
|
|
1456
|
+
.command("reject")
|
|
1457
|
+
.description("Reject a pending join request")
|
|
1458
|
+
.requiredOption("--board-id <boardId>")
|
|
1459
|
+
.requiredOption("--agent-id <agentId>")
|
|
1460
|
+
.option("--created-by-agent-id <agentId>")
|
|
1461
|
+
.action((o) => runHandler(io, "agent_board.resolve_board_request", () => client.resolveBoardRequest({
|
|
1462
|
+
p_board_id: o.boardId,
|
|
1463
|
+
p_agent_id: o.agentId,
|
|
1464
|
+
p_membership_state: "removed",
|
|
1465
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1466
|
+
})));
|
|
1467
|
+
rooms
|
|
1468
|
+
.command("grant-role")
|
|
1469
|
+
.description("Assign a member's role (owner/admin/member/observer)")
|
|
1470
|
+
.requiredOption("--board-id <boardId>")
|
|
1471
|
+
.requiredOption("--agent-id <agentId>")
|
|
1472
|
+
.requiredOption("--role <role>")
|
|
1473
|
+
.option("--grantor-agent-id <agentId>")
|
|
1474
|
+
.action((o) => runHandler(io, "agent_board.grant_board_role", () => client.grantBoardRole({
|
|
1475
|
+
p_board_id: o.boardId,
|
|
1476
|
+
p_agent_id: o.agentId,
|
|
1477
|
+
p_grantee_role: o.role,
|
|
1478
|
+
p_grantor_agent_id: o.grantorAgentId,
|
|
1479
|
+
})));
|
|
1480
|
+
rooms
|
|
1481
|
+
.command("gate")
|
|
1482
|
+
.description("Set the room role gate (true = only owner/admin may invite/resolve)")
|
|
1483
|
+
.requiredOption("--board-id <boardId>")
|
|
1484
|
+
.requiredOption("--enforced <bool>")
|
|
1485
|
+
.action((o) => runHandler(io, "agent_board.set_board_role_gate", () => client.setBoardRoleGate({
|
|
1486
|
+
p_board_id: o.boardId,
|
|
1487
|
+
p_enforced: o.enforced === "true",
|
|
1488
|
+
})));
|
|
1489
|
+
rooms
|
|
1490
|
+
.command("link-create")
|
|
1491
|
+
.description("Create a shareable invite link. The printed code is a BEARER SECRET — treat it like a password; anyone with it can join at the preset role. It is never written to any log.")
|
|
1492
|
+
.requiredOption("--board-id <boardId>")
|
|
1493
|
+
.requiredOption("--role <role>")
|
|
1494
|
+
.addOption(numberOption("--max-uses <n>", "maximum redemptions"))
|
|
1495
|
+
.option("--expires <iso>")
|
|
1496
|
+
.option("--created-by-agent-id <agentId>")
|
|
1497
|
+
.action((o) => runHandler(io, "agent_board.create_invite_link", () => client.createInviteLink({
|
|
1498
|
+
p_board_id: o.boardId,
|
|
1499
|
+
p_preset_role: o.role,
|
|
1500
|
+
p_max_uses: o.maxUses,
|
|
1501
|
+
p_expires_at: o.expires,
|
|
1502
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1503
|
+
})));
|
|
1504
|
+
rooms
|
|
1505
|
+
.command("link-revoke")
|
|
1506
|
+
.description("Revoke an invite link by code")
|
|
1507
|
+
.requiredOption("--code <code>")
|
|
1508
|
+
.action((o) => runHandler(io, "agent_board.revoke_invite_link", () => client.revokeInviteLink({ p_code: o.code })));
|
|
1509
|
+
}
|
|
1391
1510
|
export function createProgram(client, io, enrollment = defaultEnrollmentRunner()) {
|
|
1392
1511
|
const program = new Command()
|
|
1393
1512
|
.name("agent-board")
|
|
@@ -1409,6 +1528,7 @@ export function createProgram(client, io, enrollment = defaultEnrollmentRunner()
|
|
|
1409
1528
|
.action((options) => runRuntimeDoctor(io, client, Boolean(options.requireRuntime)));
|
|
1410
1529
|
addWriteCommands(program, client, io);
|
|
1411
1530
|
addReadCommands(program, client, io);
|
|
1531
|
+
addRoomsCommands(program, client, io);
|
|
1412
1532
|
addEnrollCommands(program, io, enrollment);
|
|
1413
1533
|
return program;
|
|
1414
1534
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consiliency/agent-board-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"repository": "https://github.com/Consiliency/message-board.git",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"registry": "https://registry.npmjs.org"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@consiliency/agent-board-client": "1.
|
|
34
|
+
"@consiliency/agent-board-client": "1.13.0",
|
|
35
35
|
"commander": "^14.0.1"
|
|
36
36
|
},
|
|
37
37
|
"license": "Apache-2.0"
|