@amerged/ohmyhost-cli 0.1.55 → 0.1.57

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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1 -1
  3. package/dist/{chunk-4OAAJX5B.js → chunk-GODV5QDC.js} +797 -86
  4. package/dist/index.js +9 -1
  5. package/package.json +1 -1
  6. package/src/apps/product-cli/package.json +1 -1
  7. package/src/apps/product-cli/src/cli.ts +208 -11
  8. package/src/apps/product-cli/src/command.ts +276 -19
  9. package/src/apps/product-cli/src/index.ts +1 -0
  10. package/src/apps/product-cli/src/product-api.ts +165 -3
  11. package/src/apps/product-cli/src/repository-init.ts +8 -0
  12. package/src/apps/product-cli/src/runtime-contract.ts +81 -5
  13. package/src/apps/product-cli/src/user-token-file.ts +73 -0
  14. package/src/packages/contracts/package.json +5 -0
  15. package/src/packages/contracts/src/credit-pricing.ts +1 -1
  16. package/src/packages/contracts/src/database-events.ts +67 -0
  17. package/src/packages/contracts/src/framework-admission.ts +5 -4
  18. package/src/packages/contracts/src/framework-source-rules.ts +9 -2
  19. package/src/packages/contracts/src/index.ts +9 -0
  20. package/src/packages/contracts/src/operation-deployment-result.ts +121 -1
  21. package/src/packages/contracts/src/operation-failure.ts +72 -1
  22. package/src/packages/contracts/src/organization-mcp-connections.ts +7 -0
  23. package/src/packages/contracts/src/problem-policy.ts +17 -5
  24. package/src/packages/contracts/src/secret-names.ts +10 -2
  25. package/src/packages/sdk-ts/package.json +1 -1
  26. package/src/packages/sdk-ts/src/generated/index.ts +36 -0
  27. package/src/packages/sdk-ts/src/generated/sdk.gen.ts +265 -1
  28. package/src/packages/sdk-ts/src/generated/types.gen.ts +445 -2
  29. package/src/packages/sdk-ts/src/managed-mail-response.ts +12 -0
  30. package/src/packages/sdk-ts/src/managed-mail.ts +10 -1
@@ -7126,9 +7126,9 @@ var require_pako = __commonJS({
7126
7126
  var assign = require_common().assign;
7127
7127
  var deflate = require_deflate2();
7128
7128
  var inflate = require_inflate2();
7129
- var constants4 = require_constants();
7129
+ var constants5 = require_constants();
7130
7130
  var pako = {};
7131
- assign(pako, deflate, inflate, constants4);
7131
+ assign(pako, deflate, inflate, constants5);
7132
7132
  module.exports = pako;
7133
7133
  }
7134
7134
  });
@@ -8944,19 +8944,19 @@ If you're a developer and you believe this is a bug in isomorphic-git, please fi
8944
8944
  if (!path2.length) return ".";
8945
8945
  path2 = path2.replace(/\\/g, "/");
8946
8946
  const drivePrefix = getWindowsDrivePrefix(path2);
8947
- const isAbsolute3 = path2[0] === "/" || drivePrefix !== null && path2[2] === "/";
8947
+ const isAbsolute4 = path2[0] === "/" || drivePrefix !== null && path2[2] === "/";
8948
8948
  const trailingSeparator = path2.at(-1) === "/";
8949
8949
  const pathBody = drivePrefix ? path2.slice(2) : path2;
8950
- let normalized = normalizeString(pathBody, !isAbsolute3);
8950
+ let normalized = normalizeString(pathBody, !isAbsolute4);
8951
8951
  if (!normalized.length) {
8952
- const root = drivePrefix ? isAbsolute3 ? drivePrefix + "/" : drivePrefix : isAbsolute3 ? "/" : ".";
8953
- return trailingSeparator && !isAbsolute3 ? root + "/" : root;
8952
+ const root = drivePrefix ? isAbsolute4 ? drivePrefix + "/" : drivePrefix : isAbsolute4 ? "/" : ".";
8953
+ return trailingSeparator && !isAbsolute4 ? root + "/" : root;
8954
8954
  }
8955
8955
  if (trailingSeparator) normalized += "/";
8956
8956
  if (drivePrefix) {
8957
- return isAbsolute3 ? `${drivePrefix}/${normalized}` : `${drivePrefix}${normalized}`;
8957
+ return isAbsolute4 ? `${drivePrefix}/${normalized}` : `${drivePrefix}${normalized}`;
8958
8958
  }
8959
- return isAbsolute3 ? `/${normalized}` : normalized;
8959
+ return isAbsolute4 ? `/${normalized}` : normalized;
8960
8960
  }
8961
8961
  function join7(...args) {
8962
8962
  if (args.length === 0) return ".";
@@ -12039,7 +12039,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12039
12039
  throw new MissingParameterError(name);
12040
12040
  }
12041
12041
  }
12042
- function isAbsolute2(filepath) {
12042
+ function isAbsolute3(filepath) {
12043
12043
  return filepath.startsWith("/") || /^[a-zA-Z]:[\\/]/.test(filepath);
12044
12044
  }
12045
12045
  async function discoverGitdir({ fsp, dotgit }) {
@@ -12050,7 +12050,7 @@ ${obj.gpgsig ? obj.gpgsig : ""}`;
12050
12050
  return dotgit;
12051
12051
  } else if (dotgitStat.isFile()) {
12052
12052
  return fsp._readFile(dotgit, "utf8").then((contents) => contents.trimRight().substr(8)).then((submoduleGitdir) => {
12053
- if (isAbsolute2(submoduleGitdir)) {
12053
+ if (isAbsolute3(submoduleGitdir)) {
12054
12054
  return submoduleGitdir;
12055
12055
  }
12056
12056
  const gitdir = join7(dirname4(dotgit), submoduleGitdir);
@@ -20103,11 +20103,11 @@ var require_codegen = __commonJS({
20103
20103
  const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
20104
20104
  return `${varKind} ${this.name}${rhs};` + _n;
20105
20105
  }
20106
- optimizeNames(names, constants4) {
20106
+ optimizeNames(names, constants5) {
20107
20107
  if (!names[this.name.str])
20108
20108
  return;
20109
20109
  if (this.rhs)
20110
- this.rhs = optimizeExpr(this.rhs, names, constants4);
20110
+ this.rhs = optimizeExpr(this.rhs, names, constants5);
20111
20111
  return this;
20112
20112
  }
20113
20113
  get names() {
@@ -20124,10 +20124,10 @@ var require_codegen = __commonJS({
20124
20124
  render({ _n }) {
20125
20125
  return `${this.lhs} = ${this.rhs};` + _n;
20126
20126
  }
20127
- optimizeNames(names, constants4) {
20127
+ optimizeNames(names, constants5) {
20128
20128
  if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
20129
20129
  return;
20130
- this.rhs = optimizeExpr(this.rhs, names, constants4);
20130
+ this.rhs = optimizeExpr(this.rhs, names, constants5);
20131
20131
  return this;
20132
20132
  }
20133
20133
  get names() {
@@ -20188,8 +20188,8 @@ var require_codegen = __commonJS({
20188
20188
  optimizeNodes() {
20189
20189
  return `${this.code}` ? this : void 0;
20190
20190
  }
20191
- optimizeNames(names, constants4) {
20192
- this.code = optimizeExpr(this.code, names, constants4);
20191
+ optimizeNames(names, constants5) {
20192
+ this.code = optimizeExpr(this.code, names, constants5);
20193
20193
  return this;
20194
20194
  }
20195
20195
  get names() {
@@ -20218,12 +20218,12 @@ var require_codegen = __commonJS({
20218
20218
  }
20219
20219
  return nodes.length > 0 ? this : void 0;
20220
20220
  }
20221
- optimizeNames(names, constants4) {
20221
+ optimizeNames(names, constants5) {
20222
20222
  const { nodes } = this;
20223
20223
  let i = nodes.length;
20224
20224
  while (i--) {
20225
20225
  const n = nodes[i];
20226
- if (n.optimizeNames(names, constants4))
20226
+ if (n.optimizeNames(names, constants5))
20227
20227
  continue;
20228
20228
  subtractNames(names, n.names);
20229
20229
  nodes.splice(i, 1);
@@ -20276,12 +20276,12 @@ var require_codegen = __commonJS({
20276
20276
  return void 0;
20277
20277
  return this;
20278
20278
  }
20279
- optimizeNames(names, constants4) {
20279
+ optimizeNames(names, constants5) {
20280
20280
  var _a;
20281
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants4);
20282
- if (!(super.optimizeNames(names, constants4) || this.else))
20281
+ this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants5);
20282
+ if (!(super.optimizeNames(names, constants5) || this.else))
20283
20283
  return;
20284
- this.condition = optimizeExpr(this.condition, names, constants4);
20284
+ this.condition = optimizeExpr(this.condition, names, constants5);
20285
20285
  return this;
20286
20286
  }
20287
20287
  get names() {
@@ -20304,10 +20304,10 @@ var require_codegen = __commonJS({
20304
20304
  render(opts) {
20305
20305
  return `for(${this.iteration})` + super.render(opts);
20306
20306
  }
20307
- optimizeNames(names, constants4) {
20308
- if (!super.optimizeNames(names, constants4))
20307
+ optimizeNames(names, constants5) {
20308
+ if (!super.optimizeNames(names, constants5))
20309
20309
  return;
20310
- this.iteration = optimizeExpr(this.iteration, names, constants4);
20310
+ this.iteration = optimizeExpr(this.iteration, names, constants5);
20311
20311
  return this;
20312
20312
  }
20313
20313
  get names() {
@@ -20343,10 +20343,10 @@ var require_codegen = __commonJS({
20343
20343
  render(opts) {
20344
20344
  return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
20345
20345
  }
20346
- optimizeNames(names, constants4) {
20347
- if (!super.optimizeNames(names, constants4))
20346
+ optimizeNames(names, constants5) {
20347
+ if (!super.optimizeNames(names, constants5))
20348
20348
  return;
20349
- this.iterable = optimizeExpr(this.iterable, names, constants4);
20349
+ this.iterable = optimizeExpr(this.iterable, names, constants5);
20350
20350
  return this;
20351
20351
  }
20352
20352
  get names() {
@@ -20388,11 +20388,11 @@ var require_codegen = __commonJS({
20388
20388
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
20389
20389
  return this;
20390
20390
  }
20391
- optimizeNames(names, constants4) {
20391
+ optimizeNames(names, constants5) {
20392
20392
  var _a, _b;
20393
- super.optimizeNames(names, constants4);
20394
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants4);
20395
- (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants4);
20393
+ super.optimizeNames(names, constants5);
20394
+ (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants5);
20395
+ (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants5);
20396
20396
  return this;
20397
20397
  }
20398
20398
  get names() {
@@ -20693,7 +20693,7 @@ var require_codegen = __commonJS({
20693
20693
  function addExprNames(names, from) {
20694
20694
  return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
20695
20695
  }
20696
- function optimizeExpr(expr, names, constants4) {
20696
+ function optimizeExpr(expr, names, constants5) {
20697
20697
  if (expr instanceof code_1.Name)
20698
20698
  return replaceName(expr);
20699
20699
  if (!canOptimize(expr))
@@ -20708,14 +20708,14 @@ var require_codegen = __commonJS({
20708
20708
  return items;
20709
20709
  }, []));
20710
20710
  function replaceName(n) {
20711
- const c = constants4[n.str];
20711
+ const c = constants5[n.str];
20712
20712
  if (c === void 0 || names[n.str] !== 1)
20713
20713
  return n;
20714
20714
  delete names[n.str];
20715
20715
  return c;
20716
20716
  }
20717
20717
  function canOptimize(e) {
20718
- return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants4[c.str] !== void 0);
20718
+ return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants5[c.str] !== void 0);
20719
20719
  }
20720
20720
  }
20721
20721
  function subtractNames(names, from) {
@@ -38651,8 +38651,8 @@ var FRAMEWORK_CONVERSION_DETAILS = Object.freeze({
38651
38651
  from: "framework",
38652
38652
  text: {
38653
38653
  nextjs: "runtime.mode: edge",
38654
- "vite-static": "runtime.mode: edge with src/ohmyhost/companion.ts when database, auth, mail, ai, storage or functions.crons is set, and static otherwise",
38655
- "tanstack-start": "runtime.mode: edge, or static without functions.crons, storage and ai",
38654
+ "vite-static": "runtime.mode: edge with src/ohmyhost/companion.ts when database, auth, mail, ai, browser, storage or functions.crons is set, and static otherwise",
38655
+ "tanstack-start": "runtime.mode: edge, or static without functions.crons, storage, ai and browser",
38656
38656
  astro: "runtime.mode: static for prerendered sites, or edge with the Cloudflare adapter"
38657
38657
  }
38658
38658
  }
@@ -38681,7 +38681,7 @@ var FRAMEWORK_CONVERSION_DETAILS = Object.freeze({
38681
38681
  },
38682
38682
  build_option_unsupported: {
38683
38683
  paths: ["repository_config"],
38684
- template: '"{{path}}" sets a build option this runtime ignores: build.ssg_cache_max_mib applies only to Next.js, and runtime.mode: functions takes only build.install. Remove the option, commit and push the change, then plan the new commit.'
38684
+ template: '"{{path}}" sets a build option this runtime ignores: build.ssg_cache_max_mib and build.next_revalidate_path apply only to Next.js, and runtime.mode: functions takes only build.install. Remove the option, commit and push the change, then plan the new commit.'
38685
38685
  },
38686
38686
  application_root_missing: {
38687
38687
  paths: ["repository_config"],
@@ -38713,7 +38713,7 @@ var FRAMEWORK_CONVERSION_DETAILS = Object.freeze({
38713
38713
  },
38714
38714
  companion_entry_required: {
38715
38715
  paths: ["module"],
38716
- template: '"{{path}}" is missing. A Vite app with runtime.mode: edge or with database, auth, mail, ai, storage or functions.crons needs this Worker module with export default { fetch }. Add it, or use runtime.mode: static without those settings; commit and push the change, then plan the new commit.'
38716
+ template: '"{{path}}" is missing. A Vite app with runtime.mode: edge or with database, auth, mail, ai, browser, storage or functions.crons needs this Worker module with export default { fetch }. Add it, or use runtime.mode: static without those settings; commit and push the change, then plan the new commit.'
38717
38717
  },
38718
38718
  worker_module_required: {
38719
38719
  paths: ["module"],
@@ -38991,6 +38991,24 @@ var failures = {
38991
38991
  "Read the current source to confirm it did not change, then submit the change again with a new idempotency key."
38992
38992
  ]
38993
38993
  };
38994
+ function parseMigrationFailureDiagnostic(value) {
38995
+ if (typeof value !== "object" || value === null || Array.isArray(value))
38996
+ return null;
38997
+ const r = value;
38998
+ if (Object.keys(r).some((key) => !["reason", "file", "statement_index", "sqlstate"].includes(key)) || !["catalog_changed", "execution_failed", "ledger_conflict", "not_admitted"].includes(String(r["reason"])) || !(r["file"] === null || typeof r["file"] === "string" && r["file"].length <= 512 && /^(?:[A-Za-z0-9][A-Za-z0-9._-]*\/)*\d{14}_[a-z0-9][a-z0-9_-]*\.sql$/u.test(r["file"])))
38999
+ return null;
39000
+ const ordinal = r["statement_index"], state = r["sqlstate"];
39001
+ if (Object.hasOwn(r, "statement_index") && ordinal === void 0 || Object.hasOwn(r, "sqlstate") && state === void 0)
39002
+ return null;
39003
+ if (ordinal === void 0 !== (state === void 0) || ordinal !== void 0 && (r["reason"] !== "execution_failed" || r["file"] === null || typeof ordinal !== "number" || !Number.isSafeInteger(ordinal) || ordinal < 1) || state !== void 0 && (ordinal === void 0 || typeof state !== "string" || !/^[0-9A-Z]{5}$/u.test(state) || state.startsWith("08") || /^57P0[123]$/u.test(state)))
39004
+ return null;
39005
+ return Object.freeze({
39006
+ reason: r["reason"],
39007
+ file: r["file"],
39008
+ ...ordinal === void 0 ? {} : { statement_index: ordinal },
39009
+ ...state === void 0 ? {} : { sqlstate: state }
39010
+ });
39011
+ }
38994
39012
  function publicOperationReconciliation(observation) {
38995
39013
  if (!["required", "pending"].includes(observation.state) || !Number.isFinite(Date.parse(observation.observed_at)) || (observation.state === "required" ? observation.attempt_id !== null : typeof observation.attempt_id !== "string" || !/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u.test(observation.attempt_id)))
38996
39014
  throw new TypeError("Operation reconciliation observation is invalid");
@@ -39006,12 +39024,14 @@ function publicOperationFailure(internalCode, diagnostic2) {
39006
39024
  const code = Object.hasOwn(failures, normalized) ? normalized : "operation_failed";
39007
39025
  const [message, suggested_action] = failures[code];
39008
39026
  const detail = code === "auto_deploy_plan_rejected" ? frameworkConversionDetail(diagnostic2) : null;
39027
+ const migration = code === "database_migration_failed" ? parseMigrationFailureDiagnostic(diagnostic2) : null;
39009
39028
  return Object.freeze({
39010
39029
  code,
39011
39030
  message,
39012
39031
  retryable: false,
39013
39032
  suggested_action,
39014
- ...detail === null ? {} : { detail }
39033
+ ...detail === null ? {} : { detail },
39034
+ ...migration === null ? {} : { migration }
39015
39035
  });
39016
39036
  }
39017
39037
 
@@ -39966,6 +39986,9 @@ function hasControlCharacter2(value, multiline) {
39966
39986
  });
39967
39987
  }
39968
39988
 
39989
+ // packages/contracts/dist/organization-mcp-connections.js
39990
+ var MCP_CONNECTION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
39991
+
39969
39992
  // packages/contracts/dist/project-data-changes.js
39970
39993
  var PROJECT_DATA_CHANGE_KINDS = [
39971
39994
  "isolate_prod_keeps_data",
@@ -40033,6 +40056,9 @@ function createOperationDeploymentProgress(input) {
40033
40056
  invalid3();
40034
40057
  if (input.build_completed_at !== void 0 && (!Number.isFinite(Date.parse(input.build_completed_at)) || new Date(input.build_completed_at).toISOString() !== input.build_completed_at))
40035
40058
  invalid3();
40059
+ const mail = input.mail === void 0 ? void 0 : parseDeploymentMailProgress(input.mail);
40060
+ if (mail !== void 0 && input.phase !== "waiting_for_mail")
40061
+ invalid3();
40036
40062
  return Object.freeze({
40037
40063
  ...input.build_completed_at === void 0 ? {} : { build_completed_at: input.build_completed_at },
40038
40064
  phase: input.phase,
@@ -40040,8 +40066,49 @@ function createOperationDeploymentProgress(input) {
40040
40066
  deployment_id: input.deployment_id,
40041
40067
  observed_at: input.observed_at,
40042
40068
  next_poll_after_seconds: 60,
40043
- suggested_action: deploymentProgressActions[input.phase].replace("PROJECT", project)
40069
+ suggested_action: mail === void 0 || mail.dns_records.length === 0 ? deploymentProgressActions[input.phase].replace("PROJECT", project) : "Follow the mail readiness and DNS records shown here, then poll this same operation. Do not rebuild or repeat correct DNS changes.",
40070
+ ...mail === void 0 ? {} : { mail }
40071
+ });
40072
+ }
40073
+ function parseDeploymentMailProgress(value) {
40074
+ if (typeof value !== "object" || value === null || Array.isArray(value))
40075
+ invalid3();
40076
+ const raw = value;
40077
+ const keys = ["domain", "status", "configured_at", "dns_records"];
40078
+ for (const optional of [
40079
+ "observed_at",
40080
+ "verification_issue",
40081
+ "next_check_after_seconds",
40082
+ "sending",
40083
+ "receiving"
40084
+ ])
40085
+ if (raw[optional] !== void 0)
40086
+ keys.push(optional);
40087
+ const row = exactRecord(raw, keys), time3 = (v) => typeof v === "string" && Number.isFinite(Date.parse(v)) && new Date(v).toISOString() === v, state = ["disabled", "pending", "ready", "failed"];
40088
+ if (typeof row["domain"] !== "string" || row["domain"].length > 253 || !/^[a-z0-9.-]+$/u.test(row["domain"]) || ![
40089
+ "configured",
40090
+ "delegation_required",
40091
+ "ready",
40092
+ "verification_pending",
40093
+ "verification_failed"
40094
+ ].includes(String(row["status"])) || !time3(row["configured_at"]) || row["observed_at"] !== void 0 && !time3(row["observed_at"]) || row["verification_issue"] !== void 0 && row["verification_issue"] !== null && ![
40095
+ "identity_missing",
40096
+ "identity_verification_failed",
40097
+ "dkim_verification_failed",
40098
+ "dkim_records_changed",
40099
+ "tenant_association_missing"
40100
+ ].includes(String(row["verification_issue"])) || row["next_check_after_seconds"] !== void 0 && ![60, 3600, null].includes(row["next_check_after_seconds"]) || row["sending"] !== void 0 && !state.includes(String(row["sending"])) || row["receiving"] !== void 0 && !state.includes(String(row["receiving"])) || !Array.isArray(row["dns_records"]) || row["dns_records"].length > 16)
40101
+ invalid3();
40102
+ const records2 = row["dns_records"].map((value2) => {
40103
+ if (typeof value2 !== "object" || value2 === null || Array.isArray(value2))
40104
+ invalid3();
40105
+ const item = value2;
40106
+ const record8 = exactRecord(item, item["priority"] === void 0 ? ["type", "name", "value", "status"] : ["type", "name", "value", "status", "priority"]);
40107
+ if (!["MX", "TXT", "CNAME"].includes(String(record8["type"])) || typeof record8["name"] !== "string" || record8["name"].length === 0 || record8["name"].length > 253 || /[\r\n\0]/u.test(record8["name"]) || !(record8["name"] === row["domain"] || record8["name"].endsWith(`.${row["domain"]}`)) || typeof record8["value"] !== "string" || record8["value"].length === 0 || record8["value"].length > 4096 || /[\r\n\0]/u.test(record8["value"]) || typeof record8["status"] !== "string" || record8["status"].length === 0 || record8["status"].length > 32 || /[\r\n\0]/u.test(record8["status"]) || record8["type"] === "MX" && (!Number.isSafeInteger(record8["priority"]) || Number(record8["priority"]) < 0 || Number(record8["priority"]) > 65535) || record8["type"] !== "MX" && record8["priority"] !== void 0)
40108
+ invalid3();
40109
+ return Object.freeze({ ...record8 });
40044
40110
  });
40111
+ return Object.freeze({ ...row, dns_records: records2 });
40045
40112
  }
40046
40113
  function parseOperationDeploymentProgress(value) {
40047
40114
  const keys = [
@@ -40054,13 +40121,16 @@ function parseOperationDeploymentProgress(value) {
40054
40121
  ];
40055
40122
  if (typeof value === "object" && value !== null && Object.hasOwn(value, "build_completed_at"))
40056
40123
  keys.push("build_completed_at");
40124
+ if (typeof value === "object" && value !== null && Object.hasOwn(value, "mail"))
40125
+ keys.push("mail");
40057
40126
  const row = exactRecord(value, keys);
40058
40127
  const parsed = createOperationDeploymentProgress({
40059
40128
  ...row["build_completed_at"] === void 0 ? {} : { build_completed_at: row["build_completed_at"] },
40060
40129
  phase: row["phase"],
40061
40130
  project_id: row["project_id"],
40062
40131
  deployment_id: row["deployment_id"],
40063
- observed_at: row["observed_at"]
40132
+ observed_at: row["observed_at"],
40133
+ ...row["mail"] === void 0 ? {} : { mail: parseDeploymentMailProgress(row["mail"]) }
40064
40134
  });
40065
40135
  if (row["next_poll_after_seconds"] !== 60 || row["suggested_action"] !== parsed.suggested_action)
40066
40136
  invalid3();
@@ -40451,9 +40521,21 @@ var PROBLEM_POLICY = {
40451
40521
  shared_data_requires_promotion: {
40452
40522
  status: 409,
40453
40523
  retryable: false,
40454
- action: "Plan and deploy this commit to Dev, then run 'ohmyhost deployment promote plan' to reach Prod.",
40524
+ action: "This is a legacy deployment restriction. Update the CLI and MCP to the current release, then plan with environment prod. The current platform permits direct Prod deployment with shared data; its migrations affect both environments when Dev exists. If the restriction persists, report the request ID.",
40455
40525
  title: "Shared data requires promotion"
40456
40526
  },
40527
+ development_environment_exists: {
40528
+ status: 409,
40529
+ retryable: false,
40530
+ action: "Read project status and use the existing Dev environment ID.",
40531
+ title: "Development environment already exists"
40532
+ },
40533
+ development_environment_missing: {
40534
+ status: 409,
40535
+ retryable: false,
40536
+ action: "Select environment prod, or add Dev with 'ohmyhost project dev add'.",
40537
+ title: "Development environment is missing"
40538
+ },
40457
40539
  production_deployment_required: {
40458
40540
  status: 409,
40459
40541
  retryable: false,
@@ -40592,15 +40674,15 @@ var PROBLEM_POLICY = {
40592
40674
  domain_hostname_taken: {
40593
40675
  status: 409,
40594
40676
  retryable: false,
40595
- action: "A live connection holds it; its holder removes it with ohmyhost domain paid delete --project ULID --hostname HOST --yes --json. To connect it here, run application_domain_identity_declare (CLI: ohmyhost mail identity declare --project ULID --hostname HOST --idempotency-key KEY --json), add the _omh-project.HOST TXT record it returns, run application_domain_identity_verify (CLI: ohmyhost mail identity verify --project ULID --expected-revision N --idempotency-key KEY --json), then apply again.",
40596
- restAction: "A live connection holds it; its holder removes it with ohmyhost domain paid delete --project ULID --hostname HOST --yes --json. To connect it here, run application_domain_identity_declare (CLI: ohmyhost mail identity declare --project ULID --hostname HOST --idempotency-key KEY --json), add the _omh-project.HOST TXT record it returns, run application_domain_identity_verify (CLI: ohmyhost mail identity verify --project ULID --expected-revision N --idempotency-key KEY --json), then apply again.",
40677
+ action: "A live connection holds it; its holder removes it with ohmyhost domain paid delete --project ULID --hostname HOST --yes --json. To connect it here, add the _omh-project.HOST TXT record that ohmyhost domain paid status --project ULID --json shows for it, then apply again with ohmyhost domain paid apply --project ULID --hostname HOST --idempotency-key KEY --json.",
40678
+ restAction: "A live connection holds it; its holder removes it with ohmyhost domain paid delete --project ULID --hostname HOST --yes --json. To connect it here, add the _omh-project.HOST TXT record that ohmyhost domain paid status --project ULID --json shows for it, then apply again with ohmyhost domain paid apply --project ULID --hostname HOST --idempotency-key KEY --json.",
40597
40679
  title: "Domain hostname is already connected"
40598
40680
  },
40599
40681
  domain_ownership_required: {
40600
40682
  status: 409,
40601
40683
  retryable: false,
40602
- action: "This hostname is not verified for this project yet. Run application_domain_identity_declare (CLI: ohmyhost mail identity declare --project ULID --hostname HOST --idempotency-key KEY --json) and add the _omh-project.HOST TXT record it returns; then application_domain_identity_verify (CLI: ohmyhost mail identity verify --project ULID --expected-revision N --idempotency-key KEY --json), then apply again. Repeating before then cannot work.",
40603
- restAction: "This hostname is not verified for this project yet. Run application_domain_identity_declare (CLI: ohmyhost mail identity declare --project ULID --hostname HOST --idempotency-key KEY --json) and add the _omh-project.HOST TXT record it returns; then application_domain_identity_verify (CLI: ohmyhost mail identity verify --project ULID --expected-revision N --idempotency-key KEY --json), then apply again. Repeating before then cannot work.",
40684
+ action: "This hostname is not verified for this project yet. Add the _omh-project.HOST TXT record that ohmyhost domain paid status --project ULID --json shows for it, then apply again with ohmyhost domain paid apply --project ULID --hostname HOST --idempotency-key KEY --json. Repeating before the record is published cannot work.",
40685
+ restAction: "This hostname is not verified for this project yet. Add the _omh-project.HOST TXT record that ohmyhost domain paid status --project ULID --json shows for it, then apply again with ohmyhost domain paid apply --project ULID --hostname HOST --idempotency-key KEY --json. Repeating before the record is published cannot work.",
40604
40686
  title: "Verify the domain before connecting it"
40605
40687
  },
40606
40688
  domain_dns_conflict: {
@@ -40811,6 +40893,29 @@ var parseGithubOrganizationConnectionStatus = (value) => {
40811
40893
  }
40812
40894
  return input;
40813
40895
  };
40896
+ var parseOrganizationMcpConnectionList = (value) => {
40897
+ const input = exactRecord2(value, ["connections"]);
40898
+ if (!Array.isArray(input["connections"]))
40899
+ throw new ResponseContractError();
40900
+ for (const item of input["connections"]) {
40901
+ const connection = exactRecord2(item, ["connection_id", "client_id", "user_id", "connected_at"]);
40902
+ if (typeof connection["connection_id"] !== "string" || !MCP_CONNECTION_ID_PATTERN.test(connection["connection_id"]) || !boundedString(connection["client_id"], 1, 2048) || !boundedString(connection["user_id"], 1, 256) || !isIsoInstant(connection["connected_at"]))
40903
+ throw new ResponseContractError();
40904
+ }
40905
+ return input;
40906
+ };
40907
+ var parseOrganizationMcpConnectionRevocation = (value) => {
40908
+ const input = exactRecord2(value, ["state"]);
40909
+ if (input["state"] !== "pending" && input["state"] !== "revoked")
40910
+ throw new ResponseContractError();
40911
+ return input;
40912
+ };
40913
+ var parseGithubDisconnection = (value) => {
40914
+ const status = parseGithubOrganizationConnectionStatus(value);
40915
+ if (status.status === "connected")
40916
+ throw new ResponseContractError();
40917
+ return status;
40918
+ };
40814
40919
  var parseGithubConnectionAuthorization = (value) => {
40815
40920
  const input = exactRecord2(value, [
40816
40921
  "authorization_id",
@@ -41055,7 +41160,8 @@ var parseProjectStatus = (value) => {
41055
41160
  "dev_url",
41056
41161
  "prod_url",
41057
41162
  "latest_operation",
41058
- "cleanup_state"
41163
+ "cleanup_state",
41164
+ "custom_domains"
41059
41165
  ]);
41060
41166
  const handle = input["handle"];
41061
41167
  if (!isUlid(input["project_id"]) || typeof input["etag"] !== "string" || !/^"sha256-[a-f0-9]{64}"$/u.test(input["etag"]) || !boundedString(handle, 3, 59) || !/^[a-z0-9]+(?:-[a-z0-9]+){0,4}$/u.test(handle) || input["region"] !== "us" && input["region"] !== "eu" || input["dev_access_mode"] !== "protected" && input["dev_access_mode"] !== "public" || input["lifecycle"] !== "active" && input["lifecycle"] !== "deleting" && input["lifecycle"] !== "deleted" || input["dev_url"] !== null && ![`https://dev-${handle}.dev.check.omh.st`, `https://dev-${handle}.check.omh.st`].includes(String(input["dev_url"])) || input["prod_url"] !== null && ![`https://${handle}.dev.check.omh.st`, `https://${handle}.check.omh.st`].includes(String(input["prod_url"])) || input["cleanup_state"] !== "not_started" && input["cleanup_state"] !== "pending" && input["cleanup_state"] !== "completed" && input["cleanup_state"] !== "reconciliation_required") {
@@ -41071,6 +41177,15 @@ var parseProjectStatus = (value) => {
41071
41177
  }
41072
41178
  if (input["head_deployment"] !== null)
41073
41179
  parseProjectDeployment(input["head_deployment"]);
41180
+ if (input["custom_domains"] !== void 0) {
41181
+ if (!Array.isArray(input["custom_domains"]) || input["custom_domains"].length > 64)
41182
+ throw new ResponseContractError();
41183
+ for (const raw of input["custom_domains"]) {
41184
+ const domain2 = exactRecord2(raw, ["hostname", "environment", "state"]);
41185
+ if (!isPaidHostname(domain2["hostname"]) || domain2["environment"] !== "prod" || !["awaiting_deployment", "pending", "active", "deleting"].includes(String(domain2["state"])))
41186
+ throw new ResponseContractError();
41187
+ }
41188
+ }
41074
41189
  if (input["environments"] !== void 0) {
41075
41190
  const environments = input["environments"];
41076
41191
  if (!Array.isArray(environments) || environments.length > 2)
@@ -41441,13 +41556,22 @@ var parseOperation = (value) => {
41441
41556
  };
41442
41557
  };
41443
41558
  function parseOperationFailure(value) {
41444
- const input = exactRecord2(value, ["code", "message", "retryable", "suggested_action", "detail"]);
41559
+ const input = exactRecord2(value, [
41560
+ "code",
41561
+ "message",
41562
+ "retryable",
41563
+ "suggested_action",
41564
+ "detail",
41565
+ "migration"
41566
+ ]);
41445
41567
  const detail = input["detail"];
41446
- const diagnostic2 = detail === void 0 || input["code"] !== "auto_deploy_plan_rejected" ? null : frameworkConversionDiagnosticFromDetail(detail);
41447
- if (typeof input["code"] !== "string" || !boundedString(input["message"], 1, 512) || input["retryable"] !== false || !boundedString(input["suggested_action"], 1, 500) || detail !== void 0 && diagnostic2 === null)
41568
+ const framework = detail === void 0 || input["code"] !== "auto_deploy_plan_rejected" ? null : frameworkConversionDiagnosticFromDetail(detail);
41569
+ const migration = input["migration"] === void 0 ? null : parseMigrationFailureDiagnostic(input["migration"]);
41570
+ const normalize = (value2) => JSON.stringify(Object.fromEntries(Object.entries(value2).sort(([a], [b]) => a.localeCompare(b))));
41571
+ if (typeof input["code"] !== "string" || !boundedString(input["message"], 1, 512) || input["retryable"] !== false || !boundedString(input["suggested_action"], 1, 500) || detail !== void 0 && framework === null || input["migration"] !== void 0 && (input["code"] !== "database_migration_failed" || migration === null || normalize(input["migration"]) !== normalize(migration)))
41448
41572
  throw new ResponseContractError();
41449
- const safe = publicOperationFailure(input["code"], diagnostic2);
41450
- if (safe.code !== input["code"] || safe.detail !== detail)
41573
+ const safe = publicOperationFailure(input["code"], migration ?? framework);
41574
+ if (safe.code !== input["code"] || safe.detail !== detail || JSON.stringify(safe.migration) !== JSON.stringify(migration ?? void 0))
41451
41575
  throw new ResponseContractError();
41452
41576
  return safe;
41453
41577
  }
@@ -41973,6 +42097,53 @@ var UserTokenFileError = class extends Error {
41973
42097
  this.keyId = keyId;
41974
42098
  }
41975
42099
  };
42100
+ var PrivateSecretFileError = class extends Error {
42101
+ code = "private_output_invalid";
42102
+ constructor() {
42103
+ super("Choose a new private output file outside the repository or ignored by Git. Existing files and links are never replaced. After an uncertain activation, retry the same key and request with a new output file.");
42104
+ }
42105
+ };
42106
+ async function preparePrivateSecretFile(output) {
42107
+ const path2 = resolve3(output);
42108
+ let file;
42109
+ try {
42110
+ await requireIgnoredTokenFile(path2);
42111
+ file = await open(path2, constants3.O_RDWR | constants3.O_CREAT | constants3.O_EXCL | (constants3.O_NOFOLLOW ?? 0), 384);
42112
+ const handle = file;
42113
+ await secureTokenFile(path2, handle);
42114
+ const identity = await handle.stat();
42115
+ if (!identity.isFile() || identity.nlink !== 1 || identity.size !== 0)
42116
+ throw new PrivateSecretFileError();
42117
+ return {
42118
+ path: path2,
42119
+ async save(value) {
42120
+ try {
42121
+ if (!/^[\x21-\x7e]{16,512}$/u.test(value))
42122
+ throw new PrivateSecretFileError();
42123
+ const current = await lstat(path2), before = await handle.stat();
42124
+ if (!current.isFile() || current.isSymbolicLink() || current.nlink !== 1 || current.ino !== identity.ino || current.dev !== identity.dev || before.size !== 0)
42125
+ throw new PrivateSecretFileError();
42126
+ await handle.writeFile(value, "utf8");
42127
+ await handle.sync();
42128
+ const after = await lstat(path2), stored = Buffer.alloc(Buffer.byteLength(value));
42129
+ try {
42130
+ const read = await handle.read(stored, 0, stored.length, 0);
42131
+ if (!after.isFile() || after.isSymbolicLink() || after.nlink !== 1 || after.ino !== identity.ino || after.dev !== identity.dev || after.size !== stored.length || read.bytesRead !== stored.length || stored.toString("utf8") !== value)
42132
+ throw new PrivateSecretFileError();
42133
+ } finally {
42134
+ stored.fill(0);
42135
+ }
42136
+ } catch {
42137
+ throw new PrivateSecretFileError();
42138
+ }
42139
+ },
42140
+ close: () => handle.close()
42141
+ };
42142
+ } catch {
42143
+ await file?.close();
42144
+ throw new PrivateSecretFileError();
42145
+ }
42146
+ }
41976
42147
  var tokenFileAction = (code, keyId) => {
41977
42148
  switch (code) {
41978
42149
  case "token_file_not_ignored":
@@ -42494,12 +42665,14 @@ var FIXED_PLATFORM_NAMES = /* @__PURE__ */ new Set([
42494
42665
  "IMAGES",
42495
42666
  "STORAGE"
42496
42667
  ]);
42497
- var INSTALLED_PLATFORM_KEYS = /* @__PURE__ */ new Set([
42668
+ var INSTALLED_PLATFORM_KEY_NAMES = [
42498
42669
  "OHMYHOST_STORAGE_KEY",
42499
42670
  "OHMYHOST_MAIL_KEY",
42500
42671
  "OHMYHOST_AI_KEY",
42672
+ "OHMYHOST_BROWSER_KEY",
42501
42673
  "BETTER_AUTH_SECRET"
42502
- ]);
42674
+ ];
42675
+ var INSTALLED_PLATFORM_KEYS = new Set(INSTALLED_PLATFORM_KEY_NAMES);
42503
42676
  function isUserSecretName(value, action = "set") {
42504
42677
  if (typeof value !== "string" || !USER_SECRET_NAME_PATTERN.test(value))
42505
42678
  return false;
@@ -42702,6 +42875,23 @@ function assertDatabaseWebhook(value) {
42702
42875
  throw new TypeError("Invalid database webhook");
42703
42876
  assertWebhookFields(value);
42704
42877
  }
42878
+ var SUBSCRIPTION_KEYS = ["id", "environment", "state", "generation", "provider_id"];
42879
+ function assertSubscriptionFields(value) {
42880
+ if (!matches(value["id"], /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u) || !oneOf(["dev", "prod"], value["environment"]) || !oneOf(["creating", "active", "deactivating", "inactive"], value["state"]) || !Number.isSafeInteger(value["generation"]) || Number(value["generation"]) < 1 || !(value["provider_id"] === null || matches(value["provider_id"], WEBHOOK_ID_PATTERN)) || value["state"] === "creating" && value["provider_id"] !== null || (value["state"] === "active" || value["state"] === "deactivating") && value["provider_id"] === null)
42881
+ throw new TypeError("Invalid database webhook subscription");
42882
+ }
42883
+ function assertDatabaseWebhookSubscription(value) {
42884
+ if (!record2(value) || !exact2(value, SUBSCRIPTION_KEYS))
42885
+ throw new TypeError("Invalid database webhook subscription");
42886
+ assertSubscriptionFields(value);
42887
+ }
42888
+ function assertDatabaseWebhookSubscriptionActivation(value) {
42889
+ if (!record2(value) || !exact2(value, [...SUBSCRIPTION_KEYS, "secret"]))
42890
+ throw new TypeError("Invalid database webhook subscription activation");
42891
+ assertSubscriptionFields(value);
42892
+ if (value["state"] !== "active" || value["provider_id"] === null || typeof value["secret"] !== "string" || !/^[\x21-\x7e]{16,512}$/u.test(value["secret"]))
42893
+ throw new TypeError("Invalid database webhook subscription activation");
42894
+ }
42705
42895
  function assertDatabaseWatch(value) {
42706
42896
  if (!record2(value) || !exact2(value, DATABASE_WATCH_KEYS) || !matches(value["id"], DATABASE_WATCH_ID_PATTERN) || !oneOf(["dev", "prod"], value["environment"]) || !isDatabaseWatchSchema(value["schema"]) || !isDatabaseWatchIdentifier(value["table"]) || !Array.isArray(value["columns"]) || value["columns"].length < 1 || value["columns"].length > DATABASE_WATCH_MAX_COLUMNS || !value["columns"].every(isDatabaseWatchIdentifier) || !isCanonicalOperations(value["operations"]) || value["topic"] !== dataEventTopic(value["table"]) || value["event_type"] !== `data.${value["topic"]}`)
42707
42897
  throw new TypeError("Invalid database watch");
@@ -43421,6 +43611,8 @@ var recognizedCommandLabel = (argv) => {
43421
43611
  return "github connect";
43422
43612
  if (value === "github" && values[0] === "status")
43423
43613
  return "github status";
43614
+ if (value === "github" && values[0] === "disconnect")
43615
+ return "github disconnect";
43424
43616
  if (value === "operation" && values[0] === "get")
43425
43617
  return "operation get";
43426
43618
  if (value === "credits" && values[0] === "account")
@@ -43467,6 +43659,12 @@ var recognizedCommandLabel = (argv) => {
43467
43659
  return "organization list";
43468
43660
  if (value === "organization" && values[0] === "use")
43469
43661
  return "organization use";
43662
+ if (value === "organization" && values[0] === "mcp-connections") {
43663
+ if (values[1] === "list")
43664
+ return "organization mcp-connections list";
43665
+ if (values[1] === "revoke")
43666
+ return "organization mcp-connections revoke";
43667
+ }
43470
43668
  if (value === "project" && values[0] === "list")
43471
43669
  return "project list";
43472
43670
  if (value === "project" && values[0] === "context")
@@ -43475,6 +43673,8 @@ var recognizedCommandLabel = (argv) => {
43475
43673
  return "project notes set";
43476
43674
  if (value === "project" && values[0] === "status")
43477
43675
  return "project status";
43676
+ if (value === "project" && values[0] === "dev" && values[1] === "add")
43677
+ return "project dev add";
43478
43678
  if (value === "project" && values[0] === "handle" && values[1] === "check")
43479
43679
  return "project handle check";
43480
43680
  if (value === "project" && values[0] === "handle" && values[1] === "set")
@@ -43516,6 +43716,8 @@ var recognizedCommandLabel = (argv) => {
43516
43716
  if (value === "database" && values[0] === "table" && values[1] === "create")
43517
43717
  return "database table create";
43518
43718
  if (value === "database" && values[0] === "webhook") {
43719
+ if (values[1] === "subscription" && ["activate", "deactivate", "status"].includes(values[2] ?? ""))
43720
+ return `database webhook subscription ${values[2]}`;
43519
43721
  if (values[1] === "create")
43520
43722
  return "database webhook create";
43521
43723
  if (values[1] === "list")
@@ -43627,6 +43829,8 @@ var recognizedCommandLabel = (argv) => {
43627
43829
  return "mail webhook verify";
43628
43830
  if (values[1] === "disable")
43629
43831
  return "mail webhook disable";
43832
+ if (values[1] === "rotate")
43833
+ return "mail webhook rotate";
43630
43834
  }
43631
43835
  if (values[0] === "messages") {
43632
43836
  if (values[1] === "list")
@@ -44167,14 +44371,18 @@ var parseProductCliCommand = (argv) => {
44167
44371
  }
44168
44372
  if (first === "github") {
44169
44373
  const subcommand = values.shift();
44170
- if (yes || wait || follow || stdin)
44374
+ if (wait || follow || stdin)
44375
+ throw new InvalidCommandError();
44376
+ if (subcommand !== "connect" && subcommand !== "status" && subcommand !== "disconnect")
44171
44377
  throw new InvalidCommandError();
44172
- if (subcommand !== "connect" && subcommand !== "status")
44378
+ if (yes !== (subcommand === "disconnect"))
44173
44379
  throw new InvalidCommandError();
44174
44380
  const options = parseOptions(values, subcommand === "connect" ? ["--organization", "--idempotency-key"] : ["--organization"]);
44175
44381
  const organizationId = options["--organization"];
44176
44382
  if (!ORGANIZATION_ULID.test(organizationId))
44177
44383
  throw new InvalidCommandError();
44384
+ if (subcommand === "disconnect")
44385
+ return { kind: "github-disconnect", organizationId, yes: true, credentialStore };
44178
44386
  return subcommand === "connect" ? {
44179
44387
  kind: "github-connect",
44180
44388
  organizationId,
@@ -44182,6 +44390,35 @@ var parseProductCliCommand = (argv) => {
44182
44390
  credentialStore
44183
44391
  } : { kind: "github-status", organizationId, credentialStore };
44184
44392
  }
44393
+ if (first === "organization" && values[0] === "mcp-connections") {
44394
+ values.shift();
44395
+ const subcommand = values.shift();
44396
+ if (wait || follow || stdin)
44397
+ throw new InvalidCommandError();
44398
+ if (yes !== (subcommand === "revoke"))
44399
+ throw new InvalidCommandError();
44400
+ if (subcommand === "list") {
44401
+ const organizationId = parseOptions(values, ["--organization"])["--organization"];
44402
+ if (!ORGANIZATION_ULID.test(organizationId))
44403
+ throw new InvalidCommandError();
44404
+ return { kind: "organization-mcp-connections-list", organizationId, credentialStore };
44405
+ }
44406
+ if (subcommand === "revoke") {
44407
+ const options = parseOptions(values, ["--organization", "--connection"]);
44408
+ const organizationId = options["--organization"];
44409
+ const connectionId = options["--connection"];
44410
+ if (!ORGANIZATION_ULID.test(organizationId) || !MCP_CONNECTION_ID_PATTERN.test(connectionId))
44411
+ throw new InvalidCommandError();
44412
+ return {
44413
+ kind: "organization-mcp-connection-revoke",
44414
+ organizationId,
44415
+ connectionId,
44416
+ yes: true,
44417
+ credentialStore
44418
+ };
44419
+ }
44420
+ throw new InvalidCommandError();
44421
+ }
44185
44422
  if (first === "organization") {
44186
44423
  const subcommand = values.shift();
44187
44424
  if (yes || wait || follow || stdin)
@@ -44218,6 +44455,17 @@ var parseProductCliCommand = (argv) => {
44218
44455
  }
44219
44456
  if (first === "project") {
44220
44457
  const subcommand = values.shift();
44458
+ if (subcommand === "dev" && values.shift() === "add") {
44459
+ if (yes || wait || follow || stdin)
44460
+ throw new InvalidCommandError();
44461
+ const options2 = parseOptions(values, ["--project", "--idempotency-key"]);
44462
+ return {
44463
+ kind: "project-development-add",
44464
+ projectId: options2["--project"],
44465
+ idempotencyKey: options2["--idempotency-key"],
44466
+ credentialStore
44467
+ };
44468
+ }
44221
44469
  if (subcommand === "data") {
44222
44470
  const action = values.shift();
44223
44471
  if (follow || stdin || action !== "plan" && action !== "change")
@@ -44387,12 +44635,14 @@ var parseProductCliCommand = (argv) => {
44387
44635
  "--idempotency-key",
44388
44636
  "--data-mode",
44389
44637
  "--dev-access-mode",
44638
+ "--include-development-environment",
44390
44639
  "--region"
44391
44640
  ]);
44392
44641
  const dataMode = options["--data-mode"];
44393
44642
  const devAccessMode = options["--dev-access-mode"];
44643
+ const includeDevelopmentEnvironment = options["--include-development-environment"];
44394
44644
  const region = options["--region"];
44395
- if (!options["--organization"] || !options["--name"] || !options["--idempotency-key"] || dataMode !== void 0 && dataMode !== "shared" && dataMode !== "isolated" || devAccessMode !== void 0 && devAccessMode !== "protected" && devAccessMode !== "public" || region !== void 0 && region !== "us" && region !== "eu")
44645
+ if (!options["--organization"] || !options["--name"] || !options["--idempotency-key"] || dataMode !== void 0 && dataMode !== "shared" && dataMode !== "isolated" || devAccessMode !== void 0 && devAccessMode !== "protected" && devAccessMode !== "public" || includeDevelopmentEnvironment !== void 0 && includeDevelopmentEnvironment !== "true" && includeDevelopmentEnvironment !== "false" || region !== void 0 && region !== "us" && region !== "eu")
44396
44646
  throw new InvalidCommandError();
44397
44647
  return {
44398
44648
  kind: "project-create",
@@ -44400,6 +44650,7 @@ var parseProductCliCommand = (argv) => {
44400
44650
  name: options["--name"],
44401
44651
  ...dataMode === void 0 ? {} : { dataMode },
44402
44652
  ...devAccessMode === void 0 ? {} : { devAccessMode },
44653
+ ...includeDevelopmentEnvironment === void 0 ? {} : { includeDevelopmentEnvironment: includeDevelopmentEnvironment === "true" },
44403
44654
  ...region === void 0 ? {} : { region },
44404
44655
  idempotencyKey: options["--idempotency-key"],
44405
44656
  credentialStore
@@ -44645,6 +44896,79 @@ var parseProductCliCommand = (argv) => {
44645
44896
  if (first === "database" && values[0] === "webhook") {
44646
44897
  values.shift();
44647
44898
  const subcommand = values.shift();
44899
+ if (subcommand === "subscription") {
44900
+ const action = values.shift();
44901
+ if (!["activate", "deactivate", "status"].includes(action ?? "") || wait || follow || revoke || stdin || yes !== (action !== "status"))
44902
+ throw new InvalidCommandError();
44903
+ const options = parseOptionalOptions(values, [
44904
+ "--project",
44905
+ "--environment",
44906
+ "--subscription",
44907
+ "--generation",
44908
+ "--url",
44909
+ "--event-types",
44910
+ "--headers-file",
44911
+ "--out",
44912
+ "--idempotency-key"
44913
+ ]);
44914
+ const projectId = options["--project"], environment = options["--environment"] ?? (action === "status" ? "dev" : void 0), subscriptionId = options["--subscription"];
44915
+ if (!isValue(projectId) || !subscriptionId || !ORGANIZATION_ULID.test(subscriptionId) || environment !== "dev" && environment !== "prod")
44916
+ throw new InvalidCommandError();
44917
+ if (action === "status") {
44918
+ if ([
44919
+ "--generation",
44920
+ "--url",
44921
+ "--event-types",
44922
+ "--headers-file",
44923
+ "--out",
44924
+ "--idempotency-key"
44925
+ ].some((key) => options[key] !== void 0))
44926
+ throw new InvalidCommandError();
44927
+ return {
44928
+ kind: "database-webhook-subscription-status",
44929
+ projectId,
44930
+ environment,
44931
+ subscriptionId,
44932
+ credentialStore
44933
+ };
44934
+ }
44935
+ const generationText = options["--generation"], idempotencyKey = options["--idempotency-key"];
44936
+ if (!generationText || !/^[1-9][0-9]*$/u.test(generationText) || Number(generationText) > 2147483647 || !isValue(idempotencyKey))
44937
+ throw new InvalidCommandError();
44938
+ const generation2 = Number(generationText);
44939
+ if (action === "deactivate") {
44940
+ if (["--url", "--event-types", "--headers-file", "--out"].some((key) => options[key] !== void 0))
44941
+ throw new InvalidCommandError();
44942
+ return {
44943
+ kind: "database-webhook-subscription-deactivate",
44944
+ projectId,
44945
+ environment,
44946
+ subscriptionId,
44947
+ generation: generation2,
44948
+ idempotencyKey,
44949
+ yes: true,
44950
+ credentialStore
44951
+ };
44952
+ }
44953
+ const url = options["--url"], eventTypes = options["--event-types"], headersFile = options["--headers-file"], outputPath = options["--out"];
44954
+ if (!isValue(url) || !isValue(eventTypes) || !isValue(outputPath) || headersFile !== void 0 && !isValue(headersFile))
44955
+ throw new InvalidCommandError();
44956
+ const request = contractValue(() => parseDatabaseWebhookCreateRequest({ url, event_types: eventTypes.split(",") }));
44957
+ return {
44958
+ kind: "database-webhook-subscription-activate",
44959
+ projectId,
44960
+ environment,
44961
+ subscriptionId,
44962
+ generation: generation2,
44963
+ url: request.url,
44964
+ eventTypes: request.event_types,
44965
+ headersFile: headersFile ?? null,
44966
+ outputPath,
44967
+ idempotencyKey,
44968
+ yes: true,
44969
+ credentialStore
44970
+ };
44971
+ }
44648
44972
  if (subcommand === "create") {
44649
44973
  if (!yes || wait || follow || revoke || stdin)
44650
44974
  throw new InvalidCommandError();
@@ -45019,7 +45343,7 @@ var parseProductCliCommand = (argv) => {
45019
45343
  kind: "plan",
45020
45344
  projectId,
45021
45345
  commitSha,
45022
- environment: deploymentEnvironment(options["--environment"]),
45346
+ ...options["--environment"] === void 0 ? {} : { environment: deploymentEnvironment(options["--environment"]) },
45023
45347
  credentialStore
45024
45348
  };
45025
45349
  }
@@ -45044,7 +45368,7 @@ var parseProductCliCommand = (argv) => {
45044
45368
  projectId,
45045
45369
  planId,
45046
45370
  commitSha,
45047
- environment: deploymentEnvironment(options["--environment"]),
45371
+ ...options["--environment"] === void 0 ? {} : { environment: deploymentEnvironment(options["--environment"]) },
45048
45372
  idempotencyKey,
45049
45373
  yes,
45050
45374
  wait,
@@ -45382,9 +45706,10 @@ var parseProductCliCommand = (argv) => {
45382
45706
  const area = values.shift();
45383
45707
  const sub = area === "webhook" || area === "messages" || area === "domain" ? values.shift() : void 0;
45384
45708
  const retiring = area === "domain" && sub === "delete";
45385
- if (yes !== retiring || wait || follow || stdin)
45709
+ const rotating = area === "webhook" && sub === "rotate";
45710
+ if (yes !== (retiring || rotating) || wait || follow || stdin)
45386
45711
  throw new InvalidCommandError();
45387
- const options = parseOptionalOptions(values, [
45712
+ const options = parseOptionalOptions(values, rotating ? ["--project", "--environment", "--idempotency-key"] : [
45388
45713
  "--project",
45389
45714
  "--environment",
45390
45715
  "--domain",
@@ -45434,6 +45759,13 @@ var parseProductCliCommand = (argv) => {
45434
45759
  idempotencyKey: required("--idempotency-key")
45435
45760
  };
45436
45761
  label = "mail webhook set";
45762
+ } else if (rotating) {
45763
+ request = {
45764
+ ...scope,
45765
+ action: "webhook_rotate",
45766
+ idempotencyKey: required("--idempotency-key")
45767
+ };
45768
+ label = "mail webhook rotate";
45437
45769
  } else if (area === "webhook" && (sub === "verify" || sub === "disable")) {
45438
45770
  request = {
45439
45771
  ...scope,
@@ -45812,8 +46144,9 @@ var publicWorkspace = (organization) => ({
45812
46144
  });
45813
46145
 
45814
46146
  // apps/product-cli/dist/cli.js
45815
- import { open as open3 } from "node:fs/promises";
45816
- import { join as join5, resolve as resolve4 } from "node:path";
46147
+ import { constants as constants4 } from "node:fs";
46148
+ import { lstat as lstat2, open as open3 } from "node:fs/promises";
46149
+ import { isAbsolute as isAbsolute2, join as join5, resolve as resolve4 } from "node:path";
45817
46150
 
45818
46151
  // packages/contracts/dist/database-access.js
45819
46152
  function parseProjectDatabaseWrite(value) {
@@ -45977,7 +46310,7 @@ function assertOrganizationCreditUsage(value) {
45977
46310
  for (const key of ["meter", "unit", "rate_card_id"])
45978
46311
  if (typeof meter[key] !== "string" || !/^[A-Za-z0-9_.:/-]{1,128}$/u.test(meter[key]))
45979
46312
  throw new TypeError("Invalid usage meter");
45980
- if (typeof meter["quantity"] !== "string" || !/^(0|[1-9][0-9]{0,29})(\.[0-9]{1,12})?$/u.test(meter["quantity"]) || !amount(meter["charged_micros"]))
46313
+ if (typeof meter["quantity"] !== "string" || !/^(0|[1-9][0-9]{0,29})(\.[0-9]{1,20})?$/u.test(meter["quantity"]) || !amount(meter["charged_micros"]))
45981
46314
  throw new TypeError("Invalid usage amount");
45982
46315
  }
45983
46316
  }
@@ -46056,7 +46389,7 @@ function exact4(v, keys) {
46056
46389
  // apps/product-cli/package.json
46057
46390
  var package_default = {
46058
46391
  name: "@ohmyhost/product-cli",
46059
- version: "0.1.55",
46392
+ version: "0.1.57",
46060
46393
  private: true,
46061
46394
  ohmyhost: {
46062
46395
  deployment: "production",
@@ -46373,6 +46706,7 @@ var HELP_USAGE = Object.freeze({
46373
46706
  "profile list": "ohmyhost profile list --json (saved logins on this computer: name, user and organization, never a token; pass --profile-name NAME or set OHMYHOST_PROFILE to choose one)",
46374
46707
  "github connect": "ohmyhost github connect --organization ULID --idempotency-key KEY --json (connect once, then link covered repositories without another browser consent)",
46375
46708
  "github status": "ohmyhost github status --organization ULID --json",
46709
+ "github disconnect": "ohmyhost github disconnect --organization ULID --yes --json (Owner only; revokes the workspace GitHub connection and every repository grant under it, so auto-deploy and linked sources stop at once; the GitHub App stays installed for other workspaces, and github connect starts a new connection)",
46376
46710
  "export create": "ohmyhost export create --project ULID --idempotency-key KEY --stdin --json (password on stdin only; one accepted SQL ZIP per project per 24 hours)",
46377
46711
  "export get": "ohmyhost export get EXPORT_ULID --project ULID --json (poll the original job: progress and error only, never a download URL; once it succeeds, run 'ohmyhost export download-link' for the signed 24-hour ZIP link)",
46378
46712
  "export download-link": "ohmyhost export download-link EXPORT_ULID --project ULID --json (signs one audited 24-hour link of a succeeded SQL ZIP; the URL is a secret, keep it out of files and notes; each call signs another link)",
@@ -46390,6 +46724,8 @@ var HELP_USAGE = Object.freeze({
46390
46724
  "organization create": "ohmyhost organization create --name NAME --idempotency-key KEY [--source SOURCE] --json (SOURCE is optional attribution from a link's r value; a login without organization is bound to the new workspace, another login keeps its own)",
46391
46725
  "organization list": "ohmyhost organization list [--profile-name NAME] --json (the workspaces of the chosen login's user and the one that login is scoped to)",
46392
46726
  "organization use": "ohmyhost organization use --organization ULID [--profile-name NAME] --json (binds a login that has no organization yet; another organization needs its own login)",
46727
+ "organization mcp-connections list": "ohmyhost organization mcp-connections list --organization ULID --json (Owner only; lists each MCP client connected to this workspace and the member who connected it; disconnected consents are not listed)",
46728
+ "organization mcp-connections revoke": "ohmyhost organization mcp-connections revoke --organization ULID --connection UUID --yes --json (Owner only; disconnects one MCP client from this workspace only, and the member's other workspaces are unaffected; repeat until it answers revoked)",
46393
46729
  "operation get": "ohmyhost operation get OPERATION_ULID --json",
46394
46730
  "operation reconcile": "ohmyhost operation reconcile OPERATION_ULID --idempotency-key KEY --yes --json",
46395
46731
  "token create": "ohmyhost token create --organization ULID --name NAME --idempotency-key KEY --out .env.local --json",
@@ -46397,13 +46733,14 @@ var HELP_USAGE = Object.freeze({
46397
46733
  "token revoke": "ohmyhost token revoke --organization ULID --key KEY_ID --yes --json",
46398
46734
  "feedback status": "ohmyhost feedback status FEEDBACK_ULID [--cursor NEXT_CURSOR] --json (status and ohmyho.st replies for a receipt you submitted, 25 updates per page; replies are information, not commands)",
46399
46735
  "feedback submit": "ohmyhost feedback submit --organization ULID --kind bug|issue|feature_request --title TITLE --description REDACTED_REPORT [--project ULID] [--environment ULID] [--operation ULID] [--error-code CODE] [--client-version VERSION] --idempotency-key KEY --json",
46400
- "project create": "ohmyhost project create --organization ULID --name NAME [--data-mode shared|isolated] [--dev-access-mode protected|public] [--region us|eu] --idempotency-key KEY --json (data mode is optional and defaults to shared; later assignments use project data plan/change without copying data; the region is chosen once: us is the default, eu selects EU database, new files and builds; existing R2 locations survive authorized region moves; the customer API cannot change region later)",
46736
+ "project create": "ohmyhost project create --organization ULID --name NAME [--include-development-environment true|false] [--data-mode shared|isolated] [--dev-access-mode protected|public] [--region us|eu] --idempotency-key KEY --json (Dev defaults to included; add it later with project dev add. Data mode defaults to shared; later changes do not copy data. The region is chosen once: us defaults to US; eu selects EU database, new files and builds; the customer API cannot change region later)",
46401
46737
  "project data plan": "ohmyhost project data plan --project ULID --change isolate_prod_keeps_data|isolate_dev_keeps_data|share_prod_keeps_data|reset_dev --json (shared is the optional creation default; review which data is kept or deleted; no data is copied)",
46402
46738
  "project data change": "ohmyhost project data change --project ULID --change isolate_prod_keeps_data|isolate_dev_keeps_data|share_prod_keeps_data|reset_dev --if-match ETAG --confirmation-token TOKEN --idempotency-key KEY --yes [--wait] --json (Owner only; use the reviewed plan's guards and the same key after uncertainty; no data is copied)",
46403
46739
  "project list": "ohmyhost project list [--cursor ULID] [--limit LIMIT] --json",
46404
46740
  "project context": "ohmyhost project context --project ULID --json",
46405
46741
  "project notes set": "ohmyhost project notes set --project ULID --version NUMBER --markdown TEXT --idempotency-key KEY --json (no credentials or signed URLs)",
46406
46742
  "project status": "ohmyhost project status --project ULID --json",
46743
+ "project dev add": "ohmyhost project dev add --project ULID --idempotency-key KEY --json",
46407
46744
  "project dev-access create": "ohmyhost project dev-access create --project ULID --json",
46408
46745
  "project dev-share link": "ohmyhost project dev-share link --project ULID --json",
46409
46746
  "project dev-share rotate": "ohmyhost project dev-share rotate --project ULID --idempotency-key KEY --yes --json",
@@ -46425,6 +46762,9 @@ var HELP_USAGE = Object.freeze({
46425
46762
  "database watch delete": "ohmyhost database watch delete --project ULID --environment dev|prod --watch ID --idempotency-key KEY --yes --json",
46426
46763
  "database table create": "ohmyhost database table create --project ULID --environment dev|prod --table NAME --columns-file PATH [--primary-key COL[,COL]] --idempotency-key KEY --yes --json (the table is created in the public schema as the migration role, with the same access as migration tables, so a database watch can attach later; the columns file is a UTF-8 JSON array of 1 to 64 column objects, at most 64 KiB, each with name, type and optional nullable, identity and default; types: text, integer, bigint, boolean, numeric, double precision, timestamptz, date, uuid, jsonb; identity needs integer or bigint; default now needs timestamptz and default uuid needs uuid; identical repeats answer created false; at most 100 tables, 64 columns per table)",
46427
46764
  "database webhook create": "ohmyhost database webhook create --project ULID --environment dev|prod --url HTTPS_URL --event-types TYPE[,TYPE] [--headers-file PATH] --idempotency-key KEY --yes --json (the signing secret is shown once in this answer; types: database.created, database.ready, database.woke, database.slept, database.suspended, database.resized, database.deleted, data.<topic> for the rows of one watched table printed by database watch create, or data.* for every watched table; a bare * is not accepted and does not include data events; the headers file is a UTF-8 JSON object of at most 8 KiB)",
46765
+ "database webhook subscription activate": "ohmyhost database webhook subscription activate --project ULID --environment dev|prod --subscription ULID --generation N --url HTTPS_URL --event-types TYPE[,TYPE] [--headers-file PATH] --out NEW_PRIVATE_FILE --idempotency-key KEY --yes --json (the secret is written privately; repeat the same key and body after uncertainty using a new output file)",
46766
+ "database webhook subscription deactivate": "ohmyhost database webhook subscription deactivate --project ULID --environment dev|prod --subscription ULID --generation N --idempotency-key KEY --yes --json",
46767
+ "database webhook subscription status": "ohmyhost database webhook subscription status --project ULID [--environment dev|prod] --subscription ULID --json",
46428
46768
  "database webhook list": "ohmyhost database webhook list --project ULID [--environment dev|prod] --json (dev when omitted; the secret is never listed)",
46429
46769
  "database webhook get": "ohmyhost database webhook get --project ULID [--environment dev|prod] --webhook ID --json",
46430
46770
  "database webhook delete": "ohmyhost database webhook delete --project ULID --environment dev|prod --webhook ID [--idempotency-key KEY] --yes --json (a retry with the same key and request returns the stored answer; without a key each call is new)",
@@ -46497,6 +46837,7 @@ var HELP_USAGE = Object.freeze({
46497
46837
  "mail webhook set": "ohmyhost mail webhook set --project ULID --environment ULID --url HTTPS_URL --idempotency-key KEY --json",
46498
46838
  "mail webhook verify": "ohmyhost mail webhook verify --project ULID --environment ULID --idempotency-key KEY --json",
46499
46839
  "mail webhook disable": "ohmyhost mail webhook disable --project ULID --environment ULID --idempotency-key KEY --json",
46840
+ "mail webhook rotate": "ohmyhost mail webhook rotate --project ULID --environment ULID --idempotency-key KEY --yes --json (Owner only; issues a new signing secret for the same endpoint, stops the earlier secrets at once and ends receiving until the endpoint verifies the new one; the secret is returned once, so install it in Prod application secrets and never write it into files or notes)",
46500
46841
  "mail messages list": "ohmyhost mail messages list --project ULID --environment ULID [--after ULID] --json",
46501
46842
  "mail messages get": "ohmyhost mail messages get --project ULID --environment ULID --message ULID --json",
46502
46843
  "mail messages retry": "ohmyhost mail messages retry --project ULID --environment ULID --message ULID --idempotency-key KEY --json",
@@ -46647,6 +46988,36 @@ var ProductCli = class {
46647
46988
  }
46648
46989
  });
46649
46990
  }
46991
+ if (command.kind === "github-disconnect") {
46992
+ const api = await this.authenticatedApi(command.credentialStore, signal);
46993
+ const github = parseGithubDisconnection(await api.disconnectGithub(command.organizationId));
46994
+ if (github.connection !== null && github.connection.organization_id !== command.organizationId)
46995
+ throw new ResponseContractError();
46996
+ return success(name, {
46997
+ status: github.status,
46998
+ github,
46999
+ ...github.status === "connected" ? {} : { next_action: this.githubConnectAction(command.organizationId) }
47000
+ });
47001
+ }
47002
+ if (command.kind === "organization-mcp-connections-list") {
47003
+ const api = await this.authenticatedApi(command.credentialStore, signal);
47004
+ const page = parseOrganizationMcpConnectionList(await api.listOrganizationMcpConnections(command.organizationId));
47005
+ return success(name, { status: "listed", connections: page.connections });
47006
+ }
47007
+ if (command.kind === "organization-mcp-connection-revoke") {
47008
+ const api = await this.authenticatedApi(command.credentialStore, signal);
47009
+ const revocation = parseOrganizationMcpConnectionRevocation(await api.revokeOrganizationMcpConnection({
47010
+ organizationId: command.organizationId,
47011
+ connectionId: command.connectionId
47012
+ }));
47013
+ return success(name, {
47014
+ status: revocation.state,
47015
+ revocation,
47016
+ ...revocation.state === "revoked" ? {} : {
47017
+ next_action: "Repeat this exact command until status is revoked; the client's active provider use is still draining."
47018
+ }
47019
+ });
47020
+ }
46650
47021
  if (command.kind === "whoami")
46651
47022
  return await this.getCurrentIdentity(command, signal);
46652
47023
  if (command.kind === "token-create" || command.kind === "token-list" || command.kind === "token-revoke") {
@@ -46870,6 +47241,8 @@ var ProductCli = class {
46870
47241
  }
46871
47242
  if (command.kind === "project-status")
46872
47243
  return await this.getProjectStatus(command, signal);
47244
+ if (command.kind === "project-development-add")
47245
+ return await this.addProjectDevelopment(command, signal);
46873
47246
  if (command.kind === "project-dev-access-create")
46874
47247
  return await this.createDevAccessTicket(command, signal);
46875
47248
  if (command.kind === "project-flag-status" || command.kind === "project-flag-set") {
@@ -46936,6 +47309,8 @@ var ProductCli = class {
46936
47309
  return await this.createDatabaseTable(command, signal);
46937
47310
  if (command.kind === "database-webhook-create")
46938
47311
  return await this.createDatabaseWebhook(command, signal);
47312
+ if (command.kind === "database-webhook-subscription-activate" || command.kind === "database-webhook-subscription-deactivate" || command.kind === "database-webhook-subscription-status")
47313
+ return await this.databaseWebhookSubscription(command, signal);
46939
47314
  if (command.kind === "database-webhook-list")
46940
47315
  return await this.listDatabaseWebhooks(command, signal);
46941
47316
  if (command.kind === "database-webhook-get")
@@ -47045,7 +47420,7 @@ var ProductCli = class {
47045
47420
  }
47046
47421
  return await this.deleteEnvironmentSecret(command, signal);
47047
47422
  } catch (error) {
47048
- if (error instanceof UserTokenFileError)
47423
+ if (error instanceof UserTokenFileError || error instanceof PrivateSecretFileError)
47049
47424
  return failure(name, 3, error.code, false, error.message);
47050
47425
  if (error instanceof InteractiveSessionRequiredError)
47051
47426
  return failure(name, 2, "interactive_login_required", false, `A user API token cannot create, list or select a workspace. Run '${this.dependencies.commandPrefix} login --json' in a process without OHMYHOST_TOKEN.`);
@@ -47414,6 +47789,7 @@ var ProductCli = class {
47414
47789
  name: command.name,
47415
47790
  ...command.dataMode === void 0 ? {} : { dataMode: command.dataMode },
47416
47791
  ...command.devAccessMode === void 0 ? {} : { devAccessMode: command.devAccessMode },
47792
+ ...command.includeDevelopmentEnvironment === void 0 ? {} : { includeDevelopmentEnvironment: command.includeDevelopmentEnvironment },
47417
47793
  ...command.region === void 0 ? {} : { region: command.region },
47418
47794
  idempotencyKey: command.idempotencyKey
47419
47795
  }));
@@ -47447,6 +47823,14 @@ var ProductCli = class {
47447
47823
  const project = parseProjectStatus(await api.getProjectStatus(command.projectId));
47448
47824
  return success("project status", { status: "succeeded", project, context: this.context() });
47449
47825
  }
47826
+ async addProjectDevelopment(command, signal) {
47827
+ const api = await this.authenticatedApi(command.credentialStore, signal);
47828
+ const operation = parseOperation(await api.addProjectDevelopmentEnvironment({
47829
+ projectId: command.projectId,
47830
+ idempotencyKey: command.idempotencyKey
47831
+ }));
47832
+ return success("project dev add", { status: "accepted", operation });
47833
+ }
47450
47834
  async createDevAccessTicket(command, signal) {
47451
47835
  const api = await this.authenticatedApi(command.credentialStore, signal);
47452
47836
  const ticket = parseDevAccessTicket(await api.createDevAccessTicket(command.projectId));
@@ -47552,6 +47936,48 @@ var ProductCli = class {
47552
47936
  });
47553
47937
  return success("database webhook create", { status: "succeeded", webhook });
47554
47938
  }
47939
+ async databaseWebhookSubscription(command, signal) {
47940
+ const common = {
47941
+ projectId: command.projectId,
47942
+ environment: command.environment,
47943
+ subscriptionId: command.subscriptionId
47944
+ };
47945
+ if (command.kind === "database-webhook-subscription-activate") {
47946
+ const request = await webhookCreateRequest(command);
47947
+ const file = await preparePrivateSecretFile(command.outputPath);
47948
+ try {
47949
+ const api2 = await this.authenticatedApi(command.credentialStore, signal);
47950
+ const value = await api2.activateDatabaseWebhookSubscription({
47951
+ ...common,
47952
+ generation: command.generation,
47953
+ idempotencyKey: command.idempotencyKey,
47954
+ request
47955
+ });
47956
+ await file.save(value.secret);
47957
+ const subscription2 = {
47958
+ id: value.id,
47959
+ environment: value.environment,
47960
+ state: value.state,
47961
+ generation: value.generation,
47962
+ provider_id: value.provider_id
47963
+ };
47964
+ return success(parsedCommandName(command), {
47965
+ status: "succeeded",
47966
+ subscription: subscription2,
47967
+ secret_file: file.path
47968
+ });
47969
+ } finally {
47970
+ await file.close();
47971
+ }
47972
+ }
47973
+ const api = await this.authenticatedApi(command.credentialStore, signal);
47974
+ const subscription = command.kind === "database-webhook-subscription-status" ? await api.getDatabaseWebhookSubscription(common) : await api.deactivateDatabaseWebhookSubscription({
47975
+ ...common,
47976
+ generation: command.generation,
47977
+ idempotencyKey: command.idempotencyKey
47978
+ });
47979
+ return success(parsedCommandName(command), { status: "succeeded", subscription });
47980
+ }
47555
47981
  async listDatabaseWebhooks(command, signal) {
47556
47982
  const api = await this.authenticatedApi(command.credentialStore, signal);
47557
47983
  const page = await api.listProjectDatabaseWebhooks({
@@ -47996,7 +48422,7 @@ var ProductCli = class {
47996
48422
  const plan = command.commitSha === null ? null : parseDeploymentPlan(await api.planDeployment({
47997
48423
  projectId: command.projectId,
47998
48424
  commitSha: command.commitSha,
47999
- environment: command.environment
48425
+ ...command.environment === void 0 ? {} : { environment: command.environment }
48000
48426
  }));
48001
48427
  let accepted;
48002
48428
  try {
@@ -48015,7 +48441,7 @@ var ProductCli = class {
48015
48441
  if (command.wait)
48016
48442
  operation = await this.waitForOperation(api, operation, signal);
48017
48443
  const notes = operation.state === "succeeded" ? [
48018
- `Check project status for dev_access_mode. For protected Dev, run '${this.dependencies.commandPrefix} project dev-share link --project ULID --json' and open or share its persistent share_url; public Dev opens directly.`
48444
+ `If this is a Dev deployment, check project status for dev_access_mode. For protected Dev, run '${this.dependencies.commandPrefix} project dev-share link --project ULID --json' and open or share its persistent share_url; public Dev opens directly.`
48019
48445
  ] : [];
48020
48446
  return success("deploy", {
48021
48447
  status: command.wait ? "completed" : "accepted",
@@ -48356,17 +48782,25 @@ var reusedKeyProblem = (error) => {
48356
48782
  };
48357
48783
  var OPERATION_STREAM_CONNECTIONS = 4;
48358
48784
  var readStatementFile = (path2) => readBoundedUtf8File(path2, 65536, () => new ProductCliFailure(2, "statement_file_invalid", false, STATEMENT_FILE_INVALID_ACTION));
48359
- var readBoundedUtf8File = async (path2, maxBytes, refusal) => {
48785
+ var readBoundedUtf8File = async (path2, maxBytes, refusal, privateFile = false) => {
48360
48786
  let file;
48787
+ let before;
48361
48788
  try {
48362
- file = await open3(path2, "r");
48789
+ if (privateFile) {
48790
+ if (!isAbsolute2(path2))
48791
+ throw refusal();
48792
+ before = await lstat2(path2);
48793
+ if (!before.isFile() || before.isSymbolicLink() || before.nlink !== 1 || process.platform !== "win32" && (before.uid !== process.getuid?.() || (before.mode & 63) !== 0))
48794
+ throw refusal();
48795
+ }
48796
+ file = await open3(path2, privateFile ? constants4.O_RDONLY | (constants4.O_NOFOLLOW ?? 0) : "r");
48363
48797
  } catch {
48364
48798
  throw refusal();
48365
48799
  }
48366
48800
  const buffer = Buffer.alloc(maxBytes + 1);
48367
48801
  try {
48368
48802
  const stat3 = await file.stat();
48369
- if (!stat3.isFile() || stat3.size > maxBytes)
48803
+ if (!stat3.isFile() || stat3.size > maxBytes || before !== void 0 && (stat3.ino !== before.ino || stat3.dev !== before.dev || stat3.nlink !== 1 || stat3.size !== before.size || process.platform !== "win32" && (stat3.uid !== process.getuid?.() || (stat3.mode & 63) !== 0)))
48370
48804
  throw refusal();
48371
48805
  let length = 0;
48372
48806
  while (length < buffer.length) {
@@ -48387,9 +48821,9 @@ var readBoundedUtf8File = async (path2, maxBytes, refusal) => {
48387
48821
  await file.close();
48388
48822
  }
48389
48823
  };
48390
- var webhookCreateRequest = async (command) => {
48824
+ var webhookCreateRequest = async (command, privateHeaders = false) => {
48391
48825
  const headersFailure = () => new ProductCliFailure(2, "headers_file_invalid", false, HEADERS_FILE_INVALID_ACTION);
48392
- const headers = command.headersFile === null ? void 0 : await readBoundedUtf8File(command.headersFile, 8192, headersFailure).then((text) => {
48826
+ const headers = command.headersFile === null ? void 0 : await readBoundedUtf8File(command.headersFile, 8192, headersFailure, privateHeaders).then((text) => {
48393
48827
  try {
48394
48828
  return JSON.parse(text);
48395
48829
  } catch {
@@ -48406,6 +48840,7 @@ var webhookCreateRequest = async (command) => {
48406
48840
  throw headersFailure();
48407
48841
  }
48408
48842
  };
48843
+ var readPrivateWebhookCreateRequest = (input) => webhookCreateRequest(input, true);
48409
48844
  var scheduleSetRequest = async (command) => {
48410
48845
  const statementsFailure = () => new ProductCliFailure(2, "statements_file_invalid", false, SCHEDULE_STATEMENTS_FILE_INVALID_ACTION);
48411
48846
  const statements = await readBoundedUtf8File(command.statementsFile, 65536, statementsFailure).then((text) => {
@@ -48563,6 +48998,12 @@ var parsedCommandName = (command) => {
48563
48998
  return "github connect";
48564
48999
  if (command.kind === "github-status")
48565
49000
  return "github status";
49001
+ if (command.kind === "github-disconnect")
49002
+ return "github disconnect";
49003
+ if (command.kind === "organization-mcp-connections-list")
49004
+ return "organization mcp-connections list";
49005
+ if (command.kind === "organization-mcp-connection-revoke")
49006
+ return "organization mcp-connections revoke";
48566
49007
  if (command.kind === "project-list")
48567
49008
  return "project list";
48568
49009
  if (command.kind === "database-compute-set")
@@ -48575,6 +49016,8 @@ var parsedCommandName = (command) => {
48575
49016
  return "project notes set";
48576
49017
  if (command.kind === "project-status")
48577
49018
  return "project status";
49019
+ if (command.kind === "project-development-add")
49020
+ return "project dev add";
48578
49021
  if (command.kind === "project-dev-access-create")
48579
49022
  return "project dev-access create";
48580
49023
  if (command.kind === "project-dev-share-link")
@@ -48615,6 +49058,12 @@ var parsedCommandName = (command) => {
48615
49058
  return "database table create";
48616
49059
  if (command.kind === "database-webhook-create")
48617
49060
  return "database webhook create";
49061
+ if (command.kind === "database-webhook-subscription-activate")
49062
+ return "database webhook subscription activate";
49063
+ if (command.kind === "database-webhook-subscription-deactivate")
49064
+ return "database webhook subscription deactivate";
49065
+ if (command.kind === "database-webhook-subscription-status")
49066
+ return "database webhook subscription status";
48618
49067
  if (command.kind === "database-webhook-list")
48619
49068
  return "database webhook list";
48620
49069
  if (command.kind === "database-webhook-get")
@@ -50279,6 +50728,23 @@ var connectGithubOrganization = (parameters, options) => {
50279
50728
  }
50280
50729
  });
50281
50730
  };
50731
+ var disconnectGithubOrganization = (parameters, options) => {
50732
+ const params = buildClientParams([parameters], [
50733
+ {
50734
+ args: [
50735
+ { in: "headers", key: "X-Request-Id" },
50736
+ { in: "path", key: "organization_id" }
50737
+ ]
50738
+ }
50739
+ ]);
50740
+ return (options?.client ?? client).delete({
50741
+ responseStyle: "data",
50742
+ security: [{ scheme: "bearer", type: "http" }],
50743
+ url: "/v1/organizations/{organization_id}/github",
50744
+ ...options,
50745
+ ...params
50746
+ });
50747
+ };
50282
50748
  var getGithubOrganizationConnection = (parameters, options) => {
50283
50749
  const params = buildClientParams([parameters], [
50284
50750
  {
@@ -50296,6 +50762,41 @@ var getGithubOrganizationConnection = (parameters, options) => {
50296
50762
  ...params
50297
50763
  });
50298
50764
  };
50765
+ var listOrganizationMcpConnections = (parameters, options) => {
50766
+ const params = buildClientParams([parameters], [
50767
+ {
50768
+ args: [
50769
+ { in: "headers", key: "X-Request-Id" },
50770
+ { in: "path", key: "organization_id" }
50771
+ ]
50772
+ }
50773
+ ]);
50774
+ return (options?.client ?? client).get({
50775
+ responseStyle: "data",
50776
+ security: [{ scheme: "bearer", type: "http" }],
50777
+ url: "/v1/organizations/{organization_id}/mcp-connections",
50778
+ ...options,
50779
+ ...params
50780
+ });
50781
+ };
50782
+ var revokeOrganizationMcpConnection = (parameters, options) => {
50783
+ const params = buildClientParams([parameters], [
50784
+ {
50785
+ args: [
50786
+ { in: "headers", key: "X-Request-Id" },
50787
+ { in: "path", key: "organization_id" },
50788
+ { in: "path", key: "connection_id" }
50789
+ ]
50790
+ }
50791
+ ]);
50792
+ return (options?.client ?? client).delete({
50793
+ responseStyle: "data",
50794
+ security: [{ scheme: "bearer", type: "http" }],
50795
+ url: "/v1/organizations/{organization_id}/mcp-connections/{connection_id}",
50796
+ ...options,
50797
+ ...params
50798
+ });
50799
+ };
50299
50800
  var getOrganizationReferral = (parameters, options) => {
50300
50801
  const params = buildClientParams([parameters], [
50301
50802
  {
@@ -50839,6 +51340,30 @@ var setProjectNotes = (parameters, options) => {
50839
51340
  }
50840
51341
  });
50841
51342
  };
51343
+ var addProjectDevelopmentEnvironment = (parameters, options) => {
51344
+ const params = buildClientParams([parameters], [
51345
+ {
51346
+ args: [
51347
+ { in: "headers", key: "X-Request-Id" },
51348
+ { in: "headers", key: "Idempotency-Key" },
51349
+ { in: "path", key: "project_id" },
51350
+ { key: "body", map: "body" }
51351
+ ]
51352
+ }
51353
+ ]);
51354
+ return (options?.client ?? client).post({
51355
+ responseStyle: "data",
51356
+ security: [{ scheme: "bearer", type: "http" }],
51357
+ url: "/v1/projects/{project_id}/environments/dev",
51358
+ ...options,
51359
+ ...params,
51360
+ headers: {
51361
+ "Content-Type": "application/json",
51362
+ ...options?.headers,
51363
+ ...params.headers
51364
+ }
51365
+ });
51366
+ };
50842
51367
  var getProjectStatus = (parameters, options) => {
50843
51368
  const params = buildClientParams([parameters], [
50844
51369
  {
@@ -51846,6 +52371,73 @@ var deleteProjectDatabaseWatch = (parameters, options) => {
51846
52371
  ...params
51847
52372
  });
51848
52373
  };
52374
+ var getDatabaseWebhookSubscription = (parameters, options) => {
52375
+ const params = buildClientParams([parameters], [
52376
+ {
52377
+ args: [
52378
+ { in: "headers", key: "X-Request-Id" },
52379
+ { in: "path", key: "project_id" },
52380
+ { in: "path", key: "subscription_id" },
52381
+ { in: "query", key: "environment" }
52382
+ ]
52383
+ }
52384
+ ]);
52385
+ return (options?.client ?? client).get({
52386
+ responseStyle: "data",
52387
+ security: [{ scheme: "bearer", type: "http" }],
52388
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}",
52389
+ ...options,
52390
+ ...params
52391
+ });
52392
+ };
52393
+ var deactivateDatabaseWebhookSubscription = (parameters, options) => {
52394
+ const params = buildClientParams([parameters], [
52395
+ {
52396
+ args: [
52397
+ { in: "headers", key: "X-Request-Id" },
52398
+ { in: "headers", key: "Idempotency-Key" },
52399
+ { in: "path", key: "project_id" },
52400
+ { in: "path", key: "subscription_id" },
52401
+ { in: "path", key: "generation" },
52402
+ { in: "query", key: "environment" }
52403
+ ]
52404
+ }
52405
+ ]);
52406
+ return (options?.client ?? client).delete({
52407
+ responseStyle: "data",
52408
+ security: [{ scheme: "bearer", type: "http" }],
52409
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
52410
+ ...options,
52411
+ ...params
52412
+ });
52413
+ };
52414
+ var activateDatabaseWebhookSubscription = (parameters, options) => {
52415
+ const params = buildClientParams([parameters], [
52416
+ {
52417
+ args: [
52418
+ { in: "headers", key: "X-Request-Id" },
52419
+ { in: "headers", key: "Idempotency-Key" },
52420
+ { in: "path", key: "project_id" },
52421
+ { in: "path", key: "subscription_id" },
52422
+ { in: "path", key: "generation" },
52423
+ { in: "query", key: "environment" },
52424
+ { key: "databaseWebhookCreateRequest", map: "body" }
52425
+ ]
52426
+ }
52427
+ ]);
52428
+ return (options?.client ?? client).put({
52429
+ responseStyle: "data",
52430
+ security: [{ scheme: "bearer", type: "http" }],
52431
+ url: "/v1/projects/{project_id}/database/webhook-subscriptions/{subscription_id}/activations/{generation}",
52432
+ ...options,
52433
+ ...params,
52434
+ headers: {
52435
+ "Content-Type": "application/json",
52436
+ ...options?.headers,
52437
+ ...params.headers
52438
+ }
52439
+ });
52440
+ };
51849
52441
  var listProjectDatabaseWebhooks = (parameters, options) => {
51850
52442
  const params = buildClientParams([parameters], [
51851
52443
  {
@@ -52452,6 +53044,25 @@ var prepareManagedMailWebhook = (parameters, options) => {
52452
53044
  }
52453
53045
  });
52454
53046
  };
53047
+ var rotateManagedMailWebhookSecret = (parameters, options) => {
53048
+ const params = buildClientParams([parameters], [
53049
+ {
53050
+ args: [
53051
+ { in: "headers", key: "X-Request-Id" },
53052
+ { in: "headers", key: "Idempotency-Key" },
53053
+ { in: "path", key: "project_id" },
53054
+ { in: "path", key: "environment_id" }
53055
+ ]
53056
+ }
53057
+ ]);
53058
+ return (options?.client ?? client).post({
53059
+ responseStyle: "data",
53060
+ security: [{ scheme: "bearer", type: "http" }],
53061
+ url: "/v1/projects/{project_id}/environments/{environment_id}/mail-webhook:rotate",
53062
+ ...options,
53063
+ ...params
53064
+ });
53065
+ };
52455
53066
  var verifyManagedMailWebhook = (parameters, options) => {
52456
53067
  const params = buildClientParams([parameters], [
52457
53068
  {
@@ -52628,6 +53239,13 @@ function assertManagedMailResponse(value, input) {
52628
53239
  }
52629
53240
  return;
52630
53241
  }
53242
+ if (input.action === "webhook_rotate") {
53243
+ exact5(r, ["url", "signing_secret", "status"]);
53244
+ https(r["url"]);
53245
+ if (r["status"] !== "verification_required" || typeof r["signing_secret"] !== "string" || !/^whsec_[A-Za-z0-9+/]{43}=$/u.test(r["signing_secret"]))
53246
+ invalid5();
53247
+ return;
53248
+ }
52631
53249
  if (input.action === "webhook_set") {
52632
53250
  exact5(r, ["url", "signing_secret", "status"]);
52633
53251
  if (r["url"] !== input.url || r["status"] !== "verification_required" || typeof r["signing_secret"] !== "string" || !/^whsec_[A-Za-z0-9+/]{43}=$/u.test(r["signing_secret"]))
@@ -52774,6 +53392,8 @@ function requestManagedMail(client2, input) {
52774
53392
  }, { client: client2 });
52775
53393
  case "webhook_verify":
52776
53394
  return verifyManagedMailWebhook({ ...scope, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
53395
+ case "webhook_rotate":
53396
+ return rotateManagedMailWebhookSecret({ ...scope, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
52777
53397
  case "webhook_disable":
52778
53398
  return disableManagedMailReceiving({ ...scope, "Idempotency-Key": input.idempotencyKey }, { client: client2 });
52779
53399
  case "domain_delete":
@@ -53594,6 +54214,48 @@ var GeneratedSdkProductApi = class {
53594
54214
  throw new TypeError(WEBHOOK_SCOPE_MISMATCH);
53595
54215
  return value;
53596
54216
  }
54217
+ async getDatabaseWebhookSubscription(input) {
54218
+ const value = await getDatabaseWebhookSubscription({
54219
+ project_id: input.projectId,
54220
+ environment: input.environment,
54221
+ subscription_id: input.subscriptionId
54222
+ }, { client: this.#client });
54223
+ assertDatabaseWebhookSubscription(value);
54224
+ if (value.id !== input.subscriptionId || value.environment !== input.environment)
54225
+ throw new TypeError(WEBHOOK_SCOPE_MISMATCH);
54226
+ return value;
54227
+ }
54228
+ async activateDatabaseWebhookSubscription(input) {
54229
+ const value = await activateDatabaseWebhookSubscription({
54230
+ project_id: input.projectId,
54231
+ environment: input.environment,
54232
+ subscription_id: input.subscriptionId,
54233
+ generation: input.generation,
54234
+ "Idempotency-Key": input.idempotencyKey,
54235
+ databaseWebhookCreateRequest: {
54236
+ ...input.request,
54237
+ event_types: [...input.request.event_types],
54238
+ headers: { ...input.request.headers }
54239
+ }
54240
+ }, { client: this.#client });
54241
+ assertDatabaseWebhookSubscriptionActivation(value);
54242
+ if (value.id !== input.subscriptionId || value.environment !== input.environment || value.generation !== input.generation)
54243
+ throw new TypeError(WEBHOOK_SCOPE_MISMATCH);
54244
+ return value;
54245
+ }
54246
+ async deactivateDatabaseWebhookSubscription(input) {
54247
+ const value = await deactivateDatabaseWebhookSubscription({
54248
+ project_id: input.projectId,
54249
+ environment: input.environment,
54250
+ subscription_id: input.subscriptionId,
54251
+ generation: input.generation,
54252
+ "Idempotency-Key": input.idempotencyKey
54253
+ }, { client: this.#client });
54254
+ assertDatabaseWebhookSubscription(value);
54255
+ if (value.id !== input.subscriptionId || value.environment !== input.environment || value.generation !== input.generation || value.state !== "inactive")
54256
+ throw new TypeError(WEBHOOK_SCOPE_MISMATCH);
54257
+ return value;
54258
+ }
53597
54259
  async listProjectDatabaseWebhooks(input) {
53598
54260
  const value = await listProjectDatabaseWebhooks({ project_id: input.projectId, environment: input.environment }, { client: this.#client });
53599
54261
  assertDatabaseWebhookPage(value);
@@ -53813,10 +54475,14 @@ var GeneratedSdkProductApi = class {
53813
54475
  name: input.name,
53814
54476
  ...input.dataMode === void 0 ? {} : { data_mode: input.dataMode },
53815
54477
  ...input.devAccessMode === void 0 ? {} : { dev_access_mode: input.devAccessMode },
54478
+ ...input.includeDevelopmentEnvironment === void 0 ? {} : { include_development_environment: input.includeDevelopmentEnvironment },
53816
54479
  ...input.region === void 0 ? {} : { region: input.region }
53817
54480
  }
53818
54481
  }, { client: this.#client });
53819
54482
  }
54483
+ async addProjectDevelopmentEnvironment(input) {
54484
+ return addProjectDevelopmentEnvironment({ project_id: input.projectId, "Idempotency-Key": input.idempotencyKey, body: {} }, { client: this.#client });
54485
+ }
53820
54486
  async getOperation(operationId) {
53821
54487
  return getOperation({ operation_id: operationId }, { client: this.#client });
53822
54488
  }
@@ -53836,6 +54502,15 @@ var GeneratedSdkProductApi = class {
53836
54502
  async getGithubConnection(organizationId) {
53837
54503
  return getGithubOrganizationConnection({ organization_id: organizationId }, { client: this.#client });
53838
54504
  }
54505
+ async disconnectGithub(organizationId) {
54506
+ return disconnectGithubOrganization({ organization_id: organizationId }, { client: this.#client });
54507
+ }
54508
+ async listOrganizationMcpConnections(organizationId) {
54509
+ return listOrganizationMcpConnections({ organization_id: organizationId }, { client: this.#client });
54510
+ }
54511
+ async revokeOrganizationMcpConnection(input) {
54512
+ return revokeOrganizationMcpConnection({ organization_id: input.organizationId, connection_id: input.connectionId }, { client: this.#client });
54513
+ }
53839
54514
  async linkSource(input) {
53840
54515
  return linkProjectSource({
53841
54516
  "Idempotency-Key": input.idempotencyKey,
@@ -53872,7 +54547,10 @@ var GeneratedSdkProductApi = class {
53872
54547
  async planDeployment(input) {
53873
54548
  return planDeployment({
53874
54549
  project_id: input.projectId,
53875
- planDeploymentRequest: { commit_sha: input.commitSha, environment: input.environment }
54550
+ planDeploymentRequest: {
54551
+ commit_sha: input.commitSha,
54552
+ ...input.environment === void 0 ? {} : { environment: input.environment }
54553
+ }
53876
54554
  }, { client: this.#client });
53877
54555
  }
53878
54556
  async createDeployment(input) {
@@ -53976,7 +54654,7 @@ var GeneratedSdkProductApi = class {
53976
54654
 
53977
54655
  // apps/product-cli/dist/repository-init.js
53978
54656
  import { createHash as createHash4 } from "node:crypto";
53979
- import { lstat as lstat2, open as open4, readFile as readFile3, readdir as readdir3, stat as stat2 } from "node:fs/promises";
54657
+ import { lstat as lstat3, open as open4, readFile as readFile3, readdir as readdir3, stat as stat2 } from "node:fs/promises";
53980
54658
  import { dirname as dirname3, posix, resolve as resolve5 } from "node:path";
53981
54659
 
53982
54660
  // packages/contracts/dist/application-root.js
@@ -54099,6 +54777,9 @@ var ohmyhost_schema_default = {
54099
54777
  },
54100
54778
  credits: {
54101
54779
  $ref: "#/$defs/credits"
54780
+ },
54781
+ browser: {
54782
+ $ref: "#/$defs/browserRendering"
54102
54783
  }
54103
54784
  },
54104
54785
  $defs: {
@@ -54143,6 +54824,10 @@ var ohmyhost_schema_default = {
54143
54824
  minimum: 1,
54144
54825
  maximum: 64,
54145
54826
  description: "Maximum private immutable Next.js prerender cache in MiB; defaults to 32. Cache storage costs zero credits. Public assets retain their independent limit."
54827
+ },
54828
+ next_revalidate_path: {
54829
+ type: "boolean",
54830
+ description: "Opt into deployment-scoped on-demand Next.js path revalidation."
54146
54831
  }
54147
54832
  }
54148
54833
  },
@@ -54437,6 +55122,16 @@ var ohmyhost_schema_default = {
54437
55122
  },
54438
55123
  required: ["threshold", "amount_usd_micros", "monthly_cap_usd_micros"]
54439
55124
  }
55125
+ },
55126
+ browserRendering: {
55127
+ type: "object",
55128
+ additionalProperties: false,
55129
+ required: ["enabled"],
55130
+ properties: {
55131
+ enabled: {
55132
+ type: "boolean"
55133
+ }
55134
+ }
54440
55135
  }
54441
55136
  },
54442
55137
  allOf: [
@@ -54490,6 +55185,9 @@ var ohmyhost_schema_default = {
54490
55185
  },
54491
55186
  ssg_cache_max_mib: {
54492
55187
  $ref: "#/$defs/build/properties/ssg_cache_max_mib"
55188
+ },
55189
+ next_revalidate_path: {
55190
+ $ref: "#/$defs/build/properties/next_revalidate_path"
54493
55191
  }
54494
55192
  }
54495
55193
  }
@@ -54631,7 +55329,8 @@ function parseOhmyhostConfig(value) {
54631
55329
  install: input.build.install,
54632
55330
  command: input.build.command,
54633
55331
  output: input.build.output,
54634
- ...input.build.ssg_cache_max_mib === void 0 ? {} : { ssg_cache_max_mib: input.build.ssg_cache_max_mib }
55332
+ ...input.build.ssg_cache_max_mib === void 0 ? {} : { ssg_cache_max_mib: input.build.ssg_cache_max_mib },
55333
+ ...input.build.next_revalidate_path === true ? { next_revalidate_path: true } : {}
54635
55334
  }),
54636
55335
  runtime: Object.freeze({
54637
55336
  mode: input.runtime.mode,
@@ -54662,6 +55361,7 @@ function parseOhmyhostConfig(value) {
54662
55361
  ...input.ai.jurisdiction === void 0 ? {} : { jurisdiction: input.ai.jurisdiction }
54663
55362
  })
54664
55363
  },
55364
+ ...input.browser === void 0 ? {} : { browser: Object.freeze({ enabled: input.browser.enabled }) },
54665
55365
  ...input.functions === void 0 ? {} : {
54666
55366
  functions: Object.freeze({ crons: normalizeCrons(input.functions.crons) })
54667
55367
  },
@@ -54865,7 +55565,7 @@ function declaredDependencyNames(manifest2) {
54865
55565
  return names;
54866
55566
  }
54867
55567
  function viteCompanionRequired(configuration) {
54868
- return configuration.runtime.mode === "edge" || configuration.database?.enabled === true || configuration.auth?.provider === "better-auth" || configuration.mail?.enabled === true || configuration.ai?.enabled === true || configuration.storage !== void 0 || (configuration.functions?.crons.length ?? 0) > 0;
55568
+ return configuration.runtime.mode === "edge" || configuration.database?.enabled === true || configuration.auth?.provider === "better-auth" || configuration.mail?.enabled === true || configuration.ai?.enabled === true || configuration.browser?.enabled === true || configuration.storage !== void 0 || (configuration.functions?.crons.length ?? 0) > 0;
54869
55569
  }
54870
55570
  function frameworkVersionAdmissions(framework, manifest2, lockfile) {
54871
55571
  const admissions = [];
@@ -55119,7 +55819,7 @@ function configurationFindings(input) {
55119
55819
  }
55120
55820
  if (framework !== "functions" && !runtimeModeAdmitted(framework, configuration, crons))
55121
55821
  findings.push(diagnostic({ code: "runtime_mode_unsupported", path: REPOSITORY_CONFIG, framework }));
55122
- if (build !== null && framework !== "nextjs" && build.ssg_cache_max_mib !== void 0)
55822
+ if (build !== null && framework !== "nextjs" && (build.ssg_cache_max_mib !== void 0 || build.next_revalidate_path === true))
55123
55823
  findings.push(diagnostic({ code: "build_option_unsupported", path: REPOSITORY_CONFIG }));
55124
55824
  const output = framework === "astro" ? configuration.runtime.mode === "edge" ? "dist/client" : "dist" : BUILD_OUTPUTS[framework];
55125
55825
  if (build !== null && output !== void 0 && build.output !== output)
@@ -55137,12 +55837,12 @@ function configurationFindings(input) {
55137
55837
  function runtimeModeAdmitted(framework, configuration, crons) {
55138
55838
  const mode = configuration.runtime.mode;
55139
55839
  if (framework === "astro")
55140
- return mode === "edge" || mode === "static" && !crons && configuration.storage === void 0 && configuration.database?.enabled !== true && configuration.mail?.enabled !== true && configuration.ai?.enabled !== true && configuration.auth?.provider !== "better-auth";
55840
+ return mode === "edge" || mode === "static" && !crons && configuration.storage === void 0 && configuration.database?.enabled !== true && configuration.mail?.enabled !== true && configuration.ai?.enabled !== true && configuration.browser?.enabled !== true && configuration.auth?.provider !== "better-auth";
55141
55841
  if (framework === "nextjs")
55142
55842
  return mode === "edge";
55143
55843
  if (framework === "vite-static")
55144
55844
  return mode === (viteCompanionRequired(configuration) ? "edge" : "static");
55145
- return mode === "edge" || mode === "static" && !crons && configuration.storage === void 0 && configuration.ai?.enabled !== true;
55845
+ return mode === "edge" || mode === "static" && !crons && configuration.storage === void 0 && configuration.ai?.enabled !== true && configuration.browser?.enabled !== true;
55146
55846
  }
55147
55847
  function betterAuthFindings(configuration, manifest2) {
55148
55848
  return configuration.auth?.provider === "better-auth" && declaredDependency(manifest2, "better-auth", "any") !== MANAGED_BETTER_AUTH_VERSION ? [diagnostic({ code: "better_auth_version_required", path: PACKAGE_MANIFEST2 })] : [];
@@ -56062,6 +56762,10 @@ var MAIL_RUNTIME_BINDINGS = Object.freeze([
56062
56762
  "OHMYHOST_PROJECT_ID"
56063
56763
  ]);
56064
56764
  var AI_RUNTIME_BINDINGS = Object.freeze(["OHMYHOST_AI_BASE_URL", "OHMYHOST_AI_KEY"]);
56765
+ var BROWSER_RUNTIME_BINDINGS = Object.freeze([
56766
+ "OHMYHOST_BROWSER_BASE_URL",
56767
+ "OHMYHOST_BROWSER_KEY"
56768
+ ]);
56065
56769
  var CUSTOMER_RUNTIME_SOURCE = `npm:@amerged/ohmyhost-runtime@${package_default.version}`;
56066
56770
  var PENDING_CHECKS = Object.freeze({
56067
56771
  installed_version: "compatibility.frameworks lists a version range that no lockfile ohmyho.st reads (package-lock.json v2/v3 or pnpm-lock.yaml v6/v9) resolves. Planning admits it; after the frozen install, the build checks the installed version against the same security minimum.",
@@ -56156,6 +56860,7 @@ async function initializeRepository(input) {
56156
56860
  const targetBetterAuth = existingConfiguration?.auth?.provider === "better-auth";
56157
56861
  const targetMail = existingConfiguration?.mail?.enabled === true;
56158
56862
  const targetAi = existingConfiguration?.ai?.enabled === true;
56863
+ const targetBrowser = existingConfiguration?.browser?.enabled === true;
56159
56864
  const targetStorage = r2 || supabaseStorage;
56160
56865
  const tanStackRuntime = framework !== "tanstack-start" && framework !== "astro" ? null : targetStorage ? "edge" : framework === "astro" ? dependencies.has("@astrojs/cloudflare") ? "edge" : "static" : proposedTanStackRuntime(frameworkConfig, dependencies);
56161
56866
  const companionRequired = framework === "vite" && (existingConfiguration === null ? databaseProvider !== "none" || targetBetterAuth || targetMail || targetStorage || edgeFunctionNames.size > 0 || applicationFiles.includes(VITE_COMPANION_ENTRY_PATH) : viteCompanionRequired(existingConfiguration));
@@ -56179,6 +56884,7 @@ async function initializeRepository(input) {
56179
56884
  auth: targetBetterAuth,
56180
56885
  mail: targetMail,
56181
56886
  ai: targetAi,
56887
+ browser: targetBrowser,
56182
56888
  storage: targetStorage
56183
56889
  });
56184
56890
  const companion = companionRequired ? viteCompanionScaffold(applicationFiles, capabilities) : null;
@@ -56693,7 +57399,7 @@ async function hasDirectApplicationShape(repositoryRoot, repositoryFiles, applic
56693
57399
  }
56694
57400
  async function isRealDirectory(path2) {
56695
57401
  try {
56696
- const information = await lstat2(path2);
57402
+ const information = await lstat3(path2);
56697
57403
  return information.isDirectory() && !information.isSymbolicLink();
56698
57404
  } catch {
56699
57405
  return false;
@@ -56721,7 +57427,7 @@ function hasDirectSafeBuildCommand(manifest2, framework) {
56721
57427
  async function assertRepositoryRoot(root) {
56722
57428
  let information;
56723
57429
  try {
56724
- information = await lstat2(root);
57430
+ information = await lstat3(root);
56725
57431
  } catch {
56726
57432
  throw new RepositoryInitError("repository_not_found", "Repository directory does not exist");
56727
57433
  }
@@ -56734,7 +57440,7 @@ async function assertRepositoryRoot(root) {
56734
57440
  for (let ancestor = root; ; ancestor = dirname3(ancestor)) {
56735
57441
  let marker;
56736
57442
  try {
56737
- marker = await lstat2(resolve5(ancestor, ".git"));
57443
+ marker = await lstat3(resolve5(ancestor, ".git"));
56738
57444
  } catch (error) {
56739
57445
  if (error.code !== "ENOENT") {
56740
57446
  throw new RepositoryInitError("repository_unreadable", "Could not determine the Git repository root");
@@ -56987,7 +57693,8 @@ function runtimeContract(capabilities) {
56987
57693
  ...capabilities.storage ? STORAGE_RUNTIME_BINDINGS : [],
56988
57694
  ...capabilities.database ? ["OHMYHOST_DATABASE"] : [],
56989
57695
  ...capabilities.mail ? MAIL_RUNTIME_BINDINGS : [],
56990
- ...capabilities.ai ? AI_RUNTIME_BINDINGS : []
57696
+ ...capabilities.ai ? AI_RUNTIME_BINDINGS : [],
57697
+ ...capabilities.browser ? BROWSER_RUNTIME_BINDINGS : []
56991
57698
  ])
56992
57699
  ].sort()),
56993
57700
  packages: Object.freeze({
@@ -58585,6 +59292,7 @@ export {
58585
59292
  parsePaidDomainPlan,
58586
59293
  parsePaidDomain,
58587
59294
  parseCloudflareDnsAuthorization,
59295
+ parseGithubDisconnection,
58588
59296
  parseCloudflareDnsAuthorizationStatus,
58589
59297
  parseDevAccessState,
58590
59298
  parsePoweredByFlag,
@@ -58604,6 +59312,8 @@ export {
58604
59312
  completeLocalSourcePublication,
58605
59313
  inspectLocalSourcePublications,
58606
59314
  UserTokenFileError,
59315
+ PrivateSecretFileError,
59316
+ preparePrivateSecretFile,
58607
59317
  prepareUserTokenFile,
58608
59318
  ProfileNameConflictError,
58609
59319
  ProfileLimitError,
@@ -58651,6 +59361,7 @@ export {
58651
59361
  ProductCli,
58652
59362
  ACCOUNT_SENSITIVE_PROBLEMS,
58653
59363
  classifyCliFailure,
59364
+ readPrivateWebhookCreateRequest,
58654
59365
  executeNativeAuth,
58655
59366
  GeneratedSdkManagedSourceApi,
58656
59367
  assertDatabaseTableAnswer,