@lovrabet/lovrabet-cli 2.3.13-beta.1 → 2.4.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.
Files changed (208) hide show
  1. package/README.md +22 -14
  2. package/lib/cli.js +4 -1
  3. package/lib/commands/api-doc/index.js +11 -1
  4. package/lib/commands/app/cache.js +2 -1
  5. package/lib/commands/app/definitions.js +7 -1
  6. package/lib/commands/app/eligibility.js +2 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +2 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/approval/index.js +7 -1
  13. package/lib/commands/artifact/index.js +11 -1
  14. package/lib/commands/auth/device.js +8 -1
  15. package/lib/commands/auth/index.js +9 -1
  16. package/lib/commands/auth/prompt.js +2 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +2 -1
  21. package/lib/commands/common/config-policy.js +2 -1
  22. package/lib/commands/common/constraints.js +2 -1
  23. package/lib/commands/common/flags.js +2 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +8 -1
  26. package/lib/commands/config/init.js +4 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/import-excel.js +10 -1
  29. package/lib/commands/data/index.js +10 -1
  30. package/lib/commands/dataset/detail.js +6 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +2 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +9 -1
  35. package/lib/commands/file/index.js +3 -1
  36. package/lib/commands/init.js +4 -1
  37. package/lib/commands/issue/context.js +1 -1
  38. package/lib/commands/issue/index.js +1 -1
  39. package/lib/commands/issue/report.js +5 -1
  40. package/lib/commands/kb/index.js +7 -1
  41. package/lib/commands/logs/index.js +1 -1
  42. package/lib/commands/metric/contract.js +5 -1
  43. package/lib/commands/metric/definition.js +4 -1
  44. package/lib/commands/metric/detail.js +1 -1
  45. package/lib/commands/metric/exec.js +3 -1
  46. package/lib/commands/metric/index.js +1 -1
  47. package/lib/commands/metric/list.js +2 -1
  48. package/lib/commands/metric/shared.js +2 -1
  49. package/lib/commands/notification/config-list.js +1 -1
  50. package/lib/commands/notification/index.js +1 -1
  51. package/lib/commands/notification/shared.js +2 -1
  52. package/lib/commands/ocr/index.js +4 -1
  53. package/lib/commands/permit/dataset-get.js +1 -1
  54. package/lib/commands/permit/dataset-set.js +5 -1
  55. package/lib/commands/permit/index.js +1 -1
  56. package/lib/commands/permit/page-get.js +1 -1
  57. package/lib/commands/permit/page-set.js +3 -1
  58. package/lib/commands/permit/role-menus-set.js +4 -1
  59. package/lib/commands/permit/role-menus.js +1 -1
  60. package/lib/commands/permit/shared.js +7 -1
  61. package/lib/commands/personal-bff/index.js +7 -1
  62. package/lib/commands/registry.js +6 -1
  63. package/lib/commands/role/create.js +2 -1
  64. package/lib/commands/role/delete.js +2 -1
  65. package/lib/commands/role/detail.js +1 -1
  66. package/lib/commands/role/index.js +1 -1
  67. package/lib/commands/role/list.js +2 -1
  68. package/lib/commands/role/shared.js +8 -1
  69. package/lib/commands/role/update.js +3 -1
  70. package/lib/commands/role/user-add.js +2 -1
  71. package/lib/commands/role/user-remove.js +2 -1
  72. package/lib/commands/schedule/index.js +7 -1
  73. package/lib/commands/schema.js +1 -1
  74. package/lib/commands/service/dynamic.js +10 -1
  75. package/lib/commands/service/function-name-adapter.js +3 -1
  76. package/lib/commands/service/index.js +8 -1
  77. package/lib/commands/service/registry.js +12 -1
  78. package/lib/commands/skill/commands/create.js +3 -1
  79. package/lib/commands/skill/commands/diagram.js +4 -1
  80. package/lib/commands/skill/commands/install.js +6 -1
  81. package/lib/commands/skill/commands/list.js +3 -1
  82. package/lib/commands/skill/commands/push.js +1 -1
  83. package/lib/commands/skill/commands/validate.js +1 -1
  84. package/lib/commands/skill/diagram.js +3 -1
  85. package/lib/commands/skill/flags.js +4 -1
  86. package/lib/commands/skill/index.js +1 -1
  87. package/lib/commands/skill/manifest-helpers.js +1 -1
  88. package/lib/commands/skill/push-execute.js +11 -1
  89. package/lib/commands/skill/push-flow-helpers.js +4 -1
  90. package/lib/commands/skill/push-retarget.js +1 -1
  91. package/lib/commands/skill/scopes.js +1 -1
  92. package/lib/commands/skill/summary.js +1 -1
  93. package/lib/commands/skill/templates.js +8 -1
  94. package/lib/commands/skill/validate.js +8 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +2 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/update.d.ts +2 -1
  99. package/lib/commands/update.js +8 -1
  100. package/lib/commands/user-account/bind.js +3 -1
  101. package/lib/commands/user-account/index.js +1 -1
  102. package/lib/commands/workspace/index.js +7 -1
  103. package/lib/config/domain-config.js +6 -1
  104. package/lib/config/schema.js +5 -1
  105. package/lib/constant/app.js +1 -1
  106. package/lib/constant/auth-mode.js +1 -1
  107. package/lib/constant/cli.js +3 -1
  108. package/lib/constant/defaults.js +1 -1
  109. package/lib/constant/distribution.js +1 -1
  110. package/lib/constant/domain.js +2 -1
  111. package/lib/constant/env.js +1 -1
  112. package/lib/constant/output.js +1 -1
  113. package/lib/constant/product.js +2 -1
  114. package/lib/constant/region.js +2 -1
  115. package/lib/constant/risk.js +1 -1
  116. package/lib/constant/url.js +1 -1
  117. package/lib/context.js +11 -1
  118. package/lib/core/api-client.js +38 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/kb-management-client.js +6 -1
  121. package/lib/core/kb-sdk-errors.js +2 -1
  122. package/lib/core/kb-search-client.js +2 -1
  123. package/lib/core/sdk-client.js +5 -1
  124. package/lib/errors.js +2 -1
  125. package/lib/framework/access-error.js +1 -1
  126. package/lib/framework/build-all-flags.js +1 -1
  127. package/lib/framework/dryrun.js +1 -1
  128. package/lib/framework/flags.js +1 -1
  129. package/lib/framework/help.js +2 -1
  130. package/lib/framework/index.js +1 -1
  131. package/lib/framework/output.js +1 -1
  132. package/lib/framework/preparse.js +3 -1
  133. package/lib/framework/rate-limit.js +2 -1
  134. package/lib/framework/raw-flags.js +2 -1
  135. package/lib/framework/response.js +1 -1
  136. package/lib/framework/runner-confirmation.js +2 -1
  137. package/lib/framework/runner-error.js +2 -1
  138. package/lib/framework/runner.js +9 -1
  139. package/lib/framework/schema-export.js +2 -1
  140. package/lib/framework/service-order.js +1 -1
  141. package/lib/framework/types.js +1 -1
  142. package/lib/generated/build-info.d.ts +4 -4
  143. package/lib/generated/build-info.js +1 -1
  144. package/lib/generated/official-routing.js +2 -1
  145. package/lib/generated/routing-contract.js +1 -1
  146. package/lib/help.js +1 -1
  147. package/lib/runtime/confirmation.js +1 -1
  148. package/lib/runtime/event.js +1 -1
  149. package/lib/runtime/index.js +4 -1
  150. package/lib/runtime/queue.js +1 -1
  151. package/lib/runtime/resolve.js +2 -1
  152. package/lib/runtime/types.js +1 -1
  153. package/lib/services/dataset-import/auto-id-runner.js +9 -1
  154. package/lib/services/dataset-import/excel-reader.js +25 -1
  155. package/lib/services/dataset-import/image-bytes.js +6 -1
  156. package/lib/services/dataset-import/image-ooxml.js +15 -1
  157. package/lib/services/dataset-import/image-runner.js +9 -1
  158. package/lib/services/dataset-import/metadata.js +1 -1
  159. package/lib/services/dataset-import/preview.js +1 -1
  160. package/lib/services/dataset-import/runner.js +13 -1
  161. package/lib/services/dataset-import/types.js +1 -1
  162. package/lib/skills/builtin-skill.js +8 -1
  163. package/lib/skills/install-updated-skill.d.ts +8 -0
  164. package/lib/skills/install-updated-skill.js +3 -0
  165. package/lib/skills/local-skills-installer.d.ts +2 -0
  166. package/lib/skills/local-skills-installer.js +1 -0
  167. package/lib/skills/npx-skills-add.d.ts +2 -2
  168. package/lib/skills/npx-skills-add.js +4 -1
  169. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  170. package/lib/skills/runtime-skill-sync/fs-utils.js +3 -1
  171. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  172. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  173. package/lib/skills/runtime-skill-sync/links.js +9 -1
  174. package/lib/skills/runtime-skill-sync/list-local.js +4 -1
  175. package/lib/skills/runtime-skill-sync/local-files.js +5 -1
  176. package/lib/skills/runtime-skill-sync/materialize.js +9 -1
  177. package/lib/skills/runtime-skill-sync/metadata.js +3 -1
  178. package/lib/skills/runtime-skill-sync/paths.js +2 -1
  179. package/lib/skills/runtime-skill-sync/push.js +8 -1
  180. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  181. package/lib/skills/runtime-skill-sync/types.js +1 -1
  182. package/lib/skills/runtime-skill-sync/zip-codec.js +2 -1
  183. package/lib/skills/runtime-skill-sync/zip-package.js +6 -1
  184. package/lib/skills/runtime-skill-sync.js +1 -1
  185. package/lib/skills/skill-presence.d.ts +1 -34
  186. package/lib/skills/skill-presence.js +2 -1
  187. package/lib/utils/access-key-redaction.js +2 -1
  188. package/lib/utils/apply-jq-filter.js +1 -1
  189. package/lib/utils/cli-version-check.js +2 -1
  190. package/lib/utils/cli-version-policy.js +3 -1
  191. package/lib/utils/logger.js +3 -1
  192. package/lib/utils/lossless-json.js +3 -1
  193. package/lib/utils/params.js +3 -1
  194. package/lib/utils/positive-safe-integer.js +1 -1
  195. package/lib/utils/redaction.js +2 -1
  196. package/lib/utils/runtime-user-id.js +1 -1
  197. package/lib/utils/update-notice.js +3 -1
  198. package/lib/utils/version.js +1 -1
  199. package/lib/utils/write-cli-side-channel.js +1 -1
  200. package/package.json +5 -7
  201. package/skills/lovrabet/SKILL.md +3 -3
  202. package/skills/lovrabet/references/lovrabet-skill-install.md +1 -1
  203. package/skills/lovrabet/references/lovrabet-update.md +6 -4
  204. package/skills/lovrabet-report-generation/SKILL.md +1 -1
  205. package/skills/lovrabet.manifest.json +3 -3
  206. package/lib/postinstall.d.ts +0 -2
  207. package/lib/postinstall.js +0 -1
  208. package/scripts/postinstall.mjs +0 -24
@@ -1,25 +1,3 @@
1
- /**
2
- * @fileoverview Global Skill install-state resolution, decoupled from the external `skills` CLI.
3
- *
4
- * Only reasonably trustworthy signals are used, and "confirmed missing" is kept
5
- * distinct from "cannot tell":
6
- * - artifact probe: `<globalSkillsDir>/<name>/SKILL.md`, what consumers actually resolve
7
- * - install bookkeeping: the `skills` CLI's own `~/.agents/.skill-lock.json`
8
- *
9
- * Directory layout is owned by the external tool, so a stale layout assumption must
10
- * resolve to `unverifiable` (pass through with a reason) rather than `absent` (fail).
11
- * Only when both the artifact probe and the bookkeeping agree is the skill `absent`.
12
- */
13
- /** Install bookkeeping file written by the `skills` CLI, relative to HOME. */
14
- export declare const SKILL_LOCK_RELATIVE_PATH: string;
15
- /** Known global Skill directories, relative to HOME, in probe order. */
16
- export declare const GLOBAL_SKILLS_DIR_RELATIVE_PATHS: string[];
17
- /**
18
- * Install state of a global Skill.
19
- *
20
- * `unverifiable` is deliberate: local assumptions were not sufficient to decide, so
21
- * callers should pass through instead of failing.
22
- */
23
1
  export type SkillPresence = {
24
2
  state: "present";
25
3
  path: string;
@@ -31,18 +9,7 @@ export type SkillPresence = {
31
9
  reason: string;
32
10
  };
33
11
  export interface ResolveSkillPresenceOptions {
34
- /** Override candidate global Skill directories (isolated environments or tests). */
35
- globalSkillsDirs?: string[];
36
- /** Override the `skills` CLI bookkeeping file path. */
37
- lockFile?: string;
38
- /** Override HOME. Tests only. */
12
+ /** Override the user home for isolated verification only. */
39
13
  home?: string;
40
14
  }
41
- /**
42
- * Resolves whether a global Skill is currently discoverable by consumers.
43
- *
44
- * @param skillName - Global Skill name (its directory name), e.g. `lovrabet`.
45
- * @param options - Probe overrides for isolated environments or tests.
46
- * @returns `present`, `absent`, or `unverifiable`.
47
- */
48
15
  export declare function resolveInstalledSkill(skillName: string, options?: ResolveSkillPresenceOptions): SkillPresence;
@@ -1 +1,2 @@
1
- const a177_0xa729c8=a177_0x5cb1;(function(_0x381853,_0x490245){const _0x1dacb0=a177_0x5cb1,_0x2060ad=_0x381853();while(!![]){try{const _0x45870b=-parseInt(_0x1dacb0(0xb8))/0x1*(parseInt(_0x1dacb0(0xb1))/0x2)+parseInt(_0x1dacb0(0xc2))/0x3+parseInt(_0x1dacb0(0xcc))/0x4*(-parseInt(_0x1dacb0(0xba))/0x5)+parseInt(_0x1dacb0(0xb4))/0x6+-parseInt(_0x1dacb0(0xb3))/0x7*(parseInt(_0x1dacb0(0xc5))/0x8)+parseInt(_0x1dacb0(0xc6))/0x9*(parseInt(_0x1dacb0(0xc4))/0xa)+parseInt(_0x1dacb0(0xc9))/0xb;if(_0x45870b===_0x490245)break;else _0x2060ad['push'](_0x2060ad['shift']());}catch(_0x429c19){_0x2060ad['push'](_0x2060ad['shift']());}}}(a177_0x52c5,0x7d4c9));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a177_0xa729c8(0xc7),a177_0xa729c8(0xbe));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents','skills'),join('.claude',a177_0xa729c8(0xad))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x23c4d7,_0x574265){const _0x5040e3=a177_0xa729c8;if(!existsSync(_0x23c4d7))return{'kind':_0x5040e3(0xca)};let _0x26d929;try{_0x26d929=JSON['parse'](readFileSync(_0x23c4d7,_0x5040e3(0xc0)));}catch(_0x242f36){return{'kind':_0x5040e3(0xaf),'reason':_0x23c4d7+_0x5040e3(0xb6)+_0x242f36[_0x5040e3(0xb7)]};}const _0x4c316e=_0x26d929;if(typeof _0x4c316e?.[_0x5040e3(0xac)]!==_0x5040e3(0xbb)||!SUPPORTED_LOCK_VERSIONS[_0x5040e3(0xc8)](_0x4c316e[_0x5040e3(0xac)]))return{'kind':'unusable','reason':_0x23c4d7+'\x20uses\x20unsupported\x20version\x20'+String(_0x4c316e?.['version'])};if(!_0x4c316e['skills']||typeof _0x4c316e[_0x5040e3(0xad)]!=='object')return{'kind':_0x5040e3(0xaf),'reason':_0x23c4d7+_0x5040e3(0xb0)};return _0x4c316e['skills'][_0x574265]?{'kind':_0x5040e3(0xae)}:{'kind':_0x5040e3(0xca)};}export function resolveInstalledSkill(_0x49a9b2,_0x372478){const _0x1ac30f=a177_0xa729c8,_0x7b3b77=_0x372478?.[_0x1ac30f(0xc1)]??homedir(),_0x3bda5e=_0x372478?.['globalSkillsDirs']??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1ac30f(0xb9)](_0x5a2f8a=>join(_0x7b3b77,_0x5a2f8a)),_0x5a7c28=_0x372478?.[_0x1ac30f(0xc3)]??join(_0x7b3b77,SKILL_LOCK_RELATIVE_PATH),_0x4000b0=_0x3bda5e[_0x1ac30f(0xb9)](_0xa42102=>join(_0xa42102,_0x49a9b2,_0x1ac30f(0xbf))),_0x5be040=_0x4000b0['find'](_0xe297b8=>existsSync(_0xe297b8));if(_0x5be040)return{'state':_0x1ac30f(0xbd),'path':_0x5be040};const _0x30f124=readLockLookup(_0x5a7c28,_0x49a9b2);if(_0x30f124[_0x1ac30f(0xbc)]===_0x1ac30f(0xaf))return{'state':_0x1ac30f(0xb5),'reason':_0x30f124['reason']};if(_0x30f124[_0x1ac30f(0xbc)]===_0x1ac30f(0xae))return{'state':_0x1ac30f(0xb5),'reason':_0x5a7c28+_0x1ac30f(0xcb)+_0x49a9b2+_0x1ac30f(0xb2)+('('+_0x4000b0[_0x1ac30f(0xab)](',\x20')+')')};return{'state':'absent','checked':_0x4000b0};}function a177_0x5cb1(_0x2cb29c,_0x410133){_0x2cb29c=_0x2cb29c-0xab;const _0x52c5fd=a177_0x52c5();let _0x5cb112=_0x52c5fd[_0x2cb29c];return _0x5cb112;}function a177_0x52c5(){const _0x1f8661=['number','kind','present','.skill-lock.json','SKILL.md','utf8','home','2887536bKUnid','lockFile','7510oxiklQ','742040IgqIJL','27RpHeAn','.agents','includes','3019852PSoYCU','not-recorded','\x20records\x20\x22','9836abrlco','join','version','skills','recorded','unusable','\x20has\x20no\x20skills\x20map','20fFdndH','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','7KMpdAa','4770768BpEGKY','unverifiable','\x20is\x20unreadable:\x20','message','77681cihApR','map','1325cWMmOm'];a177_0x52c5=function(){return _0x1f8661;};return a177_0x52c5();}
1
+ import{spawnSync}from"node:child_process";import{isAbsolute,join}from"node:path";import{resolveLocalSkillsInstaller}from"../skills/local-skills-installer.js";export function resolveInstalledSkill(skillName,options){try{const env={...process.env,DISABLE_TELEMETRY:"1",DO_NOT_TRACK:"1",...options?.home?{HOME:options.home,USERPROFILE:options.home}:{}};const result=spawnSync(process.execPath,[resolveLocalSkillsInstaller(),"list","-g","--json"],{env:env,encoding:"utf8",shell:false,timeout:3e4,maxBuffer:16*1024*1024});if(result.error||result.status!==0){throw new Error(result.error?.message||result.stderr?.trim()||"Skills CLI listing failed")}const rows=JSON.parse(result.stdout);if(!Array.isArray(rows)||rows.some(row=>!row||typeof row.name!=="string"||row.scope!=="global")){throw new Error("Unsupported Skills CLI listing response")}const matches=rows.filter(row=>row.name===skillName);if(matches.length===0||matches.every(row=>row.status==="missing"&&row.path===null)){return{state:"absent",
2
+ checked:[]}}if(matches.some(row=>!["tracked","untracked","modified"].includes(row.status)||typeof row.path!=="string"||!isAbsolute(row.path))){throw new Error(`Skills CLI returned an invalid installation path or status for "${skillName}"`)}const paths=[...new Set(matches.map(row=>row.path))];if(paths.length!==1)throw new Error(`Skills CLI returned multiple installation paths for "${skillName}"`);return{state:"present",path:join(paths[0],"SKILL.md")}}catch(error){return{state:"unverifiable",reason:error instanceof Error?error.message:String(error)}}}
@@ -1 +1,2 @@
1
- const a178_0x229101=a178_0x3fb7;(function(_0x162272,_0x640a00){const _0x517f61=a178_0x3fb7,_0x4468b8=_0x162272();while(!![]){try{const _0x58314a=parseInt(_0x517f61(0x132))/0x1*(-parseInt(_0x517f61(0x143))/0x2)+parseInt(_0x517f61(0x144))/0x3*(-parseInt(_0x517f61(0x131))/0x4)+-parseInt(_0x517f61(0x13d))/0x5*(-parseInt(_0x517f61(0x141))/0x6)+-parseInt(_0x517f61(0x13c))/0x7+parseInt(_0x517f61(0x12f))/0x8*(parseInt(_0x517f61(0x130))/0x9)+parseInt(_0x517f61(0x135))/0xa+parseInt(_0x517f61(0x142))/0xb*(-parseInt(_0x517f61(0x13a))/0xc);if(_0x58314a===_0x640a00)break;else _0x4468b8['push'](_0x4468b8['shift']());}catch(_0x1cbf02){_0x4468b8['push'](_0x4468b8['shift']());}}}(a178_0x2d98,0x67e21));function a178_0x3fb7(_0x41dcb0,_0x126bd5){_0x41dcb0=_0x41dcb0-0x12e;const _0x2d98db=a178_0x2d98();let _0x3fb7ab=_0x2d98db[_0x41dcb0];return _0x3fb7ab;}const REDACTED_ACCESS_KEY=a178_0x229101(0x138);export function maskCliAccessKey(_0x1eac00){const _0x31af01=a178_0x229101;if(typeof _0x1eac00!==_0x31af01(0x133)||_0x1eac00[_0x31af01(0x134)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x1eac00[_0x31af01(0x145)](0x0,0x8)+'*'['repeat'](_0x1eac00[_0x31af01(0x134)]-0x8);}export function redactCliConfigCredentials(_0x512976){const _0x3443ea=a178_0x229101,_0x1f8574={..._0x512976};return Object[_0x3443ea(0x137)][_0x3443ea(0x140)]['call'](_0x1f8574,_0x3443ea(0x147))&&(_0x1f8574[_0x3443ea(0x147)]=maskCliAccessKey(_0x1f8574[_0x3443ea(0x147)])),_0x1f8574[_0x3443ea(0x139)]&&typeof _0x1f8574[_0x3443ea(0x139)]==='object'&&!Array[_0x3443ea(0x13b)](_0x1f8574[_0x3443ea(0x139)])&&(_0x1f8574[_0x3443ea(0x139)]=redactLegacyAppCredentials(_0x1f8574[_0x3443ea(0x139)])),_0x1f8574;}export function redactCliConfigValue(_0x5c41ae,_0x36f03a){const _0x206676=a178_0x229101;if(_0x5c41ae===_0x206676(0x147)||/^apps\.[^.]+\.accessKey$/[_0x206676(0x13f)](_0x5c41ae))return maskCliAccessKey(_0x36f03a);if(_0x5c41ae===_0x206676(0x139)&&_0x36f03a&&typeof _0x36f03a===_0x206676(0x12e)&&!Array[_0x206676(0x13b)](_0x36f03a))return redactLegacyAppCredentials(_0x36f03a);if(/^apps\.[^.]+$/[_0x206676(0x13f)](_0x5c41ae)&&_0x36f03a&&typeof _0x36f03a==='object'&&!Array[_0x206676(0x13b)](_0x36f03a)){const _0x4a88ba=_0x36f03a;return Object[_0x206676(0x137)][_0x206676(0x140)][_0x206676(0x136)](_0x4a88ba,_0x206676(0x147))?{..._0x4a88ba,'accessKey':maskCliAccessKey(_0x4a88ba[_0x206676(0x147)])}:_0x36f03a;}return _0x36f03a;}function a178_0x2d98(){const _0x4353a1=['object','8bibAsB','50013xWDjPt','20IYvzRB','17305mhvJHc','string','length','6381220JeQMig','call','prototype','<redacted>','apps','60hnREgY','isArray','286349vyrfOD','5jEAOAl','fromEntries','test','hasOwnProperty','4696488qDqYOE','691746tbpIXn','60CGyOHJ','75861vnRYnW','slice','map','accessKey','entries'];a178_0x2d98=function(){return _0x4353a1;};return a178_0x2d98();}function redactLegacyAppCredentials(_0x25bdae){const _0x588ba4=a178_0x229101;return Object[_0x588ba4(0x13e)](Object[_0x588ba4(0x148)](_0x25bdae)[_0x588ba4(0x146)](([_0xa640c5,_0x3505e7])=>{const _0x3ad72d=_0x588ba4;if(!_0x3505e7||typeof _0x3505e7!==_0x3ad72d(0x12e)||Array[_0x3ad72d(0x13b)](_0x3505e7))return[_0xa640c5,_0x3505e7];const _0x4308b3={..._0x3505e7};return Object[_0x3ad72d(0x137)][_0x3ad72d(0x140)][_0x3ad72d(0x136)](_0x4308b3,'accessKey')&&(_0x4308b3[_0x3ad72d(0x147)]=maskCliAccessKey(_0x4308b3[_0x3ad72d(0x147)])),[_0xa640c5,_0x4308b3];}));}
1
+ const REDACTED_ACCESS_KEY="<redacted>";export function maskCliAccessKey(value){if(typeof value!=="string"||value.length<=8){return REDACTED_ACCESS_KEY}return`${value.slice(0,8)}${"*".repeat(value.length-8)}`}export function redactCliConfigCredentials(config){const displayed={...config};if(Object.prototype.hasOwnProperty.call(displayed,"accessKey")){displayed.accessKey=maskCliAccessKey(displayed.accessKey)}if(displayed.apps&&typeof displayed.apps==="object"&&!Array.isArray(displayed.apps)){displayed.apps=redactLegacyAppCredentials(displayed.apps)}return displayed}export function redactCliConfigValue(path,value){if(path==="accessKey"||/^apps\.[^.]+\.accessKey$/.test(path)){return maskCliAccessKey(value)}if(path==="apps"&&value&&typeof value==="object"&&!Array.isArray(value)){return redactLegacyAppCredentials(value)}if(/^apps\.[^.]+$/.test(path)&&value&&typeof value==="object"&&!Array.isArray(value)){const profile=value;return Object.prototype.hasOwnProperty.call(profile,"accessKey")?{
2
+ ...profile,accessKey:maskCliAccessKey(profile.accessKey)}:value}return value}function redactLegacyAppCredentials(apps){return Object.fromEntries(Object.entries(apps).map(([alias,profile])=>{if(!profile||typeof profile!=="object"||Array.isArray(profile)){return[alias,profile]}const displayedProfile={...profile};if(Object.prototype.hasOwnProperty.call(displayedProfile,"accessKey")){displayedProfile.accessKey=maskCliAccessKey(displayedProfile.accessKey)}return[alias,displayedProfile]}))}
@@ -1 +1 @@
1
- (function(_0x2178dc,_0x2bb563){const _0xb8b677=a179_0x1807,_0x4f2b7a=_0x2178dc();while(!![]){try{const _0x11e77f=parseInt(_0xb8b677(0xa8))/0x1*(-parseInt(_0xb8b677(0xa5))/0x2)+-parseInt(_0xb8b677(0xa7))/0x3+parseInt(_0xb8b677(0xa6))/0x4*(-parseInt(_0xb8b677(0xab))/0x5)+parseInt(_0xb8b677(0xaa))/0x6*(parseInt(_0xb8b677(0xa4))/0x7)+-parseInt(_0xb8b677(0xad))/0x8+-parseInt(_0xb8b677(0xac))/0x9+parseInt(_0xb8b677(0xa9))/0xa;if(_0x11e77f===_0x2bb563)break;else _0x4f2b7a['push'](_0x4f2b7a['shift']());}catch(_0x10a745){_0x4f2b7a['push'](_0x4f2b7a['shift']());}}}(a179_0x45af,0xc1fa8));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a179_0x45af(){const _0x3cd2ac=['3399568rhJvNG','5090869MepXNP','2nOIcsT','4qZzSzb','1245294Kurvcl','934353gXtlbM','46148200ahGbOw','6bqWxMZ','7839270CrmrXE','10847700JxQfQi'];a179_0x45af=function(){return _0x3cd2ac;};return a179_0x45af();}function a179_0x1807(_0x1f934b,_0x36bdae){_0x1f934b=_0x1f934b-0xa4;const _0x45afe2=a179_0x45af();let _0x18078c=_0x45afe2[_0x1f934b];return _0x18078c;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ import{createJqFilter,resolveBundledJqPaths}from"@lovrabet/cli-framework";import{CliErrors}from"../errors.js";export const applyJqFilter=createJqFilter(CliErrors,{bundledJqPaths:resolveBundledJqPaths()});
@@ -1 +1,2 @@
1
- (function(_0x13a543,_0xd171d2){const _0x2ae8c5=a180_0x4ccd,_0x3c1d00=_0x13a543();while(!![]){try{const _0x4fb538=parseInt(_0x2ae8c5(0xfe))/0x1*(parseInt(_0x2ae8c5(0x10b))/0x2)+parseInt(_0x2ae8c5(0x115))/0x3+parseInt(_0x2ae8c5(0x10d))/0x4*(-parseInt(_0x2ae8c5(0x107))/0x5)+-parseInt(_0x2ae8c5(0x110))/0x6*(-parseInt(_0x2ae8c5(0x108))/0x7)+parseInt(_0x2ae8c5(0x10f))/0x8*(parseInt(_0x2ae8c5(0x106))/0x9)+-parseInt(_0x2ae8c5(0x109))/0xa+-parseInt(_0x2ae8c5(0x100))/0xb*(parseInt(_0x2ae8c5(0x112))/0xc);if(_0x4fb538===_0xd171d2)break;else _0x3c1d00['push'](_0x3c1d00['shift']());}catch(_0x526f7e){_0x3c1d00['push'](_0x3c1d00['shift']());}}}(a180_0x1767,0x9a491));import a180_0x356d2b from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';function a180_0x1767(){const _0x3b5071=['92JEhgOP','npm\x20install\x20-g\x20','9172056mMzDlA','66YmeZCT','Recommended\x20stable:\x20','24lqtmSw','minimumVersionMessage','minimumVersion','2000532IjpKWj','latest','unavailable','213lznBpU','filter','9096021LaUQCD','validation','upgradeMessage','currentVersion','join','Upgrade\x20command:\x20','9QbTLoS','76005ynAxuw','429058AetCoY','8984430iKpwxy','belowMinimum','9824LhcvVk','stableVersion'];a180_0x1767=function(){return _0x3b5071;};return a180_0x1767();}function a180_0x4ccd(_0x5cb57d,_0x57d9b5){_0x5cb57d=_0x5cb57d-0xfe;const _0x176794=a180_0x1767();let _0x4ccd55=_0x176794[_0x5cb57d];return _0x4ccd55;}import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x22bc56,_0x166624){const _0xc53d42=a180_0x4ccd,_0x4079f8=a180_0x356d2b['valid'](_0x22bc56)===_0x22bc56,_0x3d7671=_0x166624?.[_0xc53d42(0x10c)]??null,_0x4c8377=_0x166624?.[_0xc53d42(0x114)]??null,_0x2218e5=Boolean(_0x4079f8&&_0x3d7671&&a180_0x356d2b['lt'](_0x22bc56,_0x3d7671)),_0x1e44ea=Boolean(_0x4079f8&&_0x4c8377&&a180_0x356d2b['lt'](_0x22bc56,_0x4c8377));return{'currentVersion':_0x22bc56,'stableVersion':_0x3d7671,'minimumVersion':_0x4c8377,'needsUpgrade':_0x2218e5||_0x1e44ea,'belowMinimum':_0x1e44ea,'upgradeMessage':_0x166624?.[_0xc53d42(0x102)],'minimumVersionMessage':_0x166624?.['minimumVersionMessage']};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x378f4a){const _0xf93b3=a180_0x4ccd;return _0xf93b3(0x10e)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x378f4a[_0xf93b3(0x10c)]??_0xf93b3(0x116));}export function assertCliVersionSupported(_0x2a2d68){const _0x33eec0=a180_0x4ccd;if(!_0x2a2d68[_0x33eec0(0x10a)])return;const _0x3d6272=[_0x2a2d68[_0x33eec0(0x113)],'Current\x20version:\x20'+_0x2a2d68[_0x33eec0(0x103)],'Minimum\x20supported:\x20'+_0x2a2d68[_0x33eec0(0x114)],_0x33eec0(0x111)+(_0x2a2d68[_0x33eec0(0x10c)]??_0x33eec0(0x117)),_0x33eec0(0x105)+getCliUpgradeCommand(_0x2a2d68)][_0x33eec0(0xff)](Boolean)[_0x33eec0(0x104)]('\x0a');throw CliErrors[_0x33eec0(0x101)]('Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.',_0x3d6272);}
1
+ import semver from"semver";import{LOVRABET_NPM_PACKAGE_NAME}from"../constant/distribution.js";import{CliErrors}from"../errors.js";import{getCliVersionPolicy}from"../utils/cli-version-policy.js";import{getCliVersion}from"../utils/version.js";export function evaluateCliVersionPolicy(currentVersion,policy){const currentIsValid=semver.valid(currentVersion)===currentVersion;const stableVersion=policy?.stableVersion??null;const minimumVersion=policy?.minimumVersion??null;const needsUpgrade=Boolean(currentIsValid&&stableVersion&&semver.lt(currentVersion,stableVersion));const belowMinimum=Boolean(currentIsValid&&minimumVersion&&semver.lt(currentVersion,minimumVersion));return{currentVersion:currentVersion,stableVersion:stableVersion,minimumVersion:minimumVersion,needsUpgrade:needsUpgrade||belowMinimum,belowMinimum:belowMinimum,upgradeMessage:policy?.upgradeMessage,minimumVersionMessage:policy?.minimumVersionMessage}}export async function checkCliVersion(){
2
+ return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy())}export function getCliUpgradeCommand(result){return`npm install -g ${LOVRABET_NPM_PACKAGE_NAME}@${result.stableVersion??"latest"}`}export function assertCliVersionSupported(result){if(!result.belowMinimum)return;const details=[result.minimumVersionMessage,`Current version: ${result.currentVersion}`,`Minimum supported: ${result.minimumVersion}`,`Recommended stable: ${result.stableVersion??"unavailable"}`,`Upgrade command: ${getCliUpgradeCommand(result)}`].filter(Boolean).join("\n");throw CliErrors.validation("Current CLI version is below the minimum supported version.",details)}
@@ -1 +1,3 @@
1
- function a181_0x488d(_0x5976dc,_0x1d2c72){_0x5976dc=_0x5976dc-0x1f2;const _0x1519a1=a181_0x1519();let _0x488d53=_0x1519a1[_0x5976dc];return _0x488d53;}(function(_0x27be26,_0x19a955){const _0x1549a6=a181_0x488d,_0x301467=_0x27be26();while(!![]){try{const _0x161168=-parseInt(_0x1549a6(0x203))/0x1*(parseInt(_0x1549a6(0x1f2))/0x2)+parseInt(_0x1549a6(0x1f5))/0x3*(-parseInt(_0x1549a6(0x205))/0x4)+-parseInt(_0x1549a6(0x206))/0x5*(parseInt(_0x1549a6(0x20a))/0x6)+parseInt(_0x1549a6(0x1fd))/0x7*(parseInt(_0x1549a6(0x202))/0x8)+parseInt(_0x1549a6(0x204))/0x9*(-parseInt(_0x1549a6(0x201))/0xa)+parseInt(_0x1549a6(0x1ff))/0xb+parseInt(_0x1549a6(0x1f8))/0xc;if(_0x161168===_0x19a955)break;else _0x301467['push'](_0x301467['shift']());}catch(_0x480f52){_0x301467['push'](_0x301467['shift']());}}}(a181_0x1519,0x8c32c));import a181_0x304355 from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x10e88c){const _0x407917=a181_0x488d;return typeof _0x10e88c===_0x407917(0x209)&&_0x10e88c[_0x407917(0x200)]()?_0x10e88c['trim']():null;}function a181_0x1519(){const _0x451e64=['31090bdllQZ','40sOzQiu','1LQOUhn','801daAFaF','1816IwOhnF','130zVTsIb','timeout','stableVersion','string','106494DGngFL','1172066fVdHNL','now','object','3000bkGbHS','cli','recommendedVersion','12981060uoAbCf','valid','upgradeMessage','minimumVersion','then','1171009RyCFLO','latestVersion','4776970QTWebL','trim'];a181_0x1519=function(){return _0x451e64;};return a181_0x1519();}function pickStrictSemver(_0xd2b593){const _0x587ea1=a181_0x488d,_0x29b8be=pickString(_0xd2b593);return _0x29b8be&&a181_0x304355[_0x587ea1(0x1f9)](_0x29b8be)===_0x29b8be?_0x29b8be:null;}export function normalizeCliVersionPolicy(_0x589fe0){const _0x3c490f=a181_0x488d;if(!_0x589fe0||typeof _0x589fe0!==_0x3c490f(0x1f4))return null;const _0x27f0c8=_0x589fe0,_0x19f903=_0x27f0c8[_0x3c490f(0x1f6)]&&typeof _0x27f0c8[_0x3c490f(0x1f6)]===_0x3c490f(0x1f4)?_0x27f0c8['cli']:_0x27f0c8,_0x30d799=pickStrictSemver(_0x19f903[_0x3c490f(0x208)]??_0x19f903[_0x3c490f(0x1fe)]??_0x19f903[_0x3c490f(0x1f7)]),_0x25f99f=pickStrictSemver(_0x19f903[_0x3c490f(0x1fb)]??_0x19f903['minVersion']);if(!_0x30d799&&!_0x25f99f)return null;if(_0x30d799&&_0x25f99f&&a181_0x304355['gt'](_0x25f99f,_0x30d799))return null;return{'stableVersion':_0x30d799,'minimumVersion':_0x25f99f,'upgradeMessage':pickString(_0x19f903[_0x3c490f(0x1fa)])??undefined,'minimumVersionMessage':pickString(_0x19f903['minimumVersionMessage'])??undefined};}export async function fetchCliVersionPolicy(){const _0x4ad875=a181_0x488d;try{const _0xf00d85=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':AbortSignal[_0x4ad875(0x207)](FETCH_TIMEOUT_MS)});if(!_0xf00d85['ok'])return null;return normalizeCliVersionPolicy(await _0xf00d85['json']());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x3f68db=a181_0x488d,_0x1fceef=Date[_0x3f68db(0x1f3)]();if(hasCachedPolicy){const _0x3c319f=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1fceef-cachedAt<_0x3c319f)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x3f68db(0x1fc)](_0x393ea0=>{const _0x15bc0e=_0x3f68db;return cachedPolicy=_0x393ea0,cachedAt=Date[_0x15bc0e(0x1f3)](),hasCachedPolicy=!![],_0x393ea0;})['finally'](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
1
+ import semver from"semver";import{LOVRABET_CLI_VERSION_POLICY_URL}from"../constant/distribution.js";const SUCCESS_CACHE_TTL_MS=5*60*1e3;const FAILURE_CACHE_TTL_MS=60*1e3;const FETCH_TIMEOUT_MS=1500;function pickString(value){return typeof value==="string"&&value.trim()?value.trim():null}function pickStrictSemver(value){const text=pickString(value);return text&&semver.valid(text)===text?text:null}export function normalizeCliVersionPolicy(raw){if(!raw||typeof raw!=="object")return null;const root=raw;const source=root.cli&&typeof root.cli==="object"?root.cli:root;const stableVersion=pickStrictSemver(source.stableVersion??source.latestVersion??source.recommendedVersion);const minimumVersion=pickStrictSemver(source.minimumVersion??source.minVersion);if(!stableVersion&&!minimumVersion)return null;if(stableVersion&&minimumVersion&&semver.gt(minimumVersion,stableVersion)){return null}return{stableVersion:stableVersion,minimumVersion:minimumVersion,
2
+ upgradeMessage:pickString(source.upgradeMessage)??undefined,minimumVersionMessage:pickString(source.minimumVersionMessage)??undefined}}export async function fetchCliVersionPolicy(){try{const response=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(FETCH_TIMEOUT_MS)});if(!response.ok)return null;return normalizeCliVersionPolicy(await response.json())}catch{return null}}let cachedPolicy=null;let cachedAt=0;let hasCachedPolicy=false;let pendingPolicy=null;export async function getCliVersionPolicy(){const now=Date.now();if(hasCachedPolicy){const ttl=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(now-cachedAt<ttl)return cachedPolicy}if(pendingPolicy)return pendingPolicy;pendingPolicy=fetchCliVersionPolicy().then(policy=>{cachedPolicy=policy;cachedAt=Date.now();hasCachedPolicy=true;return policy}).finally(()=>{pendingPolicy=null});return pendingPolicy}export function clearCliVersionPolicyCache(){cachedPolicy=null
3
+ ;cachedAt=0;hasCachedPolicy=false;pendingPolicy=null}
@@ -1 +1,3 @@
1
- const a182_0x1afcc5=a182_0x19d3;(function(_0x1a4e01,_0x130e41){const _0xfeed48=a182_0x19d3,_0x17a002=_0x1a4e01();while(!![]){try{const _0xb2dc04=-parseInt(_0xfeed48(0x1b6))/0x1*(parseInt(_0xfeed48(0x1ac))/0x2)+-parseInt(_0xfeed48(0x1c7))/0x3+-parseInt(_0xfeed48(0x1d5))/0x4*(parseInt(_0xfeed48(0x1a4))/0x5)+-parseInt(_0xfeed48(0x1b3))/0x6+-parseInt(_0xfeed48(0x1b5))/0x7*(-parseInt(_0xfeed48(0x1c9))/0x8)+-parseInt(_0xfeed48(0x1a6))/0x9*(parseInt(_0xfeed48(0x1a9))/0xa)+parseInt(_0xfeed48(0x1a7))/0xb*(parseInt(_0xfeed48(0x1a5))/0xc);if(_0xb2dc04===_0x130e41)break;else _0x17a002['push'](_0x17a002['shift']());}catch(_0x1ce74f){_0x17a002['push'](_0x17a002['shift']());}}}(a182_0x15e1,0x3aa5a));import a182_0x5b6295 from'winston';import a182_0x3c47b7 from'node:fs';function a182_0x19d3(_0x1020ea,_0x42b498){_0x1020ea=_0x1020ea-0x1a2;const _0x15e119=a182_0x15e1();let _0x19d3bf=_0x15e119[_0x1020ea];return _0x19d3bf;}function a182_0x15e1(){const _0x318cff=['createLogger','logFileName','readLogs','transports','Failed\x20to\x20read\x20logs:','readFileSync','log','652350waTHId','blue','3120nmZvPR','format','level','info','message','yellow','rawCommand','dirname','getWinstonInstance','Failed\x20to\x20clear\x20logs:','writeFileSync','Starting:\x20','72fWKZMw','unknown','currentRawCommand','warn','trim','toISOString','errors','red','winstonLogger','filter','81825eneVeJ','12EfQRls','261gqyUNl','15402035NGZpRI','clear','158150FvGUAE','stringify','parse','6ELeXBA','utf8','logFilePath','logTask','error','duration','setLogPath','476874MEcIuK','combine','315fjgSNn','42461gyUEIZ','initWinstonLogger','success','timestamp','command','printf','existsSync','Completed:\x20','now','join'];a182_0x15e1=function(){return _0x318cff;};return a182_0x15e1();}import a182_0x563ab6 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a182_0x1afcc5(0x1a2)];[a182_0x1afcc5(0x1ae)]='';[a182_0x1afcc5(0x1d7)]='';constructor(){}['setRawCommand'](_0x4291ba){this['currentRawCommand']=_0x4291ba;}[a182_0x1afcc5(0x1b2)](_0x2bfa31){const _0x3052f7=a182_0x1afcc5;this[_0x3052f7(0x1ae)]=a182_0x563ab6[_0x3052f7(0x1bf)](_0x2bfa31,PRODUCT_CONFIG[_0x3052f7(0x1c1)]),this['winstonLogger']&&this[_0x3052f7(0x1a2)][_0x3052f7(0x1a8)](),this[_0x3052f7(0x1b7)]();}[a182_0x1afcc5(0x1b7)](){const _0x22e7a9=a182_0x1afcc5,_0x7798ef=a182_0x563ab6[_0x22e7a9(0x1d0)](this[_0x22e7a9(0x1ae)]);!a182_0x3c47b7['existsSync'](_0x7798ef)&&a182_0x3c47b7['mkdirSync'](_0x7798ef,{'recursive':!![]});const _0x56f1b7=a182_0x5b6295[_0x22e7a9(0x1ca)][_0x22e7a9(0x1b4)](a182_0x5b6295['format'][_0x22e7a9(0x1b9)](),a182_0x5b6295[_0x22e7a9(0x1ca)][_0x22e7a9(0x1db)]({'stack':!![]}),a182_0x5b6295[_0x22e7a9(0x1ca)][_0x22e7a9(0x1bb)](_0x4640bc=>{const _0xb692cd=_0x22e7a9,_0x5a09aa={'timestamp':_0x4640bc[_0xb692cd(0x1b9)]||new Date()[_0xb692cd(0x1da)](),'level':_0x4640bc[_0xb692cd(0x1cb)]||'info','command':_0x4640bc[_0xb692cd(0x1ba)]||_0xb692cd(0x1d6),'rawCommand':_0x4640bc[_0xb692cd(0x1cf)]||this[_0xb692cd(0x1d7)]||undefined,'message':_0x4640bc[_0xb692cd(0x1cd)]||'','duration':_0x4640bc[_0xb692cd(0x1b1)]||undefined,'details':_0x4640bc['details']||undefined};return JSON[_0xb692cd(0x1aa)](_0x5a09aa);}));this[_0x22e7a9(0x1a2)]=a182_0x5b6295[_0x22e7a9(0x1c0)]({'level':'info','format':_0x56f1b7,'transports':[new a182_0x5b6295[(_0x22e7a9(0x1c3))]['File']({'filename':this[_0x22e7a9(0x1ae)],'level':_0x22e7a9(0x1cc)})],'silent':![]}),a182_0x5b6295['addColors']({'success':'green','error':_0x22e7a9(0x1dc),'warn':_0x22e7a9(0x1ce),'info':_0x22e7a9(0x1c8)});}[a182_0x1afcc5(0x1cc)](_0x38116e,_0x23e0f4,_0x128fd0){const _0x593dca=a182_0x1afcc5;if(!this[_0x593dca(0x1ae)]||!this[_0x593dca(0x1a2)])return;this[_0x593dca(0x1a2)][_0x593dca(0x1cc)](_0x23e0f4,{'command':_0x38116e,'details':_0x128fd0});}['success'](_0x511010,_0x40cd44,_0x5b680c,_0x58fd51){const _0x5738d3=a182_0x1afcc5;if(!this[_0x5738d3(0x1ae)]||!this[_0x5738d3(0x1a2)])return;this[_0x5738d3(0x1a2)][_0x5738d3(0x1c6)]('info',_0x40cd44,{'level':'success','command':_0x511010,'duration':_0x5b680c,'details':_0x58fd51});}['error'](_0x1580f1,_0x97f60,_0x102df8){const _0x489bd0=a182_0x1afcc5;if(!this['logFilePath']||!this[_0x489bd0(0x1a2)])return;this[_0x489bd0(0x1a2)][_0x489bd0(0x1b0)](_0x97f60,{'command':_0x1580f1,'details':_0x102df8});}[a182_0x1afcc5(0x1d8)](_0x45e7fa,_0x50859f,_0x166419){const _0xc467d7=a182_0x1afcc5;if(!this[_0xc467d7(0x1ae)]||!this[_0xc467d7(0x1a2)])return;this[_0xc467d7(0x1a2)]['warn'](_0x50859f,{'command':_0x45e7fa,'details':_0x166419});}async[a182_0x1afcc5(0x1af)](_0x146355,_0x215f59,_0x109374){const _0x24989c=a182_0x1afcc5,_0x579caf=Date['now']();this[_0x24989c(0x1cc)](_0x146355,_0x24989c(0x1d4)+_0x215f59);try{const _0x3a2cd2=await _0x109374(),_0x3156d1=Date['now']()-_0x579caf;return this[_0x24989c(0x1b8)](_0x146355,_0x24989c(0x1bd)+_0x215f59,_0x3156d1),_0x3a2cd2;}catch(_0x1e3f1b){const _0x16c1eb=Date[_0x24989c(0x1be)]()-_0x579caf;this[_0x24989c(0x1b0)](_0x146355,'Failed:\x20'+_0x215f59,{'error':_0x1e3f1b instanceof Error?_0x1e3f1b['message']:String(_0x1e3f1b),'duration':_0x16c1eb});throw _0x1e3f1b;}}[a182_0x1afcc5(0x1c2)](){const _0x398a1f=a182_0x1afcc5;try{if(!a182_0x3c47b7[_0x398a1f(0x1bc)](this[_0x398a1f(0x1ae)]))return[];const _0x1ebe95=a182_0x3c47b7[_0x398a1f(0x1c5)](this[_0x398a1f(0x1ae)],_0x398a1f(0x1ad));return _0x1ebe95['split'](/\r?\n/)[_0x398a1f(0x1a3)](_0x5c0ac5=>_0x5c0ac5[_0x398a1f(0x1d9)]())['map'](_0x37e458=>JSON[_0x398a1f(0x1ab)](_0x37e458));}catch(_0x26ad84){return console['warn'](_0x398a1f(0x1c4),_0x26ad84),[];}}['clearLogs'](){const _0x756c0f=a182_0x1afcc5;try{a182_0x3c47b7[_0x756c0f(0x1bc)](this['logFilePath'])&&a182_0x3c47b7[_0x756c0f(0x1d3)](this[_0x756c0f(0x1ae)],'','utf8');}catch(_0x76362c){console[_0x756c0f(0x1d8)](_0x756c0f(0x1d2),_0x76362c);}}[a182_0x1afcc5(0x1d1)](){return this['winstonLogger'];}}export const logger=new Logger();
1
+ import winston from"winston";import fs from"node:fs";import path from"node:path";import{PRODUCT_CONFIG}from"../constant/product.js";class Logger{winstonLogger;logFilePath="";currentRawCommand="";constructor(){}setRawCommand(rawCommand){this.currentRawCommand=rawCommand}setLogPath(projectPath){this.logFilePath=path.join(projectPath,PRODUCT_CONFIG.logFileName);if(this.winstonLogger){this.winstonLogger.clear()}this.initWinstonLogger()}initWinstonLogger(){const dir=path.dirname(this.logFilePath);if(!fs.existsSync(dir)){fs.mkdirSync(dir,{recursive:true})}const customFormat=winston.format.combine(winston.format.timestamp(),winston.format.errors({stack:true}),winston.format.printf(info=>{const logEntry={timestamp:info.timestamp||(new Date).toISOString(),level:info.level||"info",command:info.command||"unknown",rawCommand:info.rawCommand||this.currentRawCommand||undefined,message:info.message||"",duration:info.duration||undefined,details:info.details||undefined};return JSON.stringify(logEntry)
2
+ }));this.winstonLogger=winston.createLogger({level:"info",format:customFormat,transports:[new winston.transports.File({filename:this.logFilePath,level:"info"})],silent:false});winston.addColors({success:"green",error:"red",warn:"yellow",info:"blue"})}info(command,message,details){if(!this.logFilePath||!this.winstonLogger)return;this.winstonLogger.info(message,{command:command,details:details})}success(command,message,duration,details){if(!this.logFilePath||!this.winstonLogger)return;this.winstonLogger.log("info",message,{level:"success",command:command,duration:duration,details:details})}error(command,message,details){if(!this.logFilePath||!this.winstonLogger)return;this.winstonLogger.error(message,{command:command,details:details})}warn(command,message,details){if(!this.logFilePath||!this.winstonLogger)return;this.winstonLogger.warn(message,{command:command,details:details})}async logTask(command,taskName,task){const startTime=Date.now();this.info(command,`Starting: ${taskName}`);try{
3
+ const result=await task();const duration=Date.now()-startTime;this.success(command,`Completed: ${taskName}`,duration);return result}catch(error){const duration=Date.now()-startTime;this.error(command,`Failed: ${taskName}`,{error:error instanceof Error?error.message:String(error),duration:duration});throw error}}readLogs(){try{if(!fs.existsSync(this.logFilePath)){return[]}const content=fs.readFileSync(this.logFilePath,"utf8");return content.split(/\r?\n/).filter(line=>line.trim()).map(line=>JSON.parse(line))}catch(error){console.warn("Failed to read logs:",error);return[]}}clearLogs(){try{if(fs.existsSync(this.logFilePath)){fs.writeFileSync(this.logFilePath,"","utf8")}}catch(error){console.warn("Failed to clear logs:",error)}}getWinstonInstance(){return this.winstonLogger}}export const logger=new Logger;
@@ -1 +1,3 @@
1
- (function(_0x239eb1,_0xed9df7){const _0x2bb396=a183_0x2d5a,_0x461d94=_0x239eb1();while(!![]){try{const _0x251b32=parseInt(_0x2bb396(0x14d))/0x1+parseInt(_0x2bb396(0x14a))/0x2*(parseInt(_0x2bb396(0x14e))/0x3)+-parseInt(_0x2bb396(0x146))/0x4*(-parseInt(_0x2bb396(0x147))/0x5)+parseInt(_0x2bb396(0x150))/0x6+parseInt(_0x2bb396(0x156))/0x7*(parseInt(_0x2bb396(0x148))/0x8)+parseInt(_0x2bb396(0x154))/0x9*(-parseInt(_0x2bb396(0x158))/0xa)+-parseInt(_0x2bb396(0x14f))/0xb;if(_0x251b32===_0xed9df7)break;else _0x461d94['push'](_0x461d94['shift']());}catch(_0x53d808){_0x461d94['push'](_0x461d94['shift']());}}}(a183_0x55bb,0x3c87a));function a183_0x55bb(){const _0x4eff23=['10792584BLnIxf','218778EqeDjZ','defineProperty','includes','prototype','14940mdHEHc','text','15995EKEiAk','getOwnPropertyDescriptor','310uKwSLX','parse','4bVunDb','1266010ixZBHk','1360SbPYiA','json','182098TyedQN','length','slice','420321cpilrE','6vzWmhf'];a183_0x55bb=function(){return _0x4eff23;};return a183_0x55bb();}function a183_0x2d5a(_0x273a7d,_0x57324c){_0x273a7d=_0x273a7d-0x145;const _0x55bb2d=a183_0x55bb();let _0x2d5a49=_0x55bb2d[_0x273a7d];return _0x2d5a49;}const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number['MAX_SAFE_INTEGER']),MIN_SAFE_INTEGER=BigInt(Number['MIN_SAFE_INTEGER']);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function isUnsafeIntegerLiteral(_0x3495cd){const _0x2df517=a183_0x2d5a;if(_0x3495cd['includes']('.')||_0x3495cd[_0x2df517(0x152)]('e')||_0x3495cd['includes']('E'))return![];const _0x350bc2=BigInt(_0x3495cd);return _0x350bc2>MAX_SAFE_INTEGER||_0x350bc2<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x2c47f4){const _0x3359d7=a183_0x2d5a;let _0x56ab73='',_0x4ff709=![],_0x26a67b=![];for(let _0x1c5f33=0x0;_0x1c5f33<_0x2c47f4[_0x3359d7(0x14b)];){const _0x56af36=_0x2c47f4[_0x1c5f33];if(_0x4ff709){_0x56ab73+=_0x56af36,_0x1c5f33+=0x1;if(_0x26a67b)_0x26a67b=![];else{if(_0x56af36==='\x5c')_0x26a67b=!![];else _0x56af36==='\x22'&&(_0x4ff709=![]);}continue;}if(_0x56af36==='\x22'){_0x4ff709=!![],_0x56ab73+=_0x56af36,_0x1c5f33+=0x1;continue;}if(_0x56af36==='-'||_0x56af36>='0'&&_0x56af36<='9'){const _0x5d5b13=JSON_NUMBER_PATTERN['exec'](_0x2c47f4[_0x3359d7(0x14c)](_0x1c5f33))?.[0x0];if(_0x5d5b13){_0x56ab73+=isUnsafeIntegerLiteral(_0x5d5b13)?'\x22'+_0x5d5b13+'\x22':_0x5d5b13,_0x1c5f33+=_0x5d5b13[_0x3359d7(0x14b)];continue;}}_0x56ab73+=_0x56af36,_0x1c5f33+=0x1;}return _0x56ab73;}export function parseLosslessJson(_0x48f0ea){const _0x40a392=a183_0x2d5a;return JSON[_0x40a392(0x145)](quoteUnsafeIntegerLiterals(_0x48f0ea));}export function installLosslessJsonResponseParser(){const _0x39f414=a183_0x2d5a;if(typeof Response==='undefined')return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response[_0x39f414(0x153)],originalResponseJsonDescriptor=Object[_0x39f414(0x157)](responseJsonPrototype,_0x39f414(0x149)),Object[_0x39f414(0x151)](responseJsonPrototype,_0x39f414(0x149),{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x1c9f50(){const _0x56d3d9=_0x39f414;return parseLosslessJson(await this[_0x56d3d9(0x155)]());}}),restoreResponseJsonParser=()=>{const _0x44d2fa=_0x39f414;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object[_0x44d2fa(0x151)](responseJsonPrototype,_0x44d2fa(0x149),originalResponseJsonDescriptor):delete responseJsonPrototype[_0x44d2fa(0x149)],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
1
+ const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/;const MAX_SAFE_INTEGER=BigInt(Number.MAX_SAFE_INTEGER);const MIN_SAFE_INTEGER=BigInt(Number.MIN_SAFE_INTEGER);let restoreResponseJsonParser;let responseJsonPrototype;let originalResponseJsonDescriptor;function isUnsafeIntegerLiteral(token){if(token.includes(".")||token.includes("e")||token.includes("E")){return false}const value=BigInt(token);return value>MAX_SAFE_INTEGER||value<MIN_SAFE_INTEGER}function quoteUnsafeIntegerLiterals(text){let output="";let inString=false;let escaped=false;for(let index=0;index<text.length;){const character=text[index];if(inString){output+=character;index+=1;if(escaped){escaped=false}else if(character==="\\"){escaped=true}else if(character==='"'){inString=false}continue}if(character==='"'){inString=true;output+=character;index+=1;continue}if(character==="-"||character>="0"&&character<="9"){const token=JSON_NUMBER_PATTERN.exec(text.slice(index))?.[0];if(token){
2
+ output+=isUnsafeIntegerLiteral(token)?`"${token}"`:token;index+=token.length;continue}}output+=character;index+=1}return output}export function parseLosslessJson(text){return JSON.parse(quoteUnsafeIntegerLiterals(text))}export function installLosslessJsonResponseParser(){if(typeof Response==="undefined")return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;responseJsonPrototype=Response.prototype;originalResponseJsonDescriptor=Object.getOwnPropertyDescriptor(responseJsonPrototype,"json");Object.defineProperty(responseJsonPrototype,"json",{...originalResponseJsonDescriptor??{configurable:true,enumerable:false,writable:true},value:async function losslessJson(){return parseLosslessJson(await this.text())}});restoreResponseJsonParser=()=>{if(!responseJsonPrototype)return;if(originalResponseJsonDescriptor){Object.defineProperty(responseJsonPrototype,"json",originalResponseJsonDescriptor)}else{delete responseJsonPrototype.json}responseJsonPrototype=undefined
3
+ ;originalResponseJsonDescriptor=undefined;restoreResponseJsonParser=undefined};return restoreResponseJsonParser}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.()}
@@ -1 +1,3 @@
1
- (function(_0x222675,_0x168a53){const _0x13542f=a184_0x2c8a,_0x1ef770=_0x222675();while(!![]){try{const _0x2c5b9c=-parseInt(_0x13542f(0x10f))/0x1+-parseInt(_0x13542f(0x129))/0x2*(parseInt(_0x13542f(0x11a))/0x3)+parseInt(_0x13542f(0x122))/0x4*(parseInt(_0x13542f(0x112))/0x5)+-parseInt(_0x13542f(0x125))/0x6*(-parseInt(_0x13542f(0x117))/0x7)+parseInt(_0x13542f(0x128))/0x8+parseInt(_0x13542f(0x111))/0x9+parseInt(_0x13542f(0x123))/0xa*(parseInt(_0x13542f(0x116))/0xb);if(_0x2c5b9c===_0x168a53)break;else _0x1ef770['push'](_0x1ef770['shift']());}catch(_0x5f40b1){_0x1ef770['push'](_0x1ef770['shift']());}}}(a184_0x257c,0xec58b));import{CliErrors}from'../errors.js';function a184_0x257c(){const _0xc8e3bb=['id[','map','297344sKlUJY','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','3035097ZYdZIZ','200kvKDAT','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','items','data\x20update\x20--params.','22KSiilN','1726473DFCZsV','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','length','9RadsfL','string','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27','Invalid\x20JSON\x20for\x20--params:\x20','isSafeInteger','data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','\x20records\x20per\x20call;\x20received\x20','validation','19004thWtEN','4414430lpyxIJ','number','18lbvtry','join','object','2769488WgZqqd','820562tVeKaL','isArray','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.'];a184_0x257c=function(){return _0xc8e3bb;};return a184_0x257c();}import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;function a184_0x2c8a(_0x550b54,_0x3eca6a){_0x550b54=_0x550b54-0x10b;const _0x257c75=a184_0x257c();let _0x2c8abb=_0x257c75[_0x550b54];return _0x2c8abb;}export function parseJsonParams(_0x364015){if(!_0x364015)return undefined;try{return parseLosslessJson(_0x364015);}catch{throw CliErrors['validation']('Invalid\x20JSON\x20for\x20--params:\x20'+_0x364015);}}export function parseJsonParamsValue(_0xac784a){const _0x4593d3=a184_0x2c8a;if(!_0xac784a)return undefined;try{return parseLosslessJson(_0xac784a);}catch{throw CliErrors[_0x4593d3(0x121)](_0x4593d3(0x11d)+_0xac784a);}}export function parseBatchCreateItemsFromParams(_0x471744){const _0xbcee70=a184_0x2c8a;if(Array[_0xbcee70(0x10b)](_0x471744))return _0x471744;if(_0x471744!==null&&_0x471744!==undefined&&typeof _0x471744==='object'&&Array[_0xbcee70(0x10b)](_0x471744[_0xbcee70(0x114)]))return _0x471744[_0xbcee70(0x114)];throw CliErrors[_0xbcee70(0x121)](_0xbcee70(0x110),_0xbcee70(0x118));}function parseDataUpdateId(_0x12c141,_0x1067f1){const _0x5a7521=a184_0x2c8a;if(typeof _0x12c141===_0x5a7521(0x124)&&Number[_0x5a7521(0x11e)](_0x12c141)&&_0x12c141>0x0)return _0x12c141;if(typeof _0x12c141===_0x5a7521(0x11b)){if(/^[1-9]\d*$/['test'](_0x12c141))return _0x12c141;}throw CliErrors[_0x5a7521(0x121)](_0x5a7521(0x115)+_0x1067f1+'\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.');}export function parseUpdateIdsFromParams(_0x162444){const _0x25d0cc=a184_0x2c8a;if(_0x162444===null||_0x162444===undefined||typeof _0x162444!==_0x25d0cc(0x127)||Array[_0x25d0cc(0x10b)](_0x162444))throw CliErrors[_0x25d0cc(0x121)](_0x25d0cc(0x113),'Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27');const _0x17ceff=_0x162444['id'];if(_0x17ceff===undefined||_0x17ceff===null)throw CliErrors['validation'](_0x25d0cc(0x11f),_0x25d0cc(0x11c));const _0x498a0e=Array['isArray'](_0x17ceff)?_0x17ceff:[_0x17ceff];if(_0x498a0e[_0x25d0cc(0x119)]===0x0)throw CliErrors['validation'](_0x25d0cc(0x10c));if(_0x498a0e[_0x25d0cc(0x119)]>MAX_DATA_UPDATE_IDS)throw CliErrors[_0x25d0cc(0x121)]('data\x20update\x20can\x20update\x20at\x20most\x20'+MAX_DATA_UPDATE_IDS+_0x25d0cc(0x120)+_0x498a0e['length']+'.');return _0x498a0e[_0x25d0cc(0x10e)]((_0x35f93b,_0x6c8059)=>parseDataUpdateId(_0x35f93b,Array[_0x25d0cc(0x10b)](_0x17ceff)?_0x25d0cc(0x10d)+_0x6c8059+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x56c8c6,_0x305b61){const _0x250c21=a184_0x2c8a;if(Array['isArray'](_0x56c8c6['id'])&&_0x305b61[_0x250c21(0x119)]>0x1)return{..._0x56c8c6,'id':_0x305b61[_0x250c21(0x126)](',')};return _0x56c8c6;}
1
+ import{CliErrors}from"../errors.js";import{parseLosslessJson}from"../utils/lossless-json.js";export const MAX_DATA_UPDATE_IDS=1e3;export function parseJsonParams(paramsStr){if(!paramsStr)return undefined;try{return parseLosslessJson(paramsStr)}catch{throw CliErrors.validation(`Invalid JSON for --params: ${paramsStr}`)}}export function parseJsonParamsValue(paramsStr){if(!paramsStr)return undefined;try{return parseLosslessJson(paramsStr)}catch{throw CliErrors.validation(`Invalid JSON for --params: ${paramsStr}`)}}export function parseBatchCreateItemsFromParams(params){if(Array.isArray(params)){return params}if(params!==null&&params!==undefined&&typeof params==="object"&&Array.isArray(params.items)){return params.items}throw CliErrors.validation('batchCreate --params must be a JSON array or {"items":[...]}','Example: --params \'[{"name":"a"},{"name":"b"}]\'')}function parseDataUpdateId(value,label){if(typeof value==="number"&&Number.isSafeInteger(value)&&value>0){return value}
2
+ if(typeof value==="string"){if(/^[1-9]\d*$/.test(value)){return value}}throw CliErrors.validation(`data update --params.${label} must be a positive integer or numeric string.`)}export function parseUpdateIdsFromParams(params){if(params===null||params===undefined||typeof params!=="object"||Array.isArray(params)){throw CliErrors.validation("data update --params must be a JSON object with id.",'Example: --params \'{"id":[1,2,3],"status":"done"}\'')}const id=params.id;if(id===undefined||id===null){throw CliErrors.validation('data update requires "id" in --params.','Example: --params \'{"id":[1,2,3],"status":"done"}\'')}const rawIds=Array.isArray(id)?id:[id];if(rawIds.length===0){throw CliErrors.validation("data update id array cannot be empty.")}if(rawIds.length>MAX_DATA_UPDATE_IDS){throw CliErrors.validation(`data update can update at most ${MAX_DATA_UPDATE_IDS} records per call; received ${rawIds.length}.`)}
3
+ return rawIds.map((value,index)=>parseDataUpdateId(value,Array.isArray(id)?`id[${index}]`:"id"))}export function normalizeUpdateParamsForRuntime(params,ids){if(Array.isArray(params.id)&&ids.length>1){return{...params,id:ids.join(",")}}return params}
@@ -1 +1 @@
1
- function a185_0x2147(){const _0x12c4b9=['44480UUibjU','string','isSafeInteger','39CpiPfl','11439561zxviKo','3571389kdDySi','570gRgqJa','5591872VPCtQW','110342cLaxgb','number','1352966DFsXET','11914736OLtJsK','test'];a185_0x2147=function(){return _0x12c4b9;};return a185_0x2147();}function a185_0x2495(_0xcd07d5,_0x5f5505){_0xcd07d5=_0xcd07d5-0x185;const _0x2147f5=a185_0x2147();let _0x24950f=_0x2147f5[_0xcd07d5];return _0x24950f;}(function(_0x348b41,_0x4266a3){const _0x556484=a185_0x2495,_0x5cbc07=_0x348b41();while(!![]){try{const _0x40db3a=parseInt(_0x556484(0x18c))/0x1+parseInt(_0x556484(0x18a))/0x2*(parseInt(_0x556484(0x185))/0x3)+-parseInt(_0x556484(0x189))/0x4+-parseInt(_0x556484(0x18f))/0x5*(-parseInt(_0x556484(0x188))/0x6)+-parseInt(_0x556484(0x186))/0x7+parseInt(_0x556484(0x18d))/0x8+-parseInt(_0x556484(0x187))/0x9;if(_0x40db3a===_0x4266a3)break;else _0x5cbc07['push'](_0x5cbc07['shift']());}catch(_0x73fd95){_0x5cbc07['push'](_0x5cbc07['shift']());}}}(a185_0x2147,0xee317));export function normalizePositiveSafeInteger(_0xa0ed5){const _0x1f3ef1=a185_0x2495;if(typeof _0xa0ed5===_0x1f3ef1(0x18b))return Number[_0x1f3ef1(0x191)](_0xa0ed5)&&_0xa0ed5>0x0?_0xa0ed5:undefined;if(typeof _0xa0ed5!==_0x1f3ef1(0x190)||!/^\d+$/[_0x1f3ef1(0x18e)](_0xa0ed5))return undefined;const _0x11f18=Number(_0xa0ed5);return Number[_0x1f3ef1(0x191)](_0x11f18)&&_0x11f18>0x0?_0x11f18:undefined;}
1
+ export function normalizePositiveSafeInteger(value){if(typeof value==="number"){return Number.isSafeInteger(value)&&value>0?value:undefined}if(typeof value!=="string"||!/^\d+$/.test(value)){return undefined}const normalized=Number(value);return Number.isSafeInteger(normalized)&&normalized>0?normalized:undefined}
@@ -1 +1,2 @@
1
- const a186_0x2ae1ba=a186_0x2db4;function a186_0x582d(){const _0x542b80=['has','1097670BKqDlf','[REDACTED]','entries','12684Rifqqw','replace','204MHjJcb','isArray','map','1086645ttSwNq','11905536cabdNd','comment','2792396rcTbWv','object','689159bsQKcb','toLowerCase','variables','1201448nVgsbG'];a186_0x582d=function(){return _0x542b80;};return a186_0x582d();}(function(_0x396795,_0x18c276){const _0x15b306=a186_0x2db4,_0x5ec300=_0x396795();while(!![]){try{const _0x248694=parseInt(_0x15b306(0xfe))/0x1+-parseInt(_0x15b306(0x101))/0x2+-parseInt(_0x15b306(0x10b))/0x3+-parseInt(_0x15b306(0x10e))/0x4+-parseInt(_0x15b306(0x103))/0x5+parseInt(_0x15b306(0x108))/0x6*(parseInt(_0x15b306(0x106))/0x7)+parseInt(_0x15b306(0x10c))/0x8;if(_0x248694===_0x18c276)break;else _0x5ec300['push'](_0x5ec300['shift']());}catch(_0x41eb3c){_0x5ec300['push'](_0x5ec300['shift']());}}}(a186_0x582d,0x577f3));const REDACTED_VALUE=a186_0x2ae1ba(0x104),SENSITIVE_KEY_PATTERN=/(?:access.?key|api.?key|authorization|cookie|credential|password|passwd|private.?key|secret|token|webhook)/i,SENSITIVE_FLAG_NAMES=new Set([a186_0x2ae1ba(0x10d),a186_0x2ae1ba(0x100)]),SENSITIVE_VALUE_KEYS=new Set(['comment']);export function isSensitiveKey(_0x4bfb8b){const _0x31870c=a186_0x2ae1ba,_0x2fa71e=_0x4bfb8b[_0x31870c(0x107)](/_/g,'-')[_0x31870c(0xff)]();return SENSITIVE_KEY_PATTERN['test'](_0x2fa71e);}function a186_0x2db4(_0x2dd185,_0x28baf3){_0x2dd185=_0x2dd185-0xfd;const _0x582d63=a186_0x582d();let _0x2db4cd=_0x582d63[_0x2dd185];return _0x2db4cd;}export function isSensitiveFlagName(_0x5025fb){const _0x9bbe81=a186_0x2ae1ba,_0x348ae8=_0x5025fb[_0x9bbe81(0x107)](/_/g,'-')['toLowerCase']();return isSensitiveKey(_0x348ae8)||SENSITIVE_FLAG_NAMES['has'](_0x348ae8);}function redactVariableValues(_0x10a174){const _0x1ad153=a186_0x2ae1ba;if(Array[_0x1ad153(0x109)](_0x10a174))return _0x10a174[_0x1ad153(0x10a)](_0x5b9d61=>redactVariableValues(_0x5b9d61));if(_0x10a174&&typeof _0x10a174===_0x1ad153(0xfd))return Object['fromEntries'](Object[_0x1ad153(0x105)](_0x10a174)['map'](([_0x3a90f5,_0xf86f01])=>[_0x3a90f5,redactVariableValues(_0xf86f01)]));return REDACTED_VALUE;}export function redactSensitiveValue(_0x5c914e){const _0x4c77b0=a186_0x2ae1ba;if(Array['isArray'](_0x5c914e))return _0x5c914e[_0x4c77b0(0x10a)](_0x5cdcca=>redactSensitiveValue(_0x5cdcca));if(!_0x5c914e||typeof _0x5c914e!==_0x4c77b0(0xfd))return _0x5c914e;const _0x5492c7={};for(const [_0x131405,_0x2a1f85]of Object[_0x4c77b0(0x105)](_0x5c914e)){const _0x5f23f4=_0x131405[_0x4c77b0(0x107)](/_/g,'-')['toLowerCase']();_0x5492c7[_0x131405]=_0x5f23f4==='variables'?redactVariableValues(_0x2a1f85):SENSITIVE_VALUE_KEYS[_0x4c77b0(0x102)](_0x5f23f4)||isSensitiveKey(_0x131405)?REDACTED_VALUE:redactSensitiveValue(_0x2a1f85);}return _0x5492c7;}export function redactCommandArgv(_0x585d8b){const _0x1ab7dd=[];let _0x45c667=![];for(const _0x923992 of _0x585d8b){if(_0x45c667){_0x1ab7dd['push'](REDACTED_VALUE),_0x45c667=![];continue;}const _0x5b5f4c=_0x923992['match'](/^--([^=]+)(?:=(.*))?$/);if(!_0x5b5f4c||!isSensitiveFlagName(_0x5b5f4c[0x1]??'')){_0x1ab7dd['push'](_0x923992);continue;}_0x1ab7dd['push']('--'+_0x5b5f4c[0x1]+(_0x5b5f4c[0x2]===undefined?'':'='+REDACTED_VALUE)),_0x5b5f4c[0x2]===undefined&&(_0x45c667=!![]);}return _0x1ab7dd;}export{REDACTED_VALUE};
1
+ const REDACTED_VALUE="[REDACTED]";const SENSITIVE_KEY_PATTERN=/(?:access.?key|api.?key|authorization|cookie|credential|password|passwd|private.?key|secret|token|webhook)/i;const SENSITIVE_FLAG_NAMES=new Set(["comment","variables"]);const SENSITIVE_VALUE_KEYS=new Set(["comment"]);export function isSensitiveKey(key){const normalized=key.replace(/_/g,"-").toLowerCase();return SENSITIVE_KEY_PATTERN.test(normalized)}export function isSensitiveFlagName(key){const normalized=key.replace(/_/g,"-").toLowerCase();return isSensitiveKey(normalized)||SENSITIVE_FLAG_NAMES.has(normalized)}function redactVariableValues(value){if(Array.isArray(value)){return value.map(item=>redactVariableValues(item))}if(value&&typeof value==="object"){return Object.fromEntries(Object.entries(value).map(([key,item])=>[key,redactVariableValues(item)]))}return REDACTED_VALUE}export function redactSensitiveValue(value){if(Array.isArray(value)){return value.map(item=>redactSensitiveValue(item))}
2
+ if(!value||typeof value!=="object"){return value}const output={};for(const[key,item]of Object.entries(value)){const normalized=key.replace(/_/g,"-").toLowerCase();output[key]=normalized==="variables"?redactVariableValues(item):SENSITIVE_VALUE_KEYS.has(normalized)||isSensitiveKey(key)?REDACTED_VALUE:redactSensitiveValue(item)}return output}export function redactCommandArgv(argv){const output=[];let redactNext=false;for(const token of argv){if(redactNext){output.push(REDACTED_VALUE);redactNext=false;continue}const match=token.match(/^--([^=]+)(?:=(.*))?$/);if(!match||!isSensitiveFlagName(match[1]??"")){output.push(token);continue}output.push(`--${match[1]}${match[2]===undefined?"":`=${REDACTED_VALUE}`}`);if(match[2]===undefined){redactNext=true}}return output}export{REDACTED_VALUE};
@@ -1 +1 @@
1
- function a187_0x1ed5(_0x3cc36d,_0x4ec1bb){_0x3cc36d=_0x3cc36d-0x166;const _0x55b9e8=a187_0x55b9();let _0x1ed5e1=_0x55b9e8[_0x3cc36d];return _0x1ed5e1;}function a187_0x55b9(){const _0x421a13=['977104lpGKsg','number','string','replace','isSafeInteger','10521710dsIVjf','514537AUitHL','2318bcFTtr','2870037SfJwvN','test','319430uTJMuk','2872KzaPtZ','1011NbgdIZ','24rWGKXu','5383EnZWDj'];a187_0x55b9=function(){return _0x421a13;};return a187_0x55b9();}(function(_0x11634d,_0x1603d0){const _0x42bec9=a187_0x1ed5,_0x2a59fc=_0x11634d();while(!![]){try{const _0x6b3262=parseInt(_0x42bec9(0x171))/0x1+-parseInt(_0x42bec9(0x172))/0x2*(-parseInt(_0x42bec9(0x168))/0x3)+parseInt(_0x42bec9(0x16b))/0x4+parseInt(_0x42bec9(0x166))/0x5*(parseInt(_0x42bec9(0x169))/0x6)+parseInt(_0x42bec9(0x16a))/0x7*(parseInt(_0x42bec9(0x167))/0x8)+-parseInt(_0x42bec9(0x173))/0x9+-parseInt(_0x42bec9(0x170))/0xa;if(_0x6b3262===_0x1603d0)break;else _0x2a59fc['push'](_0x2a59fc['shift']());}catch(_0x481925){_0x2a59fc['push'](_0x2a59fc['shift']());}}}(a187_0x55b9,0x4babb));export function normalizeRuntimeUserId(_0x2d20f9){const _0x5b03f7=a187_0x1ed5;if(typeof _0x2d20f9===_0x5b03f7(0x16c))return Number[_0x5b03f7(0x16f)](_0x2d20f9)&&_0x2d20f9>0x0?String(_0x2d20f9):undefined;if(typeof _0x2d20f9!==_0x5b03f7(0x16d)||!/^\d+$/[_0x5b03f7(0x174)](_0x2d20f9))return undefined;const _0x590955=_0x2d20f9[_0x5b03f7(0x16e)](/^0+/,'');return _0x590955||undefined;}
1
+ export function normalizeRuntimeUserId(value){if(typeof value==="number"){return Number.isSafeInteger(value)&&value>0?String(value):undefined}if(typeof value!=="string"||!/^\d+$/.test(value))return undefined;const normalized=value.replace(/^0+/,"");return normalized||undefined}
@@ -1 +1,3 @@
1
- (function(_0xf4f4b8,_0x5a770b){const _0xe6ad0a=a188_0x3302,_0x42c767=_0xf4f4b8();while(!![]){try{const _0x12c1e0=parseInt(_0xe6ad0a(0x15e))/0x1+-parseInt(_0xe6ad0a(0x162))/0x2*(parseInt(_0xe6ad0a(0x15b))/0x3)+-parseInt(_0xe6ad0a(0x14d))/0x4*(parseInt(_0xe6ad0a(0x157))/0x5)+-parseInt(_0xe6ad0a(0x150))/0x6+parseInt(_0xe6ad0a(0x15a))/0x7*(parseInt(_0xe6ad0a(0x15c))/0x8)+-parseInt(_0xe6ad0a(0x14f))/0x9+parseInt(_0xe6ad0a(0x158))/0xa;if(_0x12c1e0===_0x5a770b)break;else _0x42c767['push'](_0x42c767['shift']());}catch(_0x29564e){_0x42c767['push'](_0x42c767['shift']());}}}(a188_0x5d1c,0xdb7f7));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a188_0x3302(_0x21e93e,_0x4f6663){_0x21e93e=_0x21e93e-0x147;const _0x5d1c8e=a188_0x5d1c();let _0x3302d3=_0x5d1c8e[_0x21e93e];return _0x3302d3;}import{checkCliVersion,getCliUpgradeCommand}from'../utils/cli-version-check.js';const UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x29b402=a188_0x3302,_0x41537a=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x29b402(0x160)]()['toLowerCase']();return _0x41537a==='1'||_0x41537a===_0x29b402(0x147)||_0x41537a===_0x29b402(0x15f);}function cacheRoot(){const _0x2149f7=a188_0x3302;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x2149f7(0x148));}function a188_0x5d1c(){const _0x246340=['needsUpgrade','11974968bjEXmz','9404124TTFGAN','/v/','now','upgradeMessage','lastNotifiedVersion','join','currentVersion','155vFRxmE','51559340jxbaDw','lovrabet-cli','420mRzSst','26577rxvNsh','56504gwNJBb','number','90447NnFQVK','yes','trim','parse','314JmyxJB','update-check.json','filter','true','.cache','lastNotifiedAt','\x20is\x20recommended,\x20current\x20','stableVersion','utf8','62236VulqLN'];a188_0x5d1c=function(){return _0x246340;};return a188_0x5d1c();}export function getUpdateNoticeCachePath(){const _0xe82b5d=a188_0x3302;return join(cacheRoot(),_0xe82b5d(0x159),_0xe82b5d(0x163));}async function readUpdateNoticeCache(){const _0x127640=a188_0x3302;try{const _0x236849=await readFile(getUpdateNoticeCachePath(),_0x127640(0x14c)),_0x90db9a=JSON[_0x127640(0x161)](_0x236849);if(!_0x90db9a||typeof _0x90db9a!=='object')return{};return _0x90db9a;}catch{return{};}}async function writeUpdateNoticeCache(_0x2eaef4){const _0x19c919=a188_0x3302;try{const _0x579b8a=getUpdateNoticeCachePath();await mkdir(dirname(_0x579b8a),{'recursive':!![]}),await writeFile(_0x579b8a,JSON['stringify'](_0x2eaef4,null,0x2)+'\x0a',_0x19c919(0x14c));}catch{}}function isRecentlyNotified(_0x4f4b2f,_0xb57c82,_0x4aeffe){const _0x429b56=a188_0x3302;return _0x4f4b2f[_0x429b56(0x154)]===_0xb57c82&&typeof _0x4f4b2f[_0x429b56(0x149)]===_0x429b56(0x15d)&&_0x4aeffe-_0x4f4b2f[_0x429b56(0x149)]<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0x429385){const _0x451824=a188_0x3302;return'https://www.npmjs.com/package/'+LOVRABET_NPM_PACKAGE_NAME+_0x451824(0x151)+_0x429385;}export async function resolveLatestUpdateNotice(_0x2956a5){const _0x4b9885=a188_0x3302;if(isUpdateNoticeDisabled())return null;try{const _0x463707=Date[_0x4b9885(0x152)](),_0x36d095=_0x2956a5??await checkCliVersion(),_0x2b9aa4=_0x36d095[_0x4b9885(0x156)],_0x152569=_0x36d095[_0x4b9885(0x14b)],_0x26c7a7=await readUpdateNoticeCache();if(!_0x152569||!_0x36d095[_0x4b9885(0x14e)]||_0x36d095['belowMinimum'])return null;if(isRecentlyNotified(_0x26c7a7,_0x152569,_0x463707))return null;const _0x4ee354=getCliUpgradeCommand(_0x36d095);return await writeUpdateNoticeCache({..._0x26c7a7,'checkedAt':_0x463707,'latest':_0x152569,'failed':![],'lastNotifiedVersion':_0x152569,'lastNotifiedAt':_0x463707}),{'command':_0x4ee354,'current':_0x2b9aa4,'latest':_0x152569,'url':buildNpmVersionUrl(_0x152569),'message':[_0x36d095[_0x4b9885(0x153)],CLI_BIN_NAME+'\x20'+_0x152569+_0x4b9885(0x14a)+_0x2b9aa4+',\x20run:\x20'+_0x4ee354][_0x4b9885(0x164)](Boolean)[_0x4b9885(0x155)]('\x20')};}catch{return null;}}
1
+ import{mkdir,readFile,writeFile}from"node:fs/promises";import{homedir}from"node:os";import{dirname,join}from"node:path";import{LOVRABET_NPM_PACKAGE_NAME}from"../constant/distribution.js";import{CLI_BIN_NAME}from"../constant/cli.js";import{checkCliVersion,getCliUpgradeCommand}from"../utils/cli-version-check.js";const UPDATE_NOTICE_TTL_MS=24*60*60*1e3;function isUpdateNoticeDisabled(){const raw=process.env.LOVRABET_NO_UPDATE_NOTICE?.trim().toLowerCase();return raw==="1"||raw==="true"||raw==="yes"}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),".cache")}export function getUpdateNoticeCachePath(){return join(cacheRoot(),"lovrabet-cli","update-check.json")}async function readUpdateNoticeCache(){try{const content=await readFile(getUpdateNoticeCachePath(),"utf8");const parsed=JSON.parse(content);if(!parsed||typeof parsed!=="object")return{};return parsed}catch{return{}}}async function writeUpdateNoticeCache(cache){try{
2
+ const file=getUpdateNoticeCachePath();await mkdir(dirname(file),{recursive:true});await writeFile(file,`${JSON.stringify(cache,null,2)}\n`,"utf8")}catch{}}function isRecentlyNotified(cache,latest,now){return cache.lastNotifiedVersion===latest&&typeof cache.lastNotifiedAt==="number"&&now-cache.lastNotifiedAt<UPDATE_NOTICE_TTL_MS}export function buildNpmVersionUrl(version){return`https://www.npmjs.com/package/${LOVRABET_NPM_PACKAGE_NAME}/v/${version}`}export async function resolveLatestUpdateNotice(checked){if(isUpdateNoticeDisabled())return null;try{const now=Date.now();const result=checked??await checkCliVersion();const current=result.currentVersion;const latest=result.stableVersion;const cache=await readUpdateNoticeCache();if(!latest||!result.needsUpgrade||result.belowMinimum)return null;if(isRecentlyNotified(cache,latest,now))return null;const command=getCliUpgradeCommand(result);await writeUpdateNoticeCache({...cache,checkedAt:now,latest:latest,failed:false,
3
+ lastNotifiedVersion:latest,lastNotifiedAt:now});return{command:command,current:current,latest:latest,url:buildNpmVersionUrl(latest),message:[result.upgradeMessage,`${CLI_BIN_NAME} ${latest} is recommended, current ${current}, run: ${command}`].filter(Boolean).join(" ")}}catch{return null}}
@@ -1 +1 @@
1
- (function(_0x49297a,_0x105dba){const _0x12a946=a189_0x4faa,_0x40df8e=_0x49297a();while(!![]){try{const _0x120436=parseInt(_0x12a946(0xc5))/0x1+parseInt(_0x12a946(0xc1))/0x2+parseInt(_0x12a946(0xc2))/0x3*(parseInt(_0x12a946(0xc4))/0x4)+-parseInt(_0x12a946(0xc3))/0x5+parseInt(_0x12a946(0xc8))/0x6+-parseInt(_0x12a946(0xc7))/0x7+parseInt(_0x12a946(0xc0))/0x8;if(_0x120436===_0x105dba)break;else _0x40df8e['push'](_0x40df8e['shift']());}catch(_0x56019c){_0x40df8e['push'](_0x40df8e['shift']());}}}(a189_0x1165,0x75623));import{BUILD_TIME,GIT_COMMIT,VERSION}from'../generated/build-info.js';function a189_0x4faa(_0x47a063,_0x581764){_0x47a063=_0x47a063-0xbf;const _0x11652b=a189_0x1165();let _0x4faa35=_0x11652b[_0x47a063];return _0x4faa35;}export function getCliVersion(){return VERSION;}function a189_0x1165(){const _0x4ab08d=['6882832bqBLEz','614582CihCme','495543QrFOuL','3573650WcMyLW','4GeipOf','1996aQKUDx','unknown','1240911mobNxT','227904ZLmcAY','slice'];a189_0x1165=function(){return _0x4ab08d;};return a189_0x1165();}export function getCliGitCommit(){const _0x3f4556=a189_0x4faa,_0x2e7f63=String(GIT_COMMIT);return _0x2e7f63&&_0x2e7f63!==_0x3f4556(0xc6)?_0x2e7f63:'';}export function getCliVersionDisplay(){const _0x2728db=a189_0x4faa,_0x376009=getCliGitCommit(),_0x442d2d=BUILD_TIME[_0x2728db(0xbf)](0x0,0xa);if(!_0x376009||!_0x442d2d)return VERSION;return VERSION+'\x20('+_0x376009+',\x20'+_0x442d2d+')';}
1
+ import{BUILD_TIME,GIT_COMMIT,VERSION}from"../generated/build-info.js";export function getCliVersion(){return VERSION}export function getCliGitCommit(){const gitCommit=String(GIT_COMMIT);return gitCommit&&gitCommit!=="unknown"?gitCommit:""}export function getCliVersionDisplay(){const gitCommit=getCliGitCommit();const buildDate=BUILD_TIME.slice(0,10);if(!gitCommit||!buildDate)return VERSION;return`${VERSION} (${gitCommit}, ${buildDate})`}
@@ -1 +1 @@
1
- (function(_0x4c0837,_0x372e00){var _0x3bb5b7=a190_0x24b9,_0x43c13c=_0x4c0837();while(!![]){try{var _0x289e8a=parseInt(_0x3bb5b7(0xd1))/0x1*(-parseInt(_0x3bb5b7(0xdb))/0x2)+-parseInt(_0x3bb5b7(0xd4))/0x3+parseInt(_0x3bb5b7(0xda))/0x4+-parseInt(_0x3bb5b7(0xdc))/0x5*(parseInt(_0x3bb5b7(0xd8))/0x6)+-parseInt(_0x3bb5b7(0xd6))/0x7+parseInt(_0x3bb5b7(0xd9))/0x8*(parseInt(_0x3bb5b7(0xd2))/0x9)+parseInt(_0x3bb5b7(0xd7))/0xa;if(_0x289e8a===_0x372e00)break;else _0x43c13c['push'](_0x43c13c['shift']());}catch(_0x517330){_0x43c13c['push'](_0x43c13c['shift']());}}}(a190_0x3dec,0xde010));function a190_0x24b9(_0x1b86f4,_0x260eac){_0x1b86f4=_0x1b86f4-0xd1;var _0x3dec7f=a190_0x3dec();var _0x24b972=_0x3dec7f[_0x1b86f4];return _0x24b972;}function a190_0x3dec(){var _0xa5a3fc=['1cbgJSn','45chjhXs','stderr','3163509JnJIju','write','8741810wwkKYj','9530310sePNmB','72492oXQeMJ','2894712TpgwXs','2669544wQSdEj','264754EvxCGY','35tcRwpe'];a190_0x3dec=function(){return _0xa5a3fc;};return a190_0x3dec();}export function writeCliSideChannelLine(_0x5ed574){var _0x202c3f=a190_0x24b9;process[_0x202c3f(0xd3)][_0x202c3f(0xd5)](_0x5ed574+'\x0a');}
1
+ export function writeCliSideChannelLine(line){process.stderr.write(`${line}\n`)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/lovrabet-cli",
3
- "version": "2.3.13-beta.1",
3
+ "version": "2.4.0-beta.2",
4
4
  "description": "Runtime CLI for Lovrabet apps, datasets, SQL, Backend Function, skills, and AI agent workflows.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "scripts": {
43
43
  "prebuild": "node scripts/generate-build-info.js && node scripts/generate-builtin-skill-manifest.mjs --check",
44
- "build": "rimraf lib && tsc && tsc-alias && javascript-obfuscator lib --output lib && node scripts/ensure-bin-executable.mjs",
44
+ "build": "node scripts/clean-build-output.mjs && tsc && tsc-alias && node scripts/minify-build-output.mjs && node scripts/ensure-bin-executable.mjs",
45
45
  "prebuild:dev": "node scripts/generate-build-info.js",
46
- "build:dev": "rimraf lib && tsc && tsc-alias && node scripts/ensure-bin-executable.mjs",
46
+ "build:dev": "node scripts/clean-build-output.mjs && tsc && tsc-alias && node scripts/ensure-bin-executable.mjs",
47
47
  "prestart": "node scripts/generate-build-info.js",
48
48
  "start": "tsc --watch",
49
49
  "pretypecheck": "node scripts/generate-build-info.js",
@@ -63,7 +63,6 @@
63
63
  "check:skill-version": "node scripts/check-skill-version.mjs",
64
64
  "generate:builtin-skill-manifest": "node scripts/generate-builtin-skill-manifest.mjs",
65
65
  "check:builtin-skill-manifest": "node scripts/generate-builtin-skill-manifest.mjs --check",
66
- "postinstall": "node scripts/postinstall.mjs",
67
66
  "ci": "npm run typecheck && npm run check:skill-version && npm run check:lockfile && npm run build",
68
67
  "pretest": "node scripts/generate-build-info.js",
69
68
  "test": "vitest run",
@@ -79,7 +78,6 @@
79
78
  "skills/lovrabet",
80
79
  "skills/lovrabet-report-generation",
81
80
  "skills/lovrabet.manifest.json",
82
- "scripts/postinstall.mjs",
83
81
  "README.md",
84
82
  "LICENSE",
85
83
  "NOTICE"
@@ -106,6 +104,7 @@
106
104
  "react": "^19.2.0",
107
105
  "saxes": "6.0.0",
108
106
  "semver": "^7.7.3",
107
+ "skills": "1.8.1",
109
108
  "winston": "^3.17.0",
110
109
  "ws": "8.20.1",
111
110
  "yaml": "^2.9.0",
@@ -118,8 +117,7 @@
118
117
  "@types/semver": "^7.7.1",
119
118
  "@types/yauzl": "2.10.3",
120
119
  "@vitest/coverage-v8": "^4.1.2",
121
- "javascript-obfuscator": "^5.4.1",
122
- "rimraf": "^6.1.3",
120
+ "terser": "5.51.2",
123
121
  "tsc-alias": "^1.8.10",
124
122
  "typescript": "5.9.3",
125
123
  "vitest": "^4.1.2",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lovrabet
3
3
  displayName: Lovrabet 运行态 CLI
4
- version: 2.3.13-beta.1
4
+ version: 2.4.0-beta.2
5
5
  description: "Lovrabet 运行态 CLI — 面向业务场景的 AI 操作套件,通过 lovrabet 命令管理应用目录、业务角色与权限、用户级外部账号、API 文档发现、数据集查询、Instant API 数据操作、可恢复 Excel 导入、Custom SQL/Backend Function、Personal Backend Function、文件上传、面向票证类业务材料文字与结构化字段提取的 OCR、审批待办与任务办理、定时任务、Skill、知识库与运行态 app-config key 状态检查。触发词:云图、lovrabet、lovrabet-cli、指标查询、统计口径、经营报告、业务角色、角色成员、页面权限、菜单权限、数据集权限、user-account bind、provider 外部账号绑定、钉钉 userId 绑定、api-doc、dataset、data filter、Excel 导入、data import-excel、file upload、file query-url、ocr recognize、OCR 识别、票证文字提取、票证字段提取、发票识别、票据识别、证照识别、附件上传、personal-bff、approval、审批、待办、approve、reject、transfer、schedule、定时任务、cron、kb、skill、sql exec、bff exec、app-config、accessKey、compress、jq。"
6
6
  metadata:
7
7
  requires:
@@ -53,7 +53,7 @@ metadata:
53
53
  npm install -g @lovrabet/lovrabet-cli
54
54
  ```
55
55
 
56
- npm 包会自动安装同版本 Built-in Skill。若 `lovrabet doctor` 报告缺失、版本不一致或内容不一致,先处理提示的网络/权限问题,再执行 `lovrabet cli-skill install` 从当前 npm 包内修复。详见 [CLI 更新](references/lovrabet-update.md) 与 [诊断](references/lovrabet-doctor.md)。
56
+ npm 包携带同版本 Built-in Skill;首次 npm 安装后必须执行 `lovrabet cli-skill install` 显式安装。若 `lovrabet doctor` 报告缺失、版本不一致或内容不一致,先处理提示的网络/权限问题,再执行 `lovrabet cli-skill install` 从当前 npm 包内修复。详见 [CLI 更新](references/lovrabet-update.md) 与 [诊断](references/lovrabet-doctor.md)。
57
57
 
58
58
  ## 认证
59
59
 
@@ -311,7 +311,7 @@ npm 包会自动安装同版本 Built-in Skill。若 `lovrabet doctor` 报告缺
311
311
 
312
312
  ### CLI 更新
313
313
 
314
- `lovrabet update` 只查询 npm package 的 dist-tags,不依赖 CDN 文件。默认等价于 `--latest`;`--beta` 使用 npm `beta` dist-tag;`--version <version>` 安装指定 semver。CLI 与 Built-in Skill 一体升级,不提供拆分升级选项;升级后由当前进程验证新版 npm 包的安装结果,同版本检查则直接从当前包内修复。
314
+ `lovrabet update` 只查询 npm package 的 dist-tags,不依赖 CDN 文件。默认等价于 `--latest`;`--beta` 使用 npm `beta` dist-tag;`--version <version>` 安装指定 semver。CLI 与 Built-in Skill 一体升级,不提供拆分升级选项;升级后启动新版 CLI 的显式安装命令并验证 Skill 版本及内容摘要,同版本检查则直接从当前包内修复。
315
315
 
316
316
  开源二开配置集中在项目代码的 `src/constant/product.ts`,`src/constant/distribution.ts` 只做兼容导出:
317
317
 
@@ -25,7 +25,7 @@ lovrabet skill install --project
25
25
 
26
26
  ## CLI Built-in Skill
27
27
 
28
- `lovrabet skill install` 仅安装当前应用的业务 Skill。CLI Built-in Skill 已包含在当前 npm 包内,并在安装或升级 CLI 时自动安装。诊断显示缺失、版本不一致或内容不一致时,使用当前包内的确定版本修复:
28
+ `lovrabet skill install` 仅安装当前应用的业务 Skill。CLI Built-in Skill 已包含在当前 npm 包内,首次 npm 安装后须显式安装;`lovrabet update` 会显式调用新版安装器并验证同版本内容。诊断显示缺失、版本不一致或内容不一致时,使用当前包内的确定版本修复:
29
29
 
30
30
  ```bash
31
31
  lovrabet cli-skill install
@@ -19,8 +19,8 @@ lovrabet update --version <version>
19
19
 
20
20
  ## 行为
21
21
 
22
- - npm 安装包携带同版本 Built-in Skill,安装阶段自动完成 Agent Skill 安装。
23
- - CLI 升级成功后,旧进程只验证目标版本 Skill 是否已安装,不使用旧包内容重复覆盖。
22
+ - npm 安装包携带同版本 Built-in Skill,首次 npm 安装后须显式执行 `lovrabet cli-skill install`。
23
+ - CLI 包升级后,按绝对路径启动新版 CLI 的 `cli-skill install`,验证新包版本及 Skill 内容摘要,通过后才报告成功。
24
24
  - CLI 已经是目标版本时,命令从当前 npm 包内检查并修复 Built-in Skill。
25
25
  - Skill 缺失、版本不一致或验证失败时,命令返回失败并提示 `lovrabet cli-skill install`;不要把“CLI 包已更新”误报为完整成功。
26
26
  - `lovrabet skill install` 仍只管理当前应用的业务 Skill,与 Built-in Skill 生命周期相互独立。
@@ -28,7 +28,9 @@ lovrabet update --version <version>
28
28
  手动复现或修复 npm 安装问题时,可以使用:
29
29
 
30
30
  ```bash
31
- npm install -g @lovrabet/lovrabet-cli@<version>
32
- lovrabet doctor
31
+ npm install -g @lovrabet/lovrabet-cli@<version> --ignore-scripts
33
32
  lovrabet cli-skill install
33
+ lovrabet doctor
34
34
  ```
35
+
36
+ Skill 安装失败时 CLI 包可能已更新,不自动回滚;修复成功前不能报告完整升级成功。
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lovrabet-report-generation
3
3
  displayName: 业务报告与分析
4
- version: 2.3.13-beta.1
4
+ version: 2.4.0-beta.2
5
5
  description: "Use when 用户需要日报、周报、经营汇总、指标比较、综合分析,修改已有报告,或根据已提供的上下文补齐报告。完整匹配的企业业务 Skill 可直接使用;单值或身份查询不强制生成报告。不用于开发发布指标或修改业务数据。"
6
6
  example: "帮我整理昨天各门店的经营情况。"
7
7
  metadata:
@@ -2,8 +2,8 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "lovrabet",
4
4
  "packageName": "@lovrabet/lovrabet-cli",
5
- "packageVersion": "2.3.13-beta.1",
6
- "skillVersion": "2.3.13-beta.1",
5
+ "packageVersion": "2.4.0-beta.2",
6
+ "skillVersion": "2.4.0-beta.2",
7
7
  "files": [
8
8
  "SKILL.md",
9
9
  "guides/app-resolution.md",
@@ -43,5 +43,5 @@
43
43
  "references/lovrabet-user-account.md",
44
44
  "references/lovrabet-workspace.md"
45
45
  ],
46
- "digest": "0bf69b7556919a6e61a58974dc863f66c5bd01390be0dbdfd6afa8a7f3a2f6e5"
46
+ "digest": "e888e18c4ddce0067ce95f9fc112ace1ffb40fca962bb6865c7c5972ad4609f6"
47
47
  }
@@ -1,2 +0,0 @@
1
- import { type BuiltinSkillInstallResult, type BuiltinSkillOptions } from "./skills/builtin-skill.js";
2
- export declare function runPostinstall(options?: BuiltinSkillOptions): Promise<BuiltinSkillInstallResult>;
@@ -1 +0,0 @@
1
- (function(_0x569abf,_0x213224){const _0x2a7d7e=a143_0x280f,_0x946469=_0x569abf();while(!![]){try{const _0x23fdf4=parseInt(_0x2a7d7e(0x159))/0x1+-parseInt(_0x2a7d7e(0x153))/0x2+parseInt(_0x2a7d7e(0x161))/0x3+-parseInt(_0x2a7d7e(0x150))/0x4*(-parseInt(_0x2a7d7e(0x15c))/0x5)+-parseInt(_0x2a7d7e(0x156))/0x6*(parseInt(_0x2a7d7e(0x157))/0x7)+parseInt(_0x2a7d7e(0x163))/0x8+-parseInt(_0x2a7d7e(0x165))/0x9*(-parseInt(_0x2a7d7e(0x15e))/0xa);if(_0x23fdf4===_0x213224)break;else _0x946469['push'](_0x946469['shift']());}catch(_0x25bb20){_0x946469['push'](_0x946469['shift']());}}}(a143_0x13c5,0xcf3bc));import{installBuiltinSkill}from'./skills/builtin-skill.js';function a143_0x13c5(){const _0x26c752=['2760046xiEQfA','\x20via\x20skills@latest','Lovrabet\x20Built-in\x20Skill\x20','6xuVaiI','6080634Rvrskp','installedPath','896254XkGfCU','Repair\x20with:\x20','SOURCE_INVALID','6700GDRWBd','repairCommand','1030UaikMK','log','installed','2258508hVtSUF','warn','1965168XhPkIB','[BUILTIN_SKILL_INSTALL_','27351hJDKYK','\x20at\x20','FAILED','skillVersion','2656hwrXiE','code','changed'];a143_0x13c5=function(){return _0x26c752;};return a143_0x13c5();}function a143_0x280f(_0x12cfd2,_0x4f18ab){_0x12cfd2=_0x12cfd2-0x14d;const _0x13c50d=a143_0x13c5();let _0x280ff2=_0x13c50d[_0x12cfd2];return _0x280ff2;}export async function runPostinstall(_0xbc7a24={}){const _0x4f2eb5=a143_0x280f,_0x5b7582=installBuiltinSkill(_0xbc7a24);if(_0x5b7582['ok']){const _0x78b512=_0x5b7582[_0x4f2eb5(0x152)]?_0x4f2eb5(0x160):'already\x20current',_0x54dd19=_0x5b7582[_0x4f2eb5(0x158)]?_0x4f2eb5(0x14d)+_0x5b7582[_0x4f2eb5(0x158)]:_0x4f2eb5(0x154);return console[_0x4f2eb5(0x15f)](_0x4f2eb5(0x155)+_0x5b7582[_0x4f2eb5(0x14f)]+'\x20'+_0x78b512+_0x54dd19),_0x5b7582;}const _0x75b147=_0x4f2eb5(0x164)+(_0x5b7582[_0x4f2eb5(0x151)]??_0x4f2eb5(0x14e))+']\x20'+(_0x5b7582['error']??'Installation\x20failed')+'.\x20'+(_0x4f2eb5(0x15a)+_0x5b7582[_0x4f2eb5(0x15d)]);if(_0x5b7582[_0x4f2eb5(0x151)]===_0x4f2eb5(0x15b))throw new Error(_0x75b147);return console[_0x4f2eb5(0x162)](_0x75b147),_0x5b7582;}
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env node
2
- import { existsSync } from "node:fs";
3
- import { dirname, join, resolve } from "node:path";
4
- import { fileURLToPath, pathToFileURL } from "node:url";
5
-
6
- const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
7
- const entry = join(root, "lib", "postinstall.js");
8
-
9
- if (!existsSync(entry)) {
10
- if (existsSync(join(root, "src", "postinstall.ts"))) {
11
- console.log("Skipping Lovrabet Built-in Skill postinstall in an unbuilt source checkout.");
12
- } else {
13
- console.error("[BUILTIN_SKILL_INSTALL_SOURCE_MISSING] Missing lib/postinstall.js");
14
- process.exitCode = 1;
15
- }
16
- } else {
17
- try {
18
- const { runPostinstall } = await import(pathToFileURL(entry).href);
19
- await runPostinstall();
20
- } catch (error) {
21
- console.error(error instanceof Error ? error.message : String(error));
22
- process.exitCode = 1;
23
- }
24
- }