@dench.com/cli 3.11.29-staging.640 → 3.11.31-staging.680

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/app-sdk.d.ts CHANGED
@@ -3503,6 +3503,8 @@ export interface ApiRequests {
3503
3503
  slug: string;
3504
3504
  pinned: boolean;
3505
3505
  };
3506
+ /** Share an app you added with the workspace (shared) or make it private to you again (private). Owner only. — `dench apps share` — POST /api/v1/apps/{slug}/visibility */
3507
+ "apps.setVisibility": Record<string, unknown>;
3506
3508
  /** Register an inbound webhook for an app. Returns the URL and signing secret ONCE. — `dench apps webhooks register` — POST /api/v1/apps/{slug}/webhooks */
3507
3509
  "apps.webhooks.register": {
3508
3510
  /** Installed app slug. */
@@ -8125,6 +8127,7 @@ export interface ApiResponses {
8125
8127
  "apps.uninstall": unknown;
8126
8128
  "apps.setEnabled": unknown;
8127
8129
  "apps.setPinned": unknown;
8130
+ "apps.setVisibility": unknown;
8128
8131
  "apps.webhooks.register": unknown;
8129
8132
  "apps.webhooks.list": unknown;
8130
8133
  "apps.webhooks.poll": unknown;
@@ -8825,6 +8828,8 @@ export type DenchApiTree = {
8825
8828
  setEnabled(args: Req<"apps.setEnabled">): Promise<Res<"apps.setEnabled">>;
8826
8829
  /** Pin or unpin an installed app in the rail. (`dench apps pin`) */
8827
8830
  setPinned(args: Req<"apps.setPinned">): Promise<Res<"apps.setPinned">>;
8831
+ /** Share an app you added with the workspace (shared) or make it private to you again (private). Owner only. (`dench apps share`) */
8832
+ setVisibility(args: Req<"apps.setVisibility">): Promise<Res<"apps.setVisibility">>;
8828
8833
  /** Uninstall an app from the workspace. (`dench apps uninstall`) */
8829
8834
  uninstall(args: Req<"apps.uninstall">): Promise<Res<"apps.uninstall">>;
8830
8835
  webhooks: {
package/apps.ts CHANGED
@@ -35,6 +35,9 @@ const api = {
35
35
  "functions/appStore:setEnabled",
36
36
  ),
37
37
  setPinned: makeFunctionReference<"mutation">("functions/appStore:setPinned"),
38
+ setVisibility: makeFunctionReference<"mutation">(
39
+ "functions/appStore:setVisibility",
40
+ ),
38
41
  listTree: makeFunctionReference<"query">("functions/files:listTree"),
39
42
  getFileContent: makeFunctionReference<"query">(
40
43
  "functions/files:getFileContent",
@@ -105,11 +108,12 @@ export function appsHelpText(): string {
105
108
  Scaffold .dench.yaml + index.html and register it
106
109
  dench apps install <listingId> [--json] Install a gallery listing into this workspace
107
110
  dench apps publish <appPath> --slug <slug> --name "My App" \\
108
- [--description "…"] [--icon <name>] [--visibility org|public|official|unlisted] [--version 1.0.0]
111
+ [--description "…"] [--icon <name>] [--visibility private|org|public|official|unlisted] [--version 1.0.0]
109
112
  Bundle an app's files into a version + listing
110
113
  dench apps uninstall <slug> Remove an installed app
111
114
  dench apps enable | disable <slug> Toggle whether the app loads
112
115
  dench apps pin | unpin <slug> Toggle the rail pin
116
+ dench apps share | unshare <slug> Share your app with the workspace, or make it private again
113
117
  dench apps validate <appPath> [--json] Check the manifest, permissions and every window.dench call
114
118
  (local folder, or a workspace path like /apps/x.dench.app)
115
119
  dench apps webhooks register <slug> <hookName> [--rotate]
@@ -434,6 +438,22 @@ export async function runAppsCommand(opts: {
434
438
  out(ctx, { ok: true, slug, pinned: sub === "pin" });
435
439
  return;
436
440
  }
441
+ case "share":
442
+ case "unshare": {
443
+ const slug = ctx.args.shift();
444
+ if (!slug) {
445
+ throw new AppsCliError(
446
+ `Missing app slug. Usage: dench apps ${sub} <slug>`,
447
+ );
448
+ }
449
+ const visibility = sub === "share" ? "shared" : "private";
450
+ await ctx.convex.mutation(
451
+ api.setVisibility,
452
+ withAuth(ctx, { slug, visibility }),
453
+ );
454
+ out(ctx, { ok: true, slug, visibility });
455
+ return;
456
+ }
437
457
  default: {
438
458
  const suggestion = closestMatch(sub, APPS_SUBCOMMANDS);
439
459
  throw new AppsCliError(
@@ -458,6 +478,8 @@ const APPS_SUBCOMMANDS = [
458
478
  "disable",
459
479
  "pin",
460
480
  "unpin",
481
+ "share",
482
+ "unshare",
461
483
  "validate",
462
484
  "webhooks",
463
485
  "help",
package/dench.ts CHANGED
@@ -463,7 +463,7 @@ Usage:
463
463
  dench signin --new-workspace --org-name "Workspace" [--kind <kind>] [--name "AI Agent - Project"]
464
464
  dench signin --email user@example.com [--new-workspace --org-name "Workspace"] [--kind <kind>] [--name "AI Agent - Project"]
465
465
  dench signin --org <workspace-slug> [--kind <kind>] [--name "AI Agent - Project"]
466
- dench upgrade [--tier pro|max] [--cycle monthly|yearly] [--no-open] [--json]
466
+ dench upgrade [--cycle monthly|yearly] [--no-open] [--json]
467
467
  dench sessions [--host <host>] [--json]
468
468
  dench use <session-key-or-workspace-slug> [--host <host>] [--json]
469
469
  dench logout [session-key-or-workspace-slug] [--session <key-or-scope>] [--host <host>] [--all] [--json]
@@ -2307,46 +2307,43 @@ async function billingTopup(runtime: Runtime) {
2307
2307
  }
2308
2308
 
2309
2309
  /**
2310
- * `dench upgrade` — turns a free CRM-only workspace into a paid Pro or
2311
- * Max plan by handing the human a Stripe Checkout link. Mirrors the
2310
+ * `dench upgrade` — turns a free CRM-only workspace into Dench Max by
2311
+ * handing the human a Stripe Checkout link. Mirrors the
2312
2312
  * `billing topup` flow (POST with the agent session as a Bearer
2313
2313
  * token, surface the returned URL) but hits the existing
2314
2314
  * `/api/stripe/create-checkout` endpoint that the marketing pricing
2315
2315
  * page already uses.
2316
2316
  *
2317
- * Two flag-driven paths:
2318
- *
2319
- * --tier pro | max Which paid tier to target. Defaults to
2320
- * "pro" (the most common upgrade from
2321
- * free).
2322
2317
  * --cycle monthly | yearly Billing cycle. Defaults to "monthly".
2318
+ * --tier max Accepted for older scripts; Max is the only
2319
+ * plan sold, and `pro` / `plus` mean Max.
2323
2320
  *
2324
2321
  * The endpoint can also return `{ updated: true }` for in-place
2325
- * Pro \u2192 Max upgrades on an already-subscribed org (no Checkout URL
2326
- * needed in that case). We surface either outcome cleanly.
2322
+ * upgrades on an already-subscribed org (no Checkout URL needed in that
2323
+ * case). We surface either outcome cleanly.
2327
2324
  */
2328
2325
  async function denchUpgrade(runtime: Runtime) {
2329
2326
  const authedRuntime = requireAuthenticatedRuntime(runtime, "dench upgrade");
2330
- const tierFlag = option("--tier")?.trim().toLowerCase() || "pro";
2327
+ const requestedTier = option("--tier")?.trim().toLowerCase() || "max";
2328
+ // Older scripts, skills and docs pass `--tier pro`. Plus is no longer
2329
+ // sold, so those upgrades go to Max instead of failing.
2330
+ const tierFlag =
2331
+ requestedTier === "pro" || requestedTier === "plus" ? "max" : requestedTier;
2331
2332
  const cycleFlag =
2332
2333
  option("--cycle")?.trim().toLowerCase() ||
2333
2334
  option("--billing-cycle")?.trim().toLowerCase() ||
2334
2335
  "monthly";
2335
- if (tierFlag !== "pro" && tierFlag !== "max") {
2336
- throw new CliError("--tier must be 'pro' or 'max'.", {
2337
- code: "invalid_tier",
2338
- });
2336
+ if (tierFlag !== "max") {
2337
+ throw new CliError(
2338
+ "Dench Max is the only plan available. Run dench upgrade.",
2339
+ { code: "invalid_tier" },
2340
+ );
2339
2341
  }
2340
2342
  if (cycleFlag !== "monthly" && cycleFlag !== "yearly") {
2341
2343
  throw new CliError("--cycle must be 'monthly' or 'yearly'.", {
2342
2344
  code: "invalid_cycle",
2343
2345
  });
2344
2346
  }
2345
- // Internal tier strings still use the legacy "desktop" / "cloud"
2346
- // names from before the Daytona rewrite. Map the CLI's
2347
- // customer-facing flag onto them so the existing checkout endpoint
2348
- // doesn't need to learn a new vocabulary.
2349
- const internalTier = tierFlag === "pro" ? "desktop" : "cloud";
2350
2347
 
2351
2348
  const response = await fetch(
2352
2349
  `${authedRuntime.host.replace(/\/+$/, "")}/api/stripe/create-checkout`,
@@ -2358,7 +2355,7 @@ async function denchUpgrade(runtime: Runtime) {
2358
2355
  authorization: `Bearer ${authedRuntime.sessionToken}`,
2359
2356
  },
2360
2357
  body: JSON.stringify({
2361
- tier: internalTier,
2358
+ tier: "cloud",
2362
2359
  billingCycle: cycleFlag,
2363
2360
  requestId: crypto.randomUUID(),
2364
2361
  }),
@@ -2381,7 +2378,8 @@ async function denchUpgrade(runtime: Runtime) {
2381
2378
  const updatedInPlace = record?.updated === true;
2382
2379
 
2383
2380
  if (updatedInPlace) {
2384
- const message = `Upgraded to Dench ${tierFlag === "pro" ? "Pro" : "Max"} in place — no Stripe Checkout needed.`;
2381
+ const message =
2382
+ "Upgraded to Dench Max in place — no Stripe Checkout needed.";
2385
2383
  print(
2386
2384
  json ? { ok: true, updated: true, tier: tierFlag, message } : message,
2387
2385
  );
@@ -2768,9 +2766,7 @@ function gatewayAuthError(
2768
2766
  if (response.status === 403 && code === "no_active_subscription") {
2769
2767
  return new CliError(`${command} requires a paid Dench workspace`, {
2770
2768
  code: "paid_workspace_required",
2771
- nextActions: [
2772
- "Run dench upgrade --tier pro or dench upgrade --tier max, then retry.",
2773
- ],
2769
+ nextActions: ["Run dench upgrade, then retry."],
2774
2770
  });
2775
2771
  }
2776
2772
  if (response.status === 401) {
package/email.ts CHANGED
@@ -396,8 +396,8 @@ ${EMAIL_INBOX_HELP}
396
396
  dench email draft signature <id> [--json] # read signature HTML; insert visibly into the body
397
397
  # Identical native create/send invocations reuse a saved request ID. Use --request-id <new-id> for another identical email.
398
398
  dench email send --to <email> [--subject <subject>] (--text <body> | --html <body> | --text-file <path> | --html-file <path>) [--mailbox <id/email>] [--cc <emails>] [--bcc <emails>] [--request-id <id>] [--wait <seconds>|--no-wait] [--json] # native default; observe the same receipt for 10s by default (--wait 0..60)
399
- dench email identity verify --from founder@example.com [--private] [--json]
400
- dench email identity verify --domain example.com [--from founder@example.com] [--private] [--json]
399
+ dench email identity verify --from founder@example.com [--shared] [--json] # private to you (and admins) unless --shared
400
+ dench email identity verify --domain example.com [--from founder@example.com] [--shared] [--json]
401
401
  dench email identity list [--domain example.com] [--json]
402
402
  dench email identity dns --identity <identityId|domain|email> [--json]
403
403
  dench email identity status --identity founder@example.com [--json]
@@ -966,7 +966,14 @@ async function runIdentity(ctx: EmailCliContext) {
966
966
  fromName: getFlag(ctx.args, "--from-name"),
967
967
  replyToEmail: getFlag(ctx.args, "--reply-to"),
968
968
  configurationSetName,
969
- ...(hasFlag(ctx.args, "--private") ? { sharing: "restricted" } : {}),
969
+ // Private unless shared (DEN-29): the server restricts a new sender
970
+ // to the member adding it unless `--shared` asks for the workspace.
971
+ // `--private` predates that default and is still accepted.
972
+ ...(hasFlag(ctx.args, "--shared")
973
+ ? { sharing: "org" }
974
+ : hasFlag(ctx.args, "--private")
975
+ ? { sharing: "restricted" }
976
+ : {}),
970
977
  },
971
978
  );
972
979
  const verification = (await callAction(
@@ -468,6 +468,7 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
468
468
  {"id":"apps.uninstall","group":"apps","summary":"Uninstall an app from the workspace.","cli":"dench apps uninstall","method":"DELETE","path":"/apps/{slug}","permission":"apps:write","pathParams":["slug"]},
469
469
  {"id":"apps.setEnabled","group":"apps","summary":"Enable or disable an installed app.","cli":"dench apps enable","method":"PATCH","path":"/apps/{slug}","permission":"apps:write","pathParams":["slug"]},
470
470
  {"id":"apps.setPinned","group":"apps","summary":"Pin or unpin an installed app in the rail.","cli":"dench apps pin","method":"POST","path":"/apps/{slug}/pin","permission":"apps:write","pathParams":["slug"]},
471
+ {"id":"apps.setVisibility","group":"apps","summary":"Share an app you added with the workspace (shared) or make it private to you again (private). Owner only.","cli":"dench apps share","method":"POST","path":"/apps/{slug}/visibility","permission":"apps:write","pathParams":["slug"]},
471
472
  {"id":"apps.webhooks.register","group":"apps","summary":"Register an inbound webhook for an app. Returns the URL and signing secret ONCE.","cli":"dench apps webhooks register","method":"POST","path":"/apps/{slug}/webhooks","permission":"webhooks:receive","pathParams":["slug"]},
472
473
  {"id":"apps.webhooks.list","group":"apps","summary":"List an app's registered webhooks (URLs, never secrets).","cli":"dench apps webhooks list","method":"GET","path":"/apps/{slug}/webhooks","permission":"webhooks:receive","pathParams":["slug"]},
473
474
  {"id":"apps.webhooks.poll","group":"apps","summary":"Read events an app webhook received since a timestamp.","cli":"dench apps webhooks poll","method":"GET","path":"/apps/{slug}/webhooks/{hookName}/events","permission":"webhooks:receive","pathParams":["slug","hookName"]},
@@ -117,9 +117,16 @@ export const COMMAND_ARGUMENTS = [
117
117
  [1, 1],
118
118
  "--slug --name --description --icon --visibility --version",
119
119
  ),
120
- ...["install", "uninstall", "enable", "disable", "pin", "unpin"].map((verb) =>
121
- spec(`apps ${verb}`, [1, 1]),
122
- ),
120
+ ...[
121
+ "install",
122
+ "uninstall",
123
+ "enable",
124
+ "disable",
125
+ "pin",
126
+ "unpin",
127
+ "share",
128
+ "unshare",
129
+ ].map((verb) => spec(`apps ${verb}`, [1, 1])),
123
130
  spec("apps webhooks register", [2, 2], "", "--rotate"),
124
131
  spec("apps webhooks delete", [2, 2]),
125
132
  spec("apps validate", [1, 1]),
@@ -5353,6 +5353,18 @@ const rawApiOperations = [
5353
5353
  responseSchema: anyResponse,
5354
5354
  backend: convex("mutation", "functions/appStore:setPinned"),
5355
5355
  }),
5356
+ op({
5357
+ id: "apps.setVisibility",
5358
+ group: "apps",
5359
+ summary:
5360
+ "Share an app you added with the workspace (shared) or make it private to you again (private). Owner only.",
5361
+ cli: "dench apps share",
5362
+ method: "POST",
5363
+ path: "/apps/{slug}/visibility",
5364
+ requestSchema: anyObject,
5365
+ responseSchema: anyResponse,
5366
+ backend: convex("mutation", "functions/appStore:setVisibility"),
5367
+ }),
5356
5368
  op({
5357
5369
  id: "apps.validate",
5358
5370
  group: "apps",