@superblocksteam/cli 2.0.142-next.0 → 2.0.142-next.2

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 (107) hide show
  1. package/README.md +1 -1
  2. package/dist/{acorn-5ISNX2MF.js → acorn-GSO23EEG.js} +3 -3
  3. package/dist/{angular-O6AH53X4.js → angular-ZHRDU23D.js} +3 -3
  4. package/dist/{api-AE5SDDID.js → api-MNZPLV4E.js} +4 -4
  5. package/dist/{babel-ZCWHS6EQ.js → babel-ZSNVX2PZ.js} +3 -3
  6. package/dist/{chunk-LSTCUVK2.js → chunk-3ZQFAYXS.js} +3 -3
  7. package/dist/{chunk-DKR5EWDW.js → chunk-4L5E7Q4C.js} +3 -3
  8. package/dist/{chunk-S55DRBPL.js → chunk-AT4BZSJH.js} +3 -3
  9. package/dist/{chunk-6ZW6DTXI.js → chunk-ATL4D4HA.js} +3 -3
  10. package/dist/{chunk-ETJRIT6Q.js → chunk-BTV5BL4N.js} +3 -3
  11. package/dist/{chunk-TQTWTZU7.js → chunk-CMNID6AS.js} +601 -305
  12. package/dist/{chunk-TQTWTZU7.js.map → chunk-CMNID6AS.js.map} +1 -1
  13. package/dist/{chunk-42WPKUJT.js → chunk-D34GVF2A.js} +4 -4
  14. package/dist/{chunk-HVUP6YRD.js → chunk-FU7IUUUK.js} +3 -3
  15. package/dist/{chunk-XHQN4NXE.js → chunk-GF5YQYAT.js} +4 -4
  16. package/dist/{chunk-45TKZK6W.js → chunk-HG2AQL6V.js} +4 -4
  17. package/dist/{chunk-RDYWEXME.js → chunk-IQ2YJIET.js} +3 -3
  18. package/dist/{chunk-TXGWVXL6.js → chunk-JVSS6SZH.js} +3 -3
  19. package/dist/{chunk-FXRQCAWN.js → chunk-KX2ALRUY.js} +6 -6
  20. package/dist/{chunk-HHOHQYKG.js → chunk-L6JIORBN.js} +3 -3
  21. package/dist/{chunk-42G3CDZT.js → chunk-R426MZT7.js} +2 -2
  22. package/dist/{chunk-ER52HKMJ.js → chunk-UA7AEZBX.js} +3 -3
  23. package/dist/{chunk-N5HHYEKV.js → chunk-Z3XFEWDW.js} +4 -4
  24. package/dist/{chunk-2CCEUUHR.js → chunk-ZC4PRPXI.js} +6 -6
  25. package/dist/{cli-truncate-5O73W6LK.js → cli-truncate-NVDPTRIU.js} +5 -5
  26. package/dist/commands/dev-parent.js +3 -3
  27. package/dist/{dd-trace-AR2756K7.js → dd-trace-6WP6ICAN.js} +7 -7
  28. package/dist/{dist-FDHWUQF5.js → dist-XTJLE2MK.js} +14 -14
  29. package/dist/{embedded-playwright-mcp-server-IB6ZRN45.js → embedded-playwright-mcp-server-UZV5UV7C.js} +3 -3
  30. package/dist/{enquirer-2WXLKL6B.js → enquirer-WLYDPTPH.js} +4 -4
  31. package/dist/{estree-CAYUOQBQ.js → estree-CBQZDSXJ.js} +3 -3
  32. package/dist/{flow-OXBFZA6O.js → flow-S3H3Y74D.js} +3 -3
  33. package/dist/{getMachineId-bsd-SNG6ZPCH.js → getMachineId-bsd-GF5JGAJM.js} +5 -5
  34. package/dist/{getMachineId-darwin-ZVQM5NBT.js → getMachineId-darwin-WRUNLH62.js} +5 -5
  35. package/dist/{getMachineId-linux-AHW4ADGP.js → getMachineId-linux-YACRTTHO.js} +4 -4
  36. package/dist/{getMachineId-unsupported-SHNJ2HMG.js → getMachineId-unsupported-YUCBAVFM.js} +4 -4
  37. package/dist/{getMachineId-win-RLT2QM63.js → getMachineId-win-UYZPCZAW.js} +5 -5
  38. package/dist/{glimmer-5XUQEU3N.js → glimmer-WTH53HRW.js} +3 -3
  39. package/dist/{graphql-F6OICFXZ.js → graphql-PODLQZYP.js} +3 -3
  40. package/dist/{html-BFYHSX7V.js → html-SUAQB3PV.js} +3 -3
  41. package/dist/{http-PHA5VWF5.js → http-E5JTLOG7.js} +13 -13
  42. package/dist/index.js +19 -19
  43. package/dist/{jiti-7NQA6EIF.js → jiti-ZYIUTG3C.js} +3 -3
  44. package/dist/{log-update-VJZHSULW.js → log-update-N5PIJ2UR.js} +6 -6
  45. package/dist/{markdown-XMQ7A2L7.js → markdown-LMLFITGX.js} +3 -3
  46. package/dist/{meriyah-BM2JQ6C3.js → meriyah-K62VQEL5.js} +3 -3
  47. package/dist/{postcss-R3X7PEXV.js → postcss-SRWVCB56.js} +3 -3
  48. package/dist/{read-pkg-YSXIPKFE.js → read-pkg-PGWLINNT.js} +5 -5
  49. package/dist/{spans-VP4ANRE4.js → spans-YUASCP6K.js} +4 -4
  50. package/dist/{src-JTYX334G.js → src-HQGEFTJ3.js} +3 -3
  51. package/dist/{token-E3LBBH4N.js → token-342EBOW2.js} +5 -5
  52. package/dist/{token-util-SBIQNSCU.js → token-util-MH4U2T5O.js} +5 -5
  53. package/dist/{typescript-K5K6KZAA.js → typescript-F65AOVRT.js} +3 -3
  54. package/dist/{wrap-ansi-EMA5EOUB.js → wrap-ansi-KX3WHOQH.js} +5 -5
  55. package/dist/{yaml-UZZWIT6V.js → yaml-FXHOCIJS.js} +3 -3
  56. package/oclif.manifest.json +1 -1
  57. package/package.json +6 -6
  58. /package/dist/{acorn-5ISNX2MF.js.map → acorn-GSO23EEG.js.map} +0 -0
  59. /package/dist/{angular-O6AH53X4.js.map → angular-ZHRDU23D.js.map} +0 -0
  60. /package/dist/{api-AE5SDDID.js.map → api-MNZPLV4E.js.map} +0 -0
  61. /package/dist/{babel-ZCWHS6EQ.js.map → babel-ZSNVX2PZ.js.map} +0 -0
  62. /package/dist/{chunk-LSTCUVK2.js.map → chunk-3ZQFAYXS.js.map} +0 -0
  63. /package/dist/{chunk-DKR5EWDW.js.map → chunk-4L5E7Q4C.js.map} +0 -0
  64. /package/dist/{chunk-S55DRBPL.js.map → chunk-AT4BZSJH.js.map} +0 -0
  65. /package/dist/{chunk-6ZW6DTXI.js.map → chunk-ATL4D4HA.js.map} +0 -0
  66. /package/dist/{chunk-ETJRIT6Q.js.map → chunk-BTV5BL4N.js.map} +0 -0
  67. /package/dist/{chunk-42WPKUJT.js.map → chunk-D34GVF2A.js.map} +0 -0
  68. /package/dist/{chunk-HVUP6YRD.js.map → chunk-FU7IUUUK.js.map} +0 -0
  69. /package/dist/{chunk-XHQN4NXE.js.map → chunk-GF5YQYAT.js.map} +0 -0
  70. /package/dist/{chunk-45TKZK6W.js.map → chunk-HG2AQL6V.js.map} +0 -0
  71. /package/dist/{chunk-RDYWEXME.js.map → chunk-IQ2YJIET.js.map} +0 -0
  72. /package/dist/{chunk-TXGWVXL6.js.map → chunk-JVSS6SZH.js.map} +0 -0
  73. /package/dist/{chunk-FXRQCAWN.js.map → chunk-KX2ALRUY.js.map} +0 -0
  74. /package/dist/{chunk-HHOHQYKG.js.map → chunk-L6JIORBN.js.map} +0 -0
  75. /package/dist/{chunk-42G3CDZT.js.map → chunk-R426MZT7.js.map} +0 -0
  76. /package/dist/{chunk-ER52HKMJ.js.map → chunk-UA7AEZBX.js.map} +0 -0
  77. /package/dist/{chunk-N5HHYEKV.js.map → chunk-Z3XFEWDW.js.map} +0 -0
  78. /package/dist/{chunk-2CCEUUHR.js.map → chunk-ZC4PRPXI.js.map} +0 -0
  79. /package/dist/{cli-truncate-5O73W6LK.js.map → cli-truncate-NVDPTRIU.js.map} +0 -0
  80. /package/dist/{dd-trace-AR2756K7.js.map → dd-trace-6WP6ICAN.js.map} +0 -0
  81. /package/dist/{dist-FDHWUQF5.js.map → dist-XTJLE2MK.js.map} +0 -0
  82. /package/dist/{embedded-playwright-mcp-server-IB6ZRN45.js.map → embedded-playwright-mcp-server-UZV5UV7C.js.map} +0 -0
  83. /package/dist/{enquirer-2WXLKL6B.js.map → enquirer-WLYDPTPH.js.map} +0 -0
  84. /package/dist/{estree-CAYUOQBQ.js.map → estree-CBQZDSXJ.js.map} +0 -0
  85. /package/dist/{flow-OXBFZA6O.js.map → flow-S3H3Y74D.js.map} +0 -0
  86. /package/dist/{getMachineId-bsd-SNG6ZPCH.js.map → getMachineId-bsd-GF5JGAJM.js.map} +0 -0
  87. /package/dist/{getMachineId-darwin-ZVQM5NBT.js.map → getMachineId-darwin-WRUNLH62.js.map} +0 -0
  88. /package/dist/{getMachineId-linux-AHW4ADGP.js.map → getMachineId-linux-YACRTTHO.js.map} +0 -0
  89. /package/dist/{getMachineId-unsupported-SHNJ2HMG.js.map → getMachineId-unsupported-YUCBAVFM.js.map} +0 -0
  90. /package/dist/{getMachineId-win-RLT2QM63.js.map → getMachineId-win-UYZPCZAW.js.map} +0 -0
  91. /package/dist/{glimmer-5XUQEU3N.js.map → glimmer-WTH53HRW.js.map} +0 -0
  92. /package/dist/{graphql-F6OICFXZ.js.map → graphql-PODLQZYP.js.map} +0 -0
  93. /package/dist/{html-BFYHSX7V.js.map → html-SUAQB3PV.js.map} +0 -0
  94. /package/dist/{http-PHA5VWF5.js.map → http-E5JTLOG7.js.map} +0 -0
  95. /package/dist/{jiti-7NQA6EIF.js.map → jiti-ZYIUTG3C.js.map} +0 -0
  96. /package/dist/{log-update-VJZHSULW.js.map → log-update-N5PIJ2UR.js.map} +0 -0
  97. /package/dist/{markdown-XMQ7A2L7.js.map → markdown-LMLFITGX.js.map} +0 -0
  98. /package/dist/{meriyah-BM2JQ6C3.js.map → meriyah-K62VQEL5.js.map} +0 -0
  99. /package/dist/{postcss-R3X7PEXV.js.map → postcss-SRWVCB56.js.map} +0 -0
  100. /package/dist/{read-pkg-YSXIPKFE.js.map → read-pkg-PGWLINNT.js.map} +0 -0
  101. /package/dist/{spans-VP4ANRE4.js.map → spans-YUASCP6K.js.map} +0 -0
  102. /package/dist/{src-JTYX334G.js.map → src-HQGEFTJ3.js.map} +0 -0
  103. /package/dist/{token-E3LBBH4N.js.map → token-342EBOW2.js.map} +0 -0
  104. /package/dist/{token-util-SBIQNSCU.js.map → token-util-MH4U2T5O.js.map} +0 -0
  105. /package/dist/{typescript-K5K6KZAA.js.map → typescript-F65AOVRT.js.map} +0 -0
  106. /package/dist/{wrap-ansi-EMA5EOUB.js.map → wrap-ansi-KX3WHOQH.js.map} +0 -0
  107. /package/dist/{yaml-UZZWIT6V.js.map → yaml-FXHOCIJS.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  if (typeof process === 'object' && process !== null &&
2
2
  process.env !== null && typeof process.env === 'object') {
3
3
  process.env.DD_GIT_REPOSITORY_URL = 'https://token@github.com/superblocksteam/superblocks.git';
4
- process.env.DD_GIT_COMMIT_SHA = '238ffafe56481afd68e4a6b196c2fa222e168bdf';
4
+ process.env.DD_GIT_COMMIT_SHA = '52f1e7a2c8429d93bf5498ef5aa3b18a844b1d12';
5
5
  }
6
6
  import { createRequire as $dd_createRequire } from 'module';
7
7
  import { fileURLToPath as $dd_fileURLToPath } from 'url';
@@ -15,7 +15,7 @@ import {
15
15
  require_lib as require_lib2,
16
16
  require_lib2 as require_lib3,
17
17
  require_picocolors
18
- } from "./chunk-HHOHQYKG.js";
18
+ } from "./chunk-L6JIORBN.js";
19
19
  import {
20
20
  debounce_default,
21
21
  get_default,
@@ -32,20 +32,20 @@ import {
32
32
  require_lib,
33
33
  require_slugify,
34
34
  throttle_default
35
- } from "./chunk-S55DRBPL.js";
35
+ } from "./chunk-AT4BZSJH.js";
36
36
  import {
37
37
  require_dd_trace,
38
38
  require_js_yaml,
39
39
  require_module_details_from_path,
40
40
  require_p_limit,
41
41
  require_path_to_regexp
42
- } from "./chunk-FXRQCAWN.js";
42
+ } from "./chunk-KX2ALRUY.js";
43
43
  import {
44
44
  require_commonjs
45
- } from "./chunk-ETJRIT6Q.js";
45
+ } from "./chunk-BTV5BL4N.js";
46
46
  import {
47
47
  require_dc_polyfill
48
- } from "./chunk-DKR5EWDW.js";
48
+ } from "./chunk-4L5E7Q4C.js";
49
49
  import {
50
50
  ATTR_SUPERBLOCKS_BASE_URL,
51
51
  ATTR_SUPERBLOCKS_CSB_ID,
@@ -54,10 +54,10 @@ import {
54
54
  SERVICE_NAME,
55
55
  getEnvironmentFromHostname,
56
56
  otlpBaseUrl
57
- } from "./chunk-RDYWEXME.js";
57
+ } from "./chunk-IQ2YJIET.js";
58
58
  import {
59
59
  require_token_error
60
- } from "./chunk-6ZW6DTXI.js";
60
+ } from "./chunk-ATL4D4HA.js";
61
61
  import {
62
62
  ROOT_CONTEXT,
63
63
  SpanKind,
@@ -70,7 +70,7 @@ import {
70
70
  metrics,
71
71
  propagation,
72
72
  trace
73
- } from "./chunk-TXGWVXL6.js";
73
+ } from "./chunk-JVSS6SZH.js";
74
74
  import {
75
75
  __commonJS,
76
76
  __esm,
@@ -79,7 +79,7 @@ import {
79
79
  __toCommonJS,
80
80
  __toESM,
81
81
  init_cjs_shims
82
- } from "./chunk-42G3CDZT.js";
82
+ } from "./chunk-R426MZT7.js";
83
83
 
84
84
  // ../../../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
85
85
  var require_constants2 = __commonJS({
@@ -5502,7 +5502,7 @@ var require_lodash = __commonJS({
5502
5502
  }
5503
5503
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
5504
5504
  });
5505
- function join45(array3, separator) {
5505
+ function join46(array3, separator) {
5506
5506
  return array3 == null ? "" : nativeJoin.call(array3, separator);
5507
5507
  }
5508
5508
  function last3(array3) {
@@ -7426,7 +7426,7 @@ var require_lodash = __commonJS({
7426
7426
  lodash.isUndefined = isUndefined2;
7427
7427
  lodash.isWeakMap = isWeakMap;
7428
7428
  lodash.isWeakSet = isWeakSet;
7429
- lodash.join = join45;
7429
+ lodash.join = join46;
7430
7430
  lodash.kebabCase = kebabCase;
7431
7431
  lodash.last = last3;
7432
7432
  lodash.lastIndexOf = lastIndexOf;
@@ -38426,7 +38426,7 @@ var require_quota_paywall = __commonJS({
38426
38426
  exports.AI_QUOTA_PAYWALL_REASON_CONFIG = {
38427
38427
  credit_limit_exceeded: {
38428
38428
  title: "Your organization has reached its AI usage limit",
38429
- subtitle: "Ask your admin to purchase additional AI credits to continue using Clark AI."
38429
+ subtitle: "Ask your admin to purchase additional GAUs to continue using Clark AI."
38430
38430
  },
38431
38431
  no_seat_assigned: {
38432
38432
  title: "You don't have an AI Builder license",
@@ -38464,11 +38464,11 @@ var require_quota_paywall = __commonJS({
38464
38464
  exports.AI_QUOTA_PAYWALL_MIN_SEATS = 1;
38465
38465
  exports.AI_QUOTA_PAYWALL_MAX_SEATS = 100;
38466
38466
  exports.AI_QUOTA_PAYWALL_TEAMS_FEATURES = [
38467
- "100 AI Credits per AI Builder / month",
38468
- "Org-level credit top-ups, shared across team",
38467
+ "100 GAUs per AI Builder / month",
38468
+ "Org-level GAU top-ups, shared across team",
38469
38469
  "Clark AI agent for app building",
38470
38470
  "Clark User Memory",
38471
- "AI Credit Packs add-on available"
38471
+ "GAU Packs add-on available"
38472
38472
  ];
38473
38473
  exports.AI_QUOTA_PAYWALL_ENTERPRISE_FEATURES = [
38474
38474
  "Clark Integration and Organization memory",
@@ -98056,15 +98056,15 @@ var require_api_files = __commonJS({
98056
98056
  exports.readAppApiYamlFile = readAppApiYamlFile4;
98057
98057
  exports.resolveLanguageSpecificStepContentFromBlocks = resolveLanguageSpecificStepContentFromBlocks2;
98058
98058
  async function writeApiFiles3(...args) {
98059
- const esmFunction = await import("./api-AE5SDDID.js");
98059
+ const esmFunction = await import("./api-MNZPLV4E.js");
98060
98060
  return esmFunction.writeApiFiles(...args);
98061
98061
  }
98062
98062
  async function readAppApiYamlFile4(...args) {
98063
- const esmFunction = await import("./api-AE5SDDID.js");
98063
+ const esmFunction = await import("./api-MNZPLV4E.js");
98064
98064
  return esmFunction.readAppApiYamlFile(...args);
98065
98065
  }
98066
98066
  async function resolveLanguageSpecificStepContentFromBlocks2(...args) {
98067
- const esmFunction = await import("./api-AE5SDDID.js");
98067
+ const esmFunction = await import("./api-MNZPLV4E.js");
98068
98068
  return esmFunction.resolveLanguageSpecificStepContentFromBlocks(...args);
98069
98069
  }
98070
98070
  }
@@ -104752,19 +104752,19 @@ var require_getMachineId = __commonJS({
104752
104752
  if (!getMachineIdImpl) {
104753
104753
  switch (process5.platform) {
104754
104754
  case "darwin":
104755
- getMachineIdImpl = (await import("./getMachineId-darwin-ZVQM5NBT.js")).getMachineId;
104755
+ getMachineIdImpl = (await import("./getMachineId-darwin-WRUNLH62.js")).getMachineId;
104756
104756
  break;
104757
104757
  case "linux":
104758
- getMachineIdImpl = (await import("./getMachineId-linux-AHW4ADGP.js")).getMachineId;
104758
+ getMachineIdImpl = (await import("./getMachineId-linux-YACRTTHO.js")).getMachineId;
104759
104759
  break;
104760
104760
  case "freebsd":
104761
- getMachineIdImpl = (await import("./getMachineId-bsd-SNG6ZPCH.js")).getMachineId;
104761
+ getMachineIdImpl = (await import("./getMachineId-bsd-GF5JGAJM.js")).getMachineId;
104762
104762
  break;
104763
104763
  case "win32":
104764
- getMachineIdImpl = (await import("./getMachineId-win-RLT2QM63.js")).getMachineId;
104764
+ getMachineIdImpl = (await import("./getMachineId-win-UYZPCZAW.js")).getMachineId;
104765
104765
  break;
104766
104766
  default:
104767
- getMachineIdImpl = (await import("./getMachineId-unsupported-SHNJ2HMG.js")).getMachineId;
104767
+ getMachineIdImpl = (await import("./getMachineId-unsupported-YUCBAVFM.js")).getMachineId;
104768
104768
  break;
104769
104769
  }
104770
104770
  }
@@ -154337,7 +154337,7 @@ var require_safe_stable_stringify = __commonJS({
154337
154337
  return circularValue;
154338
154338
  }
154339
154339
  let res = "";
154340
- let join45 = ",";
154340
+ let join46 = ",";
154341
154341
  const originalIndentation = indentation2;
154342
154342
  if (Array.isArray(value2)) {
154343
154343
  if (value2.length === 0) {
@@ -154351,7 +154351,7 @@ var require_safe_stable_stringify = __commonJS({
154351
154351
  indentation2 += spacer;
154352
154352
  res += `
154353
154353
  ${indentation2}`;
154354
- join45 = `,
154354
+ join46 = `,
154355
154355
  ${indentation2}`;
154356
154356
  }
154357
154357
  const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
@@ -154359,13 +154359,13 @@ ${indentation2}`;
154359
154359
  for (; i2 < maximumValuesToStringify - 1; i2++) {
154360
154360
  const tmp2 = stringifyFnReplacer(String(i2), value2, stack2, replacer, spacer, indentation2);
154361
154361
  res += tmp2 !== void 0 ? tmp2 : "null";
154362
- res += join45;
154362
+ res += join46;
154363
154363
  }
154364
154364
  const tmp = stringifyFnReplacer(String(i2), value2, stack2, replacer, spacer, indentation2);
154365
154365
  res += tmp !== void 0 ? tmp : "null";
154366
154366
  if (value2.length - 1 > maximumBreadth) {
154367
154367
  const removedKeys = value2.length - maximumBreadth - 1;
154368
- res += `${join45}"... ${getItemCount(removedKeys)} not stringified"`;
154368
+ res += `${join46}"... ${getItemCount(removedKeys)} not stringified"`;
154369
154369
  }
154370
154370
  if (spacer !== "") {
154371
154371
  res += `
@@ -154386,7 +154386,7 @@ ${originalIndentation}`;
154386
154386
  let separator = "";
154387
154387
  if (spacer !== "") {
154388
154388
  indentation2 += spacer;
154389
- join45 = `,
154389
+ join46 = `,
154390
154390
  ${indentation2}`;
154391
154391
  whitespace2 = " ";
154392
154392
  }
@@ -154400,13 +154400,13 @@ ${indentation2}`;
154400
154400
  const tmp = stringifyFnReplacer(key3, value2, stack2, replacer, spacer, indentation2);
154401
154401
  if (tmp !== void 0) {
154402
154402
  res += `${separator}${strEscape(key3)}:${whitespace2}${tmp}`;
154403
- separator = join45;
154403
+ separator = join46;
154404
154404
  }
154405
154405
  }
154406
154406
  if (keyLength > maximumBreadth) {
154407
154407
  const removedKeys = keyLength - maximumBreadth;
154408
154408
  res += `${separator}"...":${whitespace2}"${getItemCount(removedKeys)} not stringified"`;
154409
- separator = join45;
154409
+ separator = join46;
154410
154410
  }
154411
154411
  if (spacer !== "" && separator.length > 1) {
154412
154412
  res = `
@@ -154447,7 +154447,7 @@ ${originalIndentation}`;
154447
154447
  }
154448
154448
  const originalIndentation = indentation2;
154449
154449
  let res = "";
154450
- let join45 = ",";
154450
+ let join46 = ",";
154451
154451
  if (Array.isArray(value2)) {
154452
154452
  if (value2.length === 0) {
154453
154453
  return "[]";
@@ -154460,7 +154460,7 @@ ${originalIndentation}`;
154460
154460
  indentation2 += spacer;
154461
154461
  res += `
154462
154462
  ${indentation2}`;
154463
- join45 = `,
154463
+ join46 = `,
154464
154464
  ${indentation2}`;
154465
154465
  }
154466
154466
  const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
@@ -154468,13 +154468,13 @@ ${indentation2}`;
154468
154468
  for (; i2 < maximumValuesToStringify - 1; i2++) {
154469
154469
  const tmp2 = stringifyArrayReplacer(String(i2), value2[i2], stack2, replacer, spacer, indentation2);
154470
154470
  res += tmp2 !== void 0 ? tmp2 : "null";
154471
- res += join45;
154471
+ res += join46;
154472
154472
  }
154473
154473
  const tmp = stringifyArrayReplacer(String(i2), value2[i2], stack2, replacer, spacer, indentation2);
154474
154474
  res += tmp !== void 0 ? tmp : "null";
154475
154475
  if (value2.length - 1 > maximumBreadth) {
154476
154476
  const removedKeys = value2.length - maximumBreadth - 1;
154477
- res += `${join45}"... ${getItemCount(removedKeys)} not stringified"`;
154477
+ res += `${join46}"... ${getItemCount(removedKeys)} not stringified"`;
154478
154478
  }
154479
154479
  if (spacer !== "") {
154480
154480
  res += `
@@ -154487,7 +154487,7 @@ ${originalIndentation}`;
154487
154487
  let whitespace2 = "";
154488
154488
  if (spacer !== "") {
154489
154489
  indentation2 += spacer;
154490
- join45 = `,
154490
+ join46 = `,
154491
154491
  ${indentation2}`;
154492
154492
  whitespace2 = " ";
154493
154493
  }
@@ -154496,7 +154496,7 @@ ${indentation2}`;
154496
154496
  const tmp = stringifyArrayReplacer(key3, value2[key3], stack2, replacer, spacer, indentation2);
154497
154497
  if (tmp !== void 0) {
154498
154498
  res += `${separator}${strEscape(key3)}:${whitespace2}${tmp}`;
154499
- separator = join45;
154499
+ separator = join46;
154500
154500
  }
154501
154501
  }
154502
154502
  if (spacer !== "" && separator.length > 1) {
@@ -154554,20 +154554,20 @@ ${originalIndentation}`;
154554
154554
  indentation2 += spacer;
154555
154555
  let res2 = `
154556
154556
  ${indentation2}`;
154557
- const join46 = `,
154557
+ const join47 = `,
154558
154558
  ${indentation2}`;
154559
154559
  const maximumValuesToStringify = Math.min(value2.length, maximumBreadth);
154560
154560
  let i2 = 0;
154561
154561
  for (; i2 < maximumValuesToStringify - 1; i2++) {
154562
154562
  const tmp2 = stringifyIndent(String(i2), value2[i2], stack2, spacer, indentation2);
154563
154563
  res2 += tmp2 !== void 0 ? tmp2 : "null";
154564
- res2 += join46;
154564
+ res2 += join47;
154565
154565
  }
154566
154566
  const tmp = stringifyIndent(String(i2), value2[i2], stack2, spacer, indentation2);
154567
154567
  res2 += tmp !== void 0 ? tmp : "null";
154568
154568
  if (value2.length - 1 > maximumBreadth) {
154569
154569
  const removedKeys = value2.length - maximumBreadth - 1;
154570
- res2 += `${join46}"... ${getItemCount(removedKeys)} not stringified"`;
154570
+ res2 += `${join47}"... ${getItemCount(removedKeys)} not stringified"`;
154571
154571
  }
154572
154572
  res2 += `
154573
154573
  ${originalIndentation}`;
@@ -154583,16 +154583,16 @@ ${originalIndentation}`;
154583
154583
  return '"[Object]"';
154584
154584
  }
154585
154585
  indentation2 += spacer;
154586
- const join45 = `,
154586
+ const join46 = `,
154587
154587
  ${indentation2}`;
154588
154588
  let res = "";
154589
154589
  let separator = "";
154590
154590
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
154591
154591
  if (isTypedArrayWithEntries(value2)) {
154592
- res += stringifyTypedArray(value2, join45, maximumBreadth);
154592
+ res += stringifyTypedArray(value2, join46, maximumBreadth);
154593
154593
  keys = keys.slice(value2.length);
154594
154594
  maximumPropertiesToStringify -= value2.length;
154595
- separator = join45;
154595
+ separator = join46;
154596
154596
  }
154597
154597
  if (deterministic) {
154598
154598
  keys = sort(keys, comparator);
@@ -154603,13 +154603,13 @@ ${indentation2}`;
154603
154603
  const tmp = stringifyIndent(key3, value2[key3], stack2, spacer, indentation2);
154604
154604
  if (tmp !== void 0) {
154605
154605
  res += `${separator}${strEscape(key3)}: ${tmp}`;
154606
- separator = join45;
154606
+ separator = join46;
154607
154607
  }
154608
154608
  }
154609
154609
  if (keyLength > maximumBreadth) {
154610
154610
  const removedKeys = keyLength - maximumBreadth;
154611
154611
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
154612
- separator = join45;
154612
+ separator = join46;
154613
154613
  }
154614
154614
  if (separator !== "") {
154615
154615
  res = `
@@ -156083,7 +156083,7 @@ var require_buffer_list = __commonJS({
156083
156083
  }
156084
156084
  }, {
156085
156085
  key: "join",
156086
- value: function join45(s4) {
156086
+ value: function join46(s4) {
156087
156087
  if (this.length === 0) return "";
156088
156088
  var p3 = this.head;
156089
156089
  var ret = "" + p3.data;
@@ -185967,8 +185967,8 @@ var require_get_vercel_oidc_token = __commonJS({
185967
185967
  }
185968
185968
  try {
185969
185969
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
185970
- await import("./token-util-SBIQNSCU.js"),
185971
- await import("./token-E3LBBH4N.js")
185970
+ await import("./token-util-MH4U2T5O.js"),
185971
+ await import("./token-342EBOW2.js")
185972
185972
  ]);
185973
185973
  if (!token2 || isExpired(getTokenPayload(token2))) {
185974
185974
  await refreshToken();
@@ -216927,14 +216927,14 @@ var require_lib8 = __commonJS({
216927
216927
  };
216928
216928
  var mixinPluginNames = Object.keys(mixinPlugins);
216929
216929
  var ExpressionParser = class extends LValParser {
216930
- checkProto(prop2, isRecord4, sawProto, refExpressionErrors) {
216930
+ checkProto(prop2, isRecord5, sawProto, refExpressionErrors) {
216931
216931
  if (prop2.type === "SpreadElement" || this.isObjectMethod(prop2) || prop2.computed || prop2.shorthand) {
216932
216932
  return sawProto;
216933
216933
  }
216934
216934
  const key2 = prop2.key;
216935
216935
  const name16 = key2.type === "Identifier" ? key2.name : key2.value;
216936
216936
  if (name16 === "__proto__") {
216937
- if (isRecord4) {
216937
+ if (isRecord5) {
216938
216938
  this.raise(Errors.RecordNoProto, key2);
216939
216939
  return true;
216940
216940
  }
@@ -217992,8 +217992,8 @@ var require_lib8 = __commonJS({
217992
217992
  parseTemplateSubstitution() {
217993
217993
  return this.parseExpression();
217994
217994
  }
217995
- parseObjectLike(close, isPattern, isRecord4, refExpressionErrors) {
217996
- if (isRecord4) {
217995
+ parseObjectLike(close, isPattern, isRecord5, refExpressionErrors) {
217996
+ if (isRecord5) {
217997
217997
  this.expectPlugin("recordAndTuple");
217998
217998
  }
217999
217999
  const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
@@ -218018,9 +218018,9 @@ var require_lib8 = __commonJS({
218018
218018
  prop2 = this.parseBindingProperty();
218019
218019
  } else {
218020
218020
  prop2 = this.parsePropertyDefinition(refExpressionErrors);
218021
- sawProto = this.checkProto(prop2, isRecord4, sawProto, refExpressionErrors);
218021
+ sawProto = this.checkProto(prop2, isRecord5, sawProto, refExpressionErrors);
218022
218022
  }
218023
- if (isRecord4 && !this.isObjectProperty(prop2) && prop2.type !== "SpreadElement") {
218023
+ if (isRecord5 && !this.isObjectProperty(prop2) && prop2.type !== "SpreadElement") {
218024
218024
  this.raise(Errors.InvalidRecordProperty, prop2);
218025
218025
  }
218026
218026
  if (prop2.shorthand) {
@@ -218033,7 +218033,7 @@ var require_lib8 = __commonJS({
218033
218033
  let type = "ObjectExpression";
218034
218034
  if (isPattern) {
218035
218035
  type = "ObjectPattern";
218036
- } else if (isRecord4) {
218036
+ } else if (isRecord5) {
218037
218037
  type = "RecordExpression";
218038
218038
  }
218039
218039
  return this.finishNode(node, type);
@@ -284031,14 +284031,14 @@ var require_lib15 = __commonJS({
284031
284031
  };
284032
284032
  var mixinPluginNames = Object.keys(mixinPlugins);
284033
284033
  var ExpressionParser = class extends LValParser {
284034
- checkProto(prop2, isRecord4, sawProto, refExpressionErrors) {
284034
+ checkProto(prop2, isRecord5, sawProto, refExpressionErrors) {
284035
284035
  if (prop2.type === "SpreadElement" || this.isObjectMethod(prop2) || prop2.computed || prop2.shorthand) {
284036
284036
  return sawProto;
284037
284037
  }
284038
284038
  const key2 = prop2.key;
284039
284039
  const name16 = key2.type === "Identifier" ? key2.name : key2.value;
284040
284040
  if (name16 === "__proto__") {
284041
- if (isRecord4) {
284041
+ if (isRecord5) {
284042
284042
  this.raise(Errors.RecordNoProto, key2);
284043
284043
  return true;
284044
284044
  }
@@ -285096,8 +285096,8 @@ var require_lib15 = __commonJS({
285096
285096
  parseTemplateSubstitution() {
285097
285097
  return this.parseExpression();
285098
285098
  }
285099
- parseObjectLike(close, isPattern, isRecord4, refExpressionErrors) {
285100
- if (isRecord4) {
285099
+ parseObjectLike(close, isPattern, isRecord5, refExpressionErrors) {
285100
+ if (isRecord5) {
285101
285101
  this.expectPlugin("recordAndTuple");
285102
285102
  }
285103
285103
  const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
@@ -285122,9 +285122,9 @@ var require_lib15 = __commonJS({
285122
285122
  prop2 = this.parseBindingProperty();
285123
285123
  } else {
285124
285124
  prop2 = this.parsePropertyDefinition(refExpressionErrors);
285125
- sawProto = this.checkProto(prop2, isRecord4, sawProto, refExpressionErrors);
285125
+ sawProto = this.checkProto(prop2, isRecord5, sawProto, refExpressionErrors);
285126
285126
  }
285127
- if (isRecord4 && !this.isObjectProperty(prop2) && prop2.type !== "SpreadElement") {
285127
+ if (isRecord5 && !this.isObjectProperty(prop2) && prop2.type !== "SpreadElement") {
285128
285128
  this.raise(Errors.InvalidRecordProperty, prop2);
285129
285129
  }
285130
285130
  if (prop2.shorthand) {
@@ -285137,7 +285137,7 @@ var require_lib15 = __commonJS({
285137
285137
  let type = "ObjectExpression";
285138
285138
  if (isPattern) {
285139
285139
  type = "ObjectPattern";
285140
- } else if (isRecord4) {
285140
+ } else if (isRecord5) {
285141
285141
  type = "RecordExpression";
285142
285142
  }
285143
285143
  return this.finishNode(node, type);
@@ -300067,7 +300067,7 @@ var require_BufferList = __commonJS({
300067
300067
  this.head = this.tail = null;
300068
300068
  this.length = 0;
300069
300069
  };
300070
- BufferList.prototype.join = function join45(s4) {
300070
+ BufferList.prototype.join = function join46(s4) {
300071
300071
  if (this.length === 0) return "";
300072
300072
  var p3 = this.head;
300073
300073
  var ret = "" + p3.data;
@@ -329396,7 +329396,7 @@ var require_parse10 = __commonJS({
329396
329396
  extension: url4.getExtension(path81)
329397
329397
  };
329398
329398
  try {
329399
- const resolver = await readFile30(file2, options8, $refs);
329399
+ const resolver = await readFile31(file2, options8, $refs);
329400
329400
  $ref.pathType = resolver.plugin.name;
329401
329401
  file2.data = resolver.result;
329402
329402
  const parser8 = await parseFile4(file2, options8, $refs);
@@ -329409,7 +329409,7 @@ var require_parse10 = __commonJS({
329409
329409
  throw err;
329410
329410
  }
329411
329411
  }
329412
- function readFile30(file2, options8, $refs) {
329412
+ function readFile31(file2, options8, $refs) {
329413
329413
  return new Promise(((resolve14, reject) => {
329414
329414
  let resolvers = plugins.all(options8.resolve);
329415
329415
  resolvers = plugins.filter(resolvers, "canRead", file2);
@@ -347456,14 +347456,14 @@ var require_turndown_cjs = __commonJS({
347456
347456
  } else if (node.nodeType === 1) {
347457
347457
  replacement = replacementForNode.call(self2, node);
347458
347458
  }
347459
- return join45(output, replacement);
347459
+ return join46(output, replacement);
347460
347460
  }, "");
347461
347461
  }
347462
347462
  function postProcess(output) {
347463
347463
  var self2 = this;
347464
347464
  this.rules.forEach(function(rule) {
347465
347465
  if (typeof rule.append === "function") {
347466
- output = join45(output, rule.append(self2.options));
347466
+ output = join46(output, rule.append(self2.options));
347467
347467
  }
347468
347468
  });
347469
347469
  return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
@@ -347475,7 +347475,7 @@ var require_turndown_cjs = __commonJS({
347475
347475
  if (whitespace2.leading || whitespace2.trailing) content19 = content19.trim();
347476
347476
  return whitespace2.leading + rule.replacement(content19, node, this.options) + whitespace2.trailing;
347477
347477
  }
347478
- function join45(output, replacement) {
347478
+ function join46(output, replacement) {
347479
347479
  var s1 = trimTrailingNewlines(output);
347480
347480
  var s22 = trimLeadingNewlines(replacement);
347481
347481
  var nls = Math.max(output.length - s1.length, replacement.length - s22.length);
@@ -365785,7 +365785,7 @@ var require_snapshot_recorder = __commonJS({
365785
365785
  "../../../../node_modules/.pnpm/undici@7.28.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
365786
365786
  "use strict";
365787
365787
  init_cjs_shims();
365788
- var { writeFile: writeFile24, readFile: readFile30, mkdir: mkdir28 } = __require("node:fs/promises");
365788
+ var { writeFile: writeFile24, readFile: readFile31, mkdir: mkdir29 } = __require("node:fs/promises");
365789
365789
  var { dirname: dirname28, resolve: resolve14 } = __require("node:path");
365790
365790
  var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("node:timers");
365791
365791
  var { InvalidArgumentError: InvalidArgumentError2, UndiciError } = require_errors11();
@@ -365987,7 +365987,7 @@ var require_snapshot_recorder = __commonJS({
365987
365987
  throw new InvalidArgumentError2("Snapshot path is required");
365988
365988
  }
365989
365989
  try {
365990
- const data3 = await readFile30(resolve14(path81), "utf8");
365990
+ const data3 = await readFile31(resolve14(path81), "utf8");
365991
365991
  const parsed = JSON.parse(data3);
365992
365992
  if (Array.isArray(parsed)) {
365993
365993
  this.#snapshots.clear();
@@ -366017,7 +366017,7 @@ var require_snapshot_recorder = __commonJS({
366017
366017
  throw new InvalidArgumentError2("Snapshot path is required");
366018
366018
  }
366019
366019
  const resolvedPath = resolve14(path81);
366020
- await mkdir28(dirname28(resolvedPath), { recursive: true });
366020
+ await mkdir29(dirname28(resolvedPath), { recursive: true });
366021
366021
  const data3 = Array.from(this.#snapshots.entries()).map(([hash3, snapshot]) => ({
366022
366022
  hash: hash3,
366023
366023
  snapshot
@@ -444058,7 +444058,7 @@ var require_Str = __commonJS({
444058
444058
  "../../../../node_modules/.pnpm/prelude-ls@1.2.1/node_modules/prelude-ls/lib/Str.js"(exports, module) {
444059
444059
  init_cjs_shims();
444060
444060
  var split;
444061
- var join45;
444061
+ var join46;
444062
444062
  var lines;
444063
444063
  var unlines;
444064
444064
  var words;
@@ -444073,7 +444073,7 @@ var require_Str = __commonJS({
444073
444073
  split = curry$(function(sep5, str) {
444074
444074
  return str.split(sep5);
444075
444075
  });
444076
- join45 = curry$(function(sep5, xs2) {
444076
+ join46 = curry$(function(sep5, xs2) {
444077
444077
  return xs2.join(sep5);
444078
444078
  });
444079
444079
  lines = function(str) {
@@ -444132,7 +444132,7 @@ var require_Str = __commonJS({
444132
444132
  };
444133
444133
  module.exports = {
444134
444134
  split,
444135
- join: join45,
444135
+ join: join46,
444136
444136
  lines,
444137
444137
  unlines,
444138
444138
  words,
@@ -460949,7 +460949,7 @@ var require_posix = __commonJS({
460949
460949
  if (isAbsolute8) return `/${path81}`;
460950
460950
  return path81;
460951
460951
  }
460952
- function join45(path81, ...paths) {
460952
+ function join46(path81, ...paths) {
460953
460953
  if (path81 === void 0) return ".";
460954
460954
  if (path81 instanceof URL) {
460955
460955
  path81 = fromFileUrl(path81);
@@ -461427,7 +461427,7 @@ var require_posix = __commonJS({
461427
461427
  function joinGlobs(globs, options8 = {}) {
461428
461428
  const { globstar = false } = options8;
461429
461429
  if (!globstar || globs.length === 0) {
461430
- return join45(...globs);
461430
+ return join46(...globs);
461431
461431
  }
461432
461432
  let joined;
461433
461433
  for (const glob3 of globs) {
@@ -461454,7 +461454,7 @@ var require_posix = __commonJS({
461454
461454
  exports.globToRegExp = globToRegExp;
461455
461455
  exports.isAbsolute = isAbsolute7;
461456
461456
  exports.isGlob = isGlob;
461457
- exports.join = join45;
461457
+ exports.join = join46;
461458
461458
  exports.joinGlobs = joinGlobs;
461459
461459
  exports.normalize = normalize6;
461460
461460
  exports.normalizeGlob = normalizeGlob;
@@ -461855,7 +461855,7 @@ var require_windows = __commonJS({
461855
461855
  }
461856
461856
  return device + tail;
461857
461857
  }
461858
- function join45(path81, ...paths) {
461858
+ function join46(path81, ...paths) {
461859
461859
  if (path81 instanceof URL) {
461860
461860
  path81 = fromFileUrl(path81);
461861
461861
  }
@@ -462501,7 +462501,7 @@ var require_windows = __commonJS({
462501
462501
  function joinGlobs(globs, options8 = {}) {
462502
462502
  const { globstar = false } = options8;
462503
462503
  if (!globstar || globs.length === 0) {
462504
- return join45(...globs);
462504
+ return join46(...globs);
462505
462505
  }
462506
462506
  let joined;
462507
462507
  for (const glob3 of globs) {
@@ -462528,7 +462528,7 @@ var require_windows = __commonJS({
462528
462528
  exports.globToRegExp = globToRegExp;
462529
462529
  exports.isAbsolute = isAbsolute7;
462530
462530
  exports.isGlob = isGlob;
462531
- exports.join = join45;
462531
+ exports.join = join46;
462532
462532
  exports.joinGlobs = joinGlobs;
462533
462533
  exports.normalize = normalize6;
462534
462534
  exports.normalizeGlob = normalizeGlob;
@@ -470728,7 +470728,7 @@ var require_config_loader = __commonJS({
470728
470728
  * @returns {Promise<{createJiti: Function|undefined, version: string;}>} A promise that fulfills with an object containing the jiti module's createJiti function and version.
470729
470729
  */
470730
470730
  static async loadJiti() {
470731
- const { createJiti } = await import("./jiti-7NQA6EIF.js");
470731
+ const { createJiti } = await import("./jiti-ZYIUTG3C.js");
470732
470732
  const version3 = require_package5().version;
470733
470733
  return { createJiti, version: version3 };
470734
470734
  }
@@ -471057,7 +471057,7 @@ var require_eslint_helpers = __commonJS({
471057
471057
  }
471058
471058
  async function globMatch({ basePath, pattern }) {
471059
471059
  let found = false;
471060
- const { hfs } = await import("./src-JTYX334G.js");
471060
+ const { hfs } = await import("./src-HQGEFTJ3.js");
471061
471061
  const patternToUse = normalizeToPosix(path81.relative(basePath, pattern));
471062
471062
  const matcher = new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
471063
471063
  const walkSettings = {
@@ -471097,7 +471097,7 @@ var require_eslint_helpers = __commonJS({
471097
471097
  return new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
471098
471098
  });
471099
471099
  const unmatchedPatterns = /* @__PURE__ */ new Set([...relativeToPatterns.keys()]);
471100
- const { hfs } = await import("./src-JTYX334G.js");
471100
+ const { hfs } = await import("./src-HQGEFTJ3.js");
471101
471101
  const walk2 = hfs.walk(basePath, {
471102
471102
  async directoryFilter(entry) {
471103
471103
  if (!matchers.some((matcher) => matcher.match(entry.path, true))) {
@@ -474750,14 +474750,14 @@ Require stack:
474750
474750
  function isFilePath(nameOrPath) {
474751
474751
  return /^\.{1,2}[/\\]/u.test(nameOrPath) || path__default["default"].isAbsolute(nameOrPath);
474752
474752
  }
474753
- function readFile30(filePath) {
474753
+ function readFile31(filePath) {
474754
474754
  return fs__default["default"].readFileSync(filePath, "utf8").replace(/^\ufeff/u, "");
474755
474755
  }
474756
474756
  function loadYAMLConfigFile(filePath) {
474757
474757
  debug$2(`Loading YAML config file: ${filePath}`);
474758
474758
  const yaml8 = require$1("js-yaml");
474759
474759
  try {
474760
- return yaml8.load(readFile30(filePath)) || {};
474760
+ return yaml8.load(readFile31(filePath)) || {};
474761
474761
  } catch (e) {
474762
474762
  debug$2(`Error reading YAML file: ${filePath}`);
474763
474763
  e.message = `Cannot read config file: ${filePath}
@@ -474768,7 +474768,7 @@ Error: ${e.message}`;
474768
474768
  function loadJSONConfigFile(filePath) {
474769
474769
  debug$2(`Loading JSON config file: ${filePath}`);
474770
474770
  try {
474771
- return JSON.parse(stripComments__default["default"](readFile30(filePath)));
474771
+ return JSON.parse(stripComments__default["default"](readFile31(filePath)));
474772
474772
  } catch (e) {
474773
474773
  debug$2(`Error reading JSON file: ${filePath}`);
474774
474774
  e.message = `Cannot read config file: ${filePath}
@@ -474785,7 +474785,7 @@ Error: ${e.message}`;
474785
474785
  debug$2(`Loading legacy config file: ${filePath}`);
474786
474786
  const yaml8 = require$1("js-yaml");
474787
474787
  try {
474788
- return yaml8.load(stripComments__default["default"](readFile30(filePath))) || /* istanbul ignore next */
474788
+ return yaml8.load(stripComments__default["default"](readFile31(filePath))) || /* istanbul ignore next */
474789
474789
  {};
474790
474790
  } catch (e) {
474791
474791
  debug$2("Error reading YAML file: %s\n%o", filePath, e);
@@ -474826,7 +474826,7 @@ Error: ${e.message}`;
474826
474826
  function loadESLintIgnoreFile(filePath) {
474827
474827
  debug$2(`Loading .eslintignore file: ${filePath}`);
474828
474828
  try {
474829
- return readFile30(filePath).split(/\r?\n/gu).filter((line3) => line3.trim() !== "" && !line3.startsWith("#"));
474829
+ return readFile31(filePath).split(/\r?\n/gu).filter((line3) => line3.trim() !== "" && !line3.startsWith("#"));
474830
474830
  } catch (e) {
474831
474831
  debug$2(`Error reading .eslintignore file: ${filePath}`);
474832
474832
  e.message = `Cannot read .eslintignore file: ${filePath}
@@ -505282,7 +505282,7 @@ var require_fs8 = __commonJS({
505282
505282
  };
505283
505283
  return data3;
505284
505284
  }
505285
- var readFile30 = exports.readFile = _gensync()({
505285
+ var readFile31 = exports.readFile = _gensync()({
505286
505286
  sync: _fs().readFileSync,
505287
505287
  errback: _fs().readFile
505288
505288
  });
@@ -532476,7 +532476,7 @@ var require_view = __commonJS({
532476
532476
  var dirname28 = path81.dirname;
532477
532477
  var basename11 = path81.basename;
532478
532478
  var extname4 = path81.extname;
532479
- var join45 = path81.join;
532479
+ var join46 = path81.join;
532480
532480
  var resolve14 = path81.resolve;
532481
532481
  module.exports = View;
532482
532482
  function View(name16, options8) {
@@ -532524,12 +532524,12 @@ var require_view = __commonJS({
532524
532524
  };
532525
532525
  View.prototype.resolve = function resolve15(dir, file2) {
532526
532526
  var ext2 = this.ext;
532527
- var path83 = join45(dir, file2);
532527
+ var path83 = join46(dir, file2);
532528
532528
  var stat11 = tryStat(path83);
532529
532529
  if (stat11 && stat11.isFile()) {
532530
532530
  return path83;
532531
532531
  }
532532
- path83 = join45(dir, basename11(file2, ext2), "index" + ext2);
532532
+ path83 = join46(dir, basename11(file2, ext2), "index" + ext2);
532533
532533
  stat11 = tryStat(path83);
532534
532534
  if (stat11 && stat11.isFile()) {
532535
532535
  return path83;
@@ -533009,7 +533009,7 @@ var require_send = __commonJS({
533009
533009
  var Stream2 = __require("stream");
533010
533010
  var util5 = __require("util");
533011
533011
  var extname4 = path81.extname;
533012
- var join45 = path81.join;
533012
+ var join46 = path81.join;
533013
533013
  var normalize6 = path81.normalize;
533014
533014
  var resolve14 = path81.resolve;
533015
533015
  var sep5 = path81.sep;
@@ -533228,7 +533228,7 @@ var require_send = __commonJS({
533228
533228
  return res;
533229
533229
  }
533230
533230
  parts = path83.split(sep5);
533231
- path83 = normalize6(join45(root3, path83));
533231
+ path83 = normalize6(join46(root3, path83));
533232
533232
  } else {
533233
533233
  if (UP_PATH_REGEXP.test(path83)) {
533234
533234
  debug3('malicious path "%s"', path83);
@@ -533363,7 +533363,7 @@ var require_send = __commonJS({
533363
533363
  if (err) return self2.onStatError(err);
533364
533364
  return self2.error(404);
533365
533365
  }
533366
- var p3 = join45(path83, self2._index[i2]);
533366
+ var p3 = join46(path83, self2._index[i2]);
533367
533367
  debug3('stat "%s"', p3);
533368
533368
  fs39.stat(p3, function(err2, stat11) {
533369
533369
  if (err2) return next2(err2);
@@ -539506,7 +539506,7 @@ init_cjs_shims();
539506
539506
  // ../sdk/package.json
539507
539507
  var package_default = {
539508
539508
  name: "@superblocksteam/sdk",
539509
- version: "2.0.142-next.0",
539509
+ version: "2.0.142-next.2",
539510
539510
  description: "Superblocks JS SDK",
539511
539511
  homepage: "https://www.superblocks.com",
539512
539512
  license: "Superblocks Community Software License",
@@ -539863,7 +539863,7 @@ var config = void 0;
539863
539863
  var configured = false;
539864
539864
  var ddTracePromise = void 0;
539865
539865
  async function getDdTrace() {
539866
- ddTracePromise ??= import("./dd-trace-AR2756K7.js").then((module) => module.default);
539866
+ ddTracePromise ??= import("./dd-trace-6WP6ICAN.js").then((module) => module.default);
539867
539867
  return await ddTracePromise;
539868
539868
  }
539869
539869
  var deploymentType = (() => {
@@ -573754,7 +573754,7 @@ var MAX_ATTRIBUTE_LENGTH = 64e3;
573754
573754
  var LLMObsSpanWriter = null;
573755
573755
  async function loadLLMObsSpanWriter() {
573756
573756
  if (!LLMObsSpanWriter) {
573757
- const module = await import("./spans-VP4ANRE4.js");
573757
+ const module = await import("./spans-YUASCP6K.js");
573758
573758
  LLMObsSpanWriter = module.default;
573759
573759
  }
573760
573760
  return LLMObsSpanWriter;
@@ -596847,7 +596847,7 @@ function buildIntegrationDocumentation(integrationIds, services) {
596847
596847
  `**IMPORTANT \u2014 Correct import name**: \`import { ${sdkName} } from "@superblocksteam/sdk-api"\`. Do NOT use \`${plugin.id}\` as the import \u2014 the correct SDK export is \`${sdkName}\`.`,
596848
596848
  ""
596849
596849
  ] : [],
596850
- "**SDK access**: In your API `run` function, use the **key name** you declared: `ctx.integrations.<name>` (e.g. `ctx.integrations.db`). Do not use the integration ID when accessing\u2014only when declaring the integration.",
596850
+ "**SDK access**: In your API `run` function, use the **key name** you declared: `ctx.integrations.<key>` (e.g. `ctx.integrations.orders_db`). Prefer a descriptive key derived from the integration/database name, not a generic `db`. Do not use the integration ID when accessing\u2014only when declaring the integration.",
596851
596851
  "",
596852
596852
  "### TypeScript Type Definition",
596853
596853
  "```typescript",
@@ -597354,6 +597354,32 @@ async function getSdkRootReadmeDocumentation() {
597354
597354
  return "";
597355
597355
  }
597356
597356
  }
597357
+ var SDK_INTEGRATIONS_KEY_GUIDANCE = [
597358
+ "## Integrations map keys (CRITICAL \u2014 read before README examples)",
597359
+ "",
597360
+ "SDK README snippets below often use a generic `db` key for brevity. Treat those as **placeholders only**. When the integration already has a meaningful display name / Native DB `logicalName`, you MUST use a descriptive `integrations` map key instead \u2014 that key is what appears in generated code and TraceView.",
597361
+ "",
597362
+ "**Derive a valid JS identifier (lowercase snake_case):**",
597363
+ "1. Lowercase the display name / `logicalName`.",
597364
+ "2. Replace spaces, hyphens, and other non-alphanumeric characters with `_`; collapse repeated `_`.",
597365
+ "3. If the result starts with a digit, prefix `db_` (e.g. `2024_orders` \u2192 `db_2024_orders`).",
597366
+ "4. If the result is empty or a JS reserved word (`default`, `class`, `function`, \u2026), prefix `db_`.",
597367
+ "5. Examples: `pokemon_tracker` \u2192 `pokemon_tracker`; `Orders DB` \u2192 `orders_db`; `Order's DB!` \u2192 `orders_db`.",
597368
+ "",
597369
+ "**Collisions:** If two integrations would derive the same key, disambiguate (e.g. append `_2` or a short plugin/type suffix like `_pg`) so every object key is unique. Duplicate keys silently drop a binding.",
597370
+ "",
597371
+ "In `run()`, access via `ctx.integrations.<key>` (e.g. `ctx.integrations.pokemon_tracker`). Use the integration ID only in the declaration (`postgres(UUID)`), never for access."
597372
+ ].join("\n");
597373
+ function withIntegrationsKeyGuidance(documentation) {
597374
+ const guidance = SDK_INTEGRATIONS_KEY_GUIDANCE.trim();
597375
+ const base = documentation.trim();
597376
+ if (!base) {
597377
+ return guidance;
597378
+ }
597379
+ return `${guidance}
597380
+
597381
+ ${base}`;
597382
+ }
597357
597383
  function normalizeSemVer(version3) {
597358
597384
  return version3 && /^\d+\.\d+\.\d+$/.test(version3) ? version3 : void 0;
597359
597385
  }
@@ -597447,13 +597473,13 @@ ALWAYS call this tool:
597447
597473
  const requestedPluginIds = resolveRequestedPluginIds(integrationIds, pluginIds, services);
597448
597474
  if (requestedPluginIds.length === 0) {
597449
597475
  return {
597450
- documentation: await getSdkRootReadmeDocumentation(),
597476
+ documentation: withIntegrationsKeyGuidance(await getSdkRootReadmeDocumentation()),
597451
597477
  plugins: []
597452
597478
  };
597453
597479
  }
597454
597480
  const { documentation, plugins: resolvedPlugins } = await buildSdkPluginReadmeDocumentation(requestedPluginIds, services);
597455
597481
  return {
597456
- documentation,
597482
+ documentation: withIntegrationsKeyGuidance(documentation),
597457
597483
  plugins: resolvedPlugins
597458
597484
  };
597459
597485
  },
@@ -602447,6 +602473,9 @@ var buildManageChecklistToolFactory = createToolFactory("build_manageChecklist",
602447
602473
  };
602448
602474
  }
602449
602475
  case "clear": {
602476
+ if (isV2ToV3MigrationInProgress(checklistState)) {
602477
+ throw new Error("Cannot clear the checklist during an active 2.0 -> 3.0 migration. Mark items as 'failed' (with a failureReason) or 'cancelled' instead so the finalize checklist and Finish migration button remain intact.");
602478
+ }
602450
602479
  await clearChecklist({
602451
602480
  appRootDirPath: services.appRootDirPath
602452
602481
  });
@@ -611762,6 +611791,7 @@ function defineBackgroundTaskFactory(metadata) {
611762
611791
  const status = handle.initialStatus;
611763
611792
  const message = "message" in status ? status.message : void 0;
611764
611793
  const error40 = "error" in status ? status.error : void 0;
611794
+ const detail = status.state === "failed" ? status.detail : void 0;
611765
611795
  const result = {
611766
611796
  taskId: handle.taskId,
611767
611797
  state: status.state,
@@ -611771,6 +611801,8 @@ function defineBackgroundTaskFactory(metadata) {
611771
611801
  result.message = message;
611772
611802
  if (error40 !== void 0)
611773
611803
  result.error = error40;
611804
+ if (detail !== void 0)
611805
+ result.detail = detail;
611774
611806
  return result;
611775
611807
  }
611776
611808
  }));
@@ -611969,7 +612001,7 @@ function assertCredentialRefDoesNotContainRawMaterial(value2) {
611969
612001
 
611970
612002
  // ../../../vite-plugin-file-sync/dist/ai-service/agent/tools/databases/dev-database-tasks.js
611971
612003
  var databaseRequirementSchema = external_exports.object({
611972
- logicalName: external_exports.string().min(1).describe("The app-local database name"),
612004
+ logicalName: external_exports.string().min(1).describe("The app-local database name. Becomes the lifecycle integration's display name. When wiring SDK APIs, derive a valid lowercase snake_case integrations map key from this name (replace non-alphanumeric with _, prefix db_ if empty/digit-leading/reserved; disambiguate collisions). Examples: 'pokemon_tracker' \u2192 pokemon_tracker; 'Orders DB' \u2192 orders_db. Do not use a generic key like 'db'."),
611973
612005
  migrationDirectory: external_exports.string().optional().describe("Repo-relative path to the directory holding the app's SQL migrations. Set this explicitly when provisionDatabase should enable startApplyDevDatabaseMigrations; `db/migrations/` is the recommended convention. Files inside must match `<digits>_<description>.sql` (e.g. `0001_init.sql`, `0002_add_users.sql`); the leading digits are the sort key and the runner applies them in lexicographic order against the in-DB ledger.")
611974
612006
  });
611975
612007
  var provisionInputSchema = external_exports.object({
@@ -611981,6 +612013,11 @@ var provisionHandleSchema = external_exports.object({
611981
612013
  integrationId: external_exports.string().optional(),
611982
612014
  lifecycleState: external_exports.string().optional(),
611983
612015
  logicalName: external_exports.string().optional(),
612016
+ // Correlates to the server-side lifecycle_request row for oncall/debug
612017
+ // (mirrors ApplyMigrationsHandle). Persisted on the task handle so
612018
+ // classified failures still carry a durable request id even when the
612019
+ // user-facing error string omits it.
612020
+ requestId: external_exports.string().min(1).optional(),
611984
612021
  requirement: databaseRequirementSchema
611985
612022
  });
611986
612023
  var applyMigrationsInputSchema = external_exports.object({
@@ -612001,7 +612038,7 @@ var provisionDevDatabaseTaskMetadata = {
612001
612038
  // dev environment name are platform-controlled, so they're not in the
612002
612039
  // input. BG wrapping (taskId, don't waitForTask, check first) is the
612003
612040
  // only behavioral delta from master.
612004
- description: "Create or reuse a lifecycle-managed dev database binding for this application on Amazon RDS as a BACKGROUND TASK. Clark provisions the database and returns lifecycle progress. Returns a taskId IMMEDIATELY while RDS provisioning runs in the background; the user already sees live progress in the chat's background-tasks indicator. DO NOT call waitForTask right after this \u2014 that defeats the whole point of a background task and blocks your turn for minutes while RDS spins up. Instead: keep working on whatever does NOT depend on the database (scaffold the UI, draft API code that will use the binding, write or read SQL migration files, plan next steps). When you reach a step that genuinely cannot proceed without the connection details, FIRST call checkTask({ taskId }) \u2014 it returns instantly. Only fall back to waitForTask if checkTask still reports state='running' AND you literally have no other useful work to do. On completion the result includes bindingKey, integrationId, lifecycleState, connectionMetadata, and credentialRefs. Use integrationId only for tool inputs or generated source code such as postgres(...); do not repeat internal UUIDs in user-facing chat. This task ONLY creates the database server + an integration; it does NOT apply SQL migrations \u2014 query attempts will fail with `relation \"X\" does not exist` until you call startApplyDevDatabaseMigrations. Cancellation only stops local polling; the underlying RDS provisioning continues on the server.",
612041
+ description: "Create or reuse a lifecycle-managed dev database binding for this application on Amazon RDS as a BACKGROUND TASK. Clark provisions the database and returns lifecycle progress. Returns a taskId IMMEDIATELY while RDS provisioning runs in the background; the user already sees live progress in the chat's background-tasks indicator. DO NOT call waitForTask right after this \u2014 that defeats the whole point of a background task and blocks your turn for minutes while RDS spins up. Instead: keep working on whatever does NOT depend on the database (scaffold the UI, draft API code that will use the binding, write or read SQL migration files, plan next steps). When you reach a step that genuinely cannot proceed without the connection details, FIRST call checkTask({ taskId }) \u2014 it returns instantly. Only fall back to waitForTask if checkTask still reports state='running' AND you literally have no other useful work to do. On completion the result includes bindingKey, integrationId, lifecycleState, connectionMetadata, and credentialRefs. Use integrationId only for tool inputs or generated source code such as postgres(...); do not repeat internal UUIDs in user-facing chat. When declaring the integration in an SDK API, derive a valid lowercase snake_case integrations map key from requirement.logicalName (normalize non-alphanumeric to _, prefix db_ if needed, disambiguate collisions; e.g. pokemon_tracker \u2192 pokemon_tracker: postgres(POKEMON_TRACKER), Orders DB \u2192 orders_db) so code and TraceView match the database name \u2014 never a generic key like db. This task ONLY creates the database server + an integration; it does NOT apply SQL migrations \u2014 query attempts will fail with `relation \"X\" does not exist` until you call startApplyDevDatabaseMigrations. Cancellation only stops local polling; the underlying RDS provisioning continues on the server.",
612005
612042
  externalHandleSchema: provisionHandleSchema,
612006
612043
  inputSchema: provisionInputSchema,
612007
612044
  name: "provisionDatabase",
@@ -612037,30 +612074,99 @@ function toToolError(error40) {
612037
612074
  }
612038
612075
  return error40 instanceof Error ? error40 : new Error(String(error40));
612039
612076
  }
612040
- function lifecycleStatusFor(response) {
612077
+ var LIFECYCLE_FAILURE_USER_MESSAGE = {
612078
+ "dev database provisioning": {
612079
+ backend_locked: "Database setup is briefly busy. Try again in a moment.",
612080
+ callback_failed: "Database setup didn't finish reporting status. Try again.",
612081
+ credential_resolution_failed: "Database setup couldn't access required credentials. Contact your admin, then try again.",
612082
+ migration_failed: "A database schema update failed. Check your migration SQL, then try again.",
612083
+ policy_blocked: "Your organization blocked this database operation. Contact your admin.",
612084
+ terraform_failed: "Cloud database setup failed. Check cloud credentials with your admin, then try again.",
612085
+ unsupported_provider_capability: "This database operation isn't supported in your environment. Contact your admin."
612086
+ },
612087
+ "applying migrations": {
612088
+ backend_locked: "Database schema update is briefly busy. Try again in a moment.",
612089
+ callback_failed: "Database schema update didn't finish reporting status. Try again.",
612090
+ credential_resolution_failed: "Database schema update couldn't access required credentials. Contact your admin, then try again.",
612091
+ migration_failed: "A database schema update failed. Check your migration SQL, then try again.",
612092
+ policy_blocked: "Your organization blocked this database operation. Contact your admin.",
612093
+ terraform_failed: "Cloud database setup failed. Check cloud credentials with your admin, then try again.",
612094
+ unsupported_provider_capability: "This database operation isn't supported in your environment. Contact your admin."
612095
+ }
612096
+ };
612097
+ var LIFECYCLE_FAILURE_AGENT_GUIDANCE = {
612098
+ "dev database provisioning": {
612099
+ backend_locked: "This is usually transient; retry the provisioning task.",
612100
+ callback_failed: "The agent failed to report a terminal result; retry, and check the database-lifecycle worker if it persists.",
612101
+ credential_resolution_failed: "Credentials could not be resolved for the worker; verify secrets configuration, then retry.",
612102
+ migration_failed: "A schema migration failed during provisioning; inspect the migration SQL, fix it, then retry the provisioning task.",
612103
+ policy_blocked: "An organization policy blocked this operation; adjust policy or agent capability coverage, then retry.",
612104
+ terraform_failed: "Infrastructure provisioning failed on the agent; verify OPA/database-lifecycle worker setup and cloud credentials, then retry.",
612105
+ unsupported_provider_capability: "The agent does not support this database operation; update OPA lifecycle configuration, then retry."
612106
+ },
612107
+ "applying migrations": {
612108
+ backend_locked: "This is usually transient; retry startApplyDevDatabaseMigrations.",
612109
+ callback_failed: "The agent failed to report a terminal result; retry startApplyDevDatabaseMigrations, and check the database-lifecycle worker if it persists.",
612110
+ credential_resolution_failed: "Credentials could not be resolved for the worker; verify secrets configuration, then retry startApplyDevDatabaseMigrations.",
612111
+ migration_failed: "A schema migration failed; inspect the migration SQL, fix it, then retry startApplyDevDatabaseMigrations.",
612112
+ policy_blocked: "An organization policy blocked this operation; adjust policy or agent capability coverage, then retry.",
612113
+ terraform_failed: "Infrastructure provisioning failed on the agent; verify OPA/database-lifecycle worker setup and cloud credentials, then retry.",
612114
+ unsupported_provider_capability: "The agent does not support this database operation; update OPA lifecycle configuration, then retry."
612115
+ }
612116
+ };
612117
+ var LIFECYCLE_FAILURE_FIELD_MAX_LEN = 100;
612118
+ function sanitizeLifecycleFailureField(value2) {
612119
+ const scrubbed = stripUnsafeChars(scrubSecrets(value2)).trim();
612120
+ return scrubbed.length > LIFECYCLE_FAILURE_FIELD_MAX_LEN ? `${scrubbed.slice(0, LIFECYCLE_FAILURE_FIELD_MAX_LEN)}\u2026` : scrubbed;
612121
+ }
612122
+ function formatLifecycleTaskFailure(action, response, fallbackRequestId) {
612123
+ const code = response.errorCode ? sanitizeLifecycleFailureField(response.errorCode) : "";
612124
+ const message = response.errorMessage ? sanitizeLifecycleFailureField(response.errorMessage) : "";
612125
+ const rawRequestId = response.requestId || fallbackRequestId || "";
612126
+ const requestId = rawRequestId ? sanitizeLifecycleFailureField(rawRequestId) : "";
612127
+ const requestSuffix = requestId ? `, request ${requestId}` : "";
612128
+ let detail;
612129
+ if (code && message) {
612130
+ detail = `${action} failed (${code}${requestSuffix}): ${message}`;
612131
+ } else if (message) {
612132
+ detail = requestId ? `${action} failed (request ${requestId}): ${message}` : `${action} failed: ${message}`;
612133
+ } else if (code) {
612134
+ detail = `${action} failed (${code}${requestSuffix})`;
612135
+ } else if (requestId) {
612136
+ detail = `${action} failed (request ${requestId})`;
612137
+ } else {
612138
+ detail = `${action} failed`;
612139
+ }
612140
+ const agentGuidance = code ? LIFECYCLE_FAILURE_AGENT_GUIDANCE[action][code] : void 0;
612141
+ if (agentGuidance) {
612142
+ detail = `${detail}. ${agentGuidance}`;
612143
+ }
612144
+ const userDefault = action === "applying migrations" ? "A database schema update failed. Try again, or contact support if it keeps happening." : "Database setup failed. Try again, or contact support if it keeps happening.";
612145
+ const error40 = (code ? LIFECYCLE_FAILURE_USER_MESSAGE[action][code] : void 0) ?? userDefault;
612146
+ return { error: error40, detail };
612147
+ }
612148
+ function lifecycleStatusFor(response, fallbackRequestId) {
612041
612149
  switch (response.lifecycleState) {
612042
612150
  case "ready":
612043
612151
  return { state: "completed", result: response };
612044
- case "failed":
612045
- return {
612046
- state: "failed",
612047
- error: `dev database provisioning failed (request ${response.requestId})`
612048
- };
612152
+ case "failed": {
612153
+ const { error: error40, detail } = formatLifecycleTaskFailure("dev database provisioning", response, fallbackRequestId);
612154
+ return { state: "failed", error: error40, detail };
612155
+ }
612049
612156
  case "cancelled":
612050
612157
  return { state: "cancelled" };
612051
612158
  default:
612052
612159
  return { state: "running", message: response.lifecycleState };
612053
612160
  }
612054
612161
  }
612055
- function migrationStatusFor(response) {
612162
+ function migrationStatusFor(response, fallbackRequestId) {
612056
612163
  switch (response.migrationState) {
612057
612164
  case "migrated":
612058
612165
  return { state: "completed", result: response };
612059
- case "failed":
612060
- return {
612061
- state: "failed",
612062
- error: `applying migrations failed (request ${response.requestId})`
612063
- };
612166
+ case "failed": {
612167
+ const { error: error40, detail } = formatLifecycleTaskFailure("applying migrations", response, fallbackRequestId);
612168
+ return { state: "failed", error: error40, detail };
612169
+ }
612064
612170
  case "pending":
612065
612171
  default:
612066
612172
  return { state: "running", message: response.migrationState };
@@ -612074,6 +612180,9 @@ function updateProvisionHandleFromResponse(handle, response) {
612074
612180
  handle.integrationId = response.integrationId;
612075
612181
  handle.lifecycleState = response.lifecycleState;
612076
612182
  handle.logicalName = response.logicalName;
612183
+ if (response.requestId) {
612184
+ handle.requestId = response.requestId;
612185
+ }
612077
612186
  }
612078
612187
  function createDevDatabaseTaskTypes(deps) {
612079
612188
  const provisionDevDatabaseTaskType = {
@@ -612130,7 +612239,7 @@ function createDevDatabaseTaskTypes(deps) {
612130
612239
  throw toToolError(error40);
612131
612240
  }
612132
612241
  updateProvisionHandleFromResponse(handle, response);
612133
- return lifecycleStatusFor(response);
612242
+ return lifecycleStatusFor(response, handle.requestId);
612134
612243
  }
612135
612244
  };
612136
612245
  const applyDevDatabaseMigrationsTaskType = {
@@ -612177,7 +612286,7 @@ function createDevDatabaseTaskTypes(deps) {
612177
612286
  if (response.migrationState === "failed") {
612178
612287
  return {
612179
612288
  externalHandle: handle,
612180
- initialStatus: migrationStatusFor(response),
612289
+ initialStatus: migrationStatusFor(response, handle.requestId),
612181
612290
  label: label2
612182
612291
  };
612183
612292
  }
@@ -612197,9 +612306,9 @@ function createDevDatabaseTaskTypes(deps) {
612197
612306
  throw toToolError(error40);
612198
612307
  }
612199
612308
  if (TERMINAL_LIFECYCLE_STATES.has(response.lifecycleState) && response.lifecycleState !== "ready") {
612200
- return lifecycleStatusFor(response);
612309
+ return lifecycleStatusFor(response, handle.requestId);
612201
612310
  }
612202
- return migrationStatusFor(response);
612311
+ return migrationStatusFor(response, handle.requestId);
612203
612312
  }
612204
612313
  };
612205
612314
  return {
@@ -646666,6 +646775,7 @@ init_esm();
646666
646775
  var METER_NAME10 = "superblocks.clark.context";
646667
646776
  var METRIC_LOAD_DURATION = "superblocks.clark.context.load_duration_seconds";
646668
646777
  var METRIC_PERSIST_DURATION = "superblocks.clark.context.persist_duration_seconds";
646778
+ var METRIC_LOAD_OUTCOMES = "superblocks.clark.context.load_outcomes_total";
646669
646779
  var METRIC_FILE_BYTES = "superblocks.clark.context.file_bytes";
646670
646780
  var METRIC_RESTORE_EMPTY_CREATED = "superblocks.clark.context.restore_empty_created_total";
646671
646781
  var METRIC_ATTACHMENT_PERSIST = "superblocks.clark.context.attachment_persist_total";
@@ -646759,6 +646869,10 @@ var ClarkContextMetrics = class {
646759
646869
  unit: "s",
646760
646870
  advice: { explicitBucketBoundaries: DURATION_BUCKETS_SECONDS2 }
646761
646871
  }),
646872
+ loadOutcomesCounter: meter.createCounter(METRIC_LOAD_OUTCOMES, {
646873
+ description: "Count of Clark context loads by final low-cardinality outcome.",
646874
+ unit: "{load}"
646875
+ }),
646762
646876
  restoreEmptyCreatedCounter: meter.createCounter(METRIC_RESTORE_EMPTY_CREATED, {
646763
646877
  description: "Count of remote context restore attempts that still created a new empty Clark context.",
646764
646878
  unit: "{restore}"
@@ -646815,14 +646929,20 @@ var ClarkContextMetrics = class {
646815
646929
  trigger: input.trigger
646816
646930
  });
646817
646931
  }
646818
- recordFileBytes(input) {
646819
- this.getInstruments().fileBytesHistogram.record(Math.max(0, input.bytes), {
646820
- operation: input.operation
646932
+ recordLoadOutcome(input) {
646933
+ this.getInstruments().loadOutcomesCounter.add(1, {
646934
+ outcome: input.outcome,
646935
+ source: input.source
646821
646936
  });
646822
646937
  }
646823
646938
  recordRestoreEmptyCreated() {
646824
646939
  this.getInstruments().restoreEmptyCreatedCounter.add(1);
646825
646940
  }
646941
+ recordFileBytes(input) {
646942
+ this.getInstruments().fileBytesHistogram.record(Math.max(0, input.bytes), {
646943
+ operation: input.operation
646944
+ });
646945
+ }
646826
646946
  recordAttachmentPersist(input) {
646827
646947
  this.getInstruments().attachmentPersistCounter.add(1, {
646828
646948
  status: input.status
@@ -646882,15 +647002,18 @@ function recordContextLoad(input) {
646882
647002
  function recordContextPersist(input) {
646883
647003
  clarkContextMetrics.recordPersist(input);
646884
647004
  }
647005
+ function recordContextLoadOutcome(input) {
647006
+ clarkContextMetrics.recordLoadOutcome(input);
647007
+ }
647008
+ function recordContextRestoreEmptyCreated() {
647009
+ clarkContextMetrics.recordRestoreEmptyCreated();
647010
+ }
646885
647011
  function recordContextFileBytes(input) {
646886
647012
  clarkContextMetrics.recordFileBytes(input);
646887
647013
  }
646888
647014
  function recordContextDocuments(input) {
646889
647015
  clarkContextMetrics.recordDocuments(input);
646890
647016
  }
646891
- function recordContextRestoreEmptyCreated() {
646892
- clarkContextMetrics.recordRestoreEmptyCreated();
646893
- }
646894
647017
  function recordAttachmentPersist(input) {
646895
647018
  clarkContextMetrics.recordAttachmentPersist(input);
646896
647019
  }
@@ -653049,15 +653172,17 @@ var ContextManagerV2 = class {
653049
653172
  logger18.info(`Loading context '${id2.name}' from storage...`);
653050
653173
  const loadStartedAt = performance.now();
653051
653174
  try {
653052
- const { record: record2, source: source2, migrationRan, migrationFailed } = await this.loadRecord(id2);
653175
+ const { record: record2, source: source2, migrationRan, migrationFailed, loadOutcome } = await this.loadRecord(id2);
653053
653176
  const loadMs = Math.round(performance.now() - loadStartedAt);
653177
+ const outcome = loadOutcome ?? this.getLoadOutcome(record2, source2);
653054
653178
  tracer3.annotate(span, {
653055
653179
  tags: { source: source2 },
653056
653180
  metadata: {
653057
653181
  durationMs: loadMs,
653058
653182
  messageCount: record2?.messages.length ?? 0,
653059
653183
  migrationFailed,
653060
- migrationRan
653184
+ migrationRan,
653185
+ outcome
653061
653186
  }
653062
653187
  });
653063
653188
  recordContextLoad({
@@ -653065,6 +653190,10 @@ var ContextManagerV2 = class {
653065
653190
  durationMs: loadMs,
653066
653191
  identity: metricIdentity
653067
653192
  });
653193
+ recordContextLoadOutcome({
653194
+ source: source2,
653195
+ outcome
653196
+ });
653068
653197
  return { record: record2, loadMs };
653069
653198
  } catch (error40) {
653070
653199
  tracer3.annotate(span, { error: error40 });
@@ -653137,13 +653266,36 @@ var ContextManagerV2 = class {
653137
653266
  }
653138
653267
  logger18.warn(`Remote restore attempted for '${id2.name}' but returned no context record; creating a new empty context`);
653139
653268
  recordContextRestoreEmptyCreated();
653269
+ return {
653270
+ record: void 0,
653271
+ source: "remote",
653272
+ migrationRan,
653273
+ migrationFailed,
653274
+ loadOutcome: "missing_archive"
653275
+ };
653140
653276
  } catch (err) {
653141
653277
  logger18.warn(`Remote restore fallback failed for '${id2.name}': ${err}`);
653142
653278
  recordContextRestoreEmptyCreated();
653279
+ return {
653280
+ record: void 0,
653281
+ source: "remote",
653282
+ migrationRan,
653283
+ migrationFailed,
653284
+ loadOutcome: "restore_failed"
653285
+ };
653143
653286
  }
653144
653287
  }
653145
653288
  return { record: void 0, source: "new", migrationRan, migrationFailed };
653146
653289
  }
653290
+ getLoadOutcome(record2, source2) {
653291
+ if (record2) {
653292
+ return record2.messages.length > 0 ? "success_non_empty" : "success_empty";
653293
+ }
653294
+ if (source2 === "remote") {
653295
+ return "missing_archive";
653296
+ }
653297
+ return "created_empty";
653298
+ }
653147
653299
  /**
653148
653300
  * Gets an already-loaded context without async operations.
653149
653301
  * For use by tools executing within an LLM stream where context is already loaded.
@@ -658449,7 +658601,7 @@ var PlaywrightMcpServerManager = class {
658449
658601
  this.logger.info(`Starting embedded Playwright MCP server: browser=${options8?.browser || "chromium"}, headless=${options8?.headless !== false}`);
658450
658602
  }
658451
658603
  try {
658452
- const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-IB6ZRN45.js");
658604
+ const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-UZV5UV7C.js");
658453
658605
  this.server = await startEmbeddedPlaywrightMcpServer({
658454
658606
  storageStatePath: options8?.storageStatePath,
658455
658607
  jwt: options8?.jwt,
@@ -658600,6 +658752,7 @@ var METER_NAME12 = "superblocks.migration";
658600
658752
  var METRIC_OUTCOMES2 = "migration.autodispatch.outcome";
658601
658753
  var BUSY_REASON_PREFIX = "busy:";
658602
658754
  var STATIC_OUTCOME_REASONS = /* @__PURE__ */ new Set([
658755
+ "already-settled",
658603
658756
  "already-triggered",
658604
658757
  "awaiting-interactive-response",
658605
658758
  "checklist-unavailable",
@@ -658773,6 +658926,70 @@ async function isMigrationSessionActive(appRootDirPath) {
658773
658926
  }
658774
658927
  }
658775
658928
 
658929
+ // ../../../vite-plugin-file-sync/dist/ai-service/migration-turns-log.js
658930
+ init_cjs_shims();
658931
+ import { appendFile as appendFile2, mkdir as mkdir15, readFile as readFile17, rm as rm12 } from "node:fs/promises";
658932
+ import { join as join24 } from "node:path";
658933
+ var SCRATCH_DIR_NAME3 = "scratch";
658934
+ var MIGRATION_TURNS_LOG_FILE = "migration-turns.jsonl";
658935
+ function migrationTurnsLogPath(appRootDirPath) {
658936
+ return join24(appRootDirPath, SCRATCH_DIR_NAME3, MIGRATION_TURNS_LOG_FILE);
658937
+ }
658938
+ function isRecord4(value2) {
658939
+ return typeof value2 === "object" && value2 !== null;
658940
+ }
658941
+ async function appendRecord(appRootDirPath, record2) {
658942
+ const logPath = migrationTurnsLogPath(appRootDirPath);
658943
+ await mkdir15(join24(appRootDirPath, SCRATCH_DIR_NAME3), { recursive: true });
658944
+ await appendFile2(logPath, `${JSON.stringify(record2)}
658945
+ `, "utf8");
658946
+ }
658947
+ async function recordMigrationTurnDispatched(appRootDirPath, entry) {
658948
+ await appendRecord(appRootDirPath, {
658949
+ at: (/* @__PURE__ */ new Date()).toISOString(),
658950
+ event: "dispatched",
658951
+ ...entry
658952
+ });
658953
+ }
658954
+ async function recordMigrationTurnSettled(appRootDirPath, entry) {
658955
+ await appendRecord(appRootDirPath, {
658956
+ at: (/* @__PURE__ */ new Date()).toISOString(),
658957
+ event: "settled",
658958
+ ...entry
658959
+ });
658960
+ }
658961
+ async function readMigrationTurnRecords(appRootDirPath) {
658962
+ let raw;
658963
+ try {
658964
+ raw = await readFile17(migrationTurnsLogPath(appRootDirPath), "utf8");
658965
+ } catch {
658966
+ return [];
658967
+ }
658968
+ const records = [];
658969
+ for (const line3 of raw.split("\n")) {
658970
+ const trimmed2 = line3.trim();
658971
+ if (!trimmed2) {
658972
+ continue;
658973
+ }
658974
+ try {
658975
+ const parsed = JSON.parse(trimmed2);
658976
+ if (!isRecord4(parsed) || parsed.event !== "dispatched" && parsed.event !== "settled") {
658977
+ continue;
658978
+ }
658979
+ records.push(parsed);
658980
+ } catch {
658981
+ }
658982
+ }
658983
+ return records;
658984
+ }
658985
+ async function hasSettledNormalMigrationTurn(appRootDirPath) {
658986
+ const records = await readMigrationTurnRecords(appRootDirPath);
658987
+ return records.some((record2) => record2.event === "settled" && record2.retryMode === "none" && record2.outcome === "success");
658988
+ }
658989
+ async function clearMigrationTurnsLog(appRootDirPath) {
658990
+ await rm12(migrationTurnsLogPath(appRootDirPath), { force: true });
658991
+ }
658992
+
658776
658993
  // ../../../vite-plugin-file-sync/dist/ai-service/policy-gate-step.js
658777
658994
  init_cjs_shims();
658778
658995
  var HIDDEN_TOOLS = /* @__PURE__ */ new Set(["reportReviewRun"]);
@@ -661372,7 +661589,7 @@ Before writing ANY API, you MUST:
661372
661589
  - Do NOT read SDK documentation directly from filesystem files; fetch documentation through \`getSdkApiDocs\` only
661373
661590
 
661374
661591
  **Trace Metadata:**
661375
- All integration client methods accept an optional \`metadata\` parameter as the last argument: \`{ label?: string, description?: string }\`. When \`includeDiagnostics\` is enabled, this metadata appears in the trace view. Always include a \`label\` on each integration call to make traces readable. Example: \`ctx.integrations.db.query(sql, Schema, params, { label: "Fetch active users" })\`.
661592
+ All integration client methods accept an optional \`metadata\` parameter as the last argument: \`{ label?: string, description?: string }\`. When \`includeDiagnostics\` is enabled, this metadata appears in the trace view. Always include a \`label\` on each integration call to make traces readable. Example: \`ctx.integrations.orders_db.query(sql, Schema, params, { label: "Fetch active users" })\`.
661376
661593
 
661377
661594
  **CRITICAL - Method Validation:**
661378
661595
  Before calling ANY integration client method, you MUST:
@@ -661392,22 +661609,23 @@ Before creating APIs with new integrations:
661392
661609
  </integrations_and_data_sources>
661393
661610
 
661394
661611
  <integration_ids>
661395
- **CRITICAL: Integration IDs**
661612
+ **CRITICAL: Integration IDs and map keys**
661396
661613
 
661397
661614
  When using integrations in SDK APIs:
661398
661615
  1. **Use integration IDs** (UUIDs), not display names - IDs are stable identifiers that won't break if integrations are renamed
661399
661616
  2. **Get the ID from the integrations panel** - each integration has a unique ID visible in its settings
661400
661617
  3. **Store IDs in constants** with descriptive names at the top of the API file for clarity
661618
+ 4. **Choose a descriptive \`integrations\` map key** \u2014 a valid JS identifier derived from the integration's display name / Native DB \`logicalName\` (lowercase snake_case). Normalize: lowercase \u2192 replace non-alphanumeric with \`_\` \u2192 collapse \`_\` \u2192 if empty/starts with a digit/reserved word, prefix \`db_\`. Examples: \`pokemon_tracker\` \u2192 \`pokemon_tracker\`; \`Orders DB\` \u2192 \`orders_db\`; \`2024-orders\` \u2192 \`db_2024_orders\`. If two integrations would share a key, disambiguate (e.g. \`orders_db\` / \`orders_db_2\`). Do **not** use a generic placeholder like \`db\` when the integration already has a meaningful name \u2014 that key is what appears in generated code and TraceView. SDK README examples that use \`db\` are placeholders only.
661401
661619
 
661402
661620
  Example:
661403
661621
  \`\`\`typescript
661404
661622
  // Store integration IDs in constants with descriptive names
661405
- const PROD_POSTGRES = "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr";
661623
+ const ORDERS_DB = "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr";
661406
661624
  const OPS_SLACK = "e5f6g7h8-1234-56ab-cdef-ghijklmnopqr";
661407
661625
 
661408
661626
  export default api({
661409
661627
  integrations: {
661410
- db: postgres(PROD_POSTGRES),
661628
+ orders_db: postgres(ORDERS_DB),
661411
661629
  notifier: slack(OPS_SLACK),
661412
661630
  },
661413
661631
  // ...
@@ -661416,7 +661634,7 @@ export default api({
661416
661634
 
661417
661635
  **NEVER use integration display names** like \`postgres("Production Postgres")\` - always use the UUID.
661418
661636
 
661419
- **Access in run(): use \`ctx.integrations.<name>\` pattern.** In your API \`run\` function, access each integration by the **key name** you declared in \`integrations\`, not by integration ID. Example: \`integrations: { db: postgres(PROD_POSTGRES), notifier: slack(OPS_SLACK) }\` \u2192 use \`ctx.integrations.db\` and \`ctx.integrations.notifier\`. The integration ID (UUID) is only for the declaration (e.g. \`postgres(UUID)\`); access is always \`ctx.integrations.<key>\`.
661637
+ **Access in run(): use \`ctx.integrations.<key>\` pattern.** In your API \`run\` function, access each integration by the **key name** you declared in \`integrations\`, not by integration ID. Example: \`integrations: { orders_db: postgres(ORDERS_DB), notifier: slack(OPS_SLACK) }\` \u2192 use \`ctx.integrations.orders_db\` and \`ctx.integrations.notifier\`. The integration ID (UUID) is only for the declaration (e.g. \`postgres(UUID)\`); access is always \`ctx.integrations.<key>\`.
661420
661638
  </integration_ids>
661421
661639
 
661422
661640
  <creating_and_editing_apis>
@@ -661463,7 +661681,7 @@ You must NEVER attempt to rely on frontend data for security-critical operations
661463
661681
  import { api, z, postgres } from "@superblocksteam/sdk-api";
661464
661682
 
661465
661683
  // Integration IDs from the integrations panel - store in constants with descriptive names
661466
- const PROD_POSTGRES = "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr";
661684
+ const USERS_DB = "a1b2c3d4-5678-90ab-cdef-ghijklmnopqr";
661467
661685
 
661468
661686
  const UserSchema = z.object({
661469
661687
  id: z.string(),
@@ -661480,9 +661698,10 @@ export default api({
661480
661698
  // REQUIRED: plain-language summary for non-technical readers
661481
661699
  description: "Looks up users from the production database, with optional filtering by email or name. Returns a list of matching users.",
661482
661700
 
661483
- // Declare integrations upfront using their IDs for type safety
661701
+ // Declare integrations upfront using their IDs for type safety.
661702
+ // Key = descriptive snake_case from the integration/database name (not a generic "db").
661484
661703
  integrations: {
661485
- db: postgres(PROD_POSTGRES),
661704
+ users_db: postgres(USERS_DB),
661486
661705
  },
661487
661706
 
661488
661707
  input: z.object({
@@ -661495,10 +661714,10 @@ export default api({
661495
661714
  }),
661496
661715
 
661497
661716
  async run(ctx, { email, name }) {
661498
- // ctx.integrations.db is fully typed as PostgresClient
661717
+ // ctx.integrations.users_db is fully typed as PostgresClient
661499
661718
  // All integration methods accept an optional metadata arg as the last parameter
661500
661719
  // for trace labeling: { label?: string, description?: string }
661501
- const users = await ctx.integrations.db.query(
661720
+ const users = await ctx.integrations.users_db.query(
661502
661721
  "SELECT id, email, name FROM users WHERE ($1::text IS NULL OR email = $1) AND ($2::text IS NULL OR name = $2)",
661503
661722
  UserSchema,
661504
661723
  [email, name],
@@ -662777,7 +662996,7 @@ var DEFAULT_SAFETY_GUIDANCE = (
662777
662996
  // ../../../vite-plugin-file-sync/dist/ai-service/attachments/text-upload-artifacts.js
662778
662997
  init_cjs_shims();
662779
662998
  import { randomUUID as randomUUID3 } from "node:crypto";
662780
- import { lstat as lstat5, mkdir as mkdir15, readdir as readdir10, realpath as realpath4, rm as rm12, writeFile as writeFile13 } from "node:fs/promises";
662999
+ import { lstat as lstat5, mkdir as mkdir16, readdir as readdir10, realpath as realpath4, rm as rm13, writeFile as writeFile13 } from "node:fs/promises";
662781
663000
  import path48 from "node:path";
662782
663001
  var TEXT_UPLOAD_ARTIFACT_ROOT = path48.join(".superblocks", "uploads");
662783
663002
  var MAX_TEXT_UPLOAD_ARTIFACT_BYTES = 10 * 1024 * 1024;
@@ -662859,7 +663078,7 @@ var TextUploadArtifactMaterializer = class {
662859
663078
  });
662860
663079
  return false;
662861
663080
  }
662862
- await mkdir15(outputRoot, { recursive: true });
663081
+ await mkdir16(outputRoot, { recursive: true });
662863
663082
  const [resolvedAppRoot, resolvedOutputRoot] = await Promise.all([
662864
663083
  realpath4(this.appRootDirPath),
662865
663084
  realpath4(outputRoot)
@@ -662888,7 +663107,7 @@ var TextUploadArtifactMaterializer = class {
662888
663107
  return;
662889
663108
  }
662890
663109
  entries.sort();
662891
- await Promise.all(entries.slice(0, entries.length - keepLast).map((entry) => rm12(path48.join(uploadsDir, entry), { force: true, recursive: true })));
663110
+ await Promise.all(entries.slice(0, entries.length - keepLast).map((entry) => rm13(path48.join(uploadsDir, entry), { force: true, recursive: true })));
662892
663111
  }
662893
663112
  };
662894
663113
  function getUploadedAttachmentArtifactKey(attachment) {
@@ -664698,6 +664917,7 @@ var TaskStore = class {
664698
664917
  message: "message" in initialStatus ? initialStatus.message : void 0,
664699
664918
  result: initialStatus.state === "completed" ? initialStatus.result : void 0,
664700
664919
  error: initialStatus.state === "failed" ? initialStatus.error : void 0,
664920
+ detail: initialStatus.state === "failed" ? initialStatus.detail : void 0,
664701
664921
  ownerUserId: options8.ownerUserId
664702
664922
  };
664703
664923
  this.tasks.set(taskId, task);
@@ -664826,7 +665046,8 @@ var TaskStore = class {
664826
665046
  message: task.message,
664827
665047
  ageMs: Math.max(0, this.clock.now() - startedAtMs),
664828
665048
  completedAt: task.state === "running" ? void 0 : new Date(this.clock.now()).toISOString(),
664829
- error: task.error
665049
+ error: task.error,
665050
+ detail: task.detail
664830
665051
  };
664831
665052
  }
664832
665053
  async spawnPollLoop(taskId, type, controller) {
@@ -664858,6 +665079,7 @@ var TaskStore = class {
664858
665079
  task.message = "message" in status ? status.message : task.message;
664859
665080
  task.result = status.state === "completed" ? status.result : void 0;
664860
665081
  task.error = status.state === "failed" ? status.error : void 0;
665082
+ task.detail = status.state === "failed" ? status.detail : void 0;
664861
665083
  this.emit(taskId, status, task);
664862
665084
  }
664863
665085
  emit(taskId, status, task) {
@@ -664875,7 +665097,11 @@ var TaskStore = class {
664875
665097
  case "completed":
664876
665098
  return { state: "completed", result: task.result };
664877
665099
  case "failed":
664878
- return { state: "failed", error: task.error ?? "unknown error" };
665100
+ return {
665101
+ state: "failed",
665102
+ error: task.error ?? "unknown error",
665103
+ ...task.detail !== void 0 ? { detail: task.detail } : {}
665104
+ };
664879
665105
  case "cancelled":
664880
665106
  return { state: "cancelled" };
664881
665107
  }
@@ -667443,6 +667669,13 @@ var AiService = class extends import_shared55.TracedEventEmitter {
667443
667669
  if (request.retryMode === "focused-debug") {
667444
667670
  this.migrationTurnTriggered = false;
667445
667671
  }
667672
+ if (request.retryMode !== "focused-debug") {
667673
+ if (await hasSettledNormalMigrationTurn(this.appRootDirPath)) {
667674
+ recordAutoDispatchOutcome("already-settled");
667675
+ this.getLogger().info("[ai-service] Skipping v2\u2192v3 migration turn \u2014 prior normal turn completed successfully", { appRootDirPath: this.appRootDirPath });
667676
+ return { dispatched: false, reason: "already-settled" };
667677
+ }
667678
+ }
667446
667679
  if (this.migrationTurnTriggered) {
667447
667680
  recordAutoDispatchOutcome("already-triggered");
667448
667681
  return { dispatched: false, reason: "already-triggered" };
@@ -667501,6 +667734,8 @@ var AiService = class extends import_shared55.TracedEventEmitter {
667501
667734
  mode: AiMode.BUILD
667502
667735
  };
667503
667736
  const promptId = randomUUID5();
667737
+ const retryMode = request.retryMode === "focused-debug" ? "focused-debug" : "none";
667738
+ const triggeredBy = request.triggeredBy ?? (request.retryMode === "focused-debug" ? "focused-debug" : "ui-rpc");
667504
667739
  const branchName = this._syncContextProvider?.getBranchName();
667505
667740
  const migrationUsageMetadata = {
667506
667741
  applicationId: this.config.applicationId,
@@ -667508,8 +667743,8 @@ var AiService = class extends import_shared55.TracedEventEmitter {
667508
667743
  migrationSource: "superblocks_2_0",
667509
667744
  origin: "app_migration",
667510
667745
  pendingSeedApiCount,
667511
- retryMode: request.retryMode ?? "none",
667512
- triggeredBy: request.triggeredBy ?? (request.retryMode === "focused-debug" ? "focused-debug" : "ui-rpc")
667746
+ retryMode,
667747
+ triggeredBy
667513
667748
  };
667514
667749
  this.clark.updateContext((context2) => ({
667515
667750
  ...context2,
@@ -667518,17 +667753,38 @@ var AiService = class extends import_shared55.TracedEventEmitter {
667518
667753
  llmConfig: migrationLlmConfig
667519
667754
  }));
667520
667755
  const transitionTo = transitionFrom(this.clark);
667756
+ let settleOutcome = "success";
667521
667757
  transitionTo({
667522
667758
  type: USER_SENT_PROMPT,
667523
667759
  request: generateRequest,
667524
667760
  internal: true,
667525
667761
  visibleInChatHistory: true
667526
667762
  }).catch((error40) => {
667763
+ settleOutcome = "error";
667527
667764
  this.getLogger().error("[ai-service] Migration translation turn failed", getErrorMeta2(error40));
667528
- }).finally(() => {
667765
+ }).finally(async () => {
667766
+ try {
667767
+ await recordMigrationTurnSettled(this.appRootDirPath, {
667768
+ outcome: settleOutcome,
667769
+ promptId,
667770
+ retryMode
667771
+ });
667772
+ } catch (error40) {
667773
+ this.getLogger().error(`[ai-service] Failed to record migration turn settlement (promptId=${promptId})`, getErrorMeta2(error40));
667774
+ }
667529
667775
  this.migrationTurnTriggered = false;
667530
667776
  this.appShell.setApiHandlerEnabled(true);
667531
667777
  });
667778
+ try {
667779
+ await recordMigrationTurnDispatched(this.appRootDirPath, {
667780
+ pendingSeedApiCount,
667781
+ promptId,
667782
+ retryMode,
667783
+ triggeredBy
667784
+ });
667785
+ } catch (error40) {
667786
+ this.getLogger().error(`[ai-service] Failed to record migration turn dispatch (promptId=${promptId})`, getErrorMeta2(error40));
667787
+ }
667532
667788
  recordAutoDispatchOutcome("dispatched");
667533
667789
  return { dispatched: true };
667534
667790
  }
@@ -672151,7 +672407,7 @@ var import_shared67 = __toESM(require_dist2());
672151
672407
  // ../../../vite-plugin-file-sync/package.json
672152
672408
  var package_default2 = {
672153
672409
  name: "@superblocksteam/vite-plugin-file-sync",
672154
- version: "2.0.142-next.0",
672410
+ version: "2.0.142-next.2",
672155
672411
  keywords: [
672156
672412
  "vite-plugin"
672157
672413
  ],
@@ -672648,9 +672904,9 @@ init_cjs_shims();
672648
672904
  init_cjs_shims();
672649
672905
  var import_ws = __toESM(require_ws());
672650
672906
  var import_shared73 = __toESM(require_dist2());
672651
- import { cp as cp3, mkdir as mkdir21, mkdtemp as mkdtemp2, rm as rm15 } from "node:fs/promises";
672907
+ import { cp as cp3, mkdir as mkdir22, mkdtemp as mkdtemp2, rm as rm16 } from "node:fs/promises";
672652
672908
  import { tmpdir as tmpdir3 } from "node:os";
672653
- import { join as join28 } from "node:path";
672909
+ import { join as join29 } from "node:path";
672654
672910
 
672655
672911
  // ../../../vite-plugin-file-sync/dist/ai-service/recording/recorders/socket-recorder.js
672656
672912
  init_cjs_shims();
@@ -672695,8 +672951,8 @@ var import_shared68 = __toESM(require_dist2());
672695
672951
 
672696
672952
  // ../../../vite-plugin-file-sync/dist/git-service/ensure-workflow-file.js
672697
672953
  init_cjs_shims();
672698
- import { access as access7, mkdir as mkdir19, writeFile as writeFile17 } from "node:fs/promises";
672699
- import { dirname as dirname17, join as join27 } from "node:path";
672954
+ import { access as access7, mkdir as mkdir20, writeFile as writeFile17 } from "node:fs/promises";
672955
+ import { dirname as dirname17, join as join28 } from "node:path";
672700
672956
  async function ensureWorkflowFile(gitService, config4, superblocksBaseUrl) {
672701
672957
  const operationName = `ensure-${config4.providerName}-workflow-file`;
672702
672958
  let remoteUrl;
@@ -672716,7 +672972,7 @@ async function ensureWorkflowFile(gitService, config4, superblocksBaseUrl) {
672716
672972
  if (!config4.isProviderRemoteUrl(remoteUrl)) {
672717
672973
  return { created: false };
672718
672974
  }
672719
- const workflowPath = join27(gitService.workDir, config4.workflowPath);
672975
+ const workflowPath = join28(gitService.workDir, config4.workflowPath);
672720
672976
  try {
672721
672977
  await access7(workflowPath);
672722
672978
  return { created: false };
@@ -672733,7 +672989,7 @@ async function ensureWorkflowFile(gitService, config4, superblocksBaseUrl) {
672733
672989
  gitOutcome: "degraded"
672734
672990
  });
672735
672991
  }
672736
- await mkdir19(dirname17(workflowPath), { recursive: true });
672992
+ await mkdir20(dirname17(workflowPath), { recursive: true });
672737
672993
  await writeFile17(workflowPath, config4.buildWorkflowFromBaseUrl(resolvedUrl), "utf-8");
672738
672994
  getLogger3().info(`[git] ${operationName}: created ${config4.workflowPath}`);
672739
672995
  return { created: true };
@@ -672795,7 +673051,7 @@ var import_shared72 = __toESM(require_dist2());
672795
673051
 
672796
673052
  // ../../../vite-plugin-file-sync/dist/git-service/managed-excludes.js
672797
673053
  init_cjs_shims();
672798
- import { mkdir as mkdir20, readFile as readFile19, writeFile as writeFile18 } from "node:fs/promises";
673054
+ import { mkdir as mkdir21, readFile as readFile20, writeFile as writeFile18 } from "node:fs/promises";
672799
673055
  import path55 from "node:path";
672800
673056
  var SUPERBLOCKS_DIR = ".superblocks";
672801
673057
  var MANAGED_GIT_EXCLUDE_PATTERNS = [
@@ -672848,12 +673104,12 @@ async function ensureManagedGitExcludes(gitService) {
672848
673104
  try {
672849
673105
  const relPath = (await gitService.raw(["rev-parse", "--git-path", "info/exclude"])).trim();
672850
673106
  const excludePath = path55.isAbsolute(relPath) ? relPath : path55.join(gitService.workDir, relPath);
672851
- const existing = await readFile19(excludePath, "utf8").catch(() => "");
673107
+ const existing = await readFile20(excludePath, "utf8").catch(() => "");
672852
673108
  const next2 = mergeManagedExcludeBlock(existing);
672853
673109
  if (next2 === existing) {
672854
673110
  return;
672855
673111
  }
672856
- await mkdir20(path55.dirname(excludePath), { recursive: true });
673112
+ await mkdir21(path55.dirname(excludePath), { recursive: true });
672857
673113
  await writeFile18(excludePath, next2, "utf8");
672858
673114
  getLogger3().info("[git] applied managed git excludes", {
672859
673115
  gitCategory: "setup",
@@ -673025,7 +673281,7 @@ async function rollbackLastCommit({ gitService, expectedSha }) {
673025
673281
  }
673026
673282
 
673027
673283
  // ../../../vite-plugin-file-sync/dist/socket-manager.js
673028
- var SB_WORKTREE_SNAPSHOTS_DIR2 = join28(tmpdir3(), "sb-worktree-snapshots");
673284
+ var SB_WORKTREE_SNAPSHOTS_DIR2 = join29(tmpdir3(), "sb-worktree-snapshots");
673029
673285
  function extractCallerUserId(peerAuthorization) {
673030
673286
  if (!peerAuthorization)
673031
673287
  return void 0;
@@ -673837,7 +674093,7 @@ var SocketManager = class extends import_shared73.TracedEventEmitter {
673837
674093
  }
673838
674094
  }
673839
674095
  if (serviceToDisconnect) {
673840
- const gitDir = join28(serviceToDisconnect.workDir, ".git");
674096
+ const gitDir = join29(serviceToDisconnect.workDir, ".git");
673841
674097
  let checkoutBranchBeforeDisconnect = import_shared73.DEFAULT_NON_GIT_BRANCH;
673842
674098
  try {
673843
674099
  checkoutBranchBeforeDisconnect = await serviceToDisconnect.getDefaultBranch();
@@ -673863,7 +674119,7 @@ var SocketManager = class extends import_shared73.TracedEventEmitter {
673863
674119
  });
673864
674120
  }
673865
674121
  try {
673866
- await rm15(gitDir, { recursive: true, force: true });
674122
+ await rm16(gitDir, { recursive: true, force: true });
673867
674123
  } catch (rmErr) {
673868
674124
  getLogger3().warn("[git] gitDisconnect failed to remove .git directory; manual cleanup may be required", {
673869
674125
  gitCategory: "setup",
@@ -673993,8 +674249,8 @@ var SocketManager = class extends import_shared73.TracedEventEmitter {
673993
674249
  });
673994
674250
  }
673995
674251
  }
673996
- const worktreeBase = await mkdtemp2(join28(tmpdir3(), "sb-main-deploy-"));
673997
- const worktreePath = join28(worktreeBase, "worktree");
674252
+ const worktreeBase = await mkdtemp2(join29(tmpdir3(), "sb-main-deploy-"));
674253
+ const worktreePath = join29(worktreeBase, "worktree");
673998
674254
  try {
673999
674255
  await readyGitService.raw([
674000
674256
  "worktree",
@@ -674003,16 +674259,16 @@ var SocketManager = class extends import_shared73.TracedEventEmitter {
674003
674259
  worktreePath,
674004
674260
  sha
674005
674261
  ]);
674006
- await rm15(join28(worktreePath, ".git"), {
674262
+ await rm16(join29(worktreePath, ".git"), {
674007
674263
  force: true,
674008
674264
  recursive: true
674009
674265
  });
674010
674266
  const { directoryHash } = await syncService.uploadSnapshotToDbfs(worktreePath);
674011
- const snapshotPath = join28(SB_WORKTREE_SNAPSHOTS_DIR2, encodeURIComponent(directoryHash));
674012
- await mkdir21(SB_WORKTREE_SNAPSHOTS_DIR2, {
674267
+ const snapshotPath = join29(SB_WORKTREE_SNAPSHOTS_DIR2, encodeURIComponent(directoryHash));
674268
+ await mkdir22(SB_WORKTREE_SNAPSHOTS_DIR2, {
674013
674269
  recursive: true
674014
674270
  });
674015
- await rm15(snapshotPath, {
674271
+ await rm16(snapshotPath, {
674016
674272
  recursive: true,
674017
674273
  force: true
674018
674274
  });
@@ -674038,7 +674294,7 @@ var SocketManager = class extends import_shared73.TracedEventEmitter {
674038
674294
  ...getErrorMeta2(cleanupErr)
674039
674295
  });
674040
674296
  }
674041
- await rm15(worktreeBase, {
674297
+ await rm16(worktreeBase, {
674042
674298
  recursive: true,
674043
674299
  force: true
674044
674300
  });
@@ -676128,8 +676384,8 @@ function createIdResolver(config4, environment) {
676128
676384
  // ../../../vite-plugin-file-sync/dist/router-parser.js
676129
676385
  init_cjs_shims();
676130
676386
  var import_parser14 = __toESM(require_lib8());
676131
- import { readFile as readFile20, access as access8, stat as stat8, readdir as readdir12 } from "node:fs/promises";
676132
- import { join as join29, resolve as resolve12, dirname as dirname18, relative as relative11 } from "node:path";
676387
+ import { readFile as readFile21, access as access8, stat as stat8, readdir as readdir12 } from "node:fs/promises";
676388
+ import { join as join30, resolve as resolve12, dirname as dirname18, relative as relative11 } from "node:path";
676133
676389
 
676134
676390
  // ../../../../node_modules/.pnpm/mlly@1.8.0/node_modules/mlly/dist/index.mjs
676135
676391
  init_cjs_shims();
@@ -682299,7 +682555,7 @@ async function resolveSourceFile(jsPath) {
682299
682555
  "index.jsx",
682300
682556
  "index.js"
682301
682557
  ]) {
682302
- const indexPath = join29(jsPath, indexFile);
682558
+ const indexPath = join30(jsPath, indexFile);
682303
682559
  try {
682304
682560
  if ((await stat8(indexPath)).isFile()) {
682305
682561
  return indexPath;
@@ -682389,7 +682645,7 @@ async function findAllTsFiles(rootDir) {
682389
682645
  try {
682390
682646
  const entries = await readdir12(dir, { withFileTypes: true });
682391
682647
  for (const entry of entries) {
682392
- const fullPath = join29(dir, entry.name);
682648
+ const fullPath = join30(dir, entry.name);
682393
682649
  if (entry.name === "node_modules" || entry.name.startsWith(".")) {
682394
682650
  continue;
682395
682651
  }
@@ -682420,10 +682676,10 @@ async function findRouterFile(rootDir) {
682420
682676
  }
682421
682677
  }
682422
682678
  for (const conventionalPath of CONVENTIONAL_ROUTER_PATHS) {
682423
- const fullPath = join29(rootDir, conventionalPath);
682679
+ const fullPath = join30(rootDir, conventionalPath);
682424
682680
  try {
682425
682681
  await access8(fullPath);
682426
- const content19 = await readFile20(fullPath, "utf-8");
682682
+ const content19 = await readFile21(fullPath, "utf-8");
682427
682683
  if (hasCreateBrowserRouter(content19)) {
682428
682684
  const stats = await stat8(fullPath);
682429
682685
  cachedRouterFileLocation = { path: fullPath, mtime: stats.mtimeMs };
@@ -682438,7 +682694,7 @@ async function findRouterFile(rootDir) {
682438
682694
  const allTsFiles = await findAllTsFiles(rootDir);
682439
682695
  for (const file2 of allTsFiles) {
682440
682696
  try {
682441
- const content19 = await readFile20(file2, "utf-8");
682697
+ const content19 = await readFile21(file2, "utf-8");
682442
682698
  if (hasCreateBrowserRouter(content19)) {
682443
682699
  const stats = await stat8(file2);
682444
682700
  cachedRouterFileLocation = { path: file2, mtime: stats.mtimeMs };
@@ -682586,7 +682842,7 @@ function extractAllImports(content19) {
682586
682842
  }
682587
682843
  async function parseRouterFile(routerFilePath, rootDir) {
682588
682844
  try {
682589
- const content19 = await readFile20(routerFilePath, "utf-8");
682845
+ const content19 = await readFile21(routerFilePath, "utf-8");
682590
682846
  const { createBrowserRouterAliases, namespaceImports } = extractReactRouterImports(content19);
682591
682847
  const allImports = extractAllImports(content19);
682592
682848
  const ast = (0, import_parser14.parse)(content19, {
@@ -683366,7 +683622,7 @@ function cleanDoc(doc) {
683366
683622
  return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
683367
683623
  }
683368
683624
  function replaceEndOfLine(doc, replacement = literalline) {
683369
- return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join30(replacement, currentDoc.split("\n")) : currentDoc);
683625
+ return mapDoc(doc, (currentDoc) => typeof currentDoc === "string" ? join31(replacement, currentDoc.split("\n")) : currentDoc);
683370
683626
  }
683371
683627
  function canBreakFn(doc) {
683372
683628
  if (doc.type === DOC_TYPE_LINE) {
@@ -683508,7 +683764,7 @@ function indentIfBreak(contents2, options8) {
683508
683764
  negate: options8.negate
683509
683765
  };
683510
683766
  }
683511
- function join30(separator, docs) {
683767
+ function join31(separator, docs) {
683512
683768
  assertDoc(separator);
683513
683769
  assertDocArray(docs);
683514
683770
  const parts = [];
@@ -684220,7 +684476,7 @@ function printDocToString(doc, options8) {
684220
684476
  }
684221
684477
  }
684222
684478
  var builders = {
684223
- join: join30,
684479
+ join: join31,
684224
684480
  line,
684225
684481
  softline,
684226
684482
  hardline,
@@ -696491,7 +696747,7 @@ function parse42(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
696491
696747
  }
696492
696748
  return res;
696493
696749
  }
696494
- async function readFile21(file2) {
696750
+ async function readFile22(file2) {
696495
696751
  if (isUrlString(file2)) {
696496
696752
  file2 = new URL(file2);
696497
696753
  }
@@ -696504,7 +696760,7 @@ async function readFile21(file2) {
696504
696760
  throw new Error(`Unable to read '${file2}': ${error40.message}`);
696505
696761
  }
696506
696762
  }
696507
- var read_file_default = readFile21;
696763
+ var read_file_default = readFile22;
696508
696764
  async function readJson(file2) {
696509
696765
  const content19 = await read_file_default(file2);
696510
696766
  try {
@@ -696545,7 +696801,7 @@ var parseYaml3;
696545
696801
  async function loadYaml(file2) {
696546
696802
  const content19 = await read_file_default(file2);
696547
696803
  if (!parseYaml3) {
696548
- ({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-UZZWIT6V.js"));
696804
+ ({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-FXHOCIJS.js"));
696549
696805
  }
696550
696806
  try {
696551
696807
  return parseYaml3(content19);
@@ -699174,7 +699430,7 @@ var {
699174
699430
  breakParent: breakParent2,
699175
699431
  hardline: hardline2,
699176
699432
  indent: indent3,
699177
- join: join32,
699433
+ join: join33,
699178
699434
  line: line22,
699179
699435
  lineSuffix: lineSuffix2
699180
699436
  } = builders;
@@ -701939,7 +702195,7 @@ function createParsersAndPrinters(modules) {
701939
702195
  }
701940
702196
  var estreePlugin = createParsersAndPrinters([
701941
702197
  {
701942
- importPlugin: () => import("./estree-CAYUOQBQ.js"),
702198
+ importPlugin: () => import("./estree-CBQZDSXJ.js"),
701943
702199
  printers: ["estree", "estree-json"]
701944
702200
  }
701945
702201
  ]);
@@ -701963,11 +702219,11 @@ var languages = [
701963
702219
  ];
701964
702220
  var { parsers: parsers12, printers } = createParsersAndPrinters([
701965
702221
  {
701966
- importPlugin: () => import("./acorn-5ISNX2MF.js"),
702222
+ importPlugin: () => import("./acorn-GSO23EEG.js"),
701967
702223
  parsers: ["acorn", "espree"]
701968
702224
  },
701969
702225
  {
701970
- importPlugin: () => import("./angular-O6AH53X4.js"),
702226
+ importPlugin: () => import("./angular-ZHRDU23D.js"),
701971
702227
  parsers: [
701972
702228
  "__ng_action",
701973
702229
  "__ng_binding",
@@ -701976,7 +702232,7 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
701976
702232
  ]
701977
702233
  },
701978
702234
  {
701979
- importPlugin: () => import("./babel-ZCWHS6EQ.js"),
702235
+ importPlugin: () => import("./babel-ZSNVX2PZ.js"),
701980
702236
  parsers: [
701981
702237
  "babel",
701982
702238
  "babel-flow",
@@ -701995,44 +702251,44 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
701995
702251
  ]
701996
702252
  },
701997
702253
  {
701998
- importPlugin: () => import("./flow-OXBFZA6O.js"),
702254
+ importPlugin: () => import("./flow-S3H3Y74D.js"),
701999
702255
  parsers: ["flow"]
702000
702256
  },
702001
702257
  {
702002
- importPlugin: () => import("./glimmer-5XUQEU3N.js"),
702258
+ importPlugin: () => import("./glimmer-WTH53HRW.js"),
702003
702259
  parsers: ["glimmer"],
702004
702260
  printers: ["glimmer"]
702005
702261
  },
702006
702262
  {
702007
- importPlugin: () => import("./graphql-F6OICFXZ.js"),
702263
+ importPlugin: () => import("./graphql-PODLQZYP.js"),
702008
702264
  parsers: ["graphql"],
702009
702265
  printers: ["graphql"]
702010
702266
  },
702011
702267
  {
702012
- importPlugin: () => import("./html-BFYHSX7V.js"),
702268
+ importPlugin: () => import("./html-SUAQB3PV.js"),
702013
702269
  parsers: ["html", "angular", "vue", "lwc", "mjml"],
702014
702270
  printers: ["html"]
702015
702271
  },
702016
702272
  {
702017
- importPlugin: () => import("./markdown-XMQ7A2L7.js"),
702273
+ importPlugin: () => import("./markdown-LMLFITGX.js"),
702018
702274
  parsers: ["markdown", "mdx", "remark"],
702019
702275
  printers: ["mdast"]
702020
702276
  },
702021
702277
  {
702022
- importPlugin: () => import("./meriyah-BM2JQ6C3.js"),
702278
+ importPlugin: () => import("./meriyah-K62VQEL5.js"),
702023
702279
  parsers: ["meriyah"]
702024
702280
  },
702025
702281
  {
702026
- importPlugin: () => import("./postcss-R3X7PEXV.js"),
702282
+ importPlugin: () => import("./postcss-SRWVCB56.js"),
702027
702283
  parsers: ["css", "less", "scss"],
702028
702284
  printers: ["postcss"]
702029
702285
  },
702030
702286
  {
702031
- importPlugin: () => import("./typescript-K5K6KZAA.js"),
702287
+ importPlugin: () => import("./typescript-F65AOVRT.js"),
702032
702288
  parsers: ["typescript"]
702033
702289
  },
702034
702290
  {
702035
- importPlugin: () => import("./yaml-UZZWIT6V.js"),
702291
+ importPlugin: () => import("./yaml-FXHOCIJS.js"),
702036
702292
  parsers: ["yaml"],
702037
702293
  printers: ["yaml"]
702038
702294
  }
@@ -702771,7 +703027,7 @@ var FileSystemManager = class extends import_shared76.TracedEventEmitter {
702771
703027
  return {
702772
703028
  type: "tsx",
702773
703029
  path: f2,
702774
- content: readFile22(f2)
703030
+ content: readFile23(f2)
702775
703031
  };
702776
703032
  }),
702777
703033
  ...yamlFiles.map((f2) => {
@@ -702969,7 +703225,7 @@ var FileSystemManager = class extends import_shared76.TracedEventEmitter {
702969
703225
  }
702970
703226
  switch (event) {
702971
703227
  case "add": {
702972
- const file2 = await readFile22(normalizedFilePath);
703228
+ const file2 = await readFile23(normalizedFilePath);
702973
703229
  if (typeof file2 !== "string")
702974
703230
  return;
702975
703231
  switch (fileType.type) {
@@ -703004,7 +703260,7 @@ var FileSystemManager = class extends import_shared76.TracedEventEmitter {
703004
703260
  if (!fileType2 || !normalizedFilePath.startsWith(rootPath)) {
703005
703261
  return;
703006
703262
  }
703007
- const data3 = await readFile22(normalizedFilePath);
703263
+ const data3 = await readFile23(normalizedFilePath);
703008
703264
  if (typeof data3 !== "string")
703009
703265
  return;
703010
703266
  if (this.routerFilePath && normalizedFilePath === this.routerFilePath) {
@@ -703562,7 +703818,7 @@ var FileSystemManager = class extends import_shared76.TracedEventEmitter {
703562
703818
  return filePath.includes("/skills/app/") && filePath.endsWith(".md");
703563
703819
  }
703564
703820
  };
703565
- async function readFile22(path81) {
703821
+ async function readFile23(path81) {
703566
703822
  try {
703567
703823
  return await fs26.readFile(path81, "utf-8");
703568
703824
  } catch (e) {
@@ -703870,14 +704126,14 @@ function getIndexHtml2(features, entryPoint, viewMode = "dev") {
703870
704126
  init_cjs_shims();
703871
704127
  var import_body_parser = __toESM(require_body_parser());
703872
704128
  var import_yaml11 = __toESM(require_dist());
703873
- import { access as access9, mkdir as mkdir23, readFile as readFile27, readdir as readdir16, rm as rm17, writeFile as writeFile20 } from "node:fs/promises";
703874
- import { dirname as dirname24, join as join39 } from "node:path";
704129
+ import { access as access9, mkdir as mkdir24, readFile as readFile28, readdir as readdir16, rm as rm18, writeFile as writeFile20 } from "node:fs/promises";
704130
+ import { dirname as dirname24, join as join40 } from "node:path";
703875
704131
  var import_shared78 = __toESM(require_dist2());
703876
704132
 
703877
704133
  // ../../../vite-plugin-file-sync/dist/migration/get-fullstack-template-dir.js
703878
704134
  init_cjs_shims();
703879
704135
  import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
703880
- import { dirname as dirname21, join as join33 } from "node:path";
704136
+ import { dirname as dirname21, join as join34 } from "node:path";
703881
704137
  import { fileURLToPath as fileURLToPath6 } from "node:url";
703882
704138
  var CANDIDATE_SUBPATHS = [
703883
704139
  "migration-templates/app-fullstack",
@@ -703898,7 +704154,7 @@ function findFullstackTemplate(startDir) {
703898
704154
  let current2 = startDir;
703899
704155
  for (let hops = 0; hops < MAX_WALK_HOPS; hops++) {
703900
704156
  for (const sub of CANDIDATE_SUBPATHS) {
703901
- const candidate = join33(current2, sub);
704157
+ const candidate = join34(current2, sub);
703902
704158
  if (isUsableDir(candidate))
703903
704159
  return candidate;
703904
704160
  }
@@ -703914,7 +704170,7 @@ function enumerateSearchedPaths(startDir) {
703914
704170
  let current2 = startDir;
703915
704171
  for (let hops = 0; hops < MAX_WALK_HOPS; hops++) {
703916
704172
  for (const sub of CANDIDATE_SUBPATHS) {
703917
- paths.push(join33(current2, sub));
704173
+ paths.push(join34(current2, sub));
703918
704174
  }
703919
704175
  const parent2 = dirname21(current2);
703920
704176
  if (parent2 === current2)
@@ -703933,9 +704189,13 @@ function isUsableDir(dirPath) {
703933
704189
 
703934
704190
  // ../../../vite-plugin-file-sync/dist/migration/migration-session-reconcile.js
703935
704191
  init_cjs_shims();
703936
- import { join as join34 } from "node:path";
703937
- var SCRATCH_DIR_NAME3 = "scratch";
704192
+ import { join as join35 } from "node:path";
704193
+ var SCRATCH_DIR_NAME4 = "scratch";
703938
704194
  var MIGRATION_STATE_FILE4 = "migration-state.json";
704195
+ var rehydrateInFlight = false;
704196
+ function isMigrationScratchRehydrateInFlight() {
704197
+ return rehydrateInFlight;
704198
+ }
703939
704199
  var ACTIVE_MIGRATION_SESSION_PHASES = /* @__PURE__ */ new Set([
703940
704200
  "aborting",
703941
704201
  "in_progress",
@@ -703979,7 +704239,7 @@ async function fetchActiveMigrationSession({ syncService }) {
703979
704239
  return body.data?.session ?? null;
703980
704240
  }
703981
704241
  async function rehydrateMigrationScratchOnBoot({ appRootDir, syncService, logger: logger25 }) {
703982
- const stateFilePath = join34(appRootDir, SCRATCH_DIR_NAME3, MIGRATION_STATE_FILE4);
704242
+ const stateFilePath = join35(appRootDir, SCRATCH_DIR_NAME4, MIGRATION_STATE_FILE4);
703983
704243
  if (await pathExists3(stateFilePath)) {
703984
704244
  return;
703985
704245
  }
@@ -703997,17 +704257,22 @@ async function rehydrateMigrationScratchOnBoot({ appRootDir, syncService, logger
703997
704257
  phase: session.phase,
703998
704258
  migrationCommitId: session.migrationCommitId
703999
704259
  });
704000
- await syncService.downloadDirectory();
704001
- logger25.info("[migrate-route] Forced DBFS download to restore migration scratch completed", {
704002
- applicationId: syncService.applicationId,
704003
- branchName: syncService.branchName
704004
- });
704260
+ rehydrateInFlight = true;
704261
+ try {
704262
+ await syncService.downloadDirectory();
704263
+ logger25.info("[migrate-route] Forced DBFS download to restore migration scratch completed", {
704264
+ applicationId: syncService.applicationId,
704265
+ branchName: syncService.branchName
704266
+ });
704267
+ } finally {
704268
+ rehydrateInFlight = false;
704269
+ }
704005
704270
  } catch (error40) {
704006
704271
  logger25.warn("[migrate-route] Failed to rehydrate migration scratch on boot", getErrorMeta2(error40));
704007
704272
  }
704008
704273
  }
704009
704274
  async function reconcileMigrationSessionOnBoot({ appRootDir, syncService, logger: logger25 }) {
704010
- const stateFilePath = join34(appRootDir, SCRATCH_DIR_NAME3, MIGRATION_STATE_FILE4);
704275
+ const stateFilePath = join35(appRootDir, SCRATCH_DIR_NAME4, MIGRATION_STATE_FILE4);
704011
704276
  if (!await pathExists3(stateFilePath)) {
704012
704277
  return;
704013
704278
  }
@@ -704050,20 +704315,20 @@ async function reconcileMigrationSessionOnBoot({ appRootDir, syncService, logger
704050
704315
  init_cjs_shims();
704051
704316
  var import_yaml9 = __toESM(require_dist());
704052
704317
  import { existsSync as existsSync6 } from "node:fs";
704053
- import { cp as cp4, mkdir as mkdir22, readdir as readdir14, readFile as readFile25, rename as rename5, rm as rm16, stat as stat10, writeFile as writeFile19 } from "node:fs/promises";
704054
- import { dirname as dirname22, join as join37, relative as relative13 } from "node:path";
704318
+ import { cp as cp4, mkdir as mkdir23, readdir as readdir14, readFile as readFile26, rename as rename5, rm as rm17, stat as stat10, writeFile as writeFile19 } from "node:fs/promises";
704319
+ import { dirname as dirname22, join as join38, relative as relative13 } from "node:path";
704055
704320
 
704056
704321
  // ../../../vite-plugin-file-sync/dist/migration/recommended-user-deps.js
704057
704322
  init_cjs_shims();
704058
- import { readFile as readFile24 } from "node:fs/promises";
704059
- import { join as join36 } from "node:path";
704323
+ import { readFile as readFile25 } from "node:fs/promises";
704324
+ import { join as join37 } from "node:path";
704060
704325
 
704061
704326
  // ../../../vite-plugin-file-sync/dist/migration/scan-imports.js
704062
704327
  init_cjs_shims();
704063
704328
  import { existsSync as existsSync5 } from "node:fs";
704064
- import { readFile as readFile23, readdir as readdir13, lstat as lstat8 } from "node:fs/promises";
704329
+ import { readFile as readFile24, readdir as readdir13, lstat as lstat8 } from "node:fs/promises";
704065
704330
  import { builtinModules as builtinModules3 } from "node:module";
704066
- import { extname as extname3, join as join35 } from "node:path";
704331
+ import { extname as extname3, join as join36 } from "node:path";
704067
704332
  var NODE_BUILTINS = new Set(builtinModules3);
704068
704333
  var SCANNABLE_EXTENSIONS = /* @__PURE__ */ new Set([
704069
704334
  ".cjs",
@@ -704150,7 +704415,7 @@ async function walkScannableFiles(rootPath, files, logger25) {
704150
704415
  for (const entry of entries) {
704151
704416
  if (SKIPPED_DIR_NAMES.has(entry))
704152
704417
  continue;
704153
- const fullPath = join35(rootPath, entry);
704418
+ const fullPath = join36(rootPath, entry);
704154
704419
  let entryStat;
704155
704420
  try {
704156
704421
  entryStat = await lstat8(fullPath);
@@ -704178,7 +704443,7 @@ async function scanImportedPackages(args) {
704178
704443
  for (const file2 of files) {
704179
704444
  let content19;
704180
704445
  try {
704181
- content19 = await readFile23(file2, "utf-8");
704446
+ content19 = await readFile24(file2, "utf-8");
704182
704447
  } catch (error40) {
704183
704448
  logger25.warn("[scan-imports] Failed to read file", {
704184
704449
  error: error40 instanceof Error ? error40.message : String(error40),
@@ -704207,7 +704472,7 @@ var CorruptManifestError = class extends Error {
704207
704472
  async function loadPackageJsonManifest(filePath) {
704208
704473
  let raw;
704209
704474
  try {
704210
- raw = await readFile24(filePath, "utf-8");
704475
+ raw = await readFile25(filePath, "utf-8");
704211
704476
  } catch (error40) {
704212
704477
  if (error40.code === "ENOENT") {
704213
704478
  return { kind: "missing" };
@@ -704251,7 +704516,7 @@ function isDeclaredInActive(active, name16) {
704251
704516
  }
704252
704517
  async function computeRecommendedUserDeps(args) {
704253
704518
  const { appRootDirPath, backupDirPath, logger: logger25 } = args;
704254
- const activePath = join36(appRootDirPath, "package.json");
704519
+ const activePath = join37(appRootDirPath, "package.json");
704255
704520
  const activeLoad = await loadPackageJsonManifest(activePath);
704256
704521
  if (activeLoad.kind === "corrupt") {
704257
704522
  throw new CorruptManifestError(activePath, activeLoad.error);
@@ -704265,7 +704530,7 @@ async function computeRecommendedUserDeps(args) {
704265
704530
  };
704266
704531
  }
704267
704532
  const active = activeLoad.manifest;
704268
- const backupPath = join36(backupDirPath, "package.json");
704533
+ const backupPath = join37(backupDirPath, "package.json");
704269
704534
  const backupLoad = await loadPackageJsonManifest(backupPath);
704270
704535
  if (backupLoad.kind === "corrupt") {
704271
704536
  logger25.warn("[migrate] Backup package.json is corrupt; recommendations will fall back to 'latest' for any imported package", {
@@ -704278,7 +704543,7 @@ async function computeRecommendedUserDeps(args) {
704278
704543
  const backup = backupLoad.kind === "ok" ? backupLoad.manifest : null;
704279
704544
  const importedPackages = await scanImportedPackages({
704280
704545
  logger: logger25,
704281
- roots: [join36(appRootDirPath, "client"), join36(appRootDirPath, "server")]
704546
+ roots: [join37(appRootDirPath, "client"), join37(appRootDirPath, "server")]
704282
704547
  });
704283
704548
  const recommendedUserDeps = [];
704284
704549
  const importedButMissingFromBackup = [];
@@ -704369,7 +704634,7 @@ var BACKUP_SINGLE_FILE_DIFFS = [
704369
704634
  { backupPath: "App.tsx", clientPath: "client/App.tsx" },
704370
704635
  { backupPath: "root.tsx", clientPath: "client/root.tsx" }
704371
704636
  ];
704372
- var SCRATCH_DIR_NAME4 = "scratch";
704637
+ var SCRATCH_DIR_NAME5 = "scratch";
704373
704638
  var BACKUP_SUBDIR_NAME = "v2-backup";
704374
704639
  var MIGRATION_STATE_FILE5 = "migration-state.json";
704375
704640
  var MIGRATION_STATE_VERSION = 1;
@@ -704381,8 +704646,8 @@ async function migrateToFullstack(args) {
704381
704646
  });
704382
704647
  await assertDirectoryExists(appRootDirPath, "app root");
704383
704648
  await assertDirectoryExists(templateSourceDirPath, "template source");
704384
- const scratchDirPath = join37(appRootDirPath, SCRATCH_DIR_NAME4);
704385
- const backupDirPath = join37(scratchDirPath, BACKUP_SUBDIR_NAME);
704649
+ const scratchDirPath = join38(appRootDirPath, SCRATCH_DIR_NAME5);
704650
+ const backupDirPath = join38(scratchDirPath, BACKUP_SUBDIR_NAME);
704386
704651
  await assertBackupSlotIsEmpty(backupDirPath);
704387
704652
  await moveAllTopLevelIntoBackup({ appRootDirPath, backupDirPath, logger: logger25 });
704388
704653
  await copyTemplateIntoAppRoot({
@@ -704423,7 +704688,7 @@ async function migrateToFullstack(args) {
704423
704688
  });
704424
704689
  }
704425
704690
  restructuredFiles += apiStubResult.apiStubs.length;
704426
- const stateFilePath = join37(scratchDirPath, MIGRATION_STATE_FILE5);
704691
+ const stateFilePath = join38(scratchDirPath, MIGRATION_STATE_FILE5);
704427
704692
  const integrationWritePolicy = args.integrationWritePolicy ?? await readPersistedIntegrationWritePolicy(stateFilePath);
704428
704693
  const state = {
704429
704694
  version: MIGRATION_STATE_VERSION,
@@ -704462,7 +704727,7 @@ async function migrateToFullstack(args) {
704462
704727
  migrationChecklistFilePath,
704463
704728
  itemCount: migrationChecklist.items.length
704464
704729
  });
704465
- const sbTemplatePath = join37(appRootDirPath, ".sb_template");
704730
+ const sbTemplatePath = join38(appRootDirPath, ".sb_template");
704466
704731
  await writeFile19(sbTemplatePath, "app-fullstack", "utf-8");
704467
704732
  logger25.info("[migrate] Wrote .sb_template", { sbTemplatePath });
704468
704733
  return {
@@ -704476,8 +704741,8 @@ async function migrateToFullstack(args) {
704476
704741
  }
704477
704742
  async function restoreFromV2Backup(args) {
704478
704743
  const { appRootDirPath, logger: logger25 } = args;
704479
- const scratchDirPath = join37(appRootDirPath, SCRATCH_DIR_NAME4);
704480
- const backupDirPath = join37(scratchDirPath, BACKUP_SUBDIR_NAME);
704744
+ const scratchDirPath = join38(appRootDirPath, SCRATCH_DIR_NAME5);
704745
+ const backupDirPath = join38(scratchDirPath, BACKUP_SUBDIR_NAME);
704481
704746
  if (!existsSync6(backupDirPath)) {
704482
704747
  return { restored: false };
704483
704748
  }
@@ -704491,9 +704756,9 @@ async function restoreFromV2Backup(args) {
704491
704756
  for (const entry of topLevelEntries) {
704492
704757
  if (GUARDED_TOP_LEVEL.has(entry.name))
704493
704758
  continue;
704494
- if (entry.name === SCRATCH_DIR_NAME4)
704759
+ if (entry.name === SCRATCH_DIR_NAME5)
704495
704760
  continue;
704496
- await rm16(join37(appRootDirPath, entry.name), {
704761
+ await rm17(join38(appRootDirPath, entry.name), {
704497
704762
  recursive: true,
704498
704763
  force: true
704499
704764
  });
@@ -704503,15 +704768,15 @@ async function restoreFromV2Backup(args) {
704503
704768
  }
704504
704769
  const backupEntries = await readdir14(backupDirPath, { withFileTypes: true });
704505
704770
  for (const entry of backupEntries) {
704506
- const from = join37(backupDirPath, entry.name);
704507
- const to2 = join37(appRootDirPath, entry.name);
704771
+ const from = join38(backupDirPath, entry.name);
704772
+ const to2 = join38(appRootDirPath, entry.name);
704508
704773
  await rename5(from, to2);
704509
704774
  logger25.debug("[migrate] Restored from backup", { entry: entry.name });
704510
704775
  }
704511
- await rm16(scratchDirPath, { recursive: true, force: true });
704512
- const sbTemplatePath = join37(appRootDirPath, ".sb_template");
704776
+ await rm17(scratchDirPath, { recursive: true, force: true });
704777
+ const sbTemplatePath = join38(appRootDirPath, ".sb_template");
704513
704778
  if (existsSync6(sbTemplatePath)) {
704514
- await rm16(sbTemplatePath, { force: true });
704779
+ await rm17(sbTemplatePath, { force: true });
704515
704780
  logger25.debug("[migrate] Removed .sb_template marker written during restructure");
704516
704781
  }
704517
704782
  logger25.info("[migrate] Restored live tree from scratch/v2-backup");
@@ -704533,15 +704798,15 @@ async function assertBackupSlotIsEmpty(backupDirPath) {
704533
704798
  }
704534
704799
  async function moveAllTopLevelIntoBackup(opts) {
704535
704800
  const { appRootDirPath, backupDirPath, logger: logger25 } = opts;
704536
- await mkdir22(backupDirPath, { recursive: true });
704801
+ await mkdir23(backupDirPath, { recursive: true });
704537
704802
  const entries = await readdir14(appRootDirPath, { withFileTypes: true });
704538
704803
  for (const entry of entries) {
704539
704804
  if (GUARDED_TOP_LEVEL.has(entry.name))
704540
704805
  continue;
704541
- if (entry.name === SCRATCH_DIR_NAME4)
704806
+ if (entry.name === SCRATCH_DIR_NAME5)
704542
704807
  continue;
704543
- const from = join37(appRootDirPath, entry.name);
704544
- const to2 = join37(backupDirPath, entry.name);
704808
+ const from = join38(appRootDirPath, entry.name);
704809
+ const to2 = join38(backupDirPath, entry.name);
704545
704810
  await rename5(from, to2);
704546
704811
  logger25.debug("[migrate] Moved to backup", { entry: entry.name });
704547
704812
  }
@@ -704552,8 +704817,8 @@ async function copyTemplateIntoAppRoot(opts) {
704552
704817
  for (const entry of entries) {
704553
704818
  if (GUARDED_TOP_LEVEL.has(entry.name))
704554
704819
  continue;
704555
- const from = join37(templateSourceDirPath, entry.name);
704556
- const to2 = join37(appRootDirPath, entry.name);
704820
+ const from = join38(templateSourceDirPath, entry.name);
704821
+ const to2 = join38(appRootDirPath, entry.name);
704557
704822
  await cp4(from, to2, { recursive: true });
704558
704823
  }
704559
704824
  logger25.debug("[migrate] Template overlaid onto app root");
@@ -704562,11 +704827,11 @@ async function remapBackupDirsIntoClient(opts) {
704562
704827
  const { backupDirPath, appRootDirPath, templateSourceDirPath, logger: logger25 } = opts;
704563
704828
  let copied = 0;
704564
704829
  for (const mapping of BACKUP_TO_CLIENT_MAPPINGS) {
704565
- const src3 = join37(backupDirPath, mapping.backupSubpath);
704830
+ const src3 = join38(backupDirPath, mapping.backupSubpath);
704566
704831
  if (!existsSync6(src3))
704567
704832
  continue;
704568
- const dst = join37(appRootDirPath, "client", mapping.clientSubpath);
704569
- const templateEquivalent = join37(templateSourceDirPath, "client", mapping.clientSubpath);
704833
+ const dst = join38(appRootDirPath, "client", mapping.clientSubpath);
704834
+ const templateEquivalent = join38(templateSourceDirPath, "client", mapping.clientSubpath);
704570
704835
  copied += await copyTreeWithDiff({
704571
704836
  src: src3,
704572
704837
  dst,
@@ -704583,18 +704848,18 @@ async function remapBackupSingleFiles(opts) {
704583
704848
  const { backupDirPath, appRootDirPath, templateSourceDirPath, logger: logger25 } = opts;
704584
704849
  let copied = 0;
704585
704850
  for (const mapping of BACKUP_SINGLE_FILE_DIFFS) {
704586
- const backupFile = join37(backupDirPath, mapping.backupPath);
704851
+ const backupFile = join38(backupDirPath, mapping.backupPath);
704587
704852
  if (!existsSync6(backupFile))
704588
704853
  continue;
704589
- const destFile = join37(appRootDirPath, mapping.clientPath);
704590
- const templateFile = join37(templateSourceDirPath, mapping.clientPath);
704854
+ const destFile = join38(appRootDirPath, mapping.clientPath);
704855
+ const templateFile = join38(templateSourceDirPath, mapping.clientPath);
704591
704856
  if (existsSync6(templateFile) && await filesEqual(backupFile, templateFile)) {
704592
704857
  logger25.debug("[migrate] Skipping unmodified single file", {
704593
704858
  file: mapping.backupPath
704594
704859
  });
704595
704860
  continue;
704596
704861
  }
704597
- await mkdir22(dirname22(destFile), { recursive: true });
704862
+ await mkdir23(dirname22(destFile), { recursive: true });
704598
704863
  await cp4(backupFile, destFile);
704599
704864
  copied += 1;
704600
704865
  }
@@ -704608,7 +704873,7 @@ async function copyTreeWithDiff(opts) {
704608
704873
  const current2 = stack2.pop();
704609
704874
  const entries = await readdir14(current2, { withFileTypes: true });
704610
704875
  for (const entry of entries) {
704611
- const absEntry = join37(current2, entry.name);
704876
+ const absEntry = join38(current2, entry.name);
704612
704877
  const relFromSrc = relative13(src3, absEntry);
704613
704878
  if (skipSubpath && relFromSrc.split("/").includes(skipSubpath)) {
704614
704879
  continue;
@@ -704620,7 +704885,7 @@ async function copyTreeWithDiff(opts) {
704620
704885
  if (!entry.isFile())
704621
704886
  continue;
704622
704887
  if (templateBaseline) {
704623
- const baselineFile = join37(templateBaseline, relFromSrc);
704888
+ const baselineFile = join38(templateBaseline, relFromSrc);
704624
704889
  if (existsSync6(baselineFile) && await filesEqual(absEntry, baselineFile)) {
704625
704890
  logger25.debug("[migrate] Skipping unmodified file", {
704626
704891
  path: relFromSrc
@@ -704628,8 +704893,8 @@ async function copyTreeWithDiff(opts) {
704628
704893
  continue;
704629
704894
  }
704630
704895
  }
704631
- const destFile = join37(dst, relFromSrc);
704632
- await mkdir22(dirname22(destFile), { recursive: true });
704896
+ const destFile = join38(dst, relFromSrc);
704897
+ await mkdir23(dirname22(destFile), { recursive: true });
704633
704898
  await cp4(absEntry, destFile);
704634
704899
  copied += 1;
704635
704900
  }
@@ -704648,9 +704913,9 @@ async function stubV2Apis(opts) {
704648
704913
  const baseName = toValidApiName(rawName ?? fallback);
704649
704914
  const uniqueName = ensureUniqueName(baseName, seenNames);
704650
704915
  seenNames.add(uniqueName);
704651
- const stubRelPath = join37("server", "apis", uniqueName, "api.ts");
704652
- const stubAbsPath = join37(appRootDirPath, stubRelPath);
704653
- await mkdir22(dirname22(stubAbsPath), { recursive: true });
704916
+ const stubRelPath = join38("server", "apis", uniqueName, "api.ts");
704917
+ const stubAbsPath = join38(appRootDirPath, stubRelPath);
704918
+ await mkdir23(dirname22(stubAbsPath), { recursive: true });
704654
704919
  await writeFile19(stubAbsPath, renderApiStub(uniqueName, yamlPath, backupDirPath), "utf-8");
704655
704920
  apiStubs.push(stubRelPath);
704656
704921
  checklist.push({
@@ -704676,7 +704941,7 @@ async function findApiYamls(rootDir) {
704676
704941
  continue;
704677
704942
  }
704678
704943
  for (const entry of entries) {
704679
- const abs = join37(dir, entry.name);
704944
+ const abs = join38(dir, entry.name);
704680
704945
  if (entry.isDirectory()) {
704681
704946
  stack2.push(abs);
704682
704947
  continue;
@@ -704716,7 +704981,7 @@ async function discoverRoutesFromBackupRouter(args) {
704716
704981
  }
704717
704982
  }
704718
704983
  async function discoverRoutesFromBackupPages(backupDirPath) {
704719
- const pagesRoot = join37(backupDirPath, "pages");
704984
+ const pagesRoot = join38(backupDirPath, "pages");
704720
704985
  if (!existsSync6(pagesRoot)) {
704721
704986
  return [];
704722
704987
  }
@@ -704737,7 +705002,7 @@ async function discoverRoutesFromBackupPages(backupDirPath) {
704737
705002
  continue;
704738
705003
  }
704739
705004
  for (const entry of entries) {
704740
- const abs = join37(current2, entry.name);
705005
+ const abs = join38(current2, entry.name);
704741
705006
  if (entry.isDirectory()) {
704742
705007
  stack2.push(abs);
704743
705008
  continue;
@@ -704768,7 +705033,7 @@ function normalizeRoutePath(path81) {
704768
705033
  return withLeadingSlash.replace(/\/{2,}/g, "/");
704769
705034
  }
704770
705035
  async function extractApiName(yamlPath) {
704771
- const raw = await readFile25(yamlPath, "utf-8");
705036
+ const raw = await readFile26(yamlPath, "utf-8");
704772
705037
  const parsed = (0, import_yaml9.parse)(raw);
704773
705038
  if (parsed && typeof parsed === "object" && "metadata" in parsed && typeof parsed.metadata === "object" && parsed.metadata && typeof parsed.metadata.name === "string") {
704774
705039
  return parsed.metadata.name;
@@ -704793,7 +705058,7 @@ function ensureUniqueName(name16, seen) {
704793
705058
  }
704794
705059
  function renderApiStub(name16, yamlPath, backupDirPath) {
704795
705060
  const originalRel = relative13(backupDirPath, yamlPath);
704796
- const scratchRel = join37(SCRATCH_DIR_NAME4, BACKUP_SUBDIR_NAME, originalRel);
705061
+ const scratchRel = join38(SCRATCH_DIR_NAME5, BACKUP_SUBDIR_NAME, originalRel);
704797
705062
  return `import { api, z } from "@superblocksteam/sdk-api";
704798
705063
 
704799
705064
  /**
@@ -704820,7 +705085,7 @@ export default api({
704820
705085
  }
704821
705086
  async function writeApiRegistry(opts) {
704822
705087
  const { appRootDirPath, stubs, logger: logger25 } = opts;
704823
- const registryPath = join37(appRootDirPath, "server", "apis", "index.ts");
705088
+ const registryPath = join38(appRootDirPath, "server", "apis", "index.ts");
704824
705089
  const orderedStubs = [...stubs].sort((a, b3) => a.name.localeCompare(b3.name));
704825
705090
  const imports = orderedStubs.map((s4) => `import ${s4.name} from "./${s4.name}/api.js";`).join("\n");
704826
705091
  const entries = orderedStubs.map((s4) => ` ${s4.name},`).join("\n");
@@ -704845,7 +705110,7 @@ export default apis;
704845
705110
  /** Type for useApi inference - exported for client type-only imports */
704846
705111
  export type ApiRegistry = typeof apis;
704847
705112
  `;
704848
- await mkdir22(dirname22(registryPath), { recursive: true });
705113
+ await mkdir23(dirname22(registryPath), { recursive: true });
704849
705114
  await writeFile19(registryPath, contents2, "utf-8");
704850
705115
  logger25.debug("[migrate] Rewrote server/apis/index.ts", {
704851
705116
  registryPath,
@@ -704866,7 +705131,7 @@ async function assertDirectoryExists(path81, label2) {
704866
705131
  }
704867
705132
  }
704868
705133
  async function filesEqual(a, b3) {
704869
- const [aBuf, bBuf] = await Promise.all([readFile25(a), readFile25(b3)]);
705134
+ const [aBuf, bBuf] = await Promise.all([readFile26(a), readFile26(b3)]);
704870
705135
  if (aBuf.length !== bBuf.length)
704871
705136
  return false;
704872
705137
  return aBuf.equals(bBuf);
@@ -704875,8 +705140,8 @@ async function filesEqual(a, b3) {
704875
705140
  // ../../../vite-plugin-file-sync/dist/migration/unsupported-integrations.js
704876
705141
  init_cjs_shims();
704877
705142
  var import_yaml10 = __toESM(require_dist());
704878
- import { readdir as readdir15, readFile as readFile26 } from "node:fs/promises";
704879
- import { basename as basename10, dirname as dirname23, join as join38, relative as relative14 } from "node:path";
705143
+ import { readdir as readdir15, readFile as readFile27 } from "node:fs/promises";
705144
+ import { basename as basename10, dirname as dirname23, join as join39, relative as relative14 } from "node:path";
704880
705145
 
704881
705146
  // ../../../sdk-api/dist/index.js
704882
705147
  init_cjs_shims();
@@ -704932,6 +705197,9 @@ init_cjs_shims();
704932
705197
  // ../../../sdk-api/dist/errors.js
704933
705198
  init_cjs_shims();
704934
705199
 
705200
+ // ../../../sdk-api/dist/integrations/base/types.js
705201
+ init_cjs_shims();
705202
+
704935
705203
  // ../../../sdk-api/dist/integrations/base/rest-api-integration-client.js
704936
705204
  init_cjs_shims();
704937
705205
 
@@ -705462,7 +705730,7 @@ async function findApiYamls2(appRootDirPath) {
705462
705730
  continue;
705463
705731
  }
705464
705732
  for (const entry of entries) {
705465
- const absPath = join38(current2, entry.name);
705733
+ const absPath = join39(current2, entry.name);
705466
705734
  if (entry.isDirectory()) {
705467
705735
  if (current2 === appRootDirPath && IGNORED_ROOT_DIRS.has(entry.name) || IGNORED_DIRS_ANY_DEPTH.has(entry.name) || entry.name.startsWith(".")) {
705468
705736
  continue;
@@ -705510,7 +705778,7 @@ function isUnsupportedPluginId(pluginId) {
705510
705778
  return !SUPPORTED_PLUGIN_ID_SET.has(pluginId);
705511
705779
  }
705512
705780
  async function readApiIntegrations(yamlPath) {
705513
- const raw = await readFile26(yamlPath, "utf-8");
705781
+ const raw = await readFile27(yamlPath, "utf-8");
705514
705782
  const parsed = (0, import_yaml10.parse)(raw);
705515
705783
  const integrationRefs = collectIntegrationRefs(parsed);
705516
705784
  const fallbackApiName = basename10(dirname23(yamlPath)) || "UnknownApi";
@@ -705597,7 +705865,7 @@ function extractBearerJwt(authorizationHeader) {
705597
705865
  }
705598
705866
  var TARGET_TEMPLATE_NAME = "app-fullstack";
705599
705867
  var MIGRATION_STATE_FILE6 = "migration-state.json";
705600
- var SCRATCH_DIR_NAME5 = "scratch";
705868
+ var SCRATCH_DIR_NAME6 = "scratch";
705601
705869
  var RESTART_TELEMETRY_FLUSH_TIMEOUT_MS = 2e3;
705602
705870
  async function flushTelemetryBeforeExit(logger25) {
705603
705871
  if (!isTelemetryInitialized()) {
@@ -705635,6 +705903,7 @@ async function requestSelfRestart(logger25, prepareInPlaceRestart2) {
705635
705903
  process.exit(RESTART_EXIT_CODE);
705636
705904
  }
705637
705905
  var inMemoryStatus = { state: "idle" };
705906
+ var migrationCompleteCommitInFlight = false;
705638
705907
  async function findLiveApiYamls(rootDir) {
705639
705908
  const results = [];
705640
705909
  const stack2 = [rootDir];
@@ -705647,10 +705916,10 @@ async function findLiveApiYamls(rootDir) {
705647
705916
  continue;
705648
705917
  }
705649
705918
  for (const entry of entries) {
705650
- if (entry.name === SCRATCH_DIR_NAME5 || entry.name === "node_modules") {
705919
+ if (entry.name === SCRATCH_DIR_NAME6 || entry.name === "node_modules") {
705651
705920
  continue;
705652
705921
  }
705653
- const abs = join39(dir, entry.name);
705922
+ const abs = join40(dir, entry.name);
705654
705923
  if (entry.isDirectory()) {
705655
705924
  stack2.push(abs);
705656
705925
  } else if (entry.isFile() && (entry.name === "api.yaml" || entry.name === "api.yml")) {
@@ -705668,7 +705937,7 @@ async function extractIntegrationsFromYamls(yamlPaths) {
705668
705937
  const integrationSteps = /* @__PURE__ */ new Map();
705669
705938
  for (const yamlPath of yamlPaths) {
705670
705939
  try {
705671
- const raw = await readFile27(yamlPath, "utf-8");
705940
+ const raw = await readFile28(yamlPath, "utf-8");
705672
705941
  const parsed = (0, import_yaml11.parse)(raw);
705673
705942
  forEachYamlStep(parsed, (step) => {
705674
705943
  const integrationId = step["integration"];
@@ -705690,7 +705959,7 @@ async function extractIntegrationsFromYamls(yamlPaths) {
705690
705959
  }));
705691
705960
  }
705692
705961
  async function collectMigrationIntegrations(appRootDir) {
705693
- const backupDir = join39(appRootDir, SCRATCH_DIR_NAME5, "v2-backup");
705962
+ const backupDir = join40(appRootDir, SCRATCH_DIR_NAME6, "v2-backup");
705694
705963
  const yamlPaths = await findLiveApiYamls(backupDir);
705695
705964
  return extractIntegrationsFromYamls(yamlPaths);
705696
705965
  }
@@ -705700,9 +705969,9 @@ async function collectPreMigrationIntegrations(appRootDir) {
705700
705969
  }
705701
705970
  async function resolveStatus(appRootDir, opts = {}) {
705702
705971
  const ignoreInMemory = opts.ignoreInMemory ?? false;
705703
- const stateFilePath = join39(appRootDir, SCRATCH_DIR_NAME5, MIGRATION_STATE_FILE6);
705972
+ const stateFilePath = join40(appRootDir, SCRATCH_DIR_NAME6, MIGRATION_STATE_FILE6);
705704
705973
  const [hasV2Backup, hasMigrationStateFile] = await Promise.all([
705705
- pathExists4(join39(appRootDir, SCRATCH_DIR_NAME5, "v2-backup")),
705974
+ pathExists4(join40(appRootDir, SCRATCH_DIR_NAME6, "v2-backup")),
705706
705975
  pathExists4(stateFilePath)
705707
705976
  ]);
705708
705977
  const [checklist, integrations] = await Promise.all([
@@ -705725,7 +705994,7 @@ async function resolveStatus(appRootDir, opts = {}) {
705725
705994
  if (!hasMigrationStateFile) {
705726
705995
  const unsupportedStatus = await detectUnsupportedIntegrations(appRootDir);
705727
705996
  return {
705728
- state: "idle",
705997
+ state: isMigrationScratchRehydrateInFlight() ? "translating" : "idle",
705729
705998
  hasV2Backup,
705730
705999
  ...unsupportedStatus,
705731
706000
  checklist: checklistPayload,
@@ -705802,7 +706071,7 @@ async function resolveStatus(appRootDir, opts = {}) {
705802
706071
  }
705803
706072
  async function readPersistedMigrationState(stateFilePath) {
705804
706073
  try {
705805
- const raw = await readFile27(stateFilePath, "utf-8");
706074
+ const raw = await readFile28(stateFilePath, "utf-8");
705806
706075
  const parsed = JSON.parse(raw);
705807
706076
  return {
705808
706077
  startedAt: typeof parsed.startedAt === "string" ? parsed.startedAt : void 0,
@@ -705819,10 +706088,10 @@ async function readPersistedMigrationState(stateFilePath) {
705819
706088
  async function persistMigrationStateMetadata(stateFilePath, metadata) {
705820
706089
  let parsed = {};
705821
706090
  try {
705822
- const raw = await readFile27(stateFilePath, "utf-8");
706091
+ const raw = await readFile28(stateFilePath, "utf-8");
705823
706092
  parsed = JSON.parse(raw);
705824
706093
  } catch {
705825
- await mkdir23(dirname24(stateFilePath), { recursive: true });
706094
+ await mkdir24(dirname24(stateFilePath), { recursive: true });
705826
706095
  if (metadata.startedAt) {
705827
706096
  parsed.startedAt = metadata.startedAt;
705828
706097
  }
@@ -705943,10 +706212,10 @@ function registerMigrationRoutes(server, options8) {
705943
706212
  })) {
705944
706213
  return;
705945
706214
  }
705946
- const scratchDirPath = join39(appRootDir, SCRATCH_DIR_NAME5);
705947
- const stateFilePath = join39(scratchDirPath, MIGRATION_STATE_FILE6);
705948
- const backupDirPath = join39(scratchDirPath, "v2-backup");
705949
- const verificationDirPath = join39(scratchDirPath, "migration-verification");
706215
+ const scratchDirPath = join40(appRootDir, SCRATCH_DIR_NAME6);
706216
+ const stateFilePath = join40(scratchDirPath, MIGRATION_STATE_FILE6);
706217
+ const backupDirPath = join40(scratchDirPath, "v2-backup");
706218
+ const verificationDirPath = join40(scratchDirPath, "migration-verification");
705950
706219
  let autoSyncPaused = false;
705951
706220
  let shouldResumeAutoSync = true;
705952
706221
  let diskRestored = false;
@@ -705966,9 +706235,10 @@ function registerMigrationRoutes(server, options8) {
705966
706235
  await clearChecklist({ appRootDirPath: appRootDir });
705967
706236
  } else {
705968
706237
  await Promise.all([
705969
- rm17(stateFilePath, { force: true }),
706238
+ rm18(stateFilePath, { force: true }),
705970
706239
  clearChecklist({ appRootDirPath: appRootDir }),
705971
- rm17(verificationDirPath, { recursive: true, force: true })
706240
+ clearMigrationTurnsLog(appRootDir),
706241
+ rm18(verificationDirPath, { recursive: true, force: true })
705972
706242
  ]);
705973
706243
  }
705974
706244
  } finally {
@@ -706080,7 +706350,7 @@ function registerMigrationRoutes(server, options8) {
706080
706350
  ...willSelfRestart ? { willSelfRestart: true } : {},
706081
706351
  message: "Upgrade started. The editor will reconnect automatically when the new runtime is ready."
706082
706352
  }));
706083
- const stateFilePath = join39(appRootDir, SCRATCH_DIR_NAME5, MIGRATION_STATE_FILE6);
706353
+ const stateFilePath = join40(appRootDir, SCRATCH_DIR_NAME6, MIGRATION_STATE_FILE6);
706084
706354
  let backupCommitId;
706085
706355
  let restructured = false;
706086
706356
  let autoSyncPaused = false;
@@ -706290,6 +706560,26 @@ function registerMigrationRoutes(server, options8) {
706290
706560
  state: status.state,
706291
706561
  hasV2Backup: status.hasV2Backup
706292
706562
  });
706563
+ if (migrationCompleteCommitInFlight) {
706564
+ res.statusCode = 409;
706565
+ res.end(JSON.stringify({
706566
+ error: "Upgrade completion is already in progress."
706567
+ }));
706568
+ return;
706569
+ }
706570
+ if (!status.hasV2Backup && await isAlreadyOnFullstack(appRootDir)) {
706571
+ logger25.info("[migrate-route] completion is a no-op; migration already finalized");
706572
+ recordMigrationStage("complete", "success");
706573
+ res.statusCode = 200;
706574
+ res.setHeader("Content-Type", "application/json");
706575
+ res.end(JSON.stringify({
706576
+ ok: true,
706577
+ alreadyComplete: true,
706578
+ completionCommitId: status.migrationCommitId,
706579
+ status
706580
+ }));
706581
+ return;
706582
+ }
706293
706583
  if (status.state !== "done") {
706294
706584
  res.statusCode = 409;
706295
706585
  res.end(JSON.stringify({
@@ -706333,16 +706623,22 @@ function registerMigrationRoutes(server, options8) {
706333
706623
  remainingCount: clearedUpgradeItems.remainingCount
706334
706624
  });
706335
706625
  }
706336
- await rm17(join39(appRootDir, SCRATCH_DIR_NAME5, "v2-backup"), {
706626
+ await rm18(join40(appRootDir, SCRATCH_DIR_NAME6, "v2-backup"), {
706337
706627
  recursive: true,
706338
706628
  force: true
706339
706629
  });
706340
- await rm17(join39(appRootDir, SCRATCH_DIR_NAME5), {
706630
+ await rm18(join40(appRootDir, SCRATCH_DIR_NAME6), {
706341
706631
  recursive: true,
706342
706632
  force: true
706343
706633
  });
706344
706634
  logger25.info("[migrate-route] removed scratch directory");
706345
- const completionCommit = await syncService.commitLocalDraftChanges("migrate:complete");
706635
+ migrationCompleteCommitInFlight = true;
706636
+ let completionCommit;
706637
+ try {
706638
+ completionCommit = await syncService.commitLocalDraftChanges("migrate:complete");
706639
+ } finally {
706640
+ migrationCompleteCommitInFlight = false;
706641
+ }
706346
706642
  if (!completionCommit?.commitId) {
706347
706643
  throw new Error("Upgrade completion checkpoint was not created; aborting completion flow.");
706348
706644
  }
@@ -706408,16 +706704,16 @@ function registerMigrationRoutes(server, options8) {
706408
706704
  res.end(JSON.stringify({ error: parsedPolicy.error }));
706409
706705
  return;
706410
706706
  }
706411
- const scratchDirPath = join39(appRootDir, SCRATCH_DIR_NAME5);
706412
- const stateFilePath = join39(scratchDirPath, MIGRATION_STATE_FILE6);
706707
+ const scratchDirPath = join40(appRootDir, SCRATCH_DIR_NAME6);
706708
+ const stateFilePath = join40(scratchDirPath, MIGRATION_STATE_FILE6);
706413
706709
  let parsed;
706414
706710
  try {
706415
- parsed = JSON.parse(await readFile27(stateFilePath, "utf-8"));
706711
+ parsed = JSON.parse(await readFile28(stateFilePath, "utf-8"));
706416
706712
  } catch {
706417
706713
  parsed = {};
706418
706714
  }
706419
706715
  parsed.integrationWritePolicy = parsedPolicy.policy;
706420
- await mkdir23(scratchDirPath, { recursive: true });
706716
+ await mkdir24(scratchDirPath, { recursive: true });
706421
706717
  await writeFile20(stateFilePath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
706422
706718
  const status = await resolveStatus(appRootDir);
706423
706719
  res.statusCode = 200;
@@ -706531,8 +706827,8 @@ function registerMigrationRoutes(server, options8) {
706531
706827
  }
706532
706828
  async function isAlreadyOnFullstack(appRootDir) {
706533
706829
  const [hasClient, hasServerApisIndex] = await Promise.all([
706534
- pathExists4(join39(appRootDir, "client")),
706535
- pathExists4(join39(appRootDir, "server", "apis", "index.ts"))
706830
+ pathExists4(join40(appRootDir, "client")),
706831
+ pathExists4(join40(appRootDir, "server", "apis", "index.ts"))
706536
706832
  ]);
706537
706833
  return hasClient && hasServerApisIndex;
706538
706834
  }
@@ -717427,7 +717723,7 @@ ${stderr}`;
717427
717723
  // ../sdk/dist/cli-replacement/home-npmrc.mjs
717428
717724
  init_cjs_shims();
717429
717725
  init_esm();
717430
- import { mkdir as mkdir25 } from "node:fs/promises";
717726
+ import { mkdir as mkdir26 } from "node:fs/promises";
717431
717727
  import * as os7 from "node:os";
717432
717728
  import * as path74 from "node:path";
717433
717729
  var HOME_NPMRC_MODE = 256;
@@ -717473,7 +717769,7 @@ async function syncHomeNpmrcImpl(deps) {
717473
717769
  if (!result.config.configured) {
717474
717770
  if (result.config.allowInstallScripts === false) {
717475
717771
  try {
717476
- await mkdir25(path74.dirname(targetPath), { recursive: true });
717772
+ await mkdir26(path74.dirname(targetPath), { recursive: true });
717477
717773
  await writeNpmrc(targetPath, result.config, {
717478
717774
  mode: HOME_NPMRC_MODE
717479
717775
  });
@@ -717510,7 +717806,7 @@ async function syncHomeNpmrcImpl(deps) {
717510
717806
  }
717511
717807
  }
717512
717808
  try {
717513
- await mkdir25(path74.dirname(targetPath), { recursive: true });
717809
+ await mkdir26(path74.dirname(targetPath), { recursive: true });
717514
717810
  const snapshotOutcome = await snapshotInitialNpmrc(targetPath, backupPath);
717515
717811
  lastSnapshotOutcomeByPath.set(targetPath, snapshotOutcome);
717516
717812
  if (snapshotOutcome === "failed") {
@@ -720021,7 +720317,7 @@ async function isSocketAlive(socketPath) {
720021
720317
  init_cjs_shims();
720022
720318
  import { createHash as createHash6 } from "node:crypto";
720023
720319
  import * as fs36 from "node:fs/promises";
720024
- import { join as join43 } from "node:path";
720320
+ import { join as join44 } from "node:path";
720025
720321
  var SUPERBLOCKS_LIBRARY_PACKAGE = "@superblocksteam/library";
720026
720322
  var SUPERBLOCKS_SDK_API_PACKAGE = "@superblocksteam/sdk-api";
720027
720323
  var MANAGED_PACKAGE_DEPENDENCIES = [
@@ -720176,7 +720472,7 @@ async function readPackageJson2(cwd) {
720176
720472
  }
720177
720473
  async function readPackageJsonFile(cwd) {
720178
720474
  try {
720179
- const source2 = await fs36.readFile(join43(cwd, "package.json"), "utf-8");
720475
+ const source2 = await fs36.readFile(join44(cwd, "package.json"), "utf-8");
720180
720476
  return {
720181
720477
  packageJson: JSON.parse(source2),
720182
720478
  source: source2
@@ -720250,7 +720546,7 @@ async function restoreManagedPackageDependencies(cwd, warmPackageJson) {
720250
720546
  if (!changed) {
720251
720547
  return false;
720252
720548
  }
720253
- await fs36.writeFile(join43(cwd, "package.json"), JSON.stringify(restoredPackageJson, null, detectJsonIndent(restoredPackageJsonSource)) + (hasFinalNewline(restoredPackageJsonSource) ? "\n" : ""));
720549
+ await fs36.writeFile(join44(cwd, "package.json"), JSON.stringify(restoredPackageJson, null, detectJsonIndent(restoredPackageJsonSource)) + (hasFinalNewline(restoredPackageJsonSource) ? "\n" : ""));
720254
720550
  return true;
720255
720551
  }
720256
720552
 
@@ -720625,7 +720921,7 @@ async function handleLockConflict(error40, lockSvc, span, logger25) {
720625
720921
  }
720626
720922
  async function readPkgJson(cwd) {
720627
720923
  try {
720628
- const { readPackage } = await import("./read-pkg-YSXIPKFE.js");
720924
+ const { readPackage } = await import("./read-pkg-PGWLINNT.js");
720629
720925
  return await readPackage({ cwd });
720630
720926
  } catch {
720631
720927
  return null;
@@ -722500,4 +722796,4 @@ serve-static/index.js:
722500
722796
  chokidar/esm/index.js:
722501
722797
  (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
722502
722798
  */
722503
- //# sourceMappingURL=chunk-TQTWTZU7.js.map
722799
+ //# sourceMappingURL=chunk-CMNID6AS.js.map