@superblocksteam/cli 2.0.110-next.8 → 2.0.110

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/bin/run.js +1 -3
  3. package/dist/{acorn-FVAU6BPS.js → acorn-QRHEJZ4Y.js} +3 -3
  4. package/dist/{angular-S4NZEOFG.js → angular-E7FCGLEO.js} +3 -3
  5. package/dist/{api-5O3BHHV5.js → api-F7VFMVH5.js} +4 -4
  6. package/dist/{babel-XIQY6ZNA.js → babel-XU2VNNSQ.js} +3 -3
  7. package/dist/{chunk-WJZIMFHE.js → chunk-42MJC4KH.js} +4 -4
  8. package/dist/{chunk-LPX2Q5LD.js → chunk-4N2GPPW5.js} +3 -3
  9. package/dist/{chunk-L7IXQ4ID.js → chunk-5M7JSMKP.js} +3 -3
  10. package/dist/{chunk-XQB6BJ54.js → chunk-7XGJ2DPJ.js} +3 -3
  11. package/dist/{chunk-R77VCKC5.js → chunk-CHRYSMMG.js} +3 -3
  12. package/dist/{chunk-AQ6VYTRQ.js → chunk-E33HPBUC.js} +2 -2
  13. package/dist/{chunk-3YZBU3RR.js → chunk-FAJ3NJRT.js} +3 -3
  14. package/dist/{chunk-F3RSFQBD.js → chunk-H427LM2L.js} +3 -3
  15. package/dist/{chunk-7XJURN7W.js → chunk-JUTJWISA.js} +6 -6
  16. package/dist/{chunk-D4BMSQJY.js → chunk-QQTIZ3JW.js} +3 -3
  17. package/dist/{chunk-OW2LUCXS.js → chunk-SOVZ4MKE.js} +3 -3
  18. package/dist/{chunk-BA4C2PKF.js → chunk-UQQWHXCE.js} +4 -4
  19. package/dist/{chunk-7EODL6JA.js → chunk-VUXGBCHS.js} +4 -4
  20. package/dist/{chunk-VPKT2XRT.js → chunk-X2O46BBJ.js} +6 -6
  21. package/dist/{chunk-ERQSEXOE.js → chunk-XBQXSTNW.js} +484 -1615
  22. package/dist/{chunk-ERQSEXOE.js.map → chunk-XBQXSTNW.js.map} +1 -1
  23. package/dist/{chunk-BESQNJEC.js → chunk-Y5UCK4QB.js} +3 -3
  24. package/dist/{chunk-BIHBIO4H.js → chunk-Z64OZ4VQ.js} +4 -4
  25. package/dist/{cli-truncate-GZLMJA45.js → cli-truncate-R7BZHTWM.js} +5 -5
  26. package/dist/commands/dev-parent.js +2 -2
  27. package/dist/{dd-trace-SUJ42IPS.js → dd-trace-TMWNM5TU.js} +7 -7
  28. package/dist/{dist-5A42YBMP.js → dist-QGBH4SEF.js} +13 -13
  29. package/dist/{embedded-playwright-mcp-server-4GWMHI6K.js → embedded-playwright-mcp-server-6GY37WOF.js} +3 -3
  30. package/dist/{enquirer-VGC3XSVU.js → enquirer-QSA4Q3KI.js} +4 -4
  31. package/dist/{estree-YYBOQRDV.js → estree-M5XOW65K.js} +3 -3
  32. package/dist/{flow-IDDICIAN.js → flow-L3D4WX3Z.js} +3 -3
  33. package/dist/{getMachineId-bsd-XSCXM33P.js → getMachineId-bsd-I2VASQDS.js} +5 -5
  34. package/dist/{getMachineId-darwin-HHIDR2LJ.js → getMachineId-darwin-VTQRCEUS.js} +5 -5
  35. package/dist/{getMachineId-linux-VS2B7YBN.js → getMachineId-linux-4IXPONMU.js} +4 -4
  36. package/dist/{getMachineId-unsupported-4NHKXBGG.js → getMachineId-unsupported-UAR7YCNX.js} +4 -4
  37. package/dist/{getMachineId-win-GCVSYR3H.js → getMachineId-win-C7XX6XLO.js} +5 -5
  38. package/dist/{glimmer-7JGQ5ETX.js → glimmer-LUDC5QNV.js} +3 -3
  39. package/dist/{graphql-WERBW3XS.js → graphql-VIZ3REIC.js} +3 -3
  40. package/dist/{html-OFPTSHG5.js → html-I6EAKISS.js} +3 -3
  41. package/dist/{http-5OJBOWUJ.js → http-XXFRZJNU.js} +12 -12
  42. package/dist/index.js +26 -298
  43. package/dist/index.js.map +1 -1
  44. package/dist/{jiti-TN3UU5R6.js → jiti-EJ36EOMK.js} +3 -3
  45. package/dist/{log-update-UCFHBNA6.js → log-update-53HBE7QZ.js} +6 -6
  46. package/dist/{markdown-DMKHHF7S.js → markdown-STBGDZM6.js} +3 -3
  47. package/dist/{meriyah-GS5532SL.js → meriyah-65T7PG5O.js} +3 -3
  48. package/dist/{postcss-YPVPRBZA.js → postcss-ASIVSSN2.js} +3 -3
  49. package/dist/{read-pkg-XGDAO2TH.js → read-pkg-MWZA3RU5.js} +5 -5
  50. package/dist/{spans-IYV2NEH4.js → spans-3EJDY2PZ.js} +4 -4
  51. package/dist/{src-GHMSK4IH.js → src-DWCFAABS.js} +3 -3
  52. package/dist/{token-ML4CAHCS.js → token-YF6QEPIT.js} +5 -5
  53. package/dist/{token-util-WVP7U4JD.js → token-util-TV464TI4.js} +5 -5
  54. package/dist/{typescript-AD3CNBJV.js → typescript-ZZIEC5OF.js} +3 -3
  55. package/dist/{wrap-ansi-VSXHOSLW.js → wrap-ansi-7RMGVNIF.js} +5 -5
  56. package/dist/{yaml-K6BYFOZ5.js → yaml-P2AMYUL3.js} +3 -3
  57. package/oclif.manifest.json +1 -8
  58. package/package.json +5 -5
  59. /package/dist/{acorn-FVAU6BPS.js.map → acorn-QRHEJZ4Y.js.map} +0 -0
  60. /package/dist/{angular-S4NZEOFG.js.map → angular-E7FCGLEO.js.map} +0 -0
  61. /package/dist/{api-5O3BHHV5.js.map → api-F7VFMVH5.js.map} +0 -0
  62. /package/dist/{babel-XIQY6ZNA.js.map → babel-XU2VNNSQ.js.map} +0 -0
  63. /package/dist/{chunk-WJZIMFHE.js.map → chunk-42MJC4KH.js.map} +0 -0
  64. /package/dist/{chunk-LPX2Q5LD.js.map → chunk-4N2GPPW5.js.map} +0 -0
  65. /package/dist/{chunk-L7IXQ4ID.js.map → chunk-5M7JSMKP.js.map} +0 -0
  66. /package/dist/{chunk-XQB6BJ54.js.map → chunk-7XGJ2DPJ.js.map} +0 -0
  67. /package/dist/{chunk-R77VCKC5.js.map → chunk-CHRYSMMG.js.map} +0 -0
  68. /package/dist/{chunk-AQ6VYTRQ.js.map → chunk-E33HPBUC.js.map} +0 -0
  69. /package/dist/{chunk-3YZBU3RR.js.map → chunk-FAJ3NJRT.js.map} +0 -0
  70. /package/dist/{chunk-F3RSFQBD.js.map → chunk-H427LM2L.js.map} +0 -0
  71. /package/dist/{chunk-7XJURN7W.js.map → chunk-JUTJWISA.js.map} +0 -0
  72. /package/dist/{chunk-D4BMSQJY.js.map → chunk-QQTIZ3JW.js.map} +0 -0
  73. /package/dist/{chunk-OW2LUCXS.js.map → chunk-SOVZ4MKE.js.map} +0 -0
  74. /package/dist/{chunk-BA4C2PKF.js.map → chunk-UQQWHXCE.js.map} +0 -0
  75. /package/dist/{chunk-7EODL6JA.js.map → chunk-VUXGBCHS.js.map} +0 -0
  76. /package/dist/{chunk-VPKT2XRT.js.map → chunk-X2O46BBJ.js.map} +0 -0
  77. /package/dist/{chunk-BESQNJEC.js.map → chunk-Y5UCK4QB.js.map} +0 -0
  78. /package/dist/{chunk-BIHBIO4H.js.map → chunk-Z64OZ4VQ.js.map} +0 -0
  79. /package/dist/{cli-truncate-GZLMJA45.js.map → cli-truncate-R7BZHTWM.js.map} +0 -0
  80. /package/dist/{dd-trace-SUJ42IPS.js.map → dd-trace-TMWNM5TU.js.map} +0 -0
  81. /package/dist/{dist-5A42YBMP.js.map → dist-QGBH4SEF.js.map} +0 -0
  82. /package/dist/{embedded-playwright-mcp-server-4GWMHI6K.js.map → embedded-playwright-mcp-server-6GY37WOF.js.map} +0 -0
  83. /package/dist/{enquirer-VGC3XSVU.js.map → enquirer-QSA4Q3KI.js.map} +0 -0
  84. /package/dist/{estree-YYBOQRDV.js.map → estree-M5XOW65K.js.map} +0 -0
  85. /package/dist/{flow-IDDICIAN.js.map → flow-L3D4WX3Z.js.map} +0 -0
  86. /package/dist/{getMachineId-bsd-XSCXM33P.js.map → getMachineId-bsd-I2VASQDS.js.map} +0 -0
  87. /package/dist/{getMachineId-darwin-HHIDR2LJ.js.map → getMachineId-darwin-VTQRCEUS.js.map} +0 -0
  88. /package/dist/{getMachineId-linux-VS2B7YBN.js.map → getMachineId-linux-4IXPONMU.js.map} +0 -0
  89. /package/dist/{getMachineId-unsupported-4NHKXBGG.js.map → getMachineId-unsupported-UAR7YCNX.js.map} +0 -0
  90. /package/dist/{getMachineId-win-GCVSYR3H.js.map → getMachineId-win-C7XX6XLO.js.map} +0 -0
  91. /package/dist/{glimmer-7JGQ5ETX.js.map → glimmer-LUDC5QNV.js.map} +0 -0
  92. /package/dist/{graphql-WERBW3XS.js.map → graphql-VIZ3REIC.js.map} +0 -0
  93. /package/dist/{html-OFPTSHG5.js.map → html-I6EAKISS.js.map} +0 -0
  94. /package/dist/{http-5OJBOWUJ.js.map → http-XXFRZJNU.js.map} +0 -0
  95. /package/dist/{jiti-TN3UU5R6.js.map → jiti-EJ36EOMK.js.map} +0 -0
  96. /package/dist/{log-update-UCFHBNA6.js.map → log-update-53HBE7QZ.js.map} +0 -0
  97. /package/dist/{markdown-DMKHHF7S.js.map → markdown-STBGDZM6.js.map} +0 -0
  98. /package/dist/{meriyah-GS5532SL.js.map → meriyah-65T7PG5O.js.map} +0 -0
  99. /package/dist/{postcss-YPVPRBZA.js.map → postcss-ASIVSSN2.js.map} +0 -0
  100. /package/dist/{read-pkg-XGDAO2TH.js.map → read-pkg-MWZA3RU5.js.map} +0 -0
  101. /package/dist/{spans-IYV2NEH4.js.map → spans-3EJDY2PZ.js.map} +0 -0
  102. /package/dist/{src-GHMSK4IH.js.map → src-DWCFAABS.js.map} +0 -0
  103. /package/dist/{token-ML4CAHCS.js.map → token-YF6QEPIT.js.map} +0 -0
  104. /package/dist/{token-util-WVP7U4JD.js.map → token-util-TV464TI4.js.map} +0 -0
  105. /package/dist/{typescript-AD3CNBJV.js.map → typescript-ZZIEC5OF.js.map} +0 -0
  106. /package/dist/{wrap-ansi-VSXHOSLW.js.map → wrap-ansi-7RMGVNIF.js.map} +0 -0
  107. /package/dist/{yaml-K6BYFOZ5.js.map → yaml-P2AMYUL3.js.map} +0 -0
package/dist/index.js CHANGED
@@ -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 = '0ac778310cdc917742fd6f2071499e64e9631047';
4
+ process.env.DD_GIT_COMMIT_SHA = 'd6e752a2cecf8e93bafaf04dda2d5214949ae79a';
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
  configPathForClient,
16
16
  labelForClient,
17
17
  mergeMcpConfig
18
- } from "./chunk-7EODL6JA.js";
18
+ } from "./chunk-VUXGBCHS.js";
19
19
  import {
20
20
  AUTO_UPGRADE_EXIT_CODE,
21
21
  AuthHotReloadServer,
@@ -62,7 +62,6 @@ import {
62
62
  isSocketAlive,
63
63
  magenta,
64
64
  modeFlagValuesMap,
65
- preWarmViteCache,
66
65
  readApiFromDisk,
67
66
  readApplicationFromDisk,
68
67
  readMultiPageApplicationFromDisk,
@@ -79,28 +78,28 @@ import {
79
78
  writeApplicationToDisk,
80
79
  writeResourceToDisk,
81
80
  yellow
82
- } from "./chunk-ERQSEXOE.js";
83
- import "./chunk-D4BMSQJY.js";
81
+ } from "./chunk-XBQXSTNW.js";
82
+ import "./chunk-QQTIZ3JW.js";
84
83
  import {
85
84
  require_enquirer
86
- } from "./chunk-OW2LUCXS.js";
85
+ } from "./chunk-SOVZ4MKE.js";
87
86
  import {
88
87
  init_lodash,
89
88
  isEmpty_default,
90
89
  require_lib
91
- } from "./chunk-XQB6BJ54.js";
90
+ } from "./chunk-7XGJ2DPJ.js";
92
91
  import {
93
92
  require_rfdc
94
- } from "./chunk-VPKT2XRT.js";
95
- import "./chunk-F3RSFQBD.js";
96
- import "./chunk-BESQNJEC.js";
97
- import "./chunk-LPX2Q5LD.js";
98
- import "./chunk-3YZBU3RR.js";
93
+ } from "./chunk-X2O46BBJ.js";
94
+ import "./chunk-H427LM2L.js";
95
+ import "./chunk-Y5UCK4QB.js";
96
+ import "./chunk-4N2GPPW5.js";
97
+ import "./chunk-FAJ3NJRT.js";
99
98
  import {
100
99
  __commonJS,
101
100
  __toESM,
102
101
  init_cjs_shims
103
- } from "./chunk-AQ6VYTRQ.js";
102
+ } from "./chunk-E33HPBUC.js";
104
103
 
105
104
  // ../../../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
106
105
  var require_eventemitter3 = __commonJS({
@@ -1012,7 +1011,7 @@ async function createPrompt(options, settings) {
1012
1011
  enquirer3 = settings.enquirer;
1013
1012
  } else {
1014
1013
  try {
1015
- enquirer3 = await import("./enquirer-VGC3XSVU.js").then((imported) => imported.default ? new imported.default() : new imported());
1014
+ enquirer3 = await import("./enquirer-QSA4Q3KI.js").then((imported) => imported.default ? new imported.default() : new imported());
1016
1015
  } catch (e) {
1017
1016
  if (this instanceof TaskWrapper) {
1018
1017
  this.task.prompt = new PromptError("Enquirer is a peer dependency that must be installed separately.");
@@ -1220,9 +1219,9 @@ var _DefaultRenderer = class {
1220
1219
  return typeof bottomBar === "number" && bottomBar !== 0 || typeof bottomBar === "boolean" && bottomBar !== false || !task.hasTitle();
1221
1220
  }
1222
1221
  async render() {
1223
- const { createLogUpdate } = await import("./log-update-UCFHBNA6.js");
1224
- const { default: truncate } = await import("./cli-truncate-GZLMJA45.js");
1225
- const { default: wrap } = await import("./wrap-ansi-VSXHOSLW.js");
1222
+ const { createLogUpdate } = await import("./log-update-53HBE7QZ.js");
1223
+ const { default: truncate } = await import("./cli-truncate-R7BZHTWM.js");
1224
+ const { default: wrap } = await import("./wrap-ansi-7RMGVNIF.js");
1226
1225
  this.updater = createLogUpdate(this.logger.process.stdout);
1227
1226
  this.truncate = truncate;
1228
1227
  this.wrap = wrap;
@@ -4787,9 +4786,7 @@ var Deploy = class _Deploy extends AuthenticatedCommand {
4787
4786
  // src/commands/dev.mts
4788
4787
  init_cjs_shims();
4789
4788
  import * as child_process from "node:child_process";
4790
- import * as fs6 from "node:fs";
4791
- import * as http from "node:http";
4792
- import { basename, dirname, join as join3, resolve } from "node:path";
4789
+ import { resolve } from "node:path";
4793
4790
  import { Flags as Flags6, ux as ux4 } from "@oclif/core";
4794
4791
  var import_util13 = __toESM(require_dist2(), 1);
4795
4792
  var Dev = class _Dev extends AuthenticatedCommand {
@@ -4798,12 +4795,6 @@ var Dev = class _Dev extends AuthenticatedCommand {
4798
4795
  flags;
4799
4796
  applicationConfig;
4800
4797
  superblocksBaseUrl;
4801
- warmServer;
4802
- // When true, the CLI was started in warm pool standby mode and subsequently
4803
- // activated by SABS. Used to route auto-upgrade to SKIP_CLI_ONLY — the warm
4804
- // pod already ships with the latest CLI, but the user's package.json still
4805
- // needs to be synced to the target @superblocksteam/library version.
4806
- warmStandbyActivated = false;
4807
4798
  authHotReloadServer;
4808
4799
  getAuthTokenTimeoutMs() {
4809
4800
  return 5 * 60 * 1e3;
@@ -4818,9 +4809,6 @@ var Dev = class _Dev extends AuthenticatedCommand {
4818
4809
  async init() {
4819
4810
  const { flags } = await this.parse(_Dev);
4820
4811
  this.flags = flags;
4821
- if (this.flags.warm) {
4822
- return;
4823
- }
4824
4812
  let token;
4825
4813
  let superblocksBaseUrl;
4826
4814
  const branch = await getCurrentBranchInfo();
@@ -4991,7 +4979,7 @@ var Dev = class _Dev extends AuthenticatedCommand {
4991
4979
  if (!this.flags) {
4992
4980
  throw new Error("Flags are not initialized");
4993
4981
  }
4994
- const autoUpgradeMode = this.warmStandbyActivated ? DevServerAutoUpgradeMode.SKIP_CLI_ONLY : this.flags["skip-auto-upgrade"] ? DevServerAutoUpgradeMode.SKIP : this.flags["force-auto-upgrade"] ? DevServerAutoUpgradeMode.FORCE : void 0;
4982
+ const autoUpgradeMode = this.flags["skip-auto-upgrade"] ? DevServerAutoUpgradeMode.SKIP : this.flags["force-auto-upgrade"] ? DevServerAutoUpgradeMode.FORCE : void 0;
4995
4983
  await this.startDevServer({
4996
4984
  applicationConfig: this.applicationConfig,
4997
4985
  tokenConfig: {
@@ -5006,9 +4994,7 @@ var Dev = class _Dev extends AuthenticatedCommand {
5006
4994
  superblocksPath: resolve(process.argv[1]),
5007
4995
  autoUpgradeMode,
5008
4996
  sdk,
5009
- prefetchedApplication,
5010
- skipSync: false
5011
- // DBFS runs alongside S3 during migration (D-25)
4997
+ prefetchedApplication
5012
4998
  });
5013
4999
  }
5014
5000
  async onTokenReceived(token) {
@@ -5039,12 +5025,6 @@ var Dev = class _Dev extends AuthenticatedCommand {
5039
5025
  description: "The port that the dev server will run on",
5040
5026
  hidden: true
5041
5027
  }),
5042
- warm: Flags6.boolean({
5043
- name: "warm",
5044
- description: "Start in warm standby mode: pre-loads the server process without auth, then activates on /_sb_activate POST",
5045
- default: false,
5046
- hidden: true
5047
- }),
5048
5028
  "upload-first": Flags6.boolean({
5049
5029
  name: "upload-first",
5050
5030
  description: "Upload to Superblocks before starting",
@@ -5093,10 +5073,6 @@ var Dev = class _Dev extends AuthenticatedCommand {
5093
5073
  if (!this.flags) {
5094
5074
  throw new Error("Flags are not initialized");
5095
5075
  }
5096
- if (this.flags.warm) {
5097
- await this.runWarmStandby();
5098
- return;
5099
- }
5100
5076
  if (!this.flags["upload-first"] && !this.flags["download-first"]) {
5101
5077
  throw new Error(
5102
5078
  "This command requires either the --upload-first or --download-first flag"
@@ -5182,257 +5158,9 @@ var Dev = class _Dev extends AuthenticatedCommand {
5182
5158
  tokenManager: this.tokenManager,
5183
5159
  getCurrentToken: () => this.getCurrentToken(),
5184
5160
  authHotReloadServer: this.authHotReloadServer,
5185
- autoUpgradeMode: options.autoUpgradeMode,
5186
- existingServer: this.warmServer
5161
+ autoUpgradeMode: options.autoUpgradeMode
5187
5162
  });
5188
5163
  }
5189
- /**
5190
- * Warm standby mode: starts a minimal HTTP server that responds to health
5191
- * checks while the Node.js runtime is fully loaded in memory. When SABS
5192
- * activates the pod via POST /_sb_activate with session credentials, this
5193
- * method writes the config files, closes the standby server, and hands off
5194
- * to the normal `executeWithToken` flow.
5195
- *
5196
- * This eliminates the ~1.9s CLI cold-start from the claim-time critical path.
5197
- */
5198
- async runWarmStandby() {
5199
- const port = this.flags?.port ?? 5173;
5200
- const logger = this.logger();
5201
- logger.info(`Starting warm standby server on port ${port}`);
5202
- const activationConfig = await new Promise((resolveActivation, rejectActivation) => {
5203
- const server = http.createServer((req, res) => {
5204
- res.setHeader("Cache-Control", "no-store, max-age=0");
5205
- res.setHeader("x-csb-no-sw-proxy", "1");
5206
- if (req.url === "/_sb_health" && req.method === "GET") {
5207
- res.writeHead(503, { "Content-Type": "application/json" });
5208
- res.end(JSON.stringify({ status: "warming" }));
5209
- return;
5210
- }
5211
- if (req.url === "/_sb_activate" && req.method === "POST") {
5212
- const MAX_BODY = 64 * 1024;
5213
- let body = "";
5214
- let destroyed = false;
5215
- req.on("data", (chunk) => {
5216
- if (destroyed) return;
5217
- body += chunk.toString();
5218
- if (body.length > MAX_BODY) {
5219
- destroyed = true;
5220
- res.writeHead(413, { "Content-Type": "application/json" });
5221
- res.end(JSON.stringify({ error: "Request body too large" }));
5222
- req.destroy();
5223
- }
5224
- });
5225
- req.on("end", () => {
5226
- if (destroyed) return;
5227
- try {
5228
- const config = JSON.parse(body);
5229
- const missing = ["token", "baseUrl", "applicationId", "branch"].filter((k) => typeof config[k] !== "string" || !config[k]);
5230
- if (missing.length) {
5231
- res.writeHead(400, { "Content-Type": "application/json" });
5232
- res.end(
5233
- JSON.stringify({
5234
- error: `Missing required fields: ${missing.join(", ")}`
5235
- })
5236
- );
5237
- return;
5238
- }
5239
- res.writeHead(200, { "Content-Type": "application/json" });
5240
- res.end(JSON.stringify({ status: "activating" }));
5241
- logger.info(
5242
- "Activation received, transitioning to full dev server"
5243
- );
5244
- this.warmServer = server;
5245
- resolveActivation(config);
5246
- } catch {
5247
- res.writeHead(400, { "Content-Type": "application/json" });
5248
- res.end(JSON.stringify({ error: "invalid JSON body" }));
5249
- }
5250
- });
5251
- return;
5252
- }
5253
- res.writeHead(503);
5254
- res.end();
5255
- });
5256
- server.on("error", (err) => {
5257
- logger.error(`Warm standby server failed to start: ${err.message}`);
5258
- rejectActivation(err);
5259
- });
5260
- server.listen(port, () => {
5261
- logger.info(`Warm standby ready on port ${port}`);
5262
- preWarmViteCache(process.cwd()).catch((err) => {
5263
- logger.warn(`preWarmViteCache background task rejected: ${err}`);
5264
- });
5265
- });
5266
- });
5267
- process.env.SUPERBLOCKS_TOKEN = activationConfig.token;
5268
- process.env.SUPERBLOCKS_BASE_URL = activationConfig.baseUrl;
5269
- process.env.APPLICATION_ID = activationConfig.applicationId;
5270
- process.env.BRANCH = activationConfig.branch;
5271
- if (activationConfig.hostname) {
5272
- process.env.SABS_LIVE_EDIT_HOSTNAME = activationConfig.hostname;
5273
- }
5274
- if (activationConfig.templateName) {
5275
- process.env.SUPERBLOCKS_APP_TEMPLATE_NAME = activationConfig.templateName;
5276
- const currentDir = basename(process.cwd());
5277
- if (currentDir !== activationConfig.templateName) {
5278
- const targetDir = join3(
5279
- process.cwd(),
5280
- "..",
5281
- activationConfig.templateName
5282
- );
5283
- if (fs6.existsSync(targetDir)) {
5284
- logger.info(
5285
- `Switching template directory: ${currentDir} -> ${activationConfig.templateName}`
5286
- );
5287
- process.chdir(targetDir);
5288
- } else {
5289
- logger.warn(
5290
- `Template directory not found: ${targetDir}, staying in ${currentDir}`
5291
- );
5292
- }
5293
- }
5294
- }
5295
- const authFilePath = (0, import_util13.resolveAuthFilePath)();
5296
- fs6.mkdirSync(dirname(authFilePath), { recursive: true });
5297
- fs6.writeFileSync(
5298
- authFilePath,
5299
- JSON.stringify({
5300
- superblocksBaseUrl: activationConfig.baseUrl,
5301
- token: activationConfig.token
5302
- })
5303
- );
5304
- const appConfigPath = join3(
5305
- process.cwd(),
5306
- ".superblocks",
5307
- "superblocks.json"
5308
- );
5309
- fs6.mkdirSync(dirname(appConfigPath), { recursive: true });
5310
- fs6.writeFileSync(
5311
- appConfigPath,
5312
- JSON.stringify({
5313
- configType: "APPLICATION_V2",
5314
- id: activationConfig.applicationId
5315
- })
5316
- );
5317
- const devEnvPath = join3(
5318
- process.cwd(),
5319
- "..",
5320
- "..",
5321
- ".superblocks",
5322
- "dev-environment.json"
5323
- );
5324
- fs6.mkdirSync(dirname(devEnvPath), { recursive: true });
5325
- fs6.writeFileSync(
5326
- devEnvPath,
5327
- JSON.stringify({
5328
- configType: "DEV_ENVIRONMENT",
5329
- branch: activationConfig.branch
5330
- })
5331
- );
5332
- if (activationConfig.downloadURL) {
5333
- try {
5334
- logger.info("Downloading workspace archive...");
5335
- const downloadStart = Date.now();
5336
- const downloadResp = await fetch(activationConfig.downloadURL, {
5337
- signal: AbortSignal.timeout(3e4)
5338
- });
5339
- if (!downloadResp.ok || !downloadResp.body) {
5340
- throw new Error(
5341
- `Workspace download failed: ${downloadResp.status} ${downloadResp.statusText}`
5342
- );
5343
- }
5344
- logger.info(
5345
- `Workspace download completed in ${Date.now() - downloadStart}ms, extracting...`
5346
- );
5347
- const extractStart = Date.now();
5348
- await new Promise((resolveExtract, rejectExtract) => {
5349
- const zstdProc = child_process.spawn("zstd", ["-d"], {
5350
- stdio: ["pipe", "pipe", "pipe"]
5351
- });
5352
- const tarProc = child_process.spawn(
5353
- "tar",
5354
- ["xf", "-", "-C", process.cwd()],
5355
- {
5356
- stdio: ["pipe", "inherit", "pipe"]
5357
- }
5358
- );
5359
- zstdProc.stdout.pipe(tarProc.stdin);
5360
- zstdProc.stdin.on("error", (err) => {
5361
- rejectExtract(new Error(`zstd stdin stream error: ${err.message}`));
5362
- });
5363
- tarProc.stdin.on("error", (err) => {
5364
- rejectExtract(new Error(`tar stdin stream error: ${err.message}`));
5365
- });
5366
- const reader = downloadResp.body.getReader();
5367
- const pump = async () => {
5368
- while (true) {
5369
- const { done, value } = await reader.read();
5370
- if (done) {
5371
- zstdProc.stdin.end();
5372
- break;
5373
- }
5374
- if (!zstdProc.stdin.write(value)) {
5375
- await new Promise((r) => zstdProc.stdin.once("drain", r));
5376
- }
5377
- }
5378
- };
5379
- pump().catch((e) => {
5380
- zstdProc.kill();
5381
- tarProc.kill();
5382
- rejectExtract(e);
5383
- });
5384
- let stderr = "";
5385
- zstdProc.stderr.on("data", (chunk) => {
5386
- stderr += chunk.toString();
5387
- });
5388
- tarProc.stderr?.on("data", (chunk) => {
5389
- stderr += chunk.toString();
5390
- });
5391
- let zstdExitCode = null;
5392
- zstdProc.on("close", (code) => {
5393
- zstdExitCode = code;
5394
- });
5395
- tarProc.on("close", (code) => {
5396
- if (zstdExitCode !== null && zstdExitCode !== 0) {
5397
- rejectExtract(
5398
- new Error(
5399
- `zstd decompression failed (code ${zstdExitCode}): ${stderr}`
5400
- )
5401
- );
5402
- } else if (code === 0) {
5403
- resolveExtract();
5404
- } else {
5405
- rejectExtract(
5406
- new Error(`tar extract failed (code ${code}): ${stderr}`)
5407
- );
5408
- }
5409
- });
5410
- tarProc.on("error", rejectExtract);
5411
- zstdProc.on("error", rejectExtract);
5412
- });
5413
- logger.info(
5414
- `Workspace extracted in ${Date.now() - extractStart}ms (total ${Date.now() - downloadStart}ms)`
5415
- );
5416
- } catch (error) {
5417
- logger.warn(
5418
- `Workspace download/extract failed, DBFS will fill the gap: ${error}`
5419
- );
5420
- }
5421
- }
5422
- this.currentToken = activationConfig.token;
5423
- this.superblocksBaseUrl = activationConfig.baseUrl;
5424
- this.applicationConfig = {
5425
- id: activationConfig.applicationId,
5426
- branchName: activationConfig.branch
5427
- };
5428
- this.warmStandbyActivated = true;
5429
- this.flags = {
5430
- ...this.flags,
5431
- "download-first": true
5432
- };
5433
- await this.initializeTelemetry(activationConfig.token);
5434
- await this.executeWithToken(activationConfig.token);
5435
- }
5436
5164
  async spawnAndWaitForChild(previousRunResult, flags) {
5437
5165
  let _resolve;
5438
5166
  const promise = new Promise((resolve2) => {
@@ -6250,12 +5978,12 @@ var McpServe = class _McpServe extends Command9 {
6250
5978
  "HTTP transport requires auth token. Pass --http-token <token> or set SUPERBLOCKS_MCP_HTTP_TOKEN."
6251
5979
  );
6252
5980
  }
6253
- const { startHttpServer } = await import("./http-5OJBOWUJ.js");
5981
+ const { startHttpServer } = await import("./http-XXFRZJNU.js");
6254
5982
  await startHttpServer({ port: flags.port, authToken: httpToken });
6255
5983
  await new Promise(() => {
6256
5984
  });
6257
5985
  } else {
6258
- const { startServer } = await import("./dist-5A42YBMP.js");
5986
+ const { startServer } = await import("./dist-QGBH4SEF.js");
6259
5987
  await startServer();
6260
5988
  await new Promise((resolve2) => {
6261
5989
  process.stdin.once("end", () => resolve2());
@@ -7738,7 +7466,7 @@ function getResourceIdFromLocation(ctx, resourceLocation) {
7738
7466
  // src/commands/sync.mts
7739
7467
  init_cjs_shims();
7740
7468
  import { execFile } from "node:child_process";
7741
- import * as fs12 from "node:fs/promises";
7469
+ import * as fs11 from "node:fs/promises";
7742
7470
  import * as os from "node:os";
7743
7471
  import path17 from "node:path";
7744
7472
  import { promisify as promisify2 } from "node:util";
@@ -7832,7 +7560,7 @@ var Sync = class _Sync extends Command11 {
7832
7560
  appRelativePath,
7833
7561
  requestedSha
7834
7562
  }) {
7835
- const worktreeBase = await fs12.mkdtemp(
7563
+ const worktreeBase = await fs11.mkdtemp(
7836
7564
  path17.join(os.tmpdir(), "superblocks-sync-main-")
7837
7565
  );
7838
7566
  const worktreePath = path17.join(worktreeBase, "worktree");
@@ -7892,7 +7620,7 @@ var Sync = class _Sync extends Command11 {
7892
7620
  );
7893
7621
  } catch {
7894
7622
  }
7895
- await fs12.rm(worktreeBase, { recursive: true, force: true });
7623
+ await fs11.rm(worktreeBase, { recursive: true, force: true });
7896
7624
  }
7897
7625
  }
7898
7626
  async resolveRepoRoot(localDirectoryPath) {
@@ -7929,7 +7657,7 @@ var Sync = class _Sync extends Command11 {
7929
7657
  return snapshotAppPath;
7930
7658
  }
7931
7659
  const uploadPath = path17.join(worktreeBase, "upload");
7932
- await fs12.cp(snapshotAppPath, uploadPath, {
7660
+ await fs11.cp(snapshotAppPath, uploadPath, {
7933
7661
  recursive: true,
7934
7662
  force: true,
7935
7663
  filter: (sourcePath) => path17.basename(sourcePath) !== ".git"