@lovrabet/rabetbase-cli 2.4.7 → 2.5.0-beta.2
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.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.d.ts +13 -3
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.d.ts +7 -0
- package/lib/api/generate-sdk-config-file.js +1 -0
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +2 -5
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.d.ts +5 -0
- package/lib/commands/config/delete.js +1 -0
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +12 -0
- package/lib/commands/config/init.js +1 -0
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.d.ts +1 -0
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.d.ts +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.d.ts +2 -2
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.d.ts +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.d.ts +10 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +3 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.d.ts +23 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.d.ts +9 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.d.ts +4 -6
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +2 -2
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +2 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.d.ts +11 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +2 -2
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/types/index.d.ts +28 -0
- package/lib/utils/ai_config.d.ts +1 -2
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -3
- package/skills/rabetbase/SKILL.md +33 -28
- package/skills/rabetbase/guides/backend-function.md +41 -12
- package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
- package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
- package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
- package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
- package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
- package/skills/rabetbase/guides/troubleshooting.md +1 -1
- package/skills/rabetbase/guides/typescript-sdk.md +46 -10
- package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
- package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
- package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
- package/skills/rabetbase/references/rabetbase-config.md +75 -30
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +17 -6
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
- package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
- package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +57 -51
- package/skills/rabetbase/references/rabetbase-kb.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
- package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
- package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
- package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
- package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
- package/skills/rabetbase.manifest.json +4 -3
- package/templates/README.md +17 -28
- package/templates/generate-api/api.ts.tpl +3 -3
- package/templates/generate-api/client.ts.tpl +10 -37
- package/lib/commands/data/filter.d.ts +0 -7
- package/lib/commands/data/filter.js +0 -1
- package/lib/commands/data/getOne.d.ts +0 -7
- package/lib/commands/data/getOne.js +0 -1
- package/lib/commands/data/index.d.ts +0 -8
- package/lib/commands/data/index.js +0 -1
- package/lib/commands/data/shared.d.ts +0 -33
- package/lib/commands/data/shared.js +0 -1
- package/lib/commands/init/index.d.ts +0 -11
- package/lib/commands/init/index.js +0 -1
- package/lib/utils/rules-cdn.d.ts +0 -38
- package/lib/utils/rules-cdn.js +0 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
- package/templates/skill/SKILL.md.tpl +0 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x57fd4b,_0x5c6140){const _0x273cb8=a160_0x21ef,_0x2696a1=_0x57fd4b();while(!![]){try{const _0x1224f9=-parseInt(_0x273cb8(0x131))/0x1+-parseInt(_0x273cb8(0x14b))/0x2*(parseInt(_0x273cb8(0x14a))/0x3)+-parseInt(_0x273cb8(0x132))/0x4+parseInt(_0x273cb8(0x143))/0x5*(parseInt(_0x273cb8(0x141))/0x6)+parseInt(_0x273cb8(0x13c))/0x7+-parseInt(_0x273cb8(0x149))/0x8+parseInt(_0x273cb8(0x138))/0x9*(parseInt(_0x273cb8(0x13d))/0xa);if(_0x1224f9===_0x5c6140)break;else _0x2696a1['push'](_0x2696a1['shift']());}catch(_0x445056){_0x2696a1['push'](_0x2696a1['shift']());}}}(a160_0xf368,0x4cde6));function a160_0x21ef(_0x86623e,_0x340224){_0x86623e=_0x86623e-0x130;const _0xf3689=a160_0xf368();let _0x21ef97=_0xf3689[_0x86623e];return _0x21ef97;}import{existsSync}from'node:fs';import a160_0x15fd95 from'node:path';import a160_0x135c8f from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a160_0xf368(){const _0x46aafa=['5QQIgKS','Project\x20name:','√\x20App\x20Code:\x20','production','Skipped','trim','4660776LkTjXX','81vGgpTe','30156wjdnLR','\x22\x20already\x20exists','277305FjNpDa','1274204nIVQSo','√\x20Login\x20status:\x20','my-app','log','green','string','11377161sYNvtP','Not\x20set','cyan','Login\x20failed','1524152lhCpDr','10dNONWh','Directory\x20\x22','env','√\x20Project\x20Name:\x20','2511288fVdNSW','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?'];a160_0xf368=function(){return _0x46aafa;};return a160_0xf368();}import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x2741b7,_0x10cb41,_0x3f6881){const _0x48764a=a160_0x21ef,_0x5576c4=_0x48764a(0x134),_0x520e89=readConfig(),_0x133265=typeof _0x520e89[_0x48764a(0x13f)]===_0x48764a(0x137)?_0x520e89['env']:undefined,_0x348278=await input({'message':_0x48764a(0x144),'default':_0x5576c4,'validate':_0x41f562=>{const _0x3d91c1=_0x48764a,_0x43a5ac=_0x41f562[_0x3d91c1(0x148)]()||_0x5576c4,_0x554cce=getProjectNameValidationError(_0x43a5ac);if(_0x554cce)return _0x554cce;const _0x5aacb0=a160_0x15fd95['resolve'](process['cwd'](),_0x43a5ac);if(existsSync(_0x5aacb0))return _0x3d91c1(0x13e)+_0x43a5ac+_0x3d91c1(0x130);return!![];}});console[_0x48764a(0x135)](a160_0x135c8f[_0x48764a(0x136)](_0x48764a(0x140)+a160_0x135c8f['cyan'](_0x348278)));const _0xff0702=await selectSingleAppcode(_0x3f6881);console['log'](a160_0x135c8f[_0x48764a(0x136)](_0x48764a(0x145)+a160_0x135c8f[_0x48764a(0x13a)](_0xff0702||_0x48764a(0x139))));if(_0xff0702){const _0x438a59=await getIsSessionValid();if(!_0x438a59){const _0x49cd70=await confirm({'message':_0x48764a(0x142),'default':!![]});if(_0x49cd70){const _0xb7cecf=await authServer({'silent':!![]});console['log'](a160_0x135c8f[_0x48764a(0x136)](_0x48764a(0x133)+a160_0x135c8f['cyan'](_0xb7cecf?'Logged\x20in':_0x48764a(0x13b))));}else console[_0x48764a(0x135)](a160_0x135c8f['green'](_0x48764a(0x133)+a160_0x135c8f['cyan'](_0x48764a(0x147))));}await _0x2741b7({'projectName':_0x348278,'appCode':_0xff0702,'env':_0x10cb41||_0x133265||_0x48764a(0x146)});}else await _0x2741b7({'projectName':_0x348278,'env':_0x10cb41||_0x133265||_0x48764a(0x146)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a161_0x3ceb(_0x31cf01,_0x5ac18b){_0x31cf01=_0x31cf01-0x1ab;const _0x5709f8=a161_0x5709();let _0x3cebba=_0x5709f8[_0x31cf01];return _0x3cebba;}function a161_0x5709(){const _0x24a6fd=['225YFzquI','now','toFixed','141879msEFnY','889353abrBPV','14fECbGn','921858lOAfaN','170wCTOST','1319736sNoqzS','124278YLrOfE','107652OetCdq','replace','884468kyNyop'];a161_0x5709=function(){return _0x24a6fd;};return a161_0x5709();}(function(_0x392e48,_0x42a07f){const _0x55ae73=a161_0x3ceb,_0x3a87c2=_0x392e48();while(!![]){try{const _0x516669=parseInt(_0x55ae73(0x1ab))/0x1+-parseInt(_0x55ae73(0x1b1))/0x2*(-parseInt(_0x55ae73(0x1af))/0x3)+-parseInt(_0x55ae73(0x1b6))/0x4*(-parseInt(_0x55ae73(0x1ac))/0x5)+parseInt(_0x55ae73(0x1b5))/0x6+parseInt(_0x55ae73(0x1b2))/0x7+-parseInt(_0x55ae73(0x1b4))/0x8+parseInt(_0x55ae73(0x1b0))/0x9*(-parseInt(_0x55ae73(0x1b3))/0xa);if(_0x516669===_0x42a07f)break;else _0x3a87c2['push'](_0x3a87c2['shift']());}catch(_0x2dd822){_0x3a87c2['push'](_0x3a87c2['shift']());}}}(a161_0x5709,0xb33cb));export function formatElapsed(_0x1b3c4e){const _0x5dd946=a161_0x3ceb,_0x1e796d=Date[_0x5dd946(0x1ad)]()-_0x1b3c4e;if(_0x1e796d<0x3e8)return _0x1e796d+'ms';const _0x447d14=(_0x1e796d/0x3e8)[_0x5dd946(0x1ae)](0x2),_0x22fbb9=_0x447d14[_0x5dd946(0x1b7)](/\.?0+$/u,'');return _0x22fbb9+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x10b4d8,_0x8dfdec){const _0x4255e7=a164_0x330b,_0xb98ebd=_0x10b4d8();while(!![]){try{const _0x30a52c=-parseInt(_0x4255e7(0x1f0))/0x1+parseInt(_0x4255e7(0x1f3))/0x2*(parseInt(_0x4255e7(0x1ce))/0x3)+-parseInt(_0x4255e7(0x1ee))/0x4+parseInt(_0x4255e7(0x21b))/0x5+parseInt(_0x4255e7(0x1d6))/0x6*(parseInt(_0x4255e7(0x1de))/0x7)+parseInt(_0x4255e7(0x213))/0x8*(-parseInt(_0x4255e7(0x1e6))/0x9)+-parseInt(_0x4255e7(0x206))/0xa*(parseInt(_0x4255e7(0x20c))/0xb);if(_0x30a52c===_0x8dfdec)break;else _0xb98ebd['push'](_0xb98ebd['shift']());}catch(_0x454c4c){_0xb98ebd['push'](_0xb98ebd['shift']());}}}(a164_0x53a6,0xddb39));import a164_0x3febed from'path';import a164_0x51b214 from'fs';import a164_0x4c5fec from'chalk';import a164_0x314462 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{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a164_0x53a6(){const _0x3d7b5f=['minimumVersion','join','info','writeFileSync','rmSync','dirname','1.0.0','defaultApp','message','\x20dataset(s),\x20generated\x20','cwd','gray','\x20model(s)','create','\x20\x202.\x20Pull\x20API\x20configuration:\x20','API\x20configuration\x20pulled:\x20','配置应用AppCode失败','error','120327HOKjOM','Project\x20directory\x20','text','\x20config\x20set\x20appcode\x20<app-code>\x27','parse','W_OK','CLI\x20版本检查','log','26874FyvJQd','projectName','Extracting\x20project\x20template','currentVersion','readFileSync','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','清理项目目录失败:\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','1029fqWCwt','\x20Generated\x20by\x20rabetbase\x20cli\x20','Project\x20template\x20ready','resolve','dev','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','package.json','11552148nLoqIB','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','green','cookie','projectCode','existsSync','appCode','Install\x20dependencies','1053528SZaFKb','√\x20package.json\x20updated:\x20name=','375484UxEnar','utf8','更新\x20package.json\x20失败','74YqCdcz','name','apps','\x20|\x20AppCode:\x20','项目创建失败:\x20','bold','lstatSync','Verifying\x20project\x20template','\x20√\x20','isDirectory','length','Project\x20name:\x20','*\x20Pulling\x20API\x20configuration...','production','fail','API\x20配置拉取异常','...','warn','stableVersion','10bFOwlc','Downloading\x20project\x20template','resolving','repeat','\x20|\x20Default:\x20','constants','850399oLhvZw','√\x20Pulled\x20','nonInteractive','env','verifying','modelCount','项目创建完成:\x20','8TvqZRG','description','version','🚀\x20Next\x20Steps:','Resolving\x20project\x20template','√\x20Configuration\x20file\x20created,\x20Apps:\x20','配置应用AppCode:\x20','chdir','3826950qtSxIO','*\x20Configuring\x20AppCode\x20for\x20project\x20','\x20api\x20pull','cyan','\x20&&\x20'];a164_0x53a6=function(){return _0x3d7b5f;};return a164_0x53a6();}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';function readDirectoryIdentity(_0x525b37){const _0x20671e=a164_0x330b;try{const _0x5a0f5d=a164_0x51b214[_0x20671e(0x1f9)](_0x525b37);if(!_0x5a0f5d[_0x20671e(0x1fc)]())return null;return{'dev':_0x5a0f5d[_0x20671e(0x1e2)],'ino':_0x5a0f5d['ino']};}catch{return null;}}export async function createApp(_0x47d2a0){const _0x1f634f=a164_0x330b,_0x1611b2=await checkCliVersion();(_0x1611b2['needsUpgrade']||_0x1611b2['belowMinimum'])&&(printCliUpgradeWarning(_0x1611b2),assertCliVersionSupported(_0x1611b2),logger[_0x1f634f(0x1be)](_0x1f634f(0x1c9),_0x1f634f(0x1d4),{'currentVersion':_0x1611b2[_0x1f634f(0x1d9)],'stableVersion':_0x1611b2[_0x1f634f(0x205)],'minimumVersion':_0x1611b2[_0x1f634f(0x220)],'needsUpgrade':_0x1611b2['needsUpgrade'],'belowMinimum':_0x1611b2['belowMinimum']}));if(_0x47d2a0[_0x1f634f(0x1ea)]&&(_0x47d2a0['appCode']||_0x47d2a0[_0x1f634f(0x20e)]))await runCreate({'projectName':_0x47d2a0['projectCode'],'appCode':_0x47d2a0[_0x1f634f(0x1ec)],'env':_0x47d2a0['env']},_0x47d2a0);else{if(_0x47d2a0[_0x1f634f(0x1ea)]){const _0x312e8e=await selectSingleAppcode(_0x47d2a0[_0x1f634f(0x1e9)]);await runCreate({'projectName':_0x47d2a0['projectCode'],'appCode':_0x312e8e||undefined,'env':_0x47d2a0[_0x1f634f(0x20f)]},_0x47d2a0);}else await guidedCreateProject(_0x5605cd=>runCreate(_0x5605cd,_0x47d2a0),_0x47d2a0['env'],_0x47d2a0['cookie']);}}async function runCreate(_0x4a989f,_0x5454c7){const _0x162b80=a164_0x330b;_0x4a989f[_0x162b80(0x1d7)]=validateProjectName(_0x4a989f[_0x162b80(0x1d7)]);const _0xf5b018=a164_0x3febed[_0x162b80(0x1e1)](process['cwd'](),_0x4a989f[_0x162b80(0x1d7)]);if(a164_0x51b214[_0x162b80(0x1eb)](_0xf5b018))throw new Error(_0x162b80(0x1cf)+_0x4a989f[_0x162b80(0x1d7)]+'\x20already\x20exists');let _0x270adf=null;try{a164_0x51b214['accessSync'](a164_0x3febed[_0x162b80(0x1c1)](_0xf5b018),a164_0x51b214[_0x162b80(0x20b)][_0x162b80(0x1d3)]);}catch{throw new Error(_0x162b80(0x1dd));}logger[_0x162b80(0x1be)](_0x162b80(0x1c9),'开始创建项目:\x20'+_0x4a989f[_0x162b80(0x1d7)],{'projectDir':_0xf5b018,'appCode':_0x4a989f[_0x162b80(0x1ec)]}),console[_0x162b80(0x1d5)](),console['log'](a164_0x4c5fec[_0x162b80(0x1e8)]('\x20√\x20')+_0x162b80(0x1fe)+a164_0x4c5fec[_0x162b80(0x1e8)](_0x4a989f[_0x162b80(0x1d7)])+(_0x4a989f[_0x162b80(0x1ec)]?_0x162b80(0x1f6)+a164_0x4c5fec[_0x162b80(0x21e)](_0x4a989f[_0x162b80(0x1ec)]):''));try{await runTask(_0x162b80(0x217),_0x444593=>copyProjectTemplate(_0x4a989f[_0x162b80(0x1d7)],_0x1f53e5=>_0x444593(projectTemplateStageLabel(_0x1f53e5))),_0x162b80(0x1e0)),_0x270adf=readDirectoryIdentity(_0xf5b018);if(!_0x270adf)throw new Error('Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory');await updatePackageJsonName(_0x4a989f['projectName']),await runTask(_0x162b80(0x1ed),()=>installDependencies(_0x4a989f[_0x162b80(0x1d7)])),await runTask('Format\x20code',()=>formatProjectCode(_0x4a989f[_0x162b80(0x1d7)])),await configureAppCode(_0x4a989f[_0x162b80(0x1d7)],_0x4a989f[_0x162b80(0x1ec)]||'',_0x4a989f[_0x162b80(0x20f)]);let _0xfe0c1b=![];if(_0x4a989f[_0x162b80(0x1ec)]){console[_0x162b80(0x1d5)](_0x162b80(0x1ff));const _0xe9b492=process[_0x162b80(0x1c6)]();try{process['chdir'](_0xf5b018);const _0x4be582=_0x4a989f[_0x162b80(0x20f)]||_0x162b80(0x200);initEnv(_0x4be582);const {configArray:_0x5bd700}=await fetchModelList(_0x4a989f['appCode'],_0x5454c7[_0x162b80(0x1e9)]||''),_0x463d6d=DEFAULT_API_DIR,_0x4af27c=await generateApiFile(_0x5bd700,'',_0x4a989f[_0x162b80(0x1ec)],!![],_0x4be582,_0x463d6d);console[_0x162b80(0x1d5)](_0x162b80(0x20d)+_0x5bd700[_0x162b80(0x1fd)]+_0x162b80(0x1c5)+_0x4af27c[_0x162b80(0x211)]+_0x162b80(0x1c8)),logger[_0x162b80(0x1be)]('create',_0x162b80(0x1cb)+_0x4a989f[_0x162b80(0x1ec)]);}catch(_0x223475){_0xfe0c1b=!![],console[_0x162b80(0x1d5)](_0x162b80(0x1e7)),logger[_0x162b80(0x204)](_0x162b80(0x1c9),_0x162b80(0x202),{'error':_0x223475 instanceof Error?_0x223475[_0x162b80(0x1c4)]:String(_0x223475)});}finally{process[_0x162b80(0x21a)](_0xe9b492);}}logger['setLogPath'](_0xf5b018),logger['success'](_0x162b80(0x1c9),_0x162b80(0x212)+_0x4a989f['projectName']),console[_0x162b80(0x1d5)](),console['log'](a164_0x4c5fec['green']('─'[_0x162b80(0x209)](0x3c))),console[_0x162b80(0x1d5)](a164_0x4c5fec[_0x162b80(0x21e)][_0x162b80(0x1f8)](_0x162b80(0x216))),console['log'](),console['log']('\x20\x201.\x20Start\x20project:\x20'+a164_0x4c5fec[_0x162b80(0x21e)][_0x162b80(0x1f8)]('cd\x20'+_0x4a989f['projectName']+_0x162b80(0x21f)+CLI_BIN_NAME+'\x20run\x20start')),_0xfe0c1b&&console[_0x162b80(0x1d5)](_0x162b80(0x1ca)+a164_0x4c5fec[_0x162b80(0x21e)][_0x162b80(0x1f8)](CLI_BIN_NAME+_0x162b80(0x21d))),console['log'](a164_0x4c5fec[_0x162b80(0x1e8)]('─'[_0x162b80(0x209)](0x3c)));}catch(_0x28545d){logger['error'](_0x162b80(0x1c9),_0x162b80(0x1f7)+_0x4a989f['projectName'],{'error':_0x28545d instanceof Error?_0x28545d[_0x162b80(0x1c4)]:String(_0x28545d)});try{const _0x2f95e5=readDirectoryIdentity(_0xf5b018);if(_0x270adf&&_0x2f95e5?.[_0x162b80(0x1e2)]===_0x270adf['dev']&&_0x2f95e5['ino']===_0x270adf['ino'])console[_0x162b80(0x1d5)](_0x162b80(0x1e3)+_0xf5b018),a164_0x51b214[_0x162b80(0x1c0)](_0xf5b018,{'recursive':!![],'force':!![]});else _0x2f95e5&&logger[_0x162b80(0x204)](_0x162b80(0x1c9),'跳过清理:项目目录所有权已变化:\x20'+_0xf5b018);}catch{logger['warn'](_0x162b80(0x1c9),_0x162b80(0x1dc)+_0xf5b018);}throw _0x28545d;}}function a164_0x330b(_0x5edbf8,_0x575872){_0x5edbf8=_0x5edbf8-0x1bd;const _0x53a64f=a164_0x53a6();let _0x330b22=_0x53a64f[_0x5edbf8];return _0x330b22;}async function runTask(_0x2fd337,_0x277cbd,_0x4be592=_0x2fd337){const _0x32ccfa=a164_0x330b,_0x377556=a164_0x314462(_0x2fd337+_0x32ccfa(0x203))['start']();try{const _0x421627=await _0x277cbd(_0x3f833a=>{const _0x2a4fd2=_0x32ccfa;_0x377556[_0x2a4fd2(0x1d0)]=_0x3f833a+_0x2a4fd2(0x203);});_0x377556['stop'](),console[_0x32ccfa(0x1d5)](''+a164_0x4c5fec[_0x32ccfa(0x1e8)](_0x32ccfa(0x1fb))+_0x4be592+'\x20'+a164_0x4c5fec[_0x32ccfa(0x1c7)]('['+_0x421627+']'));}catch(_0x502d9b){_0x377556[_0x32ccfa(0x201)](_0x2fd337);throw _0x502d9b;}}function projectTemplateStageLabel(_0x396dfa){const _0x1d3bda=a164_0x330b;switch(_0x396dfa){case _0x1d3bda(0x208):return _0x1d3bda(0x217);case'downloading':return _0x1d3bda(0x207);case _0x1d3bda(0x210):return _0x1d3bda(0x1fa);case'extracting':return _0x1d3bda(0x1d8);}}async function updatePackageJsonName(_0x5b8bc0){const _0x1e13c2=a164_0x330b,_0x1260c4=a164_0x3febed[_0x1e13c2(0x1e1)](process['cwd'](),_0x5b8bc0),_0x7fa350=a164_0x3febed[_0x1e13c2(0x1bd)](_0x1260c4,_0x1e13c2(0x1e5));try{console[_0x1e13c2(0x1d5)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x53b658=getRabetbaseCliPackageRoot(),_0x553287=a164_0x3febed[_0x1e13c2(0x1bd)](_0x53b658,_0x1e13c2(0x1e5));let _0x2df779=_0x1e13c2(0x1c2);try{const _0x43242f=JSON[_0x1e13c2(0x1d2)](a164_0x51b214['readFileSync'](_0x553287,'utf8'));_0x2df779=_0x43242f[_0x1e13c2(0x215)]||_0x1e13c2(0x1c2);}catch{}const _0x3de1d4=a164_0x51b214[_0x1e13c2(0x1da)](_0x7fa350,_0x1e13c2(0x1f1)),_0xf5a68b=JSON[_0x1e13c2(0x1d2)](_0x3de1d4);_0xf5a68b[_0x1e13c2(0x1f4)]=_0x5b8bc0,_0xf5a68b[_0x1e13c2(0x214)]=_0x5b8bc0+_0x1e13c2(0x1df)+_0x2df779,a164_0x51b214[_0x1e13c2(0x1bf)](_0x7fa350,JSON['stringify'](_0xf5a68b,null,0x2)+'\x0a','utf8'),console[_0x1e13c2(0x1d5)](_0x1e13c2(0x1ef)+_0x5b8bc0),logger['info'](_0x1e13c2(0x1c9),'更新\x20package.json\x20name');}catch(_0x2388b7){logger['error'](_0x1e13c2(0x1c9),_0x1e13c2(0x1f2));throw _0x2388b7;}}async function configureAppCode(_0x308a89,_0x1c8ce0,_0x4d840){const _0x22286c=a164_0x330b,_0x11c4d9=a164_0x3febed[_0x22286c(0x1e1)](process[_0x22286c(0x1c6)](),_0x308a89),_0x5a8ab1=a164_0x3febed[_0x22286c(0x1bd)](_0x11c4d9,NEW_CONFIG_NAME);try{_0x1c8ce0?console[_0x22286c(0x1d5)](_0x22286c(0x21c)+_0x308a89+':\x20'+_0x1c8ce0):console[_0x22286c(0x1d5)](_0x22286c(0x1e4)+_0x308a89);const _0x12584d=getRabetbaseCliPackageRoot(),_0x62323c=a164_0x3febed[_0x22286c(0x1bd)](_0x12584d,_0x22286c(0x1e5));let _0x1d4a0c=_0x22286c(0x1c2);try{const _0x25e17e=JSON[_0x22286c(0x1d2)](a164_0x51b214[_0x22286c(0x1da)](_0x62323c,'utf8'));_0x1d4a0c=_0x25e17e['version']||'1.0.0';}catch{}const _0x44e557=readConfig(),_0x197cc9=typeof _0x44e557[_0x22286c(0x20f)]==='string'?_0x44e557[_0x22286c(0x20f)]:undefined,_0x1571c3={};for(const _0x2fe975 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x44e557[_0x2fe975]!=null)_0x1571c3[_0x2fe975]=_0x44e557[_0x2fe975];}const _0x584f2e=buildCanonicalProjectConfig(_0x1571c3,{'appCodes':_0x1c8ce0?[_0x1c8ce0]:[],'env':_0x4d840||_0x197cc9||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x1d4a0c}});writeConfigFile(_0x5a8ab1,_0x584f2e),_0x1c8ce0?console['log'](_0x22286c(0x218)+Object['keys'](_0x584f2e[_0x22286c(0x1f5)]||{})[_0x22286c(0x1bd)](',\x20')+_0x22286c(0x20a)+_0x584f2e[_0x22286c(0x1c3)]):console['log'](_0x22286c(0x1db)+CLI_BIN_NAME+_0x22286c(0x1d1)),logger['info']('create',_0x22286c(0x219)+_0x1c8ce0);}catch(_0x5abf54){logger[_0x22286c(0x1cd)](_0x22286c(0x1c9),_0x22286c(0x1cc));throw _0x5abf54;}}
|
|
1
|
+
(function(_0x4e082d,_0x4652d9){const _0x12cf42=a162_0x3a7a,_0xee54ee=_0x4e082d();while(!![]){try{const _0x477821=parseInt(_0x12cf42(0x13f))/0x1*(parseInt(_0x12cf42(0x12d))/0x2)+parseInt(_0x12cf42(0x122))/0x3*(parseInt(_0x12cf42(0x143))/0x4)+parseInt(_0x12cf42(0x13b))/0x5+-parseInt(_0x12cf42(0x146))/0x6*(-parseInt(_0x12cf42(0x123))/0x7)+-parseInt(_0x12cf42(0x13a))/0x8*(-parseInt(_0x12cf42(0x10b))/0x9)+-parseInt(_0x12cf42(0x104))/0xa+-parseInt(_0x12cf42(0x165))/0xb;if(_0x477821===_0x4652d9)break;else _0xee54ee['push'](_0xee54ee['shift']());}catch(_0x3bd68c){_0xee54ee['push'](_0xee54ee['shift']());}}}(a162_0x3b6f,0x738ae));import a162_0x52f024 from'path';import a162_0x4cf670 from'fs';import a162_0xb57832 from'chalk';import a162_0x4a9e3d from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';function a162_0x3a7a(_0x2eb531,_0x528e11){_0x2eb531=_0x2eb531-0x102;const _0x3b6f7b=a162_0x3b6f();let _0x3a7a44=_0x3b6f7b[_0x2eb531];return _0x3a7a44;}function readDirectoryIdentity(_0x3f9965){const _0x2b4829=a162_0x3a7a;try{const _0xb6512e=a162_0x4cf670[_0x2b4829(0x12f)](_0x3f9965);if(!_0xb6512e[_0x2b4829(0x14d)]())return null;return{'dev':_0xb6512e['dev'],'ino':_0xb6512e['ino']};}catch{return null;}}export async function createApp(_0x3d0fe8){const _0x271d4c=a162_0x3a7a,_0x48d511=await checkCliVersion();(_0x48d511[_0x271d4c(0x14c)]||_0x48d511[_0x271d4c(0x148)])&&(printCliUpgradeWarning(_0x48d511),assertCliVersionSupported(_0x48d511),logger['info'](_0x271d4c(0x140),_0x271d4c(0x119),{'currentVersion':_0x48d511[_0x271d4c(0x124)],'stableVersion':_0x48d511[_0x271d4c(0x164)],'minimumVersion':_0x48d511[_0x271d4c(0x14a)],'needsUpgrade':_0x48d511[_0x271d4c(0x14c)],'belowMinimum':_0x48d511[_0x271d4c(0x148)]}));if(_0x3d0fe8[_0x271d4c(0x13c)]&&(_0x3d0fe8['appCode']||_0x3d0fe8[_0x271d4c(0x14f)]))await runCreate({'projectName':_0x3d0fe8[_0x271d4c(0x13c)],'appCode':_0x3d0fe8[_0x271d4c(0x10e)],'env':_0x3d0fe8['env']},_0x3d0fe8);else{if(_0x3d0fe8[_0x271d4c(0x13c)]){const _0x53aec9=await selectSingleAppcode(_0x3d0fe8[_0x271d4c(0x15d)]);await runCreate({'projectName':_0x3d0fe8[_0x271d4c(0x13c)],'appCode':_0x53aec9||undefined,'env':_0x3d0fe8[_0x271d4c(0x11c)]},_0x3d0fe8);}else await guidedCreateProject(_0x311118=>runCreate(_0x311118,_0x3d0fe8),_0x3d0fe8[_0x271d4c(0x11c)],_0x3d0fe8[_0x271d4c(0x15d)]);}}async function runCreate(_0x518b16,_0x44978b){const _0x2b5930=a162_0x3a7a;_0x518b16[_0x2b5930(0x11b)]=validateProjectName(_0x518b16['projectName']);const _0x12c8f6=a162_0x52f024['resolve'](process[_0x2b5930(0x118)](),_0x518b16['projectName']);if(a162_0x4cf670[_0x2b5930(0x142)](_0x12c8f6))throw new Error(_0x2b5930(0x144)+_0x518b16[_0x2b5930(0x11b)]+'\x20already\x20exists');let _0x513279=null;try{a162_0x4cf670[_0x2b5930(0x13d)](a162_0x52f024[_0x2b5930(0x10a)](_0x12c8f6),a162_0x4cf670[_0x2b5930(0x159)]['W_OK']);}catch{throw new Error(_0x2b5930(0x166));}logger[_0x2b5930(0x109)](_0x2b5930(0x140),_0x2b5930(0x133)+_0x518b16[_0x2b5930(0x11b)],{'projectDir':_0x12c8f6,'appCode':_0x518b16[_0x2b5930(0x10e)]}),console['log'](),console[_0x2b5930(0x131)](a162_0xb57832['green'](_0x2b5930(0x12c))+'Project\x20name:\x20'+a162_0xb57832[_0x2b5930(0x130)](_0x518b16[_0x2b5930(0x11b)])+(_0x518b16[_0x2b5930(0x10e)]?'\x20|\x20AppCode:\x20'+a162_0xb57832[_0x2b5930(0x11a)](_0x518b16[_0x2b5930(0x10e)]):''));try{await runTask('Resolving\x20project\x20template',_0x32a447=>copyProjectTemplate(_0x518b16['projectName'],_0x12be19=>_0x32a447(projectTemplateStageLabel(_0x12be19)),_0x44978b[_0x2b5930(0x154)]),_0x2b5930(0x147)),_0x513279=readDirectoryIdentity(_0x12c8f6);if(!_0x513279)throw new Error(_0x2b5930(0x12e));await updatePackageJsonName(_0x518b16['projectName']),await runTask(_0x2b5930(0x127),()=>installDependencies(_0x518b16[_0x2b5930(0x11b)])),await runTask(_0x2b5930(0x126),()=>formatProjectCode(_0x518b16['projectName'])),await configureAppCode(_0x518b16[_0x2b5930(0x11b)],_0x518b16[_0x2b5930(0x10e)]||'',_0x518b16[_0x2b5930(0x11c)]);let _0x15d517=![];if(_0x518b16[_0x2b5930(0x10e)]){console[_0x2b5930(0x131)](_0x2b5930(0x121));const _0x53fd78=process[_0x2b5930(0x118)]();try{process[_0x2b5930(0x134)](_0x12c8f6);const _0x53a766=_0x518b16[_0x2b5930(0x11c)]||'production';initEnv(_0x53a766);const {configArray:_0x51efca}=await fetchModelList(_0x518b16[_0x2b5930(0x10e)],_0x44978b['cookie']||''),_0x4c18dc=DEFAULT_API_DIR,_0x4912f7=await generateApiFile(_0x51efca,'',_0x518b16['appCode'],!![],_0x53a766,_0x4c18dc,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x2b5930(0x131)](_0x2b5930(0x150)+_0x51efca['length']+_0x2b5930(0x10c)+_0x4912f7[_0x2b5930(0x152)]+_0x2b5930(0x10d)),logger[_0x2b5930(0x109)](_0x2b5930(0x140),'API\x20configuration\x20pulled:\x20'+_0x518b16[_0x2b5930(0x10e)]);}catch(_0xaa50d5){_0x15d517=!![],console[_0x2b5930(0x131)](_0x2b5930(0x141)),logger[_0x2b5930(0x116)](_0x2b5930(0x140),'API\x20configuration\x20pull\x20failed',{'error':_0xaa50d5 instanceof Error?_0xaa50d5['message']:String(_0xaa50d5)});}finally{process[_0x2b5930(0x134)](_0x53fd78);}}logger[_0x2b5930(0x132)](_0x12c8f6),logger['success'](_0x2b5930(0x140),'Project\x20created:\x20'+_0x518b16[_0x2b5930(0x11b)]),console[_0x2b5930(0x131)](),console[_0x2b5930(0x131)](a162_0xb57832[_0x2b5930(0x130)]('─'['repeat'](0x3c))),console[_0x2b5930(0x131)](a162_0xb57832['cyan']['bold'](_0x2b5930(0x114))),console['log'](),console[_0x2b5930(0x131)](_0x2b5930(0x151)+a162_0xb57832[_0x2b5930(0x11a)][_0x2b5930(0x155)](_0x2b5930(0x128)+_0x518b16[_0x2b5930(0x11b)]+'\x20&&\x20'+CLI_BIN_NAME+_0x2b5930(0x11d))),_0x15d517&&console['log'](_0x2b5930(0x103)+a162_0xb57832['cyan'][_0x2b5930(0x155)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x2b5930(0x131)](a162_0xb57832[_0x2b5930(0x130)]('─'[_0x2b5930(0x149)](0x3c)));}catch(_0x44dee5){logger[_0x2b5930(0x158)](_0x2b5930(0x140),_0x2b5930(0x10f)+_0x518b16['projectName'],{'error':_0x44dee5 instanceof Error?_0x44dee5[_0x2b5930(0x161)]:String(_0x44dee5)});try{const _0x2bde2f=readDirectoryIdentity(_0x12c8f6);if(_0x513279&&_0x2bde2f?.['dev']===_0x513279[_0x2b5930(0x111)]&&_0x2bde2f['ino']===_0x513279[_0x2b5930(0x110)])console[_0x2b5930(0x131)](_0x2b5930(0x153)+_0x12c8f6),a162_0x4cf670[_0x2b5930(0x15b)](_0x12c8f6,{'recursive':!![],'force':!![]});else _0x2bde2f&&logger[_0x2b5930(0x116)](_0x2b5930(0x140),'Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'+_0x12c8f6);}catch{logger[_0x2b5930(0x116)]('create',_0x2b5930(0x129)+_0x12c8f6);}throw _0x44dee5;}}async function runTask(_0x525d93,_0x434d85,_0x37aa30=_0x525d93){const _0x32e54b=a162_0x3a7a,_0x5c0459=a162_0x4a9e3d(_0x525d93+_0x32e54b(0x107))['start']();try{const _0x56a7c2=await _0x434d85(_0x429aa8=>{const _0x1843a5=_0x32e54b;_0x5c0459[_0x1843a5(0x13e)]=_0x429aa8+_0x1843a5(0x107);});_0x5c0459[_0x32e54b(0x15c)](),console['log'](''+a162_0xb57832[_0x32e54b(0x130)](_0x32e54b(0x12c))+_0x37aa30+'\x20'+a162_0xb57832[_0x32e54b(0x11e)]('['+_0x56a7c2+']'));}catch(_0x177e36){_0x5c0459[_0x32e54b(0x139)](_0x525d93);throw _0x177e36;}}function projectTemplateStageLabel(_0x3b23e0){const _0x3f7dd3=a162_0x3a7a;switch(_0x3b23e0){case _0x3f7dd3(0x157):return _0x3f7dd3(0x125);case _0x3f7dd3(0x160):return _0x3f7dd3(0x113);case _0x3f7dd3(0x112):return _0x3f7dd3(0x105);case _0x3f7dd3(0x138):return'Extracting\x20project\x20template';case'copying':return'Copying\x20local\x20template\x20source';}}async function updatePackageJsonName(_0x49493b){const _0x38e5c3=a162_0x3a7a,_0x1feb7b=a162_0x52f024[_0x38e5c3(0x15f)](process['cwd'](),_0x49493b),_0x5abe63=a162_0x52f024[_0x38e5c3(0x15e)](_0x1feb7b,'package.json');try{console[_0x38e5c3(0x131)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x33528c=getRabetbaseCliPackageRoot(),_0x3c53eb=a162_0x52f024[_0x38e5c3(0x15e)](_0x33528c,'package.json');let _0x5cedae=_0x38e5c3(0x136);try{const _0x231ec1=JSON[_0x38e5c3(0x15a)](a162_0x4cf670['readFileSync'](_0x3c53eb,'utf8'));_0x5cedae=_0x231ec1[_0x38e5c3(0x14e)]||_0x38e5c3(0x136);}catch{}const _0x1b80c3=a162_0x4cf670[_0x38e5c3(0x156)](_0x5abe63,_0x38e5c3(0x117)),_0x502c88=JSON[_0x38e5c3(0x15a)](_0x1b80c3);_0x502c88['name']=_0x49493b,_0x502c88[_0x38e5c3(0x135)]=_0x49493b+_0x38e5c3(0x137)+_0x5cedae,a162_0x4cf670[_0x38e5c3(0x12a)](_0x5abe63,JSON['stringify'](_0x502c88,null,0x2)+'\x0a','utf8'),console[_0x38e5c3(0x131)]('√\x20package.json\x20updated:\x20name='+_0x49493b),logger[_0x38e5c3(0x109)]('create',_0x38e5c3(0x108));}catch(_0x424ed4){logger[_0x38e5c3(0x158)](_0x38e5c3(0x140),_0x38e5c3(0x163));throw _0x424ed4;}}function a162_0x3b6f(){const _0x307ea1=['dev','verifying','Downloading\x20project\x20template','🚀\x20Next\x20Steps:','production','warn','utf8','cwd','CLI\x20version\x20check','cyan','projectName','env','\x20run\x20start','gray','Configured\x20app\x20AppCode:\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','*\x20Pulling\x20API\x20configuration...','3207nqfaYx','602882cKJSrT','currentVersion','Resolving\x20project\x20template','Format\x20code','Install\x20dependencies','cd\x20','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','writeFileSync','apps','\x20√\x20','1132osngkp','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','lstatSync','green','log','setLogPath','Starting\x20project\x20creation:\x20','chdir','description','1.0.0','\x20Generated\x20by\x20rabetbase\x20cli\x20','extracting','fail','6112864GGddeU','3716120JugZAj','projectCode','accessSync','text','137xqtQDA','create','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','existsSync','2972ekywPY','Project\x20directory\x20','keys','48sUtlgj','Project\x20template\x20ready','belowMinimum','repeat','minimumVersion','Failed\x20to\x20configure\x20app\x20AppCode','needsUpgrade','isDirectory','version','nonInteractive','√\x20Pulled\x20','\x20\x201.\x20Start\x20project:\x20','modelCount','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','templateSource','bold','readFileSync','resolving','error','constants','parse','rmSync','stop','cookie','join','resolve','downloading','message','\x20|\x20Default:\x20implicit\x20(single\x20app)','Failed\x20to\x20update\x20package.json','stableVersion','22755128gmPtaH','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','toLocaleString','\x20\x202.\x20Pull\x20API\x20configuration:\x20','5262390yHhPKP','Verifying\x20project\x20template','*\x20Configuring\x20AppCode\x20for\x20project\x20','...','Updating\x20package.json\x20name','info','dirname','9cybpeB','\x20dataset(s),\x20generated\x20','\x20model(s)','appCode','Project\x20creation\x20failed:\x20','ino'];a162_0x3b6f=function(){return _0x307ea1;};return a162_0x3b6f();}async function configureAppCode(_0x4b2992,_0x10233d,_0x6e6011){const _0x2b211e=a162_0x3a7a,_0x318b05=a162_0x52f024['resolve'](process[_0x2b211e(0x118)](),_0x4b2992),_0x301e5b=a162_0x52f024[_0x2b211e(0x15e)](_0x318b05,NEW_CONFIG_NAME);try{_0x10233d?console['log'](_0x2b211e(0x106)+_0x4b2992+':\x20'+_0x10233d):console[_0x2b211e(0x131)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x4b2992);const _0x31695d=getRabetbaseCliPackageRoot(),_0x3db8ae=a162_0x52f024[_0x2b211e(0x15e)](_0x31695d,'package.json');let _0x177487=_0x2b211e(0x136);try{const _0x202af3=JSON[_0x2b211e(0x15a)](a162_0x4cf670[_0x2b211e(0x156)](_0x3db8ae,_0x2b211e(0x117)));_0x177487=_0x202af3[_0x2b211e(0x14e)]||'1.0.0';}catch{}const {globalConfig:_0x4d021c}=loadRawConfigLayers(),_0x3a3701=typeof _0x4d021c[_0x2b211e(0x11c)]==='string'?_0x4d021c[_0x2b211e(0x11c)]:undefined,_0x36814f={};for(const _0x4866b7 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4d021c[_0x4866b7]!=null)_0x36814f[_0x4866b7]=_0x4d021c[_0x4866b7];}const _0x5a6ecd=buildCanonicalProjectConfig(_0x36814f,{'appCodes':_0x10233d?[_0x10233d]:[],'env':_0x6e6011||_0x3a3701||_0x2b211e(0x115),'metadata':{'createdAt':new Date()[_0x2b211e(0x102)](),'version':_0x177487}});writeConfigFile(_0x301e5b,_0x5a6ecd),await generateSdkConfigFile(a162_0x52f024['join'](_0x318b05,DEFAULT_API_DIR),getSdkClientRoutingConfig()),_0x10233d?console['log']('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x2b211e(0x145)](_0x5a6ecd[_0x2b211e(0x12b)]||{})[_0x2b211e(0x15e)](',\x20')+_0x2b211e(0x162)):console[_0x2b211e(0x131)](_0x2b211e(0x120)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x2b211e(0x109)](_0x2b211e(0x140),_0x2b211e(0x11f)+_0x10233d);}catch(_0x4cfba0){logger['error']('create',_0x2b211e(0x14b));throw _0x4cfba0;}}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export interface ProjectTemplateMaterialization {
|
|
2
|
-
source: "cdn";
|
|
2
|
+
source: "cdn" | "local";
|
|
3
3
|
version: string;
|
|
4
4
|
}
|
|
5
|
-
export type ProjectTemplateStage = "resolving" | "downloading" | "verifying" | "extracting";
|
|
5
|
+
export type ProjectTemplateStage = "resolving" | "downloading" | "verifying" | "extracting" | "copying";
|
|
6
6
|
export type ProjectTemplateProgress = (stage: ProjectTemplateStage) => void;
|
|
7
7
|
/**
|
|
8
8
|
* Materialize the project template into a new target directory.
|
|
9
9
|
* CDN is the single source for project templates.
|
|
10
10
|
*/
|
|
11
11
|
export declare function materializeProjectTemplate(projectDir: string, onProgress?: ProjectTemplateProgress): Promise<ProjectTemplateMaterialization>;
|
|
12
|
+
/**
|
|
13
|
+
* Materialize an already-normalized local project template directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare function materializeLocalProjectTemplate(sourceDir: string, projectDir: string, onProgress?: ProjectTemplateProgress): Promise<ProjectTemplateMaterialization>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a165_0x5779b1=a165_0x4d0c;(function(_0x5c93ad,_0x52bc3a){const _0x20fda3=a165_0x4d0c,_0x4f92f3=_0x5c93ad();while(!![]){try{const _0x17c33a=parseInt(_0x20fda3(0xee))/0x1+-parseInt(_0x20fda3(0x10e))/0x2*(parseInt(_0x20fda3(0xd1))/0x3)+-parseInt(_0x20fda3(0xd3))/0x4*(-parseInt(_0x20fda3(0x109))/0x5)+parseInt(_0x20fda3(0x111))/0x6+-parseInt(_0x20fda3(0x103))/0x7+-parseInt(_0x20fda3(0xd2))/0x8*(-parseInt(_0x20fda3(0x121))/0x9)+-parseInt(_0x20fda3(0xec))/0xa*(parseInt(_0x20fda3(0xe4))/0xb);if(_0x17c33a===_0x52bc3a)break;else _0x4f92f3['push'](_0x4f92f3['shift']());}catch(_0x2c72f8){_0x4f92f3['push'](_0x4f92f3['shift']());}}}(a165_0x29b4,0x501d1));import{createHash}from'node:crypto';import a165_0x235bfa from'node:fs/promises';import a165_0x88be16 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=a165_0x5779b1(0xea),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x295cf7){const _0x240e1c=a165_0x5779b1;return typeof _0x295cf7==='string'&&_0x295cf7[_0x240e1c(0xd9)]()?_0x295cf7['trim']():null;}function parseDescriptor(_0x3d3966){const _0x58ca4b=a165_0x5779b1;if(!_0x3d3966||typeof _0x3d3966!==_0x58ca4b(0xe3))throw new Error(_0x58ca4b(0x102)+TEMPLATE_ID+'\x22.');const _0x5c1fea=_0x3d3966,_0x26f8d5=nonEmptyString(_0x5c1fea[_0x58ca4b(0xe6)]),_0xce85e9=nonEmptyString(_0x5c1fea[_0x58ca4b(0xdf)]),_0x556bdf=nonEmptyString(_0x5c1fea['sha256'])?.[_0x58ca4b(0xd7)](),_0x5cdc78=_0x5c1fea[_0x58ca4b(0x107)];if(!_0x26f8d5||!_0xce85e9||_0xce85e9!==a165_0x88be16[_0x58ca4b(0xfc)][_0x58ca4b(0x10a)](_0xce85e9)||_0xce85e9['includes']('\x5c')||!_0x556bdf||!/^sha256:[a-f0-9]{64}$/[_0x58ca4b(0xe8)](_0x556bdf)||typeof _0x5cdc78!==_0x58ca4b(0xe2)||!Number[_0x58ca4b(0x123)](_0x5cdc78)||_0x5cdc78<=0x0||_0x5cdc78>MAX_ARCHIVE_SIZE)throw new Error(_0x58ca4b(0x117)+TEMPLATE_ID+'\x22.');return{'version':_0x26f8d5,'name':_0xce85e9,'sha256':_0x556bdf,'size':_0x5cdc78};}async function fetchWithTimeout(_0x2f9eb0,_0x288c47,_0x4bc6ff,_0x176d2c){const _0x1dce2f=a165_0x5779b1,_0x5029e8=new AbortController(),_0x4fd0ce=setTimeout(()=>_0x5029e8[_0x1dce2f(0xe0)](),_0x288c47);try{const _0x4fffc0=await fetch(_0x2f9eb0,{'headers':{'Accept':_0x4bc6ff},'signal':_0x5029e8[_0x1dce2f(0xe9)]});return await _0x176d2c(_0x4fffc0);}finally{clearTimeout(_0x4fd0ce);}}async function fetchTemplateDescriptor(){const _0x47a797=a165_0x5779b1,_0x1d5243=await getRabetbaseCdnConfig();if(!_0x1d5243)throw new Error('Rabetbase\x20CDN\x20config\x20is\x20unavailable.');return parseDescriptor(_0x1d5243[_0x47a797(0xe1)]);}function resolveArchiveUrl(_0x4be618){const _0x14c2e3=a165_0x5779b1,_0x127075=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1957cf=new URL(_0x4be618,_0x127075);if(_0x1957cf[_0x14c2e3(0x10f)]!==_0x14c2e3(0xd6)||_0x1957cf[_0x14c2e3(0xd4)]!==_0x127075['origin']||!_0x1957cf[_0x14c2e3(0xd8)][_0x14c2e3(0xfe)](_0x127075[_0x14c2e3(0xd8)]))throw new Error(_0x14c2e3(0x106));return _0x1957cf[_0x14c2e3(0xff)];}async function readResponseBytes(_0x8227ef,_0x108782){const _0x44f47e=a165_0x5779b1;if(!_0x8227ef['body']){const _0x406407=Buffer[_0x44f47e(0xfb)](await _0x8227ef[_0x44f47e(0xf0)]());if(_0x406407[_0x44f47e(0xf8)]>_0x108782)throw new Error(_0x44f47e(0xf1));return _0x406407;}const _0x31e396=_0x8227ef[_0x44f47e(0xf6)]['getReader'](),_0x32f6ea=[];let _0x21c417=0x0;try{while(!![]){const {done:_0x4ca8fa,value:_0x3788be}=await _0x31e396[_0x44f47e(0x113)]();if(_0x4ca8fa)break;_0x21c417+=_0x3788be[_0x44f47e(0xf5)];if(_0x21c417>_0x108782){await _0x31e396[_0x44f47e(0xdc)]();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x32f6ea['push'](Buffer[_0x44f47e(0xfb)](_0x3788be));}}finally{_0x31e396[_0x44f47e(0x101)]();}return Buffer[_0x44f47e(0x108)](_0x32f6ea,_0x21c417);}async function downloadArchive(_0x421a17,_0x14ad21,_0x435195){const _0xb1013b=a165_0x5779b1,_0x229d4f=await fetchWithTimeout(resolveArchiveUrl(_0x421a17[_0xb1013b(0xdf)]),ARCHIVE_TIMEOUT_MS,_0xb1013b(0x122),async _0x128967=>{const _0x5b8e8c=_0xb1013b;if(!_0x128967['ok'])throw new Error('CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20'+_0x128967[_0x5b8e8c(0xe5)]+'.');const _0x5286f5=Number(_0x128967['headers'][_0x5b8e8c(0x10b)](_0x5b8e8c(0x110)));if(Number[_0x5b8e8c(0xf2)](_0x5286f5)&&_0x5286f5>MAX_ARCHIVE_SIZE)throw new Error(_0x5b8e8c(0xeb));return readResponseBytes(_0x128967,_0x421a17[_0x5b8e8c(0x107)]);});if(_0x229d4f['length']!==_0x421a17[_0xb1013b(0x107)])throw new Error(_0xb1013b(0x11e)+_0x421a17[_0xb1013b(0x107)]+_0xb1013b(0x11b)+_0x229d4f['length']+'.');_0x435195?.('verifying');const _0x2ae4f3=_0xb1013b(0xfd)+createHash(_0xb1013b(0x114))['update'](_0x229d4f)[_0xb1013b(0x112)](_0xb1013b(0x11f));if(_0x2ae4f3!==_0x421a17[_0xb1013b(0x114)])throw new Error(_0xb1013b(0xda));await a165_0x235bfa['writeFile'](_0x14ad21,_0x229d4f,{'flag':'wx'});}async function assertTemplateRoot(_0x48e8a2){const _0xbbab96=a165_0x5779b1,_0x760441=a165_0x88be16[_0xbbab96(0xf7)](_0x48e8a2,_0xbbab96(0x119)),_0x5e444d=JSON[_0xbbab96(0xed)](await a165_0x235bfa[_0xbbab96(0x10c)](_0x760441,_0xbbab96(0x118)));if(!_0x5e444d||typeof _0x5e444d!==_0xbbab96(0xe3))throw new Error('Project\x20template\x20package.json\x20is\x20invalid.');}async function readDirectoryIdentity(_0x290551){const _0x4c96f9=a165_0x5779b1;try{const _0x5eddc9=await a165_0x235bfa[_0x4c96f9(0x116)](_0x290551);if(!_0x5eddc9[_0x4c96f9(0x105)]())return null;return{'dev':_0x5eddc9[_0x4c96f9(0xf3)],'ino':_0x5eddc9['ino']};}catch{return null;}}async function commitStagedProject(_0x5e5960,_0x19ebb0){const _0x5a067e=a165_0x5779b1;await a165_0x235bfa[_0x5a067e(0x11c)](_0x19ebb0);const _0x5557ac=await readDirectoryIdentity(_0x19ebb0);if(!_0x5557ac)throw new Error('Unable\x20to\x20claim\x20the\x20project\x20directory.');try{for(const _0x24a73b of await a165_0x235bfa[_0x5a067e(0x10d)](_0x5e5960)){await a165_0x235bfa['rename'](a165_0x88be16[_0x5a067e(0xf7)](_0x5e5960,_0x24a73b),a165_0x88be16[_0x5a067e(0xf7)](_0x19ebb0,_0x24a73b));}}catch(_0x429713){const _0x375594=await readDirectoryIdentity(_0x19ebb0);_0x375594?.[_0x5a067e(0xf3)]===_0x5557ac[_0x5a067e(0xf3)]&&_0x375594[_0x5a067e(0xef)]===_0x5557ac[_0x5a067e(0xef)]&&await a165_0x235bfa['rm'](_0x19ebb0,{'recursive':!![],'force':!![]});throw _0x429713;}}export async function materializeProjectTemplate(_0x27bfab,_0x563ae9){const _0x220eac=a165_0x5779b1,_0x4d040b=a165_0x88be16['resolve'](_0x27bfab),_0x1dbf5a=a165_0x88be16[_0x220eac(0x104)](_0x4d040b);try{await a165_0x235bfa[_0x220eac(0x116)](_0x4d040b);throw new Error(_0x220eac(0xf9)+_0x4d040b);}catch(_0xba2801){if(_0xba2801[_0x220eac(0x100)]!==_0x220eac(0xdb))throw _0xba2801;}const _0x3fac60=await a165_0x235bfa[_0x220eac(0x120)](a165_0x88be16[_0x220eac(0xf7)](_0x1dbf5a,'.rabetbase-create-')),_0x36037e=a165_0x88be16[_0x220eac(0xf7)](_0x3fac60,_0x220eac(0x11d)),_0x4f4ba0=a165_0x88be16[_0x220eac(0xf7)](_0x3fac60,_0x220eac(0xfa));try{try{_0x563ae9?.(_0x220eac(0xf4));const _0x39f398=await fetchTemplateDescriptor();return _0x563ae9?.(_0x220eac(0xdd)),await downloadArchive(_0x39f398,_0x4f4ba0,_0x563ae9),_0x563ae9?.(_0x220eac(0xd5)),await extractProjectTemplateArchive(_0x4f4ba0,_0x36037e),await assertTemplateRoot(_0x36037e),await commitStagedProject(_0x36037e,_0x4d040b),{'source':'cdn','version':_0x39f398[_0x220eac(0xe6)]};}catch(_0x1c2776){if(_0x1c2776['code']===_0x220eac(0xde))throw CliErrors[_0x220eac(0x115)](_0x220eac(0xf9)+_0x4d040b,_0x220eac(0x11a));const _0x2cb767=_0x1c2776 instanceof Error?_0x1c2776[_0x220eac(0xe7)]:String(_0x1c2776);throw CliErrors['validation']('Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20'+_0x2cb767);}}finally{await a165_0x235bfa['rm'](_0x3fac60,{'recursive':!![],'force':!![]});}}function a165_0x4d0c(_0x4e29f4,_0x5c078e){_0x4e29f4=_0x4e29f4-0xd1;const _0x29b4b3=a165_0x29b4();let _0x4d0c24=_0x29b4b3[_0x4e29f4];return _0x4d0c24;}function a165_0x29b4(){const _0x2ca91e=['from','posix','sha256:','startsWith','href','code','releaseLock','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','4450824BqlufZ','dirname','isDirectory','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','size','concat','165ubjljG','basename','get','readFile','readdir','2OINkXF','protocol','content-length','3073074KRlQSH','digest','read','sha256','validation','lstat','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','utf8','package.json','Use\x20a\x20different\x20project\x20name.',',\x20received\x20','mkdir','project','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','hex','mkdtemp','2736HtZZpw','application/zip','isSafeInteger','605427jfRzfr','12832BhLijU','21052JGeshu','origin','extracting','https:','toLowerCase','pathname','trim','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','ENOENT','cancel','downloading','EEXIST','name','abort','projectTemplate','number','object','11sTLstM','status','version','message','test','signal','sub-app-react-demo','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','2465590bUcUXm','parse','238871XNaalM','ino','arrayBuffer','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','isFinite','dev','resolving','byteLength','body','join','length','Project\x20directory\x20already\x20exists:\x20','template.zip'];a165_0x29b4=function(){return _0x2ca91e;};return a165_0x29b4();}
|
|
1
|
+
const a163_0x52bf4c=a163_0x11da;(function(_0x187ea4,_0x3e5a6f){const _0x4d5540=a163_0x11da,_0x3890a0=_0x187ea4();while(!![]){try{const _0x4e79b7=parseInt(_0x4d5540(0xe0))/0x1+parseInt(_0x4d5540(0xfb))/0x2*(-parseInt(_0x4d5540(0x104))/0x3)+-parseInt(_0x4d5540(0x102))/0x4+-parseInt(_0x4d5540(0xcb))/0x5*(parseInt(_0x4d5540(0xf6))/0x6)+parseInt(_0x4d5540(0x11c))/0x7*(-parseInt(_0x4d5540(0xff))/0x8)+parseInt(_0x4d5540(0xe8))/0x9*(-parseInt(_0x4d5540(0xfe))/0xa)+parseInt(_0x4d5540(0xc2))/0xb*(parseInt(_0x4d5540(0xbc))/0xc);if(_0x4e79b7===_0x3e5a6f)break;else _0x3890a0['push'](_0x3890a0['shift']());}catch(_0x34cbdc){_0x3890a0['push'](_0x3890a0['shift']());}}}(a163_0x4631,0x1a1b6));import{createHash}from'node:crypto';import a163_0x891a36 from'node:fs/promises';import a163_0x5cac4d 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=a163_0x52bf4c(0xed),ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function a163_0x4631(){const _0x45380f=['sha256:','object','downloading','ENOENT','isDirectory','byteLength','version','cdn','.git','startsWith','mkdir','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','extracting','7GeFLPj','from','code','string','copying','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','resolving','package.json','lstat','.rabetbase.json','Invalid\x20local\x20template\x20source:\x20','trim','digest','.lovrabet.json','read','projectTemplate','.idea','message','abort','8304uwhIdZ','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','parse','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','isAbsolute','arrayBuffer','8437HSfQzo','realpath','access','isFinite','dev','join','template.zip','test','ino','64675GRToct','validation','pathname','Unable\x20to\x20claim\x20the\x20project\x20directory.','dirname','sha256','Local\x20template\x20source\x20does\x20not\x20exist:\x20','mode','hex','name','.rabetbase-create-','isSafeInteger','.env.','node_modules','Check\x20the\x20source\x20directory\x20and\x20retry.','EEXIST','readdir','basename','length','isSymbolicLink','Project\x20directory\x20already\x20exists:\x20','161689sQBZDy','.DS_Store','push','includes','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','.env.example','protocol','copyFile','1217799ZIupFM','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','mkdtemp','rename','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','sub-app-react-demo','has','chmod','cancel','local','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','number','toLowerCase','get','6fSFltG','resolve','getReader','https:','posix','2dGFMpB','origin','Project\x20template\x20package.json\x20is\x20invalid.','10sYseJn','1427784rlEgGx','update','project','225256Fgbsgq','Use\x20a\x20different\x20project\x20name.','607458OgWNWr','size','relative','readFile','.lovrabet.log','dist','href','.codegraph','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','body','headers'];a163_0x4631=function(){return _0x45380f;};return a163_0x4631();}function nonEmptyString(_0x32320c){const _0x4ba641=a163_0x52bf4c;return typeof _0x32320c===_0x4ba641(0x11f)&&_0x32320c[_0x4ba641(0x128)]()?_0x32320c[_0x4ba641(0x128)]():null;}function parseDescriptor(_0x248d6f){const _0x212b6c=a163_0x52bf4c;if(!_0x248d6f||typeof _0x248d6f!==_0x212b6c(0x110))throw new Error('CDN\x20config\x20does\x20not\x20define\x20template\x20\x22'+TEMPLATE_ID+'\x22.');const _0x3fcb90=_0x248d6f,_0x592c74=nonEmptyString(_0x3fcb90[_0x212b6c(0x115)]),_0x5a8758=nonEmptyString(_0x3fcb90[_0x212b6c(0xd4)]),_0x4bfbc9=nonEmptyString(_0x3fcb90['sha256'])?.[_0x212b6c(0xf4)](),_0x1224c6=_0x3fcb90['size'];if(!_0x592c74||!_0x5a8758||_0x5a8758!==a163_0x5cac4d[_0x212b6c(0xfa)][_0x212b6c(0xdc)](_0x5a8758)||_0x5a8758[_0x212b6c(0xe3)]('\x5c')||!_0x4bfbc9||!/^sha256:[a-f0-9]{64}$/[_0x212b6c(0xc9)](_0x4bfbc9)||typeof _0x1224c6!==_0x212b6c(0xf3)||!Number[_0x212b6c(0xd6)](_0x1224c6)||_0x1224c6<=0x0||_0x1224c6>MAX_ARCHIVE_SIZE)throw new Error(_0x212b6c(0xec)+TEMPLATE_ID+'\x22.');return{'version':_0x592c74,'name':_0x5a8758,'sha256':_0x4bfbc9,'size':_0x1224c6};}async function fetchWithTimeout(_0x30c79f,_0x5246f8,_0x1794a1,_0x28f46a){const _0x3e52f2=a163_0x52bf4c,_0x3e4e41=new AbortController(),_0x495788=setTimeout(()=>_0x3e4e41[_0x3e52f2(0xbb)](),_0x5246f8);try{const _0x342636=await fetch(_0x30c79f,{'headers':{'Accept':_0x1794a1},'signal':_0x3e4e41['signal']});return await _0x28f46a(_0x342636);}finally{clearTimeout(_0x495788);}}async function fetchTemplateDescriptor(){const _0x1f538d=a163_0x52bf4c,_0x58db4a=await getRabetbaseCdnConfig();if(!_0x58db4a)throw new Error(_0x1f538d(0xf2));return parseDescriptor(_0x58db4a[_0x1f538d(0x12c)]);}function resolveArchiveUrl(_0x33f706){const _0x4dd9f3=a163_0x52bf4c,_0x4314db=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x46e45a=new URL(_0x33f706,_0x4314db);if(_0x46e45a[_0x4dd9f3(0xe6)]!==_0x4dd9f3(0xf9)||_0x46e45a['origin']!==_0x4314db[_0x4dd9f3(0xfc)]||!_0x46e45a['pathname'][_0x4dd9f3(0x118)](_0x4314db[_0x4dd9f3(0xcd)]))throw new Error(_0x4dd9f3(0xbd));return _0x46e45a[_0x4dd9f3(0x10a)];}async function readResponseBytes(_0x46b82a,_0x2bafd1){const _0xc9a98f=a163_0x52bf4c;if(!_0x46b82a[_0xc9a98f(0x10d)]){const _0x37b4c3=Buffer['from'](await _0x46b82a[_0xc9a98f(0xc1)]());if(_0x37b4c3[_0xc9a98f(0xdd)]>_0x2bafd1)throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');return _0x37b4c3;}const _0x2c418c=_0x46b82a[_0xc9a98f(0x10d)][_0xc9a98f(0xf8)](),_0x245e08=[];let _0x2c54c4=0x0;try{while(!![]){const {done:_0x24ce56,value:_0x557094}=await _0x2c418c[_0xc9a98f(0x12b)]();if(_0x24ce56)break;_0x2c54c4+=_0x557094[_0xc9a98f(0x114)];if(_0x2c54c4>_0x2bafd1){await _0x2c418c[_0xc9a98f(0xf0)]();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x245e08[_0xc9a98f(0xe2)](Buffer[_0xc9a98f(0x11d)](_0x557094));}}finally{_0x2c418c['releaseLock']();}return Buffer['concat'](_0x245e08,_0x2c54c4);}async function downloadArchive(_0x17b396,_0x58c06d,_0x1752ba){const _0x3b6b23=a163_0x52bf4c,_0x4f4432=await fetchWithTimeout(resolveArchiveUrl(_0x17b396[_0x3b6b23(0xd4)]),ARCHIVE_TIMEOUT_MS,'application/zip',async _0x3ec4ab=>{const _0x1e0916=_0x3b6b23;if(!_0x3ec4ab['ok'])throw new Error(_0x1e0916(0xe9)+_0x3ec4ab['status']+'.');const _0x305ec6=Number(_0x3ec4ab[_0x1e0916(0x10e)][_0x1e0916(0xf5)]('content-length'));if(Number[_0x1e0916(0xc5)](_0x305ec6)&&_0x305ec6>MAX_ARCHIVE_SIZE)throw new Error(_0x1e0916(0x121));return readResponseBytes(_0x3ec4ab,_0x17b396[_0x1e0916(0x105)]);});if(_0x4f4432[_0x3b6b23(0xdd)]!==_0x17b396[_0x3b6b23(0x105)])throw new Error('CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20'+_0x17b396[_0x3b6b23(0x105)]+',\x20received\x20'+_0x4f4432['length']+'.');_0x1752ba?.('verifying');const _0x4a1d73=_0x3b6b23(0x10f)+createHash(_0x3b6b23(0xd0))[_0x3b6b23(0x100)](_0x4f4432)[_0x3b6b23(0x129)](_0x3b6b23(0xd3));if(_0x4a1d73!==_0x17b396[_0x3b6b23(0xd0)])throw new Error(_0x3b6b23(0xbf));await a163_0x891a36['writeFile'](_0x58c06d,_0x4f4432,{'flag':'wx'});}async function assertTemplateRoot(_0x5c8faa){const _0x5ce4a8=a163_0x52bf4c,_0x57b51a=a163_0x5cac4d['join'](_0x5c8faa,_0x5ce4a8(0x124)),_0x25185c=JSON[_0x5ce4a8(0xbe)](await a163_0x891a36[_0x5ce4a8(0x107)](_0x57b51a,'utf8'));if(!_0x25185c||typeof _0x25185c!==_0x5ce4a8(0x110))throw new Error(_0x5ce4a8(0xfd));}const LOCAL_FORBIDDEN_NAMES=new Set([a163_0x52bf4c(0xe1),a163_0x52bf4c(0x10b),a163_0x52bf4c(0x117),a163_0x52bf4c(0x12d),a163_0x52bf4c(0x12a),a163_0x52bf4c(0x108),'.rabetbase',a163_0x52bf4c(0x126),a163_0x52bf4c(0x109),a163_0x52bf4c(0xd8)]);function isForbiddenTemplateEntry(_0x5be07f){const _0x598e53=a163_0x52bf4c;if(LOCAL_FORBIDDEN_NAMES[_0x598e53(0xee)](_0x5be07f))return!![];return _0x5be07f==='.env'||_0x5be07f[_0x598e53(0x118)](_0x598e53(0xd7))&&_0x5be07f!==_0x598e53(0xe5);}function containsPath(_0x28faea,_0x51ffa5){const _0x2b97af=a163_0x52bf4c,_0x23c515=a163_0x5cac4d[_0x2b97af(0x106)](_0x28faea,_0x51ffa5);return _0x23c515===''||!_0x23c515[_0x2b97af(0x118)]('..'+a163_0x5cac4d['sep'])&&_0x23c515!=='..'&&!a163_0x5cac4d[_0x2b97af(0xc0)](_0x23c515);}async function copyLocalTemplateDirectory(_0x10d51c,_0x443226){const _0x577bde=a163_0x52bf4c;await a163_0x891a36[_0x577bde(0x119)](_0x443226,{'recursive':!![]});for(const _0x41d32a of await a163_0x891a36['readdir'](_0x10d51c,{'withFileTypes':!![]})){const _0x568faf=a163_0x5cac4d[_0x577bde(0xc7)](_0x10d51c,_0x41d32a['name']),_0x3b58ad=a163_0x5cac4d['join'](_0x443226,_0x41d32a[_0x577bde(0xd4)]);if(isForbiddenTemplateEntry(_0x41d32a[_0x577bde(0xd4)]))throw new Error(_0x577bde(0x11a)+_0x568faf);const _0x30ce78=await a163_0x891a36[_0x577bde(0x125)](_0x568faf);if(_0x30ce78[_0x577bde(0xde)]())throw new Error(_0x577bde(0x10c)+_0x568faf);if(_0x30ce78[_0x577bde(0x113)]()){await copyLocalTemplateDirectory(_0x568faf,_0x3b58ad);continue;}if(!_0x30ce78['isFile']())continue;await a163_0x891a36[_0x577bde(0xe7)](_0x568faf,_0x3b58ad),await a163_0x891a36[_0x577bde(0xef)](_0x3b58ad,_0x30ce78[_0x577bde(0xd2)]&0x1ff);}}async function readTemplateVersion(_0xb048f5){const _0x44aa55=a163_0x52bf4c,_0xecf835=JSON[_0x44aa55(0xbe)](await a163_0x891a36[_0x44aa55(0x107)](a163_0x5cac4d[_0x44aa55(0xc7)](_0xb048f5,_0x44aa55(0x124)),'utf8'));return nonEmptyString(_0xecf835[_0x44aa55(0x115)])||_0x44aa55(0xf1);}async function readDirectoryIdentity(_0x3c8492){const _0x548e66=a163_0x52bf4c;try{const _0x5487ea=await a163_0x891a36[_0x548e66(0x125)](_0x3c8492);if(!_0x5487ea[_0x548e66(0x113)]())return null;return{'dev':_0x5487ea[_0x548e66(0xc6)],'ino':_0x5487ea['ino']};}catch{return null;}}async function commitStagedProject(_0x58b576,_0xdb9cf9){const _0x16add1=a163_0x52bf4c;await a163_0x891a36['mkdir'](_0xdb9cf9);const _0x2a3324=await readDirectoryIdentity(_0xdb9cf9);if(!_0x2a3324)throw new Error(_0x16add1(0xce));try{for(const _0x48c366 of await a163_0x891a36[_0x16add1(0xdb)](_0x58b576)){await a163_0x891a36[_0x16add1(0xeb)](a163_0x5cac4d['join'](_0x58b576,_0x48c366),a163_0x5cac4d['join'](_0xdb9cf9,_0x48c366));}}catch(_0x3ee556){const _0x376896=await readDirectoryIdentity(_0xdb9cf9);_0x376896?.[_0x16add1(0xc6)]===_0x2a3324[_0x16add1(0xc6)]&&_0x376896[_0x16add1(0xca)]===_0x2a3324[_0x16add1(0xca)]&&await a163_0x891a36['rm'](_0xdb9cf9,{'recursive':!![],'force':!![]});throw _0x3ee556;}}export async function materializeProjectTemplate(_0x30bb99,_0x108571){const _0x16e314=a163_0x52bf4c,_0x480287=a163_0x5cac4d['resolve'](_0x30bb99),_0x238e1d=a163_0x5cac4d[_0x16e314(0xcf)](_0x480287);try{await a163_0x891a36['lstat'](_0x480287);throw new Error(_0x16e314(0xdf)+_0x480287);}catch(_0x3803a2){if(_0x3803a2[_0x16e314(0x11e)]!==_0x16e314(0x112))throw _0x3803a2;}const _0x47a6cf=await a163_0x891a36[_0x16e314(0xea)](a163_0x5cac4d[_0x16e314(0xc7)](_0x238e1d,_0x16e314(0xd5))),_0x41f918=a163_0x5cac4d['join'](_0x47a6cf,_0x16e314(0x101)),_0x31d294=a163_0x5cac4d['join'](_0x47a6cf,_0x16e314(0xc8));try{try{_0x108571?.(_0x16e314(0x123));const _0xbd1bce=await fetchTemplateDescriptor();return _0x108571?.(_0x16e314(0x111)),await downloadArchive(_0xbd1bce,_0x31d294,_0x108571),_0x108571?.(_0x16e314(0x11b)),await extractProjectTemplateArchive(_0x31d294,_0x41f918),await assertTemplateRoot(_0x41f918),await commitStagedProject(_0x41f918,_0x480287),{'source':_0x16e314(0x116),'version':_0xbd1bce[_0x16e314(0x115)]};}catch(_0x21d21c){if(_0x21d21c['code']===_0x16e314(0xda))throw CliErrors[_0x16e314(0xcc)]('Project\x20directory\x20already\x20exists:\x20'+_0x480287,_0x16e314(0x103));const _0x5b803b=_0x21d21c instanceof Error?_0x21d21c['message']:String(_0x21d21c);throw CliErrors[_0x16e314(0xcc)]('Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.',_0x16e314(0x122)+_0x5b803b);}}finally{await a163_0x891a36['rm'](_0x47a6cf,{'recursive':!![],'force':!![]});}}function a163_0x11da(_0x174077,_0x2b191c){_0x174077=_0x174077-0xba;const _0x4631c8=a163_0x4631();let _0x11da60=_0x4631c8[_0x174077];return _0x11da60;}export async function materializeLocalProjectTemplate(_0x4578bc,_0x552d44,_0x34cd41){const _0x46a952=a163_0x52bf4c;let _0x4912fe;try{_0x4912fe=await a163_0x891a36[_0x46a952(0xc3)](a163_0x5cac4d[_0x46a952(0xf7)](_0x4578bc));}catch{throw CliErrors['validation'](_0x46a952(0xd1)+a163_0x5cac4d[_0x46a952(0xf7)](_0x4578bc),'Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.');}const _0x2272d8=await a163_0x891a36[_0x46a952(0x125)](_0x4912fe);if(!_0x2272d8[_0x46a952(0x113)]())throw CliErrors[_0x46a952(0xcc)]('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0x4912fe);const _0x58dbc1=a163_0x5cac4d['resolve'](_0x552d44),_0x40f3d4=await a163_0x891a36[_0x46a952(0xc3)](a163_0x5cac4d['dirname'](_0x58dbc1)),_0x403039=a163_0x5cac4d[_0x46a952(0xc7)](_0x40f3d4,a163_0x5cac4d['basename'](_0x58dbc1));if(containsPath(_0x4912fe,_0x403039)||containsPath(_0x403039,_0x4912fe))throw CliErrors['validation']('Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.',_0x46a952(0xe4));try{await a163_0x891a36[_0x46a952(0x125)](_0x403039);throw CliErrors[_0x46a952(0xcc)]('Project\x20directory\x20already\x20exists:\x20'+_0x403039,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x3f85c5){if(_0x3f85c5[_0x46a952(0x11e)]!==_0x46a952(0x112))throw _0x3f85c5;}const _0x586830=a163_0x5cac4d[_0x46a952(0xcf)](_0x403039);await a163_0x891a36[_0x46a952(0xc4)](_0x586830);const _0x2750e2=await a163_0x891a36['mkdtemp'](a163_0x5cac4d['join'](_0x586830,_0x46a952(0xd5))),_0x259d9d=a163_0x5cac4d[_0x46a952(0xc7)](_0x2750e2,_0x46a952(0x101));try{_0x34cd41?.(_0x46a952(0x120)),await copyLocalTemplateDirectory(_0x4912fe,_0x259d9d),await assertTemplateRoot(_0x259d9d);const _0x40221f=await readTemplateVersion(_0x259d9d);return await commitStagedProject(_0x259d9d,_0x403039),{'source':_0x46a952(0xf1),'version':_0x40221f};}catch(_0x3c1059){const _0x529ed8=_0x3c1059 instanceof Error?_0x3c1059[_0x46a952(0xba)]:String(_0x3c1059);throw CliErrors[_0x46a952(0xcc)](_0x46a952(0x127)+_0x529ed8,_0x46a952(0xd9));}finally{await a163_0x891a36['rm'](_0x2750e2,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d0fae,_0x58fb04){const _0x37ff7c=a164_0x2a52,_0x47d4b5=_0x2d0fae();while(!![]){try{const _0x72991c=-parseInt(_0x37ff7c(0x1f1))/0x1*(-parseInt(_0x37ff7c(0x1ed))/0x2)+parseInt(_0x37ff7c(0x1eb))/0x3*(parseInt(_0x37ff7c(0x1f0))/0x4)+-parseInt(_0x37ff7c(0x1ee))/0x5*(-parseInt(_0x37ff7c(0x1f3))/0x6)+parseInt(_0x37ff7c(0x1e5))/0x7+parseInt(_0x37ff7c(0x1ef))/0x8+-parseInt(_0x37ff7c(0x1e8))/0x9+-parseInt(_0x37ff7c(0x1f2))/0xa*(parseInt(_0x37ff7c(0x1e4))/0xb);if(_0x72991c===_0x58fb04)break;else _0x47d4b5['push'](_0x47d4b5['shift']());}catch(_0x1abbbf){_0x47d4b5['push'](_0x47d4b5['shift']());}}}(a164_0x1501,0xdf921));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 a164_0x1501(){const _0x23d736=['561pLhhzC','8444149ZpTixc','validation','Project\x20name\x20\x22','15677595zoYTrv','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','Project\x20name\x20cannot\x20exceed\x20','3XscirK','length','24jgSXqA','5Xfkslu','11947296WlxqPp','3787684dmYvFM','86809OMVSKF','484370CEZRJu','2637834UXTERf','test','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','\x20characters'];a164_0x1501=function(){return _0x23d736;};return a164_0x1501();}export function getProjectNameValidationError(_0x1dd42){const _0x12b94a=a164_0x2a52,_0x37e30e=_0x1dd42['trim']();if(!_0x37e30e)return'Project\x20name\x20cannot\x20be\x20empty';if(_0x37e30e[_0x12b94a(0x1ec)]>MAX_PROJECT_NAME_LENGTH)return _0x12b94a(0x1ea)+MAX_PROJECT_NAME_LENGTH+_0x12b94a(0x1f6);if(!PROJECT_NAME_PATTERN[_0x12b94a(0x1f4)](_0x37e30e))return _0x12b94a(0x1f5);if(WINDOWS_RESERVED_NAME[_0x12b94a(0x1f4)](_0x37e30e))return _0x12b94a(0x1e7)+_0x37e30e+'\x22\x20is\x20reserved\x20on\x20Windows';return null;}function a164_0x2a52(_0x5abc83,_0x4e8bf8){_0x5abc83=_0x5abc83-0x1e4;const _0x15017d=a164_0x1501();let _0x2a52d5=_0x15017d[_0x5abc83];return _0x2a52d5;}export function validateProjectName(_0x4262fc){const _0x4744c6=a164_0x2a52,_0x3bde46=_0x4262fc['trim'](),_0x56c7d9=getProjectNameValidationError(_0x3bde46);if(_0x56c7d9)throw CliErrors[_0x4744c6(0x1e6)](_0x56c7d9,_0x4744c6(0x1e9));return _0x3bde46;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46df07,_0x425036){const _0x2e105b=a165_0x1909,_0x2c402f=_0x46df07();while(!![]){try{const _0x5cbe58=parseInt(_0x2e105b(0x128))/0x1+parseInt(_0x2e105b(0x136))/0x2+parseInt(_0x2e105b(0x138))/0x3+parseInt(_0x2e105b(0x147))/0x4*(-parseInt(_0x2e105b(0x134))/0x5)+-parseInt(_0x2e105b(0x139))/0x6+parseInt(_0x2e105b(0x145))/0x7+-parseInt(_0x2e105b(0x122))/0x8*(-parseInt(_0x2e105b(0x144))/0x9);if(_0x5cbe58===_0x425036)break;else _0x2c402f['push'](_0x2c402f['shift']());}catch(_0x422430){_0x2c402f['push'](_0x2c402f['shift']());}}}(a165_0x472a,0xd6d00));import{createWriteStream}from'node:fs';import a165_0x29a259 from'node:fs/promises';import a165_0x21deb7 from'node:path';function a165_0x472a(){const _0x4a58d7=['once','replace','close','255aIfYoE','Case-conflicting\x20ZIP\x20entry\x20path:\x20','174720bJKQpn','readEntry','3027696IZAnyZ','4810272KBjUEp','isEncrypted','entry','test','\x20entries.','Unable\x20to\x20read\x20ZIP\x20entry:\x20','length','sep','end','toLocaleLowerCase','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.','261CQLlis','2681553exNXbI','mkdir','85132EVAYgl','Project\x20template\x20ZIP\x20exceeds\x20','resolve','set','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','endsWith','add','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','externalFileAttributes','ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20','split','226408JqMUBf','Unable\x20to\x20open\x20project\x20template\x20archive.','fileName','dirname','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','startsWith','466617YAFHhR','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','get','catch','has','en-US','open','join','openReadStream'];a165_0x472a=function(){return _0x4a58d7;};return a165_0x472a();}import{pipeline}from'node:stream/promises';import a165_0x1f6bdb from'yauzl';function a165_0x1909(_0x10b149,_0x1e2ad7){_0x10b149=_0x10b149-0x11c;const _0x472a85=a165_0x472a();let _0x1909bb=_0x472a85[_0x10b149];return _0x1909bb;}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(_0x47e588){return new Promise((_0xd0bdfc,_0xdeb874)=>{const _0x19508a=a165_0x1909;a165_0x1f6bdb[_0x19508a(0x12e)](_0x47e588,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x45cd76,_0x28b5bc)=>{const _0x45e8bd=_0x19508a;if(_0x45cd76||!_0x28b5bc){_0xdeb874(_0x45cd76||new Error(_0x45e8bd(0x123)));return;}_0xd0bdfc(_0x28b5bc);});});}function openEntryStream(_0x382999,_0x6abda4){return new Promise((_0x1aecba,_0x2320db)=>{const _0x3b9ab4=a165_0x1909;_0x382999[_0x3b9ab4(0x130)](_0x6abda4,(_0x3c4bd2,_0xf4e0cb)=>{const _0x3a3485=_0x3b9ab4;if(_0x3c4bd2||!_0xf4e0cb){_0x2320db(_0x3c4bd2||new Error(_0x3a3485(0x13e)+_0x6abda4[_0x3a3485(0x124)]));return;}_0x1aecba(_0xf4e0cb);});});}function validateEntryPath(_0x35c694){const _0x5d96d7=a165_0x1909,_0x596e7f=_0x35c694[_0x5d96d7(0x132)](/\\/g,'/'),_0x25862d=_0x596e7f[_0x5d96d7(0x11c)]('/'),_0x3dbb21=_0x25862d?_0x596e7f['slice'](0x0,-0x1):_0x596e7f;if(!_0x3dbb21||_0x596e7f[_0x5d96d7(0x127)]('/')||/^[A-Za-z]:\//['test'](_0x596e7f))throw new Error(_0x5d96d7(0x126)+_0x35c694);const _0x598325=_0x3dbb21[_0x5d96d7(0x121)]('/');for(const _0x3ef5af of _0x598325){if(!_0x3ef5af||_0x3ef5af==='.'||_0x3ef5af==='..'||_0x3ef5af[_0x5d96d7(0x11c)]('.')||_0x3ef5af[_0x5d96d7(0x11c)]('\x20')||WINDOWS_INVALID_CHAR[_0x5d96d7(0x13c)](_0x3ef5af)||WINDOWS_RESERVED_NAME[_0x5d96d7(0x13c)](_0x3ef5af))throw new Error(_0x5d96d7(0x129)+_0x35c694);}return{'relativePath':_0x598325[_0x5d96d7(0x12f)](a165_0x21deb7[_0x5d96d7(0x140)]),'directory':_0x25862d};}function isSymbolicLink(_0x3c7229){const _0x21287c=a165_0x1909,_0x5e8bde=_0x3c7229[_0x21287c(0x11f)]>>>0x10&0xffff;return(_0x5e8bde&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x274c60,_0x216a20){const _0x4dd055=a165_0x1909,_0x454ed0=await openZip(_0x274c60),_0x42d913=a165_0x21deb7[_0x4dd055(0x149)](_0x216a20),_0x52a5d7=new Set(),_0x36489f=new Map();let _0xfc9acf=0x0,_0x3f24c7=0x0;await a165_0x29a259[_0x4dd055(0x146)](_0x42d913,{'recursive':!![]}),await new Promise((_0x3a4767,_0x42ace5)=>{const _0x53f794=_0x4dd055;let _0x4897f1=![];const _0x23a167=_0x2a335c=>{const _0xa793e9=a165_0x1909;if(_0x4897f1)return;_0x4897f1=!![],_0x454ed0[_0xa793e9(0x133)](),_0x42ace5(_0x2a335c instanceof Error?_0x2a335c:new Error(String(_0x2a335c)));};_0x454ed0[_0x53f794(0x131)]('error',_0x23a167),_0x454ed0[_0x53f794(0x131)](_0x53f794(0x141),()=>{if(_0x4897f1)return;_0x4897f1=!![],_0x3a4767();}),_0x454ed0['on'](_0x53f794(0x13b),_0x32d213=>{const _0x54e963=_0x53f794;void(async()=>{const _0x1381b4=a165_0x1909;_0xfc9acf+=0x1,_0x3f24c7+=_0x32d213['uncompressedSize'];if(_0xfc9acf>MAX_ENTRY_COUNT)throw new Error(_0x1381b4(0x148)+MAX_ENTRY_COUNT+_0x1381b4(0x13d));if(_0x3f24c7>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x1381b4(0x143));if(_0x32d213[_0x1381b4(0x13a)]())throw new Error('Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20'+_0x32d213[_0x1381b4(0x124)]);if(isSymbolicLink(_0x32d213))throw new Error(_0x1381b4(0x11e)+_0x32d213[_0x1381b4(0x124)]);const {relativePath:_0x451b16,directory:_0x4f182e}=validateEntryPath(_0x32d213['fileName']),_0x40b1ea=_0x451b16['split'](a165_0x21deb7[_0x1381b4(0x140)]);for(let _0x5605b7=0x1;_0x5605b7<=_0x40b1ea[_0x1381b4(0x13f)];_0x5605b7+=0x1){const _0x2f638e=_0x40b1ea['slice'](0x0,_0x5605b7)[_0x1381b4(0x12f)](a165_0x21deb7[_0x1381b4(0x140)]),_0x856f2b=_0x2f638e['toLocaleLowerCase'](_0x1381b4(0x12d)),_0x4b9b93=_0x36489f[_0x1381b4(0x12a)](_0x856f2b);if(_0x4b9b93&&_0x4b9b93!==_0x2f638e)throw new Error(_0x1381b4(0x135)+_0x32d213[_0x1381b4(0x124)]);_0x36489f[_0x1381b4(0x14a)](_0x856f2b,_0x2f638e);}const _0x32f0a3=_0x451b16[_0x1381b4(0x142)](_0x1381b4(0x12d));if(_0x52a5d7[_0x1381b4(0x12c)](_0x32f0a3))throw new Error(_0x1381b4(0x14b)+_0x32d213[_0x1381b4(0x124)]);_0x52a5d7[_0x1381b4(0x11d)](_0x32f0a3);const _0xe5a37a=a165_0x21deb7[_0x1381b4(0x149)](_0x42d913,_0x451b16);if(_0xe5a37a!==_0x42d913&&!_0xe5a37a[_0x1381b4(0x127)](''+_0x42d913+a165_0x21deb7[_0x1381b4(0x140)]))throw new Error(_0x1381b4(0x120)+_0x32d213['fileName']);if(_0x4f182e)await a165_0x29a259[_0x1381b4(0x146)](_0xe5a37a,{'recursive':!![]});else{await a165_0x29a259[_0x1381b4(0x146)](a165_0x21deb7[_0x1381b4(0x125)](_0xe5a37a),{'recursive':!![]});const _0x554f4c=await openEntryStream(_0x454ed0,_0x32d213);await pipeline(_0x554f4c,createWriteStream(_0xe5a37a,{'flags':'wx','mode':0x1a4}));}_0x454ed0[_0x1381b4(0x137)]();})()[_0x54e963(0x12b)](_0x23a167);}),_0x454ed0[_0x53f794(0x137)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5468bd,_0x271d83){const _0x40cefb=a166_0x3eaf,_0x2d8faf=_0x5468bd();while(!![]){try{const _0x293a8c=-parseInt(_0x40cefb(0x135))/0x1*(-parseInt(_0x40cefb(0x132))/0x2)+parseInt(_0x40cefb(0x12e))/0x3*(parseInt(_0x40cefb(0x136))/0x4)+parseInt(_0x40cefb(0x133))/0x5+parseInt(_0x40cefb(0x12f))/0x6+parseInt(_0x40cefb(0x130))/0x7+-parseInt(_0x40cefb(0x134))/0x8+-parseInt(_0x40cefb(0x131))/0x9;if(_0x293a8c===_0x271d83)break;else _0x2d8faf['push'](_0x2d8faf['shift']());}catch(_0x270907){_0x2d8faf['push'](_0x2d8faf['shift']());}}}(a166_0x4ce8,0x70e63));function a166_0x4ce8(){const _0x3c626d=['12FyOpdM','2272398qsYZqL','1753437fyVBPA','8993619VMHbxd','345554QytAlm','4451730vqKInw','3607592YUtjXK','1vCoHiC','220328PQbsYG','../../../../'];a166_0x4ce8=function(){return _0x3c626d;};return a166_0x4ce8();}import a166_0x567e87 from'node:path';function a166_0x3eaf(_0x204b05,_0x48e803){_0x204b05=_0x204b05-0x12e;const _0x4ce86a=a166_0x4ce8();let _0x3eaf73=_0x4ce86a[_0x204b05];return _0x3eaf73;}import{fileURLToPath}from'node:url';const __dirname=a166_0x567e87['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x254dbc=a166_0x3eaf;return a166_0x567e87['resolve'](__dirname,_0x254dbc(0x137));}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type ProjectTemplateProgress } from "../../../commands/project/create/materialize-project-template.js";
|
|
2
|
-
export declare function copyProjectTemplate(projectCode: string, onProgress?: ProjectTemplateProgress): Promise<string>;
|
|
2
|
+
export declare function copyProjectTemplate(projectCode: string, onProgress?: ProjectTemplateProgress, templateSource?: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31a68e,_0x51f3f2){const _0x1133d3=a167_0x1d5e,_0x575bf6=_0x31a68e();while(!![]){try{const _0x1069e7=parseInt(_0x1133d3(0xcf))/0x1+-parseInt(_0x1133d3(0xcd))/0x2*(-parseInt(_0x1133d3(0xcb))/0x3)+parseInt(_0x1133d3(0xc5))/0x4+parseInt(_0x1133d3(0xd0))/0x5+-parseInt(_0x1133d3(0xc8))/0x6*(parseInt(_0x1133d3(0xd1))/0x7)+parseInt(_0x1133d3(0xc2))/0x8*(-parseInt(_0x1133d3(0xca))/0x9)+-parseInt(_0x1133d3(0xce))/0xa;if(_0x1069e7===_0x51f3f2)break;else _0x575bf6['push'](_0x575bf6['shift']());}catch(_0x5ace79){_0x575bf6['push'](_0x575bf6['shift']());}}}(a167_0x4829,0xbbf39));function a167_0x1d5e(_0x2479cc,_0x2d8673){_0x2479cc=_0x2479cc-0xc2;const _0x4829bc=a167_0x4829();let _0x1d5ed0=_0x4829bc[_0x2479cc];return _0x1d5ed0;}import a167_0x14651e from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a167_0x4829(){const _0x491c2c=['2719678NUurNY','17974250SVirEy','1045085dprdSM','3837720wEpeHp','399lQFzmQ','now','67120mytbwm','error','resolve','3623772QXauMn','Project\x20template\x20created','copy','30126Bucjoc','Failed\x20to\x20copy\x20project\x20template','1314oLVeWh','3NwNcCx','info'];a167_0x4829=function(){return _0x491c2c;};return a167_0x4829();}export async function copyProjectTemplate(_0x54f124,_0x1cd09f,_0x1325c5){const _0x4ac25c=a167_0x1d5e,_0x3b9e96=Date[_0x4ac25c(0xd2)](),_0xf5b739=a167_0x14651e[_0x4ac25c(0xc4)](process['cwd'](),_0x54f124);try{logger[_0x4ac25c(0xcc)]('copy','Starting\x20project\x20template\x20creation',{'projectCode':_0x54f124});const _0x55e0f0=_0x1325c5?await materializeLocalProjectTemplate(_0x1325c5,_0xf5b739,_0x1cd09f):await materializeProjectTemplate(_0xf5b739,_0x1cd09f),_0x26dd55=Date['now']()-_0x3b9e96;logger['success'](_0x4ac25c(0xc7),_0x4ac25c(0xc6),_0x26dd55,{'projectCode':_0x54f124,'templateSource':_0x55e0f0['source'],'templateVersion':_0x55e0f0['version']});}catch(_0x2efcda){const _0x195044=Date['now']()-_0x3b9e96;logger[_0x4ac25c(0xc3)](_0x4ac25c(0xc7),_0x4ac25c(0xc9),{'projectCode':_0x54f124,'error':_0x2efcda instanceof Error?_0x2efcda['message']:String(_0x2efcda),'duration':_0x195044});throw _0x2efcda;}return formatElapsed(_0x3b9e96);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a168_0x3903(_0x4f2a89,_0x2feb96){_0x4f2a89=_0x4f2a89-0xd9;const _0xb673dd=a168_0xb673();let _0x390376=_0xb673dd[_0x4f2a89];return _0x390376;}(function(_0x514f6d,_0x437308){const _0x15f3a1=a168_0x3903,_0x444fec=_0x514f6d();while(!![]){try{const _0x28ac3f=parseInt(_0x15f3a1(0xda))/0x1*(-parseInt(_0x15f3a1(0xec))/0x2)+parseInt(_0x15f3a1(0xe2))/0x3+-parseInt(_0x15f3a1(0xe4))/0x4*(parseInt(_0x15f3a1(0xdd))/0x5)+-parseInt(_0x15f3a1(0xe7))/0x6+-parseInt(_0x15f3a1(0xe6))/0x7*(-parseInt(_0x15f3a1(0xe5))/0x8)+-parseInt(_0x15f3a1(0xe9))/0x9+parseInt(_0x15f3a1(0xed))/0xa;if(_0x28ac3f===_0x437308)break;else _0x444fec['push'](_0x444fec['shift']());}catch(_0x34d529){_0x444fec['push'](_0x444fec['shift']());}}}(a168_0xb673,0xaee4d));import a168_0x44bf51 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a168_0xb673(){const _0xee1e76=['message','1696203sXHEmA','prettier','Code\x20format\x20completed','86542iwHWlV','26235850UjHnQY','format','31wRhdgJ','error','info','2760145aTShXe','cwd','Code\x20format\x20failed','--write','npx','2612055kPkHCn','now','4ozXcIx','7944ztAudx','497rcyBQe','4599066YFPWhl'];a168_0xb673=function(){return _0xee1e76;};return a168_0xb673();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x4c079c){const _0x35c515=a168_0x3903,_0x106d4f=Date[_0x35c515(0xe3)](),_0x2ac118=a168_0x44bf51['resolve'](process[_0x35c515(0xde)](),_0x4c079c);try{logger[_0x35c515(0xdc)](_0x35c515(0xd9),'Starting\x20code\x20format',{'projectCode':_0x4c079c}),await execa(resolveNpmBin(_0x35c515(0xe1)),[_0x35c515(0xea),_0x35c515(0xe0),'.'],{'cwd':_0x2ac118});const _0x5d107b=Date[_0x35c515(0xe3)]()-_0x106d4f;logger['success'](_0x35c515(0xd9),_0x35c515(0xeb),_0x5d107b,{'projectCode':_0x4c079c});}catch(_0x3e4cbb){const _0x74b138=Date['now']()-_0x106d4f;logger[_0x35c515(0xdb)](_0x35c515(0xd9),_0x35c515(0xdf),{'projectCode':_0x4c079c,'error':_0x3e4cbb instanceof Error?_0x3e4cbb[_0x35c515(0xe8)]:String(_0x3e4cbb),'duration':_0x74b138});throw _0x3e4cbb;}return formatElapsed(_0x106d4f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c56e9,_0x2b68ed){const _0x115be3=a169_0x436f,_0x3287ef=_0x3c56e9();while(!![]){try{const _0x5506e5=-parseInt(_0x115be3(0x16e))/0x1+parseInt(_0x115be3(0x16f))/0x2+-parseInt(_0x115be3(0x174))/0x3+-parseInt(_0x115be3(0x17b))/0x4+parseInt(_0x115be3(0x179))/0x5+parseInt(_0x115be3(0x173))/0x6*(parseInt(_0x115be3(0x16b))/0x7)+-parseInt(_0x115be3(0x16a))/0x8*(-parseInt(_0x115be3(0x16d))/0x9);if(_0x5506e5===_0x2b68ed)break;else _0x3287ef['push'](_0x3287ef['shift']());}catch(_0x24331c){_0x3287ef['push'](_0x3287ef['shift']());}}}(a169_0x5892,0x641ea));import a169_0x2c6808 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a169_0x5892(){const _0xde7913=['1240062MHPnzO','--registry','cwd','resolve','Dependency\x20install\x20failed','3610675DRjzGX','error','863268xjwVzs','now','install','13400RlTJvi','623AujNWF','Dependency\x20install\x20completed','1395aGfdfH','342247wKeHTZ','99778apumBa','info','message','https://registry.npmmirror.com','23586iPJspK'];a169_0x5892=function(){return _0xde7913;};return a169_0x5892();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a169_0x436f(_0x4e8cef,_0x240526){_0x4e8cef=_0x4e8cef-0x16a;const _0x5892c3=a169_0x5892();let _0x436f00=_0x5892c3[_0x4e8cef];return _0x436f00;}export async function installDependencies(_0x586ca8){const _0x1fca0e=a169_0x436f,_0x3e81d7=Date['now'](),_0x4cb237=a169_0x2c6808[_0x1fca0e(0x177)](process[_0x1fca0e(0x176)](),_0x586ca8);try{logger[_0x1fca0e(0x170)](_0x1fca0e(0x17d),'Starting\x20dependency\x20install',{'projectCode':_0x586ca8,'registry':_0x1fca0e(0x172)}),await execa(resolveNpmBin('npm'),[_0x1fca0e(0x17d),_0x1fca0e(0x175),_0x1fca0e(0x172)],{'cwd':_0x4cb237});const _0x5a151d=Date['now']()-_0x3e81d7;logger['success'](_0x1fca0e(0x17d),_0x1fca0e(0x16c),_0x5a151d,{'projectCode':_0x586ca8});}catch(_0x8acd7){const _0x6fd4a9=Date[_0x1fca0e(0x17c)]()-_0x3e81d7;logger[_0x1fca0e(0x17a)](_0x1fca0e(0x17d),_0x1fca0e(0x178),{'projectCode':_0x586ca8,'error':_0x8acd7 instanceof Error?_0x8acd7[_0x1fca0e(0x171)]:String(_0x8acd7),'duration':_0x6fd4a9});throw _0x8acd7;}return formatElapsed(_0x3e81d7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a170_0x5120(_0x294473,_0x315da6){_0x294473=_0x294473-0x95;const _0x3206fa=a170_0x3206();let _0x5120bd=_0x3206fa[_0x294473];return _0x5120bd;}const a170_0x53dee8=a170_0x5120;function a170_0x3206(){const _0x257281=['create','boolean','cookie','trim','Skip\x20confirmation\x20prompt','../../commands/project/create/main.js','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','5191459pxnBXU','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','template-source','project-name','appcode','5295858EqXVcF','Target\x20environment','project','env','validation','name','197415JnfuvY','upgrade','1795020nuduCT','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','str','write','Create\x20a\x20new\x20project','args','yes','Prepared\x20local\x20project\x20template\x20directory','string','2864984XrzSwe','5955chLGpe','10YDsYnd','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20','Project\x20name','1684320oriWKP','nonInteractive'];a170_0x3206=function(){return _0x257281;};return a170_0x3206();}(function(_0x1f1a7d,_0x15d595){const _0x333c6e=a170_0x5120,_0x4a3170=_0x1f1a7d();while(!![]){try{const _0x4c6e0b=parseInt(_0x333c6e(0xaf))/0x1*(-parseInt(_0x333c6e(0xb0))/0x2)+parseInt(_0x333c6e(0xb4))/0x3+-parseInt(_0x333c6e(0xa5))/0x4+parseInt(_0x333c6e(0xa3))/0x5+parseInt(_0x333c6e(0x9d))/0x6+-parseInt(_0x333c6e(0x98))/0x7+parseInt(_0x333c6e(0xae))/0x8;if(_0x4c6e0b===_0x15d595)break;else _0x4a3170['push'](_0x4a3170['shift']());}catch(_0x55f062){_0x4a3170['push'](_0x4a3170['shift']());}}}(a170_0x3206,0x97bd2));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a170_0x53dee8(0xa2),'type':'string','description':a170_0x53dee8(0xb3)},{'name':'env','type':a170_0x53dee8(0xad),'description':a170_0x53dee8(0x9e)},{'name':a170_0x53dee8(0x9c),'type':a170_0x53dee8(0xad),'description':a170_0x53dee8(0xa6)},{'name':'template-source','type':a170_0x53dee8(0xad),'description':a170_0x53dee8(0xac)}],upgradeFlags=[{'name':'yes','type':a170_0x53dee8(0xb7),'description':a170_0x53dee8(0x95),'default':![]}];export const projectDefinitions=[{'service':a170_0x53dee8(0x9f),'command':a170_0x53dee8(0xb6),'description':a170_0x53dee8(0xa9),'risk':a170_0x53dee8(0xa8),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a170_0x53dee8(0x9b),'description':a170_0x53dee8(0x99),'required':![]}],'flags':createFlags,async 'execute'(_0xb90f2f){const _0x329ff6=a170_0x53dee8,{createApp:_0x1df285}=await import(_0x329ff6(0x96)),_0x8621e8=_0xb90f2f[_0x329ff6(0xa7)]('name')['trim']()||_0xb90f2f[_0x329ff6(0xaa)][0x0]?.[_0x329ff6(0xb9)](),_0x11eadd=_0xb90f2f[_0x329ff6(0xa7)](_0x329ff6(0xa0))||undefined,_0x329b90=_0xb90f2f[_0x329ff6(0xa7)](_0x329ff6(0x9c))||undefined,_0x364248=_0xb90f2f[_0x329ff6(0xa7)](_0x329ff6(0x9a))[_0x329ff6(0xb9)]()||undefined;if(_0xb90f2f[_0x329ff6(0xb5)]){if(!_0x8621e8)throw CliErrors[_0x329ff6(0xa1)](_0x329ff6(0xb1),_0x329ff6(0xb2)+CLI_BIN_NAME+_0x329ff6(0x97));await _0x1df285({'projectCode':_0x8621e8,'appCode':_0x329b90,'env':_0x11eadd,'cookie':_0xb90f2f[_0x329ff6(0xb8)],'nonInteractive':!![],'templateSource':_0x364248});}else await _0x1df285({'projectCode':_0x8621e8,'appCode':_0x329b90,'env':_0x11eadd,'cookie':_0xb90f2f[_0x329ff6(0xb8)],'templateSource':_0x364248});return{'ok':!![]};}},{'service':a170_0x53dee8(0x9f),'command':a170_0x53dee8(0xa4),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2c1f7a){const _0x2e568d=a170_0x53dee8;return await upgradeApp(_0x2c1f7a[_0x2e568d(0xb5)],{'yes':_0x2c1f7a['bool'](_0x2e568d(0xab))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a173_0x1421ab=a173_0x3fb9;(function(_0x50f051,_0x103818){const _0x3a1deb=a173_0x3fb9,_0x1a7273=_0x50f051();while(!![]){try{const _0x4f030e=-parseInt(_0x3a1deb(0x134))/0x1+-parseInt(_0x3a1deb(0x1a0))/0x2+parseInt(_0x3a1deb(0x198))/0x3*(-parseInt(_0x3a1deb(0x19a))/0x4)+-parseInt(_0x3a1deb(0x130))/0x5+parseInt(_0x3a1deb(0x197))/0x6+parseInt(_0x3a1deb(0x143))/0x7*(-parseInt(_0x3a1deb(0x13c))/0x8)+parseInt(_0x3a1deb(0x13f))/0x9;if(_0x4f030e===_0x103818)break;else _0x1a7273['push'](_0x1a7273['shift']());}catch(_0x5c4dab){_0x1a7273['push'](_0x1a7273['shift']());}}}(a173_0x5241,0xddb1f));import a173_0x465c40 from'chalk';import a173_0x9eba5e from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a173_0x3fb9(_0x1dfac0,_0x4948da){_0x1dfac0=_0x1dfac0-0x12e;const _0x524113=a173_0x5241();let _0x3fb965=_0x524113[_0x1dfac0];return _0x3fb965;}import{CONFIG_NAMES,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=CONFIG_NAMES[a173_0x1421ab(0x19c)](_0x222cb5=>_0x222cb5!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x58af59){const _0x3031c9=a173_0x1421ab,_0x8137b6=[];for(const _0x4f4a35 of Object[_0x3031c9(0x151)](CORE_IDE_CONFIGS)){if(_0x4f4a35[_0x3031c9(0x18c)])for(const _0x21e48d of _0x4f4a35[_0x3031c9(0x18c)]){_0x8137b6[_0x3031c9(0x1a3)](resolve(_0x58af59,_0x21e48d[_0x3031c9(0x14c)]));}}return _0x8137b6;}function analyse(_0x3a4972){const _0x1e3fc0=a173_0x1421ab;let _0x54b199=null;const _0x3e3495=resolve(_0x3a4972,NEW_CONFIG_NAME),_0x160f76=existsSync(_0x3e3495);for(const _0x22ea0c of LEGACY_CONFIG_NAMES){const _0x41f059=resolve(_0x3a4972,_0x22ea0c);if(existsSync(_0x41f059)){const _0x1b8ae8=readConfigFile(_0x41f059),_0x79c357=Object[_0x1e3fc0(0x176)](_0x1b8ae8)[_0x1e3fc0(0x19c)](_0xcbd54b=>typeof _0x1b8ae8[_0xcbd54b]!==_0x1e3fc0(0x13a));_0x54b199={'oldPath':_0x41f059,'hasNewConfig':_0x160f76,'fields':_0x79c357};break;}}const _0x23e6e0=[],_0x5ab160=resolve(_0x3a4972,'.lovrabet');if(existsSync(_0x5ab160))_0x23e6e0[_0x1e3fc0(0x1a3)](_0x5ab160);const _0x9f164e=resolve(_0x3a4972,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x9f164e))_0x23e6e0[_0x1e3fc0(0x1a3)](_0x9f164e);const _0x300dda=resolve(_0x3a4972,_0x1e3fc0(0x19f));if(existsSync(_0x300dda))_0x23e6e0['push'](_0x300dda);for(const _0xee2d03 of collectIdeSkillFiles(_0x3a4972)){if(existsSync(_0xee2d03))_0x23e6e0[_0x1e3fc0(0x1a3)](_0xee2d03);}let _0x2606a0=null;const _0xad3ad0=resolve(_0x3a4972,_0x1e3fc0(0x18d));if(existsSync(_0xad3ad0))try{const _0x418604=JSON[_0x1e3fc0(0x190)](readFileSync(_0xad3ad0,_0x1e3fc0(0x16a)));if(_0x418604?.[_0x1e3fc0(0x18b)]&&typeof _0x418604[_0x1e3fc0(0x18b)]===_0x1e3fc0(0x179)){const _0x25cf47=[];for(const [_0x43fcae,_0xcd50ec]of Object[_0x1e3fc0(0x163)](_0x418604['mcpServers'])){const _0x2ac23b=_0xcd50ec;_0x2ac23b?.['args']&&Array[_0x1e3fc0(0x13b)](_0x2ac23b[_0x1e3fc0(0x158)])&&_0x2ac23b[_0x1e3fc0(0x158)][_0x1e3fc0(0x141)](_0x4c392c=>typeof _0x4c392c===_0x1e3fc0(0x194)&&_0x4c392c[_0x1e3fc0(0x14e)](_0x1e3fc0(0x192)))&&_0x25cf47[_0x1e3fc0(0x1a3)](_0x43fcae);}_0x25cf47[_0x1e3fc0(0x184)]>0x0&&(_0x2606a0={'path':_0xad3ad0,'keys':_0x25cf47});}}catch{}const _0x19ec3a=_0x23e6e0['length']>0x0||_0x54b199!==null;let _0x366d5e=null;const _0x5bb1e8=resolve(_0x3a4972,_0x1e3fc0(0x12f));if(existsSync(_0x5bb1e8))try{const _0x49cd31=JSON[_0x1e3fc0(0x190)](readFileSync(_0x5bb1e8,_0x1e3fc0(0x16a)));for(const _0x5e5bc8 of['dependencies','devDependencies']){const _0x1b6e13=_0x49cd31?.[_0x5e5bc8]?.[_0x1e3fc0(0x152)];if(typeof _0x1b6e13===_0x1e3fc0(0x194)){_0x1b6e13!==_0x1e3fc0(0x14b)&&(_0x366d5e={'pkgPath':_0x5bb1e8,'currentVersion':_0x1b6e13,'field':_0x5e5bc8});break;}}}catch{}return{'configMigration':_0x54b199,'oldArtifacts':_0x23e6e0,'oldMcpConfig':_0x2606a0,'needsSkillSwap':_0x19ec3a,'sdkUpgrade':_0x366d5e};}function printReport(_0x117ac9){const _0x675459=a173_0x1421ab,{configMigration:_0x4923cd,oldArtifacts:_0x2e362e,oldMcpConfig:_0x298730,needsSkillSwap:_0x4540b4}=_0x117ac9;console[_0x675459(0x17e)](''),console[_0x675459(0x17e)](a173_0x465c40[_0x675459(0x146)](_0x675459(0x131))),console[_0x675459(0x17e)]('');_0x4923cd?(console[_0x675459(0x17e)](a173_0x465c40[_0x675459(0x17d)](_0x675459(0x138))+('\x20\x20'+a173_0x465c40[_0x675459(0x16e)](_0x4923cd[_0x675459(0x13e)]))),console[_0x675459(0x17e)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x4923cd['hasNewConfig']?a173_0x465c40[_0x675459(0x182)](_0x675459(0x150)):a173_0x465c40['gray']('not\x20found\x20(will\x20create)'))),console[_0x675459(0x17e)](_0x675459(0x174)+_0x4923cd[_0x675459(0x157)]['join'](',\x20')),console['log']('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console['log'](a173_0x465c40[_0x675459(0x17d)](_0x675459(0x138))+'\x20\x20'+a173_0x465c40['gray'](_0x675459(0x17f)));console['log']('');if(_0x2e362e['length']>0x0){console[_0x675459(0x17e)](a173_0x465c40['cyan'](_0x675459(0x18a)));for(const _0x3676e6 of _0x2e362e){console['log']('\x20\x20'+a173_0x465c40[_0x675459(0x1b0)](_0x675459(0x191))+'\x20\x20'+_0x3676e6);}console[_0x675459(0x17e)](_0x675459(0x15d));}else console[_0x675459(0x17e)](a173_0x465c40[_0x675459(0x17d)]('Legacy\x20artifacts:')+'\x20\x20'+a173_0x465c40[_0x675459(0x135)](_0x675459(0x149)));console[_0x675459(0x17e)]('');_0x298730?(console[_0x675459(0x17e)](a173_0x465c40['cyan'](_0x675459(0x1a7))+('\x20\x20'+a173_0x465c40['yellow'](_0x298730[_0x675459(0x14c)])+_0x675459(0x1a9)+_0x298730[_0x675459(0x176)][_0x675459(0x16c)](',\x20'))),console[_0x675459(0x17e)](_0x675459(0x137))):console[_0x675459(0x17e)](a173_0x465c40['cyan'](_0x675459(0x1a7))+'\x20\x20'+a173_0x465c40[_0x675459(0x135)](_0x675459(0x1a8)));console[_0x675459(0x17e)](''),console[_0x675459(0x17e)](a173_0x465c40[_0x675459(0x17d)](_0x675459(0x177))+('\x20\x20'+(_0x4540b4?a173_0x465c40[_0x675459(0x16e)](_0x675459(0x164)):a173_0x465c40['green'](_0x675459(0x173)))));_0x4540b4&&console[_0x675459(0x17e)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x117ac9[_0x675459(0x168)]){const {currentVersion:_0x55b4b6,field:_0x4adc71,pkgPath:_0x247c64}=_0x117ac9[_0x675459(0x168)];console[_0x675459(0x17e)](a173_0x465c40[_0x675459(0x17d)](_0x675459(0x1a6))+('\x20\x20'+a173_0x465c40[_0x675459(0x16e)](_0x247c64))),console[_0x675459(0x17e)](_0x675459(0x161)+_0x4adc71+':\x20'+a173_0x465c40[_0x675459(0x16e)](_0x55b4b6)+_0x675459(0x145)+a173_0x465c40[_0x675459(0x182)](_0x675459(0x14b))),console[_0x675459(0x17e)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a173_0x465c40[_0x675459(0x17d)](_0x675459(0x1a6))+'\x20\x20'+a173_0x465c40['gray'](_0x675459(0x160)));console[_0x675459(0x17e)]('');}function a173_0x5241(){const _0x3a92e3=['@lovrabet/sdk:','MCP\x20config:','no\x20legacy\x20entry','\x20→\x20keys:\x20','white','Upgrade\x20completed\x20successfully!','\x20\x20bun\x20install','skipped\x20(no\x20legacy\x20config)','\x20\x20npm\x20install','lovrabet/lovrabet-skill\x20removed','red','stringify','package.json','7698320FEQmPo','===\x20Upgrade\x20Analysis\x20===','fail','CANCEL','1710940gvVWFf','gray','\x20→\x20latest','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Config\x20file:','[\x22@lovrabet/sdk\x22]:\x20','undefined','isArray','4215064JlvDwE','label','oldPath','57249738BaKNDk','error','some','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','7zegMAC','lovrabet/rabetbase\x20installed\x20globally','\x20→\x20','bold','Remove\x20old\x20skill','cwd','none\x20found','failed','latest','path','start','includes','Step\x201/7:\x20Config\x20migration\x20—\x20','already\x20exists\x20(will\x20merge)','values','@lovrabet/sdk','lovrabet/rabetbase','Clean\x20MCP\x20config','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','no\x20matching\x20entry\x20found','fields','args','===\x20Upgrade\x20Summary\x20===','message','info','oldArtifacts','\x20\x20Action:\x20delete','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','not\x20found\x20or\x20already\x20at\x20latest','\x20\x20Current\x20version\x20in\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','entries','needed','\x20removed','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','succeed','sdkUpgrade','Upgrade\x20@lovrabet/sdk','utf8','FAIL','join','detail','yellow','Remove\x20.lovrabet/','removed\x20','Remove\x20legacy\x20artifacts','\x20\x20\x20\x20\x20\x20\x20','not\x20needed','\x20\x20Fields\x20to\x20migrate:\x20','done','keys','Skill\x20swap:','step','object','.bak','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','cyan','log','no\x20legacy\x20config\x20found','inherit','exit\x20','green','Config\x20migration','length','\x20\x20#\x20or','Step\x206/7:\x20Installing\x20new\x20skill...','\x20from\x20','status','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Legacy\x20artifacts:','mcpServers','files','.cursor/mcp.json','configMigration','Step\x205/7:\x20Removing\x20old\x20skill...','parse','FOUND','@lovrabet/dataset-mcp-server','isDirectory','string','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Upgrade\x20cancelled.','6884172OiTqyt','5104749OfmeUw','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','4NEFHuf','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','filter','\x20\x20Step\x20','\x20(backup:\x20','.claude/skills/lovrabet','2242622jPFeJM','yes','oldMcpConfig','push','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','skipped'];a173_0x5241=function(){return _0x3a92e3;};return a173_0x5241();}function execConfigMigration(_0x4a3f5e,_0x3dc256){const _0x184516=a173_0x1421ab,{configMigration:_0x101c5f}=_0x4a3f5e;if(!_0x101c5f?.[_0x184516(0x13e)])return{'step':0x1,'label':_0x184516(0x183),'ok':!![],'detail':_0x184516(0x1ad)};const _0x58a8bd=readConfigFile(_0x101c5f[_0x184516(0x13e)]),_0x250e1b=resolve(_0x3dc256,NEW_CONFIG_NAME),_0x5ce726=_0x101c5f['hasNewConfig']?readConfigFile(_0x250e1b):{};for(const [_0x5dac93,_0x44444e]of Object[_0x184516(0x163)](_0x58a8bd)){!(_0x5dac93 in _0x5ce726)&&(_0x5ce726[_0x5dac93]=_0x44444e);}writeConfigFile(_0x250e1b,_0x5ce726);const _0x2dc055=_0x101c5f['oldPath']+_0x184516(0x17a);return renameSync(_0x101c5f[_0x184516(0x13e)],_0x2dc055),{'step':0x1,'label':_0x184516(0x183),'ok':!![],'detail':_0x101c5f['oldPath']+_0x184516(0x145)+_0x250e1b+_0x184516(0x19e)+_0x2dc055+')'};}function execRemoveOldArtifacts(_0x35d54c){const _0x3af44f=a173_0x1421ab,_0x53a2e9=[];for(const _0x1bfbc1 of _0x35d54c){try{if(!existsSync(_0x1bfbc1))continue;const _0x29499b=tryStat(_0x1bfbc1);_0x29499b?.[_0x3af44f(0x193)]()?rmSync(_0x1bfbc1,{'recursive':!![],'force':!![]}):unlinkSync(_0x1bfbc1);}catch(_0xcd93f5){_0x53a2e9[_0x3af44f(0x1a3)](_0x1bfbc1+':\x20'+_0xcd93f5[_0x3af44f(0x15a)]);}}return{'step':0x3,'label':_0x3af44f(0x171),'ok':_0x53a2e9[_0x3af44f(0x184)]===0x0,'detail':_0x53a2e9['length']>0x0?_0x35d54c[_0x3af44f(0x184)]-_0x53a2e9['length']+'/'+_0x35d54c[_0x3af44f(0x184)]+'\x20removed\x20('+_0x53a2e9[_0x3af44f(0x16c)](';\x20')+')':_0x35d54c[_0x3af44f(0x184)]+_0x3af44f(0x165)};}function execCleanMcp(_0x2d6361){const _0x456319=a173_0x1421ab;if(!_0x2d6361[_0x456319(0x1a2)])return{'step':0x4,'label':_0x456319(0x154),'ok':!![],'detail':_0x456319(0x1a5)};try{const _0x5613e3=readFileSync(_0x2d6361[_0x456319(0x1a2)][_0x456319(0x14c)],_0x456319(0x16a)),_0x13c8a3=JSON['parse'](_0x5613e3);if(_0x13c8a3?.[_0x456319(0x18b)]&&typeof _0x13c8a3[_0x456319(0x18b)]===_0x456319(0x179)){const _0x462ab0=[];for(const [_0x4ba75e,_0x204745]of Object[_0x456319(0x163)](_0x13c8a3[_0x456319(0x18b)])){_0x204745?.['args']&&Array['isArray'](_0x204745[_0x456319(0x158)])&&_0x204745[_0x456319(0x158)]['some'](_0x90914f=>typeof _0x90914f===_0x456319(0x194)&&_0x90914f[_0x456319(0x14e)]('@lovrabet/dataset-mcp-server'))&&_0x462ab0[_0x456319(0x1a3)](_0x4ba75e);}for(const _0x4f386f of _0x462ab0){delete _0x13c8a3[_0x456319(0x18b)][_0x4f386f];}return _0x462ab0[_0x456319(0x184)]>0x0&&writeFileSync(_0x2d6361['oldMcpConfig'][_0x456319(0x14c)],JSON[_0x456319(0x12e)](_0x13c8a3,null,0x2)+'\x0a',_0x456319(0x16a)),{'step':0x4,'label':_0x456319(0x154),'ok':!![],'detail':_0x456319(0x170)+_0x462ab0[_0x456319(0x16c)](',\x20')+_0x456319(0x187)+_0x2d6361['oldMcpConfig']['path']};}return{'step':0x4,'label':_0x456319(0x154),'ok':!![],'detail':_0x456319(0x156)};}catch(_0x4ff471){return{'step':0x4,'label':_0x456319(0x154),'ok':![],'detail':_0x4ff471[_0x456319(0x15a)]};}}function execSkillsRemove(_0x58afc1,_0x56c7ab){const _0x11fac1=a173_0x1421ab,_0x466470=runNpxSkillsRemove(_0x58afc1,{'stdio':_0x11fac1(0x180),'yes':_0x56c7ab});return{'step':0x5,'label':_0x11fac1(0x147),'ok':_0x466470['ok'],'detail':_0x466470['ok']?_0x11fac1(0x1af):_0x466470[_0x11fac1(0x140)]??'exit\x20'+_0x466470[_0x11fac1(0x188)]};}function execSkillsAdd(_0x3b6a49,_0x2e8996){const _0x10a9ca=a173_0x1421ab,_0x5ecec8=runNpxSkillsAddGlobal(_0x3b6a49,_0x10a9ca(0x153),{'stdio':'inherit','yes':_0x2e8996});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x5ecec8['ok'],'detail':_0x5ecec8['ok']?_0x10a9ca(0x144):_0x5ecec8[_0x10a9ca(0x140)]??_0x10a9ca(0x181)+_0x5ecec8[_0x10a9ca(0x188)]};}function execUpgradeSdk(_0xad293f){const _0x358f14=a173_0x1421ab;if(!_0xad293f[_0x358f14(0x168)])return{'step':0x7,'label':_0x358f14(0x169),'ok':!![],'detail':_0x358f14(0x166)};const {pkgPath:_0x50e1e7,currentVersion:_0x307675,field:_0x476824}=_0xad293f['sdkUpgrade'];try{const _0x37c152=readFileSync(_0x50e1e7,_0x358f14(0x16a)),_0x355eaf=JSON[_0x358f14(0x190)](_0x37c152);return _0x355eaf[_0x476824][_0x358f14(0x152)]=_0x358f14(0x14b),writeFileSync(_0x50e1e7,JSON[_0x358f14(0x12e)](_0x355eaf,null,0x2)+'\x0a',_0x358f14(0x16a)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x476824+_0x358f14(0x139)+_0x307675+_0x358f14(0x136)};}catch(_0x4b79e5){return{'step':0x7,'label':_0x358f14(0x169),'ok':![],'detail':_0x4b79e5['message']};}}function tryStat(_0x3a34c9){try{return statSync(_0x3a34c9);}catch{return undefined;}}function printSummary(_0xdb28f4){const _0x2f7386=a173_0x1421ab;console[_0x2f7386(0x17e)](''),console['log'](a173_0x465c40['bold'](_0x2f7386(0x159))),console[_0x2f7386(0x17e)]('');for(const _0xe26325 of _0xdb28f4){const _0x1634df=_0xe26325['ok']?a173_0x465c40['green']('OK'):a173_0x465c40[_0x2f7386(0x1b0)](_0x2f7386(0x16b));console[_0x2f7386(0x17e)]('\x20\x20'+_0x1634df+_0x2f7386(0x19d)+_0xe26325[_0x2f7386(0x178)]+':\x20'+_0xe26325[_0x2f7386(0x13d)]);if(_0xe26325[_0x2f7386(0x16d)])console['log'](_0x2f7386(0x172)+a173_0x465c40[_0x2f7386(0x135)](_0xe26325[_0x2f7386(0x16d)]));}console['log']('');}export async function upgradeApp(_0x3ad49c,_0x17cbe6){const _0x2e5cc4=a173_0x1421ab,_0x521342=process[_0x2e5cc4(0x148)](),_0xe0d880=analyse(_0x521342),_0x20eb7f=!_0xe0d880[_0x2e5cc4(0x18e)]&&_0xe0d880[_0x2e5cc4(0x15c)]['length']===0x0&&!_0xe0d880[_0x2e5cc4(0x1a2)]&&!_0xe0d880['needsSkillSwap']&&!_0xe0d880[_0x2e5cc4(0x168)];if(_0x20eb7f){console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x182)](_0x2e5cc4(0x19b)));return;}printReport(_0xe0d880);const _0x1be0c1=!!(_0x17cbe6[_0x2e5cc4(0x1a1)]||_0x17cbe6['Y']||_0x3ad49c);if(!_0x1be0c1)try{const _0x504561=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x504561){console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x135)](_0x2e5cc4(0x196)));return;}}catch(_0x2c27f5){if(_0x2c27f5?.[_0x2e5cc4(0x15a)]===_0x2e5cc4(0x133)){console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x135)]('Upgrade\x20cancelled.'));return;}throw _0x2c27f5;}const _0x368903=[],_0x4cfc32=a173_0x9eba5e({'text':'Step\x201/7:\x20Migrating\x20config...','color':'cyan'})[_0x2e5cc4(0x14d)](),_0x1dd371=execConfigMigration(_0xe0d880,_0x521342);_0x368903[_0x2e5cc4(0x1a3)](_0x1dd371),_0x4cfc32[_0x1dd371['ok']?'succeed':_0x2e5cc4(0x132)](_0x2e5cc4(0x14f)+(_0x1dd371['detail']??(_0x1dd371['ok']?_0x2e5cc4(0x175):_0x2e5cc4(0x14a))));const _0xae779d=resolve(_0x521342,'.lovrabet'),_0x820f54=a173_0x9eba5e({'text':_0x2e5cc4(0x189),'color':'cyan'})[_0x2e5cc4(0x14d)]();if(existsSync(_0xae779d))try{rmSync(_0xae779d,{'recursive':!![],'force':!![]}),_0x820f54[_0x2e5cc4(0x167)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x368903[_0x2e5cc4(0x1a3)]({'step':0x2,'label':_0x2e5cc4(0x16f),'ok':!![]});}catch(_0x29062d){_0x820f54[_0x2e5cc4(0x132)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x29062d[_0x2e5cc4(0x15a)]),_0x368903[_0x2e5cc4(0x1a3)]({'step':0x2,'label':_0x2e5cc4(0x16f),'ok':![],'detail':_0x29062d[_0x2e5cc4(0x15a)]});}else _0x820f54[_0x2e5cc4(0x15b)](_0x2e5cc4(0x15f)),_0x368903[_0x2e5cc4(0x1a3)]({'step':0x2,'label':_0x2e5cc4(0x16f),'ok':!![],'detail':_0x2e5cc4(0x1a5)});const _0x2b7e01=a173_0x9eba5e({'text':_0x2e5cc4(0x17b),'color':_0x2e5cc4(0x17d)})[_0x2e5cc4(0x14d)](),_0x3314b7=execRemoveOldArtifacts(_0xe0d880[_0x2e5cc4(0x15c)]);_0x368903[_0x2e5cc4(0x1a3)](_0x3314b7),_0x2b7e01[_0x3314b7['ok']?_0x2e5cc4(0x167):_0x2e5cc4(0x132)](_0x2e5cc4(0x17c)+(_0x3314b7['detail']??(_0x3314b7['ok']?_0x2e5cc4(0x175):'failed')));const _0x18501d=a173_0x9eba5e({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x2e5cc4(0x17d)})['start'](),_0x1ef283=execCleanMcp(_0xe0d880);_0x368903['push'](_0x1ef283),_0x18501d[_0x1ef283['ok']?'succeed':_0x2e5cc4(0x132)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x1ef283[_0x2e5cc4(0x16d)]??(_0x1ef283['ok']?'done':_0x2e5cc4(0x14a))));const _0x3284a4=a173_0x9eba5e({'text':_0x2e5cc4(0x18f),'color':'cyan'})[_0x2e5cc4(0x14d)](),_0x207ca5=execSkillsRemove(_0x521342,_0x1be0c1);_0x368903[_0x2e5cc4(0x1a3)](_0x207ca5),_0x3284a4[_0x207ca5['ok']?_0x2e5cc4(0x167):'fail'](_0x2e5cc4(0x15e)+(_0x207ca5[_0x2e5cc4(0x16d)]??(_0x207ca5['ok']?'done':_0x2e5cc4(0x14a))));const _0x5e9662=a173_0x9eba5e({'text':_0x2e5cc4(0x186),'color':_0x2e5cc4(0x17d)})[_0x2e5cc4(0x14d)](),_0x2bcd34=execSkillsAdd(_0x521342,_0x1be0c1);_0x368903[_0x2e5cc4(0x1a3)](_0x2bcd34),_0x5e9662[_0x2bcd34['ok']?_0x2e5cc4(0x167):_0x2e5cc4(0x132)](_0x2e5cc4(0x162)+(_0x2bcd34['detail']??(_0x2bcd34['ok']?_0x2e5cc4(0x175):_0x2e5cc4(0x14a))));const _0x30b3fc=a173_0x9eba5e({'text':_0x2e5cc4(0x142),'color':_0x2e5cc4(0x17d)})[_0x2e5cc4(0x14d)](),_0x316cd6=execUpgradeSdk(_0xe0d880);_0x368903[_0x2e5cc4(0x1a3)](_0x316cd6),_0x30b3fc[_0x316cd6['ok']?_0x2e5cc4(0x167):_0x2e5cc4(0x132)](_0x2e5cc4(0x155)+(_0x316cd6[_0x2e5cc4(0x16d)]??(_0x316cd6['ok']?_0x2e5cc4(0x175):_0x2e5cc4(0x14a)))),printSummary(_0x368903);const _0x205d2e=_0x368903['some'](_0x151b0e=>!_0x151b0e['ok']);_0x205d2e?console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x16e)](_0x2e5cc4(0x199))):console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x182)](_0x2e5cc4(0x1ab))),_0x316cd6['ok']&&_0xe0d880[_0x2e5cc4(0x168)]&&(console[_0x2e5cc4(0x17e)](''),console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x146)][_0x2e5cc4(0x17d)](_0x2e5cc4(0x1a4))),console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x17d)](_0x2e5cc4(0x195))),console[_0x2e5cc4(0x17e)](''),console[_0x2e5cc4(0x17e)](a173_0x465c40[_0x2e5cc4(0x1aa)](_0x2e5cc4(0x1ae))),console['log'](a173_0x465c40[_0x2e5cc4(0x1aa)](_0x2e5cc4(0x185))),console[_0x2e5cc4(0x17e)](a173_0x465c40['white'](_0x2e5cc4(0x1ac))),console[_0x2e5cc4(0x17e)](''));}
|
|
1
|
+
const a171_0x6659c9=a171_0x4820;function a171_0x5a67(){const _0x3cf7ec=['utf8','log','needsSkillSwap','error','includes','\x20→\x20','detail','undefined','CANCEL','oldMcpConfig','lovrabet/rabetbase','dependencies','no\x20legacy\x20config\x20found','not\x20found\x20or\x20already\x20at\x20latest','Config\x20file:','Upgrade\x20completed\x20successfully!','done','oldPath','gray','red','\x20\x20New\x20config\x20(.rabetbase.json):\x20','\x20\x20Fields\x20to\x20migrate:\x20','push','package.json','.lovrabet','Remove\x20legacy\x20artifacts','.lovrabet.json','2551352HYoehr','sdkUpgrade','some','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Clean\x20MCP\x20config','yellow','already\x20exists\x20(will\x20merge)','Step\x206/7:\x20Installing\x20new\x20skill...','@lovrabet/sdk','49dwHCZR','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','lovrabet/lovrabet-skill\x20removed','skipped','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','step','cyan','yes','Proceed\x20with\x20upgrade?','green','24741jRLzOz','Upgrade\x20@lovrabet/sdk','join','[\x22@lovrabet/sdk\x22]:\x20','oldArtifacts','.lovrabetrc','mcpServers','devDependencies','path','309052fUtGkM','exit\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','succeed','cwd','length','\x20\x20Step\x20','1202022ztnCYL','isDirectory','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','isArray','lovrabet/rabetbase\x20installed\x20globally','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','MCP\x20config:','\x20removed\x20(','\x20\x20npm\x20install','1111708dCOtCG','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','needed','files','\x20\x20bun\x20install','info','1309424axQrsL','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','not\x20found\x20(will\x20create)','args','entries','@lovrabet/sdk:','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','40DvTYAY','latest','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','FOUND','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','start','Remove\x20old\x20skill','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','failed','none\x20found','.cursor/mcp.json','.cursor/rules/lovrabet_rules.mdc','inherit','Step\x201/7:\x20Migrating\x20config...','parse','\x20\x20#\x20or','message','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','no\x20matching\x20entry\x20found','Upgrade\x20cancelled.','string','Config\x20migration','stringify','keys','\x20(backup:\x20','\x20→\x20latest','\x20\x20Current\x20version\x20in\x20','configMigration','Step\x204/7:\x20MCP\x20config\x20—\x20','object','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Legacy\x20artifacts:','\x20removed','===\x20Upgrade\x20Analysis\x20===','Remove\x20.lovrabet/','not\x20needed','bold','hasNewConfig','17280bDfgSr','\x20\x20Action:\x20delete','status','fail','filter','3911418kzGeao'];a171_0x5a67=function(){return _0x3cf7ec;};return a171_0x5a67();}(function(_0x35b4a4,_0x573bf6){const _0x2a0b12=a171_0x4820,_0x16fe2c=_0x35b4a4();while(!![]){try{const _0x53ce96=-parseInt(_0x2a0b12(0xef))/0x1+-parseInt(_0x2a0b12(0xc1))/0x2+-parseInt(_0x2a0b12(0xa5))/0x3+-parseInt(_0x2a0b12(0xdf))/0x4*(-parseInt(_0x2a0b12(0xfe))/0x5)+parseInt(_0x2a0b12(0xe6))/0x6+-parseInt(_0x2a0b12(0xca))/0x7*(parseInt(_0x2a0b12(0xf5))/0x8)+-parseInt(_0x2a0b12(0xd6))/0x9*(-parseInt(_0x2a0b12(0xa0))/0xa);if(_0x53ce96===_0x573bf6)break;else _0x16fe2c['push'](_0x16fe2c['shift']());}catch(_0x234664){_0x16fe2c['push'](_0x16fe2c['shift']());}}}(a171_0x5a67,0xb2a81));import a171_0x2cdb5c from'chalk';import a171_0x260983 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';function a171_0x4820(_0x141f98,_0x57aa43){_0x141f98=_0x141f98-0x80;const _0x5a6769=a171_0x5a67();let _0x4820c9=_0x5a6769[_0x141f98];return _0x4820c9;}import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=[a171_0x6659c9(0xc0),a171_0x6659c9(0xdb)];function collectIdeSkillFiles(_0x37aae2){const _0x12f77b=a171_0x6659c9,_0x50e892=[];for(const _0x5db21a of Object['values'](CORE_IDE_CONFIGS)){if(_0x5db21a['files'])for(const _0xb04977 of _0x5db21a[_0x12f77b(0xf2)]){_0x50e892[_0x12f77b(0xbc)](resolve(_0x37aae2,_0xb04977[_0x12f77b(0xde)]));}}return _0x50e892;}function analyse(_0x1b4a1e){const _0x168b42=a171_0x6659c9;let _0x3a0b3f=null;const _0x502f81=resolve(_0x1b4a1e,NEW_CONFIG_NAME),_0x483f9e=existsSync(_0x502f81);for(const _0x56c22d of LEGACY_CONFIG_NAMES){const _0x5e6392=resolve(_0x1b4a1e,_0x56c22d);if(existsSync(_0x5e6392)){const _0x419bcd=readConfigFile(_0x5e6392),_0x211d26=Object[_0x168b42(0x91)](_0x419bcd)[_0x168b42(0xa4)](_0x25bde1=>typeof _0x419bcd[_0x25bde1]!==_0x168b42(0xad));_0x3a0b3f={'oldPath':_0x5e6392,'hasNewConfig':_0x483f9e,'fields':_0x211d26};break;}}const _0x1df9ee=[],_0x44aaf9=resolve(_0x1b4a1e,_0x168b42(0xbe));if(existsSync(_0x44aaf9))_0x1df9ee[_0x168b42(0xbc)](_0x44aaf9);const _0x3b58c6=resolve(_0x1b4a1e,_0x168b42(0x85));if(existsSync(_0x3b58c6))_0x1df9ee[_0x168b42(0xbc)](_0x3b58c6);const _0x49d383=resolve(_0x1b4a1e,'.claude/skills/lovrabet');if(existsSync(_0x49d383))_0x1df9ee['push'](_0x49d383);for(const _0x3d3535 of collectIdeSkillFiles(_0x1b4a1e)){if(existsSync(_0x3d3535))_0x1df9ee[_0x168b42(0xbc)](_0x3d3535);}let _0x2370eb=null;const _0x489d50=resolve(_0x1b4a1e,_0x168b42(0x84));if(existsSync(_0x489d50))try{const _0x2ea1cb=JSON[_0x168b42(0x88)](readFileSync(_0x489d50,_0x168b42(0xa6)));if(_0x2ea1cb?.[_0x168b42(0xdc)]&&typeof _0x2ea1cb[_0x168b42(0xdc)]===_0x168b42(0x97)){const _0x3b6315=[];for(const [_0x474d60,_0x276235]of Object[_0x168b42(0xfa)](_0x2ea1cb[_0x168b42(0xdc)])){const _0x2f6dd3=_0x276235;_0x2f6dd3?.[_0x168b42(0xf9)]&&Array['isArray'](_0x2f6dd3[_0x168b42(0xf9)])&&_0x2f6dd3[_0x168b42(0xf9)]['some'](_0x2e09d0=>typeof _0x2e09d0===_0x168b42(0x8e)&&_0x2e09d0['includes']('@lovrabet/dataset-mcp-server'))&&_0x3b6315[_0x168b42(0xbc)](_0x474d60);}_0x3b6315[_0x168b42(0xe4)]>0x0&&(_0x2370eb={'path':_0x489d50,'keys':_0x3b6315});}}catch{}const _0x8fa4e=_0x1df9ee[_0x168b42(0xe4)]>0x0||_0x3a0b3f!==null;let _0x56101b=null;const _0x184af9=resolve(_0x1b4a1e,_0x168b42(0xbd));if(existsSync(_0x184af9))try{const _0x5637ba=JSON[_0x168b42(0x88)](readFileSync(_0x184af9,_0x168b42(0xa6)));for(const _0x4450d1 of[_0x168b42(0xb1),_0x168b42(0xdd)]){const _0x19c604=_0x5637ba?.[_0x4450d1]?.['@lovrabet/sdk'];if(typeof _0x19c604===_0x168b42(0x8e)){_0x19c604!=='latest'&&(_0x56101b={'pkgPath':_0x184af9,'currentVersion':_0x19c604,'field':_0x4450d1});break;}}}catch{}return{'configMigration':_0x3a0b3f,'oldArtifacts':_0x1df9ee,'oldMcpConfig':_0x2370eb,'needsSkillSwap':_0x8fa4e,'sdkUpgrade':_0x56101b};}function printReport(_0x71564c){const _0x3f516f=a171_0x6659c9,{configMigration:_0xd35218,oldArtifacts:_0x1d220a,oldMcpConfig:_0x56831f,needsSkillSwap:_0x409ddc}=_0x71564c;console[_0x3f516f(0xa7)](''),console['log'](a171_0x2cdb5c['bold'](_0x3f516f(0x9b))),console[_0x3f516f(0xa7)]('');_0xd35218?(console[_0x3f516f(0xa7)](a171_0x2cdb5c[_0x3f516f(0xd2)]('Config\x20file:')+('\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xc6)](_0xd35218[_0x3f516f(0xb7)]))),console[_0x3f516f(0xa7)](_0x3f516f(0xba)+(_0xd35218['hasNewConfig']?a171_0x2cdb5c[_0x3f516f(0xd5)](_0x3f516f(0xc7)):a171_0x2cdb5c[_0x3f516f(0xb8)](_0x3f516f(0xf8)))),console['log'](_0x3f516f(0xbb)+_0xd35218['fields'][_0x3f516f(0xd8)](',\x20')),console[_0x3f516f(0xa7)](_0x3f516f(0xfc))):console[_0x3f516f(0xa7)](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0xb4))+'\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xb8)](_0x3f516f(0xb2)));console[_0x3f516f(0xa7)]('');if(_0x1d220a[_0x3f516f(0xe4)]>0x0){console['log'](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0x99)));for(const _0x1960ed of _0x1d220a){console[_0x3f516f(0xa7)]('\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xb9)](_0x3f516f(0x101))+'\x20\x20'+_0x1960ed);}console['log'](_0x3f516f(0xa1));}else console[_0x3f516f(0xa7)](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0x99))+'\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xb8)](_0x3f516f(0x83)));console['log']('');_0x56831f?(console['log'](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0xec))+('\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xc6)](_0x56831f[_0x3f516f(0xde)])+'\x20→\x20keys:\x20'+_0x56831f[_0x3f516f(0x91)][_0x3f516f(0xd8)](',\x20'))),console[_0x3f516f(0xa7)](_0x3f516f(0xf7))):console['log'](a171_0x2cdb5c[_0x3f516f(0xd2)]('MCP\x20config:')+'\x20\x20'+a171_0x2cdb5c[_0x3f516f(0xb8)]('no\x20legacy\x20entry'));console[_0x3f516f(0xa7)](''),console['log'](a171_0x2cdb5c[_0x3f516f(0xd2)]('Skill\x20swap:')+('\x20\x20'+(_0x409ddc?a171_0x2cdb5c[_0x3f516f(0xc6)](_0x3f516f(0xf1)):a171_0x2cdb5c[_0x3f516f(0xd5)](_0x3f516f(0x9d)))));_0x409ddc&&console[_0x3f516f(0xa7)](_0x3f516f(0x8b)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3f516f(0xa7)]('');if(_0x71564c[_0x3f516f(0xc2)]){const {currentVersion:_0x1a52fe,field:_0x4ca8ae,pkgPath:_0x1ef94e}=_0x71564c[_0x3f516f(0xc2)];console[_0x3f516f(0xa7)](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0xfb))+('\x20\x20'+a171_0x2cdb5c['yellow'](_0x1ef94e))),console['log'](_0x3f516f(0x94)+_0x4ca8ae+':\x20'+a171_0x2cdb5c[_0x3f516f(0xc6)](_0x1a52fe)+'\x20→\x20'+a171_0x2cdb5c[_0x3f516f(0xd5)](_0x3f516f(0xff))),console['log'](_0x3f516f(0xce));}else console[_0x3f516f(0xa7)](a171_0x2cdb5c[_0x3f516f(0xd2)](_0x3f516f(0xfb))+'\x20\x20'+a171_0x2cdb5c['gray'](_0x3f516f(0xb3)));console[_0x3f516f(0xa7)]('');}function execConfigMigration(_0x201f15,_0x4ac7c6){const _0x863913=a171_0x6659c9,{configMigration:_0x58ba23}=_0x201f15;if(!_0x58ba23?.[_0x863913(0xb7)])return{'step':0x1,'label':_0x863913(0x8f),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x107bce=readConfigFile(_0x58ba23[_0x863913(0xb7)]),_0x462f88=resolve(_0x4ac7c6,NEW_CONFIG_NAME),_0x485a9c=_0x58ba23[_0x863913(0x9f)]?readConfigFile(_0x462f88):{};for(const [_0x265ea4,_0x28f472]of Object[_0x863913(0xfa)](_0x107bce)){!(_0x265ea4 in _0x485a9c)&&(_0x485a9c[_0x265ea4]=_0x28f472);}writeConfigFile(_0x462f88,_0x485a9c);const _0xeb22de=_0x58ba23[_0x863913(0xb7)]+'.bak';return renameSync(_0x58ba23[_0x863913(0xb7)],_0xeb22de),{'step':0x1,'label':_0x863913(0x8f),'ok':!![],'detail':_0x58ba23[_0x863913(0xb7)]+_0x863913(0xab)+_0x462f88+_0x863913(0x92)+_0xeb22de+')'};}function execRemoveOldArtifacts(_0x57cc2a){const _0x5ce3de=a171_0x6659c9,_0x3bbf37=[];for(const _0x4a8638 of _0x57cc2a){try{if(!existsSync(_0x4a8638))continue;const _0xc97cba=tryStat(_0x4a8638);_0xc97cba?.[_0x5ce3de(0xe7)]()?rmSync(_0x4a8638,{'recursive':!![],'force':!![]}):unlinkSync(_0x4a8638);}catch(_0x44112f){_0x3bbf37['push'](_0x4a8638+':\x20'+_0x44112f[_0x5ce3de(0x8a)]);}}return{'step':0x3,'label':_0x5ce3de(0xbf),'ok':_0x3bbf37[_0x5ce3de(0xe4)]===0x0,'detail':_0x3bbf37[_0x5ce3de(0xe4)]>0x0?_0x57cc2a[_0x5ce3de(0xe4)]-_0x3bbf37[_0x5ce3de(0xe4)]+'/'+_0x57cc2a['length']+_0x5ce3de(0xed)+_0x3bbf37[_0x5ce3de(0xd8)](';\x20')+')':_0x57cc2a[_0x5ce3de(0xe4)]+_0x5ce3de(0x9a)};}function execCleanMcp(_0x319eff){const _0x4d2d1a=a171_0x6659c9;if(!_0x319eff[_0x4d2d1a(0xaf)])return{'step':0x4,'label':_0x4d2d1a(0xc5),'ok':!![],'detail':_0x4d2d1a(0xcd)};try{const _0x33ae51=readFileSync(_0x319eff['oldMcpConfig']['path'],_0x4d2d1a(0xa6)),_0x461a5f=JSON[_0x4d2d1a(0x88)](_0x33ae51);if(_0x461a5f?.[_0x4d2d1a(0xdc)]&&typeof _0x461a5f[_0x4d2d1a(0xdc)]==='object'){const _0x47e61d=[];for(const [_0x2a735b,_0x4ad17f]of Object[_0x4d2d1a(0xfa)](_0x461a5f[_0x4d2d1a(0xdc)])){_0x4ad17f?.[_0x4d2d1a(0xf9)]&&Array[_0x4d2d1a(0xe9)](_0x4ad17f[_0x4d2d1a(0xf9)])&&_0x4ad17f[_0x4d2d1a(0xf9)][_0x4d2d1a(0xc3)](_0x54dcbf=>typeof _0x54dcbf==='string'&&_0x54dcbf[_0x4d2d1a(0xaa)]('@lovrabet/dataset-mcp-server'))&&_0x47e61d[_0x4d2d1a(0xbc)](_0x2a735b);}for(const _0x48692c of _0x47e61d){delete _0x461a5f[_0x4d2d1a(0xdc)][_0x48692c];}return _0x47e61d['length']>0x0&&writeFileSync(_0x319eff[_0x4d2d1a(0xaf)][_0x4d2d1a(0xde)],JSON['stringify'](_0x461a5f,null,0x2)+'\x0a',_0x4d2d1a(0xa6)),{'step':0x4,'label':_0x4d2d1a(0xc5),'ok':!![],'detail':'removed\x20'+_0x47e61d[_0x4d2d1a(0xd8)](',\x20')+'\x20from\x20'+_0x319eff['oldMcpConfig'][_0x4d2d1a(0xde)]};}return{'step':0x4,'label':_0x4d2d1a(0xc5),'ok':!![],'detail':_0x4d2d1a(0x8c)};}catch(_0x2ed80e){return{'step':0x4,'label':_0x4d2d1a(0xc5),'ok':![],'detail':_0x2ed80e['message']};}}function execSkillsRemove(_0x35b425,_0x4d0374){const _0x2e1180=a171_0x6659c9,_0x45a516=runNpxSkillsRemove(_0x35b425,{'stdio':'inherit','yes':_0x4d0374});return{'step':0x5,'label':_0x2e1180(0x80),'ok':_0x45a516['ok'],'detail':_0x45a516['ok']?_0x2e1180(0xcc):_0x45a516[_0x2e1180(0xa9)]??_0x2e1180(0xe0)+_0x45a516['status']};}function execSkillsAdd(_0x287dd9,_0x349fba){const _0xa8ac2=a171_0x6659c9,_0x570935=runNpxSkillsAddGlobal(_0x287dd9,_0xa8ac2(0xb0),{'stdio':_0xa8ac2(0x86),'yes':_0x349fba});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x570935['ok'],'detail':_0x570935['ok']?_0xa8ac2(0xea):_0x570935[_0xa8ac2(0xa9)]??_0xa8ac2(0xe0)+_0x570935[_0xa8ac2(0xa2)]};}function execUpgradeSdk(_0x3e67a7){const _0x2c2bf5=a171_0x6659c9;if(!_0x3e67a7[_0x2c2bf5(0xc2)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x2c2bf5(0xe8)};const {pkgPath:_0x3ec4d,currentVersion:_0x18ac95,field:_0x39dc98}=_0x3e67a7[_0x2c2bf5(0xc2)];try{const _0x3ca263=readFileSync(_0x3ec4d,_0x2c2bf5(0xa6)),_0x45575e=JSON[_0x2c2bf5(0x88)](_0x3ca263);return _0x45575e[_0x39dc98][_0x2c2bf5(0xc9)]=_0x2c2bf5(0xff),writeFileSync(_0x3ec4d,JSON[_0x2c2bf5(0x90)](_0x45575e,null,0x2)+'\x0a',_0x2c2bf5(0xa6)),{'step':0x7,'label':_0x2c2bf5(0xd7),'ok':!![],'detail':_0x39dc98+_0x2c2bf5(0xd9)+_0x18ac95+_0x2c2bf5(0x93)};}catch(_0x1e96b1){return{'step':0x7,'label':_0x2c2bf5(0xd7),'ok':![],'detail':_0x1e96b1[_0x2c2bf5(0x8a)]};}}function tryStat(_0x51f050){try{return statSync(_0x51f050);}catch{return undefined;}}function printSummary(_0x10ab39){const _0xaea826=a171_0x6659c9;console['log'](''),console['log'](a171_0x2cdb5c['bold']('===\x20Upgrade\x20Summary\x20===')),console[_0xaea826(0xa7)]('');for(const _0x208c6f of _0x10ab39){const _0x458b4d=_0x208c6f['ok']?a171_0x2cdb5c[_0xaea826(0xd5)]('OK'):a171_0x2cdb5c[_0xaea826(0xb9)]('FAIL');console[_0xaea826(0xa7)]('\x20\x20'+_0x458b4d+_0xaea826(0xe5)+_0x208c6f[_0xaea826(0xd1)]+':\x20'+_0x208c6f['label']);if(_0x208c6f[_0xaea826(0xac)])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a171_0x2cdb5c[_0xaea826(0xb8)](_0x208c6f[_0xaea826(0xac)]));}console[_0xaea826(0xa7)]('');}export async function upgradeApp(_0x60ba3,_0x5b5b34){const _0x27f1f7=a171_0x6659c9,_0x2cec40=process[_0x27f1f7(0xe3)](),_0x404974=analyse(_0x2cec40),_0x506344=!_0x404974[_0x27f1f7(0x95)]&&_0x404974[_0x27f1f7(0xda)][_0x27f1f7(0xe4)]===0x0&&!_0x404974[_0x27f1f7(0xaf)]&&!_0x404974[_0x27f1f7(0xa8)]&&!_0x404974[_0x27f1f7(0xc2)];if(_0x506344){console['log'](a171_0x2cdb5c[_0x27f1f7(0xd5)](_0x27f1f7(0xfd)));return;}printReport(_0x404974);const _0x5c5522=!!(_0x5b5b34[_0x27f1f7(0xd3)]||_0x5b5b34['Y']||_0x60ba3);if(!_0x5c5522)try{const _0x5e34fb=await askConfirm(_0x27f1f7(0xd4));if(!_0x5e34fb){console[_0x27f1f7(0xa7)](a171_0x2cdb5c[_0x27f1f7(0xb8)](_0x27f1f7(0x8d)));return;}}catch(_0x4192d7){if(_0x4192d7?.['message']===_0x27f1f7(0xae)){console[_0x27f1f7(0xa7)](a171_0x2cdb5c['gray']('Upgrade\x20cancelled.'));return;}throw _0x4192d7;}const _0x5f278e=[],_0x5128f0=a171_0x260983({'text':_0x27f1f7(0x87),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x18e823=execConfigMigration(_0x404974,_0x2cec40);_0x5f278e[_0x27f1f7(0xbc)](_0x18e823),_0x5128f0[_0x18e823['ok']?_0x27f1f7(0xe2):_0x27f1f7(0xa3)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x18e823['detail']??(_0x18e823['ok']?'done':_0x27f1f7(0x82))));const _0x513e38=resolve(_0x2cec40,_0x27f1f7(0xbe)),_0x3a9210=a171_0x260983({'text':_0x27f1f7(0xc4),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)]();if(existsSync(_0x513e38))try{rmSync(_0x513e38,{'recursive':!![],'force':!![]}),_0x3a9210[_0x27f1f7(0xe2)](_0x27f1f7(0xd0)),_0x5f278e[_0x27f1f7(0xbc)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x5a1341){_0x3a9210[_0x27f1f7(0xa3)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x5a1341[_0x27f1f7(0x8a)]),_0x5f278e[_0x27f1f7(0xbc)]({'step':0x2,'label':_0x27f1f7(0x9c),'ok':![],'detail':_0x5a1341['message']});}else _0x3a9210[_0x27f1f7(0xf4)](_0x27f1f7(0x102)),_0x5f278e['push']({'step':0x2,'label':_0x27f1f7(0x9c),'ok':!![],'detail':_0x27f1f7(0xcd)});const _0x45d87d=a171_0x260983({'text':_0x27f1f7(0x100),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x3303b4=execRemoveOldArtifacts(_0x404974[_0x27f1f7(0xda)]);_0x5f278e[_0x27f1f7(0xbc)](_0x3303b4),_0x45d87d[_0x3303b4['ok']?'succeed':'fail'](_0x27f1f7(0x81)+(_0x3303b4[_0x27f1f7(0xac)]??(_0x3303b4['ok']?'done':_0x27f1f7(0x82))));const _0x56516d=a171_0x260983({'text':_0x27f1f7(0xe1),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x33b67b=execCleanMcp(_0x404974);_0x5f278e[_0x27f1f7(0xbc)](_0x33b67b),_0x56516d[_0x33b67b['ok']?'succeed':_0x27f1f7(0xa3)](_0x27f1f7(0x96)+(_0x33b67b[_0x27f1f7(0xac)]??(_0x33b67b['ok']?_0x27f1f7(0xb6):_0x27f1f7(0x82))));const _0x2663a9=a171_0x260983({'text':_0x27f1f7(0xcf),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x2cce15=execSkillsRemove(_0x2cec40,_0x5c5522);_0x5f278e[_0x27f1f7(0xbc)](_0x2cce15),_0x2663a9[_0x2cce15['ok']?_0x27f1f7(0xe2):_0x27f1f7(0xa3)](_0x27f1f7(0xeb)+(_0x2cce15[_0x27f1f7(0xac)]??(_0x2cce15['ok']?_0x27f1f7(0xb6):_0x27f1f7(0x82))));const _0x275a86=a171_0x260983({'text':_0x27f1f7(0xc8),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x59f7a0=execSkillsAdd(_0x2cec40,_0x5c5522);_0x5f278e['push'](_0x59f7a0),_0x275a86[_0x59f7a0['ok']?_0x27f1f7(0xe2):_0x27f1f7(0xa3)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x59f7a0[_0x27f1f7(0xac)]??(_0x59f7a0['ok']?'done':_0x27f1f7(0x82))));const _0x4f9430=a171_0x260983({'text':_0x27f1f7(0xcb),'color':_0x27f1f7(0xd2)})[_0x27f1f7(0x103)](),_0x546cba=execUpgradeSdk(_0x404974);_0x5f278e[_0x27f1f7(0xbc)](_0x546cba),_0x4f9430[_0x546cba['ok']?_0x27f1f7(0xe2):_0x27f1f7(0xa3)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x546cba[_0x27f1f7(0xac)]??(_0x546cba['ok']?_0x27f1f7(0xb6):_0x27f1f7(0x82)))),printSummary(_0x5f278e);const _0x117225=_0x5f278e['some'](_0x79588c=>!_0x79588c['ok']);_0x117225?console[_0x27f1f7(0xa7)](a171_0x2cdb5c[_0x27f1f7(0xc6)](_0x27f1f7(0xf6))):console[_0x27f1f7(0xa7)](a171_0x2cdb5c[_0x27f1f7(0xd5)](_0x27f1f7(0xb5))),_0x546cba['ok']&&_0x404974[_0x27f1f7(0xc2)]&&(console[_0x27f1f7(0xa7)](''),console[_0x27f1f7(0xa7)](a171_0x2cdb5c[_0x27f1f7(0x9e)][_0x27f1f7(0xd2)](_0x27f1f7(0xf0))),console['log'](a171_0x2cdb5c[_0x27f1f7(0xd2)](_0x27f1f7(0x98))),console[_0x27f1f7(0xa7)](''),console[_0x27f1f7(0xa7)](a171_0x2cdb5c['white'](_0x27f1f7(0xee))),console['log'](a171_0x2cdb5c['white'](_0x27f1f7(0x89))),console[_0x27f1f7(0xa7)](a171_0x2cdb5c['white'](_0x27f1f7(0xf3))),console[_0x27f1f7(0xa7)](''));}
|
|
@@ -42,8 +42,8 @@ export interface ServiceEntry {
|
|
|
42
42
|
wildcardDef?: CommandDefinition;
|
|
43
43
|
/**
|
|
44
44
|
* 单命令 service 标记。
|
|
45
|
-
* true 时 help
|
|
46
|
-
*
|
|
45
|
+
* true 时 help 将服务显示为直接命令(如 rabetbase doctor),
|
|
46
|
+
* 而非子命令形式(如 rabetbase doctor run)。
|
|
47
47
|
*/
|
|
48
48
|
isSingleCommand?: boolean;
|
|
49
49
|
}
|