@superblocksteam/cli 2.0.155-next.2 → 2.0.155

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 (115) hide show
  1. package/README.md +1 -1
  2. package/dist/{acorn-REPR7IWV.js → acorn-R44QJXGX.js} +3 -3
  3. package/dist/{angular-XIBF4SFS.js → angular-32M7AVGS.js} +3 -3
  4. package/dist/{api-R44YCAXS.js → api-WIV6M7TY.js} +4 -4
  5. package/dist/{babel-7P224XLY.js → babel-PFQW4XYW.js} +3 -3
  6. package/dist/{chunk-5GXT3M4S.js → chunk-4T3WLZPG.js} +3 -3
  7. package/dist/{chunk-LC2I3LIU.js → chunk-4ZEAMO2U.js} +2 -2
  8. package/dist/{chunk-NP5RYEQM.js → chunk-6LFVTDU2.js} +3 -3
  9. package/dist/{chunk-K335L7E6.js → chunk-AXJONZBD.js} +8 -8
  10. package/dist/{chunk-OBRNLKIW.js → chunk-CCOC6R73.js} +155 -76
  11. package/dist/{chunk-OBRNLKIW.js.map → chunk-CCOC6R73.js.map} +1 -1
  12. package/dist/{chunk-RK5T2VWH.js → chunk-D4566SJ7.js} +3 -3
  13. package/dist/{chunk-Z2QKVFPF.js → chunk-DB3LEK4O.js} +3 -3
  14. package/dist/{chunk-2PJGTRDN.js → chunk-DJMTVLRU.js} +3 -3
  15. package/dist/{chunk-RXQ33TJ5.js → chunk-IIZNQTMP.js} +4 -4
  16. package/dist/{chunk-3ZF7KXG7.js → chunk-KGBPJIFD.js} +8 -8
  17. package/dist/{chunk-XMJLHLTP.js → chunk-LVBXHCNA.js} +5 -5
  18. package/dist/{chunk-AGRHHLLU.js → chunk-MEJXCYPE.js} +3 -3
  19. package/dist/{chunk-VCC46RSM.js → chunk-OZ4CSS7U.js} +4 -4
  20. package/dist/{chunk-IA6LFPF6.js → chunk-RPVWH5XI.js} +3 -3
  21. package/dist/{chunk-GWFAUQTA.js → chunk-TGCCW35O.js} +3 -3
  22. package/dist/{chunk-CQ2TBLNI.js → chunk-VC5KDSHO.js} +3 -3
  23. package/dist/{chunk-CMH2SXO2.js → chunk-VC6MXN5M.js} +4 -4
  24. package/dist/{chunk-SUNMMSNA.js → chunk-VJIYWOYI.js} +3 -3
  25. package/dist/{chunk-5LQ6FPMG.js → chunk-WEX5IXBC.js} +3 -3
  26. package/dist/{chunk-RQI4ZBGD.js → chunk-ZDJ4PS2J.js} +4 -4
  27. package/dist/{cli-truncate-O3P2JP3R.js → cli-truncate-L4JXF7K6.js} +5 -5
  28. package/dist/commands/dev-parent.js +3 -3
  29. package/dist/{dd-trace-YVXACI2R.js → dd-trace-V65JTNHD.js} +6 -6
  30. package/dist/{dist-JEP3W4MX.js → dist-EF4VHLPM.js} +15 -15
  31. package/dist/{dist-P6KX5YQP.js → dist-MVLIC2E7.js} +15 -15
  32. package/dist/{embedded-playwright-mcp-server-MZSNDHEM.js → embedded-playwright-mcp-server-XVYGQCP2.js} +3 -3
  33. package/dist/{enquirer-KTXAONRU.js → enquirer-YVBWN72T.js} +4 -4
  34. package/dist/{estree-EZ46OBOV.js → estree-6PWHHM2H.js} +3 -3
  35. package/dist/{flow-TH3UXLF7.js → flow-KCVOER5U.js} +3 -3
  36. package/dist/{getMachineId-bsd-MR2XKG2B.js → getMachineId-bsd-D5RAZQ2D.js} +5 -5
  37. package/dist/{getMachineId-darwin-AAJJU6MN.js → getMachineId-darwin-BSFO7XMW.js} +5 -5
  38. package/dist/{getMachineId-linux-7RTUU34G.js → getMachineId-linux-6NVJ5V5T.js} +4 -4
  39. package/dist/{getMachineId-unsupported-OG5YTFWL.js → getMachineId-unsupported-4VOVSAF3.js} +4 -4
  40. package/dist/{getMachineId-win-75LZYSM6.js → getMachineId-win-YUDPXOPQ.js} +5 -5
  41. package/dist/{glimmer-GGFKDTMT.js → glimmer-V64NM4J5.js} +3 -3
  42. package/dist/{graphql-OLTPZXYQ.js → graphql-B6AYKOKI.js} +3 -3
  43. package/dist/{html-2Y3RXJYP.js → html-ZBVVO3ZX.js} +3 -3
  44. package/dist/{http-PJLQH3FL.js → http-D6TUKCBU.js} +14 -14
  45. package/dist/index.js +21 -21
  46. package/dist/{jiti-NUS2263O.js → jiti-R3YSBCRO.js} +3 -3
  47. package/dist/{log-update-74BM2NQD.js → log-update-KVOLYFCC.js} +6 -6
  48. package/dist/{markdown-OHLGC5II.js → markdown-REEFWBCX.js} +3 -3
  49. package/dist/{meriyah-B52FMLO2.js → meriyah-T5IDFQVO.js} +3 -3
  50. package/dist/{postcss-TLWBVFUA.js → postcss-3EBJ7C2O.js} +3 -3
  51. package/dist/{read-pkg-UHL7NMON.js → read-pkg-6Z3BVK5L.js} +4 -4
  52. package/dist/{spans-AL3VDU2M.js → spans-VA2N5JX4.js} +4 -4
  53. package/dist/{src-DG5OVYSC.js → src-PHVWXSHO.js} +3 -3
  54. package/dist/{token-NUDX2H6B.js → token-AKUP2Q7O.js} +5 -5
  55. package/dist/{token-util-AK3PIXPA.js → token-util-2MHFIMFV.js} +5 -5
  56. package/dist/{typescript-NIR246NT.js → typescript-GWQR45BP.js} +3 -3
  57. package/dist/{v4-3S6TFCKP.js → v4-MJ7Z6RFC.js} +4 -4
  58. package/dist/{wrap-ansi-WHRMXVUD.js → wrap-ansi-O7TR46WQ.js} +5 -5
  59. package/dist/{yaml-JGF65MO3.js → yaml-VUB5VSYH.js} +3 -3
  60. package/oclif.manifest.json +1 -1
  61. package/package.json +7 -7
  62. /package/dist/{acorn-REPR7IWV.js.map → acorn-R44QJXGX.js.map} +0 -0
  63. /package/dist/{angular-XIBF4SFS.js.map → angular-32M7AVGS.js.map} +0 -0
  64. /package/dist/{api-R44YCAXS.js.map → api-WIV6M7TY.js.map} +0 -0
  65. /package/dist/{babel-7P224XLY.js.map → babel-PFQW4XYW.js.map} +0 -0
  66. /package/dist/{chunk-5GXT3M4S.js.map → chunk-4T3WLZPG.js.map} +0 -0
  67. /package/dist/{chunk-LC2I3LIU.js.map → chunk-4ZEAMO2U.js.map} +0 -0
  68. /package/dist/{chunk-NP5RYEQM.js.map → chunk-6LFVTDU2.js.map} +0 -0
  69. /package/dist/{chunk-K335L7E6.js.map → chunk-AXJONZBD.js.map} +0 -0
  70. /package/dist/{chunk-RK5T2VWH.js.map → chunk-D4566SJ7.js.map} +0 -0
  71. /package/dist/{chunk-Z2QKVFPF.js.map → chunk-DB3LEK4O.js.map} +0 -0
  72. /package/dist/{chunk-2PJGTRDN.js.map → chunk-DJMTVLRU.js.map} +0 -0
  73. /package/dist/{chunk-RXQ33TJ5.js.map → chunk-IIZNQTMP.js.map} +0 -0
  74. /package/dist/{chunk-3ZF7KXG7.js.map → chunk-KGBPJIFD.js.map} +0 -0
  75. /package/dist/{chunk-XMJLHLTP.js.map → chunk-LVBXHCNA.js.map} +0 -0
  76. /package/dist/{chunk-AGRHHLLU.js.map → chunk-MEJXCYPE.js.map} +0 -0
  77. /package/dist/{chunk-VCC46RSM.js.map → chunk-OZ4CSS7U.js.map} +0 -0
  78. /package/dist/{chunk-IA6LFPF6.js.map → chunk-RPVWH5XI.js.map} +0 -0
  79. /package/dist/{chunk-GWFAUQTA.js.map → chunk-TGCCW35O.js.map} +0 -0
  80. /package/dist/{chunk-CQ2TBLNI.js.map → chunk-VC5KDSHO.js.map} +0 -0
  81. /package/dist/{chunk-CMH2SXO2.js.map → chunk-VC6MXN5M.js.map} +0 -0
  82. /package/dist/{chunk-SUNMMSNA.js.map → chunk-VJIYWOYI.js.map} +0 -0
  83. /package/dist/{chunk-5LQ6FPMG.js.map → chunk-WEX5IXBC.js.map} +0 -0
  84. /package/dist/{chunk-RQI4ZBGD.js.map → chunk-ZDJ4PS2J.js.map} +0 -0
  85. /package/dist/{cli-truncate-O3P2JP3R.js.map → cli-truncate-L4JXF7K6.js.map} +0 -0
  86. /package/dist/{dd-trace-YVXACI2R.js.map → dd-trace-V65JTNHD.js.map} +0 -0
  87. /package/dist/{dist-JEP3W4MX.js.map → dist-EF4VHLPM.js.map} +0 -0
  88. /package/dist/{dist-P6KX5YQP.js.map → dist-MVLIC2E7.js.map} +0 -0
  89. /package/dist/{embedded-playwright-mcp-server-MZSNDHEM.js.map → embedded-playwright-mcp-server-XVYGQCP2.js.map} +0 -0
  90. /package/dist/{enquirer-KTXAONRU.js.map → enquirer-YVBWN72T.js.map} +0 -0
  91. /package/dist/{estree-EZ46OBOV.js.map → estree-6PWHHM2H.js.map} +0 -0
  92. /package/dist/{flow-TH3UXLF7.js.map → flow-KCVOER5U.js.map} +0 -0
  93. /package/dist/{getMachineId-bsd-MR2XKG2B.js.map → getMachineId-bsd-D5RAZQ2D.js.map} +0 -0
  94. /package/dist/{getMachineId-darwin-AAJJU6MN.js.map → getMachineId-darwin-BSFO7XMW.js.map} +0 -0
  95. /package/dist/{getMachineId-linux-7RTUU34G.js.map → getMachineId-linux-6NVJ5V5T.js.map} +0 -0
  96. /package/dist/{getMachineId-unsupported-OG5YTFWL.js.map → getMachineId-unsupported-4VOVSAF3.js.map} +0 -0
  97. /package/dist/{getMachineId-win-75LZYSM6.js.map → getMachineId-win-YUDPXOPQ.js.map} +0 -0
  98. /package/dist/{glimmer-GGFKDTMT.js.map → glimmer-V64NM4J5.js.map} +0 -0
  99. /package/dist/{graphql-OLTPZXYQ.js.map → graphql-B6AYKOKI.js.map} +0 -0
  100. /package/dist/{html-2Y3RXJYP.js.map → html-ZBVVO3ZX.js.map} +0 -0
  101. /package/dist/{http-PJLQH3FL.js.map → http-D6TUKCBU.js.map} +0 -0
  102. /package/dist/{jiti-NUS2263O.js.map → jiti-R3YSBCRO.js.map} +0 -0
  103. /package/dist/{log-update-74BM2NQD.js.map → log-update-KVOLYFCC.js.map} +0 -0
  104. /package/dist/{markdown-OHLGC5II.js.map → markdown-REEFWBCX.js.map} +0 -0
  105. /package/dist/{meriyah-B52FMLO2.js.map → meriyah-T5IDFQVO.js.map} +0 -0
  106. /package/dist/{postcss-TLWBVFUA.js.map → postcss-3EBJ7C2O.js.map} +0 -0
  107. /package/dist/{read-pkg-UHL7NMON.js.map → read-pkg-6Z3BVK5L.js.map} +0 -0
  108. /package/dist/{spans-AL3VDU2M.js.map → spans-VA2N5JX4.js.map} +0 -0
  109. /package/dist/{src-DG5OVYSC.js.map → src-PHVWXSHO.js.map} +0 -0
  110. /package/dist/{token-NUDX2H6B.js.map → token-AKUP2Q7O.js.map} +0 -0
  111. /package/dist/{token-util-AK3PIXPA.js.map → token-util-2MHFIMFV.js.map} +0 -0
  112. /package/dist/{typescript-NIR246NT.js.map → typescript-GWQR45BP.js.map} +0 -0
  113. /package/dist/{v4-3S6TFCKP.js.map → v4-MJ7Z6RFC.js.map} +0 -0
  114. /package/dist/{wrap-ansi-WHRMXVUD.js.map → wrap-ansi-O7TR46WQ.js.map} +0 -0
  115. /package/dist/{yaml-JGF65MO3.js.map → yaml-VUB5VSYH.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 = '0b0bad522666bac55f96fe9112b3f6fe9a889eb2';
4
+ process.env.DD_GIT_COMMIT_SHA = '2ee59e9d024805e249f694ef52557d46e859a5f3';
5
5
  }
6
6
  import { createRequire as $dd_createRequire } from 'module';
7
7
  import { fileURLToPath as $dd_fileURLToPath } from 'url';
@@ -16,7 +16,7 @@ import {
16
16
  require_lib as require_lib2,
17
17
  require_lib2 as require_lib3,
18
18
  require_picocolors
19
- } from "./chunk-5GXT3M4S.js";
19
+ } from "./chunk-4T3WLZPG.js";
20
20
  import {
21
21
  debounce_default,
22
22
  get_default,
@@ -33,18 +33,18 @@ import {
33
33
  require_lib,
34
34
  require_slugify,
35
35
  throttle_default
36
- } from "./chunk-RK5T2VWH.js";
36
+ } from "./chunk-D4566SJ7.js";
37
37
  import {
38
38
  require_dd_trace,
39
39
  require_import_in_the_middle,
40
40
  require_js_yaml,
41
41
  require_module_details_from_path,
42
42
  require_src
43
- } from "./chunk-XMJLHLTP.js";
43
+ } from "./chunk-LVBXHCNA.js";
44
44
  import {
45
45
  require_dc_polyfill,
46
46
  require_storage2 as require_storage
47
- } from "./chunk-GWFAUQTA.js";
47
+ } from "./chunk-TGCCW35O.js";
48
48
  import {
49
49
  ATTR_SUPERBLOCKS_BASE_URL,
50
50
  ATTR_SUPERBLOCKS_CSB_ID,
@@ -53,10 +53,10 @@ import {
53
53
  SERVICE_NAME,
54
54
  getEnvironmentFromHostname,
55
55
  otlpBaseUrl
56
- } from "./chunk-Z2QKVFPF.js";
56
+ } from "./chunk-DB3LEK4O.js";
57
57
  import {
58
58
  require_token_error
59
- } from "./chunk-5LQ6FPMG.js";
59
+ } from "./chunk-WEX5IXBC.js";
60
60
  import {
61
61
  ROOT_CONTEXT,
62
62
  SpanKind,
@@ -69,7 +69,7 @@ import {
69
69
  metrics,
70
70
  propagation,
71
71
  trace
72
- } from "./chunk-SUNMMSNA.js";
72
+ } from "./chunk-VJIYWOYI.js";
73
73
  import {
74
74
  __commonJS,
75
75
  __esm,
@@ -79,7 +79,7 @@ import {
79
79
  __toESM,
80
80
  init_cjs_shims,
81
81
  require_register
82
- } from "./chunk-LC2I3LIU.js";
82
+ } from "./chunk-4ZEAMO2U.js";
83
83
 
84
84
  // ../../../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js
85
85
  var require_constants2 = __commonJS({
@@ -38844,6 +38844,7 @@ var require_response = __commonJS({
38844
38844
  SuperblocksError2["AuthenticatedUserNotFound"] = "AuthenticatedUserNotFound";
38845
38845
  SuperblocksError2["UserTokenInvalid"] = "UserTokenInvalid";
38846
38846
  SuperblocksError2["JWTExpired"] = "JWTExpired";
38847
+ SuperblocksError2["JWTVerificationUnavailable"] = "JWTVerificationUnavailable";
38847
38848
  })(SuperblocksError || (exports.SuperblocksError = SuperblocksError = {}));
38848
38849
  function isResponseMetadata(responseMetadata) {
38849
38850
  if (responseMetadata instanceof ResponseMeta) {
@@ -41781,7 +41782,18 @@ var require_policyGate = __commonJS({
41781
41782
  init_cjs_shims();
41782
41783
  Object.defineProperty(exports, "__esModule", { value: true });
41783
41784
  exports.POLICY_GATE_STALE_LIVE_EDIT_ERROR = exports.POLICY_GATE_BLOCKED_ERROR = exports.SECURITY_SCANS_ENABLED = void 0;
41785
+ exports.isHardBlockingPolicyItem = isHardBlockingPolicyItem;
41786
+ exports.areReadinessItemsAckEligible = areReadinessItemsAckEligible;
41784
41787
  exports.SECURITY_SCANS_ENABLED = false;
41788
+ function isHardBlockingPolicyItem(item) {
41789
+ if (item.mode !== "blocking" && item.mode !== "approval") {
41790
+ return false;
41791
+ }
41792
+ return item.status === "blocked" || item.status === "failed";
41793
+ }
41794
+ function areReadinessItemsAckEligible(items) {
41795
+ return items.length > 0 && items.every((item) => item.status === "blocked" || item.status === "passed" || item.status === "advisory_findings");
41796
+ }
41785
41797
  exports.POLICY_GATE_BLOCKED_ERROR = "POLICY_GATE_BLOCKED";
41786
41798
  exports.POLICY_GATE_STALE_LIVE_EDIT_ERROR = "Policy gates can only run for the current app state. Deploy the current changes or restore to this commit and then deploy.";
41787
41799
  }
@@ -78840,7 +78852,9 @@ var require_verifier = __commonJS({
78840
78852
  const result = await (0, jose_1.jwtVerify)(token2, jwkSet, options8);
78841
78853
  return result.payload;
78842
78854
  } catch (err) {
78843
- throw new index_js_1.UnauthorizedError(`JWT verification failed: ${err.message}`);
78855
+ const failure = new index_js_1.UnauthorizedError(`JWT verification failed: ${err.message}`);
78856
+ failure.cause = err;
78857
+ throw failure;
78844
78858
  }
78845
78859
  }
78846
78860
  async resolveJwkSet() {
@@ -99490,15 +99504,15 @@ var require_api_files = __commonJS({
99490
99504
  exports.readAppApiYamlFile = readAppApiYamlFile4;
99491
99505
  exports.resolveLanguageSpecificStepContentFromBlocks = resolveLanguageSpecificStepContentFromBlocks2;
99492
99506
  async function writeApiFiles3(...args) {
99493
- const esmFunction = await import("./api-R44YCAXS.js");
99507
+ const esmFunction = await import("./api-WIV6M7TY.js");
99494
99508
  return esmFunction.writeApiFiles(...args);
99495
99509
  }
99496
99510
  async function readAppApiYamlFile4(...args) {
99497
- const esmFunction = await import("./api-R44YCAXS.js");
99511
+ const esmFunction = await import("./api-WIV6M7TY.js");
99498
99512
  return esmFunction.readAppApiYamlFile(...args);
99499
99513
  }
99500
99514
  async function resolveLanguageSpecificStepContentFromBlocks2(...args) {
99501
- const esmFunction = await import("./api-R44YCAXS.js");
99515
+ const esmFunction = await import("./api-WIV6M7TY.js");
99502
99516
  return esmFunction.resolveLanguageSpecificStepContentFromBlocks(...args);
99503
99517
  }
99504
99518
  }
@@ -105718,19 +105732,19 @@ var require_getMachineId = __commonJS({
105718
105732
  if (!getMachineIdImpl) {
105719
105733
  switch (process5.platform) {
105720
105734
  case "darwin":
105721
- getMachineIdImpl = (await import("./getMachineId-darwin-AAJJU6MN.js")).getMachineId;
105735
+ getMachineIdImpl = (await import("./getMachineId-darwin-BSFO7XMW.js")).getMachineId;
105722
105736
  break;
105723
105737
  case "linux":
105724
- getMachineIdImpl = (await import("./getMachineId-linux-7RTUU34G.js")).getMachineId;
105738
+ getMachineIdImpl = (await import("./getMachineId-linux-6NVJ5V5T.js")).getMachineId;
105725
105739
  break;
105726
105740
  case "freebsd":
105727
- getMachineIdImpl = (await import("./getMachineId-bsd-MR2XKG2B.js")).getMachineId;
105741
+ getMachineIdImpl = (await import("./getMachineId-bsd-D5RAZQ2D.js")).getMachineId;
105728
105742
  break;
105729
105743
  case "win32":
105730
- getMachineIdImpl = (await import("./getMachineId-win-75LZYSM6.js")).getMachineId;
105744
+ getMachineIdImpl = (await import("./getMachineId-win-YUDPXOPQ.js")).getMachineId;
105731
105745
  break;
105732
105746
  default:
105733
- getMachineIdImpl = (await import("./getMachineId-unsupported-OG5YTFWL.js")).getMachineId;
105747
+ getMachineIdImpl = (await import("./getMachineId-unsupported-4VOVSAF3.js")).getMachineId;
105734
105748
  break;
105735
105749
  }
105736
105750
  }
@@ -166383,8 +166397,8 @@ var require_get_vercel_oidc_token = __commonJS({
166383
166397
  }
166384
166398
  try {
166385
166399
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
166386
- await import("./token-util-AK3PIXPA.js"),
166387
- await import("./token-NUDX2H6B.js")
166400
+ await import("./token-util-2MHFIMFV.js"),
166401
+ await import("./token-AKUP2Q7O.js")
166388
166402
  ]);
166389
166403
  if (!token2 || isExpired(getTokenPayload(token2))) {
166390
166404
  await refreshToken();
@@ -437806,7 +437820,7 @@ var require_config_loader = __commonJS({
437806
437820
  * @returns {Promise<{createJiti: Function|undefined, version: string;}>} A promise that fulfills with an object containing the jiti module's createJiti function and version.
437807
437821
  */
437808
437822
  static async loadJiti() {
437809
- const { createJiti } = await import("./jiti-NUS2263O.js");
437823
+ const { createJiti } = await import("./jiti-R3YSBCRO.js");
437810
437824
  const version3 = require_package5().version;
437811
437825
  return { createJiti, version: version3 };
437812
437826
  }
@@ -438135,7 +438149,7 @@ var require_eslint_helpers = __commonJS({
438135
438149
  }
438136
438150
  async function globMatch({ basePath, pattern }) {
438137
438151
  let found = false;
438138
- const { hfs } = await import("./src-DG5OVYSC.js");
438152
+ const { hfs } = await import("./src-PHVWXSHO.js");
438139
438153
  const patternToUse = normalizeToPosix(path84.relative(basePath, pattern));
438140
438154
  const matcher = new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
438141
438155
  const walkSettings = {
@@ -438175,7 +438189,7 @@ var require_eslint_helpers = __commonJS({
438175
438189
  return new Minimatch2(patternToUse, MINIMATCH_OPTIONS);
438176
438190
  });
438177
438191
  const unmatchedPatterns = /* @__PURE__ */ new Set([...relativeToPatterns.keys()]);
438178
- const { hfs } = await import("./src-DG5OVYSC.js");
438192
+ const { hfs } = await import("./src-PHVWXSHO.js");
438179
438193
  const walk2 = hfs.walk(basePath, {
438180
438194
  async directoryFilter(entry) {
438181
438195
  if (!matchers.some((matcher) => matcher.match(entry.path, true))) {
@@ -507658,7 +507672,7 @@ init_cjs_shims();
507658
507672
  // ../sdk/package.json
507659
507673
  var package_default = {
507660
507674
  name: "@superblocksteam/sdk",
507661
- version: "2.0.155-next.2",
507675
+ version: "2.0.155",
507662
507676
  description: "Superblocks JS SDK",
507663
507677
  homepage: "https://www.superblocks.com",
507664
507678
  license: "Superblocks Community Software License",
@@ -508027,7 +508041,7 @@ var config = void 0;
508027
508041
  var configured = false;
508028
508042
  var ddTracePromise = void 0;
508029
508043
  async function getDdTrace() {
508030
- ddTracePromise ??= import("./dd-trace-YVXACI2R.js").then((module) => module.default);
508044
+ ddTracePromise ??= import("./dd-trace-V65JTNHD.js").then((module) => module.default);
508031
508045
  return await ddTracePromise;
508032
508046
  }
508033
508047
  var deploymentType = (() => {
@@ -560201,7 +560215,7 @@ var MAX_ATTRIBUTE_LENGTH = 64e3;
560201
560215
  var LLMObsSpanWriter = null;
560202
560216
  async function loadLLMObsSpanWriter() {
560203
560217
  if (!LLMObsSpanWriter) {
560204
- const module = await import("./spans-AL3VDU2M.js");
560218
+ const module = await import("./spans-VA2N5JX4.js");
560205
560219
  LLMObsSpanWriter = module.default;
560206
560220
  }
560207
560221
  return LLMObsSpanWriter;
@@ -586016,7 +586030,8 @@ function computeContextUsed(usage) {
586016
586030
 
586017
586031
  // ../../../vite-plugin-file-sync/dist/ai-service/util/llm-config-utils.js
586018
586032
  init_cjs_shims();
586019
- function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext, contextManagementOptions) {
586033
+ var DEFAULT_THINKING_BUDGET_TOKENS = 5e3;
586034
+ function processLLMConfig(llmConfig, defaultBudgetTokens = DEFAULT_THINKING_BUDGET_TOKENS, logContext, contextManagementOptions) {
586020
586035
  const logger26 = getLogger3();
586021
586036
  const thinkingEnabled = llmConfig?.thinkingEnabled ?? true;
586022
586037
  let thinkingBudgetTokens = llmConfig?.thinkingBudgetTokens ? parseInt(llmConfig.thinkingBudgetTokens) : defaultBudgetTokens;
@@ -586069,6 +586084,29 @@ function processLLMConfig(llmConfig, defaultBudgetTokens = 5e3, logContext, cont
586069
586084
  headers: thinkingOptions.headers
586070
586085
  };
586071
586086
  }
586087
+ function buildModelConfigAttributes(llmConfig) {
586088
+ const context2 = resolveContextOptionsV2(llmConfig?.contextOptionsV2);
586089
+ return {
586090
+ context_limit: context2.contextLimit,
586091
+ max_output_tokens: context2.maxOutputTokens,
586092
+ context_buffer_tokens: context2.contextBufferTokens,
586093
+ // Only an explicit `true` opts in to server-side compaction; `false`,
586094
+ // `undefined`, and a missing flag payload all stay on the client path.
586095
+ context_management: llmConfig?.serverContextManagement?.enabled === true ? "server" : "client",
586096
+ ...buildThinkingAttributes(llmConfig)
586097
+ };
586098
+ }
586099
+ function buildThinkingAttributes(llmConfig) {
586100
+ if (usesAdaptiveEffort(llmConfig?.coreModel)) {
586101
+ return { thinking_mode: "adaptive" };
586102
+ }
586103
+ if (!(llmConfig?.thinkingEnabled ?? true)) {
586104
+ return { thinking_mode: "off" };
586105
+ }
586106
+ const configured2 = llmConfig?.thinkingBudgetTokens;
586107
+ const budget = configured2 ? parseInt(configured2) : DEFAULT_THINKING_BUDGET_TOKENS;
586108
+ return Number.isFinite(budget) ? { thinking_mode: "budgeted", thinking_budget_tokens: budget } : { thinking_mode: "budgeted" };
586109
+ }
586072
586110
 
586073
586111
  // ../../../vite-plugin-file-sync/dist/ai-service/state-machine/helpers/prompt-request-metrics.js
586074
586112
  init_cjs_shims();
@@ -587088,6 +587126,10 @@ var Clark = class _Clark extends TracedFSM {
587088
587126
  // they've been consumed.
587089
587127
  pausedForCreditsReason: ctx.pausedForCreditsReason,
587090
587128
  pausedForCreditsMultiChoiceContext: ctx.pausedForCreditsMultiChoiceContext,
587129
+ // same reasoning for an auth failure. The cancel path runs
587130
+ // through Idle, which rebuilds context from this list, so a flag left
587131
+ // off it is gone before the next prompt can read it.
587132
+ resumeAfterAuthFailure: ctx.resumeAfterAuthFailure,
587091
587133
  // APPS-4080: preserve the last generation-state snapshot across
587092
587134
  // resets so reconnect replay in `handleUserConnected` can faithfully
587093
587135
  // reproduce CANCELLED + paywallReason after a mid-stream credit
@@ -649739,6 +649781,7 @@ var LLMClient = class {
649739
649781
  });
649740
649782
  const scope = safetyConfig.scope ?? "all";
649741
649783
  const userText = extractTextFromMessage(user, scope);
649784
+ let classificationInput = safetyConfig.classification?.input ?? userText;
649742
649785
  if (hasSecretRedaction) {
649743
649786
  await tracer3.trace({
649744
649787
  name: "llmclient.safety.secretRedaction",
@@ -649759,6 +649802,7 @@ var LLMClient = class {
649759
649802
  });
649760
649803
  }
649761
649804
  safeUser = redactUserMessage(safeUser, secretRedactor);
649805
+ classificationInput = secretRedactor.redact(classificationInput);
649762
649806
  } catch (error40) {
649763
649807
  this.logger.error("[secret-scan] Secret scanning threw an exception, proceeding without redaction", getErrorMeta2(error40));
649764
649808
  }
@@ -649773,8 +649817,7 @@ var LLMClient = class {
649773
649817
  name: "llmclient.safety.classification",
649774
649818
  kind: "task"
649775
649819
  }, async () => {
649776
- const textToClassify = extractTextFromMessage(safeUser, scope);
649777
- const result = await this.applySafetyClassification(safeUser, textToClassify, config4, providerConfig);
649820
+ const result = await this.applySafetyClassification(safeUser, classificationInput, config4, providerConfig);
649778
649821
  safeUser = result.message;
649779
649822
  tracer3.annotate({
649780
649823
  tags: {
@@ -650784,7 +650827,7 @@ var PlaywrightMcpServerManager = class {
650784
650827
  this.logger.info(`Starting embedded Playwright MCP server: browser=${options8?.browser || "chromium"}, headless=${options8?.headless !== false}`);
650785
650828
  }
650786
650829
  try {
650787
- const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-MZSNDHEM.js");
650830
+ const { startEmbeddedPlaywrightMcpServer } = await import("./embedded-playwright-mcp-server-XVYGQCP2.js");
650788
650831
  this.server = await startEmbeddedPlaywrightMcpServer({
650789
650832
  storageStatePath: options8?.storageStatePath,
650790
650833
  jwt: options8?.jwt,
@@ -652940,7 +652983,8 @@ Address the errors and return the fixed code.`;
652940
652983
  }
652941
652984
  void params.appShell.warmLinterCache();
652942
652985
  let resolvedUserPrompt = request3.prompt;
652943
- const isPaywallResume = !!clark.context.pausedForCreditsReason;
652986
+ const isOrganicTurn = !isInternalTurn && !request3.importSource;
652987
+ const isSyntheticResume = !!clark.context.pausedForCreditsReason || !!clark.context.resumeAfterAuthFailure && isOrganicTurn;
652944
652988
  if (clark.context.pausedForCreditsReason) {
652945
652989
  const mcCtx = clark.context.pausedForCreditsMultiChoiceContext;
652946
652990
  if (mcCtx) {
@@ -652957,8 +653001,19 @@ ${request3.prompt}`;
652957
653001
  }
652958
653002
  clark.updateContext({
652959
653003
  pausedForCreditsReason: void 0,
652960
- pausedForCreditsMultiChoiceContext: void 0
653004
+ pausedForCreditsMultiChoiceContext: void 0,
653005
+ // Both can be pending at once, since an internal turn no longer
653006
+ // consumes the auth flag but can still hit the credits gate. The
653007
+ // credits wrap already asks the model to pick up where it left
653008
+ // off, so drop the auth one rather than let it prefix a later,
653009
+ // unrelated prompt.
653010
+ resumeAfterAuthFailure: void 0
652961
653011
  });
653012
+ } else if (clark.context.resumeAfterAuthFailure && isOrganicTurn) {
653013
+ resolvedUserPrompt = `(My previous turn stopped partway because my session expired. It is working again now. Please continue from where you stopped rather than starting over.)
653014
+
653015
+ ${request3.prompt}`;
653016
+ clark.updateContext({ resumeAfterAuthFailure: void 0 });
652962
653017
  }
652963
653018
  void transitionTo({
652964
653019
  type: AGENT_PLANNED,
@@ -652976,13 +653031,10 @@ ${request3.prompt}`;
652976
653031
  // `withThirdPartyMigrationSkillInstruction` which trips the
652977
653032
  // classifier as prompt injection. (APPS-4921)
652978
653033
  //
652979
- // Paywall-resume is intentionally NOT in this list it still
652980
- // carries the user's raw `request.prompt` text inside the wrap,
652981
- // so secret redaction must stay ON. Only the classifier gets
652982
- // skipped (via `isPaywallResume` below) because the synthetic
652983
- // resume coaching trips it as prompt injection.
653034
+ // Resume turns still carry raw user text. They keep both safety
653035
+ // features on, but classify the raw prompt instead of the wrapper.
652984
653036
  isUserPrompt: !request3.responseMetadata && !isInternalTurn && !request3.importSource,
652985
- isPaywallResume,
653037
+ safetyClassificationInput: isSyntheticResume ? request3.prompt : void 0,
652986
653038
  knowledgeMessageId
652987
653039
  });
652988
653040
  break;
@@ -653032,6 +653084,9 @@ ${request3.prompt}`;
653032
653084
  });
653033
653085
  break;
653034
653086
  }
653087
+ if (error40.type === "auth_error" && error40.data?.isClark === true) {
653088
+ clark.updateContext({ resumeAfterAuthFailure: true });
653089
+ }
653035
653090
  const advice = getTerminalErrorMessage(error40);
653036
653091
  void transitionTo({
653037
653092
  type: AGENT_CANCELED,
@@ -654511,6 +654566,7 @@ var buildBaseSystemPrompt = (config4, mode, factsSection, appKnowledgeSection, o
654511
654566
  const planGenerationVariant = options8?.variant === "plan-generation";
654512
654567
  const managedNativeDbAvailable = isManagedNativeDbAvailableForClark(config4);
654513
654568
  const superblocksDocsGuidance = config4.features.superblocksDocsMcpEnabled ? "For Superblocks product documentation, use the `search_superblocks_docs` tool first for setup, integration, and platform behavior questions. If the docs MCP result is missing or incomplete, then use `web_fetch` against `https://docs.superblocks.com` and, if needed, discover pages via `https://docs.superblocks.com/sitemap.xml`.\nWhen referring to Superblocks pages in your response, always include relative links: [Integrations](/integrations) for the integrations page, or [Integration Name](/integrations/{slug}) for a specific integration (e.g., [Salesforce](/integrations/salesforce), [PostgreSQL](/integrations/postgres))." : "For Superblocks product documentation, prefer `https://docs.superblocks.com` as the primary source. If you need to discover the right page first, use the sitemap at `https://docs.superblocks.com/sitemap.xml`, then fetch the specific docs page you need.";
654569
+ const managedNativeDbAvailabilityGuidance = managedNativeDbAvailable ? "" : "\n\n**App Database availability:** App Databases (called Superblocks Database in the product documentation) are not available for this organization. Documentation describing this feature does not override this restriction. Do not propose or attempt to provision an App Database. You may still use existing database integrations or help the user configure a supported integration.";
654514
654570
  let preamble = "";
654515
654571
  if (planGenerationVariant) {
654516
654572
  preamble = `## System Instructions
@@ -654738,6 +654794,7 @@ When an \`<environment_compatibility>\` block is present, treat it as the server
654738
654794
  - Use the Environment mutation tool only when \`canManageEnvironments\` is true and either the user asked to change app environment membership or \`remediationActions\` contains \`change_app_environment\`.
654739
654795
  - If that tool is unavailable, provide a read-only explanation and the server-supplied remediation options instead of claiming to make the change.
654740
654796
  `}
654797
+ ${managedNativeDbAvailabilityGuidance}
654741
654798
  <safety_guidance>
654742
654799
  ${safetyGuidance}
654743
654800
  </safety_guidance>
@@ -656588,7 +656645,7 @@ var doLLMGenerating = (clark, services) => {
656588
656645
  return async ({ event }) => {
656589
656646
  switch (event.type) {
656590
656647
  case AGENT_PLANNED: {
656591
- const { userPrompt, promptContext, isUserPrompt = true, isPaywallResume = false, knowledgeMessageId } = event;
656648
+ const { userPrompt, promptContext, isUserPrompt = true, safetyClassificationInput, knowledgeMessageId } = event;
656592
656649
  const runPromptId = clark.context.promptId;
656593
656650
  const isStaleRun = () => clark.context.promptId !== runPromptId;
656594
656651
  const provider = services.llmProvider.name;
@@ -656774,20 +656831,12 @@ var doLLMGenerating = (clark, services) => {
656774
656831
  onError: (error40) => {
656775
656832
  clark.logger.error("LLM stream processing failed", getErrorMeta2(error40));
656776
656833
  },
656777
- // Apply safety features for original user prompts. Responses to
656778
- // interactive messages and internal turns (isUserPrompt: false)
656779
- // skip both classifier and redaction — they carry no raw user
656780
- // text. Paywall-resume turns (isPaywallResume: true) carry raw
656781
- // user text inside a synthetic resume wrap, so we keep redaction
656782
- // ON but turn the classifier OFF (the wrap reliably trips it as
656783
- // prompt injection). (APPS-4080)
656784
656834
  safety: isUserPrompt ? {
656785
656835
  scope: "last",
656786
- // Unified scope: only scan user prompt, not context parts
656787
656836
  classification: {
656788
- enabled: !isPaywallResume && (services.features.safetyClassificationEnabled ?? false),
656789
- // Only resolve model if classification is enabled to avoid unnecessary work
656790
- model: !isPaywallResume && services.features.safetyClassificationEnabled ? services.llmProvider.modelForTask("fast").model : void 0,
656837
+ enabled: services.features.safetyClassificationEnabled ?? false,
656838
+ input: safetyClassificationInput,
656839
+ model: services.features.safetyClassificationEnabled ? services.llmProvider.modelForTask("fast").model : void 0,
656791
656840
  failOpen: true
656792
656841
  },
656793
656842
  secretRedaction: {
@@ -659604,17 +659653,28 @@ var AiService = class extends import_shared60.TracedEventEmitter {
659604
659653
  return this.clark?.context?.jwt;
659605
659654
  }
659606
659655
  /**
659607
- * Updates the JWT in Clark context
659656
+ * Updates the JWT in Clark context.
659657
+ *
659658
+ * A token that expires before the one already installed is ignored, because
659659
+ * primes can arrive out of order.
659660
+ *
659661
+ * @returns whether the pod ended up holding a usable token. A rejected token
659662
+ * used to look exactly like one that landed, and like one that was never
659663
+ * sent at all, which is why a run could die holding a credential nobody
659664
+ * knew was stale.
659608
659665
  */
659609
659666
  updateClarkJwt(jwt2) {
659610
659667
  const jwtDetails = describeMigrationInferenceJwt(jwt2);
659611
659668
  if (!jwt2 || !jwtDetails.usable) {
659612
- return;
659669
+ getLogger3().warn(`[ai-service] Rejected an inference JWT (present: ${jwtDetails.present}, hasFederatedToken: ${jwtDetails.hasFederatedToken}, scope: ${jwtDetails.scope ?? "none"})`);
659670
+ return false;
659613
659671
  }
659672
+ getLogger3().info("[ai-service] Accepted a new inference JWT");
659614
659673
  this.clark.updateContext({ jwt: jwt2 });
659615
659674
  const llmConfig = this.lastMigrationTurnCredentials?.llmConfig ?? this.clark.context.llmConfig ?? buildServerMigrationLlmConfig(this.config.flagBootstrap);
659616
659675
  this.storeMigrationTurnCredentials(jwt2, llmConfig);
659617
659676
  this.tryAutoDispatchMigrationTurnIfReady();
659677
+ return true;
659618
659678
  }
659619
659679
  // ===== Recording API =====
659620
659680
  /**
@@ -660466,6 +660526,7 @@ var AiService = class extends import_shared60.TracedEventEmitter {
660466
660526
  // Note: retry_count for LLM retries is added by orchestrator via providerOptions
660467
660527
  mode: clark.context.currentMode === AiMode.PLAN ? "plan" : "build",
660468
660528
  plan_size: clark.context.planSize,
660529
+ ...buildModelConfigAttributes(clark.context.llmConfig),
660469
660530
  metadata: baseCommitId ? { ...usageMetadata, baseCommitId } : usageMetadata
660470
660531
  };
660471
660532
  }
@@ -662710,11 +662771,13 @@ ${request3.prompt}`;
662710
662771
  this.clark.updateContext({
662711
662772
  activeInteractiveMessage: void 0,
662712
662773
  pendingIntegrationActionPrompt: void 0,
662713
- pendingToolPermissionRequest: void 0
662774
+ pendingToolPermissionRequest: void 0,
662775
+ resumeAfterAuthFailure: void 0
662714
662776
  });
662715
662777
  }
662716
662778
  /** Clears local LLM context so migration-era memory does not survive abort. */
662717
662779
  async clearMigrationAbortLocalContext() {
662780
+ this.clark.updateContext({ resumeAfterAuthFailure: void 0 });
662718
662781
  const contextId = getContextId(this.clark, this.config);
662719
662782
  await this.contextManagerV2.clearAllContexts();
662720
662783
  if (contextId) {
@@ -665834,7 +665897,7 @@ var import_shared72 = __toESM(require_dist2());
665834
665897
  // ../../../vite-plugin-file-sync/package.json
665835
665898
  var package_default2 = {
665836
665899
  name: "@superblocksteam/vite-plugin-file-sync",
665837
- version: "2.0.155-next.2",
665900
+ version: "2.0.155",
665838
665901
  keywords: [
665839
665902
  "vite-plugin"
665840
665903
  ],
@@ -667588,8 +667651,16 @@ var SocketManager = class extends import_shared78.TracedEventEmitter {
667588
667651
  }
667589
667652
  ],
667590
667653
  primeClarkInferenceJwt: [
667654
+ // Fail loudly. The browser is the only thing that can hand
667655
+ // over a working token, so it has to learn that this one
667656
+ // did not land.
667591
667657
  async (request3) => {
667592
- aiService?.updateClarkJwt(request3.jwt);
667658
+ if (!aiService) {
667659
+ throw new Error("Cannot prime the Clark inference JWT: the AI service is not running");
667660
+ }
667661
+ if (!aiService.updateClarkJwt(request3.jwt)) {
667662
+ throw new Error("The dev server rejected the Clark inference JWT");
667663
+ }
667593
667664
  }
667594
667665
  ],
667595
667666
  gitCommitLocal: [
@@ -690641,7 +690712,7 @@ var parseYaml3;
690641
690712
  async function loadYaml(file2) {
690642
690713
  const content19 = await read_file_default(file2);
690643
690714
  if (!parseYaml3) {
690644
- ({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-JGF65MO3.js"));
690715
+ ({ __parsePrettierYamlConfig: parseYaml3 } = await import("./yaml-VUB5VSYH.js"));
690645
690716
  }
690646
690717
  try {
690647
690718
  return parseYaml3(content19);
@@ -696035,7 +696106,7 @@ function createParsersAndPrinters(modules) {
696035
696106
  }
696036
696107
  var estreePlugin = createParsersAndPrinters([
696037
696108
  {
696038
- importPlugin: () => import("./estree-EZ46OBOV.js"),
696109
+ importPlugin: () => import("./estree-6PWHHM2H.js"),
696039
696110
  printers: ["estree", "estree-json"]
696040
696111
  }
696041
696112
  ]);
@@ -696059,11 +696130,11 @@ var languages = [
696059
696130
  ];
696060
696131
  var { parsers: parsers12, printers } = createParsersAndPrinters([
696061
696132
  {
696062
- importPlugin: () => import("./acorn-REPR7IWV.js"),
696133
+ importPlugin: () => import("./acorn-R44QJXGX.js"),
696063
696134
  parsers: ["acorn", "espree"]
696064
696135
  },
696065
696136
  {
696066
- importPlugin: () => import("./angular-XIBF4SFS.js"),
696137
+ importPlugin: () => import("./angular-32M7AVGS.js"),
696067
696138
  parsers: [
696068
696139
  "__ng_action",
696069
696140
  "__ng_binding",
@@ -696072,7 +696143,7 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
696072
696143
  ]
696073
696144
  },
696074
696145
  {
696075
- importPlugin: () => import("./babel-7P224XLY.js"),
696146
+ importPlugin: () => import("./babel-PFQW4XYW.js"),
696076
696147
  parsers: [
696077
696148
  "babel",
696078
696149
  "babel-flow",
@@ -696091,44 +696162,44 @@ var { parsers: parsers12, printers } = createParsersAndPrinters([
696091
696162
  ]
696092
696163
  },
696093
696164
  {
696094
- importPlugin: () => import("./flow-TH3UXLF7.js"),
696165
+ importPlugin: () => import("./flow-KCVOER5U.js"),
696095
696166
  parsers: ["flow"]
696096
696167
  },
696097
696168
  {
696098
- importPlugin: () => import("./glimmer-GGFKDTMT.js"),
696169
+ importPlugin: () => import("./glimmer-V64NM4J5.js"),
696099
696170
  parsers: ["glimmer"],
696100
696171
  printers: ["glimmer"]
696101
696172
  },
696102
696173
  {
696103
- importPlugin: () => import("./graphql-OLTPZXYQ.js"),
696174
+ importPlugin: () => import("./graphql-B6AYKOKI.js"),
696104
696175
  parsers: ["graphql"],
696105
696176
  printers: ["graphql"]
696106
696177
  },
696107
696178
  {
696108
- importPlugin: () => import("./html-2Y3RXJYP.js"),
696179
+ importPlugin: () => import("./html-ZBVVO3ZX.js"),
696109
696180
  parsers: ["html", "angular", "vue", "lwc", "mjml"],
696110
696181
  printers: ["html"]
696111
696182
  },
696112
696183
  {
696113
- importPlugin: () => import("./markdown-OHLGC5II.js"),
696184
+ importPlugin: () => import("./markdown-REEFWBCX.js"),
696114
696185
  parsers: ["markdown", "mdx", "remark"],
696115
696186
  printers: ["mdast"]
696116
696187
  },
696117
696188
  {
696118
- importPlugin: () => import("./meriyah-B52FMLO2.js"),
696189
+ importPlugin: () => import("./meriyah-T5IDFQVO.js"),
696119
696190
  parsers: ["meriyah"]
696120
696191
  },
696121
696192
  {
696122
- importPlugin: () => import("./postcss-TLWBVFUA.js"),
696193
+ importPlugin: () => import("./postcss-3EBJ7C2O.js"),
696123
696194
  parsers: ["css", "less", "scss"],
696124
696195
  printers: ["postcss"]
696125
696196
  },
696126
696197
  {
696127
- importPlugin: () => import("./typescript-NIR246NT.js"),
696198
+ importPlugin: () => import("./typescript-GWQR45BP.js"),
696128
696199
  parsers: ["typescript"]
696129
696200
  },
696130
696201
  {
696131
- importPlugin: () => import("./yaml-JGF65MO3.js"),
696202
+ importPlugin: () => import("./yaml-VUB5VSYH.js"),
696132
696203
  parsers: ["yaml"],
696133
696204
  printers: ["yaml"]
696134
696205
  }
@@ -700091,7 +700162,7 @@ function setupCorsAndValidateMethod({ req, res, allowedMethod, allowHeaders }) {
700091
700162
  return true;
700092
700163
  }
700093
700164
  function registerMigrationRoutes(server, options8) {
700094
- const { appRootDir, getIsInitialized, syncService, logger: logger26, inPlaceTemplateRestartEnabled = false, getAiService, prepareInPlaceRestart: prepareInPlaceRestart2 } = options8;
700165
+ const { appRootDir, checkAuthorization, getIsInitialized, syncService, logger: logger26, inPlaceTemplateRestartEnabled = false, getAiService, prepareInPlaceRestart: prepareInPlaceRestart2 } = options8;
700095
700166
  server.middlewares.use("/sb-migration-status", (req, res, next2) => {
700096
700167
  if (!getIsInitialized())
700097
700168
  return next2();
@@ -700125,6 +700196,13 @@ function registerMigrationRoutes(server, options8) {
700125
700196
  })) {
700126
700197
  return;
700127
700198
  }
700199
+ const authorization = await checkAuthorization(req.headers.authorization);
700200
+ if (!authorization.success) {
700201
+ res.statusCode = authorization.status;
700202
+ res.setHeader("Content-Type", "application/json");
700203
+ res.end(JSON.stringify({ error: authorization.error }));
700204
+ return;
700205
+ }
700128
700206
  const body = req.body;
700129
700207
  const { applicationId, branchName, commitId } = body;
700130
700208
  if (typeof applicationId !== "string" || typeof branchName !== "string" || typeof commitId !== "string") {
@@ -700147,7 +700225,7 @@ function registerMigrationRoutes(server, options8) {
700147
700225
  res.end(JSON.stringify({ error: "Authorization required" }));
700148
700226
  return;
700149
700227
  }
700150
- aiService.updateClarkJwt(jwt2);
700228
+ const jwtAccepted = aiService.updateClarkJwt(jwt2);
700151
700229
  let cleared = false;
700152
700230
  try {
700153
700231
  await aiService.clearMigrationAbortLocalContext();
@@ -700157,7 +700235,7 @@ function registerMigrationRoutes(server, options8) {
700157
700235
  }
700158
700236
  res.statusCode = 200;
700159
700237
  res.setHeader("Content-Type", "application/json");
700160
- res.end(JSON.stringify({ ok: true, cleared }));
700238
+ res.end(JSON.stringify({ ok: true, cleared, jwtAccepted }));
700161
700239
  })().catch((error40) => {
700162
700240
  logger26.error("[migrate-route] /sb-migration-restore-context failed", getErrorMeta2(error40));
700163
700241
  res.statusCode = 500;
@@ -701902,11 +701980,11 @@ function fileSyncVitePlugin(pluginParams, options8) {
701902
701980
  try {
701903
701981
  unlinkSync2(metadataFilePath);
701904
701982
  } catch (cleanupError) {
701905
- logger26.error("Failed to cleanup metadata file", cleanupError);
701983
+ logger26.error("Failed to cleanup metadata file", getErrorMeta2(cleanupError));
701906
701984
  }
701907
701985
  }
701908
701986
  } catch (error40) {
701909
- logger26.error("Error creating zip download", error40);
701987
+ logger26.error("Error creating zip download", getErrorMeta2(error40));
701910
701988
  if (!res.headersSent) {
701911
701989
  res.statusCode = 500;
701912
701990
  res.setHeader("Content-Type", "application/json");
@@ -701999,6 +702077,7 @@ function fileSyncVitePlugin(pluginParams, options8) {
701999
702077
  });
702000
702078
  registerMigrationRoutes(server, {
702001
702079
  appRootDir,
702080
+ checkAuthorization: pluginParams.checkAuthorization,
702002
702081
  getIsInitialized: () => isInitialized,
702003
702082
  syncService,
702004
702083
  logger: logger26,
@@ -716994,7 +717073,7 @@ async function handleLockConflict(error40, lockSvc, span, logger26) {
716994
717073
  }
716995
717074
  async function readPkgJson(cwd) {
716996
717075
  try {
716997
- const { readPackage } = await import("./read-pkg-UHL7NMON.js");
717076
+ const { readPackage } = await import("./read-pkg-6Z3BVK5L.js");
716998
717077
  return await readPackage({ cwd });
716999
717078
  } catch {
717000
717079
  return null;
@@ -719055,4 +719134,4 @@ serve-static/index.js:
719055
719134
  chokidar/esm/index.js:
719056
719135
  (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
719057
719136
  */
719058
- //# sourceMappingURL=chunk-OBRNLKIW.js.map
719137
+ //# sourceMappingURL=chunk-CCOC6R73.js.map