@consiliency/agent-board-cli 1.7.0 → 1.8.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 +8 -1
- package/dist/cli.js +35 -8
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { type EnrollKeystore, type EnrollmentIntent, type PendingEnrollmentStore, type OAuthFetchLike, type FetchLike } from "@consiliency/agent-board-client";
|
|
2
|
+
import { type EnrollKeystore, type EnrollmentIntent, type PendingEnrollmentStore, type OAuthFetchLike, type FetchLike, type AgentJoinDeployment, type AgentJoinInstructions } from "@consiliency/agent-board-client";
|
|
3
3
|
type JsonObject = Record<string, unknown>;
|
|
4
4
|
export interface CliIo {
|
|
5
5
|
writeStdout(message: string): void;
|
|
@@ -38,6 +38,13 @@ interface ClientLike {
|
|
|
38
38
|
grantBoardRole(input: JsonObject): Promise<unknown>;
|
|
39
39
|
setBoardRoleGate(input: JsonObject): Promise<unknown>;
|
|
40
40
|
createInviteLink(input: JsonObject): Promise<unknown>;
|
|
41
|
+
createInviteLinkWithInstructions(input: JsonObject, deployment: AgentJoinDeployment, board?: {
|
|
42
|
+
boardSlug?: string;
|
|
43
|
+
boardName?: string;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
result: unknown;
|
|
46
|
+
instructions: AgentJoinInstructions;
|
|
47
|
+
}>;
|
|
41
48
|
revokeInviteLink(input: JsonObject): Promise<unknown>;
|
|
42
49
|
listBoardPendingMemberships(input: JsonObject): Promise<unknown>;
|
|
43
50
|
resolveAgentHandle(input: JsonObject): Promise<unknown>;
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, Option } from "commander";
|
|
2
|
-
import { createAgentBoardClient, toOperationFailure, beginEnrollment, completeEnrollment, runEnrollment, resolveEnrollmentDescriptor, resolveEnrollEndpoint, resolveEnrollSessionUrl, resolveEnrollPublishableKey, nodeFetchAdapter, buildEnrollKeystore, } from "@consiliency/agent-board-client";
|
|
2
|
+
import { createAgentBoardClient, toOperationFailure, beginEnrollment, completeEnrollment, runEnrollment, resolveEnrollmentDescriptor, resolveEnrollEndpoint, resolveEnrollSessionUrl, resolveEnrollPublishableKey, resolveJoinDeployment, nodeFetchAdapter, buildEnrollKeystore, } from "@consiliency/agent-board-client";
|
|
3
3
|
import { FilePendingEnrollmentStore, makeBrowserOpener } from "./enroll_runtime.js";
|
|
4
4
|
function isRuntimeStatus(value) {
|
|
5
5
|
return Boolean(value && typeof value === "object" && "runtime" in value);
|
|
@@ -1494,13 +1494,40 @@ function addRoomsCommands(program, client, io) {
|
|
|
1494
1494
|
.addOption(numberOption("--max-uses <n>", "maximum redemptions"))
|
|
1495
1495
|
.option("--expires <iso>")
|
|
1496
1496
|
.option("--created-by-agent-id <agentId>")
|
|
1497
|
-
.
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1497
|
+
.option("--with-instructions", "also print the canonical, paste-able agent-join instructions block (embeds the invite code — treat the output as secret)")
|
|
1498
|
+
.option("--board-slug <slug>", "board slug for the instructions label (the RPC does not return it)")
|
|
1499
|
+
.option("--board-name <name>", "board name for the instructions label (the RPC does not return it)")
|
|
1500
|
+
.action(async (o) => {
|
|
1501
|
+
const rpcInput = {
|
|
1502
|
+
p_board_id: o.boardId,
|
|
1503
|
+
p_preset_role: o.role,
|
|
1504
|
+
p_max_uses: o.maxUses,
|
|
1505
|
+
p_expires_at: o.expires,
|
|
1506
|
+
p_created_by_agent_id: o.createdByAgentId,
|
|
1507
|
+
};
|
|
1508
|
+
if (!o.withInstructions) {
|
|
1509
|
+
return runHandler(io, "agent_board.create_invite_link", () => client.createInviteLink(rpcInput));
|
|
1510
|
+
}
|
|
1511
|
+
// Opt-in instructions path. Resolve deployment facts FIRST so a config gap
|
|
1512
|
+
// fails cleanly WITHOUT minting an orphan link; the plain path above is
|
|
1513
|
+
// untouched, so a missing descriptor never breaks ordinary invite creation.
|
|
1514
|
+
try {
|
|
1515
|
+
const deployment = resolveJoinDeployment();
|
|
1516
|
+
const { result, instructions } = await client.createInviteLinkWithInstructions(rpcInput, deployment, {
|
|
1517
|
+
boardSlug: o.boardSlug,
|
|
1518
|
+
boardName: o.boardName,
|
|
1519
|
+
});
|
|
1520
|
+
io.writeStdout(`${JSON.stringify(result, null, 2)}\n`);
|
|
1521
|
+
// Rendered block printed raw (not JSON-escaped) so it is paste-able. The
|
|
1522
|
+
// invite code lives here; this is the operator's own terminal, the same
|
|
1523
|
+
// place the JSON result already prints it.
|
|
1524
|
+
io.writeStdout(`\n--- agent join instructions (hand this to your agent) ---\n${instructions.renderedText}\n`);
|
|
1525
|
+
}
|
|
1526
|
+
catch (error) {
|
|
1527
|
+
io.writeStdout(`${JSON.stringify(toOperationFailure("agent_board.create_invite_link", error), null, 2)}\n`);
|
|
1528
|
+
process.exitCode = 1;
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1504
1531
|
rooms
|
|
1505
1532
|
.command("link-revoke")
|
|
1506
1533
|
.description("Revoke an invite link by code")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consiliency/agent-board-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.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.14.0",
|
|
35
35
|
"commander": "^14.0.1"
|
|
36
36
|
},
|
|
37
37
|
"license": "Apache-2.0"
|