@duvoai/cli 1.6.2 → 1.7.1
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 +594 -267
- package/dist/bin/duvo.js.map +4 -4
- package/package.json +1 -1
package/dist/bin/duvo.js
CHANGED
|
@@ -1902,7 +1902,14 @@ var agentRunSchema = z10.object({
|
|
|
1902
1902
|
eval_summaries: evalSummarySchema.nullable().optional(),
|
|
1903
1903
|
user_name: z10.string().nullable().optional(),
|
|
1904
1904
|
user_email: z10.string().nullable().optional(),
|
|
1905
|
-
submitted_prompt_count: z10.number().int().min(0).optional()
|
|
1905
|
+
submitted_prompt_count: z10.number().int().min(0).optional(),
|
|
1906
|
+
/**
|
|
1907
|
+
* Sequential run number within its agent, scoped per owner (1-based,
|
|
1908
|
+
* oldest first) — so each user gets their own sequence, matching the
|
|
1909
|
+
* team-wide runs page. Computed server-side; the frontend must use this
|
|
1910
|
+
* rather than deriving a number from the list position.
|
|
1911
|
+
*/
|
|
1912
|
+
run_number: z10.number().int().positive().optional()
|
|
1906
1913
|
});
|
|
1907
1914
|
var agentRunsListResponseSchema = z10.object({
|
|
1908
1915
|
data: z10.array(agentRunSchema),
|
|
@@ -1967,7 +1974,14 @@ var agentRunDetailSchemaData = z10.object({
|
|
|
1967
1974
|
eval_summaries: evalSummarySchema.nullable().optional(),
|
|
1968
1975
|
user_name: z10.string().nullable().optional(),
|
|
1969
1976
|
user_email: z10.string().nullable().optional(),
|
|
1970
|
-
submitted_prompt_count: z10.number().int().min(0).optional()
|
|
1977
|
+
submitted_prompt_count: z10.number().int().min(0).optional(),
|
|
1978
|
+
/**
|
|
1979
|
+
* Sequential run number for this run within its agent (1-based, oldest
|
|
1980
|
+
* first). Computed server-side so the header shows the correct "Run #N"
|
|
1981
|
+
* even for old runs opened directly by URL, which may fall outside the
|
|
1982
|
+
* paginated runs list the frontend has loaded.
|
|
1983
|
+
*/
|
|
1984
|
+
run_number: z10.number().int().positive().optional()
|
|
1971
1985
|
});
|
|
1972
1986
|
var agentRunDetailSchema = z10.object({
|
|
1973
1987
|
data: agentRunDetailSchemaData.nullable()
|
|
@@ -2958,6 +2972,14 @@ var clarityProcessLandscapeNodeSchema = z13.object({
|
|
|
2958
2972
|
updatedAt: z13.string(),
|
|
2959
2973
|
process: clarityProcessLandscapeSummarySchema.nullable()
|
|
2960
2974
|
});
|
|
2975
|
+
var clarityProcessLandscapeLinkSchema = z13.object({
|
|
2976
|
+
id: z13.guid(),
|
|
2977
|
+
sourceNodeId: z13.guid(),
|
|
2978
|
+
targetNodeId: z13.guid(),
|
|
2979
|
+
type: z13.enum(["hands_off_to", "shares_step_with", "variant_of"]),
|
|
2980
|
+
state: z13.enum(["suggested", "confirmed"]),
|
|
2981
|
+
confidence: z13.number().nullable()
|
|
2982
|
+
});
|
|
2961
2983
|
var clarityProcessLandscapeStatsSchema = z13.object({
|
|
2962
2984
|
totalNodes: z13.number(),
|
|
2963
2985
|
processNodes: z13.number(),
|
|
@@ -2968,6 +2990,7 @@ var clarityProcessLandscapeStatsSchema = z13.object({
|
|
|
2968
2990
|
});
|
|
2969
2991
|
var clarityProcessLandscapeResponseSchema = z13.object({
|
|
2970
2992
|
nodes: z13.array(clarityProcessLandscapeNodeSchema),
|
|
2993
|
+
links: z13.array(clarityProcessLandscapeLinkSchema),
|
|
2971
2994
|
stats: clarityProcessLandscapeStatsSchema,
|
|
2972
2995
|
truncated: z13.boolean()
|
|
2973
2996
|
});
|
|
@@ -3960,21 +3983,23 @@ var clarityProcessSnapshotBaseApiSchema = z18.object({
|
|
|
3960
3983
|
updated_at: z18.string().describe("ISO 8601 last-update timestamp"),
|
|
3961
3984
|
...versioningApiFields
|
|
3962
3985
|
});
|
|
3986
|
+
var clarityCurrentProcessSnapshotKindApiSchema = clarityProcessSnapshotBaseApiSchema.extend({
|
|
3987
|
+
kind: z18.literal("current_process"),
|
|
3988
|
+
source_snapshot_id: z18.null(),
|
|
3989
|
+
data: postprocessClarityCurrentProcessDataSchema.describe(
|
|
3990
|
+
"Opaque BPMN payload describing the captured current process."
|
|
3991
|
+
)
|
|
3992
|
+
});
|
|
3993
|
+
var clarityTransformationProposalSnapshotKindApiSchema = clarityProcessSnapshotBaseApiSchema.extend({
|
|
3994
|
+
kind: z18.literal("transformation_proposal"),
|
|
3995
|
+
source_snapshot_id: z18.guid(),
|
|
3996
|
+
data: postprocessClarityTransformationProposalDataSchema.describe(
|
|
3997
|
+
"Opaque BPMN payload for the proposed transformed process."
|
|
3998
|
+
)
|
|
3999
|
+
});
|
|
3963
4000
|
var clarityProcessSnapshotApiSchema = z18.discriminatedUnion("kind", [
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
source_snapshot_id: z18.null(),
|
|
3967
|
-
data: postprocessClarityCurrentProcessDataSchema.describe(
|
|
3968
|
-
"Opaque BPMN payload describing the captured current process."
|
|
3969
|
-
)
|
|
3970
|
-
}),
|
|
3971
|
-
clarityProcessSnapshotBaseApiSchema.extend({
|
|
3972
|
-
kind: z18.literal("transformation_proposal"),
|
|
3973
|
-
source_snapshot_id: z18.guid(),
|
|
3974
|
-
data: postprocessClarityTransformationProposalDataSchema.describe(
|
|
3975
|
-
"Opaque BPMN payload for the proposed transformed process."
|
|
3976
|
-
)
|
|
3977
|
-
})
|
|
4001
|
+
clarityCurrentProcessSnapshotKindApiSchema,
|
|
4002
|
+
clarityTransformationProposalSnapshotKindApiSchema
|
|
3978
4003
|
]);
|
|
3979
4004
|
var clarityProcessSnapshotVersionApiSchema = z18.discriminatedUnion(
|
|
3980
4005
|
"kind",
|
|
@@ -4006,11 +4031,18 @@ var getClarityProcessSnapshotParamsSchema = listClarityProcessSnapshotsParamsSch
|
|
|
4006
4031
|
var clarityProcessSnapshotDetailResponseSchema = z18.object({
|
|
4007
4032
|
snapshot: clarityProcessSnapshotApiSchema
|
|
4008
4033
|
});
|
|
4034
|
+
var clarityCurrentProcessSnapshotKindDetailResponseSchema = z18.object({
|
|
4035
|
+
snapshot: clarityCurrentProcessSnapshotKindApiSchema
|
|
4036
|
+
});
|
|
4037
|
+
var clarityTransformationProposalSnapshotKindDetailResponseSchema = z18.object({
|
|
4038
|
+
snapshot: clarityTransformationProposalSnapshotKindApiSchema
|
|
4039
|
+
});
|
|
4009
4040
|
var saveClarityProcessSnapshotBodySchema = z18.object({
|
|
4010
4041
|
steps: z18.array(postprocessClarityStepBaseSchema).min(1).superRefine(refineStepGraph),
|
|
4011
4042
|
baselineSnapshotId: z18.guid(),
|
|
4012
4043
|
clarityCurrentProcessId: z18.guid().optional()
|
|
4013
4044
|
});
|
|
4045
|
+
var saveClarityProcessSnapshotResponseSchema = clarityProcessSnapshotDetailResponseSchema;
|
|
4014
4046
|
var clarityV2ProcessReadModelSchema = z18.object({
|
|
4015
4047
|
process: z18.object({
|
|
4016
4048
|
id: z18.guid().describe("Clarity process id"),
|
|
@@ -4249,6 +4281,7 @@ var sendArtifactChatMessageResponseSchema = z20.object({
|
|
|
4249
4281
|
var updateArtifactChatMessageBodySchema = z20.object({
|
|
4250
4282
|
decision: z20.enum(["accept", "decline"])
|
|
4251
4283
|
});
|
|
4284
|
+
var updateArtifactChatMessageResponseSchema = sendArtifactChatMessageResponseSchema;
|
|
4252
4285
|
var artifactChatMessageUpsertEventDataSchema = z20.object({
|
|
4253
4286
|
conversation: clarityProcessChatConversationSchema,
|
|
4254
4287
|
message: clarityProcessChatMessageSchema
|
|
@@ -7797,11 +7830,6 @@ var FEATURE_FLAG_CATALOGUE = {
|
|
|
7797
7830
|
defaultValue: false,
|
|
7798
7831
|
description: "Enables the case approval feature end-to-end: AOP authors can @-mention team members in the agent AOP textarea (serialized as <DUVO:USER> tags), agents can request human approval on cases via the request_case_approval tool, and approvers see and respond to pending requests on the case. Off-by-default for staged rollout."
|
|
7799
7832
|
},
|
|
7800
|
-
CLARITY_AUTO_CLASSIFIER: {
|
|
7801
|
-
key: "clarity_auto_classifier",
|
|
7802
|
-
defaultValue: false,
|
|
7803
|
-
description: "Enables the Clarity L1\u2013L4 auto-classifier: the explicit Organize action plus the incremental re-classification triggers (capture completion, org team assignment) that place unconfirmed process nodes into the hierarchy via LLM decisions. Off by default while the classifier is validated with pilot teams; flip on per team or organization."
|
|
7804
|
-
},
|
|
7805
7833
|
CLARITY_ARTIFACT_CHAT: {
|
|
7806
7834
|
key: "clarity_artifact_chat",
|
|
7807
7835
|
defaultValue: false,
|
|
@@ -15240,6 +15268,90 @@ ${renderTable(MESSAGE_COLUMNS, response.messages)}`
|
|
|
15240
15268
|
}, "action"));
|
|
15241
15269
|
}
|
|
15242
15270
|
__name(registerClarityArtifactChatMessages, "registerClarityArtifactChatMessages");
|
|
15271
|
+
function registerClaritySendArtifactChatMessage(clarity) {
|
|
15272
|
+
clarity.command("send-artifact-chat-message <process-id>").description("Send an artifact-chat message or HITL answer").option(
|
|
15273
|
+
"--conversation-id <id>",
|
|
15274
|
+
"existing conversation to continue; omit to start a new conversation"
|
|
15275
|
+
).requiredOption(
|
|
15276
|
+
"--snapshot-kind <current_process|transformation_proposal>",
|
|
15277
|
+
"artifact kind to edit",
|
|
15278
|
+
parseSnapshotKind
|
|
15279
|
+
).requiredOption(
|
|
15280
|
+
"--baseline-snapshot-id <id>",
|
|
15281
|
+
"snapshot version the artifact-chat turn is based on"
|
|
15282
|
+
).option("--message <text>", "message text to send").option(
|
|
15283
|
+
"--answer <key=value>",
|
|
15284
|
+
"answer one HITL question; repeat for multiple answers",
|
|
15285
|
+
collectAnswer,
|
|
15286
|
+
[]
|
|
15287
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
15288
|
+
const answers = parseAnswers(options.answer ?? []);
|
|
15289
|
+
if (options.message === void 0 && answers === void 0) {
|
|
15290
|
+
throw new CliError("Pass --message, at least one --answer, or both.");
|
|
15291
|
+
}
|
|
15292
|
+
if (answers !== void 0 && options.conversationId === void 0) {
|
|
15293
|
+
throw new CliError("--answer requires --conversation-id.");
|
|
15294
|
+
}
|
|
15295
|
+
const body = {
|
|
15296
|
+
conversation_id: options.conversationId ?? null,
|
|
15297
|
+
snapshot_kind: options.snapshotKind,
|
|
15298
|
+
baseline_snapshot_id: options.baselineSnapshotId
|
|
15299
|
+
};
|
|
15300
|
+
if (options.message !== void 0) {
|
|
15301
|
+
body.content = options.message;
|
|
15302
|
+
}
|
|
15303
|
+
if (answers !== void 0) {
|
|
15304
|
+
body.answers = answers;
|
|
15305
|
+
}
|
|
15306
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
15307
|
+
const raw = await httpRequest({
|
|
15308
|
+
method: "POST",
|
|
15309
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-chat/messages`,
|
|
15310
|
+
apiKey,
|
|
15311
|
+
apiBaseUrl,
|
|
15312
|
+
body
|
|
15313
|
+
});
|
|
15314
|
+
if (options.json) {
|
|
15315
|
+
printJson(raw);
|
|
15316
|
+
return;
|
|
15317
|
+
}
|
|
15318
|
+
const parsed = sendArtifactChatMessageResponseSchema.safeParse(raw);
|
|
15319
|
+
if (!parsed.success) {
|
|
15320
|
+
throw new CliError(
|
|
15321
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
15322
|
+
);
|
|
15323
|
+
}
|
|
15324
|
+
renderArtifactChatTurn(parsed.data);
|
|
15325
|
+
}, "action"));
|
|
15326
|
+
}
|
|
15327
|
+
__name(registerClaritySendArtifactChatMessage, "registerClaritySendArtifactChatMessage");
|
|
15328
|
+
function registerClarityDecideArtifactChatPatch(clarity) {
|
|
15329
|
+
clarity.command("decide-artifact-chat-patch <process-id> <message-id>").description("Accept or decline an artifact-chat patch proposal").option("--accept", "accept the patch proposal").option("--decline", "decline the patch proposal").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, messageId, options) {
|
|
15330
|
+
if (options.accept === options.decline) {
|
|
15331
|
+
throw new CliError("Pass exactly one of --accept or --decline.");
|
|
15332
|
+
}
|
|
15333
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
15334
|
+
const raw = await httpRequest({
|
|
15335
|
+
method: "PUT",
|
|
15336
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-chat/messages/${encodeURIComponent(messageId)}`,
|
|
15337
|
+
apiKey,
|
|
15338
|
+
apiBaseUrl,
|
|
15339
|
+
body: { decision: options.accept === true ? "accept" : "decline" }
|
|
15340
|
+
});
|
|
15341
|
+
if (options.json) {
|
|
15342
|
+
printJson(raw);
|
|
15343
|
+
return;
|
|
15344
|
+
}
|
|
15345
|
+
const parsed = updateArtifactChatMessageResponseSchema.safeParse(raw);
|
|
15346
|
+
if (!parsed.success) {
|
|
15347
|
+
throw new CliError(
|
|
15348
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
15349
|
+
);
|
|
15350
|
+
}
|
|
15351
|
+
renderArtifactChatTurn(parsed.data);
|
|
15352
|
+
}, "action"));
|
|
15353
|
+
}
|
|
15354
|
+
__name(registerClarityDecideArtifactChatPatch, "registerClarityDecideArtifactChatPatch");
|
|
15243
15355
|
function parseSnapshotKind(value) {
|
|
15244
15356
|
const parsed = claritySnapshotKindSchema.safeParse(value);
|
|
15245
15357
|
if (!parsed.success) {
|
|
@@ -15250,6 +15362,43 @@ function parseSnapshotKind(value) {
|
|
|
15250
15362
|
return parsed.data;
|
|
15251
15363
|
}
|
|
15252
15364
|
__name(parseSnapshotKind, "parseSnapshotKind");
|
|
15365
|
+
function collectAnswer(value, previous) {
|
|
15366
|
+
return [...previous, value];
|
|
15367
|
+
}
|
|
15368
|
+
__name(collectAnswer, "collectAnswer");
|
|
15369
|
+
function parseAnswers(entries) {
|
|
15370
|
+
if (entries.length === 0) {
|
|
15371
|
+
return void 0;
|
|
15372
|
+
}
|
|
15373
|
+
const answers = {};
|
|
15374
|
+
for (const entry of entries) {
|
|
15375
|
+
const separatorIndex = entry.indexOf("=");
|
|
15376
|
+
if (separatorIndex <= 0) {
|
|
15377
|
+
throw new CliError("--answer must use key=value format.");
|
|
15378
|
+
}
|
|
15379
|
+
const key = entry.slice(0, separatorIndex).trim();
|
|
15380
|
+
const value = entry.slice(separatorIndex + 1);
|
|
15381
|
+
if (key.length === 0) {
|
|
15382
|
+
throw new CliError("--answer key cannot be empty.");
|
|
15383
|
+
}
|
|
15384
|
+
answers[key] = value;
|
|
15385
|
+
}
|
|
15386
|
+
return answers;
|
|
15387
|
+
}
|
|
15388
|
+
__name(parseAnswers, "parseAnswers");
|
|
15389
|
+
function renderArtifactChatTurn(response) {
|
|
15390
|
+
console.log(
|
|
15391
|
+
renderKeyValue([
|
|
15392
|
+
{ label: "Conversation", value: response.conversation.id },
|
|
15393
|
+
{ label: "Conversation status", value: response.conversation.status },
|
|
15394
|
+
{ label: "Message", value: response.message.id },
|
|
15395
|
+
{ label: "Role", value: response.message.role },
|
|
15396
|
+
{ label: "Kind", value: response.message.kind },
|
|
15397
|
+
{ label: "Created", value: response.message.created_at }
|
|
15398
|
+
])
|
|
15399
|
+
);
|
|
15400
|
+
}
|
|
15401
|
+
__name(renderArtifactChatTurn, "renderArtifactChatTurn");
|
|
15253
15402
|
function describeMessageBody(body) {
|
|
15254
15403
|
switch (body.kind) {
|
|
15255
15404
|
case "text":
|
|
@@ -15681,7 +15830,7 @@ function renderOverview(overview) {
|
|
|
15681
15830
|
const usableCaptures = overview.process.captures.filter(
|
|
15682
15831
|
(capture) => describeCaptureUsability(capture).usable
|
|
15683
15832
|
).length;
|
|
15684
|
-
const proposalAnchor = overview.current_snapshot !== null && overview.transformation_proposal_snapshot !== null ? overview.transformation_proposal_snapshot.
|
|
15833
|
+
const proposalAnchor = overview.current_snapshot !== null && overview.transformation_proposal_snapshot !== null ? overview.transformation_proposal_snapshot.source_snapshot_id === overview.current_snapshot.id : null;
|
|
15685
15834
|
const proposalAnchorStatus = formatOptionalMatch(proposalAnchor, {
|
|
15686
15835
|
trueValue: "matches selected current snapshot",
|
|
15687
15836
|
falseValue: "mismatch",
|
|
@@ -15838,7 +15987,7 @@ function renderLegacyMarkdown(process2) {
|
|
|
15838
15987
|
}
|
|
15839
15988
|
__name(renderLegacyMarkdown, "renderLegacyMarkdown");
|
|
15840
15989
|
function renderSnapshotMarkdown(title, snapshot) {
|
|
15841
|
-
const anchorLine = "
|
|
15990
|
+
const anchorLine = snapshot.kind === "transformation_proposal" ? `- Current process anchor: ${snapshot.source_snapshot_id ?? "none"}` : null;
|
|
15842
15991
|
return [
|
|
15843
15992
|
`# ${title}`,
|
|
15844
15993
|
"",
|
|
@@ -15856,7 +16005,7 @@ __name(renderSnapshotMarkdown, "renderSnapshotMarkdown");
|
|
|
15856
16005
|
function renderCompareMarkdown(processName, current, proposal) {
|
|
15857
16006
|
const currentStepCount = current?.data.steps.length ?? 0;
|
|
15858
16007
|
const proposalStepCount = proposal?.data.steps.length ?? 0;
|
|
15859
|
-
const anchorMatches = current !== null && proposal !== null ? proposal.
|
|
16008
|
+
const anchorMatches = current !== null && proposal !== null ? proposal.source_snapshot_id === current.id : null;
|
|
15860
16009
|
const anchorStatus = formatOptionalMatch(anchorMatches, {
|
|
15861
16010
|
trueValue: "matches selected current snapshot",
|
|
15862
16011
|
falseValue: "mismatch",
|
|
@@ -15868,7 +16017,7 @@ function renderCompareMarkdown(processName, current, proposal) {
|
|
|
15868
16017
|
"## Summary",
|
|
15869
16018
|
`- Current snapshot: ${current?.id ?? "none"} (${currentStepCount} steps)`,
|
|
15870
16019
|
`- Proposal snapshot: ${proposal?.id ?? "none"} (${proposalStepCount} steps)`,
|
|
15871
|
-
proposal ? `- Proposal anchor: ${proposal.
|
|
16020
|
+
proposal ? `- Proposal anchor: ${proposal.source_snapshot_id}` : "- Proposal anchor: none",
|
|
15872
16021
|
`- Anchor status: ${anchorStatus}`,
|
|
15873
16022
|
`- Step delta: ${proposalStepCount - currentStepCount}`,
|
|
15874
16023
|
"",
|
|
@@ -16246,10 +16395,10 @@ function buildProposalAnchorCheck(overview) {
|
|
|
16246
16395
|
}
|
|
16247
16396
|
__name(buildProposalAnchorCheck, "buildProposalAnchorCheck");
|
|
16248
16397
|
function describeProposalAnchorMismatch(currentSnapshot, proposalSnapshot) {
|
|
16249
|
-
if (proposalSnapshot.
|
|
16398
|
+
if (proposalSnapshot.source_snapshot_id === currentSnapshot.id) {
|
|
16250
16399
|
return null;
|
|
16251
16400
|
}
|
|
16252
|
-
return `Selected proposal was generated against current-process ${proposalSnapshot.
|
|
16401
|
+
return `Selected proposal was generated against current-process ${proposalSnapshot.source_snapshot_id}, not selected current-process ${currentSnapshot.id}.`;
|
|
16253
16402
|
}
|
|
16254
16403
|
__name(describeProposalAnchorMismatch, "describeProposalAnchorMismatch");
|
|
16255
16404
|
function buildOverviewOutput(overview, options) {
|
|
@@ -16551,11 +16700,11 @@ async function getCurrentProcessSnapshot(config, processId, snapshotId) {
|
|
|
16551
16700
|
method: "GET",
|
|
16552
16701
|
path: `/v2/clarity-v2/processes/${encodeURIComponent(
|
|
16553
16702
|
processId
|
|
16554
|
-
)}/
|
|
16703
|
+
)}/snapshots/current_process/${encodeURIComponent(snapshotId)}`,
|
|
16555
16704
|
resource: "Clarity current-process snapshot"
|
|
16556
16705
|
});
|
|
16557
16706
|
return parseResponse(
|
|
16558
|
-
|
|
16707
|
+
clarityCurrentProcessSnapshotKindDetailResponseSchema,
|
|
16559
16708
|
raw
|
|
16560
16709
|
);
|
|
16561
16710
|
}
|
|
@@ -16565,11 +16714,11 @@ async function getTransformationProposalSnapshot(config, processId, snapshotId)
|
|
|
16565
16714
|
method: "GET",
|
|
16566
16715
|
path: `/v2/clarity-v2/processes/${encodeURIComponent(
|
|
16567
16716
|
processId
|
|
16568
|
-
)}/
|
|
16717
|
+
)}/snapshots/transformation_proposal/${encodeURIComponent(snapshotId)}`,
|
|
16569
16718
|
resource: "Clarity transformation-proposal snapshot"
|
|
16570
16719
|
});
|
|
16571
16720
|
return parseResponse(
|
|
16572
|
-
|
|
16721
|
+
clarityTransformationProposalSnapshotKindDetailResponseSchema,
|
|
16573
16722
|
raw
|
|
16574
16723
|
);
|
|
16575
16724
|
}
|
|
@@ -16714,32 +16863,13 @@ var CLARITY_READ_TOOLS = [
|
|
|
16714
16863
|
description: "Read old v1 Clarity processes with legacy analysis, transformation guidance, and captures."
|
|
16715
16864
|
},
|
|
16716
16865
|
{
|
|
16717
|
-
name: "
|
|
16866
|
+
name: "getClarityProcessSnapshot",
|
|
16718
16867
|
scope: "v2",
|
|
16719
16868
|
read_only: true,
|
|
16720
16869
|
commands: [
|
|
16721
16870
|
"duvo clarity current",
|
|
16722
|
-
"duvo clarity evidence",
|
|
16723
|
-
"duvo clarity compare",
|
|
16724
|
-
"duvo clarity overview",
|
|
16725
|
-
"duvo clarity facets",
|
|
16726
|
-
"duvo clarity export",
|
|
16727
|
-
"duvo clarity doctor"
|
|
16728
|
-
],
|
|
16729
|
-
endpoints: [
|
|
16730
|
-
{
|
|
16731
|
-
method: "GET",
|
|
16732
|
-
path: "/v2/clarity-v2/processes/:processId/current-process/:snapshotId"
|
|
16733
|
-
}
|
|
16734
|
-
],
|
|
16735
|
-
description: "Read a full v2 current-process snapshot, including BPMN steps, sources, summary, and readiness slices."
|
|
16736
|
-
},
|
|
16737
|
-
{
|
|
16738
|
-
name: "getClarityTransformationProposalSnapshot",
|
|
16739
|
-
scope: "v2",
|
|
16740
|
-
read_only: true,
|
|
16741
|
-
commands: [
|
|
16742
16871
|
"duvo clarity proposal",
|
|
16872
|
+
"duvo clarity evidence",
|
|
16743
16873
|
"duvo clarity compare",
|
|
16744
16874
|
"duvo clarity readiness",
|
|
16745
16875
|
"duvo clarity gaps",
|
|
@@ -16751,10 +16881,14 @@ var CLARITY_READ_TOOLS = [
|
|
|
16751
16881
|
endpoints: [
|
|
16752
16882
|
{
|
|
16753
16883
|
method: "GET",
|
|
16754
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
16884
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/:snapshotId"
|
|
16885
|
+
},
|
|
16886
|
+
{
|
|
16887
|
+
method: "GET",
|
|
16888
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/:snapshotId"
|
|
16755
16889
|
}
|
|
16756
16890
|
],
|
|
16757
|
-
description: "Read a full v2
|
|
16891
|
+
description: "Read a full v2 snapshot, including process steps, evidence, readiness, projected impact, and gaps."
|
|
16758
16892
|
},
|
|
16759
16893
|
{
|
|
16760
16894
|
name: "listClarityExtraCaptureRequests",
|
|
@@ -16804,82 +16938,110 @@ var CLARITY_READ_TOOLS = [
|
|
|
16804
16938
|
];
|
|
16805
16939
|
var CLARITY_WRITE_TOOLS = [
|
|
16806
16940
|
{
|
|
16807
|
-
name: "
|
|
16941
|
+
name: "sendClarityArtifactChatMessage",
|
|
16808
16942
|
scope: "v2",
|
|
16809
16943
|
read_only: false,
|
|
16810
|
-
commands: ["duvo clarity
|
|
16944
|
+
commands: ["duvo clarity send-artifact-chat-message"],
|
|
16811
16945
|
endpoints: [
|
|
16812
16946
|
{
|
|
16813
16947
|
method: "POST",
|
|
16814
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
16948
|
+
path: "/v2/clarity-v2/processes/:processId/artifact-chat/messages"
|
|
16815
16949
|
}
|
|
16816
16950
|
],
|
|
16817
|
-
description: "
|
|
16951
|
+
description: "Send a new artifact-chat message, continue an existing conversation, or answer HITL questions."
|
|
16818
16952
|
},
|
|
16819
16953
|
{
|
|
16820
|
-
name: "
|
|
16954
|
+
name: "decideClarityArtifactChatPatch",
|
|
16821
16955
|
scope: "v2",
|
|
16822
16956
|
read_only: false,
|
|
16823
|
-
commands: ["duvo clarity
|
|
16957
|
+
commands: ["duvo clarity decide-artifact-chat-patch"],
|
|
16824
16958
|
endpoints: [
|
|
16825
16959
|
{
|
|
16826
|
-
method: "
|
|
16827
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
16960
|
+
method: "PUT",
|
|
16961
|
+
path: "/v2/clarity-v2/processes/:processId/artifact-chat/messages/:messageId"
|
|
16828
16962
|
}
|
|
16829
16963
|
],
|
|
16830
|
-
description: "
|
|
16964
|
+
description: "Accept or decline a proposed artifact-chat patch."
|
|
16831
16965
|
},
|
|
16832
16966
|
{
|
|
16833
|
-
name: "
|
|
16967
|
+
name: "generateClarityProcessSnapshot",
|
|
16834
16968
|
scope: "v2",
|
|
16835
16969
|
read_only: false,
|
|
16836
|
-
commands: [
|
|
16970
|
+
commands: [
|
|
16971
|
+
"duvo clarity generate-current-process",
|
|
16972
|
+
"duvo clarity generate-transformation-proposal"
|
|
16973
|
+
],
|
|
16837
16974
|
endpoints: [
|
|
16838
16975
|
{
|
|
16839
16976
|
method: "POST",
|
|
16840
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
16977
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/generate"
|
|
16978
|
+
},
|
|
16979
|
+
{
|
|
16980
|
+
method: "POST",
|
|
16981
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/generate"
|
|
16841
16982
|
}
|
|
16842
16983
|
],
|
|
16843
|
-
description: "
|
|
16984
|
+
description: "Start asynchronous snapshot generation or regeneration."
|
|
16844
16985
|
},
|
|
16845
16986
|
{
|
|
16846
|
-
name: "
|
|
16987
|
+
name: "saveClarityProcessSnapshot",
|
|
16847
16988
|
scope: "v2",
|
|
16848
16989
|
read_only: false,
|
|
16849
|
-
commands: [
|
|
16990
|
+
commands: [
|
|
16991
|
+
"duvo clarity save-current-process",
|
|
16992
|
+
"duvo clarity save-transformation-proposal"
|
|
16993
|
+
],
|
|
16850
16994
|
endpoints: [
|
|
16851
16995
|
{
|
|
16852
16996
|
method: "POST",
|
|
16853
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
16997
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/save"
|
|
16998
|
+
},
|
|
16999
|
+
{
|
|
17000
|
+
method: "POST",
|
|
17001
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/save"
|
|
16854
17002
|
}
|
|
16855
17003
|
],
|
|
16856
|
-
description: "
|
|
17004
|
+
description: "Save edited snapshot steps as the live version."
|
|
16857
17005
|
},
|
|
16858
17006
|
{
|
|
16859
|
-
name: "
|
|
17007
|
+
name: "promoteClarityProcessSnapshot",
|
|
16860
17008
|
scope: "v2",
|
|
16861
17009
|
read_only: false,
|
|
16862
|
-
commands: [
|
|
17010
|
+
commands: [
|
|
17011
|
+
"duvo clarity promote-current-process",
|
|
17012
|
+
"duvo clarity promote-transformation-proposal"
|
|
17013
|
+
],
|
|
16863
17014
|
endpoints: [
|
|
16864
17015
|
{
|
|
16865
|
-
method: "
|
|
16866
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
17016
|
+
method: "POST",
|
|
17017
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/:snapshotId/promote"
|
|
17018
|
+
},
|
|
17019
|
+
{
|
|
17020
|
+
method: "POST",
|
|
17021
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/:proposalId/promote"
|
|
16867
17022
|
}
|
|
16868
17023
|
],
|
|
16869
|
-
description: "
|
|
17024
|
+
description: "Promote a snapshot to live."
|
|
16870
17025
|
},
|
|
16871
17026
|
{
|
|
16872
|
-
name: "
|
|
17027
|
+
name: "revertClarityProcessSnapshot",
|
|
16873
17028
|
scope: "v2",
|
|
16874
17029
|
read_only: false,
|
|
16875
|
-
commands: [
|
|
17030
|
+
commands: [
|
|
17031
|
+
"duvo clarity revert-current-process",
|
|
17032
|
+
"duvo clarity revert-transformation-proposal"
|
|
17033
|
+
],
|
|
16876
17034
|
endpoints: [
|
|
16877
17035
|
{
|
|
16878
17036
|
method: "DELETE",
|
|
16879
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
17037
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/:snapshotId"
|
|
17038
|
+
},
|
|
17039
|
+
{
|
|
17040
|
+
method: "DELETE",
|
|
17041
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/:proposalId"
|
|
16880
17042
|
}
|
|
16881
17043
|
],
|
|
16882
|
-
description: "Delete a
|
|
17044
|
+
description: "Delete a snapshot."
|
|
16883
17045
|
},
|
|
16884
17046
|
{
|
|
16885
17047
|
name: "assignClarityExtraCaptureRequest",
|
|
@@ -16921,17 +17083,24 @@ var CLARITY_WRITE_TOOLS = [
|
|
|
16921
17083
|
description: "Start workflow-builder automation generation from the latest proposal."
|
|
16922
17084
|
},
|
|
16923
17085
|
{
|
|
16924
|
-
name: "
|
|
17086
|
+
name: "stopClarityProcessSnapshot",
|
|
16925
17087
|
scope: "v2",
|
|
16926
17088
|
read_only: false,
|
|
16927
|
-
commands: [
|
|
17089
|
+
commands: [
|
|
17090
|
+
"duvo clarity stop-current-process",
|
|
17091
|
+
"duvo clarity stop-transformation-proposal"
|
|
17092
|
+
],
|
|
16928
17093
|
endpoints: [
|
|
16929
17094
|
{
|
|
16930
17095
|
method: "POST",
|
|
16931
|
-
path: "/v2/clarity-v2/processes/:processId/
|
|
17096
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/current_process/stop"
|
|
17097
|
+
},
|
|
17098
|
+
{
|
|
17099
|
+
method: "POST",
|
|
17100
|
+
path: "/v2/clarity-v2/processes/:processId/snapshots/transformation_proposal/stop"
|
|
16932
17101
|
}
|
|
16933
17102
|
],
|
|
16934
|
-
description: "Stop an in-flight
|
|
17103
|
+
description: "Stop an in-flight snapshot generation."
|
|
16935
17104
|
},
|
|
16936
17105
|
{
|
|
16937
17106
|
name: "createClarityInviteLink",
|
|
@@ -17607,7 +17776,7 @@ function proposalAnchorMatchesCurrent(overview) {
|
|
|
17607
17776
|
if (overview.current_snapshot === null || overview.transformation_proposal_snapshot === null) {
|
|
17608
17777
|
return null;
|
|
17609
17778
|
}
|
|
17610
|
-
return overview.transformation_proposal_snapshot.
|
|
17779
|
+
return overview.transformation_proposal_snapshot.source_snapshot_id === overview.current_snapshot.id;
|
|
17611
17780
|
}
|
|
17612
17781
|
__name(proposalAnchorMatchesCurrent, "proposalAnchorMatchesCurrent");
|
|
17613
17782
|
function distinctSystems(steps) {
|
|
@@ -17695,7 +17864,7 @@ function registerClarityGenerateCurrentProcess(clarity) {
|
|
|
17695
17864
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
17696
17865
|
const raw = await httpRequest({
|
|
17697
17866
|
method: "POST",
|
|
17698
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
17867
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/current_process/generate`,
|
|
17699
17868
|
apiKey,
|
|
17700
17869
|
apiBaseUrl
|
|
17701
17870
|
});
|
|
@@ -17728,7 +17897,7 @@ function registerClarityGenerateTransformationProposal(clarity) {
|
|
|
17728
17897
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
17729
17898
|
const raw = await httpRequest({
|
|
17730
17899
|
method: "POST",
|
|
17731
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
17900
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/transformation_proposal/generate`,
|
|
17732
17901
|
apiKey,
|
|
17733
17902
|
apiBaseUrl,
|
|
17734
17903
|
body
|
|
@@ -17746,7 +17915,7 @@ function buildGenerateTransformationProposalBody(options) {
|
|
|
17746
17915
|
return { regenerate_from: options.regenerateFrom };
|
|
17747
17916
|
}
|
|
17748
17917
|
if (options.currentProcessId !== void 0) {
|
|
17749
|
-
return {
|
|
17918
|
+
return { source_snapshot_id: options.currentProcessId };
|
|
17750
17919
|
}
|
|
17751
17920
|
return void 0;
|
|
17752
17921
|
}
|
|
@@ -17757,6 +17926,9 @@ import { z as z88 } from "zod";
|
|
|
17757
17926
|
var snapshotSchema = z88.object({
|
|
17758
17927
|
snapshot: z88.object({
|
|
17759
17928
|
id: z88.string(),
|
|
17929
|
+
kind: z88.string(),
|
|
17930
|
+
source_snapshot_id: z88.string().nullable(),
|
|
17931
|
+
parent_id: z88.string().nullable(),
|
|
17760
17932
|
status: z88.string(),
|
|
17761
17933
|
creator_type: z88.string(),
|
|
17762
17934
|
user_id: z88.string().nullable(),
|
|
@@ -17770,7 +17942,7 @@ function registerClarityGetCurrentProcess(clarity) {
|
|
|
17770
17942
|
const config = await requireAuthenticatedConfig(this);
|
|
17771
17943
|
const raw = await getClarityJson(config, {
|
|
17772
17944
|
method: "GET",
|
|
17773
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
17945
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/current_process/${encodeURIComponent(snapshotId)}`,
|
|
17774
17946
|
resource: "Clarity current-process snapshot"
|
|
17775
17947
|
});
|
|
17776
17948
|
if (options.json) {
|
|
@@ -17787,6 +17959,12 @@ function registerClarityGetCurrentProcess(clarity) {
|
|
|
17787
17959
|
console.log(
|
|
17788
17960
|
renderKeyValue([
|
|
17789
17961
|
{ label: "ID", value: snapshot.id },
|
|
17962
|
+
{ label: "Kind", value: snapshot.kind },
|
|
17963
|
+
{
|
|
17964
|
+
label: "Source snapshot ID",
|
|
17965
|
+
value: snapshot.source_snapshot_id ?? ""
|
|
17966
|
+
},
|
|
17967
|
+
{ label: "Parent ID", value: snapshot.parent_id ?? "" },
|
|
17790
17968
|
{ label: "Status", value: snapshot.status },
|
|
17791
17969
|
{ label: "Creator type", value: snapshot.creator_type },
|
|
17792
17970
|
{ label: "User ID", value: snapshot.user_id ?? "" },
|
|
@@ -17804,6 +17982,9 @@ import { z as z89 } from "zod";
|
|
|
17804
17982
|
var snapshotSchema2 = z89.object({
|
|
17805
17983
|
snapshot: z89.object({
|
|
17806
17984
|
id: z89.string(),
|
|
17985
|
+
kind: z89.string(),
|
|
17986
|
+
source_snapshot_id: z89.string().nullable(),
|
|
17987
|
+
parent_id: z89.string().nullable(),
|
|
17807
17988
|
status: z89.string(),
|
|
17808
17989
|
creator_type: z89.string(),
|
|
17809
17990
|
user_id: z89.string().nullable(),
|
|
@@ -17817,7 +17998,7 @@ function registerClarityGetTransformationProposal(clarity) {
|
|
|
17817
17998
|
const config = await requireAuthenticatedConfig(this);
|
|
17818
17999
|
const raw = await getClarityJson(config, {
|
|
17819
18000
|
method: "GET",
|
|
17820
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18001
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/transformation_proposal/${encodeURIComponent(proposalId)}`,
|
|
17821
18002
|
resource: "Clarity transformation-proposal snapshot"
|
|
17822
18003
|
});
|
|
17823
18004
|
if (options.json) {
|
|
@@ -17834,6 +18015,12 @@ function registerClarityGetTransformationProposal(clarity) {
|
|
|
17834
18015
|
console.log(
|
|
17835
18016
|
renderKeyValue([
|
|
17836
18017
|
{ label: "ID", value: snapshot.id },
|
|
18018
|
+
{ label: "Kind", value: snapshot.kind },
|
|
18019
|
+
{
|
|
18020
|
+
label: "Source snapshot ID",
|
|
18021
|
+
value: snapshot.source_snapshot_id ?? ""
|
|
18022
|
+
},
|
|
18023
|
+
{ label: "Parent ID", value: snapshot.parent_id ?? "" },
|
|
17837
18024
|
{ label: "Status", value: snapshot.status },
|
|
17838
18025
|
{ label: "Creator type", value: snapshot.creator_type },
|
|
17839
18026
|
{ label: "User ID", value: snapshot.user_id ?? "" },
|
|
@@ -18016,7 +18203,7 @@ function registerClarityPromoteCurrentProcess(clarity) {
|
|
|
18016
18203
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18017
18204
|
const raw = await httpRequest({
|
|
18018
18205
|
method: "POST",
|
|
18019
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18206
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/current_process/${encodeURIComponent(snapshotId)}/promote`,
|
|
18020
18207
|
apiKey,
|
|
18021
18208
|
apiBaseUrl
|
|
18022
18209
|
});
|
|
@@ -18060,7 +18247,7 @@ function registerClarityPromoteTransformationProposal(clarity) {
|
|
|
18060
18247
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18061
18248
|
const raw = await httpRequest({
|
|
18062
18249
|
method: "POST",
|
|
18063
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18250
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/transformation_proposal/${encodeURIComponent(proposalId)}/promote`,
|
|
18064
18251
|
apiKey,
|
|
18065
18252
|
apiBaseUrl
|
|
18066
18253
|
});
|
|
@@ -18094,7 +18281,7 @@ function registerClarityRevertCurrentProcess(clarity) {
|
|
|
18094
18281
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18095
18282
|
const raw = await httpRequest({
|
|
18096
18283
|
method: "DELETE",
|
|
18097
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18284
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/current_process/${encodeURIComponent(snapshotId)}`,
|
|
18098
18285
|
apiKey,
|
|
18099
18286
|
apiBaseUrl
|
|
18100
18287
|
});
|
|
@@ -18113,7 +18300,7 @@ function registerClarityRevertTransformationProposal(clarity) {
|
|
|
18113
18300
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18114
18301
|
const raw = await httpRequest({
|
|
18115
18302
|
method: "DELETE",
|
|
18116
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18303
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/transformation_proposal/${encodeURIComponent(proposalId)}`,
|
|
18117
18304
|
apiKey,
|
|
18118
18305
|
apiBaseUrl
|
|
18119
18306
|
});
|
|
@@ -18126,13 +18313,148 @@ function registerClarityRevertTransformationProposal(clarity) {
|
|
|
18126
18313
|
}
|
|
18127
18314
|
__name(registerClarityRevertTransformationProposal, "registerClarityRevertTransformationProposal");
|
|
18128
18315
|
|
|
18316
|
+
// src/commands/clarity/save-snapshot.ts
|
|
18317
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
18318
|
+
import { z as z92 } from "zod";
|
|
18319
|
+
var stepsFileSchema = z92.union([
|
|
18320
|
+
saveClarityProcessSnapshotBodySchema.shape.steps,
|
|
18321
|
+
z92.object({ steps: saveClarityProcessSnapshotBodySchema.shape.steps })
|
|
18322
|
+
]);
|
|
18323
|
+
function registerClaritySaveCurrentProcess(clarity) {
|
|
18324
|
+
clarity.command("save-current-process <process-id>").description("Save edited current-process steps as the live snapshot").requiredOption(
|
|
18325
|
+
"--baseline-snapshot-id <id>",
|
|
18326
|
+
"current-process snapshot the edits are based on"
|
|
18327
|
+
).requiredOption(
|
|
18328
|
+
"--steps-file <path>",
|
|
18329
|
+
"JSON file containing an array of edited steps or an object with a steps array"
|
|
18330
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
18331
|
+
await saveSnapshot({
|
|
18332
|
+
command: this,
|
|
18333
|
+
processId,
|
|
18334
|
+
kind: "current_process",
|
|
18335
|
+
body: {
|
|
18336
|
+
baselineSnapshotId: options.baselineSnapshotId,
|
|
18337
|
+
steps: await readStepsFile(options.stepsFile)
|
|
18338
|
+
},
|
|
18339
|
+
json: options.json === true
|
|
18340
|
+
});
|
|
18341
|
+
}, "action"));
|
|
18342
|
+
}
|
|
18343
|
+
__name(registerClaritySaveCurrentProcess, "registerClaritySaveCurrentProcess");
|
|
18344
|
+
function registerClaritySaveTransformationProposal(clarity) {
|
|
18345
|
+
clarity.command("save-transformation-proposal <process-id>").description(
|
|
18346
|
+
"Save edited transformation-proposal steps as the live snapshot"
|
|
18347
|
+
).requiredOption(
|
|
18348
|
+
"--baseline-snapshot-id <id>",
|
|
18349
|
+
"transformation-proposal snapshot the edits are based on"
|
|
18350
|
+
).requiredOption(
|
|
18351
|
+
"--steps-file <path>",
|
|
18352
|
+
"JSON file containing an array of edited steps or an object with a steps array"
|
|
18353
|
+
).option(
|
|
18354
|
+
"--current-process-id <id>",
|
|
18355
|
+
"current-process snapshot anchor expected by the edited proposal"
|
|
18356
|
+
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
18357
|
+
await saveSnapshot({
|
|
18358
|
+
command: this,
|
|
18359
|
+
processId,
|
|
18360
|
+
kind: "transformation_proposal",
|
|
18361
|
+
body: {
|
|
18362
|
+
baselineSnapshotId: options.baselineSnapshotId,
|
|
18363
|
+
clarityCurrentProcessId: options.currentProcessId,
|
|
18364
|
+
steps: await readStepsFile(options.stepsFile)
|
|
18365
|
+
},
|
|
18366
|
+
json: options.json === true
|
|
18367
|
+
});
|
|
18368
|
+
}, "action"));
|
|
18369
|
+
}
|
|
18370
|
+
__name(registerClaritySaveTransformationProposal, "registerClaritySaveTransformationProposal");
|
|
18371
|
+
async function saveSnapshot(args) {
|
|
18372
|
+
const parsedBody = saveClarityProcessSnapshotBodySchema.safeParse(args.body);
|
|
18373
|
+
if (!parsedBody.success) {
|
|
18374
|
+
throw new CliError(`Invalid snapshot edits: ${parsedBody.error.message}`);
|
|
18375
|
+
}
|
|
18376
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(args.command);
|
|
18377
|
+
const raw = await httpRequest({
|
|
18378
|
+
method: "POST",
|
|
18379
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(args.processId)}/snapshots/${args.kind}/save`,
|
|
18380
|
+
apiKey,
|
|
18381
|
+
apiBaseUrl,
|
|
18382
|
+
body: parsedBody.data
|
|
18383
|
+
});
|
|
18384
|
+
if (args.json) {
|
|
18385
|
+
printJson(raw);
|
|
18386
|
+
return;
|
|
18387
|
+
}
|
|
18388
|
+
const parsed = saveClarityProcessSnapshotResponseSchema.safeParse(raw);
|
|
18389
|
+
if (!parsed.success) {
|
|
18390
|
+
throw new CliError(
|
|
18391
|
+
`Unexpected response from the API: ${parsed.error.message}`
|
|
18392
|
+
);
|
|
18393
|
+
}
|
|
18394
|
+
const { snapshot } = parsed.data;
|
|
18395
|
+
console.log(
|
|
18396
|
+
renderKeyValue([
|
|
18397
|
+
{ label: "ID", value: snapshot.id },
|
|
18398
|
+
{ label: "Kind", value: snapshot.kind },
|
|
18399
|
+
{ label: "Status", value: snapshot.status },
|
|
18400
|
+
{ label: "Creator type", value: snapshot.creator_type },
|
|
18401
|
+
{ label: "Created", value: snapshot.created_at },
|
|
18402
|
+
{ label: "Updated", value: snapshot.updated_at }
|
|
18403
|
+
])
|
|
18404
|
+
);
|
|
18405
|
+
}
|
|
18406
|
+
__name(saveSnapshot, "saveSnapshot");
|
|
18407
|
+
async function readStepsFile(path) {
|
|
18408
|
+
let raw;
|
|
18409
|
+
try {
|
|
18410
|
+
raw = await readFile6(path, "utf8");
|
|
18411
|
+
} catch (error) {
|
|
18412
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
18413
|
+
throw new CliError(`Cannot read "${path}": ${message}`);
|
|
18414
|
+
}
|
|
18415
|
+
let json;
|
|
18416
|
+
try {
|
|
18417
|
+
json = JSON.parse(raw);
|
|
18418
|
+
} catch (error) {
|
|
18419
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
18420
|
+
throw new CliError(`Invalid JSON in "${path}": ${message}`);
|
|
18421
|
+
}
|
|
18422
|
+
const parsed = stepsFileSchema.safeParse(json);
|
|
18423
|
+
if (!parsed.success) {
|
|
18424
|
+
throw new CliError(
|
|
18425
|
+
`Invalid steps file "${path}": expected a step array or an object with a steps array. ${parsed.error.message}`
|
|
18426
|
+
);
|
|
18427
|
+
}
|
|
18428
|
+
return Array.isArray(parsed.data) ? parsed.data : parsed.data.steps;
|
|
18429
|
+
}
|
|
18430
|
+
__name(readStepsFile, "readStepsFile");
|
|
18431
|
+
|
|
18432
|
+
// src/commands/clarity/stop-current-process.ts
|
|
18433
|
+
function registerClarityStopCurrentProcess(clarity) {
|
|
18434
|
+
clarity.command("stop-current-process <process-id>").description("Stop an in-flight current-process generation").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
18435
|
+
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18436
|
+
const raw = await httpRequest({
|
|
18437
|
+
method: "POST",
|
|
18438
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/current_process/stop`,
|
|
18439
|
+
apiKey,
|
|
18440
|
+
apiBaseUrl
|
|
18441
|
+
});
|
|
18442
|
+
if (options.json) {
|
|
18443
|
+
printJson(raw);
|
|
18444
|
+
return;
|
|
18445
|
+
}
|
|
18446
|
+
console.log("Generation stopped.");
|
|
18447
|
+
}, "action"));
|
|
18448
|
+
}
|
|
18449
|
+
__name(registerClarityStopCurrentProcess, "registerClarityStopCurrentProcess");
|
|
18450
|
+
|
|
18129
18451
|
// src/commands/clarity/stop-transformation-proposal.ts
|
|
18130
18452
|
function registerClarityStopTransformationProposal(clarity) {
|
|
18131
18453
|
clarity.command("stop-transformation-proposal <process-id>").description("Stop an in-flight transformation-proposal generation").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
|
|
18132
18454
|
const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
|
|
18133
18455
|
const raw = await httpRequest({
|
|
18134
18456
|
method: "POST",
|
|
18135
|
-
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/
|
|
18457
|
+
path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/snapshots/transformation_proposal/stop`,
|
|
18136
18458
|
apiKey,
|
|
18137
18459
|
apiBaseUrl
|
|
18138
18460
|
});
|
|
@@ -18175,8 +18497,12 @@ function registerClarity(program) {
|
|
|
18175
18497
|
registerClarityListExtraCaptureRequests(clarity);
|
|
18176
18498
|
registerClarityArtifactChatConversations(clarity);
|
|
18177
18499
|
registerClarityArtifactChatMessages(clarity);
|
|
18500
|
+
registerClaritySendArtifactChatMessage(clarity);
|
|
18501
|
+
registerClarityDecideArtifactChatPatch(clarity);
|
|
18178
18502
|
registerClarityGenerateCurrentProcess(clarity);
|
|
18179
18503
|
registerClarityGenerateTransformationProposal(clarity);
|
|
18504
|
+
registerClaritySaveCurrentProcess(clarity);
|
|
18505
|
+
registerClaritySaveTransformationProposal(clarity);
|
|
18180
18506
|
registerClarityPromoteCurrentProcess(clarity);
|
|
18181
18507
|
registerClarityPromoteTransformationProposal(clarity);
|
|
18182
18508
|
registerClarityRevertCurrentProcess(clarity);
|
|
@@ -18184,6 +18510,7 @@ function registerClarity(program) {
|
|
|
18184
18510
|
registerClarityAssignExtraCaptureRequest(clarity);
|
|
18185
18511
|
registerClarityPostprocess(clarity);
|
|
18186
18512
|
registerClarityBuildAutomation(clarity);
|
|
18513
|
+
registerClarityStopCurrentProcess(clarity);
|
|
18187
18514
|
registerClarityStopTransformationProposal(clarity);
|
|
18188
18515
|
registerClarityCreateInviteLink(clarity);
|
|
18189
18516
|
registerClarityImportArtifact(clarity);
|
|
@@ -18978,16 +19305,16 @@ function registerConnectionsList(connections) {
|
|
|
18978
19305
|
__name(registerConnectionsList, "registerConnectionsList");
|
|
18979
19306
|
|
|
18980
19307
|
// src/commands/connections/probe.ts
|
|
18981
|
-
import { z as
|
|
18982
|
-
var toolSchema =
|
|
18983
|
-
name:
|
|
18984
|
-
description:
|
|
18985
|
-
input_schema:
|
|
19308
|
+
import { z as z93 } from "zod";
|
|
19309
|
+
var toolSchema = z93.object({
|
|
19310
|
+
name: z93.string(),
|
|
19311
|
+
description: z93.string().optional(),
|
|
19312
|
+
input_schema: z93.record(z93.string(), z93.unknown()).optional()
|
|
18986
19313
|
});
|
|
18987
|
-
var probeResponseSchema =
|
|
18988
|
-
success:
|
|
18989
|
-
tools:
|
|
18990
|
-
error:
|
|
19314
|
+
var probeResponseSchema = z93.object({
|
|
19315
|
+
success: z93.boolean(),
|
|
19316
|
+
tools: z93.array(toolSchema).optional(),
|
|
19317
|
+
error: z93.string().optional()
|
|
18991
19318
|
});
|
|
18992
19319
|
var DESCRIPTION_MAX_WIDTH = 80;
|
|
18993
19320
|
var TABLE_COLUMNS21 = [
|
|
@@ -19206,48 +19533,48 @@ function registerConnections(program) {
|
|
|
19206
19533
|
__name(registerConnections, "registerConnections");
|
|
19207
19534
|
|
|
19208
19535
|
// src/api/credential-schemas.ts
|
|
19209
|
-
import { z as
|
|
19210
|
-
var dateLike =
|
|
19211
|
-
var secretSchema =
|
|
19212
|
-
id:
|
|
19213
|
-
team_id:
|
|
19214
|
-
user_id:
|
|
19215
|
-
name:
|
|
19216
|
-
service_slug:
|
|
19217
|
-
env_var_keys:
|
|
19218
|
-
created_by:
|
|
19536
|
+
import { z as z94 } from "zod";
|
|
19537
|
+
var dateLike = z94.string();
|
|
19538
|
+
var secretSchema = z94.object({
|
|
19539
|
+
id: z94.string(),
|
|
19540
|
+
team_id: z94.string(),
|
|
19541
|
+
user_id: z94.string().nullable(),
|
|
19542
|
+
name: z94.string(),
|
|
19543
|
+
service_slug: z94.string().nullable(),
|
|
19544
|
+
env_var_keys: z94.array(z94.string()),
|
|
19545
|
+
created_by: z94.string(),
|
|
19219
19546
|
created_at: dateLike,
|
|
19220
19547
|
updated_at: dateLike
|
|
19221
19548
|
});
|
|
19222
|
-
var secretsListResponseSchema =
|
|
19549
|
+
var secretsListResponseSchema = z94.array(secretSchema);
|
|
19223
19550
|
var secretResponseSchema = secretSchema;
|
|
19224
|
-
var browserLoginSchema =
|
|
19225
|
-
id:
|
|
19226
|
-
user_id:
|
|
19227
|
-
team_id:
|
|
19228
|
-
domain:
|
|
19229
|
-
username:
|
|
19551
|
+
var browserLoginSchema = z94.object({
|
|
19552
|
+
id: z94.string(),
|
|
19553
|
+
user_id: z94.string().nullable(),
|
|
19554
|
+
team_id: z94.string(),
|
|
19555
|
+
domain: z94.string(),
|
|
19556
|
+
username: z94.string().nullable(),
|
|
19230
19557
|
password: encryptedDataSchema.nullable(),
|
|
19231
19558
|
otp_secret: encryptedDataSchema.nullable(),
|
|
19232
19559
|
created_at: dateLike,
|
|
19233
19560
|
updated_at: dateLike
|
|
19234
19561
|
});
|
|
19235
|
-
var browserLoginsListResponseSchema =
|
|
19236
|
-
var revisionLoginSummarySchema =
|
|
19237
|
-
id:
|
|
19238
|
-
user_id:
|
|
19239
|
-
team_id:
|
|
19240
|
-
domain:
|
|
19241
|
-
username:
|
|
19562
|
+
var browserLoginsListResponseSchema = z94.array(credentialPreviewSchema);
|
|
19563
|
+
var revisionLoginSummarySchema = z94.object({
|
|
19564
|
+
id: z94.string(),
|
|
19565
|
+
user_id: z94.string().nullable(),
|
|
19566
|
+
team_id: z94.string().nullable(),
|
|
19567
|
+
domain: z94.string(),
|
|
19568
|
+
username: z94.string().nullable(),
|
|
19242
19569
|
created_at: dateLike,
|
|
19243
19570
|
updated_at: dateLike
|
|
19244
19571
|
});
|
|
19245
|
-
var revisionLoginsListResponseSchema =
|
|
19572
|
+
var revisionLoginsListResponseSchema = z94.array(
|
|
19246
19573
|
revisionLoginSummarySchema
|
|
19247
19574
|
);
|
|
19248
|
-
var revisionSecretsListResponseSchema =
|
|
19249
|
-
var successResponseSchema2 =
|
|
19250
|
-
success:
|
|
19575
|
+
var revisionSecretsListResponseSchema = z94.array(secretSchema);
|
|
19576
|
+
var successResponseSchema2 = z94.object({
|
|
19577
|
+
success: z94.boolean()
|
|
19251
19578
|
});
|
|
19252
19579
|
var attachSuccessResponseSchema = successResponseSchema2;
|
|
19253
19580
|
var deleteSecretResponseSchema = successResponseSchema2;
|
|
@@ -22784,91 +23111,91 @@ function registerRevisionSecrets(program) {
|
|
|
22784
23111
|
__name(registerRevisionSecrets, "registerRevisionSecrets");
|
|
22785
23112
|
|
|
22786
23113
|
// src/api/run-schemas.ts
|
|
22787
|
-
import { z as
|
|
22788
|
-
var publicRunSchema =
|
|
22789
|
-
id:
|
|
22790
|
-
agent_id:
|
|
22791
|
-
build_id:
|
|
22792
|
-
status:
|
|
22793
|
-
source:
|
|
22794
|
-
sandbox_id:
|
|
22795
|
-
started_at:
|
|
22796
|
-
completed_at:
|
|
22797
|
-
created_at:
|
|
22798
|
-
updated_at:
|
|
22799
|
-
human_in_the_loop_enabled:
|
|
22800
|
-
});
|
|
22801
|
-
var startRunResponseSchema =
|
|
23114
|
+
import { z as z95 } from "zod";
|
|
23115
|
+
var publicRunSchema = z95.object({
|
|
23116
|
+
id: z95.string(),
|
|
23117
|
+
agent_id: z95.string(),
|
|
23118
|
+
build_id: z95.string(),
|
|
23119
|
+
status: z95.string(),
|
|
23120
|
+
source: z95.string().nullish(),
|
|
23121
|
+
sandbox_id: z95.string().nullish(),
|
|
23122
|
+
started_at: z95.string().nullish(),
|
|
23123
|
+
completed_at: z95.string().nullish(),
|
|
23124
|
+
created_at: z95.string(),
|
|
23125
|
+
updated_at: z95.string().nullish(),
|
|
23126
|
+
human_in_the_loop_enabled: z95.boolean().nullish()
|
|
23127
|
+
});
|
|
23128
|
+
var startRunResponseSchema = z95.object({
|
|
22802
23129
|
run: publicRunSchema
|
|
22803
23130
|
});
|
|
22804
|
-
var questionOptionSchema =
|
|
22805
|
-
label:
|
|
22806
|
-
description:
|
|
22807
|
-
});
|
|
22808
|
-
var questionSchema =
|
|
22809
|
-
question:
|
|
22810
|
-
header:
|
|
22811
|
-
options:
|
|
22812
|
-
multi_select:
|
|
22813
|
-
});
|
|
22814
|
-
var pendingHumanRequestSchema =
|
|
22815
|
-
id:
|
|
22816
|
-
title:
|
|
22817
|
-
description:
|
|
22818
|
-
created_at:
|
|
22819
|
-
type:
|
|
22820
|
-
questions:
|
|
22821
|
-
});
|
|
22822
|
-
var getRunResponseSchema =
|
|
23131
|
+
var questionOptionSchema = z95.object({
|
|
23132
|
+
label: z95.string(),
|
|
23133
|
+
description: z95.string().nullish()
|
|
23134
|
+
});
|
|
23135
|
+
var questionSchema = z95.object({
|
|
23136
|
+
question: z95.string(),
|
|
23137
|
+
header: z95.string().nullish(),
|
|
23138
|
+
options: z95.array(questionOptionSchema).nullish(),
|
|
23139
|
+
multi_select: z95.boolean().nullish()
|
|
23140
|
+
});
|
|
23141
|
+
var pendingHumanRequestSchema = z95.object({
|
|
23142
|
+
id: z95.string(),
|
|
23143
|
+
title: z95.string(),
|
|
23144
|
+
description: z95.string().nullish(),
|
|
23145
|
+
created_at: z95.string(),
|
|
23146
|
+
type: z95.string(),
|
|
23147
|
+
questions: z95.array(questionSchema).nullish()
|
|
23148
|
+
});
|
|
23149
|
+
var getRunResponseSchema = z95.object({
|
|
22823
23150
|
run: publicRunSchema.nullable(),
|
|
22824
23151
|
pending_human_request: pendingHumanRequestSchema.nullish()
|
|
22825
23152
|
});
|
|
22826
|
-
var stopRunResponseSchema =
|
|
22827
|
-
success:
|
|
22828
|
-
message:
|
|
22829
|
-
});
|
|
22830
|
-
var runMessageSchema =
|
|
22831
|
-
id:
|
|
22832
|
-
type:
|
|
22833
|
-
role:
|
|
22834
|
-
timestamp:
|
|
22835
|
-
text_content:
|
|
22836
|
-
tool_call:
|
|
22837
|
-
id:
|
|
22838
|
-
name:
|
|
22839
|
-
arguments:
|
|
23153
|
+
var stopRunResponseSchema = z95.object({
|
|
23154
|
+
success: z95.boolean(),
|
|
23155
|
+
message: z95.string().nullish()
|
|
23156
|
+
});
|
|
23157
|
+
var runMessageSchema = z95.object({
|
|
23158
|
+
id: z95.string(),
|
|
23159
|
+
type: z95.string(),
|
|
23160
|
+
role: z95.string(),
|
|
23161
|
+
timestamp: z95.string(),
|
|
23162
|
+
text_content: z95.string().nullish(),
|
|
23163
|
+
tool_call: z95.object({
|
|
23164
|
+
id: z95.string(),
|
|
23165
|
+
name: z95.string(),
|
|
23166
|
+
arguments: z95.record(z95.string(), z95.unknown()).nullish()
|
|
22840
23167
|
}).nullish(),
|
|
22841
|
-
tool_result:
|
|
22842
|
-
tool_call_id:
|
|
22843
|
-
result:
|
|
22844
|
-
error:
|
|
23168
|
+
tool_result: z95.object({
|
|
23169
|
+
tool_call_id: z95.string(),
|
|
23170
|
+
result: z95.unknown().nullish(),
|
|
23171
|
+
error: z95.string().nullish()
|
|
22845
23172
|
}).nullish()
|
|
22846
23173
|
});
|
|
22847
|
-
var listRunMessagesResponseSchema =
|
|
22848
|
-
messages:
|
|
22849
|
-
total:
|
|
22850
|
-
limit:
|
|
22851
|
-
offset:
|
|
23174
|
+
var listRunMessagesResponseSchema = z95.object({
|
|
23175
|
+
messages: z95.array(runMessageSchema),
|
|
23176
|
+
total: z95.number().nullish(),
|
|
23177
|
+
limit: z95.number().nullish(),
|
|
23178
|
+
offset: z95.number().nullish()
|
|
22852
23179
|
});
|
|
22853
|
-
var postedMessageSchema =
|
|
22854
|
-
id:
|
|
22855
|
-
type:
|
|
22856
|
-
role:
|
|
22857
|
-
timestamp:
|
|
22858
|
-
text_content:
|
|
23180
|
+
var postedMessageSchema = z95.object({
|
|
23181
|
+
id: z95.string(),
|
|
23182
|
+
type: z95.string(),
|
|
23183
|
+
role: z95.string(),
|
|
23184
|
+
timestamp: z95.string(),
|
|
23185
|
+
text_content: z95.string()
|
|
22859
23186
|
});
|
|
22860
|
-
var postRunMessageResponseSchema =
|
|
23187
|
+
var postRunMessageResponseSchema = z95.object({
|
|
22861
23188
|
message: postedMessageSchema
|
|
22862
23189
|
});
|
|
22863
|
-
var respondHumanRequestResponseSchema =
|
|
22864
|
-
human_request:
|
|
22865
|
-
id:
|
|
22866
|
-
run_id:
|
|
22867
|
-
title:
|
|
22868
|
-
description:
|
|
22869
|
-
response:
|
|
22870
|
-
responded_at:
|
|
22871
|
-
created_at:
|
|
23190
|
+
var respondHumanRequestResponseSchema = z95.object({
|
|
23191
|
+
human_request: z95.object({
|
|
23192
|
+
id: z95.string(),
|
|
23193
|
+
run_id: z95.string(),
|
|
23194
|
+
title: z95.string(),
|
|
23195
|
+
description: z95.string().nullish(),
|
|
23196
|
+
response: z95.string().nullish(),
|
|
23197
|
+
responded_at: z95.string().nullish(),
|
|
23198
|
+
created_at: z95.string()
|
|
22872
23199
|
})
|
|
22873
23200
|
});
|
|
22874
23201
|
|
|
@@ -23304,11 +23631,11 @@ function registerRunsMessages(runs) {
|
|
|
23304
23631
|
__name(registerRunsMessages, "registerRunsMessages");
|
|
23305
23632
|
|
|
23306
23633
|
// src/commands/runs/respond.ts
|
|
23307
|
-
function
|
|
23634
|
+
function collectAnswer2(value, previous = []) {
|
|
23308
23635
|
return [...previous, value];
|
|
23309
23636
|
}
|
|
23310
|
-
__name(
|
|
23311
|
-
function
|
|
23637
|
+
__name(collectAnswer2, "collectAnswer");
|
|
23638
|
+
function parseAnswers2(raw) {
|
|
23312
23639
|
const answers = /* @__PURE__ */ Object.create(null);
|
|
23313
23640
|
for (const entry of raw) {
|
|
23314
23641
|
const eq = entry.indexOf("=");
|
|
@@ -23328,7 +23655,7 @@ function parseAnswers(raw) {
|
|
|
23328
23655
|
}
|
|
23329
23656
|
return answers;
|
|
23330
23657
|
}
|
|
23331
|
-
__name(
|
|
23658
|
+
__name(parseAnswers2, "parseAnswers");
|
|
23332
23659
|
function buildBody5(options) {
|
|
23333
23660
|
const approveSet = options.approve === true;
|
|
23334
23661
|
const denySet = options.deny === true;
|
|
@@ -23348,7 +23675,7 @@ function buildBody5(options) {
|
|
|
23348
23675
|
return { approved: false };
|
|
23349
23676
|
}
|
|
23350
23677
|
if (answers.length > 0) {
|
|
23351
|
-
return { answers:
|
|
23678
|
+
return { answers: parseAnswers2(answers) };
|
|
23352
23679
|
}
|
|
23353
23680
|
throw new CliError(
|
|
23354
23681
|
"Provide --approve, --deny, or at least one --answer question=answer."
|
|
@@ -23383,7 +23710,7 @@ function registerRunsRespond(runs) {
|
|
|
23383
23710
|
).option("--approve", "approve an approval-type request").option("--deny", "deny an approval-type request").option(
|
|
23384
23711
|
"--answer <question=answer>",
|
|
23385
23712
|
"answer a question-type request (repeatable)",
|
|
23386
|
-
|
|
23713
|
+
collectAnswer2,
|
|
23387
23714
|
[]
|
|
23388
23715
|
).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function respondAction(runId, requestIdArg, options) {
|
|
23389
23716
|
const body = buildBody5(options);
|
|
@@ -23563,28 +23890,28 @@ function registerRuns(program) {
|
|
|
23563
23890
|
__name(registerRuns, "registerRuns");
|
|
23564
23891
|
|
|
23565
23892
|
// src/api/sandbox-schemas.ts
|
|
23566
|
-
import { z as
|
|
23567
|
-
var createSandboxResponseSchema =
|
|
23568
|
-
sandbox_id:
|
|
23569
|
-
expires_at:
|
|
23893
|
+
import { z as z96 } from "zod";
|
|
23894
|
+
var createSandboxResponseSchema = z96.object({
|
|
23895
|
+
sandbox_id: z96.string(),
|
|
23896
|
+
expires_at: z96.string()
|
|
23570
23897
|
});
|
|
23571
|
-
var createSandboxUploadUrlResponseSchema =
|
|
23572
|
-
upload_url:
|
|
23573
|
-
path:
|
|
23574
|
-
expires_in_seconds:
|
|
23898
|
+
var createSandboxUploadUrlResponseSchema = z96.object({
|
|
23899
|
+
upload_url: z96.string(),
|
|
23900
|
+
path: z96.string(),
|
|
23901
|
+
expires_in_seconds: z96.number()
|
|
23575
23902
|
});
|
|
23576
|
-
var sandboxFileSchema =
|
|
23577
|
-
name:
|
|
23578
|
-
path:
|
|
23579
|
-
type:
|
|
23580
|
-
size_bytes:
|
|
23903
|
+
var sandboxFileSchema = z96.object({
|
|
23904
|
+
name: z96.string(),
|
|
23905
|
+
path: z96.string(),
|
|
23906
|
+
type: z96.enum(["file", "dir"]),
|
|
23907
|
+
size_bytes: z96.number()
|
|
23581
23908
|
});
|
|
23582
|
-
var listSandboxFilesResponseSchema =
|
|
23583
|
-
files:
|
|
23909
|
+
var listSandboxFilesResponseSchema = z96.object({
|
|
23910
|
+
files: z96.array(sandboxFileSchema)
|
|
23584
23911
|
});
|
|
23585
|
-
var uploadSandboxFileResponseSchema =
|
|
23586
|
-
path:
|
|
23587
|
-
size_bytes:
|
|
23912
|
+
var uploadSandboxFileResponseSchema = z96.object({
|
|
23913
|
+
path: z96.string(),
|
|
23914
|
+
size_bytes: z96.number()
|
|
23588
23915
|
});
|
|
23589
23916
|
var DEFAULT_SANDBOX_FILES_PATH = "/workspace";
|
|
23590
23917
|
|
|
@@ -23712,7 +24039,7 @@ function registerSandboxesPrepareUploadUrl(sandboxes) {
|
|
|
23712
24039
|
__name(registerSandboxesPrepareUploadUrl, "registerSandboxesPrepareUploadUrl");
|
|
23713
24040
|
|
|
23714
24041
|
// src/commands/sandboxes/upload.ts
|
|
23715
|
-
import { readFile as
|
|
24042
|
+
import { readFile as readFile7, stat } from "node:fs/promises";
|
|
23716
24043
|
import { basename as basename2 } from "node:path";
|
|
23717
24044
|
var MAX_DIRECT_UPLOAD_BYTES = 10 * 1024 * 1024;
|
|
23718
24045
|
function registerSandboxesUpload(sandboxes) {
|
|
@@ -23739,7 +24066,7 @@ function registerSandboxesUpload(sandboxes) {
|
|
|
23739
24066
|
`File "${file}" is ${stats.size} bytes, larger than the ${MAX_DIRECT_UPLOAD_BYTES}-byte direct-upload limit. Use \`duvo sandboxes prepare-upload-url\` for larger files.`
|
|
23740
24067
|
);
|
|
23741
24068
|
}
|
|
23742
|
-
const content = await
|
|
24069
|
+
const content = await readFile7(file).catch((error) => {
|
|
23743
24070
|
const message = error instanceof Error ? error.message : String(error);
|
|
23744
24071
|
throw new CliError(`Could not read file "${file}": ${message}`);
|
|
23745
24072
|
});
|
|
@@ -24195,13 +24522,13 @@ __name(registerSkillsAssignments, "registerSkillsAssignments");
|
|
|
24195
24522
|
|
|
24196
24523
|
// src/commands/skills/create.ts
|
|
24197
24524
|
import { readFileSync as readFileSync5 } from "node:fs";
|
|
24198
|
-
import { z as
|
|
24199
|
-
var createSkillResponseSchema =
|
|
24200
|
-
skill:
|
|
24201
|
-
id:
|
|
24202
|
-
name:
|
|
24203
|
-
description:
|
|
24204
|
-
team_id:
|
|
24525
|
+
import { z as z97 } from "zod";
|
|
24526
|
+
var createSkillResponseSchema = z97.object({
|
|
24527
|
+
skill: z97.object({
|
|
24528
|
+
id: z97.string(),
|
|
24529
|
+
name: z97.string(),
|
|
24530
|
+
description: z97.string(),
|
|
24531
|
+
team_id: z97.string()
|
|
24205
24532
|
})
|
|
24206
24533
|
});
|
|
24207
24534
|
function registerSkillsCreate(skills) {
|
|
@@ -24565,13 +24892,13 @@ function readExistingContent(source) {
|
|
|
24565
24892
|
__name(readExistingContent, "readExistingContent");
|
|
24566
24893
|
|
|
24567
24894
|
// src/commands/skills/install.ts
|
|
24568
|
-
import { z as
|
|
24569
|
-
var installSkillResponseSchema =
|
|
24570
|
-
skill:
|
|
24571
|
-
id:
|
|
24572
|
-
name:
|
|
24573
|
-
description:
|
|
24574
|
-
team_id:
|
|
24895
|
+
import { z as z98 } from "zod";
|
|
24896
|
+
var installSkillResponseSchema = z98.object({
|
|
24897
|
+
skill: z98.object({
|
|
24898
|
+
id: z98.string(),
|
|
24899
|
+
name: z98.string(),
|
|
24900
|
+
description: z98.string(),
|
|
24901
|
+
team_id: z98.string()
|
|
24575
24902
|
})
|
|
24576
24903
|
});
|
|
24577
24904
|
function registerSkillsInstall(skills) {
|
|
@@ -24759,15 +25086,15 @@ function registerSkillsSystem(skills) {
|
|
|
24759
25086
|
__name(registerSkillsSystem, "registerSkillsSystem");
|
|
24760
25087
|
|
|
24761
25088
|
// src/commands/skills/upload.ts
|
|
24762
|
-
import { readFile as
|
|
25089
|
+
import { readFile as readFile8, stat as stat2 } from "node:fs/promises";
|
|
24763
25090
|
import { basename as basename3 } from "node:path";
|
|
24764
|
-
import { z as
|
|
24765
|
-
var uploadSkillResponseSchema =
|
|
24766
|
-
skill:
|
|
24767
|
-
id:
|
|
24768
|
-
name:
|
|
24769
|
-
description:
|
|
24770
|
-
team_id:
|
|
25091
|
+
import { z as z99 } from "zod";
|
|
25092
|
+
var uploadSkillResponseSchema = z99.object({
|
|
25093
|
+
skill: z99.object({
|
|
25094
|
+
id: z99.string(),
|
|
25095
|
+
name: z99.string(),
|
|
25096
|
+
description: z99.string(),
|
|
25097
|
+
team_id: z99.string()
|
|
24771
25098
|
})
|
|
24772
25099
|
});
|
|
24773
25100
|
function registerSkillsUpload(skills) {
|
|
@@ -24781,7 +25108,7 @@ function registerSkillsUpload(skills) {
|
|
|
24781
25108
|
if (!fileStats.isFile()) {
|
|
24782
25109
|
throw new CliError(`Could not read file "${file}": not a regular file`);
|
|
24783
25110
|
}
|
|
24784
|
-
const content = await
|
|
25111
|
+
const content = await readFile8(file).catch((error) => {
|
|
24785
25112
|
const message = error instanceof Error ? error.message : String(error);
|
|
24786
25113
|
throw new CliError(`Could not read file "${file}": ${message}`);
|
|
24787
25114
|
});
|
|
@@ -25141,11 +25468,11 @@ function registerTeamMembers(team) {
|
|
|
25141
25468
|
__name(registerTeamMembers, "registerTeamMembers");
|
|
25142
25469
|
|
|
25143
25470
|
// src/commands/team/use.ts
|
|
25144
|
-
import { z as
|
|
25471
|
+
import { z as z100 } from "zod";
|
|
25145
25472
|
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;
|
|
25146
|
-
var teamIdSchema =
|
|
25147
|
-
var listMyTeamsResponseSchema3 =
|
|
25148
|
-
teams:
|
|
25473
|
+
var teamIdSchema = z100.string().regex(TEAM_ID_SHAPE);
|
|
25474
|
+
var listMyTeamsResponseSchema3 = z100.object({
|
|
25475
|
+
teams: z100.array(z100.object({ id: z100.string() }))
|
|
25149
25476
|
});
|
|
25150
25477
|
function registerTeamUse(team) {
|
|
25151
25478
|
team.command("use <team-id>").description(
|
|
@@ -25227,14 +25554,14 @@ function registerTeam(program) {
|
|
|
25227
25554
|
__name(registerTeam, "registerTeam");
|
|
25228
25555
|
|
|
25229
25556
|
// src/commands/teams/list.ts
|
|
25230
|
-
import { z as
|
|
25231
|
-
var teamApiSchema2 =
|
|
25232
|
-
id:
|
|
25233
|
-
name:
|
|
25234
|
-
organization_id:
|
|
25557
|
+
import { z as z101 } from "zod";
|
|
25558
|
+
var teamApiSchema2 = z101.object({
|
|
25559
|
+
id: z101.string(),
|
|
25560
|
+
name: z101.string(),
|
|
25561
|
+
organization_id: z101.string().nullable()
|
|
25235
25562
|
});
|
|
25236
|
-
var listMyTeamsResponseSchema4 =
|
|
25237
|
-
teams:
|
|
25563
|
+
var listMyTeamsResponseSchema4 = z101.object({
|
|
25564
|
+
teams: z101.array(teamApiSchema2)
|
|
25238
25565
|
});
|
|
25239
25566
|
function registerTeamsList(program) {
|
|
25240
25567
|
const teams = program.command("teams").description("Inspect the teams your credentials can act on");
|
|
@@ -25330,7 +25657,7 @@ __name(resolveActiveTeamId, "resolveActiveTeamId");
|
|
|
25330
25657
|
var version = resolveVersion();
|
|
25331
25658
|
function resolveVersion() {
|
|
25332
25659
|
if (true) {
|
|
25333
|
-
return "1.
|
|
25660
|
+
return "1.7.1";
|
|
25334
25661
|
}
|
|
25335
25662
|
const packageJsonPath = join3(
|
|
25336
25663
|
dirname3(fileURLToPath2(import.meta.url)),
|
|
@@ -25413,7 +25740,7 @@ function checkForUpdate() {
|
|
|
25413
25740
|
__name(checkForUpdate, "checkForUpdate");
|
|
25414
25741
|
function loadPackageMeta() {
|
|
25415
25742
|
if (true) {
|
|
25416
|
-
return { name: "@duvoai/cli", version: "1.
|
|
25743
|
+
return { name: "@duvoai/cli", version: "1.7.1" };
|
|
25417
25744
|
}
|
|
25418
25745
|
const require2 = createRequire(import.meta.url);
|
|
25419
25746
|
const raw = require2("../package.json");
|