@lovrabet/lovrabet-cli 2.3.1-beta.2 → 2.3.1-beta.3
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/README.md +53 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.d.ts +2 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +2 -0
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.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/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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.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/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +33 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +3 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.d.ts +0 -51
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +3 -5
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +16 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.d.ts +0 -2
- 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/generated/official-routing.d.ts +59 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/guides/troubleshooting.md +3 -5
- package/skills/lovrabet/references/lovrabet-config-commands.md +33 -10
- package/skills/lovrabet/references/lovrabet-config.md +8 -20
- package/skills/lovrabet/references/lovrabet-doctor.md +0 -2
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -3
- package/skills/lovrabet.manifest.json +3 -3
- package/lib/core/kb-search-client.d.ts +0 -30
- package/lib/core/kb-search-client.js +0 -1
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a92_0x230fea=a92_0x317a;(function(_0x52eddc,_0x13b8c0){const _0x2e3526=a92_0x317a,_0xd16e5b=_0x52eddc();while(!![]){try{const _0x427ad7=-parseInt(_0x2e3526(0x11d))/0x1*(-parseInt(_0x2e3526(0x136))/0x2)+-parseInt(_0x2e3526(0x13f))/0x3+-parseInt(_0x2e3526(0x126))/0x4*(-parseInt(_0x2e3526(0x131))/0x5)+-parseInt(_0x2e3526(0x12e))/0x6*(parseInt(_0x2e3526(0x13c))/0x7)+parseInt(_0x2e3526(0x148))/0x8*(parseInt(_0x2e3526(0x128))/0x9)+-parseInt(_0x2e3526(0x11e))/0xa+-parseInt(_0x2e3526(0x124))/0xb*(-parseInt(_0x2e3526(0x141))/0xc);if(_0x427ad7===_0x13b8c0)break;else _0xd16e5b['push'](_0xd16e5b['shift']());}catch(_0x4df677){_0xd16e5b['push'](_0xd16e5b['shift']());}}}(a92_0x330e,0xf063d));import{PRODUCT_CONFIG}from'../constant/product.js';function a92_0x317a(_0x2a2989,_0x30068d){_0x2a2989=_0x2a2989-0x11a;const _0x330eec=a92_0x330e();let _0x317a1b=_0x330eec[_0x2a2989];return _0x317a1b;}import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG['cliBinName'];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a92_0x230fea(0x147)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a92_0x230fea(0x12b),'meowKey':a92_0x230fea(0x12b),'type':'string','description':a92_0x230fea(0x144),'hint':a92_0x230fea(0x143)},{'name':'app','meowKey':a92_0x230fea(0x142),'type':a92_0x230fea(0x11f),'description':'Select\x20app\x20profile\x20by\x20name','hint':a92_0x230fea(0x135)},{'name':'env','meowKey':a92_0x230fea(0x13a),'type':'string','description':'Environment','hint':a92_0x230fea(0x138)},{'name':a92_0x230fea(0x140),'meowKey':a92_0x230fea(0x140),'type':a92_0x230fea(0x11f),'description':'Output\x20format','hint':a92_0x230fea(0x145)},{'name':'jq','meowKey':'jq','type':a92_0x230fea(0x11f),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','hint':a92_0x230fea(0x122)},{'name':a92_0x230fea(0x123),'meowKey':a92_0x230fea(0x121),'type':a92_0x230fea(0x11b),'description':'Preview\x20operation\x20without\x20executing'},{'name':'yes','meowKey':'yes','type':a92_0x230fea(0x11b),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':'non-interactive','meowKey':a92_0x230fea(0x13b),'type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x12a)},{'name':a92_0x230fea(0x146),'meowKey':a92_0x230fea(0x146),'type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x134)},{'name':'ci','meowKey':'ci','type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x125),'hidden':!![]},{'name':a92_0x230fea(0x12f),'meowKey':a92_0x230fea(0x12f),'type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x127)},{'name':'id','meowKey':'id','type':'string','description':'Record\x20ID','hidden':!![]},{'name':a92_0x230fea(0x139),'meowKey':a92_0x230fea(0x139),'type':a92_0x230fea(0x11f),'description':a92_0x230fea(0x13e),'hidden':!![]},{'name':'sqlcode','meowKey':a92_0x230fea(0x129),'type':a92_0x230fea(0x11f),'description':'SQL\x20query\x20code','hidden':!![]},{'name':a92_0x230fea(0x130),'meowKey':a92_0x230fea(0x130),'type':'string','description':a92_0x230fea(0x12d),'hidden':!![]},{'name':a92_0x230fea(0x11c),'meowKey':a92_0x230fea(0x11c),'type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x120),'hidden':!![]},{'name':a92_0x230fea(0x133),'meowKey':a92_0x230fea(0x133),'type':a92_0x230fea(0x11b),'description':a92_0x230fea(0x13d),'hidden':!![]}];function a92_0x330e(){const _0x56ea4e=['55hYblxZ','Alias\x20for\x20--non-interactive','5924HSrRJN','Show\x20help','24426RNbsrY','sqlcode','Force\x20non-interactive\x20mode\x20(CI)','appcode','map','JSON\x20params\x20for\x20execute\x20commands','1326222zCoWQL','help','params','5245ZCasBc','meowKey','clear','Use\x20global\x20config\x20scope','<name>','4506cySOse','type','production\x20|\x20development\x20|\x20daily','name','env','nonInteractive','14sumtxu','Clear\x20output','Name\x20filter','2342286rZqJQf','format','920604NxWkEa','app','<code>','Override\x20appcode','json\x20|\x20pretty\x20|\x20compress','global','cliDisplayName','752xgIOMj','non-interactive','yes','boolean','verbose','422AlzGFu','9355630VQFVpB','string','Verbose\x20output','dryRun','<expr>','dry-run'];a92_0x330e=function(){return _0x56ea4e;};return a92_0x330e();}export const PIPELINE_FLAG_NAMES=new Set([a92_0x230fea(0x12b),'app',a92_0x230fea(0x13a),a92_0x230fea(0x140),'jq',a92_0x230fea(0x123),a92_0x230fea(0x11a),a92_0x230fea(0x149),'ci']);export function buildMeowFlags(){const _0x2a5b41=a92_0x230fea;return Object['fromEntries'](GLOBAL_FLAGS[_0x2a5b41(0x12c)](_0x5654be=>[_0x5654be[_0x2a5b41(0x132)],{'type':_0x5654be[_0x2a5b41(0x137)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a93_0x5a31b3=a93_0xe3c8;(function(_0x17ba8b,_0x1dbab6){const _0x2a27d4=a93_0xe3c8,_0x3c38bb=_0x17ba8b();while(!![]){try{const _0x4b72df=parseInt(_0x2a27d4(0x172))/0x1+-parseInt(_0x2a27d4(0x170))/0x2+-parseInt(_0x2a27d4(0x178))/0x3+parseInt(_0x2a27d4(0x176))/0x4*(-parseInt(_0x2a27d4(0x179))/0x5)+parseInt(_0x2a27d4(0x173))/0x6+parseInt(_0x2a27d4(0x175))/0x7+-parseInt(_0x2a27d4(0x171))/0x8;if(_0x4b72df===_0x1dbab6)break;else _0x3c38bb['push'](_0x3c38bb['shift']());}catch(_0x854296){_0x3c38bb['push'](_0x3c38bb['shift']());}}}(a93_0x221f,0x760b4));export const DEFAULT_APP_PROFILE_NAME=a93_0x5a31b3(0x177);export const DEFAULT_CONFIG_VALUES={'env':'production','format':a93_0x5a31b3(0x16f),'locale':a93_0x5a31b3(0x174),'riskLevel':'write'};function a93_0xe3c8(_0x141ec4,_0x41385c){_0x141ec4=_0x141ec4-0x16f;const _0x221f63=a93_0x221f();let _0xe3c82=_0x221f63[_0x141ec4];return _0xe3c82;}function a93_0x221f(){const _0xb661f3=['106824niTfCZ','2102176LmFRMU','241856GvImUd','3167028chrdOM','en-US','2652594poYcwZ','3784EhZWVe','main','802764QvSJBP','430bGKPoK','compress'];a93_0x221f=function(){return _0xb661f3;};return a93_0x221f();}export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a94_0xdcb24=a94_0x475f;(function(_0x27b355,_0x18c0e4){const _0x4197d5=a94_0x475f,_0x2bb7bf=_0x27b355();while(!![]){try{const _0x582027=-parseInt(_0x4197d5(0x1b0))/0x1+parseInt(_0x4197d5(0x1ae))/0x2+parseInt(_0x4197d5(0x1ab))/0x3+-parseInt(_0x4197d5(0x1b4))/0x4*(parseInt(_0x4197d5(0x1b1))/0x5)+parseInt(_0x4197d5(0x1b2))/0x6+-parseInt(_0x4197d5(0x1ac))/0x7*(-parseInt(_0x4197d5(0x1ad))/0x8)+-parseInt(_0x4197d5(0x1af))/0x9*(parseInt(_0x4197d5(0x1b3))/0xa);if(_0x582027===_0x18c0e4)break;else _0x2bb7bf['push'](_0x2bb7bf['shift']());}catch(_0x4af08a){_0x2bb7bf['push'](_0x2bb7bf['shift']());}}}(a94_0x2354,0x9695c));import{PRODUCT_CONFIG}from'../constant/product.js';function a94_0x2354(){const _0x392f83=['cliCdnBaseUrl','skillSource','npmPackageName','1770987kJVeCj','1578794BanIHj','8bMyRjw','1010052KkIefJ','312021JnSWZB','550645zmbeng','449140ntwCJT','4639092VGrucW','60DILWgk','32HzHmwq','/dist/lovrabet-cli/config/index.json'];a94_0x2354=function(){return _0x392f83;};return a94_0x2354();}function a94_0x475f(_0x3a16b4,_0x5eff3c){_0x3a16b4=_0x3a16b4-0x1aa;const _0x23545e=a94_0x2354();let _0x475fcb=_0x23545e[_0x3a16b4];return _0x475fcb;}export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a94_0xdcb24(0x1aa)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a94_0xdcb24(0x1b7)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG['npmRegistryBaseUrl'];export const LOVRABET_CLI_CDN_BASE_URL=PRODUCT_CONFIG[a94_0xdcb24(0x1b6)];export const LOVRABET_CLI_VERSION_POLICY_URL=LOVRABET_CLI_CDN_BASE_URL+a94_0xdcb24(0x1b5);
|
package/lib/constant/domain.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Why domain resolution is centralized here: the CLI makes HTTP requests to multiple
|
|
5
5
|
* backend services, each with its own domain. Rather than hard-coding URLs or
|
|
6
|
-
* duplicating the env-based selection logic, we expose
|
|
7
|
-
*
|
|
6
|
+
* duplicating the env-based selection logic, we expose three getter functions that
|
|
7
|
+
* encapsulate the rule:
|
|
8
8
|
*
|
|
9
9
|
* - production env → production domains
|
|
10
10
|
* - daily (staging) env → daily-prefixed domains
|
|
@@ -19,7 +19,7 @@ import { type LovrabetRegion } from "../constant/region.js";
|
|
|
19
19
|
/**
|
|
20
20
|
* Sets custom domain overrides read from the config file.
|
|
21
21
|
*
|
|
22
|
-
* Why pass an options object instead of
|
|
22
|
+
* Why pass an options object instead of three separate parameters: future-proofing.
|
|
23
23
|
* Adding a new domain type (e.g. `authDomain`) only requires adding a field here,
|
|
24
24
|
* not changing every call site. Typed `undefined` fields mean "use the default".
|
|
25
25
|
*
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a95_0x535f25=a95_0x5469;(function(_0x54443d,_0x54fcf0){const _0xbe1aaa=a95_0x5469,_0x3db5c0=_0x54443d();while(!![]){try{const _0x4cdd29=parseInt(_0xbe1aaa(0x13b))/0x1+-parseInt(_0xbe1aaa(0x132))/0x2*(parseInt(_0xbe1aaa(0x133))/0x3)+-parseInt(_0xbe1aaa(0x12e))/0x4+parseInt(_0xbe1aaa(0x136))/0x5+parseInt(_0xbe1aaa(0x137))/0x6+-parseInt(_0xbe1aaa(0x12d))/0x7*(-parseInt(_0xbe1aaa(0x139))/0x8)+parseInt(_0xbe1aaa(0x13d))/0x9;if(_0x4cdd29===_0x54fcf0)break;else _0x3db5c0['push'](_0x3db5c0['shift']());}catch(_0x3a5266){_0x3db5c0['push'](_0x3db5c0['shift']());}}}(a95_0x2743,0x701c8));import{getEnv,isProduction}from'../constant/env.js';import{OFFICIAL_ROUTING_PROFILES}from'../generated/official-routing.js';import{DEFAULT_LOVRABET_REGION}from'../constant/region.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillDomain,customKbDomain,activeRegion=DEFAULT_LOVRABET_REGION;export function initDomains(_0x170a4c){const _0x22f6bf=a95_0x5469;customApiDomain=_0x170a4c?.[_0x22f6bf(0x130)],customUserDomain=_0x170a4c?.[_0x22f6bf(0x12b)],customRuntimeDomain=_0x170a4c?.[_0x22f6bf(0x135)],customSkillDomain=_0x170a4c?.[_0x22f6bf(0x12a)],customKbDomain=_0x170a4c?.['kbDomain'],activeRegion=_0x170a4c?.['region']??DEFAULT_LOVRABET_REGION;}const getActiveRegionDomains=()=>{const _0x560890=a95_0x5469,_0x287748=OFFICIAL_ROUTING_PROFILES[activeRegion][_0x560890(0x138)];return isProduction(getEnv())?_0x287748[_0x560890(0x13a)]:_0x560890(0x12f)in _0x287748?_0x287748['daily']:_0x287748[_0x560890(0x13a)];};export const getUserDomain=()=>customUserDomain||getActiveRegionDomains()[a95_0x535f25(0x12c)];export const getApiDomain=()=>customApiDomain||getActiveRegionDomains()[a95_0x535f25(0x131)];export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains()[a95_0x535f25(0x134)];function a95_0x2743(){const _0x9d8763=['apiDomain','api','38098VGeike','6wydino','runtime','runtimeDomain','124305idlRKz','226614QgTVHh','serviceDomains','251752DcvZFA','production','735761JCXdOi','skill','2814579LrFwIu','skillDomain','userDomain','user','7bzdgHy','2581140JLaWcd','daily'];a95_0x2743=function(){return _0x9d8763;};return a95_0x2743();}export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains()[a95_0x535f25(0x13c)];function a95_0x5469(_0x573253,_0x362c0b){_0x573253=_0x573253-0x12a;const _0x2743d2=a95_0x2743();let _0x54691f=_0x2743d2[_0x573253];return _0x54691f;}export const getKbDomain=()=>customKbDomain||getActiveRegionDomains()['kb'];
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a96_0x49f702=a96_0x39ac;(function(_0x30cb9a,_0xfc3ad0){const _0x48fb73=a96_0x39ac,_0xba3fdd=_0x30cb9a();while(!![]){try{const _0x1ee587=parseInt(_0x48fb73(0xed))/0x1+parseInt(_0x48fb73(0xf1))/0x2+-parseInt(_0x48fb73(0xf4))/0x3*(-parseInt(_0x48fb73(0xf2))/0x4)+-parseInt(_0x48fb73(0xea))/0x5*(parseInt(_0x48fb73(0xf3))/0x6)+parseInt(_0x48fb73(0xf0))/0x7+parseInt(_0x48fb73(0xee))/0x8+-parseInt(_0x48fb73(0xe8))/0x9*(parseInt(_0x48fb73(0xec))/0xa);if(_0x1ee587===_0xfc3ad0)break;else _0xba3fdd['push'](_0xba3fdd['shift']());}catch(_0x21882d){_0xba3fdd['push'](_0xba3fdd['shift']());}}}(a96_0x4481,0x4af79));import{productEnv}from'../constant/product.js';function a96_0x4481(){const _0x4cb542=['production','9fDenPz','ENV','60scILLX','dev','7020330NatjDg','123985poNvMK','160288kwKzSS','daily','2433788liGiou','1167568rtBZun','814148eCxKfH','134964SgPuuj','3GdGesh'];a96_0x4481=function(){return _0x4cb542;};return a96_0x4481();}export const RUNTIME_ENV_VALUES=['production','development',a96_0x49f702(0xef)];export function normalizeEnv(_0x1477f4){const _0x3c3cb9=a96_0x49f702;return _0x1477f4==='online'?_0x3c3cb9(0xf5):_0x1477f4;}export function isProduction(_0x1a0576){return normalizeEnv(_0x1a0576)==='production';}export function isDaily(_0x2575ee){const _0x1e115c=a96_0x49f702;return normalizeEnv(_0x2575ee)===_0x1e115c(0xef);}export function isDev(_0x195cc4){const _0x3f12ad=a96_0x49f702,_0x1ed57d=normalizeEnv(_0x195cc4);return _0x1ed57d==='development'||_0x1ed57d===_0x3f12ad(0xeb);}let env=normalizeEnv(productEnv(a96_0x49f702(0xe9))||'production');function a96_0x39ac(_0x18a91e,_0x5725fa){_0x18a91e=_0x18a91e-0xe8;const _0x448189=a96_0x4481();let _0x39ac90=_0x448189[_0x18a91e];return _0x39ac90;}export function getEnv(){return env;}export function initEnv(_0x4b864d){env=normalizeEnv(_0x4b864d);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a97_0x18afd6=a97_0x428d;(function(_0x4f2a2b,_0x30d258){const _0x65cc21=a97_0x428d,_0x201286=_0x4f2a2b();while(!![]){try{const _0x4b2186=parseInt(_0x65cc21(0x161))/0x1*(-parseInt(_0x65cc21(0x168))/0x2)+-parseInt(_0x65cc21(0x162))/0x3+parseInt(_0x65cc21(0x166))/0x4+parseInt(_0x65cc21(0x163))/0x5*(-parseInt(_0x65cc21(0x16a))/0x6)+-parseInt(_0x65cc21(0x167))/0x7*(parseInt(_0x65cc21(0x15e))/0x8)+-parseInt(_0x65cc21(0x15f))/0x9+parseInt(_0x65cc21(0x160))/0xa;if(_0x4b2186===_0x30d258)break;else _0x201286['push'](_0x201286['shift']());}catch(_0x34bad4){_0x201286['push'](_0x201286['shift']());}}}(a97_0x2751,0x65c4e));function a97_0x2751(){const _0x4bab81=['json','pretty','2074984KAvLXV','21287siAKhh','114YpvULO','compress','366RECJxL','736YhqHcd','4263876euAvJl','22079160zJceTn','5778OpDGBJ','2017332bLfvXs','45450AHcFSQ'];a97_0x2751=function(){return _0x4bab81;};return a97_0x2751();}function a97_0x428d(_0x38134e,_0x1aa48d){_0x38134e=_0x38134e-0x15e;const _0x27517d=a97_0x2751();let _0x428d75=_0x27517d[_0x38134e];return _0x428d75;}export const OUTPUT_FORMAT_VALUES=[a97_0x18afd6(0x164),a97_0x18afd6(0x165),a97_0x18afd6(0x169)];
|
|
@@ -54,57 +54,6 @@ export declare const PRODUCT_CONFIG: {
|
|
|
54
54
|
readonly userCenterDisplayName: "Lovrabet User Center";
|
|
55
55
|
/** Env var suffix for skipping `npx skills add`. */
|
|
56
56
|
readonly skipNpxSkillsEnvSuffix: "SKIP_NPX_SKILLS";
|
|
57
|
-
/** Built-in official node profiles. Config file overrides still take precedence. */
|
|
58
|
-
readonly regionDomains: {
|
|
59
|
-
readonly cn: {
|
|
60
|
-
readonly production: {
|
|
61
|
-
readonly user: "https://user.lovrabet.com";
|
|
62
|
-
readonly api: "https://api.lovrabet.com";
|
|
63
|
-
readonly runtime: "https://runtime.lovrabet.com";
|
|
64
|
-
readonly skill: "https://skills.lovrabet.com";
|
|
65
|
-
readonly kb: "https://runtime.lovrabet.com";
|
|
66
|
-
};
|
|
67
|
-
readonly nonProduction: {
|
|
68
|
-
readonly user: "https://user-daily.lovrabet.com";
|
|
69
|
-
readonly api: "https://daily-api.lovrabet.com";
|
|
70
|
-
readonly runtime: "https://daily-runtime.lovrabet.com";
|
|
71
|
-
readonly skill: "https://skills-daily.lovrabet.com";
|
|
72
|
-
readonly kb: "https://daily-runtime.lovrabet.com";
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
readonly id: {
|
|
76
|
-
readonly production: {
|
|
77
|
-
readonly user: "https://user.lovrabet.id";
|
|
78
|
-
readonly api: "https://api.lovrabet.id";
|
|
79
|
-
readonly runtime: "https://runtime.lovrabet.id";
|
|
80
|
-
readonly skill: "https://skills.lovrabet.id";
|
|
81
|
-
readonly kb: "https://runtime.lovrabet.id";
|
|
82
|
-
};
|
|
83
|
-
readonly nonProduction: {
|
|
84
|
-
readonly user: "https://user-daily.lovrabet.id";
|
|
85
|
-
readonly api: "https://daily-api.lovrabet.id";
|
|
86
|
-
readonly runtime: "https://daily-runtime.lovrabet.id";
|
|
87
|
-
readonly skill: "https://skills-daily.lovrabet.id";
|
|
88
|
-
readonly kb: "https://daily-runtime.lovrabet.id";
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
readonly global: {
|
|
92
|
-
readonly production: {
|
|
93
|
-
readonly user: "https://user.lovrabet.ai";
|
|
94
|
-
readonly api: "https://api.lovrabet.ai";
|
|
95
|
-
readonly runtime: "https://runtime.lovrabet.ai";
|
|
96
|
-
readonly skill: "https://skills.lovrabet.ai";
|
|
97
|
-
readonly kb: "https://runtime.lovrabet.ai";
|
|
98
|
-
};
|
|
99
|
-
readonly nonProduction: {
|
|
100
|
-
readonly user: "https://user-daily.lovrabet.ai";
|
|
101
|
-
readonly api: "https://daily-api.lovrabet.ai";
|
|
102
|
-
readonly runtime: "https://daily-runtime.lovrabet.ai";
|
|
103
|
-
readonly skill: "https://skills-daily.lovrabet.ai";
|
|
104
|
-
readonly kb: "https://daily-runtime.lovrabet.ai";
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
57
|
/** User center path for creating an AccessKey. */
|
|
109
58
|
readonly accessKeyCreatePath: "/user/ak";
|
|
110
59
|
};
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a98_0x2302(){const _0x152031=['git@codeup.aliyun.com:yuntoo/open/lovrabet-runtime-cli.git','https://registry.npmjs.org','5nDqFsL','RABETBASE','envPrefix','/user/ak','map','994357BqvdGD','1271520iOZYpa','942126juVRjP','6265233OHngjo','1894032kYjRUJ','10OovWzf','.lovrabet.json','42DpbNNS','cli:lovrabet-runtime','232285AapbwK','217846cEDXBc','.lovrabet-runtime.log','https://g.lovrabet.com','LOVRABET','lovrabet/lovrabet-cli','legacyEnvPrefixes'];a98_0x2302=function(){return _0x152031;};return a98_0x2302();}const a98_0x1d0b40=a98_0x13ca;(function(_0x46def3,_0x888ae5){const _0x425252=a98_0x13ca,_0x16407a=_0x46def3();while(!![]){try{const _0x355a36=-parseInt(_0x425252(0x16e))/0x1*(parseInt(_0x425252(0x17d))/0x2)+-parseInt(_0x425252(0x175))/0x3+parseInt(_0x425252(0x177))/0x4+-parseInt(_0x425252(0x17c))/0x5*(-parseInt(_0x425252(0x17a))/0x6)+-parseInt(_0x425252(0x173))/0x7+-parseInt(_0x425252(0x174))/0x8+parseInt(_0x425252(0x176))/0x9*(parseInt(_0x425252(0x178))/0xa);if(_0x355a36===_0x888ae5)break;else _0x16407a['push'](_0x16407a['shift']());}catch(_0x20fd1c){_0x16407a['push'](_0x16407a['shift']());}}}(a98_0x2302,0x51d5c));function a98_0x13ca(_0x49c1d8,_0x119411){_0x49c1d8=_0x49c1d8-0x16d;const _0x2302bf=a98_0x2302();let _0x13caeb=_0x2302bf[_0x49c1d8];return _0x13caeb;}export const PRODUCT_CONFIG={'cliBinName':'lovrabet','cliDisplayName':'Lovrabet\x20Runtime\x20CLI','npmPackageName':'@lovrabet/lovrabet-cli','skillSource':a98_0x1d0b40(0x181),'internalSkillSource':a98_0x1d0b40(0x183),'globalSkillName':'lovrabet','npmRegistryBaseUrl':a98_0x1d0b40(0x16d),'cliCdnBaseUrl':a98_0x1d0b40(0x17f),'envPrefix':a98_0x1d0b40(0x180),'legacyEnvPrefixes':[a98_0x1d0b40(0x16f)],'configFileNames':[a98_0x1d0b40(0x179)],'newConfigFileName':a98_0x1d0b40(0x179),'homeDirName':'.lovrabet','logFileName':a98_0x1d0b40(0x17e),'invokeSource':a98_0x1d0b40(0x17b),'userCenterDisplayName':'Lovrabet\x20User\x20Center','skipNpxSkillsEnvSuffix':'SKIP_NPX_SKILLS','accessKeyCreatePath':a98_0x1d0b40(0x171)};export function productEnvName(_0x1fc410){const _0x59ab59=a98_0x1d0b40;return PRODUCT_CONFIG[_0x59ab59(0x170)]+'_'+_0x1fc410;}export function productEnvNames(_0x3a04ad){const _0x23d6e4=a98_0x1d0b40;return[productEnvName(_0x3a04ad),...PRODUCT_CONFIG[_0x23d6e4(0x182)][_0x23d6e4(0x172)](_0x9823a7=>_0x9823a7+'_'+_0x3a04ad)];}export function productEnv(_0x53f112){for(const _0x3100ab of productEnvNames(_0x53f112)){const _0x49d43c=process.env[_0x3100ab];if(_0x49d43c!==undefined)return _0x49d43c;}return undefined;}
|
package/lib/constant/region.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Lovrabet deployment-region constants and normalization.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* remain authoritative
|
|
6
|
-
* region with an enterprise-local runtime endpoint.
|
|
4
|
+
* Region metadata is generated from the canonical routing catalog. Explicit
|
|
5
|
+
* Domain overrides remain authoritative for enterprise deployments.
|
|
7
6
|
*/
|
|
8
7
|
export declare const LOVRABET_REGION_VALUES: readonly ["cn", "id", "global"];
|
|
9
|
-
/** Regions currently available for new CLI configuration. */
|
|
10
8
|
export declare const ENABLED_LOVRABET_REGION_VALUES: readonly ["cn", "id"];
|
|
11
9
|
export type LovrabetRegion = (typeof LOVRABET_REGION_VALUES)[number];
|
|
12
10
|
export declare const DEFAULT_LOVRABET_REGION: LovrabetRegion;
|
|
13
11
|
export declare function isLovrabetRegion(value: unknown): value is LovrabetRegion;
|
|
14
|
-
export declare function isEnabledLovrabetRegion(value: unknown): value is
|
|
12
|
+
export declare function isEnabledLovrabetRegion(value: unknown): value is LovrabetRegion;
|
|
15
13
|
export declare function normalizeLovrabetRegion(value: unknown): LovrabetRegion;
|
package/lib/constant/region.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a99_0x4b31(){const _0x2011ce=['42215mjkgPU','Run\x20`lovrabet\x20config\x20init`\x20to\x20restore\x20the\x20global\x20country/region\x20configuration.','1411278DdUXzS','validation','261234nhzeKA','9AupXsP','Region\x20\x22','28mzCMsT','includes','3003GjCKxH','string','2oxPRjT','443560cwtZGi','9190rzgZCu','667765fPPlQy','Invalid\x20region\x20value:\x20expected\x20a\x20string,\x20received\x20','410898zWnRre'];a99_0x4b31=function(){return _0x2011ce;};return a99_0x4b31();}(function(_0x168f68,_0x504aa8){const _0x4d4500=a99_0xbd33,_0x17f27b=_0x168f68();while(!![]){try{const _0x7e4f7d=-parseInt(_0x4d4500(0xfb))/0x1+parseInt(_0x4d4500(0xf1))/0x2*(parseInt(_0x4d4500(0xf6))/0x3)+parseInt(_0x4d4500(0xfe))/0x4*(-parseInt(_0x4d4500(0xf7))/0x5)+parseInt(_0x4d4500(0xf9))/0x6+-parseInt(_0x4d4500(0xf4))/0x7+-parseInt(_0x4d4500(0xf2))/0x8*(parseInt(_0x4d4500(0xfc))/0x9)+-parseInt(_0x4d4500(0xf3))/0xa*(-parseInt(_0x4d4500(0xef))/0xb);if(_0x7e4f7d===_0x504aa8)break;else _0x17f27b['push'](_0x17f27b['shift']());}catch(_0x128d79){_0x17f27b['push'](_0x17f27b['shift']());}}}(a99_0x4b31,0x25153));import{DEFAULT_REGION,ENABLED_REGION_VALUES,REGION_ALIASES,REGION_VALUES}from'../generated/official-routing.js';import{CliErrors}from'../errors.js';export const LOVRABET_REGION_VALUES=REGION_VALUES;export const ENABLED_LOVRABET_REGION_VALUES=ENABLED_REGION_VALUES;export const DEFAULT_LOVRABET_REGION=DEFAULT_REGION;function a99_0xbd33(_0x1c41d2,_0x1f7c75){_0x1c41d2=_0x1c41d2-0xef;const _0x4b3139=a99_0x4b31();let _0xbd33b4=_0x4b3139[_0x1c41d2];return _0xbd33b4;}export function isLovrabetRegion(_0x4d907){return typeof _0x4d907==='string'&&LOVRABET_REGION_VALUES['includes'](_0x4d907);}export function isEnabledLovrabetRegion(_0x3adbac){const _0x104d60=a99_0xbd33;return typeof _0x3adbac==='string'&&ENABLED_LOVRABET_REGION_VALUES[_0x104d60(0xff)](_0x3adbac);}export function normalizeLovrabetRegion(_0x4efb27){const _0x5f3726=a99_0xbd33;if(_0x4efb27===undefined||_0x4efb27===null||_0x4efb27==='')return DEFAULT_LOVRABET_REGION;if(typeof _0x4efb27!==_0x5f3726(0xf0))throw CliErrors[_0x5f3726(0xfa)](_0x5f3726(0xf5)+typeof _0x4efb27+'.',_0x5f3726(0xf8));const _0x3cebd1=REGION_ALIASES[_0x4efb27]??_0x4efb27;if(isEnabledLovrabetRegion(_0x3cebd1))return _0x3cebd1;throw CliErrors[_0x5f3726(0xfa)](_0x5f3726(0xfd)+_0x4efb27+'\x22\x20is\x20not\x20currently\x20available.','Available\x20regions:\x20'+ENABLED_LOVRABET_REGION_VALUES['join'](',\x20')+'.\x20Run\x20`lovrabet\x20config\x20init`\x20to\x20repair\x20the\x20global\x20configuration.');}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a100_0x3037(_0x131787,_0x2ae73c){_0x131787=_0x131787-0xfc;const _0x1b4dc8=a100_0x1b4d();let _0x3037f5=_0x1b4dc8[_0x131787];return _0x3037f5;}const a100_0x1c80c5=a100_0x3037;function a100_0x1b4d(){const _0x5ceaa7=['227496HGHZcF','1997408WPKksV','34odCyvH','read','write','5763710lnRiie','5370JEIsHC','7382874mNZIYv','69993XVXgro','2720424lXGNRE','26594mVKPmO','49ZMbJkx'];a100_0x1b4d=function(){return _0x5ceaa7;};return a100_0x1b4d();}(function(_0x38d346,_0x178bc9){const _0x59f820=a100_0x3037,_0x124ee7=_0x38d346();while(!![]){try{const _0x5d7a2c=parseInt(_0x59f820(0x106))/0x1*(parseInt(_0x59f820(0xfe))/0x2)+-parseInt(_0x59f820(0x105))/0x3+-parseInt(_0x59f820(0xfd))/0x4+-parseInt(_0x59f820(0x101))/0x5+-parseInt(_0x59f820(0x103))/0x6+-parseInt(_0x59f820(0x107))/0x7*(parseInt(_0x59f820(0xfc))/0x8)+parseInt(_0x59f820(0x104))/0x9*(parseInt(_0x59f820(0x102))/0xa);if(_0x5d7a2c===_0x178bc9)break;else _0x124ee7['push'](_0x124ee7['shift']());}catch(_0x297565){_0x124ee7['push'](_0x124ee7['shift']());}}}(a100_0x1b4d,0x9c3a3));export const RISK_LEVEL_VALUES=[a100_0x1c80c5(0xff),a100_0x1c80c5(0x100),'high-risk-write'];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x96d27f,_0x54f4ec){const _0x22d4cb=a101_0x36c1,_0x2f9e0f=_0x96d27f();while(!![]){try{const _0x38826d=-parseInt(_0x22d4cb(0x1c6))/0x1+-parseInt(_0x22d4cb(0x1c1))/0x2*(parseInt(_0x22d4cb(0x1bc))/0x3)+parseInt(_0x22d4cb(0x1c3))/0x4*(-parseInt(_0x22d4cb(0x1bb))/0x5)+parseInt(_0x22d4cb(0x1bd))/0x6+parseInt(_0x22d4cb(0x1b8))/0x7*(parseInt(_0x22d4cb(0x1c0))/0x8)+parseInt(_0x22d4cb(0x1be))/0x9*(-parseInt(_0x22d4cb(0x1b9))/0xa)+parseInt(_0x22d4cb(0x1bf))/0xb*(parseInt(_0x22d4cb(0x1c4))/0xc);if(_0x38826d===_0x54f4ec)break;else _0x2f9e0f['push'](_0x2f9e0f['shift']());}catch(_0x579bd1){_0x2f9e0f['push'](_0x2f9e0f['shift']());}}}(a101_0x4a93,0x60cf0));import{PRODUCT_CONFIG}from'../constant/product.js';import{OFFICIAL_ROUTING_PROFILES}from'../generated/official-routing.js';function a101_0x4a93(){const _0x23ab0e=['408492JBmEES','22wTYmaW','3672qtaNGS','2dNXykU','serviceDomains','12RwSRtX','11578956CFZLyZ','accessKeyCreatePath','160864AYqCcM','user','5915blQxoo','160aCYFcc','production','958445MDbPTH','2110683XauIca','1467282NtKzcK'];a101_0x4a93=function(){return _0x23ab0e;};return a101_0x4a93();}import{DEFAULT_LOVRABET_REGION}from'../constant/region.js';export function getUserAccessKeyCreateUrl(_0x4531ab=DEFAULT_LOVRABET_REGION){const _0x4ad0d8=a101_0x36c1,_0x2e85fb=OFFICIAL_ROUTING_PROFILES[_0x4531ab][_0x4ad0d8(0x1c2)][_0x4ad0d8(0x1ba)][_0x4ad0d8(0x1b7)];return''+_0x2e85fb+PRODUCT_CONFIG[_0x4ad0d8(0x1c5)];}function a101_0x36c1(_0x569023,_0x1bcf1f){_0x569023=_0x569023-0x1b7;const _0x4a93cb=a101_0x4a93();let _0x36c1db=_0x4a93cb[_0x569023];return _0x36c1db;}export const USER_ACCESS_KEY_CREATE_URL=getUserAccessKeyCreateUrl();
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a102_0x37f99d=a102_0x2305;(function(_0x275e97,_0x2eaf98){const _0x4e4678=a102_0x2305,_0x1994a3=_0x275e97();while(!![]){try{const _0x57ff57=-parseInt(_0x4e4678(0x140))/0x1+-parseInt(_0x4e4678(0x135))/0x2*(parseInt(_0x4e4678(0x157))/0x3)+parseInt(_0x4e4678(0x12d))/0x4+parseInt(_0x4e4678(0x129))/0x5*(-parseInt(_0x4e4678(0x14f))/0x6)+parseInt(_0x4e4678(0x139))/0x7*(-parseInt(_0x4e4678(0x136))/0x8)+parseInt(_0x4e4678(0x158))/0x9+parseInt(_0x4e4678(0x147))/0xa;if(_0x57ff57===_0x2eaf98)break;else _0x1994a3['push'](_0x1994a3['shift']());}catch(_0x2c9754){_0x1994a3['push'](_0x1994a3['shift']());}}}(a102_0x27a8,0xa4943));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';import{normalizeLovrabetRegion}from'./constant/region.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a102_0x37f99d(0x11f)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a102_0x37f99d(0x159)];function resolveConfigPath(_0x326fc7){for(const _0xbed780 of CONFIG_NAMES){const _0x46db76=resolve(_0x326fc7,_0xbed780);if(existsSync(_0x46db76))return _0x46db76;}return undefined;}export function resolveWriteConfigPath(_0x47a9a3){const _0x4e666e=a102_0x37f99d,_0x433c77=_0x47a9a3===_0x4e666e(0x138)?process[_0x4e666e(0x128)]():homedir(),_0x2a424e=resolveConfigPath(_0x433c77);return _0x2a424e??resolve(_0x433c77,NEW_CONFIG_NAME);}export function readConfigFile(_0x1625c1){const _0x140bde=a102_0x37f99d;try{if(existsSync(_0x1625c1)){const _0xad77c6=readFileSync(_0x1625c1,{'encoding':_0x140bde(0x116)});if(_0xad77c6){const _0x531265=JSON[_0x140bde(0x13f)](_0xad77c6);return migrateOnlineEnv(_0x1625c1,_0x531265),_0x531265;}}}catch{}return{};}function a102_0x2305(_0x4b93e1,_0x35ca4c){_0x4b93e1=_0x4b93e1-0x10d;const _0x27a8b6=a102_0x27a8();let _0x230514=_0x27a8b6[_0x4b93e1];return _0x230514;}function migrateOnlineEnv(_0xcb74cd,_0x11a86d){const _0x1b5344=a102_0x37f99d;let _0x40d01b=![];_0x11a86d[_0x1b5344(0x10f)]===_0x1b5344(0x151)&&(_0x11a86d['env']=_0x1b5344(0x11a),_0x40d01b=!![]);if(_0x11a86d[_0x1b5344(0x123)]&&typeof _0x11a86d[_0x1b5344(0x123)]===_0x1b5344(0x121))for(const _0x61e5 of Object['values'](_0x11a86d[_0x1b5344(0x123)])){_0x61e5&&_0x61e5[_0x1b5344(0x10f)]==='online'&&(_0x61e5['env']=_0x1b5344(0x11a),_0x40d01b=!![]);}if(_0x40d01b)try{writeConfigFile(_0xcb74cd,_0x11a86d);}catch{}}export function writeConfigFile(_0x140bd8,_0xc86d9f){const _0x2c8768=a102_0x37f99d,_0x23e4e8=dirname(_0x140bd8);!existsSync(_0x23e4e8)&&mkdirSync(_0x23e4e8,{'recursive':!![]});const _0x3223c1=_0x140bd8+_0x2c8768(0x110);try{writeFileSync(_0x3223c1,JSON[_0x2c8768(0x125)](_0xc86d9f,null,0x2)+'\x0a',{'encoding':_0x2c8768(0x116),'mode':0x180});try{renameSync(_0x3223c1,_0x140bd8);}catch(_0x551567){if(_0x551567[_0x2c8768(0x12b)]===_0x2c8768(0x112)||_0x551567['code']===_0x2c8768(0x111)||_0x551567[_0x2c8768(0x12b)]===_0x2c8768(0x14e)){writeFileSync(_0x140bd8,JSON[_0x2c8768(0x125)](_0xc86d9f,null,0x2)+'\x0a',{'encoding':_0x2c8768(0x116)});try{unlinkSync(_0x3223c1);}catch{}}else throw _0x551567;}}catch(_0x56f077){try{unlinkSync(_0x3223c1);}catch{}throw _0x56f077;}}export function isNonInteractiveMode(_0x490785){const _0x5cd124=a102_0x37f99d;return!!(_0x490785[_0x5cd124(0x13a)]||_0x490785['ci']||productEnvNames('CI')[_0x5cd124(0x15d)](_0x450299=>process.env[_0x450299]==='true')||process.env.CI==='true'||!process[_0x5cd124(0x130)][_0x5cd124(0x13c)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x256fdd=a102_0x37f99d;if(!process[_0x256fdd(0x15e)][_0x256fdd(0x13c)])return![];try{const _0x4a50f6=process[_0x256fdd(0x15e)][_0x256fdd(0x14c)];return process[_0x256fdd(0x15e)][_0x256fdd(0x156)](!![]),process['stdin'][_0x256fdd(0x156)](_0x4a50f6??![]),!![];}catch{return![];}}export async function createContext(_0x3fb834){const _0x30b871=a102_0x37f99d,_0x4482cd=readRawConfig(),_0x5518d2=buildConfig(_0x4482cd,_0x3fb834);await initGlobalEnvironment(_0x5518d2);const {getUserDomain:_0x20536d,getApiDomain:_0x5bc690}=await import(_0x30b871(0x13e)),_0x586d79={'apiDomain':_0x5bc690(),'userDomain':_0x20536d()},_0x3e9f2c=await buildAuth(_0x5518d2);logger[_0x30b871(0x127)](process[_0x30b871(0x128)]());const _0x24bda9=(CLI_BIN_NAME+'\x20'+process[_0x30b871(0x160)]['slice'](0x2)[_0x30b871(0x10e)]('\x20'))[_0x30b871(0x150)]();logger[_0x30b871(0x132)](_0x24bda9);const _0x14dbe7=isNonInteractiveMode(_0x3fb834);return{'config':_0x5518d2,'auth':_0x3e9f2c,'logger':logger,'env':_0x586d79,'nonInteractive':_0x14dbe7};}export function buildConfigFromFlags(_0x240645){return buildConfig(readRawConfig(),_0x240645);}export function getLocalAppAliases(_0x1f31d6){const _0x5911d1=a102_0x37f99d;return _0x1f31d6[_0x5911d1(0x123)]&&typeof _0x1f31d6[_0x5911d1(0x123)]==='object'?_0x1f31d6[_0x5911d1(0x123)]:{};}export function resolveLocalAppAliasCode(_0x37369b,_0x2f8971){const _0x29bc2e=a102_0x37f99d;if(!_0x2f8971)return undefined;const _0x586341=getLocalAppAliases(_0x37369b)[_0x2f8971],_0x74b24a=_0x586341?.[_0x29bc2e(0x145)];return typeof _0x74b24a===_0x29bc2e(0x117)&&_0x74b24a[_0x29bc2e(0x150)]()?_0x74b24a[_0x29bc2e(0x150)]():undefined;}export function readAppCodeFromConfig(){const _0x320ce2=a102_0x37f99d,_0x9f5e2c=readRawConfig(),_0x5a0691=_0x9f5e2c[_0x320ce2(0x145)]??_0x9f5e2c[_0x320ce2(0x115)];if(typeof _0x5a0691===_0x320ce2(0x117)&&_0x5a0691['trim']())return _0x5a0691[_0x320ce2(0x150)]();const _0x397c95=resolveLocalAppAliasCode(_0x9f5e2c,typeof _0x9f5e2c[_0x320ce2(0x124)]===_0x320ce2(0x117)?_0x9f5e2c[_0x320ce2(0x124)]:undefined);if(_0x397c95)return _0x397c95;const _0x5bd449=normalizeEnv(String(_0x9f5e2c[_0x320ce2(0x10f)]||_0x320ce2(0x11a))),_0x3f12be=isDaily(_0x5bd449)?_0x320ce2(0x15c):isDev(_0x5bd449)?'development':_0x320ce2(0x11a),_0x162fae=resolveCachedAppCode(typeof _0x9f5e2c['defaultApp']===_0x320ce2(0x117)?_0x9f5e2c['defaultApp']:undefined,_0x3f12be,typeof _0x9f5e2c['accessKey']===_0x320ce2(0x117)?_0x9f5e2c['accessKey']:undefined);if(_0x162fae)return _0x162fae;const _0x584d82=Object['values'](getLocalAppAliases(_0x9f5e2c))[_0x320ce2(0x144)](_0x553a3d=>_0x553a3d?.[_0x320ce2(0x145)]);return typeof _0x584d82?.[_0x320ce2(0x145)]===_0x320ce2(0x117)&&_0x584d82[_0x320ce2(0x145)][_0x320ce2(0x150)]()?_0x584d82[_0x320ce2(0x145)][_0x320ce2(0x150)]():undefined;}export function readScopedConfig(_0x350851){const _0x226026=a102_0x37f99d,_0x1c401f=_0x350851[_0x226026(0x148)]?_0x226026(0x148):'project';return readConfigFile(resolveWriteConfigPath(_0x1c401f));}function a102_0x27a8(){const _0x189e03=['high-risk-write','globalConfig','configFileNames','authRequired','object','skillDomain','apps','defaultApp','stringify','cache','setLogPath','cwd','5Tilucl','ACCESS_KEY','code','platformDomain','1325824gnapfr','PAGE_SIZE','./constant/env.js','stdout','ENV','setRawCommand','pageSize','missing','668154LXqSMl','38680ZrNUdD','APPCODE','project','686QOupHU','nonInteractive','explicit','isTTY','FORMAT','./constant/domain.js','parse','485437xpIvKW','agentDomain','accessKey','runtimeDomain','find','appcode','top-level','27376220UEwnDz','global','riskLevel','projectConfig','development','isRaw','raw','EACCES','7076178ZwJIRZ','trim','online','write','nativeToolAvailable','userDomain','locale','setRawMode','3DuKODp','699696ZIFVrA','newConfigFileName','VERBOSE','true','daily','some','stdin','format','argv','error','join','env','.tmp','EXDEV','EPERM','region','APP','app','utf8','string','apiDomain','kbDomain','production','empty','skillHubDomain'];a102_0x27a8=function(){return _0x189e03;};return a102_0x27a8();}export function writeScopedConfig(_0x59afde,_0x1f7a5d){const _0x303582=a102_0x37f99d,_0x5ed48e=_0x1f7a5d[_0x303582(0x148)]?_0x303582(0x148):_0x303582(0x138);writeConfigFile(resolveWriteConfigPath(_0x5ed48e),_0x59afde);}export async function initGlobalEnvironment(_0x4ffeaa){const _0xedebdf=a102_0x37f99d,{initEnv:_0x12044f}=await import(_0xedebdf(0x12f));_0x12044f(_0x4ffeaa['env']);const {initDomains:_0x36f761}=await import(_0xedebdf(0x13e));_0x36f761({'apiDomain':_0x4ffeaa['raw'][_0xedebdf(0x118)]||_0x4ffeaa[_0xedebdf(0x14d)]['host']||undefined,'userDomain':_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x154)]||undefined,'runtimeDomain':_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x143)]||undefined,'skillDomain':_0x4ffeaa['raw'][_0xedebdf(0x122)]||_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x11c)]||_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x141)]||_0x4ffeaa['raw'][_0xedebdf(0x12c)]||undefined,'kbDomain':_0x4ffeaa['raw'][_0xedebdf(0x119)]||_0x4ffeaa['raw']['agentDomain']||_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x12c)]||_0x4ffeaa[_0xedebdf(0x14d)][_0xedebdf(0x143)]||undefined,'region':normalizeLovrabetRegion(_0x4ffeaa['raw'][_0xedebdf(0x113)])});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x510137){const _0x182547=a102_0x37f99d;if(!existsSync(_0x510137))return{'status':_0x182547(0x134)};try{const _0x33050e=readFileSync(_0x510137,{'encoding':'utf8'});if(!_0x33050e?.[_0x182547(0x150)]())return{'status':_0x182547(0x11b)};const _0x3b7559=JSON[_0x182547(0x13f)](_0x33050e);return{'status':'ok','data':_0x3b7559};}catch(_0x33ff49){return{'status':_0x182547(0x10d),'message':_0x33ff49 instanceof Error?_0x33ff49['message']:String(_0x33ff49)};}}export function loadRawConfigLayers(_0x1d090e){const _0x2ff5de=a102_0x37f99d;let _0x1eaaa5={},_0x1596d9={},_0x4b95f2,_0x58ee3d;try{_0x4b95f2=resolveConfigPath(homedir());if(_0x4b95f2){const _0x26911e=readFileSync(_0x4b95f2,{'encoding':'utf8'});if(_0x26911e)_0x1eaaa5=JSON[_0x2ff5de(0x13f)](_0x26911e);}}catch{}try{const _0x169d60=_0x1d090e||process['cwd']();_0x58ee3d=resolveConfigPath(_0x169d60);if(_0x58ee3d){const _0x5746f0=readFileSync(_0x58ee3d,{'encoding':_0x2ff5de(0x116)});if(_0x5746f0)_0x1596d9=JSON[_0x2ff5de(0x13f)](_0x5746f0);}}catch{}return{'globalPath':_0x4b95f2,'projectPath':_0x58ee3d,'globalConfig':_0x1eaaa5,'projectConfig':_0x1596d9};}function mergeRawConfigLayers(_0x2935d9){const _0x4b904c=a102_0x37f99d,{globalConfig:_0x1b809b,projectConfig:_0x3c6dd8}=_0x2935d9,_0x13a55d={..._0x1b809b,..._0x3c6dd8};delete _0x13a55d['inherit'];if('defaultApp'in _0x3c6dd8)_0x13a55d['defaultApp']=_0x3c6dd8[_0x4b904c(0x124)];else _0x1b809b[_0x4b904c(0x124)]&&(_0x13a55d[_0x4b904c(0x124)]=_0x1b809b[_0x4b904c(0x124)]);return _0x13a55d;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x17574b){return mergeRawConfigLayers(loadRawConfigLayers(_0x17574b));}export function readRawConfigWithLayers(_0x36dddd){const _0x5bde2b=loadRawConfigLayers(_0x36dddd);return{'config':mergeRawConfigLayers(_0x5bde2b),'layers':_0x5bde2b};}export function resolveDefaultAppSource(_0x439813){const _0x366480=a102_0x37f99d;if(_0x366480(0x124)in _0x439813[_0x366480(0x14a)])return _0x366480(0x138);if(_0x439813[_0x366480(0x11e)]['defaultApp'])return'global';return null;}function buildConfig(_0x3185f9,_0x2545de){const _0x3fc334=a102_0x37f99d,_0x13c99c=_0x3185f9[_0x3fc334(0x124)]||undefined,_0x47fcb0=_0x2545de['app']||env(_0x3fc334(0x114))||undefined,_0xaf8539=_0x47fcb0||_0x13c99c||undefined,_0x598e55=env(_0x3fc334(0x12a))||_0x3185f9[_0x3fc334(0x142)]||undefined,_0x575448=_0x2545de[_0x3fc334(0x10f)]||env(_0x3fc334(0x131))||_0x3185f9[_0x3fc334(0x10f)]||DEFAULT_CONFIG_VALUES['env'],_0xb8d3b7=normalizeEnv(String(_0x575448)),_0x2abc3a=isDaily(_0xb8d3b7)?_0x3fc334(0x15c):isDev(_0xb8d3b7)?_0x3fc334(0x14b):_0x3fc334(0x11a),_0x1a7d68=typeof _0x2545de[_0x3fc334(0x145)]===_0x3fc334(0x117)?_0x2545de[_0x3fc334(0x145)]:undefined,_0x484f8a=env(_0x3fc334(0x137)),_0x7532b5=_0x47fcb0?undefined:_0x3185f9[_0x3fc334(0x145)]||_0x3185f9[_0x3fc334(0x115)]||undefined,_0x5d3ec2=_0x47fcb0||(_0x7532b5?undefined:_0x13c99c),_0x25d205=resolveLocalAppAliasCode(_0x3185f9,_0x5d3ec2),_0x19535f=resolveCachedAppCode(_0x5d3ec2,_0x2abc3a,_0x598e55),_0x4e0515=_0x1a7d68||_0x484f8a||_0x7532b5||_0x25d205||_0x19535f||undefined,_0x2702ef=_0x1a7d68?_0x3fc334(0x13b):_0x484f8a?_0x3fc334(0x10f):_0x7532b5?_0x3fc334(0x146):_0x25d205?'local-alias':_0x19535f?_0x3fc334(0x126):undefined,_0x521fa7=_0x3185f9['locale']||DEFAULT_CONFIG_VALUES[_0x3fc334(0x155)],_0x2e55fc=undefined,_0x5c79eb=_0x2545de[_0x3fc334(0x15f)]||env(_0x3fc334(0x13d))||_0x3185f9[_0x3fc334(0x15f)],_0x35bdf9=normalizeLegacyOutputFormat(_0x5c79eb),_0x15d30d=env(_0x3fc334(0x12e))||_0x3185f9[_0x3fc334(0x133)],_0x2ef255=_0x15d30d?Number(_0x15d30d)||undefined:undefined,_0x1f9445=_0x3185f9[_0x3fc334(0x149)],_0x53b628=_0x1f9445==='read'||_0x1f9445===_0x3fc334(0x152)||_0x1f9445===_0x3fc334(0x11d)?_0x1f9445:DEFAULT_CONFIG_VALUES['riskLevel'],_0x3101bc=_0x3185f9[_0x3fc334(0x153)]===!![],_0x54d0b0=env(_0x3fc334(0x15a)),_0xd43e13=_0x54d0b0==='1'||_0x54d0b0===_0x3fc334(0x15b);return{'appCode':typeof _0x4e0515===_0x3fc334(0x117)&&_0x4e0515[_0x3fc334(0x150)]()?_0x4e0515[_0x3fc334(0x150)]():undefined,'appCodeSource':_0x2702ef,'env':_0x2abc3a,'locale':_0x521fa7,'cookie':_0x2e55fc,'accessKey':_0x598e55,'format':_0x35bdf9,'pageSize':_0x2ef255,'riskLevel':_0x53b628,'nativeToolAvailable':_0x3101bc,'verbose':_0xd43e13,'defaultApp':_0x13c99c,'currentApp':typeof _0xaf8539===_0x3fc334(0x117)?_0xaf8539:undefined,'raw':_0x3185f9};}function env(_0x3533cb){return productEnv(_0x3533cb);}async function buildAuth(_0x56c372){const _0x1de767=a102_0x37f99d,_0x1ba66a='',_0x2ca31b=!!_0x56c372[_0x1de767(0x142)];return{'cookie':_0x1ba66a,'isLoggedIn':_0x2ca31b,async 'getOrLogin'(){const _0x161788=_0x1de767;if(_0x2ca31b)return _0x1ba66a;throw CliErrors[_0x161788(0x120)]();}};}
|
|
1
|
+
const a102_0x53e2fc=a102_0x3613;(function(_0xee0e88,_0x41389a){const _0x3b5e86=a102_0x3613,_0x8f9a52=_0xee0e88();while(!![]){try{const _0x2df7b2=-parseInt(_0x3b5e86(0x1a7))/0x1*(parseInt(_0x3b5e86(0x177))/0x2)+-parseInt(_0x3b5e86(0x199))/0x3+-parseInt(_0x3b5e86(0x1a1))/0x4+parseInt(_0x3b5e86(0x197))/0x5+-parseInt(_0x3b5e86(0x1af))/0x6*(parseInt(_0x3b5e86(0x179))/0x7)+-parseInt(_0x3b5e86(0x18f))/0x8*(parseInt(_0x3b5e86(0x165))/0x9)+-parseInt(_0x3b5e86(0x19a))/0xa*(-parseInt(_0x3b5e86(0x171))/0xb);if(_0x2df7b2===_0x41389a)break;else _0x8f9a52['push'](_0x8f9a52['shift']());}catch(_0x48fcff){_0x8f9a52['push'](_0x8f9a52['shift']());}}}(a102_0x5445,0xd7668));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';import{normalizeLovrabetRegion}from'./constant/region.js';import{resolveEnterpriseRoutingConfig}from'./config/domain-config.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a102_0x53e2fc(0x178)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a102_0x53e2fc(0x191)];function a102_0x3613(_0x7cf00,_0x2f7ca7){_0x7cf00=_0x7cf00-0x162;const _0x5445d7=a102_0x5445();let _0x361330=_0x5445d7[_0x7cf00];return _0x361330;}function resolveConfigPath(_0x5a8b5a){for(const _0x14edbb of CONFIG_NAMES){const _0x34dda9=resolve(_0x5a8b5a,_0x14edbb);if(existsSync(_0x34dda9))return _0x34dda9;}return undefined;}export function resolveWriteConfigPath(_0x594622){const _0x1515aa=a102_0x53e2fc,_0x2d1bc9=_0x594622===_0x1515aa(0x19c)?process['cwd']():homedir(),_0x3fa98a=resolveConfigPath(_0x2d1bc9);return _0x3fa98a??resolve(_0x2d1bc9,NEW_CONFIG_NAME);}export function readConfigFile(_0xde3aaa){const _0x26e6a2=a102_0x53e2fc;try{if(existsSync(_0xde3aaa)){const _0x5e8d48=readFileSync(_0xde3aaa,{'encoding':_0x26e6a2(0x1b4)});if(_0x5e8d48){const _0x1f6b5c=JSON[_0x26e6a2(0x17b)](_0x5e8d48);return migrateOnlineEnv(_0xde3aaa,_0x1f6b5c),_0x1f6b5c;}}}catch{}return{};}function migrateOnlineEnv(_0x4a1a64,_0xad238d){const _0x339105=a102_0x53e2fc;let _0x2a67a3=![];_0xad238d[_0x339105(0x182)]==='online'&&(_0xad238d[_0x339105(0x182)]=_0x339105(0x1b2),_0x2a67a3=!![]);if(_0xad238d[_0x339105(0x176)]&&typeof _0xad238d[_0x339105(0x176)]===_0x339105(0x195))for(const _0x2026ac of Object['values'](_0xad238d[_0x339105(0x176)])){_0x2026ac&&_0x2026ac[_0x339105(0x182)]===_0x339105(0x1ac)&&(_0x2026ac[_0x339105(0x182)]=_0x339105(0x1b2),_0x2a67a3=!![]);}if(_0x2a67a3)try{writeConfigFile(_0x4a1a64,_0xad238d);}catch{}}export function writeConfigFile(_0x58a637,_0x230858){const _0x2a09ba=a102_0x53e2fc,_0x52877e=dirname(_0x58a637);!existsSync(_0x52877e)&&mkdirSync(_0x52877e,{'recursive':!![]});const _0x27a1d1=_0x58a637+_0x2a09ba(0x19e);try{writeFileSync(_0x27a1d1,JSON[_0x2a09ba(0x198)](_0x230858,null,0x2)+'\x0a',{'encoding':_0x2a09ba(0x1b4),'mode':0x180});try{renameSync(_0x27a1d1,_0x58a637);}catch(_0x1eb885){if(_0x1eb885[_0x2a09ba(0x1a4)]===_0x2a09ba(0x17e)||_0x1eb885[_0x2a09ba(0x1a4)]==='EXDEV'||_0x1eb885[_0x2a09ba(0x1a4)]===_0x2a09ba(0x17f)){writeFileSync(_0x58a637,JSON[_0x2a09ba(0x198)](_0x230858,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x27a1d1);}catch{}}else throw _0x1eb885;}}catch(_0x2d2800){try{unlinkSync(_0x27a1d1);}catch{}throw _0x2d2800;}}export function isNonInteractiveMode(_0x2dab9d){const _0x691372=a102_0x53e2fc;return!!(_0x2dab9d[_0x691372(0x18c)]||_0x2dab9d['ci']||productEnvNames('CI')[_0x691372(0x183)](_0x18650c=>process.env[_0x18650c]===_0x691372(0x168))||process.env.CI==='true'||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x3765e7=a102_0x53e2fc;if(!process[_0x3765e7(0x1ad)][_0x3765e7(0x18a)])return![];try{const _0x1d1ef2=process['stdin']['isRaw'];return process[_0x3765e7(0x1ad)][_0x3765e7(0x1a0)](!![]),process[_0x3765e7(0x1ad)][_0x3765e7(0x1a0)](_0x1d1ef2??![]),!![];}catch{return![];}}export async function createContext(_0x2630f3){const _0x347b77=a102_0x53e2fc,_0xf51ea2=readRawConfig(),_0x4f2e50=buildConfig(_0xf51ea2,_0x2630f3);await initGlobalEnvironment(_0x4f2e50);const {getUserDomain:_0x1a13e0,getApiDomain:_0x4bd8e4}=await import(_0x347b77(0x189)),_0x1080b3={'apiDomain':_0x4bd8e4(),'userDomain':_0x1a13e0()},_0x44cdcd=await buildAuth(_0x4f2e50);logger[_0x347b77(0x188)](process[_0x347b77(0x167)]());const _0x38ca78=(CLI_BIN_NAME+'\x20'+process['argv'][_0x347b77(0x193)](0x2)['join']('\x20'))[_0x347b77(0x162)]();logger[_0x347b77(0x1b5)](_0x38ca78);const _0xf0ba47=isNonInteractiveMode(_0x2630f3);return{'config':_0x4f2e50,'auth':_0x44cdcd,'logger':logger,'env':_0x1080b3,'nonInteractive':_0xf0ba47};}export function buildConfigFromFlags(_0x297105){return buildConfig(readRawConfig(),_0x297105);}export function getLocalAppAliases(_0x57025a){const _0x6af46a=a102_0x53e2fc;return _0x57025a[_0x6af46a(0x176)]&&typeof _0x57025a['apps']===_0x6af46a(0x195)?_0x57025a[_0x6af46a(0x176)]:{};}export function resolveLocalAppAliasCode(_0x4efd6a,_0x1a0e51){const _0xa04cd2=a102_0x53e2fc;if(!_0x1a0e51)return undefined;const _0x309db9=getLocalAppAliases(_0x4efd6a)[_0x1a0e51],_0x1e472d=_0x309db9?.[_0xa04cd2(0x181)];return typeof _0x1e472d===_0xa04cd2(0x173)&&_0x1e472d[_0xa04cd2(0x162)]()?_0x1e472d[_0xa04cd2(0x162)]():undefined;}export function readAppCodeFromConfig(){const _0x53d7da=a102_0x53e2fc,_0xe6bf7a=readRawConfig(),_0x16c2ab=_0xe6bf7a[_0x53d7da(0x181)]??_0xe6bf7a[_0x53d7da(0x187)];if(typeof _0x16c2ab==='string'&&_0x16c2ab['trim']())return _0x16c2ab[_0x53d7da(0x162)]();const _0xdae5df=resolveLocalAppAliasCode(_0xe6bf7a,typeof _0xe6bf7a[_0x53d7da(0x1a3)]===_0x53d7da(0x173)?_0xe6bf7a[_0x53d7da(0x1a3)]:undefined);if(_0xdae5df)return _0xdae5df;const _0x4fbe1d=normalizeEnv(String(_0xe6bf7a[_0x53d7da(0x182)]||'production')),_0x260b8f=isDaily(_0x4fbe1d)?_0x53d7da(0x1ab):isDev(_0x4fbe1d)?_0x53d7da(0x166):_0x53d7da(0x1b2),_0x4a4e03=resolveCachedAppCode(typeof _0xe6bf7a[_0x53d7da(0x1a3)]===_0x53d7da(0x173)?_0xe6bf7a[_0x53d7da(0x1a3)]:undefined,_0x260b8f,typeof _0xe6bf7a['accessKey']===_0x53d7da(0x173)?_0xe6bf7a[_0x53d7da(0x16f)]:undefined);if(_0x4a4e03)return _0x4a4e03;const _0x502e63=Object[_0x53d7da(0x163)](getLocalAppAliases(_0xe6bf7a))[_0x53d7da(0x16d)](_0x1ee990=>_0x1ee990?.['appcode']);return typeof _0x502e63?.['appcode']===_0x53d7da(0x173)&&_0x502e63[_0x53d7da(0x181)]['trim']()?_0x502e63[_0x53d7da(0x181)][_0x53d7da(0x162)]():undefined;}export function readScopedConfig(_0x59c83a){const _0x1aff32=a102_0x53e2fc,_0x2e5f3e=_0x59c83a[_0x1aff32(0x18b)]?_0x1aff32(0x18b):_0x1aff32(0x19c);return readConfigFile(resolveWriteConfigPath(_0x2e5f3e));}export function writeScopedConfig(_0x26f401,_0x10fdb5){const _0x100161=a102_0x53e2fc,_0x2a985f=_0x10fdb5[_0x100161(0x18b)]?_0x100161(0x18b):_0x100161(0x19c);writeConfigFile(resolveWriteConfigPath(_0x2a985f),_0x26f401);}export async function initGlobalEnvironment(_0x438a1d){const _0x307502=a102_0x53e2fc,{initEnv:_0x5db35c}=await import(_0x307502(0x1a6));_0x5db35c(_0x438a1d[_0x307502(0x182)]);const {initDomains:_0x2b94af}=await import(_0x307502(0x189)),_0x2de79b=resolveEnterpriseRoutingConfig(_0x438a1d[_0x307502(0x192)][_0x307502(0x185)]);_0x2b94af({'apiDomain':_0x2de79b?_0x2de79b[_0x307502(0x180)]:_0x438a1d[_0x307502(0x192)][_0x307502(0x180)]||_0x438a1d['raw'][_0x307502(0x18e)]||undefined,'userDomain':_0x2de79b?_0x2de79b[_0x307502(0x16c)]:_0x438a1d[_0x307502(0x192)][_0x307502(0x16c)]||undefined,'runtimeDomain':_0x2de79b?_0x2de79b['runtimeDomain']:_0x438a1d[_0x307502(0x192)][_0x307502(0x169)]||undefined,'skillDomain':_0x2de79b?_0x2de79b[_0x307502(0x1b3)]:_0x438a1d[_0x307502(0x192)]['skillDomain']||_0x438a1d['raw'][_0x307502(0x19f)]||_0x438a1d[_0x307502(0x192)][_0x307502(0x18d)]||_0x438a1d[_0x307502(0x192)][_0x307502(0x1b0)]||undefined,'kbDomain':_0x2de79b?_0x2de79b[_0x307502(0x172)]:_0x438a1d[_0x307502(0x192)][_0x307502(0x172)]||_0x438a1d[_0x307502(0x192)][_0x307502(0x18d)]||_0x438a1d[_0x307502(0x192)]['platformDomain']||_0x438a1d[_0x307502(0x192)][_0x307502(0x169)]||undefined,'region':normalizeLovrabetRegion(_0x438a1d[_0x307502(0x192)][_0x307502(0x164)])});}export function getProjectConfigPath(){const _0x33d43b=a102_0x53e2fc;return resolveConfigPath(process[_0x33d43b(0x167)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x1a727b){const _0x3f2cab=a102_0x53e2fc;if(!existsSync(_0x1a727b))return{'status':_0x3f2cab(0x1b1)};try{const _0x2d8691=readFileSync(_0x1a727b,{'encoding':_0x3f2cab(0x1b4)});if(!_0x2d8691?.[_0x3f2cab(0x162)]())return{'status':_0x3f2cab(0x17c)};const _0x3d7585=JSON[_0x3f2cab(0x17b)](_0x2d8691);return{'status':'ok','data':_0x3d7585};}catch(_0x30cb08){return{'status':_0x3f2cab(0x196),'message':_0x30cb08 instanceof Error?_0x30cb08[_0x3f2cab(0x194)]:String(_0x30cb08)};}}export function loadRawConfigLayers(_0x2a0b3e){const _0x438611=a102_0x53e2fc;let _0x1396e6={},_0x4e4659={},_0x8e73ca,_0x1cdf25;try{_0x8e73ca=resolveConfigPath(homedir());if(_0x8e73ca){const _0x153590=readFileSync(_0x8e73ca,{'encoding':_0x438611(0x1b4)});if(_0x153590)_0x1396e6=JSON[_0x438611(0x17b)](_0x153590);}}catch{}try{const _0x3bea5a=_0x2a0b3e||process[_0x438611(0x167)]();_0x1cdf25=resolveConfigPath(_0x3bea5a);if(_0x1cdf25){const _0x4bd778=readFileSync(_0x1cdf25,{'encoding':_0x438611(0x1b4)});if(_0x4bd778)_0x4e4659=JSON[_0x438611(0x17b)](_0x4bd778);}}catch{}return{'globalPath':_0x8e73ca,'projectPath':_0x1cdf25,'globalConfig':_0x1396e6,'projectConfig':_0x4e4659};}function mergeRawConfigLayers(_0xdec221){const _0x2487d4=a102_0x53e2fc,{globalConfig:_0x48a6e,projectConfig:_0x5e5be1}=_0xdec221,_0x4380f7={..._0x48a6e,..._0x5e5be1};delete _0x4380f7[_0x2487d4(0x190)];if(_0x2487d4(0x1a3)in _0x5e5be1)_0x4380f7[_0x2487d4(0x1a3)]=_0x5e5be1[_0x2487d4(0x1a3)];else _0x48a6e[_0x2487d4(0x1a3)]&&(_0x4380f7[_0x2487d4(0x1a3)]=_0x48a6e[_0x2487d4(0x1a3)]);return _0x4380f7;}export function isInProject(){return!!getProjectConfigPath();}function a102_0x5445(){const _0x390002=['local-alias','apps','584KhUdHD','configFileNames','7paRgZV','APPCODE','parse','empty','PAGE_SIZE','EPERM','EACCES','apiDomain','appcode','env','some','authRequired','routing','nativeToolAvailable','app','setLogPath','./constant/domain.js','isTTY','global','nonInteractive','agentDomain','host','883160VZxuiU','inherit','newConfigFileName','raw','slice','message','object','error','3083280Diuvjz','stringify','3344154yoSKTy','928130DqnrOt','locale','project','read','.tmp','skillHubDomain','setRawMode','5556220whUtvg','ACCESS_KEY','defaultApp','code','projectConfig','./constant/env.js','3867zrBckQ','ENV','high-risk-write','cache','daily','online','stdin','top-level','7477326NJIEpe','platformDomain','missing','production','skillDomain','utf8','setRawCommand','trim','values','region','27fLjpvs','development','cwd','true','runtimeDomain','format','FORMAT','userDomain','find','explicit','accessKey','write','649SEGinA','kbDomain','string','riskLevel'];a102_0x5445=function(){return _0x390002;};return a102_0x5445();}export function readRawConfig(_0x429c62){return mergeRawConfigLayers(loadRawConfigLayers(_0x429c62));}export function readRawConfigWithLayers(_0x389ba8){const _0x44a3b3=loadRawConfigLayers(_0x389ba8);return{'config':mergeRawConfigLayers(_0x44a3b3),'layers':_0x44a3b3};}export function resolveDefaultAppSource(_0xd71c02){const _0x2c180e=a102_0x53e2fc;if('defaultApp'in _0xd71c02[_0x2c180e(0x1a5)])return'project';if(_0xd71c02['globalConfig'][_0x2c180e(0x1a3)])return _0x2c180e(0x18b);return null;}function buildConfig(_0x41db41,_0x3779ad){const _0x3e8231=a102_0x53e2fc,_0x59a034=_0x41db41[_0x3e8231(0x1a3)]||undefined,_0x35c447=_0x3779ad[_0x3e8231(0x187)]||env('APP')||undefined,_0x773984=_0x35c447||_0x59a034||undefined,_0x1bde33=env(_0x3e8231(0x1a2))||_0x41db41['accessKey']||undefined,_0x6ae079=_0x3779ad['env']||env(_0x3e8231(0x1a8))||_0x41db41['env']||DEFAULT_CONFIG_VALUES['env'],_0x4397f2=normalizeEnv(String(_0x6ae079)),_0x5c9290=isDaily(_0x4397f2)?_0x3e8231(0x1ab):isDev(_0x4397f2)?'development':_0x3e8231(0x1b2),_0x295ef4=typeof _0x3779ad['appcode']===_0x3e8231(0x173)?_0x3779ad[_0x3e8231(0x181)]:undefined,_0x37e5f0=env(_0x3e8231(0x17a)),_0x118a13=_0x35c447?undefined:_0x41db41[_0x3e8231(0x181)]||_0x41db41[_0x3e8231(0x187)]||undefined,_0x3cc19d=_0x35c447||(_0x118a13?undefined:_0x59a034),_0xe8395d=resolveLocalAppAliasCode(_0x41db41,_0x3cc19d),_0x2011d5=resolveCachedAppCode(_0x3cc19d,_0x5c9290,_0x1bde33),_0x4891b1=_0x295ef4||_0x37e5f0||_0x118a13||_0xe8395d||_0x2011d5||undefined,_0x25fda0=_0x295ef4?_0x3e8231(0x16e):_0x37e5f0?'env':_0x118a13?_0x3e8231(0x1ae):_0xe8395d?_0x3e8231(0x175):_0x2011d5?_0x3e8231(0x1aa):undefined,_0x3a77b4=_0x41db41[_0x3e8231(0x19b)]||DEFAULT_CONFIG_VALUES['locale'],_0x5ef92e=undefined,_0xfde83c=_0x3779ad[_0x3e8231(0x16a)]||env(_0x3e8231(0x16b))||_0x41db41[_0x3e8231(0x16a)],_0x37589f=normalizeLegacyOutputFormat(_0xfde83c),_0x353f78=env(_0x3e8231(0x17d))||_0x41db41['pageSize'],_0x4bc1b1=_0x353f78?Number(_0x353f78)||undefined:undefined,_0x5e8d36=_0x41db41[_0x3e8231(0x174)],_0x2a1ba5=_0x5e8d36===_0x3e8231(0x19d)||_0x5e8d36===_0x3e8231(0x170)||_0x5e8d36===_0x3e8231(0x1a9)?_0x5e8d36:DEFAULT_CONFIG_VALUES[_0x3e8231(0x174)],_0x2adec9=_0x41db41[_0x3e8231(0x186)]===!![],_0x440ac6=env('VERBOSE'),_0x11968b=_0x440ac6==='1'||_0x440ac6===_0x3e8231(0x168);return{'appCode':typeof _0x4891b1==='string'&&_0x4891b1[_0x3e8231(0x162)]()?_0x4891b1[_0x3e8231(0x162)]():undefined,'appCodeSource':_0x25fda0,'env':_0x5c9290,'locale':_0x3a77b4,'cookie':_0x5ef92e,'accessKey':_0x1bde33,'format':_0x37589f,'pageSize':_0x4bc1b1,'riskLevel':_0x2a1ba5,'nativeToolAvailable':_0x2adec9,'verbose':_0x11968b,'defaultApp':_0x59a034,'currentApp':typeof _0x773984==='string'?_0x773984:undefined,'raw':_0x41db41};}function env(_0x2a3fb6){return productEnv(_0x2a3fb6);}async function buildAuth(_0x5762c0){const _0x5f3b28=a102_0x53e2fc,_0x5453ce='',_0x37a2d3=!!_0x5762c0[_0x5f3b28(0x16f)];return{'cookie':_0x5453ce,'isLoggedIn':_0x37a2d3,async 'getOrLogin'(){const _0x4c6c52=_0x5f3b28;if(_0x37a2d3)return _0x5453ce;throw CliErrors[_0x4c6c52(0x184)]();}};}
|
package/lib/core/api-client.d.ts
CHANGED
|
@@ -184,6 +184,17 @@ export interface PersonalKnowledgeBaseUpsertInput {
|
|
|
184
184
|
title: string;
|
|
185
185
|
content: string;
|
|
186
186
|
}
|
|
187
|
+
/** One visible public, company, or personal RAG search hit. */
|
|
188
|
+
export interface KnowledgeBaseSearchHit {
|
|
189
|
+
scope: "COMPANY" | "PERSONAL" | string;
|
|
190
|
+
title?: string;
|
|
191
|
+
docId: string;
|
|
192
|
+
score: number;
|
|
193
|
+
weightedScore?: number;
|
|
194
|
+
content: string;
|
|
195
|
+
metadata?: Record<string, unknown>;
|
|
196
|
+
[key: string]: unknown;
|
|
197
|
+
}
|
|
187
198
|
/** A runtime Skill returned by the management API. */
|
|
188
199
|
export interface RuntimeSkillFile {
|
|
189
200
|
path: string;
|
|
@@ -469,6 +480,11 @@ export declare function getPersonalKnowledgeBaseItem(id: number, appCode: string
|
|
|
469
480
|
export declare function createPersonalKnowledgeBaseItem(appCode: string, input: PersonalKnowledgeBaseUpsertInput): Promise<PersonalKnowledgeBaseItem>;
|
|
470
481
|
/** Updates a personal knowledge-base entry. The backend requires POST. */
|
|
471
482
|
export declare function updatePersonalKnowledgeBaseItem(id: number, appCode: string, input: PersonalKnowledgeBaseUpsertInput): Promise<PersonalKnowledgeBaseItem>;
|
|
483
|
+
/** Searches visible company and personal knowledge for the active user/app. */
|
|
484
|
+
export declare function searchKnowledgeBase(appCode: string, input: {
|
|
485
|
+
query: string;
|
|
486
|
+
topK?: number;
|
|
487
|
+
}): Promise<KnowledgeBaseSearchHit[]>;
|
|
472
488
|
export type RuntimeSkillRemoteScope = "all" | "personal" | "company";
|
|
473
489
|
/** Fetches one SkillHub native Skill by exact namespace and slug. */
|
|
474
490
|
export declare function getRuntimeSkillByCode(appCode: string, skillCode: string): Promise<RuntimeSkillItem | undefined>;
|