@duvoai/cli 1.116.0 → 1.118.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/README.md CHANGED
@@ -206,7 +206,7 @@ Default output is summary-first and compact. JSON output also includes a compact
206
206
  | `duvo agents set-model <id> --model <model>` | Switch the LLM model used by an agent's latest revision |
207
207
  | `duvo agents eval-scores <agent-id>` | Show aggregate evaluation scores for an agent's jobs (`--since`, `--scope`) |
208
208
  | `duvo agents eval-rubrics <agent-id>` | List an agent's active evaluation rubrics (`--build`) |
209
- | `duvo agents schedules list <agent-id>` | List schedules you own for an agent (`duvo agents schedules <agent-id>` also works; `--all-users` lists every member's, with who created each one, for elevated team roles) |
209
+ | `duvo agents schedules list <agent-id>` | List schedules you own for an agent (`duvo agents schedules <agent-id>` also works; `--all-users` lists every member's, with the member each one runs as, for elevated team roles) |
210
210
  | `duvo agents schedules create <agent-id> --frequency <f> --timezone <tz>` | Create a schedule for an agent (`--time`, `--day`, `--day-of-month`, `--cron`) |
211
211
  | `duvo agents schedules update <agent-id> <schedule-id>` | Update a schedule (`--enable`/`--disable`, `--frequency`, `--time`, `--clear-*`, ...) |
212
212
  | `duvo agents schedules delete <agent-id> <schedule-id>` | Delete a schedule |
@@ -231,7 +231,7 @@ Default output is summary-first and compact. JSON output also includes a compact
231
231
  | `duvo automations create --name <name>` | Create an automation (its first agent is created alongside it); `--run-scope team` makes it run as your team |
232
232
  | `duvo automations run-scope-options` | Show whether you can create an automation that runs as your team, and why not |
233
233
  | `duvo automations rename <id> --name <name>` | Rename an automation |
234
- | `duvo automations duplicate <id>` (alias `clone`) | Duplicate an automation into a "Copy of …" automation from its live agents, queues and routing; your triggers and schedules are copied switched off (`--json`) |
234
+ | `duvo automations duplicate <id>` (alias `clone`) | Duplicate an automation into a "Copy of …" automation from its live agents, queues and routing; `--run-scope personal` (default) copies your triggers and schedules switched off, `--run-scope team` keeps only shared pins (`--run-scope`, `--json`) |
235
235
  | `duvo automations convert-to-team <id>` | Convert an automation to run as your team (one-way). Members' personal triggers and schedules on it are turned off; copy your own AOP exceptions with `--copy-exception` (`--yes`, `--json`); `--dry-run` previews what conversion turns off and changes nothing |
236
236
  | `duvo automations delete <id>` | Delete an automation (its agents and queues stop dispatching) |
237
237
  | `duvo automations current <id>` | Show what an automation is set up to do right now (agents, queues, triggers, schedules) |
package/dist/bin/duvo.js CHANGED
@@ -11672,7 +11672,14 @@ var scheduleApiSchema = z44.object({
11672
11672
  id: z44.string(),
11673
11673
  build_id: z44.string(),
11674
11674
  agent_id: z44.string(),
11675
- user_id: z44.string(),
11675
+ /** The user the schedule runs as. Null on a shared schedule, which belongs to its Team automation and runs as the team. */
11676
+ user_id: z44.string().nullable(),
11677
+ /**
11678
+ * The user who set the schedule up. Null when nobody recorded it, or the
11679
+ * profile was deleted. Optional so a response from an older server still
11680
+ * parses.
11681
+ */
11682
+ created_by: z44.string().nullable().optional(),
11676
11683
  enabled: z44.boolean(),
11677
11684
  frequency: scheduleFrequencySchema,
11678
11685
  time: z44.string().nullable(),
@@ -13578,7 +13585,7 @@ var caseQueueItemSchema = z55.object({
13578
13585
  "The automation revision that produced the case. It never changes. Null when no Run created the case (added through the API or an import, or created before automation revisions), and on a team without automation revisions."
13579
13586
  ),
13580
13587
  automation_revision_id: z55.guid().nullable().optional().describe(
13581
- "The automation revision that handles the case. It is set when a Run creates the case, set again to the revision that runs the case when a Run claims it, and otherwise changes only when an activation moves waiting cases. For a case that no Run created, null until a Run claims it or an activation moves it. Null on a team without automation revisions."
13588
+ "The automation revision the case is pinned to, whose routing handles it. A case a draft Run creates is pinned to that draft and keeps the pin after the draft goes live. Any other case is null, and follows the automation's live revision, unless its team pins cases to live revisions: then it is pinned to the revision of the Run that creates or first claims it. Moving a case to the live revision (Run on live revision, or an activation that moves waiting cases) pins it to that revision on such a team and clears the pin otherwise. Null on a team without automation revisions."
13582
13589
  ),
13583
13590
  automation_revision: caseRevisionPinSchema.nullable().optional().describe(
13584
13591
  "The handling revision, resolved. Null when the case has no handling revision."
@@ -13863,7 +13870,9 @@ var caseBulkStatusUpdateResponseSchema = z55.object({
13863
13870
  });
13864
13871
  var caseRunOnLiveRevisionResponseSchema = z55.object({
13865
13872
  success: z55.literal(true),
13866
- automation_revision_id: z55.guid().describe("The live revision the case is now pinned to.")
13873
+ automation_revision_id: z55.guid().describe(
13874
+ "The live revision the case now runs on. The case is pinned to it only on a team that pins cases to live revisions; otherwise it is left unpinned and follows the automation's live wiring."
13875
+ )
13867
13876
  });
13868
13877
  var caseBulkPriorityUpdateResponseSchema = z55.object({
13869
13878
  updatedCount: z55.number(),
@@ -14446,6 +14455,11 @@ var duplicateAutomationResponseApiSchema = z57.object({
14446
14455
  "The new automation: a copy of the source's live agents, builds, queues and the routing between them."
14447
14456
  )
14448
14457
  });
14458
+ var duplicateAutomationBodyApiSchema = z57.object({
14459
+ run_scope: z57.enum(AUTOMATION_RUN_SCOPES).default("personal").describe(
14460
+ "Who the copy's runs execute as, whatever the original runs as: `personal` (the default) runs as each member with their own Connections; `team` runs as the team with shared Connections, Secrets and Logins only, and can't be changed back. `team` has the same requirements as creating an automation with `run_scope: team`: read `GET /v2/teams/{teamId}/automations/run-scope-options` to see whether it is available and why not. Refused with 409 and the blocker's `code` when it isn't, or 403 `permission_required` for a caller below Lead Builder."
14461
+ )
14462
+ }).default({ run_scope: "personal" });
14449
14463
  var TEAM_CONVERSION_BLOCKER_CODES = [
14450
14464
  "automations_workspace_required",
14451
14465
  "module_demo",
@@ -14488,6 +14502,15 @@ var runScopeOptionsResponseApiSchema = z57.object({
14488
14502
  "The `team` run scope. `personal` is always available to anyone who may create an automation."
14489
14503
  )
14490
14504
  });
14505
+ var runScopeOptionsClientResponseSchema = z57.object({
14506
+ team: z57.object({
14507
+ available: z57.boolean(),
14508
+ blocker: z57.object({
14509
+ code: z57.string(),
14510
+ message: z57.string()
14511
+ }).nullable()
14512
+ })
14513
+ });
14491
14514
  var teamConversionPreviewApiSchema = z57.object({
14492
14515
  personal_rows: z57.array(
14493
14516
  z57.object({
@@ -17245,6 +17268,41 @@ var casesListRequestBodySchema = z79.object({
17245
17268
  include_blockers: z79.boolean().optional().describe(CASE_INCLUDE_BLOCKERS_DESCRIPTION),
17246
17269
  fields: z79.array(z79.enum(CASE_LIST_SELECTABLE_FIELDS)).min(1).optional().describe(CASE_LIST_FIELDS_DESCRIPTION)
17247
17270
  });
17271
+ var RUN_CASE_LIST_SELECTABLE_FIELDS = [
17272
+ "id",
17273
+ "queue_id",
17274
+ "title",
17275
+ "data",
17276
+ "json_data",
17277
+ "json_schema_id",
17278
+ "status",
17279
+ "display_status",
17280
+ "priority",
17281
+ "labels",
17282
+ "claimed_at",
17283
+ "claimed_by_run_id",
17284
+ "completed_at",
17285
+ "postponed_to",
17286
+ "created_at",
17287
+ "updated_at"
17288
+ ];
17289
+ var MAX_RUN_LABEL_FILTER_KEYS = 20;
17290
+ var MAX_RUN_LABEL_FILTER_VALUES = 100;
17291
+ var runCasesFiltersSchema = casesFiltersSchema.omit({ awaiting_my_approval: true }).extend({
17292
+ // Bounded here, not on the shared filters: each label key adds a
17293
+ // correlated subquery and each value an expression, and this route is
17294
+ // reachable with any run's key.
17295
+ labels: z79.record(z79.string(), z79.array(z79.string()).max(MAX_RUN_LABEL_FILTER_VALUES)).refine(
17296
+ (labels) => Object.keys(labels).length <= MAX_RUN_LABEL_FILTER_KEYS,
17297
+ `labels may name at most ${MAX_RUN_LABEL_FILTER_KEYS} label keys`
17298
+ ).optional()
17299
+ }).strict();
17300
+ var runCasesSearchRequestBodySchema = casesListRequestBodySchema.omit({ include_blockers: true }).extend({
17301
+ filters: runCasesFiltersSchema.default({}),
17302
+ fields: z79.array(z79.enum(RUN_CASE_LIST_SELECTABLE_FIELDS)).min(1).optional().describe(
17303
+ "Return only these keys on each case. `id` is always returned. Leaving out `data` and `json_data` skips reading the payload. Omit to return every key."
17304
+ )
17305
+ }).strict();
17248
17306
  function toBase64(input) {
17249
17307
  if (typeof btoa === "function") {
17250
17308
  return btoa(unescape(encodeURIComponent(input)));
@@ -22355,7 +22413,8 @@ var publicScheduleSchema = z87.object({
22355
22413
  id: z87.string(),
22356
22414
  build_id: z87.string(),
22357
22415
  agent_id: z87.string(),
22358
- user_id: z87.string(),
22416
+ /** The user the schedule runs as; null on a shared schedule, which runs as the team. */
22417
+ user_id: z87.string().nullable(),
22359
22418
  enabled: z87.boolean(),
22360
22419
  frequency: z87.string(),
22361
22420
  time: z87.string().nullish(),
@@ -22369,9 +22428,9 @@ var publicScheduleSchema = z87.object({
22369
22428
  created_at: z87.string(),
22370
22429
  updated_at: z87.string(),
22371
22430
  /**
22372
- * Who created the schedule. Returned only by the elevated all-users read
22373
- * (`GET /agents/{agent_id}/schedules/all`); absent on the caller's-own
22374
- * listing, where every row belongs to the caller anyway.
22431
+ * The member the schedule runs as, null on a shared schedule. Returned only
22432
+ * by the elevated all-users read (`GET /agents/{agent_id}/schedules/all`);
22433
+ * absent on the caller's-own listing, where every row is the caller's.
22375
22434
  */
22376
22435
  user_name: z87.string().nullish(),
22377
22436
  user_email: z87.string().nullish()
@@ -22571,8 +22630,8 @@ __name(registerAgentsSchedulesDelete, "registerAgentsSchedulesDelete");
22571
22630
 
22572
22631
  // src/commands/agents/schedules/list.ts
22573
22632
  var TASK_PREVIEW_WIDTH = 40;
22574
- var CREATED_BY_WIDTH = 28;
22575
- var CREATED_BY_HEADER = "CREATED BY";
22633
+ var OWNER_WIDTH = 28;
22634
+ var OWNER_HEADER = "OWNER";
22576
22635
  var TABLE_COLUMNS7 = [
22577
22636
  { header: "ID", cell: /* @__PURE__ */ __name((row) => row.id, "cell") },
22578
22637
  {
@@ -22592,13 +22651,13 @@ var TABLE_COLUMNS7 = [
22592
22651
  maxWidth: TASK_PREVIEW_WIDTH
22593
22652
  },
22594
22653
  {
22595
- header: CREATED_BY_HEADER,
22596
- cell: /* @__PURE__ */ __name((row) => row.user_name ?? row.user_email ?? row.user_id, "cell"),
22597
- maxWidth: CREATED_BY_WIDTH
22654
+ header: OWNER_HEADER,
22655
+ cell: /* @__PURE__ */ __name((row) => row.user_id === null ? "shared" : row.user_name ?? row.user_email ?? row.user_id, "cell"),
22656
+ maxWidth: OWNER_WIDTH
22598
22657
  }
22599
22658
  ];
22600
22659
  function columnsFor(allUsers) {
22601
- return allUsers ? TABLE_COLUMNS7 : TABLE_COLUMNS7.filter((column) => column.header !== CREATED_BY_HEADER);
22660
+ return allUsers ? TABLE_COLUMNS7 : TABLE_COLUMNS7.filter((column) => column.header !== OWNER_HEADER);
22602
22661
  }
22603
22662
  __name(columnsFor, "columnsFor");
22604
22663
  function whenCell(row) {
@@ -22619,7 +22678,7 @@ function registerAgentsSchedulesList(schedules) {
22619
22678
  "List schedules for an agent \u2014 your own by default, or every member's with --all-users (use to find the schedule ID for update / delete)"
22620
22679
  ).option(
22621
22680
  "--all-users",
22622
- "list every team member's schedules on the agent, with who created each one (requires an elevated team role)"
22681
+ "list every team member's schedules on the agent, with the member each one runs as (requires an elevated team role)"
22623
22682
  ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(agentId, options) {
22624
22683
  const id = trimRequired(agentId, "<agent-id>");
22625
22684
  const allUsers = options.allUsers === true;
@@ -25518,7 +25577,7 @@ __name(printConversionPreview, "printConversionPreview");
25518
25577
 
25519
25578
  // src/commands/shared/run-scope.ts
25520
25579
  import { InvalidArgumentError } from "commander";
25521
- var RUN_SCOPE_OPTION_DESCRIPTION = "who the automation's runs execute as: personal (each member, the default) or team (shared Connections only; needs Lead Builder or above, can't be changed back)";
25580
+ var RUN_SCOPE_OPTION_DESCRIPTION = "who the automation's runs execute as: personal (each member, the default) or team (shared Connections only; needs a higher role, can't be changed back)";
25522
25581
  function parseRunScope(value) {
25523
25582
  const scope = value.trim().toLowerCase();
25524
25583
  const match = AUTOMATION_RUN_SCOPES.find((candidate) => candidate === scope);
@@ -25840,10 +25899,20 @@ function registerAutomationsDelete(automations) {
25840
25899
  }
25841
25900
  __name(registerAutomationsDelete, "registerAutomationsDelete");
25842
25901
 
25902
+ // src/commands/automations/run-scope-label.ts
25903
+ function runScopeLabel2(runScope) {
25904
+ return runScope === "team" ? "Team" : "Each member";
25905
+ }
25906
+ __name(runScopeLabel2, "runScopeLabel");
25907
+
25843
25908
  // src/commands/automations/duplicate.ts
25844
25909
  function registerAutomationsDuplicate(automations) {
25845
25910
  automations.command("duplicate <id>").alias("clone").description(
25846
- 'Duplicate an automation into a new "Copy of <name>" automation: its live agents, queues and routing. Your own triggers and schedules are copied switched off; cases and run history are not copied.'
25911
+ `Duplicate an automation into a new "Copy of <name>" automation: its live agents, queues and routing. Cases and run history are not copied. A copy that runs as each member keeps every pin and takes your own triggers and schedules, switched off; one that runs as your team keeps only the team's shared pins and its team AOP exceptions.`
25912
+ ).option(
25913
+ "--run-scope <scope>",
25914
+ "who the copy's runs execute as, whatever the original runs as: personal (each member, the default) or team (shared Connections only; needs a higher role in the automation's team, can't be changed back)",
25915
+ parseRunScope
25847
25916
  ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function duplicateAction(id, options) {
25848
25917
  const automationId = trimRequired(id, "<id>");
25849
25918
  const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
@@ -25853,13 +25922,26 @@ function registerAutomationsDuplicate(automations) {
25853
25922
  automation_id: automationId
25854
25923
  }),
25855
25924
  apiKey,
25856
- apiBaseUrl
25925
+ apiBaseUrl,
25926
+ ...options.runScope !== void 0 && {
25927
+ body: { run_scope: options.runScope }
25928
+ }
25857
25929
  });
25930
+ const parsed = duplicateAutomationResponseApiSchema.safeParse(raw);
25858
25931
  if (options.json) {
25859
25932
  printJson(raw);
25933
+ }
25934
+ if (options.runScope === "team") {
25935
+ const copyId = parsed.data?.automation.id;
25936
+ assertRunScopeHonoured(
25937
+ options.runScope,
25938
+ parsed.data?.automation.run_scope,
25939
+ copyId ? `copy ${copyId}` : void 0
25940
+ );
25941
+ }
25942
+ if (options.json) {
25860
25943
  return;
25861
25944
  }
25862
- const parsed = duplicateAutomationResponseApiSchema.safeParse(raw);
25863
25945
  if (!parsed.success) {
25864
25946
  throw new CliError(
25865
25947
  `Unexpected response from the API: ${parsed.error.message}`
@@ -25872,6 +25954,7 @@ function registerAutomationsDuplicate(automations) {
25872
25954
  renderKeyValue([
25873
25955
  { label: "ID", value: automation.id },
25874
25956
  { label: "Name", value: automation.name },
25957
+ { label: "Runs as", value: runScopeLabel2(automation.run_scope) },
25875
25958
  { label: "Agents", value: String(automation.agent_count) },
25876
25959
  { label: "Queues", value: String(automation.queue_count) }
25877
25960
  ])
@@ -26162,12 +26245,6 @@ function registerAutomationsGenerateProposal(automations) {
26162
26245
  }
26163
26246
  __name(registerAutomationsGenerateProposal, "registerAutomationsGenerateProposal");
26164
26247
 
26165
- // src/commands/automations/run-scope-label.ts
26166
- function runScopeLabel2(runScope) {
26167
- return runScope === "team" ? "Team" : "Each member";
26168
- }
26169
- __name(runScopeLabel2, "runScopeLabel");
26170
-
26171
26248
  // src/commands/automations/get.ts
26172
26249
  function registerAutomationsGet(automations) {
26173
26250
  automations.command("get <id>").description("Get an automation by ID").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function getAction(id, options) {
@@ -53336,6 +53413,39 @@ function formatTraceparent(traceId, parentSpanId) {
53336
53413
  }
53337
53414
  __name(formatTraceparent, "formatTraceparent");
53338
53415
  __name3(formatTraceparent, "formatTraceparent");
53416
+ var PREVIEW_PROJECT_NUMBER = "286048984292";
53417
+ var CLOUD_RUN_PREVIEW_HOST = /^([a-z0-9-]+)-taskcrew-fe-(\d+)\.europe-west1\.run\.app$/;
53418
+ var MAPPED_PREVIEW_HOST = /^monorepo-([a-z0-9-]+)\.taskcrew-staging\.ai$/;
53419
+ function previewAdminUrl(hostname) {
53420
+ const host = hostname.toLowerCase();
53421
+ const cloudRun = CLOUD_RUN_PREVIEW_HOST.exec(host);
53422
+ if (cloudRun) {
53423
+ const [, slug, projectNumber] = cloudRun;
53424
+ return `https://${slug}-admin-${projectNumber}.europe-west1.run.app`;
53425
+ }
53426
+ const mapped = MAPPED_PREVIEW_HOST.exec(host);
53427
+ return mapped ? `https://${mapped[1]}-admin-${PREVIEW_PROJECT_NUMBER}.europe-west1.run.app` : null;
53428
+ }
53429
+ __name(previewAdminUrl, "previewAdminUrl");
53430
+ __name3(previewAdminUrl, "previewAdminUrl");
53431
+ function adminUrl(environment, hostname) {
53432
+ const preview = previewAdminUrl(hostname);
53433
+ if (preview) {
53434
+ return preview;
53435
+ }
53436
+ if (hostname.toLowerCase() === "app.stg.duvo.ai") {
53437
+ return "https://admin.stg.duvo.ai";
53438
+ }
53439
+ if (hostname.toLowerCase() === "app.duvo.ai" || environment === "production") {
53440
+ return "https://admin.duvo.ai";
53441
+ }
53442
+ if (["localhost", "127.0.0.1"].includes(hostname.toLowerCase())) {
53443
+ return "http://localhost:3100";
53444
+ }
53445
+ return "https://admin.stg.duvo.ai";
53446
+ }
53447
+ __name(adminUrl, "adminUrl");
53448
+ __name3(adminUrl, "adminUrl");
53339
53449
  var AUDIT_CHANGE_CLASS = {
53340
53450
  team_member: "access_control",
53341
53451
  custom_role: "access_control",
@@ -56989,6 +57099,20 @@ var FEATURE_FLAG_CATALOGUE = {
56989
57099
  stage: "public_beta",
56990
57100
  description: "Enables the Suggestions tab in the assignment builder \u2014 a per-Assignment inbox of typed, evidence-backed improvement proposals (connection-correctness analysis this cycle) that users apply into the draft build or dismiss."
56991
57101
  },
57102
+ DPU_BURN_METERING: {
57103
+ key: "dpu_burn_metering",
57104
+ defaultValue: false,
57105
+ stage: "dev",
57106
+ stageEnrollmentExclusion: "Metering requires an explicit rollout.",
57107
+ description: "With the Automations flag on, meter Automation Runs that start while this flag is enabled. Enable after the serving backend and its rollback target both support metering."
57108
+ },
57109
+ DPU_BURN_RATE: {
57110
+ key: "dpu_burn_rate",
57111
+ defaultValue: false,
57112
+ stage: "dev",
57113
+ stageEnrollmentExclusion: "Customer DPU visibility requires an explicit rollout.",
57114
+ description: "Show customers their DPU usage on the Automations workspace when the Automations flag is on. Configure metering separately."
57115
+ },
56992
57116
  AUTOMATIONS: {
56993
57117
  key: "automations",
56994
57118
  defaultValue: false,
@@ -57027,6 +57151,12 @@ var FEATURE_FLAG_CATALOGUE = {
57027
57151
  implies: ["automations"],
57028
57152
  description: "Makes the Automations migration convert straight to revision semantics instead of the lite workspace. When off (the default), POST /automations/migrate writes automation containers only and stamps team.automations_migrated_at; when on, it also snapshots each automation's current live builds and queue routing as revision 1 and stamps team.automation_revisions_migrated_at. Trigger configs and recurring builder schedules are always folded into that snapshot as versioned declarations, so a team on versions never keeps them as live, unversioned legacy rows; one-time schedules, ones an agent set itself, timings versions cannot express and trigger types whose dispatch does not read the revision stay legacy rows. Turning versions off ('Turn off revisions') unfolds them again. This replaces AUTOMATION_VERSIONED_TRIGGERS_SCHEDULES (`automation_versioned_triggers_schedules`), which is no longer declared. It implied AUTOMATION_VERSIONING, so a subject that had only it on is given `automation_versioning` by hand in the admin before this release ships. Its own rows are left in the database and resolve nowhere in this code, so the admin lists it under db-only flags, where it should be cleared from. Only applies to a team that is still standalone \u2014 it is not the lite-to-versioned cutover, which resolves its groups from existing automation membership rather than by closure discovery. Resolved for the caller, user-level overrides included, as the button resolves it, and only consulted for a team that also has AUTOMATIONS on."
57029
57153
  },
57154
+ AUTOMATION_LIVE_CASE_PINS: {
57155
+ key: "automation_live_case_pins",
57156
+ defaultValue: false,
57157
+ stage: "dev",
57158
+ description: "Pins a versioned automation's cases to the live or historic revision they were created under, so each keeps following that revision's wiring after a newer revision goes live. When off (the default), only a case created by a draft run is pinned: it follows that exact revision for life, through activation and after it becomes historic. A run counts as a draft run while it belongs to an automation run that started on a draft (revision_status draft), carries its revision and either does not work a case that follows the live wiring or is the first run of a root automation run (a builder test started on a chosen case), so a test's cases created after its draft is activated are pinned too. Every other case on the team (one a live or historic run created, an imported or manual one) stays unpinned and follows the automation's live wiring, as on an automation without versions. The decision is made when a case is written and never revisited. With the flag off, a claim leaves an unpinned case unpinned, and its run takes the live revision rather than a parent run's pin; 'Run on live revision' and an activation that moves waiting cases unpin them instead of pinning them to the new live revision, except a case already pinned to the revision being activated, which keeps its pin. Switching the flag changes only cases written afterwards. Resolved at team scope with no user, because case dispatch has none. Has no effect on lite automations, which have no revisions to pin to."
57159
+ },
57030
57160
  AUTOMATION_CONVERSION_MEASUREMENT: {
57031
57161
  key: "automation_conversion_measurement",
57032
57162
  defaultValue: false,
@@ -64986,6 +65116,8 @@ var claritySizingSchema = z392.object({
64986
65116
  });
64987
65117
  var MONTHS_PER_YEAR = 12;
64988
65118
  var USD_PER_DPU = 1e3;
65119
+ var DPU_RUN_COST_MARKUP_PERCENT = 20;
65120
+ var DPU_RUN_COST_MULTIPLIER = 1 + DPU_RUN_COST_MARKUP_PERCENT / 100;
64989
65121
  function dpusPerMonth(timeSaved, formula) {
64990
65122
  if (timeSaved.timeSavedHoursPerMonth === null) {
64991
65123
  return null;
@@ -70363,7 +70495,7 @@ var INTEGRATION_DESCRIPTORS = [
70363
70495
  type: "case-queue-producer",
70364
70496
  name: "Queue (Producer)",
70365
70497
  icon_url: "/integration-icons/case-queue.svg",
70366
- description: "Add items to queues for processing by other agents or workflows. Provides tools: add_cases, get_case_schema, declare_case_schema, update_case_schema, list_cases, list_labels.",
70498
+ description: "Add items to queues for processing by other agents or workflows. Provides tools: add_cases, get_case_schema, declare_case_schema, update_case_schema, read_case_file, list_cases, list_labels, list_aggregations, evaluate_aggregation, get_aggregation_result, create_aggregation, refresh_aggregation, delete_aggregation.",
70367
70499
  category: "duvo-platform",
70368
70500
  oauth_provider_id: null
70369
70501
  },
@@ -70372,7 +70504,7 @@ var INTEGRATION_DESCRIPTORS = [
70372
70504
  type: "case-queue-consumer",
70373
70505
  name: "Queue (Consumer)",
70374
70506
  icon_url: "/integration-icons/case-queue.svg",
70375
- description: "Process items from queues and trigger automated workflows. Provides tools: claim_case, get_case_schema, complete_case, fail_case, postpone_case, update_case, list_cases, list_labels.",
70507
+ description: "Process items from queues and trigger automated workflows. Provides tools: claim_case, get_case_schema, complete_case, fail_case, postpone_case, update_case, set_case_fields, attach_case_file, read_case_file, list_cases, list_labels, list_aggregations, evaluate_aggregation, get_aggregation_result.",
70376
70508
  category: "duvo-platform",
70377
70509
  oauth_provider_id: null
70378
70510
  },
@@ -79373,7 +79505,14 @@ var scheduleApiSchema2 = z1102.object({
79373
79505
  id: z1102.string(),
79374
79506
  build_id: z1102.string(),
79375
79507
  agent_id: z1102.string(),
79376
- user_id: z1102.string(),
79508
+ /** The user the schedule runs as. Null on a shared schedule, which belongs to its Team automation and runs as the team. */
79509
+ user_id: z1102.string().nullable(),
79510
+ /**
79511
+ * The user who set the schedule up. Null when nobody recorded it, or the
79512
+ * profile was deleted. Optional so a response from an older server still
79513
+ * parses.
79514
+ */
79515
+ created_by: z1102.string().nullable().optional(),
79377
79516
  enabled: z1102.boolean(),
79378
79517
  frequency: scheduleFrequencySchema2,
79379
79518
  time: z1102.string().nullable(),
@@ -79879,7 +80018,14 @@ var clarityConversionContextInputSchema = z1152.discriminatedUnion(
79879
80018
  * Set by Module Setup's Approve and build: the module's own Automation,
79880
80019
  * which the build updates instead of creating a second one.
79881
80020
  */
79882
- targetAutomationId: z1152.guid().optional()
80021
+ targetAutomationId: z1152.guid().optional(),
80022
+ /**
80023
+ * Who the new Automation's runs execute as, picked beside Build
80024
+ * automation. The build's prepare step reads it for this attempt when
80025
+ * the model passes none. Never with `targetAutomationId`: a build into
80026
+ * an existing Automation keeps that Automation's scope.
80027
+ */
80028
+ runScope: runScopeSchema2.optional()
79883
80029
  })
79884
80030
  ]
79885
80031
  );
@@ -81631,7 +81777,7 @@ var caseQueueItemSchema2 = z1282.object({
81631
81777
  "The automation revision that produced the case. It never changes. Null when no Run created the case (added through the API or an import, or created before automation revisions), and on a team without automation revisions."
81632
81778
  ),
81633
81779
  automation_revision_id: z1282.guid().nullable().optional().describe(
81634
- "The automation revision that handles the case. It is set when a Run creates the case, set again to the revision that runs the case when a Run claims it, and otherwise changes only when an activation moves waiting cases. For a case that no Run created, null until a Run claims it or an activation moves it. Null on a team without automation revisions."
81780
+ "The automation revision the case is pinned to, whose routing handles it. A case a draft Run creates is pinned to that draft and keeps the pin after the draft goes live. Any other case is null, and follows the automation's live revision, unless its team pins cases to live revisions: then it is pinned to the revision of the Run that creates or first claims it. Moving a case to the live revision (Run on live revision, or an activation that moves waiting cases) pins it to that revision on such a team and clears the pin otherwise. Null on a team without automation revisions."
81635
81781
  ),
81636
81782
  automation_revision: caseRevisionPinSchema2.nullable().optional().describe(
81637
81783
  "The handling revision, resolved. Null when the case has no handling revision."
@@ -81916,7 +82062,9 @@ var caseBulkStatusUpdateResponseSchema2 = z1282.object({
81916
82062
  });
81917
82063
  var caseRunOnLiveRevisionResponseSchema2 = z1282.object({
81918
82064
  success: z1282.literal(true),
81919
- automation_revision_id: z1282.guid().describe("The live revision the case is now pinned to.")
82065
+ automation_revision_id: z1282.guid().describe(
82066
+ "The live revision the case now runs on. The case is pinned to it only on a team that pins cases to live revisions; otherwise it is left unpinned and follows the automation's live wiring."
82067
+ )
81920
82068
  });
81921
82069
  var caseBulkPriorityUpdateResponseSchema2 = z1282.object({
81922
82070
  updatedCount: z1282.number(),
@@ -82499,6 +82647,11 @@ var duplicateAutomationResponseApiSchema2 = z1302.object({
82499
82647
  "The new automation: a copy of the source's live agents, builds, queues and the routing between them."
82500
82648
  )
82501
82649
  });
82650
+ var duplicateAutomationBodyApiSchema2 = z1302.object({
82651
+ run_scope: z1302.enum(AUTOMATION_RUN_SCOPES2).default("personal").describe(
82652
+ "Who the copy's runs execute as, whatever the original runs as: `personal` (the default) runs as each member with their own Connections; `team` runs as the team with shared Connections, Secrets and Logins only, and can't be changed back. `team` has the same requirements as creating an automation with `run_scope: team`: read `GET /v2/teams/{teamId}/automations/run-scope-options` to see whether it is available and why not. Refused with 409 and the blocker's `code` when it isn't, or 403 `permission_required` for a caller below Lead Builder."
82653
+ )
82654
+ }).default({ run_scope: "personal" });
82502
82655
  var TEAM_CONVERSION_BLOCKER_CODES2 = [
82503
82656
  "automations_workspace_required",
82504
82657
  "module_demo",
@@ -82541,6 +82694,15 @@ var runScopeOptionsResponseApiSchema2 = z1302.object({
82541
82694
  "The `team` run scope. `personal` is always available to anyone who may create an automation."
82542
82695
  )
82543
82696
  });
82697
+ var runScopeOptionsClientResponseSchema2 = z1302.object({
82698
+ team: z1302.object({
82699
+ available: z1302.boolean(),
82700
+ blocker: z1302.object({
82701
+ code: z1302.string(),
82702
+ message: z1302.string()
82703
+ }).nullable()
82704
+ })
82705
+ });
82544
82706
  var teamConversionPreviewApiSchema2 = z1302.object({
82545
82707
  personal_rows: z1302.array(
82546
82708
  z1302.object({
@@ -87816,6 +87978,41 @@ var casesListRequestBodySchema2 = z173.object({
87816
87978
  include_blockers: z173.boolean().optional().describe(CASE_INCLUDE_BLOCKERS_DESCRIPTION2),
87817
87979
  fields: z173.array(z173.enum(CASE_LIST_SELECTABLE_FIELDS2)).min(1).optional().describe(CASE_LIST_FIELDS_DESCRIPTION2)
87818
87980
  });
87981
+ var RUN_CASE_LIST_SELECTABLE_FIELDS2 = [
87982
+ "id",
87983
+ "queue_id",
87984
+ "title",
87985
+ "data",
87986
+ "json_data",
87987
+ "json_schema_id",
87988
+ "status",
87989
+ "display_status",
87990
+ "priority",
87991
+ "labels",
87992
+ "claimed_at",
87993
+ "claimed_by_run_id",
87994
+ "completed_at",
87995
+ "postponed_to",
87996
+ "created_at",
87997
+ "updated_at"
87998
+ ];
87999
+ var MAX_RUN_LABEL_FILTER_KEYS2 = 20;
88000
+ var MAX_RUN_LABEL_FILTER_VALUES2 = 100;
88001
+ var runCasesFiltersSchema2 = casesFiltersSchema2.omit({ awaiting_my_approval: true }).extend({
88002
+ // Bounded here, not on the shared filters: each label key adds a
88003
+ // correlated subquery and each value an expression, and this route is
88004
+ // reachable with any run's key.
88005
+ labels: z173.record(z173.string(), z173.array(z173.string()).max(MAX_RUN_LABEL_FILTER_VALUES2)).refine(
88006
+ (labels) => Object.keys(labels).length <= MAX_RUN_LABEL_FILTER_KEYS2,
88007
+ `labels may name at most ${MAX_RUN_LABEL_FILTER_KEYS2} label keys`
88008
+ ).optional()
88009
+ }).strict();
88010
+ var runCasesSearchRequestBodySchema2 = casesListRequestBodySchema2.omit({ include_blockers: true }).extend({
88011
+ filters: runCasesFiltersSchema2.default({}),
88012
+ fields: z173.array(z173.enum(RUN_CASE_LIST_SELECTABLE_FIELDS2)).min(1).optional().describe(
88013
+ "Return only these keys on each case. `id` is always returned. Leaving out `data` and `json_data` skips reading the payload. Omit to return every key."
88014
+ )
88015
+ }).strict();
87819
88016
  function toBase642(input) {
87820
88017
  if (typeof btoa === "function") {
87821
88018
  return btoa(unescape(encodeURIComponent(input)));
@@ -91192,7 +91389,7 @@ __name(isStandaloneBinary, "isStandaloneBinary");
91192
91389
  import { createRequire } from "node:module";
91193
91390
  function getPackageMeta() {
91194
91391
  if (true) {
91195
- return { name: "@duvoai/cli", version: "1.116.0" };
91392
+ return { name: "@duvoai/cli", version: "1.118.0" };
91196
91393
  }
91197
91394
  const require2 = createRequire(import.meta.url);
91198
91395
  const raw = require2("../../package.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvoai/cli",
3
- "version": "1.116.0",
3
+ "version": "1.118.0",
4
4
  "description": "Command-line interface for the Duvo public API",
5
5
  "bin": {
6
6
  "duvo": "./dist/bin/duvo.js"