@openbuilder/cli 0.50.15 → 0.50.18

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 (31) hide show
  1. package/dist/chunks/{Banner-D4tqKfzA.js → Banner-ClJs6QcI.js} +3 -4
  2. package/dist/chunks/{Banner-D4tqKfzA.js.map → Banner-ClJs6QcI.js.map} +1 -1
  3. package/dist/chunks/_commonjsHelpers-DcsQGttR.js +32 -0
  4. package/dist/chunks/_commonjsHelpers-DcsQGttR.js.map +1 -0
  5. package/dist/chunks/{cli-auth-CHooQYR9.js → cli-auth-rqwB_Zwt.js} +12 -2
  6. package/dist/chunks/cli-auth-rqwB_Zwt.js.map +1 -0
  7. package/dist/chunks/{init-tui-BNzk_7Yx.js → init-tui-DDxZYe9B.js} +54 -55
  8. package/dist/chunks/{init-tui-BNzk_7Yx.js.map → init-tui-DDxZYe9B.js.map} +1 -1
  9. package/dist/chunks/{init-CZoN6soU.js → init-zX5aX-qn.js} +5 -6
  10. package/dist/chunks/{init-CZoN6soU.js.map → init-zX5aX-qn.js.map} +1 -1
  11. package/dist/chunks/{login-XrUC43gE.js → login-DFgTXEGt.js} +2 -2
  12. package/dist/chunks/{login-XrUC43gE.js.map → login-DFgTXEGt.js.map} +1 -1
  13. package/dist/chunks/{logout-Dib2ZEQL.js → logout-DwddishT.js} +2 -2
  14. package/dist/chunks/{logout-Dib2ZEQL.js.map → logout-DwddishT.js.map} +1 -1
  15. package/dist/chunks/{main-tui-1ygCKH67.js → main-tui-B5GJ49Bp.js} +43 -44
  16. package/dist/chunks/{main-tui-1ygCKH67.js.map → main-tui-B5GJ49Bp.js.map} +1 -1
  17. package/dist/chunks/{run-ImqaRH0K.js → run-CaSootos.js} +34 -35
  18. package/dist/chunks/{run-ImqaRH0K.js.map → run-CaSootos.js.map} +1 -1
  19. package/dist/chunks/{start-BygPCbvw.js → start-B4P27nZ7.js} +46 -47
  20. package/dist/chunks/{start-BygPCbvw.js.map → start-B4P27nZ7.js.map} +1 -1
  21. package/dist/chunks/theme-BF4W2Gwm.js +2300 -0
  22. package/dist/chunks/theme-BF4W2Gwm.js.map +1 -0
  23. package/dist/chunks/{useBuildState-CdBSu9y_.js → useBuildState-BZuezCb6.js} +33 -35
  24. package/dist/chunks/{useBuildState-CdBSu9y_.js.map → useBuildState-BZuezCb6.js.map} +1 -1
  25. package/dist/cli/index.js +7 -7
  26. package/dist/instrument.js +1 -29
  27. package/dist/instrument.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunks/cli-auth-CHooQYR9.js.map +0 -1
  30. package/dist/chunks/theme-DhorI2Hb.js +0 -44
  31. package/dist/chunks/theme-DhorI2Hb.js.map +0 -1
@@ -3,9 +3,8 @@ import { execSync } from 'node:child_process';
3
3
  import { existsSync, readFileSync } from 'node:fs';
4
4
  import { join, dirname } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
- import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import { j as jsxRuntimeExports, c as colors } from './theme-BF4W2Gwm.js';
7
7
  import { Box, Text } from 'ink';
8
- import { c as colors } from './theme-DhorI2Hb.js';
9
8
 
10
9
  /**
11
10
  * Version and git commit info utilities
@@ -106,8 +105,8 @@ function Banner() {
106
105
  { open: '╚██████╔╝██║ ███████╗██║ ╚████║', builder: '██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║' },
107
106
  { open: ' ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝', builder: '╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝' },
108
107
  ];
109
- return (jsx(Box, { flexDirection: "column", alignItems: "center", children: lines.map((line, index) => (jsxs(Box, { children: [jsx(Text, { color: colors.cyan, children: line.open }), jsx(Text, { color: colors.brightPurple, children: line.builder })] }, index))) }));
108
+ return (jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "center", children: lines.map((line, index) => (jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: line.open }), jsxRuntimeExports.jsx(Text, { color: colors.brightPurple, children: line.builder })] }, index))) }));
110
109
  }
111
110
 
112
111
  export { Banner as B, getVersionInfo as g };
113
- //# sourceMappingURL=Banner-D4tqKfzA.js.map
112
+ //# sourceMappingURL=Banner-ClJs6QcI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Banner-D4tqKfzA.js","sources":["../../src/cli/utils/version-info.ts","../../src/cli/tui/components/Banner.tsx"],"sourcesContent":["/**\n * Version and git commit info utilities\n */\n\nimport { execSync } from 'node:child_process';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Find the package root directory (apps/runner).\n * Works in both development (src/cli/utils/) and production (dist/cli/utils/) modes.\n */\nfunction findPackageRoot(): string {\n // Try multiple possible locations\n const possiblePaths = [\n // Development: src/cli/utils/ -> apps/runner (3 levels up)\n join(__dirname, '..', '..', '..'),\n // Production from dist/cli/utils/: -> apps/runner (3 levels up, same structure)\n join(__dirname, '..', '..', '..'),\n ];\n \n for (const path of possiblePaths) {\n const packageJsonPath = join(path, 'package.json');\n if (existsSync(packageJsonPath)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n // Verify this is the runner package\n if (pkg.name === '@openbuilder/cli') {\n return path;\n }\n } catch {\n // Continue to next path\n }\n }\n }\n \n // Fallback to the standard path\n return join(__dirname, '..', '..', '..');\n}\n\n// Cache the package root\nconst packageRoot = findPackageRoot();\n\n/**\n * Get the package version from package.json\n */\nexport function getPackageVersion(): string {\n try {\n const packageJsonPath = join(packageRoot, 'package.json');\n if (existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n return packageJson.version || '0.0.0';\n }\n } catch {\n // Ignore errors\n }\n return '0.0.0';\n}\n\n/**\n * Get the short git commit hash\n */\nexport function getGitCommit(): string | null {\n try {\n // Try to get commit from git command\n const commit = execSync('git rev-parse --short HEAD', {\n cwd: packageRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n return commit || null;\n } catch {\n // Git not available or not a git repo\n return null;\n }\n}\n\n/**\n * Get combined version string with commit\n * Returns \"v0.19.1 (abc1234)\" or just \"v0.19.1\" if no commit\n */\nexport function getVersionString(): string {\n const version = getPackageVersion();\n const commit = getGitCommit();\n \n if (commit) {\n return `v${version} (${commit})`;\n }\n return `v${version}`;\n}\n\n/**\n * Version info object\n */\nexport interface VersionInfo {\n version: string;\n commit: string | null;\n display: string;\n}\n\n/**\n * Get all version info\n */\nexport function getVersionInfo(): VersionInfo {\n const version = getPackageVersion();\n const commit = getGitCommit();\n \n return {\n version,\n commit,\n display: commit ? `v${version} (${commit})` : `v${version}`,\n };\n}\n","import { Box, Text } from 'ink';\nimport { colors } from '../theme.js';\n\n/**\n * ASCII art banner component - centered with cyan/purple gradient\n * Each line is padded to exactly the same width for perfect alignment\n */\nexport function Banner() {\n // Full banner lines - OPEN in cyan, BUILDER in purple\n // All lines padded to same total width for consistent centering\n const lines = [\n { open: ' ██████╗ ██████╗ ███████╗███╗ ██╗', builder: '██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ ' },\n { open: '██╔═══██╗██╔══██╗██╔════╝████╗ ██║', builder: '██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗' },\n { open: '██║ ██║██████╔╝█████╗ ██╔██╗ ██║', builder: '██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝' },\n { open: '██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║', builder: '██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗' },\n { open: '╚██████╔╝██║ ███████╗██║ ╚████║', builder: '██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║' },\n { open: ' ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝', builder: '╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝' },\n ];\n\n return (\n <Box flexDirection=\"column\" alignItems=\"center\">\n {lines.map((line, index) => (\n <Box key={index}>\n <Text color={colors.cyan}>{line.open}</Text>\n <Text color={colors.brightPurple}>{line.builder}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n"],"names":["__filename","__dirname","_jsx","_jsxs"],"mappings":";;;;;;;;;AAAA;;AAEG;AAOH,MAAMA,YAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACjD,MAAMC,WAAS,GAAG,OAAO,CAACD,YAAU,CAAC;AAErC;;;AAGG;AACH,SAAS,eAAe,GAAA;;AAEtB,IAAA,MAAM,aAAa,GAAG;;QAEpB,IAAI,CAACC,WAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;;QAEjC,IAAI,CAACA,WAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAClC;AAED,IAAA,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE;QAChC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;AAClD,QAAA,IAAI,UAAU,CAAC,eAAe,CAAC,EAAE;AAC/B,YAAA,IAAI;AACF,gBAAA,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;;AAE9D,gBAAA,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB,EAAE;AACnC,oBAAA,OAAO,IAAI;gBACb;YACF;AAAE,YAAA,MAAM;;YAER;QACF;IACF;;IAGA,OAAO,IAAI,CAACA,WAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAC1C;AAEA;AACA,MAAM,WAAW,GAAG,eAAe,EAAE;AAErC;;AAEG;SACa,iBAAiB,GAAA;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C,EAAE,OAAO,EAAE,sDAAsD,EAAE;AAChH,QAAA,EAAE,IAAI,EAAE,qCAAqC,EAAE,OAAO,EAAE,sDAAsD,EAAE;AAChH,QAAA,EAAE,IAAI,EAAE,qCAAqC,EAAE,OAAO,EAAE,sDAAsD,EAAE;AAChH,QAAA,EAAE,IAAI,EAAE,qCAAqC,EAAE,OAAO,EAAE,sDAAsD,EAAE;KACjH;AAED,IAAA,QACEC,GAAA,CAAC,GAAG,EAAA,EAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAA,QAAA,EAC5C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MACrBC,IAAA,CAAC,GAAG,EAAA,EAAA,QAAA,EAAA,CACFD,GAAA,CAAC,IAAI,EAAA,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAA,QAAA,EAAG,IAAI,CAAC,IAAI,EAAA,CAAQ,EAC5CA,GAAA,CAAC,IAAI,EAAA,EAAC,KAAK,EAAE,MAAM,CAAC,YAAY,EAAA,QAAA,EAAG,IAAI,CAAC,OAAO,EAAA,CAAQ,CAAA,EAAA,EAF/C,KAAK,CAGT,CACP,CAAC,EAAA,CACE;AAEV;;;;"}
1
+ {"version":3,"file":"Banner-ClJs6QcI.js","sources":["../../src/cli/utils/version-info.ts","../../src/cli/tui/components/Banner.tsx"],"sourcesContent":["/**\n * Version and git commit info utilities\n */\n\nimport { execSync } from 'node:child_process';\nimport { readFileSync, existsSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Find the package root directory (apps/runner).\n * Works in both development (src/cli/utils/) and production (dist/cli/utils/) modes.\n */\nfunction findPackageRoot(): string {\n // Try multiple possible locations\n const possiblePaths = [\n // Development: src/cli/utils/ -> apps/runner (3 levels up)\n join(__dirname, '..', '..', '..'),\n // Production from dist/cli/utils/: -> apps/runner (3 levels up, same structure)\n join(__dirname, '..', '..', '..'),\n ];\n \n for (const path of possiblePaths) {\n const packageJsonPath = join(path, 'package.json');\n if (existsSync(packageJsonPath)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n // Verify this is the runner package\n if (pkg.name === '@openbuilder/cli') {\n return path;\n }\n } catch {\n // Continue to next path\n }\n }\n }\n \n // Fallback to the standard path\n return join(__dirname, '..', '..', '..');\n}\n\n// Cache the package root\nconst packageRoot = findPackageRoot();\n\n/**\n * Get the package version from package.json\n */\nexport function getPackageVersion(): string {\n try {\n const packageJsonPath = join(packageRoot, 'package.json');\n if (existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n return packageJson.version || '0.0.0';\n }\n } catch {\n // Ignore errors\n }\n return '0.0.0';\n}\n\n/**\n * Get the short git commit hash\n */\nexport function getGitCommit(): string | null {\n try {\n // Try to get commit from git command\n const commit = execSync('git rev-parse --short HEAD', {\n cwd: packageRoot,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n }).trim();\n return commit || null;\n } catch {\n // Git not available or not a git repo\n return null;\n }\n}\n\n/**\n * Get combined version string with commit\n * Returns \"v0.19.1 (abc1234)\" or just \"v0.19.1\" if no commit\n */\nexport function getVersionString(): string {\n const version = getPackageVersion();\n const commit = getGitCommit();\n \n if (commit) {\n return `v${version} (${commit})`;\n }\n return `v${version}`;\n}\n\n/**\n * Version info object\n */\nexport interface VersionInfo {\n version: string;\n commit: string | null;\n display: string;\n}\n\n/**\n * Get all version info\n */\nexport function getVersionInfo(): VersionInfo {\n const version = getPackageVersion();\n const commit = getGitCommit();\n \n return {\n version,\n commit,\n display: commit ? `v${version} (${commit})` : `v${version}`,\n };\n}\n","import { Box, Text } from 'ink';\nimport { colors } from '../theme.js';\n\n/**\n * ASCII art banner component - centered with cyan/purple gradient\n * Each line is padded to exactly the same width for perfect alignment\n */\nexport function Banner() {\n // Full banner lines - OPEN in cyan, BUILDER in purple\n // All lines padded to same total width for consistent centering\n const lines = [\n { open: ' ██████╗ ██████╗ ███████╗███╗ ██╗', builder: '██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗ ' },\n { open: '██╔═══██╗██╔══██╗██╔════╝████╗ ██║', builder: '██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗' },\n { open: '██║ ██║██████╔╝█████╗ ██╔██╗ ██║', builder: '██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝' },\n { open: '██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║', builder: '██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗' },\n { open: '╚██████╔╝██║ ███████╗██║ ╚████║', builder: '██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║' },\n { open: ' ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝', builder: '╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝' },\n ];\n\n return (\n <Box flexDirection=\"column\" alignItems=\"center\">\n {lines.map((line, index) => (\n <Box key={index}>\n <Text color={colors.cyan}>{line.open}</Text>\n <Text color={colors.brightPurple}>{line.builder}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n"],"names":["__filename","__dirname","_jsx","_jsxs"],"mappings":";;;;;;;;AAAA;;AAEG;AAOH,MAAMA,YAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AACjD,MAAMC,WAAS,GAAG,OAAO,CAACD,YAAU,CAAC;AAErC;;;AAGG;AACH,SAAS,eAAe,GAAA;;AAEtB,IAAA,MAAM,aAAa,GAAG;;QAEpB,IAAI,CAACC,WAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;;QAEjC,IAAI,CAACA,WAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KAClC;AAED,IAAA,KAAK,MAAM,IAA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A,EAAA,EAF/C,KAAK,CAGT,CACP,CAAC,EAAA,CACE;AAEV;;;;"}
@@ -0,0 +1,32 @@
1
+ // OpenBuilder CLI - Built with Rollup
2
+ function getDefaultExportFromCjs (x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
4
+ }
5
+
6
+ function getAugmentedNamespace(n) {
7
+ if (n.__esModule) return n;
8
+ var f = n.default;
9
+ if (typeof f == "function") {
10
+ var a = function a () {
11
+ if (this instanceof a) {
12
+ return Reflect.construct(f, arguments, this.constructor);
13
+ }
14
+ return f.apply(this, arguments);
15
+ };
16
+ a.prototype = f.prototype;
17
+ } else a = {};
18
+ Object.defineProperty(a, '__esModule', {value: true});
19
+ Object.keys(n).forEach(function (k) {
20
+ var d = Object.getOwnPropertyDescriptor(n, k);
21
+ Object.defineProperty(a, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () {
24
+ return n[k];
25
+ }
26
+ });
27
+ });
28
+ return a;
29
+ }
30
+
31
+ export { getDefaultExportFromCjs as a, getAugmentedNamespace as g };
32
+ //# sourceMappingURL=_commonjsHelpers-DcsQGttR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-DcsQGttR.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -66,6 +66,8 @@ function getDeviceName() {
66
66
  */
67
67
  function startCallbackServer(port) {
68
68
  return new Promise((resolve) => {
69
+ // Track active connections so we can forcefully close them
70
+ const connections = new Set();
69
71
  const server = http__default.createServer((req, res) => {
70
72
  const url = new URL(req.url || '/', `http://localhost:${port}`);
71
73
  if (url.pathname === '/callback') {
@@ -113,8 +115,9 @@ function startCallbackServer(port) {
113
115
  </body>
114
116
  </html>
115
117
  `);
116
- // Close server and resolve
118
+ // Close server and resolve - destroy all connections to ensure clean exit
117
119
  server.close();
120
+ connections.forEach(conn => conn.destroy());
118
121
  resolve({ success: true, token });
119
122
  }
120
123
  else {
@@ -158,6 +161,7 @@ function startCallbackServer(port) {
158
161
  </html>
159
162
  `);
160
163
  server.close();
164
+ connections.forEach(conn => conn.destroy());
161
165
  resolve({ success: false, error: error || 'Authentication failed' });
162
166
  }
163
167
  }
@@ -170,6 +174,7 @@ function startCallbackServer(port) {
170
174
  // Timeout after 5 minutes
171
175
  const timeout = setTimeout(() => {
172
176
  server.close();
177
+ connections.forEach(conn => conn.destroy());
173
178
  resolve({ success: false, error: 'Authentication timed out' });
174
179
  }, 5 * 60 * 1000);
175
180
  server.on('close', () => {
@@ -185,6 +190,11 @@ function startCallbackServer(port) {
185
190
  resolve({ success: false, error: `Server error: ${err.message}` });
186
191
  }
187
192
  });
193
+ // Track connections for cleanup
194
+ server.on('connection', (conn) => {
195
+ connections.add(conn);
196
+ conn.on('close', () => connections.delete(conn));
197
+ });
188
198
  server.listen(port, '127.0.0.1');
189
199
  });
190
200
  }
@@ -327,4 +337,4 @@ function clearToken() {
327
337
  }
328
338
 
329
339
  export { clearToken as c, getStoredToken as g, hasStoredToken as h, performOAuthLogin as p, storeToken as s };
330
- //# sourceMappingURL=cli-auth-CHooQYR9.js.map
340
+ //# sourceMappingURL=cli-auth-rqwB_Zwt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-auth-rqwB_Zwt.js","sources":["../../src/cli/utils/cli-auth.ts"],"sourcesContent":["import http from 'node:http';\nimport { URL } from 'node:url';\nimport { hostname, platform } from 'node:os';\nimport { exec } from 'node:child_process';\nimport chalk from 'chalk';\nimport { configManager } from './config-manager.js';\n\n/**\n * Open a URL in the default browser (cross-platform)\n */\nasync function openBrowser(url: string): Promise<void> {\n const os = platform();\n \n return new Promise((resolve, reject) => {\n let command: string;\n \n switch (os) {\n case 'darwin':\n command = `open \"${url}\"`;\n break;\n case 'win32':\n command = `start \"\" \"${url}\"`;\n break;\n default: // Linux and others\n command = `xdg-open \"${url}\"`;\n }\n \n exec(command, (error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n}\n\ninterface AuthResult {\n success: boolean;\n token?: string;\n error?: string;\n}\n\ninterface CLIAuthOptions {\n apiUrl?: string;\n deviceName?: string;\n silent?: boolean;\n}\n\n/**\n * Find an available port for the callback server\n */\nasync function findAvailablePort(startPort: number = 9876, endPort: number = 9999): Promise<number> {\n for (let port = startPort; port <= endPort; port++) {\n const isAvailable = await new Promise<boolean>((resolve) => {\n const server = http.createServer();\n server.once('error', () => resolve(false));\n server.once('listening', () => {\n server.close();\n resolve(true);\n });\n server.listen(port, '127.0.0.1');\n });\n \n if (isAvailable) {\n return port;\n }\n }\n \n throw new Error('No available ports found for OAuth callback server');\n}\n\n/**\n * Get a device name for the runner key\n */\nfunction getDeviceName(): string {\n const host = hostname();\n const date = new Date().toLocaleDateString();\n return `CLI - ${host} - ${date}`;\n}\n\n/**\n * Start a local HTTP server to receive the OAuth callback\n */\nfunction startCallbackServer(port: number): Promise<AuthResult> {\n return new Promise((resolve) => {\n // Track active connections so we can forcefully close them\n const connections = new Set<import('net').Socket>();\n \n const server = http.createServer((req, res) => {\n const url = new URL(req.url || '/', `http://localhost:${port}`);\n \n if (url.pathname === '/callback') {\n const token = url.searchParams.get('token');\n const status = url.searchParams.get('status');\n const error = url.searchParams.get('error');\n \n // Send response to browser\n res.writeHead(200, { 'Content-Type': 'text/html' });\n \n if (status === 'success' && token) {\n res.end(`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Authentication Successful</title>\n <style>\n body {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n margin: 0;\n background: #09090b;\n color: white;\n }\n .container {\n text-align: center;\n padding: 40px;\n }\n .success {\n color: #22c55e;\n font-size: 48px;\n margin-bottom: 20px;\n }\n h1 { margin: 0 0 10px; }\n p { color: #a1a1aa; }\n </style>\n </head>\n <body>\n <div class=\"container\">\n <div class=\"success\">&#10003;</div>\n <h1>Authentication Successful!</h1>\n <p>You can close this window and return to your terminal.</p>\n </div>\n </body>\n </html>\n `);\n \n // Close server and resolve - destroy all connections to ensure clean exit\n server.close();\n connections.forEach(conn => conn.destroy());\n resolve({ success: true, token });\n } else {\n res.end(`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Authentication Failed</title>\n <style>\n body {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n margin: 0;\n background: #09090b;\n color: white;\n }\n .container {\n text-align: center;\n padding: 40px;\n }\n .error {\n color: #ef4444;\n font-size: 48px;\n margin-bottom: 20px;\n }\n h1 { margin: 0 0 10px; }\n p { color: #a1a1aa; }\n </style>\n </head>\n <body>\n <div class=\"container\">\n <div class=\"error\">&#10007;</div>\n <h1>Authentication Failed</h1>\n <p>${error || 'An error occurred during authentication.'}</p>\n <p>Please close this window and try again.</p>\n </div>\n </body>\n </html>\n `);\n \n server.close();\n connections.forEach(conn => conn.destroy());\n resolve({ success: false, error: error || 'Authentication failed' });\n }\n } else {\n // Handle other paths\n res.writeHead(404, { 'Content-Type': 'text/plain' });\n res.end('Not found');\n }\n });\n \n // Timeout after 5 minutes\n const timeout = setTimeout(() => {\n server.close();\n connections.forEach(conn => conn.destroy());\n resolve({ success: false, error: 'Authentication timed out' });\n }, 5 * 60 * 1000);\n \n server.on('close', () => {\n clearTimeout(timeout);\n });\n \n // Handle server errors (e.g., port became unavailable due to race condition)\n server.on('error', (err: NodeJS.ErrnoException) => {\n clearTimeout(timeout);\n if (err.code === 'EADDRINUSE') {\n resolve({ success: false, error: `Port ${port} is no longer available. Please try again.` });\n } else {\n resolve({ success: false, error: `Server error: ${err.message}` });\n }\n });\n \n // Track connections for cleanup\n server.on('connection', (conn) => {\n connections.add(conn);\n conn.on('close', () => connections.delete(conn));\n });\n \n server.listen(port, '127.0.0.1');\n });\n}\n\n/**\n * Perform CLI OAuth authentication flow\n * \n * 1. Find an available port\n * 2. Start local callback server\n * 3. Request auth session from API\n * 4. Open browser to auth page\n * 5. Wait for callback\n * 6. Return token\n */\nexport async function performOAuthLogin(options: CLIAuthOptions = {}): Promise<AuthResult> {\n const apiUrl = options.apiUrl || 'https://openbuilder.sh';\n const deviceName = options.deviceName || getDeviceName();\n const silent = options.silent || false;\n \n try {\n // Find available port\n if (!silent) {\n console.log(chalk.dim('Finding available port for callback...'));\n }\n const port = await findAvailablePort();\n \n // Start callback server before requesting auth (so it's ready when browser redirects)\n const callbackPromise = startCallbackServer(port);\n \n // Request auth session from API\n if (!silent) {\n console.log(chalk.dim('Initiating authentication...'));\n }\n \n const response = await fetch(`${apiUrl}/api/auth/cli/start`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n callbackPort: port,\n callbackHost: 'localhost',\n deviceName,\n }),\n });\n \n if (!response.ok) {\n const data = await response.json();\n return { success: false, error: data.error || 'Failed to start authentication' };\n }\n \n const { authUrl } = await response.json();\n \n // Open browser\n if (!silent) {\n console.log('');\n console.log(chalk.cyan('Opening browser for authentication...'));\n console.log(chalk.dim(`If the browser doesn't open, visit:`));\n console.log(chalk.underline(authUrl));\n console.log('');\n }\n \n try {\n await openBrowser(authUrl);\n } catch {\n // Browser failed to open - user will need to copy/paste URL\n if (!silent) {\n console.log(chalk.yellow('Could not open browser automatically.'));\n }\n }\n \n if (!silent) {\n console.log(chalk.yellow('Waiting for authentication...'));\n console.log(chalk.dim('(Press Ctrl+C to cancel)'));\n }\n \n // Wait for callback\n const result = await callbackPromise;\n \n return result;\n } catch (error) {\n return {\n success: false,\n error: error instanceof Error ? error.message : 'Authentication failed',\n };\n }\n}\n\n/**\n * Check if we have a valid stored token\n */\nexport function hasStoredToken(): boolean {\n const token = getStoredToken();\n return token !== null && token.startsWith('sv_');\n}\n\n/**\n * Get the stored runner token\n */\nexport function getStoredToken(): string | null {\n const config = configManager.get();\n \n // Check for runner token in config\n if (config.server?.secret && config.server.secret.startsWith('sv_')) {\n return config.server.secret;\n }\n \n // Legacy: check broker config\n if (config.broker?.secret && config.broker.secret.startsWith('sv_')) {\n return config.broker.secret;\n }\n \n return null;\n}\n\n/**\n * Store the runner token in config\n */\nexport function storeToken(token: string, apiUrl?: string): void {\n // Determine the WebSocket URL from the API URL\n let wsUrl = 'wss://openbuilder.sh/ws/runner';\n if (apiUrl) {\n const url = new URL(apiUrl);\n const protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';\n wsUrl = `${protocol}//${url.host}/ws/runner`;\n }\n \n // Store in the server config\n configManager.set('server', {\n wsUrl,\n secret: token,\n });\n \n // Also set the apiUrl if provided\n if (apiUrl) {\n configManager.set('apiUrl', apiUrl);\n }\n}\n\n/**\n * Clear the stored token\n */\nexport function clearToken(): void {\n const config = configManager.get();\n \n // Clear server secret\n if (config.server) {\n configManager.set('server', {\n ...config.server,\n secret: '',\n });\n }\n \n // Clear legacy broker secret\n if (config.broker) {\n configManager.set('broker', {\n ...config.broker,\n secret: '',\n });\n }\n}\n\n/**\n * Validate the stored token against the server\n */\nexport async function validateToken(token: string, apiUrl: string): Promise<boolean> {\n try {\n // Try to fetch user's runner keys - this will fail if token is invalid\n const response = await fetch(`${apiUrl}/api/runner-keys`, {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n });\n \n return response.ok;\n } catch {\n return false;\n }\n}\n"],"names":["http"],"mappings":";;;;;;;;AAOA;;AAEG;AACH,eAAe,WAAW,CAAC,GAAW,EAAA;AACpC,IAAA,MAAM,EAAE,GAAG,QAAQ,EAAE;IAErB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,QAAA,IAAI,OAAe;QAEnB,QAAQ,EAAE;AACR,YAAA,KAAK,QAAQ;AACX,gBAAA,OAAO,GAAG,CAAA,MAAA,EAAS,GAAG,CAAA,CAAA,CAAG;gBACzB;AACF,YAAA,KAAK,OAAO;AACV,gBAAA,OAAO,GAAG,CAAA,UAAA,EAAa,GAAG,CAAA,CAAA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;AAEG;SACa,UAAU,GAAA;AACxB,IAAA,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,EAAE;;AAGlC,IAAA,IAAI,MAAM,CAAC,MAAM,EAAE;AACjB,QAAA,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC1B,GAAG,MAAM,CAAC,MAAM;AAChB,YAAA,MAAM,EAAE,EAAE;AACX,SAAA,CAAC;IACJ;;AAGA,IAAA,IAAI,MAAM,CAAC,MAAM,EAAE;AACjB,QAAA,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC1B,GAAG,MAAM,CAAC,MAAM;AAChB,YAAA,MAAM,EAAE,EAAE;AACX,SAAA,CAAC;IACJ;AACF;;;;"}
@@ -3,11 +3,9 @@ import { mkdir, writeFile } from 'node:fs/promises';
3
3
  import { existsSync, rmSync, realpathSync } from 'node:fs';
4
4
  import { join, resolve } from 'node:path';
5
5
  import { randomBytes } from 'node:crypto';
6
- import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
7
- import { Fragment, useState, useRef, useEffect, useCallback } from 'react';
6
+ import { j as jsxRuntimeExports, r as reactExports, s as symbols, c as colors, l as layout } from './theme-BF4W2Gwm.js';
8
7
  import { Box, Text, useApp, useStdout, useInput, render } from 'ink';
9
- import { g as getVersionInfo, B as Banner } from './Banner-D4tqKfzA.js';
10
- import { s as symbols, c as colors, l as layout } from './theme-DhorI2Hb.js';
8
+ import { g as getVersionInfo, B as Banner } from './Banner-ClJs6QcI.js';
11
9
  import 'ink-text-input';
12
10
  import 'node:events';
13
11
  import 'chalk';
@@ -16,6 +14,7 @@ import { i as isInsideMonorepo } from './repo-detector-B_oj696o.js';
16
14
  import { isPnpmInstalled, cloneRepository, installDependencies, buildAgentCore } from './repo-cloner-CpOQjFSo.js';
17
15
  import { p as pushDatabaseSchema, s as setupDatabase } from './database-setup-BYjIRAmT.js';
18
16
  import { C as CLIError } from './cli-error-BjQwvWtK.js';
17
+ import './_commonjsHelpers-DcsQGttR.js';
19
18
  import 'node:child_process';
20
19
  import 'node:url';
21
20
  import 'conf';
@@ -59,7 +58,7 @@ function ProgressStepper({ steps }) {
59
58
  // Cell and connector sizing
60
59
  const cellWidth = 10;
61
60
  const connectorWidth = 7;
62
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsx(Box, { children: steps.map((step, index) => (jsxs(Fragment, { children: [jsx(Box, { width: cellWidth, justifyContent: "center", children: jsx(Text, { color: getStepColor(step.status), children: getStepSymbol(step.status) }) }), index < steps.length - 1 && (jsx(Text, { color: colors.dimGray, children: symbols.horizontalLine.repeat(connectorWidth) }))] }, step.id))) }), jsx(Box, { children: steps.map((step, index) => (jsxs(Fragment, { children: [jsx(Box, { width: cellWidth, justifyContent: "center", children: jsx(Text, { color: step.status === 'pending' ? colors.dimGray : colors.gray, dimColor: step.status === 'pending', children: step.label }) }), index < steps.length - 1 && (jsx(Box, { width: connectorWidth }))] }, step.id))) })] }));
61
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsxRuntimeExports.jsx(Box, { children: steps.map((step, index) => (jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [jsxRuntimeExports.jsx(Box, { width: cellWidth, justifyContent: "center", children: jsxRuntimeExports.jsx(Text, { color: getStepColor(step.status), children: getStepSymbol(step.status) }) }), index < steps.length - 1 && (jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: symbols.horizontalLine.repeat(connectorWidth) }))] }, step.id))) }), jsxRuntimeExports.jsx(Box, { children: steps.map((step, index) => (jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [jsxRuntimeExports.jsx(Box, { width: cellWidth, justifyContent: "center", children: jsxRuntimeExports.jsx(Text, { color: step.status === 'pending' ? colors.dimGray : colors.gray, dimColor: step.status === 'pending', children: step.label }) }), index < steps.length - 1 && (jsxRuntimeExports.jsx(Box, { width: connectorWidth }))] }, step.id))) })] }));
63
62
  }
64
63
 
65
64
  // Match the stepper width: cellWidth(10) * 4 + connectorWidth(7) * 3 = 61
@@ -74,13 +73,13 @@ const BOX_INNER_WIDTH = BOX_WIDTH - 4; // Account for "│ " and " │"
74
73
  * └───────────────────────────────────────────────────────────┘
75
74
  */
76
75
  function TaskStream({ stepId, tasks, onTypewriterComplete }) {
77
- const [spinnerIndex, setSpinnerIndex] = useState(0);
78
- const [cursorVisible, setCursorVisible] = useState(true);
79
- const [typedChars, setTypedChars] = useState({});
80
- const [completedTyping, setCompletedTyping] = useState(new Set());
81
- const prevStepRef = useRef(stepId);
76
+ const [spinnerIndex, setSpinnerIndex] = reactExports.useState(0);
77
+ const [cursorVisible, setCursorVisible] = reactExports.useState(true);
78
+ const [typedChars, setTypedChars] = reactExports.useState({});
79
+ const [completedTyping, setCompletedTyping] = reactExports.useState(new Set());
80
+ const prevStepRef = reactExports.useRef(stepId);
82
81
  // Reset typed chars when step changes
83
- useEffect(() => {
82
+ reactExports.useEffect(() => {
84
83
  if (stepId !== prevStepRef.current) {
85
84
  setTypedChars({});
86
85
  setCompletedTyping(new Set());
@@ -88,7 +87,7 @@ function TaskStream({ stepId, tasks, onTypewriterComplete }) {
88
87
  }
89
88
  }, [stepId]);
90
89
  // Spinner animation - runs independently
91
- useEffect(() => {
90
+ reactExports.useEffect(() => {
92
91
  let mounted = true;
93
92
  const animate = () => {
94
93
  if (!mounted)
@@ -103,7 +102,7 @@ function TaskStream({ stepId, tasks, onTypewriterComplete }) {
103
102
  };
104
103
  }, []);
105
104
  // Cursor blink - runs independently
106
- useEffect(() => {
105
+ reactExports.useEffect(() => {
107
106
  let mounted = true;
108
107
  const blink = () => {
109
108
  if (!mounted)
@@ -209,7 +208,7 @@ function TaskStream({ stepId, tasks, onTypewriterComplete }) {
209
208
  const errorToType = primaryTask?.error && primaryTask.status === 'failed' ? primaryTask.error : null;
210
209
  const textToType = errorToType;
211
210
  const typeId = errorToType ? `error-${primaryTask?.id}` : null;
212
- useEffect(() => {
211
+ reactExports.useEffect(() => {
213
212
  if (!typeId || !textToType)
214
213
  return;
215
214
  const currentChars = typedChars[typeId] || 0;
@@ -233,15 +232,15 @@ function TaskStream({ stepId, tasks, onTypewriterComplete }) {
233
232
  }, [typeId, textToType, typedChars[typeId || ''], completedTyping, onTypewriterComplete, primaryTask]);
234
233
  // Empty state - show empty box to maintain layout
235
234
  if (lines.length === 0) {
236
- return (jsx(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: jsxs(Box, { flexDirection: "column", width: BOX_WIDTH, children: [jsxs(Text, { color: colors.dimGray, children: ["\u250C", '─'.repeat(BOX_WIDTH - 2), "\u2510"] }), jsxs(Box, { children: [jsx(Text, { color: colors.dimGray, children: "\u2502" }), jsx(Text, { children: ' '.repeat(BOX_WIDTH - 2) }), jsx(Text, { color: colors.dimGray, children: "\u2502" })] }), jsxs(Text, { color: colors.dimGray, children: ["\u2514", '─'.repeat(BOX_WIDTH - 2), "\u2518"] })] }) }));
235
+ return (jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: jsxRuntimeExports.jsxs(Box, { flexDirection: "column", width: BOX_WIDTH, children: [jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["\u250C", '─'.repeat(BOX_WIDTH - 2), "\u2510"] }), jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "\u2502" }), jsxRuntimeExports.jsx(Text, { children: ' '.repeat(BOX_WIDTH - 2) }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "\u2502" })] }), jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["\u2514", '─'.repeat(BOX_WIDTH - 2), "\u2518"] })] }) }));
237
236
  }
238
- return (jsx(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: jsxs(Box, { flexDirection: "column", width: BOX_WIDTH, children: [jsxs(Text, { color: colors.dimGray, children: ["\u250C", '─'.repeat(BOX_WIDTH - 2), "\u2510"] }), lines.map(line => {
237
+ return (jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: jsxRuntimeExports.jsxs(Box, { flexDirection: "column", width: BOX_WIDTH, children: [jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["\u250C", '─'.repeat(BOX_WIDTH - 2), "\u2510"] }), lines.map(line => {
239
238
  const checkmarkStr = line.checkmark ? `${symbols.check} ` : '';
240
239
  const content = `${line.prefix}${checkmarkStr}${line.displayedText}`;
241
240
  const cursor = line.showCursor ? '▌' : '';
242
241
  const paddingNeeded = Math.max(0, BOX_INNER_WIDTH - content.length - cursor.length);
243
- return (jsxs(Box, { children: [jsx(Text, { color: colors.dimGray, children: "\u2502 " }), jsx(Text, { color: line.prefixColor, children: line.prefix }), line.checkmark && jsxs(Text, { color: colors.success, children: [symbols.check, " "] }), jsx(Text, { color: line.color, children: line.displayedText }), line.showCursor && jsx(Text, { color: colors.cyan, children: "\u258C" }), jsx(Text, { children: ' '.repeat(paddingNeeded) }), jsx(Text, { color: colors.dimGray, children: " \u2502" })] }, line.id));
244
- }), jsxs(Text, { color: colors.dimGray, children: ["\u2514", '─'.repeat(BOX_WIDTH - 2), "\u2518"] })] }) }));
242
+ return (jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "\u2502 " }), jsxRuntimeExports.jsx(Text, { color: line.prefixColor, children: line.prefix }), line.checkmark && jsxRuntimeExports.jsxs(Text, { color: colors.success, children: [symbols.check, " "] }), jsxRuntimeExports.jsx(Text, { color: line.color, children: line.displayedText }), line.showCursor && jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: "\u258C" }), jsxRuntimeExports.jsx(Text, { children: ' '.repeat(paddingNeeded) }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: " \u2502" })] }, line.id));
243
+ }), jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["\u2514", '─'.repeat(BOX_WIDTH - 2), "\u2518"] })] }) }));
245
244
  }
246
245
 
247
246
  /**
@@ -257,13 +256,13 @@ function ConfigSummary({ items, title }) {
257
256
  const divider = symbols.horizontalLine.repeat(dividerWidth);
258
257
  // Find the longest label for alignment
259
258
  const maxLabelLength = Math.max(...items.map(item => item.label.length));
260
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsx(Text, { color: colors.dimGray, children: divider }), title && (jsx(Box, { marginTop: 1, marginBottom: 1, children: jsx(Text, { color: colors.white, bold: true, children: title }) })), jsx(Box, { flexDirection: "column", alignItems: "flex-start", marginTop: title ? 0 : 1, children: items.map((item, index) => (jsxs(Box, { children: [jsx(Text, { color: colors.gray, children: item.label.padEnd(maxLabelLength + 3) }), jsx(Text, { color: colors.cyan, children: item.value })] }, index))) }), jsx(Box, { marginTop: 1, children: jsx(Text, { color: colors.dimGray, children: divider }) })] }));
259
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }), title && (jsxRuntimeExports.jsx(Box, { marginTop: 1, marginBottom: 1, children: jsxRuntimeExports.jsx(Text, { color: colors.white, bold: true, children: title }) })), jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "flex-start", marginTop: title ? 0 : 1, children: items.map((item, index) => (jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.gray, children: item.label.padEnd(maxLabelLength + 3) }), jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: item.value })] }, index))) }), jsxRuntimeExports.jsx(Box, { marginTop: 1, children: jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }) })] }));
261
260
  }
262
261
  /**
263
262
  * Next steps display for completion screen
264
263
  */
265
264
  function NextSteps({ command, url }) {
266
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: [jsxs(Box, { children: [jsx(Text, { color: colors.gray, children: "Run: " }), jsx(Text, { color: colors.cyan, bold: true, children: command })] }), jsxs(Box, { children: [jsx(Text, { color: colors.gray, children: "Open: " }), jsx(Text, { color: colors.cyan, children: url })] })] }));
265
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", marginTop: 1, children: [jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.gray, children: "Run: " }), jsxRuntimeExports.jsx(Text, { color: colors.cyan, bold: true, children: command })] }), jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.gray, children: "Open: " }), jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: url })] })] }));
267
266
  }
268
267
  /**
269
268
  * Error display with message and recovery suggestions
@@ -271,7 +270,7 @@ function NextSteps({ command, url }) {
271
270
  function ErrorSummary({ message, suggestions }) {
272
271
  const dividerWidth = 44;
273
272
  const divider = symbols.horizontalLine.repeat(dividerWidth);
274
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsx(Text, { color: colors.dimGray, children: divider }), message && (jsx(Box, { marginTop: 1, marginBottom: 1, children: jsxs(Text, { color: colors.error, bold: true, children: [symbols.cross, " ", message] }) })), jsx(Box, { flexDirection: "column", alignItems: "flex-start", marginTop: message ? 0 : 1, children: suggestions.map((suggestion, index) => (jsx(Box, { children: jsx(Text, { color: suggestion.startsWith(' ') ? colors.cyan : colors.gray, children: suggestion }) }, index))) }), jsx(Box, { marginTop: 1, children: jsx(Text, { color: colors.dimGray, children: divider }) })] }));
273
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }), message && (jsxRuntimeExports.jsx(Box, { marginTop: 1, marginBottom: 1, children: jsxRuntimeExports.jsxs(Text, { color: colors.error, bold: true, children: [symbols.cross, " ", message] }) })), jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "flex-start", marginTop: message ? 0 : 1, children: suggestions.map((suggestion, index) => (jsxRuntimeExports.jsx(Box, { children: jsxRuntimeExports.jsx(Text, { color: suggestion.startsWith(' ') ? colors.cyan : colors.gray, children: suggestion }) }, index))) }), jsxRuntimeExports.jsx(Box, { marginTop: 1, children: jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }) })] }));
275
274
  }
276
275
 
277
276
  /**
@@ -282,8 +281,8 @@ function BuildErrorView({ title, errorLines, suggestions = [], onExit }) {
282
281
  const { exit } = useApp();
283
282
  const { stdout } = useStdout();
284
283
  const terminalWidth = stdout?.columns || 80;
285
- const [scrollOffset, setScrollOffset] = useState(0);
286
- const [showCopiedMessage, setShowCopiedMessage] = useState(false);
284
+ const [scrollOffset, setScrollOffset] = reactExports.useState(0);
285
+ const [showCopiedMessage, setShowCopiedMessage] = reactExports.useState(false);
287
286
  // Fixed dimensions for compact view
288
287
  const boxWidth = Math.min(70, Math.floor(terminalWidth * 0.6));
289
288
  const maxVisibleLines = 12; // Show 12 lines of errors max
@@ -292,7 +291,7 @@ function BuildErrorView({ title, errorLines, suggestions = [], onExit }) {
292
291
  // Get visible lines
293
292
  const visibleLines = errorLines.slice(scrollOffset, scrollOffset + maxVisibleLines);
294
293
  // Copy all error content to clipboard
295
- const copyToClipboard = useCallback(async () => {
294
+ const copyToClipboard = reactExports.useCallback(async () => {
296
295
  const content = [
297
296
  `Build Error: ${title}`,
298
297
  '─'.repeat(60),
@@ -376,12 +375,12 @@ function BuildErrorView({ title, errorLines, suggestions = [], onExit }) {
376
375
  };
377
376
  const divider = symbols.horizontalLine.repeat(boxWidth - 2);
378
377
  const hasScroll = errorLines.length > maxVisibleLines;
379
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", width: "100%", children: [jsx(Text, { color: colors.dimGray, children: divider }), jsx(Box, { marginTop: 1, marginBottom: 1, width: boxWidth, justifyContent: "center", children: jsxs(Text, { color: colors.error, bold: true, children: [symbols.cross, " ", title] }) }), jsxs(Box, { flexDirection: "column", width: boxWidth, borderStyle: "round", borderColor: colors.error, paddingX: 1, paddingY: 0, children: [hasScroll && (jsx(Box, { justifyContent: "flex-end", marginBottom: 0, children: jsxs(Text, { color: colors.dimGray, dimColor: true, children: ["[", scrollOffset + 1, "-", Math.min(scrollOffset + maxVisibleLines, errorLines.length), "/", errorLines.length, "] \u2191\u2193"] }) })), visibleLines.length > 0 ? (visibleLines.map((line, index) => {
378
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", width: "100%", children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }), jsxRuntimeExports.jsx(Box, { marginTop: 1, marginBottom: 1, width: boxWidth, justifyContent: "center", children: jsxRuntimeExports.jsxs(Text, { color: colors.error, bold: true, children: [symbols.cross, " ", title] }) }), jsxRuntimeExports.jsxs(Box, { flexDirection: "column", width: boxWidth, borderStyle: "round", borderColor: colors.error, paddingX: 1, paddingY: 0, children: [hasScroll && (jsxRuntimeExports.jsx(Box, { justifyContent: "flex-end", marginBottom: 0, children: jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, dimColor: true, children: ["[", scrollOffset + 1, "-", Math.min(scrollOffset + maxVisibleLines, errorLines.length), "/", errorLines.length, "] \u2191\u2193"] }) })), visibleLines.length > 0 ? (visibleLines.map((line, index) => {
380
379
  const truncatedLine = line.length > boxWidth - 4
381
380
  ? line.substring(0, boxWidth - 7) + '...'
382
381
  : line;
383
- return (jsx(Text, { color: getLineColor(line), wrap: "truncate", children: truncatedLine }, index));
384
- })) : (jsx(Text, { color: colors.dimGray, children: "No error details captured" }))] }), suggestions.length > 0 && (jsx(Box, { flexDirection: "column", marginTop: 1, width: boxWidth, children: suggestions.map((suggestion, index) => (jsx(Text, { color: suggestion.startsWith(' ') ? colors.cyan : colors.gray, children: suggestion }, index))) })), jsx(Box, { marginTop: 1, children: jsx(Text, { color: colors.dimGray, children: divider }) }), jsx(Box, { marginTop: 1, justifyContent: "center", children: showCopiedMessage ? (jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " Copied to clipboard! Exiting..."] })) : (jsxs(Box, { children: [jsx(Text, { color: colors.dimGray, children: "[" }), jsx(Text, { color: colors.success, bold: true, children: "c" }), jsx(Text, { color: colors.dimGray, children: "]" }), jsx(Text, { color: colors.success, children: "copy & exit" }), jsx(Text, { children: " " }), jsx(Text, { color: colors.dimGray, children: "[" }), jsx(Text, { color: colors.cyan, children: "q" }), jsx(Text, { color: colors.dimGray, children: "]" }), jsx(Text, { color: colors.gray, children: "quit" }), hasScroll && (jsxs(Fragment$1, { children: [jsx(Text, { children: " " }), jsx(Text, { color: colors.dimGray, children: "[" }), jsx(Text, { color: colors.cyan, children: "\u2191\u2193" }), jsx(Text, { color: colors.dimGray, children: "]" }), jsx(Text, { color: colors.gray, children: "scroll" })] }))] })) })] }));
382
+ return (jsxRuntimeExports.jsx(Text, { color: getLineColor(line), wrap: "truncate", children: truncatedLine }, index));
383
+ })) : (jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "No error details captured" }))] }), suggestions.length > 0 && (jsxRuntimeExports.jsx(Box, { flexDirection: "column", marginTop: 1, width: boxWidth, children: suggestions.map((suggestion, index) => (jsxRuntimeExports.jsx(Text, { color: suggestion.startsWith(' ') ? colors.cyan : colors.gray, children: suggestion }, index))) })), jsxRuntimeExports.jsx(Box, { marginTop: 1, children: jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: divider }) }), jsxRuntimeExports.jsx(Box, { marginTop: 1, justifyContent: "center", children: showCopiedMessage ? (jsxRuntimeExports.jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " Copied to clipboard! Exiting..."] })) : (jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "[" }), jsxRuntimeExports.jsx(Text, { color: colors.success, bold: true, children: "c" }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "]" }), jsxRuntimeExports.jsx(Text, { color: colors.success, children: "copy & exit" }), jsxRuntimeExports.jsx(Text, { children: " " }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "[" }), jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: "q" }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "]" }), jsxRuntimeExports.jsx(Text, { color: colors.gray, children: "quit" }), hasScroll && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Text, { children: " " }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "[" }), jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: "\u2191\u2193" }), jsxRuntimeExports.jsx(Text, { color: colors.dimGray, children: "]" }), jsxRuntimeExports.jsx(Text, { color: colors.gray, children: "scroll" })] }))] })) })] }));
385
384
  }
386
385
 
387
386
  const INITIAL_STEPS = [
@@ -400,7 +399,7 @@ const INITIAL_TASKS = [
400
399
  { id: 'services', label: 'Building services', status: 'pending', stepId: 'ready' },
401
400
  ];
402
401
  function useInitFlow() {
403
- const [state, setState] = useState({
402
+ const [state, setState] = reactExports.useState({
404
403
  phase: 'repo',
405
404
  steps: INITIAL_STEPS,
406
405
  tasks: INITIAL_TASKS,
@@ -409,67 +408,67 @@ function useInitFlow() {
409
408
  isComplete: false,
410
409
  });
411
410
  // Step management
412
- const setStepStatus = useCallback((stepId, status) => {
411
+ const setStepStatus = reactExports.useCallback((stepId, status) => {
413
412
  setState(prev => ({
414
413
  ...prev,
415
414
  steps: prev.steps.map(step => step.id === stepId ? { ...step, status } : step),
416
415
  }));
417
416
  }, []);
418
- const activateStep = useCallback((stepId) => {
417
+ const activateStep = reactExports.useCallback((stepId) => {
419
418
  setState(prev => ({
420
419
  ...prev,
421
420
  phase: stepId,
422
421
  steps: prev.steps.map(step => step.id === stepId ? { ...step, status: 'active' } : step),
423
422
  }));
424
423
  }, []);
425
- const completeStep = useCallback((stepId) => {
424
+ const completeStep = reactExports.useCallback((stepId) => {
426
425
  setStepStatus(stepId, 'completed');
427
426
  }, [setStepStatus]);
428
- const failStep = useCallback((stepId) => {
427
+ const failStep = reactExports.useCallback((stepId) => {
429
428
  setStepStatus(stepId, 'error');
430
429
  }, [setStepStatus]);
431
430
  // Task management
432
- const setTaskStatus = useCallback((taskId, status, detail) => {
431
+ const setTaskStatus = reactExports.useCallback((taskId, status, detail) => {
433
432
  setState(prev => ({
434
433
  ...prev,
435
434
  tasks: prev.tasks.map(task => task.id === taskId ? { ...task, status, detail: detail ?? task.detail } : task),
436
435
  }));
437
436
  }, []);
438
- const startTask = useCallback((taskId, detail) => {
437
+ const startTask = reactExports.useCallback((taskId, detail) => {
439
438
  setTaskStatus(taskId, 'running', detail);
440
439
  }, [setTaskStatus]);
441
- const completeTask = useCallback((taskId) => {
440
+ const completeTask = reactExports.useCallback((taskId) => {
442
441
  setTaskStatus(taskId, 'completed');
443
442
  }, [setTaskStatus]);
444
- const failTask = useCallback((taskId, error) => {
443
+ const failTask = reactExports.useCallback((taskId, error) => {
445
444
  setState(prev => ({
446
445
  ...prev,
447
446
  tasks: prev.tasks.map(task => task.id === taskId ? { ...task, status: 'failed', error } : task),
448
447
  }));
449
448
  }, []);
450
449
  // Get tasks for a specific step
451
- const getTasksForStep = useCallback((stepId) => {
450
+ const getTasksForStep = reactExports.useCallback((stepId) => {
452
451
  return state.tasks.filter(task => task.stepId === stepId);
453
452
  }, [state.tasks]);
454
453
  // Get tasks for the currently active step
455
- const getActiveStepTasks = useCallback(() => {
454
+ const getActiveStepTasks = reactExports.useCallback(() => {
456
455
  return state.tasks.filter(task => task.stepId === state.phase);
457
456
  }, [state.tasks, state.phase]);
458
457
  // Config management
459
- const setConfig = useCallback((items) => {
458
+ const setConfig = reactExports.useCallback((items) => {
460
459
  setState(prev => ({
461
460
  ...prev,
462
461
  config: items,
463
462
  }));
464
463
  }, []);
465
464
  // Error management
466
- const setError = useCallback((message, suggestions) => {
465
+ const setError = reactExports.useCallback((message, suggestions) => {
467
466
  setState(prev => ({
468
467
  ...prev,
469
468
  error: { message, suggestions },
470
469
  }));
471
470
  }, []);
472
- const setBuildError = useCallback((message, errorLines, suggestions) => {
471
+ const setBuildError = reactExports.useCallback((message, errorLines, suggestions) => {
473
472
  setState(prev => ({
474
473
  ...prev,
475
474
  error: {
@@ -482,14 +481,14 @@ function useInitFlow() {
482
481
  },
483
482
  }));
484
483
  }, []);
485
- const clearError = useCallback(() => {
484
+ const clearError = reactExports.useCallback(() => {
486
485
  setState(prev => ({
487
486
  ...prev,
488
487
  error: null,
489
488
  }));
490
489
  }, []);
491
490
  // Completion
492
- const markComplete = useCallback(() => {
491
+ const markComplete = reactExports.useCallback(() => {
493
492
  setState(prev => ({
494
493
  ...prev,
495
494
  isComplete: true,
@@ -498,7 +497,7 @@ function useInitFlow() {
498
497
  }));
499
498
  }, []);
500
499
  // Reset
501
- const reset = useCallback(() => {
500
+ const reset = reactExports.useCallback(() => {
502
501
  setState({
503
502
  phase: 'repo',
504
503
  steps: INITIAL_STEPS,
@@ -537,7 +536,7 @@ function InitScreen({ onInit, onComplete, onError }) {
537
536
  const { exit } = useApp();
538
537
  const { stdout } = useStdout();
539
538
  const flow = useInitFlow();
540
- const [finalConfig, setFinalConfig] = useState(null);
539
+ const [finalConfig, setFinalConfig] = reactExports.useState(null);
541
540
  // Get version info
542
541
  const versionInfo = getVersionInfo();
543
542
  // Calculate vertical centering
@@ -545,7 +544,7 @@ function InitScreen({ onInit, onComplete, onError }) {
545
544
  const contentHeight = 20;
546
545
  const topPadding = Math.max(0, Math.floor((terminalHeight - contentHeight) / 3));
547
546
  // Run init flow
548
- useEffect(() => {
547
+ reactExports.useEffect(() => {
549
548
  const callbacks = {
550
549
  activateStep: flow.activateStep,
551
550
  completeStep: flow.completeStep,
@@ -595,7 +594,7 @@ function InitScreen({ onInit, onComplete, onError }) {
595
594
  detail: task.detail,
596
595
  error: task.error,
597
596
  }));
598
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", paddingTop: topPadding, children: [jsx(Banner, {}), jsx(Box, { marginTop: 1, children: jsx(Text, { color: colors.gray, dimColor: true, children: versionInfo.display }) }), jsx(Box, { marginTop: 1 }), jsx(ProgressStepper, { steps: state.steps }), !state.isComplete && !state.error && (jsx(TaskStream, { stepId: state.phase, tasks: currentStepTasks })), state.error && state.error.buildError && (jsx(BuildErrorView, { title: state.error.message, errorLines: state.error.buildError.errorLines, suggestions: state.error.buildError.suggestions, onExit: () => exit() })), state.error && !state.error.buildError && (jsx(Box, { marginTop: 2, children: jsx(ErrorSummary, { message: state.error.message, suggestions: state.error.suggestions }) })), state.isComplete && !state.error && (jsxs(Box, { marginTop: 2, flexDirection: "column", alignItems: "center", children: [jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " Setup complete!"] }), jsx(Box, { marginTop: 1, flexDirection: "column", children: state.tasks.filter(t => t.status === 'completed').map(task => (jsxs(Box, { children: [jsx(Text, { color: colors.success, children: symbols.check }), jsxs(Text, { color: colors.gray, children: [" ", task.label] })] }, task.id))) }), jsx(Box, { marginTop: 1 }), jsx(ConfigSummary, { items: state.config }), jsx(NextSteps, { command: "openbuilder run", url: "http://localhost:3000" })] }))] }));
597
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", paddingTop: topPadding, children: [jsxRuntimeExports.jsx(Banner, {}), jsxRuntimeExports.jsx(Box, { marginTop: 1, children: jsxRuntimeExports.jsx(Text, { color: colors.gray, dimColor: true, children: versionInfo.display }) }), jsxRuntimeExports.jsx(Box, { marginTop: 1 }), jsxRuntimeExports.jsx(ProgressStepper, { steps: state.steps }), !state.isComplete && !state.error && (jsxRuntimeExports.jsx(TaskStream, { stepId: state.phase, tasks: currentStepTasks })), state.error && state.error.buildError && (jsxRuntimeExports.jsx(BuildErrorView, { title: state.error.message, errorLines: state.error.buildError.errorLines, suggestions: state.error.buildError.suggestions, onExit: () => exit() })), state.error && !state.error.buildError && (jsxRuntimeExports.jsx(Box, { marginTop: 2, children: jsxRuntimeExports.jsx(ErrorSummary, { message: state.error.message, suggestions: state.error.suggestions }) })), state.isComplete && !state.error && (jsxRuntimeExports.jsxs(Box, { marginTop: 2, flexDirection: "column", alignItems: "center", children: [jsxRuntimeExports.jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " Setup complete!"] }), jsxRuntimeExports.jsx(Box, { marginTop: 1, flexDirection: "column", children: state.tasks.filter(t => t.status === 'completed').map(task => (jsxRuntimeExports.jsxs(Box, { children: [jsxRuntimeExports.jsx(Text, { color: colors.success, children: symbols.check }), jsxRuntimeExports.jsxs(Text, { color: colors.gray, children: [" ", task.label] })] }, task.id))) }), jsxRuntimeExports.jsx(Box, { marginTop: 1 }), jsxRuntimeExports.jsx(ConfigSummary, { items: state.config }), jsxRuntimeExports.jsx(NextSteps, { command: "openbuilder run", url: "http://localhost:3000" })] }))] }));
599
598
  }
600
599
 
601
600
  /**
@@ -630,15 +629,15 @@ function StartPromptScreen({ onSelect }) {
630
629
  return;
631
630
  }
632
631
  });
633
- return (jsxs(Box, { flexDirection: "column", alignItems: "center", paddingTop: topPadding, children: [jsx(Banner, {}), jsx(Box, { marginTop: 2 }), jsx(Box, { flexDirection: "column", alignItems: "center", children: jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " OpenBuilder is ready!"] }) }), jsx(Box, { marginTop: 2 }), jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsx(Text, { color: colors.white, children: "Start OpenBuilder now?" }), jsx(Box, { marginTop: 1, children: jsxs(Text, { color: colors.dimGray, children: ["Press ", jsx(Text, { color: colors.cyan, bold: true, children: "Y" }), " or ", jsx(Text, { color: colors.cyan, bold: true, children: "Enter" }), " to start, ", jsx(Text, { color: colors.cyan, bold: true, children: "N" }), " or ", jsx(Text, { color: colors.cyan, bold: true, children: "Esc" }), " to exit"] }) })] }), jsx(Box, { marginTop: 2 }), jsx(Box, { flexDirection: "column", alignItems: "center", children: jsxs(Text, { color: colors.dimGray, children: ["To start later, run: ", jsx(Text, { color: colors.cyan, children: "openbuilder run" })] }) })] }));
632
+ return (jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", paddingTop: topPadding, children: [jsxRuntimeExports.jsx(Banner, {}), jsxRuntimeExports.jsx(Box, { marginTop: 2 }), jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "center", children: jsxRuntimeExports.jsxs(Text, { color: colors.success, bold: true, children: [symbols.check, " OpenBuilder is ready!"] }) }), jsxRuntimeExports.jsx(Box, { marginTop: 2 }), jsxRuntimeExports.jsxs(Box, { flexDirection: "column", alignItems: "center", children: [jsxRuntimeExports.jsx(Text, { color: colors.white, children: "Start OpenBuilder now?" }), jsxRuntimeExports.jsx(Box, { marginTop: 1, children: jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["Press ", jsxRuntimeExports.jsx(Text, { color: colors.cyan, bold: true, children: "Y" }), " or ", jsxRuntimeExports.jsx(Text, { color: colors.cyan, bold: true, children: "Enter" }), " to start, ", jsxRuntimeExports.jsx(Text, { color: colors.cyan, bold: true, children: "N" }), " or ", jsxRuntimeExports.jsx(Text, { color: colors.cyan, bold: true, children: "Esc" }), " to exit"] }) })] }), jsxRuntimeExports.jsx(Box, { marginTop: 2 }), jsxRuntimeExports.jsx(Box, { flexDirection: "column", alignItems: "center", children: jsxRuntimeExports.jsxs(Text, { color: colors.dimGray, children: ["To start later, run: ", jsxRuntimeExports.jsx(Text, { color: colors.cyan, children: "openbuilder run" })] }) })] }));
634
633
  }
635
634
 
636
635
  /**
637
636
  * Init App component that manages the init flow screens
638
637
  */
639
638
  function InitApp({ onInit, onComplete, onError }) {
640
- const [screen, setScreen] = useState('init');
641
- const [config, setConfig] = useState(null);
639
+ const [screen, setScreen] = reactExports.useState('init');
640
+ const [config, setConfig] = reactExports.useState(null);
642
641
  const handleInitComplete = (initConfig) => {
643
642
  setConfig(initConfig);
644
643
  // Show the start prompt screen
@@ -650,9 +649,9 @@ function InitApp({ onInit, onComplete, onError }) {
650
649
  }
651
650
  };
652
651
  if (screen === 'prompt' && config) {
653
- return jsx(StartPromptScreen, { onSelect: handleStartChoice });
652
+ return jsxRuntimeExports.jsx(StartPromptScreen, { onSelect: handleStartChoice });
654
653
  }
655
- return (jsx(InitScreen, { onInit: onInit, onComplete: handleInitComplete, onError: onError }));
654
+ return (jsxRuntimeExports.jsx(InitScreen, { onInit: onInit, onComplete: handleInitComplete, onError: onError }));
656
655
  }
657
656
  /**
658
657
  * Render the TUI init screen
@@ -662,7 +661,7 @@ async function runInitTUI(options) {
662
661
  return new Promise((resolve, reject) => {
663
662
  let result = null;
664
663
  let error = null;
665
- const { unmount, waitUntilExit } = render(jsx(InitApp, { onInit: options.onInit, onComplete: (config, shouldStart) => {
664
+ const { unmount, waitUntilExit } = render(jsxRuntimeExports.jsx(InitApp, { onInit: options.onInit, onComplete: (config, shouldStart) => {
666
665
  result = { config, shouldStart };
667
666
  // Give time for final render before unmounting
668
667
  setTimeout(() => {
@@ -758,7 +757,7 @@ async function initTUICommand(options) {
758
757
  console.clear();
759
758
  console.log('\n Starting OpenBuilder...\n');
760
759
  // Import and run the start command (full TUI with web app + runner)
761
- const { startCommand } = await import('./start-BygPCbvw.js');
760
+ const { startCommand } = await import('./start-B4P27nZ7.js');
762
761
  await startCommand({});
763
762
  }
764
763
  else {
@@ -1124,4 +1123,4 @@ async function executeInitFlow(options, callbacks) {
1124
1123
  }
1125
1124
 
1126
1125
  export { initTUICommand };
1127
- //# sourceMappingURL=init-tui-BNzk_7Yx.js.map
1126
+ //# sourceMappingURL=init-tui-DDxZYe9B.js.map