@consiliency/agent-board-cli 1.8.0 → 1.10.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 +59 -1
- package/dist/cli.js +891 -15
- package/dist/enroll_runtime.d.ts +67 -1
- package/dist/enroll_runtime.js +259 -1
- package/package.json +2 -2
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { type EnrollKeystore, type EnrollmentIntent, type PendingEnrollmentStore, type OAuthFetchLike, type FetchLike, type AgentJoinDeployment, type AgentJoinInstructions } from "@consiliency/agent-board-client";
|
|
2
|
+
import { type EnrollKeystore, type EnrollmentIntent, type FleetOnboardingIntent, type PendingEnrollmentStore, type OAuthFetchLike, type FetchLike, type AgentJoinDeployment, type AgentJoinInstructions, type DeviceAuthorizationPrompt } from "@consiliency/agent-board-client";
|
|
3
|
+
import { DevicePendingEnrollmentStore } from "./enroll_runtime.js";
|
|
3
4
|
type JsonObject = Record<string, unknown>;
|
|
4
5
|
export interface CliIo {
|
|
5
6
|
writeStdout(message: string): void;
|
|
@@ -38,6 +39,20 @@ interface ClientLike {
|
|
|
38
39
|
grantBoardRole(input: JsonObject): Promise<unknown>;
|
|
39
40
|
setBoardRoleGate(input: JsonObject): Promise<unknown>;
|
|
40
41
|
createInviteLink(input: JsonObject): Promise<unknown>;
|
|
42
|
+
createFleetOnboardingInvite?(input: {
|
|
43
|
+
boardId: string;
|
|
44
|
+
machineId: string;
|
|
45
|
+
harnessKind: string;
|
|
46
|
+
harnessLabel: string;
|
|
47
|
+
repoSlug: string;
|
|
48
|
+
repoFingerprint: string;
|
|
49
|
+
repoScopeRole: "worker" | "reviewer";
|
|
50
|
+
agentRole: "phase_worker" | "reviewer";
|
|
51
|
+
expectedAgentHandle: string;
|
|
52
|
+
maxUses?: number;
|
|
53
|
+
expiresAt?: string;
|
|
54
|
+
createdByAgentId?: string;
|
|
55
|
+
}): Promise<unknown>;
|
|
41
56
|
createInviteLinkWithInstructions(input: JsonObject, deployment: AgentJoinDeployment, board?: {
|
|
42
57
|
boardSlug?: string;
|
|
43
58
|
boardName?: string;
|
|
@@ -46,6 +61,7 @@ interface ClientLike {
|
|
|
46
61
|
instructions: AgentJoinInstructions;
|
|
47
62
|
}>;
|
|
48
63
|
revokeInviteLink(input: JsonObject): Promise<unknown>;
|
|
64
|
+
redeemInviteLink(input: JsonObject): Promise<unknown>;
|
|
49
65
|
listBoardPendingMemberships(input: JsonObject): Promise<unknown>;
|
|
50
66
|
resolveAgentHandle(input: JsonObject): Promise<unknown>;
|
|
51
67
|
updateInboxItemState(input: JsonObject): Promise<unknown>;
|
|
@@ -136,10 +152,45 @@ export interface EnrollmentCommandRunner {
|
|
|
136
152
|
redirectResponse?: string;
|
|
137
153
|
slug?: string;
|
|
138
154
|
}): Promise<unknown>;
|
|
155
|
+
device?(input: {
|
|
156
|
+
slug: string;
|
|
157
|
+
intent: EnrollmentIntent;
|
|
158
|
+
agentKind?: string;
|
|
159
|
+
requestedScopes?: string[];
|
|
160
|
+
requestedBoardScopes?: string[];
|
|
161
|
+
onDeviceAuthorization: (prompt: DeviceAuthorizationPrompt) => void | Promise<void>;
|
|
162
|
+
}): Promise<unknown>;
|
|
163
|
+
deviceBegin?(input: {
|
|
164
|
+
/** Optional caller-generated ID used to bind a companion non-secret continuation first. */
|
|
165
|
+
enrollmentId?: string;
|
|
166
|
+
slug: string;
|
|
167
|
+
intent: EnrollmentIntent;
|
|
168
|
+
agentKind?: string;
|
|
169
|
+
requestedScopes?: string[];
|
|
170
|
+
requestedBoardScopes?: string[];
|
|
171
|
+
}): Promise<{
|
|
172
|
+
enrollmentId: string;
|
|
173
|
+
prompt: DeviceAuthorizationPrompt;
|
|
174
|
+
}>;
|
|
175
|
+
deviceComplete?(input: {
|
|
176
|
+
enrollmentId: string;
|
|
177
|
+
expectedFleet?: {
|
|
178
|
+
intent: Omit<FleetOnboardingIntent, "inviteCode">;
|
|
179
|
+
keyReference: string;
|
|
180
|
+
slug: string;
|
|
181
|
+
};
|
|
182
|
+
/** Keep the secret continuation for a caller that must finish local materialization first. */
|
|
183
|
+
deletePending?: boolean;
|
|
184
|
+
}): Promise<unknown>;
|
|
185
|
+
deviceDeletePending?(input: {
|
|
186
|
+
enrollmentId: string;
|
|
187
|
+
}): Promise<void>;
|
|
139
188
|
}
|
|
140
189
|
export interface DefaultEnrollmentRunnerDeps {
|
|
141
190
|
/** Pending store bridging begin→complete. Default: FilePendingEnrollmentStore(env). */
|
|
142
191
|
store?: PendingEnrollmentStore;
|
|
192
|
+
/** Device-code state bridging deviceBegin→deviceComplete across CLI processes. */
|
|
193
|
+
deviceStore?: DevicePendingEnrollmentStore;
|
|
143
194
|
/** OAuth/enroll fetch. Default: nodeFetchAdapter over globalThis.fetch. */
|
|
144
195
|
fetch?: OAuthFetchLike;
|
|
145
196
|
/** Board-native fetch for the post-enroll SessionClient. Default: nodeFetchAdapter. */
|
|
@@ -156,6 +207,13 @@ export interface DefaultEnrollmentRunnerDeps {
|
|
|
156
207
|
publishableKey?: string;
|
|
157
208
|
/** Clock (tests). Default: wall clock. */
|
|
158
209
|
now?: () => number;
|
|
210
|
+
/**
|
|
211
|
+
* Poll delay for the device-authorization grant (tests inject a no-op so the e2e
|
|
212
|
+
* does not incur a real RFC 8628 backoff sleep). Default: the real timer inside
|
|
213
|
+
* `acquireAccessTokenViaDeviceCode`. Only the `device` flow polls; run/begin/complete
|
|
214
|
+
* ignore it.
|
|
215
|
+
*/
|
|
216
|
+
sleep?: (ms: number) => Promise<void>;
|
|
159
217
|
/** Writer for the default browser opener's printed URL. Default: process std streams. */
|
|
160
218
|
io?: {
|
|
161
219
|
writeStdout(message: string): void;
|