@duvoai/cli 1.28.1 → 1.30.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
@@ -8120,10 +8120,18 @@ var adminDreamEditReferenceSchema = z38.object({
8120
8120
  source_refs: z38.array(memorySourceRefSchema),
8121
8121
  created_at: z38.string()
8122
8122
  });
8123
+ var adminDreamTraceEntrySchema = z38.object({
8124
+ type: z38.string().max(128),
8125
+ role: z38.string().max(64).optional(),
8126
+ toolName: z38.string().max(512).optional(),
8127
+ contentPreview: z38.string().max(2e3).optional(),
8128
+ ts: z38.string()
8129
+ });
8123
8130
  var adminDreamingRunDetailSchema = adminDreamingRunSummarySchema.extend({
8124
8131
  input: z38.record(z38.string(), z38.unknown()),
8125
8132
  resolvedInputs: z38.array(adminDreamResolvedInputSchema),
8126
- editReferences: z38.array(adminDreamEditReferenceSchema)
8133
+ editReferences: z38.array(adminDreamEditReferenceSchema),
8134
+ sessionTrace: z38.array(adminDreamTraceEntrySchema)
8127
8135
  });
8128
8136
  var adminDreamingRunDetailResponseSchema = z38.object({
8129
8137
  dream: adminDreamingRunDetailSchema
@@ -31186,15 +31194,128 @@ function registerTeam(program) {
31186
31194
  }
31187
31195
  __name(registerTeam, "registerTeam");
31188
31196
 
31189
- // src/commands/teams/list.ts
31197
+ // src/commands/teams/create-org-team.ts
31190
31198
  import { z as z113 } from "zod";
31191
- var teamApiSchema2 = z113.object({
31192
- id: z113.string(),
31193
- name: z113.string(),
31194
- organization_id: z113.string().nullable()
31199
+ var createOrgTeamResponseSchema = z113.object({
31200
+ id: z113.guid(),
31201
+ name: z113.string()
31195
31202
  });
31196
- var listMyTeamsResponseSchema3 = z113.object({
31197
- teams: z113.array(teamApiSchema2)
31203
+ function registerTeamsCreateOrgTeam(teams) {
31204
+ teams.command("create-org-team <org-id>").description("Create a new team inside an organization you administer").requiredOption("--name <name>", "team name").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function createOrgTeamAction(orgId, options) {
31205
+ if (options.name === void 0 || options.name.trim().length === 0) {
31206
+ throw new CliError("--name must not be empty");
31207
+ }
31208
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
31209
+ const raw = await httpRequest({
31210
+ method: "POST",
31211
+ path: `/v2/organizations/${encodeURIComponent(orgId)}/teams`,
31212
+ apiKey,
31213
+ apiBaseUrl,
31214
+ body: { name: options.name.trim() }
31215
+ });
31216
+ if (options.json) {
31217
+ printJson(raw);
31218
+ return;
31219
+ }
31220
+ const parsed = createOrgTeamResponseSchema.safeParse(raw);
31221
+ if (!parsed.success) {
31222
+ throw new CliError(
31223
+ `Unexpected response from POST /v2/organizations/:orgId/teams: ${parsed.error.message}`
31224
+ );
31225
+ }
31226
+ console.log(green("Team created!"));
31227
+ console.log();
31228
+ console.log(
31229
+ renderKeyValue([
31230
+ { label: "ID", value: parsed.data.id },
31231
+ { label: "Name", value: parsed.data.name }
31232
+ ])
31233
+ );
31234
+ }, "createOrgTeamAction"));
31235
+ }
31236
+ __name(registerTeamsCreateOrgTeam, "registerTeamsCreateOrgTeam");
31237
+
31238
+ // src/commands/teams/invite-org-member.ts
31239
+ var ORG_ROLES2 = Object.values(ORG_ROLE);
31240
+ var DEFAULT_ROLE = ORG_ROLE.MEMBER;
31241
+ function registerTeamsInviteOrgMember(teams) {
31242
+ teams.command("invite-org-member <org-id>").description(
31243
+ "Invite a person to an organization, optionally onto one of its teams"
31244
+ ).requiredOption("--email <email>", "email address of the person to invite").option(
31245
+ "--role <role>",
31246
+ `organization role to grant: ${ORG_ROLES2.join(", ")} (default ${DEFAULT_ROLE})`,
31247
+ DEFAULT_ROLE
31248
+ ).option("--team-id <id>", "assign the invitee to this team in the org").option(
31249
+ "--frontend-url <url>",
31250
+ "base URL used to build the invitation email link (email is skipped if omitted)"
31251
+ ).option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function inviteOrgMemberAction(orgId, options) {
31252
+ const email = options.email?.trim();
31253
+ if (email === void 0 || email.length === 0) {
31254
+ throw new CliError("--email must not be empty");
31255
+ }
31256
+ const role = options.role ?? DEFAULT_ROLE;
31257
+ if (!ORG_ROLES2.includes(role)) {
31258
+ throw new CliError(
31259
+ `Invalid --role "${role}"; expected one of: ${ORG_ROLES2.join(", ")}`
31260
+ );
31261
+ }
31262
+ const { apiKey, apiBaseUrl } = await requireAuthenticatedConfig(this);
31263
+ const body = { email, role };
31264
+ if (options.teamId !== void 0) {
31265
+ const teamId = options.teamId.trim();
31266
+ if (teamId.length === 0) {
31267
+ throw new CliError("--team-id must not be empty");
31268
+ }
31269
+ body.teamId = teamId;
31270
+ }
31271
+ if (options.frontendUrl !== void 0) {
31272
+ const frontendUrl = options.frontendUrl.trim();
31273
+ if (frontendUrl.length === 0) {
31274
+ throw new CliError("--frontend-url must not be empty");
31275
+ }
31276
+ body.frontendUrl = frontendUrl;
31277
+ }
31278
+ const raw = await httpRequest({
31279
+ method: "POST",
31280
+ path: `/v2/organizations/${encodeURIComponent(orgId)}/members`,
31281
+ apiKey,
31282
+ apiBaseUrl,
31283
+ body
31284
+ });
31285
+ if (options.json) {
31286
+ printJson(raw);
31287
+ return;
31288
+ }
31289
+ const parsed = inviteOrgMemberResponseSchema.safeParse(raw);
31290
+ if (!parsed.success) {
31291
+ throw new CliError(
31292
+ `Unexpected response from POST /v2/organizations/:orgId/members: ${parsed.error.message}`
31293
+ );
31294
+ }
31295
+ console.log(green("Invitation created!"));
31296
+ console.log();
31297
+ console.log(
31298
+ renderKeyValue([
31299
+ { label: "Invitation ID", value: parsed.data.invitationId },
31300
+ { label: "Email", value: email },
31301
+ { label: "Role", value: role },
31302
+ { label: "Team", value: body.teamId ?? "\u2014" },
31303
+ { label: "Email sent", value: parsed.data.emailSent ? "yes" : "no" }
31304
+ ])
31305
+ );
31306
+ }, "inviteOrgMemberAction"));
31307
+ }
31308
+ __name(registerTeamsInviteOrgMember, "registerTeamsInviteOrgMember");
31309
+
31310
+ // src/commands/teams/list.ts
31311
+ import { z as z114 } from "zod";
31312
+ var teamApiSchema2 = z114.object({
31313
+ id: z114.string(),
31314
+ name: z114.string(),
31315
+ organization_id: z114.string().nullable()
31316
+ });
31317
+ var listMyTeamsResponseSchema3 = z114.object({
31318
+ teams: z114.array(teamApiSchema2)
31198
31319
  });
31199
31320
  function registerTeamsList(teams) {
31200
31321
  teams.command("list", { isDefault: true }).description("List every team you can act on").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function listAction(options) {
@@ -31237,21 +31358,21 @@ function registerTeamsList(teams) {
31237
31358
  __name(registerTeamsList, "registerTeamsList");
31238
31359
 
31239
31360
  // src/commands/teams/org-insights.ts
31240
- import { z as z114 } from "zod";
31241
- var headlineSchema = z114.object({
31242
- total_runs: z114.number(),
31243
- completed_runs: z114.number(),
31244
- failed_runs: z114.number(),
31245
- success_rate: z114.number().nullable(),
31246
- active_agents: z114.number(),
31247
- active_users: z114.number(),
31248
- start_date: z114.string(),
31249
- end_date: z114.string(),
31250
- truncated: z114.boolean(),
31251
- aggregated_teams: z114.number(),
31252
- total_teams: z114.number()
31253
- });
31254
- var orgInsightsHeadlineResponseSchema = z114.object({
31361
+ import { z as z115 } from "zod";
31362
+ var headlineSchema = z115.object({
31363
+ total_runs: z115.number(),
31364
+ completed_runs: z115.number(),
31365
+ failed_runs: z115.number(),
31366
+ success_rate: z115.number().nullable(),
31367
+ active_agents: z115.number(),
31368
+ active_users: z115.number(),
31369
+ start_date: z115.string(),
31370
+ end_date: z115.string(),
31371
+ truncated: z115.boolean(),
31372
+ aggregated_teams: z115.number(),
31373
+ total_teams: z115.number()
31374
+ });
31375
+ var orgInsightsHeadlineResponseSchema = z115.object({
31255
31376
  headline: headlineSchema
31256
31377
  });
31257
31378
  function formatRate(rate) {
@@ -31319,26 +31440,26 @@ function registerTeamsOrgInsights(teams) {
31319
31440
  __name(registerTeamsOrgInsights, "registerTeamsOrgInsights");
31320
31441
 
31321
31442
  // src/commands/teams/org-metrics.ts
31322
- import { z as z115 } from "zod";
31323
- var teamMetricSchema = z115.object({
31324
- team_id: z115.string(),
31325
- team_name: z115.string(),
31326
- is_deleted: z115.boolean(),
31327
- member_count: z115.number(),
31328
- assignment_count: z115.number(),
31329
- scheduled_job_count: z115.number(),
31330
- total_jobs: z115.number(),
31331
- completed_jobs: z115.number(),
31332
- failed_jobs: z115.number(),
31333
- total_runs: z115.number()
31334
- });
31335
- var orgInsightsMetricsResponseSchema = z115.object({
31336
- teams: z115.array(teamMetricSchema),
31337
- start_date: z115.string(),
31338
- end_date: z115.string(),
31339
- truncated: z115.boolean(),
31340
- total_teams: z115.number(),
31341
- org_member_count: z115.number()
31443
+ import { z as z116 } from "zod";
31444
+ var teamMetricSchema = z116.object({
31445
+ team_id: z116.string(),
31446
+ team_name: z116.string(),
31447
+ is_deleted: z116.boolean(),
31448
+ member_count: z116.number(),
31449
+ assignment_count: z116.number(),
31450
+ scheduled_job_count: z116.number(),
31451
+ total_jobs: z116.number(),
31452
+ completed_jobs: z116.number(),
31453
+ failed_jobs: z116.number(),
31454
+ total_runs: z116.number()
31455
+ });
31456
+ var orgInsightsMetricsResponseSchema = z116.object({
31457
+ teams: z116.array(teamMetricSchema),
31458
+ start_date: z116.string(),
31459
+ end_date: z116.string(),
31460
+ truncated: z116.boolean(),
31461
+ total_teams: z116.number(),
31462
+ org_member_count: z116.number()
31342
31463
  });
31343
31464
  function registerTeamsOrgMetrics(teams) {
31344
31465
  teams.command("org-metrics <org-id>").description("Show per-team run metrics across an organization").option("--start-date <date>", "window start (ISO 8601, default 7d ago)").option("--end-date <date>", "window end (ISO 8601, default now)").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function orgMetricsAction(orgId, options) {
@@ -31401,20 +31522,20 @@ ${total_teams} teams${suffix} \xB7 ${org_member_count} org members`
31401
31522
  __name(registerTeamsOrgMetrics, "registerTeamsOrgMetrics");
31402
31523
 
31403
31524
  // src/commands/teams/org-usage.ts
31404
- import { z as z116 } from "zod";
31525
+ import { z as z117 } from "zod";
31405
31526
  var GRANULARITIES = ["day", "week", "month"];
31406
31527
  var DEFAULT_LOOKBACK_MS = 30 * 24 * 60 * 60 * 1e3;
31407
- var bucketSchema = z116.object({
31408
- period: z116.string(),
31409
- total_runs: z116.number(),
31410
- scheduled_runs: z116.number(),
31411
- on_demand_runs: z116.number()
31412
- });
31413
- var usageChartResponseSchema = z116.object({
31414
- buckets: z116.array(bucketSchema),
31415
- granularity: z116.enum(GRANULARITIES),
31416
- truncated: z116.boolean(),
31417
- total_teams: z116.number()
31528
+ var bucketSchema = z117.object({
31529
+ period: z117.string(),
31530
+ total_runs: z117.number(),
31531
+ scheduled_runs: z117.number(),
31532
+ on_demand_runs: z117.number()
31533
+ });
31534
+ var usageChartResponseSchema = z117.object({
31535
+ buckets: z117.array(bucketSchema),
31536
+ granularity: z117.enum(GRANULARITIES),
31537
+ truncated: z117.boolean(),
31538
+ total_teams: z117.number()
31418
31539
  });
31419
31540
  function registerTeamsOrgUsage(teams) {
31420
31541
  teams.command("org-usage <org-id>").description("Show org-wide run volume over time (scheduled vs on-demand)").option("--start-date <date>", "window start (ISO 8601, default 30d ago)").option("--end-date <date>", "window end (ISO 8601, default now)").option(
@@ -31473,17 +31594,17 @@ function registerTeamsOrgUsage(teams) {
31473
31594
  __name(registerTeamsOrgUsage, "registerTeamsOrgUsage");
31474
31595
 
31475
31596
  // src/commands/teams/org.ts
31476
- import { z as z117 } from "zod";
31477
- var orgTeamSchema = z117.object({
31478
- id: z117.string(),
31479
- name: z117.string(),
31480
- userIsMember: z117.boolean(),
31481
- userRole: z117.string().nullable(),
31482
- memberCount: z117.number()
31597
+ import { z as z118 } from "zod";
31598
+ var orgTeamSchema = z118.object({
31599
+ id: z118.string(),
31600
+ name: z118.string(),
31601
+ userIsMember: z118.boolean(),
31602
+ userRole: z118.string().nullable(),
31603
+ memberCount: z118.number()
31483
31604
  });
31484
- var listOrgTeamsResponseSchema = z117.object({
31485
- teams: z117.array(orgTeamSchema),
31486
- total: z117.number()
31605
+ var listOrgTeamsResponseSchema = z118.object({
31606
+ teams: z118.array(orgTeamSchema),
31607
+ total: z118.number()
31487
31608
  });
31488
31609
  function registerTeamsOrg(teams) {
31489
31610
  teams.command("org <org-id>").description("List all teams in an organization you belong to").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function orgAction(orgId, options) {
@@ -31525,17 +31646,17 @@ function registerTeamsOrg(teams) {
31525
31646
  __name(registerTeamsOrg, "registerTeamsOrg");
31526
31647
 
31527
31648
  // src/commands/teams/orgs.ts
31528
- import { z as z118 } from "zod";
31529
- var orgMembershipSchema = z118.object({
31530
- organization: z118.object({
31531
- id: z118.string(),
31532
- name: z118.string()
31649
+ import { z as z119 } from "zod";
31650
+ var orgMembershipSchema = z119.object({
31651
+ organization: z119.object({
31652
+ id: z119.string(),
31653
+ name: z119.string()
31533
31654
  }),
31534
- role: z118.string(),
31535
- memberCount: z118.number()
31655
+ role: z119.string(),
31656
+ memberCount: z119.number()
31536
31657
  });
31537
- var listMyOrganizationsResponseSchema = z118.object({
31538
- memberships: z118.array(orgMembershipSchema)
31658
+ var listMyOrganizationsResponseSchema = z119.object({
31659
+ memberships: z119.array(orgMembershipSchema)
31539
31660
  });
31540
31661
  function registerTeamsOrgs(teams) {
31541
31662
  teams.command("orgs").description("List the organizations you belong to and your role in each").option("--json", "output raw JSON from the API").action(/* @__PURE__ */ __name(async function orgsAction(options) {
@@ -31581,6 +31702,8 @@ function registerTeams(program) {
31581
31702
  registerTeamsList(teams);
31582
31703
  registerTeamsOrg(teams);
31583
31704
  registerTeamsOrgs(teams);
31705
+ registerTeamsCreateOrgTeam(teams);
31706
+ registerTeamsInviteOrgMember(teams);
31584
31707
  registerTeamsOrgInsights(teams);
31585
31708
  registerTeamsOrgMetrics(teams);
31586
31709
  registerTeamsOrgUsage(teams);
@@ -31640,7 +31763,7 @@ __name(resolveActiveTeamId, "resolveActiveTeamId");
31640
31763
  var version = resolveVersion();
31641
31764
  function resolveVersion() {
31642
31765
  if (true) {
31643
- return "1.28.1";
31766
+ return "1.30.0";
31644
31767
  }
31645
31768
  const packageJsonPath = join3(
31646
31769
  dirname3(fileURLToPath2(import.meta.url)),
@@ -31834,7 +31957,7 @@ function isNewerVersion(candidate, current) {
31834
31957
  __name(isNewerVersion, "isNewerVersion");
31835
31958
  function loadPackageMeta() {
31836
31959
  if (true) {
31837
- return { name: "@duvoai/cli", version: "1.28.1" };
31960
+ return { name: "@duvoai/cli", version: "1.30.0" };
31838
31961
  }
31839
31962
  const require2 = createRequire(import.meta.url);
31840
31963
  const raw = require2("../package.json");