@duvoai/cli 1.12.0 → 1.14.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/bin/duvo.js +297 -35
- package/dist/bin/duvo.js.map +4 -4
- package/package.json +1 -1
package/dist/bin/duvo.js
CHANGED
|
@@ -3080,6 +3080,7 @@ var clarityProcessLandscapeNodeSchema = z14.object({
|
|
|
3080
3080
|
createdAt: z14.string(),
|
|
3081
3081
|
updatedAt: z14.string(),
|
|
3082
3082
|
process: clarityProcessLandscapeSummarySchema.nullable(),
|
|
3083
|
+
proposedSummary: z14.string().nullable(),
|
|
3083
3084
|
teamId: z14.guid().nullable().optional(),
|
|
3084
3085
|
teamName: z14.string().nullable().optional(),
|
|
3085
3086
|
assignedTeam: clarityLandscapeAssignedTeamSchema.nullable().optional(),
|
|
@@ -3123,6 +3124,34 @@ var clarityProcessLandscapeResponseSchema = z14.object({
|
|
|
3123
3124
|
generation: clarityProcessLandscapeGenerationSchema,
|
|
3124
3125
|
truncated: z14.boolean()
|
|
3125
3126
|
});
|
|
3127
|
+
var clarityProcessPersonSchema = z14.object({
|
|
3128
|
+
id: z14.guid(),
|
|
3129
|
+
userId: z14.guid().nullable(),
|
|
3130
|
+
name: z14.string().nullable(),
|
|
3131
|
+
email: z14.email().nullable(),
|
|
3132
|
+
role: z14.string().nullable(),
|
|
3133
|
+
status: z14.enum(["pending"]).nullable(),
|
|
3134
|
+
invitationId: z14.guid().nullable(),
|
|
3135
|
+
captureCount: z14.number().int().nonnegative(),
|
|
3136
|
+
createdAt: z14.string()
|
|
3137
|
+
});
|
|
3138
|
+
var clarityProcessPeopleResponseSchema = z14.object({
|
|
3139
|
+
people: z14.array(clarityProcessPersonSchema)
|
|
3140
|
+
});
|
|
3141
|
+
var createClarityProcessPersonRequestSchema = z14.object({
|
|
3142
|
+
name: z14.string().max(200).nullable().optional(),
|
|
3143
|
+
email: z14.email().nullable().optional(),
|
|
3144
|
+
role: z14.string().max(200).nullable().optional()
|
|
3145
|
+
}).refine(
|
|
3146
|
+
(body) => Boolean(body.name?.trim()) || Boolean(body.email?.trim()),
|
|
3147
|
+
"Name or email is required"
|
|
3148
|
+
);
|
|
3149
|
+
var updateClarityProcessPersonRequestSchema = z14.object({
|
|
3150
|
+
role: z14.string().max(200).nullable().optional()
|
|
3151
|
+
}).refine((body) => Object.hasOwn(body, "role"), "Role must be provided");
|
|
3152
|
+
var deleteClarityProcessPersonResponseSchema = z14.object({
|
|
3153
|
+
success: z14.literal(true)
|
|
3154
|
+
});
|
|
3126
3155
|
var GENERATION_STEP_STATUSES = [
|
|
3127
3156
|
"pending",
|
|
3128
3157
|
"in_progress",
|
|
@@ -4069,10 +4098,13 @@ var CLARITY_INTERVIEW_STATUSES = [
|
|
|
4069
4098
|
var clarityInterviewStatusSchema = z18.enum(CLARITY_INTERVIEW_STATUSES);
|
|
4070
4099
|
var CLARITY_INTERVIEW_SCOPES = ["team", "organization"];
|
|
4071
4100
|
var clarityInterviewScopeSchema = z18.enum(CLARITY_INTERVIEW_SCOPES);
|
|
4101
|
+
var CLARITY_INTERVIEW_TYPES = ["interview", "document"];
|
|
4102
|
+
var clarityInterviewTypeSchema = z18.enum(CLARITY_INTERVIEW_TYPES);
|
|
4072
4103
|
var teamInterviewSummarySchema = z18.object({
|
|
4073
4104
|
id: z18.guid(),
|
|
4074
4105
|
userId: z18.guid(),
|
|
4075
4106
|
title: z18.string(),
|
|
4107
|
+
type: clarityInterviewTypeSchema,
|
|
4076
4108
|
status: clarityInterviewStatusSchema,
|
|
4077
4109
|
createdAt: z18.string(),
|
|
4078
4110
|
updatedAt: z18.string()
|
|
@@ -4087,6 +4119,7 @@ var organizationInterviewSummarySchema = teamInterviewSummarySchema.extend({
|
|
|
4087
4119
|
var clarityInterviewSchema = z18.object({
|
|
4088
4120
|
id: z18.guid(),
|
|
4089
4121
|
scope: clarityInterviewScopeSchema,
|
|
4122
|
+
type: clarityInterviewTypeSchema,
|
|
4090
4123
|
teamId: z18.guid().nullable(),
|
|
4091
4124
|
organizationId: z18.guid().nullable(),
|
|
4092
4125
|
processId: z18.guid().nullable(),
|
|
@@ -4149,6 +4182,30 @@ var interviewUploadUrlsResponseSchema = z18.object({
|
|
|
4149
4182
|
frameUploadUrls: z18.array(interviewFrameUploadSchema),
|
|
4150
4183
|
expiresAt: z18.string()
|
|
4151
4184
|
});
|
|
4185
|
+
var CLARITY_DOCUMENT_CONTENT_TYPES = [
|
|
4186
|
+
"application/pdf",
|
|
4187
|
+
"text/plain",
|
|
4188
|
+
"text/markdown",
|
|
4189
|
+
"application/xml"
|
|
4190
|
+
];
|
|
4191
|
+
var clarityDocumentContentTypeSchema = z18.enum(
|
|
4192
|
+
CLARITY_DOCUMENT_CONTENT_TYPES
|
|
4193
|
+
);
|
|
4194
|
+
var organizationDocumentUploadUrlBodySchema = z18.object({
|
|
4195
|
+
fileName: z18.string().min(1).describe("Name of the document file"),
|
|
4196
|
+
contentType: clarityDocumentContentTypeSchema.describe(
|
|
4197
|
+
"MIME type of the document"
|
|
4198
|
+
)
|
|
4199
|
+
});
|
|
4200
|
+
var organizationDocumentUploadUrlResponseSchema = z18.object({
|
|
4201
|
+
signedUrl: z18.url().describe("The signed URL for uploading"),
|
|
4202
|
+
captureId: z18.guid().describe("The organization interview/capture ID"),
|
|
4203
|
+
expiresAt: z18.iso.datetime().describe("When the URL expires"),
|
|
4204
|
+
gcsPath: z18.string().describe("The GCS path where the file will be stored")
|
|
4205
|
+
});
|
|
4206
|
+
var completeOrganizationDocumentBodySchema = z18.object({
|
|
4207
|
+
fileName: z18.string().min(1).describe("Name of the uploaded document file")
|
|
4208
|
+
});
|
|
4152
4209
|
var completeInterviewCaptureBodySchema = interviewUploadUrlsBodySchema.extend({
|
|
4153
4210
|
transcript: z18.array(conversationMessageSchema).min(1).max(MAX_INTERVIEW_TRANSCRIPT_ENTRIES)
|
|
4154
4211
|
});
|
|
@@ -6169,6 +6226,13 @@ var adminCaseItemDetailResponseSchema = z32.object({
|
|
|
6169
6226
|
assignedAgentName: z32.string().nullable(),
|
|
6170
6227
|
lastAgentRunId: z32.string().nullable(),
|
|
6171
6228
|
postponedTo: z32.string().nullable(),
|
|
6229
|
+
/**
|
|
6230
|
+
* Deprecated debug field from the pre-decoupling model. Carries the
|
|
6231
|
+
* stored pre_claim_status while the column still exists and is always
|
|
6232
|
+
* null once it is dropped; kept so removing the column is not a
|
|
6233
|
+
* breaking change on this internal endpoint. Remove with a future
|
|
6234
|
+
* admin-API cleanup.
|
|
6235
|
+
*/
|
|
6172
6236
|
preClaimStatus: z32.string().nullable(),
|
|
6173
6237
|
createdAt: z32.string(),
|
|
6174
6238
|
updatedAt: z32.string()
|
|
@@ -7657,7 +7721,20 @@ var caseQueueItemSchema = z53.object({
|
|
|
7657
7721
|
queue_id: z53.guid(),
|
|
7658
7722
|
title: z53.string(),
|
|
7659
7723
|
data: z53.string(),
|
|
7660
|
-
status: z53.enum(["pending", "
|
|
7724
|
+
status: z53.enum(["pending", "completed", "failed"]),
|
|
7725
|
+
/**
|
|
7726
|
+
* Derived display bucket combining the settlement status with ownership,
|
|
7727
|
+
* open HITL tokens, and scheduling. See CASE_DISPLAY_STATUS in
|
|
7728
|
+
* `constants/case-queue.ts` for the derivation rules.
|
|
7729
|
+
*/
|
|
7730
|
+
display_status: z53.enum([
|
|
7731
|
+
"pending",
|
|
7732
|
+
"in_progress",
|
|
7733
|
+
"needs_input",
|
|
7734
|
+
"postponed",
|
|
7735
|
+
"completed",
|
|
7736
|
+
"failed"
|
|
7737
|
+
]),
|
|
7661
7738
|
claimed_at: z53.string().nullable(),
|
|
7662
7739
|
claimed_by_run_id: z53.string().nullable(),
|
|
7663
7740
|
completed_at: z53.string().nullable(),
|
|
@@ -7758,11 +7835,13 @@ var caseCreateResponseSchema = z53.object({
|
|
|
7758
7835
|
});
|
|
7759
7836
|
var casesStatsSchema = z53.object({
|
|
7760
7837
|
total: z53.number(),
|
|
7838
|
+
/** Pending, unowned, not postponed — idle and claimable */
|
|
7761
7839
|
pending: z53.number(),
|
|
7840
|
+
/** "In Progress": pending cases owned by a run with no open HITL token */
|
|
7762
7841
|
claimed: z53.number(),
|
|
7763
|
-
/**
|
|
7842
|
+
/** "Needs Input": pending cases whose owning run has an open HITL token */
|
|
7764
7843
|
waiting: z53.number(),
|
|
7765
|
-
/**
|
|
7844
|
+
/** Pending, unowned cases postponed for later */
|
|
7766
7845
|
postponed: z53.number(),
|
|
7767
7846
|
completed: z53.number(),
|
|
7768
7847
|
failed: z53.number()
|
|
@@ -8938,7 +9017,11 @@ var removeMemberResponseSchema = z69.object({
|
|
|
8938
9017
|
planType: z69.enum(["pro", "enterprise"]).nullable()
|
|
8939
9018
|
});
|
|
8940
9019
|
var getMemberMeResponseSchema = z69.object({
|
|
8941
|
-
role: z69.string().nullable()
|
|
9020
|
+
role: z69.string().nullable(),
|
|
9021
|
+
// True only when a real `user_team_memberships` row exists. `role` can be a
|
|
9022
|
+
// read-only *virtual* role for org leaders who haven't joined, so it is not a
|
|
9023
|
+
// membership signal on its own — use this flag to tell a real member apart.
|
|
9024
|
+
isMember: z69.boolean()
|
|
8942
9025
|
});
|
|
8943
9026
|
var addTeamMemberRequestSchema = z69.object({
|
|
8944
9027
|
userId: z69.guid(),
|
|
@@ -14950,7 +15033,7 @@ function registerCasesGet(cases) {
|
|
|
14950
15033
|
{ label: "ID", value: caseItem.id },
|
|
14951
15034
|
{ label: "Queue", value: caseItem.queue_id },
|
|
14952
15035
|
{ label: "Title", value: caseItem.title },
|
|
14953
|
-
{ label: "Status", value: caseItem.
|
|
15036
|
+
{ label: "Status", value: caseItem.display_status },
|
|
14954
15037
|
{ label: "Data", value: caseItem.data ?? "" },
|
|
14955
15038
|
{ label: "Claimed", value: caseItem.claimed_at ?? "" },
|
|
14956
15039
|
{ label: "Claimed by run", value: caseItem.claimed_by_run_id ?? "" },
|
|
@@ -15164,7 +15247,7 @@ var SORT_ORDERS = ["asc", "desc"];
|
|
|
15164
15247
|
var TABLE_COLUMNS18 = [
|
|
15165
15248
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
|
|
15166
15249
|
{ header: "TITLE", cell: /* @__PURE__ */ __name((row) => row.title, "cell"), maxWidth: 50 },
|
|
15167
|
-
{ header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.
|
|
15250
|
+
{ header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.display_status, "cell") },
|
|
15168
15251
|
{ header: "CREATED", cell: /* @__PURE__ */ __name((row) => row.created_at ?? "", "cell") }
|
|
15169
15252
|
];
|
|
15170
15253
|
function registerCasesList(cases) {
|
|
@@ -17365,6 +17448,19 @@ var CLARITY_READ_TOOLS = [
|
|
|
17365
17448
|
}
|
|
17366
17449
|
],
|
|
17367
17450
|
description: "Find one landscape node locally after reading the Clarity process landscape."
|
|
17451
|
+
},
|
|
17452
|
+
{
|
|
17453
|
+
name: "listClarityLandscapeCaptures",
|
|
17454
|
+
scope: "v1+v2",
|
|
17455
|
+
read_only: true,
|
|
17456
|
+
commands: ["duvo clarity landscape captures"],
|
|
17457
|
+
endpoints: [
|
|
17458
|
+
{
|
|
17459
|
+
method: "GET",
|
|
17460
|
+
path: "/v2/organizations/:orgId/clarity/hierarchy/captures"
|
|
17461
|
+
}
|
|
17462
|
+
],
|
|
17463
|
+
description: "List the organization's eligible Process Landscape captures (completed interview and document transcripts) to seed new process proposals."
|
|
17368
17464
|
}
|
|
17369
17465
|
];
|
|
17370
17466
|
var CLARITY_WRITE_TOOLS = [
|
|
@@ -17679,6 +17775,19 @@ var CLARITY_WRITE_TOOLS = [
|
|
|
17679
17775
|
}
|
|
17680
17776
|
],
|
|
17681
17777
|
description: "Start a process-landscape generation run from the organization's eligible Clarity captures."
|
|
17778
|
+
},
|
|
17779
|
+
{
|
|
17780
|
+
name: "proposeClarityLandscapeProcess",
|
|
17781
|
+
scope: "v1+v2",
|
|
17782
|
+
read_only: false,
|
|
17783
|
+
commands: ["duvo clarity landscape propose-process"],
|
|
17784
|
+
endpoints: [
|
|
17785
|
+
{
|
|
17786
|
+
method: "POST",
|
|
17787
|
+
path: "/v2/organizations/:orgId/clarity/hierarchy/proposed-processes"
|
|
17788
|
+
}
|
|
17789
|
+
],
|
|
17790
|
+
description: "Propose a new process in the Clarity process landscape as a proposed, unassigned placeholder for a human to confirm."
|
|
17682
17791
|
}
|
|
17683
17792
|
];
|
|
17684
17793
|
var CLARITY_TOOLS = [
|
|
@@ -18639,6 +18748,8 @@ var ORG_FLAG_DESCRIPTION = "organization id for the org-scoped process landscape
|
|
|
18639
18748
|
var LANDSCAPE_RESOURCE_PATH = "/clarity/hierarchy/landscape";
|
|
18640
18749
|
var TREE_RESOURCE_PATH = "/clarity/hierarchy/tree";
|
|
18641
18750
|
var NODES_RESOURCE_PATH = "/clarity/hierarchy/nodes";
|
|
18751
|
+
var CAPTURES_RESOURCE_PATH = "/clarity/hierarchy/captures";
|
|
18752
|
+
var PROPOSED_PROCESSES_RESOURCE_PATH = "/clarity/hierarchy/proposed-processes";
|
|
18642
18753
|
var PROCESS_NODE_TYPE = "process";
|
|
18643
18754
|
var AREA_NODE_TYPE = "area";
|
|
18644
18755
|
var axisSchema = z92.enum(["content", "existence"]);
|
|
@@ -18707,6 +18818,24 @@ var generateLandscapeResponseSchema = z92.object({
|
|
|
18707
18818
|
generationId: z92.string(),
|
|
18708
18819
|
eligibleCaptureCount: z92.number()
|
|
18709
18820
|
}).passthrough();
|
|
18821
|
+
var captureSchema = z92.object({
|
|
18822
|
+
id: z92.string(),
|
|
18823
|
+
scope: z92.string(),
|
|
18824
|
+
type: z92.string(),
|
|
18825
|
+
title: z92.string(),
|
|
18826
|
+
organizationId: z92.string().nullable(),
|
|
18827
|
+
organizationName: z92.string().nullable(),
|
|
18828
|
+
teamId: z92.string().nullable(),
|
|
18829
|
+
teamName: z92.string().nullable(),
|
|
18830
|
+
processNodeId: z92.string().nullable(),
|
|
18831
|
+
createdAt: z92.string(),
|
|
18832
|
+
transcriptMessageCount: z92.number()
|
|
18833
|
+
}).passthrough();
|
|
18834
|
+
var captureListResponseSchema = z92.object({
|
|
18835
|
+
captures: z92.array(captureSchema),
|
|
18836
|
+
total: z92.number(),
|
|
18837
|
+
truncated: z92.boolean()
|
|
18838
|
+
}).passthrough();
|
|
18710
18839
|
var LANDSCAPE_COLUMNS = [
|
|
18711
18840
|
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell"), maxWidth: 36 },
|
|
18712
18841
|
{
|
|
@@ -18733,6 +18862,16 @@ var TREE_COLUMNS = [
|
|
|
18733
18862
|
{ header: "TYPE", cell: getTreeNodeType },
|
|
18734
18863
|
{ header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell"), maxWidth: 36 }
|
|
18735
18864
|
];
|
|
18865
|
+
var CAPTURE_COLUMNS = [
|
|
18866
|
+
{ header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell"), maxWidth: 36 },
|
|
18867
|
+
{ header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
|
|
18868
|
+
{ header: "TITLE", cell: /* @__PURE__ */ __name((row) => row.title, "cell"), maxWidth: 36 },
|
|
18869
|
+
{
|
|
18870
|
+
header: "MESSAGES",
|
|
18871
|
+
cell: /* @__PURE__ */ __name((row) => String(row.transcriptMessageCount), "cell")
|
|
18872
|
+
},
|
|
18873
|
+
{ header: "TEAM", cell: /* @__PURE__ */ __name((row) => row.teamName ?? "-", "cell"), maxWidth: 28 }
|
|
18874
|
+
];
|
|
18736
18875
|
function registerClarityLandscape(clarity) {
|
|
18737
18876
|
const landscape = clarity.command("landscape").description("Inspect and curate the Clarity process landscape").option("--org <org-id>", ORG_FLAG_DESCRIPTION);
|
|
18738
18877
|
landscape.command("get", { isDefault: true }).description("Read the Clarity process landscape").option("--org <org-id>", ORG_FLAG_DESCRIPTION).option("--root <node-id>", "only read the subtree under this node").option("--json", "output JSON").action(/* @__PURE__ */ __name(async function getAction(options) {
|
|
@@ -18863,6 +19002,36 @@ function registerClarityLandscape(clarity) {
|
|
|
18863
19002
|
`Started process landscape generation: ${response.generationId} (${response.eligibleCaptureCount} captures)`
|
|
18864
19003
|
);
|
|
18865
19004
|
}, "generateAction"));
|
|
19005
|
+
landscape.command("captures").description("List Clarity captures eligible for the process landscape").option("--org <org-id>", ORG_FLAG_DESCRIPTION).option("--limit <n>", "page size").option("--include-transcripts", "include full transcripts in JSON output").option("--json", "output JSON").action(/* @__PURE__ */ __name(async function capturesAction(options) {
|
|
19006
|
+
const config = await requireAuthenticatedConfig(this);
|
|
19007
|
+
const path = resolveOrgPath(this, CAPTURES_RESOURCE_PATH);
|
|
19008
|
+
const raw = await httpRequest({
|
|
19009
|
+
method: "GET",
|
|
19010
|
+
path,
|
|
19011
|
+
apiKey: config.apiKey,
|
|
19012
|
+
apiBaseUrl: config.apiBaseUrl,
|
|
19013
|
+
searchParams: buildCapturesSearchParams(options)
|
|
19014
|
+
});
|
|
19015
|
+
const response = captureListResponseSchema.parse(raw);
|
|
19016
|
+
if (options.json) {
|
|
19017
|
+
printJson(response);
|
|
19018
|
+
return;
|
|
19019
|
+
}
|
|
19020
|
+
renderCaptures(response, "No landscape captures found.");
|
|
19021
|
+
}, "capturesAction"));
|
|
19022
|
+
landscape.command("propose-process").description("Propose a new process node in the Clarity process landscape").requiredOption("--name <name>", "proposed process name").option("--description <text>", "proposed process description").option("--parent <node-id>", "parent area node id").option("--org <org-id>", ORG_FLAG_DESCRIPTION).option("--json", "output JSON").action(/* @__PURE__ */ __name(async function proposeProcessAction(options) {
|
|
19023
|
+
const config = await requireAuthenticatedConfig(this);
|
|
19024
|
+
const path = resolveOrgPath(this, PROPOSED_PROCESSES_RESOURCE_PATH);
|
|
19025
|
+
const raw = await httpRequest({
|
|
19026
|
+
method: "POST",
|
|
19027
|
+
path,
|
|
19028
|
+
apiKey: config.apiKey,
|
|
19029
|
+
apiBaseUrl: config.apiBaseUrl,
|
|
19030
|
+
body: buildProposeProcessBody(options)
|
|
19031
|
+
});
|
|
19032
|
+
const node = nodeResponseSchema.parse(raw);
|
|
19033
|
+
renderNodeMutationResult("Proposed process", node, options);
|
|
19034
|
+
}, "proposeProcessAction"));
|
|
18866
19035
|
}
|
|
18867
19036
|
__name(registerClarityLandscape, "registerClarityLandscape");
|
|
18868
19037
|
function nodePath(orgId, nodeId) {
|
|
@@ -18907,6 +19076,25 @@ function buildMoveNodeBody(options) {
|
|
|
18907
19076
|
throw new CliError("Pass --parent <node-id> or --root.");
|
|
18908
19077
|
}
|
|
18909
19078
|
__name(buildMoveNodeBody, "buildMoveNodeBody");
|
|
19079
|
+
function buildProposeProcessBody(options) {
|
|
19080
|
+
return {
|
|
19081
|
+
name: options.name,
|
|
19082
|
+
...options.description !== void 0 ? { description: options.description } : {},
|
|
19083
|
+
...options.parent !== void 0 ? { parentId: options.parent } : {}
|
|
19084
|
+
};
|
|
19085
|
+
}
|
|
19086
|
+
__name(buildProposeProcessBody, "buildProposeProcessBody");
|
|
19087
|
+
function buildCapturesSearchParams(options) {
|
|
19088
|
+
const searchParams = new URLSearchParams();
|
|
19089
|
+
if (options.limit !== void 0) {
|
|
19090
|
+
searchParams.set("limit", options.limit);
|
|
19091
|
+
}
|
|
19092
|
+
if (options.includeTranscripts) {
|
|
19093
|
+
searchParams.set("includeTranscripts", "true");
|
|
19094
|
+
}
|
|
19095
|
+
return searchParams;
|
|
19096
|
+
}
|
|
19097
|
+
__name(buildCapturesSearchParams, "buildCapturesSearchParams");
|
|
18910
19098
|
function filterLandscapeNodes(response, query) {
|
|
18911
19099
|
const normalizedQuery = query.trim().toLowerCase();
|
|
18912
19100
|
if (!normalizedQuery) {
|
|
@@ -19036,6 +19224,19 @@ function renderTreeNodes(nodes, emptyMessage) {
|
|
|
19036
19224
|
console.log(renderTable(TREE_COLUMNS, nodes));
|
|
19037
19225
|
}
|
|
19038
19226
|
__name(renderTreeNodes, "renderTreeNodes");
|
|
19227
|
+
function renderCaptures(response, emptyMessage) {
|
|
19228
|
+
if (response.captures.length === 0) {
|
|
19229
|
+
console.log(emptyMessage);
|
|
19230
|
+
return;
|
|
19231
|
+
}
|
|
19232
|
+
console.log(renderTable(CAPTURE_COLUMNS, response.captures));
|
|
19233
|
+
if (response.truncated) {
|
|
19234
|
+
console.log(
|
|
19235
|
+
`Showing ${response.captures.length} of ${response.total} captures. Re-run with --limit <n> to see more.`
|
|
19236
|
+
);
|
|
19237
|
+
}
|
|
19238
|
+
}
|
|
19239
|
+
__name(renderCaptures, "renderCaptures");
|
|
19039
19240
|
function renderNodeMutationResult(label, node, options) {
|
|
19040
19241
|
if (options.json) {
|
|
19041
19242
|
printJson(node);
|
|
@@ -27132,9 +27333,6 @@ __name(registerTeamMembers, "registerTeamMembers");
|
|
|
27132
27333
|
import { z as z104 } from "zod";
|
|
27133
27334
|
var TEAM_ID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
27134
27335
|
var teamIdSchema = z104.string().regex(TEAM_ID_SHAPE);
|
|
27135
|
-
var listMyTeamsResponseSchema3 = z104.object({
|
|
27136
|
-
teams: z104.array(z104.object({ id: z104.string() }))
|
|
27137
|
-
});
|
|
27138
27336
|
function registerTeamUse(team) {
|
|
27139
27337
|
team.command("use <team-id>").description(
|
|
27140
27338
|
"Set the default team for the active OAuth profile (overridable per-command via --team or DUVO_TEAM_ID)"
|
|
@@ -27151,7 +27349,7 @@ function registerTeamUse(team) {
|
|
|
27151
27349
|
`"${teamId}" is not a valid team ID (expected a UUID). Run \`duvo teams list\` to see the teams you can use.`
|
|
27152
27350
|
);
|
|
27153
27351
|
}
|
|
27154
|
-
await
|
|
27352
|
+
await assertTeamAccessible(
|
|
27155
27353
|
parsedTeamId.data,
|
|
27156
27354
|
auth.apiKey,
|
|
27157
27355
|
auth.apiBaseUrl
|
|
@@ -27182,27 +27380,32 @@ function registerTeamUse(team) {
|
|
|
27182
27380
|
}, "useAction"));
|
|
27183
27381
|
}
|
|
27184
27382
|
__name(registerTeamUse, "registerTeamUse");
|
|
27185
|
-
async function
|
|
27186
|
-
|
|
27187
|
-
|
|
27188
|
-
|
|
27189
|
-
|
|
27190
|
-
|
|
27191
|
-
|
|
27192
|
-
|
|
27193
|
-
|
|
27194
|
-
|
|
27195
|
-
|
|
27196
|
-
|
|
27383
|
+
async function assertTeamAccessible(teamId, apiKey, apiBaseUrl) {
|
|
27384
|
+
try {
|
|
27385
|
+
await httpRequest({
|
|
27386
|
+
method: "GET",
|
|
27387
|
+
path: `/v2/teams/${encodeURIComponent(teamId)}`,
|
|
27388
|
+
apiKey,
|
|
27389
|
+
apiBaseUrl
|
|
27390
|
+
});
|
|
27391
|
+
} catch (error) {
|
|
27392
|
+
if (isNoTeamAccessError(error)) {
|
|
27393
|
+
throw new CliError(
|
|
27394
|
+
`You can't access team ${teamId} \u2014 it doesn't exist, or you're neither a member nor an organization Owner/Executive/Admin of its organization. Run \`duvo teams list\` or \`duvo teams org <org-id>\` to find a team you can use.`,
|
|
27395
|
+
EXIT_CODE.NOT_FOUND
|
|
27396
|
+
);
|
|
27397
|
+
}
|
|
27398
|
+
throw error;
|
|
27197
27399
|
}
|
|
27198
|
-
|
|
27199
|
-
|
|
27200
|
-
|
|
27201
|
-
|
|
27202
|
-
|
|
27400
|
+
}
|
|
27401
|
+
__name(assertTeamAccessible, "assertTeamAccessible");
|
|
27402
|
+
function isNoTeamAccessError(error) {
|
|
27403
|
+
if (error instanceof CliHttpError) {
|
|
27404
|
+
return error.status === 403 || error.status === 404;
|
|
27203
27405
|
}
|
|
27406
|
+
return error instanceof CliError && error.exitCode === EXIT_CODE.NOT_FOUND;
|
|
27204
27407
|
}
|
|
27205
|
-
__name(
|
|
27408
|
+
__name(isNoTeamAccessError, "isNoTeamAccessError");
|
|
27206
27409
|
|
|
27207
27410
|
// src/commands/team/index.ts
|
|
27208
27411
|
function registerTeam(program) {
|
|
@@ -27221,11 +27424,10 @@ var teamApiSchema2 = z105.object({
|
|
|
27221
27424
|
name: z105.string(),
|
|
27222
27425
|
organization_id: z105.string().nullable()
|
|
27223
27426
|
});
|
|
27224
|
-
var
|
|
27427
|
+
var listMyTeamsResponseSchema3 = z105.object({
|
|
27225
27428
|
teams: z105.array(teamApiSchema2)
|
|
27226
27429
|
});
|
|
27227
|
-
function registerTeamsList(
|
|
27228
|
-
const teams = program.command("teams").description("Inspect the teams your credentials can act on");
|
|
27430
|
+
function registerTeamsList(teams) {
|
|
27229
27431
|
teams.command("list", { isDefault: true }).description("List every team you can act on").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(options) {
|
|
27230
27432
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
27231
27433
|
const raw = await httpRequest({
|
|
@@ -27238,7 +27440,7 @@ function registerTeamsList(program) {
|
|
|
27238
27440
|
printJson(raw);
|
|
27239
27441
|
return;
|
|
27240
27442
|
}
|
|
27241
|
-
const parsed =
|
|
27443
|
+
const parsed = listMyTeamsResponseSchema3.safeParse(raw);
|
|
27242
27444
|
if (!parsed.success) {
|
|
27243
27445
|
throw new CliError(
|
|
27244
27446
|
`Unexpected response from GET /v2/teams: ${parsed.error.message}`
|
|
@@ -27265,6 +27467,66 @@ function registerTeamsList(program) {
|
|
|
27265
27467
|
}
|
|
27266
27468
|
__name(registerTeamsList, "registerTeamsList");
|
|
27267
27469
|
|
|
27470
|
+
// src/commands/teams/org.ts
|
|
27471
|
+
import { z as z106 } from "zod";
|
|
27472
|
+
var orgTeamSchema = z106.object({
|
|
27473
|
+
id: z106.string(),
|
|
27474
|
+
name: z106.string(),
|
|
27475
|
+
userIsMember: z106.boolean(),
|
|
27476
|
+
userRole: z106.string().nullable(),
|
|
27477
|
+
memberCount: z106.number()
|
|
27478
|
+
});
|
|
27479
|
+
var listOrgTeamsResponseSchema = z106.object({
|
|
27480
|
+
teams: z106.array(orgTeamSchema),
|
|
27481
|
+
total: z106.number()
|
|
27482
|
+
});
|
|
27483
|
+
function registerTeamsOrg(teams) {
|
|
27484
|
+
teams.command("org <org-id>").description("List all teams in an organization you belong to").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function orgAction(orgId, options) {
|
|
27485
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
27486
|
+
const raw = await httpRequest({
|
|
27487
|
+
method: "GET",
|
|
27488
|
+
path: `/v2/organizations/${encodeURIComponent(orgId)}/teams`,
|
|
27489
|
+
apiKey,
|
|
27490
|
+
apiBaseUrl
|
|
27491
|
+
});
|
|
27492
|
+
if (options.json) {
|
|
27493
|
+
printJson(raw);
|
|
27494
|
+
return;
|
|
27495
|
+
}
|
|
27496
|
+
const parsed = listOrgTeamsResponseSchema.safeParse(raw);
|
|
27497
|
+
if (!parsed.success) {
|
|
27498
|
+
throw new CliError(
|
|
27499
|
+
`Unexpected response from GET /v2/organizations/:orgId/teams: ${parsed.error.message}`
|
|
27500
|
+
);
|
|
27501
|
+
}
|
|
27502
|
+
if (parsed.data.teams.length === 0) {
|
|
27503
|
+
console.log("No teams found in this organization.");
|
|
27504
|
+
return;
|
|
27505
|
+
}
|
|
27506
|
+
console.log(
|
|
27507
|
+
renderTable(
|
|
27508
|
+
[
|
|
27509
|
+
{ header: "ID", cell: /* @__PURE__ */ __name((t) => t.id, "cell") },
|
|
27510
|
+
{ header: "NAME", cell: /* @__PURE__ */ __name((t) => t.name, "cell"), maxWidth: 40 },
|
|
27511
|
+
{ header: "MEMBER", cell: /* @__PURE__ */ __name((t) => t.userIsMember ? "yes" : "no", "cell") },
|
|
27512
|
+
{ header: "ROLE", cell: /* @__PURE__ */ __name((t) => t.userRole ?? "\u2014", "cell") },
|
|
27513
|
+
{ header: "MEMBERS", cell: /* @__PURE__ */ __name((t) => String(t.memberCount), "cell") }
|
|
27514
|
+
],
|
|
27515
|
+
parsed.data.teams
|
|
27516
|
+
)
|
|
27517
|
+
);
|
|
27518
|
+
}, "orgAction"));
|
|
27519
|
+
}
|
|
27520
|
+
__name(registerTeamsOrg, "registerTeamsOrg");
|
|
27521
|
+
|
|
27522
|
+
// src/commands/teams/index.ts
|
|
27523
|
+
function registerTeams(program) {
|
|
27524
|
+
const teams = program.command("teams").description("Inspect the teams your credentials can act on");
|
|
27525
|
+
registerTeamsList(teams);
|
|
27526
|
+
registerTeamsOrg(teams);
|
|
27527
|
+
}
|
|
27528
|
+
__name(registerTeams, "registerTeams");
|
|
27529
|
+
|
|
27268
27530
|
// src/commands/whoami.ts
|
|
27269
27531
|
function registerWhoami(program) {
|
|
27270
27532
|
program.command("whoami").description(
|
|
@@ -27318,7 +27580,7 @@ __name(resolveActiveTeamId, "resolveActiveTeamId");
|
|
|
27318
27580
|
var version = resolveVersion();
|
|
27319
27581
|
function resolveVersion() {
|
|
27320
27582
|
if (true) {
|
|
27321
|
-
return "1.
|
|
27583
|
+
return "1.14.0";
|
|
27322
27584
|
}
|
|
27323
27585
|
const packageJsonPath = join3(
|
|
27324
27586
|
dirname3(fileURLToPath2(import.meta.url)),
|
|
@@ -27372,7 +27634,7 @@ function createProgram() {
|
|
|
27372
27634
|
registerGuide(program);
|
|
27373
27635
|
registerSuggestions(program);
|
|
27374
27636
|
registerTeam(program);
|
|
27375
|
-
|
|
27637
|
+
registerTeams(program);
|
|
27376
27638
|
registerSecrets(program);
|
|
27377
27639
|
registerCredentials(program);
|
|
27378
27640
|
registerRevisionSecrets(program);
|
|
@@ -27402,7 +27664,7 @@ function checkForUpdate() {
|
|
|
27402
27664
|
__name(checkForUpdate, "checkForUpdate");
|
|
27403
27665
|
function loadPackageMeta() {
|
|
27404
27666
|
if (true) {
|
|
27405
|
-
return { name: "@duvoai/cli", version: "1.
|
|
27667
|
+
return { name: "@duvoai/cli", version: "1.14.0" };
|
|
27406
27668
|
}
|
|
27407
27669
|
const require2 = createRequire(import.meta.url);
|
|
27408
27670
|
const raw = require2("../package.json");
|