@lovrabet/rabetbase-cli 2.5.2 → 2.5.3-beta.1

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 (348) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.d.ts +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +2 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-restore.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  82. package/lib/commands/db/analysis-batching.js +1 -1
  83. package/lib/commands/db/analyze-batch-plan.js +1 -1
  84. package/lib/commands/db/analyze-cancel.js +1 -1
  85. package/lib/commands/db/analyze-start.js +1 -1
  86. package/lib/commands/db/analyze-status.js +1 -1
  87. package/lib/commands/db/create.js +1 -1
  88. package/lib/commands/db/delete.js +1 -1
  89. package/lib/commands/db/detail.js +1 -1
  90. package/lib/commands/db/diff-refresh-start.js +1 -1
  91. package/lib/commands/db/diff-refresh-status.js +1 -1
  92. package/lib/commands/db/diff.js +1 -1
  93. package/lib/commands/db/index.js +1 -1
  94. package/lib/commands/db/list.js +1 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/table-diff-shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/deployment/index.js +1 -1
  101. package/lib/commands/deployment/sync-all.js +1 -1
  102. package/lib/commands/deployment/sync-jobs.js +1 -1
  103. package/lib/commands/deployment/sync-status.js +1 -1
  104. package/lib/commands/doctor.js +1 -1
  105. package/lib/commands/file/index.js +1 -1
  106. package/lib/commands/instant-api-policy/current.js +1 -1
  107. package/lib/commands/instant-api-policy/index.js +1 -1
  108. package/lib/commands/instant-api-policy/init.js +1 -1
  109. package/lib/commands/instant-api-policy/publish.js +1 -1
  110. package/lib/commands/instant-api-policy/pull.js +1 -1
  111. package/lib/commands/instant-api-policy/revision.js +1 -1
  112. package/lib/commands/instant-api-policy/revisions.js +1 -1
  113. package/lib/commands/instant-api-policy/rollback.js +1 -1
  114. package/lib/commands/instant-api-policy/shared.js +1 -1
  115. package/lib/commands/instant-api-policy/validate.js +1 -1
  116. package/lib/commands/issue/index.js +1 -1
  117. package/lib/commands/issue/nudge.js +1 -1
  118. package/lib/commands/issue/report.js +1 -1
  119. package/lib/commands/issue/shared.js +1 -1
  120. package/lib/commands/kb/create.js +1 -1
  121. package/lib/commands/kb/delete.js +1 -1
  122. package/lib/commands/kb/detail.js +1 -1
  123. package/lib/commands/kb/index.js +1 -1
  124. package/lib/commands/kb/list.js +1 -1
  125. package/lib/commands/kb/search.js +1 -1
  126. package/lib/commands/kb/shared.js +1 -1
  127. package/lib/commands/kb/update.js +1 -1
  128. package/lib/commands/logs/index.js +1 -1
  129. package/lib/commands/menu/asset-update.js +1 -1
  130. package/lib/commands/menu/delete.js +1 -1
  131. package/lib/commands/menu/external-link-create.js +1 -1
  132. package/lib/commands/menu/external-link-update.js +1 -1
  133. package/lib/commands/menu/group-create.js +1 -1
  134. package/lib/commands/menu/group-update.js +1 -1
  135. package/lib/commands/menu/index.js +1 -1
  136. package/lib/commands/menu/list.js +1 -1
  137. package/lib/commands/menu/move.js +1 -1
  138. package/lib/commands/menu/regroup-start.js +1 -1
  139. package/lib/commands/menu/rename.js +1 -1
  140. package/lib/commands/menu/shared/compare-table.js +1 -1
  141. package/lib/commands/menu/shared/delete-plan.js +1 -1
  142. package/lib/commands/menu/shared/facts.js +1 -1
  143. package/lib/commands/menu/shared/index.js +1 -1
  144. package/lib/commands/menu/shared/inquirer.js +1 -1
  145. package/lib/commands/menu/shared/local-pages.js +1 -1
  146. package/lib/commands/menu/shared/logic.js +1 -1
  147. package/lib/commands/menu/shared/mutations.js +1 -1
  148. package/lib/commands/menu/shared/service.js +1 -1
  149. package/lib/commands/menu/shared/sync-core.js +1 -1
  150. package/lib/commands/menu/shared/update-core.js +1 -1
  151. package/lib/commands/menu/shared/valid-url.js +1 -1
  152. package/lib/commands/menu/sync.js +1 -1
  153. package/lib/commands/menu/visibility-update.js +1 -1
  154. package/lib/commands/notification/config-create.js +1 -1
  155. package/lib/commands/notification/config-delete.js +1 -1
  156. package/lib/commands/notification/config-list.js +1 -1
  157. package/lib/commands/notification/config-update.js +1 -1
  158. package/lib/commands/notification/index.js +1 -1
  159. package/lib/commands/notification/shared.js +1 -1
  160. package/lib/commands/ocr/index.js +1 -1
  161. package/lib/commands/page/create.js +1 -1
  162. package/lib/commands/page/custom/detail.js +1 -1
  163. package/lib/commands/page/custom/list.js +1 -1
  164. package/lib/commands/page/custom/publish.js +1 -1
  165. package/lib/commands/page/custom/shared.js +1 -1
  166. package/lib/commands/page/custom/syntax.js +1 -1
  167. package/lib/commands/page/custom/update.js +1 -1
  168. package/lib/commands/page/data-list-status.js +1 -1
  169. package/lib/commands/page/generate-start.js +1 -1
  170. package/lib/commands/page/generate-status.js +1 -1
  171. package/lib/commands/page/index.js +1 -1
  172. package/lib/commands/page/pull.js +1 -1
  173. package/lib/commands/page/push.js +1 -1
  174. package/lib/commands/page/relation-audit.js +1 -1
  175. package/lib/commands/page/restore.js +1 -1
  176. package/lib/commands/page/shared.js +1 -1
  177. package/lib/commands/page/sync.js +1 -1
  178. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  179. package/lib/commands/project/create/format-elapsed.js +1 -1
  180. package/lib/commands/project/create/main.js +1 -1
  181. package/lib/commands/project/create/materialize-project-template.js +1 -1
  182. package/lib/commands/project/create/project-name.js +1 -1
  183. package/lib/commands/project/create/project-template-archive.js +1 -1
  184. package/lib/commands/project/create/project-template-path.js +1 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/domain-routing-sync.js +1 -1
  189. package/lib/commands/project/index.js +1 -1
  190. package/lib/commands/project/upgrade.js +1 -1
  191. package/lib/commands/registry.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/rule/get.js +1 -1
  202. package/lib/commands/rule/index.js +1 -1
  203. package/lib/commands/rule/list.js +1 -1
  204. package/lib/commands/rule/set.js +1 -1
  205. package/lib/commands/rule/shared.js +1 -1
  206. package/lib/commands/run/index.js +1 -1
  207. package/lib/commands/schema.js +1 -1
  208. package/lib/commands/sql/create.js +1 -1
  209. package/lib/commands/sql/delete.js +1 -1
  210. package/lib/commands/sql/detail.js +1 -1
  211. package/lib/commands/sql/exec.js +1 -1
  212. package/lib/commands/sql/index.js +1 -1
  213. package/lib/commands/sql/list.js +1 -1
  214. package/lib/commands/sql/pull.js +1 -1
  215. package/lib/commands/sql/push.js +1 -1
  216. package/lib/commands/sql/shared.js +1 -1
  217. package/lib/commands/sql/status.js +1 -1
  218. package/lib/commands/sql/validate.js +1 -1
  219. package/lib/commands/task/index.js +1 -1
  220. package/lib/commands/task/status.js +1 -1
  221. package/lib/commands/tenant/index.js +1 -1
  222. package/lib/commands/tenant/members-list.js +1 -1
  223. package/lib/commands/tenant/shared.js +1 -1
  224. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  225. package/lib/commands/user-account/index.js +1 -1
  226. package/lib/commands/workspace/add.js +1 -1
  227. package/lib/commands/workspace/index.js +1 -1
  228. package/lib/commands/workspace/remove.js +1 -1
  229. package/lib/config/domain-config.js +1 -1
  230. package/lib/config/project-domain-routing.js +1 -1
  231. package/lib/config/region-config.d.ts +23 -0
  232. package/lib/config/region-config.js +1 -0
  233. package/lib/config/schema.d.ts +15 -0
  234. package/lib/config/schema.js +1 -1
  235. package/lib/constant/cdn.js +1 -1
  236. package/lib/constant/cli.js +1 -1
  237. package/lib/constant/defaults.js +1 -1
  238. package/lib/constant/domain.js +1 -1
  239. package/lib/constant/env.js +1 -1
  240. package/lib/constant/output.js +1 -1
  241. package/lib/constant/paths.js +1 -1
  242. package/lib/constant/region.js +1 -1
  243. package/lib/constant/risk.js +1 -1
  244. package/lib/constant/routing-profile.js +1 -1
  245. package/lib/context/app-resolver.d.ts +6 -0
  246. package/lib/context/app-resolver.js +1 -1
  247. package/lib/context/auth-resolver.js +1 -1
  248. package/lib/context/config-loader.js +1 -1
  249. package/lib/context.d.ts +13 -0
  250. package/lib/context.js +1 -1
  251. package/lib/core/alias-resolver.js +1 -1
  252. package/lib/core/api-client.d.ts +2 -0
  253. package/lib/core/api-client.js +1 -1
  254. package/lib/core/bff/config.js +1 -1
  255. package/lib/core/bff/file-system.js +1 -1
  256. package/lib/core/bff/hash.js +1 -1
  257. package/lib/core/bff/lock.js +1 -1
  258. package/lib/core/bff/utils.js +1 -1
  259. package/lib/core/db-resolver.js +1 -1
  260. package/lib/core/instant-api-policy/config.js +1 -1
  261. package/lib/core/kb-search-client.js +1 -1
  262. package/lib/core/page/file-system.js +1 -1
  263. package/lib/core/page/hash.js +1 -1
  264. package/lib/core/page/lock.js +1 -1
  265. package/lib/core/page/lr-smart-jsx.d.ts +6 -0
  266. package/lib/core/page/lr-smart-jsx.js +1 -0
  267. package/lib/core/sql-index-auditor.js +1 -1
  268. package/lib/core/sql-sync/config.js +1 -1
  269. package/lib/core/sql-sync/file-system.js +1 -1
  270. package/lib/core/sql-sync/hash.js +1 -1
  271. package/lib/core/sql-sync/lock.js +1 -1
  272. package/lib/core/sql-sync/utils.js +1 -1
  273. package/lib/core/sql-validator.js +1 -1
  274. package/lib/errors.js +1 -1
  275. package/lib/framework/build-all-flags.js +1 -1
  276. package/lib/framework/error-output.js +1 -1
  277. package/lib/framework/explicit-yes.js +1 -1
  278. package/lib/framework/flags.js +1 -1
  279. package/lib/framework/help.js +1 -1
  280. package/lib/framework/index.js +1 -1
  281. package/lib/framework/output.js +1 -1
  282. package/lib/framework/response.js +1 -1
  283. package/lib/framework/runner-alias.js +1 -1
  284. package/lib/framework/runner.js +1 -1
  285. package/lib/framework/schema-export.js +1 -1
  286. package/lib/framework/supported-flags.js +1 -1
  287. package/lib/framework/types.js +1 -1
  288. package/lib/generated/build-info.d.ts +4 -4
  289. package/lib/generated/build-info.js +1 -1
  290. package/lib/generated/official-routing.js +1 -1
  291. package/lib/generated/routing-contract.js +1 -1
  292. package/lib/help.js +1 -1
  293. package/lib/postinstall.js +1 -1
  294. package/lib/runtime/confirmation.js +1 -1
  295. package/lib/runtime/event.js +1 -1
  296. package/lib/runtime/index.js +1 -1
  297. package/lib/runtime/queue.js +1 -1
  298. package/lib/runtime/resolve.js +1 -1
  299. package/lib/skills/builtin-skill.js +1 -1
  300. package/lib/skills/main.js +1 -1
  301. package/lib/skills/npx-skills-add.js +1 -1
  302. package/lib/skills/skill-presence.js +1 -1
  303. package/lib/telemetry/cli-command-trace.js +1 -1
  304. package/lib/telemetry/cli-help-trace.js +1 -1
  305. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  306. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  307. package/lib/telemetry/send-cli-trace-log.js +1 -1
  308. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  309. package/lib/types/index.d.ts +1 -1
  310. package/lib/utils/ai_config.js +1 -1
  311. package/lib/utils/apply-jq-filter.js +1 -1
  312. package/lib/utils/cdn-config.js +1 -1
  313. package/lib/utils/check-sdk-version.js +1 -1
  314. package/lib/utils/cli-version-check.js +1 -1
  315. package/lib/utils/cli-version-policy.js +1 -1
  316. package/lib/utils/config.d.ts +2 -8
  317. package/lib/utils/config.js +1 -1
  318. package/lib/utils/entity-with-id.js +1 -1
  319. package/lib/utils/file-utils.js +1 -1
  320. package/lib/utils/guides-cdn.js +1 -1
  321. package/lib/utils/http-client.js +1 -1
  322. package/lib/utils/is-non-interactive.js +1 -1
  323. package/lib/utils/logger.js +1 -1
  324. package/lib/utils/params.js +1 -1
  325. package/lib/utils/platform.js +1 -1
  326. package/lib/utils/sleep.js +1 -1
  327. package/lib/utils/template-replacer.d.ts +2 -1
  328. package/lib/utils/template-replacer.js +1 -1
  329. package/lib/utils/update-notice.js +1 -1
  330. package/lib/utils/version.js +1 -1
  331. package/lib/utils/with-active-cookie.js +1 -1
  332. package/lib/utils/write-cli-side-channel.js +1 -1
  333. package/package.json +1 -1
  334. package/skills/rabetbase/SKILL.md +6 -5
  335. package/skills/rabetbase/guides/page-development-workflow.md +3 -0
  336. package/skills/rabetbase/guides/sdk-client-generation.md +5 -5
  337. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
  338. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
  339. package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
  340. package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-bff-pull.md +2 -0
  342. package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
  343. package/skills/rabetbase/references/rabetbase-config.md +10 -9
  344. package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
  346. package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
  347. package/skills/rabetbase.manifest.json +3 -3
  348. package/templates/generate-api/client.ts.tpl +1 -1
@@ -1 +1 @@
1
- (function(_0x483d86,_0x4fcff8){const _0x23fd6e=a176_0x51a5,_0x24b74c=_0x483d86();while(!![]){try{const _0xa31d64=-parseInt(_0x23fd6e(0x1a3))/0x1+parseInt(_0x23fd6e(0x1ac))/0x2*(parseInt(_0x23fd6e(0x1a0))/0x3)+parseInt(_0x23fd6e(0x1ad))/0x4*(parseInt(_0x23fd6e(0x19e))/0x5)+parseInt(_0x23fd6e(0x1aa))/0x6*(parseInt(_0x23fd6e(0x197))/0x7)+parseInt(_0x23fd6e(0x1af))/0x8*(parseInt(_0x23fd6e(0x1a6))/0x9)+parseInt(_0x23fd6e(0x198))/0xa+-parseInt(_0x23fd6e(0x1b0))/0xb;if(_0xa31d64===_0x4fcff8)break;else _0x24b74c['push'](_0x24b74c['shift']());}catch(_0x93431b){_0x24b74c['push'](_0x24b74c['shift']());}}}(a176_0x1627,0x32067));import{existsSync}from'node:fs';import a176_0x1c9336 from'node:path';function a176_0x1627(){const _0xd66275=['Login\x20failed','√\x20Login\x20status:\x20','trim','2420526SdqGSp','production','530890QbIMte','8cVCcZE','my-app','8hPgcbH','10874677VMsFiH','Logged\x20in','√\x20App\x20Code:\x20','string','\x22\x20already\x20exists','green','7RRgpot','1670380MPPwvc','√\x20Project\x20Name:\x20','log','cyan','Directory\x20\x22','cwd','724215SKqBPl','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','3zhYcNX','env','Project\x20name:','169075zDwuhm','Skipped','Not\x20set','2132955LjcRrX'];a176_0x1627=function(){return _0xd66275;};return a176_0x1627();}import a176_0x19d245 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';function a176_0x51a5(_0x36e57d,_0x205d33){_0x36e57d=_0x36e57d-0x192;const _0x162774=a176_0x1627();let _0x51a5f4=_0x162774[_0x36e57d];return _0x51a5f4;}export async function guidedCreateProject(_0x8f3c31,_0x1515ea,_0x2010ab){const _0x779b7c=a176_0x51a5,_0x516b2d=_0x779b7c(0x1ae),_0x2387ec=readConfig(),_0x46d5f6=typeof _0x2387ec['env']===_0x779b7c(0x194)?_0x2387ec[_0x779b7c(0x1a1)]:undefined,_0x4affc3=await input({'message':_0x779b7c(0x1a2),'default':_0x516b2d,'validate':_0x99cd27=>{const _0x4311b7=_0x779b7c,_0x5c0caf=_0x99cd27[_0x4311b7(0x1a9)]()||_0x516b2d,_0x261b48=getProjectNameValidationError(_0x5c0caf);if(_0x261b48)return _0x261b48;const _0x4c447a=a176_0x1c9336['resolve'](process[_0x4311b7(0x19d)](),_0x5c0caf);if(existsSync(_0x4c447a))return _0x4311b7(0x19c)+_0x5c0caf+_0x4311b7(0x195);return!![];}});console[_0x779b7c(0x19a)](a176_0x19d245[_0x779b7c(0x196)](_0x779b7c(0x199)+a176_0x19d245[_0x779b7c(0x19b)](_0x4affc3)));const _0x3eeed8=await selectSingleAppcode(_0x2010ab);console[_0x779b7c(0x19a)](a176_0x19d245[_0x779b7c(0x196)](_0x779b7c(0x193)+a176_0x19d245[_0x779b7c(0x19b)](_0x3eeed8||_0x779b7c(0x1a5))));if(_0x3eeed8){const _0x5ead47=await getIsSessionValid();if(!_0x5ead47){const _0x53ab57=await confirm({'message':_0x779b7c(0x19f),'default':!![]});if(_0x53ab57){const _0x20e9f8=await authServer({'silent':!![]});console[_0x779b7c(0x19a)](a176_0x19d245[_0x779b7c(0x196)](_0x779b7c(0x1a8)+a176_0x19d245['cyan'](_0x20e9f8?_0x779b7c(0x192):_0x779b7c(0x1a7))));}else console[_0x779b7c(0x19a)](a176_0x19d245[_0x779b7c(0x196)](_0x779b7c(0x1a8)+a176_0x19d245[_0x779b7c(0x19b)](_0x779b7c(0x1a4))));}await _0x8f3c31({'projectName':_0x4affc3,'appCode':_0x3eeed8,'env':_0x1515ea||_0x46d5f6||_0x779b7c(0x1ab)});}else await _0x8f3c31({'projectName':_0x4affc3,'env':_0x1515ea||_0x46d5f6||_0x779b7c(0x1ab)});}
1
+ (function(_0x5be824,_0x46b9e5){const _0x102f65=a176_0x3e40,_0x148084=_0x5be824();while(!![]){try{const _0x604077=-parseInt(_0x102f65(0x1c4))/0x1+parseInt(_0x102f65(0x1d7))/0x2*(parseInt(_0x102f65(0x1d5))/0x3)+-parseInt(_0x102f65(0x1ca))/0x4+parseInt(_0x102f65(0x1cb))/0x5*(parseInt(_0x102f65(0x1d1))/0x6)+parseInt(_0x102f65(0x1c5))/0x7*(-parseInt(_0x102f65(0x1bd))/0x8)+parseInt(_0x102f65(0x1c9))/0x9+parseInt(_0x102f65(0x1d0))/0xa;if(_0x604077===_0x46b9e5)break;else _0x148084['push'](_0x148084['shift']());}catch(_0x167620){_0x148084['push'](_0x148084['shift']());}}}(a176_0x103c,0x9bd28));import{existsSync}from'node:fs';import a176_0x3ba2be from'node:path';import a176_0x5dd6ce from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a176_0x103c(){const _0x1ebc22=['2975bXUZBW','string','resolve','√\x20App\x20Code:\x20','production','2997470cabqec','8706WcDjHz','my-app','Not\x20set','log','1854grKlQD','Directory\x20\x22','4074IoPnkr','8368DXLMTH','Login\x20failed','\x22\x20already\x20exists','cyan','√\x20Login\x20status:\x20','Skipped','trim','1063491vUfwfu','2296pCLtyR','env','Project\x20name:','green','6268410JgcZcn','4294484trKzFc'];a176_0x103c=function(){return _0x1ebc22;};return a176_0x103c();}function a176_0x3e40(_0x3d2f4d,_0x1a76be){_0x3d2f4d=_0x3d2f4d-0x1bd;const _0x103c56=a176_0x103c();let _0x3e407b=_0x103c56[_0x3d2f4d];return _0x3e407b;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x2d48d0,_0x4cdddb,_0xd0b358){const _0x48fba9=a176_0x3e40,_0x5bf8a7=_0x48fba9(0x1d2),_0x56e892=readConfig(),_0x3474d4=typeof _0x56e892[_0x48fba9(0x1c6)]===_0x48fba9(0x1cc)?_0x56e892['env']:undefined,_0x990836=await input({'message':_0x48fba9(0x1c7),'default':_0x5bf8a7,'validate':_0x41e6da=>{const _0x131d3d=_0x48fba9,_0x36ebe6=_0x41e6da[_0x131d3d(0x1c3)]()||_0x5bf8a7,_0x4f8954=getProjectNameValidationError(_0x36ebe6);if(_0x4f8954)return _0x4f8954;const _0x5bcdb=a176_0x3ba2be[_0x131d3d(0x1cd)](process['cwd'](),_0x36ebe6);if(existsSync(_0x5bcdb))return _0x131d3d(0x1d6)+_0x36ebe6+_0x131d3d(0x1bf);return!![];}});console[_0x48fba9(0x1d4)](a176_0x5dd6ce[_0x48fba9(0x1c8)]('√\x20Project\x20Name:\x20'+a176_0x5dd6ce[_0x48fba9(0x1c0)](_0x990836)));const _0x1b194f=await selectSingleAppcode(_0xd0b358);console[_0x48fba9(0x1d4)](a176_0x5dd6ce[_0x48fba9(0x1c8)](_0x48fba9(0x1ce)+a176_0x5dd6ce[_0x48fba9(0x1c0)](_0x1b194f||_0x48fba9(0x1d3))));if(_0x1b194f){const _0x3e6307=await getIsSessionValid();if(!_0x3e6307){const _0x4fd0ad=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x4fd0ad){const _0x4c828f=await authServer({'silent':!![]});console[_0x48fba9(0x1d4)](a176_0x5dd6ce['green'](_0x48fba9(0x1c1)+a176_0x5dd6ce[_0x48fba9(0x1c0)](_0x4c828f?'Logged\x20in':_0x48fba9(0x1be))));}else console[_0x48fba9(0x1d4)](a176_0x5dd6ce[_0x48fba9(0x1c8)](_0x48fba9(0x1c1)+a176_0x5dd6ce[_0x48fba9(0x1c0)](_0x48fba9(0x1c2))));}await _0x2d48d0({'projectName':_0x990836,'appCode':_0x1b194f,'env':_0x4cdddb||_0x3474d4||_0x48fba9(0x1cf)});}else await _0x2d48d0({'projectName':_0x990836,'env':_0x4cdddb||_0x3474d4||_0x48fba9(0x1cf)});}
@@ -1 +1 @@
1
- function a177_0x1c18(_0x17c40b,_0x214cbc){_0x17c40b=_0x17c40b-0x1d3;const _0x26f5d5=a177_0x26f5();let _0x1c18a4=_0x26f5d5[_0x17c40b];return _0x1c18a4;}(function(_0x14b220,_0x3774b4){const _0x3a8e62=a177_0x1c18,_0x17f1e6=_0x14b220();while(!![]){try{const _0xa41496=parseInt(_0x3a8e62(0x1da))/0x1*(-parseInt(_0x3a8e62(0x1dd))/0x2)+parseInt(_0x3a8e62(0x1d3))/0x3+parseInt(_0x3a8e62(0x1db))/0x4+parseInt(_0x3a8e62(0x1d4))/0x5+-parseInt(_0x3a8e62(0x1dc))/0x6*(-parseInt(_0x3a8e62(0x1df))/0x7)+-parseInt(_0x3a8e62(0x1de))/0x8+parseInt(_0x3a8e62(0x1d8))/0x9*(parseInt(_0x3a8e62(0x1d5))/0xa);if(_0xa41496===_0x3774b4)break;else _0x17f1e6['push'](_0x17f1e6['shift']());}catch(_0xb1d275){_0x17f1e6['push'](_0x17f1e6['shift']());}}}(a177_0x26f5,0xd51bf));export function formatElapsed(_0x2b78ca){const _0x541a9d=a177_0x1c18,_0x413007=Date[_0x541a9d(0x1d6)]()-_0x2b78ca;if(_0x413007<0x3e8)return _0x413007+'ms';const _0x2255ac=(_0x413007/0x3e8)[_0x541a9d(0x1d7)](0x2),_0x44ef30=_0x2255ac[_0x541a9d(0x1d9)](/\.?0+$/u,'');return _0x44ef30+'s';}function a177_0x26f5(){const _0x1bc094=['448670yVTtfk','now','toFixed','9VBJguC','replace','1JyygJf','3767112VjFVLo','6GXVSzH','3244818POCPZf','9155984ejnMcb','6113345DBqkNX','1937541OHaCOT','5669875mlRDrx'];a177_0x26f5=function(){return _0x1bc094;};return a177_0x26f5();}
1
+ function a177_0x3c7a(_0x4a4051,_0x38eb5c){_0x4a4051=_0x4a4051-0x1bc;const _0x53af04=a177_0x53af();let _0x3c7a19=_0x53af04[_0x4a4051];return _0x3c7a19;}(function(_0x2fe66b,_0x3d430b){const _0x4bea6d=a177_0x3c7a,_0x3da8f7=_0x2fe66b();while(!![]){try{const _0x12b9b9=parseInt(_0x4bea6d(0x1c0))/0x1+-parseInt(_0x4bea6d(0x1c5))/0x2+-parseInt(_0x4bea6d(0x1c6))/0x3+-parseInt(_0x4bea6d(0x1c1))/0x4*(-parseInt(_0x4bea6d(0x1c3))/0x5)+parseInt(_0x4bea6d(0x1bc))/0x6*(parseInt(_0x4bea6d(0x1c4))/0x7)+-parseInt(_0x4bea6d(0x1c7))/0x8*(-parseInt(_0x4bea6d(0x1c2))/0x9)+parseInt(_0x4bea6d(0x1bd))/0xa;if(_0x12b9b9===_0x3d430b)break;else _0x3da8f7['push'](_0x3da8f7['shift']());}catch(_0x20a0cf){_0x3da8f7['push'](_0x3da8f7['shift']());}}}(a177_0x53af,0xaf813));function a177_0x53af(){const _0x10c337=['toFixed','now','468013wUnOeO','27684PWDRjn','189LftoyJ','610AFFduo','28opMtfn','2694434yLBWxn','3931503HTYRTb','427192bdfUbD','replace','733326tbaeAM','4539470ErOwNn'];a177_0x53af=function(){return _0x10c337;};return a177_0x53af();}export function formatElapsed(_0x2d1d2a){const _0x4d3a83=a177_0x3c7a,_0x11a258=Date[_0x4d3a83(0x1bf)]()-_0x2d1d2a;if(_0x11a258<0x3e8)return _0x11a258+'ms';const _0x42538f=(_0x11a258/0x3e8)[_0x4d3a83(0x1be)](0x2),_0x5a97fb=_0x42538f[_0x4d3a83(0x1c8)](/\.?0+$/u,'');return _0x5a97fb+'s';}
@@ -1 +1 @@
1
- function a178_0x2e9e(){const _0x288358=['basename','1145608PdyIBf','fail','writeFileSync','reverse','√\x20package.json\x20updated:\x20name=','dev','W_OK','CLI\x20version\x20check','info','√\x20Pulled\x20','1208430wwUvih','belowMinimum','join','start','The\x20current\x20directory\x20must\x20be\x20empty.','warn','keys','minimumVersion','relative','24652RUfKXU','cd\x20','7507320eoMjvT','renameSync','version','description','env','√\x20Configuration\x20file\x20created,\x20Apps:\x20','...','gray','\x20√\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','utf8','stableVersion','bold','Install\x20dependencies','Project\x20creation\x20failed:\x20','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','green','length','verifying','115otBPVt','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','message','Verifying\x20project\x20template','projectCode','projectName','repeat','42QNiNGF','cyan','rmSync','3572hLuNRG','create','isDirectory','*\x20Configuring\x20AppCode\x20for\x20project\x20','1.0.0','dirname','package.json','stop','\x20&&\x20','\x20\x201.\x20Start\x20project:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','needsUpgrade','Failed\x20to\x20configure\x20app\x20AppCode','lstatSync','*\x20Pulling\x20API\x20configuration...','readdirSync','toLocaleString','mkdtempSync','validation','resolving','Project\x20name:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','constants','Extracting\x20project\x20template','production','templateSource','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','modelCount','Configured\x20app\x20AppCode:\x20','Resolving\x20project\x20template','success','extracting','chdir','23027334YUNnyh','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','160nJdAxa','API\x20configuration\x20pull\x20failed','Updating\x20package.json\x20name','API\x20configuration\x20pulled:\x20','cwd','project','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','\x20config\x20set\x20appcode\x20<app-code>\x27','appCode','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','\x20run\x20start','log','\x20api\x20pull\x20--force\x20--yes','Project\x20created:\x20','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','Project\x20template\x20ready','nonInteractive','existsSync','apps','accessSync','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','\x20model(s)','currentVersion','Project\x20directory\x20','ino','\x20already\x20exists','\x20\x202.\x20Pull\x20API\x20configuration:\x20','downloading','parse','cookie','36bdPVlC','\x20|\x20AppCode:\x20','135114UuNchm','resolve','\x20Generated\x20by\x20rabetbase\x20cli\x20','currentDir','push','stringify','Failed\x20to\x20update\x20package.json','readFileSync','error','12paSpBy'];a178_0x2e9e=function(){return _0x288358;};return a178_0x2e9e();}(function(_0x3ba786,_0x1e15b1){const _0x373a3c=a178_0x6994,_0x2d9bb6=_0x3ba786();while(!![]){try{const _0x68c031=parseInt(_0x373a3c(0x144))/0x1*(parseInt(_0x373a3c(0x169))/0x2)+-parseInt(_0x373a3c(0x187))/0x3*(-parseInt(_0x373a3c(0x1a7))/0x4)+-parseInt(_0x373a3c(0x1bc))/0x5*(-parseInt(_0x373a3c(0x189))/0x6)+parseInt(_0x373a3c(0x141))/0x7*(parseInt(_0x373a3c(0x194))/0x8)+parseInt(_0x373a3c(0x19e))/0x9+parseInt(_0x373a3c(0x1a9))/0xa+parseInt(_0x373a3c(0x167))/0xb*(-parseInt(_0x373a3c(0x192))/0xc);if(_0x68c031===_0x1e15b1)break;else _0x2d9bb6['push'](_0x2d9bb6['shift']());}catch(_0x5d6226){_0x2d9bb6['push'](_0x2d9bb6['shift']());}}}(a178_0x2e9e,0x81053));import a178_0x5308e7 from'path';import a178_0x569b84 from'fs';import a178_0x2d6ee6 from'chalk';import a178_0x5c2aa3 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';function a178_0x6994(_0x4c3179,_0x27124f){_0x4c3179=_0x4c3179-0x13e;const _0x2e9e77=a178_0x2e9e();let _0x69949b=_0x2e9e77[_0x4c3179];return _0x69949b;}import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x4654f3){const _0x551a98=a178_0x6994;try{const _0x5b58bf=a178_0x569b84[_0x551a98(0x152)](_0x4654f3);if(!_0x5b58bf[_0x551a98(0x146)]())return null;return{'dev':_0x5b58bf['dev'],'ino':_0x5b58bf['ino']};}catch{return null;}}function isSameDirectory(_0x535724,_0x328520){const _0x520b5e=a178_0x6994;return!!_0x535724&&!!_0x328520&&_0x535724[_0x520b5e(0x199)]===_0x328520[_0x520b5e(0x199)]&&_0x535724[_0x520b5e(0x181)]===_0x328520['ino'];}function commitCurrentDirectoryProject(_0x31688c,_0xc9fbae,_0x38adf0){const _0x147d9b=a178_0x6994;if(!isSameDirectory(readDirectoryIdentity(_0x31688c),_0x38adf0))throw new Error(_0x147d9b(0x16f));const _0x58366c=a178_0x5308e7['basename'](_0xc9fbae),_0x42968e=a178_0x569b84[_0x147d9b(0x154)](_0x31688c);if(_0x42968e[_0x147d9b(0x1ba)]!==0x1||_0x42968e[0x0]!==_0x58366c)throw CliErrors['validation'](_0x147d9b(0x15b),_0x147d9b(0x17d));const _0x42c890=a178_0x5308e7[_0x147d9b(0x1a0)](_0xc9fbae,'project'),_0x10d863=[];try{for(const _0x9193c1 of a178_0x569b84[_0x147d9b(0x154)](_0x42c890)){a178_0x569b84[_0x147d9b(0x1aa)](a178_0x5308e7['join'](_0x42c890,_0x9193c1),a178_0x5308e7[_0x147d9b(0x1a0)](_0x31688c,_0x9193c1)),_0x10d863[_0x147d9b(0x18d)](_0x9193c1);}a178_0x569b84[_0x147d9b(0x143)](_0xc9fbae,{'recursive':!![],'force':!![]});}catch(_0x589682){for(const _0x3f297a of _0x10d863[_0x147d9b(0x197)]()){const _0x449549=a178_0x5308e7[_0x147d9b(0x1a0)](_0x31688c,_0x3f297a);if(!a178_0x569b84[_0x147d9b(0x17a)](_0x449549))continue;a178_0x569b84[_0x147d9b(0x1aa)](_0x449549,a178_0x5308e7[_0x147d9b(0x1a0)](_0x42c890,_0x3f297a));}throw _0x589682;}}export async function createApp(_0x42c98b){const _0x546ccd=a178_0x6994,_0x4bd5ee=await checkCliVersion();(_0x4bd5ee[_0x546ccd(0x150)]||_0x4bd5ee[_0x546ccd(0x19f)])&&(printCliUpgradeWarning(_0x4bd5ee),assertCliVersionSupported(_0x4bd5ee),logger[_0x546ccd(0x19c)](_0x546ccd(0x145),_0x546ccd(0x19b),{'currentVersion':_0x4bd5ee[_0x546ccd(0x17f)],'stableVersion':_0x4bd5ee[_0x546ccd(0x1b4)],'minimumVersion':_0x4bd5ee[_0x546ccd(0x1a5)],'needsUpgrade':_0x4bd5ee[_0x546ccd(0x150)],'belowMinimum':_0x4bd5ee[_0x546ccd(0x19f)]}));const _0x4b0df7=_0x42c98b['currentDir']?a178_0x5308e7[_0x546ccd(0x193)](process[_0x546ccd(0x16d)]()):_0x42c98b[_0x546ccd(0x13e)];if(_0x4b0df7&&(_0x42c98b['appCode']||_0x42c98b[_0x546ccd(0x179)]))await runCreate({'projectName':_0x4b0df7,'appCode':_0x42c98b[_0x546ccd(0x171)],'env':_0x42c98b[_0x546ccd(0x1ad)]},_0x42c98b);else{if(_0x4b0df7){const _0x1b6faa=await selectSingleAppcode(_0x42c98b[_0x546ccd(0x186)]);await runCreate({'projectName':_0x4b0df7,'appCode':_0x1b6faa||undefined,'env':_0x42c98b[_0x546ccd(0x1ad)]},_0x42c98b);}else await guidedCreateProject(_0x323405=>runCreate(_0x323405,_0x42c98b),_0x42c98b[_0x546ccd(0x1ad)],_0x42c98b['cookie']);}}async function runCreate(_0xdc526c,_0x26a179){const _0x40abff=a178_0x6994;_0xdc526c[_0x40abff(0x13f)]=validateProjectName(_0xdc526c['projectName']);const _0x2ecbca=_0x26a179[_0x40abff(0x18c)]?process[_0x40abff(0x16d)]():a178_0x5308e7[_0x40abff(0x18a)](process[_0x40abff(0x16d)](),_0xdc526c[_0x40abff(0x13f)]);if(_0x26a179[_0x40abff(0x18c)]){if(a178_0x569b84[_0x40abff(0x154)](_0x2ecbca)[_0x40abff(0x1ba)]>0x0)throw CliErrors[_0x40abff(0x157)](_0x40abff(0x1a2),_0x40abff(0x1b8));}else{if(a178_0x569b84[_0x40abff(0x17a)](_0x2ecbca))throw new Error(_0x40abff(0x180)+_0xdc526c['projectName']+_0x40abff(0x182));}let _0x55b8af=null;const _0x59e9da=_0x26a179[_0x40abff(0x18c)]?readDirectoryIdentity(_0x2ecbca):null;let _0x44aefc=null;try{a178_0x569b84[_0x40abff(0x17c)](a178_0x5308e7[_0x40abff(0x149)](_0x2ecbca),a178_0x569b84[_0x40abff(0x15c)][_0x40abff(0x19a)]);}catch{throw new Error(_0x40abff(0x160));}logger['info'](_0x40abff(0x145),'Starting\x20project\x20creation:\x20'+_0xdc526c[_0x40abff(0x13f)],{'projectDir':_0x2ecbca,'appCode':_0xdc526c[_0x40abff(0x171)]}),console[_0x40abff(0x174)](),console[_0x40abff(0x174)](a178_0x2d6ee6['green'](_0x40abff(0x1b1))+_0x40abff(0x159)+a178_0x2d6ee6[_0x40abff(0x1b9)](_0xdc526c[_0x40abff(0x13f)])+(_0xdc526c[_0x40abff(0x171)]?_0x40abff(0x188)+a178_0x2d6ee6[_0x40abff(0x142)](_0xdc526c[_0x40abff(0x171)]):''));try{let _0x4dd1d8=_0xdc526c[_0x40abff(0x13f)];_0x26a179[_0x40abff(0x18c)]&&(_0x44aefc=a178_0x569b84[_0x40abff(0x156)](a178_0x5308e7[_0x40abff(0x1a0)](_0x2ecbca,'.rabetbase-create-')),_0x4dd1d8=a178_0x5308e7[_0x40abff(0x1a6)](process[_0x40abff(0x16d)](),a178_0x5308e7[_0x40abff(0x1a0)](_0x44aefc,_0x40abff(0x16e))));const _0x2abb4f=a178_0x5308e7['resolve'](process['cwd'](),_0x4dd1d8);await runTask(_0x40abff(0x163),_0x5abfad=>copyProjectTemplate(_0x4dd1d8,_0x226811=>_0x5abfad(projectTemplateStageLabel(_0x226811)),_0x26a179[_0x40abff(0x15f)]),_0x40abff(0x178)),_0x55b8af=_0x26a179[_0x40abff(0x18c)]?null:readDirectoryIdentity(_0x2ecbca);if(!_0x26a179['currentDir']&&!_0x55b8af)throw new Error(_0x40abff(0x14f));await updatePackageJsonName(_0x4dd1d8,_0xdc526c[_0x40abff(0x13f)]),await runTask(_0x40abff(0x1b6),()=>installDependencies(_0x4dd1d8)),await runTask('Format\x20code',()=>formatProjectCode(_0x4dd1d8)),await configureAppCode(_0x4dd1d8,_0xdc526c[_0x40abff(0x13f)],_0xdc526c[_0x40abff(0x171)]||'',_0xdc526c[_0x40abff(0x1ad)]);let _0x13c108=![];if(_0xdc526c[_0x40abff(0x171)]){console[_0x40abff(0x174)](_0x40abff(0x153));const _0x5f3657=process['cwd']();try{process[_0x40abff(0x166)](_0x2abb4f);const _0x783846=_0xdc526c[_0x40abff(0x1ad)]||_0x40abff(0x15e);initEnv(_0x783846);const {configArray:_0x2d113c}=await fetchModelList(_0xdc526c[_0x40abff(0x171)],_0x26a179[_0x40abff(0x186)]||''),_0x1c81f7=DEFAULT_API_DIR,_0x33176e=await generateApiFile(_0x2d113c,'',_0xdc526c[_0x40abff(0x171)],!![],_0x783846,_0x1c81f7,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console['log'](_0x40abff(0x19d)+_0x2d113c[_0x40abff(0x1ba)]+'\x20dataset(s),\x20generated\x20'+_0x33176e[_0x40abff(0x161)]+_0x40abff(0x17e)),logger[_0x40abff(0x19c)](_0x40abff(0x145),_0x40abff(0x16c)+_0xdc526c[_0x40abff(0x171)]);}catch(_0x59a849){_0x13c108=!![],console[_0x40abff(0x174)](_0x40abff(0x15a)+CLI_BIN_NAME+_0x40abff(0x175)),logger[_0x40abff(0x1a3)]('create',_0x40abff(0x16a),{'error':_0x59a849 instanceof Error?_0x59a849[_0x40abff(0x1be)]:String(_0x59a849)});}finally{process['chdir'](_0x5f3657);}}if(_0x26a179['currentDir']){if(!_0x44aefc||!_0x59e9da)throw new Error(_0x40abff(0x168));commitCurrentDirectoryProject(_0x2ecbca,_0x44aefc,_0x59e9da),_0x44aefc=null;}try{logger['setLogPath'](_0x2ecbca),logger[_0x40abff(0x164)](_0x40abff(0x145),_0x40abff(0x176)+_0xdc526c[_0x40abff(0x13f)]);}catch(_0x46dcf1){console[_0x40abff(0x1a3)](_0x40abff(0x1bd)+(_0x46dcf1 instanceof Error?_0x46dcf1['message']:String(_0x46dcf1)));}console[_0x40abff(0x174)](),console[_0x40abff(0x174)](a178_0x2d6ee6[_0x40abff(0x1b9)]('─'[_0x40abff(0x140)](0x3c))),console[_0x40abff(0x174)](a178_0x2d6ee6[_0x40abff(0x142)][_0x40abff(0x1b5)]('🚀\x20Next\x20Steps:')),console[_0x40abff(0x174)]();const _0x6567e6=_0x26a179[_0x40abff(0x18c)]?CLI_BIN_NAME+_0x40abff(0x173):_0x40abff(0x1a8)+_0xdc526c[_0x40abff(0x13f)]+_0x40abff(0x14c)+CLI_BIN_NAME+_0x40abff(0x173);console[_0x40abff(0x174)](_0x40abff(0x14d)+a178_0x2d6ee6[_0x40abff(0x142)][_0x40abff(0x1b5)](_0x6567e6)),_0x13c108&&console[_0x40abff(0x174)](_0x40abff(0x183)+a178_0x2d6ee6['cyan'][_0x40abff(0x1b5)](CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes')),console['log'](a178_0x2d6ee6[_0x40abff(0x1b9)]('─'[_0x40abff(0x140)](0x3c)));}catch(_0x139550){logger[_0x40abff(0x191)](_0x40abff(0x145),_0x40abff(0x1b7)+_0xdc526c[_0x40abff(0x13f)],{'error':_0x139550 instanceof Error?_0x139550[_0x40abff(0x1be)]:String(_0x139550)});try{const _0x5d95f7=readDirectoryIdentity(_0x2ecbca);if(_0x26a179['currentDir']&&_0x44aefc)a178_0x569b84[_0x40abff(0x143)](_0x44aefc,{'recursive':!![],'force':!![]});else{if(_0x55b8af&&_0x5d95f7?.[_0x40abff(0x199)]===_0x55b8af[_0x40abff(0x199)]&&_0x5d95f7[_0x40abff(0x181)]===_0x55b8af[_0x40abff(0x181)])console[_0x40abff(0x174)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x2ecbca),a178_0x569b84[_0x40abff(0x143)](_0x2ecbca,{'recursive':!![],'force':!![]});else _0x5d95f7&&logger[_0x40abff(0x1a3)](_0x40abff(0x145),_0x40abff(0x177)+_0x2ecbca);}}catch{logger[_0x40abff(0x1a3)](_0x40abff(0x145),_0x40abff(0x172)+_0x2ecbca);}throw _0x139550;}}async function runTask(_0x119018,_0x13d419,_0x9166a9=_0x119018){const _0x31e269=a178_0x6994,_0xe1b206=a178_0x5c2aa3(_0x119018+_0x31e269(0x1af))[_0x31e269(0x1a1)]();try{const _0x1d72d0=await _0x13d419(_0x2a4106=>{const _0x9fec5f=_0x31e269;_0xe1b206['text']=_0x2a4106+_0x9fec5f(0x1af);});_0xe1b206[_0x31e269(0x14b)](),console[_0x31e269(0x174)](''+a178_0x2d6ee6[_0x31e269(0x1b9)]('\x20√\x20')+_0x9166a9+'\x20'+a178_0x2d6ee6[_0x31e269(0x1b0)]('['+_0x1d72d0+']'));}catch(_0x29604b){_0xe1b206[_0x31e269(0x195)](_0x119018);throw _0x29604b;}}function projectTemplateStageLabel(_0xae6621){const _0x1b75be=a178_0x6994;switch(_0xae6621){case _0x1b75be(0x158):return _0x1b75be(0x163);case _0x1b75be(0x184):return'Downloading\x20project\x20template';case _0x1b75be(0x1bb):return _0x1b75be(0x1bf);case _0x1b75be(0x165):return _0x1b75be(0x15d);case'copying':return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x303443,_0x4093d0){const _0x52186c=a178_0x6994,_0x54bf50=a178_0x5308e7[_0x52186c(0x18a)](process[_0x52186c(0x16d)](),_0x303443),_0x38d65d=a178_0x5308e7[_0x52186c(0x1a0)](_0x54bf50,_0x52186c(0x14a));try{console[_0x52186c(0x174)](_0x52186c(0x14e));const _0x337ee8=getRabetbaseCliPackageRoot(),_0x26e28a=a178_0x5308e7['join'](_0x337ee8,'package.json');let _0x3f4395=_0x52186c(0x148);try{const _0xa330a0=JSON[_0x52186c(0x185)](a178_0x569b84[_0x52186c(0x190)](_0x26e28a,_0x52186c(0x1b3)));_0x3f4395=_0xa330a0[_0x52186c(0x1ab)]||_0x52186c(0x148);}catch{}const _0x58c500=a178_0x569b84[_0x52186c(0x190)](_0x38d65d,'utf8'),_0x209553=JSON['parse'](_0x58c500);_0x209553['name']=_0x4093d0,_0x209553[_0x52186c(0x1ac)]=_0x4093d0+_0x52186c(0x18b)+_0x3f4395,a178_0x569b84[_0x52186c(0x196)](_0x38d65d,JSON[_0x52186c(0x18e)](_0x209553,null,0x2)+'\x0a',_0x52186c(0x1b3)),console[_0x52186c(0x174)](_0x52186c(0x198)+_0x4093d0),logger['info'](_0x52186c(0x145),_0x52186c(0x16b));}catch(_0x3fcc08){logger[_0x52186c(0x191)](_0x52186c(0x145),_0x52186c(0x18f));throw _0x3fcc08;}}async function configureAppCode(_0x127977,_0x12489f,_0x1527fe,_0x2df9c8){const _0x2abf84=a178_0x6994,_0x240c9c=a178_0x5308e7[_0x2abf84(0x18a)](process[_0x2abf84(0x16d)](),_0x127977),_0x25d0b2=a178_0x5308e7[_0x2abf84(0x1a0)](_0x240c9c,NEW_CONFIG_NAME);try{_0x1527fe?console[_0x2abf84(0x174)](_0x2abf84(0x147)+_0x12489f+':\x20'+_0x1527fe):console['log'](_0x2abf84(0x1b2)+_0x12489f);const _0x5790ee=getRabetbaseCliPackageRoot(),_0x4f4e6e=a178_0x5308e7[_0x2abf84(0x1a0)](_0x5790ee,'package.json');let _0x556f6d='1.0.0';try{const _0x3bcedc=JSON[_0x2abf84(0x185)](a178_0x569b84['readFileSync'](_0x4f4e6e,'utf8'));_0x556f6d=_0x3bcedc[_0x2abf84(0x1ab)]||_0x2abf84(0x148);}catch{}const {globalConfig:_0x424b6d}=loadRawConfigLayers(),_0x1a4729=typeof _0x424b6d['env']==='string'?_0x424b6d['env']:undefined,_0x5ee7b6={};for(const _0x5ea567 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x424b6d[_0x5ea567]!=null)_0x5ee7b6[_0x5ea567]=_0x424b6d[_0x5ea567];}const _0x52a2d7=buildCanonicalProjectConfig(_0x5ee7b6,{'appCodes':_0x1527fe?[_0x1527fe]:[],'env':_0x2df9c8||_0x1a4729||_0x2abf84(0x15e),'metadata':{'createdAt':new Date()[_0x2abf84(0x155)](),'version':_0x556f6d}});writeConfigFile(_0x25d0b2,_0x52a2d7),await generateSdkConfigFile(a178_0x5308e7['join'](_0x240c9c,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x240c9c),_0x1527fe?console['log'](_0x2abf84(0x1ae)+Object[_0x2abf84(0x1a4)](_0x52a2d7[_0x2abf84(0x17b)]||{})['join'](',\x20')+'\x20|\x20Default:\x20implicit\x20(single\x20app)'):console[_0x2abf84(0x174)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x2abf84(0x170)),logger[_0x2abf84(0x19c)](_0x2abf84(0x145),_0x2abf84(0x162)+_0x1527fe);}catch(_0x4109bf){logger[_0x2abf84(0x191)]('create',_0x2abf84(0x151));throw _0x4109bf;}}
1
+ (function(_0x29924c,_0x5be1d6){const _0x33c62b=a178_0x4cd3,_0x55aae3=_0x29924c();while(!![]){try{const _0x32323a=parseInt(_0x33c62b(0xef))/0x1+parseInt(_0x33c62b(0xe9))/0x2*(-parseInt(_0x33c62b(0x8d))/0x3)+parseInt(_0x33c62b(0x8b))/0x4*(-parseInt(_0x33c62b(0xcf))/0x5)+-parseInt(_0x33c62b(0x82))/0x6+parseInt(_0x33c62b(0x90))/0x7+parseInt(_0x33c62b(0xee))/0x8+parseInt(_0x33c62b(0xa3))/0x9;if(_0x32323a===_0x5be1d6)break;else _0x55aae3['push'](_0x55aae3['shift']());}catch(_0x51ca33){_0x55aae3['push'](_0x55aae3['shift']());}}}(a178_0x5231,0x3191a));import a178_0x15f60a from'path';import a178_0xb59fc0 from'fs';import a178_0x5c369a from'chalk';import a178_0x1a23f2 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x205f27){const _0x175d86=a178_0x4cd3;try{const _0x1ed8f5=a178_0xb59fc0[_0x175d86(0xbf)](_0x205f27);if(!_0x1ed8f5[_0x175d86(0xdc)]())return null;return{'dev':_0x1ed8f5['dev'],'ino':_0x1ed8f5[_0x175d86(0xe3)]};}catch{return null;}}function isSameDirectory(_0x4328e2,_0x1fbcbe){const _0x30833a=a178_0x4cd3;return!!_0x4328e2&&!!_0x1fbcbe&&_0x4328e2[_0x30833a(0xb2)]===_0x1fbcbe[_0x30833a(0xb2)]&&_0x4328e2[_0x30833a(0xe3)]===_0x1fbcbe[_0x30833a(0xe3)];}function commitCurrentDirectoryProject(_0x5b7a7a,_0x5c28b3,_0xc139c6){const _0x4825f6=a178_0x4cd3;if(!isSameDirectory(readDirectoryIdentity(_0x5b7a7a),_0xc139c6))throw new Error(_0x4825f6(0xad));const _0x441b2b=a178_0x15f60a[_0x4825f6(0x7b)](_0x5c28b3),_0x1b771f=a178_0xb59fc0['readdirSync'](_0x5b7a7a);if(_0x1b771f['length']!==0x1||_0x1b771f[0x0]!==_0x441b2b)throw CliErrors[_0x4825f6(0xe4)](_0x4825f6(0xd1),_0x4825f6(0xc2));const _0x28fefc=a178_0x15f60a[_0x4825f6(0xba)](_0x5c28b3,_0x4825f6(0x95)),_0xd84c49=[];try{for(const _0x5a09b0 of a178_0xb59fc0['readdirSync'](_0x28fefc)){a178_0xb59fc0[_0x4825f6(0xe7)](a178_0x15f60a[_0x4825f6(0xba)](_0x28fefc,_0x5a09b0),a178_0x15f60a[_0x4825f6(0xba)](_0x5b7a7a,_0x5a09b0)),_0xd84c49[_0x4825f6(0xd4)](_0x5a09b0);}a178_0xb59fc0[_0x4825f6(0x9f)](_0x5c28b3,{'recursive':!![],'force':!![]});}catch(_0x5103b9){for(const _0xd70458 of _0xd84c49[_0x4825f6(0xd6)]()){const _0x11d895=a178_0x15f60a[_0x4825f6(0xba)](_0x5b7a7a,_0xd70458);if(!a178_0xb59fc0[_0x4825f6(0xdd)](_0x11d895))continue;a178_0xb59fc0[_0x4825f6(0xe7)](_0x11d895,a178_0x15f60a[_0x4825f6(0xba)](_0x28fefc,_0xd70458));}throw _0x5103b9;}}export async function createApp(_0x26082b){const _0x505136=a178_0x4cd3,_0x2d0cf3=await checkCliVersion();(_0x2d0cf3[_0x505136(0xc5)]||_0x2d0cf3[_0x505136(0xb0)])&&(printCliUpgradeWarning(_0x2d0cf3),assertCliVersionSupported(_0x2d0cf3),logger[_0x505136(0xc7)](_0x505136(0xca),_0x505136(0x85),{'currentVersion':_0x2d0cf3['currentVersion'],'stableVersion':_0x2d0cf3[_0x505136(0xd2)],'minimumVersion':_0x2d0cf3[_0x505136(0x88)],'needsUpgrade':_0x2d0cf3[_0x505136(0xc5)],'belowMinimum':_0x2d0cf3[_0x505136(0xb0)]}));const _0x29ac84=_0x26082b[_0x505136(0xa1)]?a178_0x15f60a[_0x505136(0x7b)](process[_0x505136(0x91)]()):_0x26082b[_0x505136(0xa0)];if(_0x29ac84&&(_0x26082b['appCode']||_0x26082b['nonInteractive']))await runCreate({'projectName':_0x29ac84,'appCode':_0x26082b['appCode'],'env':_0x26082b[_0x505136(0xaf)]},_0x26082b);else{if(_0x29ac84){const _0x25c93d=await selectSingleAppcode(_0x26082b['cookie']);await runCreate({'projectName':_0x29ac84,'appCode':_0x25c93d||undefined,'env':_0x26082b[_0x505136(0xaf)]},_0x26082b);}else await guidedCreateProject(_0x587147=>runCreate(_0x587147,_0x26082b),_0x26082b[_0x505136(0xaf)],_0x26082b['cookie']);}}async function runCreate(_0x2abd02,_0x3375e8){const _0x2e59b8=a178_0x4cd3;_0x2abd02['projectName']=validateProjectName(_0x2abd02[_0x2e59b8(0xc9)]);const _0x5c6eab=_0x3375e8[_0x2e59b8(0xa1)]?process[_0x2e59b8(0x91)]():a178_0x15f60a[_0x2e59b8(0xb8)](process[_0x2e59b8(0x91)](),_0x2abd02['projectName']);if(_0x3375e8['currentDir']){if(a178_0xb59fc0[_0x2e59b8(0x93)](_0x5c6eab)[_0x2e59b8(0x87)]>0x0)throw CliErrors[_0x2e59b8(0xe4)]('The\x20current\x20directory\x20must\x20be\x20empty.',_0x2e59b8(0xd5));}else{if(a178_0xb59fc0['existsSync'](_0x5c6eab))throw new Error(_0x2e59b8(0x98)+_0x2abd02[_0x2e59b8(0xc9)]+'\x20already\x20exists');}let _0x41041c=null;const _0x3b6106=_0x3375e8[_0x2e59b8(0xa1)]?readDirectoryIdentity(_0x5c6eab):null;let _0x44f73e=null;try{a178_0xb59fc0[_0x2e59b8(0x9b)](a178_0x15f60a[_0x2e59b8(0xbe)](_0x5c6eab),a178_0xb59fc0[_0x2e59b8(0xab)]['W_OK']);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x2e59b8(0xc7)](_0x2e59b8(0xca),'Starting\x20project\x20creation:\x20'+_0x2abd02[_0x2e59b8(0xc9)],{'projectDir':_0x5c6eab,'appCode':_0x2abd02[_0x2e59b8(0xcd)]}),console['log'](),console[_0x2e59b8(0xa6)](a178_0x5c369a[_0x2e59b8(0xe8)](_0x2e59b8(0xe2))+_0x2e59b8(0x7c)+a178_0x5c369a[_0x2e59b8(0xe8)](_0x2abd02['projectName'])+(_0x2abd02[_0x2e59b8(0xcd)]?_0x2e59b8(0x7d)+a178_0x5c369a[_0x2e59b8(0x7e)](_0x2abd02[_0x2e59b8(0xcd)]):''));try{let _0x44611f=_0x2abd02['projectName'];_0x3375e8[_0x2e59b8(0xa1)]&&(_0x44f73e=a178_0xb59fc0[_0x2e59b8(0xdb)](a178_0x15f60a[_0x2e59b8(0xba)](_0x5c6eab,'.rabetbase-create-')),_0x44611f=a178_0x15f60a['relative'](process[_0x2e59b8(0x91)](),a178_0x15f60a[_0x2e59b8(0xba)](_0x44f73e,'project')));const _0xc8bcc9=a178_0x15f60a['resolve'](process[_0x2e59b8(0x91)](),_0x44611f);await runTask(_0x2e59b8(0xcb),_0x1f6a35=>copyProjectTemplate(_0x44611f,_0x58b353=>_0x1f6a35(projectTemplateStageLabel(_0x58b353)),_0x3375e8[_0x2e59b8(0x97)]),_0x2e59b8(0xda)),_0x41041c=_0x3375e8[_0x2e59b8(0xa1)]?null:readDirectoryIdentity(_0x5c6eab);if(!_0x3375e8[_0x2e59b8(0xa1)]&&!_0x41041c)throw new Error(_0x2e59b8(0xea));await updatePackageJsonName(_0x44611f,_0x2abd02['projectName']),await runTask(_0x2e59b8(0x99),()=>installDependencies(_0x44611f)),await runTask(_0x2e59b8(0xd7),()=>formatProjectCode(_0x44611f)),await configureAppCode(_0x44611f,_0x2abd02['projectName'],_0x2abd02['appCode']||'',_0x2abd02[_0x2e59b8(0xaf)]);let _0x3dc57b=![];if(_0x2abd02[_0x2e59b8(0xcd)]){console[_0x2e59b8(0xa6)]('*\x20Pulling\x20API\x20configuration...');const _0x349df4=process['cwd']();try{process['chdir'](_0xc8bcc9);const _0x277c2a=_0x2abd02[_0x2e59b8(0xaf)]||'production';initEnv(_0x277c2a);const {configArray:_0x2aae78}=await fetchModelList(_0x2abd02[_0x2e59b8(0xcd)],_0x3375e8[_0x2e59b8(0xb6)]||''),_0x15d09c=DEFAULT_API_DIR,_0x3f779d=await generateApiFile(_0x2aae78,'',_0x2abd02['appCode'],!![],_0x277c2a,_0x15d09c,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x2e59b8(0xa6)](_0x2e59b8(0xce)+_0x2aae78[_0x2e59b8(0x87)]+_0x2e59b8(0xae)+_0x3f779d['modelCount']+_0x2e59b8(0x80)),logger[_0x2e59b8(0xc7)]('create','API\x20configuration\x20pulled:\x20'+_0x2abd02['appCode']);}catch(_0x34b835){_0x3dc57b=!![],console[_0x2e59b8(0xa6)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20'+CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes'),logger['warn'](_0x2e59b8(0xca),_0x2e59b8(0x9c),{'error':_0x34b835 instanceof Error?_0x34b835[_0x2e59b8(0x8e)]:String(_0x34b835)});}finally{process['chdir'](_0x349df4);}}if(_0x3375e8['currentDir']){if(!_0x44f73e||!_0x3b6106)throw new Error(_0x2e59b8(0x94));commitCurrentDirectoryProject(_0x5c6eab,_0x44f73e,_0x3b6106),_0x44f73e=null;}try{logger[_0x2e59b8(0xa8)](_0x5c6eab),logger[_0x2e59b8(0xa7)](_0x2e59b8(0xca),_0x2e59b8(0xe6)+_0x2abd02[_0x2e59b8(0xc9)]);}catch(_0x6f042e){console[_0x2e59b8(0xf0)](_0x2e59b8(0x9d)+(_0x6f042e instanceof Error?_0x6f042e[_0x2e59b8(0x8e)]:String(_0x6f042e)));}console[_0x2e59b8(0xa6)](),console[_0x2e59b8(0xa6)](a178_0x5c369a['green']('─'[_0x2e59b8(0x86)](0x3c))),console['log'](a178_0x5c369a[_0x2e59b8(0x7e)]['bold'](_0x2e59b8(0xed))),console[_0x2e59b8(0xa6)]();const _0x149894=_0x3375e8['currentDir']?CLI_BIN_NAME+_0x2e59b8(0x96):_0x2e59b8(0x81)+_0x2abd02['projectName']+_0x2e59b8(0x8f)+CLI_BIN_NAME+'\x20run\x20start';console[_0x2e59b8(0xa6)]('\x20\x201.\x20Start\x20project:\x20'+a178_0x5c369a['cyan'][_0x2e59b8(0xbb)](_0x149894)),_0x3dc57b&&console[_0x2e59b8(0xa6)](_0x2e59b8(0xb1)+a178_0x5c369a[_0x2e59b8(0x7e)][_0x2e59b8(0xbb)](CLI_BIN_NAME+_0x2e59b8(0xb4))),console['log'](a178_0x5c369a[_0x2e59b8(0xe8)]('─'[_0x2e59b8(0x86)](0x3c)));}catch(_0x33b3a0){logger[_0x2e59b8(0x83)](_0x2e59b8(0xca),'Project\x20creation\x20failed:\x20'+_0x2abd02['projectName'],{'error':_0x33b3a0 instanceof Error?_0x33b3a0['message']:String(_0x33b3a0)});try{const _0x553569=readDirectoryIdentity(_0x5c6eab);if(_0x3375e8[_0x2e59b8(0xa1)]&&_0x44f73e)a178_0xb59fc0[_0x2e59b8(0x9f)](_0x44f73e,{'recursive':!![],'force':!![]});else{if(_0x41041c&&_0x553569?.['dev']===_0x41041c[_0x2e59b8(0xb2)]&&_0x553569[_0x2e59b8(0xe3)]===_0x41041c[_0x2e59b8(0xe3)])console[_0x2e59b8(0xa6)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x5c6eab),a178_0xb59fc0[_0x2e59b8(0x9f)](_0x5c6eab,{'recursive':!![],'force':!![]});else _0x553569&&logger[_0x2e59b8(0xf0)]('create',_0x2e59b8(0xb3)+_0x5c6eab);}}catch{logger[_0x2e59b8(0xf0)](_0x2e59b8(0xca),_0x2e59b8(0xde)+_0x5c6eab);}throw _0x33b3a0;}}async function runTask(_0x1efd3e,_0x4ad3f2,_0x577581=_0x1efd3e){const _0x19037a=a178_0x4cd3,_0xbf194b=a178_0x1a23f2(_0x1efd3e+'...')[_0x19037a(0xbc)]();try{const _0xebc822=await _0x4ad3f2(_0x168e65=>{const _0x5ede61=_0x19037a;_0xbf194b[_0x5ede61(0xd8)]=_0x168e65+_0x5ede61(0xec);});_0xbf194b[_0x19037a(0x92)](),console[_0x19037a(0xa6)](''+a178_0x5c369a['green'](_0x19037a(0xe2))+_0x577581+'\x20'+a178_0x5c369a['gray']('['+_0xebc822+']'));}catch(_0x1cb2de){_0xbf194b[_0x19037a(0xbd)](_0x1efd3e);throw _0x1cb2de;}}function projectTemplateStageLabel(_0x4eee03){const _0x5c6c9e=a178_0x4cd3;switch(_0x4eee03){case _0x5c6c9e(0xb5):return _0x5c6c9e(0xcb);case _0x5c6c9e(0xe5):return'Downloading\x20project\x20template';case _0x5c6c9e(0xd3):return _0x5c6c9e(0xa9);case _0x5c6c9e(0xaa):return _0x5c6c9e(0xe1);case _0x5c6c9e(0xcc):return _0x5c6c9e(0x8c);}}function a178_0x5231(){const _0x10d13e=['stableVersion','verifying','push','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','reverse','Format\x20code','text','parse','Project\x20template\x20ready','mkdtempSync','isDirectory','existsSync','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','version','stringify','Extracting\x20project\x20template','\x20√\x20','ino','validation','downloading','Project\x20created:\x20','renameSync','green','374yVVYud','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','...','🚀\x20Next\x20Steps:','1327664XISiJC','293637wcFnKt','warn','basename','Project\x20name:\x20','\x20|\x20AppCode:\x20','cyan','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20model(s)','cd\x20','920802AEPkXa','error','apps','CLI\x20version\x20check','repeat','length','minimumVersion','\x20config\x20set\x20appcode\x20<app-code>\x27','package.json','454868SJxdrs','Copying\x20local\x20template\x20source','2829VlAJZM','message','\x20&&\x20','843731DpXDrU','cwd','stop','readdirSync','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','project','\x20run\x20start','templateSource','Project\x20directory\x20','Install\x20dependencies','Failed\x20to\x20update\x20package.json','accessSync','API\x20configuration\x20pull\x20failed','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','name','rmSync','projectCode','currentDir','readFileSync','1621332mmDcMN','\x20Generated\x20by\x20rabetbase\x20cli\x20','√\x20package.json\x20updated:\x20name=','log','success','setLogPath','Verifying\x20project\x20template','extracting','constants','description','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','\x20dataset(s),\x20generated\x20','env','belowMinimum','\x20\x202.\x20Pull\x20API\x20configuration:\x20','dev','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','\x20api\x20pull\x20--force\x20--yes','resolving','cookie','*\x20Configuring\x20AppCode\x20for\x20project\x20','resolve','keys','join','bold','start','fail','dirname','lstatSync','\x20|\x20Default:\x20implicit\x20(single\x20app)','utf8','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','writeFileSync','Updating\x20package.json\x20name','needsUpgrade','Configured\x20app\x20AppCode:\x20','info','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','projectName','create','Resolving\x20project\x20template','copying','appCode','√\x20Pulled\x20','10WbXVtg','1.0.0','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.'];a178_0x5231=function(){return _0x10d13e;};return a178_0x5231();}function a178_0x4cd3(_0x7024d9,_0x14eece){_0x7024d9=_0x7024d9-0x7b;const _0x52312b=a178_0x5231();let _0x4cd323=_0x52312b[_0x7024d9];return _0x4cd323;}async function updatePackageJsonName(_0x59014e,_0x4b22a1){const _0x4ddf9b=a178_0x4cd3,_0x10eb05=a178_0x15f60a[_0x4ddf9b(0xb8)](process[_0x4ddf9b(0x91)](),_0x59014e),_0xa35446=a178_0x15f60a[_0x4ddf9b(0xba)](_0x10eb05,_0x4ddf9b(0x8a));try{console[_0x4ddf9b(0xa6)](_0x4ddf9b(0x7f));const _0x3cd192=getRabetbaseCliPackageRoot(),_0x8bd0b1=a178_0x15f60a['join'](_0x3cd192,'package.json');let _0x1d9578=_0x4ddf9b(0xd0);try{const _0x5adfee=JSON['parse'](a178_0xb59fc0['readFileSync'](_0x8bd0b1,_0x4ddf9b(0xc1)));_0x1d9578=_0x5adfee[_0x4ddf9b(0xdf)]||'1.0.0';}catch{}const _0x5517a6=a178_0xb59fc0[_0x4ddf9b(0xa2)](_0xa35446,_0x4ddf9b(0xc1)),_0x108e68=JSON[_0x4ddf9b(0xd9)](_0x5517a6);_0x108e68[_0x4ddf9b(0x9e)]=_0x4b22a1,_0x108e68[_0x4ddf9b(0xac)]=_0x4b22a1+_0x4ddf9b(0xa4)+_0x1d9578,a178_0xb59fc0[_0x4ddf9b(0xc3)](_0xa35446,JSON[_0x4ddf9b(0xe0)](_0x108e68,null,0x2)+'\x0a',_0x4ddf9b(0xc1)),console['log'](_0x4ddf9b(0xa5)+_0x4b22a1),logger[_0x4ddf9b(0xc7)](_0x4ddf9b(0xca),_0x4ddf9b(0xc4));}catch(_0x255c6c){logger[_0x4ddf9b(0x83)](_0x4ddf9b(0xca),_0x4ddf9b(0x9a));throw _0x255c6c;}}async function configureAppCode(_0x379cd8,_0x445a9a,_0x51cf23,_0x10078e){const _0x116180=a178_0x4cd3,_0x4c9ee3=a178_0x15f60a[_0x116180(0xb8)](process[_0x116180(0x91)](),_0x379cd8),_0x5a79e5=a178_0x15f60a[_0x116180(0xba)](_0x4c9ee3,NEW_CONFIG_NAME);try{_0x51cf23?console[_0x116180(0xa6)](_0x116180(0xb7)+_0x445a9a+':\x20'+_0x51cf23):console[_0x116180(0xa6)](_0x116180(0xeb)+_0x445a9a);const _0x3e7151=getRabetbaseCliPackageRoot(),_0x542ccd=a178_0x15f60a[_0x116180(0xba)](_0x3e7151,'package.json');let _0x43b970=_0x116180(0xd0);try{const _0x5b3162=JSON[_0x116180(0xd9)](a178_0xb59fc0['readFileSync'](_0x542ccd,_0x116180(0xc1)));_0x43b970=_0x5b3162[_0x116180(0xdf)]||_0x116180(0xd0);}catch{}const {globalConfig:_0x5a5724}=loadRawConfigLayers(),_0xaf5f2d=typeof _0x5a5724['env']==='string'?_0x5a5724[_0x116180(0xaf)]:undefined,_0x3ff360={};for(const _0x315f24 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x5a5724[_0x315f24]!=null)_0x3ff360[_0x315f24]=_0x5a5724[_0x315f24];}const _0x35b9f1=buildCanonicalProjectConfig(_0x3ff360,{'appCodes':_0x51cf23?[_0x51cf23]:[],'env':_0x10078e||_0xaf5f2d||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x43b970}});writeConfigFile(_0x5a79e5,_0x35b9f1),await generateSdkConfigFile(a178_0x15f60a['join'](_0x4c9ee3,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x4c9ee3),_0x51cf23?console[_0x116180(0xa6)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x116180(0xb9)](_0x35b9f1[_0x116180(0x84)]||{})[_0x116180(0xba)](',\x20')+_0x116180(0xc0)):console['log'](_0x116180(0xc8)+CLI_BIN_NAME+_0x116180(0x89)),logger[_0x116180(0xc7)](_0x116180(0xca),_0x116180(0xc6)+_0x51cf23);}catch(_0x34c8e2){logger[_0x116180(0x83)]('create','Failed\x20to\x20configure\x20app\x20AppCode');throw _0x34c8e2;}}
@@ -1 +1 @@
1
- const a179_0x372b09=a179_0x47c9;(function(_0xe67ce0,_0x3316b7){const _0x154601=a179_0x47c9,_0x375403=_0xe67ce0();while(!![]){try{const _0x42ed7a=parseInt(_0x154601(0xa0))/0x1*(parseInt(_0x154601(0xce))/0x2)+parseInt(_0x154601(0xfe))/0x3*(parseInt(_0x154601(0xbc))/0x4)+parseInt(_0x154601(0xe0))/0x5+parseInt(_0x154601(0xf3))/0x6*(parseInt(_0x154601(0xba))/0x7)+-parseInt(_0x154601(0xe8))/0x8+-parseInt(_0x154601(0x104))/0x9*(parseInt(_0x154601(0xc8))/0xa)+parseInt(_0x154601(0x9e))/0xb;if(_0x42ed7a===_0x3316b7)break;else _0x375403['push'](_0x375403['shift']());}catch(_0x54f7f3){_0x375403['push'](_0x375403['shift']());}}}(a179_0xd1da,0x9d224));function a179_0xd1da(){const _0x594f61=['join','get','dev','concat','9dEOjpP','https:','node_modules','readdir','sep','.env','status','mkdtemp','.lovrabet.json','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','parse','9176002aIlgcn',',\x20received\x20','149551IzcNxA','downloading','local','href','version','toLowerCase','sha256:','Check\x20the\x20source\x20directory\x20and\x20retry.','test','mode','pathname','abort','hex','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','lstat','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','verifying','code','sub-app-react-demo','utf8','.env.','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','readFile','.lovrabet.log','length','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','100968dIiGOy','sha256','2236khDuZi','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','protocol','validation','copyFile','isFile','realpath','dirname','.idea','.rabetbase-create-','application/zip','12135650byXpsL','includes','from','rename','isDirectory','.env.example','2jjVTCc','startsWith','.DS_Store','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','template.zip','update','read','package.json','resolve','ino','message','origin','isFinite','headers','cdn','copying','signal','.rabetbase','4793235DlLSAP','access','resolving','name','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','isAbsolute','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','8567888ysfLuC','chmod','isSafeInteger','object','Unable\x20to\x20claim\x20the\x20project\x20directory.','trim','releaseLock','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','Invalid\x20local\x20template\x20source:\x20','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','168fBeBPY','mkdir','.git','body','.codegraph','basename','size','project','ENOENT','Project\x20directory\x20already\x20exists:\x20','isSymbolicLink','3123BhmTum','number'];a179_0xd1da=function(){return _0x594f61;};return a179_0xd1da();}import{createHash}from'node:crypto';import a179_0x24c6ba from'node:fs/promises';import a179_0x4830f4 from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a179_0x372b09(0xb2),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x757b70){const _0x2a8d65=a179_0x372b09;return typeof _0x757b70==='string'&&_0x757b70[_0x2a8d65(0xed)]()?_0x757b70['trim']():null;}function parseDescriptor(_0x495b6b){const _0x448e95=a179_0x372b09;if(!_0x495b6b||typeof _0x495b6b!=='object')throw new Error(_0x448e95(0xef)+TEMPLATE_ID+'\x22.');const _0xe4838a=_0x495b6b,_0x1e31ec=nonEmptyString(_0xe4838a['version']),_0x3a0097=nonEmptyString(_0xe4838a[_0x448e95(0xe3)]),_0x5bfabf=nonEmptyString(_0xe4838a[_0x448e95(0xbb)])?.[_0x448e95(0xa5)](),_0x5ef750=_0xe4838a['size'];if(!_0x1e31ec||!_0x3a0097||_0x3a0097!==a179_0x4830f4['posix'][_0x448e95(0xf8)](_0x3a0097)||_0x3a0097[_0x448e95(0xc9)]('\x5c')||!_0x5bfabf||!/^sha256:[a-f0-9]{64}$/[_0x448e95(0xa8)](_0x5bfabf)||typeof _0x5ef750!==_0x448e95(0xff)||!Number[_0x448e95(0xea)](_0x5ef750)||_0x5ef750<=0x0||_0x5ef750>MAX_ARCHIVE_SIZE)throw new Error(_0x448e95(0xe6)+TEMPLATE_ID+'\x22.');return{'version':_0x1e31ec,'name':_0x3a0097,'sha256':_0x5bfabf,'size':_0x5ef750};}async function fetchWithTimeout(_0x595e4,_0xb6ca8a,_0x2b32e6,_0x2f31ac){const _0x155461=a179_0x372b09,_0x2cf40a=new AbortController(),_0x1b8f4b=setTimeout(()=>_0x2cf40a[_0x155461(0xab)](),_0xb6ca8a);try{const _0x4c24ea=await fetch(_0x595e4,{'headers':{'Accept':_0x2b32e6},'signal':_0x2cf40a[_0x155461(0xde)]});return await _0x2f31ac(_0x4c24ea);}finally{clearTimeout(_0x1b8f4b);}}async function fetchTemplateDescriptor(){const _0x36f12f=await getRabetbaseCdnConfig();if(!_0x36f12f)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');return parseDescriptor(_0x36f12f['projectTemplate']);}function resolveArchiveUrl(_0x2d1b24){const _0x5f51e0=a179_0x372b09,_0x3ce7e2=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x55e0e4=new URL(_0x2d1b24,_0x3ce7e2);if(_0x55e0e4[_0x5f51e0(0xbf)]!==_0x5f51e0(0x105)||_0x55e0e4[_0x5f51e0(0xd9)]!==_0x3ce7e2[_0x5f51e0(0xd9)]||!_0x55e0e4[_0x5f51e0(0xaa)]['startsWith'](_0x3ce7e2[_0x5f51e0(0xaa)]))throw new Error(_0x5f51e0(0xe7));return _0x55e0e4[_0x5f51e0(0xa3)];}async function readResponseBytes(_0x101225,_0xb35243){const _0x2cf3e4=a179_0x372b09;if(!_0x101225[_0x2cf3e4(0xf6)]){const _0x246c88=Buffer['from'](await _0x101225['arrayBuffer']());if(_0x246c88[_0x2cf3e4(0xb8)]>_0xb35243)throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');return _0x246c88;}const _0x1ec447=_0x101225[_0x2cf3e4(0xf6)]['getReader'](),_0x170aa0=[];let _0x3e6506=0x0;try{while(!![]){const {done:_0x51e2d7,value:_0x2d0054}=await _0x1ec447[_0x2cf3e4(0xd4)]();if(_0x51e2d7)break;_0x3e6506+=_0x2d0054['byteLength'];if(_0x3e6506>_0xb35243){await _0x1ec447['cancel']();throw new Error(_0x2cf3e4(0xbe));}_0x170aa0['push'](Buffer[_0x2cf3e4(0xca)](_0x2d0054));}}finally{_0x1ec447[_0x2cf3e4(0xee)]();}return Buffer[_0x2cf3e4(0x103)](_0x170aa0,_0x3e6506);}async function downloadArchive(_0x466e8c,_0x3d3ed1,_0x484225){const _0x294e63=a179_0x372b09,_0x12d309=await fetchWithTimeout(resolveArchiveUrl(_0x466e8c['name']),ARCHIVE_TIMEOUT_MS,_0x294e63(0xc7),async _0x2e0b92=>{const _0x317259=_0x294e63;if(!_0x2e0b92['ok'])throw new Error(_0x317259(0xbd)+_0x2e0b92[_0x317259(0x10a)]+'.');const _0x1ea6b8=Number(_0x2e0b92[_0x317259(0xdb)][_0x317259(0x101)]('content-length'));if(Number[_0x317259(0xda)](_0x1ea6b8)&&_0x1ea6b8>MAX_ARCHIVE_SIZE)throw new Error(_0x317259(0xd1));return readResponseBytes(_0x2e0b92,_0x466e8c[_0x317259(0xf9)]);});if(_0x12d309[_0x294e63(0xb8)]!==_0x466e8c[_0x294e63(0xf9)])throw new Error(_0x294e63(0xb9)+_0x466e8c[_0x294e63(0xf9)]+_0x294e63(0x9f)+_0x12d309[_0x294e63(0xb8)]+'.');_0x484225?.(_0x294e63(0xb0));const _0x3df3cc=_0x294e63(0xa6)+createHash('sha256')[_0x294e63(0xd3)](_0x12d309)['digest'](_0x294e63(0xac));if(_0x3df3cc!==_0x466e8c['sha256'])throw new Error(_0x294e63(0xe4));await a179_0x24c6ba['writeFile'](_0x3d3ed1,_0x12d309,{'flag':'wx'});}async function assertTemplateRoot(_0x4a168d){const _0x443e01=a179_0x372b09,_0x553204=a179_0x4830f4['join'](_0x4a168d,_0x443e01(0xd5)),_0x38def1=JSON[_0x443e01(0x10e)](await a179_0x24c6ba[_0x443e01(0xb6)](_0x553204,_0x443e01(0xb3)));if(!_0x38def1||typeof _0x38def1!==_0x443e01(0xeb))throw new Error('Project\x20template\x20package.json\x20is\x20invalid.');}const LOCAL_FORBIDDEN_NAMES=new Set([a179_0x372b09(0xd0),a179_0x372b09(0xf7),a179_0x372b09(0xf5),a179_0x372b09(0xc5),a179_0x372b09(0x10c),a179_0x372b09(0xb7),a179_0x372b09(0xdf),'.rabetbase.json','dist',a179_0x372b09(0x106)]);function isForbiddenTemplateEntry(_0x292d77){const _0xf3362f=a179_0x372b09;if(LOCAL_FORBIDDEN_NAMES['has'](_0x292d77))return!![];return _0x292d77===_0xf3362f(0x109)||_0x292d77[_0xf3362f(0xcf)](_0xf3362f(0xb4))&&_0x292d77!==_0xf3362f(0xcd);}function containsPath(_0x5503f7,_0xaade38){const _0x19e346=a179_0x372b09,_0x28247c=a179_0x4830f4['relative'](_0x5503f7,_0xaade38);return _0x28247c===''||!_0x28247c[_0x19e346(0xcf)]('..'+a179_0x4830f4[_0x19e346(0x108)])&&_0x28247c!=='..'&&!a179_0x4830f4[_0x19e346(0xe5)](_0x28247c);}async function copyLocalTemplateDirectory(_0x46a831,_0x28cd7a){const _0x19896f=a179_0x372b09;await a179_0x24c6ba[_0x19896f(0xf4)](_0x28cd7a,{'recursive':!![]});for(const _0x5f32ba of await a179_0x24c6ba[_0x19896f(0x107)](_0x46a831,{'withFileTypes':!![]})){const _0x1cad96=a179_0x4830f4['join'](_0x46a831,_0x5f32ba[_0x19896f(0xe3)]),_0x13e51a=a179_0x4830f4[_0x19896f(0x100)](_0x28cd7a,_0x5f32ba[_0x19896f(0xe3)]);if(isForbiddenTemplateEntry(_0x5f32ba['name']))throw new Error(_0x19896f(0xaf)+_0x1cad96);const _0x31f554=await a179_0x24c6ba[_0x19896f(0xae)](_0x1cad96);if(_0x31f554[_0x19896f(0xfd)]())throw new Error('Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20'+_0x1cad96);if(_0x31f554[_0x19896f(0xcc)]()){await copyLocalTemplateDirectory(_0x1cad96,_0x13e51a);continue;}if(!_0x31f554[_0x19896f(0xc2)]())continue;await a179_0x24c6ba[_0x19896f(0xc1)](_0x1cad96,_0x13e51a),await a179_0x24c6ba[_0x19896f(0xe9)](_0x13e51a,_0x31f554[_0x19896f(0xa9)]&0x1ff);}}async function readTemplateVersion(_0x1d6488){const _0x1f12e8=a179_0x372b09,_0xcc738e=JSON[_0x1f12e8(0x10e)](await a179_0x24c6ba[_0x1f12e8(0xb6)](a179_0x4830f4[_0x1f12e8(0x100)](_0x1d6488,_0x1f12e8(0xd5)),_0x1f12e8(0xb3)));return nonEmptyString(_0xcc738e[_0x1f12e8(0xa4)])||_0x1f12e8(0xa2);}async function readDirectoryIdentity(_0x5c9a9a){const _0x453e13=a179_0x372b09;try{const _0x165bf3=await a179_0x24c6ba['lstat'](_0x5c9a9a);if(!_0x165bf3[_0x453e13(0xcc)]())return null;return{'dev':_0x165bf3[_0x453e13(0x102)],'ino':_0x165bf3['ino']};}catch{return null;}}function a179_0x47c9(_0x1c108a,_0x1ce7a9){_0x1c108a=_0x1c108a-0x9e;const _0xd1da0e=a179_0xd1da();let _0x47c9f3=_0xd1da0e[_0x1c108a];return _0x47c9f3;}async function commitStagedProject(_0x452c1a,_0x58d9d2){const _0x3d7415=a179_0x372b09;await a179_0x24c6ba[_0x3d7415(0xf4)](_0x58d9d2);const _0x128d84=await readDirectoryIdentity(_0x58d9d2);if(!_0x128d84)throw new Error(_0x3d7415(0xec));try{for(const _0x4b47b3 of await a179_0x24c6ba[_0x3d7415(0x107)](_0x452c1a)){await a179_0x24c6ba[_0x3d7415(0xcb)](a179_0x4830f4[_0x3d7415(0x100)](_0x452c1a,_0x4b47b3),a179_0x4830f4[_0x3d7415(0x100)](_0x58d9d2,_0x4b47b3));}}catch(_0x568b87){const _0x18b302=await readDirectoryIdentity(_0x58d9d2);_0x18b302?.[_0x3d7415(0x102)]===_0x128d84[_0x3d7415(0x102)]&&_0x18b302[_0x3d7415(0xd7)]===_0x128d84[_0x3d7415(0xd7)]&&await a179_0x24c6ba['rm'](_0x58d9d2,{'recursive':!![],'force':!![]});throw _0x568b87;}}export async function materializeProjectTemplate(_0x37e00a,_0x3e5b57){const _0x3599f1=a179_0x372b09,_0x2897d1=a179_0x4830f4[_0x3599f1(0xd6)](_0x37e00a),_0x5c89bd=a179_0x4830f4[_0x3599f1(0xc4)](_0x2897d1);try{await a179_0x24c6ba[_0x3599f1(0xae)](_0x2897d1);throw new Error(_0x3599f1(0xfc)+_0x2897d1);}catch(_0x227804){if(_0x227804['code']!==_0x3599f1(0xfb))throw _0x227804;}const _0x465ab3=await a179_0x24c6ba[_0x3599f1(0x10b)](a179_0x4830f4[_0x3599f1(0x100)](_0x5c89bd,_0x3599f1(0xc6))),_0x121c3e=a179_0x4830f4[_0x3599f1(0x100)](_0x465ab3,'project'),_0x2fa199=a179_0x4830f4[_0x3599f1(0x100)](_0x465ab3,_0x3599f1(0xd2));try{try{_0x3e5b57?.(_0x3599f1(0xe2));const _0x192ef9=await fetchTemplateDescriptor();return _0x3e5b57?.(_0x3599f1(0xa1)),await downloadArchive(_0x192ef9,_0x2fa199,_0x3e5b57),_0x3e5b57?.('extracting'),await extractProjectTemplateArchive(_0x2fa199,_0x121c3e),await assertTemplateRoot(_0x121c3e),await commitStagedProject(_0x121c3e,_0x2897d1),{'source':_0x3599f1(0xdc),'version':_0x192ef9['version']};}catch(_0x439daf){if(_0x439daf[_0x3599f1(0xb1)]==='EEXIST')throw CliErrors['validation']('Project\x20directory\x20already\x20exists:\x20'+_0x2897d1,'Use\x20a\x20different\x20project\x20name.');const _0x2303a0=_0x439daf instanceof Error?_0x439daf[_0x3599f1(0xd8)]:String(_0x439daf);throw CliErrors[_0x3599f1(0xc0)](_0x3599f1(0xf2),'Check\x20your\x20network\x20and\x20retry.\x20Details:\x20'+_0x2303a0);}}finally{await a179_0x24c6ba['rm'](_0x465ab3,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x24a8b7,_0x555022,_0x50eedf){const _0x27ea58=a179_0x372b09;let _0x187e7a;try{_0x187e7a=await a179_0x24c6ba[_0x27ea58(0xc3)](a179_0x4830f4[_0x27ea58(0xd6)](_0x24a8b7));}catch{throw CliErrors['validation']('Local\x20template\x20source\x20does\x20not\x20exist:\x20'+a179_0x4830f4['resolve'](_0x24a8b7),_0x27ea58(0xf1));}const _0x15851e=await a179_0x24c6ba['lstat'](_0x187e7a);if(!_0x15851e[_0x27ea58(0xcc)]())throw CliErrors['validation'](_0x27ea58(0x10d)+_0x187e7a);const _0x38a21e=a179_0x4830f4[_0x27ea58(0xd6)](_0x555022),_0x5d9d87=await a179_0x24c6ba[_0x27ea58(0xc3)](a179_0x4830f4['dirname'](_0x38a21e)),_0x2e2f9f=a179_0x4830f4[_0x27ea58(0x100)](_0x5d9d87,a179_0x4830f4['basename'](_0x38a21e));if(containsPath(_0x187e7a,_0x2e2f9f)||containsPath(_0x2e2f9f,_0x187e7a))throw CliErrors[_0x27ea58(0xc0)](_0x27ea58(0xb5),'Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.');try{await a179_0x24c6ba[_0x27ea58(0xae)](_0x2e2f9f);throw CliErrors[_0x27ea58(0xc0)]('Project\x20directory\x20already\x20exists:\x20'+_0x2e2f9f,_0x27ea58(0xad));}catch(_0x118a10){if(_0x118a10[_0x27ea58(0xb1)]!==_0x27ea58(0xfb))throw _0x118a10;}const _0xf03f8b=a179_0x4830f4[_0x27ea58(0xc4)](_0x2e2f9f);await a179_0x24c6ba[_0x27ea58(0xe1)](_0xf03f8b);const _0x1c88d3=await a179_0x24c6ba[_0x27ea58(0x10b)](a179_0x4830f4[_0x27ea58(0x100)](_0xf03f8b,_0x27ea58(0xc6))),_0x20c286=a179_0x4830f4['join'](_0x1c88d3,_0x27ea58(0xfa));try{_0x50eedf?.(_0x27ea58(0xdd)),await copyLocalTemplateDirectory(_0x187e7a,_0x20c286),await assertTemplateRoot(_0x20c286);const _0x1d0914=await readTemplateVersion(_0x20c286);return await commitStagedProject(_0x20c286,_0x2e2f9f),{'source':_0x27ea58(0xa2),'version':_0x1d0914};}catch(_0x299ec9){const _0xb9686=_0x299ec9 instanceof Error?_0x299ec9[_0x27ea58(0xd8)]:String(_0x299ec9);throw CliErrors[_0x27ea58(0xc0)](_0x27ea58(0xf0)+_0xb9686,_0x27ea58(0xa7));}finally{await a179_0x24c6ba['rm'](_0x1c88d3,{'recursive':!![],'force':!![]});}}
1
+ const a179_0xf8bc57=a179_0x48ee;(function(_0x4b87d2,_0x5d7111){const _0x4f4433=a179_0x48ee,_0x166dde=_0x4b87d2();while(!![]){try{const _0xee4f6a=-parseInt(_0x4f4433(0x70))/0x1+-parseInt(_0x4f4433(0xc5))/0x2+parseInt(_0x4f4433(0x6e))/0x3+parseInt(_0x4f4433(0x8e))/0x4+-parseInt(_0x4f4433(0x6f))/0x5*(-parseInt(_0x4f4433(0xd8))/0x6)+-parseInt(_0x4f4433(0xb2))/0x7*(parseInt(_0x4f4433(0x7e))/0x8)+-parseInt(_0x4f4433(0xb1))/0x9;if(_0xee4f6a===_0x5d7111)break;else _0x166dde['push'](_0x166dde['shift']());}catch(_0x186479){_0x166dde['push'](_0x166dde['shift']());}}}(a179_0x295e,0xda40f));import{createHash}from'node:crypto';import a179_0x51bbd7 from'node:fs/promises';import a179_0x2a0727 from'node:path';function a179_0x48ee(_0x2c1cde,_0x90f2){_0x2c1cde=_0x2c1cde-0x6d;const _0x295e2c=a179_0x295e();let _0x48eeb6=_0x295e2c[_0x2c1cde];return _0x48eeb6;}import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';function a179_0x295e(){const _0x3c6c10=['CDN\x20project\x20template\x20checksum\x20verification\x20failed.','.idea','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','local','chmod','.env','content-length','Use\x20a\x20different\x20project\x20name.','8CwgDls','read','abort','ENOENT','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','isFinite','readFile','Unable\x20to\x20claim\x20the\x20project\x20directory.','resolve','name','Invalid\x20local\x20template\x20source:\x20','dirname','writeFile','.env.example','.rabetbase-create-','copying','5885692KDRZAX','byteLength','mkdir','href','update','ino','dist','.codegraph','dev','digest','verifying','realpath','version','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','.git','lstat','.env.','sub-app-react-demo','.rabetbase','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','Project\x20template\x20package.json\x20is\x20invalid.','template.zip','basename','copyFile','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','mode','Project\x20directory\x20already\x20exists:\x20','Local\x20template\x20source\x20does\x20not\x20exist:\x20','readdir','message','length','body','includes','object','relative','6782256mOviIl','1057434GnVLXp','node_modules','has','protocol','cdn','status','test','Check\x20the\x20source\x20directory\x20and\x20retry.','origin','package.json','.DS_Store','.lovrabet.json','toLowerCase','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','utf8','getReader','pathname','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','994788XYQQoo','mkdtemp','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','startsWith','https:','cancel','isSafeInteger','sha256','extracting','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','releaseLock','trim','application/zip','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','from','parse','concat','arrayBuffer','2294862hiTswj','isFile','code','EEXIST','number','isDirectory','753039egiAmf','15labloB','573860xyBMUW','join','size','project','validation','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.'];a179_0x295e=function(){return _0x3c6c10;};return a179_0x295e();}import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID=a179_0xf8bc57(0x9f),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x451c09){const _0x40decd=a179_0xf8bc57;return typeof _0x451c09==='string'&&_0x451c09[_0x40decd(0xd0)]()?_0x451c09[_0x40decd(0xd0)]():null;}function parseDescriptor(_0x3952f0){const _0x5cbaef=a179_0xf8bc57;if(!_0x3952f0||typeof _0x3952f0!==_0x5cbaef(0xaf))throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x2411e4=_0x3952f0,_0x1aa15e=nonEmptyString(_0x2411e4[_0x5cbaef(0x9a)]),_0x22744b=nonEmptyString(_0x2411e4[_0x5cbaef(0x87)]),_0x42f7d7=nonEmptyString(_0x2411e4[_0x5cbaef(0xcc)])?.[_0x5cbaef(0xbe)](),_0x11ef1e=_0x2411e4[_0x5cbaef(0x72)];if(!_0x1aa15e||!_0x22744b||_0x22744b!==a179_0x2a0727['posix']['basename'](_0x22744b)||_0x22744b[_0x5cbaef(0xae)]('\x5c')||!_0x42f7d7||!/^sha256:[a-f0-9]{64}$/[_0x5cbaef(0xb8)](_0x42f7d7)||typeof _0x11ef1e!==_0x5cbaef(0xdc)||!Number[_0x5cbaef(0xcb)](_0x11ef1e)||_0x11ef1e<=0x0||_0x11ef1e>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x1aa15e,'name':_0x22744b,'sha256':_0x42f7d7,'size':_0x11ef1e};}async function fetchWithTimeout(_0x70fbe6,_0xecbaa5,_0x6bfa16,_0x130802){const _0x10136a=a179_0xf8bc57,_0xefe24a=new AbortController(),_0x2e043e=setTimeout(()=>_0xefe24a[_0x10136a(0x80)](),_0xecbaa5);try{const _0x5d0149=await fetch(_0x70fbe6,{'headers':{'Accept':_0x6bfa16},'signal':_0xefe24a['signal']});return await _0x130802(_0x5d0149);}finally{clearTimeout(_0x2e043e);}}async function fetchTemplateDescriptor(){const _0x5f4e4a=a179_0xf8bc57,_0xeb7aae=await getRabetbaseCdnConfig();if(!_0xeb7aae)throw new Error(_0x5f4e4a(0xc4));return parseDescriptor(_0xeb7aae['projectTemplate']);}function resolveArchiveUrl(_0x483091){const _0x5ea7d2=a179_0xf8bc57,_0x3af6eb=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1c627=new URL(_0x483091,_0x3af6eb);if(_0x1c627[_0x5ea7d2(0xb5)]!==_0x5ea7d2(0xc9)||_0x1c627[_0x5ea7d2(0xba)]!==_0x3af6eb['origin']||!_0x1c627[_0x5ea7d2(0xc3)]['startsWith'](_0x3af6eb[_0x5ea7d2(0xc3)]))throw new Error(_0x5ea7d2(0x78));return _0x1c627[_0x5ea7d2(0x91)];}async function readResponseBytes(_0x589232,_0x39f762){const _0x122eb8=a179_0xf8bc57;if(!_0x589232[_0x122eb8(0xad)]){const _0x4b95f9=Buffer['from'](await _0x589232[_0x122eb8(0xd7)]());if(_0x4b95f9[_0x122eb8(0xac)]>_0x39f762)throw new Error(_0x122eb8(0x82));return _0x4b95f9;}const _0x3f3002=_0x589232[_0x122eb8(0xad)][_0x122eb8(0xc2)](),_0x2fbd12=[];let _0x532471=0x0;try{while(!![]){const {done:_0x4dff9c,value:_0x942d6f}=await _0x3f3002[_0x122eb8(0x7f)]();if(_0x4dff9c)break;_0x532471+=_0x942d6f[_0x122eb8(0x8f)];if(_0x532471>_0x39f762){await _0x3f3002[_0x122eb8(0xca)]();throw new Error(_0x122eb8(0x82));}_0x2fbd12['push'](Buffer[_0x122eb8(0xd4)](_0x942d6f));}}finally{_0x3f3002[_0x122eb8(0xcf)]();}return Buffer[_0x122eb8(0xd6)](_0x2fbd12,_0x532471);}async function downloadArchive(_0x31108d,_0x4740ef,_0x51ef7f){const _0x51fb99=a179_0xf8bc57,_0x376b09=await fetchWithTimeout(resolveArchiveUrl(_0x31108d[_0x51fb99(0x87)]),ARCHIVE_TIMEOUT_MS,_0x51fb99(0xd1),async _0x58c472=>{const _0x3bd761=_0x51fb99;if(!_0x58c472['ok'])throw new Error(_0x3bd761(0xbf)+_0x58c472[_0x3bd761(0xb7)]+'.');const _0x24295a=Number(_0x58c472['headers']['get'](_0x3bd761(0x7c)));if(Number[_0x3bd761(0x83)](_0x24295a)&&_0x24295a>MAX_ARCHIVE_SIZE)throw new Error(_0x3bd761(0xd2));return readResponseBytes(_0x58c472,_0x31108d[_0x3bd761(0x72)]);});if(_0x376b09['length']!==_0x31108d[_0x51fb99(0x72)])throw new Error(_0x51fb99(0xc0)+_0x31108d[_0x51fb99(0x72)]+',\x20received\x20'+_0x376b09['length']+'.');_0x51ef7f?.(_0x51fb99(0x98));const _0x5a1bff='sha256:'+createHash(_0x51fb99(0xcc))[_0x51fb99(0x92)](_0x376b09)[_0x51fb99(0x97)]('hex');if(_0x5a1bff!==_0x31108d[_0x51fb99(0xcc)])throw new Error(_0x51fb99(0x76));await a179_0x51bbd7[_0x51fb99(0x8a)](_0x4740ef,_0x376b09,{'flag':'wx'});}async function assertTemplateRoot(_0x907b26){const _0x2d63e7=a179_0xf8bc57,_0x495266=a179_0x2a0727[_0x2d63e7(0x71)](_0x907b26,'package.json'),_0x56cf1a=JSON[_0x2d63e7(0xd5)](await a179_0x51bbd7['readFile'](_0x495266,_0x2d63e7(0xc1)));if(!_0x56cf1a||typeof _0x56cf1a!=='object')throw new Error(_0x2d63e7(0xa2));}const LOCAL_FORBIDDEN_NAMES=new Set([a179_0xf8bc57(0xbc),a179_0xf8bc57(0x95),a179_0xf8bc57(0x9c),a179_0xf8bc57(0x77),a179_0xf8bc57(0xbd),'.lovrabet.log',a179_0xf8bc57(0xa0),'.rabetbase.json',a179_0xf8bc57(0x94),a179_0xf8bc57(0xb3)]);function isForbiddenTemplateEntry(_0x34aebb){const _0x141c04=a179_0xf8bc57;if(LOCAL_FORBIDDEN_NAMES[_0x141c04(0xb4)](_0x34aebb))return!![];return _0x34aebb===_0x141c04(0x7b)||_0x34aebb[_0x141c04(0xc8)](_0x141c04(0x9e))&&_0x34aebb!==_0x141c04(0x8b);}function containsPath(_0x3bbfbf,_0x3f0024){const _0x1ec798=a179_0xf8bc57,_0x26dfda=a179_0x2a0727[_0x1ec798(0xb0)](_0x3bbfbf,_0x3f0024);return _0x26dfda===''||!_0x26dfda[_0x1ec798(0xc8)]('..'+a179_0x2a0727['sep'])&&_0x26dfda!=='..'&&!a179_0x2a0727['isAbsolute'](_0x26dfda);}async function copyLocalTemplateDirectory(_0x23c6c6,_0x2f5325){const _0x51a7e1=a179_0xf8bc57;await a179_0x51bbd7[_0x51a7e1(0x90)](_0x2f5325,{'recursive':!![]});for(const _0x33351d of await a179_0x51bbd7[_0x51a7e1(0xaa)](_0x23c6c6,{'withFileTypes':!![]})){const _0x324343=a179_0x2a0727[_0x51a7e1(0x71)](_0x23c6c6,_0x33351d[_0x51a7e1(0x87)]),_0x232e26=a179_0x2a0727[_0x51a7e1(0x71)](_0x2f5325,_0x33351d[_0x51a7e1(0x87)]);if(isForbiddenTemplateEntry(_0x33351d['name']))throw new Error(_0x51a7e1(0xce)+_0x324343);const _0x549b23=await a179_0x51bbd7['lstat'](_0x324343);if(_0x549b23['isSymbolicLink']())throw new Error('Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20'+_0x324343);if(_0x549b23[_0x51a7e1(0x6d)]()){await copyLocalTemplateDirectory(_0x324343,_0x232e26);continue;}if(!_0x549b23[_0x51a7e1(0xd9)]())continue;await a179_0x51bbd7[_0x51a7e1(0xa5)](_0x324343,_0x232e26),await a179_0x51bbd7[_0x51a7e1(0x7a)](_0x232e26,_0x549b23[_0x51a7e1(0xa7)]&0x1ff);}}async function readTemplateVersion(_0x86e75a){const _0x37080a=a179_0xf8bc57,_0x1ae13e=JSON[_0x37080a(0xd5)](await a179_0x51bbd7[_0x37080a(0x84)](a179_0x2a0727['join'](_0x86e75a,_0x37080a(0xbb)),_0x37080a(0xc1)));return nonEmptyString(_0x1ae13e[_0x37080a(0x9a)])||_0x37080a(0x79);}async function readDirectoryIdentity(_0x1b0c55){const _0x4f739d=a179_0xf8bc57;try{const _0x355007=await a179_0x51bbd7[_0x4f739d(0x9d)](_0x1b0c55);if(!_0x355007[_0x4f739d(0x6d)]())return null;return{'dev':_0x355007[_0x4f739d(0x96)],'ino':_0x355007[_0x4f739d(0x93)]};}catch{return null;}}async function commitStagedProject(_0x51dd9f,_0x589de1){const _0x12cf62=a179_0xf8bc57;await a179_0x51bbd7[_0x12cf62(0x90)](_0x589de1);const _0x21d8b5=await readDirectoryIdentity(_0x589de1);if(!_0x21d8b5)throw new Error(_0x12cf62(0x85));try{for(const _0x283fbd of await a179_0x51bbd7['readdir'](_0x51dd9f)){await a179_0x51bbd7['rename'](a179_0x2a0727[_0x12cf62(0x71)](_0x51dd9f,_0x283fbd),a179_0x2a0727[_0x12cf62(0x71)](_0x589de1,_0x283fbd));}}catch(_0x182c6a){const _0x2eea43=await readDirectoryIdentity(_0x589de1);_0x2eea43?.['dev']===_0x21d8b5[_0x12cf62(0x96)]&&_0x2eea43[_0x12cf62(0x93)]===_0x21d8b5[_0x12cf62(0x93)]&&await a179_0x51bbd7['rm'](_0x589de1,{'recursive':!![],'force':!![]});throw _0x182c6a;}}export async function materializeProjectTemplate(_0x1e32c7,_0x4034aa){const _0x4bd096=a179_0xf8bc57,_0x34f4d3=a179_0x2a0727[_0x4bd096(0x86)](_0x1e32c7),_0x5480b0=a179_0x2a0727['dirname'](_0x34f4d3);try{await a179_0x51bbd7[_0x4bd096(0x9d)](_0x34f4d3);throw new Error(_0x4bd096(0xa8)+_0x34f4d3);}catch(_0x3b9c28){if(_0x3b9c28['code']!==_0x4bd096(0x81))throw _0x3b9c28;}const _0x4c021a=await a179_0x51bbd7['mkdtemp'](a179_0x2a0727['join'](_0x5480b0,_0x4bd096(0x8c))),_0x34779e=a179_0x2a0727[_0x4bd096(0x71)](_0x4c021a,_0x4bd096(0x73)),_0x1dadf9=a179_0x2a0727[_0x4bd096(0x71)](_0x4c021a,_0x4bd096(0xa3));try{try{_0x4034aa?.('resolving');const _0x20e929=await fetchTemplateDescriptor();return _0x4034aa?.('downloading'),await downloadArchive(_0x20e929,_0x1dadf9,_0x4034aa),_0x4034aa?.(_0x4bd096(0xcd)),await extractProjectTemplateArchive(_0x1dadf9,_0x34779e),await assertTemplateRoot(_0x34779e),await commitStagedProject(_0x34779e,_0x34f4d3),{'source':_0x4bd096(0xb6),'version':_0x20e929[_0x4bd096(0x9a)]};}catch(_0x186a07){if(_0x186a07[_0x4bd096(0xda)]===_0x4bd096(0xdb))throw CliErrors[_0x4bd096(0x74)](_0x4bd096(0xa8)+_0x34f4d3,_0x4bd096(0x7d));const _0x1e33d4=_0x186a07 instanceof Error?_0x186a07[_0x4bd096(0xab)]:String(_0x186a07);throw CliErrors[_0x4bd096(0x74)](_0x4bd096(0x75),_0x4bd096(0x9b)+_0x1e33d4);}}finally{await a179_0x51bbd7['rm'](_0x4c021a,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x1bc79,_0x25e464,_0x13f218){const _0x433454=a179_0xf8bc57;let _0x4e9d36;try{_0x4e9d36=await a179_0x51bbd7[_0x433454(0x99)](a179_0x2a0727[_0x433454(0x86)](_0x1bc79));}catch{throw CliErrors['validation'](_0x433454(0xa9)+a179_0x2a0727[_0x433454(0x86)](_0x1bc79),_0x433454(0xa1));}const _0x216f0b=await a179_0x51bbd7['lstat'](_0x4e9d36);if(!_0x216f0b[_0x433454(0x6d)]())throw CliErrors['validation'](_0x433454(0xa6)+_0x4e9d36);const _0x573e57=a179_0x2a0727['resolve'](_0x25e464),_0x16685d=await a179_0x51bbd7[_0x433454(0x99)](a179_0x2a0727[_0x433454(0x89)](_0x573e57)),_0x541c52=a179_0x2a0727[_0x433454(0x71)](_0x16685d,a179_0x2a0727[_0x433454(0xa4)](_0x573e57));if(containsPath(_0x4e9d36,_0x541c52)||containsPath(_0x541c52,_0x4e9d36))throw CliErrors[_0x433454(0x74)]('Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.',_0x433454(0xc7));try{await a179_0x51bbd7[_0x433454(0x9d)](_0x541c52);throw CliErrors['validation'](_0x433454(0xa8)+_0x541c52,_0x433454(0xd3));}catch(_0x46566f){if(_0x46566f[_0x433454(0xda)]!==_0x433454(0x81))throw _0x46566f;}const _0x319910=a179_0x2a0727[_0x433454(0x89)](_0x541c52);await a179_0x51bbd7['access'](_0x319910);const _0x58e735=await a179_0x51bbd7[_0x433454(0xc6)](a179_0x2a0727[_0x433454(0x71)](_0x319910,_0x433454(0x8c))),_0x4684fc=a179_0x2a0727['join'](_0x58e735,'project');try{_0x13f218?.(_0x433454(0x8d)),await copyLocalTemplateDirectory(_0x4e9d36,_0x4684fc),await assertTemplateRoot(_0x4684fc);const _0x2faa63=await readTemplateVersion(_0x4684fc);return await commitStagedProject(_0x4684fc,_0x541c52),{'source':'local','version':_0x2faa63};}catch(_0x4943b5){const _0x106d04=_0x4943b5 instanceof Error?_0x4943b5[_0x433454(0xab)]:String(_0x4943b5);throw CliErrors['validation'](_0x433454(0x88)+_0x106d04,_0x433454(0xb9));}finally{await a179_0x51bbd7['rm'](_0x58e735,{'recursive':!![],'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x1978ec,_0xd2469f){const _0x536894=a180_0x29b4,_0x497558=_0x1978ec();while(!![]){try{const _0x32536b=-parseInt(_0x536894(0xd9))/0x1*(-parseInt(_0x536894(0xda))/0x2)+-parseInt(_0x536894(0xe1))/0x3+parseInt(_0x536894(0xdd))/0x4+parseInt(_0x536894(0xd5))/0x5+parseInt(_0x536894(0xd8))/0x6+-parseInt(_0x536894(0xe2))/0x7+-parseInt(_0x536894(0xdc))/0x8;if(_0x32536b===_0xd2469f)break;else _0x497558['push'](_0x497558['shift']());}catch(_0x2a6374){_0x497558['push'](_0x497558['shift']());}}}(a180_0x40a9,0x351ff));import{CliErrors}from'../../../errors.js';function a180_0x40a9(){const _0x51d4c9=['1070670EdiCVo','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','trim','1010238LommCB','114667pOeAGY','4AuVcFJ','validation','4690656kKdBHj','1584488lfdTus','Project\x20name\x20cannot\x20exceed\x20','Project\x20name\x20\x22','\x20characters','438171wzelfj','405825eGFVhH','Project\x20name\x20cannot\x20be\x20empty','\x22\x20is\x20reserved\x20on\x20Windows','length','test','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_'];a180_0x40a9=function(){return _0x51d4c9;};return a180_0x40a9();}function a180_0x29b4(_0x2693f8,_0x29e0fd){_0x2693f8=_0x2693f8-0xd2;const _0x40a9bd=a180_0x40a9();let _0x29b48c=_0x40a9bd[_0x2693f8];return _0x29b48c;}const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0x544e8a){const _0x547821=a180_0x29b4,_0x1fe9a9=_0x544e8a[_0x547821(0xd7)]();if(!_0x1fe9a9)return _0x547821(0xe3);if(_0x1fe9a9[_0x547821(0xd2)]>MAX_PROJECT_NAME_LENGTH)return _0x547821(0xde)+MAX_PROJECT_NAME_LENGTH+_0x547821(0xe0);if(!PROJECT_NAME_PATTERN[_0x547821(0xd3)](_0x1fe9a9))return _0x547821(0xd4);if(WINDOWS_RESERVED_NAME['test'](_0x1fe9a9))return _0x547821(0xdf)+_0x1fe9a9+_0x547821(0xe4);return null;}export function validateProjectName(_0x1eeada){const _0xfed070=a180_0x29b4,_0x22cba5=_0x1eeada[_0xfed070(0xd7)](),_0x48aa46=getProjectNameValidationError(_0x22cba5);if(_0x48aa46)throw CliErrors[_0xfed070(0xdb)](_0x48aa46,_0xfed070(0xd6));return _0x22cba5;}
1
+ (function(_0x2e2114,_0x5954ca){const _0x7efed3=a180_0x6992,_0x624f60=_0x2e2114();while(!![]){try{const _0xc8b731=parseInt(_0x7efed3(0x1d9))/0x1+parseInt(_0x7efed3(0x1d5))/0x2*(parseInt(_0x7efed3(0x1c7))/0x3)+parseInt(_0x7efed3(0x1cc))/0x4+parseInt(_0x7efed3(0x1ce))/0x5+-parseInt(_0x7efed3(0x1d2))/0x6+parseInt(_0x7efed3(0x1d1))/0x7*(-parseInt(_0x7efed3(0x1cf))/0x8)+-parseInt(_0x7efed3(0x1d0))/0x9;if(_0xc8b731===_0x5954ca)break;else _0x624f60['push'](_0x624f60['shift']());}catch(_0x45d3ce){_0x624f60['push'](_0x624f60['shift']());}}}(a180_0x3449,0xeb681));import{CliErrors}from'../../../errors.js';const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0xdd0c67){const _0x25170e=a180_0x6992,_0xc01d27=_0xdd0c67[_0x25170e(0x1cd)]();if(!_0xc01d27)return _0x25170e(0x1d3);if(_0xc01d27[_0x25170e(0x1c9)]>MAX_PROJECT_NAME_LENGTH)return'Project\x20name\x20cannot\x20exceed\x20'+MAX_PROJECT_NAME_LENGTH+_0x25170e(0x1ca);if(!PROJECT_NAME_PATTERN[_0x25170e(0x1d4)](_0xc01d27))return _0x25170e(0x1d6);if(WINDOWS_RESERVED_NAME[_0x25170e(0x1d4)](_0xc01d27))return _0x25170e(0x1c8)+_0xc01d27+_0x25170e(0x1cb);return null;}function a180_0x3449(){const _0x5ded40=['Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','validation','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','818069ODBXNW','1240041vRQKlw','Project\x20name\x20\x22','length','\x20characters','\x22\x20is\x20reserved\x20on\x20Windows','2073680SzIxFN','trim','4135620bWDaMo','19016tmQFfE','6517314yjfvXP','1953AQOIAt','6312600ItWttd','Project\x20name\x20cannot\x20be\x20empty','test','6BKxlBf'];a180_0x3449=function(){return _0x5ded40;};return a180_0x3449();}function a180_0x6992(_0xd62195,_0x41b732){_0xd62195=_0xd62195-0x1c7;const _0x3449c8=a180_0x3449();let _0x699271=_0x3449c8[_0xd62195];return _0x699271;}export function validateProjectName(_0x2ad7f7){const _0xe3ad39=a180_0x6992,_0x1d4368=_0x2ad7f7[_0xe3ad39(0x1cd)](),_0x3ec944=getProjectNameValidationError(_0x1d4368);if(_0x3ec944)throw CliErrors[_0xe3ad39(0x1d7)](_0x3ec944,_0xe3ad39(0x1d8));return _0x1d4368;}
@@ -1 +1 @@
1
- (function(_0x1ee677,_0x1ff692){const _0x3fae1e=a181_0x1214,_0x38307e=_0x1ee677();while(!![]){try{const _0x2b57e4=parseInt(_0x3fae1e(0x10d))/0x1+-parseInt(_0x3fae1e(0x12c))/0x2*(-parseInt(_0x3fae1e(0x11c))/0x3)+-parseInt(_0x3fae1e(0x130))/0x4+parseInt(_0x3fae1e(0x129))/0x5*(-parseInt(_0x3fae1e(0x10b))/0x6)+-parseInt(_0x3fae1e(0x117))/0x7+parseInt(_0x3fae1e(0x132))/0x8*(-parseInt(_0x3fae1e(0x133))/0x9)+parseInt(_0x3fae1e(0x121))/0xa;if(_0x2b57e4===_0x1ff692)break;else _0x38307e['push'](_0x38307e['shift']());}catch(_0x3c3fb2){_0x38307e['push'](_0x38307e['shift']());}}}(a181_0x5d66,0x43f83));function a181_0x5d66(){const _0x5a5a67=['Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','Case-conflicting\x20ZIP\x20entry\x20path:\x20','readEntry','sep','error','Unable\x20to\x20read\x20ZIP\x20entry:\x20','12185zVXDPb','replace','fileName','228428DZADAF','startsWith','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','dirname','1992264RCEDSl','get','8NoOekU','2479239gmPnVC','\x20entries.','endsWith','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','1284pTtbFX','entry','145772xsgvpW','slice','open','catch','test','uncompressedSize','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','has','isEncrypted','659379JKtisd','once','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','add','toLocaleLowerCase','3bcQifn','openReadStream','join','resolve','en-US','14076690hlOUec','mkdir'];a181_0x5d66=function(){return _0x5a5a67;};return a181_0x5d66();}import{createWriteStream}from'node:fs';import a181_0x5b36de from'node:fs/promises';import a181_0x650c35 from'node:path';import{pipeline}from'node:stream/promises';import a181_0x52ae4f from'yauzl';const MAX_ENTRY_COUNT=0x7d0,MAX_UNCOMPRESSED_SIZE=0x32*0x400*0x400,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,WINDOWS_INVALID_CHAR=/[<>:"|?*\x00-\x1f]/;function openZip(_0x4ccaf3){return new Promise((_0x13e34c,_0x36cf23)=>{const _0xc7d969=a181_0x1214;a181_0x52ae4f[_0xc7d969(0x10f)](_0x4ccaf3,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x2639d3,_0x4aba86)=>{if(_0x2639d3||!_0x4aba86){_0x36cf23(_0x2639d3||new Error('Unable\x20to\x20open\x20project\x20template\x20archive.'));return;}_0x13e34c(_0x4aba86);});});}function openEntryStream(_0x2457f4,_0x5267db){return new Promise((_0x29fa5a,_0x40fb52)=>{const _0x410ce3=a181_0x1214;_0x2457f4[_0x410ce3(0x11d)](_0x5267db,(_0x135cfd,_0x3c6f15)=>{const _0x3a612d=_0x410ce3;if(_0x135cfd||!_0x3c6f15){_0x40fb52(_0x135cfd||new Error(_0x3a612d(0x128)+_0x5267db[_0x3a612d(0x12b)]));return;}_0x29fa5a(_0x3c6f15);});});}function validateEntryPath(_0x430334){const _0x3b2a14=a181_0x1214,_0x3fe09f=_0x430334[_0x3b2a14(0x12a)](/\\/g,'/'),_0x43cb5f=_0x3fe09f[_0x3b2a14(0x135)]('/'),_0x51c10d=_0x43cb5f?_0x3fe09f[_0x3b2a14(0x10e)](0x0,-0x1):_0x3fe09f;if(!_0x51c10d||_0x3fe09f[_0x3b2a14(0x12d)]('/')||/^[A-Za-z]:\//[_0x3b2a14(0x111)](_0x3fe09f))throw new Error(_0x3b2a14(0x10a)+_0x430334);const _0x59d9d1=_0x51c10d['split']('/');for(const _0x15eeda of _0x59d9d1){if(!_0x15eeda||_0x15eeda==='.'||_0x15eeda==='..'||_0x15eeda['endsWith']('.')||_0x15eeda['endsWith']('\x20')||WINDOWS_INVALID_CHAR[_0x3b2a14(0x111)](_0x15eeda)||WINDOWS_RESERVED_NAME[_0x3b2a14(0x111)](_0x15eeda))throw new Error(_0x3b2a14(0x12e)+_0x430334);}return{'relativePath':_0x59d9d1['join'](a181_0x650c35[_0x3b2a14(0x126)]),'directory':_0x43cb5f};}function isSymbolicLink(_0x2536ee){const _0x4bcb46=_0x2536ee['externalFileAttributes']>>>0x10&0xffff;return(_0x4bcb46&0xf000)===0xa000;}function a181_0x1214(_0x8bc417,_0x5d009e){_0x8bc417=_0x8bc417-0x10a;const _0x5d66d5=a181_0x5d66();let _0x12143c=_0x5d66d5[_0x8bc417];return _0x12143c;}export async function extractProjectTemplateArchive(_0x5d15c3,_0x33ef58){const _0x27ac67=a181_0x1214,_0x14a56b=await openZip(_0x5d15c3),_0x2ff944=a181_0x650c35[_0x27ac67(0x11f)](_0x33ef58),_0x2994bd=new Set(),_0x1f2cae=new Map();let _0x1d737a=0x0,_0x1a56ca=0x0;await a181_0x5b36de['mkdir'](_0x2ff944,{'recursive':!![]}),await new Promise((_0xf4ccd9,_0x55dcc2)=>{const _0x134928=_0x27ac67;let _0x33ffd9=![];const _0x4089af=_0x51a927=>{if(_0x33ffd9)return;_0x33ffd9=!![],_0x14a56b['close'](),_0x55dcc2(_0x51a927 instanceof Error?_0x51a927:new Error(String(_0x51a927)));};_0x14a56b[_0x134928(0x118)](_0x134928(0x127),_0x4089af),_0x14a56b[_0x134928(0x118)]('end',()=>{if(_0x33ffd9)return;_0x33ffd9=!![],_0xf4ccd9();}),_0x14a56b['on'](_0x134928(0x10c),_0x576939=>{const _0x27c4e1=_0x134928;void(async()=>{const _0x819580=a181_0x1214;_0x1d737a+=0x1,_0x1a56ca+=_0x576939[_0x819580(0x112)];if(_0x1d737a>MAX_ENTRY_COUNT)throw new Error('Project\x20template\x20ZIP\x20exceeds\x20'+MAX_ENTRY_COUNT+_0x819580(0x134));if(_0x1a56ca>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x819580(0x113));if(_0x576939[_0x819580(0x116)]())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x576939[_0x819580(0x12b)]);if(isSymbolicLink(_0x576939))throw new Error(_0x819580(0x123)+_0x576939['fileName']);const {relativePath:_0x15678e,directory:_0x763cbe}=validateEntryPath(_0x576939[_0x819580(0x12b)]),_0xdcb100=_0x15678e['split'](a181_0x650c35[_0x819580(0x126)]);for(let _0x3ef60d=0x1;_0x3ef60d<=_0xdcb100['length'];_0x3ef60d+=0x1){const _0x3ad4b6=_0xdcb100[_0x819580(0x10e)](0x0,_0x3ef60d)[_0x819580(0x11e)](a181_0x650c35[_0x819580(0x126)]),_0x6cf111=_0x3ad4b6['toLocaleLowerCase'](_0x819580(0x120)),_0x3bbdf0=_0x1f2cae[_0x819580(0x131)](_0x6cf111);if(_0x3bbdf0&&_0x3bbdf0!==_0x3ad4b6)throw new Error(_0x819580(0x124)+_0x576939[_0x819580(0x12b)]);_0x1f2cae['set'](_0x6cf111,_0x3ad4b6);}const _0x1ee9d6=_0x15678e[_0x819580(0x11b)](_0x819580(0x120));if(_0x2994bd[_0x819580(0x115)](_0x1ee9d6))throw new Error(_0x819580(0x114)+_0x576939[_0x819580(0x12b)]);_0x2994bd[_0x819580(0x11a)](_0x1ee9d6);const _0x543054=a181_0x650c35[_0x819580(0x11f)](_0x2ff944,_0x15678e);if(_0x543054!==_0x2ff944&&!_0x543054[_0x819580(0x12d)](''+_0x2ff944+a181_0x650c35[_0x819580(0x126)]))throw new Error(_0x819580(0x119)+_0x576939[_0x819580(0x12b)]);if(_0x763cbe)await a181_0x5b36de[_0x819580(0x122)](_0x543054,{'recursive':!![]});else{await a181_0x5b36de[_0x819580(0x122)](a181_0x650c35[_0x819580(0x12f)](_0x543054),{'recursive':!![]});const _0x20ada5=await openEntryStream(_0x14a56b,_0x576939);await pipeline(_0x20ada5,createWriteStream(_0x543054,{'flags':'wx','mode':0x1a4}));}_0x14a56b[_0x819580(0x125)]();})()[_0x27c4e1(0x110)](_0x4089af);}),_0x14a56b[_0x134928(0x125)]();});}
1
+ (function(_0x4ae464,_0x32b812){const _0x2292a9=a181_0x2013,_0x12acae=_0x4ae464();while(!![]){try{const _0x1be7ec=-parseInt(_0x2292a9(0xa5))/0x1+-parseInt(_0x2292a9(0xad))/0x2*(-parseInt(_0x2292a9(0x97))/0x3)+parseInt(_0x2292a9(0x9f))/0x4+parseInt(_0x2292a9(0x98))/0x5*(parseInt(_0x2292a9(0xb2))/0x6)+-parseInt(_0x2292a9(0xaa))/0x7*(parseInt(_0x2292a9(0x91))/0x8)+-parseInt(_0x2292a9(0x8e))/0x9*(-parseInt(_0x2292a9(0xab))/0xa)+parseInt(_0x2292a9(0x95))/0xb*(-parseInt(_0x2292a9(0xa9))/0xc);if(_0x1be7ec===_0x32b812)break;else _0x12acae['push'](_0x12acae['shift']());}catch(_0x5d75e4){_0x12acae['push'](_0x12acae['shift']());}}}(a181_0x43e8,0x6a4a0));import{createWriteStream}from'node:fs';import a181_0x5324db from'node:fs/promises';function a181_0x43e8(){const _0x1c816f=['entry','5528vZQXsN','once','get','toLocaleLowerCase','935sOpEfm','has','3gPprXk','25305ZWeorA','slice','fileName','mkdir','test','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','\x20entries.','1500068gpQXPs','readEntry','split','isEncrypted','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','en-US','479048JGpqht','catch','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','Project\x20template\x20ZIP\x20exceeds\x20','55320UIRfqW','1239IDNqoD','10eHreiz','resolve','875516nUYEmC','join','dirname','endsWith','open','78YLoboZ','externalFileAttributes','sep','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','Case-conflicting\x20ZIP\x20entry\x20path:\x20','add','error','startsWith','Unable\x20to\x20read\x20ZIP\x20entry:\x20','Unable\x20to\x20open\x20project\x20template\x20archive.','4949973nWvzrU','end'];a181_0x43e8=function(){return _0x1c816f;};return a181_0x43e8();}import a181_0x3778e7 from'node:path';import{pipeline}from'node:stream/promises';import a181_0x404bb6 from'yauzl';const MAX_ENTRY_COUNT=0x7d0,MAX_UNCOMPRESSED_SIZE=0x32*0x400*0x400,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,WINDOWS_INVALID_CHAR=/[<>:"|?*\x00-\x1f]/;function openZip(_0x502ec9){return new Promise((_0x4f34f8,_0x121eb0)=>{const _0x25da91=a181_0x2013;a181_0x404bb6[_0x25da91(0xb1)](_0x502ec9,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x100b77,_0x437dfd)=>{const _0x1dc76b=_0x25da91;if(_0x100b77||!_0x437dfd){_0x121eb0(_0x100b77||new Error(_0x1dc76b(0x8d)));return;}_0x4f34f8(_0x437dfd);});});}function openEntryStream(_0xa52c0b,_0x593292){return new Promise((_0x4aab11,_0x53d3c0)=>{_0xa52c0b['openReadStream'](_0x593292,(_0x5efefd,_0x972efa)=>{const _0x5b2405=a181_0x2013;if(_0x5efefd||!_0x972efa){_0x53d3c0(_0x5efefd||new Error(_0x5b2405(0x8c)+_0x593292[_0x5b2405(0x9a)]));return;}_0x4aab11(_0x972efa);});});}function validateEntryPath(_0x98af6e){const _0x4f1a49=a181_0x2013,_0x1911da=_0x98af6e['replace'](/\\/g,'/'),_0x346d30=_0x1911da[_0x4f1a49(0xb0)]('/'),_0x59c3ee=_0x346d30?_0x1911da['slice'](0x0,-0x1):_0x1911da;if(!_0x59c3ee||_0x1911da[_0x4f1a49(0x8b)]('/')||/^[A-Za-z]:\//[_0x4f1a49(0x9c)](_0x1911da))throw new Error(_0x4f1a49(0x87)+_0x98af6e);const _0x5d00f6=_0x59c3ee[_0x4f1a49(0xa1)]('/');for(const _0x2b301b of _0x5d00f6){if(!_0x2b301b||_0x2b301b==='.'||_0x2b301b==='..'||_0x2b301b[_0x4f1a49(0xb0)]('.')||_0x2b301b[_0x4f1a49(0xb0)]('\x20')||WINDOWS_INVALID_CHAR[_0x4f1a49(0x9c)](_0x2b301b)||WINDOWS_RESERVED_NAME[_0x4f1a49(0x9c)](_0x2b301b))throw new Error('Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20'+_0x98af6e);}return{'relativePath':_0x5d00f6[_0x4f1a49(0xae)](a181_0x3778e7[_0x4f1a49(0x86)]),'directory':_0x346d30};}function isSymbolicLink(_0x249824){const _0x5442f3=a181_0x2013,_0x18df71=_0x249824[_0x5442f3(0xb3)]>>>0x10&0xffff;return(_0x18df71&0xf000)===0xa000;}function a181_0x2013(_0x40dd70,_0x4bf2ee){_0x40dd70=_0x40dd70-0x86;const _0x43e85d=a181_0x43e8();let _0x201328=_0x43e85d[_0x40dd70];return _0x201328;}export async function extractProjectTemplateArchive(_0x499d49,_0x4df20f){const _0x4796d3=a181_0x2013,_0x285ee6=await openZip(_0x499d49),_0x1bdeba=a181_0x3778e7[_0x4796d3(0xac)](_0x4df20f),_0x3a8817=new Set(),_0x31e4f3=new Map();let _0x5401dc=0x0,_0x30b8d7=0x0;await a181_0x5324db[_0x4796d3(0x9b)](_0x1bdeba,{'recursive':!![]}),await new Promise((_0x27a0c0,_0x57ffe0)=>{const _0x1ec936=_0x4796d3;let _0x363f2b=![];const _0xdfa823=_0x3ff6d2=>{if(_0x363f2b)return;_0x363f2b=!![],_0x285ee6['close'](),_0x57ffe0(_0x3ff6d2 instanceof Error?_0x3ff6d2:new Error(String(_0x3ff6d2)));};_0x285ee6[_0x1ec936(0x92)](_0x1ec936(0x8a),_0xdfa823),_0x285ee6[_0x1ec936(0x92)](_0x1ec936(0x8f),()=>{if(_0x363f2b)return;_0x363f2b=!![],_0x27a0c0();}),_0x285ee6['on'](_0x1ec936(0x90),_0x3febc4=>{const _0x4e23a3=_0x1ec936;void(async()=>{const _0x17042=a181_0x2013;_0x5401dc+=0x1,_0x30b8d7+=_0x3febc4['uncompressedSize'];if(_0x5401dc>MAX_ENTRY_COUNT)throw new Error(_0x17042(0xa8)+MAX_ENTRY_COUNT+_0x17042(0x9e));if(_0x30b8d7>MAX_UNCOMPRESSED_SIZE)throw new Error('Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.');if(_0x3febc4[_0x17042(0xa2)]())throw new Error(_0x17042(0xa7)+_0x3febc4['fileName']);if(isSymbolicLink(_0x3febc4))throw new Error(_0x17042(0xa3)+_0x3febc4[_0x17042(0x9a)]);const {relativePath:_0x598b0c,directory:_0x10e5f7}=validateEntryPath(_0x3febc4[_0x17042(0x9a)]),_0x37aad7=_0x598b0c[_0x17042(0xa1)](a181_0x3778e7['sep']);for(let _0x35b3f6=0x1;_0x35b3f6<=_0x37aad7['length'];_0x35b3f6+=0x1){const _0x56553f=_0x37aad7[_0x17042(0x99)](0x0,_0x35b3f6)[_0x17042(0xae)](a181_0x3778e7[_0x17042(0x86)]),_0x154384=_0x56553f[_0x17042(0x94)](_0x17042(0xa4)),_0x113d94=_0x31e4f3[_0x17042(0x93)](_0x154384);if(_0x113d94&&_0x113d94!==_0x56553f)throw new Error(_0x17042(0x88)+_0x3febc4[_0x17042(0x9a)]);_0x31e4f3['set'](_0x154384,_0x56553f);}const _0x1632f9=_0x598b0c[_0x17042(0x94)](_0x17042(0xa4));if(_0x3a8817[_0x17042(0x96)](_0x1632f9))throw new Error('Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20'+_0x3febc4[_0x17042(0x9a)]);_0x3a8817[_0x17042(0x89)](_0x1632f9);const _0x292a17=a181_0x3778e7[_0x17042(0xac)](_0x1bdeba,_0x598b0c);if(_0x292a17!==_0x1bdeba&&!_0x292a17[_0x17042(0x8b)](''+_0x1bdeba+a181_0x3778e7[_0x17042(0x86)]))throw new Error(_0x17042(0x9d)+_0x3febc4[_0x17042(0x9a)]);if(_0x10e5f7)await a181_0x5324db[_0x17042(0x9b)](_0x292a17,{'recursive':!![]});else{await a181_0x5324db[_0x17042(0x9b)](a181_0x3778e7[_0x17042(0xaf)](_0x292a17),{'recursive':!![]});const _0x10c747=await openEntryStream(_0x285ee6,_0x3febc4);await pipeline(_0x10c747,createWriteStream(_0x292a17,{'flags':'wx','mode':0x1a4}));}_0x285ee6[_0x17042(0xa0)]();})()[_0x4e23a3(0xa6)](_0xdfa823);}),_0x285ee6[_0x1ec936(0xa0)]();});}
@@ -1 +1 @@
1
- const a182_0x2d1728=a182_0x230c;function a182_0x230c(_0x44da5e,_0x705e9a){_0x44da5e=_0x44da5e-0xb1;const _0x5156e8=a182_0x5156();let _0x230c52=_0x5156e8[_0x44da5e];return _0x230c52;}(function(_0x5d4068,_0x1998ce){const _0x553ba4=a182_0x230c,_0x5dbba0=_0x5d4068();while(!![]){try{const _0x3fa045=parseInt(_0x553ba4(0xb4))/0x1*(parseInt(_0x553ba4(0xb9))/0x2)+-parseInt(_0x553ba4(0xb3))/0x3+-parseInt(_0x553ba4(0xb5))/0x4+parseInt(_0x553ba4(0xba))/0x5*(-parseInt(_0x553ba4(0xb1))/0x6)+parseInt(_0x553ba4(0xb8))/0x7*(parseInt(_0x553ba4(0xb6))/0x8)+parseInt(_0x553ba4(0xbc))/0x9+parseInt(_0x553ba4(0xb2))/0xa;if(_0x3fa045===_0x1998ce)break;else _0x5dbba0['push'](_0x5dbba0['shift']());}catch(_0xa117ed){_0x5dbba0['push'](_0x5dbba0['shift']());}}}(a182_0x5156,0xb1374));import a182_0x2c0565 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a182_0x2c0565[a182_0x2d1728(0xbb)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x5185a6=a182_0x2d1728;return a182_0x2c0565[_0x5185a6(0xb7)](__dirname,'../../../../');}function a182_0x5156(){const _0x2eeb02=['3535479vIXcob','1VmbDhh','2365704klEZvf','5326040qXuQuM','resolve','7QFuHJx','1407930ilFIYp','174080hVkoie','dirname','8763543PSuHkZ','180JZbYvq','11968280AKoAkT'];a182_0x5156=function(){return _0x2eeb02;};return a182_0x5156();}
1
+ function a182_0x1b6a(_0x187b89,_0x4c053d){_0x187b89=_0x187b89-0x1d5;const _0x4622fd=a182_0x4622();let _0x1b6aaf=_0x4622fd[_0x187b89];return _0x1b6aaf;}const a182_0x5aad69=a182_0x1b6a;(function(_0x266b1e,_0x463a71){const _0x11329c=a182_0x1b6a,_0x48fae1=_0x266b1e();while(!![]){try{const _0x252989=-parseInt(_0x11329c(0x1df))/0x1+parseInt(_0x11329c(0x1d5))/0x2*(-parseInt(_0x11329c(0x1d9))/0x3)+parseInt(_0x11329c(0x1dc))/0x4+-parseInt(_0x11329c(0x1de))/0x5*(parseInt(_0x11329c(0x1da))/0x6)+-parseInt(_0x11329c(0x1d8))/0x7*(-parseInt(_0x11329c(0x1d7))/0x8)+parseInt(_0x11329c(0x1e0))/0x9+parseInt(_0x11329c(0x1e1))/0xa;if(_0x252989===_0x463a71)break;else _0x48fae1['push'](_0x48fae1['shift']());}catch(_0x1c2b6b){_0x48fae1['push'](_0x48fae1['shift']());}}}(a182_0x4622,0xe3502));import a182_0x22aeb1 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a182_0x22aeb1[a182_0x5aad69(0x1d6)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x170d3d=a182_0x5aad69;return a182_0x22aeb1[_0x170d3d(0x1dd)](__dirname,_0x170d3d(0x1db));}function a182_0x4622(){const _0x2789ce=['718LOHobH','dirname','8AvTCgl','1336573PiDbtb','8577mOUYKI','978CSJoDv','../../../../','593372TtpZoK','resolve','42705nYyoHi','747309MuWTMk','9394029HtZpUk','27138840DZUwql'];a182_0x4622=function(){return _0x2789ce;};return a182_0x4622();}
@@ -1 +1 @@
1
- (function(_0x31e970,_0x8eca12){const _0x2f4e82=a183_0xa45b,_0x927fdf=_0x31e970();while(!![]){try{const _0x36a29b=-parseInt(_0x2f4e82(0x194))/0x1+parseInt(_0x2f4e82(0x198))/0x2*(-parseInt(_0x2f4e82(0x1a4))/0x3)+parseInt(_0x2f4e82(0x19e))/0x4+parseInt(_0x2f4e82(0x193))/0x5*(parseInt(_0x2f4e82(0x195))/0x6)+-parseInt(_0x2f4e82(0x19a))/0x7*(-parseInt(_0x2f4e82(0x1a1))/0x8)+-parseInt(_0x2f4e82(0x19d))/0x9*(parseInt(_0x2f4e82(0x19c))/0xa)+-parseInt(_0x2f4e82(0x1a3))/0xb*(-parseInt(_0x2f4e82(0x199))/0xc);if(_0x36a29b===_0x8eca12)break;else _0x927fdf['push'](_0x927fdf['shift']());}catch(_0x4aed6f){_0x927fdf['push'](_0x927fdf['shift']());}}}(a183_0x4e3f,0xdca22));function a183_0xa45b(_0x3817d8,_0x2be57b){_0x3817d8=_0x3817d8-0x191;const _0x4e3f88=a183_0x4e3f();let _0xa45b1e=_0x4e3f88[_0x3817d8];return _0xa45b1e;}import a183_0x14b867 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a183_0x4e3f(){const _0x297378=['8689608qrFxVU','3464060rSPoxv','Failed\x20to\x20copy\x20project\x20template','copy','48dIyyMP','resolve','4038639endWqm','1174224aiFnnt','now','message','error','312940BruaAL','350136FEJCJQ','54RXLUaM','info','success','8NWvLYK','60xsywkz','606599xvOane','Starting\x20project\x20template\x20creation','10NGGVPq'];a183_0x4e3f=function(){return _0x297378;};return a183_0x4e3f();}export async function copyProjectTemplate(_0x4212e8,_0x56508f,_0x108b01){const _0x46a32a=a183_0xa45b,_0x5299a5=Date[_0x46a32a(0x1a5)](),_0x323bd0=a183_0x14b867[_0x46a32a(0x1a2)](process['cwd'](),_0x4212e8);try{logger[_0x46a32a(0x196)](_0x46a32a(0x1a0),_0x46a32a(0x19b),{'projectCode':_0x4212e8});const _0x56760a=_0x108b01?await materializeLocalProjectTemplate(_0x108b01,_0x323bd0,_0x56508f):await materializeProjectTemplate(_0x323bd0,_0x56508f),_0x25b24c=Date[_0x46a32a(0x1a5)]()-_0x5299a5;logger[_0x46a32a(0x197)](_0x46a32a(0x1a0),'Project\x20template\x20created',_0x25b24c,{'projectCode':_0x4212e8,'templateSource':_0x56760a['source'],'templateVersion':_0x56760a['version']});}catch(_0x3e9476){const _0x5bf2a2=Date[_0x46a32a(0x1a5)]()-_0x5299a5;logger[_0x46a32a(0x192)](_0x46a32a(0x1a0),_0x46a32a(0x19f),{'projectCode':_0x4212e8,'error':_0x3e9476 instanceof Error?_0x3e9476[_0x46a32a(0x191)]:String(_0x3e9476),'duration':_0x5bf2a2});throw _0x3e9476;}return formatElapsed(_0x5299a5);}
1
+ (function(_0x1aa861,_0x5a1aba){const _0x1272a2=a183_0x4e63,_0x341c7f=_0x1aa861();while(!![]){try{const _0x4b5252=parseInt(_0x1272a2(0xde))/0x1*(parseInt(_0x1272a2(0xd2))/0x2)+-parseInt(_0x1272a2(0xd3))/0x3*(-parseInt(_0x1272a2(0xd6))/0x4)+-parseInt(_0x1272a2(0xdf))/0x5*(-parseInt(_0x1272a2(0xd4))/0x6)+-parseInt(_0x1272a2(0xe1))/0x7+parseInt(_0x1272a2(0xdb))/0x8+parseInt(_0x1272a2(0xe2))/0x9*(-parseInt(_0x1272a2(0xcf))/0xa)+parseInt(_0x1272a2(0xdc))/0xb*(-parseInt(_0x1272a2(0xda))/0xc);if(_0x4b5252===_0x5a1aba)break;else _0x341c7f['push'](_0x341c7f['shift']());}catch(_0x5c7c0b){_0x341c7f['push'](_0x341c7f['shift']());}}}(a183_0x3ee6,0x9d19e));import a183_0x104a64 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a183_0x3ee6(){const _0xb064be=['322590hwYHeo','cwd','5302906xxhpsG','950877uqQxsc','source','20keCKWq','Failed\x20to\x20copy\x20project\x20template','copy','2UOwfPs','18195fQFiif','54kWdXAA','now','520ckAvGo','success','message','Starting\x20project\x20template\x20creation','559452UfivDs','2067216ATICDf','33wsAygb','info','124699QFuChF'];a183_0x3ee6=function(){return _0xb064be;};return a183_0x3ee6();}function a183_0x4e63(_0x2dc854,_0x3b974b){_0x2dc854=_0x2dc854-0xce;const _0x3ee6fd=a183_0x3ee6();let _0x4e633f=_0x3ee6fd[_0x2dc854];return _0x4e633f;}import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0x158cbd,_0xbc14f2,_0x5e8ee1){const _0x304c14=a183_0x4e63,_0x820e32=Date['now'](),_0x4007c5=a183_0x104a64['resolve'](process[_0x304c14(0xe0)](),_0x158cbd);try{logger[_0x304c14(0xdd)](_0x304c14(0xd1),_0x304c14(0xd9),{'projectCode':_0x158cbd});const _0xe0f171=_0x5e8ee1?await materializeLocalProjectTemplate(_0x5e8ee1,_0x4007c5,_0xbc14f2):await materializeProjectTemplate(_0x4007c5,_0xbc14f2),_0x2b1281=Date['now']()-_0x820e32;logger[_0x304c14(0xd7)](_0x304c14(0xd1),'Project\x20template\x20created',_0x2b1281,{'projectCode':_0x158cbd,'templateSource':_0xe0f171[_0x304c14(0xce)],'templateVersion':_0xe0f171['version']});}catch(_0x190bf7){const _0x8ff270=Date[_0x304c14(0xd5)]()-_0x820e32;logger['error'](_0x304c14(0xd1),_0x304c14(0xd0),{'projectCode':_0x158cbd,'error':_0x190bf7 instanceof Error?_0x190bf7[_0x304c14(0xd8)]:String(_0x190bf7),'duration':_0x8ff270});throw _0x190bf7;}return formatElapsed(_0x820e32);}
@@ -1 +1 @@
1
- function a184_0x350e(_0x2b7f81,_0x3e15c7){_0x2b7f81=_0x2b7f81-0x118;const _0x56786c=a184_0x5678();let _0x350e8b=_0x56786c[_0x2b7f81];return _0x350e8b;}(function(_0x171942,_0x2167a3){const _0x158c1d=a184_0x350e,_0x193788=_0x171942();while(!![]){try{const _0x3ba0c5=parseInt(_0x158c1d(0x11c))/0x1*(-parseInt(_0x158c1d(0x11a))/0x2)+parseInt(_0x158c1d(0x125))/0x3*(parseInt(_0x158c1d(0x128))/0x4)+parseInt(_0x158c1d(0x12a))/0x5+-parseInt(_0x158c1d(0x118))/0x6+parseInt(_0x158c1d(0x126))/0x7+-parseInt(_0x158c1d(0x11e))/0x8*(-parseInt(_0x158c1d(0x12f))/0x9)+-parseInt(_0x158c1d(0x12b))/0xa;if(_0x3ba0c5===_0x2167a3)break;else _0x193788['push'](_0x193788['shift']());}catch(_0x37645d){_0x193788['push'](_0x193788['shift']());}}}(a184_0x5678,0x27803));import a184_0x36c381 from'node:path';import{execa}from'execa';function a184_0x5678(){const _0x3ebd38=['Code\x20format\x20completed','success','Code\x20format\x20failed','--write','11505rfpeUN','1895495npjqFV','prettier','196gKLfve','message','350515vgSQoh','2176380bkiGeS','now','Starting\x20code\x20format','cwd','171PQMCgz','1363950yVChyE','npx','69352QOmqQk','format','2oFTucd','info','62024CjGFyG','resolve','error'];a184_0x5678=function(){return _0x3ebd38;};return a184_0x5678();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x827d26){const _0x229878=a184_0x350e,_0x530b4f=Date[_0x229878(0x12c)](),_0x395509=a184_0x36c381[_0x229878(0x11f)](process[_0x229878(0x12e)](),_0x827d26);try{logger[_0x229878(0x11d)](_0x229878(0x11b),_0x229878(0x12d),{'projectCode':_0x827d26}),await execa(resolveNpmBin(_0x229878(0x119)),[_0x229878(0x127),_0x229878(0x124),'.'],{'cwd':_0x395509});const _0x20e022=Date[_0x229878(0x12c)]()-_0x530b4f;logger[_0x229878(0x122)](_0x229878(0x11b),_0x229878(0x121),_0x20e022,{'projectCode':_0x827d26});}catch(_0x4516ce){const _0x543164=Date[_0x229878(0x12c)]()-_0x530b4f;logger[_0x229878(0x120)](_0x229878(0x11b),_0x229878(0x123),{'projectCode':_0x827d26,'error':_0x4516ce instanceof Error?_0x4516ce[_0x229878(0x129)]:String(_0x4516ce),'duration':_0x543164});throw _0x4516ce;}return formatElapsed(_0x530b4f);}
1
+ (function(_0x477fb1,_0x21cdde){const _0x5e9f8c=a184_0x36b5,_0x9a535c=_0x477fb1();while(!![]){try{const _0x359083=parseInt(_0x5e9f8c(0x97))/0x1*(-parseInt(_0x5e9f8c(0x8f))/0x2)+parseInt(_0x5e9f8c(0x90))/0x3+parseInt(_0x5e9f8c(0x9f))/0x4*(-parseInt(_0x5e9f8c(0x94))/0x5)+parseInt(_0x5e9f8c(0x91))/0x6+-parseInt(_0x5e9f8c(0x9e))/0x7+parseInt(_0x5e9f8c(0x8e))/0x8+parseInt(_0x5e9f8c(0x8c))/0x9*(parseInt(_0x5e9f8c(0x9b))/0xa);if(_0x359083===_0x21cdde)break;else _0x9a535c['push'](_0x9a535c['shift']());}catch(_0x31ea93){_0x9a535c['push'](_0x9a535c['shift']());}}}(a184_0x4638,0xa1dcf));import a184_0x2cf950 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a184_0x4638(){const _0x5bbb77=['3022840reLVPq','262942sLRLFl','948426FdQMkY','6125988vAWXOG','format','prettier','200utoxoc','--write','Code\x20format\x20failed','2cWmkDZ','success','error','Starting\x20code\x20format','294790wObYFO','Code\x20format\x20completed','now','5205823AfeVTk','42860KQgvqL','cwd','117AltpZK','message'];a184_0x4638=function(){return _0x5bbb77;};return a184_0x4638();}function a184_0x36b5(_0x3b132e,_0x43c16a){_0x3b132e=_0x3b132e-0x8c;const _0x4638f7=a184_0x4638();let _0x36b5a9=_0x4638f7[_0x3b132e];return _0x36b5a9;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x3eb818){const _0x32fdae=a184_0x36b5,_0x2534b1=Date[_0x32fdae(0x9d)](),_0x235eb3=a184_0x2cf950['resolve'](process[_0x32fdae(0xa0)](),_0x3eb818);try{logger['info'](_0x32fdae(0x92),_0x32fdae(0x9a),{'projectCode':_0x3eb818}),await execa(resolveNpmBin('npx'),[_0x32fdae(0x93),_0x32fdae(0x95),'.'],{'cwd':_0x235eb3});const _0x45210b=Date[_0x32fdae(0x9d)]()-_0x2534b1;logger[_0x32fdae(0x98)](_0x32fdae(0x92),_0x32fdae(0x9c),_0x45210b,{'projectCode':_0x3eb818});}catch(_0x21a474){const _0x3f5941=Date['now']()-_0x2534b1;logger[_0x32fdae(0x99)]('format',_0x32fdae(0x96),{'projectCode':_0x3eb818,'error':_0x21a474 instanceof Error?_0x21a474[_0x32fdae(0x8d)]:String(_0x21a474),'duration':_0x3f5941});throw _0x21a474;}return formatElapsed(_0x2534b1);}
@@ -1 +1 @@
1
- (function(_0x1a323f,_0x157205){const _0x4099fb=a185_0x3f72,_0x1ad27c=_0x1a323f();while(!![]){try{const _0xe74247=parseInt(_0x4099fb(0x1d2))/0x1*(parseInt(_0x4099fb(0x1c7))/0x2)+parseInt(_0x4099fb(0x1ca))/0x3+-parseInt(_0x4099fb(0x1c9))/0x4*(parseInt(_0x4099fb(0x1c8))/0x5)+parseInt(_0x4099fb(0x1d1))/0x6*(parseInt(_0x4099fb(0x1d0))/0x7)+parseInt(_0x4099fb(0x1bf))/0x8*(-parseInt(_0x4099fb(0x1c2))/0x9)+parseInt(_0x4099fb(0x1cc))/0xa*(-parseInt(_0x4099fb(0x1d4))/0xb)+-parseInt(_0x4099fb(0x1c6))/0xc;if(_0xe74247===_0x157205)break;else _0x1ad27c['push'](_0x1ad27c['shift']());}catch(_0x56dcb7){_0x1ad27c['push'](_0x1ad27c['shift']());}}}(a185_0x326f,0x85d10));import a185_0x239dfe from'node:path';function a185_0x3f72(_0x5e857f,_0x18b2d9){_0x5e857f=_0x5e857f-0x1bf;const _0x326fd7=a185_0x326f();let _0x3f72c7=_0x326fd7[_0x5e857f];return _0x3f72c7;}import{execa}from'execa';function a185_0x326f(){const _0x54321f=['success','1153356RzHfxk','36838nWhfcS','15cBYnoy','1109368fupLgY','2676033kJEelW','resolve','383730BpHpaT','cwd','info','https://registry.npmmirror.com','3614366RfmtOH','6ekYilQ','42IUcedv','Dependency\x20install\x20completed','66EbSsyA','48RBXgzl','now','install','713187regsPF','npm','error'];a185_0x326f=function(){return _0x54321f;};return a185_0x326f();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x144b87){const _0x49637f=a185_0x3f72,_0x4c0298=Date[_0x49637f(0x1c0)](),_0x7833ce=a185_0x239dfe[_0x49637f(0x1cb)](process[_0x49637f(0x1cd)](),_0x144b87);try{logger[_0x49637f(0x1ce)]('install','Starting\x20dependency\x20install',{'projectCode':_0x144b87,'registry':_0x49637f(0x1cf)}),await execa(resolveNpmBin(_0x49637f(0x1c3)),['install','--registry',_0x49637f(0x1cf)],{'cwd':_0x7833ce});const _0xe2aff9=Date[_0x49637f(0x1c0)]()-_0x4c0298;logger[_0x49637f(0x1c5)](_0x49637f(0x1c1),_0x49637f(0x1d3),_0xe2aff9,{'projectCode':_0x144b87});}catch(_0x1b3efc){const _0x18716b=Date[_0x49637f(0x1c0)]()-_0x4c0298;logger[_0x49637f(0x1c4)](_0x49637f(0x1c1),'Dependency\x20install\x20failed',{'projectCode':_0x144b87,'error':_0x1b3efc instanceof Error?_0x1b3efc['message']:String(_0x1b3efc),'duration':_0x18716b});throw _0x1b3efc;}return formatElapsed(_0x4c0298);}
1
+ (function(_0x245f29,_0x4f7a7e){const _0x6aa35f=a185_0xa414,_0x42af35=_0x245f29();while(!![]){try{const _0x5b0f8b=parseInt(_0x6aa35f(0x1f1))/0x1+parseInt(_0x6aa35f(0x1e2))/0x2+parseInt(_0x6aa35f(0x1e8))/0x3*(-parseInt(_0x6aa35f(0x1f3))/0x4)+-parseInt(_0x6aa35f(0x1e4))/0x5+parseInt(_0x6aa35f(0x1e0))/0x6+-parseInt(_0x6aa35f(0x1e9))/0x7*(-parseInt(_0x6aa35f(0x1e5))/0x8)+parseInt(_0x6aa35f(0x1e3))/0x9*(-parseInt(_0x6aa35f(0x1e1))/0xa);if(_0x5b0f8b===_0x4f7a7e)break;else _0x42af35['push'](_0x42af35['shift']());}catch(_0x1c6304){_0x42af35['push'](_0x42af35['shift']());}}}(a185_0x4754,0xc1a05));function a185_0xa414(_0x39cc7b,_0x5aabd3){_0x39cc7b=_0x39cc7b-0x1df;const _0x475491=a185_0x4754();let _0xa41430=_0x475491[_0x39cc7b];return _0xa41430;}import a185_0x1b76b4 from'node:path';import{execa}from'execa';function a185_0x4754(){const _0x39992e=['2314047cgNwVw','19033KDtpiE','Dependency\x20install\x20completed','Starting\x20dependency\x20install','error','install','--registry','now','message','1393216LQUJvI','info','4guOUMB','npm','8870412aUlNfk','157810ItujIC','3008318gVOLkN','2223DuXNXI','997575OZqNFs','3784GlHbCq','https://registry.npmmirror.com','resolve'];a185_0x4754=function(){return _0x39992e;};return a185_0x4754();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0xf329f5){const _0x4986c5=a185_0xa414,_0xc2bb5c=Date['now'](),_0x41ae30=a185_0x1b76b4[_0x4986c5(0x1e7)](process['cwd'](),_0xf329f5);try{logger[_0x4986c5(0x1f2)](_0x4986c5(0x1ed),_0x4986c5(0x1eb),{'projectCode':_0xf329f5,'registry':_0x4986c5(0x1e6)}),await execa(resolveNpmBin(_0x4986c5(0x1df)),[_0x4986c5(0x1ed),_0x4986c5(0x1ee),_0x4986c5(0x1e6)],{'cwd':_0x41ae30});const _0x367558=Date['now']()-_0xc2bb5c;logger['success']('install',_0x4986c5(0x1ea),_0x367558,{'projectCode':_0xf329f5});}catch(_0x556161){const _0xc22b00=Date[_0x4986c5(0x1ef)]()-_0xc2bb5c;logger[_0x4986c5(0x1ec)](_0x4986c5(0x1ed),'Dependency\x20install\x20failed',{'projectCode':_0xf329f5,'error':_0x556161 instanceof Error?_0x556161[_0x4986c5(0x1f0)]:String(_0x556161),'duration':_0xc22b00});throw _0x556161;}return formatElapsed(_0xc2bb5c);}
@@ -1 +1 @@
1
- const a186_0x20ae44=a186_0x5154;(function(_0x2762fb,_0x3872cd){const _0x58b1a9=a186_0x5154,_0x3adf52=_0x2762fb();while(!![]){try{const _0x1125d6=-parseInt(_0x58b1a9(0x160))/0x1*(-parseInt(_0x58b1a9(0x15f))/0x2)+parseInt(_0x58b1a9(0x168))/0x3*(parseInt(_0x58b1a9(0x159))/0x4)+-parseInt(_0x58b1a9(0x15a))/0x5*(parseInt(_0x58b1a9(0x156))/0x6)+-parseInt(_0x58b1a9(0x161))/0x7*(parseInt(_0x58b1a9(0x155))/0x8)+parseInt(_0x58b1a9(0x163))/0x9+-parseInt(_0x58b1a9(0x15d))/0xa*(-parseInt(_0x58b1a9(0x158))/0xb)+-parseInt(_0x58b1a9(0x167))/0xc;if(_0x1125d6===_0x3872cd)break;else _0x3adf52['push'](_0x3adf52['shift']());}catch(_0x124a27){_0x3adf52['push'](_0x3adf52['shift']());}}}(a186_0x3a77,0xd5f12));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a186_0x5154(_0x45bcd4,_0x19f614){_0x45bcd4=_0x45bcd4-0x155;const _0x3a7797=a186_0x3a77();let _0x5154e1=_0x3a7797[_0x45bcd4];return _0x5154e1;}function a186_0x3a77(){const _0x3c7f4b=['\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','project','validation','22243956WnxeXY','9qCeXeN','165576jEewnQ','566178IwwebX','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','25993auvNPM','1535604hsUUGJ','65URhqcJ','read','Domain\x20routing\x20synchronized:\x20','3620oUEuAy','domain-routing-sync','86126AsxAWp','23KXWHaF','7WlZupK','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','8818443wjttQt'];a186_0x3a77=function(){return _0x3c7f4b;};return a186_0x3a77();}import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':a186_0x20ae44(0x165),'command':a186_0x20ae44(0x15e),'description':a186_0x20ae44(0x162),'risk':a186_0x20ae44(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x257963=a186_0x20ae44,_0x3d3eae=findProjectRootDirectory();if(!resolveConfigPath(_0x3d3eae))throw CliErrors[_0x257963(0x166)](_0x257963(0x157),'Run\x20'+CLI_BIN_NAME+_0x257963(0x164));const _0x3bafb2=writeProjectDomainRoutingManifest(_0x3d3eae);return{'ok':!![],'message':_0x257963(0x15c)+_0x3bafb2['path'],'data':_0x3bafb2};}};
1
+ const a186_0x183561=a186_0x2efc;function a186_0x3fcd(){const _0x3c06c2=['1851729VFNvbf','domain-routing-sync','14SiZZGJ','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','Domain\x20routing\x20synchronized:\x20','128370oYEIRZ','42HwVdwg','1529872RitmYR','239624GZeAVP','9VGpUdC','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','path','1769661UaWYWQ','validation','19505PPQHvj','read','262967UlrxOj','20AfPxsr','Run\x20'];a186_0x3fcd=function(){return _0x3c06c2;};return a186_0x3fcd();}(function(_0x15d3d4,_0x44efb6){const _0x10f788=a186_0x2efc,_0x45f7eb=_0x15d3d4();while(!![]){try{const _0xb3f6b3=parseInt(_0x10f788(0xbb))/0x1+parseInt(_0x10f788(0xb0))/0x2*(-parseInt(_0x10f788(0xb4))/0x3)+-parseInt(_0x10f788(0xb3))/0x4+parseInt(_0x10f788(0xb9))/0x5*(parseInt(_0x10f788(0xb1))/0x6)+-parseInt(_0x10f788(0xc0))/0x7*(parseInt(_0x10f788(0xb2))/0x8)+-parseInt(_0x10f788(0xb7))/0x9*(-parseInt(_0x10f788(0xbc))/0xa)+parseInt(_0x10f788(0xbe))/0xb;if(_0xb3f6b3===_0x44efb6)break;else _0x45f7eb['push'](_0x45f7eb['shift']());}catch(_0x413624){_0x45f7eb['push'](_0x45f7eb['shift']());}}}(a186_0x3fcd,0x34f6e));function a186_0x2efc(_0x1185c4,_0x4adb28){_0x1185c4=_0x1185c4-0xaf;const _0x3fcd7b=a186_0x3fcd();let _0x2efc8b=_0x3fcd7b[_0x1185c4];return _0x2efc8b;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';export const projectDomainRoutingSyncDefinition={'service':'project','command':a186_0x183561(0xbf),'description':'Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','risk':a186_0x183561(0xba),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x38458c=a186_0x183561,_0x4650b2=findProjectRootDirectory();if(!resolveConfigPath(_0x4650b2))throw CliErrors[_0x38458c(0xb8)](_0x38458c(0xc1),_0x38458c(0xbd)+CLI_BIN_NAME+_0x38458c(0xb5));const _0x519088=writeProjectDomainRoutingManifest(_0x4650b2);return{'ok':!![],'message':_0x38458c(0xaf)+_0x519088[_0x38458c(0xb6)],'data':_0x519088};}};
@@ -1 +1 @@
1
- const a187_0x376a60=a187_0x2b9c;(function(_0x264ad4,_0x10d292){const _0x4b7af6=a187_0x2b9c,_0x466275=_0x264ad4();while(!![]){try{const _0x1c5e7e=-parseInt(_0x4b7af6(0x189))/0x1+parseInt(_0x4b7af6(0x17c))/0x2*(-parseInt(_0x4b7af6(0x191))/0x3)+parseInt(_0x4b7af6(0x17a))/0x4*(parseInt(_0x4b7af6(0x175))/0x5)+parseInt(_0x4b7af6(0x18e))/0x6+parseInt(_0x4b7af6(0x18f))/0x7+-parseInt(_0x4b7af6(0x172))/0x8*(-parseInt(_0x4b7af6(0x170))/0x9)+parseInt(_0x4b7af6(0x192))/0xa*(-parseInt(_0x4b7af6(0x16c))/0xb);if(_0x1c5e7e===_0x10d292)break;else _0x466275['push'](_0x466275['shift']());}catch(_0x51aaa0){_0x466275['push'](_0x466275['shift']());}}}(a187_0x5441,0xe8816));import{CliErrors}from'../../errors.js';function a187_0x5441(){const _0x2db8b7=['write','9IiHMvX','24808690XipTJo','env','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','boolean','11BAVouP','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','bool','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','17163mooxGx','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','6952eMorSa','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','upgrade','5YZEdOl','template-source','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','project','nonInteractive','2879752PSEFuY','validation','1018828MLThFN','Skip\x20confirmation\x20prompt','current-dir','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','str','trim','Usage:\x20','project-name','name','string','Project\x20name','create','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','307808CyMwaO','appcode','Prepared\x20local\x20project\x20template\x20directory','cookie','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','9335736zPyCFH','9353288uBmOFk'];a187_0x5441=function(){return _0x2db8b7;};return a187_0x5441();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a187_0x2b9c(_0x3989e6,_0x48298a){_0x3989e6=_0x3989e6-0x16a;const _0x544110=a187_0x5441();let _0x2b9c25=_0x544110[_0x3989e6];return _0x2b9c25;}import{upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a187_0x376a60(0x184),'type':a187_0x376a60(0x185),'description':a187_0x376a60(0x186)},{'name':a187_0x376a60(0x193),'type':a187_0x376a60(0x185),'description':'Target\x20environment'},{'name':a187_0x376a60(0x18a),'type':a187_0x376a60(0x185),'description':a187_0x376a60(0x16a)},{'name':a187_0x376a60(0x17e),'type':'boolean','description':a187_0x376a60(0x177),'default':![]},{'name':a187_0x376a60(0x176),'type':a187_0x376a60(0x185),'description':a187_0x376a60(0x18b)}],upgradeFlags=[{'name':'yes','type':a187_0x376a60(0x16b),'description':a187_0x376a60(0x17d),'default':![]}];export const projectDefinitions=[{'service':a187_0x376a60(0x178),'command':a187_0x376a60(0x187),'description':'Create\x20a\x20new\x20project','risk':a187_0x376a60(0x190),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a187_0x376a60(0x183),'description':a187_0x376a60(0x18d),'required':![]}],'flags':createFlags,async 'execute'(_0x2b0f69){const _0x29635c=a187_0x376a60,{createApp:_0x130453}=await import('../../commands/project/create/main.js'),_0x543f50=_0x2b0f69[_0x29635c(0x180)](_0x29635c(0x184))[_0x29635c(0x181)]()||_0x2b0f69['args'][0x0]?.[_0x29635c(0x181)](),_0x232f75=_0x2b0f69[_0x29635c(0x180)](_0x29635c(0x193))||undefined,_0x5005f2=_0x2b0f69[_0x29635c(0x180)](_0x29635c(0x18a))||undefined,_0x580c7b=_0x2b0f69[_0x29635c(0x180)](_0x29635c(0x176))['trim']()||undefined,_0x396faa=_0x2b0f69[_0x29635c(0x16e)](_0x29635c(0x17e));if(_0x396faa&&_0x543f50)throw CliErrors[_0x29635c(0x17b)](_0x29635c(0x188),'Run\x20'+CLI_BIN_NAME+_0x29635c(0x16f));if(_0x2b0f69[_0x29635c(0x179)]){if(!_0x543f50&&!_0x396faa)throw CliErrors['validation'](_0x29635c(0x171),_0x29635c(0x182)+CLI_BIN_NAME+_0x29635c(0x16d)+CLI_BIN_NAME+_0x29635c(0x173));await _0x130453({'projectCode':_0x543f50,'appCode':_0x5005f2,'env':_0x232f75,'cookie':_0x2b0f69[_0x29635c(0x18c)],'currentDir':_0x396faa,'nonInteractive':!![],'templateSource':_0x580c7b});}else await _0x130453({'projectCode':_0x543f50,'appCode':_0x5005f2,'env':_0x232f75,'cookie':_0x2b0f69[_0x29635c(0x18c)],'currentDir':_0x396faa,'templateSource':_0x580c7b});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a187_0x376a60(0x178),'command':a187_0x376a60(0x174),'description':a187_0x376a60(0x17f),'risk':a187_0x376a60(0x190),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x434b59){const _0x3f30f4=a187_0x376a60;return await upgradeApp(_0x434b59['nonInteractive'],{'yes':_0x434b59[_0x3f30f4(0x16e)]('yes')}),{'ok':!![]};}}];
1
+ function a187_0x3a2a(){const _0x502cc5=['cookie','Project\x20name','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','validation','current-dir','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','14gxOBkb','upgrade','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','81590qdtkCu','template-source','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','string','Target\x20environment','85878hPExWd','Run\x20','Skip\x20confirmation\x20prompt','13JsFHaf','env','bool','64EnlXIH','nonInteractive','814IyDhIa','boolean','trim','1638BXHwhy','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','str','400RKoIPF','15177648xdLVTD','37428zZtOgi','appcode','write','project','yes','342546IQnrKw','583639jTahbx','10864SOUHQU'];a187_0x3a2a=function(){return _0x502cc5;};return a187_0x3a2a();}const a187_0xb7549f=a187_0x45a4;(function(_0x2419fd,_0x3880d6){const _0x48c8fb=a187_0x45a4,_0x3b2726=_0x2419fd();while(!![]){try{const _0x1e72af=parseInt(_0x48c8fb(0x17f))/0x1+-parseInt(_0x48c8fb(0x16f))/0x2*(parseInt(_0x48c8fb(0x169))/0x3)+-parseInt(_0x48c8fb(0x179))/0x4*(parseInt(_0x48c8fb(0x177))/0x5)+parseInt(_0x48c8fb(0x17e))/0x6*(parseInt(_0x48c8fb(0x161))/0x7)+parseInt(_0x48c8fb(0x180))/0x8*(-parseInt(_0x48c8fb(0x174))/0x9)+parseInt(_0x48c8fb(0x164))/0xa*(parseInt(_0x48c8fb(0x171))/0xb)+parseInt(_0x48c8fb(0x178))/0xc*(parseInt(_0x48c8fb(0x16c))/0xd);if(_0x1e72af===_0x3880d6)break;else _0x3b2726['push'](_0x3b2726['shift']());}catch(_0x4d1b3b){_0x3b2726['push'](_0x3b2726['shift']());}}}(a187_0x3a2a,0x9fd33));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':'name','type':a187_0xb7549f(0x167),'description':a187_0xb7549f(0x182)},{'name':'env','type':a187_0xb7549f(0x167),'description':a187_0xb7549f(0x168)},{'name':a187_0xb7549f(0x17a),'type':a187_0xb7549f(0x167),'description':a187_0xb7549f(0x183)},{'name':a187_0xb7549f(0x185),'type':a187_0xb7549f(0x172),'description':'Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','default':![]},{'name':a187_0xb7549f(0x165),'type':a187_0xb7549f(0x167),'description':'Prepared\x20local\x20project\x20template\x20directory'}],upgradeFlags=[{'name':a187_0xb7549f(0x17d),'type':a187_0xb7549f(0x172),'description':a187_0xb7549f(0x16b),'default':![]}];function a187_0x45a4(_0x14fca5,_0x2574b8){_0x14fca5=_0x14fca5-0x160;const _0x3a2a8e=a187_0x3a2a();let _0x45a4db=_0x3a2a8e[_0x14fca5];return _0x45a4db;}export const projectDefinitions=[{'service':a187_0xb7549f(0x17c),'command':'create','description':'Create\x20a\x20new\x20project','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x585093){const _0x3f8dff=a187_0xb7549f,{createApp:_0x53dfbc}=await import('../../commands/project/create/main.js'),_0x19a453=_0x585093['str']('name')['trim']()||_0x585093['args'][0x0]?.['trim'](),_0x344182=_0x585093[_0x3f8dff(0x176)](_0x3f8dff(0x16d))||undefined,_0xec65=_0x585093['str'](_0x3f8dff(0x17a))||undefined,_0xd953d0=_0x585093[_0x3f8dff(0x176)]('template-source')[_0x3f8dff(0x173)]()||undefined,_0x10904f=_0x585093[_0x3f8dff(0x16e)](_0x3f8dff(0x185));if(_0x10904f&&_0x19a453)throw CliErrors['validation'](_0x3f8dff(0x166),_0x3f8dff(0x16a)+CLI_BIN_NAME+_0x3f8dff(0x175));if(_0x585093['nonInteractive']){if(!_0x19a453&&!_0x10904f)throw CliErrors[_0x3f8dff(0x184)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x3f8dff(0x163)+CLI_BIN_NAME+'\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]');await _0x53dfbc({'projectCode':_0x19a453,'appCode':_0xec65,'env':_0x344182,'cookie':_0x585093[_0x3f8dff(0x181)],'currentDir':_0x10904f,'nonInteractive':!![],'templateSource':_0xd953d0});}else await _0x53dfbc({'projectCode':_0x19a453,'appCode':_0xec65,'env':_0x344182,'cookie':_0x585093[_0x3f8dff(0x181)],'currentDir':_0x10904f,'templateSource':_0xd953d0});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a187_0xb7549f(0x17c),'command':a187_0xb7549f(0x162),'description':a187_0xb7549f(0x160),'risk':a187_0xb7549f(0x17b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2cb8fe){const _0x497138=a187_0xb7549f;return await upgradeApp(_0x2cb8fe[_0x497138(0x170)],{'yes':_0x2cb8fe['bool']('yes')}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a188_0xad0a10=a188_0x3488;(function(_0x66162c,_0x1094d1){const _0xb11631=a188_0x3488,_0x39aa0a=_0x66162c();while(!![]){try{const _0x4ea8f3=parseInt(_0xb11631(0x204))/0x1*(-parseInt(_0xb11631(0x1ba))/0x2)+parseInt(_0xb11631(0x203))/0x3*(parseInt(_0xb11631(0x200))/0x4)+-parseInt(_0xb11631(0x1c6))/0x5+parseInt(_0xb11631(0x212))/0x6+parseInt(_0xb11631(0x1a9))/0x7*(-parseInt(_0xb11631(0x1cf))/0x8)+-parseInt(_0xb11631(0x1b7))/0x9+parseInt(_0xb11631(0x205))/0xa*(parseInt(_0xb11631(0x1aa))/0xb);if(_0x4ea8f3===_0x1094d1)break;else _0x39aa0a['push'](_0x39aa0a['shift']());}catch(_0x45f570){_0x39aa0a['push'](_0x39aa0a['shift']());}}}(a188_0x4ad9,0x6aaf8));import a188_0x153756 from'chalk';import a188_0x461dff from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a188_0x3488(_0x1fcf5f,_0x105b5d){_0x1fcf5f=_0x1fcf5f-0x199;const _0x4ad95c=a188_0x4ad9();let _0x348878=_0x4ad95c[_0x1fcf5f];return _0x348878;}import{resolve}from'node:path';import{NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=[a188_0xad0a10(0x1df),a188_0xad0a10(0x1d3)];function collectIdeSkillFiles(_0x54d328){const _0x44fb30=a188_0xad0a10,_0x6abfaf=[];for(const _0x490f70 of Object[_0x44fb30(0x20c)](CORE_IDE_CONFIGS)){if(_0x490f70[_0x44fb30(0x1f1)])for(const _0x481424 of _0x490f70[_0x44fb30(0x1f1)]){_0x6abfaf[_0x44fb30(0x1dc)](resolve(_0x54d328,_0x481424['path']));}}return _0x6abfaf;}function analyse(_0x37e673){const _0x194551=a188_0xad0a10;let _0x2391ce=null;const _0x45d4c4=resolve(_0x37e673,NEW_CONFIG_NAME),_0x5c53f9=existsSync(_0x45d4c4);for(const _0x1d6cf4 of LEGACY_CONFIG_NAMES){const _0x1711e7=resolve(_0x37e673,_0x1d6cf4);if(existsSync(_0x1711e7)){const _0x144e49=readConfigFile(_0x1711e7),_0x67b12=Object[_0x194551(0x1c0)](_0x144e49)[_0x194551(0x215)](_0x49044e=>typeof _0x144e49[_0x49044e]!==_0x194551(0x214));_0x2391ce={'oldPath':_0x1711e7,'hasNewConfig':_0x5c53f9,'fields':_0x67b12};break;}}const _0x20a40f=[],_0x1d80f6=resolve(_0x37e673,'.lovrabet');if(existsSync(_0x1d80f6))_0x20a40f[_0x194551(0x1dc)](_0x1d80f6);const _0x2505d4=resolve(_0x37e673,_0x194551(0x1d2));if(existsSync(_0x2505d4))_0x20a40f[_0x194551(0x1dc)](_0x2505d4);const _0x58a506=resolve(_0x37e673,'.claude/skills/lovrabet');if(existsSync(_0x58a506))_0x20a40f[_0x194551(0x1dc)](_0x58a506);for(const _0x4fe063 of collectIdeSkillFiles(_0x37e673)){if(existsSync(_0x4fe063))_0x20a40f[_0x194551(0x1dc)](_0x4fe063);}let _0x36ae54=null;const _0x54ff02=resolve(_0x37e673,_0x194551(0x20f));if(existsSync(_0x54ff02))try{const _0x6fb40a=JSON['parse'](readFileSync(_0x54ff02,'utf8'));if(_0x6fb40a?.[_0x194551(0x1ca)]&&typeof _0x6fb40a['mcpServers']===_0x194551(0x1f6)){const _0x326d9e=[];for(const [_0x2f41e4,_0x42378b]of Object['entries'](_0x6fb40a['mcpServers'])){const _0x2b878a=_0x42378b;_0x2b878a?.[_0x194551(0x1b4)]&&Array['isArray'](_0x2b878a['args'])&&_0x2b878a[_0x194551(0x1b4)][_0x194551(0x1e7)](_0x20a394=>typeof _0x20a394===_0x194551(0x1c8)&&_0x20a394['includes']('@lovrabet/dataset-mcp-server'))&&_0x326d9e['push'](_0x2f41e4);}_0x326d9e['length']>0x0&&(_0x36ae54={'path':_0x54ff02,'keys':_0x326d9e});}}catch{}const _0x1f68b2=_0x20a40f[_0x194551(0x201)]>0x0||_0x2391ce!==null;let _0x4bae71=null;const _0x4ac535=resolve(_0x37e673,_0x194551(0x1a3));if(existsSync(_0x4ac535))try{const _0x51a4c3=JSON[_0x194551(0x1d7)](readFileSync(_0x4ac535,_0x194551(0x1bc)));for(const _0x12fa2 of['dependencies',_0x194551(0x1b6)]){const _0x4201de=_0x51a4c3?.[_0x12fa2]?.[_0x194551(0x208)];if(typeof _0x4201de===_0x194551(0x1c8)){_0x4201de!==_0x194551(0x1b5)&&(_0x4bae71={'pkgPath':_0x4ac535,'currentVersion':_0x4201de,'field':_0x12fa2});break;}}}catch{}return{'configMigration':_0x2391ce,'oldArtifacts':_0x20a40f,'oldMcpConfig':_0x36ae54,'needsSkillSwap':_0x1f68b2,'sdkUpgrade':_0x4bae71};}function printReport(_0x44ec00){const _0x5ead55=a188_0xad0a10,{configMigration:_0x3c66cf,oldArtifacts:_0x3b3e63,oldMcpConfig:_0x5084c9,needsSkillSwap:_0x34b9dc}=_0x44ec00;console[_0x5ead55(0x1dd)](''),console[_0x5ead55(0x1dd)](a188_0x153756['bold']('===\x20Upgrade\x20Analysis\x20===')),console[_0x5ead55(0x1dd)]('');_0x3c66cf?(console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x1ee))+('\x20\x20'+a188_0x153756['yellow'](_0x3c66cf[_0x5ead55(0x1b2)]))),console[_0x5ead55(0x1dd)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x3c66cf[_0x5ead55(0x206)]?a188_0x153756[_0x5ead55(0x1d8)]('already\x20exists\x20(will\x20merge)'):a188_0x153756[_0x5ead55(0x1f9)](_0x5ead55(0x19b)))),console[_0x5ead55(0x1dd)](_0x5ead55(0x1db)+_0x3c66cf[_0x5ead55(0x1e6)][_0x5ead55(0x1b1)](',\x20')),console[_0x5ead55(0x1dd)](_0x5ead55(0x1de))):console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x1ee))+'\x20\x20'+a188_0x153756['gray'](_0x5ead55(0x1ae)));console[_0x5ead55(0x1dd)]('');if(_0x3b3e63[_0x5ead55(0x201)]>0x0){console['log'](a188_0x153756['cyan'](_0x5ead55(0x19e)));for(const _0x8ac1fb of _0x3b3e63){console[_0x5ead55(0x1dd)]('\x20\x20'+a188_0x153756[_0x5ead55(0x1fd)](_0x5ead55(0x218))+'\x20\x20'+_0x8ac1fb);}console['log']('\x20\x20Action:\x20delete');}else console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x19e))+'\x20\x20'+a188_0x153756[_0x5ead55(0x1f9)]('none\x20found'));console[_0x5ead55(0x1dd)]('');_0x5084c9?(console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)]('MCP\x20config:')+('\x20\x20'+a188_0x153756[_0x5ead55(0x1f7)](_0x5084c9[_0x5ead55(0x1f4)])+_0x5ead55(0x1a7)+_0x5084c9[_0x5ead55(0x1c0)][_0x5ead55(0x1b1)](',\x20'))),console[_0x5ead55(0x1dd)](_0x5ead55(0x207))):console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)]('MCP\x20config:')+'\x20\x20'+a188_0x153756['gray'](_0x5ead55(0x1bb)));console[_0x5ead55(0x1dd)](''),console['log'](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x1a2))+('\x20\x20'+(_0x34b9dc?a188_0x153756['yellow'](_0x5ead55(0x1ce)):a188_0x153756[_0x5ead55(0x1d8)]('not\x20needed'))));_0x34b9dc&&console[_0x5ead55(0x1dd)](_0x5ead55(0x1eb)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x5ead55(0x1dd)]('');if(_0x44ec00[_0x5ead55(0x20d)]){const {currentVersion:_0x376697,field:_0x19f647,pkgPath:_0x306a91}=_0x44ec00['sdkUpgrade'];console[_0x5ead55(0x1dd)](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x213))+('\x20\x20'+a188_0x153756['yellow'](_0x306a91))),console[_0x5ead55(0x1dd)](_0x5ead55(0x1f8)+_0x19f647+':\x20'+a188_0x153756['yellow'](_0x376697)+_0x5ead55(0x21b)+a188_0x153756[_0x5ead55(0x1d8)]('latest')),console[_0x5ead55(0x1dd)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a188_0x153756[_0x5ead55(0x1c2)](_0x5ead55(0x213))+'\x20\x20'+a188_0x153756[_0x5ead55(0x1f9)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x5ead55(0x1dd)]('');}function execConfigMigration(_0x288a53,_0x5b3b8e){const _0x12be5b=a188_0xad0a10,{configMigration:_0x5c9e5d}=_0x288a53;if(!_0x5c9e5d?.['oldPath'])return{'step':0x1,'label':_0x12be5b(0x1e3),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x59a1f0=readConfigFile(_0x5c9e5d[_0x12be5b(0x1b2)]),_0x58df78=resolve(_0x5b3b8e,NEW_CONFIG_NAME),_0x50bdca=_0x5c9e5d[_0x12be5b(0x206)]?readConfigFile(_0x58df78):{};for(const [_0x278dcb,_0x4e9c45]of Object[_0x12be5b(0x1be)](_0x59a1f0)){!(_0x278dcb in _0x50bdca)&&(_0x50bdca[_0x278dcb]=_0x4e9c45);}writeConfigFile(_0x58df78,_0x50bdca);const _0xe76b13=_0x5c9e5d[_0x12be5b(0x1b2)]+'.bak';return renameSync(_0x5c9e5d[_0x12be5b(0x1b2)],_0xe76b13),{'step':0x1,'label':_0x12be5b(0x1e3),'ok':!![],'detail':_0x5c9e5d[_0x12be5b(0x1b2)]+_0x12be5b(0x21b)+_0x58df78+_0x12be5b(0x1f0)+_0xe76b13+')'};}function execRemoveOldArtifacts(_0x15cc79){const _0x7facf5=a188_0xad0a10,_0x5300c9=[];for(const _0x461fbe of _0x15cc79){try{if(!existsSync(_0x461fbe))continue;const _0x458ab=tryStat(_0x461fbe);_0x458ab?.[_0x7facf5(0x1e2)]()?rmSync(_0x461fbe,{'recursive':!![],'force':!![]}):unlinkSync(_0x461fbe);}catch(_0x1d5aa8){_0x5300c9[_0x7facf5(0x1dc)](_0x461fbe+':\x20'+_0x1d5aa8[_0x7facf5(0x1e1)]);}}return{'step':0x3,'label':_0x7facf5(0x211),'ok':_0x5300c9['length']===0x0,'detail':_0x5300c9[_0x7facf5(0x201)]>0x0?_0x15cc79[_0x7facf5(0x201)]-_0x5300c9[_0x7facf5(0x201)]+'/'+_0x15cc79[_0x7facf5(0x201)]+_0x7facf5(0x1e8)+_0x5300c9[_0x7facf5(0x1b1)](';\x20')+')':_0x15cc79[_0x7facf5(0x201)]+_0x7facf5(0x1fe)};}function execCleanMcp(_0x1fb596){const _0x1c5a11=a188_0xad0a10;if(!_0x1fb596[_0x1c5a11(0x1d1)])return{'step':0x4,'label':_0x1c5a11(0x1c9),'ok':!![],'detail':_0x1c5a11(0x1c3)};try{const _0x5ef344=readFileSync(_0x1fb596['oldMcpConfig']['path'],_0x1c5a11(0x1bc)),_0x379d30=JSON[_0x1c5a11(0x1d7)](_0x5ef344);if(_0x379d30?.[_0x1c5a11(0x1ca)]&&typeof _0x379d30[_0x1c5a11(0x1ca)]==='object'){const _0x57527e=[];for(const [_0x297927,_0x294c0e]of Object['entries'](_0x379d30[_0x1c5a11(0x1ca)])){_0x294c0e?.[_0x1c5a11(0x1b4)]&&Array[_0x1c5a11(0x1ab)](_0x294c0e[_0x1c5a11(0x1b4)])&&_0x294c0e['args']['some'](_0x253938=>typeof _0x253938===_0x1c5a11(0x1c8)&&_0x253938[_0x1c5a11(0x1a5)]('@lovrabet/dataset-mcp-server'))&&_0x57527e[_0x1c5a11(0x1dc)](_0x297927);}for(const _0x5a8bb7 of _0x57527e){delete _0x379d30[_0x1c5a11(0x1ca)][_0x5a8bb7];}return _0x57527e[_0x1c5a11(0x201)]>0x0&&writeFileSync(_0x1fb596[_0x1c5a11(0x1d1)]['path'],JSON['stringify'](_0x379d30,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x1c5a11(0x1c9),'ok':!![],'detail':_0x1c5a11(0x1fa)+_0x57527e[_0x1c5a11(0x1b1)](',\x20')+'\x20from\x20'+_0x1fb596['oldMcpConfig']['path']};}return{'step':0x4,'label':_0x1c5a11(0x1c9),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x547466){return{'step':0x4,'label':_0x1c5a11(0x1c9),'ok':![],'detail':_0x547466[_0x1c5a11(0x1e1)]};}}function execSkillsRemove(_0x29b455,_0x20127a){const _0xd8f5f8=a188_0xad0a10,_0x267920=runNpxSkillsRemove(_0x29b455,{'stdio':_0xd8f5f8(0x1cc),'yes':_0x20127a});return{'step':0x5,'label':_0xd8f5f8(0x1c4),'ok':_0x267920['ok'],'detail':_0x267920['ok']?_0xd8f5f8(0x216):_0x267920['error']??_0xd8f5f8(0x1b0)+_0x267920[_0xd8f5f8(0x20a)]};}function execSkillsAdd(_0x74505,_0x28c009){const _0x1426a9=a188_0xad0a10,_0x48d42e=runNpxSkillsAddGlobal(_0x74505,_0x1426a9(0x20e),{'stdio':_0x1426a9(0x1cc),'yes':_0x28c009});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x48d42e['ok'],'detail':_0x48d42e['ok']?_0x1426a9(0x19d):_0x48d42e[_0x1426a9(0x219)]??_0x1426a9(0x1b0)+_0x48d42e[_0x1426a9(0x20a)]};}function execUpgradeSdk(_0x18fe81){const _0x4e1d3e=a188_0xad0a10;if(!_0x18fe81[_0x4e1d3e(0x20d)])return{'step':0x7,'label':_0x4e1d3e(0x1cd),'ok':!![],'detail':_0x4e1d3e(0x1e0)};const {pkgPath:_0x25458d,currentVersion:_0x316a0e,field:_0x19a9aa}=_0x18fe81[_0x4e1d3e(0x20d)];try{const _0x2bc198=readFileSync(_0x25458d,_0x4e1d3e(0x1bc)),_0x3995d8=JSON[_0x4e1d3e(0x1d7)](_0x2bc198);return _0x3995d8[_0x19a9aa][_0x4e1d3e(0x208)]=_0x4e1d3e(0x1b5),writeFileSync(_0x25458d,JSON[_0x4e1d3e(0x1f2)](_0x3995d8,null,0x2)+'\x0a',_0x4e1d3e(0x1bc)),{'step':0x7,'label':_0x4e1d3e(0x1cd),'ok':!![],'detail':_0x19a9aa+_0x4e1d3e(0x1a4)+_0x316a0e+_0x4e1d3e(0x1e4)};}catch(_0x4060f9){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x4060f9[_0x4e1d3e(0x1e1)]};}}function tryStat(_0x5594e7){try{return statSync(_0x5594e7);}catch{return undefined;}}function a188_0x4ad9(){const _0x24dfef=['.lovrabetrc','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','failed','step','parse','green','\x20\x20\x20\x20\x20\x20\x20','\x20\x20Step\x20','\x20\x20Fields\x20to\x20migrate:\x20','push','log','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','.lovrabet.json','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','message','isDirectory','Config\x20migration','\x20→\x20latest','Step\x206/7:\x20Installing\x20new\x20skill...','fields','some','\x20removed\x20(','start','oldArtifacts','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','Step\x201/7:\x20Migrating\x20config...','Config\x20file:','Upgrade\x20completed\x20successfully!','\x20(backup:\x20','files','stringify','detail','path','succeed','object','yellow','\x20\x20Current\x20version\x20in\x20','gray','removed\x20','\x20\x20#\x20or','white','red','\x20removed','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','8uWCvTT','length','needsSkillSwap','956073QBrSVD','4aawEPz','11670590gBaawf','hasNewConfig','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','@lovrabet/sdk','Remove\x20.lovrabet/','status','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','values','sdkUpgrade','lovrabet/rabetbase','.cursor/mcp.json','\x20\x20npm\x20install','Remove\x20legacy\x20artifacts','2252856IqLYVv','@lovrabet/sdk:','undefined','filter','lovrabet/lovrabet-skill\x20removed','Step\x201/7:\x20Config\x20migration\x20—\x20','FOUND','error','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20→\x20','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x204/7:\x20MCP\x20config\x20—\x20','not\x20found\x20(will\x20create)','Upgrade\x20cancelled.','lovrabet/rabetbase\x20installed\x20globally','Legacy\x20artifacts:','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','yes','Proceed\x20with\x20upgrade?','Skill\x20swap:','package.json','[\x22@lovrabet/sdk\x22]:\x20','includes','FAIL','\x20→\x20keys:\x20','info','221501uJvpxM','11XWhMOc','isArray','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','===\x20Upgrade\x20Summary\x20===','no\x20legacy\x20config\x20found','bold','exit\x20','join','oldPath','CANCEL','args','latest','devDependencies','5427477SzzyPi','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','394636YMWlJd','no\x20legacy\x20entry','utf8','label','entries','cwd','keys','done','cyan','skipped','Remove\x20old\x20skill','fail','329105yQiqeW','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','string','Clean\x20MCP\x20config','mcpServers','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','inherit','Upgrade\x20@lovrabet/sdk','needed','72cOrZyA','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','oldMcpConfig','.cursor/rules/lovrabet_rules.mdc'];a188_0x4ad9=function(){return _0x24dfef;};return a188_0x4ad9();}function printSummary(_0x14ade6){const _0x1c4d7a=a188_0xad0a10;console[_0x1c4d7a(0x1dd)](''),console[_0x1c4d7a(0x1dd)](a188_0x153756[_0x1c4d7a(0x1af)](_0x1c4d7a(0x1ad))),console[_0x1c4d7a(0x1dd)]('');for(const _0x42eb34 of _0x14ade6){const _0x16bced=_0x42eb34['ok']?a188_0x153756['green']('OK'):a188_0x153756['red'](_0x1c4d7a(0x1a6));console[_0x1c4d7a(0x1dd)]('\x20\x20'+_0x16bced+_0x1c4d7a(0x1da)+_0x42eb34[_0x1c4d7a(0x1d6)]+':\x20'+_0x42eb34[_0x1c4d7a(0x1bd)]);if(_0x42eb34[_0x1c4d7a(0x1f3)])console['log'](_0x1c4d7a(0x1d9)+a188_0x153756[_0x1c4d7a(0x1f9)](_0x42eb34[_0x1c4d7a(0x1f3)]));}console[_0x1c4d7a(0x1dd)]('');}export async function upgradeApp(_0x41b51f,_0xe71c89){const _0x394dcc=a188_0xad0a10,_0x13c025=process[_0x394dcc(0x1bf)](),_0x24e287=analyse(_0x13c025),_0x24c292=!_0x24e287['configMigration']&&_0x24e287[_0x394dcc(0x1ea)][_0x394dcc(0x201)]===0x0&&!_0x24e287[_0x394dcc(0x1d1)]&&!_0x24e287[_0x394dcc(0x202)]&&!_0x24e287[_0x394dcc(0x20d)];if(_0x24c292){console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1d8)](_0x394dcc(0x1cb)));return;}printReport(_0x24e287);const _0x4b29ef=!!(_0xe71c89[_0x394dcc(0x1a0)]||_0xe71c89['Y']||_0x41b51f);if(!_0x4b29ef)try{const _0xc008b4=await askConfirm(_0x394dcc(0x1a1));if(!_0xc008b4){console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1f9)](_0x394dcc(0x19c)));return;}}catch(_0x1369db){if(_0x1369db?.['message']===_0x394dcc(0x1b3)){console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1f9)](_0x394dcc(0x19c)));return;}throw _0x1369db;}const _0x10fe38=[],_0x507835=a188_0x461dff({'text':_0x394dcc(0x1ed),'color':_0x394dcc(0x1c2)})[_0x394dcc(0x1e9)](),_0x2bf878=execConfigMigration(_0x24e287,_0x13c025);_0x10fe38[_0x394dcc(0x1dc)](_0x2bf878),_0x507835[_0x2bf878['ok']?_0x394dcc(0x1f5):_0x394dcc(0x1c5)](_0x394dcc(0x217)+(_0x2bf878['detail']??(_0x2bf878['ok']?'done':_0x394dcc(0x1d5))));const _0x422381=resolve(_0x13c025,'.lovrabet'),_0x41567e=a188_0x461dff({'text':_0x394dcc(0x1b9),'color':_0x394dcc(0x1c2)})['start']();if(existsSync(_0x422381))try{rmSync(_0x422381,{'recursive':!![],'force':!![]}),_0x41567e[_0x394dcc(0x1f5)](_0x394dcc(0x1ff)),_0x10fe38[_0x394dcc(0x1dc)]({'step':0x2,'label':_0x394dcc(0x209),'ok':!![]});}catch(_0x114cd3){_0x41567e[_0x394dcc(0x1c5)](_0x394dcc(0x1d4)+_0x114cd3[_0x394dcc(0x1e1)]),_0x10fe38[_0x394dcc(0x1dc)]({'step':0x2,'label':_0x394dcc(0x209),'ok':![],'detail':_0x114cd3[_0x394dcc(0x1e1)]});}else _0x41567e[_0x394dcc(0x1a8)](_0x394dcc(0x21a)),_0x10fe38[_0x394dcc(0x1dc)]({'step':0x2,'label':_0x394dcc(0x209),'ok':!![],'detail':_0x394dcc(0x1c3)});const _0x3f6f55=a188_0x461dff({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x394dcc(0x1c2)})[_0x394dcc(0x1e9)](),_0x19faa9=execRemoveOldArtifacts(_0x24e287['oldArtifacts']);_0x10fe38['push'](_0x19faa9),_0x3f6f55[_0x19faa9['ok']?_0x394dcc(0x1f5):_0x394dcc(0x1c5)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x19faa9[_0x394dcc(0x1f3)]??(_0x19faa9['ok']?_0x394dcc(0x1c1):_0x394dcc(0x1d5))));const _0xa2b35a=a188_0x461dff({'text':_0x394dcc(0x1b8),'color':'cyan'})[_0x394dcc(0x1e9)](),_0x29d235=execCleanMcp(_0x24e287);_0x10fe38['push'](_0x29d235),_0xa2b35a[_0x29d235['ok']?_0x394dcc(0x1f5):_0x394dcc(0x1c5)](_0x394dcc(0x19a)+(_0x29d235[_0x394dcc(0x1f3)]??(_0x29d235['ok']?_0x394dcc(0x1c1):_0x394dcc(0x1d5))));const _0x5b120f=a188_0x461dff({'text':_0x394dcc(0x199),'color':_0x394dcc(0x1c2)})[_0x394dcc(0x1e9)](),_0x169193=execSkillsRemove(_0x13c025,_0x4b29ef);_0x10fe38[_0x394dcc(0x1dc)](_0x169193),_0x5b120f[_0x169193['ok']?_0x394dcc(0x1f5):'fail'](_0x394dcc(0x1ac)+(_0x169193['detail']??(_0x169193['ok']?_0x394dcc(0x1c1):_0x394dcc(0x1d5))));const _0x303d42=a188_0x461dff({'text':_0x394dcc(0x1e5),'color':_0x394dcc(0x1c2)})[_0x394dcc(0x1e9)](),_0x3f55d3=execSkillsAdd(_0x13c025,_0x4b29ef);_0x10fe38[_0x394dcc(0x1dc)](_0x3f55d3),_0x303d42[_0x3f55d3['ok']?_0x394dcc(0x1f5):_0x394dcc(0x1c5)](_0x394dcc(0x1c7)+(_0x3f55d3['detail']??(_0x3f55d3['ok']?_0x394dcc(0x1c1):_0x394dcc(0x1d5))));const _0x909e96=a188_0x461dff({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x394dcc(0x1c2)})[_0x394dcc(0x1e9)](),_0x32350d=execUpgradeSdk(_0x24e287);_0x10fe38['push'](_0x32350d),_0x909e96[_0x32350d['ok']?_0x394dcc(0x1f5):_0x394dcc(0x1c5)](_0x394dcc(0x1ec)+(_0x32350d[_0x394dcc(0x1f3)]??(_0x32350d['ok']?'done':_0x394dcc(0x1d5)))),printSummary(_0x10fe38);const _0xbd83b5=_0x10fe38[_0x394dcc(0x1e7)](_0x12bb5e=>!_0x12bb5e['ok']);_0xbd83b5?console[_0x394dcc(0x1dd)](a188_0x153756['yellow'](_0x394dcc(0x19f))):console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1d8)](_0x394dcc(0x1ef))),_0x32350d['ok']&&_0x24e287['sdkUpgrade']&&(console['log'](''),console['log'](a188_0x153756[_0x394dcc(0x1af)][_0x394dcc(0x1c2)](_0x394dcc(0x20b))),console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1c2)](_0x394dcc(0x1d0))),console[_0x394dcc(0x1dd)](''),console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1fc)](_0x394dcc(0x210))),console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1fc)](_0x394dcc(0x1fb))),console[_0x394dcc(0x1dd)](a188_0x153756[_0x394dcc(0x1fc)]('\x20\x20bun\x20install')),console[_0x394dcc(0x1dd)](''));}
1
+ const a188_0x4c912e=a188_0x54cb;(function(_0x5d7360,_0x243447){const _0x26d022=a188_0x54cb,_0x5006cb=_0x5d7360();while(!![]){try{const _0x3ff56b=-parseInt(_0x26d022(0x1f6))/0x1*(-parseInt(_0x26d022(0x1b6))/0x2)+parseInt(_0x26d022(0x1cd))/0x3+parseInt(_0x26d022(0x20d))/0x4+-parseInt(_0x26d022(0x1cb))/0x5*(-parseInt(_0x26d022(0x194))/0x6)+-parseInt(_0x26d022(0x18c))/0x7+-parseInt(_0x26d022(0x196))/0x8*(parseInt(_0x26d022(0x1b7))/0x9)+-parseInt(_0x26d022(0x1e0))/0xa;if(_0x3ff56b===_0x243447)break;else _0x5006cb['push'](_0x5006cb['shift']());}catch(_0x4acfa9){_0x5006cb['push'](_0x5006cb['shift']());}}}(a188_0xb822,0x7ed90));import a188_0x4a04e0 from'chalk';import a188_0x407e3c from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=[a188_0x4c912e(0x19a),a188_0x4c912e(0x19d)];function a188_0xb822(){const _0x4f504d=['status','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','undefined','already\x20exists\x20(will\x20merge)','lovrabet/rabetbase\x20installed\x20globally','oldArtifacts','Config\x20file:','Upgrade\x20cancelled.','Upgrade\x20@lovrabet/sdk','length','Step\x201/7:\x20Migrating\x20config...','\x20\x20Step\x20','no\x20matching\x20entry\x20found','.cursor/rules/lovrabet_rules.mdc','object','158075RcrcKR','Remove\x20.lovrabet/','gray','===\x20Upgrade\x20Summary\x20===','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Step\x204/7:\x20MCP\x20config\x20—\x20','includes','yellow','parse','white','\x20\x20\x20\x20\x20\x20\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20Action:\x20delete','isArray','\x20(backup:\x20','\x20→\x20','not\x20found\x20or\x20already\x20at\x20latest','bold','step','message','entries','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','.claude/skills/lovrabet','3022812lKlJeG','Step\x201/7:\x20Config\x20migration\x20—\x20','path','latest','sdkUpgrade','1191449WmweNO','yes','CANCEL','files','\x20\x20New\x20config\x20(.rabetbase.json):\x20','fields','hasNewConfig','oldPath','337386zbTaWP','\x20\x20bun\x20install','1293896hLPjeh','Remove\x20old\x20skill','needed','\x20removed','.lovrabet.json','detail','needsSkillSwap','.lovrabetrc','removed\x20','succeed','failed','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','cwd','@lovrabet/sdk:','keys','error','[\x22@lovrabet/sdk\x22]:\x20','.lovrabet','Step\x204/7:\x20Cleaning\x20MCP\x20config...','\x20removed\x20(','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','lovrabet/rabetbase','MCP\x20config:','some','inherit','skipped','skipped\x20(no\x20legacy\x20config)','mcpServers','.cursor/mcp.json','args','fail','start','4fUwukh','27avavPl','\x20from\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','lovrabet/lovrabet-skill\x20removed','string','Legacy\x20artifacts:','devDependencies','green','stringify','join','dependencies','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','oldMcpConfig','utf8','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x205/7:\x20Removing\x20old\x20skill...','@lovrabet/sdk','not\x20found\x20(will\x20create)','red','30AoVbNc','not\x20needed','1627218YfwncC','@lovrabet/dataset-mcp-server','none\x20found','Install\x20new\x20skill','FOUND','.bak','\x20\x20Fields\x20to\x20migrate:\x20','configMigration','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','FAIL','\x20→\x20keys:\x20','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','done','Proceed\x20with\x20upgrade?','Config\x20migration','values','\x20\x20Current\x20version\x20in\x20','log','7766590IlWipf','no\x20legacy\x20entry','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Clean\x20MCP\x20config','cyan','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','push'];a188_0xb822=function(){return _0x4f504d;};return a188_0xb822();}function collectIdeSkillFiles(_0xd27bac){const _0x37a230=a188_0x4c912e,_0x9dd19d=[];for(const _0x2a0732 of Object[_0x37a230(0x1dd)](CORE_IDE_CONFIGS)){if(_0x2a0732[_0x37a230(0x18f)])for(const _0x37765a of _0x2a0732[_0x37a230(0x18f)]){_0x9dd19d[_0x37a230(0x1e6)](resolve(_0xd27bac,_0x37765a[_0x37a230(0x189)]));}}return _0x9dd19d;}function analyse(_0x18ed99){const _0x33adf6=a188_0x4c912e;let _0x473b33=null;const _0x243e2d=resolve(_0x18ed99,NEW_CONFIG_NAME),_0x5a3c41=existsSync(_0x243e2d);for(const _0x199e53 of LEGACY_CONFIG_NAMES){const _0x688fab=resolve(_0x18ed99,_0x199e53);if(existsSync(_0x688fab)){const _0x142ff9=readConfigFile(_0x688fab),_0x2a21a3=Object[_0x33adf6(0x1a4)](_0x142ff9)['filter'](_0x258f06=>typeof _0x142ff9[_0x258f06]!==_0x33adf6(0x1e9));_0x473b33={'oldPath':_0x688fab,'hasNewConfig':_0x5a3c41,'fields':_0x2a21a3};break;}}const _0x129b90=[],_0x327114=resolve(_0x18ed99,_0x33adf6(0x1a7));if(existsSync(_0x327114))_0x129b90['push'](_0x327114);const _0x40a8b9=resolve(_0x18ed99,_0x33adf6(0x1f4));if(existsSync(_0x40a8b9))_0x129b90[_0x33adf6(0x1e6)](_0x40a8b9);const _0x459632=resolve(_0x18ed99,_0x33adf6(0x20c));if(existsSync(_0x459632))_0x129b90[_0x33adf6(0x1e6)](_0x459632);for(const _0x246d81 of collectIdeSkillFiles(_0x18ed99)){if(existsSync(_0x246d81))_0x129b90[_0x33adf6(0x1e6)](_0x246d81);}let _0x15cf17=null;const _0x3cc69d=resolve(_0x18ed99,_0x33adf6(0x1b2));if(existsSync(_0x3cc69d))try{const _0x24a30a=JSON[_0x33adf6(0x1fe)](readFileSync(_0x3cc69d,_0x33adf6(0x1c5)));if(_0x24a30a?.['mcpServers']&&typeof _0x24a30a['mcpServers']==='object'){const _0x481623=[];for(const [_0x22d5e0,_0x339dc3]of Object[_0x33adf6(0x20a)](_0x24a30a[_0x33adf6(0x1b1)])){const _0x28a091=_0x339dc3;_0x28a091?.[_0x33adf6(0x1b3)]&&Array[_0x33adf6(0x203)](_0x28a091[_0x33adf6(0x1b3)])&&_0x28a091[_0x33adf6(0x1b3)]['some'](_0x518c58=>typeof _0x518c58===_0x33adf6(0x1bb)&&_0x518c58[_0x33adf6(0x1fc)]('@lovrabet/dataset-mcp-server'))&&_0x481623[_0x33adf6(0x1e6)](_0x22d5e0);}_0x481623[_0x33adf6(0x1f0)]>0x0&&(_0x15cf17={'path':_0x3cc69d,'keys':_0x481623});}}catch{}const _0x27722c=_0x129b90[_0x33adf6(0x1f0)]>0x0||_0x473b33!==null;let _0x3c8d24=null;const _0xdb2664=resolve(_0x18ed99,'package.json');if(existsSync(_0xdb2664))try{const _0xbf6e0a=JSON[_0x33adf6(0x1fe)](readFileSync(_0xdb2664,_0x33adf6(0x1c5)));for(const _0x512d25 of[_0x33adf6(0x1c1),_0x33adf6(0x1bd)]){const _0x52ba0c=_0xbf6e0a?.[_0x512d25]?.['@lovrabet/sdk'];if(typeof _0x52ba0c===_0x33adf6(0x1bb)){_0x52ba0c!==_0x33adf6(0x18a)&&(_0x3c8d24={'pkgPath':_0xdb2664,'currentVersion':_0x52ba0c,'field':_0x512d25});break;}}}catch{}return{'configMigration':_0x473b33,'oldArtifacts':_0x129b90,'oldMcpConfig':_0x15cf17,'needsSkillSwap':_0x27722c,'sdkUpgrade':_0x3c8d24};}function printReport(_0x38907d){const _0x2262db=a188_0x4c912e,{configMigration:_0x2f9088,oldArtifacts:_0x291b94,oldMcpConfig:_0x3af1ea,needsSkillSwap:_0x3687dd}=_0x38907d;console['log'](''),console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x207)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x2262db(0x1df)]('');_0x2f9088?(console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)](_0x2262db(0x1ed))+('\x20\x20'+a188_0x4a04e0[_0x2262db(0x1fd)](_0x2f9088['oldPath']))),console['log'](_0x2262db(0x190)+(_0x2f9088[_0x2262db(0x192)]?a188_0x4a04e0[_0x2262db(0x1be)](_0x2262db(0x1ea)):a188_0x4a04e0[_0x2262db(0x1f8)](_0x2262db(0x1c9)))),console['log'](_0x2262db(0x1d3)+_0x2f9088[_0x2262db(0x191)][_0x2262db(0x1c0)](',\x20')),console[_0x2262db(0x1df)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console['log'](a188_0x4a04e0[_0x2262db(0x1e4)]('Config\x20file:')+'\x20\x20'+a188_0x4a04e0[_0x2262db(0x1f8)]('no\x20legacy\x20config\x20found'));console[_0x2262db(0x1df)]('');if(_0x291b94[_0x2262db(0x1f0)]>0x0){console['log'](a188_0x4a04e0[_0x2262db(0x1e4)](_0x2262db(0x1bc)));for(const _0x4a6ce9 of _0x291b94){console['log']('\x20\x20'+a188_0x4a04e0[_0x2262db(0x1ca)](_0x2262db(0x1d1))+'\x20\x20'+_0x4a6ce9);}console['log'](_0x2262db(0x202));}else console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)](_0x2262db(0x1bc))+'\x20\x20'+a188_0x4a04e0[_0x2262db(0x1f8)](_0x2262db(0x1cf)));console[_0x2262db(0x1df)]('');_0x3af1ea?(console['log'](a188_0x4a04e0['cyan'](_0x2262db(0x1ac))+('\x20\x20'+a188_0x4a04e0['yellow'](_0x3af1ea['path'])+_0x2262db(0x1d8)+_0x3af1ea[_0x2262db(0x1a4)][_0x2262db(0x1c0)](',\x20'))),console[_0x2262db(0x1df)](_0x2262db(0x20b))):console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)]('MCP\x20config:')+'\x20\x20'+a188_0x4a04e0['gray'](_0x2262db(0x1e1)));console[_0x2262db(0x1df)](''),console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)]('Skill\x20swap:')+('\x20\x20'+(_0x3687dd?a188_0x4a04e0[_0x2262db(0x1fd)](_0x2262db(0x198)):a188_0x4a04e0[_0x2262db(0x1be)](_0x2262db(0x1cc)))));_0x3687dd&&console[_0x2262db(0x1df)](_0x2262db(0x1a1)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2262db(0x1df)]('');if(_0x38907d['sdkUpgrade']){const {currentVersion:_0x5b8c32,field:_0x3923e0,pkgPath:_0x2c3553}=_0x38907d['sdkUpgrade'];console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)](_0x2262db(0x1a3))+('\x20\x20'+a188_0x4a04e0[_0x2262db(0x1fd)](_0x2c3553))),console[_0x2262db(0x1df)](_0x2262db(0x1de)+_0x3923e0+':\x20'+a188_0x4a04e0['yellow'](_0x5b8c32)+_0x2262db(0x205)+a188_0x4a04e0[_0x2262db(0x1be)](_0x2262db(0x18a))),console[_0x2262db(0x1df)](_0x2262db(0x1c2));}else console[_0x2262db(0x1df)](a188_0x4a04e0[_0x2262db(0x1e4)](_0x2262db(0x1a3))+'\x20\x20'+a188_0x4a04e0[_0x2262db(0x1f8)](_0x2262db(0x206)));console[_0x2262db(0x1df)]('');}function execConfigMigration(_0xac044c,_0x59a2d3){const _0x402b35=a188_0x4c912e,{configMigration:_0x5132dd}=_0xac044c;if(!_0x5132dd?.[_0x402b35(0x193)])return{'step':0x1,'label':_0x402b35(0x1dc),'ok':!![],'detail':_0x402b35(0x1b0)};const _0x30e405=readConfigFile(_0x5132dd[_0x402b35(0x193)]),_0xd92393=resolve(_0x59a2d3,NEW_CONFIG_NAME),_0x27f08d=_0x5132dd[_0x402b35(0x192)]?readConfigFile(_0xd92393):{};for(const [_0x5b56b7,_0x522ae4]of Object[_0x402b35(0x20a)](_0x30e405)){!(_0x5b56b7 in _0x27f08d)&&(_0x27f08d[_0x5b56b7]=_0x522ae4);}writeConfigFile(_0xd92393,_0x27f08d);const _0x1ba9d9=_0x5132dd[_0x402b35(0x193)]+_0x402b35(0x1d2);return renameSync(_0x5132dd['oldPath'],_0x1ba9d9),{'step':0x1,'label':_0x402b35(0x1dc),'ok':!![],'detail':_0x5132dd[_0x402b35(0x193)]+_0x402b35(0x205)+_0xd92393+_0x402b35(0x204)+_0x1ba9d9+')'};}function a188_0x54cb(_0x1c8337,_0x53f818){_0x1c8337=_0x1c8337-0x189;const _0xb8229d=a188_0xb822();let _0x54cb50=_0xb8229d[_0x1c8337];return _0x54cb50;}function execRemoveOldArtifacts(_0x586991){const _0x4e5fb5=a188_0x4c912e,_0x2a726a=[];for(const _0x2382d5 of _0x586991){try{if(!existsSync(_0x2382d5))continue;const _0x54ee7=tryStat(_0x2382d5);_0x54ee7?.['isDirectory']()?rmSync(_0x2382d5,{'recursive':!![],'force':!![]}):unlinkSync(_0x2382d5);}catch(_0x405af2){_0x2a726a['push'](_0x2382d5+':\x20'+_0x405af2['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x2a726a[_0x4e5fb5(0x1f0)]===0x0,'detail':_0x2a726a['length']>0x0?_0x586991[_0x4e5fb5(0x1f0)]-_0x2a726a[_0x4e5fb5(0x1f0)]+'/'+_0x586991['length']+_0x4e5fb5(0x1a9)+_0x2a726a[_0x4e5fb5(0x1c0)](';\x20')+')':_0x586991[_0x4e5fb5(0x1f0)]+_0x4e5fb5(0x199)};}function execCleanMcp(_0x12f481){const _0x55dcc4=a188_0x4c912e;if(!_0x12f481['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x55dcc4(0x1af)};try{const _0x19be33=readFileSync(_0x12f481[_0x55dcc4(0x1c4)]['path'],'utf8'),_0x712be7=JSON[_0x55dcc4(0x1fe)](_0x19be33);if(_0x712be7?.[_0x55dcc4(0x1b1)]&&typeof _0x712be7[_0x55dcc4(0x1b1)]===_0x55dcc4(0x1f5)){const _0x20c62e=[];for(const [_0x42d08f,_0x27ecb5]of Object[_0x55dcc4(0x20a)](_0x712be7[_0x55dcc4(0x1b1)])){_0x27ecb5?.[_0x55dcc4(0x1b3)]&&Array[_0x55dcc4(0x203)](_0x27ecb5[_0x55dcc4(0x1b3)])&&_0x27ecb5[_0x55dcc4(0x1b3)]['some'](_0x4d8b63=>typeof _0x4d8b63===_0x55dcc4(0x1bb)&&_0x4d8b63[_0x55dcc4(0x1fc)](_0x55dcc4(0x1ce)))&&_0x20c62e['push'](_0x42d08f);}for(const _0x4eaf41 of _0x20c62e){delete _0x712be7['mcpServers'][_0x4eaf41];}return _0x20c62e[_0x55dcc4(0x1f0)]>0x0&&writeFileSync(_0x12f481[_0x55dcc4(0x1c4)][_0x55dcc4(0x189)],JSON[_0x55dcc4(0x1bf)](_0x712be7,null,0x2)+'\x0a',_0x55dcc4(0x1c5)),{'step':0x4,'label':_0x55dcc4(0x1e3),'ok':!![],'detail':_0x55dcc4(0x19e)+_0x20c62e[_0x55dcc4(0x1c0)](',\x20')+_0x55dcc4(0x1b8)+_0x12f481['oldMcpConfig'][_0x55dcc4(0x189)]};}return{'step':0x4,'label':_0x55dcc4(0x1e3),'ok':!![],'detail':_0x55dcc4(0x1f3)};}catch(_0x4f5c6d){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x4f5c6d[_0x55dcc4(0x209)]};}}function execSkillsRemove(_0x434a1b,_0x46d7bc){const _0x5551be=a188_0x4c912e,_0x1fef9e=runNpxSkillsRemove(_0x434a1b,{'stdio':'inherit','yes':_0x46d7bc});return{'step':0x5,'label':_0x5551be(0x197),'ok':_0x1fef9e['ok'],'detail':_0x1fef9e['ok']?_0x5551be(0x1ba):_0x1fef9e['error']??'exit\x20'+_0x1fef9e[_0x5551be(0x1e7)]};}function execSkillsAdd(_0x4daee2,_0x2a38fc){const _0x5af4d9=a188_0x4c912e,_0x5692a9=runNpxSkillsAddGlobal(_0x4daee2,_0x5af4d9(0x1ab),{'stdio':_0x5af4d9(0x1ae),'yes':_0x2a38fc});return{'step':0x6,'label':_0x5af4d9(0x1d0),'ok':_0x5692a9['ok'],'detail':_0x5692a9['ok']?_0x5af4d9(0x1eb):_0x5692a9[_0x5af4d9(0x1a5)]??'exit\x20'+_0x5692a9['status']};}function execUpgradeSdk(_0x305ff5){const _0x91788c=a188_0x4c912e;if(!_0x305ff5[_0x91788c(0x18b)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x91788c(0x1c6)};const {pkgPath:_0x4e7e6d,currentVersion:_0xf9651f,field:_0x282320}=_0x305ff5[_0x91788c(0x18b)];try{const _0x361b9c=readFileSync(_0x4e7e6d,_0x91788c(0x1c5)),_0x5835dc=JSON[_0x91788c(0x1fe)](_0x361b9c);return _0x5835dc[_0x282320][_0x91788c(0x1c8)]=_0x91788c(0x18a),writeFileSync(_0x4e7e6d,JSON[_0x91788c(0x1bf)](_0x5835dc,null,0x2)+'\x0a',_0x91788c(0x1c5)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x282320+_0x91788c(0x1a6)+_0xf9651f+'\x20→\x20latest'};}catch(_0x501286){return{'step':0x7,'label':_0x91788c(0x1ef),'ok':![],'detail':_0x501286[_0x91788c(0x209)]};}}function tryStat(_0x1d7572){try{return statSync(_0x1d7572);}catch{return undefined;}}function printSummary(_0x45151d){const _0x55cabb=a188_0x4c912e;console[_0x55cabb(0x1df)](''),console[_0x55cabb(0x1df)](a188_0x4a04e0[_0x55cabb(0x207)](_0x55cabb(0x1f9))),console[_0x55cabb(0x1df)]('');for(const _0x13245d of _0x45151d){const _0x337bc4=_0x13245d['ok']?a188_0x4a04e0[_0x55cabb(0x1be)]('OK'):a188_0x4a04e0['red'](_0x55cabb(0x1d7));console[_0x55cabb(0x1df)]('\x20\x20'+_0x337bc4+_0x55cabb(0x1f2)+_0x13245d[_0x55cabb(0x208)]+':\x20'+_0x13245d['label']);if(_0x13245d[_0x55cabb(0x19b)])console[_0x55cabb(0x1df)](_0x55cabb(0x200)+a188_0x4a04e0[_0x55cabb(0x1f8)](_0x13245d[_0x55cabb(0x19b)]));}console['log']('');}export async function upgradeApp(_0x3caa0b,_0x4a6ba1){const _0x5812e2=a188_0x4c912e,_0x9073c2=process[_0x5812e2(0x1a2)](),_0x5e6c41=analyse(_0x9073c2),_0x2ed38d=!_0x5e6c41[_0x5812e2(0x1d4)]&&_0x5e6c41[_0x5812e2(0x1ec)]['length']===0x0&&!_0x5e6c41['oldMcpConfig']&&!_0x5e6c41[_0x5812e2(0x19c)]&&!_0x5e6c41[_0x5812e2(0x18b)];if(_0x2ed38d){console[_0x5812e2(0x1df)](a188_0x4a04e0['green']('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x5e6c41);const _0x5c3444=!!(_0x4a6ba1[_0x5812e2(0x18d)]||_0x4a6ba1['Y']||_0x3caa0b);if(!_0x5c3444)try{const _0x51785b=await askConfirm(_0x5812e2(0x1db));if(!_0x51785b){console[_0x5812e2(0x1df)](a188_0x4a04e0['gray']('Upgrade\x20cancelled.'));return;}}catch(_0x55c930){if(_0x55c930?.['message']===_0x5812e2(0x18e)){console[_0x5812e2(0x1df)](a188_0x4a04e0[_0x5812e2(0x1f8)](_0x5812e2(0x1ee)));return;}throw _0x55c930;}const _0x1de138=[],_0x53d5f7=a188_0x407e3c({'text':_0x5812e2(0x1f1),'color':_0x5812e2(0x1e4)})[_0x5812e2(0x1b5)](),_0x428d7c=execConfigMigration(_0x5e6c41,_0x9073c2);_0x1de138[_0x5812e2(0x1e6)](_0x428d7c),_0x53d5f7[_0x428d7c['ok']?_0x5812e2(0x19f):_0x5812e2(0x1b4)](_0x5812e2(0x20e)+(_0x428d7c[_0x5812e2(0x19b)]??(_0x428d7c['ok']?_0x5812e2(0x1da):_0x5812e2(0x1a0))));const _0x50bfbb=resolve(_0x9073c2,_0x5812e2(0x1a7)),_0x14e126=a188_0x407e3c({'text':_0x5812e2(0x1b9),'color':_0x5812e2(0x1e4)})[_0x5812e2(0x1b5)]();if(existsSync(_0x50bfbb))try{rmSync(_0x50bfbb,{'recursive':!![],'force':!![]}),_0x14e126['succeed'](_0x5812e2(0x201)),_0x1de138[_0x5812e2(0x1e6)]({'step':0x2,'label':_0x5812e2(0x1f7),'ok':!![]});}catch(_0x3865ad){_0x14e126[_0x5812e2(0x1b4)](_0x5812e2(0x1d6)+_0x3865ad[_0x5812e2(0x209)]),_0x1de138[_0x5812e2(0x1e6)]({'step':0x2,'label':_0x5812e2(0x1f7),'ok':![],'detail':_0x3865ad['message']});}else _0x14e126['info']('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x1de138[_0x5812e2(0x1e6)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x5812e2(0x1af)});const _0x2ef6ce=a188_0x407e3c({'text':_0x5812e2(0x1fa),'color':_0x5812e2(0x1e4)})[_0x5812e2(0x1b5)](),_0x1d7ecc=execRemoveOldArtifacts(_0x5e6c41[_0x5812e2(0x1ec)]);_0x1de138[_0x5812e2(0x1e6)](_0x1d7ecc),_0x2ef6ce[_0x1d7ecc['ok']?_0x5812e2(0x19f):'fail'](_0x5812e2(0x1e8)+(_0x1d7ecc[_0x5812e2(0x19b)]??(_0x1d7ecc['ok']?_0x5812e2(0x1da):'failed')));const _0x2583bb=a188_0x407e3c({'text':_0x5812e2(0x1a8),'color':_0x5812e2(0x1e4)})['start'](),_0xf02a8=execCleanMcp(_0x5e6c41);_0x1de138[_0x5812e2(0x1e6)](_0xf02a8),_0x2583bb[_0xf02a8['ok']?'succeed':'fail'](_0x5812e2(0x1fb)+(_0xf02a8['detail']??(_0xf02a8['ok']?_0x5812e2(0x1da):'failed')));const _0x251ffd=a188_0x407e3c({'text':_0x5812e2(0x1c7),'color':_0x5812e2(0x1e4)})[_0x5812e2(0x1b5)](),_0x447d6f=execSkillsRemove(_0x9073c2,_0x5c3444);_0x1de138['push'](_0x447d6f),_0x251ffd[_0x447d6f['ok']?'succeed':_0x5812e2(0x1b4)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x447d6f[_0x5812e2(0x19b)]??(_0x447d6f['ok']?_0x5812e2(0x1da):_0x5812e2(0x1a0))));const _0x3ba991=a188_0x407e3c({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x5812e2(0x1e4)})[_0x5812e2(0x1b5)](),_0x383809=execSkillsAdd(_0x9073c2,_0x5c3444);_0x1de138[_0x5812e2(0x1e6)](_0x383809),_0x3ba991[_0x383809['ok']?_0x5812e2(0x19f):'fail'](_0x5812e2(0x1d5)+(_0x383809[_0x5812e2(0x19b)]??(_0x383809['ok']?'done':'failed')));const _0x3109ab=a188_0x407e3c({'text':_0x5812e2(0x1e2),'color':_0x5812e2(0x1e4)})['start'](),_0x3f9164=execUpgradeSdk(_0x5e6c41);_0x1de138[_0x5812e2(0x1e6)](_0x3f9164),_0x3109ab[_0x3f9164['ok']?'succeed':_0x5812e2(0x1b4)](_0x5812e2(0x1c3)+(_0x3f9164[_0x5812e2(0x19b)]??(_0x3f9164['ok']?_0x5812e2(0x1da):_0x5812e2(0x1a0)))),printSummary(_0x1de138);const _0x2119f9=_0x1de138[_0x5812e2(0x1ad)](_0x327118=>!_0x327118['ok']);_0x2119f9?console[_0x5812e2(0x1df)](a188_0x4a04e0[_0x5812e2(0x1fd)](_0x5812e2(0x1e5))):console[_0x5812e2(0x1df)](a188_0x4a04e0[_0x5812e2(0x1be)]('Upgrade\x20completed\x20successfully!')),_0x3f9164['ok']&&_0x5e6c41[_0x5812e2(0x18b)]&&(console[_0x5812e2(0x1df)](''),console[_0x5812e2(0x1df)](a188_0x4a04e0['bold'][_0x5812e2(0x1e4)](_0x5812e2(0x1d9))),console[_0x5812e2(0x1df)](a188_0x4a04e0['cyan'](_0x5812e2(0x1aa))),console[_0x5812e2(0x1df)](''),console[_0x5812e2(0x1df)](a188_0x4a04e0['white']('\x20\x20npm\x20install')),console['log'](a188_0x4a04e0[_0x5812e2(0x1ff)]('\x20\x20#\x20or')),console['log'](a188_0x4a04e0['white'](_0x5812e2(0x195))),console[_0x5812e2(0x1df)](''));}