@duvoai/cli 1.2.0 → 1.4.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 CHANGED
@@ -99,6 +99,7 @@ import { z as z61 } from "zod";
99
99
  import { z as z62 } from "zod";
100
100
  import { z as z63 } from "zod";
101
101
  import { z as z64 } from "zod";
102
+ import { z as z65 } from "zod";
102
103
 
103
104
  // ../node_modules/.pnpm/jsonrepair@3.13.2/node_modules/jsonrepair/lib/esm/utils/JSONRepairError.js
104
105
  var JSONRepairError = class extends Error {
@@ -863,7 +864,7 @@ var PLAN_VERSIONS = {
863
864
  maxAgents: "unlimited",
864
865
  maxAgentRunsPerMonth: 500,
865
866
  runCountingMode: "monthly",
866
- maxConcurrentRuns: 1,
867
+ maxConcurrentRuns: 20,
867
868
  features: [
868
869
  PLAN_FEATURE.BROWSER_AUTOMATION,
869
870
  PLAN_FEATURE.ADVANCED_INTEGRATIONS,
@@ -1659,7 +1660,8 @@ var evalSummarySchema = z8.object({
1659
1660
  });
1660
1661
  var evalFlagCountSchema = z8.object({
1661
1662
  flag: z8.string(),
1662
- count: z8.int()
1663
+ count: z8.int(),
1664
+ label: z8.string().nullable().optional()
1663
1665
  });
1664
1666
  var evalScoresResponseSchema = z8.object({
1665
1667
  total_evaluated: z8.int(),
@@ -1674,7 +1676,9 @@ var evalCountsByAgentResponseSchema = z8.object({
1674
1676
  by_agent: z8.record(z8.string(), evalCountsSchema)
1675
1677
  });
1676
1678
  var summarizeEvalScoresBodySchema = z8.object({
1677
- since: z8.iso.datetime()
1679
+ since: z8.iso.datetime(),
1680
+ /** `"custom"` restricts to live-build runs + `custom__*` flags only. */
1681
+ scope: z8.enum(["all", "custom"]).optional()
1678
1682
  });
1679
1683
  var summarizeEvalScoresResponseSchema = z8.object({
1680
1684
  data: z8.object({
@@ -1714,6 +1718,7 @@ var AGENT_RUN_SOURCES = [
1714
1718
  "handover",
1715
1719
  "postpone",
1716
1720
  "delegate",
1721
+ "reprocess",
1717
1722
  "trigger"
1718
1723
  ];
1719
1724
  var agentRunSourceSchema = z9.enum(AGENT_RUN_SOURCES);
@@ -1746,6 +1751,7 @@ var SOURCE_TO_INITIATOR = {
1746
1751
  handover: "handover",
1747
1752
  postpone: "case-queue",
1748
1753
  delegate: "case-queue",
1754
+ reprocess: "case-queue",
1749
1755
  trigger: "trigger"
1750
1756
  };
1751
1757
  function mapSourceToInitiator(source) {
@@ -1965,6 +1971,31 @@ var ClaudeModelIdSchema = z11.enum([
1965
1971
  ...CLAUDE_MODEL_IDS,
1966
1972
  ...LEGACY_MODEL_IDS
1967
1973
  ]);
1974
+ var AVAILABLE_AGENT_MODELS = {
1975
+ "claude-sonnet-4-6": {
1976
+ displayName: "Claude Sonnet 4.6"
1977
+ },
1978
+ "claude-sonnet-4-6[1m]": {
1979
+ displayName: "Claude Sonnet 4.6",
1980
+ description: "Fast and capable for everyday tasks"
1981
+ },
1982
+ "claude-opus-4-6": {
1983
+ displayName: "Claude Opus 4.6",
1984
+ description: "Advanced model for complex work"
1985
+ },
1986
+ "claude-opus-4-6[1m]": {
1987
+ displayName: "Claude Opus 4.6",
1988
+ description: "Advanced model for complex work"
1989
+ },
1990
+ "claude-opus-4-7": {
1991
+ displayName: "Claude Opus 4.7",
1992
+ description: "Our most capable model \u2014 best for complex work"
1993
+ },
1994
+ "claude-opus-4-7[1m]": {
1995
+ displayName: "Claude Opus 4.7",
1996
+ description: "Our most capable model \u2014 best for complex work"
1997
+ }
1998
+ };
1968
1999
  var BrowsingModelIdSchema = z11.enum([
1969
2000
  "gemini-2.5-pro",
1970
2001
  "gemini-2.5-flash",
@@ -2019,24 +2050,6 @@ var BUILD_STATUS = {
2019
2050
  LIVE: "live",
2020
2051
  HISTORIC: "historic"
2021
2052
  };
2022
- var CASE_QUEUE_ITEM_STATUS = {
2023
- PENDING: "pending",
2024
- CLAIMED: "claimed",
2025
- COMPLETED: "completed",
2026
- FAILED: "failed"
2027
- };
2028
- var RETRYABLE_CASE_STATUSES = [
2029
- CASE_QUEUE_ITEM_STATUS.COMPLETED,
2030
- CASE_QUEUE_ITEM_STATUS.FAILED,
2031
- CASE_QUEUE_ITEM_STATUS.CLAIMED
2032
- ];
2033
- function isRetryableCaseStatus(status) {
2034
- return RETRYABLE_CASE_STATUSES.includes(
2035
- status
2036
- );
2037
- }
2038
- __name(isRetryableCaseStatus, "isRetryableCaseStatus");
2039
- __name2(isRetryableCaseStatus, "isRetryableCaseStatus");
2040
2053
  var ALL_EVALUATION_RUBRIC_SEVERITIES = [
2041
2054
  "critical",
2042
2055
  "medium",
@@ -2314,6 +2327,7 @@ var ALL_EVALUATION_RUBRIC_KEYS = Object.keys(
2314
2327
  var PLATFORM_DEFAULT_EVAL_RUBRIC_KEYS = ALL_EVALUATION_RUBRIC_KEYS.filter(
2315
2328
  (k) => EVALUATION_RUBRIC_CATALOG[k].is_default
2316
2329
  );
2330
+ var EVALUATION_FINAL_COMMENT_KEY = "final_comment";
2317
2331
  var EVALUATION_SEVERITY_KEY_SUFFIX = "_severity";
2318
2332
  var EVALUATION_REASON_KEY_SUFFIX = "_reason";
2319
2333
  function getRubricSeverityKey(key) {
@@ -2336,6 +2350,23 @@ function isEvaluationRubricKey(value) {
2336
2350
  }
2337
2351
  __name(isEvaluationRubricKey, "isEvaluationRubricKey");
2338
2352
  __name2(isEvaluationRubricKey, "isEvaluationRubricKey");
2353
+ var CUSTOM_RUBRIC_KEY_PREFIX = "custom__";
2354
+ function isCustomRubricKey(key) {
2355
+ return key.startsWith(CUSTOM_RUBRIC_KEY_PREFIX);
2356
+ }
2357
+ __name(isCustomRubricKey, "isCustomRubricKey");
2358
+ __name2(isCustomRubricKey, "isCustomRubricKey");
2359
+ function isFailingFlag(key, value) {
2360
+ if (key === EVALUATION_FINAL_COMMENT_KEY) {
2361
+ return false;
2362
+ }
2363
+ if (typeof value !== "boolean") {
2364
+ return false;
2365
+ }
2366
+ return isCustomRubricKey(key) ? !value : value;
2367
+ }
2368
+ __name(isFailingFlag, "isFailingFlag");
2369
+ __name2(isFailingFlag, "isFailingFlag");
2339
2370
  var EVALUATION_RUBRIC_KEYS_BY_CAUSE = (() => {
2340
2371
  const mutable = {
2341
2372
  sop_gap: [],
@@ -2639,12 +2670,17 @@ var clarityProcessVersionSchema = z12.union([
2639
2670
  z12.literal(1),
2640
2671
  z12.literal(2)
2641
2672
  ]);
2673
+ var CLARITY_PROCESS_VISIBILITIES = ["team", "restricted"];
2674
+ var clarityProcessVisibilitySchema = z12.enum(
2675
+ CLARITY_PROCESS_VISIBILITIES
2676
+ );
2642
2677
  var clarityProcessSchema = z12.object({
2643
2678
  id: z12.guid(),
2644
2679
  teamId: z12.guid(),
2645
2680
  userId: z12.guid(),
2646
2681
  name: z12.string(),
2647
2682
  status: clarityProcessStatusSchema,
2683
+ visibility: clarityProcessVisibilitySchema,
2648
2684
  /** 1 = legacy, 2 = v2. */
2649
2685
  version: z12.number().int(),
2650
2686
  analysis: clarityAnalysisResponseSchema.nullable(),
@@ -2659,6 +2695,7 @@ var clarityProcessListItemSchema = z12.object({
2659
2695
  teamName: z12.string().optional(),
2660
2696
  name: z12.string(),
2661
2697
  status: clarityProcessStatusSchema,
2698
+ visibility: clarityProcessVisibilitySchema,
2662
2699
  version: z12.number().int(),
2663
2700
  captureCount: z12.number(),
2664
2701
  captureCounts: z12.object({
@@ -2732,7 +2769,8 @@ var createClarityProcessResponseSchema = z12.object({
2732
2769
  });
2733
2770
  var updateClarityProcessSchema = z12.object({
2734
2771
  name: z12.string().min(1).max(255).optional(),
2735
- customPrompt: z12.string().max(5e3).nullable().optional()
2772
+ customPrompt: z12.string().max(5e3).nullable().optional(),
2773
+ visibility: clarityProcessVisibilitySchema.optional()
2736
2774
  });
2737
2775
  var INTERVIEW_LANGUAGES = [
2738
2776
  "en",
@@ -3176,6 +3214,66 @@ function refineStepGraph(steps, ctx) {
3176
3214
  }
3177
3215
  __name(refineStepGraph, "refineStepGraph");
3178
3216
  __name2(refineStepGraph, "refineStepGraph");
3217
+ var STRING_ARRAY_FIELDS = ["assumptions", "openQuestions"];
3218
+ var NULLABLE_STRING_FIELDS = [
3219
+ "action",
3220
+ "role",
3221
+ "system",
3222
+ "input",
3223
+ "output",
3224
+ "condition",
3225
+ "exception",
3226
+ "handling"
3227
+ ];
3228
+ function isPlainObject(value) {
3229
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3230
+ }
3231
+ __name(isPlainObject, "isPlainObject");
3232
+ __name2(isPlainObject, "isPlainObject");
3233
+ function coerceStringArrayField(value) {
3234
+ if (Array.isArray(value)) {
3235
+ return value;
3236
+ }
3237
+ if (typeof value === "string") {
3238
+ const trimmed = value.trim();
3239
+ return trimmed.length === 0 ? null : [trimmed];
3240
+ }
3241
+ return value;
3242
+ }
3243
+ __name(coerceStringArrayField, "coerceStringArrayField");
3244
+ __name2(coerceStringArrayField, "coerceStringArrayField");
3245
+ function coerceNullableStringField(value) {
3246
+ if (typeof value === "string" && value.trim().length === 0) {
3247
+ return null;
3248
+ }
3249
+ return value;
3250
+ }
3251
+ __name(coerceNullableStringField, "coerceNullableStringField");
3252
+ __name2(coerceNullableStringField, "coerceNullableStringField");
3253
+ function coerceStepOutput(step) {
3254
+ if (!isPlainObject(step)) {
3255
+ return step;
3256
+ }
3257
+ const next = { ...step };
3258
+ for (const field of STRING_ARRAY_FIELDS) {
3259
+ if (field in next) {
3260
+ next[field] = coerceStringArrayField(next[field]);
3261
+ }
3262
+ }
3263
+ for (const field of NULLABLE_STRING_FIELDS) {
3264
+ if (field in next) {
3265
+ next[field] = coerceNullableStringField(next[field]);
3266
+ }
3267
+ }
3268
+ return next;
3269
+ }
3270
+ __name(coerceStepOutput, "coerceStepOutput");
3271
+ __name2(coerceStepOutput, "coerceStepOutput");
3272
+ function coerceStepsOutput(steps) {
3273
+ return steps.map(coerceStepOutput);
3274
+ }
3275
+ __name(coerceStepsOutput, "coerceStepsOutput");
3276
+ __name2(coerceStepsOutput, "coerceStepsOutput");
3179
3277
  var stepSourceSchema = z14.object({
3180
3278
  attribution: z14.string().min(1).describe(
3181
3279
  'Human-readable source label identifying who or what the evidence comes from. Examples: "Anna (sales interview)", "Onboarding SOP \xA73.2", "Slack #ops 2024-06-12"'
@@ -3425,6 +3523,9 @@ var clarityV2ProcessReadModelSchema = z15.object({
3425
3523
  user_id: z15.guid().describe("Creator user id"),
3426
3524
  name: z15.string().describe("Process name"),
3427
3525
  status: clarityProcessStatusSchema.describe("Lifecycle status"),
3526
+ visibility: clarityProcessVisibilitySchema.describe(
3527
+ "Process visibility. 'team' is workspace-visible to full members; 'restricted' is visible to the creator, org admins, workspace managers/admins, and accepted grant holders."
3528
+ ),
3428
3529
  version: z15.number().int().describe("Schema version (always 2 here)"),
3429
3530
  generation_error: z15.string().nullable().describe("Error message from the most recent failed generation, if any"),
3430
3531
  generation_progress: generationProgressSchema.nullable().describe(
@@ -3575,6 +3676,31 @@ function getClarityProcessRoomName(processId) {
3575
3676
  }
3576
3677
  __name(getClarityProcessRoomName, "getClarityProcessRoomName");
3577
3678
  __name2(getClarityProcessRoomName, "getClarityProcessRoomName");
3679
+ var clarityExportStatusSchema = z17.enum([
3680
+ "queued",
3681
+ "running",
3682
+ "succeeded",
3683
+ "failed"
3684
+ ]);
3685
+ var clarityExportResultSchema = z17.object({
3686
+ diagramId: z17.string().optional(),
3687
+ diagramName: z17.string().optional(),
3688
+ folderId: z17.string().optional()
3689
+ });
3690
+ var clarityExportBaseSchema = z17.object({
3691
+ processId: z17.guid(),
3692
+ exportRunId: z17.guid()
3693
+ });
3694
+ var clarityExportProgressEventDataSchema = clarityExportBaseSchema.extend({
3695
+ status: clarityExportStatusSchema,
3696
+ label: z17.string().optional()
3697
+ });
3698
+ var clarityExportCompletedEventDataSchema = clarityExportBaseSchema.extend({
3699
+ result: clarityExportResultSchema
3700
+ });
3701
+ var clarityExportFailedEventDataSchema = clarityExportBaseSchema.extend({
3702
+ error: z17.string()
3703
+ });
3578
3704
  var clarityProcessChatConversationStatusSchema = z18.enum([
3579
3705
  "open",
3580
3706
  "running",
@@ -3712,6 +3838,151 @@ var artifactChatMessageUpsertEventDataSchema = z18.object({
3712
3838
  conversation: clarityProcessChatConversationSchema,
3713
3839
  message: clarityProcessChatMessageSchema
3714
3840
  });
3841
+ function isJsonObject(value) {
3842
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3843
+ }
3844
+ __name(isJsonObject, "isJsonObject");
3845
+ __name2(isJsonObject, "isJsonObject");
3846
+ function clarityStepsToEaseDocument(steps) {
3847
+ const stepOrder = steps.map((step) => step.id);
3848
+ const stepsById = Object.fromEntries(
3849
+ steps.map((step) => {
3850
+ const {
3851
+ id,
3852
+ readiness: _readiness,
3853
+ readinessRationale: _readinessRationale,
3854
+ extraCaptureNeeded: _extraCaptureNeeded,
3855
+ ...baseStep
3856
+ } = step;
3857
+ return [id, baseStep];
3858
+ })
3859
+ );
3860
+ return { stepOrder, stepsById };
3861
+ }
3862
+ __name(clarityStepsToEaseDocument, "clarityStepsToEaseDocument");
3863
+ __name2(clarityStepsToEaseDocument, "clarityStepsToEaseDocument");
3864
+ function assertEaseDocument(value) {
3865
+ if (!isJsonObject(value)) {
3866
+ throw new Error("EASE document must be an object");
3867
+ }
3868
+ if (!Array.isArray(value.stepOrder)) {
3869
+ throw new Error("EASE document stepOrder must be an array");
3870
+ }
3871
+ if (!isJsonObject(value.stepsById)) {
3872
+ throw new Error("EASE document stepsById must be an object");
3873
+ }
3874
+ const stepOrder = value.stepOrder.map((stepId, index) => {
3875
+ if (typeof stepId !== "string" || stepId.length === 0) {
3876
+ throw new Error(`stepOrder[${index}] must be a non-empty string`);
3877
+ }
3878
+ return stepId;
3879
+ });
3880
+ const duplicateStepIds = stepOrder.filter(
3881
+ (stepId, index) => stepOrder.indexOf(stepId) !== index
3882
+ );
3883
+ if (duplicateStepIds.length > 0) {
3884
+ throw new Error(`stepOrder contains duplicate id "${duplicateStepIds[0]}"`);
3885
+ }
3886
+ const stepOrderSet = new Set(stepOrder);
3887
+ const stepEntries = Object.entries(value.stepsById).map(([stepId, step]) => {
3888
+ if (!stepOrderSet.has(stepId)) {
3889
+ throw new Error(`stepsById contains "${stepId}" but stepOrder does not`);
3890
+ }
3891
+ if (!isJsonObject(step)) {
3892
+ throw new Error(`stepsById.${stepId} must be an object`);
3893
+ }
3894
+ if ("id" in step) {
3895
+ throw new Error(`stepsById.${stepId} must not contain an id field`);
3896
+ }
3897
+ const targetSteps = step.targetSteps;
3898
+ if (!Array.isArray(targetSteps)) {
3899
+ throw new Error(`stepsById.${stepId}.targetSteps must be an array`);
3900
+ }
3901
+ targetSteps.forEach((edge, edgeIndex) => {
3902
+ if (!isJsonObject(edge)) {
3903
+ throw new Error(
3904
+ `stepsById.${stepId}.targetSteps[${edgeIndex}] must be an object`
3905
+ );
3906
+ }
3907
+ if (typeof edge.stepId !== "string" || !stepOrderSet.has(edge.stepId)) {
3908
+ throw new Error(
3909
+ `stepsById.${stepId}.targetSteps[${edgeIndex}].stepId "${String(edge.stepId)}" does not match any step id`
3910
+ );
3911
+ }
3912
+ });
3913
+ return [stepId, step];
3914
+ });
3915
+ for (const stepId of stepOrder) {
3916
+ if (!(stepId in value.stepsById)) {
3917
+ throw new Error(`stepOrder contains "${stepId}" but stepsById does not`);
3918
+ }
3919
+ }
3920
+ return {
3921
+ stepOrder,
3922
+ stepsById: Object.fromEntries(stepEntries)
3923
+ };
3924
+ }
3925
+ __name(assertEaseDocument, "assertEaseDocument");
3926
+ __name2(assertEaseDocument, "assertEaseDocument");
3927
+ function materializeEaseDocument(easeDocument) {
3928
+ const ease = assertEaseDocument(easeDocument);
3929
+ return {
3930
+ steps: ease.stepOrder.map((stepId) => ({
3931
+ id: stepId,
3932
+ ...ease.stepsById[stepId]
3933
+ }))
3934
+ };
3935
+ }
3936
+ __name(materializeEaseDocument, "materializeEaseDocument");
3937
+ __name2(materializeEaseDocument, "materializeEaseDocument");
3938
+ function mergeCurrentProcessPostprocessSlices(previous, steps) {
3939
+ return { ...previous, steps: mergeSteps(previous.steps, steps) };
3940
+ }
3941
+ __name(mergeCurrentProcessPostprocessSlices, "mergeCurrentProcessPostprocessSlices");
3942
+ __name2(mergeCurrentProcessPostprocessSlices, "mergeCurrentProcessPostprocessSlices");
3943
+ function mergeTransformationProposalPostprocessSlices(previous, steps) {
3944
+ return { ...previous, steps: mergeSteps(previous.steps, steps) };
3945
+ }
3946
+ __name(mergeTransformationProposalPostprocessSlices, "mergeTransformationProposalPostprocessSlices");
3947
+ __name2(mergeTransformationProposalPostprocessSlices, "mergeTransformationProposalPostprocessSlices");
3948
+ function createBaseCurrentProcessData(previous, steps) {
3949
+ return postprocessClarityCurrentProcessDataSchema.parse({
3950
+ version: previous.version,
3951
+ steps: steps.map((step) => clarityStepBaseSchema.parse(step))
3952
+ });
3953
+ }
3954
+ __name(createBaseCurrentProcessData, "createBaseCurrentProcessData");
3955
+ __name2(createBaseCurrentProcessData, "createBaseCurrentProcessData");
3956
+ function createBaseTransformationProposalData(previous, steps) {
3957
+ return postprocessClarityTransformationProposalDataSchema.parse({
3958
+ version: previous.version,
3959
+ steps: steps.map((step) => clarityStepBaseSchema.parse(step))
3960
+ });
3961
+ }
3962
+ __name(createBaseTransformationProposalData, "createBaseTransformationProposalData");
3963
+ __name2(createBaseTransformationProposalData, "createBaseTransformationProposalData");
3964
+ function mergeSteps(previousSteps, steps) {
3965
+ const previousById = new Map(previousSteps.map((step) => [step.id, step]));
3966
+ return steps.map((step) => {
3967
+ const prev = previousById.get(step.id);
3968
+ if (!prev) {
3969
+ return step;
3970
+ }
3971
+ return {
3972
+ ...step,
3973
+ readiness: step.readiness ?? prev.readiness,
3974
+ readinessRationale: nonEmptyString(step.readinessRationale) ? step.readinessRationale : prev.readinessRationale,
3975
+ extraCaptureNeeded: step.extraCaptureNeeded ?? prev.extraCaptureNeeded
3976
+ };
3977
+ });
3978
+ }
3979
+ __name(mergeSteps, "mergeSteps");
3980
+ __name2(mergeSteps, "mergeSteps");
3981
+ function nonEmptyString(value) {
3982
+ return value != null && value.length > 0;
3983
+ }
3984
+ __name(nonEmptyString, "nonEmptyString");
3985
+ __name2(nonEmptyString, "nonEmptyString");
3715
3986
  var MAX_PROCESS_GUIDANCE_PROMPT_CHARS = 500;
3716
3987
  function removeControlCharacters(value) {
3717
3988
  return [...value].map((character) => {
@@ -3811,6 +4082,138 @@ function makeSentryReporter(sentry) {
3811
4082
  }
3812
4083
  __name(makeSentryReporter, "makeSentryReporter");
3813
4084
  __name2(makeSentryReporter, "makeSentryReporter");
4085
+ var MAX_BLOCKED_DOMAINS = 1e3;
4086
+ var MAX_GUARDRAILS_TEXT_LENGTH = 2e4;
4087
+ var DOMAIN_LABEL = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/;
4088
+ function stripToHost(value) {
4089
+ if (/^[a-z][a-z0-9+.-]*:\/\//.test(value)) {
4090
+ try {
4091
+ return new URL(value).hostname;
4092
+ } catch {
4093
+ return value;
4094
+ }
4095
+ }
4096
+ const pathStart = ["/", "?", "#"].reduce((idx, ch) => {
4097
+ const at = value.indexOf(ch);
4098
+ return at !== -1 && (idx === -1 || at < idx) ? at : idx;
4099
+ }, -1);
4100
+ const withoutPath = pathStart === -1 ? value : value.slice(0, pathStart);
4101
+ const portStart = withoutPath.indexOf(":");
4102
+ return portStart === -1 ? withoutPath : withoutPath.slice(0, portStart);
4103
+ }
4104
+ __name(stripToHost, "stripToHost");
4105
+ __name2(stripToHost, "stripToHost");
4106
+ function normalizeBlockedDomain(input) {
4107
+ const trimmed = input.trim().toLowerCase();
4108
+ if (trimmed.length === 0) {
4109
+ return { ok: false, reason: "Empty line" };
4110
+ }
4111
+ const host = stripToHost(trimmed);
4112
+ if (host.includes("*")) {
4113
+ return {
4114
+ ok: false,
4115
+ reason: "Wildcards are not needed \u2014 entering `acme.com` blocks acme.com and all subdomains"
4116
+ };
4117
+ }
4118
+ const normalized = host.replace(/\.$/, "");
4119
+ const wwwStripped = normalized.startsWith("www.") ? normalized.slice(4) : normalized;
4120
+ const candidate = wwwStripped.includes(".") ? wwwStripped : normalized;
4121
+ if (!candidate.includes(".")) {
4122
+ return {
4123
+ ok: false,
4124
+ reason: "Not a valid domain \u2014 must contain at least one dot"
4125
+ };
4126
+ }
4127
+ const labels = candidate.split(".");
4128
+ for (const label of labels) {
4129
+ if (!DOMAIN_LABEL.test(label)) {
4130
+ return {
4131
+ ok: false,
4132
+ reason: `"${label}" is not a valid domain label`
4133
+ };
4134
+ }
4135
+ }
4136
+ return { ok: true, value: candidate };
4137
+ }
4138
+ __name(normalizeBlockedDomain, "normalizeBlockedDomain");
4139
+ __name2(normalizeBlockedDomain, "normalizeBlockedDomain");
4140
+ function parseBlockedDomainsList(text3) {
4141
+ const seen = /* @__PURE__ */ new Set();
4142
+ const domains = [];
4143
+ const errors = [];
4144
+ const lines = text3.split(/\r?\n/);
4145
+ for (let i = 0; i < lines.length; i += 1) {
4146
+ const raw = lines[i];
4147
+ if (raw.trim().length === 0) {
4148
+ continue;
4149
+ }
4150
+ const result = normalizeBlockedDomain(raw);
4151
+ if (!result.ok) {
4152
+ errors.push({ line: i + 1, input: raw, reason: result.reason });
4153
+ continue;
4154
+ }
4155
+ if (seen.has(result.value)) {
4156
+ continue;
4157
+ }
4158
+ seen.add(result.value);
4159
+ domains.push(result.value);
4160
+ }
4161
+ return { domains, errors };
4162
+ }
4163
+ __name(parseBlockedDomainsList, "parseBlockedDomainsList");
4164
+ __name2(parseBlockedDomainsList, "parseBlockedDomainsList");
4165
+ function domainToCdpBlockPatterns(domain) {
4166
+ return [
4167
+ `*://${domain}/*`,
4168
+ `*://${domain}:*/*`,
4169
+ `*://${domain}./*`,
4170
+ `*://${domain}.:*/*`,
4171
+ `*://*.${domain}/*`,
4172
+ `*://*.${domain}:*/*`,
4173
+ `*://*.${domain}./*`,
4174
+ `*://*.${domain}.:*/*`
4175
+ ];
4176
+ }
4177
+ __name(domainToCdpBlockPatterns, "domainToCdpBlockPatterns");
4178
+ __name2(domainToCdpBlockPatterns, "domainToCdpBlockPatterns");
4179
+ function blockedDomainsToCdpPatterns(domains) {
4180
+ return domains.flatMap(domainToCdpBlockPatterns);
4181
+ }
4182
+ __name(blockedDomainsToCdpPatterns, "blockedDomainsToCdpPatterns");
4183
+ __name2(blockedDomainsToCdpPatterns, "blockedDomainsToCdpPatterns");
4184
+ function isUrlBlocked(url, blockedDomains) {
4185
+ if (blockedDomains.length === 0) {
4186
+ return { blocked: false };
4187
+ }
4188
+ let host;
4189
+ try {
4190
+ host = new URL(url).hostname.toLowerCase().replace(/\.$/, "");
4191
+ } catch {
4192
+ return { blocked: false };
4193
+ }
4194
+ for (const domain of blockedDomains) {
4195
+ if (host === domain || host.endsWith(`.${domain}`)) {
4196
+ return { blocked: true, matchedDomain: domain, host };
4197
+ }
4198
+ }
4199
+ return { blocked: false };
4200
+ }
4201
+ __name(isUrlBlocked, "isUrlBlocked");
4202
+ __name2(isUrlBlocked, "isUrlBlocked");
4203
+ function blockedDomainAgentErrorMessage(args) {
4204
+ const { host, matchedDomain } = args;
4205
+ const domainLine = host === matchedDomain ? `"${host}" is on this team's browser blocklist` : `"${host}" matches the blocklist entry "${matchedDomain}" (subdomain match)`;
4206
+ return [
4207
+ `A team admin has restricted access to this domain: ${domainLine}, so it cannot be accessed.`,
4208
+ "",
4209
+ "What to do:",
4210
+ "- Check that you're using the correct URLs in your SOP \u2014 you may be pointing at the wrong site or have a typo in the domain.",
4211
+ `- If you genuinely need this domain, contact your team admin to update Team Settings \u2192 Guardrails (currently blocks "${matchedDomain}").`,
4212
+ "- Do NOT attempt to bypass this restriction by reformatting the URL, using a proxy, or other workarounds \u2014 the request will continue to fail."
4213
+ ].join("\n");
4214
+ }
4215
+ __name(blockedDomainAgentErrorMessage, "blockedDomainAgentErrorMessage");
4216
+ __name2(blockedDomainAgentErrorMessage, "blockedDomainAgentErrorMessage");
3814
4217
  var ORG_ROLE = {
3815
4218
  EXECUTIVE: "organization:executive",
3816
4219
  OWNER: "organization:owner",
@@ -5643,6 +6046,7 @@ var caseQueueItemEventSchema = z43.object({
5643
6046
  agent_run_id: z43.guid().nullable(),
5644
6047
  human_request_id: z43.guid().nullable(),
5645
6048
  type: z43.string(),
6049
+ reason: z43.string().nullable(),
5646
6050
  created_at: z43.string(),
5647
6051
  agent_id: z43.guid().nullable(),
5648
6052
  agent_name: z43.string().nullable(),
@@ -5776,13 +6180,22 @@ var caseBulkDeleteResponseSchema = z43.object({
5776
6180
  deletedCount: z43.number(),
5777
6181
  interruptedRunIds: z43.array(z43.guid())
5778
6182
  });
5779
- var caseBulkRetryResponseSchema = z43.object({
5780
- retriedCount: z43.number(),
5781
- skippedCount: z43.number()
5782
- });
5783
- var caseBulkDelegateResponseSchema = z43.object({
5784
- delegatedCount: z43.number(),
5785
- skippedCount: z43.number()
6183
+ var caseBulkReprocessResponseSchema = z43.object({
6184
+ reprocessedCount: z43.number(),
6185
+ skippedCount: z43.number(),
6186
+ // Deprecated aliases of `reprocessedCount`, both equal to it. Returned so
6187
+ // clients 308-redirected here from the deprecated `bulk-delegate` /
6188
+ // `bulk-retry` endpoints still find their original field. Optional +
6189
+ // `deprecated` so consumers don't couple to them; removed with those aliases
6190
+ // at the 2026-06-10 sunset.
6191
+ delegatedCount: z43.number().meta({
6192
+ deprecated: true,
6193
+ description: "Deprecated alias of reprocessedCount, kept for clients redirected from bulk-delegate. Removed on 2026-06-10."
6194
+ }).optional(),
6195
+ retriedCount: z43.number().meta({
6196
+ deprecated: true,
6197
+ description: "Deprecated alias of reprocessedCount, kept for clients redirected from bulk-retry. Removed on 2026-06-10."
6198
+ }).optional()
5786
6199
  });
5787
6200
  var caseBulkStatusUpdateResponseSchema = z43.object({
5788
6201
  updatedCount: z43.number(),
@@ -6171,9 +6584,6 @@ var acceptJoinLinkResponseSchema = z45.object({
6171
6584
  var createClarityProcessInviteLinkRequestSchema = z46.object({
6172
6585
  frontendUrl: z46.url()
6173
6586
  });
6174
- var getClarityProcessInviteLinkQuerySchema = z46.object({
6175
- frontendUrl: z46.url()
6176
- });
6177
6587
  var clarityProcessInviteLinkSchema = teamInviteLinkSchema;
6178
6588
  var getClarityProcessInviteLinkResponseSchema = z46.object({
6179
6589
  hasLink: z46.boolean(),
@@ -6322,6 +6732,11 @@ var FEATURE_FLAG_CATALOGUE = {
6322
6732
  defaultValue: true,
6323
6733
  description: "Grants a team access to the Windows Remote Desktop beta. Default-on day-one (no known scaling limit); flip off to hide the Enable form and show a Request Access flow on the tile's detail page."
6324
6734
  },
6735
+ CROSS_TEAM_AGENT_MOVE: {
6736
+ key: "cross_team_agent_move",
6737
+ defaultValue: false,
6738
+ description: "Enables the Move Assignment to another team flow. Default-off while we monitor multi-table move semantics in prod; flip on for individual teams to grant access."
6739
+ },
6325
6740
  TEAM_ONTOLOGY: {
6326
6741
  key: "team_ontology",
6327
6742
  defaultValue: false,
@@ -6356,6 +6771,11 @@ var FEATURE_FLAG_CATALOGUE = {
6356
6771
  key: "portfolio_intelligence",
6357
6772
  defaultValue: false,
6358
6773
  description: "Enables portfolio intelligence analysis in the Clarity sidebar, providing cross-process insights and recommendations."
6774
+ },
6775
+ SHARED_CONNECTIONS: {
6776
+ key: "shared_connections",
6777
+ defaultValue: false,
6778
+ description: "Grants connection sharing to teams that are NOT part of an organization (org-less teams have no org-level `connections_sharing_enabled` kill-switch). Resolved with team > global precedence; a global override turns it on for every org-less team. Teams inside an organization are governed solely by their org's setting and are unaffected by this flag."
6359
6779
  }
6360
6780
  };
6361
6781
  var FEATURE_FLAGS = Object.fromEntries(
@@ -7118,7 +7538,14 @@ var RunConfigSchema = AgentConfigSchema.extend({
7118
7538
  conversationHistory: z57.array(ThreadContextMessageSchema).optional(),
7119
7539
  chatFiles: z57.array(ChatFileReferenceSchema).optional(),
7120
7540
  /** IANA timezone (e.g. `"Europe/Prague"`). Consumers should fall back to UTC when absent. */
7121
- timezone: z57.string().optional()
7541
+ timezone: z57.string().optional(),
7542
+ /**
7543
+ * ISO 8601 timestamp captured when the run was created. Frozen at
7544
+ * run-creation time and never recomputed, so resumes reuse the same value —
7545
+ * the runtime injects it into the cached system prompt and a changing value
7546
+ * would bust the prompt cache.
7547
+ */
7548
+ sessionStartedAt: z57.string().optional()
7122
7549
  });
7123
7550
  var StoredRunConfigV0Schema = z57.object({
7124
7551
  version: z57.literal("v0")
@@ -7393,73 +7820,101 @@ var teamInsightsUsersResponseSchema = z61.object({
7393
7820
  data: z61.array(teamInsightsUserWithAgentsAndRunsSchema),
7394
7821
  total: z61.number()
7395
7822
  });
7396
- var userDismissalListResponseSchema = z62.object({
7397
- data: z62.array(z62.string())
7823
+ var guardrailsAuthorSchema = z62.object({
7824
+ id: z62.guid(),
7825
+ name: z62.string().nullable(),
7826
+ email: z62.email()
7827
+ });
7828
+ var guardrailsRevisionSchema = z62.object({
7829
+ id: z62.guid(),
7830
+ teamId: z62.guid(),
7831
+ guardrailsText: z62.string().nullable(),
7832
+ blockedDomains: z62.array(z62.string()),
7833
+ createdAt: z62.string(),
7834
+ createdBy: guardrailsAuthorSchema
7835
+ });
7836
+ var getTeamGuardrailsResponseSchema = z62.object({
7837
+ current: guardrailsRevisionSchema.nullable()
7838
+ });
7839
+ var listTeamGuardrailsRevisionsQuerySchema = z62.object({
7840
+ limit: z62.coerce.number().int().min(1).max(100).default(20),
7841
+ offset: z62.coerce.number().int().min(0).default(0)
7842
+ });
7843
+ var listTeamGuardrailsRevisionsResponseSchema = z62.object({
7844
+ revisions: z62.array(guardrailsRevisionSchema),
7845
+ total: z62.number().int().nonnegative()
7846
+ });
7847
+ var createTeamGuardrailsRevisionRequestSchema = z62.object({
7848
+ guardrailsText: z62.string().max(MAX_GUARDRAILS_TEXT_LENGTH).nullable().transform((value) => value && value.trim().length > 0 ? value : null),
7849
+ blockedDomains: z62.array(z62.string()).max(MAX_BLOCKED_DOMAINS)
7850
+ });
7851
+ var userDismissalListResponseSchema = z63.object({
7852
+ data: z63.array(z63.string())
7398
7853
  });
7399
- var userDismissalMutationSchema = z62.object({
7400
- elementKey: z62.string()
7854
+ var userDismissalMutationSchema = z63.object({
7855
+ elementKey: z63.string()
7401
7856
  });
7402
7857
  var PASSWORD_MIN = 1;
7403
7858
  var PASSWORD_MAX = 1024;
7404
7859
  var NAME_MAX = 200;
7405
7860
  var URL_MAX = 500;
7406
7861
  var USERNAME_MAX = 200;
7407
- var vpnProxyConfigSummarySchema = z63.object({
7408
- id: z63.guid(),
7409
- name: z63.string(),
7410
- server: z63.string(),
7411
- username: z63.string(),
7412
- enabled: z63.boolean(),
7413
- passwordSet: z63.boolean(),
7414
- organizationCount: z63.number().int().nonnegative(),
7415
- createdAt: z63.string(),
7416
- updatedAt: z63.string()
7417
- });
7418
- var vpnProxyConfigListResponseSchema = z63.object({
7419
- configs: z63.array(vpnProxyConfigSummarySchema)
7420
- });
7421
- var vpnProxyConfigCreateRequestSchema = z63.object({
7422
- name: z63.string().trim().min(1).max(NAME_MAX),
7423
- server: z63.string().trim().min(1).max(URL_MAX).url(),
7424
- username: z63.string().trim().min(1).max(USERNAME_MAX),
7425
- password: z63.string().min(PASSWORD_MIN).max(PASSWORD_MAX),
7426
- enabled: z63.boolean().prefault(true)
7427
- });
7428
- var vpnProxyConfigCreateResponseSchema = z63.object({
7862
+ var vpnProxyConfigSummarySchema = z64.object({
7863
+ id: z64.guid(),
7864
+ name: z64.string(),
7865
+ server: z64.string(),
7866
+ username: z64.string(),
7867
+ enabled: z64.boolean(),
7868
+ passwordSet: z64.boolean(),
7869
+ organizationCount: z64.number().int().nonnegative(),
7870
+ createdAt: z64.string(),
7871
+ updatedAt: z64.string()
7872
+ });
7873
+ var vpnProxyConfigListResponseSchema = z64.object({
7874
+ configs: z64.array(vpnProxyConfigSummarySchema)
7875
+ });
7876
+ var vpnProxyConfigCreateRequestSchema = z64.object({
7877
+ name: z64.string().trim().min(1).max(NAME_MAX),
7878
+ server: z64.string().trim().min(1).max(URL_MAX).url(),
7879
+ username: z64.string().trim().min(1).max(USERNAME_MAX),
7880
+ password: z64.string().min(PASSWORD_MIN).max(PASSWORD_MAX),
7881
+ enabled: z64.boolean().prefault(true)
7882
+ });
7883
+ var vpnProxyConfigCreateResponseSchema = z64.object({
7429
7884
  config: vpnProxyConfigSummarySchema
7430
7885
  });
7431
- var vpnProxyConfigUpdateRequestSchema = z63.object({
7432
- name: z63.string().trim().min(1).max(NAME_MAX).optional(),
7433
- server: z63.string().trim().min(1).max(URL_MAX).url().optional(),
7434
- username: z63.string().trim().min(1).max(USERNAME_MAX).optional(),
7435
- password: z63.string().min(PASSWORD_MIN).max(PASSWORD_MAX).optional(),
7436
- enabled: z63.boolean().optional()
7886
+ var vpnProxyConfigUpdateRequestSchema = z64.object({
7887
+ name: z64.string().trim().min(1).max(NAME_MAX).optional(),
7888
+ server: z64.string().trim().min(1).max(URL_MAX).url().optional(),
7889
+ username: z64.string().trim().min(1).max(USERNAME_MAX).optional(),
7890
+ password: z64.string().min(PASSWORD_MIN).max(PASSWORD_MAX).optional(),
7891
+ enabled: z64.boolean().optional()
7437
7892
  });
7438
- var vpnProxyConfigUpdateResponseSchema = z63.object({
7893
+ var vpnProxyConfigUpdateResponseSchema = z64.object({
7439
7894
  config: vpnProxyConfigSummarySchema
7440
7895
  });
7441
- var vpnProxyConfigDeleteResponseSchema = z63.object({
7442
- success: z63.literal(true)
7896
+ var vpnProxyConfigDeleteResponseSchema = z64.object({
7897
+ success: z64.literal(true)
7443
7898
  });
7444
- var vpnProxyConfigOrganizationSchema = z63.object({
7445
- id: z63.guid(),
7446
- organizationId: z63.guid(),
7447
- organizationName: z63.string(),
7448
- attachedAt: z63.string()
7899
+ var vpnProxyConfigOrganizationSchema = z64.object({
7900
+ id: z64.guid(),
7901
+ organizationId: z64.guid(),
7902
+ organizationName: z64.string(),
7903
+ attachedAt: z64.string()
7449
7904
  });
7450
- var vpnProxyConfigOrganizationListResponseSchema = z63.object({
7451
- organizations: z63.array(vpnProxyConfigOrganizationSchema)
7905
+ var vpnProxyConfigOrganizationListResponseSchema = z64.object({
7906
+ organizations: z64.array(vpnProxyConfigOrganizationSchema)
7452
7907
  });
7453
- var vpnProxyConfigAttachOrganizationRequestSchema = z63.object({
7454
- organizationId: z63.guid()
7908
+ var vpnProxyConfigAttachOrganizationRequestSchema = z64.object({
7909
+ organizationId: z64.guid()
7455
7910
  });
7456
- var vpnProxyConfigAttachOrganizationResponseSchema = z63.object({
7911
+ var vpnProxyConfigAttachOrganizationResponseSchema = z64.object({
7457
7912
  attachment: vpnProxyConfigOrganizationSchema
7458
7913
  });
7459
- var vpnProxyConfigDetachOrganizationResponseSchema = z63.object({
7460
- success: z63.literal(true)
7914
+ var vpnProxyConfigDetachOrganizationResponseSchema = z64.object({
7915
+ success: z64.literal(true)
7461
7916
  });
7462
- var vpnProxyConfigForOrganizationResponseSchema = z63.object({
7917
+ var vpnProxyConfigForOrganizationResponseSchema = z64.object({
7463
7918
  config: vpnProxyConfigSummarySchema.nullable()
7464
7919
  });
7465
7920
  function canonicalizeSopInput(config) {
@@ -7480,7 +7935,7 @@ function canonicalizeSopInput(config) {
7480
7935
  }
7481
7936
  __name(canonicalizeSopInput, "canonicalizeSopInput");
7482
7937
  __name2(canonicalizeSopInput, "canonicalizeSopInput");
7483
- var caseFilterStatusSchema = z64.enum([
7938
+ var caseFilterStatusSchema = z65.enum([
7484
7939
  "pending",
7485
7940
  "claimed",
7486
7941
  "completed",
@@ -7488,19 +7943,19 @@ var caseFilterStatusSchema = z64.enum([
7488
7943
  "needs_input",
7489
7944
  "postponed"
7490
7945
  ]);
7491
- var casesFiltersSchema = z64.object({
7492
- status: z64.array(caseFilterStatusSchema).optional(),
7493
- created_at_from: z64.string().optional(),
7494
- updated_at_from: z64.string().optional(),
7495
- labels: z64.record(z64.string(), z64.array(z64.string())).optional()
7946
+ var casesFiltersSchema = z65.object({
7947
+ status: z65.array(caseFilterStatusSchema).optional(),
7948
+ created_at_from: z65.string().optional(),
7949
+ updated_at_from: z65.string().optional(),
7950
+ labels: z65.record(z65.string(), z65.array(z65.string())).optional()
7496
7951
  });
7497
- var casesListRequestBodySchema = z64.object({
7952
+ var casesListRequestBodySchema = z65.object({
7498
7953
  filters: casesFiltersSchema.default({}),
7499
- limit: z64.int().min(1).max(100).default(25),
7500
- offset: z64.int().min(0).default(0),
7501
- sort_by: z64.enum(["created_at", "updated_at", "postponed_to"]).default("created_at"),
7502
- sort_order: z64.enum(["asc", "desc"]).default("desc"),
7503
- search: z64.string().optional()
7954
+ limit: z65.int().min(1).max(100).default(25),
7955
+ offset: z65.int().min(0).default(0),
7956
+ sort_by: z65.enum(["created_at", "updated_at", "postponed_to"]).default("created_at"),
7957
+ sort_order: z65.enum(["asc", "desc"]).default("desc"),
7958
+ search: z65.string().optional()
7504
7959
  });
7505
7960
  function toBase64(input) {
7506
7961
  if (typeof btoa === "function") {
@@ -7595,7 +8050,7 @@ function setFilterValuesByCategoryKey(filters, categoryKey, values) {
7595
8050
  const { status: _, ...rest } = filters;
7596
8051
  return rest;
7597
8052
  }
7598
- const parsed = z64.array(caseFilterStatusSchema).safeParse(values);
8053
+ const parsed = z65.array(caseFilterStatusSchema).safeParse(values);
7599
8054
  if (!parsed.success) {
7600
8055
  return filters;
7601
8056
  }
@@ -8735,11 +9190,11 @@ function emptyConfig() {
8735
9190
  __name(emptyConfig, "emptyConfig");
8736
9191
 
8737
9192
  // src/config/env.ts
8738
- import { z as z65 } from "zod";
8739
- var optionalEnvString = z65.string().optional().transform(
9193
+ import { z as z66 } from "zod";
9194
+ var optionalEnvString = z66.string().optional().transform(
8740
9195
  (value) => value === void 0 || value === "" ? void 0 : value
8741
9196
  );
8742
- var CliEnvSchema = z65.object({
9197
+ var CliEnvSchema = z66.object({
8743
9198
  DUVO_PROFILE: optionalEnvString,
8744
9199
  DUVO_API_KEY: optionalEnvString,
8745
9200
  DUVO_API_BASE_URL: optionalEnvString,
@@ -9235,9 +9690,9 @@ async function requireAuthenticatedConfig(command) {
9235
9690
  __name(requireAuthenticatedConfig, "requireAuthenticatedConfig");
9236
9691
 
9237
9692
  // src/commands/shared/team-context.ts
9238
- import { z as z66 } from "zod";
9239
- var teamSchema = z66.object({ id: z66.string() });
9240
- var listMyTeamsResponseSchema = z66.object({ teams: z66.array(teamSchema) });
9693
+ import { z as z67 } from "zod";
9694
+ var teamSchema = z67.object({ id: z67.string() });
9695
+ var listMyTeamsResponseSchema = z67.object({ teams: z67.array(teamSchema) });
9241
9696
  async function resolveRequiredTeamId(config, options = {}) {
9242
9697
  if (options.override) {
9243
9698
  return options.override;
@@ -10028,40 +10483,56 @@ import { readFile as readFile2 } from "node:fs/promises";
10028
10483
  import { confirm as confirm2, isCancel as isCancel2, text } from "@clack/prompts";
10029
10484
 
10030
10485
  // src/api/agent-schemas.ts
10031
- import { z as z67 } from "zod";
10032
- var publicAgentSchema = z67.object({
10033
- id: z67.string(),
10034
- name: z67.string(),
10035
- slack_enabled: z67.boolean().nullish(),
10036
- microsoft_teams_enabled: z67.boolean().nullish(),
10037
- agentic_memory_enabled: z67.boolean().nullish(),
10038
- thread_id: z67.string().nullish(),
10039
- created_at: z67.string().nullish(),
10040
- updated_at: z67.string().nullish()
10041
- });
10042
- var publicBuildSchema = z67.object({
10043
- id: z67.string(),
10044
- agent_id: z67.string(),
10045
- name: z67.string(),
10046
- revision_number: z67.number().nullish(),
10047
- created_at: z67.string().nullish(),
10048
- updated_at: z67.string().nullish()
10049
- });
10050
- var listAgentsResponseSchema = z67.object({
10051
- agents: z67.array(publicAgentSchema),
10052
- total: z67.number().nullish(),
10053
- limit: z67.number().nullish(),
10054
- offset: z67.number().nullish()
10055
- });
10056
- var getAgentResponseSchema = z67.object({
10486
+ import { z as z69 } from "zod";
10487
+
10488
+ // src/api/json-value.ts
10489
+ import { z as z68 } from "zod";
10490
+ var jsonValueSchema = z68.lazy(
10491
+ () => z68.union([
10492
+ z68.string(),
10493
+ z68.number(),
10494
+ z68.boolean(),
10495
+ z68.null(),
10496
+ z68.array(jsonValueSchema),
10497
+ z68.record(z68.string(), jsonValueSchema)
10498
+ ])
10499
+ );
10500
+
10501
+ // src/api/agent-schemas.ts
10502
+ var publicAgentSchema = z69.object({
10503
+ id: z69.string(),
10504
+ name: z69.string(),
10505
+ slack_enabled: z69.boolean().nullish(),
10506
+ microsoft_teams_enabled: z69.boolean().nullish(),
10507
+ agentic_memory_enabled: z69.boolean().nullish(),
10508
+ thread_id: z69.string().nullish(),
10509
+ created_at: z69.string().nullish(),
10510
+ updated_at: z69.string().nullish(),
10511
+ latest_build: z69.object({ config: jsonValueSchema.nullish() }).nullish()
10512
+ });
10513
+ var publicBuildSchema = z69.object({
10514
+ id: z69.string(),
10515
+ agent_id: z69.string(),
10516
+ name: z69.string(),
10517
+ revision_number: z69.number().nullish(),
10518
+ created_at: z69.string().nullish(),
10519
+ updated_at: z69.string().nullish()
10520
+ });
10521
+ var listAgentsResponseSchema = z69.object({
10522
+ agents: z69.array(publicAgentSchema),
10523
+ total: z69.number().nullish(),
10524
+ limit: z69.number().nullish(),
10525
+ offset: z69.number().nullish()
10526
+ });
10527
+ var getAgentResponseSchema = z69.object({
10057
10528
  agent: publicAgentSchema
10058
10529
  });
10059
- var createAgentResponseSchema = z67.object({
10530
+ var createAgentResponseSchema = z69.object({
10060
10531
  agent: publicAgentSchema,
10061
10532
  build: publicBuildSchema.optional()
10062
10533
  });
10063
- var deleteAgentResponseSchema = z67.object({
10064
- success: z67.literal(true)
10534
+ var deleteAgentResponseSchema = z69.object({
10535
+ success: z69.literal(true)
10065
10536
  });
10066
10537
  var buildConfigSchema = StoredAgentConfigSchemaV2;
10067
10538
  var DEFAULT_NEW_AGENT_NAME = DEFAULT_AGENT_NAME;
@@ -10071,6 +10542,77 @@ var DEFAULT_BUILD_CONFIG = {
10071
10542
  data: DEFAULT_AGENT_CONFIG
10072
10543
  };
10073
10544
 
10545
+ // src/commands/shared/is-interactive-terminal.ts
10546
+ function isInteractiveTerminal() {
10547
+ return process.stdin.isTTY === true && process.stdout.isTTY === true;
10548
+ }
10549
+ __name(isInteractiveTerminal, "isInteractiveTerminal");
10550
+
10551
+ // src/commands/agents/model-option.ts
10552
+ var MODEL_IDS = CLAUDE_MODEL_IDS;
10553
+ var NO_MODEL_LABEL = "\u2014";
10554
+ function modelFromConfig(config) {
10555
+ if (config === null || config === void 0) {
10556
+ return NO_MODEL_LABEL;
10557
+ }
10558
+ const { config: parsed } = parseAgentConfig(config);
10559
+ return parsed ? parsed.models.agent.model : NO_MODEL_LABEL;
10560
+ }
10561
+ __name(modelFromConfig, "modelFromConfig");
10562
+ function isCoreClaudeModelId(value) {
10563
+ return MODEL_IDS.includes(value);
10564
+ }
10565
+ __name(isCoreClaudeModelId, "isCoreClaudeModelId");
10566
+ function formatModelChoices() {
10567
+ return MODEL_IDS.map(
10568
+ (id) => ` ${id} \u2014 ${AVAILABLE_AGENT_MODELS[id].displayName}`
10569
+ ).join("\n");
10570
+ }
10571
+ __name(formatModelChoices, "formatModelChoices");
10572
+ function resolveModelFlag(flag) {
10573
+ const trimmed = flag.trim();
10574
+ if (trimmed.length === 0) {
10575
+ throw new CliError("--model must not be empty");
10576
+ }
10577
+ if (!isCoreClaudeModelId(trimmed)) {
10578
+ throw new CliError(
10579
+ `Unknown model "${trimmed}". Available models:
10580
+ ${formatModelChoices()}`
10581
+ );
10582
+ }
10583
+ return trimmed;
10584
+ }
10585
+ __name(resolveModelFlag, "resolveModelFlag");
10586
+ function listAgentModels() {
10587
+ return MODEL_IDS.map((id) => ({
10588
+ id,
10589
+ displayName: AVAILABLE_AGENT_MODELS[id].displayName,
10590
+ description: AVAILABLE_AGENT_MODELS[id].description ?? "",
10591
+ isDefault: id === PLATFORM_DEFAULT_MODELS.agent.model
10592
+ }));
10593
+ }
10594
+ __name(listAgentModels, "listAgentModels");
10595
+ function buildModelPickerOptions() {
10596
+ return MODEL_IDS.map((id) => ({
10597
+ value: id,
10598
+ label: `${AVAILABLE_AGENT_MODELS[id].displayName} (${id})`
10599
+ }));
10600
+ }
10601
+ __name(buildModelPickerOptions, "buildModelPickerOptions");
10602
+ function applyModelToConfig(config, model) {
10603
+ return {
10604
+ ...config,
10605
+ data: {
10606
+ ...config.data,
10607
+ models: {
10608
+ ...config.data.models,
10609
+ agent: { ...config.data.models.agent, model }
10610
+ }
10611
+ }
10612
+ };
10613
+ }
10614
+ __name(applyModelToConfig, "applyModelToConfig");
10615
+
10074
10616
  // src/commands/agents/create.ts
10075
10617
  function registerAgentsCreate(agents) {
10076
10618
  agents.command("create").description("Create a new agent").option("--name <name>", "human-readable agent name").option(
@@ -10079,11 +10621,18 @@ function registerAgentsCreate(agents) {
10079
10621
  ).option(
10080
10622
  "--config <path>",
10081
10623
  "path to a JSON file with the full build config (overrides --input)"
10624
+ ).option(
10625
+ "--model <model>",
10626
+ "Claude model the agent should use (overrides the model in --config)"
10082
10627
  ).option("--no-build", "create the agent without an initial build").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function createAction(options) {
10083
10628
  const resolved = await requireAuthenticatedConfig(this);
10084
10629
  const teamId = await resolveRequiredTeamId(resolved, {
10085
10630
  override: getTeamFlag(this)
10086
10631
  });
10632
+ const model = options.model !== void 0 ? resolveModelFlag(options.model) : void 0;
10633
+ if (options.build === false && model !== void 0) {
10634
+ throw new CliError("--model cannot be combined with --no-build.");
10635
+ }
10087
10636
  const name = await resolveName(options.name);
10088
10637
  const body = { name };
10089
10638
  if (options.build !== false) {
@@ -10091,7 +10640,7 @@ function registerAgentsCreate(agents) {
10091
10640
  if (config) {
10092
10641
  body.build = {
10093
10642
  name: DEFAULT_BUILD_NAME,
10094
- config
10643
+ config: model ? applyModelToConfig(config, model) : config
10095
10644
  };
10096
10645
  }
10097
10646
  }
@@ -10120,6 +10669,12 @@ function registerAgentsCreate(agents) {
10120
10669
  ];
10121
10670
  if (build) {
10122
10671
  entries.push({ label: "Build", value: `${build.id} (${build.name})` });
10672
+ if (body.build) {
10673
+ entries.push({
10674
+ label: "Model",
10675
+ value: modelFromConfig(body.build.config)
10676
+ });
10677
+ }
10123
10678
  }
10124
10679
  console.log(green("Agent created!"));
10125
10680
  console.log();
@@ -10127,10 +10682,6 @@ function registerAgentsCreate(agents) {
10127
10682
  }, "createAction"));
10128
10683
  }
10129
10684
  __name(registerAgentsCreate, "registerAgentsCreate");
10130
- function isInteractiveTerminal() {
10131
- return process.stdin.isTTY === true && process.stdout.isTTY === true;
10132
- }
10133
- __name(isInteractiveTerminal, "isInteractiveTerminal");
10134
10685
  async function resolveName(flag) {
10135
10686
  if (flag !== void 0) {
10136
10687
  const trimmed2 = flag.trim();
@@ -10289,7 +10840,56 @@ function registerAgentsDelete(agents) {
10289
10840
  }
10290
10841
  __name(registerAgentsDelete, "registerAgentsDelete");
10291
10842
 
10843
+ // src/api/build-schemas.ts
10844
+ import { z as z70 } from "zod";
10845
+ var publicBuildSchema2 = z70.object({
10846
+ id: z70.string(),
10847
+ agent_id: z70.string(),
10848
+ name: z70.string(),
10849
+ status: z70.string().nullish(),
10850
+ config: jsonValueSchema.nullish(),
10851
+ revision_number: z70.number().nullish(),
10852
+ created_at: z70.string().nullish(),
10853
+ updated_at: z70.string().nullish()
10854
+ });
10855
+ var listBuildsResponseSchema2 = z70.object({
10856
+ builds: z70.array(publicBuildSchema2),
10857
+ total: z70.number().nullish(),
10858
+ limit: z70.number().nullish(),
10859
+ offset: z70.number().nullish()
10860
+ });
10861
+ var getBuildResponseSchema = z70.object({
10862
+ build: publicBuildSchema2
10863
+ });
10864
+ var createBuildResponseSchema = z70.object({
10865
+ build: publicBuildSchema2,
10866
+ agent: z70.object({ id: z70.string() })
10867
+ });
10868
+
10292
10869
  // src/commands/agents/get.ts
10870
+ async function fetchLatestModel(agentId, apiKey, apiBaseUrl) {
10871
+ const searchParams = new URLSearchParams();
10872
+ searchParams.append("limit", "1");
10873
+ searchParams.append("offset", "0");
10874
+ try {
10875
+ const raw = await httpRequest({
10876
+ method: "GET",
10877
+ path: `/v2/agents/${encodeURIComponent(agentId)}/revisions`,
10878
+ apiKey,
10879
+ apiBaseUrl,
10880
+ searchParams
10881
+ });
10882
+ const parsed = listBuildsResponseSchema2.safeParse(raw);
10883
+ if (!parsed.success) {
10884
+ return NO_MODEL_LABEL;
10885
+ }
10886
+ const latest = parsed.data.builds[0];
10887
+ return latest ? modelFromConfig(latest.config) : NO_MODEL_LABEL;
10888
+ } catch {
10889
+ return NO_MODEL_LABEL;
10890
+ }
10891
+ }
10892
+ __name(fetchLatestModel, "fetchLatestModel");
10293
10893
  function registerAgentsGet(agents) {
10294
10894
  agents.command("get <id>").description("Get an agent by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(id, options) {
10295
10895
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
@@ -10310,10 +10910,12 @@ function registerAgentsGet(agents) {
10310
10910
  );
10311
10911
  }
10312
10912
  const { agent } = parsed.data;
10913
+ const model = await fetchLatestModel(agent.id, apiKey, apiBaseUrl);
10313
10914
  console.log(
10314
10915
  renderKeyValue([
10315
10916
  { label: "ID", value: agent.id },
10316
10917
  { label: "Name", value: agent.name },
10918
+ { label: "Model", value: model },
10317
10919
  { label: "Created", value: agent.created_at ?? "" },
10318
10920
  { label: "Updated", value: agent.updated_at ?? "" }
10319
10921
  ])
@@ -10356,6 +10958,10 @@ var MAX_LIMIT = 100;
10356
10958
  var TABLE_COLUMNS4 = [
10357
10959
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
10358
10960
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
10961
+ {
10962
+ header: "MODEL",
10963
+ cell: /* @__PURE__ */ __name((row) => modelFromConfig(row.latest_build?.config), "cell")
10964
+ },
10359
10965
  { header: "CREATED", cell: /* @__PURE__ */ __name((row) => row.created_at ?? "", "cell") }
10360
10966
  ];
10361
10967
  function registerAgentsList(agents) {
@@ -10479,31 +11085,58 @@ function registerAgentsMemory(agents) {
10479
11085
  }
10480
11086
  __name(registerAgentsMemory, "registerAgentsMemory");
10481
11087
 
11088
+ // src/commands/agents/models.ts
11089
+ var DEFAULT_MARKER = "\u2713";
11090
+ var TABLE_COLUMNS6 = [
11091
+ { header: "MODEL", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
11092
+ { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.displayName, "cell") },
11093
+ {
11094
+ header: "DEFAULT",
11095
+ cell: /* @__PURE__ */ __name((row) => row.isDefault ? DEFAULT_MARKER : "", "cell")
11096
+ },
11097
+ { header: "DESCRIPTION", cell: /* @__PURE__ */ __name((row) => row.description, "cell") }
11098
+ ];
11099
+ function registerAgentsModels(agents) {
11100
+ agents.command("models").description("List the LLM models available for agents").option("--json", "output raw JSON").action(/* @__PURE__ */ __name(function modelsAction(options) {
11101
+ const models = listAgentModels();
11102
+ if (options.json) {
11103
+ printJson(models);
11104
+ return;
11105
+ }
11106
+ console.log(renderTable(TABLE_COLUMNS6, models));
11107
+ console.log();
11108
+ console.log(
11109
+ `Use a MODEL value with \`duvo agents create --model <model>\` or \`duvo agents set-model <id> --model <model>\`.`
11110
+ );
11111
+ }, "modelsAction"));
11112
+ }
11113
+ __name(registerAgentsModels, "registerAgentsModels");
11114
+
10482
11115
  // src/api/schedule-schemas.ts
10483
- import { z as z68 } from "zod";
10484
- var publicScheduleSchema = z68.object({
10485
- id: z68.string(),
10486
- build_id: z68.string(),
10487
- agent_id: z68.string(),
10488
- user_id: z68.string(),
10489
- enabled: z68.boolean(),
10490
- frequency: z68.string(),
10491
- time: z68.string().nullish(),
10492
- timezone: z68.string(),
10493
- day: z68.string().nullish(),
10494
- day_of_month: z68.number().nullish(),
10495
- cron: z68.string().nullish(),
10496
- source: z68.string().nullish(),
10497
- task: z68.string().nullish(),
10498
- recurring: z68.boolean().nullish(),
10499
- created_at: z68.string(),
10500
- updated_at: z68.string()
10501
- });
10502
- var listSchedulesResponseSchema = z68.object({
10503
- schedules: z68.array(publicScheduleSchema)
10504
- });
10505
- var deleteScheduleResponseSchema = z68.object({
10506
- success: z68.literal(true)
11116
+ import { z as z71 } from "zod";
11117
+ var publicScheduleSchema = z71.object({
11118
+ id: z71.string(),
11119
+ build_id: z71.string(),
11120
+ agent_id: z71.string(),
11121
+ user_id: z71.string(),
11122
+ enabled: z71.boolean(),
11123
+ frequency: z71.string(),
11124
+ time: z71.string().nullish(),
11125
+ timezone: z71.string(),
11126
+ day: z71.string().nullish(),
11127
+ day_of_month: z71.number().nullish(),
11128
+ cron: z71.string().nullish(),
11129
+ source: z71.string().nullish(),
11130
+ task: z71.string().nullish(),
11131
+ recurring: z71.boolean().nullish(),
11132
+ created_at: z71.string(),
11133
+ updated_at: z71.string()
11134
+ });
11135
+ var listSchedulesResponseSchema = z71.object({
11136
+ schedules: z71.array(publicScheduleSchema)
11137
+ });
11138
+ var deleteScheduleResponseSchema = z71.object({
11139
+ success: z71.literal(true)
10507
11140
  });
10508
11141
 
10509
11142
  // src/commands/agents/schedules/render-schedule.ts
@@ -10682,7 +11315,7 @@ __name(registerAgentsSchedulesDelete, "registerAgentsSchedulesDelete");
10682
11315
 
10683
11316
  // src/commands/agents/schedules/list.ts
10684
11317
  var TASK_PREVIEW_WIDTH = 40;
10685
- var TABLE_COLUMNS6 = [
11318
+ var TABLE_COLUMNS7 = [
10686
11319
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
10687
11320
  {
10688
11321
  header: "ENABLED",
@@ -10741,7 +11374,7 @@ function registerAgentsSchedulesList(schedules) {
10741
11374
  console.log("No schedules found.");
10742
11375
  return;
10743
11376
  }
10744
- console.log(renderTable(TABLE_COLUMNS6, rows));
11377
+ console.log(renderTable(TABLE_COLUMNS7, rows));
10745
11378
  console.log(`Showing ${rows.length}`);
10746
11379
  }, "listAction"));
10747
11380
  }
@@ -10860,39 +11493,129 @@ function registerAgentsSchedules(agents) {
10860
11493
  }
10861
11494
  __name(registerAgentsSchedules, "registerAgentsSchedules");
10862
11495
 
11496
+ // src/commands/agents/set-model.ts
11497
+ import { isCancel as isCancel3, select } from "@clack/prompts";
11498
+ async function resolveModel(flag) {
11499
+ if (flag !== void 0) {
11500
+ return resolveModelFlag(flag);
11501
+ }
11502
+ if (!isInteractiveTerminal()) {
11503
+ throw new CliError(
11504
+ "--model is required in non-interactive shells (e.g. --model claude-opus-4-7)."
11505
+ );
11506
+ }
11507
+ const answer = await select({
11508
+ message: "Select a model for this agent",
11509
+ options: buildModelPickerOptions()
11510
+ });
11511
+ if (isCancel3(answer)) {
11512
+ throw new CancelCliError("Model switch cancelled.");
11513
+ }
11514
+ return answer;
11515
+ }
11516
+ __name(resolveModel, "resolveModel");
11517
+ function buildConfigWithModel(rawConfig, model) {
11518
+ const { config } = parseAgentConfig(rawConfig);
11519
+ const data = config ?? DEFAULT_AGENT_CONFIG;
11520
+ return {
11521
+ version: AGENT_CONFIG_VERSION,
11522
+ data: {
11523
+ ...data,
11524
+ models: {
11525
+ ...data.models,
11526
+ agent: { ...data.models.agent, model }
11527
+ }
11528
+ }
11529
+ };
11530
+ }
11531
+ __name(buildConfigWithModel, "buildConfigWithModel");
11532
+ function registerAgentsSetModel(agents) {
11533
+ agents.command("set-model <id>").description("Switch the LLM model used by an agent's latest revision").option(
11534
+ "--model <model>",
11535
+ "Claude model to switch to (interactive picker when omitted)"
11536
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function setModelAction(id, options) {
11537
+ const agentId = trimRequired(id, "<id>");
11538
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
11539
+ const model = await resolveModel(options.model);
11540
+ const searchParams = new URLSearchParams();
11541
+ searchParams.append("limit", "1");
11542
+ searchParams.append("offset", "0");
11543
+ const listRaw = await httpRequest({
11544
+ method: "GET",
11545
+ path: `/v2/agents/${encodeURIComponent(agentId)}/revisions`,
11546
+ apiKey,
11547
+ apiBaseUrl,
11548
+ searchParams
11549
+ });
11550
+ const listParsed = listBuildsResponseSchema2.safeParse(listRaw);
11551
+ if (!listParsed.success) {
11552
+ throw new CliError(
11553
+ `Unexpected response from the API: ${listParsed.error.message}`
11554
+ );
11555
+ }
11556
+ const latest = listParsed.data.builds[0];
11557
+ if (!latest) {
11558
+ throw new CliError(
11559
+ "This agent has no revisions yet. Create one with `duvo builds create` first."
11560
+ );
11561
+ }
11562
+ const config = buildConfigWithModel(latest.config, model);
11563
+ const raw = await httpRequest({
11564
+ method: "PATCH",
11565
+ path: `/v2/revisions/${encodeURIComponent(latest.id)}`,
11566
+ apiKey,
11567
+ apiBaseUrl,
11568
+ body: { config }
11569
+ });
11570
+ if (options.json) {
11571
+ printJson(raw);
11572
+ return;
11573
+ }
11574
+ console.log(green("Model updated!"));
11575
+ console.log(
11576
+ renderKeyValue([
11577
+ { label: "Agent", value: agentId },
11578
+ { label: "Revision", value: latest.id },
11579
+ { label: "Model", value: model }
11580
+ ])
11581
+ );
11582
+ }, "setModelAction"));
11583
+ }
11584
+ __name(registerAgentsSetModel, "registerAgentsSetModel");
11585
+
10863
11586
  // src/api/trigger-schemas.ts
10864
- import { z as z69 } from "zod";
10865
- var triggerSchema = z69.object({
10866
- id: z69.string(),
10867
- agent_id: z69.string(),
10868
- user_id: z69.string(),
10869
- integration_slug: z69.string(),
10870
- trigger_type: z69.string(),
10871
- filter_config: z69.record(z69.string(), z69.unknown()),
10872
- integration_instance_id: z69.string(),
10873
- enabled: z69.boolean(),
10874
- created_at: z69.string(),
10875
- updated_at: z69.string()
10876
- });
10877
- var listTriggersResponseSchema = z69.object({
10878
- triggers: z69.array(triggerSchema)
10879
- });
10880
- var triggerTypeSchema = z69.object({
10881
- integration_slug: z69.string(),
10882
- integration_name: z69.string(),
10883
- icon_url: z69.string(),
10884
- trigger_type: z69.string(),
10885
- label: z69.string(),
10886
- description: z69.string(),
10887
- filter_schema: z69.record(z69.string(), z69.unknown())
10888
- });
10889
- var listTriggerTypesResponseSchema = z69.object({
10890
- trigger_types: z69.array(triggerTypeSchema)
11587
+ import { z as z72 } from "zod";
11588
+ var triggerSchema = z72.object({
11589
+ id: z72.string(),
11590
+ agent_id: z72.string(),
11591
+ user_id: z72.string(),
11592
+ integration_slug: z72.string(),
11593
+ trigger_type: z72.string(),
11594
+ filter_config: z72.record(z72.string(), z72.unknown()),
11595
+ integration_instance_id: z72.string(),
11596
+ enabled: z72.boolean(),
11597
+ created_at: z72.string(),
11598
+ updated_at: z72.string()
11599
+ });
11600
+ var listTriggersResponseSchema = z72.object({
11601
+ triggers: z72.array(triggerSchema)
11602
+ });
11603
+ var triggerTypeSchema = z72.object({
11604
+ integration_slug: z72.string(),
11605
+ integration_name: z72.string(),
11606
+ icon_url: z72.string(),
11607
+ trigger_type: z72.string(),
11608
+ label: z72.string(),
11609
+ description: z72.string(),
11610
+ filter_schema: z72.record(z72.string(), z72.unknown())
11611
+ });
11612
+ var listTriggerTypesResponseSchema = z72.object({
11613
+ trigger_types: z72.array(triggerTypeSchema)
10891
11614
  });
10892
11615
 
10893
11616
  // src/commands/agents/triggers/list.ts
10894
11617
  var FILTER_PREVIEW_WIDTH = 40;
10895
- var TABLE_COLUMNS7 = [
11618
+ var TABLE_COLUMNS8 = [
10896
11619
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
10897
11620
  { header: "INTEGRATION", cell: /* @__PURE__ */ __name((row) => row.integration_slug, "cell") },
10898
11621
  { header: "TRIGGER TYPE", cell: /* @__PURE__ */ __name((row) => row.trigger_type, "cell") },
@@ -10936,7 +11659,7 @@ function registerAgentsTriggersList(triggers) {
10936
11659
  console.log("No triggers found.");
10937
11660
  return;
10938
11661
  }
10939
- console.log(renderTable(TABLE_COLUMNS7, rows));
11662
+ console.log(renderTable(TABLE_COLUMNS8, rows));
10940
11663
  console.log(`Showing ${rows.length}`);
10941
11664
  }, "listAction"));
10942
11665
  }
@@ -11018,7 +11741,7 @@ __name(registerAgentsTriggersSet, "registerAgentsTriggersSet");
11018
11741
 
11019
11742
  // src/commands/agents/triggers/types.ts
11020
11743
  var DESCRIPTION_PREVIEW_WIDTH = 50;
11021
- var TABLE_COLUMNS8 = [
11744
+ var TABLE_COLUMNS9 = [
11022
11745
  { header: "INTEGRATION", cell: /* @__PURE__ */ __name((row) => row.integration_slug, "cell") },
11023
11746
  { header: "TRIGGER TYPE", cell: /* @__PURE__ */ __name((row) => row.trigger_type, "cell") },
11024
11747
  { header: "LABEL", cell: /* @__PURE__ */ __name((row) => row.label, "cell") },
@@ -11055,7 +11778,7 @@ function registerAgentsTriggersTypes(triggers) {
11055
11778
  console.log("No trigger types available.");
11056
11779
  return;
11057
11780
  }
11058
- console.log(renderTable(TABLE_COLUMNS8, rows));
11781
+ console.log(renderTable(TABLE_COLUMNS9, rows));
11059
11782
  console.log(`Showing ${rows.length}`);
11060
11783
  }, "typesAction"));
11061
11784
  }
@@ -11201,6 +11924,8 @@ function registerAgents(program) {
11201
11924
  registerAgentsGet(agents);
11202
11925
  registerAgentsCreate(agents);
11203
11926
  registerAgentsUpdate(agents);
11927
+ registerAgentsModels(agents);
11928
+ registerAgentsSetModel(agents);
11204
11929
  registerAgentsDelete(agents);
11205
11930
  registerAgentsSchedules(agents);
11206
11931
  registerAgentsCaseTriggers(agents);
@@ -11507,55 +12232,55 @@ function fieldsToSearchParams(fields) {
11507
12232
  __name(fieldsToSearchParams, "fieldsToSearchParams");
11508
12233
 
11509
12234
  // src/api/integration-schemas.ts
11510
- import { z as z70 } from "zod";
11511
- var integrationSchema = z70.object({
11512
- id: z70.string(),
11513
- name: z70.string(),
11514
- type: z70.string(),
11515
- provider: z70.string(),
11516
- user_id: z70.string().nullable(),
11517
- team_id: z70.string(),
11518
- server_url: z70.string().optional(),
11519
- transport_type: z70.string().optional(),
11520
- auth_method: z70.string().nullish(),
11521
- composio_mcp_id: z70.string().nullish(),
11522
- custom_integration_id: z70.string().nullish(),
11523
- icon_url: z70.string().nullish(),
11524
- oauth_provider: z70.string().nullish(),
11525
- oauth_provider_key: z70.string().nullish(),
11526
- oauth_scopes: z70.array(z70.string()).nullish(),
11527
- integration_id: z70.string().nullish(),
11528
- created_at: z70.string(),
11529
- updated_at: z70.string()
11530
- });
11531
- var integrationsListResponseSchema2 = z70.object({
11532
- integrations: z70.array(integrationSchema)
12235
+ import { z as z73 } from "zod";
12236
+ var integrationSchema = z73.object({
12237
+ id: z73.string(),
12238
+ name: z73.string(),
12239
+ type: z73.string(),
12240
+ provider: z73.string(),
12241
+ user_id: z73.string().nullable(),
12242
+ team_id: z73.string(),
12243
+ server_url: z73.string().optional(),
12244
+ transport_type: z73.string().optional(),
12245
+ auth_method: z73.string().nullish(),
12246
+ composio_mcp_id: z73.string().nullish(),
12247
+ custom_integration_id: z73.string().nullish(),
12248
+ icon_url: z73.string().nullish(),
12249
+ oauth_provider: z73.string().nullish(),
12250
+ oauth_provider_key: z73.string().nullish(),
12251
+ oauth_scopes: z73.array(z73.string()).nullish(),
12252
+ integration_id: z73.string().nullish(),
12253
+ created_at: z73.string(),
12254
+ updated_at: z73.string()
12255
+ });
12256
+ var integrationsListResponseSchema2 = z73.object({
12257
+ integrations: z73.array(integrationSchema)
11533
12258
  });
11534
12259
  var connectionResponseSchema = integrationSchema;
11535
- var buildIntegrationConfigSchema2 = z70.object({
11536
- id: z70.string(),
11537
- integration_id: z70.string().nullable(),
11538
- custom_integration_id: z70.string().nullable(),
11539
- integration_type: z70.string(),
11540
- integration_name: z70.string(),
11541
- created_at: z70.string()
12260
+ var buildIntegrationConfigSchema2 = z73.object({
12261
+ id: z73.string(),
12262
+ integration_id: z73.string().nullable(),
12263
+ custom_integration_id: z73.string().nullable(),
12264
+ integration_type: z73.string(),
12265
+ integration_name: z73.string(),
12266
+ created_at: z73.string()
11542
12267
  });
11543
- var listBuildIntegrationsResponseSchema2 = z70.object({
11544
- integrations: z70.array(buildIntegrationConfigSchema2)
12268
+ var listBuildIntegrationsResponseSchema2 = z73.object({
12269
+ integrations: z73.array(buildIntegrationConfigSchema2)
11545
12270
  });
11546
- var attachBuildIntegrationsResponseSchema = z70.object({
11547
- success: z70.boolean(),
11548
- count: z70.number()
12271
+ var attachBuildIntegrationsResponseSchema = z73.object({
12272
+ success: z73.boolean(),
12273
+ count: z73.number()
11549
12274
  });
11550
- var buildIntegrationConnectionSchema = z70.object({
11551
- connection_id: z70.string(),
11552
- created_at: z70.string()
12275
+ var buildIntegrationConnectionSchema = z73.object({
12276
+ connection_id: z73.string(),
12277
+ created_at: z73.string()
11553
12278
  });
11554
- var listBuildIntegrationConnectionsResponseSchema = z70.object({
11555
- connections: z70.array(buildIntegrationConnectionSchema)
12279
+ var listBuildIntegrationConnectionsResponseSchema = z73.object({
12280
+ connections: z73.array(buildIntegrationConnectionSchema)
11556
12281
  });
11557
- var successResponseSchema = z70.object({
11558
- success: z70.boolean()
12282
+ var successResponseSchema = z73.object({
12283
+ success: z73.boolean()
11559
12284
  });
11560
12285
 
11561
12286
  // src/commands/build-integrations/attach.ts
@@ -11598,17 +12323,17 @@ function registerBuildIntegrationsAttach(buildIntegrations) {
11598
12323
  __name(registerBuildIntegrationsAttach, "registerBuildIntegrationsAttach");
11599
12324
 
11600
12325
  // src/commands/build-integrations/case-queue-setup.ts
11601
- import { z as z71 } from "zod";
11602
- var slotSchema = z71.object({
11603
- config_id: z71.string(),
11604
- integration_type: z71.string(),
11605
- linked_queue_count: z71.number()
12326
+ import { z as z74 } from "zod";
12327
+ var slotSchema = z74.object({
12328
+ config_id: z74.string(),
12329
+ integration_type: z74.string(),
12330
+ linked_queue_count: z74.number()
11606
12331
  });
11607
- var responseSchema2 = z71.object({
11608
- configs: z71.array(slotSchema),
11609
- has_available_queues: z71.boolean()
12332
+ var responseSchema2 = z74.object({
12333
+ configs: z74.array(slotSchema),
12334
+ has_available_queues: z74.boolean()
11610
12335
  });
11611
- var TABLE_COLUMNS9 = [
12336
+ var TABLE_COLUMNS10 = [
11612
12337
  { header: "SLOT ID", cell: /* @__PURE__ */ __name((row) => row.config_id, "cell") },
11613
12338
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.integration_type, "cell") },
11614
12339
  { header: "QUEUES", cell: /* @__PURE__ */ __name((row) => String(row.linked_queue_count), "cell") },
@@ -11643,7 +12368,7 @@ function registerBuildIntegrationsCaseQueueSetup(buildIntegrations) {
11643
12368
  console.log("No case-queue integration slots on this revision.");
11644
12369
  return;
11645
12370
  }
11646
- console.log(renderTable(TABLE_COLUMNS9, configs));
12371
+ console.log(renderTable(TABLE_COLUMNS10, configs));
11647
12372
  const unmapped = configs.filter((slot) => slot.linked_queue_count === 0);
11648
12373
  if (unmapped.length > 0) {
11649
12374
  console.log(
@@ -11662,7 +12387,7 @@ function registerBuildIntegrationsCaseQueueSetup(buildIntegrations) {
11662
12387
  __name(registerBuildIntegrationsCaseQueueSetup, "registerBuildIntegrationsCaseQueueSetup");
11663
12388
 
11664
12389
  // src/commands/build-integrations/connections-list.ts
11665
- var TABLE_COLUMNS10 = [
12390
+ var TABLE_COLUMNS11 = [
11666
12391
  {
11667
12392
  header: "CONNECTION ID",
11668
12393
  cell: /* @__PURE__ */ __name((row) => row.connection_id, "cell")
@@ -11701,7 +12426,7 @@ function registerBuildIntegrationsConnectionsList(connections) {
11701
12426
  console.log("No connections pinned to this slot.");
11702
12427
  return;
11703
12428
  }
11704
- console.log(renderTable(TABLE_COLUMNS10, rows));
12429
+ console.log(renderTable(TABLE_COLUMNS11, rows));
11705
12430
  console.log(`Showing ${rows.length}`);
11706
12431
  }, "listAction"));
11707
12432
  }
@@ -11771,7 +12496,7 @@ function registerBuildIntegrationsConnectionsUnpin(connections) {
11771
12496
  __name(registerBuildIntegrationsConnectionsUnpin, "registerBuildIntegrationsConnectionsUnpin");
11772
12497
 
11773
12498
  // src/commands/build-integrations/list.ts
11774
- var TABLE_COLUMNS11 = [
12499
+ var TABLE_COLUMNS12 = [
11775
12500
  {
11776
12501
  header: "INTEGRATION ID",
11777
12502
  cell: /* @__PURE__ */ __name((row) => row.integration_id ?? row.custom_integration_id ?? "", "cell")
@@ -11811,14 +12536,14 @@ function registerBuildIntegrationsList(buildIntegrations) {
11811
12536
  console.log("No integrations attached to this revision.");
11812
12537
  return;
11813
12538
  }
11814
- console.log(renderTable(TABLE_COLUMNS11, integrations));
12539
+ console.log(renderTable(TABLE_COLUMNS12, integrations));
11815
12540
  console.log(`Showing ${integrations.length}`);
11816
12541
  }, "listAction"));
11817
12542
  }
11818
12543
  __name(registerBuildIntegrationsList, "registerBuildIntegrationsList");
11819
12544
 
11820
12545
  // src/commands/build-integrations/queues-list.ts
11821
- var TABLE_COLUMNS12 = [
12546
+ var TABLE_COLUMNS13 = [
11822
12547
  { header: "QUEUE ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
11823
12548
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") }
11824
12549
  ];
@@ -11850,14 +12575,14 @@ function registerBuildIntegrationsQueuesList(queues) {
11850
12575
  console.log("No case queues linked to this integration slot.");
11851
12576
  return;
11852
12577
  }
11853
- console.log(renderTable(TABLE_COLUMNS12, parsed.data.queues));
12578
+ console.log(renderTable(TABLE_COLUMNS13, parsed.data.queues));
11854
12579
  console.log(`Showing ${parsed.data.queues.length}`);
11855
12580
  }, "listAction"));
11856
12581
  }
11857
12582
  __name(registerBuildIntegrationsQueuesList, "registerBuildIntegrationsQueuesList");
11858
12583
 
11859
12584
  // src/commands/build-integrations/queues-set.ts
11860
- var TABLE_COLUMNS13 = [
12585
+ var TABLE_COLUMNS14 = [
11861
12586
  { header: "QUEUE ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
11862
12587
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") }
11863
12588
  ];
@@ -11899,7 +12624,7 @@ function registerBuildIntegrationsQueuesSet(queues) {
11899
12624
  green(`Linked ${parsed.data.queues.length} case queue(s) to the slot.`)
11900
12625
  );
11901
12626
  if (parsed.data.queues.length > 0) {
11902
- console.log(renderTable(TABLE_COLUMNS13, parsed.data.queues));
12627
+ console.log(renderTable(TABLE_COLUMNS14, parsed.data.queues));
11903
12628
  }
11904
12629
  }, "setAction"));
11905
12630
  }
@@ -11957,47 +12682,6 @@ function registerBuildIntegrations(program) {
11957
12682
  }
11958
12683
  __name(registerBuildIntegrations, "registerBuildIntegrations");
11959
12684
 
11960
- // src/api/build-schemas.ts
11961
- import { z as z73 } from "zod";
11962
-
11963
- // src/api/json-value.ts
11964
- import { z as z72 } from "zod";
11965
- var jsonValueSchema = z72.lazy(
11966
- () => z72.union([
11967
- z72.string(),
11968
- z72.number(),
11969
- z72.boolean(),
11970
- z72.null(),
11971
- z72.array(jsonValueSchema),
11972
- z72.record(z72.string(), jsonValueSchema)
11973
- ])
11974
- );
11975
-
11976
- // src/api/build-schemas.ts
11977
- var publicBuildSchema2 = z73.object({
11978
- id: z73.string(),
11979
- agent_id: z73.string(),
11980
- name: z73.string(),
11981
- status: z73.string().nullish(),
11982
- config: jsonValueSchema.nullish(),
11983
- revision_number: z73.number().nullish(),
11984
- created_at: z73.string().nullish(),
11985
- updated_at: z73.string().nullish()
11986
- });
11987
- var listBuildsResponseSchema2 = z73.object({
11988
- builds: z73.array(publicBuildSchema2),
11989
- total: z73.number().nullish(),
11990
- limit: z73.number().nullish(),
11991
- offset: z73.number().nullish()
11992
- });
11993
- var getBuildResponseSchema = z73.object({
11994
- build: publicBuildSchema2
11995
- });
11996
- var createBuildResponseSchema = z73.object({
11997
- build: publicBuildSchema2,
11998
- agent: z73.object({ id: z73.string() })
11999
- });
12000
-
12001
12685
  // src/commands/builds/create.ts
12002
12686
  function registerBuildsCreate(builds) {
12003
12687
  builds.command("create").description("Create a new revision for an existing agent").requiredOption("--agent <id>", "ID of the agent this revision belongs to").requiredOption("--name <text>", "revision name").requiredOption(
@@ -12089,7 +12773,7 @@ __name(registerBuildsGet, "registerBuildsGet");
12089
12773
  var DEFAULT_LIMIT2 = 20;
12090
12774
  var MIN_LIMIT2 = 1;
12091
12775
  var MAX_LIMIT2 = 100;
12092
- var TABLE_COLUMNS14 = [
12776
+ var TABLE_COLUMNS15 = [
12093
12777
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
12094
12778
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
12095
12779
  {
@@ -12132,7 +12816,7 @@ function registerBuildsList(builds) {
12132
12816
  console.log("No revisions found.");
12133
12817
  return;
12134
12818
  }
12135
- console.log(renderTable(TABLE_COLUMNS14, response.builds));
12819
+ console.log(renderTable(TABLE_COLUMNS15, response.builds));
12136
12820
  const resolvedOffset = response.offset ?? offset;
12137
12821
  const total = response.total ?? null;
12138
12822
  const summary = total === null ? `Showing ${response.builds.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.builds.length} of ${total} \xB7 offset ${resolvedOffset}`;
@@ -12142,9 +12826,9 @@ function registerBuildsList(builds) {
12142
12826
  __name(registerBuildsList, "registerBuildsList");
12143
12827
 
12144
12828
  // src/commands/builds/promote.ts
12145
- import { z as z74 } from "zod";
12146
- var promoteResponseSchema = z74.object({
12147
- success: z74.boolean()
12829
+ import { z as z75 } from "zod";
12830
+ var promoteResponseSchema = z75.object({
12831
+ success: z75.boolean()
12148
12832
  });
12149
12833
  function registerBuildsPromote(builds) {
12150
12834
  builds.command("promote <id>").description(
@@ -12270,50 +12954,6 @@ function parseCaseIds(raw) {
12270
12954
  }
12271
12955
  __name(parseCaseIds, "parseCaseIds");
12272
12956
 
12273
- // src/commands/cases/bulk-delegate.ts
12274
- function registerCasesBulkDelegate(cases) {
12275
- cases.command("bulk-delegate").description(
12276
- "Delegate multiple cases to a chosen agent (1-100). Interrupts any active runs."
12277
- ).requiredOption("--queue <id>", "ID of the queue the cases belong to").requiredOption(
12278
- "--agent <id>",
12279
- "agent ID to delegate to (must be a queue consumer; list via `duvo queues agents <queue-id>`)"
12280
- ).requiredOption("--ids <list>", "comma-separated case IDs (1-100)").option("-y, --yes", "skip confirmation prompt").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function bulkDelegateAction(options) {
12281
- const caseIds = parseCaseIds(options.ids);
12282
- const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
12283
- await confirmDestructive({
12284
- message: `Delegate ${caseIds.length} case(s) in queue "${options.queue}" to agent "${options.agent}"?`,
12285
- skip: Boolean(options.yes)
12286
- });
12287
- const raw = await httpRequest({
12288
- method: "POST",
12289
- path: `/v2/queues/${encodeURIComponent(options.queue)}/cases/bulk-delegate`,
12290
- apiKey,
12291
- apiBaseUrl,
12292
- body: { case_ids: caseIds, agent_id: options.agent }
12293
- });
12294
- if (options.json) {
12295
- printJson(raw);
12296
- return;
12297
- }
12298
- const parsed = caseBulkDelegateResponseSchema.safeParse(raw);
12299
- if (!parsed.success) {
12300
- throw new CliError(
12301
- `Unexpected response from the API: ${parsed.error.message}`
12302
- );
12303
- }
12304
- const result = parsed.data;
12305
- console.log(green("Bulk delegate complete."));
12306
- console.log();
12307
- console.log(
12308
- renderKeyValue([
12309
- { label: "Delegated", value: String(result.delegatedCount) },
12310
- { label: "Skipped", value: String(result.skippedCount) }
12311
- ])
12312
- );
12313
- }, "bulkDelegateAction"));
12314
- }
12315
- __name(registerCasesBulkDelegate, "registerCasesBulkDelegate");
12316
-
12317
12957
  // src/commands/cases/bulk-delete.ts
12318
12958
  function registerCasesBulkDelete(cases) {
12319
12959
  cases.command("bulk-delete").description(
@@ -12413,46 +13053,49 @@ async function fetchCaseTitles(ids, apiKey, apiBaseUrl) {
12413
13053
  }
12414
13054
  __name(fetchCaseTitles, "fetchCaseTitles");
12415
13055
 
12416
- // src/commands/cases/bulk-retry.ts
12417
- function registerCasesBulkRetry(cases) {
12418
- cases.command("bulk-retry").description(
12419
- "Retry multiple cases by resetting them to pending (1-100). Interrupts any active runs."
12420
- ).requiredOption("--queue <id>", "ID of the queue the cases belong to").requiredOption("--ids <list>", "comma-separated case IDs (1-100)").option("-y, --yes", "skip confirmation prompt").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function bulkRetryAction(options) {
13056
+ // src/commands/cases/bulk-reprocess.ts
13057
+ function registerCasesBulkReprocess(cases) {
13058
+ cases.command("bulk-reprocess").description(
13059
+ "Re-process multiple cases on a chosen agent (1-100). Interrupts any active runs."
13060
+ ).requiredOption("--queue <id>", "ID of the queue the cases belong to").requiredOption(
13061
+ "--agent <id>",
13062
+ "agent ID to re-process on (must be a queue consumer; list via `duvo queues agents <queue-id>`)"
13063
+ ).requiredOption("--ids <list>", "comma-separated case IDs (1-100)").option("-y, --yes", "skip confirmation prompt").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function bulkReprocessAction(options) {
12421
13064
  const caseIds = parseCaseIds(options.ids);
12422
13065
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
12423
13066
  await confirmDestructive({
12424
- message: `Retry ${caseIds.length} case(s) in queue "${options.queue}"?`,
13067
+ message: `Re-process ${caseIds.length} case(s) in queue "${options.queue}" on agent "${options.agent}"?`,
12425
13068
  skip: Boolean(options.yes)
12426
13069
  });
12427
13070
  const raw = await httpRequest({
12428
13071
  method: "POST",
12429
- path: `/v2/queues/${encodeURIComponent(options.queue)}/cases/bulk-retry`,
13072
+ path: `/v2/queues/${encodeURIComponent(options.queue)}/cases/bulk-reprocess`,
12430
13073
  apiKey,
12431
13074
  apiBaseUrl,
12432
- body: { case_ids: caseIds }
13075
+ body: { case_ids: caseIds, agent_id: options.agent }
12433
13076
  });
12434
13077
  if (options.json) {
12435
13078
  printJson(raw);
12436
13079
  return;
12437
13080
  }
12438
- const parsed = caseBulkRetryResponseSchema.safeParse(raw);
13081
+ const parsed = caseBulkReprocessResponseSchema.safeParse(raw);
12439
13082
  if (!parsed.success) {
12440
13083
  throw new CliError(
12441
13084
  `Unexpected response from the API: ${parsed.error.message}`
12442
13085
  );
12443
13086
  }
12444
13087
  const result = parsed.data;
12445
- console.log(green("Bulk retry complete."));
13088
+ console.log(green("Bulk reprocess complete."));
12446
13089
  console.log();
12447
13090
  console.log(
12448
13091
  renderKeyValue([
12449
- { label: "Retried", value: String(result.retriedCount) },
13092
+ { label: "Re-processed", value: String(result.reprocessedCount) },
12450
13093
  { label: "Skipped", value: String(result.skippedCount) }
12451
13094
  ])
12452
13095
  );
12453
- }, "bulkRetryAction"));
13096
+ }, "bulkReprocessAction"));
12454
13097
  }
12455
- __name(registerCasesBulkRetry, "registerCasesBulkRetry");
13098
+ __name(registerCasesBulkReprocess, "registerCasesBulkReprocess");
12456
13099
 
12457
13100
  // src/commands/cases/bulk-update-status.ts
12458
13101
  var CASE_TERMINAL_STATUSES = ["completed", "failed"];
@@ -12603,7 +13246,7 @@ __name(fetchQueueCaseCount, "fetchQueueCaseCount");
12603
13246
 
12604
13247
  // src/commands/cases/create.ts
12605
13248
  import { readFile as readFile4 } from "node:fs/promises";
12606
- var TABLE_COLUMNS15 = [
13249
+ var TABLE_COLUMNS16 = [
12607
13250
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
12608
13251
  { header: "TITLE", cell: /* @__PURE__ */ __name((row) => row.title, "cell"), maxWidth: 50 },
12609
13252
  { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") }
@@ -12646,7 +13289,7 @@ function registerCasesCreate(cases) {
12646
13289
  )
12647
13290
  );
12648
13291
  console.log();
12649
- console.log(renderTable(TABLE_COLUMNS15, addedCases));
13292
+ console.log(renderTable(TABLE_COLUMNS16, addedCases));
12650
13293
  }, "createAction"));
12651
13294
  }
12652
13295
  __name(registerCasesCreate, "registerCasesCreate");
@@ -12881,7 +13524,7 @@ __name(registerCasesGet, "registerCasesGet");
12881
13524
 
12882
13525
  // src/commands/cases/labels.ts
12883
13526
  var MAX_LABELS_PER_REQUEST = 50;
12884
- var TABLE_COLUMNS16 = [
13527
+ var TABLE_COLUMNS17 = [
12885
13528
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
12886
13529
  { header: "KEY", cell: /* @__PURE__ */ __name((row) => row.key, "cell") },
12887
13530
  { header: "VALUE", cell: /* @__PURE__ */ __name((row) => row.value, "cell") },
@@ -12911,7 +13554,7 @@ function registerCasesLabels(cases) {
12911
13554
  console.log("No labels assigned.");
12912
13555
  return;
12913
13556
  }
12914
- console.log(renderTable(TABLE_COLUMNS16, parsed.data.labels));
13557
+ console.log(renderTable(TABLE_COLUMNS17, parsed.data.labels));
12915
13558
  console.log(`Showing ${parsed.data.labels.length}`);
12916
13559
  }, "listAction"));
12917
13560
  labels.command("assign <case-id>").description(
@@ -12951,7 +13594,7 @@ function registerCasesLabels(cases) {
12951
13594
  );
12952
13595
  }
12953
13596
  console.log(green("Labels assigned!"));
12954
- console.log(renderTable(TABLE_COLUMNS16, parsed.data.labels));
13597
+ console.log(renderTable(TABLE_COLUMNS17, parsed.data.labels));
12955
13598
  }, "assignAction"));
12956
13599
  labels.command("unlink <case-id>").description(
12957
13600
  "Remove one or more labels from a case (by --label-id or --label key=value, for symmetry with assign)"
@@ -13069,7 +13712,7 @@ var MIN_LIMIT3 = 1;
13069
13712
  var MAX_LIMIT3 = 100;
13070
13713
  var SORT_FIELDS = ["created_at", "updated_at", "postponed_to"];
13071
13714
  var SORT_ORDERS = ["asc", "desc"];
13072
- var TABLE_COLUMNS17 = [
13715
+ var TABLE_COLUMNS18 = [
13073
13716
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
13074
13717
  { header: "TITLE", cell: /* @__PURE__ */ __name((row) => row.title, "cell"), maxWidth: 50 },
13075
13718
  { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
@@ -13142,7 +13785,7 @@ function registerCasesList(cases) {
13142
13785
  console.log("No cases found.");
13143
13786
  return;
13144
13787
  }
13145
- console.log(renderTable(TABLE_COLUMNS17, response.cases));
13788
+ console.log(renderTable(TABLE_COLUMNS18, response.cases));
13146
13789
  const resolvedOffset = response.offset ?? offset;
13147
13790
  const total = response.total ?? null;
13148
13791
  const summary = total === null ? `Showing ${response.cases.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.cases.length} of ${total} \xB7 offset ${resolvedOffset}`;
@@ -13196,7 +13839,7 @@ function parseSortOrder(raw) {
13196
13839
  __name(parseSortOrder, "parseSortOrder");
13197
13840
 
13198
13841
  // src/commands/cases/runs.ts
13199
- import { z as z75 } from "zod";
13842
+ import { z as z76 } from "zod";
13200
13843
  var MIN_LIMIT4 = 1;
13201
13844
  var MAX_LIMIT4 = 10;
13202
13845
  var DEFAULT_LIMIT4 = 3;
@@ -13214,17 +13857,17 @@ var RUNS_TABLE_COLUMNS = [
13214
13857
  cell: /* @__PURE__ */ __name((row) => row.has_pending_human_request ? row.pending_human_request_title ?? "(unknown)" : "", "cell")
13215
13858
  }
13216
13859
  ];
13217
- var recentMessageSchema = z75.object({
13218
- id: z75.string(),
13219
- type: z75.string(),
13220
- role: z75.string(),
13221
- timestamp: z75.string(),
13222
- text_content: z75.string().nullish(),
13223
- tool_call: z75.object({ id: z75.string(), name: z75.string() }).passthrough().nullish(),
13224
- tool_result: z75.object({ tool_call_id: z75.string() }).passthrough().nullish()
13225
- });
13226
- var recentMessagesResponseSchema = z75.object({
13227
- messages: z75.array(recentMessageSchema)
13860
+ var recentMessageSchema = z76.object({
13861
+ id: z76.string(),
13862
+ type: z76.string(),
13863
+ role: z76.string(),
13864
+ timestamp: z76.string(),
13865
+ text_content: z76.string().nullish(),
13866
+ tool_call: z76.object({ id: z76.string(), name: z76.string() }).passthrough().nullish(),
13867
+ tool_result: z76.object({ tool_call_id: z76.string() }).passthrough().nullish()
13868
+ });
13869
+ var recentMessagesResponseSchema = z76.object({
13870
+ messages: z76.array(recentMessageSchema)
13228
13871
  });
13229
13872
  var TEXT_PREVIEW_WIDTH = 60;
13230
13873
  var MESSAGES_TABLE_COLUMNS = [
@@ -13345,53 +13988,541 @@ function registerCases(program) {
13345
13988
  registerCasesDelete(cases);
13346
13989
  registerCasesClear(cases);
13347
13990
  registerCasesBulkDelete(cases);
13348
- registerCasesBulkRetry(cases);
13991
+ registerCasesBulkReprocess(cases);
13349
13992
  registerCasesBulkUpdateStatus(cases);
13350
- registerCasesBulkDelegate(cases);
13351
13993
  registerCasesRuns(cases);
13352
13994
  registerCasesLabels(cases);
13353
13995
  }
13354
13996
  __name(registerCases, "registerCases");
13355
13997
 
13356
13998
  // src/commands/clarity/index.ts
13357
- import { z as z79 } from "zod";
13999
+ import { z as z84 } from "zod";
13358
14000
 
13359
- // src/commands/clarity/render.ts
13360
- var DEFAULT_HUMAN_SUMMARY_LIMIT = 1200;
13361
- var PROCESS_TABLE_COLUMNS = [
13362
- { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
13363
- { header: "VERSION", cell: /* @__PURE__ */ __name((row) => String(row.version), "cell") },
13364
- { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
14001
+ // src/api/clarity-schemas.ts
14002
+ import { z as z77 } from "zod";
14003
+ var clarityListProcessSchema = z77.object({
14004
+ id: z77.guid(),
14005
+ name: z77.string(),
14006
+ status: clarityProcessStatusSchema,
14007
+ visibility: clarityProcessVisibilitySchema,
14008
+ version: z77.number().int(),
14009
+ capture_count: z77.number().int(),
14010
+ capture_counts: z77.object({
14011
+ video: z77.number().int(),
14012
+ interview: z77.number().int(),
14013
+ document: z77.number().int()
14014
+ }).optional(),
14015
+ pending_invitation_count: z77.number().int(),
14016
+ contributors: z77.array(
14017
+ z77.object({
14018
+ user_id: z77.string(),
14019
+ user_name: z77.string()
14020
+ })
14021
+ ),
14022
+ created_at: z77.string(),
14023
+ created_by_name: z77.string().nullable()
14024
+ });
14025
+ var listClarityProcessesResponseSchema = z77.object({
14026
+ processes: z77.array(clarityListProcessSchema),
14027
+ total: z77.number().int(),
14028
+ limit: z77.number().int(),
14029
+ offset: z77.number().int()
14030
+ });
14031
+ var createClarityInviteLinkResponseSchema = z77.object({
14032
+ invite_link: z77.object({
14033
+ id: z77.guid(),
14034
+ url: z77.url(),
14035
+ created_at: z77.string(),
14036
+ created_by: z77.object({
14037
+ id: z77.guid(),
14038
+ email: z77.email().nullable()
14039
+ })
14040
+ })
14041
+ });
14042
+ var createArtifactImportUploadUrlResponseSchema = z77.object({
14043
+ signed_url: z77.url(),
14044
+ capture_id: z77.guid(),
14045
+ expires_at: z77.iso.datetime()
14046
+ });
14047
+ var completeArtifactImportResponseSchema = z77.object({
14048
+ capture: clarityCaptureSchema.extend({
14049
+ createdAt: z77.iso.datetime(),
14050
+ updatedAt: z77.iso.datetime()
14051
+ })
14052
+ });
14053
+ var legacyClarityProcessResponseSchema = legacyClarityProcessDetailSchema;
14054
+
14055
+ // src/commands/clarity/artifact-chat.ts
14056
+ var SNAPSHOT_KIND_CHOICES = claritySnapshotKindSchema.options;
14057
+ var CONVERSATION_COLUMNS = [
13365
14058
  {
13366
- header: "CAPTURES",
13367
- cell: /* @__PURE__ */ __name((row) => String(row.capture_count), "cell")
14059
+ header: "ID",
14060
+ cell: /* @__PURE__ */ __name((row) => row.id, "cell")
13368
14061
  },
13369
14062
  {
13370
- header: "NAME",
13371
- cell: /* @__PURE__ */ __name((row) => row.name, "cell"),
14063
+ header: "SNAPSHOT",
14064
+ cell: /* @__PURE__ */ __name((row) => row.snapshot_kind, "cell")
14065
+ },
14066
+ {
14067
+ header: "STATUS",
14068
+ cell: /* @__PURE__ */ __name((row) => row.status, "cell")
14069
+ },
14070
+ {
14071
+ header: "TITLE",
14072
+ cell: /* @__PURE__ */ __name((row) => row.title ?? "", "cell"),
13372
14073
  maxWidth: 48
14074
+ },
14075
+ {
14076
+ header: "UPDATED",
14077
+ cell: /* @__PURE__ */ __name((row) => row.updated_at, "cell")
13373
14078
  }
13374
14079
  ];
13375
- var CAPTURE_TABLE_COLUMNS = [
13376
- { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
13377
- { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
13378
- { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
14080
+ var MESSAGE_COLUMNS = [
13379
14081
  {
13380
- header: "USABLE",
13381
- cell: /* @__PURE__ */ __name((row) => describeCaptureUsability(row).usable ? "yes" : "no", "cell")
14082
+ header: "ID",
14083
+ cell: /* @__PURE__ */ __name((row) => row.id, "cell")
14084
+ },
14085
+ {
14086
+ header: "ROLE",
14087
+ cell: /* @__PURE__ */ __name((row) => row.role, "cell")
14088
+ },
14089
+ {
14090
+ header: "KIND",
14091
+ cell: /* @__PURE__ */ __name((row) => row.kind, "cell")
13382
14092
  },
13383
- { header: "USER", cell: /* @__PURE__ */ __name((row) => row.userName ?? row.userId, "cell") },
13384
14093
  {
13385
14094
  header: "CREATED",
13386
- cell: /* @__PURE__ */ __name((row) => formatIso(row.createdAt), "cell")
14095
+ cell: /* @__PURE__ */ __name((row) => row.created_at, "cell")
14096
+ },
14097
+ {
14098
+ header: "BODY",
14099
+ cell: /* @__PURE__ */ __name((row) => describeMessageBody(row.body), "cell"),
14100
+ maxWidth: 64
13387
14101
  }
13388
14102
  ];
13389
- function renderProcessTable(rows) {
13390
- return renderTable(PROCESS_TABLE_COLUMNS, rows);
14103
+ function registerClarityArtifactChatConversations(clarity) {
14104
+ clarity.command("artifact-chat-conversations <process-id>").description("List artifact-chat conversations for a v2 process").requiredOption(
14105
+ "--snapshot-kind <current_process|transformation_proposal>",
14106
+ "artifact kind to list conversations for",
14107
+ parseSnapshotKind
14108
+ ).option("--json", "output JSON").action(/* @__PURE__ */ __name(async function action(processId, options) {
14109
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14110
+ const searchParams = new URLSearchParams();
14111
+ searchParams.append("snapshot_kind", options.snapshotKind);
14112
+ const raw = await httpRequest({
14113
+ method: "GET",
14114
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-chat/conversations`,
14115
+ apiKey,
14116
+ apiBaseUrl,
14117
+ searchParams
14118
+ });
14119
+ const parsed = listArtifactChatConversationsResponseSchema.safeParse(raw);
14120
+ if (!parsed.success) {
14121
+ throw new CliError(
14122
+ `Unexpected response from the API: ${parsed.error.message}`
14123
+ );
14124
+ }
14125
+ const response = parsed.data;
14126
+ if (options.json) {
14127
+ printJson(response);
14128
+ return;
14129
+ }
14130
+ if (response.conversations.length === 0) {
14131
+ console.log("No artifact-chat conversations found.");
14132
+ return;
14133
+ }
14134
+ console.log(renderTable(CONVERSATION_COLUMNS, response.conversations));
14135
+ }, "action"));
13391
14136
  }
13392
- __name(renderProcessTable, "renderProcessTable");
13393
- function renderCapturesTable(rows) {
13394
- return renderTable(CAPTURE_TABLE_COLUMNS, rows);
14137
+ __name(registerClarityArtifactChatConversations, "registerClarityArtifactChatConversations");
14138
+ function registerClarityArtifactChatMessages(clarity) {
14139
+ clarity.command("artifact-chat-messages <process-id> <conversation-id>").description("Read messages for one artifact-chat conversation").option("--json", "output JSON").action(/* @__PURE__ */ __name(async function action(processId, conversationId, options) {
14140
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14141
+ const raw = await httpRequest({
14142
+ method: "GET",
14143
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-chat/conversations/${encodeURIComponent(conversationId)}/messages`,
14144
+ apiKey,
14145
+ apiBaseUrl
14146
+ });
14147
+ const parsed = getArtifactChatMessagesResponseSchema.safeParse(raw);
14148
+ if (!parsed.success) {
14149
+ throw new CliError(
14150
+ `Unexpected response from the API: ${parsed.error.message}`
14151
+ );
14152
+ }
14153
+ const response = parsed.data;
14154
+ if (options.json) {
14155
+ printJson(response);
14156
+ return;
14157
+ }
14158
+ const conversation = renderKeyValue([
14159
+ { label: "Conversation", value: response.conversation.id },
14160
+ { label: "Snapshot", value: response.conversation.snapshot_kind },
14161
+ { label: "Status", value: response.conversation.status },
14162
+ { label: "Title", value: response.conversation.title ?? "" }
14163
+ ]);
14164
+ if (response.messages.length === 0) {
14165
+ console.log(`${conversation}
14166
+
14167
+ No artifact-chat messages found.`);
14168
+ return;
14169
+ }
14170
+ console.log(
14171
+ `${conversation}
14172
+
14173
+ ${renderTable(MESSAGE_COLUMNS, response.messages)}`
14174
+ );
14175
+ }, "action"));
14176
+ }
14177
+ __name(registerClarityArtifactChatMessages, "registerClarityArtifactChatMessages");
14178
+ function parseSnapshotKind(value) {
14179
+ const parsed = claritySnapshotKindSchema.safeParse(value);
14180
+ if (!parsed.success) {
14181
+ throw new CliError(
14182
+ `--snapshot-kind must be one of: ${SNAPSHOT_KIND_CHOICES.join(", ")}`
14183
+ );
14184
+ }
14185
+ return parsed.data;
14186
+ }
14187
+ __name(parseSnapshotKind, "parseSnapshotKind");
14188
+ function describeMessageBody(body) {
14189
+ switch (body.kind) {
14190
+ case "text":
14191
+ case "error":
14192
+ case "info":
14193
+ return body.text;
14194
+ case "patch":
14195
+ return `${body.status}: ${body.summary}`;
14196
+ case "hitl_question":
14197
+ return `${body.questions.length} question(s)`;
14198
+ case "hitl_answer":
14199
+ return `${Object.keys(body.answers).length} answer(s)`;
14200
+ }
14201
+ }
14202
+ __name(describeMessageBody, "describeMessageBody");
14203
+
14204
+ // src/commands/clarity/artifact-import.ts
14205
+ import { readFile as readFile5 } from "node:fs/promises";
14206
+ import { basename, extname } from "node:path";
14207
+ var ARTIFACT_CONTENT_TYPES = [
14208
+ "image/svg+xml",
14209
+ "application/xml",
14210
+ "text/xml",
14211
+ "image/png",
14212
+ "image/jpeg"
14213
+ ];
14214
+ var ARTIFACT_UPLOAD_TIMEOUT_MS = 3e5;
14215
+ function registerClarityImportArtifact(clarity) {
14216
+ clarity.command("import-artifact <process-id> <file>").description(
14217
+ "Import a local Miro SVG, XML, PNG, or JPEG export into a Clarity process"
14218
+ ).option("--content-type <type>", "artifact content type").option(
14219
+ "--extra-capture-request-id <id>",
14220
+ "bind the import to an extra-capture request"
14221
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, filePath, options) {
14222
+ const fileName = basename(filePath);
14223
+ const contentType = resolveArtifactContentType(
14224
+ fileName,
14225
+ options.contentType
14226
+ );
14227
+ const config = await requireAuthenticatedConfig(this);
14228
+ const bytes = await readLocalArtifact(filePath);
14229
+ const upload = await createUploadUrl(config, processId, {
14230
+ fileName,
14231
+ contentType,
14232
+ extraCaptureRequestId: options.extraCaptureRequestId
14233
+ });
14234
+ await uploadToSignedUrl(upload.signed_url, bytes, contentType);
14235
+ const complete = await completeArtifactImport(
14236
+ config,
14237
+ processId,
14238
+ upload.capture_id,
14239
+ { fileName, contentType }
14240
+ );
14241
+ if (options.json) {
14242
+ printJson({ upload, complete });
14243
+ return;
14244
+ }
14245
+ renderCompletedImport(complete);
14246
+ }, "action"));
14247
+ }
14248
+ __name(registerClarityImportArtifact, "registerClarityImportArtifact");
14249
+ async function createUploadUrl(config, processId, input) {
14250
+ const body = {
14251
+ file_name: input.fileName,
14252
+ content_type: input.contentType
14253
+ };
14254
+ if (input.extraCaptureRequestId !== void 0) {
14255
+ body.extra_capture_request_id = input.extraCaptureRequestId;
14256
+ }
14257
+ const raw = await httpRequest({
14258
+ method: "POST",
14259
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-imports/create-upload-url`,
14260
+ apiKey: config.apiKey,
14261
+ apiBaseUrl: config.apiBaseUrl,
14262
+ body
14263
+ });
14264
+ const parsed = createArtifactImportUploadUrlResponseSchema.safeParse(raw);
14265
+ if (!parsed.success) {
14266
+ throw new CliError(
14267
+ `Unexpected response from the API: ${parsed.error.message}`
14268
+ );
14269
+ }
14270
+ return parsed.data;
14271
+ }
14272
+ __name(createUploadUrl, "createUploadUrl");
14273
+ async function completeArtifactImport(config, processId, captureId, input) {
14274
+ const raw = await httpRequest({
14275
+ method: "POST",
14276
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/artifact-imports/${encodeURIComponent(captureId)}/complete`,
14277
+ apiKey: config.apiKey,
14278
+ apiBaseUrl: config.apiBaseUrl,
14279
+ body: {
14280
+ file_name: input.fileName,
14281
+ content_type: input.contentType
14282
+ }
14283
+ });
14284
+ const parsed = completeArtifactImportResponseSchema.safeParse(raw);
14285
+ if (!parsed.success) {
14286
+ throw new CliError(
14287
+ `Unexpected response from the API: ${parsed.error.message}`
14288
+ );
14289
+ }
14290
+ return parsed.data;
14291
+ }
14292
+ __name(completeArtifactImport, "completeArtifactImport");
14293
+ async function readLocalArtifact(filePath) {
14294
+ try {
14295
+ return await readFile5(filePath);
14296
+ } catch (error) {
14297
+ const message = error instanceof Error ? error.message : String(error);
14298
+ throw new CliError(`Cannot read "${filePath}": ${message}`);
14299
+ }
14300
+ }
14301
+ __name(readLocalArtifact, "readLocalArtifact");
14302
+ async function uploadToSignedUrl(signedUrl, bytes, contentType) {
14303
+ let response;
14304
+ try {
14305
+ response = await fetch(signedUrl, {
14306
+ method: "PUT",
14307
+ headers: { "Content-Type": contentType },
14308
+ body: new Uint8Array(bytes),
14309
+ signal: AbortSignal.timeout(ARTIFACT_UPLOAD_TIMEOUT_MS)
14310
+ });
14311
+ } catch (error) {
14312
+ const message = error instanceof Error ? error.message : String(error);
14313
+ throw new CliError(`Artifact upload failed: ${message}`);
14314
+ }
14315
+ if (!response.ok) {
14316
+ const text3 = await response.text().catch(() => "");
14317
+ throw new CliError(
14318
+ `Artifact upload failed with HTTP ${response.status}${text3 ? `: ${text3}` : ""}`
14319
+ );
14320
+ }
14321
+ }
14322
+ __name(uploadToSignedUrl, "uploadToSignedUrl");
14323
+ function resolveArtifactContentType(fileName, contentType) {
14324
+ if (contentType !== void 0) {
14325
+ return parseArtifactContentType(contentType);
14326
+ }
14327
+ const extension = extname(fileName).toLowerCase();
14328
+ if (extension === ".svg") {
14329
+ return "image/svg+xml";
14330
+ }
14331
+ if (extension === ".xml") {
14332
+ return "application/xml";
14333
+ }
14334
+ if (extension === ".png") {
14335
+ return "image/png";
14336
+ }
14337
+ if (extension === ".jpg" || extension === ".jpeg") {
14338
+ return "image/jpeg";
14339
+ }
14340
+ throw new CliError(
14341
+ "Cannot infer content type. Supported extensions: .svg, .xml, .png, .jpg, .jpeg."
14342
+ );
14343
+ }
14344
+ __name(resolveArtifactContentType, "resolveArtifactContentType");
14345
+ function parseArtifactContentType(contentType) {
14346
+ if (ARTIFACT_CONTENT_TYPES.includes(contentType)) {
14347
+ return contentType;
14348
+ }
14349
+ throw new CliError(
14350
+ `Invalid content type "${contentType}". Expected one of: ${ARTIFACT_CONTENT_TYPES.join(", ")}.`
14351
+ );
14352
+ }
14353
+ __name(parseArtifactContentType, "parseArtifactContentType");
14354
+ function renderCompletedImport(response) {
14355
+ console.log(
14356
+ renderKeyValue([
14357
+ { label: "Capture ID", value: response.capture.id },
14358
+ { label: "Status", value: response.capture.status },
14359
+ { label: "Type", value: response.capture.type },
14360
+ { label: "Created", value: response.capture.createdAt },
14361
+ { label: "Updated", value: response.capture.updatedAt }
14362
+ ])
14363
+ );
14364
+ }
14365
+ __name(renderCompletedImport, "renderCompletedImport");
14366
+
14367
+ // src/commands/clarity/assign-extra-capture-request.ts
14368
+ import { z as z78 } from "zod";
14369
+ var responseSchema3 = z78.object({
14370
+ request: clarityProposalExtraCaptureRequestSchema
14371
+ });
14372
+ function renderRequest(request) {
14373
+ console.log(
14374
+ renderKeyValue([
14375
+ { label: "ID", value: request.id },
14376
+ { label: "Step ID", value: request.step_id },
14377
+ { label: "Status", value: request.status },
14378
+ { label: "Priority", value: request.priority },
14379
+ { label: "Assigned to", value: request.requested_user_id ?? "" },
14380
+ { label: "Gap", value: request.gap },
14381
+ { label: "Updated", value: request.updated_at }
14382
+ ])
14383
+ );
14384
+ }
14385
+ __name(renderRequest, "renderRequest");
14386
+ function registerClarityAssignExtraCaptureRequest(clarity) {
14387
+ clarity.command(
14388
+ "assign-extra-capture-request <process-id> <proposal-id> <request-id>"
14389
+ ).description(
14390
+ "Assign (or unassign) a team member to an extra-capture request"
14391
+ ).option("--user-id <id>", "team member to assign (omit to unassign)").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, requestId, options) {
14392
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14393
+ const raw = await httpRequest({
14394
+ method: "PATCH",
14395
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposals/${encodeURIComponent(proposalId)}/extra-capture-requests/${encodeURIComponent(requestId)}/assign`,
14396
+ apiKey,
14397
+ apiBaseUrl,
14398
+ body: { user_id: options.userId ?? null }
14399
+ });
14400
+ if (options.json) {
14401
+ printJson(raw);
14402
+ return;
14403
+ }
14404
+ const parsed = responseSchema3.safeParse(raw);
14405
+ if (!parsed.success) {
14406
+ throw new CliError(
14407
+ `Unexpected response from the API: ${parsed.error.message}`
14408
+ );
14409
+ }
14410
+ renderRequest(parsed.data.request);
14411
+ }, "action"));
14412
+ }
14413
+ __name(registerClarityAssignExtraCaptureRequest, "registerClarityAssignExtraCaptureRequest");
14414
+
14415
+ // src/commands/clarity/build-automation.ts
14416
+ import { z as z79 } from "zod";
14417
+ var responseSchema4 = z79.object({
14418
+ automation_run: z79.object({
14419
+ id: z79.string(),
14420
+ status: z79.string()
14421
+ })
14422
+ });
14423
+ function registerClarityBuildAutomation(clarity) {
14424
+ clarity.command("build-automation <process-id>").description(
14425
+ "Hand the latest transformation proposal off to the workflow-builder pipeline (async)"
14426
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
14427
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14428
+ const raw = await httpRequest({
14429
+ method: "POST",
14430
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/automation`,
14431
+ apiKey,
14432
+ apiBaseUrl
14433
+ });
14434
+ if (options.json) {
14435
+ printJson(raw);
14436
+ return;
14437
+ }
14438
+ const parsed = responseSchema4.safeParse(raw);
14439
+ if (!parsed.success) {
14440
+ throw new CliError(
14441
+ `Unexpected response from the API: ${parsed.error.message}`
14442
+ );
14443
+ }
14444
+ const { automation_run: run } = parsed.data;
14445
+ console.log(
14446
+ renderKeyValue([
14447
+ { label: "Run ID", value: run.id },
14448
+ { label: "Status", value: run.status }
14449
+ ])
14450
+ );
14451
+ }, "action"));
14452
+ }
14453
+ __name(registerClarityBuildAutomation, "registerClarityBuildAutomation");
14454
+
14455
+ // src/commands/clarity/create-invite-link.ts
14456
+ function registerClarityCreateInviteLink(clarity) {
14457
+ clarity.command("create-invite-link <process-id>").description(
14458
+ "Create or regenerate a Clarity interview invite link for a process"
14459
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
14460
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14461
+ const raw = await httpRequest({
14462
+ method: "POST",
14463
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/invite-link`,
14464
+ apiKey,
14465
+ apiBaseUrl
14466
+ });
14467
+ const parsed = createClarityInviteLinkResponseSchema.safeParse(raw);
14468
+ if (!parsed.success) {
14469
+ throw new CliError(
14470
+ `Unexpected response from the API: ${parsed.error.message}`
14471
+ );
14472
+ }
14473
+ if (options.json) {
14474
+ printJson(raw);
14475
+ return;
14476
+ }
14477
+ const { invite_link: inviteLink } = parsed.data;
14478
+ console.log(
14479
+ renderKeyValue([
14480
+ { label: "ID", value: inviteLink.id },
14481
+ { label: "URL", value: inviteLink.url },
14482
+ { label: "Created", value: inviteLink.created_at },
14483
+ { label: "Created by", value: inviteLink.created_by.email ?? "" }
14484
+ ])
14485
+ );
14486
+ }, "action"));
14487
+ }
14488
+ __name(registerClarityCreateInviteLink, "registerClarityCreateInviteLink");
14489
+
14490
+ // src/commands/clarity/render.ts
14491
+ var DEFAULT_HUMAN_SUMMARY_LIMIT = 1200;
14492
+ var PROCESS_TABLE_COLUMNS = [
14493
+ { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
14494
+ { header: "VERSION", cell: /* @__PURE__ */ __name((row) => String(row.version), "cell") },
14495
+ { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
14496
+ {
14497
+ header: "CAPTURES",
14498
+ cell: /* @__PURE__ */ __name((row) => String(row.capture_count), "cell")
14499
+ },
14500
+ {
14501
+ header: "NAME",
14502
+ cell: /* @__PURE__ */ __name((row) => row.name, "cell"),
14503
+ maxWidth: 48
14504
+ }
14505
+ ];
14506
+ var CAPTURE_TABLE_COLUMNS = [
14507
+ { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
14508
+ { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
14509
+ { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
14510
+ {
14511
+ header: "USABLE",
14512
+ cell: /* @__PURE__ */ __name((row) => describeCaptureUsability(row).usable ? "yes" : "no", "cell")
14513
+ },
14514
+ { header: "USER", cell: /* @__PURE__ */ __name((row) => row.userName ?? row.userId, "cell") },
14515
+ {
14516
+ header: "CREATED",
14517
+ cell: /* @__PURE__ */ __name((row) => formatIso(row.createdAt), "cell")
14518
+ }
14519
+ ];
14520
+ function renderProcessTable(rows) {
14521
+ return renderTable(PROCESS_TABLE_COLUMNS, rows);
14522
+ }
14523
+ __name(renderProcessTable, "renderProcessTable");
14524
+ function renderCapturesTable(rows) {
14525
+ return renderTable(CAPTURE_TABLE_COLUMNS, rows);
13395
14526
  }
13396
14527
  __name(renderCapturesTable, "renderCapturesTable");
13397
14528
  function renderVersionReport(process2) {
@@ -14347,25 +15478,15 @@ function formatOptionalBoolean(value) {
14347
15478
  }
14348
15479
  __name(formatOptionalBoolean, "formatOptionalBoolean");
14349
15480
 
14350
- // src/commands/clarity/get-current-process.ts
14351
- import { z as z76 } from "zod";
14352
- var snapshotSchema = z76.object({
14353
- snapshot: z76.object({
14354
- id: z76.string(),
14355
- status: z76.string(),
14356
- creator_type: z76.string(),
14357
- user_id: z76.string().nullable(),
14358
- sandbox_id: z76.string().nullable(),
14359
- created_at: z76.string(),
14360
- updated_at: z76.string()
14361
- })
14362
- });
14363
- function registerClarityGetCurrentProcess(clarity) {
14364
- clarity.command("get-current-process <process-id> <snapshot-id>").description("Get a specific current-process snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
15481
+ // src/commands/clarity/generate-current-process.ts
15482
+ function registerClarityGenerateCurrentProcess(clarity) {
15483
+ clarity.command("generate-current-process <process-id>").description(
15484
+ "Trigger current-process generation for a Clarity v2 process (async)"
15485
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
14365
15486
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14366
15487
  const raw = await httpRequest({
14367
- method: "GET",
14368
- path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}`,
15488
+ method: "POST",
15489
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/current-process`,
14369
15490
  apiKey,
14370
15491
  apiBaseUrl
14371
15492
  });
@@ -14373,242 +15494,57 @@ function registerClarityGetCurrentProcess(clarity) {
14373
15494
  printJson(raw);
14374
15495
  return;
14375
15496
  }
14376
- const parsed = snapshotSchema.safeParse(raw);
14377
- if (!parsed.success) {
14378
- throw new CliError(
14379
- `Unexpected response from the API: ${parsed.error.message}`
14380
- );
14381
- }
14382
- const { snapshot } = parsed.data;
14383
- console.log(
14384
- renderKeyValue([
14385
- { label: "ID", value: snapshot.id },
14386
- { label: "Status", value: snapshot.status },
14387
- { label: "Creator type", value: snapshot.creator_type },
14388
- { label: "User ID", value: snapshot.user_id ?? "" },
14389
- { label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
14390
- { label: "Created", value: snapshot.created_at },
14391
- { label: "Updated", value: snapshot.updated_at }
14392
- ])
14393
- );
15497
+ console.log("Generation started.");
14394
15498
  }, "action"));
14395
15499
  }
14396
- __name(registerClarityGetCurrentProcess, "registerClarityGetCurrentProcess");
15500
+ __name(registerClarityGenerateCurrentProcess, "registerClarityGenerateCurrentProcess");
14397
15501
 
14398
- // src/commands/clarity/get-transformation-proposal.ts
14399
- import { z as z77 } from "zod";
14400
- var snapshotSchema2 = z77.object({
14401
- snapshot: z77.object({
14402
- id: z77.string(),
14403
- status: z77.string(),
14404
- creator_type: z77.string(),
14405
- user_id: z77.string().nullable(),
14406
- sandbox_id: z77.string().nullable(),
14407
- created_at: z77.string(),
14408
- updated_at: z77.string()
14409
- })
14410
- });
14411
- function registerClarityGetTransformationProposal(clarity) {
14412
- clarity.command("get-transformation-proposal <process-id> <proposal-id>").description("Get a specific transformation-proposal snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
15502
+ // src/commands/clarity/generate-transformation-proposal.ts
15503
+ function registerClarityGenerateTransformationProposal(clarity) {
15504
+ clarity.command("generate-transformation-proposal <process-id>").description(
15505
+ "Trigger transformation-proposal generation for a Clarity v2 process (async)"
15506
+ ).option(
15507
+ "--current-process-id <id>",
15508
+ "current-process snapshot to anchor generation to"
15509
+ ).option(
15510
+ "--regenerate-from <id>",
15511
+ "previous transformation proposal to regenerate from"
15512
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, options) {
15513
+ if (options.currentProcessId !== void 0 && options.regenerateFrom !== void 0) {
15514
+ throw new CliError(
15515
+ "Pass either --current-process-id or --regenerate-from, not both."
15516
+ );
15517
+ }
15518
+ const body = buildGenerateTransformationProposalBody(options);
14413
15519
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14414
15520
  const raw = await httpRequest({
14415
- method: "GET",
14416
- path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}`,
15521
+ method: "POST",
15522
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal`,
14417
15523
  apiKey,
14418
- apiBaseUrl
15524
+ apiBaseUrl,
15525
+ body
14419
15526
  });
14420
15527
  if (options.json) {
14421
15528
  printJson(raw);
14422
15529
  return;
14423
15530
  }
14424
- const parsed = snapshotSchema2.safeParse(raw);
14425
- if (!parsed.success) {
14426
- throw new CliError(
14427
- `Unexpected response from the API: ${parsed.error.message}`
14428
- );
14429
- }
14430
- const { snapshot } = parsed.data;
14431
- console.log(
14432
- renderKeyValue([
14433
- { label: "ID", value: snapshot.id },
14434
- { label: "Status", value: snapshot.status },
14435
- { label: "Creator type", value: snapshot.creator_type },
14436
- { label: "User ID", value: snapshot.user_id ?? "" },
14437
- { label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
14438
- { label: "Created", value: snapshot.created_at },
14439
- { label: "Updated", value: snapshot.updated_at }
14440
- ])
14441
- );
15531
+ console.log("Generation started.");
14442
15532
  }, "action"));
14443
15533
  }
14444
- __name(registerClarityGetTransformationProposal, "registerClarityGetTransformationProposal");
14445
-
14446
- // src/commands/clarity/get.ts
14447
- function registerClarityGet(clarity) {
14448
- clarity.command("get <process-id>").description("Get a Clarity process read model by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(processId, options) {
14449
- const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14450
- const raw = await httpRequest({
14451
- method: "GET",
14452
- path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}`,
14453
- apiKey,
14454
- apiBaseUrl
14455
- });
14456
- if (options.json) {
14457
- printJson(raw);
14458
- return;
14459
- }
14460
- const parsed = clarityV2ProcessReadModelSchema.safeParse(raw);
14461
- if (!parsed.success) {
14462
- throw new CliError(
14463
- `Unexpected response from the API: ${parsed.error.message}`
14464
- );
14465
- }
14466
- const { process: process2 } = parsed.data;
14467
- console.log(
14468
- renderKeyValue([
14469
- { label: "ID", value: process2.id },
14470
- { label: "Name", value: process2.name },
14471
- { label: "Status", value: process2.status },
14472
- { label: "Version", value: String(process2.version) },
14473
- { label: "Created", value: process2.created_at },
14474
- { label: "Updated", value: process2.updated_at },
14475
- {
14476
- label: "Error",
14477
- value: process2.generation_error ?? ""
14478
- },
14479
- {
14480
- label: "Custom prompt",
14481
- value: process2.custom_prompt ?? ""
14482
- }
14483
- ])
14484
- );
14485
- const {
14486
- current_process_versions: cpVersions,
14487
- transformation_proposal_versions: tpVersions
14488
- } = parsed.data;
14489
- if (cpVersions.length > 0) {
14490
- console.log(`
14491
- Current process versions (${cpVersions.length}):`);
14492
- for (const v of cpVersions) {
14493
- console.log(` - ${v.id} ${v.status} ${v.created_at}`);
14494
- }
14495
- }
14496
- if (tpVersions.length > 0) {
14497
- console.log(
14498
- `
14499
- Transformation proposal versions (${tpVersions.length}):`
14500
- );
14501
- for (const v of tpVersions) {
14502
- console.log(` - ${v.id} ${v.status} ${v.created_at}`);
14503
- }
14504
- }
14505
- }, "getAction"));
14506
- }
14507
- __name(registerClarityGet, "registerClarityGet");
14508
-
14509
- // src/commands/clarity/list-extra-capture-requests.ts
14510
- var DEFAULT_LIMIT5 = 20;
14511
- var MIN_LIMIT5 = 1;
14512
- var MAX_LIMIT5 = 100;
14513
- var TABLE_COLUMNS18 = [
14514
- {
14515
- header: "ID",
14516
- cell: /* @__PURE__ */ __name((row) => row.id, "cell")
14517
- },
14518
- {
14519
- header: "STEP ID",
14520
- cell: /* @__PURE__ */ __name((row) => row.step_id, "cell")
14521
- },
14522
- {
14523
- header: "STATUS",
14524
- cell: /* @__PURE__ */ __name((row) => row.status, "cell")
14525
- },
14526
- {
14527
- header: "PRIORITY",
14528
- cell: /* @__PURE__ */ __name((row) => row.priority, "cell")
14529
- },
14530
- {
14531
- header: "ASSIGNED TO",
14532
- cell: /* @__PURE__ */ __name((row) => row.requested_user_id ?? "", "cell")
14533
- },
14534
- {
14535
- header: "GAP",
14536
- cell: /* @__PURE__ */ __name((row) => row.gap, "cell"),
14537
- maxWidth: 50
15534
+ __name(registerClarityGenerateTransformationProposal, "registerClarityGenerateTransformationProposal");
15535
+ function buildGenerateTransformationProposalBody(options) {
15536
+ if (options.regenerateFrom !== void 0) {
15537
+ return { regenerate_from: options.regenerateFrom };
14538
15538
  }
14539
- ];
14540
- function registerClarityListExtraCaptureRequests(clarity) {
14541
- clarity.command("list-extra-capture-requests <process-id> <proposal-id>").description("List extra-capture requests for a transformation proposal").option("--limit <n>", `page size (${MIN_LIMIT5}-${MAX_LIMIT5})`).option("--offset <n>", "number of requests to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
14542
- const limit = parseLimit(options.limit, {
14543
- defaultValue: DEFAULT_LIMIT5,
14544
- min: MIN_LIMIT5,
14545
- max: MAX_LIMIT5
14546
- });
14547
- const offset = parseOffset(options.offset);
14548
- const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
14549
- const searchParams = new URLSearchParams();
14550
- searchParams.append("limit", String(limit));
14551
- searchParams.append("offset", String(offset));
14552
- const raw = await httpRequest({
14553
- method: "GET",
14554
- path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposals/${encodeURIComponent(proposalId)}/extra-capture-requests`,
14555
- apiKey,
14556
- apiBaseUrl,
14557
- searchParams
14558
- });
14559
- if (options.json) {
14560
- printJson(raw);
14561
- return;
14562
- }
14563
- const parsed = clarityProposalExtraCaptureRequestListResponseSchema.safeParse(raw);
14564
- if (!parsed.success) {
14565
- throw new CliError(
14566
- `Unexpected response from the API: ${parsed.error.message}`
14567
- );
14568
- }
14569
- const response = parsed.data;
14570
- if (response.requests.length === 0) {
14571
- console.log("No extra-capture requests found.");
14572
- return;
14573
- }
14574
- console.log(renderTable(TABLE_COLUMNS18, response.requests));
14575
- console.log(
14576
- `Showing ${response.requests.length} of ${response.total} \xB7 offset ${response.offset}`
14577
- );
14578
- }, "action"));
15539
+ if (options.currentProcessId !== void 0) {
15540
+ return { current_process_id: options.currentProcessId };
15541
+ }
15542
+ return void 0;
14579
15543
  }
14580
- __name(registerClarityListExtraCaptureRequests, "registerClarityListExtraCaptureRequests");
15544
+ __name(buildGenerateTransformationProposalBody, "buildGenerateTransformationProposalBody");
14581
15545
 
14582
- // src/api/clarity-schemas.ts
14583
- import { z as z78 } from "zod";
14584
- var clarityListProcessSchema = z78.object({
14585
- id: z78.guid(),
14586
- name: z78.string(),
14587
- status: clarityProcessStatusSchema,
14588
- version: z78.number().int(),
14589
- capture_count: z78.number().int(),
14590
- capture_counts: z78.object({
14591
- video: z78.number().int(),
14592
- interview: z78.number().int(),
14593
- document: z78.number().int()
14594
- }).optional(),
14595
- pending_invitation_count: z78.number().int(),
14596
- contributors: z78.array(
14597
- z78.object({
14598
- user_id: z78.string(),
14599
- user_name: z78.string()
14600
- })
14601
- ),
14602
- created_at: z78.string(),
14603
- created_by_name: z78.string().nullable()
14604
- });
14605
- var listClarityProcessesResponseSchema = z78.object({
14606
- processes: z78.array(clarityListProcessSchema),
14607
- total: z78.number().int(),
14608
- limit: z78.number().int(),
14609
- offset: z78.number().int()
14610
- });
14611
- var legacyClarityProcessResponseSchema = legacyClarityProcessDetailSchema;
15546
+ // src/commands/clarity/get-current-process.ts
15547
+ import { z as z80 } from "zod";
14612
15548
 
14613
15549
  // src/commands/clarity/read-api.ts
14614
15550
  var AUTH_ERROR_MARKER = "Unauthorized.";
@@ -14706,6 +15642,19 @@ function isLegacyV2ReadError(error) {
14706
15642
  return error instanceof CliHttpError && error.status === 403 && (error.apiErrorCode === "PROCESS_NOT_ON_V2" || error.apiErrorMessage === "Process is not on v2");
14707
15643
  }
14708
15644
  __name(isLegacyV2ReadError, "isLegacyV2ReadError");
15645
+ async function requireV2Process(config, processId) {
15646
+ try {
15647
+ return await getClarityV2Process(config, processId);
15648
+ } catch (error) {
15649
+ if (isLegacyV2ReadError(error)) {
15650
+ throw new CliError(
15651
+ "This command requires Clarity v2. Use `duvo clarity overview <process-id>` to read legacy v1 context."
15652
+ );
15653
+ }
15654
+ throw error;
15655
+ }
15656
+ }
15657
+ __name(requireV2Process, "requireV2Process");
14709
15658
  async function getClarityJson(config, options) {
14710
15659
  try {
14711
15660
  return await httpRequest({
@@ -14755,17 +15704,409 @@ function toClarityCliError(error, context) {
14755
15704
  }
14756
15705
  return error;
14757
15706
  }
14758
- __name(toClarityCliError, "toClarityCliError");
14759
- function parseResponse(schema, raw) {
14760
- const parsed = schema.safeParse(raw);
14761
- if (!parsed.success) {
14762
- throw new CliError(
14763
- `Unexpected response from the API: ${parsed.error.message}`
14764
- );
14765
- }
14766
- return parsed.data;
15707
+ __name(toClarityCliError, "toClarityCliError");
15708
+ function parseResponse(schema, raw) {
15709
+ const parsed = schema.safeParse(raw);
15710
+ if (!parsed.success) {
15711
+ throw new CliError(
15712
+ `Unexpected response from the API: ${parsed.error.message}`
15713
+ );
15714
+ }
15715
+ return parsed.data;
15716
+ }
15717
+ __name(parseResponse, "parseResponse");
15718
+
15719
+ // src/commands/clarity/get-current-process.ts
15720
+ var snapshotSchema = z80.object({
15721
+ snapshot: z80.object({
15722
+ id: z80.string(),
15723
+ status: z80.string(),
15724
+ creator_type: z80.string(),
15725
+ user_id: z80.string().nullable(),
15726
+ sandbox_id: z80.string().nullable(),
15727
+ created_at: z80.string(),
15728
+ updated_at: z80.string()
15729
+ })
15730
+ });
15731
+ function registerClarityGetCurrentProcess(clarity) {
15732
+ clarity.command("get-current-process <process-id> <snapshot-id>").description("Get a specific current-process snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
15733
+ const config = await requireAuthenticatedConfig(this);
15734
+ const raw = await getClarityJson(config, {
15735
+ method: "GET",
15736
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}`,
15737
+ resource: "Clarity current-process snapshot"
15738
+ });
15739
+ if (options.json) {
15740
+ printJson(raw);
15741
+ return;
15742
+ }
15743
+ const parsed = snapshotSchema.safeParse(raw);
15744
+ if (!parsed.success) {
15745
+ throw new CliError(
15746
+ `Unexpected response from the API: ${parsed.error.message}`
15747
+ );
15748
+ }
15749
+ const { snapshot } = parsed.data;
15750
+ console.log(
15751
+ renderKeyValue([
15752
+ { label: "ID", value: snapshot.id },
15753
+ { label: "Status", value: snapshot.status },
15754
+ { label: "Creator type", value: snapshot.creator_type },
15755
+ { label: "User ID", value: snapshot.user_id ?? "" },
15756
+ { label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
15757
+ { label: "Created", value: snapshot.created_at },
15758
+ { label: "Updated", value: snapshot.updated_at }
15759
+ ])
15760
+ );
15761
+ }, "action"));
15762
+ }
15763
+ __name(registerClarityGetCurrentProcess, "registerClarityGetCurrentProcess");
15764
+
15765
+ // src/commands/clarity/get-transformation-proposal.ts
15766
+ import { z as z81 } from "zod";
15767
+ var snapshotSchema2 = z81.object({
15768
+ snapshot: z81.object({
15769
+ id: z81.string(),
15770
+ status: z81.string(),
15771
+ creator_type: z81.string(),
15772
+ user_id: z81.string().nullable(),
15773
+ sandbox_id: z81.string().nullable(),
15774
+ created_at: z81.string(),
15775
+ updated_at: z81.string()
15776
+ })
15777
+ });
15778
+ function registerClarityGetTransformationProposal(clarity) {
15779
+ clarity.command("get-transformation-proposal <process-id> <proposal-id>").description("Get a specific transformation-proposal snapshot by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
15780
+ const config = await requireAuthenticatedConfig(this);
15781
+ const raw = await getClarityJson(config, {
15782
+ method: "GET",
15783
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}`,
15784
+ resource: "Clarity transformation-proposal snapshot"
15785
+ });
15786
+ if (options.json) {
15787
+ printJson(raw);
15788
+ return;
15789
+ }
15790
+ const parsed = snapshotSchema2.safeParse(raw);
15791
+ if (!parsed.success) {
15792
+ throw new CliError(
15793
+ `Unexpected response from the API: ${parsed.error.message}`
15794
+ );
15795
+ }
15796
+ const { snapshot } = parsed.data;
15797
+ console.log(
15798
+ renderKeyValue([
15799
+ { label: "ID", value: snapshot.id },
15800
+ { label: "Status", value: snapshot.status },
15801
+ { label: "Creator type", value: snapshot.creator_type },
15802
+ { label: "User ID", value: snapshot.user_id ?? "" },
15803
+ { label: "Sandbox ID", value: snapshot.sandbox_id ?? "" },
15804
+ { label: "Created", value: snapshot.created_at },
15805
+ { label: "Updated", value: snapshot.updated_at }
15806
+ ])
15807
+ );
15808
+ }, "action"));
15809
+ }
15810
+ __name(registerClarityGetTransformationProposal, "registerClarityGetTransformationProposal");
15811
+
15812
+ // src/commands/clarity/get.ts
15813
+ function registerClarityGet(clarity) {
15814
+ clarity.command("get <process-id>").description("Get a Clarity process read model by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(processId, options) {
15815
+ const config = await requireAuthenticatedConfig(this);
15816
+ const result = await requireV2Process(config, processId);
15817
+ if (options.json) {
15818
+ printJson(result);
15819
+ return;
15820
+ }
15821
+ const { process: process2 } = result;
15822
+ console.log(
15823
+ renderKeyValue([
15824
+ { label: "ID", value: process2.id },
15825
+ { label: "Name", value: process2.name },
15826
+ { label: "Status", value: process2.status },
15827
+ { label: "Version", value: String(process2.version) },
15828
+ { label: "Created", value: process2.created_at },
15829
+ { label: "Updated", value: process2.updated_at },
15830
+ {
15831
+ label: "Error",
15832
+ value: process2.generation_error ?? ""
15833
+ },
15834
+ {
15835
+ label: "Custom prompt",
15836
+ value: process2.custom_prompt ?? ""
15837
+ }
15838
+ ])
15839
+ );
15840
+ const {
15841
+ current_process_versions: cpVersions,
15842
+ transformation_proposal_versions: tpVersions
15843
+ } = result;
15844
+ if (cpVersions.length > 0) {
15845
+ console.log(`
15846
+ Current process versions (${cpVersions.length}):`);
15847
+ for (const v of cpVersions) {
15848
+ console.log(` - ${v.id} ${v.status} ${v.created_at}`);
15849
+ }
15850
+ }
15851
+ if (tpVersions.length > 0) {
15852
+ console.log(
15853
+ `
15854
+ Transformation proposal versions (${tpVersions.length}):`
15855
+ );
15856
+ for (const v of tpVersions) {
15857
+ console.log(` - ${v.id} ${v.status} ${v.created_at}`);
15858
+ }
15859
+ }
15860
+ }, "getAction"));
15861
+ }
15862
+ __name(registerClarityGet, "registerClarityGet");
15863
+
15864
+ // src/commands/clarity/list-extra-capture-requests.ts
15865
+ var DEFAULT_LIMIT5 = 20;
15866
+ var MIN_LIMIT5 = 1;
15867
+ var MAX_LIMIT5 = 100;
15868
+ var TABLE_COLUMNS19 = [
15869
+ {
15870
+ header: "ID",
15871
+ cell: /* @__PURE__ */ __name((row) => row.id, "cell")
15872
+ },
15873
+ {
15874
+ header: "STEP ID",
15875
+ cell: /* @__PURE__ */ __name((row) => row.step_id, "cell")
15876
+ },
15877
+ {
15878
+ header: "STATUS",
15879
+ cell: /* @__PURE__ */ __name((row) => row.status, "cell")
15880
+ },
15881
+ {
15882
+ header: "PRIORITY",
15883
+ cell: /* @__PURE__ */ __name((row) => row.priority, "cell")
15884
+ },
15885
+ {
15886
+ header: "ASSIGNED TO",
15887
+ cell: /* @__PURE__ */ __name((row) => row.requested_user_id ?? "", "cell")
15888
+ },
15889
+ {
15890
+ header: "GAP",
15891
+ cell: /* @__PURE__ */ __name((row) => row.gap, "cell"),
15892
+ maxWidth: 50
15893
+ }
15894
+ ];
15895
+ function registerClarityListExtraCaptureRequests(clarity) {
15896
+ clarity.command("list-extra-capture-requests <process-id> <proposal-id>").description("List extra-capture requests for a transformation proposal").option("--limit <n>", `page size (${MIN_LIMIT5}-${MAX_LIMIT5})`).option("--offset <n>", "number of requests to skip").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
15897
+ const limit = parseLimit(options.limit, {
15898
+ defaultValue: DEFAULT_LIMIT5,
15899
+ min: MIN_LIMIT5,
15900
+ max: MAX_LIMIT5
15901
+ });
15902
+ const offset = parseOffset(options.offset);
15903
+ const config = await requireAuthenticatedConfig(this);
15904
+ const searchParams = new URLSearchParams();
15905
+ searchParams.append("limit", String(limit));
15906
+ searchParams.append("offset", String(offset));
15907
+ const raw = await getClarityJson(config, {
15908
+ method: "GET",
15909
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposals/${encodeURIComponent(proposalId)}/extra-capture-requests`,
15910
+ resource: "Clarity extra-capture requests",
15911
+ searchParams
15912
+ });
15913
+ if (options.json) {
15914
+ printJson(raw);
15915
+ return;
15916
+ }
15917
+ const parsed = clarityProposalExtraCaptureRequestListResponseSchema.safeParse(raw);
15918
+ if (!parsed.success) {
15919
+ throw new CliError(
15920
+ `Unexpected response from the API: ${parsed.error.message}`
15921
+ );
15922
+ }
15923
+ const response = parsed.data;
15924
+ if (response.requests.length === 0) {
15925
+ console.log("No extra-capture requests found.");
15926
+ return;
15927
+ }
15928
+ console.log(renderTable(TABLE_COLUMNS19, response.requests));
15929
+ console.log(
15930
+ `Showing ${response.requests.length} of ${response.total} \xB7 offset ${response.offset}`
15931
+ );
15932
+ }, "action"));
15933
+ }
15934
+ __name(registerClarityListExtraCaptureRequests, "registerClarityListExtraCaptureRequests");
15935
+
15936
+ // src/commands/clarity/postprocess.ts
15937
+ var SNAPSHOT_TYPES = ["current_process", "transformation_proposal"];
15938
+ function registerClarityPostprocess(clarity) {
15939
+ clarity.command("postprocess <process-id> <snapshot-type> <snapshot-id>").description(
15940
+ `Re-run postprocessing agents on an existing snapshot. snapshot-type must be one of: ${SNAPSHOT_TYPES.join(", ")}`
15941
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotType, snapshotId, options) {
15942
+ if (!SNAPSHOT_TYPES.includes(snapshotType)) {
15943
+ throw new CliError(
15944
+ `snapshot-type must be one of: ${SNAPSHOT_TYPES.join(", ")}`
15945
+ );
15946
+ }
15947
+ const type = snapshotType;
15948
+ const body = type === "current_process" ? { type, current_process_id: snapshotId } : { type, transformation_proposal_id: snapshotId };
15949
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
15950
+ const raw = await httpRequest({
15951
+ method: "POST",
15952
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/postprocess`,
15953
+ apiKey,
15954
+ apiBaseUrl,
15955
+ body
15956
+ });
15957
+ if (options.json) {
15958
+ printJson(raw);
15959
+ return;
15960
+ }
15961
+ console.log("Postprocessing started.");
15962
+ }, "action"));
15963
+ }
15964
+ __name(registerClarityPostprocess, "registerClarityPostprocess");
15965
+
15966
+ // src/commands/clarity/promote-current-process.ts
15967
+ import { z as z82 } from "zod";
15968
+ var snapshotSchema3 = z82.object({
15969
+ snapshot: z82.object({
15970
+ id: z82.string(),
15971
+ status: z82.string(),
15972
+ creator_type: z82.string(),
15973
+ created_at: z82.string(),
15974
+ updated_at: z82.string()
15975
+ })
15976
+ });
15977
+ function registerClarityPromoteCurrentProcess(clarity) {
15978
+ clarity.command("promote-current-process <process-id> <snapshot-id>").description("Promote a current-process snapshot to live").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
15979
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
15980
+ const raw = await httpRequest({
15981
+ method: "POST",
15982
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}/promote`,
15983
+ apiKey,
15984
+ apiBaseUrl
15985
+ });
15986
+ if (options.json) {
15987
+ printJson(raw);
15988
+ return;
15989
+ }
15990
+ const parsed = snapshotSchema3.safeParse(raw);
15991
+ if (!parsed.success) {
15992
+ throw new CliError(
15993
+ `Unexpected response from the API: ${parsed.error.message}`
15994
+ );
15995
+ }
15996
+ const { snapshot } = parsed.data;
15997
+ console.log(
15998
+ renderKeyValue([
15999
+ { label: "ID", value: snapshot.id },
16000
+ { label: "Status", value: snapshot.status },
16001
+ { label: "Creator type", value: snapshot.creator_type },
16002
+ { label: "Created", value: snapshot.created_at },
16003
+ { label: "Updated", value: snapshot.updated_at }
16004
+ ])
16005
+ );
16006
+ }, "action"));
16007
+ }
16008
+ __name(registerClarityPromoteCurrentProcess, "registerClarityPromoteCurrentProcess");
16009
+
16010
+ // src/commands/clarity/promote-transformation-proposal.ts
16011
+ import { z as z83 } from "zod";
16012
+ var snapshotSchema4 = z83.object({
16013
+ snapshot: z83.object({
16014
+ id: z83.string(),
16015
+ status: z83.string(),
16016
+ creator_type: z83.string(),
16017
+ created_at: z83.string(),
16018
+ updated_at: z83.string()
16019
+ })
16020
+ });
16021
+ function registerClarityPromoteTransformationProposal(clarity) {
16022
+ clarity.command("promote-transformation-proposal <process-id> <proposal-id>").description("Promote a transformation-proposal snapshot to live").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
16023
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
16024
+ const raw = await httpRequest({
16025
+ method: "POST",
16026
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}/promote`,
16027
+ apiKey,
16028
+ apiBaseUrl
16029
+ });
16030
+ if (options.json) {
16031
+ printJson(raw);
16032
+ return;
16033
+ }
16034
+ const parsed = snapshotSchema4.safeParse(raw);
16035
+ if (!parsed.success) {
16036
+ throw new CliError(
16037
+ `Unexpected response from the API: ${parsed.error.message}`
16038
+ );
16039
+ }
16040
+ const { snapshot } = parsed.data;
16041
+ console.log(
16042
+ renderKeyValue([
16043
+ { label: "ID", value: snapshot.id },
16044
+ { label: "Status", value: snapshot.status },
16045
+ { label: "Creator type", value: snapshot.creator_type },
16046
+ { label: "Created", value: snapshot.created_at },
16047
+ { label: "Updated", value: snapshot.updated_at }
16048
+ ])
16049
+ );
16050
+ }, "action"));
16051
+ }
16052
+ __name(registerClarityPromoteTransformationProposal, "registerClarityPromoteTransformationProposal");
16053
+
16054
+ // src/commands/clarity/revert-current-process.ts
16055
+ function registerClarityRevertCurrentProcess(clarity) {
16056
+ clarity.command("revert-current-process <process-id> <snapshot-id>").description("Delete (revert) a current-process snapshot").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, snapshotId, options) {
16057
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
16058
+ const raw = await httpRequest({
16059
+ method: "DELETE",
16060
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/current-process/${encodeURIComponent(snapshotId)}`,
16061
+ apiKey,
16062
+ apiBaseUrl
16063
+ });
16064
+ if (options.json) {
16065
+ printJson(raw);
16066
+ return;
16067
+ }
16068
+ console.log("Snapshot reverted.");
16069
+ }, "action"));
16070
+ }
16071
+ __name(registerClarityRevertCurrentProcess, "registerClarityRevertCurrentProcess");
16072
+
16073
+ // src/commands/clarity/revert-transformation-proposal.ts
16074
+ function registerClarityRevertTransformationProposal(clarity) {
16075
+ clarity.command("revert-transformation-proposal <process-id> <proposal-id>").description("Delete (revert) a transformation-proposal snapshot").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function action(processId, proposalId, options) {
16076
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
16077
+ const raw = await httpRequest({
16078
+ method: "DELETE",
16079
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/${encodeURIComponent(proposalId)}`,
16080
+ apiKey,
16081
+ apiBaseUrl
16082
+ });
16083
+ if (options.json) {
16084
+ printJson(raw);
16085
+ return;
16086
+ }
16087
+ console.log("Snapshot reverted.");
16088
+ }, "action"));
16089
+ }
16090
+ __name(registerClarityRevertTransformationProposal, "registerClarityRevertTransformationProposal");
16091
+
16092
+ // src/commands/clarity/stop-transformation-proposal.ts
16093
+ function registerClarityStopTransformationProposal(clarity) {
16094
+ 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) {
16095
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
16096
+ const raw = await httpRequest({
16097
+ method: "POST",
16098
+ path: `/v2/clarity-v2/processes/${encodeURIComponent(processId)}/transformation-proposal/stop`,
16099
+ apiKey,
16100
+ apiBaseUrl
16101
+ });
16102
+ if (options.json) {
16103
+ printJson(raw);
16104
+ return;
16105
+ }
16106
+ console.log("Generation stopped.");
16107
+ }, "action"));
14767
16108
  }
14768
- __name(parseResponse, "parseResponse");
16109
+ __name(registerClarityStopTransformationProposal, "registerClarityStopTransformationProposal");
14769
16110
 
14770
16111
  // src/commands/clarity/index.ts
14771
16112
  var DEFAULT_LIMIT6 = 50;
@@ -14873,8 +16214,200 @@ var CLARITY_READ_TOOLS = [
14873
16214
  }
14874
16215
  ],
14875
16216
  description: "Read active extra-capture requests for a v2 transformation proposal."
16217
+ },
16218
+ {
16219
+ name: "listClarityArtifactChatConversations",
16220
+ scope: "v2",
16221
+ read_only: true,
16222
+ commands: ["duvo clarity artifact-chat-conversations"],
16223
+ endpoints: [
16224
+ {
16225
+ method: "GET",
16226
+ path: "/v2/clarity-v2/processes/:processId/artifact-chat/conversations"
16227
+ }
16228
+ ],
16229
+ description: "List recent artifact-chat conversations for a v2 process and snapshot kind."
16230
+ },
16231
+ {
16232
+ name: "getClarityArtifactChatMessages",
16233
+ scope: "v2",
16234
+ read_only: true,
16235
+ commands: ["duvo clarity artifact-chat-messages"],
16236
+ endpoints: [
16237
+ {
16238
+ method: "GET",
16239
+ path: "/v2/clarity-v2/processes/:processId/artifact-chat/conversations/:conversationId/messages"
16240
+ }
16241
+ ],
16242
+ description: "Read messages for one artifact-chat conversation in a v2 process."
16243
+ }
16244
+ ];
16245
+ var CLARITY_WRITE_TOOLS = [
16246
+ {
16247
+ name: "generateClarityCurrentProcess",
16248
+ scope: "v2",
16249
+ read_only: false,
16250
+ commands: ["duvo clarity generate-current-process"],
16251
+ endpoints: [
16252
+ {
16253
+ method: "POST",
16254
+ path: "/v2/clarity-v2/processes/:processId/current-process"
16255
+ }
16256
+ ],
16257
+ description: "Start asynchronous current-process generation."
16258
+ },
16259
+ {
16260
+ name: "generateClarityTransformationProposal",
16261
+ scope: "v2",
16262
+ read_only: false,
16263
+ commands: ["duvo clarity generate-transformation-proposal"],
16264
+ endpoints: [
16265
+ {
16266
+ method: "POST",
16267
+ path: "/v2/clarity-v2/processes/:processId/transformation-proposal"
16268
+ }
16269
+ ],
16270
+ description: "Start asynchronous transformation-proposal generation or regeneration."
16271
+ },
16272
+ {
16273
+ name: "promoteClarityCurrentProcess",
16274
+ scope: "v2",
16275
+ read_only: false,
16276
+ commands: ["duvo clarity promote-current-process"],
16277
+ endpoints: [
16278
+ {
16279
+ method: "POST",
16280
+ path: "/v2/clarity-v2/processes/:processId/current-process/:snapshotId/promote"
16281
+ }
16282
+ ],
16283
+ description: "Promote a current-process snapshot to live."
16284
+ },
16285
+ {
16286
+ name: "promoteClarityTransformationProposal",
16287
+ scope: "v2",
16288
+ read_only: false,
16289
+ commands: ["duvo clarity promote-transformation-proposal"],
16290
+ endpoints: [
16291
+ {
16292
+ method: "POST",
16293
+ path: "/v2/clarity-v2/processes/:processId/transformation-proposal/:proposalId/promote"
16294
+ }
16295
+ ],
16296
+ description: "Promote a transformation-proposal snapshot to live."
16297
+ },
16298
+ {
16299
+ name: "revertClarityCurrentProcess",
16300
+ scope: "v2",
16301
+ read_only: false,
16302
+ commands: ["duvo clarity revert-current-process"],
16303
+ endpoints: [
16304
+ {
16305
+ method: "DELETE",
16306
+ path: "/v2/clarity-v2/processes/:processId/current-process/:snapshotId"
16307
+ }
16308
+ ],
16309
+ description: "Delete a current-process snapshot."
16310
+ },
16311
+ {
16312
+ name: "revertClarityTransformationProposal",
16313
+ scope: "v2",
16314
+ read_only: false,
16315
+ commands: ["duvo clarity revert-transformation-proposal"],
16316
+ endpoints: [
16317
+ {
16318
+ method: "DELETE",
16319
+ path: "/v2/clarity-v2/processes/:processId/transformation-proposal/:proposalId"
16320
+ }
16321
+ ],
16322
+ description: "Delete a transformation-proposal snapshot."
16323
+ },
16324
+ {
16325
+ name: "assignClarityExtraCaptureRequest",
16326
+ scope: "v2",
16327
+ read_only: false,
16328
+ commands: ["duvo clarity assign-extra-capture-request"],
16329
+ endpoints: [
16330
+ {
16331
+ method: "PATCH",
16332
+ path: "/v2/clarity-v2/processes/:processId/transformation-proposals/:proposalId/extra-capture-requests/:requestId/assign"
16333
+ }
16334
+ ],
16335
+ description: "Assign or unassign an extra-capture request."
16336
+ },
16337
+ {
16338
+ name: "postprocessClaritySnapshot",
16339
+ scope: "v2",
16340
+ read_only: false,
16341
+ commands: ["duvo clarity postprocess"],
16342
+ endpoints: [
16343
+ {
16344
+ method: "POST",
16345
+ path: "/v2/clarity-v2/processes/:processId/postprocess"
16346
+ }
16347
+ ],
16348
+ description: "Re-run postprocessing for an existing snapshot."
16349
+ },
16350
+ {
16351
+ name: "buildClarityAutomation",
16352
+ scope: "v2",
16353
+ read_only: false,
16354
+ commands: ["duvo clarity build-automation"],
16355
+ endpoints: [
16356
+ {
16357
+ method: "POST",
16358
+ path: "/v2/clarity-v2/processes/:processId/automation"
16359
+ }
16360
+ ],
16361
+ description: "Start workflow-builder automation generation from the latest proposal."
16362
+ },
16363
+ {
16364
+ name: "stopClarityTransformationProposal",
16365
+ scope: "v2",
16366
+ read_only: false,
16367
+ commands: ["duvo clarity stop-transformation-proposal"],
16368
+ endpoints: [
16369
+ {
16370
+ method: "POST",
16371
+ path: "/v2/clarity-v2/processes/:processId/transformation-proposal/stop"
16372
+ }
16373
+ ],
16374
+ description: "Stop an in-flight transformation-proposal generation."
16375
+ },
16376
+ {
16377
+ name: "createClarityInviteLink",
16378
+ scope: "v2",
16379
+ read_only: false,
16380
+ commands: ["duvo clarity create-invite-link"],
16381
+ endpoints: [
16382
+ {
16383
+ method: "POST",
16384
+ path: "/v2/clarity-v2/processes/:processId/invite-link"
16385
+ }
16386
+ ],
16387
+ description: "Create or regenerate a public Clarity interview invite link."
16388
+ },
16389
+ {
16390
+ name: "importClarityArtifact",
16391
+ scope: "v2",
16392
+ read_only: false,
16393
+ commands: ["duvo clarity import-artifact"],
16394
+ endpoints: [
16395
+ {
16396
+ method: "POST",
16397
+ path: "/v2/clarity-v2/processes/:processId/artifact-imports/create-upload-url"
16398
+ },
16399
+ {
16400
+ method: "POST",
16401
+ path: "/v2/clarity-v2/processes/:processId/artifact-imports/:captureId/complete"
16402
+ }
16403
+ ],
16404
+ description: "Upload and complete a local Miro SVG, XML, PNG, or JPEG export."
14876
16405
  }
14877
16406
  ];
16407
+ var CLARITY_TOOLS = [
16408
+ ...CLARITY_READ_TOOLS,
16409
+ ...CLARITY_WRITE_TOOLS
16410
+ ];
14878
16411
  var CLARITY_TOOL_COLUMNS = [
14879
16412
  { header: "TOOL", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
14880
16413
  { header: "SCOPE", cell: /* @__PURE__ */ __name((row) => row.scope, "cell") },
@@ -14885,7 +16418,7 @@ var CLARITY_TOOL_COLUMNS = [
14885
16418
  },
14886
16419
  {
14887
16420
  header: "ENDPOINTS",
14888
- cell: /* @__PURE__ */ __name((row) => row.endpoints.map((endpoint) => endpoint.path).join(", "), "cell"),
16421
+ cell: /* @__PURE__ */ __name((row) => row.endpoints.map((endpoint) => `${endpoint.method} ${endpoint.path}`).join(", "), "cell"),
14889
16422
  maxWidth: 62
14890
16423
  }
14891
16424
  ];
@@ -14912,6 +16445,20 @@ function registerClarity(program) {
14912
16445
  registerClarityGetCurrentProcess(clarity);
14913
16446
  registerClarityGetTransformationProposal(clarity);
14914
16447
  registerClarityListExtraCaptureRequests(clarity);
16448
+ registerClarityArtifactChatConversations(clarity);
16449
+ registerClarityArtifactChatMessages(clarity);
16450
+ registerClarityGenerateCurrentProcess(clarity);
16451
+ registerClarityGenerateTransformationProposal(clarity);
16452
+ registerClarityPromoteCurrentProcess(clarity);
16453
+ registerClarityPromoteTransformationProposal(clarity);
16454
+ registerClarityRevertCurrentProcess(clarity);
16455
+ registerClarityRevertTransformationProposal(clarity);
16456
+ registerClarityAssignExtraCaptureRequest(clarity);
16457
+ registerClarityPostprocess(clarity);
16458
+ registerClarityBuildAutomation(clarity);
16459
+ registerClarityStopTransformationProposal(clarity);
16460
+ registerClarityCreateInviteLink(clarity);
16461
+ registerClarityImportArtifact(clarity);
14915
16462
  }
14916
16463
  __name(registerClarity, "registerClarity");
14917
16464
  function registerList(clarity) {
@@ -15270,7 +16817,7 @@ function registerExport(clarity) {
15270
16817
  __name(registerExport, "registerExport");
15271
16818
  function registerDoctor(clarity) {
15272
16819
  clarity.command("doctor [process-id]").description(
15273
- "Check auth, API reachability, read-only tools, and optionally one process context"
16820
+ "Check auth, API reachability, Clarity tools, and optionally one process context"
15274
16821
  ).option("--json", "output JSON").action(/* @__PURE__ */ __name(async function doctorAction(processId, options) {
15275
16822
  const environment = await buildEnvironmentDoctorChecks(this);
15276
16823
  const processChecks = processId === void 0 ? [] : await buildProcessDoctorChecks(environment.config, processId);
@@ -15288,15 +16835,15 @@ function registerDoctor(clarity) {
15288
16835
  }
15289
16836
  __name(registerDoctor, "registerDoctor");
15290
16837
  function registerTools(clarity) {
15291
- clarity.command("tools").description("List read-only Clarity tools used by the CLI").option("--json", "output JSON").action((options) => {
16838
+ clarity.command("tools").description("List Clarity tools used by the CLI").option("--json", "output JSON").action((options) => {
15292
16839
  if (options.json) {
15293
- printJson({ tools: CLARITY_READ_TOOLS });
16840
+ printJson({ tools: CLARITY_TOOLS });
15294
16841
  return;
15295
16842
  }
15296
- console.log(renderTable(CLARITY_TOOL_COLUMNS, CLARITY_READ_TOOLS));
16843
+ console.log(renderTable(CLARITY_TOOL_COLUMNS, CLARITY_TOOLS));
15297
16844
  console.log("");
15298
16845
  console.log(
15299
- "All listed Clarity tools are read-only GET calls. Generation, promotion, revert, assignment, postprocess, and automation-build commands are not exposed."
16846
+ "Clarity tools include read-only GET calls and explicit write commands for generation, promotion, revert, assignment, postprocess, automation, artifact import, and invite links."
15300
16847
  );
15301
16848
  });
15302
16849
  }
@@ -15418,17 +16965,6 @@ async function loadV2Overview(config, processId, options) {
15418
16965
  };
15419
16966
  }
15420
16967
  __name(loadV2Overview, "loadV2Overview");
15421
- async function requireV2Process(config, processId) {
15422
- try {
15423
- return await getClarityV2Process(config, processId);
15424
- } catch (error) {
15425
- if (isLegacyV2ReadError(error)) {
15426
- throw new CliError(CLARITY_V2_REQUIRED_MESSAGE);
15427
- }
15428
- throw error;
15429
- }
15430
- }
15431
- __name(requireV2Process, "requireV2Process");
15432
16968
  function buildWarnings(context) {
15433
16969
  const warnings = [];
15434
16970
  const processId = context.process.process.id;
@@ -15507,14 +17043,14 @@ __name(buildProposalAnchorCheck, "buildProposalAnchorCheck");
15507
17043
  async function buildEnvironmentDoctorChecks(command) {
15508
17044
  const checks = [
15509
17045
  {
15510
- name: "read_only_surface",
17046
+ name: "command_surface",
15511
17047
  ok: true,
15512
- detail: "The Clarity CLI registers read commands only; generation, promotion, revert, assignment, postprocess, and automation build routes are not exposed."
17048
+ detail: "The Clarity CLI registers read commands and explicit write commands for public Clarity v2 routes."
15513
17049
  },
15514
17050
  {
15515
- name: "read_tools_available",
17051
+ name: "tools_available",
15516
17052
  ok: true,
15517
- detail: `${CLARITY_READ_TOOLS.length} read-only Clarity tools available.`,
17053
+ detail: `${CLARITY_TOOLS.length} Clarity tools available.`,
15518
17054
  next_command: "duvo clarity tools"
15519
17055
  }
15520
17056
  ];
@@ -15617,8 +17153,8 @@ async function buildTeamContextCheck(config) {
15617
17153
  }
15618
17154
  }
15619
17155
  __name(buildTeamContextCheck, "buildTeamContextCheck");
15620
- var listMyTeamsResponseSchema2 = z79.object({
15621
- teams: z79.array(z79.object({ id: z79.string() }))
17156
+ var listMyTeamsResponseSchema2 = z84.object({
17157
+ teams: z84.array(z84.object({ id: z84.string() }))
15622
17158
  });
15623
17159
  async function buildClarityApiReachableCheck(command, config) {
15624
17160
  let teamId;
@@ -16319,7 +17855,7 @@ function registerConnectionsGet(connections) {
16319
17855
  __name(registerConnectionsGet, "registerConnectionsGet");
16320
17856
 
16321
17857
  // src/commands/connections/list.ts
16322
- var TABLE_COLUMNS19 = [
17858
+ var TABLE_COLUMNS20 = [
16323
17859
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
16324
17860
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
16325
17861
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
@@ -16359,26 +17895,26 @@ function registerConnectionsList(connections) {
16359
17895
  console.log("No connections found.");
16360
17896
  return;
16361
17897
  }
16362
- console.log(renderTable(TABLE_COLUMNS19, rows));
17898
+ console.log(renderTable(TABLE_COLUMNS20, rows));
16363
17899
  console.log(`Showing ${rows.length}`);
16364
17900
  }, "listAction"));
16365
17901
  }
16366
17902
  __name(registerConnectionsList, "registerConnectionsList");
16367
17903
 
16368
17904
  // src/commands/connections/probe.ts
16369
- import { z as z80 } from "zod";
16370
- var toolSchema = z80.object({
16371
- name: z80.string(),
16372
- description: z80.string().optional(),
16373
- input_schema: z80.record(z80.string(), z80.unknown()).optional()
17905
+ import { z as z85 } from "zod";
17906
+ var toolSchema = z85.object({
17907
+ name: z85.string(),
17908
+ description: z85.string().optional(),
17909
+ input_schema: z85.record(z85.string(), z85.unknown()).optional()
16374
17910
  });
16375
- var probeResponseSchema = z80.object({
16376
- success: z80.boolean(),
16377
- tools: z80.array(toolSchema).optional(),
16378
- error: z80.string().optional()
17911
+ var probeResponseSchema = z85.object({
17912
+ success: z85.boolean(),
17913
+ tools: z85.array(toolSchema).optional(),
17914
+ error: z85.string().optional()
16379
17915
  });
16380
17916
  var DESCRIPTION_MAX_WIDTH = 80;
16381
- var TABLE_COLUMNS20 = [
17917
+ var TABLE_COLUMNS21 = [
16382
17918
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
16383
17919
  {
16384
17920
  header: "DESCRIPTION",
@@ -16438,7 +17974,7 @@ function registerConnectionsProbe(connections) {
16438
17974
  console.log("No tools found.");
16439
17975
  return;
16440
17976
  }
16441
- console.log(renderTable(TABLE_COLUMNS20, tools));
17977
+ console.log(renderTable(TABLE_COLUMNS21, tools));
16442
17978
  console.log(
16443
17979
  `Showing ${tools.length} tool${tools.length === 1 ? "" : "s"}`
16444
17980
  );
@@ -16594,48 +18130,48 @@ function registerConnections(program) {
16594
18130
  __name(registerConnections, "registerConnections");
16595
18131
 
16596
18132
  // src/api/credential-schemas.ts
16597
- import { z as z81 } from "zod";
16598
- var dateLike = z81.string();
16599
- var secretSchema = z81.object({
16600
- id: z81.string(),
16601
- team_id: z81.string(),
16602
- user_id: z81.string().nullable(),
16603
- name: z81.string(),
16604
- service_slug: z81.string().nullable(),
16605
- env_var_keys: z81.array(z81.string()),
16606
- created_by: z81.string(),
18133
+ import { z as z86 } from "zod";
18134
+ var dateLike = z86.string();
18135
+ var secretSchema = z86.object({
18136
+ id: z86.string(),
18137
+ team_id: z86.string(),
18138
+ user_id: z86.string().nullable(),
18139
+ name: z86.string(),
18140
+ service_slug: z86.string().nullable(),
18141
+ env_var_keys: z86.array(z86.string()),
18142
+ created_by: z86.string(),
16607
18143
  created_at: dateLike,
16608
18144
  updated_at: dateLike
16609
18145
  });
16610
- var secretsListResponseSchema = z81.array(secretSchema);
18146
+ var secretsListResponseSchema = z86.array(secretSchema);
16611
18147
  var secretResponseSchema = secretSchema;
16612
- var browserLoginSchema = z81.object({
16613
- id: z81.string(),
16614
- user_id: z81.string().nullable(),
16615
- team_id: z81.string(),
16616
- domain: z81.string(),
16617
- username: z81.string().nullable(),
18148
+ var browserLoginSchema = z86.object({
18149
+ id: z86.string(),
18150
+ user_id: z86.string().nullable(),
18151
+ team_id: z86.string(),
18152
+ domain: z86.string(),
18153
+ username: z86.string().nullable(),
16618
18154
  password: encryptedDataSchema.nullable(),
16619
18155
  otp_secret: encryptedDataSchema.nullable(),
16620
18156
  created_at: dateLike,
16621
18157
  updated_at: dateLike
16622
18158
  });
16623
- var browserLoginsListResponseSchema = z81.array(credentialPreviewSchema);
16624
- var revisionLoginSummarySchema = z81.object({
16625
- id: z81.string(),
16626
- user_id: z81.string().nullable(),
16627
- team_id: z81.string().nullable(),
16628
- domain: z81.string(),
16629
- username: z81.string().nullable(),
18159
+ var browserLoginsListResponseSchema = z86.array(credentialPreviewSchema);
18160
+ var revisionLoginSummarySchema = z86.object({
18161
+ id: z86.string(),
18162
+ user_id: z86.string().nullable(),
18163
+ team_id: z86.string().nullable(),
18164
+ domain: z86.string(),
18165
+ username: z86.string().nullable(),
16630
18166
  created_at: dateLike,
16631
18167
  updated_at: dateLike
16632
18168
  });
16633
- var revisionLoginsListResponseSchema = z81.array(
18169
+ var revisionLoginsListResponseSchema = z86.array(
16634
18170
  revisionLoginSummarySchema
16635
18171
  );
16636
- var revisionSecretsListResponseSchema = z81.array(secretSchema);
16637
- var successResponseSchema2 = z81.object({
16638
- success: z81.boolean()
18172
+ var revisionSecretsListResponseSchema = z86.array(secretSchema);
18173
+ var successResponseSchema2 = z86.object({
18174
+ success: z86.boolean()
16639
18175
  });
16640
18176
  var attachSuccessResponseSchema = successResponseSchema2;
16641
18177
  var deleteSecretResponseSchema = successResponseSchema2;
@@ -16829,7 +18365,7 @@ function registerCredentialsGet(credentials) {
16829
18365
  __name(registerCredentialsGet, "registerCredentialsGet");
16830
18366
 
16831
18367
  // src/commands/credentials/list.ts
16832
- var TABLE_COLUMNS21 = [
18368
+ var TABLE_COLUMNS22 = [
16833
18369
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
16834
18370
  { header: "DOMAIN", cell: /* @__PURE__ */ __name((row) => row.domain, "cell") },
16835
18371
  {
@@ -16888,7 +18424,7 @@ function registerCredentialsList(credentials) {
16888
18424
  console.log("No credentials found.");
16889
18425
  return;
16890
18426
  }
16891
- console.log(renderTable(TABLE_COLUMNS21, rows));
18427
+ console.log(renderTable(TABLE_COLUMNS22, rows));
16892
18428
  console.log(`Showing ${rows.length}`);
16893
18429
  }, "listAction"));
16894
18430
  }
@@ -17168,7 +18704,7 @@ function registerFilesDownloadUrl(files) {
17168
18704
  __name(registerFilesDownloadUrl, "registerFilesDownloadUrl");
17169
18705
 
17170
18706
  // src/commands/files/list.ts
17171
- var TABLE_COLUMNS22 = [
18707
+ var TABLE_COLUMNS23 = [
17172
18708
  { header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
17173
18709
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
17174
18710
  {
@@ -17211,7 +18747,7 @@ function registerFilesList(files) {
17211
18747
  console.log("No files found.");
17212
18748
  return;
17213
18749
  }
17214
- console.log(renderTable(TABLE_COLUMNS22, parsed.data.files));
18750
+ console.log(renderTable(TABLE_COLUMNS23, parsed.data.files));
17215
18751
  console.log(`Showing ${parsed.data.files.length}`);
17216
18752
  }, "listAction"));
17217
18753
  }
@@ -17473,7 +19009,7 @@ function registerIntegrationsCustom(integrations) {
17473
19009
  __name(registerIntegrationsCustom, "registerIntegrationsCustom");
17474
19010
 
17475
19011
  // src/commands/integrations/list.ts
17476
- var TABLE_COLUMNS23 = [
19012
+ var TABLE_COLUMNS24 = [
17477
19013
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
17478
19014
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
17479
19015
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
@@ -17515,7 +19051,7 @@ function registerIntegrationsList(integrations) {
17515
19051
  console.log("No integrations found.");
17516
19052
  return;
17517
19053
  }
17518
- console.log(renderTable(TABLE_COLUMNS23, rows));
19054
+ console.log(renderTable(TABLE_COLUMNS24, rows));
17519
19055
  console.log(`Showing ${rows.length}`);
17520
19056
  }, "listAction"));
17521
19057
  }
@@ -17532,7 +19068,7 @@ function registerIntegrations(program) {
17532
19068
  __name(registerIntegrations, "registerIntegrations");
17533
19069
 
17534
19070
  // src/commands/login.ts
17535
- import { isCancel as isCancel3, password, spinner, text as text2 } from "@clack/prompts";
19071
+ import { isCancel as isCancel4, password, spinner, text as text2 } from "@clack/prompts";
17536
19072
 
17537
19073
  // src/oauth/auth0-config.ts
17538
19074
  var BAKED_DOMAIN = "login.duvo.ai" ? "login.duvo.ai" : "login.dev.duvo.ai";
@@ -17924,7 +19460,7 @@ async function resolveProfileName(flag, existingCount) {
17924
19460
  return void 0;
17925
19461
  }, "validate")
17926
19462
  });
17927
- if (isCancel3(answer)) {
19463
+ if (isCancel4(answer)) {
17928
19464
  throw new CancelCliError("Login cancelled.");
17929
19465
  }
17930
19466
  return answer;
@@ -17943,7 +19479,7 @@ async function resolveApiKey(flag) {
17943
19479
  return void 0;
17944
19480
  }, "validate")
17945
19481
  });
17946
- if (isCancel3(answer)) {
19482
+ if (isCancel4(answer)) {
17947
19483
  throw new CancelCliError("Login cancelled.");
17948
19484
  }
17949
19485
  return answer;
@@ -18354,7 +19890,7 @@ function parseHeaders(raw) {
18354
19890
  return result;
18355
19891
  }
18356
19892
  __name(parseHeaders, "parseHeaders");
18357
- var TABLE_COLUMNS24 = [
19893
+ var TABLE_COLUMNS25 = [
18358
19894
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
18359
19895
  { header: "DESCRIPTION", cell: /* @__PURE__ */ __name((row) => row.description, "cell") }
18360
19896
  ];
@@ -18412,7 +19948,7 @@ function registerOauthMcpProbe(mcp) {
18412
19948
  console.log("No tools advertised by this MCP server.");
18413
19949
  return;
18414
19950
  }
18415
- console.log(renderTable(TABLE_COLUMNS24, rows));
19951
+ console.log(renderTable(TABLE_COLUMNS25, rows));
18416
19952
  console.log(`Showing ${rows.length}`);
18417
19953
  }, "probeMcpAction"));
18418
19954
  }
@@ -18494,7 +20030,7 @@ function registerOauth(program) {
18494
20030
  __name(registerOauth, "registerOauth");
18495
20031
 
18496
20032
  // src/commands/plugins/list.ts
18497
- var TABLE_COLUMNS25 = [
20033
+ var TABLE_COLUMNS26 = [
18498
20034
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
18499
20035
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
18500
20036
  {
@@ -18528,7 +20064,7 @@ function registerPluginsList(plugins) {
18528
20064
  console.log("No plugins found.");
18529
20065
  return;
18530
20066
  }
18531
- console.log(renderTable(TABLE_COLUMNS25, parsed.data.plugins));
20067
+ console.log(renderTable(TABLE_COLUMNS26, parsed.data.plugins));
18532
20068
  console.log(`Showing ${parsed.data.plugins.length}`);
18533
20069
  }, "listAction"));
18534
20070
  }
@@ -18565,12 +20101,12 @@ function padRight(value, width) {
18565
20101
  __name(padRight, "padRight");
18566
20102
 
18567
20103
  // src/commands/profiles/render-list.ts
18568
- var DEFAULT_MARKER = "\u25B6";
20104
+ var DEFAULT_MARKER2 = "\u25B6";
18569
20105
  var NON_DEFAULT_MARKER = " ";
18570
20106
  var COLUMNS = [
18571
20107
  {
18572
20108
  header: "",
18573
- cell: /* @__PURE__ */ __name((item) => item.isDefault ? DEFAULT_MARKER : NON_DEFAULT_MARKER, "cell")
20109
+ cell: /* @__PURE__ */ __name((item) => item.isDefault ? DEFAULT_MARKER2 : NON_DEFAULT_MARKER, "cell")
18574
20110
  },
18575
20111
  { header: "NAME", cell: /* @__PURE__ */ __name((item) => item.name, "cell") },
18576
20112
  {
@@ -18653,7 +20189,7 @@ function registerRename(profiles) {
18653
20189
  __name(registerRename, "registerRename");
18654
20190
 
18655
20191
  // src/commands/profiles/use.ts
18656
- import { isCancel as isCancel4, select } from "@clack/prompts";
20192
+ import { isCancel as isCancel5, select as select2 } from "@clack/prompts";
18657
20193
  var NAME_HEADER = "NAME";
18658
20194
  function registerUse(profiles) {
18659
20195
  profiles.command("use [name]").description(
@@ -18685,12 +20221,12 @@ async function pickProfileInteractively(config) {
18685
20221
  );
18686
20222
  }
18687
20223
  const options = buildPickerOptions(profiles);
18688
- const answer = await select({
20224
+ const answer = await select2({
18689
20225
  message: "Select default profile",
18690
20226
  initialValue: config.defaultProfile ?? profiles[0].name,
18691
20227
  options
18692
20228
  });
18693
- if (isCancel4(answer)) {
20229
+ if (isCancel5(answer)) {
18694
20230
  throw new CancelCliError("Profile switch cancelled.");
18695
20231
  }
18696
20232
  return answer;
@@ -18705,7 +20241,7 @@ function buildPickerOptions(profiles) {
18705
20241
  ...profiles.map((profile) => profile.name.length)
18706
20242
  );
18707
20243
  return profiles.map((profile, index) => {
18708
- const marker = profile.isDefault ? DEFAULT_MARKER : NON_DEFAULT_MARKER;
20244
+ const marker = profile.isDefault ? DEFAULT_MARKER2 : NON_DEFAULT_MARKER;
18709
20245
  const label = `${marker} ${padRight(profile.name, nameWidth)} ${maskedKeys[index]}`;
18710
20246
  return {
18711
20247
  value: profile.name,
@@ -18726,7 +20262,7 @@ function registerProfiles(program) {
18726
20262
  __name(registerProfiles, "registerProfiles");
18727
20263
 
18728
20264
  // src/commands/queue-labels/index.ts
18729
- var TABLE_COLUMNS26 = [
20265
+ var TABLE_COLUMNS27 = [
18730
20266
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
18731
20267
  { header: "KEY", cell: /* @__PURE__ */ __name((row) => row.key, "cell") },
18732
20268
  { header: "VALUE", cell: /* @__PURE__ */ __name((row) => row.value, "cell") },
@@ -18780,7 +20316,7 @@ function registerList3(labels) {
18780
20316
  console.log("No labels defined on this queue.");
18781
20317
  return;
18782
20318
  }
18783
- console.log(renderTable(TABLE_COLUMNS26, parsed.data.labels));
20319
+ console.log(renderTable(TABLE_COLUMNS27, parsed.data.labels));
18784
20320
  console.log(`Showing ${parsed.data.labels.length}`);
18785
20321
  }, "listAction"));
18786
20322
  }
@@ -19534,7 +21070,7 @@ __name(registerQueuesLinkAgent, "registerQueuesLinkAgent");
19534
21070
  var DEFAULT_LIMIT7 = 20;
19535
21071
  var MIN_LIMIT7 = 1;
19536
21072
  var MAX_LIMIT7 = 100;
19537
- var TABLE_COLUMNS27 = [
21073
+ var TABLE_COLUMNS28 = [
19538
21074
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
19539
21075
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
19540
21076
  {
@@ -19582,7 +21118,7 @@ function registerQueuesList(queues) {
19582
21118
  console.log("No queues found.");
19583
21119
  return;
19584
21120
  }
19585
- console.log(renderTable(TABLE_COLUMNS27, response.queues));
21121
+ console.log(renderTable(TABLE_COLUMNS28, response.queues));
19586
21122
  const resolvedOffset = response.offset ?? offset;
19587
21123
  const total = response.total ?? null;
19588
21124
  const summary = total === null ? `Showing ${response.queues.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.queues.length} of ${total} \xB7 offset ${resolvedOffset}`;
@@ -19840,7 +21376,7 @@ function registerRevisionLoginsDetach(revisionLogins) {
19840
21376
  __name(registerRevisionLoginsDetach, "registerRevisionLoginsDetach");
19841
21377
 
19842
21378
  // src/commands/revision-logins/list.ts
19843
- var TABLE_COLUMNS28 = [
21379
+ var TABLE_COLUMNS29 = [
19844
21380
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
19845
21381
  { header: "DOMAIN", cell: /* @__PURE__ */ __name((row) => row.domain, "cell") },
19846
21382
  {
@@ -19876,7 +21412,7 @@ function registerRevisionLoginsList(revisionLogins) {
19876
21412
  console.log("No browser logins attached to this revision.");
19877
21413
  return;
19878
21414
  }
19879
- console.log(renderTable(TABLE_COLUMNS28, rows));
21415
+ console.log(renderTable(TABLE_COLUMNS29, rows));
19880
21416
  console.log(`Showing ${rows.length}`);
19881
21417
  }, "listAction"));
19882
21418
  }
@@ -19949,7 +21485,7 @@ function registerRevisionSecretsDetach(revisionSecrets) {
19949
21485
  __name(registerRevisionSecretsDetach, "registerRevisionSecretsDetach");
19950
21486
 
19951
21487
  // src/commands/revision-secrets/list.ts
19952
- var TABLE_COLUMNS29 = [
21488
+ var TABLE_COLUMNS30 = [
19953
21489
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
19954
21490
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
19955
21491
  {
@@ -19987,7 +21523,7 @@ function registerRevisionSecretsList(revisionSecrets) {
19987
21523
  console.log("No secrets attached to this revision.");
19988
21524
  return;
19989
21525
  }
19990
- console.log(renderTable(TABLE_COLUMNS29, rows));
21526
+ console.log(renderTable(TABLE_COLUMNS30, rows));
19991
21527
  console.log(`Showing ${rows.length}`);
19992
21528
  }, "listAction"));
19993
21529
  }
@@ -20003,94 +21539,176 @@ function registerRevisionSecrets(program) {
20003
21539
  __name(registerRevisionSecrets, "registerRevisionSecrets");
20004
21540
 
20005
21541
  // src/api/run-schemas.ts
20006
- import { z as z82 } from "zod";
20007
- var publicRunSchema = z82.object({
20008
- id: z82.string(),
20009
- agent_id: z82.string(),
20010
- build_id: z82.string(),
20011
- status: z82.string(),
20012
- source: z82.string().nullish(),
20013
- sandbox_id: z82.string().nullish(),
20014
- started_at: z82.string().nullish(),
20015
- completed_at: z82.string().nullish(),
20016
- created_at: z82.string(),
20017
- updated_at: z82.string().nullish(),
20018
- human_in_the_loop_enabled: z82.boolean().nullish()
20019
- });
20020
- var startRunResponseSchema = z82.object({
21542
+ import { z as z87 } from "zod";
21543
+ var publicRunSchema = z87.object({
21544
+ id: z87.string(),
21545
+ agent_id: z87.string(),
21546
+ build_id: z87.string(),
21547
+ status: z87.string(),
21548
+ source: z87.string().nullish(),
21549
+ sandbox_id: z87.string().nullish(),
21550
+ started_at: z87.string().nullish(),
21551
+ completed_at: z87.string().nullish(),
21552
+ created_at: z87.string(),
21553
+ updated_at: z87.string().nullish(),
21554
+ human_in_the_loop_enabled: z87.boolean().nullish()
21555
+ });
21556
+ var startRunResponseSchema = z87.object({
20021
21557
  run: publicRunSchema
20022
21558
  });
20023
- var questionOptionSchema = z82.object({
20024
- label: z82.string(),
20025
- description: z82.string().nullish()
20026
- });
20027
- var questionSchema = z82.object({
20028
- question: z82.string(),
20029
- header: z82.string().nullish(),
20030
- options: z82.array(questionOptionSchema).nullish(),
20031
- multi_select: z82.boolean().nullish()
20032
- });
20033
- var pendingHumanRequestSchema = z82.object({
20034
- id: z82.string(),
20035
- title: z82.string(),
20036
- description: z82.string().nullish(),
20037
- created_at: z82.string(),
20038
- type: z82.string(),
20039
- questions: z82.array(questionSchema).nullish()
20040
- });
20041
- var getRunResponseSchema = z82.object({
21559
+ var questionOptionSchema = z87.object({
21560
+ label: z87.string(),
21561
+ description: z87.string().nullish()
21562
+ });
21563
+ var questionSchema = z87.object({
21564
+ question: z87.string(),
21565
+ header: z87.string().nullish(),
21566
+ options: z87.array(questionOptionSchema).nullish(),
21567
+ multi_select: z87.boolean().nullish()
21568
+ });
21569
+ var pendingHumanRequestSchema = z87.object({
21570
+ id: z87.string(),
21571
+ title: z87.string(),
21572
+ description: z87.string().nullish(),
21573
+ created_at: z87.string(),
21574
+ type: z87.string(),
21575
+ questions: z87.array(questionSchema).nullish()
21576
+ });
21577
+ var getRunResponseSchema = z87.object({
20042
21578
  run: publicRunSchema.nullable(),
20043
21579
  pending_human_request: pendingHumanRequestSchema.nullish()
20044
21580
  });
20045
- var stopRunResponseSchema = z82.object({
20046
- success: z82.boolean(),
20047
- message: z82.string().nullish()
20048
- });
20049
- var runMessageSchema = z82.object({
20050
- id: z82.string(),
20051
- type: z82.string(),
20052
- role: z82.string(),
20053
- timestamp: z82.string(),
20054
- text_content: z82.string().nullish(),
20055
- tool_call: z82.object({
20056
- id: z82.string(),
20057
- name: z82.string(),
20058
- arguments: z82.record(z82.string(), z82.unknown()).nullish()
21581
+ var stopRunResponseSchema = z87.object({
21582
+ success: z87.boolean(),
21583
+ message: z87.string().nullish()
21584
+ });
21585
+ var runMessageSchema = z87.object({
21586
+ id: z87.string(),
21587
+ type: z87.string(),
21588
+ role: z87.string(),
21589
+ timestamp: z87.string(),
21590
+ text_content: z87.string().nullish(),
21591
+ tool_call: z87.object({
21592
+ id: z87.string(),
21593
+ name: z87.string(),
21594
+ arguments: z87.record(z87.string(), z87.unknown()).nullish()
20059
21595
  }).nullish(),
20060
- tool_result: z82.object({
20061
- tool_call_id: z82.string(),
20062
- result: z82.unknown().nullish(),
20063
- error: z82.string().nullish()
21596
+ tool_result: z87.object({
21597
+ tool_call_id: z87.string(),
21598
+ result: z87.unknown().nullish(),
21599
+ error: z87.string().nullish()
20064
21600
  }).nullish()
20065
21601
  });
20066
- var listRunMessagesResponseSchema = z82.object({
20067
- messages: z82.array(runMessageSchema),
20068
- total: z82.number().nullish(),
20069
- limit: z82.number().nullish(),
20070
- offset: z82.number().nullish()
21602
+ var listRunMessagesResponseSchema = z87.object({
21603
+ messages: z87.array(runMessageSchema),
21604
+ total: z87.number().nullish(),
21605
+ limit: z87.number().nullish(),
21606
+ offset: z87.number().nullish()
20071
21607
  });
20072
- var postedMessageSchema = z82.object({
20073
- id: z82.string(),
20074
- type: z82.string(),
20075
- role: z82.string(),
20076
- timestamp: z82.string(),
20077
- text_content: z82.string()
21608
+ var postedMessageSchema = z87.object({
21609
+ id: z87.string(),
21610
+ type: z87.string(),
21611
+ role: z87.string(),
21612
+ timestamp: z87.string(),
21613
+ text_content: z87.string()
20078
21614
  });
20079
- var postRunMessageResponseSchema = z82.object({
21615
+ var postRunMessageResponseSchema = z87.object({
20080
21616
  message: postedMessageSchema
20081
21617
  });
20082
- var respondHumanRequestResponseSchema = z82.object({
20083
- human_request: z82.object({
20084
- id: z82.string(),
20085
- run_id: z82.string(),
20086
- title: z82.string(),
20087
- description: z82.string().nullish(),
20088
- response: z82.string().nullish(),
20089
- responded_at: z82.string().nullish(),
20090
- created_at: z82.string()
21618
+ var respondHumanRequestResponseSchema = z87.object({
21619
+ human_request: z87.object({
21620
+ id: z87.string(),
21621
+ run_id: z87.string(),
21622
+ title: z87.string(),
21623
+ description: z87.string().nullish(),
21624
+ response: z87.string().nullish(),
21625
+ responded_at: z87.string().nullish(),
21626
+ created_at: z87.string()
20091
21627
  })
20092
21628
  });
20093
21629
 
21630
+ // src/commands/runs/evaluation.ts
21631
+ async function resolveAgentId(runId, apiKey, apiBaseUrl) {
21632
+ const raw = await httpRequest({
21633
+ method: "GET",
21634
+ path: `/v2/runs/${encodeURIComponent(runId)}`,
21635
+ apiKey,
21636
+ apiBaseUrl
21637
+ });
21638
+ const parsed = getRunResponseSchema.safeParse(raw);
21639
+ if (!parsed.success) {
21640
+ throw new CliError(
21641
+ `Unexpected response from the API: ${parsed.error.message}`
21642
+ );
21643
+ }
21644
+ const { run } = parsed.data;
21645
+ if (!run) {
21646
+ throw new CliError(`Run "${runId}" not found.`);
21647
+ }
21648
+ return run.agent_id;
21649
+ }
21650
+ __name(resolveAgentId, "resolveAgentId");
21651
+ function registerRunsEvaluation(runs) {
21652
+ runs.command("evaluation <run-id>").alias("eval").description("Get the latest evaluation for an agent run").option(
21653
+ "--agent <agent-id>",
21654
+ "agent ID for the run (resolved from the run automatically when omitted)"
21655
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function evaluationAction(runId, options) {
21656
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
21657
+ const agentId = options.agent ?? await resolveAgentId(runId, apiKey, apiBaseUrl);
21658
+ const raw = await httpRequest({
21659
+ method: "GET",
21660
+ path: `/v2/agent/${encodeURIComponent(agentId)}/runs/${encodeURIComponent(runId)}/evaluation`,
21661
+ apiKey,
21662
+ apiBaseUrl
21663
+ });
21664
+ if (options.json) {
21665
+ printJson(raw);
21666
+ return;
21667
+ }
21668
+ const parsed = runEvaluationResponseSchema.safeParse(raw);
21669
+ if (!parsed.success) {
21670
+ throw new CliError(
21671
+ `Unexpected response from the API: ${parsed.error.message}`
21672
+ );
21673
+ }
21674
+ const evaluation = parsed.data.data;
21675
+ if (!evaluation) {
21676
+ console.log(`No evaluation available for run "${runId}".`);
21677
+ return;
21678
+ }
21679
+ console.log(
21680
+ renderKeyValue([
21681
+ { label: "ID", value: evaluation.id },
21682
+ { label: "Run", value: evaluation.run_id },
21683
+ { label: "Source", value: evaluation.source ?? "" },
21684
+ { label: "Created", value: evaluation.created_at }
21685
+ ])
21686
+ );
21687
+ const flags = Object.entries(evaluation.output.data).filter(
21688
+ ([key]) => key !== "final_comment"
21689
+ );
21690
+ if (flags.length > 0) {
21691
+ console.log("");
21692
+ console.log("Rubric:");
21693
+ console.log(
21694
+ renderKeyValue(
21695
+ flags.map(([key, value]) => ({
21696
+ label: key,
21697
+ value: value === null ? "" : String(value)
21698
+ }))
21699
+ )
21700
+ );
21701
+ }
21702
+ const finalComment = evaluation.output.data.final_comment;
21703
+ if (typeof finalComment === "string" && finalComment.length > 0) {
21704
+ console.log("");
21705
+ console.log("Final comment:");
21706
+ console.log(finalComment);
21707
+ }
21708
+ }, "evaluationAction"));
21709
+ }
21710
+ __name(registerRunsEvaluation, "registerRunsEvaluation");
21711
+
20094
21712
  // src/commands/runs/get.ts
20095
21713
  function registerRunsGet(runs) {
20096
21714
  runs.command("get <id>").description("Get an agent run by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(id, options) {
@@ -20156,7 +21774,7 @@ var MAX_LIMIT8 = 100;
20156
21774
  var SORT_ORDERS2 = ["asc", "desc"];
20157
21775
  var HAS_ISSUES_VALUES = ["true", "false"];
20158
21776
  var TITLE_PREVIEW_WIDTH = 50;
20159
- var TABLE_COLUMNS30 = [
21777
+ var TABLE_COLUMNS31 = [
20160
21778
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
20161
21779
  { header: "RUN#", cell: /* @__PURE__ */ __name((row) => String(row.run_number), "cell") },
20162
21780
  { header: "STATUS", cell: /* @__PURE__ */ __name((row) => row.status, "cell") },
@@ -20257,7 +21875,7 @@ function registerRunsList(runs) {
20257
21875
  console.log("No runs found.");
20258
21876
  return;
20259
21877
  }
20260
- console.log(renderTable(TABLE_COLUMNS30, response.data));
21878
+ console.log(renderTable(TABLE_COLUMNS31, response.data));
20261
21879
  console.log(
20262
21880
  `Showing ${response.data.length} of ${response.total} \xB7 offset ${offset}`
20263
21881
  );
@@ -20367,7 +21985,7 @@ var DEFAULT_LIMIT9 = 20;
20367
21985
  var MIN_LIMIT9 = 1;
20368
21986
  var MAX_LIMIT9 = 50;
20369
21987
  var TEXT_PREVIEW_WIDTH2 = 60;
20370
- var TABLE_COLUMNS31 = [
21988
+ var TABLE_COLUMNS32 = [
20371
21989
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
20372
21990
  { header: "ROLE", cell: /* @__PURE__ */ __name((row) => row.role, "cell") },
20373
21991
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
@@ -20432,7 +22050,7 @@ function registerRunsMessages(runs) {
20432
22050
  console.log("No messages found.");
20433
22051
  return;
20434
22052
  }
20435
- console.log(renderTable(TABLE_COLUMNS31, response.messages));
22053
+ console.log(renderTable(TABLE_COLUMNS32, response.messages));
20436
22054
  const resolvedOffset = response.offset ?? offset;
20437
22055
  const summary = response.total === null || response.total === void 0 ? `Showing ${response.messages.length} \xB7 offset ${resolvedOffset}` : `Showing ${response.messages.length} of ${response.total} \xB7 offset ${resolvedOffset}`;
20438
22056
  console.log(summary);
@@ -20691,6 +22309,7 @@ function registerRuns(program) {
20691
22309
  registerRunsStart(runs);
20692
22310
  registerRunsList(runs);
20693
22311
  registerRunsGet(runs);
22312
+ registerRunsEvaluation(runs);
20694
22313
  registerRunsMessages(runs);
20695
22314
  registerRunsSendMessage(runs);
20696
22315
  registerRunsRespond(runs);
@@ -20699,28 +22318,28 @@ function registerRuns(program) {
20699
22318
  __name(registerRuns, "registerRuns");
20700
22319
 
20701
22320
  // src/api/sandbox-schemas.ts
20702
- import { z as z83 } from "zod";
20703
- var createSandboxResponseSchema = z83.object({
20704
- sandbox_id: z83.string(),
20705
- expires_at: z83.string()
22321
+ import { z as z88 } from "zod";
22322
+ var createSandboxResponseSchema = z88.object({
22323
+ sandbox_id: z88.string(),
22324
+ expires_at: z88.string()
20706
22325
  });
20707
- var createSandboxUploadUrlResponseSchema = z83.object({
20708
- upload_url: z83.string(),
20709
- path: z83.string(),
20710
- expires_in_seconds: z83.number()
22326
+ var createSandboxUploadUrlResponseSchema = z88.object({
22327
+ upload_url: z88.string(),
22328
+ path: z88.string(),
22329
+ expires_in_seconds: z88.number()
20711
22330
  });
20712
- var sandboxFileSchema = z83.object({
20713
- name: z83.string(),
20714
- path: z83.string(),
20715
- type: z83.enum(["file", "dir"]),
20716
- size_bytes: z83.number()
22331
+ var sandboxFileSchema = z88.object({
22332
+ name: z88.string(),
22333
+ path: z88.string(),
22334
+ type: z88.enum(["file", "dir"]),
22335
+ size_bytes: z88.number()
20717
22336
  });
20718
- var listSandboxFilesResponseSchema = z83.object({
20719
- files: z83.array(sandboxFileSchema)
22337
+ var listSandboxFilesResponseSchema = z88.object({
22338
+ files: z88.array(sandboxFileSchema)
20720
22339
  });
20721
- var uploadSandboxFileResponseSchema = z83.object({
20722
- path: z83.string(),
20723
- size_bytes: z83.number()
22340
+ var uploadSandboxFileResponseSchema = z88.object({
22341
+ path: z88.string(),
22342
+ size_bytes: z88.number()
20724
22343
  });
20725
22344
  var DEFAULT_SANDBOX_FILES_PATH = "/workspace";
20726
22345
 
@@ -20757,7 +22376,7 @@ function registerSandboxesCreate(sandboxes) {
20757
22376
  __name(registerSandboxesCreate, "registerSandboxesCreate");
20758
22377
 
20759
22378
  // src/commands/sandboxes/files.ts
20760
- var TABLE_COLUMNS32 = [
22379
+ var TABLE_COLUMNS33 = [
20761
22380
  { header: "TYPE", cell: /* @__PURE__ */ __name((row) => row.type, "cell") },
20762
22381
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
20763
22382
  { header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
@@ -20795,7 +22414,7 @@ function registerSandboxesFiles(sandboxes) {
20795
22414
  console.log("No files found.");
20796
22415
  return;
20797
22416
  }
20798
- console.log(renderTable(TABLE_COLUMNS32, files));
22417
+ console.log(renderTable(TABLE_COLUMNS33, files));
20799
22418
  console.log(`Showing ${files.length}`);
20800
22419
  }, "filesAction"));
20801
22420
  }
@@ -20848,8 +22467,8 @@ function registerSandboxesPrepareUploadUrl(sandboxes) {
20848
22467
  __name(registerSandboxesPrepareUploadUrl, "registerSandboxesPrepareUploadUrl");
20849
22468
 
20850
22469
  // src/commands/sandboxes/upload.ts
20851
- import { readFile as readFile5, stat } from "node:fs/promises";
20852
- import { basename } from "node:path";
22470
+ import { readFile as readFile6, stat } from "node:fs/promises";
22471
+ import { basename as basename2 } from "node:path";
20853
22472
  var MAX_DIRECT_UPLOAD_BYTES = 10 * 1024 * 1024;
20854
22473
  function registerSandboxesUpload(sandboxes) {
20855
22474
  sandboxes.command("upload <sandbox_id> <file>").description(
@@ -20875,11 +22494,11 @@ function registerSandboxesUpload(sandboxes) {
20875
22494
  `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.`
20876
22495
  );
20877
22496
  }
20878
- const content = await readFile5(file).catch((error) => {
22497
+ const content = await readFile6(file).catch((error) => {
20879
22498
  const message = error instanceof Error ? error.message : String(error);
20880
22499
  throw new CliError(`Could not read file "${file}": ${message}`);
20881
22500
  });
20882
- const filename = basename(file);
22501
+ const filename = basename2(file);
20883
22502
  const formData = new FormData();
20884
22503
  formData.append("file", new Blob([new Uint8Array(content)]), filename);
20885
22504
  if (trimmedPath !== void 0) {
@@ -21140,7 +22759,7 @@ function registerSecretsGet(secrets) {
21140
22759
  __name(registerSecretsGet, "registerSecretsGet");
21141
22760
 
21142
22761
  // src/commands/secrets/list.ts
21143
- var TABLE_COLUMNS33 = [
22762
+ var TABLE_COLUMNS34 = [
21144
22763
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
21145
22764
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
21146
22765
  {
@@ -21184,7 +22803,7 @@ function registerSecretsList(secrets) {
21184
22803
  console.log("No secrets found.");
21185
22804
  return;
21186
22805
  }
21187
- console.log(renderTable(TABLE_COLUMNS33, rows));
22806
+ console.log(renderTable(TABLE_COLUMNS34, rows));
21188
22807
  console.log(`Showing ${rows.length}`);
21189
22808
  }, "listAction"));
21190
22809
  }
@@ -21295,7 +22914,7 @@ function registerSecrets(program) {
21295
22914
  __name(registerSecrets, "registerSecrets");
21296
22915
 
21297
22916
  // src/commands/skills/assignments.ts
21298
- var TABLE_COLUMNS34 = [
22917
+ var TABLE_COLUMNS35 = [
21299
22918
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
21300
22919
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") }
21301
22920
  ];
@@ -21323,7 +22942,7 @@ function registerSkillsAssignments(skills) {
21323
22942
  console.log("No assignments use this skill.");
21324
22943
  return;
21325
22944
  }
21326
- console.log(renderTable(TABLE_COLUMNS34, assignments));
22945
+ console.log(renderTable(TABLE_COLUMNS35, assignments));
21327
22946
  console.log(`Showing ${assignments.length} of ${total}`);
21328
22947
  }, "assignmentsAction"));
21329
22948
  }
@@ -21331,13 +22950,13 @@ __name(registerSkillsAssignments, "registerSkillsAssignments");
21331
22950
 
21332
22951
  // src/commands/skills/create.ts
21333
22952
  import { readFileSync as readFileSync4 } from "node:fs";
21334
- import { z as z84 } from "zod";
21335
- var createSkillResponseSchema = z84.object({
21336
- skill: z84.object({
21337
- id: z84.string(),
21338
- name: z84.string(),
21339
- description: z84.string(),
21340
- team_id: z84.string()
22953
+ import { z as z89 } from "zod";
22954
+ var createSkillResponseSchema = z89.object({
22955
+ skill: z89.object({
22956
+ id: z89.string(),
22957
+ name: z89.string(),
22958
+ description: z89.string(),
22959
+ team_id: z89.string()
21341
22960
  })
21342
22961
  });
21343
22962
  function registerSkillsCreate(skills) {
@@ -21605,7 +23224,7 @@ function readContent2(options) {
21605
23224
  __name(readContent2, "readContent");
21606
23225
 
21607
23226
  // src/commands/skills/files.ts
21608
- var TABLE_COLUMNS35 = [
23227
+ var TABLE_COLUMNS36 = [
21609
23228
  { header: "PATH", cell: /* @__PURE__ */ __name((row) => row.path, "cell") },
21610
23229
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name, "cell") },
21611
23230
  {
@@ -21644,7 +23263,7 @@ function registerSkillsFiles(skills) {
21644
23263
  console.log("No files found.");
21645
23264
  return;
21646
23265
  }
21647
- console.log(renderTable(TABLE_COLUMNS35, parsed.data.files));
23266
+ console.log(renderTable(TABLE_COLUMNS36, parsed.data.files));
21648
23267
  console.log(`Showing ${parsed.data.files.length}`);
21649
23268
  }, "filesAction"));
21650
23269
  }
@@ -21701,13 +23320,13 @@ function readExistingContent(source) {
21701
23320
  __name(readExistingContent, "readExistingContent");
21702
23321
 
21703
23322
  // src/commands/skills/install.ts
21704
- import { z as z85 } from "zod";
21705
- var installSkillResponseSchema = z85.object({
21706
- skill: z85.object({
21707
- id: z85.string(),
21708
- name: z85.string(),
21709
- description: z85.string(),
21710
- team_id: z85.string()
23323
+ import { z as z90 } from "zod";
23324
+ var installSkillResponseSchema = z90.object({
23325
+ skill: z90.object({
23326
+ id: z90.string(),
23327
+ name: z90.string(),
23328
+ description: z90.string(),
23329
+ team_id: z90.string()
21711
23330
  })
21712
23331
  });
21713
23332
  function registerSkillsInstall(skills) {
@@ -21895,15 +23514,15 @@ function registerSkillsSystem(skills) {
21895
23514
  __name(registerSkillsSystem, "registerSkillsSystem");
21896
23515
 
21897
23516
  // src/commands/skills/upload.ts
21898
- import { readFile as readFile6, stat as stat2 } from "node:fs/promises";
21899
- import { basename as basename2 } from "node:path";
21900
- import { z as z86 } from "zod";
21901
- var uploadSkillResponseSchema = z86.object({
21902
- skill: z86.object({
21903
- id: z86.string(),
21904
- name: z86.string(),
21905
- description: z86.string(),
21906
- team_id: z86.string()
23517
+ import { readFile as readFile7, stat as stat2 } from "node:fs/promises";
23518
+ import { basename as basename3 } from "node:path";
23519
+ import { z as z91 } from "zod";
23520
+ var uploadSkillResponseSchema = z91.object({
23521
+ skill: z91.object({
23522
+ id: z91.string(),
23523
+ name: z91.string(),
23524
+ description: z91.string(),
23525
+ team_id: z91.string()
21907
23526
  })
21908
23527
  });
21909
23528
  function registerSkillsUpload(skills) {
@@ -21917,11 +23536,11 @@ function registerSkillsUpload(skills) {
21917
23536
  if (!fileStats.isFile()) {
21918
23537
  throw new CliError(`Could not read file "${file}": not a regular file`);
21919
23538
  }
21920
- const content = await readFile6(file).catch((error) => {
23539
+ const content = await readFile7(file).catch((error) => {
21921
23540
  const message = error instanceof Error ? error.message : String(error);
21922
23541
  throw new CliError(`Could not read file "${file}": ${message}`);
21923
23542
  });
21924
- const filename = basename2(file);
23543
+ const filename = basename3(file);
21925
23544
  const formData = new FormData();
21926
23545
  formData.append("file", new Blob([new Uint8Array(content)]), filename);
21927
23546
  const config = await requireAuthenticatedConfig(this);
@@ -22058,7 +23677,7 @@ __name(registerTeamGet, "registerTeamGet");
22058
23677
  var DEFAULT_LIMIT10 = 50;
22059
23678
  var MIN_LIMIT10 = 1;
22060
23679
  var MAX_LIMIT10 = 100;
22061
- var TABLE_COLUMNS36 = [
23680
+ var TABLE_COLUMNS37 = [
22062
23681
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
22063
23682
  { header: "NAME", cell: /* @__PURE__ */ __name((row) => row.name ?? "", "cell") },
22064
23683
  { header: "EMAIL", cell: /* @__PURE__ */ __name((row) => row.email, "cell") },
@@ -22109,7 +23728,7 @@ function registerTeamMembers(team) {
22109
23728
  console.log("No members found.");
22110
23729
  return;
22111
23730
  }
22112
- console.log(renderTable(TABLE_COLUMNS36, response.members));
23731
+ console.log(renderTable(TABLE_COLUMNS37, response.members));
22113
23732
  console.log(
22114
23733
  `Showing ${response.members.length} of ${response.total} \xB7 offset ${response.offset}`
22115
23734
  );
@@ -22118,11 +23737,11 @@ function registerTeamMembers(team) {
22118
23737
  __name(registerTeamMembers, "registerTeamMembers");
22119
23738
 
22120
23739
  // src/commands/team/use.ts
22121
- import { z as z87 } from "zod";
23740
+ import { z as z92 } from "zod";
22122
23741
  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;
22123
- var teamIdSchema = z87.string().regex(TEAM_ID_SHAPE);
22124
- var listMyTeamsResponseSchema3 = z87.object({
22125
- teams: z87.array(z87.object({ id: z87.string() }))
23742
+ var teamIdSchema = z92.string().regex(TEAM_ID_SHAPE);
23743
+ var listMyTeamsResponseSchema3 = z92.object({
23744
+ teams: z92.array(z92.object({ id: z92.string() }))
22126
23745
  });
22127
23746
  function registerTeamUse(team) {
22128
23747
  team.command("use <team-id>").description(
@@ -22204,14 +23823,14 @@ function registerTeam(program) {
22204
23823
  __name(registerTeam, "registerTeam");
22205
23824
 
22206
23825
  // src/commands/teams/list.ts
22207
- import { z as z88 } from "zod";
22208
- var teamApiSchema2 = z88.object({
22209
- id: z88.string(),
22210
- name: z88.string(),
22211
- organization_id: z88.string().nullable()
23826
+ import { z as z93 } from "zod";
23827
+ var teamApiSchema2 = z93.object({
23828
+ id: z93.string(),
23829
+ name: z93.string(),
23830
+ organization_id: z93.string().nullable()
22212
23831
  });
22213
- var listMyTeamsResponseSchema4 = z88.object({
22214
- teams: z88.array(teamApiSchema2)
23832
+ var listMyTeamsResponseSchema4 = z93.object({
23833
+ teams: z93.array(teamApiSchema2)
22215
23834
  });
22216
23835
  function registerTeamsList(program) {
22217
23836
  const teams = program.command("teams").description("Inspect the teams your credentials can act on");
@@ -22307,7 +23926,7 @@ __name(resolveActiveTeamId, "resolveActiveTeamId");
22307
23926
  var version = resolveVersion();
22308
23927
  function resolveVersion() {
22309
23928
  if (true) {
22310
- return "1.2.0";
23929
+ return "1.4.0";
22311
23930
  }
22312
23931
  const packageJsonPath = join2(
22313
23932
  dirname2(fileURLToPath(import.meta.url)),
@@ -22376,7 +23995,7 @@ function checkForUpdate() {
22376
23995
  __name(checkForUpdate, "checkForUpdate");
22377
23996
  function loadPackageMeta() {
22378
23997
  if (true) {
22379
- return { name: "@duvoai/cli", version: "1.2.0" };
23998
+ return { name: "@duvoai/cli", version: "1.4.0" };
22380
23999
  }
22381
24000
  const require2 = createRequire(import.meta.url);
22382
24001
  const raw = require2("../package.json");