@duvoai/cli 1.8.0 → 1.9.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
@@ -2946,6 +2946,98 @@ var clarityProcessLandscapeSummarySchema = z13.object({
2946
2946
  contributors: z13.array(clarityProcessContributorSchema),
2947
2947
  updatedAt: z13.coerce.date()
2948
2948
  });
2949
+ var clarityLandscapeAssignedTeamSchema = z13.object({
2950
+ id: z13.guid(),
2951
+ name: z13.string()
2952
+ });
2953
+ var CLARITY_LANDSCAPE_SUGGESTION_STATUSES = [
2954
+ "pending",
2955
+ "accepted",
2956
+ "dismissed"
2957
+ ];
2958
+ var clarityLandscapeSuggestionStatusSchema = z13.enum(
2959
+ CLARITY_LANDSCAPE_SUGGESTION_STATUSES
2960
+ );
2961
+ var clarityLandscapeTeamAssignmentSuggestionSchema = z13.object({
2962
+ id: z13.guid(),
2963
+ suggestedTeamId: z13.guid().nullable(),
2964
+ suggestedTeamName: z13.string(),
2965
+ confidence: z13.number().min(0).max(1),
2966
+ rationale: z13.string(),
2967
+ status: clarityLandscapeSuggestionStatusSchema,
2968
+ createdAt: z13.string()
2969
+ });
2970
+ var clarityLandscapeCaptureSuggestionSchema = z13.object({
2971
+ id: z13.guid(),
2972
+ suggestedUserId: z13.guid().nullable(),
2973
+ suggestedUserName: z13.string().nullable(),
2974
+ suggestedTeamId: z13.guid().nullable(),
2975
+ suggestedTeamName: z13.string().nullable(),
2976
+ gap: z13.string().min(1),
2977
+ suggestedPrompt: z13.string().nullable(),
2978
+ confidence: z13.number().min(0).max(1),
2979
+ rationale: z13.string().min(1),
2980
+ status: clarityLandscapeSuggestionStatusSchema,
2981
+ createdAt: z13.string()
2982
+ }).superRefine((suggestion, ctx) => {
2983
+ const hasSuggestedUser = suggestion.suggestedUserId !== null || suggestion.suggestedUserName !== null;
2984
+ const hasSuggestedTeam = suggestion.suggestedTeamId !== null || suggestion.suggestedTeamName !== null;
2985
+ if (!hasSuggestedUser && !hasSuggestedTeam) {
2986
+ ctx.addIssue({
2987
+ code: "custom",
2988
+ message: "Capture suggestion must include a suggested user or team"
2989
+ });
2990
+ }
2991
+ if (suggestion.suggestedUserId === null !== (suggestion.suggestedUserName === null)) {
2992
+ ctx.addIssue({
2993
+ code: "custom",
2994
+ message: "Suggested user id and name must be provided together",
2995
+ path: ["suggestedUserId"]
2996
+ });
2997
+ }
2998
+ if (suggestion.suggestedTeamId === null !== (suggestion.suggestedTeamName === null)) {
2999
+ ctx.addIssue({
3000
+ code: "custom",
3001
+ message: "Suggested team id and name must be provided together",
3002
+ path: ["suggestedTeamId"]
3003
+ });
3004
+ }
3005
+ });
3006
+ var CLARITY_LANDSCAPE_CAPTURE_REQUEST_STATUSES = [
3007
+ "open",
3008
+ "completed",
3009
+ "cancelled"
3010
+ ];
3011
+ var clarityLandscapeCaptureRequestStatusSchema = z13.enum(
3012
+ CLARITY_LANDSCAPE_CAPTURE_REQUEST_STATUSES
3013
+ );
3014
+ var clarityLandscapeCaptureRequestSchema = z13.object({
3015
+ id: z13.guid(),
3016
+ requestedUserId: z13.guid().nullable(),
3017
+ requestedUserName: z13.string().nullable(),
3018
+ assignedByUserId: z13.guid().nullable().optional(),
3019
+ requestedTeamId: z13.guid().nullable(),
3020
+ requestedTeamName: z13.string().nullable(),
3021
+ gap: z13.string().min(1),
3022
+ prompt: z13.string().nullable(),
3023
+ status: clarityLandscapeCaptureRequestStatusSchema,
3024
+ createdAt: z13.string()
3025
+ }).superRefine((request, ctx) => {
3026
+ if (request.requestedUserId === null !== (request.requestedUserName === null)) {
3027
+ ctx.addIssue({
3028
+ code: "custom",
3029
+ message: "Requested user id and name must be provided together",
3030
+ path: ["requestedUserId"]
3031
+ });
3032
+ }
3033
+ if (request.requestedTeamId === null !== (request.requestedTeamName === null)) {
3034
+ ctx.addIssue({
3035
+ code: "custom",
3036
+ message: "Requested team id and name must be provided together",
3037
+ path: ["requestedTeamId"]
3038
+ });
3039
+ }
3040
+ });
2949
3041
  var clarityProcessLandscapeNodeSchema = z13.object({
2950
3042
  id: z13.guid(),
2951
3043
  parentId: z13.guid().nullable(),
@@ -2962,7 +3054,15 @@ var clarityProcessLandscapeNodeSchema = z13.object({
2962
3054
  source: z13.enum(["ai", "human"]),
2963
3055
  createdAt: z13.string(),
2964
3056
  updatedAt: z13.string(),
2965
- process: clarityProcessLandscapeSummarySchema.nullable()
3057
+ process: clarityProcessLandscapeSummarySchema.nullable(),
3058
+ scope: z13.enum(["team", "organization"]).optional(),
3059
+ teamId: z13.guid().nullable().optional(),
3060
+ teamName: z13.string().nullable().optional(),
3061
+ assignedTeam: clarityLandscapeAssignedTeamSchema.nullable().optional(),
3062
+ assignedTeams: z13.array(z13.object({ teamId: z13.guid(), teamName: z13.string().nullable() })).optional(),
3063
+ teamAssignmentSuggestions: z13.array(clarityLandscapeTeamAssignmentSuggestionSchema).optional(),
3064
+ captureSuggestions: z13.array(clarityLandscapeCaptureSuggestionSchema).optional(),
3065
+ captureRequests: z13.array(clarityLandscapeCaptureRequestSchema).optional()
2966
3066
  });
2967
3067
  var clarityProcessLandscapeLinkSchema = z13.object({
2968
3068
  id: z13.guid(),
@@ -5418,7 +5518,7 @@ var artifactRevisionSchema = z24.object({
5418
5518
  created_at: z24.string()
5419
5519
  });
5420
5520
  var artifactRevisionListResponseSchema = z24.object({
5421
- data: z24.array(artifactRevisionSchema),
5521
+ revisions: z24.array(artifactRevisionSchema),
5422
5522
  total: z24.number(),
5423
5523
  // The live "head" version — what the dashboard currently shows and what the
5424
5524
  // next turn continues from by default. Null while the first turn is in flight.
@@ -5426,7 +5526,7 @@ var artifactRevisionListResponseSchema = z24.object({
5426
5526
  current_version: z24.number().int().positive().nullable()
5427
5527
  });
5428
5528
  var restoreArtifactRevisionResponseSchema = z24.object({
5429
- ok: z24.literal(true),
5529
+ success: z24.literal(true),
5430
5530
  // The version now live (the head was moved here; nothing is copied or lost).
5431
5531
  current_revision_id: z24.guid(),
5432
5532
  current_version: z24.number().int().positive()
@@ -22201,7 +22301,7 @@ function registerPulseCreate(pulse) {
22201
22301
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22202
22302
  const raw = await httpRequest({
22203
22303
  method: "POST",
22204
- path: "/v1/artifacts",
22304
+ path: "/v2/artifacts",
22205
22305
  apiKey,
22206
22306
  apiBaseUrl,
22207
22307
  body: { message }
@@ -22237,7 +22337,7 @@ function registerPulseDelete(pulse) {
22237
22337
  });
22238
22338
  const raw = await httpRequest({
22239
22339
  method: "DELETE",
22240
- path: `/v1/artifacts/${encodeURIComponent(pulseId)}`,
22340
+ path: `/v2/artifacts/${encodeURIComponent(pulseId)}`,
22241
22341
  apiKey,
22242
22342
  apiBaseUrl
22243
22343
  });
@@ -22263,7 +22363,7 @@ function registerPulseGet(pulse) {
22263
22363
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22264
22364
  const raw = await httpRequest({
22265
22365
  method: "GET",
22266
- path: `/v1/artifacts/${encodeURIComponent(pulseId)}`,
22366
+ path: `/v2/artifacts/${encodeURIComponent(pulseId)}`,
22267
22367
  apiKey,
22268
22368
  apiBaseUrl
22269
22369
  });
@@ -22305,12 +22405,16 @@ __name(registerPulseGet, "registerPulseGet");
22305
22405
  function registerPulseHtml(pulse) {
22306
22406
  pulse.command("html <id>").description(
22307
22407
  "Print a Pulse dashboard's rendered HTML document to stdout (pipe to a file or browser)"
22308
- ).action(/* @__PURE__ */ __name(async function htmlAction(id) {
22408
+ ).option(
22409
+ "--version <version-id>",
22410
+ "render a specific historical version instead of the live one (see `duvo pulse versions`)"
22411
+ ).action(/* @__PURE__ */ __name(async function htmlAction(id, options) {
22309
22412
  const pulseId = trimRequired(id, "<id>");
22310
22413
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22414
+ const path = options.version ? `/v2/artifacts/${encodeURIComponent(pulseId)}/revisions/${encodeURIComponent(options.version)}/render` : `/v2/artifacts/${encodeURIComponent(pulseId)}/render`;
22311
22415
  const raw = await httpRequest({
22312
22416
  method: "GET",
22313
- path: `/v1/artifacts/${encodeURIComponent(pulseId)}/render`,
22417
+ path,
22314
22418
  apiKey,
22315
22419
  apiBaseUrl
22316
22420
  });
@@ -22356,7 +22460,7 @@ function registerPulseList(pulse) {
22356
22460
  searchParams.append("offset", String(offset));
22357
22461
  const raw = await httpRequest({
22358
22462
  method: "GET",
22359
- path: "/v1/artifacts",
22463
+ path: "/v2/artifacts",
22360
22464
  apiKey,
22361
22465
  apiBaseUrl,
22362
22466
  searchParams
@@ -22384,6 +22488,40 @@ function registerPulseList(pulse) {
22384
22488
  }
22385
22489
  __name(registerPulseList, "registerPulseList");
22386
22490
 
22491
+ // src/commands/pulse/restore.ts
22492
+ function registerPulseRestore(pulse) {
22493
+ pulse.command("restore <id> <version-id>").description(
22494
+ "Restore a previous version of a dashboard, making it live again (creator only). Non-destructive \u2014 list versions with `duvo pulse versions`."
22495
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function restoreAction(id, versionId, options) {
22496
+ const pulseId = trimRequired(id, "<id>");
22497
+ const revisionId = trimRequired(versionId, "<version-id>");
22498
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22499
+ const raw = await httpRequest({
22500
+ method: "POST",
22501
+ path: `/v2/artifacts/${encodeURIComponent(pulseId)}/revisions/${encodeURIComponent(revisionId)}/restore`,
22502
+ apiKey,
22503
+ apiBaseUrl,
22504
+ body: {}
22505
+ });
22506
+ if (options.json) {
22507
+ printJson(raw);
22508
+ return;
22509
+ }
22510
+ const parsed = restoreArtifactRevisionResponseSchema.safeParse(raw);
22511
+ if (!parsed.success) {
22512
+ throw new CliError(
22513
+ `Unexpected response from the API: ${parsed.error.message}`
22514
+ );
22515
+ }
22516
+ console.log(
22517
+ green(
22518
+ `Restored version ${parsed.data.current_version} as the live dashboard.`
22519
+ )
22520
+ );
22521
+ }, "restoreAction"));
22522
+ }
22523
+ __name(registerPulseRestore, "registerPulseRestore");
22524
+
22387
22525
  // src/commands/pulse/send-message.ts
22388
22526
  function registerPulseSendMessage(pulse) {
22389
22527
  pulse.command("send-message <id>").description(
@@ -22397,7 +22535,7 @@ function registerPulseSendMessage(pulse) {
22397
22535
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22398
22536
  const raw = await httpRequest({
22399
22537
  method: "POST",
22400
- path: `/v1/artifacts/${encodeURIComponent(pulseId)}/messages`,
22538
+ path: `/v2/artifacts/${encodeURIComponent(pulseId)}/messages`,
22401
22539
  apiKey,
22402
22540
  apiBaseUrl,
22403
22541
  body: { message }
@@ -22421,6 +22559,52 @@ function registerPulseSendMessage(pulse) {
22421
22559
  }
22422
22560
  __name(registerPulseSendMessage, "registerPulseSendMessage");
22423
22561
 
22562
+ // src/commands/pulse/versions.ts
22563
+ function registerPulseVersions(pulse) {
22564
+ pulse.command("versions <id>").description(
22565
+ "List a Pulse dashboard's version history, newest first (the 'time machine'). Restore one with `duvo pulse restore`."
22566
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function versionsAction(id, options) {
22567
+ const pulseId = trimRequired(id, "<id>");
22568
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
22569
+ const raw = await httpRequest({
22570
+ method: "GET",
22571
+ path: `/v2/artifacts/${encodeURIComponent(pulseId)}/revisions`,
22572
+ apiKey,
22573
+ apiBaseUrl
22574
+ });
22575
+ if (options.json) {
22576
+ printJson(raw);
22577
+ return;
22578
+ }
22579
+ const parsed = artifactRevisionListResponseSchema.safeParse(raw);
22580
+ if (!parsed.success) {
22581
+ throw new CliError(
22582
+ `Unexpected response from the API: ${parsed.error.message}`
22583
+ );
22584
+ }
22585
+ const { revisions, current_revision_id: currentRevisionId } = parsed.data;
22586
+ if (revisions.length === 0) {
22587
+ console.log("No versions yet.");
22588
+ return;
22589
+ }
22590
+ const columns = [
22591
+ {
22592
+ header: "",
22593
+ cell: /* @__PURE__ */ __name((row) => row.id === currentRevisionId ? "\u25B6" : "", "cell")
22594
+ },
22595
+ {
22596
+ header: "VERSION",
22597
+ cell: /* @__PURE__ */ __name((row) => String(row.version), "cell")
22598
+ },
22599
+ { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
22600
+ { header: "CREATED", cell: /* @__PURE__ */ __name((row) => row.created_at, "cell") }
22601
+ ];
22602
+ console.log(renderTable(columns, revisions));
22603
+ console.log(`\u25B6 marks the current (live) version.`);
22604
+ }, "versionsAction"));
22605
+ }
22606
+ __name(registerPulseVersions, "registerPulseVersions");
22607
+
22424
22608
  // src/commands/pulse/index.ts
22425
22609
  function registerPulse(program) {
22426
22610
  const pulse = program.command("pulse").description("Manage Duvo Pulse dashboards in the public API");
@@ -22430,6 +22614,8 @@ function registerPulse(program) {
22430
22614
  registerPulseHtml(pulse);
22431
22615
  registerPulseSendMessage(pulse);
22432
22616
  registerPulseDelete(pulse);
22617
+ registerPulseVersions(pulse);
22618
+ registerPulseRestore(pulse);
22433
22619
  }
22434
22620
  __name(registerPulse, "registerPulse");
22435
22621
 
@@ -26257,7 +26443,7 @@ __name(resolveActiveTeamId, "resolveActiveTeamId");
26257
26443
  var version = resolveVersion();
26258
26444
  function resolveVersion() {
26259
26445
  if (true) {
26260
- return "1.8.0";
26446
+ return "1.9.0";
26261
26447
  }
26262
26448
  const packageJsonPath = join3(
26263
26449
  dirname3(fileURLToPath2(import.meta.url)),
@@ -26341,7 +26527,7 @@ function checkForUpdate() {
26341
26527
  __name(checkForUpdate, "checkForUpdate");
26342
26528
  function loadPackageMeta() {
26343
26529
  if (true) {
26344
- return { name: "@duvoai/cli", version: "1.8.0" };
26530
+ return { name: "@duvoai/cli", version: "1.9.0" };
26345
26531
  }
26346
26532
  const require2 = createRequire(import.meta.url);
26347
26533
  const raw = require2("../package.json");