@lovrabet/rabetbase-cli 2.5.2-beta.3 → 2.5.2-beta.4

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 (349) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/auth/auth-server-ui.js +1 -1
  7. package/lib/auth/auth-server.js +1 -1
  8. package/lib/auth/constant.js +1 -1
  9. package/lib/auth/get-cookie.js +1 -1
  10. package/lib/auth/get-session-user.js +1 -1
  11. package/lib/auth/is-session-valid.js +1 -1
  12. package/lib/auth/login-success-html.js +1 -1
  13. package/lib/auth/logout.js +1 -1
  14. package/lib/cli-flags.js +1 -1
  15. package/lib/cli.js +1 -1
  16. package/lib/commands/api/generate.js +1 -1
  17. package/lib/commands/api/index.js +1 -1
  18. package/lib/commands/api/list.js +1 -1
  19. package/lib/commands/api/pull.js +1 -1
  20. package/lib/commands/api/shared.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/members-list.js +1 -1
  24. package/lib/commands/app/remote-directory.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-registry.js +1 -1
  47. package/lib/commands/common/app-selector.js +1 -1
  48. package/lib/commands/common/async-task.js +1 -1
  49. package/lib/commands/common/dry-run.js +1 -1
  50. package/lib/commands/common/flags.js +1 -1
  51. package/lib/commands/common/local-file.js +1 -1
  52. package/lib/commands/common/validate.js +1 -1
  53. package/lib/commands/config/delete.js +1 -1
  54. package/lib/commands/config/get.js +1 -1
  55. package/lib/commands/config/index.js +1 -1
  56. package/lib/commands/config/init.js +1 -1
  57. package/lib/commands/config/list.js +1 -1
  58. package/lib/commands/config/set.js +1 -1
  59. package/lib/commands/config/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/business-groups.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-restore.js +1 -1
  67. package/lib/commands/dataset/field-update.js +1 -1
  68. package/lib/commands/dataset/generate.js +1 -1
  69. package/lib/commands/dataset/index.js +1 -1
  70. package/lib/commands/dataset/list.js +1 -1
  71. package/lib/commands/dataset/operations.js +1 -1
  72. package/lib/commands/dataset/relation-audit.js +1 -1
  73. package/lib/commands/dataset/relation-create.js +1 -1
  74. package/lib/commands/dataset/relation-delete.js +1 -1
  75. package/lib/commands/dataset/relation-shared.js +1 -1
  76. package/lib/commands/dataset/relation-update.js +1 -1
  77. package/lib/commands/dataset/relations.js +1 -1
  78. package/lib/commands/dataset/rename.js +1 -1
  79. package/lib/commands/dataset/restore.js +1 -1
  80. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.js +1 -1
  95. package/lib/commands/db/table-diff-shared.js +1 -1
  96. package/lib/commands/db/tables.js +1 -1
  97. package/lib/commands/db/test.js +1 -1
  98. package/lib/commands/db/update.js +1 -1
  99. package/lib/commands/deployment/auto-sync.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/deployment/sync.js +1 -1
  105. package/lib/commands/doctor.js +1 -1
  106. package/lib/commands/file/index.js +1 -1
  107. package/lib/commands/instant-api-policy/current.js +1 -1
  108. package/lib/commands/instant-api-policy/index.js +1 -1
  109. package/lib/commands/instant-api-policy/init.js +1 -1
  110. package/lib/commands/instant-api-policy/publish.js +1 -1
  111. package/lib/commands/instant-api-policy/pull.js +1 -1
  112. package/lib/commands/instant-api-policy/revision.js +1 -1
  113. package/lib/commands/instant-api-policy/revisions.js +1 -1
  114. package/lib/commands/instant-api-policy/rollback.js +1 -1
  115. package/lib/commands/instant-api-policy/shared.js +1 -1
  116. package/lib/commands/instant-api-policy/validate.js +1 -1
  117. package/lib/commands/issue/index.js +1 -1
  118. package/lib/commands/issue/nudge.js +1 -1
  119. package/lib/commands/issue/report.js +1 -1
  120. package/lib/commands/issue/shared.js +1 -1
  121. package/lib/commands/kb/create.js +1 -1
  122. package/lib/commands/kb/delete.js +1 -1
  123. package/lib/commands/kb/detail.js +1 -1
  124. package/lib/commands/kb/index.js +1 -1
  125. package/lib/commands/kb/list.js +1 -1
  126. package/lib/commands/kb/search.js +1 -1
  127. package/lib/commands/kb/shared.js +1 -1
  128. package/lib/commands/kb/update.js +1 -1
  129. package/lib/commands/logs/index.js +1 -1
  130. package/lib/commands/menu/asset-update.js +1 -1
  131. package/lib/commands/menu/delete.js +1 -1
  132. package/lib/commands/menu/external-link-create.js +1 -1
  133. package/lib/commands/menu/external-link-update.js +1 -1
  134. package/lib/commands/menu/group-create.js +1 -1
  135. package/lib/commands/menu/group-update.js +1 -1
  136. package/lib/commands/menu/index.js +1 -1
  137. package/lib/commands/menu/list.js +1 -1
  138. package/lib/commands/menu/move.js +1 -1
  139. package/lib/commands/menu/regroup-start.js +1 -1
  140. package/lib/commands/menu/rename.js +1 -1
  141. package/lib/commands/menu/shared/compare-table.js +1 -1
  142. package/lib/commands/menu/shared/delete-plan.js +1 -1
  143. package/lib/commands/menu/shared/facts.js +1 -1
  144. package/lib/commands/menu/shared/index.js +1 -1
  145. package/lib/commands/menu/shared/inquirer.js +1 -1
  146. package/lib/commands/menu/shared/local-pages.js +1 -1
  147. package/lib/commands/menu/shared/logic.js +1 -1
  148. package/lib/commands/menu/shared/mutations.js +1 -1
  149. package/lib/commands/menu/shared/service.js +1 -1
  150. package/lib/commands/menu/shared/sync-core.js +1 -1
  151. package/lib/commands/menu/shared/update-core.js +1 -1
  152. package/lib/commands/menu/shared/valid-url.js +1 -1
  153. package/lib/commands/menu/sync.js +1 -1
  154. package/lib/commands/menu/visibility-update.js +1 -1
  155. package/lib/commands/notification/config-create.js +1 -1
  156. package/lib/commands/notification/config-delete.js +1 -1
  157. package/lib/commands/notification/config-list.js +1 -1
  158. package/lib/commands/notification/config-update.js +1 -1
  159. package/lib/commands/notification/index.js +1 -1
  160. package/lib/commands/notification/shared.js +1 -1
  161. package/lib/commands/ocr/index.js +1 -1
  162. package/lib/commands/page/create.js +1 -1
  163. package/lib/commands/page/custom/detail.js +1 -1
  164. package/lib/commands/page/custom/list.js +1 -1
  165. package/lib/commands/page/custom/publish.js +1 -1
  166. package/lib/commands/page/custom/shared.d.ts +0 -8
  167. package/lib/commands/page/custom/shared.js +1 -1
  168. package/lib/commands/page/custom/syntax.js +1 -1
  169. package/lib/commands/page/custom/update.js +1 -1
  170. package/lib/commands/page/data-list-status.js +1 -1
  171. package/lib/commands/page/generate-start.js +1 -1
  172. package/lib/commands/page/generate-status.js +1 -1
  173. package/lib/commands/page/index.js +1 -1
  174. package/lib/commands/page/pull.js +1 -1
  175. package/lib/commands/page/push.js +1 -1
  176. package/lib/commands/page/relation-audit.js +1 -1
  177. package/lib/commands/page/restore.js +1 -1
  178. package/lib/commands/page/shared.js +1 -1
  179. package/lib/commands/page/sync.js +1 -1
  180. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  181. package/lib/commands/project/create/format-elapsed.js +1 -1
  182. package/lib/commands/project/create/main.js +1 -1
  183. package/lib/commands/project/create/materialize-project-template.js +1 -1
  184. package/lib/commands/project/create/project-name.js +1 -1
  185. package/lib/commands/project/create/project-template-archive.js +1 -1
  186. package/lib/commands/project/create/project-template-path.js +1 -1
  187. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  188. package/lib/commands/project/create/use-format-code.js +1 -1
  189. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  190. package/lib/commands/project/domain-routing-sync.js +1 -1
  191. package/lib/commands/project/index.js +1 -1
  192. package/lib/commands/project/upgrade.js +1 -1
  193. package/lib/commands/registry.js +1 -1
  194. package/lib/commands/role/delete.js +1 -1
  195. package/lib/commands/role/detail.js +1 -1
  196. package/lib/commands/role/index.js +1 -1
  197. package/lib/commands/role/list.js +1 -1
  198. package/lib/commands/role/shared.js +1 -1
  199. package/lib/commands/role/update.js +1 -1
  200. package/lib/commands/role/user-add.js +1 -1
  201. package/lib/commands/role/user-remove.js +1 -1
  202. package/lib/commands/role/user-resolve.js +1 -1
  203. package/lib/commands/rule/get.js +1 -1
  204. package/lib/commands/rule/index.js +1 -1
  205. package/lib/commands/rule/list.js +1 -1
  206. package/lib/commands/rule/set.js +1 -1
  207. package/lib/commands/rule/shared.js +1 -1
  208. package/lib/commands/run/index.d.ts +4 -0
  209. package/lib/commands/run/index.js +1 -1
  210. package/lib/commands/schema.js +1 -1
  211. package/lib/commands/sql/create.js +1 -1
  212. package/lib/commands/sql/delete.js +1 -1
  213. package/lib/commands/sql/detail.js +1 -1
  214. package/lib/commands/sql/exec.js +1 -1
  215. package/lib/commands/sql/index.js +1 -1
  216. package/lib/commands/sql/list.js +1 -1
  217. package/lib/commands/sql/pull.js +1 -1
  218. package/lib/commands/sql/push.js +1 -1
  219. package/lib/commands/sql/shared.js +1 -1
  220. package/lib/commands/sql/status.js +1 -1
  221. package/lib/commands/sql/validate.js +1 -1
  222. package/lib/commands/task/index.js +1 -1
  223. package/lib/commands/task/status.js +1 -1
  224. package/lib/commands/tenant/index.js +1 -1
  225. package/lib/commands/tenant/members-list.js +1 -1
  226. package/lib/commands/tenant/shared.js +1 -1
  227. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  228. package/lib/commands/user-account/index.js +1 -1
  229. package/lib/commands/workspace/add.js +1 -1
  230. package/lib/commands/workspace/index.js +1 -1
  231. package/lib/commands/workspace/remove.js +1 -1
  232. package/lib/config/domain-config.js +1 -1
  233. package/lib/config/project-domain-routing.d.ts +5 -1
  234. package/lib/config/project-domain-routing.js +1 -1
  235. package/lib/config/schema.js +1 -1
  236. package/lib/constant/cdn.js +1 -1
  237. package/lib/constant/cli.js +1 -1
  238. package/lib/constant/defaults.js +1 -1
  239. package/lib/constant/domain.js +1 -1
  240. package/lib/constant/env.js +1 -1
  241. package/lib/constant/output.js +1 -1
  242. package/lib/constant/paths.js +1 -1
  243. package/lib/constant/region.js +1 -1
  244. package/lib/constant/risk.js +1 -1
  245. package/lib/constant/routing-profile.js +1 -1
  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.js +1 -1
  250. package/lib/core/alias-resolver.js +1 -1
  251. package/lib/core/api-client.d.ts +0 -26
  252. package/lib/core/api-client.js +1 -1
  253. package/lib/core/bff/config.js +1 -1
  254. package/lib/core/bff/file-system.js +1 -1
  255. package/lib/core/bff/hash.js +1 -1
  256. package/lib/core/bff/lock.js +1 -1
  257. package/lib/core/bff/utils.js +1 -1
  258. package/lib/core/db-resolver.js +1 -1
  259. package/lib/core/instant-api-policy/config.js +1 -1
  260. package/lib/core/kb-search-client.js +1 -1
  261. package/lib/core/page/file-system.d.ts +43 -0
  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/sql-index-auditor.js +1 -1
  266. package/lib/core/sql-sync/config.js +1 -1
  267. package/lib/core/sql-sync/file-system.js +1 -1
  268. package/lib/core/sql-sync/hash.js +1 -1
  269. package/lib/core/sql-sync/lock.js +1 -1
  270. package/lib/core/sql-sync/utils.js +1 -1
  271. package/lib/core/sql-validator.js +1 -1
  272. package/lib/errors.js +1 -1
  273. package/lib/framework/build-all-flags.js +1 -1
  274. package/lib/framework/error-output.js +1 -1
  275. package/lib/framework/explicit-yes.js +1 -1
  276. package/lib/framework/flags.js +1 -1
  277. package/lib/framework/help.js +1 -1
  278. package/lib/framework/index.js +1 -1
  279. package/lib/framework/output.js +1 -1
  280. package/lib/framework/response.js +1 -1
  281. package/lib/framework/runner-alias.js +1 -1
  282. package/lib/framework/runner.js +1 -1
  283. package/lib/framework/schema-export.js +1 -1
  284. package/lib/framework/supported-flags.js +1 -1
  285. package/lib/framework/types.js +1 -1
  286. package/lib/generated/build-info.d.ts +4 -4
  287. package/lib/generated/build-info.js +1 -1
  288. package/lib/generated/official-routing.js +1 -1
  289. package/lib/generated/routing-contract.js +1 -1
  290. package/lib/help.js +1 -1
  291. package/lib/postinstall.js +1 -1
  292. package/lib/runtime/confirmation.js +1 -1
  293. package/lib/runtime/event.js +1 -1
  294. package/lib/runtime/index.js +1 -1
  295. package/lib/runtime/queue.js +1 -1
  296. package/lib/runtime/resolve.js +1 -1
  297. package/lib/skills/builtin-skill.js +1 -1
  298. package/lib/skills/main.js +1 -1
  299. package/lib/skills/npx-skills-add.js +1 -1
  300. package/lib/skills/skill-presence.js +1 -1
  301. package/lib/telemetry/cli-command-trace.js +1 -1
  302. package/lib/telemetry/cli-help-trace.js +1 -1
  303. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  304. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  305. package/lib/telemetry/send-cli-trace-log.js +1 -1
  306. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  307. package/lib/utils/ai_config.js +1 -1
  308. package/lib/utils/apply-jq-filter.js +1 -1
  309. package/lib/utils/cdn-config.js +1 -1
  310. package/lib/utils/check-sdk-version.js +1 -1
  311. package/lib/utils/cli-version-check.js +1 -1
  312. package/lib/utils/cli-version-policy.js +1 -1
  313. package/lib/utils/config.js +1 -1
  314. package/lib/utils/entity-with-id.js +1 -1
  315. package/lib/utils/file-utils.js +1 -1
  316. package/lib/utils/guides-cdn.js +1 -1
  317. package/lib/utils/http-client.js +1 -1
  318. package/lib/utils/is-non-interactive.js +1 -1
  319. package/lib/utils/logger.js +1 -1
  320. package/lib/utils/params.js +1 -1
  321. package/lib/utils/platform.js +1 -1
  322. package/lib/utils/sleep.js +1 -1
  323. package/lib/utils/template-replacer.js +1 -1
  324. package/lib/utils/update-notice.js +1 -1
  325. package/lib/utils/version.js +1 -1
  326. package/lib/utils/with-active-cookie.js +1 -1
  327. package/lib/utils/write-cli-side-channel.js +1 -1
  328. package/package.json +2 -1
  329. package/skills/rabetbase/SKILL.md +5 -5
  330. package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
  331. package/skills/rabetbase/guides/page-development-workflow.md +1 -1
  332. package/skills/rabetbase/knowledge/components.md +292 -0
  333. package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
  334. package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
  335. package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
  336. package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
  337. package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
  338. package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
  339. package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
  340. package/skills/rabetbase/references/rabetbase-run.md +1 -0
  341. package/skills/rabetbase.manifest.json +5 -4
  342. package/templates/README.md +10 -4
  343. package/templates/custom-pages/blank.json +5 -0
  344. package/templates/custom-pages/dashboard.json +5 -0
  345. package/templates/custom-pages/onepage.json +5 -0
  346. package/templates/generate-api/api.ts.tpl +1 -1
  347. package/lib/commands/page/custom/template.d.ts +0 -8
  348. package/lib/commands/page/custom/template.js +0 -1
  349. package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
@@ -1 +1 @@
1
- (function(_0x442d12,_0x6bc4dd){const _0x3b4194=a179_0x1232,_0x3ad974=_0x442d12();while(!![]){try{const _0x556489=parseInt(_0x3b4194(0x153))/0x1*(-parseInt(_0x3b4194(0x143))/0x2)+-parseInt(_0x3b4194(0x141))/0x3+parseInt(_0x3b4194(0x152))/0x4+parseInt(_0x3b4194(0x13f))/0x5*(-parseInt(_0x3b4194(0x13e))/0x6)+parseInt(_0x3b4194(0x146))/0x7+-parseInt(_0x3b4194(0x14b))/0x8+parseInt(_0x3b4194(0x140))/0x9;if(_0x556489===_0x6bc4dd)break;else _0x3ad974['push'](_0x3ad974['shift']());}catch(_0x3ca8d7){_0x3ad974['push'](_0x3ad974['shift']());}}}(a179_0x1e45,0xb5d8f));import{existsSync}from'node:fs';import a179_0x1a0f53 from'node:path';import a179_0x3d11d6 from'chalk';function a179_0x1232(_0x1bdabc,_0x40249c){_0x1bdabc=_0x1bdabc-0x137;const _0x1e45de=a179_0x1e45();let _0x123226=_0x1e45de[_0x1bdabc];return _0x123226;}function a179_0x1e45(){const _0x4c9c18=['4227735CtrCDb','resolve','1501186LsLteJ','string','Not\x20set','6686085dgLbPm','production','√\x20Login\x20status:\x20','Login\x20failed','√\x20App\x20Code:\x20','9956384HzzVhZ','cwd','cyan','\x22\x20already\x20exists','log','Project\x20name:','env','2312608SVTino','1dEXyAT','trim','√\x20Project\x20Name:\x20','green','Logged\x20in','Directory\x20\x22','Skipped','my-app','24TctIrT','745765Dpsqzw','28912842ahjoxk'];a179_0x1e45=function(){return _0x4c9c18;};return a179_0x1e45();}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';export async function guidedCreateProject(_0x281324,_0x697523,_0x24e363){const _0x74dd61=a179_0x1232,_0x598b3e=_0x74dd61(0x13d),_0xaaf341=readConfig(),_0x396867=typeof _0xaaf341[_0x74dd61(0x151)]===_0x74dd61(0x144)?_0xaaf341[_0x74dd61(0x151)]:undefined,_0x562dd8=await input({'message':_0x74dd61(0x150),'default':_0x598b3e,'validate':_0x26738b=>{const _0x115acf=_0x74dd61,_0x296135=_0x26738b[_0x115acf(0x137)]()||_0x598b3e,_0x5ace7d=getProjectNameValidationError(_0x296135);if(_0x5ace7d)return _0x5ace7d;const _0xa20bda=a179_0x1a0f53[_0x115acf(0x142)](process[_0x115acf(0x14c)](),_0x296135);if(existsSync(_0xa20bda))return _0x115acf(0x13b)+_0x296135+_0x115acf(0x14e);return!![];}});console[_0x74dd61(0x14f)](a179_0x3d11d6[_0x74dd61(0x139)](_0x74dd61(0x138)+a179_0x3d11d6[_0x74dd61(0x14d)](_0x562dd8)));const _0x49adae=await selectSingleAppcode(_0x24e363);console[_0x74dd61(0x14f)](a179_0x3d11d6[_0x74dd61(0x139)](_0x74dd61(0x14a)+a179_0x3d11d6[_0x74dd61(0x14d)](_0x49adae||_0x74dd61(0x145))));if(_0x49adae){const _0x333981=await getIsSessionValid();if(!_0x333981){const _0xb6c6d3=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0xb6c6d3){const _0x2abbbc=await authServer({'silent':!![]});console[_0x74dd61(0x14f)](a179_0x3d11d6['green'](_0x74dd61(0x148)+a179_0x3d11d6[_0x74dd61(0x14d)](_0x2abbbc?_0x74dd61(0x13a):_0x74dd61(0x149))));}else console['log'](a179_0x3d11d6[_0x74dd61(0x139)]('√\x20Login\x20status:\x20'+a179_0x3d11d6[_0x74dd61(0x14d)](_0x74dd61(0x13c))));}await _0x281324({'projectName':_0x562dd8,'appCode':_0x49adae,'env':_0x697523||_0x396867||_0x74dd61(0x147)});}else await _0x281324({'projectName':_0x562dd8,'env':_0x697523||_0x396867||_0x74dd61(0x147)});}
1
+ (function(_0x145f78,_0x3cc474){const _0x5827de=a178_0x13a0,_0x155cd4=_0x145f78();while(!![]){try{const _0x311915=parseInt(_0x5827de(0x119))/0x1*(-parseInt(_0x5827de(0x11e))/0x2)+-parseInt(_0x5827de(0x11b))/0x3*(-parseInt(_0x5827de(0x133))/0x4)+-parseInt(_0x5827de(0x11a))/0x5+-parseInt(_0x5827de(0x123))/0x6*(-parseInt(_0x5827de(0x124))/0x7)+-parseInt(_0x5827de(0x12f))/0x8+-parseInt(_0x5827de(0x122))/0x9*(-parseInt(_0x5827de(0x11c))/0xa)+parseInt(_0x5827de(0x12d))/0xb;if(_0x311915===_0x3cc474)break;else _0x155cd4['push'](_0x155cd4['shift']());}catch(_0x106726){_0x155cd4['push'](_0x155cd4['shift']());}}}(a178_0x13ab,0xf033e));import{existsSync}from'node:fs';import a178_0x32cd33 from'node:path';import a178_0x1f32b3 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 a178_0x13a0(_0x11b3f6,_0x529851){_0x11b3f6=_0x11b3f6-0x119;const _0x13ab06=a178_0x13ab();let _0x13a069=_0x13ab06[_0x11b3f6];return _0x13a069;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x2e1358,_0x538412,_0x3531d4){const _0xaa36aa=a178_0x13a0,_0x447477=_0xaa36aa(0x121),_0x569369=readConfig(),_0x530567=typeof _0x569369[_0xaa36aa(0x127)]===_0xaa36aa(0x130)?_0x569369[_0xaa36aa(0x127)]:undefined,_0x52c69c=await input({'message':_0xaa36aa(0x12a),'default':_0x447477,'validate':_0x4e8783=>{const _0x40bf18=_0xaa36aa,_0x3e1c08=_0x4e8783[_0x40bf18(0x11d)]()||_0x447477,_0x239e13=getProjectNameValidationError(_0x3e1c08);if(_0x239e13)return _0x239e13;const _0x3e4bc6=a178_0x32cd33[_0x40bf18(0x12b)](process[_0x40bf18(0x120)](),_0x3e1c08);if(existsSync(_0x3e4bc6))return _0x40bf18(0x129)+_0x3e1c08+'\x22\x20already\x20exists';return!![];}});console['log'](a178_0x1f32b3[_0xaa36aa(0x131)](_0xaa36aa(0x125)+a178_0x1f32b3[_0xaa36aa(0x128)](_0x52c69c)));const _0x4c5186=await selectSingleAppcode(_0x3531d4);console[_0xaa36aa(0x11f)](a178_0x1f32b3[_0xaa36aa(0x131)]('√\x20App\x20Code:\x20'+a178_0x1f32b3[_0xaa36aa(0x128)](_0x4c5186||'Not\x20set')));if(_0x4c5186){const _0x462bbe=await getIsSessionValid();if(!_0x462bbe){const _0x20300d=await confirm({'message':_0xaa36aa(0x12e),'default':!![]});if(_0x20300d){const _0x5d72bb=await authServer({'silent':!![]});console[_0xaa36aa(0x11f)](a178_0x1f32b3['green'](_0xaa36aa(0x132)+a178_0x1f32b3[_0xaa36aa(0x128)](_0x5d72bb?'Logged\x20in':'Login\x20failed')));}else console[_0xaa36aa(0x11f)](a178_0x1f32b3[_0xaa36aa(0x131)](_0xaa36aa(0x132)+a178_0x1f32b3[_0xaa36aa(0x128)](_0xaa36aa(0x126))));}await _0x2e1358({'projectName':_0x52c69c,'appCode':_0x4c5186,'env':_0x538412||_0x530567||_0xaa36aa(0x12c)});}else await _0x2e1358({'projectName':_0x52c69c,'env':_0x538412||_0x530567||'production'});}function a178_0x13ab(){const _0x2f4cda=['my-app','1906029iaBFix','6ofMNSS','3142517PGygkJ','√\x20Project\x20Name:\x20','Skipped','env','cyan','Directory\x20\x22','Project\x20name:','resolve','production','11279697UrhYSO','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','6458472nbVEOs','string','green','√\x20Login\x20status:\x20','14812emSQoI','11362ToGDYO','1073815uZjtcd','705pNjUAb','50OIHHan','trim','246PlgJfO','log','cwd'];a178_0x13ab=function(){return _0x2f4cda;};return a178_0x13ab();}
@@ -1 +1 @@
1
- (function(_0x28bdf3,_0x311622){const _0xb5e3e8=a180_0x4546,_0x1d8699=_0x28bdf3();while(!![]){try{const _0x35f73f=-parseInt(_0xb5e3e8(0x18c))/0x1*(-parseInt(_0xb5e3e8(0x190))/0x2)+-parseInt(_0xb5e3e8(0x191))/0x3*(parseInt(_0xb5e3e8(0x18f))/0x4)+-parseInt(_0xb5e3e8(0x192))/0x5+-parseInt(_0xb5e3e8(0x18e))/0x6*(parseInt(_0xb5e3e8(0x189))/0x7)+-parseInt(_0xb5e3e8(0x188))/0x8+-parseInt(_0xb5e3e8(0x18d))/0x9+parseInt(_0xb5e3e8(0x18b))/0xa;if(_0x35f73f===_0x311622)break;else _0x1d8699['push'](_0x1d8699['shift']());}catch(_0x476ec8){_0x1d8699['push'](_0x1d8699['shift']());}}}(a180_0x3eaf,0x5854f));function a180_0x4546(_0x56db7b,_0x454353){_0x56db7b=_0x56db7b-0x188;const _0x3eafa8=a180_0x3eaf();let _0x454607=_0x3eafa8[_0x56db7b];return _0x454607;}function a180_0x3eaf(){const _0x588cc4=['1525080Hntocj','42AWIHQj','now','23144110Ksgths','711853HdgncQ','5467419qVPdiF','632238SmoUMe','3316pIlPFr','2jsUSei','2448bHdKVU','2788145bZtUcH','replace'];a180_0x3eaf=function(){return _0x588cc4;};return a180_0x3eaf();}export function formatElapsed(_0x4a29dd){const _0x3caf65=a180_0x4546,_0x145329=Date[_0x3caf65(0x18a)]()-_0x4a29dd;if(_0x145329<0x3e8)return _0x145329+'ms';const _0x42f566=(_0x145329/0x3e8)['toFixed'](0x2),_0x46386b=_0x42f566[_0x3caf65(0x193)](/\.?0+$/u,'');return _0x46386b+'s';}
1
+ function a179_0x28c3(_0x20c32d,_0x5bd484){_0x20c32d=_0x20c32d-0x1ce;const _0x3be2e4=a179_0x3be2();let _0x28c348=_0x3be2e4[_0x20c32d];return _0x28c348;}(function(_0x5bf96a,_0x4af10c){const _0x3b97ec=a179_0x28c3,_0x53666f=_0x5bf96a();while(!![]){try{const _0x419f45=-parseInt(_0x3b97ec(0x1d4))/0x1*(-parseInt(_0x3b97ec(0x1db))/0x2)+-parseInt(_0x3b97ec(0x1d8))/0x3*(-parseInt(_0x3b97ec(0x1d7))/0x4)+parseInt(_0x3b97ec(0x1cf))/0x5*(-parseInt(_0x3b97ec(0x1d3))/0x6)+parseInt(_0x3b97ec(0x1d9))/0x7*(-parseInt(_0x3b97ec(0x1d1))/0x8)+-parseInt(_0x3b97ec(0x1d2))/0x9+parseInt(_0x3b97ec(0x1d0))/0xa+parseInt(_0x3b97ec(0x1d6))/0xb;if(_0x419f45===_0x4af10c)break;else _0x53666f['push'](_0x53666f['shift']());}catch(_0x5bec2a){_0x53666f['push'](_0x53666f['shift']());}}}(a179_0x3be2,0x1cd11));function a179_0x3be2(){const _0xe6ff8f=['now','2905331DXlQkt','12gskClp','5451xLYNrp','14WwzJqt','replace','5294ApFGYw','toFixed','266090qoLntD','1246220vuwjcd','816936KIswtI','335142zUqLDL','6YVkaMj','7RVPMPi'];a179_0x3be2=function(){return _0xe6ff8f;};return a179_0x3be2();}export function formatElapsed(_0x19b83a){const _0x3da735=a179_0x28c3,_0x515948=Date[_0x3da735(0x1d5)]()-_0x19b83a;if(_0x515948<0x3e8)return _0x515948+'ms';const _0x5e4004=(_0x515948/0x3e8)[_0x3da735(0x1ce)](0x2),_0x291f08=_0x5e4004[_0x3da735(0x1da)](/\.?0+$/u,'');return _0x291f08+'s';}
@@ -1 +1 @@
1
- (function(_0x126e3e,_0x32660b){const _0x1ba9a7=a181_0x5df7,_0x3f7dd7=_0x126e3e();while(!![]){try{const _0x555783=parseInt(_0x1ba9a7(0x118))/0x1*(-parseInt(_0x1ba9a7(0xb9))/0x2)+parseInt(_0x1ba9a7(0xbb))/0x3+parseInt(_0x1ba9a7(0xd2))/0x4*(parseInt(_0x1ba9a7(0xbf))/0x5)+parseInt(_0x1ba9a7(0x117))/0x6+parseInt(_0x1ba9a7(0xdd))/0x7*(parseInt(_0x1ba9a7(0xde))/0x8)+parseInt(_0x1ba9a7(0xfc))/0x9*(parseInt(_0x1ba9a7(0xdc))/0xa)+-parseInt(_0x1ba9a7(0x128))/0xb;if(_0x555783===_0x32660b)break;else _0x3f7dd7['push'](_0x3f7dd7['shift']());}catch(_0x296a4a){_0x3f7dd7['push'](_0x3f7dd7['shift']());}}}(a181_0x22e7,0x3fdb8));import a181_0x24c8a2 from'path';import a181_0x2d24f7 from'fs';import a181_0x151d20 from'chalk';import a181_0x55881e 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';function a181_0x5df7(_0x2f1e6d,_0x48ea7c){_0x2f1e6d=_0x2f1e6d-0xb8;const _0x22e755=a181_0x22e7();let _0x5df75c=_0x22e755[_0x2f1e6d];return _0x5df75c;}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(_0x954816){const _0x5389b7=a181_0x5df7;try{const _0x42ce9c=a181_0x2d24f7[_0x5389b7(0xf5)](_0x954816);if(!_0x42ce9c[_0x5389b7(0xbe)]())return null;return{'dev':_0x42ce9c['dev'],'ino':_0x42ce9c[_0x5389b7(0xe9)]};}catch{return null;}}function isSameDirectory(_0x28af73,_0x206960){const _0x440f14=a181_0x5df7;return!!_0x28af73&&!!_0x206960&&_0x28af73[_0x440f14(0xfa)]===_0x206960['dev']&&_0x28af73[_0x440f14(0xe9)]===_0x206960['ino'];}function commitCurrentDirectoryProject(_0x33bd7f,_0x5ce66e,_0x16a6cf){const _0xa4a448=a181_0x5df7;if(!isSameDirectory(readDirectoryIdentity(_0x33bd7f),_0x16a6cf))throw new Error(_0xa4a448(0x12d));const _0x4ab500=a181_0x24c8a2['basename'](_0x5ce66e),_0x3f0ddc=a181_0x2d24f7['readdirSync'](_0x33bd7f);if(_0x3f0ddc['length']!==0x1||_0x3f0ddc[0x0]!==_0x4ab500)throw CliErrors[_0xa4a448(0xe2)](_0xa4a448(0xc7),'Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.');const _0x20b744=a181_0x24c8a2['join'](_0x5ce66e,_0xa4a448(0x11d)),_0x23cf91=[];try{for(const _0x5938c3 of a181_0x2d24f7['readdirSync'](_0x20b744)){a181_0x2d24f7[_0xa4a448(0xba)](a181_0x24c8a2[_0xa4a448(0xf7)](_0x20b744,_0x5938c3),a181_0x24c8a2['join'](_0x33bd7f,_0x5938c3)),_0x23cf91['push'](_0x5938c3);}a181_0x2d24f7[_0xa4a448(0xf2)](_0x5ce66e,{'recursive':!![],'force':!![]});}catch(_0x247754){for(const _0x28ab2c of _0x23cf91[_0xa4a448(0x11a)]()){const _0x5a386f=a181_0x24c8a2['join'](_0x33bd7f,_0x28ab2c);if(!a181_0x2d24f7[_0xa4a448(0xd4)](_0x5a386f))continue;a181_0x2d24f7[_0xa4a448(0xba)](_0x5a386f,a181_0x24c8a2['join'](_0x20b744,_0x28ab2c));}throw _0x247754;}}export async function createApp(_0xffb395){const _0x4e1d4a=a181_0x5df7,_0x4e698a=await checkCliVersion();(_0x4e698a[_0x4e1d4a(0xea)]||_0x4e698a[_0x4e1d4a(0x113)])&&(printCliUpgradeWarning(_0x4e698a),assertCliVersionSupported(_0x4e698a),logger[_0x4e1d4a(0x11e)](_0x4e1d4a(0xed),_0x4e1d4a(0x104),{'currentVersion':_0x4e698a[_0x4e1d4a(0xef)],'stableVersion':_0x4e698a['stableVersion'],'minimumVersion':_0x4e698a[_0x4e1d4a(0xdb)],'needsUpgrade':_0x4e698a[_0x4e1d4a(0xea)],'belowMinimum':_0x4e698a['belowMinimum']}));const _0x309c3f=_0xffb395[_0x4e1d4a(0x130)]?a181_0x24c8a2[_0x4e1d4a(0x108)](process[_0x4e1d4a(0x110)]()):_0xffb395['projectCode'];if(_0x309c3f&&(_0xffb395[_0x4e1d4a(0xb8)]||_0xffb395[_0x4e1d4a(0x119)]))await runCreate({'projectName':_0x309c3f,'appCode':_0xffb395[_0x4e1d4a(0xb8)],'env':_0xffb395[_0x4e1d4a(0x106)]},_0xffb395);else{if(_0x309c3f){const _0x54187c=await selectSingleAppcode(_0xffb395[_0x4e1d4a(0x100)]);await runCreate({'projectName':_0x309c3f,'appCode':_0x54187c||undefined,'env':_0xffb395['env']},_0xffb395);}else await guidedCreateProject(_0x337c61=>runCreate(_0x337c61,_0xffb395),_0xffb395[_0x4e1d4a(0x106)],_0xffb395[_0x4e1d4a(0x100)]);}}async function runCreate(_0x30e4e7,_0xe0a441){const _0x2c1419=a181_0x5df7;_0x30e4e7['projectName']=validateProjectName(_0x30e4e7['projectName']);const _0x2c5812=_0xe0a441[_0x2c1419(0x130)]?process[_0x2c1419(0x110)]():a181_0x24c8a2[_0x2c1419(0x107)](process['cwd'](),_0x30e4e7[_0x2c1419(0x105)]);if(_0xe0a441['currentDir']){if(a181_0x2d24f7[_0x2c1419(0x109)](_0x2c5812)[_0x2c1419(0xc3)]>0x0)throw CliErrors[_0x2c1419(0xe2)](_0x2c1419(0xeb),_0x2c1419(0xe3));}else{if(a181_0x2d24f7[_0x2c1419(0xd4)](_0x2c5812))throw new Error(_0x2c1419(0x126)+_0x30e4e7[_0x2c1419(0x105)]+'\x20already\x20exists');}let _0x594fc7=null;const _0x55e580=_0xe0a441[_0x2c1419(0x130)]?readDirectoryIdentity(_0x2c5812):null;let _0x5c9531=null;try{a181_0x2d24f7['accessSync'](a181_0x24c8a2[_0x2c1419(0xc9)](_0x2c5812),a181_0x2d24f7[_0x2c1419(0xc2)]['W_OK']);}catch{throw new Error(_0x2c1419(0x103));}logger['info'](_0x2c1419(0xed),_0x2c1419(0xe5)+_0x30e4e7['projectName'],{'projectDir':_0x2c5812,'appCode':_0x30e4e7['appCode']}),console['log'](),console[_0x2c1419(0xbc)](a181_0x151d20['green'](_0x2c1419(0xcb))+_0x2c1419(0xcf)+a181_0x151d20[_0x2c1419(0xd1)](_0x30e4e7['projectName'])+(_0x30e4e7[_0x2c1419(0xb8)]?_0x2c1419(0xe4)+a181_0x151d20['cyan'](_0x30e4e7[_0x2c1419(0xb8)]):''));try{let _0x4e1dd6=_0x30e4e7[_0x2c1419(0x105)];_0xe0a441['currentDir']&&(_0x5c9531=a181_0x2d24f7['mkdtempSync'](a181_0x24c8a2[_0x2c1419(0xf7)](_0x2c5812,_0x2c1419(0x129))),_0x4e1dd6=a181_0x24c8a2[_0x2c1419(0x121)](process[_0x2c1419(0x110)](),a181_0x24c8a2[_0x2c1419(0xf7)](_0x5c9531,_0x2c1419(0x11d))));const _0x36345a=a181_0x24c8a2[_0x2c1419(0x107)](process[_0x2c1419(0x110)](),_0x4e1dd6);await runTask(_0x2c1419(0x12a),_0x13b239=>copyProjectTemplate(_0x4e1dd6,_0x2c9cca=>_0x13b239(projectTemplateStageLabel(_0x2c9cca)),_0xe0a441[_0x2c1419(0xda)]),_0x2c1419(0xfe)),_0x594fc7=_0xe0a441[_0x2c1419(0x130)]?null:readDirectoryIdentity(_0x2c5812);if(!_0xe0a441['currentDir']&&!_0x594fc7)throw new Error(_0x2c1419(0x125));await updatePackageJsonName(_0x4e1dd6,_0x30e4e7[_0x2c1419(0x105)]),await runTask(_0x2c1419(0x123),()=>installDependencies(_0x4e1dd6)),await runTask('Format\x20code',()=>formatProjectCode(_0x4e1dd6)),await configureAppCode(_0x4e1dd6,_0x30e4e7['projectName'],_0x30e4e7[_0x2c1419(0xb8)]||'',_0x30e4e7[_0x2c1419(0x106)]);let _0xee0b3f=![];if(_0x30e4e7[_0x2c1419(0xb8)]){console[_0x2c1419(0xbc)](_0x2c1419(0xca));const _0x540658=process[_0x2c1419(0x110)]();try{process[_0x2c1419(0xe7)](_0x36345a);const _0xc1696=_0x30e4e7[_0x2c1419(0x106)]||_0x2c1419(0xe6);initEnv(_0xc1696);const {configArray:_0x55df5f}=await fetchModelList(_0x30e4e7[_0x2c1419(0xb8)],_0xe0a441[_0x2c1419(0x100)]||''),_0x12bfa0=DEFAULT_API_DIR,_0x4e34f6=await generateApiFile(_0x55df5f,'',_0x30e4e7[_0x2c1419(0xb8)],!![],_0xc1696,_0x12bfa0,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x2c1419(0xbc)](_0x2c1419(0xce)+_0x55df5f[_0x2c1419(0xc3)]+_0x2c1419(0x12c)+_0x4e34f6[_0x2c1419(0x116)]+_0x2c1419(0xbd)),logger[_0x2c1419(0x11e)](_0x2c1419(0xed),'API\x20configuration\x20pulled:\x20'+_0x30e4e7[_0x2c1419(0xb8)]);}catch(_0x4b912f){_0xee0b3f=!![],console[_0x2c1419(0xbc)](_0x2c1419(0xe1)+CLI_BIN_NAME+_0x2c1419(0xec)),logger[_0x2c1419(0x10c)]('create',_0x2c1419(0x120),{'error':_0x4b912f instanceof Error?_0x4b912f[_0x2c1419(0x112)]:String(_0x4b912f)});}finally{process[_0x2c1419(0xe7)](_0x540658);}}if(_0xe0a441['currentDir']){if(!_0x5c9531||!_0x55e580)throw new Error(_0x2c1419(0xd8));commitCurrentDirectoryProject(_0x2c5812,_0x5c9531,_0x55e580),_0x5c9531=null;}try{logger[_0x2c1419(0xff)](_0x2c5812),logger[_0x2c1419(0xd9)](_0x2c1419(0xed),'Project\x20created:\x20'+_0x30e4e7[_0x2c1419(0x105)]);}catch(_0x5b4f3b){console[_0x2c1419(0x10c)](_0x2c1419(0xf9)+(_0x5b4f3b instanceof Error?_0x5b4f3b[_0x2c1419(0x112)]:String(_0x5b4f3b)));}console[_0x2c1419(0xbc)](),console['log'](a181_0x151d20['green']('─'[_0x2c1419(0x115)](0x3c))),console['log'](a181_0x151d20[_0x2c1419(0x10e)][_0x2c1419(0xf1)](_0x2c1419(0x11b))),console[_0x2c1419(0xbc)]();const _0x175d98=_0xe0a441['currentDir']?CLI_BIN_NAME+'\x20run\x20start':_0x2c1419(0xdf)+_0x30e4e7[_0x2c1419(0x105)]+_0x2c1419(0xf0)+CLI_BIN_NAME+'\x20run\x20start';console[_0x2c1419(0xbc)](_0x2c1419(0xc6)+a181_0x151d20[_0x2c1419(0x10e)]['bold'](_0x175d98)),_0xee0b3f&&console[_0x2c1419(0xbc)](_0x2c1419(0x127)+a181_0x151d20[_0x2c1419(0x10e)][_0x2c1419(0xf1)](CLI_BIN_NAME+'\x20api\x20pull\x20--force\x20--yes')),console['log'](a181_0x151d20[_0x2c1419(0xd1)]('─'[_0x2c1419(0x115)](0x3c)));}catch(_0x276d81){logger[_0x2c1419(0x12e)](_0x2c1419(0xed),'Project\x20creation\x20failed:\x20'+_0x30e4e7[_0x2c1419(0x105)],{'error':_0x276d81 instanceof Error?_0x276d81[_0x2c1419(0x112)]:String(_0x276d81)});try{const _0x2c2c7c=readDirectoryIdentity(_0x2c5812);if(_0xe0a441['currentDir']&&_0x5c9531)a181_0x2d24f7[_0x2c1419(0xf2)](_0x5c9531,{'recursive':!![],'force':!![]});else{if(_0x594fc7&&_0x2c2c7c?.['dev']===_0x594fc7[_0x2c1419(0xfa)]&&_0x2c2c7c['ino']===_0x594fc7[_0x2c1419(0xe9)])console['log'](_0x2c1419(0x11c)+_0x2c5812),a181_0x2d24f7[_0x2c1419(0xf2)](_0x2c5812,{'recursive':!![],'force':!![]});else _0x2c2c7c&&logger[_0x2c1419(0x10c)](_0x2c1419(0xed),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0x2c5812);}}catch{logger[_0x2c1419(0x10c)]('create',_0x2c1419(0xfd)+_0x2c5812);}throw _0x276d81;}}async function runTask(_0x3502db,_0x361322,_0x27ddce=_0x3502db){const _0x4979f1=a181_0x5df7,_0x41576a=a181_0x55881e(_0x3502db+'...')[_0x4979f1(0x122)]();try{const _0x4b0432=await _0x361322(_0x4625b5=>{_0x41576a['text']=_0x4625b5+'...';});_0x41576a[_0x4979f1(0xe0)](),console[_0x4979f1(0xbc)](''+a181_0x151d20[_0x4979f1(0xd1)](_0x4979f1(0xcb))+_0x27ddce+'\x20'+a181_0x151d20[_0x4979f1(0x10b)]('['+_0x4b0432+']'));}catch(_0x2fa798){_0x41576a[_0x4979f1(0xd7)](_0x3502db);throw _0x2fa798;}}function a181_0x22e7(){const _0x58ca08=['√\x20Configuration\x20file\x20created,\x20Apps:\x20','dirname','*\x20Pulling\x20API\x20configuration...','\x20√\x20','√\x20package.json\x20updated:\x20name=','name','√\x20Pulled\x20','Project\x20name:\x20','stringify','green','372irgQlz','readFileSync','existsSync','Configured\x20app\x20AppCode:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','fail','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','success','templateSource','minimumVersion','10DiMxGU','24493VoRczf','1176USseaQ','cd\x20','stop','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','validation','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','\x20|\x20AppCode:\x20','Starting\x20project\x20creation:\x20','production','chdir','parse','ino','needsUpgrade','The\x20current\x20directory\x20must\x20be\x20empty.','\x20api\x20pull\x20--force\x20--yes','create','extracting','currentVersion','\x20&&\x20','bold','rmSync','Failed\x20to\x20configure\x20app\x20AppCode','Updating\x20package.json\x20name','lstatSync','*\x20Configuring\x20AppCode\x20for\x20project\x20','join','Failed\x20to\x20update\x20package.json','!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20','dev','copying','1369107oOGDPg','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','Project\x20template\x20ready','setLogPath','cookie','utf8','1.0.0','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','CLI\x20version\x20check','projectName','env','resolve','basename','readdirSync','\x20config\x20set\x20appcode\x20<app-code>\x27','gray','warn','\x20Generated\x20by\x20rabetbase\x20cli\x20','cyan','resolving','cwd','Extracting\x20project\x20template','message','belowMinimum','version','repeat','modelCount','18078LmukIo','109eAGnpZ','nonInteractive','reverse','🚀\x20Next\x20Steps:','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','project','info','string','API\x20configuration\x20pull\x20failed','relative','start','Install\x20dependencies','package.json','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','Project\x20directory\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','8247184dSbQZD','.rabetbase-create-','Resolving\x20project\x20template','Copying\x20local\x20template\x20source','\x20dataset(s),\x20generated\x20','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','error','verifying','currentDir','appCode','8922xXNcEk','renameSync','1062966cUsrOy','log','\x20model(s)','isDirectory','25470pTPMoj','downloading','\x20|\x20Default:\x20implicit\x20(single\x20app)','constants','length','apps','Verifying\x20project\x20template','\x20\x201.\x20Start\x20project:\x20','The\x20current\x20directory\x20changed\x20during\x20project\x20creation.'];a181_0x22e7=function(){return _0x58ca08;};return a181_0x22e7();}function projectTemplateStageLabel(_0x52f70a){const _0x37e872=a181_0x5df7;switch(_0x52f70a){case _0x37e872(0x10f):return _0x37e872(0x12a);case _0x37e872(0xc0):return'Downloading\x20project\x20template';case _0x37e872(0x12f):return _0x37e872(0xc5);case _0x37e872(0xee):return _0x37e872(0x111);case _0x37e872(0xfb):return _0x37e872(0x12b);}}async function updatePackageJsonName(_0x249c45,_0x101fdb){const _0x5177f9=a181_0x5df7,_0x13f540=a181_0x24c8a2[_0x5177f9(0x107)](process[_0x5177f9(0x110)](),_0x249c45),_0x882daf=a181_0x24c8a2[_0x5177f9(0xf7)](_0x13f540,_0x5177f9(0x124));try{console['log'](_0x5177f9(0xd6));const _0x15979e=getRabetbaseCliPackageRoot(),_0x4ffee2=a181_0x24c8a2['join'](_0x15979e,_0x5177f9(0x124));let _0x1d326b=_0x5177f9(0x102);try{const _0x14fb1e=JSON[_0x5177f9(0xe8)](a181_0x2d24f7['readFileSync'](_0x4ffee2,_0x5177f9(0x101)));_0x1d326b=_0x14fb1e[_0x5177f9(0x114)]||_0x5177f9(0x102);}catch{}const _0x4a1641=a181_0x2d24f7[_0x5177f9(0xd3)](_0x882daf,_0x5177f9(0x101)),_0x4a9a8f=JSON[_0x5177f9(0xe8)](_0x4a1641);_0x4a9a8f[_0x5177f9(0xcd)]=_0x101fdb,_0x4a9a8f['description']=_0x101fdb+_0x5177f9(0x10d)+_0x1d326b,a181_0x2d24f7['writeFileSync'](_0x882daf,JSON[_0x5177f9(0xd0)](_0x4a9a8f,null,0x2)+'\x0a',_0x5177f9(0x101)),console[_0x5177f9(0xbc)](_0x5177f9(0xcc)+_0x101fdb),logger[_0x5177f9(0x11e)](_0x5177f9(0xed),_0x5177f9(0xf4));}catch(_0x54de4){logger['error']('create',_0x5177f9(0xf8));throw _0x54de4;}}async function configureAppCode(_0x9ec1a4,_0x5d6088,_0x2dff7f,_0x19e01d){const _0x2a64b4=a181_0x5df7,_0x232174=a181_0x24c8a2['resolve'](process[_0x2a64b4(0x110)](),_0x9ec1a4),_0x26a357=a181_0x24c8a2['join'](_0x232174,NEW_CONFIG_NAME);try{_0x2dff7f?console[_0x2a64b4(0xbc)](_0x2a64b4(0xf6)+_0x5d6088+':\x20'+_0x2dff7f):console[_0x2a64b4(0xbc)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x5d6088);const _0x229e2d=getRabetbaseCliPackageRoot(),_0x5e559e=a181_0x24c8a2[_0x2a64b4(0xf7)](_0x229e2d,'package.json');let _0x6f32b9=_0x2a64b4(0x102);try{const _0x35cd8f=JSON['parse'](a181_0x2d24f7[_0x2a64b4(0xd3)](_0x5e559e,_0x2a64b4(0x101)));_0x6f32b9=_0x35cd8f[_0x2a64b4(0x114)]||'1.0.0';}catch{}const {globalConfig:_0x15f2d0}=loadRawConfigLayers(),_0x271014=typeof _0x15f2d0[_0x2a64b4(0x106)]===_0x2a64b4(0x11f)?_0x15f2d0[_0x2a64b4(0x106)]:undefined,_0x37eacb={};for(const _0x5e9cdd of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x15f2d0[_0x5e9cdd]!=null)_0x37eacb[_0x5e9cdd]=_0x15f2d0[_0x5e9cdd];}const _0x496de0=buildCanonicalProjectConfig(_0x37eacb,{'appCodes':_0x2dff7f?[_0x2dff7f]:[],'env':_0x19e01d||_0x271014||_0x2a64b4(0xe6),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x6f32b9}});writeConfigFile(_0x26a357,_0x496de0),await generateSdkConfigFile(a181_0x24c8a2[_0x2a64b4(0xf7)](_0x232174,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x232174),_0x2dff7f?console['log'](_0x2a64b4(0xc8)+Object['keys'](_0x496de0[_0x2a64b4(0xc4)]||{})[_0x2a64b4(0xf7)](',\x20')+_0x2a64b4(0xc1)):console[_0x2a64b4(0xbc)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x2a64b4(0x10a)),logger[_0x2a64b4(0x11e)](_0x2a64b4(0xed),_0x2a64b4(0xd5)+_0x2dff7f);}catch(_0x540acb){logger[_0x2a64b4(0x12e)]('create',_0x2a64b4(0xf3));throw _0x540acb;}}
1
+ (function(_0x49ff86,_0x39ea2d){const _0x5184df=a180_0x1274,_0x28709f=_0x49ff86();while(!![]){try{const _0x590cf7=parseInt(_0x5184df(0xfe))/0x1*(-parseInt(_0x5184df(0x114))/0x2)+-parseInt(_0x5184df(0xfc))/0x3+parseInt(_0x5184df(0xd9))/0x4*(-parseInt(_0x5184df(0x119))/0x5)+parseInt(_0x5184df(0x100))/0x6*(-parseInt(_0x5184df(0x121))/0x7)+parseInt(_0x5184df(0x135))/0x8+parseInt(_0x5184df(0x126))/0x9+parseInt(_0x5184df(0x133))/0xa;if(_0x590cf7===_0x39ea2d)break;else _0x28709f['push'](_0x28709f['shift']());}catch(_0x4fa8ec){_0x28709f['push'](_0x28709f['shift']());}}}(a180_0xda03,0x3cc84));import a180_0x2f8960 from'path';import a180_0x2474d0 from'fs';import a180_0x9631a9 from'chalk';import a180_0x5d5bb2 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';function a180_0x1274(_0x5d919d,_0x26ca37){_0x5d919d=_0x5d919d-0xd5;const _0xda0352=a180_0xda03();let _0x127499=_0xda0352[_0x5d919d];return _0x127499;}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';function a180_0xda03(){const _0xcb1b9b=['The\x20current\x20directory\x20changed\x20during\x20project\x20creation.','copying','\x20already\x20exists','repeat','1218348eitNaN','project','12fvQIxk','start','390vfbVZg','dev','1.0.0','mkdtempSync','setLogPath','basename','Starting\x20project\x20creation:\x20','Resolving\x20project\x20template','error','minimumVersion','*\x20Configuring\x20AppCode\x20for\x20project\x20','Remove\x20or\x20move\x20the\x20existing\x20files,\x20then\x20retry\x20with\x20--current-dir.','Updating\x20package.json\x20name','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','\x20model(s)','\x20config\x20set\x20appcode\x20<app-code>\x27','bold','env','needsUpgrade','Project\x20directory\x20','58662McAeuZ','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','gray','extracting','text','20045DktQRP','\x20\x201.\x20Start\x20project:\x20','version','verifying','constants','projectName','cookie','cwd','33362JctrIr','\x20|\x20AppCode:\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','nonInteractive','stringify','1921248ywFwBz','√\x20Configuration\x20file\x20created,\x20Apps:\x20','Current\x20directory\x20identity\x20changed\x20during\x20project\x20creation','green','info','Format\x20code','dirname','The\x20current\x20directory\x20must\x20be\x20empty.','push','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20','isDirectory','lstatSync','currentDir','12342660eUDPNu','renameSync','1422376fSGKSl','Verifying\x20project\x20template','utf8','cyan','currentVersion','join','accessSync','W_OK','package.json','description','templateSource','resolve','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','\x20api\x20pull\x20--force\x20--yes','warn','Install\x20dependencies','success','belowMinimum','create','Failed\x20to\x20update\x20package.json','cd\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','log','🚀\x20Next\x20Steps:','validation','apps','readdirSync','\x20|\x20Default:\x20implicit\x20(single\x20app)','appCode','API\x20configuration\x20pulled:\x20','308jlJJym','string','name','\x20\x202.\x20Pull\x20API\x20configuration:\x20','ino','parse','Project\x20created:\x20','...','Unable\x20to\x20prepare\x20the\x20current\x20directory\x20workspace','\x20run\x20start','Failed\x20to\x20configure\x20app\x20AppCode','readFileSync','message','√\x20Pulled\x20','writeFileSync','Remove\x20the\x20new\x20files\x20and\x20retry\x20from\x20an\x20empty\x20directory.','existsSync','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','reverse','*\x20Pulling\x20API\x20configuration...','\x20&&\x20','Copying\x20local\x20template\x20source','\x20√\x20','rmSync','length','toLocaleString','Project\x20creation\x20failed:\x20','resolving','chdir','stop','downloading'];a180_0xda03=function(){return _0xcb1b9b;};return a180_0xda03();}import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectDomainRoutingManifest}from'../../../config/project-domain-routing.js';import{CliErrors}from'../../../errors.js';function readDirectoryIdentity(_0x6f906c){const _0x4468c3=a180_0x1274;try{const _0x151833=a180_0x2474d0[_0x4468c3(0x131)](_0x6f906c);if(!_0x151833[_0x4468c3(0x130)]())return null;return{'dev':_0x151833[_0x4468c3(0x101)],'ino':_0x151833['ino']};}catch{return null;}}function isSameDirectory(_0x28bc37,_0x195686){const _0x58cd93=a180_0x1274;return!!_0x28bc37&&!!_0x195686&&_0x28bc37['dev']===_0x195686['dev']&&_0x28bc37[_0x58cd93(0xdd)]===_0x195686[_0x58cd93(0xdd)];}function commitCurrentDirectoryProject(_0x27ea55,_0x1fdbee,_0x95b816){const _0x4e930a=a180_0x1274;if(!isSameDirectory(readDirectoryIdentity(_0x27ea55),_0x95b816))throw new Error(_0x4e930a(0x128));const _0x4d03a2=a180_0x2f8960[_0x4e930a(0x105)](_0x1fdbee),_0x21b841=a180_0x2474d0[_0x4e930a(0xd5)](_0x27ea55);if(_0x21b841[_0x4e930a(0xf1)]!==0x1||_0x21b841[0x0]!==_0x4d03a2)throw CliErrors[_0x4e930a(0x14d)](_0x4e930a(0xf8),_0x4e930a(0xe8));const _0x50fa11=a180_0x2f8960[_0x4e930a(0x13a)](_0x1fdbee,_0x4e930a(0xfd)),_0x329e8d=[];try{for(const _0x1b7134 of a180_0x2474d0[_0x4e930a(0xd5)](_0x50fa11)){a180_0x2474d0[_0x4e930a(0x134)](a180_0x2f8960[_0x4e930a(0x13a)](_0x50fa11,_0x1b7134),a180_0x2f8960[_0x4e930a(0x13a)](_0x27ea55,_0x1b7134)),_0x329e8d[_0x4e930a(0x12e)](_0x1b7134);}a180_0x2474d0['rmSync'](_0x1fdbee,{'recursive':!![],'force':!![]});}catch(_0x57873d){for(const _0x1ae320 of _0x329e8d[_0x4e930a(0xeb)]()){const _0x56ef51=a180_0x2f8960['join'](_0x27ea55,_0x1ae320);if(!a180_0x2474d0[_0x4e930a(0xe9)](_0x56ef51))continue;a180_0x2474d0[_0x4e930a(0x134)](_0x56ef51,a180_0x2f8960[_0x4e930a(0x13a)](_0x50fa11,_0x1ae320));}throw _0x57873d;}}export async function createApp(_0x44011f){const _0x4ce271=a180_0x1274,_0x442861=await checkCliVersion();(_0x442861[_0x4ce271(0x112)]||_0x442861[_0x4ce271(0x146)])&&(printCliUpgradeWarning(_0x442861),assertCliVersionSupported(_0x442861),logger['info'](_0x4ce271(0x147),'CLI\x20version\x20check',{'currentVersion':_0x442861[_0x4ce271(0x139)],'stableVersion':_0x442861['stableVersion'],'minimumVersion':_0x442861[_0x4ce271(0x109)],'needsUpgrade':_0x442861[_0x4ce271(0x112)],'belowMinimum':_0x442861[_0x4ce271(0x146)]}));const _0x496371=_0x44011f[_0x4ce271(0x132)]?a180_0x2f8960[_0x4ce271(0x105)](process[_0x4ce271(0x120)]()):_0x44011f['projectCode'];if(_0x496371&&(_0x44011f[_0x4ce271(0xd7)]||_0x44011f[_0x4ce271(0x124)]))await runCreate({'projectName':_0x496371,'appCode':_0x44011f[_0x4ce271(0xd7)],'env':_0x44011f['env']},_0x44011f);else{if(_0x496371){const _0x1bb333=await selectSingleAppcode(_0x44011f[_0x4ce271(0x11f)]);await runCreate({'projectName':_0x496371,'appCode':_0x1bb333||undefined,'env':_0x44011f[_0x4ce271(0x111)]},_0x44011f);}else await guidedCreateProject(_0x4b427c=>runCreate(_0x4b427c,_0x44011f),_0x44011f[_0x4ce271(0x111)],_0x44011f[_0x4ce271(0x11f)]);}}async function runCreate(_0x3fcce7,_0x3d499d){const _0x45d859=a180_0x1274;_0x3fcce7[_0x45d859(0x11e)]=validateProjectName(_0x3fcce7[_0x45d859(0x11e)]);const _0x57daaa=_0x3d499d[_0x45d859(0x132)]?process[_0x45d859(0x120)]():a180_0x2f8960[_0x45d859(0x140)](process[_0x45d859(0x120)](),_0x3fcce7[_0x45d859(0x11e)]);if(_0x3d499d[_0x45d859(0x132)]){if(a180_0x2474d0[_0x45d859(0xd5)](_0x57daaa)[_0x45d859(0xf1)]>0x0)throw CliErrors[_0x45d859(0x14d)](_0x45d859(0x12d),_0x45d859(0x10b));}else{if(a180_0x2474d0[_0x45d859(0xe9)](_0x57daaa))throw new Error(_0x45d859(0x113)+_0x3fcce7[_0x45d859(0x11e)]+_0x45d859(0xfa));}let _0x46e1bd=null;const _0x31818a=_0x3d499d[_0x45d859(0x132)]?readDirectoryIdentity(_0x57daaa):null;let _0x509171=null;try{a180_0x2474d0[_0x45d859(0x13b)](a180_0x2f8960[_0x45d859(0x12c)](_0x57daaa),a180_0x2474d0[_0x45d859(0x11d)][_0x45d859(0x13c)]);}catch{throw new Error(_0x45d859(0xea));}logger[_0x45d859(0x12a)](_0x45d859(0x147),_0x45d859(0x106)+_0x3fcce7['projectName'],{'projectDir':_0x57daaa,'appCode':_0x3fcce7[_0x45d859(0xd7)]}),console[_0x45d859(0x14b)](),console[_0x45d859(0x14b)](a180_0x9631a9[_0x45d859(0x129)](_0x45d859(0xef))+'Project\x20name:\x20'+a180_0x9631a9[_0x45d859(0x129)](_0x3fcce7['projectName'])+(_0x3fcce7['appCode']?_0x45d859(0x122)+a180_0x9631a9[_0x45d859(0x138)](_0x3fcce7['appCode']):''));try{let _0x7e9704=_0x3fcce7['projectName'];_0x3d499d[_0x45d859(0x132)]&&(_0x509171=a180_0x2474d0[_0x45d859(0x103)](a180_0x2f8960[_0x45d859(0x13a)](_0x57daaa,'.rabetbase-create-')),_0x7e9704=a180_0x2f8960['relative'](process[_0x45d859(0x120)](),a180_0x2f8960[_0x45d859(0x13a)](_0x509171,_0x45d859(0xfd))));const _0x417575=a180_0x2f8960['resolve'](process['cwd'](),_0x7e9704);await runTask(_0x45d859(0x107),_0x6c1835=>copyProjectTemplate(_0x7e9704,_0x5b4d3c=>_0x6c1835(projectTemplateStageLabel(_0x5b4d3c)),_0x3d499d[_0x45d859(0x13f)]),'Project\x20template\x20ready'),_0x46e1bd=_0x3d499d[_0x45d859(0x132)]?null:readDirectoryIdentity(_0x57daaa);if(!_0x3d499d['currentDir']&&!_0x46e1bd)throw new Error(_0x45d859(0x10d));await updatePackageJsonName(_0x7e9704,_0x3fcce7['projectName']),await runTask(_0x45d859(0x144),()=>installDependencies(_0x7e9704)),await runTask(_0x45d859(0x12b),()=>formatProjectCode(_0x7e9704)),await configureAppCode(_0x7e9704,_0x3fcce7[_0x45d859(0x11e)],_0x3fcce7[_0x45d859(0xd7)]||'',_0x3fcce7[_0x45d859(0x111)]);let _0x4695e4=![];if(_0x3fcce7['appCode']){console[_0x45d859(0x14b)](_0x45d859(0xec));const _0x51635f=process['cwd']();try{process[_0x45d859(0xf5)](_0x417575);const _0x597832=_0x3fcce7[_0x45d859(0x111)]||'production';initEnv(_0x597832);const {configArray:_0x4a6db7}=await fetchModelList(_0x3fcce7[_0x45d859(0xd7)],_0x3d499d[_0x45d859(0x11f)]||''),_0x228275=DEFAULT_API_DIR,_0x25fabf=await generateApiFile(_0x4a6db7,'',_0x3fcce7[_0x45d859(0xd7)],!![],_0x597832,_0x228275,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x45d859(0x14b)](_0x45d859(0xe6)+_0x4a6db7[_0x45d859(0xf1)]+'\x20dataset(s),\x20generated\x20'+_0x25fabf['modelCount']+_0x45d859(0x10e)),logger[_0x45d859(0x12a)](_0x45d859(0x147),_0x45d859(0xd8)+_0x3fcce7[_0x45d859(0xd7)]);}catch(_0x437246){_0x4695e4=!![],console[_0x45d859(0x14b)](_0x45d859(0x12f)+CLI_BIN_NAME+_0x45d859(0x142)),logger[_0x45d859(0x143)]('create','API\x20configuration\x20pull\x20failed',{'error':_0x437246 instanceof Error?_0x437246[_0x45d859(0xe5)]:String(_0x437246)});}finally{process[_0x45d859(0xf5)](_0x51635f);}}if(_0x3d499d[_0x45d859(0x132)]){if(!_0x509171||!_0x31818a)throw new Error(_0x45d859(0xe1));commitCurrentDirectoryProject(_0x57daaa,_0x509171,_0x31818a),_0x509171=null;}try{logger[_0x45d859(0x104)](_0x57daaa),logger[_0x45d859(0x145)](_0x45d859(0x147),_0x45d859(0xdf)+_0x3fcce7[_0x45d859(0x11e)]);}catch(_0xad0b72){console[_0x45d859(0x143)]('!\x20Project\x20created,\x20but\x20local\x20logging\x20could\x20not\x20be\x20initialized:\x20'+(_0xad0b72 instanceof Error?_0xad0b72[_0x45d859(0xe5)]:String(_0xad0b72)));}console[_0x45d859(0x14b)](),console[_0x45d859(0x14b)](a180_0x9631a9[_0x45d859(0x129)]('─'[_0x45d859(0xfb)](0x3c))),console[_0x45d859(0x14b)](a180_0x9631a9[_0x45d859(0x138)][_0x45d859(0x110)](_0x45d859(0x14c))),console['log']();const _0x207b28=_0x3d499d[_0x45d859(0x132)]?CLI_BIN_NAME+_0x45d859(0xe2):_0x45d859(0x149)+_0x3fcce7[_0x45d859(0x11e)]+_0x45d859(0xed)+CLI_BIN_NAME+_0x45d859(0xe2);console[_0x45d859(0x14b)](_0x45d859(0x11a)+a180_0x9631a9[_0x45d859(0x138)][_0x45d859(0x110)](_0x207b28)),_0x4695e4&&console[_0x45d859(0x14b)](_0x45d859(0xdc)+a180_0x9631a9[_0x45d859(0x138)][_0x45d859(0x110)](CLI_BIN_NAME+_0x45d859(0x142))),console[_0x45d859(0x14b)](a180_0x9631a9[_0x45d859(0x129)]('─'[_0x45d859(0xfb)](0x3c)));}catch(_0x36a931){logger[_0x45d859(0x108)](_0x45d859(0x147),_0x45d859(0xf3)+_0x3fcce7['projectName'],{'error':_0x36a931 instanceof Error?_0x36a931['message']:String(_0x36a931)});try{const _0x2f0159=readDirectoryIdentity(_0x57daaa);if(_0x3d499d[_0x45d859(0x132)]&&_0x509171)a180_0x2474d0[_0x45d859(0xf0)](_0x509171,{'recursive':!![],'force':!![]});else{if(_0x46e1bd&&_0x2f0159?.[_0x45d859(0x101)]===_0x46e1bd[_0x45d859(0x101)]&&_0x2f0159['ino']===_0x46e1bd[_0x45d859(0xdd)])console[_0x45d859(0x14b)](_0x45d859(0x123)+_0x57daaa),a180_0x2474d0[_0x45d859(0xf0)](_0x57daaa,{'recursive':!![],'force':!![]});else _0x2f0159&&logger[_0x45d859(0x143)](_0x45d859(0x147),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0x57daaa);}}catch{logger[_0x45d859(0x143)](_0x45d859(0x147),_0x45d859(0x141)+_0x57daaa);}throw _0x36a931;}}async function runTask(_0x2129b7,_0x3416bf,_0x12ab2d=_0x2129b7){const _0x37e831=a180_0x1274,_0x3ff461=a180_0x5d5bb2(_0x2129b7+_0x37e831(0xe0))[_0x37e831(0xff)]();try{const _0x501b45=await _0x3416bf(_0x216f21=>{const _0x4b6a85=_0x37e831;_0x3ff461[_0x4b6a85(0x118)]=_0x216f21+_0x4b6a85(0xe0);});_0x3ff461[_0x37e831(0xf6)](),console[_0x37e831(0x14b)](''+a180_0x9631a9[_0x37e831(0x129)]('\x20√\x20')+_0x12ab2d+'\x20'+a180_0x9631a9[_0x37e831(0x116)]('['+_0x501b45+']'));}catch(_0x5722df){_0x3ff461['fail'](_0x2129b7);throw _0x5722df;}}function projectTemplateStageLabel(_0x15a60c){const _0x52c138=a180_0x1274;switch(_0x15a60c){case _0x52c138(0xf4):return _0x52c138(0x107);case _0x52c138(0xf7):return'Downloading\x20project\x20template';case _0x52c138(0x11c):return _0x52c138(0x136);case _0x52c138(0x117):return'Extracting\x20project\x20template';case _0x52c138(0xf9):return _0x52c138(0xee);}}async function updatePackageJsonName(_0x3236cf,_0x274097){const _0x4a79e3=a180_0x1274,_0x35632e=a180_0x2f8960['resolve'](process[_0x4a79e3(0x120)](),_0x3236cf),_0x2f27ff=a180_0x2f8960[_0x4a79e3(0x13a)](_0x35632e,_0x4a79e3(0x13d));try{console[_0x4a79e3(0x14b)](_0x4a79e3(0x115));const _0x1418b6=getRabetbaseCliPackageRoot(),_0x3754ec=a180_0x2f8960[_0x4a79e3(0x13a)](_0x1418b6,_0x4a79e3(0x13d));let _0x135d49=_0x4a79e3(0x102);try{const _0x3cce03=JSON[_0x4a79e3(0xde)](a180_0x2474d0[_0x4a79e3(0xe4)](_0x3754ec,'utf8'));_0x135d49=_0x3cce03[_0x4a79e3(0x11b)]||_0x4a79e3(0x102);}catch{}const _0x4a557b=a180_0x2474d0[_0x4a79e3(0xe4)](_0x2f27ff,'utf8'),_0x4c3693=JSON[_0x4a79e3(0xde)](_0x4a557b);_0x4c3693[_0x4a79e3(0xdb)]=_0x274097,_0x4c3693[_0x4a79e3(0x13e)]=_0x274097+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x135d49,a180_0x2474d0[_0x4a79e3(0xe7)](_0x2f27ff,JSON[_0x4a79e3(0x125)](_0x4c3693,null,0x2)+'\x0a',_0x4a79e3(0x137)),console[_0x4a79e3(0x14b)]('√\x20package.json\x20updated:\x20name='+_0x274097),logger[_0x4a79e3(0x12a)](_0x4a79e3(0x147),_0x4a79e3(0x10c));}catch(_0x3c5eb4){logger[_0x4a79e3(0x108)]('create',_0x4a79e3(0x148));throw _0x3c5eb4;}}async function configureAppCode(_0x178639,_0x5ba7fc,_0x13a753,_0x14b1c0){const _0x534fa9=a180_0x1274,_0x1bee75=a180_0x2f8960[_0x534fa9(0x140)](process[_0x534fa9(0x120)](),_0x178639),_0x10a9f3=a180_0x2f8960[_0x534fa9(0x13a)](_0x1bee75,NEW_CONFIG_NAME);try{_0x13a753?console[_0x534fa9(0x14b)](_0x534fa9(0x10a)+_0x5ba7fc+':\x20'+_0x13a753):console[_0x534fa9(0x14b)](_0x534fa9(0x14a)+_0x5ba7fc);const _0x5ce497=getRabetbaseCliPackageRoot(),_0x2a444c=a180_0x2f8960[_0x534fa9(0x13a)](_0x5ce497,_0x534fa9(0x13d));let _0x3d7fb0=_0x534fa9(0x102);try{const _0x15c992=JSON[_0x534fa9(0xde)](a180_0x2474d0[_0x534fa9(0xe4)](_0x2a444c,_0x534fa9(0x137)));_0x3d7fb0=_0x15c992['version']||_0x534fa9(0x102);}catch{}const {globalConfig:_0x3b1400}=loadRawConfigLayers(),_0x19eab5=typeof _0x3b1400[_0x534fa9(0x111)]===_0x534fa9(0xda)?_0x3b1400['env']:undefined,_0x5c5302={};for(const _0x4654cd of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3b1400[_0x4654cd]!=null)_0x5c5302[_0x4654cd]=_0x3b1400[_0x4654cd];}const _0x56b19e=buildCanonicalProjectConfig(_0x5c5302,{'appCodes':_0x13a753?[_0x13a753]:[],'env':_0x14b1c0||_0x19eab5||'production','metadata':{'createdAt':new Date()[_0x534fa9(0xf2)](),'version':_0x3d7fb0}});writeConfigFile(_0x10a9f3,_0x56b19e),await generateSdkConfigFile(a180_0x2f8960[_0x534fa9(0x13a)](_0x1bee75,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectDomainRoutingManifest(_0x1bee75),_0x13a753?console[_0x534fa9(0x14b)](_0x534fa9(0x127)+Object['keys'](_0x56b19e[_0x534fa9(0x14e)]||{})[_0x534fa9(0x13a)](',\x20')+_0x534fa9(0xd6)):console[_0x534fa9(0x14b)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x534fa9(0x10f)),logger[_0x534fa9(0x12a)](_0x534fa9(0x147),'Configured\x20app\x20AppCode:\x20'+_0x13a753);}catch(_0x3ffce1){logger[_0x534fa9(0x108)](_0x534fa9(0x147),_0x534fa9(0xe3));throw _0x3ffce1;}}
@@ -1 +1 @@
1
- const a182_0x5a9855=a182_0x5a9b;(function(_0x3dce44,_0x50a073){const _0x4443a8=a182_0x5a9b,_0x45bea6=_0x3dce44();while(!![]){try{const _0x300403=-parseInt(_0x4443a8(0x1df))/0x1+-parseInt(_0x4443a8(0x1d1))/0x2+parseInt(_0x4443a8(0x1e3))/0x3+parseInt(_0x4443a8(0x1f2))/0x4*(parseInt(_0x4443a8(0x1d2))/0x5)+-parseInt(_0x4443a8(0x22c))/0x6*(-parseInt(_0x4443a8(0x1fd))/0x7)+parseInt(_0x4443a8(0x216))/0x8*(parseInt(_0x4443a8(0x1f3))/0x9)+-parseInt(_0x4443a8(0x1d3))/0xa;if(_0x300403===_0x50a073)break;else _0x45bea6['push'](_0x45bea6['shift']());}catch(_0x1bbad5){_0x45bea6['push'](_0x45bea6['shift']());}}}(a182_0x2cf3,0xb4cbe));function a182_0x2cf3(){const _0x3fa58b=['copying','realpath','.rabetbase-create-','downloading','origin','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','object','signal','sep','cdn','has','extracting','ino','project','6YuIwnO','string','concat','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','hex','number','projectTemplate','body','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','byteLength','version','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','href','toLowerCase','digest','Use\x20a\x20different\x20project\x20name.','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','pathname','protocol','sha256:','length','trim','.idea','583660qwLIwN','295cPNuuw','15351480TkVfsS','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','.rabetbase.json','posix','.codegraph','node_modules','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','includes','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','getReader','readdir','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','37282KoyfgR',',\x20received\x20','sha256','Project\x20template\x20package.json\x20is\x20invalid.','2935578woJHqi','isSymbolicLink','update','.lovrabet.log','relative','message','utf8','Unable\x20to\x20claim\x20the\x20project\x20directory.','isFinite','Check\x20the\x20source\x20directory\x20and\x20retry.','application/zip','local','startsWith','from','readFile','7884EcsGGH','36QdllaW','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','code','resolve','Local\x20template\x20source\x20does\x20not\x20exist:\x20','cancel','validation','dirname','EEXIST','size','6498317gYfceH','resolving','.env.','isAbsolute','sub-app-react-demo','releaseLock','chmod','verifying','abort','status','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','dev','parse','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','Project\x20directory\x20already\x20exists:\x20','name','get','join','isFile','access','mode','.lovrabet.json','.rabetbase','package.json','https:','1163312tKyAVu','.env.example','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','isDirectory','lstat','mkdtemp'];a182_0x2cf3=function(){return _0x3fa58b;};return a182_0x2cf3();}import{createHash}from'node:crypto';import a182_0x211a90 from'node:fs/promises';function a182_0x5a9b(_0x10c1f1,_0x2fc166){_0x10c1f1=_0x10c1f1-0x1c5;const _0x2cf337=a182_0x2cf3();let _0x5a9b84=_0x2cf337[_0x10c1f1];return _0x5a9b84;}import a182_0x166faa 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=a182_0x5a9855(0x201),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x3ccd1b){const _0x213f1c=a182_0x5a9855;return typeof _0x3ccd1b===_0x213f1c(0x22d)&&_0x3ccd1b['trim']()?_0x3ccd1b[_0x213f1c(0x1cf)]():null;}function parseDescriptor(_0x593a21){const _0x34ed79=a182_0x5a9855;if(!_0x593a21||typeof _0x593a21!==_0x34ed79(0x224))throw new Error(_0x34ed79(0x20a)+TEMPLATE_ID+'\x22.');const _0x56d112=_0x593a21,_0x344dfb=nonEmptyString(_0x56d112['version']),_0x472aff=nonEmptyString(_0x56d112[_0x34ed79(0x20c)]),_0x3e7427=nonEmptyString(_0x56d112[_0x34ed79(0x1e1)])?.[_0x34ed79(0x1c7)](),_0xf99125=_0x56d112[_0x34ed79(0x1fc)];if(!_0x344dfb||!_0x472aff||_0x472aff!==a182_0x166faa[_0x34ed79(0x1d6)]['basename'](_0x472aff)||_0x472aff[_0x34ed79(0x1da)]('\x5c')||!_0x3e7427||!/^sha256:[a-f0-9]{64}$/['test'](_0x3e7427)||typeof _0xf99125!==_0x34ed79(0x232)||!Number['isSafeInteger'](_0xf99125)||_0xf99125<=0x0||_0xf99125>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22'+TEMPLATE_ID+'\x22.');return{'version':_0x344dfb,'name':_0x472aff,'sha256':_0x3e7427,'size':_0xf99125};}async function fetchWithTimeout(_0x506a04,_0x40e887,_0x3eef15,_0xd0415){const _0xbae6bf=a182_0x5a9855,_0x5d5c1a=new AbortController(),_0x1c73d4=setTimeout(()=>_0x5d5c1a[_0xbae6bf(0x205)](),_0x40e887);try{const _0x3a8409=await fetch(_0x506a04,{'headers':{'Accept':_0x3eef15},'signal':_0x5d5c1a[_0xbae6bf(0x225)]});return await _0xd0415(_0x3a8409);}finally{clearTimeout(_0x1c73d4);}}async function fetchTemplateDescriptor(){const _0x299dbe=a182_0x5a9855,_0x420555=await getRabetbaseCdnConfig();if(!_0x420555)throw new Error(_0x299dbe(0x223));return parseDescriptor(_0x420555[_0x299dbe(0x233)]);}function resolveArchiveUrl(_0x23f809){const _0x37b32c=a182_0x5a9855,_0x4cffdb=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1f0002=new URL(_0x23f809,_0x4cffdb);if(_0x1f0002[_0x37b32c(0x1cc)]!==_0x37b32c(0x215)||_0x1f0002[_0x37b32c(0x221)]!==_0x4cffdb['origin']||!_0x1f0002[_0x37b32c(0x1cb)][_0x37b32c(0x1ef)](_0x4cffdb[_0x37b32c(0x1cb)]))throw new Error(_0x37b32c(0x1c5));return _0x1f0002[_0x37b32c(0x1c6)];}async function readResponseBytes(_0x3d158d,_0x3f32d8){const _0x3160a4=a182_0x5a9855;if(!_0x3d158d[_0x3160a4(0x234)]){const _0x53447c=Buffer['from'](await _0x3d158d['arrayBuffer']());if(_0x53447c[_0x3160a4(0x1ce)]>_0x3f32d8)throw new Error(_0x3160a4(0x1d9));return _0x53447c;}const _0x3369d1=_0x3d158d[_0x3160a4(0x234)][_0x3160a4(0x1dc)](),_0x2cb7c9=[];let _0x454436=0x0;try{while(!![]){const {done:_0x3893c2,value:_0x55153d}=await _0x3369d1['read']();if(_0x3893c2)break;_0x454436+=_0x55153d[_0x3160a4(0x236)];if(_0x454436>_0x3f32d8){await _0x3369d1[_0x3160a4(0x1f8)]();throw new Error(_0x3160a4(0x1d9));}_0x2cb7c9['push'](Buffer[_0x3160a4(0x1f0)](_0x55153d));}}finally{_0x3369d1[_0x3160a4(0x202)]();}return Buffer[_0x3160a4(0x22e)](_0x2cb7c9,_0x454436);}async function downloadArchive(_0x111034,_0x3d8195,_0x5bdaf0){const _0x2f4253=a182_0x5a9855,_0x3992dd=await fetchWithTimeout(resolveArchiveUrl(_0x111034[_0x2f4253(0x20c)]),ARCHIVE_TIMEOUT_MS,_0x2f4253(0x1ed),async _0xae8d3b=>{const _0x10898c=_0x2f4253;if(!_0xae8d3b['ok'])throw new Error(_0x10898c(0x219)+_0xae8d3b[_0x10898c(0x206)]+'.');const _0x122a87=Number(_0xae8d3b['headers'][_0x10898c(0x20d)]('content-length'));if(Number[_0x10898c(0x1eb)](_0x122a87)&&_0x122a87>MAX_ARCHIVE_SIZE)throw new Error(_0x10898c(0x230));return readResponseBytes(_0xae8d3b,_0x111034[_0x10898c(0x1fc)]);});if(_0x3992dd[_0x2f4253(0x1ce)]!==_0x111034[_0x2f4253(0x1fc)])throw new Error(_0x2f4253(0x1de)+_0x111034[_0x2f4253(0x1fc)]+_0x2f4253(0x1e0)+_0x3992dd[_0x2f4253(0x1ce)]+'.');_0x5bdaf0?.(_0x2f4253(0x204));const _0x2266f3=_0x2f4253(0x1cd)+createHash(_0x2f4253(0x1e1))[_0x2f4253(0x1e5)](_0x3992dd)[_0x2f4253(0x1c8)](_0x2f4253(0x231));if(_0x2266f3!==_0x111034[_0x2f4253(0x1e1)])throw new Error(_0x2f4253(0x1db));await a182_0x211a90['writeFile'](_0x3d8195,_0x3992dd,{'flag':'wx'});}async function assertTemplateRoot(_0x2dca3b){const _0x51fb76=a182_0x5a9855,_0x46928e=a182_0x166faa[_0x51fb76(0x20e)](_0x2dca3b,_0x51fb76(0x214)),_0x177dd4=JSON['parse'](await a182_0x211a90[_0x51fb76(0x1f1)](_0x46928e,_0x51fb76(0x1e9)));if(!_0x177dd4||typeof _0x177dd4!==_0x51fb76(0x224))throw new Error(_0x51fb76(0x1e2));}const LOCAL_FORBIDDEN_NAMES=new Set(['.DS_Store',a182_0x5a9855(0x1d7),'.git',a182_0x5a9855(0x1d0),a182_0x5a9855(0x212),a182_0x5a9855(0x1e6),a182_0x5a9855(0x213),a182_0x5a9855(0x1d5),'dist',a182_0x5a9855(0x1d8)]);function isForbiddenTemplateEntry(_0x50756e){const _0x6480b5=a182_0x5a9855;if(LOCAL_FORBIDDEN_NAMES[_0x6480b5(0x228)](_0x50756e))return!![];return _0x50756e==='.env'||_0x50756e['startsWith'](_0x6480b5(0x1ff))&&_0x50756e!==_0x6480b5(0x217);}function containsPath(_0x23c476,_0x56e6f6){const _0x42982c=a182_0x5a9855,_0x12bca1=a182_0x166faa[_0x42982c(0x1e7)](_0x23c476,_0x56e6f6);return _0x12bca1===''||!_0x12bca1[_0x42982c(0x1ef)]('..'+a182_0x166faa[_0x42982c(0x226)])&&_0x12bca1!=='..'&&!a182_0x166faa[_0x42982c(0x200)](_0x12bca1);}async function copyLocalTemplateDirectory(_0x54f5e2,_0x3fb9bc){const _0x1b0d20=a182_0x5a9855;await a182_0x211a90['mkdir'](_0x3fb9bc,{'recursive':!![]});for(const _0xee6069 of await a182_0x211a90[_0x1b0d20(0x1dd)](_0x54f5e2,{'withFileTypes':!![]})){const _0x168ca1=a182_0x166faa[_0x1b0d20(0x20e)](_0x54f5e2,_0xee6069[_0x1b0d20(0x20c)]),_0x1c3280=a182_0x166faa['join'](_0x3fb9bc,_0xee6069[_0x1b0d20(0x20c)]);if(isForbiddenTemplateEntry(_0xee6069[_0x1b0d20(0x20c)]))throw new Error(_0x1b0d20(0x207)+_0x168ca1);const _0x39f611=await a182_0x211a90['lstat'](_0x168ca1);if(_0x39f611[_0x1b0d20(0x1e4)]())throw new Error(_0x1b0d20(0x1d4)+_0x168ca1);if(_0x39f611[_0x1b0d20(0x21a)]()){await copyLocalTemplateDirectory(_0x168ca1,_0x1c3280);continue;}if(!_0x39f611[_0x1b0d20(0x20f)]())continue;await a182_0x211a90['copyFile'](_0x168ca1,_0x1c3280),await a182_0x211a90[_0x1b0d20(0x203)](_0x1c3280,_0x39f611[_0x1b0d20(0x211)]&0x1ff);}}async function readTemplateVersion(_0x18fc42){const _0x11e566=a182_0x5a9855,_0x4bad8a=JSON[_0x11e566(0x209)](await a182_0x211a90[_0x11e566(0x1f1)](a182_0x166faa[_0x11e566(0x20e)](_0x18fc42,_0x11e566(0x214)),_0x11e566(0x1e9)));return nonEmptyString(_0x4bad8a[_0x11e566(0x237)])||_0x11e566(0x1ee);}async function readDirectoryIdentity(_0x58d2fb){const _0x2a4035=a182_0x5a9855;try{const _0x778353=await a182_0x211a90[_0x2a4035(0x21b)](_0x58d2fb);if(!_0x778353['isDirectory']())return null;return{'dev':_0x778353[_0x2a4035(0x208)],'ino':_0x778353[_0x2a4035(0x22a)]};}catch{return null;}}async function commitStagedProject(_0x4cf4eb,_0xa9e2e2){const _0x4827f5=a182_0x5a9855;await a182_0x211a90['mkdir'](_0xa9e2e2);const _0x346bce=await readDirectoryIdentity(_0xa9e2e2);if(!_0x346bce)throw new Error(_0x4827f5(0x1ea));try{for(const _0x3ac11e of await a182_0x211a90['readdir'](_0x4cf4eb)){await a182_0x211a90['rename'](a182_0x166faa[_0x4827f5(0x20e)](_0x4cf4eb,_0x3ac11e),a182_0x166faa[_0x4827f5(0x20e)](_0xa9e2e2,_0x3ac11e));}}catch(_0x575cbf){const _0x4a98ee=await readDirectoryIdentity(_0xa9e2e2);_0x4a98ee?.[_0x4827f5(0x208)]===_0x346bce[_0x4827f5(0x208)]&&_0x4a98ee[_0x4827f5(0x22a)]===_0x346bce['ino']&&await a182_0x211a90['rm'](_0xa9e2e2,{'recursive':!![],'force':!![]});throw _0x575cbf;}}export async function materializeProjectTemplate(_0x405ddd,_0x22d6a4){const _0x5ba559=a182_0x5a9855,_0x46d5cf=a182_0x166faa['resolve'](_0x405ddd),_0x698bee=a182_0x166faa[_0x5ba559(0x1fa)](_0x46d5cf);try{await a182_0x211a90[_0x5ba559(0x21b)](_0x46d5cf);throw new Error('Project\x20directory\x20already\x20exists:\x20'+_0x46d5cf);}catch(_0x3962ca){if(_0x3962ca['code']!=='ENOENT')throw _0x3962ca;}const _0x11b9f2=await a182_0x211a90[_0x5ba559(0x21c)](a182_0x166faa[_0x5ba559(0x20e)](_0x698bee,_0x5ba559(0x21f))),_0x474ecb=a182_0x166faa[_0x5ba559(0x20e)](_0x11b9f2,_0x5ba559(0x22b)),_0x53cabf=a182_0x166faa[_0x5ba559(0x20e)](_0x11b9f2,'template.zip');try{try{_0x22d6a4?.(_0x5ba559(0x1fe));const _0x9098e7=await fetchTemplateDescriptor();return _0x22d6a4?.(_0x5ba559(0x220)),await downloadArchive(_0x9098e7,_0x53cabf,_0x22d6a4),_0x22d6a4?.(_0x5ba559(0x229)),await extractProjectTemplateArchive(_0x53cabf,_0x474ecb),await assertTemplateRoot(_0x474ecb),await commitStagedProject(_0x474ecb,_0x46d5cf),{'source':_0x5ba559(0x227),'version':_0x9098e7[_0x5ba559(0x237)]};}catch(_0x3f20a2){if(_0x3f20a2['code']===_0x5ba559(0x1fb))throw CliErrors[_0x5ba559(0x1f9)](_0x5ba559(0x20b)+_0x46d5cf,_0x5ba559(0x1c9));const _0x43dbb7=_0x3f20a2 instanceof Error?_0x3f20a2[_0x5ba559(0x1e8)]:String(_0x3f20a2);throw CliErrors[_0x5ba559(0x1f9)](_0x5ba559(0x1f4),_0x5ba559(0x22f)+_0x43dbb7);}}finally{await a182_0x211a90['rm'](_0x11b9f2,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x3c2b24,_0xb9b853,_0x361ec2){const _0x16af06=a182_0x5a9855;let _0x3cb7a7;try{_0x3cb7a7=await a182_0x211a90['realpath'](a182_0x166faa[_0x16af06(0x1f6)](_0x3c2b24));}catch{throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x1f7)+a182_0x166faa['resolve'](_0x3c2b24),_0x16af06(0x235));}const _0x3d3b12=await a182_0x211a90['lstat'](_0x3cb7a7);if(!_0x3d3b12[_0x16af06(0x21a)]())throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x222)+_0x3cb7a7);const _0x1d9af8=a182_0x166faa[_0x16af06(0x1f6)](_0xb9b853),_0xde38d5=await a182_0x211a90[_0x16af06(0x21e)](a182_0x166faa[_0x16af06(0x1fa)](_0x1d9af8)),_0x227dde=a182_0x166faa[_0x16af06(0x20e)](_0xde38d5,a182_0x166faa['basename'](_0x1d9af8));if(containsPath(_0x3cb7a7,_0x227dde)||containsPath(_0x227dde,_0x3cb7a7))throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x218),_0x16af06(0x1ca));try{await a182_0x211a90[_0x16af06(0x21b)](_0x227dde);throw CliErrors[_0x16af06(0x1f9)](_0x16af06(0x20b)+_0x227dde,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x1bee7e){if(_0x1bee7e[_0x16af06(0x1f5)]!=='ENOENT')throw _0x1bee7e;}const _0x1f0765=a182_0x166faa[_0x16af06(0x1fa)](_0x227dde);await a182_0x211a90[_0x16af06(0x210)](_0x1f0765);const _0x212cf3=await a182_0x211a90['mkdtemp'](a182_0x166faa[_0x16af06(0x20e)](_0x1f0765,_0x16af06(0x21f))),_0x257182=a182_0x166faa[_0x16af06(0x20e)](_0x212cf3,'project');try{_0x361ec2?.(_0x16af06(0x21d)),await copyLocalTemplateDirectory(_0x3cb7a7,_0x257182),await assertTemplateRoot(_0x257182);const _0x247ff3=await readTemplateVersion(_0x257182);return await commitStagedProject(_0x257182,_0x227dde),{'source':_0x16af06(0x1ee),'version':_0x247ff3};}catch(_0x503e0f){const _0x2b4b6f=_0x503e0f instanceof Error?_0x503e0f['message']:String(_0x503e0f);throw CliErrors['validation']('Invalid\x20local\x20template\x20source:\x20'+_0x2b4b6f,_0x16af06(0x1ec));}finally{await a182_0x211a90['rm'](_0x212cf3,{'recursive':!![],'force':!![]});}}
1
+ const a181_0x52f0bc=a181_0x4b68;(function(_0x480d22,_0x5e6cb4){const _0x3c3887=a181_0x4b68,_0x224696=_0x480d22();while(!![]){try{const _0xcc779c=-parseInt(_0x3c3887(0x110))/0x1+-parseInt(_0x3c3887(0xd6))/0x2*(parseInt(_0x3c3887(0xc3))/0x3)+-parseInt(_0x3c3887(0xf2))/0x4+parseInt(_0x3c3887(0xd2))/0x5+parseInt(_0x3c3887(0xe1))/0x6*(parseInt(_0x3c3887(0x128))/0x7)+parseInt(_0x3c3887(0x105))/0x8+-parseInt(_0x3c3887(0x12a))/0x9*(-parseInt(_0x3c3887(0x123))/0xa);if(_0xcc779c===_0x5e6cb4)break;else _0x224696['push'](_0x224696['shift']());}catch(_0x4bccf0){_0x224696['push'](_0x224696['shift']());}}}(a181_0x3b1b,0xeba35));import{createHash}from'node:crypto';import a181_0x477fc9 from'node:fs/promises';import a181_0x17ce37 from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';function a181_0x4b68(_0x768f98,_0x4a77b1){_0x768f98=_0x768f98-0xc2;const _0x3b1bf1=a181_0x3b1b();let _0x4b684d=_0x3b1bf1[_0x768f98];return _0x4b684d;}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='sub-app-react-demo',ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0xd6dd6c){const _0x26f123=a181_0x4b68;return typeof _0xd6dd6c===_0x26f123(0xf5)&&_0xd6dd6c['trim']()?_0xd6dd6c[_0x26f123(0xde)]():null;}function parseDescriptor(_0x30cb42){const _0x267011=a181_0x4b68;if(!_0x30cb42||typeof _0x30cb42!==_0x267011(0xc6))throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x1d259a=_0x30cb42,_0x228a73=nonEmptyString(_0x1d259a['version']),_0x4d15fc=nonEmptyString(_0x1d259a['name']),_0x2732f6=nonEmptyString(_0x1d259a[_0x267011(0x109)])?.[_0x267011(0xd8)](),_0x7b2e7c=_0x1d259a[_0x267011(0xc2)];if(!_0x228a73||!_0x4d15fc||_0x4d15fc!==a181_0x17ce37[_0x267011(0x120)]['basename'](_0x4d15fc)||_0x4d15fc[_0x267011(0x10a)]('\x5c')||!_0x2732f6||!/^sha256:[a-f0-9]{64}$/[_0x267011(0xe5)](_0x2732f6)||typeof _0x7b2e7c!=='number'||!Number[_0x267011(0x11f)](_0x7b2e7c)||_0x7b2e7c<=0x0||_0x7b2e7c>MAX_ARCHIVE_SIZE)throw new Error(_0x267011(0xfc)+TEMPLATE_ID+'\x22.');return{'version':_0x228a73,'name':_0x4d15fc,'sha256':_0x2732f6,'size':_0x7b2e7c};}async function fetchWithTimeout(_0x236f4f,_0x52a68f,_0x4547dc,_0x454996){const _0xe0d2a7=a181_0x4b68,_0x350e6a=new AbortController(),_0x10f062=setTimeout(()=>_0x350e6a[_0xe0d2a7(0x129)](),_0x52a68f);try{const _0x590f37=await fetch(_0x236f4f,{'headers':{'Accept':_0x4547dc},'signal':_0x350e6a['signal']});return await _0x454996(_0x590f37);}finally{clearTimeout(_0x10f062);}}async function fetchTemplateDescriptor(){const _0x3cd053=a181_0x4b68,_0x1f99d4=await getRabetbaseCdnConfig();if(!_0x1f99d4)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');return parseDescriptor(_0x1f99d4[_0x3cd053(0x121)]);}function a181_0x3b1b(){const _0x4066a5=['parse','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','resolve','isAbsolute','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','mkdtemp','Use\x20a\x20different\x20project\x20name.','getReader','code','cancel','content-length','1275305SvvVze','Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','hex','version','2wQyXHo','.lovrabet.json','toLowerCase','node_modules','name','cdn','startsWith','.rabetbase','trim','pathname','ino','81408Kroigs','copyFile','releaseLock','isDirectory','test','rename','Unable\x20to\x20claim\x20the\x20project\x20directory.','https:','chmod','byteLength','Check\x20the\x20source\x20directory\x20and\x20retry.','validation','readFile','has','length','.rabetbase-create-','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','6860816xQtIKz','Project\x20directory\x20already\x20exists:\x20','.codegraph','string','arrayBuffer','writeFile','verifying','status','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','concat','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','utf8','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','.env.example','body','Project\x20template\x20package.json\x20is\x20invalid.','join','isFinite',',\x20received\x20','13913768TjQVIq','dev','origin','resolving','sha256','includes','dirname','package.json','downloading','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','get','1900177GUNLlo','isSymbolicLink','update','.DS_Store','realpath','from','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','ENOENT','application/zip','relative','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','headers','basename','isSafeInteger','posix','projectTemplate','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','1122190UAUmjz','readdir','.env.','message','read','826oshbch','abort','117sYzPIx','dist','mkdir','project','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','size','1420797vKmfIC','lstat','.idea','object'];a181_0x3b1b=function(){return _0x4066a5;};return a181_0x3b1b();}function resolveArchiveUrl(_0x43f35a){const _0x1e75d7=a181_0x4b68,_0x4d3fae=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0xa1f428=new URL(_0x43f35a,_0x4d3fae);if(_0xa1f428['protocol']!==_0x1e75d7(0xe8)||_0xa1f428[_0x1e75d7(0x107)]!==_0x4d3fae[_0x1e75d7(0x107)]||!_0xa1f428[_0x1e75d7(0xdf)][_0x1e75d7(0xdc)](_0x4d3fae[_0x1e75d7(0xdf)]))throw new Error(_0x1e75d7(0x116));return _0xa1f428['href'];}async function readResponseBytes(_0x2c9f2f,_0x15adae){const _0x275baf=a181_0x4b68;if(!_0x2c9f2f[_0x275baf(0x100)]){const _0x1352a4=Buffer[_0x275baf(0x115)](await _0x2c9f2f[_0x275baf(0xf6)]());if(_0x1352a4['length']>_0x15adae)throw new Error(_0x275baf(0x12e));return _0x1352a4;}const _0x188fa6=_0x2c9f2f[_0x275baf(0x100)][_0x275baf(0xce)](),_0x3b51df=[];let _0x283b3c=0x0;try{while(!![]){const {done:_0x5e5769,value:_0x7a6bb6}=await _0x188fa6[_0x275baf(0x127)]();if(_0x5e5769)break;_0x283b3c+=_0x7a6bb6[_0x275baf(0xea)];if(_0x283b3c>_0x15adae){await _0x188fa6[_0x275baf(0xd0)]();throw new Error(_0x275baf(0x12e));}_0x3b51df['push'](Buffer[_0x275baf(0x115)](_0x7a6bb6));}}finally{_0x188fa6[_0x275baf(0xe3)]();}return Buffer[_0x275baf(0xfb)](_0x3b51df,_0x283b3c);}async function downloadArchive(_0xc396f8,_0x316b80,_0xa981d){const _0x56abb4=a181_0x4b68,_0x47d1ae=await fetchWithTimeout(resolveArchiveUrl(_0xc396f8[_0x56abb4(0xda)]),ARCHIVE_TIMEOUT_MS,_0x56abb4(0x118),async _0x12a45f=>{const _0x267cf0=_0x56abb4;if(!_0x12a45f['ok'])throw new Error(_0x267cf0(0x11c)+_0x12a45f[_0x267cf0(0xf9)]+'.');const _0x5307c3=Number(_0x12a45f[_0x267cf0(0x11d)][_0x267cf0(0x10f)](_0x267cf0(0xd1)));if(Number[_0x267cf0(0x103)](_0x5307c3)&&_0x5307c3>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.');return readResponseBytes(_0x12a45f,_0xc396f8[_0x267cf0(0xc2)]);});if(_0x47d1ae[_0x56abb4(0xef)]!==_0xc396f8[_0x56abb4(0xc2)])throw new Error(_0x56abb4(0x122)+_0xc396f8[_0x56abb4(0xc2)]+_0x56abb4(0x104)+_0x47d1ae[_0x56abb4(0xef)]+'.');_0xa981d?.(_0x56abb4(0xf8));const _0x4b6709='sha256:'+createHash(_0x56abb4(0x109))[_0x56abb4(0x112)](_0x47d1ae)['digest'](_0x56abb4(0xd4));if(_0x4b6709!==_0xc396f8[_0x56abb4(0x109)])throw new Error(_0x56abb4(0x11b));await a181_0x477fc9[_0x56abb4(0xf7)](_0x316b80,_0x47d1ae,{'flag':'wx'});}async function assertTemplateRoot(_0x2393a1){const _0x278912=a181_0x4b68,_0x408ad8=a181_0x17ce37[_0x278912(0x102)](_0x2393a1,_0x278912(0x10c)),_0x1074d7=JSON[_0x278912(0xc7)](await a181_0x477fc9[_0x278912(0xed)](_0x408ad8,_0x278912(0xfd)));if(!_0x1074d7||typeof _0x1074d7!==_0x278912(0xc6))throw new Error(_0x278912(0x101));}const LOCAL_FORBIDDEN_NAMES=new Set([a181_0x52f0bc(0x113),a181_0x52f0bc(0xf4),'.git',a181_0x52f0bc(0xc5),a181_0x52f0bc(0xd7),'.lovrabet.log',a181_0x52f0bc(0xdd),'.rabetbase.json',a181_0x52f0bc(0x12b),a181_0x52f0bc(0xd9)]);function isForbiddenTemplateEntry(_0x34a52e){const _0x16cc1b=a181_0x52f0bc;if(LOCAL_FORBIDDEN_NAMES[_0x16cc1b(0xee)](_0x34a52e))return!![];return _0x34a52e==='.env'||_0x34a52e['startsWith'](_0x16cc1b(0x125))&&_0x34a52e!==_0x16cc1b(0xff);}function containsPath(_0x5f29f0,_0x360d55){const _0x45b14a=a181_0x52f0bc,_0x4c2a66=a181_0x17ce37[_0x45b14a(0x119)](_0x5f29f0,_0x360d55);return _0x4c2a66===''||!_0x4c2a66['startsWith']('..'+a181_0x17ce37['sep'])&&_0x4c2a66!=='..'&&!a181_0x17ce37[_0x45b14a(0xca)](_0x4c2a66);}async function copyLocalTemplateDirectory(_0x2588a3,_0x4abf63){const _0x46d3c9=a181_0x52f0bc;await a181_0x477fc9[_0x46d3c9(0x12c)](_0x4abf63,{'recursive':!![]});for(const _0x325661 of await a181_0x477fc9[_0x46d3c9(0x124)](_0x2588a3,{'withFileTypes':!![]})){const _0x4bff5a=a181_0x17ce37[_0x46d3c9(0x102)](_0x2588a3,_0x325661[_0x46d3c9(0xda)]),_0x4cdf2f=a181_0x17ce37['join'](_0x4abf63,_0x325661['name']);if(isForbiddenTemplateEntry(_0x325661[_0x46d3c9(0xda)]))throw new Error(_0x46d3c9(0xc8)+_0x4bff5a);const _0x54233d=await a181_0x477fc9[_0x46d3c9(0xc4)](_0x4bff5a);if(_0x54233d[_0x46d3c9(0x111)]())throw new Error(_0x46d3c9(0xfa)+_0x4bff5a);if(_0x54233d[_0x46d3c9(0xe4)]()){await copyLocalTemplateDirectory(_0x4bff5a,_0x4cdf2f);continue;}if(!_0x54233d['isFile']())continue;await a181_0x477fc9[_0x46d3c9(0xe2)](_0x4bff5a,_0x4cdf2f),await a181_0x477fc9[_0x46d3c9(0xe9)](_0x4cdf2f,_0x54233d['mode']&0x1ff);}}async function readTemplateVersion(_0x1138d3){const _0x2cee02=a181_0x52f0bc,_0x58c75f=JSON['parse'](await a181_0x477fc9[_0x2cee02(0xed)](a181_0x17ce37['join'](_0x1138d3,'package.json'),_0x2cee02(0xfd)));return nonEmptyString(_0x58c75f['version'])||'local';}async function readDirectoryIdentity(_0x2d84cb){const _0x11f39c=a181_0x52f0bc;try{const _0x17d252=await a181_0x477fc9[_0x11f39c(0xc4)](_0x2d84cb);if(!_0x17d252[_0x11f39c(0xe4)]())return null;return{'dev':_0x17d252[_0x11f39c(0x106)],'ino':_0x17d252[_0x11f39c(0xe0)]};}catch{return null;}}async function commitStagedProject(_0x1b66a1,_0x688e76){const _0xbe6127=a181_0x52f0bc;await a181_0x477fc9[_0xbe6127(0x12c)](_0x688e76);const _0xd135bb=await readDirectoryIdentity(_0x688e76);if(!_0xd135bb)throw new Error(_0xbe6127(0xe7));try{for(const _0x52a64 of await a181_0x477fc9[_0xbe6127(0x124)](_0x1b66a1)){await a181_0x477fc9[_0xbe6127(0xe6)](a181_0x17ce37[_0xbe6127(0x102)](_0x1b66a1,_0x52a64),a181_0x17ce37[_0xbe6127(0x102)](_0x688e76,_0x52a64));}}catch(_0x15c7bd){const _0x54ecf3=await readDirectoryIdentity(_0x688e76);_0x54ecf3?.['dev']===_0xd135bb[_0xbe6127(0x106)]&&_0x54ecf3[_0xbe6127(0xe0)]===_0xd135bb[_0xbe6127(0xe0)]&&await a181_0x477fc9['rm'](_0x688e76,{'recursive':!![],'force':!![]});throw _0x15c7bd;}}export async function materializeProjectTemplate(_0x465a30,_0x2fe63a){const _0x4ce87c=a181_0x52f0bc,_0xf67897=a181_0x17ce37['resolve'](_0x465a30),_0x27ede5=a181_0x17ce37['dirname'](_0xf67897);try{await a181_0x477fc9[_0x4ce87c(0xc4)](_0xf67897);throw new Error(_0x4ce87c(0xf3)+_0xf67897);}catch(_0x16bd9c){if(_0x16bd9c[_0x4ce87c(0xcf)]!==_0x4ce87c(0x117))throw _0x16bd9c;}const _0xaddef0=await a181_0x477fc9[_0x4ce87c(0xcc)](a181_0x17ce37[_0x4ce87c(0x102)](_0x27ede5,_0x4ce87c(0xf0))),_0x3e8828=a181_0x17ce37[_0x4ce87c(0x102)](_0xaddef0,_0x4ce87c(0x12d)),_0x2f7c82=a181_0x17ce37['join'](_0xaddef0,'template.zip');try{try{_0x2fe63a?.(_0x4ce87c(0x108));const _0x2c82fc=await fetchTemplateDescriptor();return _0x2fe63a?.(_0x4ce87c(0x10d)),await downloadArchive(_0x2c82fc,_0x2f7c82,_0x2fe63a),_0x2fe63a?.('extracting'),await extractProjectTemplateArchive(_0x2f7c82,_0x3e8828),await assertTemplateRoot(_0x3e8828),await commitStagedProject(_0x3e8828,_0xf67897),{'source':_0x4ce87c(0xdb),'version':_0x2c82fc[_0x4ce87c(0xd5)]};}catch(_0x587cac){if(_0x587cac[_0x4ce87c(0xcf)]==='EEXIST')throw CliErrors[_0x4ce87c(0xec)](_0x4ce87c(0xf3)+_0xf67897,_0x4ce87c(0xcd));const _0x57fbcb=_0x587cac instanceof Error?_0x587cac[_0x4ce87c(0x126)]:String(_0x587cac);throw CliErrors[_0x4ce87c(0xec)](_0x4ce87c(0xcb),'Check\x20your\x20network\x20and\x20retry.\x20Details:\x20'+_0x57fbcb);}}finally{await a181_0x477fc9['rm'](_0xaddef0,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x414769,_0x15abd6,_0xa6e728){const _0x211fd6=a181_0x52f0bc;let _0x2a3ce2;try{_0x2a3ce2=await a181_0x477fc9['realpath'](a181_0x17ce37['resolve'](_0x414769));}catch{throw CliErrors[_0x211fd6(0xec)]('Local\x20template\x20source\x20does\x20not\x20exist:\x20'+a181_0x17ce37[_0x211fd6(0xc9)](_0x414769),_0x211fd6(0x11a));}const _0x3e2e90=await a181_0x477fc9[_0x211fd6(0xc4)](_0x2a3ce2);if(!_0x3e2e90[_0x211fd6(0xe4)]())throw CliErrors[_0x211fd6(0xec)](_0x211fd6(0xd3)+_0x2a3ce2);const _0x5f12d4=a181_0x17ce37[_0x211fd6(0xc9)](_0x15abd6),_0x27ad75=await a181_0x477fc9[_0x211fd6(0x114)](a181_0x17ce37[_0x211fd6(0x10b)](_0x5f12d4)),_0x5d0627=a181_0x17ce37['join'](_0x27ad75,a181_0x17ce37[_0x211fd6(0x11e)](_0x5f12d4));if(containsPath(_0x2a3ce2,_0x5d0627)||containsPath(_0x5d0627,_0x2a3ce2))throw CliErrors['validation'](_0x211fd6(0x10e),_0x211fd6(0xf1));try{await a181_0x477fc9['lstat'](_0x5d0627);throw CliErrors[_0x211fd6(0xec)](_0x211fd6(0xf3)+_0x5d0627,_0x211fd6(0xfe));}catch(_0x1f09d1){if(_0x1f09d1[_0x211fd6(0xcf)]!==_0x211fd6(0x117))throw _0x1f09d1;}const _0x3f2f37=a181_0x17ce37[_0x211fd6(0x10b)](_0x5d0627);await a181_0x477fc9['access'](_0x3f2f37);const _0x52410f=await a181_0x477fc9['mkdtemp'](a181_0x17ce37[_0x211fd6(0x102)](_0x3f2f37,_0x211fd6(0xf0))),_0x288153=a181_0x17ce37[_0x211fd6(0x102)](_0x52410f,_0x211fd6(0x12d));try{_0xa6e728?.('copying'),await copyLocalTemplateDirectory(_0x2a3ce2,_0x288153),await assertTemplateRoot(_0x288153);const _0x2b602a=await readTemplateVersion(_0x288153);return await commitStagedProject(_0x288153,_0x5d0627),{'source':'local','version':_0x2b602a};}catch(_0x8a8e1a){const _0x42b54a=_0x8a8e1a instanceof Error?_0x8a8e1a[_0x211fd6(0x126)]:String(_0x8a8e1a);throw CliErrors[_0x211fd6(0xec)]('Invalid\x20local\x20template\x20source:\x20'+_0x42b54a,_0x211fd6(0xeb));}finally{await a181_0x477fc9['rm'](_0x52410f,{'recursive':!![],'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x804acd,_0x20beec){const _0x14ea9a=a183_0x570d,_0x232df9=_0x804acd();while(!![]){try{const _0x50be17=-parseInt(_0x14ea9a(0x1ee))/0x1*(parseInt(_0x14ea9a(0x1e9))/0x2)+-parseInt(_0x14ea9a(0x1ef))/0x3*(-parseInt(_0x14ea9a(0x1f5))/0x4)+-parseInt(_0x14ea9a(0x1f3))/0x5+-parseInt(_0x14ea9a(0x1ea))/0x6+parseInt(_0x14ea9a(0x1eb))/0x7*(parseInt(_0x14ea9a(0x1fb))/0x8)+parseInt(_0x14ea9a(0x1ed))/0x9+-parseInt(_0x14ea9a(0x1fa))/0xa*(-parseInt(_0x14ea9a(0x1f4))/0xb);if(_0x50be17===_0x20beec)break;else _0x232df9['push'](_0x232df9['shift']());}catch(_0x5d898a){_0x232df9['push'](_0x232df9['shift']());}}}(a183_0x5216,0x7b491));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;function a183_0x570d(_0x2b158e,_0x32ac23){_0x2b158e=_0x2b158e-0x1e9;const _0x5216c2=a183_0x5216();let _0x570d1d=_0x5216c2[_0x2b158e];return _0x570d1d;}export function getProjectNameValidationError(_0x50feac){const _0x1983ce=a183_0x570d,_0x29cdaf=_0x50feac['trim']();if(!_0x29cdaf)return'Project\x20name\x20cannot\x20be\x20empty';if(_0x29cdaf[_0x1983ce(0x1f1)]>MAX_PROJECT_NAME_LENGTH)return'Project\x20name\x20cannot\x20exceed\x20'+MAX_PROJECT_NAME_LENGTH+_0x1983ce(0x1ec);if(!PROJECT_NAME_PATTERN[_0x1983ce(0x1f8)](_0x29cdaf))return _0x1983ce(0x1f9);if(WINDOWS_RESERVED_NAME[_0x1983ce(0x1f8)](_0x29cdaf))return _0x1983ce(0x1f2)+_0x29cdaf+_0x1983ce(0x1f7);return null;}function a183_0x5216(){const _0x4e53d1=['9036306xSBtmv','33TrRPLF','3rJEeLf','validation','length','Project\x20name\x20\x22','2668295zSYIlo','54285dEghwC','1714660pvXZEs','trim','\x22\x20is\x20reserved\x20on\x20Windows','test','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','330Jfwnqp','40tXdAgN','40654xHlhLn','5265792LzEshV','1388107DVHCdf','\x20characters'];a183_0x5216=function(){return _0x4e53d1;};return a183_0x5216();}export function validateProjectName(_0x222922){const _0x1aeeec=a183_0x570d,_0x157063=_0x222922[_0x1aeeec(0x1f6)](),_0x2fd51b=getProjectNameValidationError(_0x157063);if(_0x2fd51b)throw CliErrors[_0x1aeeec(0x1f0)](_0x2fd51b,'Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.');return _0x157063;}
1
+ (function(_0x3f74cf,_0x5c254f){const _0x15fb29=a182_0x3731,_0x59f993=_0x3f74cf();while(!![]){try{const _0x13bf79=-parseInt(_0x15fb29(0x1e9))/0x1*(parseInt(_0x15fb29(0x1dd))/0x2)+parseInt(_0x15fb29(0x1eb))/0x3*(parseInt(_0x15fb29(0x1e3))/0x4)+parseInt(_0x15fb29(0x1df))/0x5*(-parseInt(_0x15fb29(0x1e4))/0x6)+-parseInt(_0x15fb29(0x1e2))/0x7+parseInt(_0x15fb29(0x1e8))/0x8*(parseInt(_0x15fb29(0x1f2))/0x9)+-parseInt(_0x15fb29(0x1ec))/0xa*(parseInt(_0x15fb29(0x1ef))/0xb)+parseInt(_0x15fb29(0x1e0))/0xc*(parseInt(_0x15fb29(0x1ea))/0xd);if(_0x13bf79===_0x5c254f)break;else _0x59f993['push'](_0x59f993['shift']());}catch(_0x1bf22c){_0x59f993['push'](_0x59f993['shift']());}}}(a182_0x54b0,0xdf0fd));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(_0x1185d7){const _0x57191a=a182_0x3731,_0x5e8f82=_0x1185d7[_0x57191a(0x1ed)]();if(!_0x5e8f82)return _0x57191a(0x1e6);if(_0x5e8f82['length']>MAX_PROJECT_NAME_LENGTH)return _0x57191a(0x1e5)+MAX_PROJECT_NAME_LENGTH+'\x20characters';if(!PROJECT_NAME_PATTERN[_0x57191a(0x1de)](_0x5e8f82))return _0x57191a(0x1f0);if(WINDOWS_RESERVED_NAME[_0x57191a(0x1de)](_0x5e8f82))return _0x57191a(0x1f1)+_0x5e8f82+_0x57191a(0x1ee);return null;}function a182_0x3731(_0x49fd41,_0x5b811f){_0x49fd41=_0x49fd41-0x1dd;const _0x54b0f7=a182_0x54b0();let _0x373161=_0x54b0f7[_0x49fd41];return _0x373161;}function a182_0x54b0(){const _0x100ef9=['Project\x20name\x20\x22','27iGGWRl','114374HuETst','test','15lGBICH','36dEAGlu','validation','276136EaoUhs','20shJRBR','1193622xSsSmM','Project\x20name\x20cannot\x20exceed\x20','Project\x20name\x20cannot\x20be\x20empty','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','4732328aFbUGW','27wKQZZV','2528201xnlisR','485154cnKvgH','950Jbkxkw','trim','\x22\x20is\x20reserved\x20on\x20Windows','8415yFlATx','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_'];a182_0x54b0=function(){return _0x100ef9;};return a182_0x54b0();}export function validateProjectName(_0x30c5c5){const _0xce3be9=a182_0x3731,_0x2e1052=_0x30c5c5['trim'](),_0xfe8e8c=getProjectNameValidationError(_0x2e1052);if(_0xfe8e8c)throw CliErrors[_0xce3be9(0x1e1)](_0xfe8e8c,_0xce3be9(0x1e7));return _0x2e1052;}
@@ -1 +1 @@
1
- (function(_0x9c7e00,_0x4c016c){const _0x4ef725=a184_0x2c2f,_0x390eb7=_0x9c7e00();while(!![]){try{const _0x39030f=-parseInt(_0x4ef725(0x1bb))/0x1+-parseInt(_0x4ef725(0x1ba))/0x2+parseInt(_0x4ef725(0x1b5))/0x3*(-parseInt(_0x4ef725(0x1b1))/0x4)+parseInt(_0x4ef725(0x1c4))/0x5*(-parseInt(_0x4ef725(0x1b4))/0x6)+-parseInt(_0x4ef725(0x1a2))/0x7+parseInt(_0x4ef725(0x1c7))/0x8+-parseInt(_0x4ef725(0x1b6))/0x9*(-parseInt(_0x4ef725(0x1b9))/0xa);if(_0x39030f===_0x4c016c)break;else _0x390eb7['push'](_0x390eb7['shift']());}catch(_0x1b1a9){_0x390eb7['push'](_0x390eb7['shift']());}}}(a184_0x5eb9,0x8f226));import{createWriteStream}from'node:fs';import a184_0x3d18e2 from'node:fs/promises';function a184_0x2c2f(_0x329b7f,_0x811337){_0x329b7f=_0x329b7f-0x19a;const _0x5eb91f=a184_0x5eb9();let _0x2c2f7a=_0x5eb91f[_0x329b7f];return _0x2c2f7a;}import a184_0x2058e1 from'node:path';import{pipeline}from'node:stream/promises';import a184_0x1f74bc 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(_0x3bb2e0){return new Promise((_0x56fc05,_0x17a6c)=>{const _0x11c9d4=a184_0x2c2f;a184_0x1f74bc[_0x11c9d4(0x1af)](_0x3bb2e0,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x3b7146,_0x40228b)=>{const _0x19a963=_0x11c9d4;if(_0x3b7146||!_0x40228b){_0x17a6c(_0x3b7146||new Error(_0x19a963(0x1b7)));return;}_0x56fc05(_0x40228b);});});}function openEntryStream(_0x6e9cb9,_0x7a0022){return new Promise((_0x237ff2,_0x5491bf)=>{const _0x5b49b5=a184_0x2c2f;_0x6e9cb9[_0x5b49b5(0x1b0)](_0x7a0022,(_0x2c3f1a,_0x5c7119)=>{const _0x4acdd2=_0x5b49b5;if(_0x2c3f1a||!_0x5c7119){_0x5491bf(_0x2c3f1a||new Error('Unable\x20to\x20read\x20ZIP\x20entry:\x20'+_0x7a0022[_0x4acdd2(0x1b2)]));return;}_0x237ff2(_0x5c7119);});});}function a184_0x5eb9(){const _0xb17444=['dirname','isEncrypted','200TbhrUA','mkdir','close','9060976jmZMpe','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','slice','test','catch','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','once','has','26313OwNUzZ','resolve','get','join','readEntry','startsWith','replace','sep','\x20entries.','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','toLocaleLowerCase','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','set','open','openReadStream','4OkVLPx','fileName','externalFileAttributes','104466lufQMb','252765bWbTjf','9ecmzfo','Unable\x20to\x20open\x20project\x20template\x20archive.','end','16219580xXyHYt','1508090NIItrG','629803dhsUuz','split','entry','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','endsWith','Project\x20template\x20ZIP\x20exceeds\x20','en-US'];a184_0x5eb9=function(){return _0xb17444;};return a184_0x5eb9();}function validateEntryPath(_0x54a508){const _0x1086e0=a184_0x2c2f,_0x16cf5a=_0x54a508[_0x1086e0(0x1a8)](/\\/g,'/'),_0x4e0ba4=_0x16cf5a['endsWith']('/'),_0x151bec=_0x4e0ba4?_0x16cf5a[_0x1086e0(0x19c)](0x0,-0x1):_0x16cf5a;if(!_0x151bec||_0x16cf5a[_0x1086e0(0x1a7)]('/')||/^[A-Za-z]:\//[_0x1086e0(0x19d)](_0x16cf5a))throw new Error(_0x1086e0(0x19a)+_0x54a508);const _0x2fcac4=_0x151bec[_0x1086e0(0x1bc)]('/');for(const _0x1f9588 of _0x2fcac4){if(!_0x1f9588||_0x1f9588==='.'||_0x1f9588==='..'||_0x1f9588[_0x1086e0(0x1bf)]('.')||_0x1f9588[_0x1086e0(0x1bf)]('\x20')||WINDOWS_INVALID_CHAR[_0x1086e0(0x19d)](_0x1f9588)||WINDOWS_RESERVED_NAME[_0x1086e0(0x19d)](_0x1f9588))throw new Error(_0x1086e0(0x1be)+_0x54a508);}return{'relativePath':_0x2fcac4[_0x1086e0(0x1a5)](a184_0x2058e1[_0x1086e0(0x1a9)]),'directory':_0x4e0ba4};}function isSymbolicLink(_0x53589d){const _0x398657=a184_0x2c2f,_0x2dcfc5=_0x53589d[_0x398657(0x1b3)]>>>0x10&0xffff;return(_0x2dcfc5&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x3159f2,_0x58d782){const _0xa07108=await openZip(_0x3159f2),_0x4e64c0=a184_0x2058e1['resolve'](_0x58d782),_0x1071db=new Set(),_0x22a128=new Map();let _0x21378e=0x0,_0x583695=0x0;await a184_0x3d18e2['mkdir'](_0x4e64c0,{'recursive':!![]}),await new Promise((_0x485ea5,_0x3fa591)=>{const _0x42e3f9=a184_0x2c2f;let _0x172954=![];const _0x12aef1=_0x12b5ba=>{const _0x8b9b29=a184_0x2c2f;if(_0x172954)return;_0x172954=!![],_0xa07108[_0x8b9b29(0x1c6)](),_0x3fa591(_0x12b5ba instanceof Error?_0x12b5ba:new Error(String(_0x12b5ba)));};_0xa07108['once']('error',_0x12aef1),_0xa07108[_0x42e3f9(0x1a0)](_0x42e3f9(0x1b8),()=>{if(_0x172954)return;_0x172954=!![],_0x485ea5();}),_0xa07108['on'](_0x42e3f9(0x1bd),_0x52e52f=>{const _0x19c03d=_0x42e3f9;void(async()=>{const _0x104a9b=a184_0x2c2f;_0x21378e+=0x1,_0x583695+=_0x52e52f['uncompressedSize'];if(_0x21378e>MAX_ENTRY_COUNT)throw new Error(_0x104a9b(0x1c0)+MAX_ENTRY_COUNT+_0x104a9b(0x1aa));if(_0x583695>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x104a9b(0x1ab));if(_0x52e52f[_0x104a9b(0x1c3)]())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x52e52f[_0x104a9b(0x1b2)]);if(isSymbolicLink(_0x52e52f))throw new Error(_0x104a9b(0x1ad)+_0x52e52f[_0x104a9b(0x1b2)]);const {relativePath:_0x1833a3,directory:_0x1c8693}=validateEntryPath(_0x52e52f['fileName']),_0x4ba6ac=_0x1833a3[_0x104a9b(0x1bc)](a184_0x2058e1[_0x104a9b(0x1a9)]);for(let _0x14d3cb=0x1;_0x14d3cb<=_0x4ba6ac['length'];_0x14d3cb+=0x1){const _0x4cb5f4=_0x4ba6ac['slice'](0x0,_0x14d3cb)[_0x104a9b(0x1a5)](a184_0x2058e1[_0x104a9b(0x1a9)]),_0x370f7c=_0x4cb5f4['toLocaleLowerCase'](_0x104a9b(0x1c1)),_0xab2ba4=_0x22a128[_0x104a9b(0x1a4)](_0x370f7c);if(_0xab2ba4&&_0xab2ba4!==_0x4cb5f4)throw new Error('Case-conflicting\x20ZIP\x20entry\x20path:\x20'+_0x52e52f[_0x104a9b(0x1b2)]);_0x22a128[_0x104a9b(0x1ae)](_0x370f7c,_0x4cb5f4);}const _0x2acd5a=_0x1833a3[_0x104a9b(0x1ac)](_0x104a9b(0x1c1));if(_0x1071db[_0x104a9b(0x1a1)](_0x2acd5a))throw new Error(_0x104a9b(0x19f)+_0x52e52f[_0x104a9b(0x1b2)]);_0x1071db['add'](_0x2acd5a);const _0x2f4b6a=a184_0x2058e1[_0x104a9b(0x1a3)](_0x4e64c0,_0x1833a3);if(_0x2f4b6a!==_0x4e64c0&&!_0x2f4b6a[_0x104a9b(0x1a7)](''+_0x4e64c0+a184_0x2058e1['sep']))throw new Error(_0x104a9b(0x19b)+_0x52e52f[_0x104a9b(0x1b2)]);if(_0x1c8693)await a184_0x3d18e2[_0x104a9b(0x1c5)](_0x2f4b6a,{'recursive':!![]});else{await a184_0x3d18e2[_0x104a9b(0x1c5)](a184_0x2058e1[_0x104a9b(0x1c2)](_0x2f4b6a),{'recursive':!![]});const _0x930c0c=await openEntryStream(_0xa07108,_0x52e52f);await pipeline(_0x930c0c,createWriteStream(_0x2f4b6a,{'flags':'wx','mode':0x1a4}));}_0xa07108[_0x104a9b(0x1a6)]();})()[_0x19c03d(0x19e)](_0x12aef1);}),_0xa07108[_0x42e3f9(0x1a6)]();});}
1
+ (function(_0x47ded6,_0xdf75b5){const _0x269392=a183_0x3bbd,_0x350dd3=_0x47ded6();while(!![]){try{const _0x39ac87=parseInt(_0x269392(0x134))/0x1+-parseInt(_0x269392(0x12b))/0x2+parseInt(_0x269392(0x123))/0x3*(parseInt(_0x269392(0x11a))/0x4)+-parseInt(_0x269392(0x147))/0x5*(parseInt(_0x269392(0x12d))/0x6)+parseInt(_0x269392(0x12f))/0x7+-parseInt(_0x269392(0x11e))/0x8*(parseInt(_0x269392(0x145))/0x9)+parseInt(_0x269392(0x13a))/0xa*(parseInt(_0x269392(0x11f))/0xb);if(_0x39ac87===_0xdf75b5)break;else _0x350dd3['push'](_0x350dd3['shift']());}catch(_0x2d97fc){_0x350dd3['push'](_0x350dd3['shift']());}}}(a183_0x13b6,0xe0deb));import{createWriteStream}from'node:fs';import a183_0x3597c8 from'node:fs/promises';import a183_0x5d068b from'node:path';function a183_0x3bbd(_0x39a664,_0x20a599){_0x39a664=_0x39a664-0x119;const _0x13b623=a183_0x13b6();let _0x3bbde4=_0x13b623[_0x39a664];return _0x3bbde4;}import{pipeline}from'node:stream/promises';import a183_0x19c43b from'yauzl';function a183_0x13b6(){const _0x587bd7=['slice','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','set','120PdQCIX','Unable\x20to\x20read\x20ZIP\x20entry:\x20','open','readEntry','once','add','replace','Project\x20template\x20ZIP\x20exceeds\x20','externalFileAttributes','split','resolve','11289222vRmGlX','uncompressedSize','5WCQQBN','close','212rHptfW','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','catch','entry','8DenZCc','1253384jFtwpj','endsWith','Case-conflicting\x20ZIP\x20entry\x20path:\x20','fileName','14109XdZLjj','dirname','startsWith','length','test','sep','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','join','75206TEeGpj','end','7451988iBUxkj','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','811895IwUWGj','en-US','\x20entries.','Unable\x20to\x20open\x20project\x20template\x20archive.','toLocaleLowerCase','1722454EWttia','openReadStream','has'];a183_0x13b6=function(){return _0x587bd7;};return a183_0x13b6();}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(_0x7dc409){return new Promise((_0x3552a2,_0x2dfd2c)=>{const _0x16657e=a183_0x3bbd;a183_0x19c43b[_0x16657e(0x13c)](_0x7dc409,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x187468,_0x17d528)=>{const _0x5de0bf=_0x16657e;if(_0x187468||!_0x17d528){_0x2dfd2c(_0x187468||new Error(_0x5de0bf(0x132)));return;}_0x3552a2(_0x17d528);});});}function openEntryStream(_0x4048c6,_0x5ebfbc){return new Promise((_0x40dcb9,_0x574f60)=>{const _0x1dd061=a183_0x3bbd;_0x4048c6[_0x1dd061(0x135)](_0x5ebfbc,(_0x363a1d,_0x2e8961)=>{const _0x1f0620=_0x1dd061;if(_0x363a1d||!_0x2e8961){_0x574f60(_0x363a1d||new Error(_0x1f0620(0x13b)+_0x5ebfbc[_0x1f0620(0x122)]));return;}_0x40dcb9(_0x2e8961);});});}function validateEntryPath(_0x9a2af1){const _0x4c3aa8=a183_0x3bbd,_0x35e300=_0x9a2af1[_0x4c3aa8(0x140)](/\\/g,'/'),_0x4f51de=_0x35e300[_0x4c3aa8(0x120)]('/'),_0xaa571=_0x4f51de?_0x35e300[_0x4c3aa8(0x137)](0x0,-0x1):_0x35e300;if(!_0xaa571||_0x35e300[_0x4c3aa8(0x125)]('/')||/^[A-Za-z]:\//[_0x4c3aa8(0x127)](_0x35e300))throw new Error('Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20'+_0x9a2af1);const _0x48371d=_0xaa571[_0x4c3aa8(0x143)]('/');for(const _0x579894 of _0x48371d){if(!_0x579894||_0x579894==='.'||_0x579894==='..'||_0x579894[_0x4c3aa8(0x120)]('.')||_0x579894[_0x4c3aa8(0x120)]('\x20')||WINDOWS_INVALID_CHAR['test'](_0x579894)||WINDOWS_RESERVED_NAME['test'](_0x579894))throw new Error(_0x4c3aa8(0x11b)+_0x9a2af1);}return{'relativePath':_0x48371d[_0x4c3aa8(0x12a)](a183_0x5d068b['sep']),'directory':_0x4f51de};}function isSymbolicLink(_0x4a44d0){const _0x224c3a=a183_0x3bbd,_0x4e3079=_0x4a44d0[_0x224c3a(0x142)]>>>0x10&0xffff;return(_0x4e3079&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x360d5e,_0x343baa){const _0x39717f=a183_0x3bbd,_0x11585f=await openZip(_0x360d5e),_0x454538=a183_0x5d068b[_0x39717f(0x144)](_0x343baa),_0x2fa7d2=new Set(),_0x53b4f0=new Map();let _0x15d8c6=0x0,_0x37c229=0x0;await a183_0x3597c8['mkdir'](_0x454538,{'recursive':!![]}),await new Promise((_0x46c84f,_0x231dfc)=>{const _0x15eccd=_0x39717f;let _0x5dac5c=![];const _0x25fdfd=_0x59960f=>{const _0x4f271b=a183_0x3bbd;if(_0x5dac5c)return;_0x5dac5c=!![],_0x11585f[_0x4f271b(0x119)](),_0x231dfc(_0x59960f instanceof Error?_0x59960f:new Error(String(_0x59960f)));};_0x11585f[_0x15eccd(0x13e)]('error',_0x25fdfd),_0x11585f[_0x15eccd(0x13e)](_0x15eccd(0x12c),()=>{if(_0x5dac5c)return;_0x5dac5c=!![],_0x46c84f();}),_0x11585f['on'](_0x15eccd(0x11d),_0x58062b=>{const _0x419dbc=_0x15eccd;void(async()=>{const _0xe8b25b=a183_0x3bbd;_0x15d8c6+=0x1,_0x37c229+=_0x58062b[_0xe8b25b(0x146)];if(_0x15d8c6>MAX_ENTRY_COUNT)throw new Error(_0xe8b25b(0x141)+MAX_ENTRY_COUNT+_0xe8b25b(0x131));if(_0x37c229>MAX_UNCOMPRESSED_SIZE)throw new Error(_0xe8b25b(0x138));if(_0x58062b['isEncrypted']())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x58062b[_0xe8b25b(0x122)]);if(isSymbolicLink(_0x58062b))throw new Error(_0xe8b25b(0x12e)+_0x58062b[_0xe8b25b(0x122)]);const {relativePath:_0x97c64f,directory:_0x509869}=validateEntryPath(_0x58062b[_0xe8b25b(0x122)]),_0x334027=_0x97c64f[_0xe8b25b(0x143)](a183_0x5d068b[_0xe8b25b(0x128)]);for(let _0x59e7b2=0x1;_0x59e7b2<=_0x334027[_0xe8b25b(0x126)];_0x59e7b2+=0x1){const _0x231d7d=_0x334027[_0xe8b25b(0x137)](0x0,_0x59e7b2)[_0xe8b25b(0x12a)](a183_0x5d068b[_0xe8b25b(0x128)]),_0x20c887=_0x231d7d[_0xe8b25b(0x133)](_0xe8b25b(0x130)),_0x21d076=_0x53b4f0['get'](_0x20c887);if(_0x21d076&&_0x21d076!==_0x231d7d)throw new Error(_0xe8b25b(0x121)+_0x58062b[_0xe8b25b(0x122)]);_0x53b4f0[_0xe8b25b(0x139)](_0x20c887,_0x231d7d);}const _0x36c442=_0x97c64f['toLocaleLowerCase']('en-US');if(_0x2fa7d2[_0xe8b25b(0x136)](_0x36c442))throw new Error(_0xe8b25b(0x129)+_0x58062b[_0xe8b25b(0x122)]);_0x2fa7d2[_0xe8b25b(0x13f)](_0x36c442);const _0xfa1ebc=a183_0x5d068b['resolve'](_0x454538,_0x97c64f);if(_0xfa1ebc!==_0x454538&&!_0xfa1ebc['startsWith'](''+_0x454538+a183_0x5d068b[_0xe8b25b(0x128)]))throw new Error('ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20'+_0x58062b[_0xe8b25b(0x122)]);if(_0x509869)await a183_0x3597c8['mkdir'](_0xfa1ebc,{'recursive':!![]});else{await a183_0x3597c8['mkdir'](a183_0x5d068b[_0xe8b25b(0x124)](_0xfa1ebc),{'recursive':!![]});const _0x5818c0=await openEntryStream(_0x11585f,_0x58062b);await pipeline(_0x5818c0,createWriteStream(_0xfa1ebc,{'flags':'wx','mode':0x1a4}));}_0x11585f['readEntry']();})()[_0x419dbc(0x11c)](_0x25fdfd);}),_0x11585f[_0x15eccd(0x13d)]();});}
@@ -1 +1 @@
1
- const a185_0x21bf1f=a185_0x3f46;(function(_0x18c58a,_0x56ee19){const _0x3f5586=a185_0x3f46,_0x3d1e5d=_0x18c58a();while(!![]){try{const _0xfc5b9d=-parseInt(_0x3f5586(0xeb))/0x1+-parseInt(_0x3f5586(0xec))/0x2+-parseInt(_0x3f5586(0xf4))/0x3*(-parseInt(_0x3f5586(0xee))/0x4)+parseInt(_0x3f5586(0xf3))/0x5+parseInt(_0x3f5586(0xf1))/0x6*(-parseInt(_0x3f5586(0xe9))/0x7)+parseInt(_0x3f5586(0xef))/0x8*(parseInt(_0x3f5586(0xf0))/0x9)+parseInt(_0x3f5586(0xed))/0xa;if(_0xfc5b9d===_0x56ee19)break;else _0x3d1e5d['push'](_0x3d1e5d['shift']());}catch(_0x1dbb1e){_0x3d1e5d['push'](_0x3d1e5d['shift']());}}}(a185_0x330f,0x6a7e2));import a185_0x1b25f6 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a185_0x1b25f6[a185_0x21bf1f(0xf2)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x52cdc4=a185_0x21bf1f;return a185_0x1b25f6[_0x52cdc4(0xea)](__dirname,'../../../../');}function a185_0x3f46(_0x441e62,_0x2cd00b){_0x441e62=_0x441e62-0xe9;const _0x330fe4=a185_0x330f();let _0x3f467c=_0x330fe4[_0x441e62];return _0x3f467c;}function a185_0x330f(){const _0x4a9135=['327480BRFNIy','1385816YUwgqN','36dCdtBc','6882aUZrqp','dirname','1013880PoKFDp','18ytJHIL','1918hBawvZ','resolve','218819gsnGmY','934656gclQzJ','497150ueUJIu'];a185_0x330f=function(){return _0x4a9135;};return a185_0x330f();}
1
+ function a184_0x2fdb(){const _0x3f184a=['10KnbhYb','547799RHdnml','dirname','721256LCzyvS','../../../../','711220BqqdkB','697308Jcnpcj','6wXnSYG','2784560ZXlEYa','1738734BypQVK','9RTdrLK','219726KbMQfF','resolve'];a184_0x2fdb=function(){return _0x3f184a;};return a184_0x2fdb();}const a184_0x32ba64=a184_0x5d8a;(function(_0x13a037,_0x6bc64f){const _0x85d6db=a184_0x5d8a,_0x203795=_0x13a037();while(!![]){try{const _0xd78b7=parseInt(_0x85d6db(0x160))/0x1+parseInt(_0x85d6db(0x166))/0x2+-parseInt(_0x85d6db(0x164))/0x3+-parseInt(_0x85d6db(0x161))/0x4*(-parseInt(_0x85d6db(0x168))/0x5)+-parseInt(_0x85d6db(0x162))/0x6*(-parseInt(_0x85d6db(0x15c))/0x7)+parseInt(_0x85d6db(0x15e))/0x8*(parseInt(_0x85d6db(0x165))/0x9)+-parseInt(_0x85d6db(0x163))/0xa;if(_0xd78b7===_0x6bc64f)break;else _0x203795['push'](_0x203795['shift']());}catch(_0x323f1b){_0x203795['push'](_0x203795['shift']());}}}(a184_0x2fdb,0x75375));import a184_0x1c52f1 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a184_0x1c52f1[a184_0x32ba64(0x15d)](fileURLToPath(import.meta.url));function a184_0x5d8a(_0x1c4275,_0x174bb0){_0x1c4275=_0x1c4275-0x15c;const _0x2fdb65=a184_0x2fdb();let _0x5d8a2d=_0x2fdb65[_0x1c4275];return _0x5d8a2d;}export function getRabetbaseCliPackageRoot(){const _0xd895c0=a184_0x32ba64;return a184_0x1c52f1[_0xd895c0(0x167)](__dirname,_0xd895c0(0x15f));}
@@ -1 +1 @@
1
- (function(_0x17944e,_0xb650c4){const _0x9d476e=a186_0x2da8,_0x106a16=_0x17944e();while(!![]){try{const _0x3cb571=parseInt(_0x9d476e(0x17b))/0x1*(-parseInt(_0x9d476e(0x172))/0x2)+parseInt(_0x9d476e(0x16e))/0x3+-parseInt(_0x9d476e(0x173))/0x4+parseInt(_0x9d476e(0x176))/0x5+parseInt(_0x9d476e(0x174))/0x6*(-parseInt(_0x9d476e(0x17a))/0x7)+-parseInt(_0x9d476e(0x179))/0x8+parseInt(_0x9d476e(0x16a))/0x9*(parseInt(_0x9d476e(0x16d))/0xa);if(_0x3cb571===_0xb650c4)break;else _0x106a16['push'](_0x106a16['shift']());}catch(_0x298c06){_0x106a16['push'](_0x106a16['shift']());}}}(a186_0x8f57,0xa9547));import a186_0x4e50a9 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a186_0x2da8(_0x3ec97c,_0x2d511a){_0x3ec97c=_0x3ec97c-0x16a;const _0x8f570b=a186_0x8f57();let _0x2da801=_0x8f570b[_0x3ec97c];return _0x2da801;}import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';export async function copyProjectTemplate(_0xf4c522,_0x411298,_0x55de37){const _0x17219f=a186_0x2da8,_0x1077dd=Date[_0x17219f(0x170)](),_0x2f45fe=a186_0x4e50a9[_0x17219f(0x171)](process['cwd'](),_0xf4c522);try{logger[_0x17219f(0x16f)](_0x17219f(0x178),'Starting\x20project\x20template\x20creation',{'projectCode':_0xf4c522});const _0x54b4a9=_0x55de37?await materializeLocalProjectTemplate(_0x55de37,_0x2f45fe,_0x411298):await materializeProjectTemplate(_0x2f45fe,_0x411298),_0x3beba5=Date[_0x17219f(0x170)]()-_0x1077dd;logger['success'](_0x17219f(0x178),'Project\x20template\x20created',_0x3beba5,{'projectCode':_0xf4c522,'templateSource':_0x54b4a9[_0x17219f(0x177)],'templateVersion':_0x54b4a9[_0x17219f(0x16b)]});}catch(_0x12066f){const _0x375cea=Date[_0x17219f(0x170)]()-_0x1077dd;logger[_0x17219f(0x175)](_0x17219f(0x178),'Failed\x20to\x20copy\x20project\x20template',{'projectCode':_0xf4c522,'error':_0x12066f instanceof Error?_0x12066f[_0x17219f(0x16c)]:String(_0x12066f),'duration':_0x375cea});throw _0x12066f;}return formatElapsed(_0x1077dd);}function a186_0x8f57(){const _0x4772a2=['1466534LZVlnN','5025120xDCrGz','7893822HqNRpC','error','3342210eCCxlP','source','copy','8070120cmcisU','7pxEzwQ','1RCziMm','9JbnBwQ','version','message','42836630zNOskg','166257pGhyhg','info','now','resolve'];a186_0x8f57=function(){return _0x4772a2;};return a186_0x8f57();}
1
+ function a185_0x5cea(_0x3575d6,_0x3231b9){_0x3575d6=_0x3575d6-0x18d;const _0x2d099=a185_0x2d09();let _0x5cea84=_0x2d099[_0x3575d6];return _0x5cea84;}(function(_0xa6583e,_0x3cfc3d){const _0x26e600=a185_0x5cea,_0x1d08ce=_0xa6583e();while(!![]){try{const _0x40cddc=-parseInt(_0x26e600(0x1a1))/0x1+parseInt(_0x26e600(0x199))/0x2*(parseInt(_0x26e600(0x19e))/0x3)+-parseInt(_0x26e600(0x197))/0x4*(-parseInt(_0x26e600(0x1a4))/0x5)+parseInt(_0x26e600(0x191))/0x6*(parseInt(_0x26e600(0x194))/0x7)+parseInt(_0x26e600(0x198))/0x8*(-parseInt(_0x26e600(0x1a3))/0x9)+-parseInt(_0x26e600(0x1a0))/0xa*(-parseInt(_0x26e600(0x18d))/0xb)+-parseInt(_0x26e600(0x19f))/0xc*(parseInt(_0x26e600(0x19d))/0xd);if(_0x40cddc===_0x3cfc3d)break;else _0x1d08ce['push'](_0x1d08ce['shift']());}catch(_0x1092b9){_0x1d08ce['push'](_0x1d08ce['shift']());}}}(a185_0x2d09,0x446b5));import a185_0x2524de from'node:path';function a185_0x2d09(){const _0x30a573=['3546512KoZwSt','2hXJRZc','error','info','resolve','168025tKkMsp','989649WUPBev','156iJDFym','1288570oYtYZT','123702xbtpiw','source','9xPvhhC','296635oZUuUs','22TCbmFi','copy','now','cwd','1854210CDLkQc','message','Starting\x20project\x20template\x20creation','7TYwpSI','Failed\x20to\x20copy\x20project\x20template','version','8xxaZrJ'];a185_0x2d09=function(){return _0x30a573;};return a185_0x2d09();}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';export async function copyProjectTemplate(_0x5dcdd0,_0x3588e5,_0x383e14){const _0x3f344=a185_0x5cea,_0x2b89b8=Date['now'](),_0x561f83=a185_0x2524de[_0x3f344(0x19c)](process[_0x3f344(0x190)](),_0x5dcdd0);try{logger[_0x3f344(0x19b)](_0x3f344(0x18e),_0x3f344(0x193),{'projectCode':_0x5dcdd0});const _0x25c900=_0x383e14?await materializeLocalProjectTemplate(_0x383e14,_0x561f83,_0x3588e5):await materializeProjectTemplate(_0x561f83,_0x3588e5),_0x19dc1c=Date[_0x3f344(0x18f)]()-_0x2b89b8;logger['success'](_0x3f344(0x18e),'Project\x20template\x20created',_0x19dc1c,{'projectCode':_0x5dcdd0,'templateSource':_0x25c900[_0x3f344(0x1a2)],'templateVersion':_0x25c900[_0x3f344(0x196)]});}catch(_0x4e59b2){const _0x3be198=Date[_0x3f344(0x18f)]()-_0x2b89b8;logger[_0x3f344(0x19a)](_0x3f344(0x18e),_0x3f344(0x195),{'projectCode':_0x5dcdd0,'error':_0x4e59b2 instanceof Error?_0x4e59b2[_0x3f344(0x192)]:String(_0x4e59b2),'duration':_0x3be198});throw _0x4e59b2;}return formatElapsed(_0x2b89b8);}
@@ -1 +1 @@
1
- (function(_0x56988f,_0x30ff28){const _0x21d176=a187_0x51a2,_0x475eb0=_0x56988f();while(!![]){try{const _0xd7ca96=parseInt(_0x21d176(0x165))/0x1*(parseInt(_0x21d176(0x166))/0x2)+parseInt(_0x21d176(0x164))/0x3+parseInt(_0x21d176(0x174))/0x4*(-parseInt(_0x21d176(0x162))/0x5)+parseInt(_0x21d176(0x171))/0x6*(-parseInt(_0x21d176(0x161))/0x7)+-parseInt(_0x21d176(0x163))/0x8+-parseInt(_0x21d176(0x172))/0x9+-parseInt(_0x21d176(0x16f))/0xa*(-parseInt(_0x21d176(0x167))/0xb);if(_0xd7ca96===_0x30ff28)break;else _0x475eb0['push'](_0x475eb0['shift']());}catch(_0x53a489){_0x475eb0['push'](_0x475eb0['shift']());}}}(a187_0x2ef6,0xa9b8f));import a187_0x4d123a from'node:path';import{execa}from'execa';function a187_0x51a2(_0x316208,_0x16f118){_0x316208=_0x316208-0x161;const _0x2ef694=a187_0x2ef6();let _0x51a2b4=_0x2ef694[_0x316208];return _0x51a2b4;}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a187_0x2ef6(){const _0x18f5e8=['Starting\x20code\x20format','4xZPBMM','9905kxlOHa','3372205FtLQox','7735248fpQjSb','3374661yklEEy','8213aheryn','18WvXxis','23406449hUdGGQ','resolve','npx','format','now','success','Code\x20format\x20failed','--write','10hOAfMs','cwd','2190isvBJG','4262922RSkZeN'];a187_0x2ef6=function(){return _0x18f5e8;};return a187_0x2ef6();}export async function formatProjectCode(_0x404870){const _0x4aa555=a187_0x51a2,_0x2b547f=Date[_0x4aa555(0x16b)](),_0x1fd3c8=a187_0x4d123a[_0x4aa555(0x168)](process[_0x4aa555(0x170)](),_0x404870);try{logger['info'](_0x4aa555(0x16a),_0x4aa555(0x173),{'projectCode':_0x404870}),await execa(resolveNpmBin(_0x4aa555(0x169)),['prettier',_0x4aa555(0x16e),'.'],{'cwd':_0x1fd3c8});const _0x43b604=Date[_0x4aa555(0x16b)]()-_0x2b547f;logger[_0x4aa555(0x16c)](_0x4aa555(0x16a),'Code\x20format\x20completed',_0x43b604,{'projectCode':_0x404870});}catch(_0x45682f){const _0x217188=Date[_0x4aa555(0x16b)]()-_0x2b547f;logger['error']('format',_0x4aa555(0x16d),{'projectCode':_0x404870,'error':_0x45682f instanceof Error?_0x45682f['message']:String(_0x45682f),'duration':_0x217188});throw _0x45682f;}return formatElapsed(_0x2b547f);}
1
+ (function(_0x31597a,_0x425351){const _0x4b67f4=a186_0x7673,_0x5e16b3=_0x31597a();while(!![]){try{const _0x542cc2=parseInt(_0x4b67f4(0x115))/0x1*(-parseInt(_0x4b67f4(0x11a))/0x2)+-parseInt(_0x4b67f4(0x10a))/0x3+-parseInt(_0x4b67f4(0x10b))/0x4*(parseInt(_0x4b67f4(0x118))/0x5)+-parseInt(_0x4b67f4(0x106))/0x6+parseInt(_0x4b67f4(0x110))/0x7+-parseInt(_0x4b67f4(0x10f))/0x8*(-parseInt(_0x4b67f4(0x105))/0x9)+parseInt(_0x4b67f4(0x113))/0xa*(parseInt(_0x4b67f4(0x116))/0xb);if(_0x542cc2===_0x425351)break;else _0x5e16b3['push'](_0x5e16b3['shift']());}catch(_0x29e360){_0x5e16b3['push'](_0x5e16b3['shift']());}}}(a186_0x4998,0x61847));import a186_0x52852b from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a186_0x7673(_0x49a2ec,_0x40d536){_0x49a2ec=_0x49a2ec-0x104;const _0x49984c=a186_0x4998();let _0x7673a0=_0x49984c[_0x49a2ec];return _0x7673a0;}function a186_0x4998(){const _0x5910f3=['error','55nvWmng','Code\x20format\x20failed','45758JUxyWQ','Starting\x20code\x20format','495fDhpyX','1102860zjcOFb','--write','info','npx','924369Htdwzs','280676xkqqRX','prettier','success','now','75488juhlci','4567227JiyOHf','Code\x20format\x20completed','message','1761450ccUQYz','format','17hwvVbE','55TayoJo'];a186_0x4998=function(){return _0x5910f3;};return a186_0x4998();}export async function formatProjectCode(_0x2231f1){const _0x30e69b=a186_0x7673,_0x7b449d=Date[_0x30e69b(0x10e)](),_0x29ea10=a186_0x52852b['resolve'](process['cwd'](),_0x2231f1);try{logger[_0x30e69b(0x108)]('format',_0x30e69b(0x104),{'projectCode':_0x2231f1}),await execa(resolveNpmBin(_0x30e69b(0x109)),[_0x30e69b(0x10c),_0x30e69b(0x107),'.'],{'cwd':_0x29ea10});const _0x13a0aa=Date['now']()-_0x7b449d;logger[_0x30e69b(0x10d)](_0x30e69b(0x114),_0x30e69b(0x111),_0x13a0aa,{'projectCode':_0x2231f1});}catch(_0x1d71b8){const _0x47c875=Date[_0x30e69b(0x10e)]()-_0x7b449d;logger[_0x30e69b(0x117)]('format',_0x30e69b(0x119),{'projectCode':_0x2231f1,'error':_0x1d71b8 instanceof Error?_0x1d71b8[_0x30e69b(0x112)]:String(_0x1d71b8),'duration':_0x47c875});throw _0x1d71b8;}return formatElapsed(_0x7b449d);}
@@ -1 +1 @@
1
- (function(_0x409087,_0x5e9302){const _0x1cfab5=a188_0x4531,_0x20af01=_0x409087();while(!![]){try{const _0x51bad0=parseInt(_0x1cfab5(0x1d3))/0x1+-parseInt(_0x1cfab5(0x1da))/0x2+-parseInt(_0x1cfab5(0x1c9))/0x3+parseInt(_0x1cfab5(0x1c7))/0x4*(parseInt(_0x1cfab5(0x1d9))/0x5)+-parseInt(_0x1cfab5(0x1d2))/0x6+-parseInt(_0x1cfab5(0x1db))/0x7+parseInt(_0x1cfab5(0x1ce))/0x8;if(_0x51bad0===_0x5e9302)break;else _0x20af01['push'](_0x20af01['shift']());}catch(_0x46d503){_0x20af01['push'](_0x20af01['shift']());}}}(a188_0x4156,0xd1f00));import a188_0x2e1c75 from'node:path';function a188_0x4156(){const _0x66a351=['Dependency\x20install\x20completed','5518002ZTOneL','98690fkAcEI','Dependency\x20install\x20failed','resolve','message','success','install','5CXpckP','2133810DAjBNu','10236737GwZimz','615788tZkEGw','https://registry.npmmirror.com','3319041FfjPoD','npm','cwd','Starting\x20dependency\x20install','error','41300616CvMyun','--registry','now'];a188_0x4156=function(){return _0x66a351;};return a188_0x4156();}import{execa}from'execa';function a188_0x4531(_0x54c04f,_0x217c43){_0x54c04f=_0x54c04f-0x1c7;const _0x41560f=a188_0x4156();let _0x4531db=_0x41560f[_0x54c04f];return _0x4531db;}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(_0x27b305){const _0x2302ce=a188_0x4531,_0x3ccb9c=Date[_0x2302ce(0x1d0)](),_0x43f7ad=a188_0x2e1c75[_0x2302ce(0x1d5)](process[_0x2302ce(0x1cb)](),_0x27b305);try{logger['info'](_0x2302ce(0x1d8),_0x2302ce(0x1cc),{'projectCode':_0x27b305,'registry':_0x2302ce(0x1c8)}),await execa(resolveNpmBin(_0x2302ce(0x1ca)),[_0x2302ce(0x1d8),_0x2302ce(0x1cf),_0x2302ce(0x1c8)],{'cwd':_0x43f7ad});const _0x11ea0d=Date[_0x2302ce(0x1d0)]()-_0x3ccb9c;logger[_0x2302ce(0x1d7)](_0x2302ce(0x1d8),_0x2302ce(0x1d1),_0x11ea0d,{'projectCode':_0x27b305});}catch(_0x31320e){const _0x3dda1e=Date[_0x2302ce(0x1d0)]()-_0x3ccb9c;logger[_0x2302ce(0x1cd)](_0x2302ce(0x1d8),_0x2302ce(0x1d4),{'projectCode':_0x27b305,'error':_0x31320e instanceof Error?_0x31320e[_0x2302ce(0x1d6)]:String(_0x31320e),'duration':_0x3dda1e});throw _0x31320e;}return formatElapsed(_0x3ccb9c);}
1
+ (function(_0x2c7dcb,_0x59ac7e){const _0x4ea999=a187_0x2520,_0x1273f9=_0x2c7dcb();while(!![]){try{const _0x44afed=-parseInt(_0x4ea999(0x1e2))/0x1+parseInt(_0x4ea999(0x1e4))/0x2*(parseInt(_0x4ea999(0x1e3))/0x3)+parseInt(_0x4ea999(0x1e8))/0x4+-parseInt(_0x4ea999(0x1e7))/0x5+-parseInt(_0x4ea999(0x1e0))/0x6*(parseInt(_0x4ea999(0x1de))/0x7)+parseInt(_0x4ea999(0x1e6))/0x8+parseInt(_0x4ea999(0x1e9))/0x9;if(_0x44afed===_0x59ac7e)break;else _0x1273f9['push'](_0x1273f9['shift']());}catch(_0x2b4ce4){_0x1273f9['push'](_0x1273f9['shift']());}}}(a187_0x5a92,0x5b59f));import a187_0x3eb81c from'node:path';function a187_0x2520(_0x531615,_0x337acf){_0x531615=_0x531615-0x1da;const _0x5a92e9=a187_0x5a92();let _0x2520ce=_0x5a92e9[_0x531615];return _0x2520ce;}import{execa}from'execa';function a187_0x5a92(){const _0x169202=['114IybexE','now','538723xRRRBu','20883NdDLcp','160dtjYBY','Dependency\x20install\x20failed','1796504UUKaBe','779000tmbgUF','1709064BeYqKx','3141612dEmFYa','resolve','npm','success','cwd','https://registry.npmmirror.com','install','message','180187EsFSiu','Starting\x20dependency\x20install'];a187_0x5a92=function(){return _0x169202;};return a187_0x5a92();}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(_0x4b7253){const _0x437fac=a187_0x2520,_0x32e346=Date[_0x437fac(0x1e1)](),_0x42013e=a187_0x3eb81c[_0x437fac(0x1ea)](process[_0x437fac(0x1da)](),_0x4b7253);try{logger['info'](_0x437fac(0x1dc),_0x437fac(0x1df),{'projectCode':_0x4b7253,'registry':_0x437fac(0x1db)}),await execa(resolveNpmBin(_0x437fac(0x1eb)),[_0x437fac(0x1dc),'--registry',_0x437fac(0x1db)],{'cwd':_0x42013e});const _0x3cf4b4=Date['now']()-_0x32e346;logger[_0x437fac(0x1ec)](_0x437fac(0x1dc),'Dependency\x20install\x20completed',_0x3cf4b4,{'projectCode':_0x4b7253});}catch(_0x3fc4b0){const _0x12f5c0=Date[_0x437fac(0x1e1)]()-_0x32e346;logger['error'](_0x437fac(0x1dc),_0x437fac(0x1e5),{'projectCode':_0x4b7253,'error':_0x3fc4b0 instanceof Error?_0x3fc4b0[_0x437fac(0x1dd)]:String(_0x3fc4b0),'duration':_0x12f5c0});throw _0x3fc4b0;}return formatElapsed(_0x32e346);}
@@ -1 +1 @@
1
- const a189_0xea8a25=a189_0x2b31;(function(_0xa1e355,_0x1d7a2b){const _0xa9c7d=a189_0x2b31,_0x23f2ec=_0xa1e355();while(!![]){try{const _0x2a8a31=-parseInt(_0xa9c7d(0x140))/0x1+-parseInt(_0xa9c7d(0x131))/0x2+-parseInt(_0xa9c7d(0x141))/0x3*(parseInt(_0xa9c7d(0x135))/0x4)+-parseInt(_0xa9c7d(0x133))/0x5+parseInt(_0xa9c7d(0x132))/0x6+-parseInt(_0xa9c7d(0x134))/0x7*(parseInt(_0xa9c7d(0x13d))/0x8)+parseInt(_0xa9c7d(0x13e))/0x9*(parseInt(_0xa9c7d(0x137))/0xa);if(_0x2a8a31===_0x1d7a2b)break;else _0x23f2ec['push'](_0x23f2ec['shift']());}catch(_0x30287d){_0x23f2ec['push'](_0x23f2ec['shift']());}}}(a189_0x1740,0xb4371));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{findProjectRootDirectory,resolveConfigPath}from'../../context/config-loader.js';function a189_0x1740(){const _0x1eabb3=['read','3079030gOlexK','Domain\x20routing\x20synchronized:\x20','\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','path','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','1430984hFCTfI','117TDRxFS','validation','770493qpiCQD','45CLNFjT','Run\x20','1269824keTJKn','425190juyOVR','1240705BVzNMs','28enuYib','257708zzfniE'];a189_0x1740=function(){return _0x1eabb3;};return a189_0x1740();}import{writeProjectDomainRoutingManifest}from'../../config/project-domain-routing.js';function a189_0x2b31(_0xc08a49,_0x4912c7){_0xc08a49=_0xc08a49-0x130;const _0x17402c=a189_0x1740();let _0x2b31c5=_0x17402c[_0xc08a49];return _0x2b31c5;}export const projectDomainRoutingSyncDefinition={'service':'project','command':'domain-routing-sync','description':a189_0xea8a25(0x13c),'risk':a189_0xea8a25(0x136),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x5ed7d0=a189_0xea8a25,_0x22e2ae=findProjectRootDirectory();if(!resolveConfigPath(_0x22e2ae))throw CliErrors[_0x5ed7d0(0x13f)](_0x5ed7d0(0x13a),_0x5ed7d0(0x130)+CLI_BIN_NAME+_0x5ed7d0(0x139));const _0x1d7181=writeProjectDomainRoutingManifest(_0x22e2ae);return{'ok':!![],'message':_0x5ed7d0(0x138)+_0x1d7181[_0x5ed7d0(0x13b)],'data':_0x1d7181};}};
1
+ const a188_0xaf1012=a188_0x58cc;(function(_0x4fa515,_0x40670d){const _0xbfe492=a188_0x58cc,_0x174c7e=_0x4fa515();while(!![]){try{const _0x3d0239=parseInt(_0xbfe492(0x6e))/0x1+parseInt(_0xbfe492(0x74))/0x2+parseInt(_0xbfe492(0x75))/0x3*(parseInt(_0xbfe492(0x6f))/0x4)+parseInt(_0xbfe492(0x79))/0x5+parseInt(_0xbfe492(0x70))/0x6*(parseInt(_0xbfe492(0x73))/0x7)+parseInt(_0xbfe492(0x77))/0x8*(parseInt(_0xbfe492(0x76))/0x9)+-parseInt(_0xbfe492(0x6c))/0xa;if(_0x3d0239===_0x40670d)break;else _0x174c7e['push'](_0x174c7e['shift']());}catch(_0x2ee8a7){_0x174c7e['push'](_0x174c7e['shift']());}}}(a188_0x1705,0xe935c));function a188_0x58cc(_0x25a692,_0x1947fe){_0x25a692=_0x25a692-0x6c;const _0x17052d=a188_0x1705();let _0x58ccae=_0x17052d[_0x25a692];return _0x58ccae;}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':a188_0xaf1012(0x71),'command':a188_0xaf1012(0x72),'description':a188_0xaf1012(0x7b),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(){const _0x552347=a188_0xaf1012,_0x3c16ca=findProjectRootDirectory();if(!resolveConfigPath(_0x3c16ca))throw CliErrors[_0x552347(0x7a)](_0x552347(0x7c),_0x552347(0x78)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>\x20in\x20the\x20project\x20directory\x20first.');const _0x304118=writeProjectDomainRoutingManifest(_0x3c16ca);return{'ok':!![],'message':'Domain\x20routing\x20synchronized:\x20'+_0x304118[_0x552347(0x6d)],'data':_0x304118};}};function a188_0x1705(){const _0x229ab9=['1879669iIxsCt','656468VRVdXG','12zgKiEz','project','domain-routing-sync','5696530NuTSDw','2148624YyPtcy','15TxWzmh','240498MyUGQl','344kPbnoC','Run\x20','2150740sCJByH','validation','Synchronize\x20the\x20current\x20project\x27s\x20public\x20Domain\x20routing','No\x20Rabetbase\x20project\x20configuration\x20was\x20found.','60261120SnjyGQ','path'];a188_0x1705=function(){return _0x229ab9;};return a188_0x1705();}
@@ -1 +1 @@
1
- const a190_0x467d27=a190_0x11c4;(function(_0x4b4e0c,_0x4f766e){const _0x2ed604=a190_0x11c4,_0x2db689=_0x4b4e0c();while(!![]){try{const _0x3aec0c=-parseInt(_0x2ed604(0xa6))/0x1+-parseInt(_0x2ed604(0x90))/0x2*(-parseInt(_0x2ed604(0x9d))/0x3)+parseInt(_0x2ed604(0x8c))/0x4+parseInt(_0x2ed604(0x99))/0x5+-parseInt(_0x2ed604(0x9b))/0x6*(-parseInt(_0x2ed604(0xa2))/0x7)+-parseInt(_0x2ed604(0xac))/0x8+parseInt(_0x2ed604(0x88))/0x9*(-parseInt(_0x2ed604(0xa7))/0xa);if(_0x3aec0c===_0x4f766e)break;else _0x2db689['push'](_0x2db689['shift']());}catch(_0x4c31d0){_0x2db689['push'](_0x2db689['shift']());}}}(a190_0x2ba9,0xa76ab));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':a190_0x467d27(0xa8),'type':'string','description':a190_0x467d27(0x8f)},{'name':a190_0x467d27(0x8a),'type':a190_0x467d27(0x9e),'description':a190_0x467d27(0x8b)},{'name':a190_0x467d27(0xad),'type':a190_0x467d27(0x9e),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'},{'name':'current-dir','type':a190_0x467d27(0x9a),'description':a190_0x467d27(0xae),'default':![]},{'name':a190_0x467d27(0x92),'type':a190_0x467d27(0x9e),'description':a190_0x467d27(0x9f)}],upgradeFlags=[{'name':a190_0x467d27(0x97),'type':a190_0x467d27(0x9a),'description':a190_0x467d27(0x93),'default':![]}];function a190_0x11c4(_0x33b4c8,_0x4265f7){_0x33b4c8=_0x33b4c8-0x87;const _0x2ba904=a190_0x2ba9();let _0x11c42a=_0x2ba904[_0x33b4c8];return _0x11c42a;}function a190_0x2ba9(){const _0x56a260=['Run\x20','6847904bufKFj','appcode','Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','project','--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.','write','671445PfoZgH','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','env','Target\x20environment','2601072dfZSep','trim','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','Project\x20name','4IWEKzP','str','template-source','Skip\x20confirmation\x20prompt','validation','nonInteractive','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','yes','create','6659955JmlzeG','boolean','2628684AxbiLa','Usage:\x20','391521FmzdNH','string','Prepared\x20local\x20project\x20template\x20directory','../../commands/project/create/main.js','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','7MLiFDt','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','cookie','Create\x20a\x20new\x20project','1065055VVGmep','10MdUqWC','name','project-name','args'];a190_0x2ba9=function(){return _0x56a260;};return a190_0x2ba9();}export const projectDefinitions=[{'service':'project','command':a190_0x467d27(0x98),'description':a190_0x467d27(0xa5),'risk':a190_0x467d27(0x87),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a190_0x467d27(0xa9),'description':a190_0x467d27(0xa1),'required':![]}],'flags':createFlags,async 'execute'(_0x369211){const _0x206ee8=a190_0x467d27,{createApp:_0x2c7334}=await import(_0x206ee8(0xa0)),_0x4b3d50=_0x369211[_0x206ee8(0x91)](_0x206ee8(0xa8))['trim']()||_0x369211[_0x206ee8(0xaa)][0x0]?.[_0x206ee8(0x8d)](),_0x3e5fd4=_0x369211[_0x206ee8(0x91)](_0x206ee8(0x8a))||undefined,_0x4a4bed=_0x369211[_0x206ee8(0x91)](_0x206ee8(0xad))||undefined,_0x51243c=_0x369211[_0x206ee8(0x91)]('template-source')['trim']()||undefined,_0x2e4d7a=_0x369211['bool']('current-dir');if(_0x2e4d7a&&_0x4b3d50)throw CliErrors[_0x206ee8(0x94)](_0x206ee8(0xb0),_0x206ee8(0xab)+CLI_BIN_NAME+_0x206ee8(0x89));if(_0x369211['nonInteractive']){if(!_0x4b3d50&&!_0x2e4d7a)throw CliErrors[_0x206ee8(0x94)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x206ee8(0x9c)+CLI_BIN_NAME+_0x206ee8(0x8e)+CLI_BIN_NAME+_0x206ee8(0xa3));await _0x2c7334({'projectCode':_0x4b3d50,'appCode':_0x4a4bed,'env':_0x3e5fd4,'cookie':_0x369211['cookie'],'currentDir':_0x2e4d7a,'nonInteractive':!![],'templateSource':_0x51243c});}else await _0x2c7334({'projectCode':_0x4b3d50,'appCode':_0x4a4bed,'env':_0x3e5fd4,'cookie':_0x369211[_0x206ee8(0xa4)],'currentDir':_0x2e4d7a,'templateSource':_0x51243c});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a190_0x467d27(0xaf),'command':'upgrade','description':a190_0x467d27(0x96),'risk':a190_0x467d27(0x87),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x15cbbe){const _0x674cbf=a190_0x467d27;return await upgradeApp(_0x15cbbe[_0x674cbf(0x95)],{'yes':_0x15cbbe['bool'](_0x674cbf(0x97))}),{'ok':!![]};}}];
1
+ const a189_0x25d93d=a189_0x3ae4;(function(_0xd027f5,_0x469d6){const _0x130c51=a189_0x3ae4,_0x5c0859=_0xd027f5();while(!![]){try{const _0x34a8dd=parseInt(_0x130c51(0x12d))/0x1+parseInt(_0x130c51(0x121))/0x2+parseInt(_0x130c51(0x135))/0x3+-parseInt(_0x130c51(0x12f))/0x4+-parseInt(_0x130c51(0x122))/0x5+-parseInt(_0x130c51(0x132))/0x6*(-parseInt(_0x130c51(0x116))/0x7)+-parseInt(_0x130c51(0x120))/0x8*(parseInt(_0x130c51(0x112))/0x9);if(_0x34a8dd===_0x469d6)break;else _0x5c0859['push'](_0x5c0859['shift']());}catch(_0x283bac){_0x5c0859['push'](_0x5c0859['shift']());}}}(a189_0x1354,0x5a424));function a189_0x1354(){const _0x199f55=['Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','1333299MBnkQZ','cookie','Create\x20a\x20new\x20project','72nCiGJG','bool','yes','str','3422839mihcoF','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]\x20from\x20the\x20empty\x20target\x20directory.','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','upgrade','env','write','validation','project-name','Target\x20environment','string','737576EiRREs','1405272xNBfgB','2139040SaZpZi','Run\x20','boolean','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]\x20or\x20','nonInteractive','create','\x20project\x20create\x20--current-dir\x20[--appcode\x20<code>]','Prepared\x20local\x20project\x20template\x20directory','trim','Project\x20name','project','201092xAEmbh','name','1208216ruRNlJ','../../commands/project/create/main.js','appcode','6yuDHEe','template-source'];a189_0x1354=function(){return _0x199f55;};return a189_0x1354();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a189_0x3ae4(_0x54fbe7,_0x4916cb){_0x54fbe7=_0x54fbe7-0x111;const _0x13548c=a189_0x1354();let _0x3ae4f0=_0x13548c[_0x54fbe7];return _0x3ae4f0;}import{upgradeApp}from'../../commands/project/upgrade.js';import{projectDomainRoutingSyncDefinition}from'../../commands/project/domain-routing-sync.js';const createFlags=[{'name':a189_0x25d93d(0x12e),'type':'string','description':a189_0x25d93d(0x12b)},{'name':a189_0x25d93d(0x11a),'type':a189_0x25d93d(0x11f),'description':a189_0x25d93d(0x11e)},{'name':'appcode','type':a189_0x25d93d(0x11f),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'},{'name':'current-dir','type':a189_0x25d93d(0x124),'description':'Initialize\x20the\x20current\x20empty\x20directory\x20instead\x20of\x20creating\x20a\x20child\x20directory','default':![]},{'name':a189_0x25d93d(0x133),'type':'string','description':a189_0x25d93d(0x129)}],upgradeFlags=[{'name':a189_0x25d93d(0x114),'type':a189_0x25d93d(0x124),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a189_0x25d93d(0x12c),'command':a189_0x25d93d(0x127),'description':a189_0x25d93d(0x111),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a189_0x25d93d(0x11d),'description':a189_0x25d93d(0x118),'required':![]}],'flags':createFlags,async 'execute'(_0x4aecb9){const _0x176973=a189_0x25d93d,{createApp:_0x5e21ca}=await import(_0x176973(0x130)),_0x3c23e1=_0x4aecb9[_0x176973(0x115)](_0x176973(0x12e))[_0x176973(0x12a)]()||_0x4aecb9['args'][0x0]?.[_0x176973(0x12a)](),_0x585492=_0x4aecb9[_0x176973(0x115)](_0x176973(0x11a))||undefined,_0x199165=_0x4aecb9[_0x176973(0x115)](_0x176973(0x131))||undefined,_0x7765e5=_0x4aecb9[_0x176973(0x115)](_0x176973(0x133))['trim']()||undefined,_0xc31c87=_0x4aecb9[_0x176973(0x113)]('current-dir');if(_0xc31c87&&_0x3c23e1)throw CliErrors[_0x176973(0x11c)]('--current-dir\x20cannot\x20be\x20combined\x20with\x20a\x20project\x20name.',_0x176973(0x123)+CLI_BIN_NAME+_0x176973(0x117));if(_0x4aecb9[_0x176973(0x126)]){if(!_0x3c23e1&&!_0xc31c87)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x176973(0x125)+CLI_BIN_NAME+_0x176973(0x128));await _0x5e21ca({'projectCode':_0x3c23e1,'appCode':_0x199165,'env':_0x585492,'cookie':_0x4aecb9[_0x176973(0x136)],'currentDir':_0xc31c87,'nonInteractive':!![],'templateSource':_0x7765e5});}else await _0x5e21ca({'projectCode':_0x3c23e1,'appCode':_0x199165,'env':_0x585492,'cookie':_0x4aecb9[_0x176973(0x136)],'currentDir':_0xc31c87,'templateSource':_0x7765e5});return{'ok':!![]};}},projectDomainRoutingSyncDefinition,{'service':a189_0x25d93d(0x12c),'command':a189_0x25d93d(0x119),'description':a189_0x25d93d(0x134),'risk':a189_0x25d93d(0x11b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x5f4ab5){const _0xdc9eaf=a189_0x25d93d;return await upgradeApp(_0x5f4ab5[_0xdc9eaf(0x126)],{'yes':_0x5f4ab5['bool'](_0xdc9eaf(0x114))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a191_0x56c7b3=a191_0x14b0;(function(_0x523ecf,_0x4fabdc){const _0x30afe9=a191_0x14b0,_0x58f5e4=_0x523ecf();while(!![]){try{const _0x2e227d=parseInt(_0x30afe9(0x241))/0x1+-parseInt(_0x30afe9(0x23b))/0x2*(parseInt(_0x30afe9(0x20b))/0x3)+-parseInt(_0x30afe9(0x233))/0x4*(parseInt(_0x30afe9(0x1e0))/0x5)+parseInt(_0x30afe9(0x1ee))/0x6+parseInt(_0x30afe9(0x1e2))/0x7+parseInt(_0x30afe9(0x23a))/0x8*(-parseInt(_0x30afe9(0x1e6))/0x9)+parseInt(_0x30afe9(0x209))/0xa;if(_0x2e227d===_0x4fabdc)break;else _0x58f5e4['push'](_0x58f5e4['shift']());}catch(_0x502f7b){_0x58f5e4['push'](_0x58f5e4['shift']());}}}(a191_0x4c12,0xb001d));import a191_0x56ef4e from'chalk';function a191_0x4c12(){const _0xc22929=['label','undefined','\x20\x20\x20\x20\x20\x20\x20','includes','@lovrabet/sdk','start','===\x20Upgrade\x20Summary\x20===','\x20\x20Fields\x20to\x20migrate:\x20','.cursor/mcp.json','Proceed\x20with\x20upgrade?','fields','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','cyan','\x20\x20#\x20or','inherit','needed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20New\x20config\x20(.rabetbase.json):\x20','MCP\x20config:','error','yellow','bold','FOUND','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','@lovrabet/dataset-mcp-server','succeed','message','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Action:\x20delete','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','join','Install\x20new\x20skill','files','push','red','Upgrade\x20cancelled.','already\x20exists\x20(will\x20merge)','Remove\x20old\x20skill','4hxkyYW','===\x20Upgrade\x20Analysis\x20===','fail','@lovrabet/sdk:','\x20\x20bun\x20install','no\x20legacy\x20entry','Upgrade\x20@lovrabet/sdk','920snnKpc','15470nVoPKP','info','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','\x20removed','args','isArray','1369069idusoe','\x20from\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','.bak','object','not\x20found\x20(will\x20create)','keys','lovrabet/rabetbase\x20installed\x20globally','failed','oldMcpConfig','\x20(backup:\x20','Remove\x20.lovrabet/','latest','parse','exit\x20','CANCEL','string','gray','not\x20found\x20or\x20already\x20at\x20latest','oldArtifacts','log','Step\x204/7:\x20MCP\x20config\x20—\x20','skipped','no\x20legacy\x20config\x20found','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','\x20→\x20','Config\x20migration','mcpServers','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','5994565MesHcL','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','9385957kkdGXA','Legacy\x20artifacts:','Remove\x20legacy\x20artifacts','stringify','49239YjPOwm','length','isDirectory','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Clean\x20MCP\x20config','lovrabet/lovrabet-skill\x20removed','utf8','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1677906buwiqF','\x20\x20npm\x20install','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Config\x20file:','step','oldPath','Upgrade\x20completed\x20successfully!','removed\x20','hasNewConfig','.claude/skills/lovrabet','white','none\x20found','green','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','done','sdkUpgrade','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','status','Step\x201/7:\x20Migrating\x20config...','path','.lovrabet.json','\x20\x20Step\x20','cwd','entries','\x20removed\x20(','2633170NDwQUX','some','273ODmqJP','package.json'];a191_0x4c12=function(){return _0xc22929;};return a191_0x4c12();}import a191_0x900295 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=[a191_0x56c7b3(0x204),'.lovrabetrc'];function collectIdeSkillFiles(_0x4cfc1c){const _0x1356f8=a191_0x56c7b3,_0x9efbd1=[];for(const _0x2c1246 of Object['values'](CORE_IDE_CONFIGS)){if(_0x2c1246[_0x1356f8(0x22d)])for(const _0x214875 of _0x2c1246['files']){_0x9efbd1[_0x1356f8(0x22e)](resolve(_0x4cfc1c,_0x214875[_0x1356f8(0x203)]));}}return _0x9efbd1;}function analyse(_0x3b9617){const _0x1ed961=a191_0x56c7b3;let _0x4a4446=null;const _0x3aafa2=resolve(_0x3b9617,NEW_CONFIG_NAME),_0x14a999=existsSync(_0x3aafa2);for(const _0xd561b0 of LEGACY_CONFIG_NAMES){const _0x24a256=resolve(_0x3b9617,_0xd561b0);if(existsSync(_0x24a256)){const _0xb89fa7=readConfigFile(_0x24a256),_0x332fcd=Object[_0x1ed961(0x247)](_0xb89fa7)['filter'](_0x2e2232=>typeof _0xb89fa7[_0x2e2232]!==_0x1ed961(0x20e));_0x4a4446={'oldPath':_0x24a256,'hasNewConfig':_0x14a999,'fields':_0x332fcd};break;}}const _0x59b499=[],_0x42e9bb=resolve(_0x3b9617,'.lovrabet');if(existsSync(_0x42e9bb))_0x59b499['push'](_0x42e9bb);const _0x4e7db8=resolve(_0x3b9617,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x4e7db8))_0x59b499[_0x1ed961(0x22e)](_0x4e7db8);const _0x590a10=resolve(_0x3b9617,_0x1ed961(0x1f9));if(existsSync(_0x590a10))_0x59b499[_0x1ed961(0x22e)](_0x590a10);for(const _0x233397 of collectIdeSkillFiles(_0x3b9617)){if(existsSync(_0x233397))_0x59b499[_0x1ed961(0x22e)](_0x233397);}let _0x1736aa=null;const _0x1fa885=resolve(_0x3b9617,_0x1ed961(0x215));if(existsSync(_0x1fa885))try{const _0x3cae47=JSON[_0x1ed961(0x24e)](readFileSync(_0x1fa885,_0x1ed961(0x1ec)));if(_0x3cae47?.[_0x1ed961(0x1de)]&&typeof _0x3cae47['mcpServers']==='object'){const _0x400c2d=[];for(const [_0x2a478f,_0x116d3b]of Object['entries'](_0x3cae47[_0x1ed961(0x1de)])){const _0xd921a8=_0x116d3b;_0xd921a8?.['args']&&Array[_0x1ed961(0x240)](_0xd921a8[_0x1ed961(0x23f)])&&_0xd921a8[_0x1ed961(0x23f)][_0x1ed961(0x20a)](_0x3db1f5=>typeof _0x3db1f5===_0x1ed961(0x1d1)&&_0x3db1f5['includes'](_0x1ed961(0x225)))&&_0x400c2d['push'](_0x2a478f);}_0x400c2d[_0x1ed961(0x1e7)]>0x0&&(_0x1736aa={'path':_0x1fa885,'keys':_0x400c2d});}}catch{}const _0x95ea51=_0x59b499['length']>0x0||_0x4a4446!==null;let _0x29c0d0=null;const _0x1f4b56=resolve(_0x3b9617,_0x1ed961(0x20c));if(existsSync(_0x1f4b56))try{const _0x5e8954=JSON[_0x1ed961(0x24e)](readFileSync(_0x1f4b56,'utf8'));for(const _0x479948 of['dependencies','devDependencies']){const _0x3b3b8e=_0x5e8954?.[_0x479948]?.[_0x1ed961(0x211)];if(typeof _0x3b3b8e===_0x1ed961(0x1d1)){_0x3b3b8e!==_0x1ed961(0x24d)&&(_0x29c0d0={'pkgPath':_0x1f4b56,'currentVersion':_0x3b3b8e,'field':_0x479948});break;}}}catch{}return{'configMigration':_0x4a4446,'oldArtifacts':_0x59b499,'oldMcpConfig':_0x1736aa,'needsSkillSwap':_0x95ea51,'sdkUpgrade':_0x29c0d0};}function printReport(_0x9eecc6){const _0x15a78d=a191_0x56c7b3,{configMigration:_0x4048fa,oldArtifacts:_0x507ca0,oldMcpConfig:_0x633d8,needsSkillSwap:_0x1af5c7}=_0x9eecc6;console[_0x15a78d(0x1d5)](''),console['log'](a191_0x56ef4e[_0x15a78d(0x222)](_0x15a78d(0x234))),console[_0x15a78d(0x1d5)]('');_0x4048fa?(console['log'](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1f3))+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x4048fa['oldPath']))),console[_0x15a78d(0x1d5)](_0x15a78d(0x21e)+(_0x4048fa[_0x15a78d(0x1f8)]?a191_0x56ef4e[_0x15a78d(0x1fc)](_0x15a78d(0x231)):a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x246)))),console[_0x15a78d(0x1d5)](_0x15a78d(0x214)+_0x4048fa[_0x15a78d(0x217)][_0x15a78d(0x22b)](',\x20')),console['log'](_0x15a78d(0x1da))):console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1f3))+'\x20\x20'+a191_0x56ef4e['gray'](_0x15a78d(0x1d8)));console[_0x15a78d(0x1d5)]('');if(_0x507ca0[_0x15a78d(0x1e7)]>0x0){console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1e3)));for(const _0x47be43 of _0x507ca0){console[_0x15a78d(0x1d5)]('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x22f)](_0x15a78d(0x223))+'\x20\x20'+_0x47be43);}console[_0x15a78d(0x1d5)](_0x15a78d(0x229));}else console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x1e3))+'\x20\x20'+a191_0x56ef4e['gray'](_0x15a78d(0x1fb)));console[_0x15a78d(0x1d5)]('');_0x633d8?(console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('MCP\x20config:')+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x633d8[_0x15a78d(0x203)])+'\x20→\x20keys:\x20'+_0x633d8[_0x15a78d(0x247)]['join'](',\x20'))),console[_0x15a78d(0x1d5)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x21f))+'\x20\x20'+a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x238)));console[_0x15a78d(0x1d5)](''),console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('Skill\x20swap:')+('\x20\x20'+(_0x1af5c7?a191_0x56ef4e[_0x15a78d(0x221)](_0x15a78d(0x21c)):a191_0x56ef4e[_0x15a78d(0x1fc)]('not\x20needed'))));_0x1af5c7&&console[_0x15a78d(0x1d5)](_0x15a78d(0x1df)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x15a78d(0x1d5)]('');if(_0x9eecc6[_0x15a78d(0x1ff)]){const {currentVersion:_0x5b5a74,field:_0x589e03,pkgPath:_0x14734e}=_0x9eecc6[_0x15a78d(0x1ff)];console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)](_0x15a78d(0x236))+('\x20\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x14734e))),console[_0x15a78d(0x1d5)]('\x20\x20Current\x20version\x20in\x20'+_0x589e03+':\x20'+a191_0x56ef4e[_0x15a78d(0x221)](_0x5b5a74)+_0x15a78d(0x1dc)+a191_0x56ef4e[_0x15a78d(0x1fc)](_0x15a78d(0x24d))),console['log'](_0x15a78d(0x1e9));}else console[_0x15a78d(0x1d5)](a191_0x56ef4e[_0x15a78d(0x219)]('@lovrabet/sdk:')+'\x20\x20'+a191_0x56ef4e[_0x15a78d(0x1d2)](_0x15a78d(0x1d3)));console[_0x15a78d(0x1d5)]('');}function execConfigMigration(_0x18c35c,_0x4e6afd){const _0x4bede8=a191_0x56c7b3,{configMigration:_0x76f5cd}=_0x18c35c;if(!_0x76f5cd?.[_0x4bede8(0x1f5)])return{'step':0x1,'label':_0x4bede8(0x1dd),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x32afb2=readConfigFile(_0x76f5cd[_0x4bede8(0x1f5)]),_0x2ed149=resolve(_0x4e6afd,NEW_CONFIG_NAME),_0x399221=_0x76f5cd[_0x4bede8(0x1f8)]?readConfigFile(_0x2ed149):{};for(const [_0xe7a401,_0x5ed07b]of Object['entries'](_0x32afb2)){!(_0xe7a401 in _0x399221)&&(_0x399221[_0xe7a401]=_0x5ed07b);}writeConfigFile(_0x2ed149,_0x399221);const _0x2a0f81=_0x76f5cd[_0x4bede8(0x1f5)]+_0x4bede8(0x244);return renameSync(_0x76f5cd['oldPath'],_0x2a0f81),{'step':0x1,'label':_0x4bede8(0x1dd),'ok':!![],'detail':_0x76f5cd[_0x4bede8(0x1f5)]+_0x4bede8(0x1dc)+_0x2ed149+_0x4bede8(0x24b)+_0x2a0f81+')'};}function execRemoveOldArtifacts(_0x4d97ee){const _0x2a967d=a191_0x56c7b3,_0x52318c=[];for(const _0x262202 of _0x4d97ee){try{if(!existsSync(_0x262202))continue;const _0x392e17=tryStat(_0x262202);_0x392e17?.[_0x2a967d(0x1e8)]()?rmSync(_0x262202,{'recursive':!![],'force':!![]}):unlinkSync(_0x262202);}catch(_0x5ac42c){_0x52318c[_0x2a967d(0x22e)](_0x262202+':\x20'+_0x5ac42c['message']);}}return{'step':0x3,'label':_0x2a967d(0x1e4),'ok':_0x52318c[_0x2a967d(0x1e7)]===0x0,'detail':_0x52318c[_0x2a967d(0x1e7)]>0x0?_0x4d97ee[_0x2a967d(0x1e7)]-_0x52318c['length']+'/'+_0x4d97ee[_0x2a967d(0x1e7)]+_0x2a967d(0x208)+_0x52318c[_0x2a967d(0x22b)](';\x20')+')':_0x4d97ee['length']+_0x2a967d(0x23e)};}function execCleanMcp(_0x56c4d8){const _0x20611f=a191_0x56c7b3;if(!_0x56c4d8[_0x20611f(0x24a)])return{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':_0x20611f(0x1d7)};try{const _0x4d990f=readFileSync(_0x56c4d8[_0x20611f(0x24a)][_0x20611f(0x203)],_0x20611f(0x1ec)),_0x15d2f8=JSON[_0x20611f(0x24e)](_0x4d990f);if(_0x15d2f8?.[_0x20611f(0x1de)]&&typeof _0x15d2f8[_0x20611f(0x1de)]===_0x20611f(0x245)){const _0x54b767=[];for(const [_0x220920,_0x49c845]of Object[_0x20611f(0x207)](_0x15d2f8[_0x20611f(0x1de)])){_0x49c845?.['args']&&Array[_0x20611f(0x240)](_0x49c845['args'])&&_0x49c845['args'][_0x20611f(0x20a)](_0x36f043=>typeof _0x36f043===_0x20611f(0x1d1)&&_0x36f043[_0x20611f(0x210)]('@lovrabet/dataset-mcp-server'))&&_0x54b767[_0x20611f(0x22e)](_0x220920);}for(const _0x133df3 of _0x54b767){delete _0x15d2f8[_0x20611f(0x1de)][_0x133df3];}return _0x54b767[_0x20611f(0x1e7)]>0x0&&writeFileSync(_0x56c4d8['oldMcpConfig'][_0x20611f(0x203)],JSON[_0x20611f(0x1e5)](_0x15d2f8,null,0x2)+'\x0a',_0x20611f(0x1ec)),{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':_0x20611f(0x1f7)+_0x54b767[_0x20611f(0x22b)](',\x20')+_0x20611f(0x242)+_0x56c4d8[_0x20611f(0x24a)][_0x20611f(0x203)]};}return{'step':0x4,'label':_0x20611f(0x1ea),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x44021c){return{'step':0x4,'label':_0x20611f(0x1ea),'ok':![],'detail':_0x44021c['message']};}}function execSkillsRemove(_0x1ec285,_0x3343d4){const _0xa5bfe8=a191_0x56c7b3,_0x493ba1=runNpxSkillsRemove(_0x1ec285,{'stdio':_0xa5bfe8(0x21b),'yes':_0x3343d4});return{'step':0x5,'label':_0xa5bfe8(0x232),'ok':_0x493ba1['ok'],'detail':_0x493ba1['ok']?_0xa5bfe8(0x1eb):_0x493ba1[_0xa5bfe8(0x220)]??_0xa5bfe8(0x1cf)+_0x493ba1[_0xa5bfe8(0x201)]};}function execSkillsAdd(_0x131e40,_0x32e5fe){const _0x45d85c=a191_0x56c7b3,_0x4e5cae=runNpxSkillsAddGlobal(_0x131e40,'lovrabet/rabetbase',{'stdio':_0x45d85c(0x21b),'yes':_0x32e5fe});return{'step':0x6,'label':_0x45d85c(0x22c),'ok':_0x4e5cae['ok'],'detail':_0x4e5cae['ok']?_0x45d85c(0x248):_0x4e5cae['error']??_0x45d85c(0x1cf)+_0x4e5cae[_0x45d85c(0x201)]};}function execUpgradeSdk(_0x395a20){const _0x246262=a191_0x56c7b3;if(!_0x395a20[_0x246262(0x1ff)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x246262(0x23d)};const {pkgPath:_0x386dcc,currentVersion:_0x2aaa58,field:_0xe990ab}=_0x395a20[_0x246262(0x1ff)];try{const _0x4e517c=readFileSync(_0x386dcc,_0x246262(0x1ec)),_0x2546e8=JSON[_0x246262(0x24e)](_0x4e517c);return _0x2546e8[_0xe990ab][_0x246262(0x211)]=_0x246262(0x24d),writeFileSync(_0x386dcc,JSON['stringify'](_0x2546e8,null,0x2)+'\x0a',_0x246262(0x1ec)),{'step':0x7,'label':_0x246262(0x239),'ok':!![],'detail':_0xe990ab+'[\x22@lovrabet/sdk\x22]:\x20'+_0x2aaa58+'\x20→\x20latest'};}catch(_0x478826){return{'step':0x7,'label':_0x246262(0x239),'ok':![],'detail':_0x478826[_0x246262(0x227)]};}}function tryStat(_0x1bfc6b){try{return statSync(_0x1bfc6b);}catch{return undefined;}}function a191_0x14b0(_0x2d59dd,_0x1946c0){_0x2d59dd=_0x2d59dd-0x1cf;const _0x4c127d=a191_0x4c12();let _0x14b000=_0x4c127d[_0x2d59dd];return _0x14b000;}function printSummary(_0x5d13c2){const _0x2254fe=a191_0x56c7b3;console[_0x2254fe(0x1d5)](''),console['log'](a191_0x56ef4e[_0x2254fe(0x222)](_0x2254fe(0x213))),console[_0x2254fe(0x1d5)]('');for(const _0x4e89b0 of _0x5d13c2){const _0x5224e7=_0x4e89b0['ok']?a191_0x56ef4e[_0x2254fe(0x1fc)]('OK'):a191_0x56ef4e[_0x2254fe(0x22f)]('FAIL');console[_0x2254fe(0x1d5)]('\x20\x20'+_0x5224e7+_0x2254fe(0x205)+_0x4e89b0[_0x2254fe(0x1f4)]+':\x20'+_0x4e89b0[_0x2254fe(0x20d)]);if(_0x4e89b0['detail'])console['log'](_0x2254fe(0x20f)+a191_0x56ef4e[_0x2254fe(0x1d2)](_0x4e89b0['detail']));}console[_0x2254fe(0x1d5)]('');}export async function upgradeApp(_0x35da62,_0x331380){const _0xe3c05b=a191_0x56c7b3,_0x11effd=process[_0xe3c05b(0x206)](),_0x5768a2=analyse(_0x11effd),_0x49ef70=!_0x5768a2['configMigration']&&_0x5768a2[_0xe3c05b(0x1d4)][_0xe3c05b(0x1e7)]===0x0&&!_0x5768a2['oldMcpConfig']&&!_0x5768a2['needsSkillSwap']&&!_0x5768a2[_0xe3c05b(0x1ff)];if(_0x49ef70){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fc)](_0xe3c05b(0x200)));return;}printReport(_0x5768a2);const _0x299c24=!!(_0x331380['yes']||_0x331380['Y']||_0x35da62);if(!_0x299c24)try{const _0x133f10=await askConfirm(_0xe3c05b(0x216));if(!_0x133f10){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1d2)](_0xe3c05b(0x230)));return;}}catch(_0x33f0bc){if(_0x33f0bc?.['message']===_0xe3c05b(0x1d0)){console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1d2)](_0xe3c05b(0x230)));return;}throw _0x33f0bc;}const _0x56d2e3=[],_0x3b0623=a191_0x900295({'text':_0xe3c05b(0x202),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x25e62c=execConfigMigration(_0x5768a2,_0x11effd);_0x56d2e3[_0xe3c05b(0x22e)](_0x25e62c),_0x3b0623[_0x25e62c['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x228)+(_0x25e62c['detail']??(_0x25e62c['ok']?'done':_0xe3c05b(0x249))));const _0x293b5e=resolve(_0x11effd,'.lovrabet'),_0x5273be=a191_0x900295({'text':_0xe3c05b(0x218),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)]();if(existsSync(_0x293b5e))try{rmSync(_0x293b5e,{'recursive':!![],'force':!![]}),_0x5273be[_0xe3c05b(0x226)](_0xe3c05b(0x224)),_0x56d2e3[_0xe3c05b(0x22e)]({'step':0x2,'label':_0xe3c05b(0x24c),'ok':!![]});}catch(_0x40fc93){_0x5273be[_0xe3c05b(0x235)](_0xe3c05b(0x1ed)+_0x40fc93[_0xe3c05b(0x227)]),_0x56d2e3[_0xe3c05b(0x22e)]({'step':0x2,'label':_0xe3c05b(0x24c),'ok':![],'detail':_0x40fc93[_0xe3c05b(0x227)]});}else _0x5273be[_0xe3c05b(0x23c)](_0xe3c05b(0x21d)),_0x56d2e3['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0xe3c05b(0x1d7)});const _0x146522=a191_0x900295({'text':_0xe3c05b(0x1d9),'color':_0xe3c05b(0x219)})['start'](),_0x41a75c=execRemoveOldArtifacts(_0x5768a2['oldArtifacts']);_0x56d2e3[_0xe3c05b(0x22e)](_0x41a75c),_0x146522[_0x41a75c['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x1e1)+(_0x41a75c[_0xe3c05b(0x1db)]??(_0x41a75c['ok']?'done':_0xe3c05b(0x249))));const _0x51f511=a191_0x900295({'text':_0xe3c05b(0x1f2),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x39fe53=execCleanMcp(_0x5768a2);_0x56d2e3[_0xe3c05b(0x22e)](_0x39fe53),_0x51f511[_0x39fe53['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)](_0xe3c05b(0x1d6)+(_0x39fe53[_0xe3c05b(0x1db)]??(_0x39fe53['ok']?'done':'failed')));const _0xeb7459=a191_0x900295({'text':_0xe3c05b(0x1f1),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x15bdb2=execSkillsRemove(_0x11effd,_0x299c24);_0x56d2e3[_0xe3c05b(0x22e)](_0x15bdb2),_0xeb7459[_0x15bdb2['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x15bdb2['detail']??(_0x15bdb2['ok']?_0xe3c05b(0x1fe):'failed')));const _0x3ed903=a191_0x900295({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':'cyan'})[_0xe3c05b(0x212)](),_0x5e0bf7=execSkillsAdd(_0x11effd,_0x299c24);_0x56d2e3['push'](_0x5e0bf7),_0x3ed903[_0x5e0bf7['ok']?_0xe3c05b(0x226):'fail'](_0xe3c05b(0x243)+(_0x5e0bf7[_0xe3c05b(0x1db)]??(_0x5e0bf7['ok']?_0xe3c05b(0x1fe):_0xe3c05b(0x249))));const _0x359a7d=a191_0x900295({'text':_0xe3c05b(0x1f0),'color':_0xe3c05b(0x219)})[_0xe3c05b(0x212)](),_0x1e0525=execUpgradeSdk(_0x5768a2);_0x56d2e3[_0xe3c05b(0x22e)](_0x1e0525),_0x359a7d[_0x1e0525['ok']?_0xe3c05b(0x226):_0xe3c05b(0x235)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x1e0525[_0xe3c05b(0x1db)]??(_0x1e0525['ok']?'done':_0xe3c05b(0x249)))),printSummary(_0x56d2e3);const _0x5e12b8=_0x56d2e3[_0xe3c05b(0x20a)](_0xe4aa47=>!_0xe4aa47['ok']);_0x5e12b8?console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x221)](_0xe3c05b(0x22a))):console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fc)](_0xe3c05b(0x1f6))),_0x1e0525['ok']&&_0x5768a2[_0xe3c05b(0x1ff)]&&(console[_0xe3c05b(0x1d5)](''),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x222)]['cyan'](_0xe3c05b(0x1fd))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x219)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0xe3c05b(0x1d5)](''),console['log'](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x1ef))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x21a))),console[_0xe3c05b(0x1d5)](a191_0x56ef4e[_0xe3c05b(0x1fa)](_0xe3c05b(0x237))),console[_0xe3c05b(0x1d5)](''));}
1
+ const a190_0x352005=a190_0x24c2;(function(_0x5346b6,_0x307ea9){const _0x4675b1=a190_0x24c2,_0x4adc4b=_0x5346b6();while(!![]){try{const _0x48889e=parseInt(_0x4675b1(0xd1))/0x1+-parseInt(_0x4675b1(0xe1))/0x2+parseInt(_0x4675b1(0x100))/0x3*(-parseInt(_0x4675b1(0xec))/0x4)+parseInt(_0x4675b1(0x97))/0x5*(-parseInt(_0x4675b1(0x8a))/0x6)+parseInt(_0x4675b1(0xc0))/0x7+-parseInt(_0x4675b1(0xca))/0x8+parseInt(_0x4675b1(0xdf))/0x9;if(_0x48889e===_0x307ea9)break;else _0x4adc4b['push'](_0x4adc4b['shift']());}catch(_0x593203){_0x4adc4b['push'](_0x4adc4b['shift']());}}}(a190_0x3429,0xaceed));import a190_0x52a7b6 from'chalk';import a190_0xd85a8e from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a190_0x24c2(_0x234748,_0x5b352e){_0x234748=_0x234748-0x87;const _0x34290d=a190_0x3429();let _0x24c2f5=_0x34290d[_0x234748];return _0x24c2f5;}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=[a190_0x352005(0xf5),a190_0x352005(0xcd)];function collectIdeSkillFiles(_0x8a8f77){const _0x25ea8b=a190_0x352005,_0xf3c556=[];for(const _0x38596a of Object[_0x25ea8b(0xf3)](CORE_IDE_CONFIGS)){if(_0x38596a[_0x25ea8b(0xea)])for(const _0x2fd233 of _0x38596a[_0x25ea8b(0xea)]){_0xf3c556[_0x25ea8b(0xc2)](resolve(_0x8a8f77,_0x2fd233[_0x25ea8b(0xb2)]));}}return _0xf3c556;}function a190_0x3429(){const _0x45cf95=['Upgrade\x20@lovrabet/sdk','latest','1174789nhzigJ','Install\x20new\x20skill','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','done','Config\x20file:','@lovrabet/sdk','yellow','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','includes','stringify','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','keys','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','1855278bHpeCM','===\x20Upgrade\x20Analysis\x20===','570476KmrHbI','isArray','devDependencies','status','cwd','removed\x20','@lovrabet/sdk:','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','isDirectory','files','no\x20legacy\x20entry','966796HVIKRL','step','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','failed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Config\x20migration','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','values','red','.lovrabet.json','some','.cursor/mcp.json','[\x22@lovrabet/sdk\x22]:\x20','length','Clean\x20MCP\x20config','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','parse','start','no\x20legacy\x20config\x20found','needsSkillSwap','3nvjnHV','info','.claude/skills/lovrabet','\x20\x20#\x20or','752724QvNLDp','MCP\x20config:','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Upgrade\x20cancelled.','\x20\x20New\x20config\x20(.rabetbase.json):\x20','dependencies','gray','Step\x206/7:\x20Installing\x20new\x20skill...','Upgrade\x20completed\x20successfully!','oldPath','\x20\x20Action:\x20delete','oldMcpConfig','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','55VoCNLq','.cursor/rules/lovrabet_rules.mdc','Legacy\x20artifacts:','not\x20found\x20or\x20already\x20at\x20latest','log','label','Remove\x20.lovrabet/','not\x20needed','entries','oldArtifacts','bold','\x20→\x20','join','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','not\x20found\x20(will\x20create)','Remove\x20legacy\x20artifacts','inherit','args','hasNewConfig','green','message','\x20\x20npm\x20install','Step\x204/7:\x20MCP\x20config\x20—\x20','\x20(backup:\x20','.bak','yes','fields','path','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','string','.lovrabet','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','utf8','exit\x20','sdkUpgrade','FAIL','cyan','detail','Step\x205/7:\x20Removing\x20old\x20skill...','object','Step\x204/7:\x20Cleaning\x20MCP\x20config...','9467528PMEexx','mcpServers','push','\x20\x20Fields\x20to\x20migrate:\x20','\x20→\x20keys:\x20','succeed','\x20→\x20latest','fail','error','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','945368Ltvoht','\x20\x20Current\x20version\x20in\x20','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','.lovrabetrc','white'];a190_0x3429=function(){return _0x45cf95;};return a190_0x3429();}function analyse(_0x19449d){const _0x198fd9=a190_0x352005;let _0x1535c4=null;const _0x35fe68=resolve(_0x19449d,NEW_CONFIG_NAME),_0x5925ee=existsSync(_0x35fe68);for(const _0x1d57e0 of LEGACY_CONFIG_NAMES){const _0x36fb9d=resolve(_0x19449d,_0x1d57e0);if(existsSync(_0x36fb9d)){const _0x31144d=readConfigFile(_0x36fb9d),_0x5e4c64=Object['keys'](_0x31144d)['filter'](_0x1b5b9e=>typeof _0x31144d[_0x1b5b9e]!=='undefined');_0x1535c4={'oldPath':_0x36fb9d,'hasNewConfig':_0x5925ee,'fields':_0x5e4c64};break;}}const _0x39ecdc=[],_0x2b4210=resolve(_0x19449d,_0x198fd9(0xb5));if(existsSync(_0x2b4210))_0x39ecdc[_0x198fd9(0xc2)](_0x2b4210);const _0x507d41=resolve(_0x19449d,_0x198fd9(0x98));if(existsSync(_0x507d41))_0x39ecdc['push'](_0x507d41);const _0x29fbff=resolve(_0x19449d,_0x198fd9(0x88));if(existsSync(_0x29fbff))_0x39ecdc[_0x198fd9(0xc2)](_0x29fbff);for(const _0x485ef0 of collectIdeSkillFiles(_0x19449d)){if(existsSync(_0x485ef0))_0x39ecdc[_0x198fd9(0xc2)](_0x485ef0);}let _0x447792=null;const _0x328784=resolve(_0x19449d,_0x198fd9(0xf7));if(existsSync(_0x328784))try{const _0x14f94f=JSON[_0x198fd9(0xfc)](readFileSync(_0x328784,_0x198fd9(0xb7)));if(_0x14f94f?.[_0x198fd9(0xc1)]&&typeof _0x14f94f['mcpServers']===_0x198fd9(0xbe)){const _0x88fabb=[];for(const [_0x90d99c,_0x59aa4]of Object[_0x198fd9(0x9f)](_0x14f94f['mcpServers'])){const _0x59ea7b=_0x59aa4;_0x59ea7b?.[_0x198fd9(0xa8)]&&Array[_0x198fd9(0xe2)](_0x59ea7b[_0x198fd9(0xa8)])&&_0x59ea7b[_0x198fd9(0xa8)]['some'](_0x32e3ec=>typeof _0x32e3ec===_0x198fd9(0xb4)&&_0x32e3ec[_0x198fd9(0xd9)]('@lovrabet/dataset-mcp-server'))&&_0x88fabb[_0x198fd9(0xc2)](_0x90d99c);}_0x88fabb[_0x198fd9(0xf9)]>0x0&&(_0x447792={'path':_0x328784,'keys':_0x88fabb});}}catch{}const _0x6619bd=_0x39ecdc[_0x198fd9(0xf9)]>0x0||_0x1535c4!==null;let _0x22f7ab=null;const _0x3f7de6=resolve(_0x19449d,'package.json');if(existsSync(_0x3f7de6))try{const _0x1bada1=JSON['parse'](readFileSync(_0x3f7de6,_0x198fd9(0xb7)));for(const _0x537e3b of[_0x198fd9(0x8f),_0x198fd9(0xe3)]){const _0x9b16bb=_0x1bada1?.[_0x537e3b]?.['@lovrabet/sdk'];if(typeof _0x9b16bb==='string'){_0x9b16bb!==_0x198fd9(0xd0)&&(_0x22f7ab={'pkgPath':_0x3f7de6,'currentVersion':_0x9b16bb,'field':_0x537e3b});break;}}}catch{}return{'configMigration':_0x1535c4,'oldArtifacts':_0x39ecdc,'oldMcpConfig':_0x447792,'needsSkillSwap':_0x6619bd,'sdkUpgrade':_0x22f7ab};}function printReport(_0x126e54){const _0x41a66b=a190_0x352005,{configMigration:_0xbd0f40,oldArtifacts:_0x529215,oldMcpConfig:_0x1d5cfc,needsSkillSwap:_0x51893e}=_0x126e54;console[_0x41a66b(0x9b)](''),console[_0x41a66b(0x9b)](a190_0x52a7b6[_0x41a66b(0xa1)](_0x41a66b(0xe0))),console[_0x41a66b(0x9b)]('');_0xbd0f40?(console[_0x41a66b(0x9b)](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0xd5))+('\x20\x20'+a190_0x52a7b6[_0x41a66b(0xd7)](_0xbd0f40[_0x41a66b(0x93)]))),console['log'](_0x41a66b(0x8e)+(_0xbd0f40[_0x41a66b(0xa9)]?a190_0x52a7b6[_0x41a66b(0xaa)]('already\x20exists\x20(will\x20merge)'):a190_0x52a7b6[_0x41a66b(0x90)](_0x41a66b(0xa5)))),console[_0x41a66b(0x9b)](_0x41a66b(0xc3)+_0xbd0f40[_0x41a66b(0xb1)]['join'](',\x20')),console[_0x41a66b(0x9b)](_0x41a66b(0xd8))):console[_0x41a66b(0x9b)](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0xd5))+'\x20\x20'+a190_0x52a7b6[_0x41a66b(0x90)](_0x41a66b(0xfe)));console[_0x41a66b(0x9b)]('');if(_0x529215[_0x41a66b(0xf9)]>0x0){console[_0x41a66b(0x9b)](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0x99)));for(const _0x529366 of _0x529215){console[_0x41a66b(0x9b)]('\x20\x20'+a190_0x52a7b6[_0x41a66b(0xf4)]('FOUND')+'\x20\x20'+_0x529366);}console[_0x41a66b(0x9b)](_0x41a66b(0x94));}else console[_0x41a66b(0x9b)](a190_0x52a7b6['cyan'](_0x41a66b(0x99))+'\x20\x20'+a190_0x52a7b6[_0x41a66b(0x90)]('none\x20found'));console['log']('');_0x1d5cfc?(console['log'](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0x8b))+('\x20\x20'+a190_0x52a7b6[_0x41a66b(0xd7)](_0x1d5cfc[_0x41a66b(0xb2)])+_0x41a66b(0xc4)+_0x1d5cfc[_0x41a66b(0xdc)][_0x41a66b(0xa3)](',\x20'))),console['log'](_0x41a66b(0xb3))):console['log'](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0x8b))+'\x20\x20'+a190_0x52a7b6[_0x41a66b(0x90)](_0x41a66b(0xeb)));console[_0x41a66b(0x9b)](''),console[_0x41a66b(0x9b)](a190_0x52a7b6[_0x41a66b(0xbb)]('Skill\x20swap:')+('\x20\x20'+(_0x51893e?a190_0x52a7b6[_0x41a66b(0xd7)]('needed'):a190_0x52a7b6['green'](_0x41a66b(0x9e)))));_0x51893e&&console[_0x41a66b(0x9b)](_0x41a66b(0x8c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x41a66b(0x9b)]('');if(_0x126e54[_0x41a66b(0xb9)]){const {currentVersion:_0x3cdb66,field:_0x423dbd,pkgPath:_0x546752}=_0x126e54[_0x41a66b(0xb9)];console['log'](a190_0x52a7b6[_0x41a66b(0xbb)](_0x41a66b(0xe7))+('\x20\x20'+a190_0x52a7b6[_0x41a66b(0xd7)](_0x546752))),console['log'](_0x41a66b(0xcb)+_0x423dbd+':\x20'+a190_0x52a7b6[_0x41a66b(0xd7)](_0x3cdb66)+_0x41a66b(0xa2)+a190_0x52a7b6['green'](_0x41a66b(0xd0))),console[_0x41a66b(0x9b)](_0x41a66b(0xde));}else console['log'](a190_0x52a7b6[_0x41a66b(0xbb)]('@lovrabet/sdk:')+'\x20\x20'+a190_0x52a7b6[_0x41a66b(0x90)](_0x41a66b(0x9a)));console[_0x41a66b(0x9b)]('');}function execConfigMigration(_0x182bb8,_0x3e8f88){const _0x468b6a=a190_0x352005,{configMigration:_0x17ccfe}=_0x182bb8;if(!_0x17ccfe?.[_0x468b6a(0x93)])return{'step':0x1,'label':_0x468b6a(0xf1),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x43e05f=readConfigFile(_0x17ccfe[_0x468b6a(0x93)]),_0x18b22c=resolve(_0x3e8f88,NEW_CONFIG_NAME),_0x2de474=_0x17ccfe[_0x468b6a(0xa9)]?readConfigFile(_0x18b22c):{};for(const [_0x161885,_0x3c05db]of Object[_0x468b6a(0x9f)](_0x43e05f)){!(_0x161885 in _0x2de474)&&(_0x2de474[_0x161885]=_0x3c05db);}writeConfigFile(_0x18b22c,_0x2de474);const _0x2ea930=_0x17ccfe['oldPath']+_0x468b6a(0xaf);return renameSync(_0x17ccfe[_0x468b6a(0x93)],_0x2ea930),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x17ccfe['oldPath']+_0x468b6a(0xa2)+_0x18b22c+_0x468b6a(0xae)+_0x2ea930+')'};}function execRemoveOldArtifacts(_0x1398fe){const _0x5a2876=a190_0x352005,_0x4a121c=[];for(const _0x555116 of _0x1398fe){try{if(!existsSync(_0x555116))continue;const _0xa195ad=tryStat(_0x555116);_0xa195ad?.[_0x5a2876(0xe9)]()?rmSync(_0x555116,{'recursive':!![],'force':!![]}):unlinkSync(_0x555116);}catch(_0x5d573b){_0x4a121c[_0x5a2876(0xc2)](_0x555116+':\x20'+_0x5d573b[_0x5a2876(0xab)]);}}return{'step':0x3,'label':_0x5a2876(0xa6),'ok':_0x4a121c['length']===0x0,'detail':_0x4a121c[_0x5a2876(0xf9)]>0x0?_0x1398fe[_0x5a2876(0xf9)]-_0x4a121c[_0x5a2876(0xf9)]+'/'+_0x1398fe[_0x5a2876(0xf9)]+'\x20removed\x20('+_0x4a121c[_0x5a2876(0xa3)](';\x20')+')':_0x1398fe[_0x5a2876(0xf9)]+'\x20removed'};}function execCleanMcp(_0x34c5bd){const _0x17981a=a190_0x352005;if(!_0x34c5bd[_0x17981a(0x95)])return{'step':0x4,'label':_0x17981a(0xfa),'ok':!![],'detail':'skipped'};try{const _0x54a469=readFileSync(_0x34c5bd[_0x17981a(0x95)]['path'],_0x17981a(0xb7)),_0x370abb=JSON['parse'](_0x54a469);if(_0x370abb?.['mcpServers']&&typeof _0x370abb[_0x17981a(0xc1)]===_0x17981a(0xbe)){const _0x15c192=[];for(const [_0x73b9bb,_0x16afe0]of Object[_0x17981a(0x9f)](_0x370abb[_0x17981a(0xc1)])){_0x16afe0?.[_0x17981a(0xa8)]&&Array[_0x17981a(0xe2)](_0x16afe0[_0x17981a(0xa8)])&&_0x16afe0[_0x17981a(0xa8)][_0x17981a(0xf6)](_0x14813=>typeof _0x14813===_0x17981a(0xb4)&&_0x14813[_0x17981a(0xd9)]('@lovrabet/dataset-mcp-server'))&&_0x15c192[_0x17981a(0xc2)](_0x73b9bb);}for(const _0x38c7c7 of _0x15c192){delete _0x370abb['mcpServers'][_0x38c7c7];}return _0x15c192['length']>0x0&&writeFileSync(_0x34c5bd[_0x17981a(0x95)]['path'],JSON[_0x17981a(0xda)](_0x370abb,null,0x2)+'\x0a',_0x17981a(0xb7)),{'step':0x4,'label':_0x17981a(0xfa),'ok':!![],'detail':_0x17981a(0xe6)+_0x15c192[_0x17981a(0xa3)](',\x20')+'\x20from\x20'+_0x34c5bd[_0x17981a(0x95)][_0x17981a(0xb2)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x48ca3b){return{'step':0x4,'label':_0x17981a(0xfa),'ok':![],'detail':_0x48ca3b[_0x17981a(0xab)]};}}function execSkillsRemove(_0x4a7c75,_0x2b57cc){const _0x146e70=a190_0x352005,_0x28b88b=runNpxSkillsRemove(_0x4a7c75,{'stdio':'inherit','yes':_0x2b57cc});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x28b88b['ok'],'detail':_0x28b88b['ok']?'lovrabet/lovrabet-skill\x20removed':_0x28b88b[_0x146e70(0xc8)]??_0x146e70(0xb8)+_0x28b88b[_0x146e70(0xe4)]};}function execSkillsAdd(_0x41c3de,_0x32069d){const _0x4f8d79=a190_0x352005,_0x3dc78b=runNpxSkillsAddGlobal(_0x41c3de,'lovrabet/rabetbase',{'stdio':_0x4f8d79(0xa7),'yes':_0x32069d});return{'step':0x6,'label':_0x4f8d79(0xd2),'ok':_0x3dc78b['ok'],'detail':_0x3dc78b['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x3dc78b[_0x4f8d79(0xc8)]??_0x4f8d79(0xb8)+_0x3dc78b['status']};}function execUpgradeSdk(_0x3ce974){const _0x19e93a=a190_0x352005;if(!_0x3ce974[_0x19e93a(0xb9)])return{'step':0x7,'label':_0x19e93a(0xcf),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x30b3c9,currentVersion:_0x3a0ee3,field:_0x20b836}=_0x3ce974['sdkUpgrade'];try{const _0x5082e1=readFileSync(_0x30b3c9,_0x19e93a(0xb7)),_0x573f2d=JSON[_0x19e93a(0xfc)](_0x5082e1);return _0x573f2d[_0x20b836][_0x19e93a(0xd6)]=_0x19e93a(0xd0),writeFileSync(_0x30b3c9,JSON[_0x19e93a(0xda)](_0x573f2d,null,0x2)+'\x0a',_0x19e93a(0xb7)),{'step':0x7,'label':_0x19e93a(0xcf),'ok':!![],'detail':_0x20b836+_0x19e93a(0xf8)+_0x3a0ee3+_0x19e93a(0xc6)};}catch(_0x1d4a14){return{'step':0x7,'label':_0x19e93a(0xcf),'ok':![],'detail':_0x1d4a14[_0x19e93a(0xab)]};}}function tryStat(_0x10ae85){try{return statSync(_0x10ae85);}catch{return undefined;}}function printSummary(_0x52f307){const _0x449458=a190_0x352005;console['log'](''),console[_0x449458(0x9b)](a190_0x52a7b6[_0x449458(0xa1)]('===\x20Upgrade\x20Summary\x20===')),console[_0x449458(0x9b)]('');for(const _0x44c6ce of _0x52f307){const _0x251a53=_0x44c6ce['ok']?a190_0x52a7b6[_0x449458(0xaa)]('OK'):a190_0x52a7b6[_0x449458(0xf4)](_0x449458(0xba));console[_0x449458(0x9b)]('\x20\x20'+_0x251a53+'\x20\x20Step\x20'+_0x44c6ce[_0x449458(0xed)]+':\x20'+_0x44c6ce[_0x449458(0x9c)]);if(_0x44c6ce[_0x449458(0xbc)])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a190_0x52a7b6[_0x449458(0x90)](_0x44c6ce[_0x449458(0xbc)]));}console[_0x449458(0x9b)]('');}export async function upgradeApp(_0x33598b,_0x14f240){const _0x369028=a190_0x352005,_0xc2560b=process[_0x369028(0xe5)](),_0x2b549d=analyse(_0xc2560b),_0x435477=!_0x2b549d['configMigration']&&_0x2b549d[_0x369028(0xa0)][_0x369028(0xf9)]===0x0&&!_0x2b549d['oldMcpConfig']&&!_0x2b549d[_0x369028(0xff)]&&!_0x2b549d['sdkUpgrade'];if(_0x435477){console['log'](a190_0x52a7b6[_0x369028(0xaa)](_0x369028(0xcc)));return;}printReport(_0x2b549d);const _0x29e22a=!!(_0x14f240[_0x369028(0xb0)]||_0x14f240['Y']||_0x33598b);if(!_0x29e22a)try{const _0x35840a=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x35840a){console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0x90)](_0x369028(0x8d)));return;}}catch(_0x6fc536){if(_0x6fc536?.['message']==='CANCEL'){console[_0x369028(0x9b)](a190_0x52a7b6['gray'](_0x369028(0x8d)));return;}throw _0x6fc536;}const _0x27746c=[],_0x17de8f=a190_0xd85a8e({'text':'Step\x201/7:\x20Migrating\x20config...','color':'cyan'})['start'](),_0x2ff891=execConfigMigration(_0x2b549d,_0xc2560b);_0x27746c['push'](_0x2ff891),_0x17de8f[_0x2ff891['ok']?_0x369028(0xc5):_0x369028(0xc7)](_0x369028(0xdd)+(_0x2ff891[_0x369028(0xbc)]??(_0x2ff891['ok']?_0x369028(0xd4):_0x369028(0xef))));const _0x13d36d=resolve(_0xc2560b,_0x369028(0xb5)),_0x1d6b22=a190_0xd85a8e({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0x369028(0xbb)})['start']();if(existsSync(_0x13d36d))try{rmSync(_0x13d36d,{'recursive':!![],'force':!![]}),_0x1d6b22[_0x369028(0xc5)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x27746c[_0x369028(0xc2)]({'step':0x2,'label':_0x369028(0x9d),'ok':!![]});}catch(_0x19ceb5){_0x1d6b22[_0x369028(0xc7)](_0x369028(0xc9)+_0x19ceb5[_0x369028(0xab)]),_0x27746c[_0x369028(0xc2)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x19ceb5[_0x369028(0xab)]});}else _0x1d6b22[_0x369028(0x87)](_0x369028(0x96)),_0x27746c[_0x369028(0xc2)]({'step':0x2,'label':_0x369028(0x9d),'ok':!![],'detail':'skipped'});const _0x1c49bb=a190_0xd85a8e({'text':_0x369028(0xa4),'color':'cyan'})[_0x369028(0xfd)](),_0x102120=execRemoveOldArtifacts(_0x2b549d[_0x369028(0xa0)]);_0x27746c[_0x369028(0xc2)](_0x102120),_0x1c49bb[_0x102120['ok']?_0x369028(0xc5):_0x369028(0xc7)](_0x369028(0xb6)+(_0x102120[_0x369028(0xbc)]??(_0x102120['ok']?_0x369028(0xd4):_0x369028(0xef))));const _0xc01cb7=a190_0xd85a8e({'text':_0x369028(0xbf),'color':'cyan'})[_0x369028(0xfd)](),_0x5da8e7=execCleanMcp(_0x2b549d);_0x27746c[_0x369028(0xc2)](_0x5da8e7),_0xc01cb7[_0x5da8e7['ok']?'succeed':'fail'](_0x369028(0xad)+(_0x5da8e7[_0x369028(0xbc)]??(_0x5da8e7['ok']?_0x369028(0xd4):_0x369028(0xef))));const _0x561031=a190_0xd85a8e({'text':_0x369028(0xbd),'color':_0x369028(0xbb)})[_0x369028(0xfd)](),_0x12b23e=execSkillsRemove(_0xc2560b,_0x29e22a);_0x27746c[_0x369028(0xc2)](_0x12b23e),_0x561031[_0x12b23e['ok']?'succeed':'fail'](_0x369028(0xfb)+(_0x12b23e['detail']??(_0x12b23e['ok']?_0x369028(0xd4):_0x369028(0xef))));const _0x35fdb1=a190_0xd85a8e({'text':_0x369028(0x91),'color':'cyan'})[_0x369028(0xfd)](),_0xcaedf7=execSkillsAdd(_0xc2560b,_0x29e22a);_0x27746c[_0x369028(0xc2)](_0xcaedf7),_0x35fdb1[_0xcaedf7['ok']?_0x369028(0xc5):_0x369028(0xc7)](_0x369028(0xd3)+(_0xcaedf7[_0x369028(0xbc)]??(_0xcaedf7['ok']?_0x369028(0xd4):'failed')));const _0x4402c2=a190_0xd85a8e({'text':_0x369028(0xe8),'color':_0x369028(0xbb)})[_0x369028(0xfd)](),_0x4ab13f=execUpgradeSdk(_0x2b549d);_0x27746c['push'](_0x4ab13f),_0x4402c2[_0x4ab13f['ok']?_0x369028(0xc5):_0x369028(0xc7)](_0x369028(0xdb)+(_0x4ab13f[_0x369028(0xbc)]??(_0x4ab13f['ok']?_0x369028(0xd4):'failed'))),printSummary(_0x27746c);const _0x36947f=_0x27746c[_0x369028(0xf6)](_0x881ec6=>!_0x881ec6['ok']);_0x36947f?console['log'](a190_0x52a7b6[_0x369028(0xd7)](_0x369028(0xee))):console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xaa)](_0x369028(0x92))),_0x4ab13f['ok']&&_0x2b549d[_0x369028(0xb9)]&&(console[_0x369028(0x9b)](''),console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xa1)][_0x369028(0xbb)](_0x369028(0xf2))),console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xbb)](_0x369028(0xf0))),console['log'](''),console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xce)](_0x369028(0xac))),console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xce)](_0x369028(0x89))),console[_0x369028(0x9b)](a190_0x52a7b6[_0x369028(0xce)]('\x20\x20bun\x20install')),console[_0x369028(0x9b)](''));}