@lovrabet/lovrabet-cli 2.1.17 → 2.1.18-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 (252) hide show
  1. package/lib/cli.d.ts +21 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.d.ts +38 -0
  4. package/lib/commands/api-doc/index.js +1 -1
  5. package/lib/commands/app/cache.d.ts +61 -0
  6. package/lib/commands/app/cache.js +1 -1
  7. package/lib/commands/app/definitions.d.ts +26 -0
  8. package/lib/commands/app/definitions.js +1 -1
  9. package/lib/commands/app/eligibility.d.ts +16 -0
  10. package/lib/commands/app/eligibility.js +1 -1
  11. package/lib/commands/app/mock-loader.d.ts +41 -0
  12. package/lib/commands/app/mock-loader.js +1 -1
  13. package/lib/commands/app/remote-source.d.ts +66 -0
  14. package/lib/commands/app/remote-source.js +1 -1
  15. package/lib/commands/app/shared.d.ts +38 -0
  16. package/lib/commands/app/shared.js +1 -1
  17. package/lib/commands/app-config/get.d.ts +2 -0
  18. package/lib/commands/app-config/get.js +1 -1
  19. package/lib/commands/app-config/index.d.ts +2 -0
  20. package/lib/commands/app-config/index.js +1 -1
  21. package/lib/commands/artifact/index.d.ts +9 -0
  22. package/lib/commands/artifact/index.js +1 -1
  23. package/lib/commands/auth/device.d.ts +31 -0
  24. package/lib/commands/auth/device.js +1 -1
  25. package/lib/commands/auth/index.d.ts +23 -0
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/auth/prompt.d.ts +33 -0
  28. package/lib/commands/auth/prompt.js +1 -1
  29. package/lib/commands/bff/detail.d.ts +8 -0
  30. package/lib/commands/bff/detail.js +1 -1
  31. package/lib/commands/bff/exec.d.ts +19 -0
  32. package/lib/commands/bff/exec.js +1 -1
  33. package/lib/commands/bff/index.d.ts +15 -0
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/cli-skill/index.d.ts +9 -0
  36. package/lib/commands/cli-skill/index.js +1 -1
  37. package/lib/commands/common/config-policy.d.ts +80 -0
  38. package/lib/commands/common/config-policy.js +1 -1
  39. package/lib/commands/common/constraints.d.ts +67 -0
  40. package/lib/commands/common/constraints.js +1 -1
  41. package/lib/commands/common/flags.d.ts +41 -0
  42. package/lib/commands/common/flags.js +1 -1
  43. package/lib/commands/common/local-file.d.ts +6 -0
  44. package/lib/commands/common/local-file.js +1 -1
  45. package/lib/commands/config/definitions.d.ts +21 -0
  46. package/lib/commands/config/definitions.js +1 -1
  47. package/lib/commands/config/shared.d.ts +17 -0
  48. package/lib/commands/config/shared.js +1 -1
  49. package/lib/commands/data/index.d.ts +27 -0
  50. package/lib/commands/data/index.js +1 -1
  51. package/lib/commands/dataset/detail.d.ts +26 -0
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.d.ts +10 -0
  54. package/lib/commands/dataset/index.js +1 -1
  55. package/lib/commands/dataset/list.d.ts +18 -0
  56. package/lib/commands/dataset/list.js +1 -1
  57. package/lib/commands/dataset/sdk-doc.d.ts +6 -0
  58. package/lib/commands/dataset/sdk-doc.js +1 -1
  59. package/lib/commands/doctor.d.ts +23 -0
  60. package/lib/commands/doctor.js +1 -1
  61. package/lib/commands/file/index.d.ts +2 -0
  62. package/lib/commands/file/index.js +1 -1
  63. package/lib/commands/init.d.ts +32 -0
  64. package/lib/commands/init.js +1 -1
  65. package/lib/commands/kb/index.d.ts +8 -0
  66. package/lib/commands/kb/index.js +1 -1
  67. package/lib/commands/logs/index.d.ts +20 -0
  68. package/lib/commands/logs/index.js +1 -1
  69. package/lib/commands/ocr/index.d.ts +2 -0
  70. package/lib/commands/ocr/index.js +1 -1
  71. package/lib/commands/personal-bff/index.d.ts +5 -0
  72. package/lib/commands/personal-bff/index.js +1 -1
  73. package/lib/commands/registry.d.ts +56 -0
  74. package/lib/commands/registry.js +1 -1
  75. package/lib/commands/schedule/index.d.ts +2 -0
  76. package/lib/commands/schedule/index.js +1 -0
  77. package/lib/commands/schema.d.ts +18 -0
  78. package/lib/commands/schema.js +1 -1
  79. package/lib/commands/service/dynamic.d.ts +18 -0
  80. package/lib/commands/service/dynamic.js +1 -1
  81. package/lib/commands/service/function-name-adapter.d.ts +13 -0
  82. package/lib/commands/service/function-name-adapter.js +1 -1
  83. package/lib/commands/service/index.d.ts +2 -0
  84. package/lib/commands/service/index.js +1 -1
  85. package/lib/commands/service/registry.d.ts +102 -0
  86. package/lib/commands/service/registry.js +1 -1
  87. package/lib/commands/skill/commands/create.d.ts +2 -0
  88. package/lib/commands/skill/commands/create.js +1 -1
  89. package/lib/commands/skill/commands/install.d.ts +2 -0
  90. package/lib/commands/skill/commands/install.js +1 -1
  91. package/lib/commands/skill/commands/list.d.ts +2 -0
  92. package/lib/commands/skill/commands/list.js +1 -1
  93. package/lib/commands/skill/commands/push.d.ts +2 -0
  94. package/lib/commands/skill/commands/push.js +1 -1
  95. package/lib/commands/skill/commands/validate.d.ts +2 -0
  96. package/lib/commands/skill/commands/validate.js +1 -1
  97. package/lib/commands/skill/flags.d.ts +13 -0
  98. package/lib/commands/skill/flags.js +1 -1
  99. package/lib/commands/skill/index.d.ts +9 -0
  100. package/lib/commands/skill/index.js +1 -1
  101. package/lib/commands/skill/manifest-helpers.d.ts +5 -0
  102. package/lib/commands/skill/manifest-helpers.js +1 -1
  103. package/lib/commands/skill/push-execute.d.ts +49 -0
  104. package/lib/commands/skill/push-execute.js +1 -1
  105. package/lib/commands/skill/push-flow-helpers.d.ts +80 -0
  106. package/lib/commands/skill/push-flow-helpers.js +1 -1
  107. package/lib/commands/skill/push-retarget.d.ts +9 -0
  108. package/lib/commands/skill/push-retarget.js +1 -1
  109. package/lib/commands/skill/scopes.d.ts +13 -0
  110. package/lib/commands/skill/scopes.js +1 -1
  111. package/lib/commands/skill/summary.d.ts +6 -0
  112. package/lib/commands/skill/summary.js +1 -1
  113. package/lib/commands/skill/templates.d.ts +23 -0
  114. package/lib/commands/skill/templates.js +1 -1
  115. package/lib/commands/skill/validate.d.ts +20 -0
  116. package/lib/commands/skill/validate.js +1 -1
  117. package/lib/commands/sql/detail.d.ts +13 -0
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.d.ts +21 -0
  120. package/lib/commands/sql/exec.js +1 -1
  121. package/lib/commands/sql/index.d.ts +9 -0
  122. package/lib/commands/sql/index.js +1 -1
  123. package/lib/commands/update.d.ts +10 -0
  124. package/lib/commands/update.js +1 -1
  125. package/lib/commands/workspace/index.d.ts +10 -0
  126. package/lib/commands/workspace/index.js +1 -1
  127. package/lib/config/schema.d.ts +108 -0
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/app.d.ts +13 -0
  130. package/lib/constant/app.js +1 -1
  131. package/lib/constant/auth-mode.d.ts +28 -0
  132. package/lib/constant/auth-mode.js +1 -1
  133. package/lib/constant/cli.d.ts +86 -0
  134. package/lib/constant/cli.js +1 -1
  135. package/lib/constant/defaults.d.ts +45 -0
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/distribution.d.ts +12 -0
  138. package/lib/constant/distribution.js +1 -1
  139. package/lib/constant/domain.d.ts +57 -0
  140. package/lib/constant/domain.js +1 -1
  141. package/lib/constant/env.d.ts +56 -0
  142. package/lib/constant/env.js +1 -1
  143. package/lib/constant/output.d.ts +13 -0
  144. package/lib/constant/output.js +1 -1
  145. package/lib/constant/product.d.ts +79 -0
  146. package/lib/constant/product.js +1 -1
  147. package/lib/constant/risk.d.ts +14 -0
  148. package/lib/constant/risk.js +1 -1
  149. package/lib/constant/url.d.ts +14 -0
  150. package/lib/constant/url.js +1 -1
  151. package/lib/context.d.ts +287 -0
  152. package/lib/context.js +1 -1
  153. package/lib/core/api-client.d.ts +451 -0
  154. package/lib/core/api-client.js +1 -1
  155. package/lib/core/db-resolver.d.ts +39 -0
  156. package/lib/core/db-resolver.js +1 -1
  157. package/lib/core/sdk-client.d.ts +62 -0
  158. package/lib/core/sdk-client.js +1 -1
  159. package/lib/errors.d.ts +25 -0
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.d.ts +24 -0
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/dryrun.d.ts +64 -0
  164. package/lib/framework/dryrun.js +1 -1
  165. package/lib/framework/flags.d.ts +19 -0
  166. package/lib/framework/flags.js +1 -1
  167. package/lib/framework/help.d.ts +21 -0
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.d.ts +10 -0
  170. package/lib/framework/index.js +1 -1
  171. package/lib/framework/output.d.ts +10 -0
  172. package/lib/framework/output.js +1 -1
  173. package/lib/framework/preparse.d.ts +64 -0
  174. package/lib/framework/preparse.js +1 -1
  175. package/lib/framework/rate-limit.d.ts +10 -0
  176. package/lib/framework/rate-limit.js +1 -1
  177. package/lib/framework/response.d.ts +10 -0
  178. package/lib/framework/response.js +1 -1
  179. package/lib/framework/runner-confirmation.d.ts +46 -0
  180. package/lib/framework/runner-confirmation.js +1 -1
  181. package/lib/framework/runner-error.d.ts +28 -0
  182. package/lib/framework/runner-error.js +1 -1
  183. package/lib/framework/runner.d.ts +102 -0
  184. package/lib/framework/runner.js +1 -1
  185. package/lib/framework/schema-export.d.ts +29 -0
  186. package/lib/framework/schema-export.js +1 -1
  187. package/lib/framework/service-order.d.ts +4 -0
  188. package/lib/framework/service-order.js +1 -1
  189. package/lib/framework/types.d.ts +108 -0
  190. package/lib/framework/types.js +1 -1
  191. package/lib/generated/build-info.d.ts +4 -0
  192. package/lib/generated/build-info.js +1 -1
  193. package/lib/help.d.ts +25 -0
  194. package/lib/help.js +1 -1
  195. package/lib/runtime/event.d.ts +16 -0
  196. package/lib/runtime/event.js +1 -0
  197. package/lib/runtime/index.d.ts +13 -0
  198. package/lib/runtime/index.js +1 -0
  199. package/lib/runtime/queue.d.ts +6 -0
  200. package/lib/runtime/queue.js +1 -0
  201. package/lib/runtime/resolve.d.ts +14 -0
  202. package/lib/runtime/resolve.js +1 -0
  203. package/lib/runtime/types.d.ts +59 -0
  204. package/lib/runtime/types.js +1 -0
  205. package/lib/skills/npx-skills-add.d.ts +42 -0
  206. package/lib/skills/npx-skills-add.js +1 -1
  207. package/lib/skills/runtime-skill-sync/constants.d.ts +4 -0
  208. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  209. package/lib/skills/runtime-skill-sync/fs-utils.d.ts +21 -0
  210. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  211. package/lib/skills/runtime-skill-sync/hashing.d.ts +9 -0
  212. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  213. package/lib/skills/runtime-skill-sync/links.d.ts +18 -0
  214. package/lib/skills/runtime-skill-sync/links.js +1 -1
  215. package/lib/skills/runtime-skill-sync/list-local.d.ts +3 -0
  216. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  217. package/lib/skills/runtime-skill-sync/local-files.d.ts +25 -0
  218. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  219. package/lib/skills/runtime-skill-sync/materialize.d.ts +11 -0
  220. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  221. package/lib/skills/runtime-skill-sync/metadata.d.ts +7 -0
  222. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  223. package/lib/skills/runtime-skill-sync/paths.d.ts +11 -0
  224. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  225. package/lib/skills/runtime-skill-sync/push.d.ts +33 -0
  226. package/lib/skills/runtime-skill-sync/push.js +1 -1
  227. package/lib/skills/runtime-skill-sync/scopes.d.ts +5 -0
  228. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  229. package/lib/skills/runtime-skill-sync/types.d.ts +105 -0
  230. package/lib/skills/runtime-skill-sync/zip-codec.d.ts +9 -0
  231. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  232. package/lib/skills/runtime-skill-sync/zip-package.d.ts +15 -0
  233. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  234. package/lib/skills/runtime-skill-sync.d.ts +15 -0
  235. package/lib/skills/runtime-skill-sync.js +1 -1
  236. package/lib/utils/apply-jq-filter.d.ts +25 -0
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/logger.d.ts +73 -0
  239. package/lib/utils/logger.js +1 -1
  240. package/lib/utils/lossless-json.d.ts +21 -0
  241. package/lib/utils/lossless-json.js +1 -1
  242. package/lib/utils/params.d.ts +65 -0
  243. package/lib/utils/params.js +1 -1
  244. package/lib/utils/platform.d.ts +17 -0
  245. package/lib/utils/platform.js +1 -1
  246. package/lib/utils/update-notice.d.ts +10 -0
  247. package/lib/utils/update-notice.js +1 -1
  248. package/lib/utils/version.d.ts +18 -0
  249. package/lib/utils/version.js +1 -1
  250. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  251. package/lib/utils/write-cli-side-channel.js +1 -1
  252. package/package.json +9 -1
@@ -0,0 +1,451 @@
1
+ /**
2
+ * @fileoverview Management API client using raw `fetch`.
3
+ *
4
+ * Why a separate module from `sdk-client.ts`: the SDK (`@lovrabet/sdk`) is designed
5
+ * for runtime operations (data/SQL/BFF execution) and encapsulates the SDK client
6
+ * lifecycle. This module handles authenticated API calls that the SDK does not
7
+ * cover: listing datasets, fetching app lists, querying runtime contracts, etc.
8
+ *
9
+ * Why `X-User-AK` auth: the runtime CLI uses AccessKey authentication exclusively.
10
+ * The AK is set as a module-level variable (`_activeAK`) and read by every request.
11
+ * The `finalize` hook clears it after each command to prevent AK leakage.
12
+ *
13
+ * Design decision: management API paths use `/client/`; narrowly scoped runtime
14
+ * contract lookups may use `/api/` when the backend exposes a non-enumerating endpoint.
15
+ */
16
+ import type { Paging } from "../framework/response.js";
17
+ /** Sets the active AccessKey used for all subsequent API calls. */
18
+ export declare function setActiveAK(ak: string): void;
19
+ /** Clears the active AccessKey after command completion. */
20
+ export declare function clearActiveAK(): void;
21
+ /** Public runtime contract for one known BFF endpoint function. */
22
+ export interface BffEndpointContract {
23
+ appCode: string;
24
+ functionName: string;
25
+ description?: string;
26
+ version?: number;
27
+ gmtModified?: string | number;
28
+ }
29
+ /**
30
+ * Fetches one known BFF endpoint contract by its stable runtime identity.
31
+ * The runtime exposes an AK-authenticated exact endpoint keyed by appCode + functionName.
32
+ * Platform-only fields returned by older backends are intentionally discarded here.
33
+ */
34
+ export declare function getBffEndpointContract(appCode: string, functionName: string): Promise<BffEndpointContract>;
35
+ /** Metadata for a SQL query returned by the management API. */
36
+ export interface SqlQuery {
37
+ id: number;
38
+ tenantCode?: string;
39
+ appCode: string;
40
+ sqlCode: string;
41
+ sqlName: string;
42
+ dbId?: number;
43
+ sqlContent?: string;
44
+ sqlConfig?: string | null;
45
+ params?: string | null;
46
+ }
47
+ export interface SqlListResult {
48
+ tableData: SqlQuery[];
49
+ paging: Paging;
50
+ }
51
+ /**
52
+ * Fetches SQL query metadata by `sqlCode`.
53
+ *
54
+ * Why POST with `sqlCode` filter rather than GET with path param: the API's
55
+ * `/client/sql/query` endpoint accepts POST with a filter body. We match the
56
+ * API's convention even though GET would be more RESTful — changing the API
57
+ * is out of scope for this CLI.
58
+ *
59
+ * The response may be either a `SqlListResult` (paginated list) or a single
60
+ * `SqlQuery` object (when the API returns the matched record directly). We
61
+ * handle both shapes.
62
+ */
63
+ export declare function getSqlQueryInfo(appCode: string, sqlCode: string): Promise<SqlQuery>;
64
+ /** A dataset returned by the list API. */
65
+ export interface DatasetItem {
66
+ id: number;
67
+ name: string;
68
+ code: string;
69
+ source?: string;
70
+ description?: string;
71
+ dbtableConfig?: {
72
+ tableName?: string;
73
+ dbId?: number;
74
+ dbName?: string;
75
+ dbType?: string;
76
+ datasetKey?: string;
77
+ pkField?: string;
78
+ allFields?: string;
79
+ };
80
+ [key: string]: any;
81
+ }
82
+ export interface RuntimeArtifactItem {
83
+ id: number;
84
+ appCode: string;
85
+ artifactType?: string;
86
+ name?: string;
87
+ content?: string;
88
+ compiledContent?: string;
89
+ metadata?: Record<string, unknown>;
90
+ source?: string;
91
+ favorite?: boolean;
92
+ deleted?: number | boolean;
93
+ createTime?: string;
94
+ updateTime?: string;
95
+ [key: string]: unknown;
96
+ }
97
+ export interface RuntimeArtifactUpsertInput {
98
+ artifactType: "react_module";
99
+ name?: string;
100
+ content: string;
101
+ metadata?: Record<string, unknown>;
102
+ source: "AGENT";
103
+ }
104
+ export interface PersonalBffItem {
105
+ id: number;
106
+ appCode?: string;
107
+ functionName?: string;
108
+ description?: string;
109
+ scriptType?: string;
110
+ scriptContent?: string;
111
+ config?: Record<string, unknown> | null;
112
+ version?: number | string;
113
+ createUserId?: number | string;
114
+ gmtCreate?: string;
115
+ gmtModified?: string;
116
+ createTime?: string;
117
+ updateTime?: string;
118
+ [key: string]: unknown;
119
+ }
120
+ export interface PersonalBffUpsertInput {
121
+ functionName?: string;
122
+ description?: string;
123
+ scriptContent?: string;
124
+ sourceSessionId?: string;
125
+ }
126
+ export interface DatasetSdkUsageResponse {
127
+ markdown?: string;
128
+ [key: string]: unknown;
129
+ }
130
+ export interface RuntimeFileUploadResponse {
131
+ fileName?: string | null;
132
+ filePath?: string | null;
133
+ fileUrl?: string | null;
134
+ downloadFlag?: boolean;
135
+ fileType?: string | null;
136
+ size?: number | null;
137
+ sourceDir?: string | null;
138
+ [key: string]: unknown;
139
+ }
140
+ export interface RuntimeFileUrlResponse {
141
+ fileName?: string | null;
142
+ filePath?: string | null;
143
+ fileUrl?: string | null;
144
+ downloadFlag?: boolean;
145
+ longTerm?: boolean;
146
+ expiresInDays?: number | null;
147
+ [key: string]: unknown;
148
+ }
149
+ export interface RuntimeOcrResponse {
150
+ requestId?: string;
151
+ type?: string;
152
+ scene?: string;
153
+ text?: string;
154
+ lines?: string[];
155
+ kvData?: Record<string, unknown>;
156
+ width?: number;
157
+ height?: number;
158
+ pageNo?: number | null;
159
+ subImageCount?: number | null;
160
+ algoVersion?: string | null;
161
+ kvExcelUrl?: string | null;
162
+ xmlResult?: string | null;
163
+ rawData?: string | null;
164
+ creditsCharged?: number;
165
+ [key: string]: unknown;
166
+ }
167
+ /** A personal knowledge-base entry returned by the runtime API. */
168
+ export interface PersonalKnowledgeBaseItem {
169
+ id: number;
170
+ appCode: string;
171
+ scope?: string;
172
+ userId?: number | string;
173
+ title: string;
174
+ version?: number;
175
+ content?: string;
176
+ ragStatus?: string;
177
+ ragErrorMessage?: string | null;
178
+ createTime?: string;
179
+ updateTime?: string;
180
+ [key: string]: unknown;
181
+ }
182
+ /** Request body used for personal knowledge-base create/update. */
183
+ export interface PersonalKnowledgeBaseUpsertInput {
184
+ title: string;
185
+ content: string;
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
+ }
198
+ /** A runtime Skill returned by the management API. */
199
+ export interface RuntimeSkillFile {
200
+ path: string;
201
+ sha256: string;
202
+ size: number;
203
+ }
204
+ export interface RuntimeSkillFilesManifest {
205
+ schemaVersion?: number;
206
+ ossPath?: string;
207
+ treeSha256: string;
208
+ zipSha256: string;
209
+ zipSize: number;
210
+ files: RuntimeSkillFile[];
211
+ }
212
+ export interface RuntimeSkillItem {
213
+ id?: number;
214
+ skillCode: string;
215
+ skillName?: string;
216
+ description?: string;
217
+ example?: string;
218
+ appCode?: string;
219
+ scope?: "personal" | "company" | "builtin" | string;
220
+ tenantCode?: string;
221
+ userId?: number | string;
222
+ version?: string;
223
+ status?: string;
224
+ tags?: string[];
225
+ readonly?: boolean;
226
+ hasUpstreamUpdate?: boolean;
227
+ forkedFromSkillId?: number;
228
+ forkedFromVersion?: string;
229
+ sourceSessionId?: string;
230
+ content?: string;
231
+ files?: RuntimeSkillFilesManifest;
232
+ [key: string]: unknown;
233
+ }
234
+ export interface RuntimeSkillListResponse {
235
+ appCode: string;
236
+ personal: RuntimeSkillItem[];
237
+ company: RuntimeSkillItem[];
238
+ effective: RuntimeSkillItem[];
239
+ }
240
+ /** Request body used for personal runtime Skill create/update. */
241
+ export interface RuntimeSkillUpsertInput {
242
+ skillCode?: string;
243
+ skillName?: string;
244
+ description?: string;
245
+ content: string;
246
+ tags?: string[];
247
+ version?: string;
248
+ sourceSessionId?: string;
249
+ files?: RuntimeSkillFilesManifest;
250
+ packageBase64?: string;
251
+ }
252
+ export type RuntimeSkillPublishVisibility = "PRIVATE" | "NAMESPACE_ONLY";
253
+ export interface RuntimeSkillPublishOptions {
254
+ visibility: RuntimeSkillPublishVisibility;
255
+ confirmWarnings?: boolean;
256
+ }
257
+ export interface RuntimeSkillPublishValidationInput {
258
+ visibility: RuntimeSkillPublishVisibility;
259
+ }
260
+ export interface RuntimeSkillPublishValidationResult {
261
+ valid: boolean;
262
+ errors: string[];
263
+ warnings: string[];
264
+ resolvedSlug?: string;
265
+ resolvedVersion?: string;
266
+ }
267
+ /** An app returned by the remote app list API. */
268
+ export interface RemoteAppItem {
269
+ id: number;
270
+ appCode: string;
271
+ appName: string;
272
+ appDesc: string | null;
273
+ tenantCode: string;
274
+ appPublishStatus: string;
275
+ appOwnerName: string;
276
+ createTime: string;
277
+ updateTime: string;
278
+ enableI18n: boolean;
279
+ i18nInfo: {
280
+ baseLang: string | null;
281
+ langs: string[] | null;
282
+ nonDomesticAppName: string | null;
283
+ } | null;
284
+ extend: {
285
+ skinColor: string | null;
286
+ enableOpenApi: boolean;
287
+ accessKey: string | null;
288
+ } | null;
289
+ }
290
+ /** User info returned by `/client/user/loginUserInfo`. */
291
+ export interface LoginUserInfo {
292
+ id?: number | string;
293
+ userId?: number | string;
294
+ username?: string;
295
+ nickname?: string;
296
+ name?: string | null;
297
+ userName?: string;
298
+ nickName?: string;
299
+ loginName?: string;
300
+ tenantCode?: string;
301
+ employeeId?: string | null;
302
+ avatar?: string | null;
303
+ mobile?: string | null;
304
+ email?: string | null;
305
+ [key: string]: unknown;
306
+ }
307
+ export type RuntimeScheduleKind = "CRON" | "ONCE";
308
+ export type RuntimeScheduleChannel = "auto" | "premium";
309
+ export type RuntimeScheduleTaskStatus = "QUEUED" | "RUNNING" | "COMPLETED" | "FAILED" | "CANCELLED";
310
+ export type RuntimeScheduleInput = {
311
+ kind: "CRON";
312
+ timezone: "UTC";
313
+ cron: string;
314
+ title: string;
315
+ prompt: string;
316
+ channel: RuntimeScheduleChannel;
317
+ } | {
318
+ kind: "ONCE";
319
+ timezone: "UTC";
320
+ scheduledAt: string;
321
+ title: string;
322
+ prompt: string;
323
+ channel: RuntimeScheduleChannel;
324
+ };
325
+ export interface RuntimeScheduleSummary {
326
+ scheduleId: string;
327
+ kind: RuntimeScheduleKind;
328
+ title: string;
329
+ appCode: string;
330
+ timezone: "UTC";
331
+ createdAt: string;
332
+ cron?: string;
333
+ scheduledAt?: string;
334
+ triggeredTaskId?: string;
335
+ triggeredStatus?: RuntimeScheduleTaskStatus;
336
+ }
337
+ export interface RuntimeSchedulePage {
338
+ items: RuntimeScheduleSummary[];
339
+ nextCursor?: string;
340
+ }
341
+ export interface RuntimeScheduleRun {
342
+ taskId: string;
343
+ status: "QUEUED";
344
+ }
345
+ /** Fetches the current user's app list from the remote API. */
346
+ export declare function getMyApps(): Promise<RemoteAppItem[]>;
347
+ /**
348
+ * Fetches the current login user info for the active AccessKey.
349
+ *
350
+ * Why this call goes through the raw API client: it is a management-style
351
+ * `/client/*` endpoint keyed solely by `X-User-AK`, not an app-scoped SDK call.
352
+ */
353
+ export declare function getLoginUserInfo(): Promise<LoginUserInfo>;
354
+ export declare function validateRuntimeSchedule(appCode: string, input: RuntimeScheduleInput): Promise<RuntimeScheduleInput>;
355
+ export declare function createRuntimeSchedule(appCode: string, input: RuntimeScheduleInput): Promise<RuntimeScheduleSummary>;
356
+ export declare function listRuntimeSchedules(appCode: string, query?: {
357
+ limit?: number;
358
+ cursor?: string;
359
+ }): Promise<RuntimeSchedulePage>;
360
+ export declare function getRuntimeSchedule(appCode: string, scheduleId: string): Promise<RuntimeScheduleSummary>;
361
+ export declare function deleteRuntimeSchedule(appCode: string, scheduleId: string): Promise<{
362
+ scheduleId: string;
363
+ deleted: true;
364
+ }>;
365
+ export declare function runRuntimeSchedule(appCode: string, scheduleId: string): Promise<RuntimeScheduleRun>;
366
+ /**
367
+ * Lists datasets for an app, optionally filtered by code or name.
368
+ *
369
+ * Why `listDatasets` uses `extractList`: the API response wraps records in
370
+ * `{ tableData: [...] }`. `extractList` handles this so commands don't need
371
+ * to know the envelope structure.
372
+ */
373
+ export declare function listDatasets(appCode: string, options?: {
374
+ code?: string;
375
+ name?: string;
376
+ }): Promise<DatasetItem[]>;
377
+ /**
378
+ * Fetches complete dataset driven data by code.
379
+ *
380
+ * The server endpoint also accepts `id`, but runtime CLI keeps `code` as the
381
+ * public contract because it is stable across environments and visible to users.
382
+ */
383
+ export declare function getDatasetDetail(datasetCode: string): Promise<any>;
384
+ export declare function getDatasetSdkUsageDoc(datasetCode: string, appCode: string): Promise<string>;
385
+ export declare function uploadRuntimeFile(appCode: string, filePath: string): Promise<RuntimeFileUploadResponse>;
386
+ export declare function queryRuntimeFileUrl(filePath: string, options?: {
387
+ download?: boolean;
388
+ longTerm?: boolean;
389
+ }): Promise<RuntimeFileUrlResponse>;
390
+ export declare function recognizeRuntimeOcr(appCode: string, input: {
391
+ url: string;
392
+ type: string;
393
+ }): Promise<RuntimeOcrResponse>;
394
+ export declare function getRuntimeAppConfigByKey(appCode: string, key: string): Promise<string>;
395
+ export declare function listRuntimeArtifacts(appCode: string, options?: {
396
+ artifactType?: string;
397
+ source?: string;
398
+ favorite?: boolean;
399
+ }): Promise<RuntimeArtifactItem[]>;
400
+ export declare function getRuntimeArtifact(id: number, appCode: string): Promise<RuntimeArtifactItem>;
401
+ export declare function createRuntimeArtifact(appCode: string, input: RuntimeArtifactUpsertInput): Promise<RuntimeArtifactItem>;
402
+ export declare function updateRuntimeArtifact(id: number, appCode: string, input: RuntimeArtifactUpsertInput): Promise<RuntimeArtifactItem>;
403
+ export declare function listPersonalBffs(appCode: string): Promise<PersonalBffItem[]>;
404
+ export declare function getPersonalBff(id: number, appCode: string): Promise<PersonalBffItem>;
405
+ export declare function createPersonalBff(appCode: string, input: PersonalBffUpsertInput): Promise<PersonalBffItem>;
406
+ export declare function updatePersonalBff(id: number, appCode: string, input: PersonalBffUpsertInput): Promise<PersonalBffItem>;
407
+ export declare function executePersonalBff(id: number, appCode: string, params: Record<string, any>): Promise<unknown>;
408
+ /** Lists the authenticated user's personal knowledge-base entries for an app. */
409
+ export declare function listPersonalKnowledgeBaseItems(appCode: string): Promise<PersonalKnowledgeBaseItem[]>;
410
+ /** Fetches one personal knowledge-base entry by numeric ID. */
411
+ export declare function getPersonalKnowledgeBaseItem(id: number, appCode: string): Promise<PersonalKnowledgeBaseItem>;
412
+ /** Creates a personal knowledge-base entry from a title/content payload. */
413
+ export declare function createPersonalKnowledgeBaseItem(appCode: string, input: PersonalKnowledgeBaseUpsertInput): Promise<PersonalKnowledgeBaseItem>;
414
+ /** Updates a personal knowledge-base entry. The backend requires POST. */
415
+ export declare function updatePersonalKnowledgeBaseItem(id: number, appCode: string, input: PersonalKnowledgeBaseUpsertInput): Promise<PersonalKnowledgeBaseItem>;
416
+ /** Searches visible company and personal knowledge for the active user/app. */
417
+ export declare function searchKnowledgeBase(appCode: string, input: {
418
+ query: string;
419
+ topK?: number;
420
+ }): Promise<KnowledgeBaseSearchHit[]>;
421
+ export type RuntimeSkillRemoteScope = "all" | "personal" | "company";
422
+ /** Fetches one SkillHub native Skill by exact namespace and slug. */
423
+ export declare function getRuntimeSkillByCode(appCode: string, skillCode: string): Promise<RuntimeSkillItem | undefined>;
424
+ /** Lists SkillHub native Skills with Lovrabet AK auth. */
425
+ export declare function listRuntimeSkills(input: {
426
+ appCode: string;
427
+ scope?: RuntimeSkillRemoteScope;
428
+ code?: string;
429
+ }): Promise<RuntimeSkillListResponse>;
430
+ /** Lists the authenticated user's personal Skills for an app. */
431
+ export declare function listPersonalRuntimeSkills(appCode: string): Promise<RuntimeSkillItem[]>;
432
+ /** Lists company Skills visible in the app namespace. */
433
+ export declare function listCompanyRuntimeSkills(appCode: string): Promise<RuntimeSkillItem[]>;
434
+ /** Lists effective business runtime Skills visible to the authenticated user. */
435
+ export declare function listVisibleRuntimeSkills(appCode: string): Promise<RuntimeSkillItem[]>;
436
+ /** Publishes a private runtime Skill through SkillHub. */
437
+ export declare function createPersonalRuntimeSkill(appCode: string, input: RuntimeSkillUpsertInput, options?: {
438
+ confirmWarnings?: boolean;
439
+ }): Promise<RuntimeSkillItem>;
440
+ /** Updates a personal runtime Skill by republishing it through SkillHub. */
441
+ export declare function updatePersonalRuntimeSkill(skillCode: string, appCode: string, input: RuntimeSkillUpsertInput, options?: {
442
+ confirmWarnings?: boolean;
443
+ }): Promise<RuntimeSkillItem>;
444
+ /** Publishes a company runtime Skill version through SkillHub review flow. */
445
+ export declare function publishCompanyRuntimeSkill(appCode: string, input: RuntimeSkillUpsertInput, options?: {
446
+ confirmWarnings?: boolean;
447
+ }): Promise<RuntimeSkillItem>;
448
+ /** Validates a runtime Skill publish package through SkillHub without creating a version. */
449
+ export declare function validateRuntimeSkillPublish(appCode: string, input: RuntimeSkillUpsertInput, validation: RuntimeSkillPublishValidationInput): Promise<RuntimeSkillPublishValidationResult>;
450
+ /** Downloads a runtime Skill package through SkillHub. */
451
+ export declare function downloadRuntimeSkillPackage(scope: "personal" | "company" | "builtin", skillCode: string, appCode: string, version?: string): Promise<Buffer>;
@@ -1 +1 @@
1
- (function(_0x31121f,_0x42bae9){const _0x261d1a=a75_0xc8b5,_0x17bed5=_0x31121f();while(!![]){try{const _0x250f60=parseInt(_0x261d1a(0x19b))/0x1+-parseInt(_0x261d1a(0x18c))/0x2+-parseInt(_0x261d1a(0x196))/0x3*(parseInt(_0x261d1a(0x1b9))/0x4)+-parseInt(_0x261d1a(0x177))/0x5*(-parseInt(_0x261d1a(0x1b3))/0x6)+parseInt(_0x261d1a(0x168))/0x7*(-parseInt(_0x261d1a(0x1ad))/0x8)+-parseInt(_0x261d1a(0x15e))/0x9+-parseInt(_0x261d1a(0x160))/0xa*(-parseInt(_0x261d1a(0x18f))/0xb);if(_0x250f60===_0x42bae9)break;else _0x17bed5['push'](_0x17bed5['shift']());}catch(_0x3a0845){_0x17bed5['push'](_0x17bed5['shift']());}}}(a75_0x27ad,0x51795));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{createRateLimitError,readRetryAfter,readRetryAfterSeconds}from'../framework/rate-limit.js';import{extractList}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x3e1a7d){_activeAK=_0x3e1a7d||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0x542787){const _0x3efdea=a75_0xc8b5;for(const _0x3cbaec of _0x542787){if(typeof _0x3cbaec===_0x3efdea(0x15d)&&_0x3cbaec[_0x3efdea(0x1b2)]())return _0x3cbaec[_0x3efdea(0x1b2)]();}return undefined;}async function decodeResponseBody(_0x4e02e5){const _0x54fc08=a75_0xc8b5;if(typeof _0x4e02e5[_0x54fc08(0x17b)]==='function')try{const _0x3ca2f6=await _0x4e02e5[_0x54fc08(0x17b)]();try{return{'isJson':!![],'data':parseLosslessJson(_0x3ca2f6),'text':_0x3ca2f6};}catch{return{'isJson':![],'text':_0x3ca2f6[_0x54fc08(0x1b2)]()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x4e02e5[_0x54fc08(0x155)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x503429,_0x57a1f4,_0x51eca1){const _0x5a16ba=a75_0xc8b5,_0x4198e4=_0x57a1f4&&typeof _0x57a1f4===_0x5a16ba(0x154)?_0x57a1f4:{},_0x3ddbba=[_0x4198e4[_0x5a16ba(0x186)],_0x4198e4[_0x5a16ba(0x134)]][_0x5a16ba(0x187)](_0x5257c9=>Number(_0x5257c9)===0x1ad),_0x1ac9e6=createRateLimitError({'status':_0x503429[_0x5a16ba(0x186)]===0x1ad?_0x503429['status']:_0x3ddbba??_0x503429[_0x5a16ba(0x186)],'errorCode':firstString(_0x4198e4['errorCode'],typeof _0x4198e4[_0x5a16ba(0x134)]===_0x5a16ba(0x15d)?_0x4198e4[_0x5a16ba(0x134)]:undefined),'message':firstString(_0x4198e4[_0x5a16ba(0x18d)],_0x4198e4[_0x5a16ba(0x15c)],_0x4198e4[_0x5a16ba(0x189)],_0x51eca1),'retryAfter':readRetryAfter(_0x503429[_0x5a16ba(0x193)])??readRetryAfterSeconds(_0x57a1f4)});if(_0x1ac9e6)throw _0x1ac9e6;}async function apiRequest(_0x3774ae,_0x41411a={}){const _0x5d6407=a75_0xc8b5,{method:method='GET',body:_0x2716e4,headers:headers={},timeout:timeout=0x7530}=_0x41411a,_0x4951b7=_activeAK,_0x5707fb=getRuntimeDomain();if(!_0x4951b7)throw CliErrors[_0x5d6407(0x13e)](_0x5d6407(0x1b7)+PRODUCT_CONFIG[_0x5d6407(0x1b0)]+'.');const _0x9a4fe7=''+_0x5707fb+_0x3774ae,_0x317905={'X-User-AK':_0x4951b7},_0x210da7=new AbortController(),_0x3730d3=setTimeout(()=>_0x210da7['abort'](),timeout);try{const _0x49794c=await fetch(_0x9a4fe7,{'method':method,'headers':{'Content-Type':_0x5d6407(0x166),'X-Invoke-Source':PRODUCT_CONFIG[_0x5d6407(0x148)],..._0x317905,...headers},'body':_0x2716e4?JSON['stringify'](_0x2716e4):undefined,'signal':_0x210da7[_0x5d6407(0x199)]}),_0x1531e8=await decodeResponseBody(_0x49794c);if(!_0x1531e8[_0x5d6407(0x1a8)]){throwIfRateLimited(_0x49794c,undefined,_0x1531e8[_0x5d6407(0x17b)]);throw CliErrors[_0x5d6407(0x171)](_0x5d6407(0x15b)+_0x49794c[_0x5d6407(0x186)]+')',_0x49794c[_0x5d6407(0x186)]>=0x190?_0x5d6407(0x174):undefined);}const _0x309cc1=_0x1531e8[_0x5d6407(0x14a)];throwIfRateLimited(_0x49794c,_0x309cc1);if(!_0x49794c['ok']||_0x309cc1[_0x5d6407(0x1c2)]===![])throw CliErrors[_0x5d6407(0x171)](_0x309cc1[_0x5d6407(0x18d)]||_0x309cc1['message']||_0x5d6407(0x179)+_0x49794c[_0x5d6407(0x186)],_0x309cc1['errorCode']?_0x5d6407(0x1b8)+_0x309cc1[_0x5d6407(0x15a)]:undefined);return _0x309cc1;}catch(_0x5276c7){if(_0x5276c7 instanceof Error&&_0x5276c7['name']===_0x5d6407(0x1a2))throw CliErrors[_0x5d6407(0x171)](_0x5d6407(0x133)+_0x9a4fe7);throw _0x5276c7;}finally{clearTimeout(_0x3730d3);}}async function apiBinaryRequest(_0x2990fa,_0x15e0dd={}){const _0x27ad79=a75_0xc8b5,{method:method=_0x27ad79(0x12f),headers:headers={},timeout:timeout=0x7530}=_0x15e0dd,_0x5956bc=_activeAK,_0xb41d8e=getRuntimeDomain();if(!_0x5956bc)throw CliErrors[_0x27ad79(0x13e)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x27ad79(0x1b0)]+'.');const _0x48a4f7=''+_0xb41d8e+_0x2990fa,_0x171973=new AbortController(),_0x30412a=setTimeout(()=>_0x171973[_0x27ad79(0x157)](),timeout);try{const _0x122933=await fetch(_0x48a4f7,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x27ad79(0x148)],'X-User-AK':_0x5956bc,...headers},'signal':_0x171973[_0x27ad79(0x199)]});if(!_0x122933['ok']){const _0x42e0d0=await decodeResponseBody(_0x122933),_0x426616=_0x42e0d0[_0x27ad79(0x14a)]&&typeof _0x42e0d0[_0x27ad79(0x14a)]===_0x27ad79(0x154)?_0x42e0d0[_0x27ad79(0x14a)]:{},_0x17dde7=firstString(_0x426616[_0x27ad79(0x18d)],_0x426616['message'],_0x426616[_0x27ad79(0x15a)],_0x42e0d0[_0x27ad79(0x17b)]);throwIfRateLimited(_0x122933,_0x42e0d0[_0x27ad79(0x14a)],_0x17dde7);throw CliErrors[_0x27ad79(0x171)](_0x17dde7||_0x27ad79(0x179)+_0x122933[_0x27ad79(0x186)],_0x27ad79(0x197)+_0x48a4f7);}return Buffer[_0x27ad79(0x190)](await _0x122933[_0x27ad79(0x188)]());}catch(_0x594004){if(_0x594004 instanceof Error&&_0x594004['name']===_0x27ad79(0x1a2))throw CliErrors[_0x27ad79(0x171)](_0x27ad79(0x133)+_0x48a4f7);throw _0x594004;}finally{clearTimeout(_0x30412a);}}async function apiFormRequest(_0x51bb4d,_0xd99b45,_0x908052={}){const _0x5d62d4=a75_0xc8b5,{timeout:timeout=0x7530}=_0x908052,_0x4b1e72=_activeAK,_0x4ca8bc=getRuntimeDomain();if(!_0x4b1e72)throw CliErrors[_0x5d62d4(0x13e)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x5d62d4(0x1b0)]+'.');const _0x20fac2=''+_0x4ca8bc+_0x51bb4d,_0x1cc020=new AbortController(),_0x193a19=setTimeout(()=>_0x1cc020[_0x5d62d4(0x157)](),timeout);try{const _0xd6fc50=await fetch(_0x20fac2,{'method':_0x5d62d4(0x180),'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x4b1e72},'body':_0xd99b45,'signal':_0x1cc020['signal']}),_0xf17f83=await decodeResponseBody(_0xd6fc50);if(!_0xf17f83[_0x5d62d4(0x1a8)]){throwIfRateLimited(_0xd6fc50,undefined,_0xf17f83[_0x5d62d4(0x17b)]);throw CliErrors[_0x5d62d4(0x171)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0xd6fc50[_0x5d62d4(0x186)]+')',_0xd6fc50[_0x5d62d4(0x186)]>=0x190?_0x5d62d4(0x174):undefined);}const _0x2a90bb=_0xf17f83['data'];throwIfRateLimited(_0xd6fc50,_0x2a90bb);if(!_0xd6fc50['ok']||_0x2a90bb[_0x5d62d4(0x1c2)]===![])throw CliErrors[_0x5d62d4(0x171)](_0x2a90bb[_0x5d62d4(0x18d)]||_0x2a90bb[_0x5d62d4(0x15c)]||_0x5d62d4(0x179)+_0xd6fc50[_0x5d62d4(0x186)],_0x2a90bb[_0x5d62d4(0x15a)]?'API\x20error\x20code:\x20'+_0x2a90bb[_0x5d62d4(0x15a)]:undefined);return _0x2a90bb;}catch(_0x2c1e6a){if(_0x2c1e6a instanceof Error&&_0x2c1e6a['name']==='AbortError')throw CliErrors[_0x5d62d4(0x171)](_0x5d62d4(0x133)+_0x20fac2);throw _0x2c1e6a;}finally{clearTimeout(_0x193a19);}}async function toolboxRequest(_0x15c21b,_0xfd1b44,_0x3bea17={}){const _0x217355=a75_0xc8b5,{method:method=_0x217355(0x12f),headers:headers={},timeout:timeout=0x7530}=_0x3bea17,_0x54cc05=_activeAK;if(!_0x54cc05)throw CliErrors[_0x217355(0x13e)](_0x217355(0x1b7)+PRODUCT_CONFIG[_0x217355(0x1b0)]+'.');const _0x344c44=getApiDomain()[_0x217355(0x14b)](/\/$/,''),_0x39fe84=new URL(_0x15c21b,_0x344c44+_0x217355(0x1ab));if(_0xfd1b44)for(const [_0x50b345,_0x1a71f4]of Object[_0x217355(0x176)](_0xfd1b44)){_0x1a71f4!==undefined&&_0x1a71f4!==null&&_0x39fe84[_0x217355(0x12d)][_0x217355(0x1b5)](_0x50b345,String(_0x1a71f4));}const _0x23ed94=new AbortController(),_0x6bb46a=setTimeout(()=>_0x23ed94[_0x217355(0x157)](),timeout);try{const _0x32ff9a=await fetch(_0x39fe84,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x217355(0x148)],'X-User-AK':_0x54cc05,...headers},'signal':_0x23ed94['signal']}),_0x210854=await decodeResponseBody(_0x32ff9a);if(!_0x210854['isJson']){throwIfRateLimited(_0x32ff9a,undefined,_0x210854[_0x217355(0x17b)]);throw CliErrors[_0x217355(0x171)]('Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x32ff9a['status']+')',_0x32ff9a[_0x217355(0x186)]>=0x190?_0x217355(0x174):undefined);}const _0x4c1849=_0x210854['data'];throwIfRateLimited(_0x32ff9a,_0x4c1849);if(!_0x32ff9a['ok']){const _0x4086b9=_0x4c1849&&typeof _0x4c1849===_0x217355(0x154)?_0x4c1849:{};throw CliErrors[_0x217355(0x171)](_0x4086b9[_0x217355(0x18d)]||_0x4086b9['message']||_0x217355(0x14d)+_0x32ff9a[_0x217355(0x186)],_0x4086b9[_0x217355(0x15a)]?'Toolbox\x20error\x20code:\x20'+_0x4086b9[_0x217355(0x15a)]:undefined);}if(_0x4c1849&&typeof _0x4c1849===_0x217355(0x154)&&_0x217355(0x1c2)in _0x4c1849&&typeof _0x4c1849[_0x217355(0x1c2)]===_0x217355(0x1a5)){const _0x29f51a=_0x4c1849;if(!_0x29f51a[_0x217355(0x1c2)])throw CliErrors[_0x217355(0x171)](_0x29f51a[_0x217355(0x18d)]||_0x29f51a[_0x217355(0x15c)]||'Toolbox\x20API\x20error',_0x29f51a[_0x217355(0x15a)]?_0x217355(0x17a)+_0x29f51a[_0x217355(0x15a)]:undefined);return _0x29f51a['data'];}return _0x4c1849;}catch(_0x277731){if(_0x277731 instanceof Error&&_0x277731[_0x217355(0x1a7)]===_0x217355(0x1a2))throw CliErrors['apiError'](_0x217355(0x133)+_0x39fe84['toString']());throw _0x277731;}finally{clearTimeout(_0x6bb46a);}}async function skillHubJsonRequest(_0xa10f5e,_0x5835fe={}){const _0x87b086=a75_0xc8b5,{method:method=_0x87b086(0x12f),query:_0x2a30e2,body:_0x613aeb,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x5835fe,_0x5dcea1=_activeAK;if(!_0x5dcea1)throw CliErrors[_0x87b086(0x13e)](_0x87b086(0x1b7)+PRODUCT_CONFIG[_0x87b086(0x1b0)]+'.');const _0x325a73=getSkillHubDomain()[_0x87b086(0x14b)](/\/$/,''),_0x26e1ab=new URL(_0xa10f5e,_0x325a73+'/');if(_0x2a30e2)for(const [_0x467ec5,_0x534425]of Object[_0x87b086(0x176)](_0x2a30e2)){_0x534425!==undefined&&_0x534425!==null&&_0x26e1ab[_0x87b086(0x12d)][_0x87b086(0x1b5)](_0x467ec5,String(_0x534425));}const _0x5af3eb=new AbortController(),_0x34bb9c=setTimeout(()=>_0x5af3eb[_0x87b086(0x157)](),timeout);try{const _0x5e4cbd=await fetch(_0x26e1ab['toString'](),{'method':method,'headers':{'Accept':_0x87b086(0x166),'X-Invoke-Source':PRODUCT_CONFIG[_0x87b086(0x148)],'X-User-AK':_0x5dcea1,...headers},'body':_0x613aeb,'signal':_0x5af3eb[_0x87b086(0x199)]}),_0x18a623=await decodeResponseBody(_0x5e4cbd);if(!_0x18a623[_0x87b086(0x1a8)]){if(allowNotFound&&_0x5e4cbd[_0x87b086(0x186)]===0x194)return undefined;throwIfRateLimited(_0x5e4cbd,undefined,_0x18a623[_0x87b086(0x17b)]);throw CliErrors['apiError'](_0x87b086(0x175)+_0x5e4cbd[_0x87b086(0x186)]+')',_0x5e4cbd['status']>=0x190?_0x87b086(0x174):undefined);}const _0x1270e6=_0x18a623['data'];throwIfRateLimited(_0x5e4cbd,_0x1270e6);if(allowNotFound&&isSkillHubNotFoundResponse(_0x5e4cbd[_0x87b086(0x186)],_0x1270e6))return undefined;const _0x19985a=!_0x5e4cbd['ok']||_0x1270e6?.[_0x87b086(0x1c2)]===![]||typeof _0x1270e6?.[_0x87b086(0x134)]===_0x87b086(0x14c)&&_0x1270e6[_0x87b086(0x134)]>=0x190;if(_0x19985a)throw CliErrors['apiError'](_0x1270e6?.[_0x87b086(0x18d)]||_0x1270e6?.[_0x87b086(0x15c)]||_0x1270e6?.[_0x87b086(0x189)]||_0x87b086(0x191)+_0x5e4cbd[_0x87b086(0x186)],_0x1270e6?.['errorCode']?_0x87b086(0x16f)+_0x1270e6[_0x87b086(0x15a)]:undefined);return _0x1270e6?.['data']??_0x1270e6;}catch(_0x4abc80){if(_0x4abc80 instanceof Error&&_0x4abc80['name']===_0x87b086(0x1a2))throw CliErrors['apiError'](_0x87b086(0x133)+_0x26e1ab[_0x87b086(0x18e)]());throw _0x4abc80;}finally{clearTimeout(_0x34bb9c);}}function isSkillHubNotFoundResponse(_0x373fec,_0x4ed58e){const _0x53ff37=a75_0xc8b5;if(_0x373fec===0x194||_0x4ed58e?.[_0x53ff37(0x134)]===0x194)return!![];if(_0x373fec!==0x190&&_0x4ed58e?.[_0x53ff37(0x134)]!==0x190)return![];const _0x5e9d43=[_0x4ed58e?.[_0x53ff37(0x189)],_0x4ed58e?.[_0x53ff37(0x15c)],_0x4ed58e?.[_0x53ff37(0x18d)],_0x4ed58e?.[_0x53ff37(0x149)]][_0x53ff37(0x14f)](_0x3f106e=>typeof _0x3f106e===_0x53ff37(0x15d))[_0x53ff37(0x17e)]('\x20');return/skill not found\b/i['test'](_0x5e9d43);}async function skillHubBinaryRequest(_0x42b493,_0x51b229={}){const _0x1681a7=a75_0xc8b5,{query:_0x28f95f,headers:headers={},timeout:timeout=0x7530}=_0x51b229,_0x34847c=_activeAK;if(!_0x34847c)throw CliErrors['authRequired'](_0x1681a7(0x1b7)+PRODUCT_CONFIG[_0x1681a7(0x1b0)]+'.');const _0x7fdff9=getSkillHubDomain()['replace'](/\/$/,''),_0x1dc3e8=new URL(_0x42b493,_0x7fdff9+'/');if(_0x28f95f)for(const [_0x44baa6,_0x30ddb3]of Object[_0x1681a7(0x176)](_0x28f95f)){_0x30ddb3!==undefined&&_0x30ddb3!==null&&_0x1dc3e8[_0x1681a7(0x12d)][_0x1681a7(0x1b5)](_0x44baa6,String(_0x30ddb3));}const _0x33e087=new AbortController(),_0xf3bad9=setTimeout(()=>_0x33e087[_0x1681a7(0x157)](),timeout);try{const _0x205ddc=await fetch(_0x1dc3e8[_0x1681a7(0x18e)](),{'method':'GET','headers':{'Accept':_0x1681a7(0x1ba),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x34847c,...headers},'signal':_0x33e087[_0x1681a7(0x199)]});if(!_0x205ddc['ok']){const _0x10fffa=await decodeResponseBody(_0x205ddc),_0x2abf3d=_0x10fffa[_0x1681a7(0x14a)]&&typeof _0x10fffa['data']===_0x1681a7(0x154)?_0x10fffa[_0x1681a7(0x14a)]:{},_0x512dfa=firstString(_0x2abf3d[_0x1681a7(0x18d)],_0x2abf3d[_0x1681a7(0x15c)],_0x2abf3d[_0x1681a7(0x189)],_0x2abf3d[_0x1681a7(0x15a)],_0x10fffa['text']);throwIfRateLimited(_0x205ddc,_0x10fffa[_0x1681a7(0x14a)],_0x512dfa);throw CliErrors['apiError'](_0x512dfa||_0x1681a7(0x191)+_0x205ddc[_0x1681a7(0x186)],_0x1681a7(0x197)+_0x1dc3e8[_0x1681a7(0x18e)]());}return Buffer['from'](await _0x205ddc[_0x1681a7(0x188)]());}catch(_0x340534){if(_0x340534 instanceof Error&&_0x340534[_0x1681a7(0x1a7)]===_0x1681a7(0x1a2))throw CliErrors[_0x1681a7(0x171)](_0x1681a7(0x133)+_0x1dc3e8[_0x1681a7(0x18e)]());throw _0x340534;}finally{clearTimeout(_0xf3bad9);}}export async function getBffEndpointContract(_0x4e1e0a,_0x2751b2){const _0x1040e2=a75_0xc8b5;if(_0x2751b2===_0x1040e2(0x165))throw CliErrors[_0x1040e2(0x16b)](_0x1040e2(0x15f)+_0x4e1e0a+_0x1040e2(0x18a)+_0x2751b2);const _0x26e897=await apiRequest(_0x1040e2(0x1af)+encodeURIComponent(_0x4e1e0a)+'/'+encodeURIComponent(_0x2751b2)),_0x66ac44=_0x26e897['data'];if(!_0x66ac44||typeof _0x66ac44!==_0x1040e2(0x154)||Array[_0x1040e2(0x162)](_0x66ac44)||_0x66ac44[_0x1040e2(0x13d)]!==_0x4e1e0a||_0x66ac44[_0x1040e2(0x158)]!==_0x2751b2)throw CliErrors['validation'](_0x1040e2(0x15f)+_0x4e1e0a+_0x1040e2(0x18a)+_0x2751b2);return{'appCode':_0x66ac44['appCode'],'functionName':_0x66ac44[_0x1040e2(0x158)],'description':_0x66ac44['description'],'version':_0x66ac44[_0x1040e2(0x163)],'gmtModified':_0x66ac44[_0x1040e2(0x147)]};}export async function getSqlQueryInfo(_0x31aa85,_0x502895){const _0x2299c0=a75_0xc8b5,_0x300244=await apiRequest(_0x2299c0(0x12c),{'method':_0x2299c0(0x180),'body':{'appCode':_0x31aa85,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x502895}}),_0x494912=_0x300244[_0x2299c0(0x14a)],_0xff589f=_0x494912&&typeof _0x494912===_0x2299c0(0x154)&&_0x2299c0(0x1a6)in _0x494912?_0x494912[_0x2299c0(0x1a6)]?.[0x0]:_0x494912&&typeof _0x494912==='object'&&'sqlCode'in _0x494912?_0x494912:undefined;if(!_0xff589f)throw CliErrors[_0x2299c0(0x16b)](_0x2299c0(0x12e)+_0x502895);return _0xff589f;}function isRemoteAppItem(_0x52d4e0){const _0x5cfcf4=a75_0xc8b5;return!!_0x52d4e0&&typeof _0x52d4e0==='object'&&typeof _0x52d4e0[_0x5cfcf4(0x13d)]===_0x5cfcf4(0x15d)&&typeof _0x52d4e0[_0x5cfcf4(0x13b)]===_0x5cfcf4(0x15d);}function extractRemoteAppItems(_0x573593){const _0x199a35=a75_0xc8b5;if(Array[_0x199a35(0x162)](_0x573593))return _0x573593['filter'](isRemoteAppItem);if(!_0x573593||typeof _0x573593!=='object')throw CliErrors[_0x199a35(0x171)](_0x199a35(0x185));const _0x2398aa=_0x573593;if(Array[_0x199a35(0x162)](_0x2398aa[_0x199a35(0x1a6)]))return _0x2398aa['tableData'][_0x199a35(0x14f)](isRemoteAppItem);if(_0x2398aa[_0x199a35(0x14a)]&&typeof _0x2398aa[_0x199a35(0x14a)]===_0x199a35(0x154)){const _0x1b56c9=_0x2398aa[_0x199a35(0x14a)];if(Array[_0x199a35(0x162)](_0x1b56c9[_0x199a35(0x1a6)]))return _0x1b56c9['tableData'][_0x199a35(0x14f)](isRemoteAppItem);}throw CliErrors[_0x199a35(0x171)]('Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.');}export async function getMyApps(){const _0x4e9872=a75_0xc8b5,_0x29ed64=await apiRequest(_0x4e9872(0x170));return extractRemoteAppItems(_0x29ed64['data']);}export async function getLoginUserInfo(){const _0x1f092b=a75_0xc8b5,_0x550321=await apiRequest(_0x1f092b(0x192));if(!_0x550321['data']||typeof _0x550321[_0x1f092b(0x14a)]!==_0x1f092b(0x154)||Array['isArray'](_0x550321[_0x1f092b(0x14a)]))throw CliErrors['apiError'](_0x1f092b(0x195));return _0x550321[_0x1f092b(0x14a)];}export async function listDatasets(_0x108c91,_0x336efe){const _0x1e5feb=a75_0xc8b5,_0x438a5b=await apiRequest(_0x1e5feb(0x151),{'method':_0x1e5feb(0x180),'body':{'appCode':_0x108c91,..._0x336efe?.[_0x1e5feb(0x134)]&&{'code':_0x336efe[_0x1e5feb(0x134)]},..._0x336efe?.[_0x1e5feb(0x1a7)]&&{'name':_0x336efe['name']}}});return extractList(_0x438a5b[_0x1e5feb(0x14a)]);}export async function getDatasetDetail(_0x51f094){const _0xbc0149=a75_0xc8b5,_0x1fa0db=await apiRequest('/client/dataset/get-driven-data?code='+encodeURIComponent(_0x51f094));return _0x1fa0db[_0xbc0149(0x14a)];}export async function getDatasetSdkUsageDoc(_0x51f88d,_0x404372){const _0x3ab039=a75_0xc8b5,_0x12fb68=await toolboxRequest(_0x3ab039(0x1be),{'datasetCode':_0x51f88d,'appCode':_0x404372});return typeof _0x12fb68?.[_0x3ab039(0x1a1)]===_0x3ab039(0x15d)?_0x12fb68['markdown']:'';}export async function uploadRuntimeFile(_0x45aa60,_0x4e2f0c){const _0x1fda33=a75_0xc8b5,_0x1aad51=await readFile(_0x4e2f0c),_0x131527=new FormData();_0x131527['append'](_0x1fda33(0x13d),_0x45aa60),_0x131527[_0x1fda33(0x19a)]('file',new Blob([new Uint8Array(_0x1aad51)]),basename(_0x4e2f0c));const _0x34bde5=await apiFormRequest(_0x1fda33(0x135),_0x131527);return _0x34bde5[_0x1fda33(0x14a)];}export async function queryRuntimeFileUrl(_0x3d6a6b,_0x3ab554={}){const _0xc0e17e=a75_0xc8b5,_0x4afce3=await apiRequest('/client/queryFileUrl',{'method':_0xc0e17e(0x180),'body':{'filePath':_0x3d6a6b,'downloadFlag':_0x3ab554['download']??![],..._0x3ab554['longTerm']?{'longTerm':!![]}:{}}});return _0x4afce3[_0xc0e17e(0x14a)];}export async function recognizeRuntimeOcr(_0x54a6e1,_0x260e27){const _0x151051=a75_0xc8b5,_0x257906=await apiRequest(_0x151051(0x140),{'method':_0x151051(0x180),'body':{'appCode':_0x54a6e1,'url':_0x260e27[_0x151051(0x167)],'type':_0x260e27[_0x151051(0x153)]}});return _0x257906[_0x151051(0x14a)];}export async function getRuntimeAppConfigByKey(_0x205db4,_0x4d506e){const _0x5c9189=a75_0xc8b5,_0x55cb66=new URLSearchParams({'appCode':_0x205db4,'key':_0x4d506e}),_0x4f121b=await apiRequest(_0x5c9189(0x12b)+_0x55cb66[_0x5c9189(0x18e)]());if(typeof _0x4f121b['data']!=='string')throw CliErrors[_0x5c9189(0x16b)](_0x5c9189(0x161)+_0x4d506e);return _0x4f121b[_0x5c9189(0x14a)];}export async function listRuntimeArtifacts(_0x2182f5,_0x185aad){const _0xd88b5e=a75_0xc8b5,_0x250fe7=new URLSearchParams({'appCode':_0x2182f5});if(_0x185aad?.['artifactType'])_0x250fe7[_0xd88b5e(0x1b5)]('artifactType',_0x185aad[_0xd88b5e(0x17c)]);if(_0x185aad?.[_0xd88b5e(0x164)])_0x250fe7[_0xd88b5e(0x1b5)](_0xd88b5e(0x164),_0x185aad[_0xd88b5e(0x164)]);if(_0x185aad?.[_0xd88b5e(0x178)]!==undefined)_0x250fe7['set'](_0xd88b5e(0x178),String(_0x185aad[_0xd88b5e(0x178)]));const _0x11727e=await apiRequest(_0xd88b5e(0x198)+_0x250fe7['toString']());return Array[_0xd88b5e(0x162)](_0x11727e[_0xd88b5e(0x14a)])?_0x11727e[_0xd88b5e(0x14a)]:[];}export async function getRuntimeArtifact(_0x9117fc,_0x3535e8){const _0x45eba6=a75_0xc8b5,_0x12fdf9=await apiRequest(_0x45eba6(0x1ac)+_0x9117fc+'?appCode='+encodeURIComponent(_0x3535e8));if(!_0x12fdf9[_0x45eba6(0x14a)])throw CliErrors['validation'](_0x45eba6(0x137)+_0x9117fc);return _0x12fdf9['data'];}export async function createRuntimeArtifact(_0x1b4825,_0x28510d){const _0xfcaa4e=a75_0xc8b5,_0x321a1c=await apiRequest(_0xfcaa4e(0x1ae),{'method':_0xfcaa4e(0x180),'body':{'appCode':_0x1b4825,..._0x28510d}});return _0x321a1c[_0xfcaa4e(0x14a)];}export async function updateRuntimeArtifact(_0x50ef92,_0x4c01ea,_0x119070){const _0x122d1d=a75_0xc8b5,_0x3648fc=await apiRequest(_0x122d1d(0x1ac)+_0x50ef92+_0x122d1d(0x1bd),{'method':_0x122d1d(0x180),'body':{'appCode':_0x4c01ea,..._0x119070}});return _0x3648fc[_0x122d1d(0x14a)];}export async function listPersonalBffs(_0x430e1e){const _0x3ebb4a=a75_0xc8b5,_0x543fb8=await apiRequest(_0x3ebb4a(0x1b6)+encodeURIComponent(_0x430e1e));return Array[_0x3ebb4a(0x162)](_0x543fb8[_0x3ebb4a(0x14a)])?_0x543fb8[_0x3ebb4a(0x14a)]:[];}export async function getPersonalBff(_0xe40d24,_0x25770f){const _0xdff862=a75_0xc8b5,_0x32737f=await apiRequest(_0xdff862(0x142)+_0xe40d24+'?appCode='+encodeURIComponent(_0x25770f));if(!_0x32737f[_0xdff862(0x14a)])throw CliErrors[_0xdff862(0x16b)](_0xdff862(0x1a4)+_0xe40d24);return _0x32737f[_0xdff862(0x14a)];}export async function createPersonalBff(_0x5125c8,_0x47f99d){const _0x12acea=a75_0xc8b5,_0x33d0db=await apiRequest(_0x12acea(0x13a),{'method':'POST','body':{'appCode':_0x5125c8,..._0x47f99d}});return _0x33d0db[_0x12acea(0x14a)];}export async function updatePersonalBff(_0x9813bf,_0xbf5ced,_0x487191){const _0x84e984=a75_0xc8b5,_0x493501=await apiRequest(_0x84e984(0x142)+_0x9813bf+_0x84e984(0x1bd),{'method':_0x84e984(0x180),'body':{'appCode':_0xbf5ced,..._0x487191}});return _0x493501[_0x84e984(0x14a)];}export async function executePersonalBff(_0x550d4b,_0x3bcfaf,_0x2b19b3){const _0x29cc8d=a75_0xc8b5,_0x5bc3f2=await apiRequest(_0x29cc8d(0x142)+_0x550d4b+_0x29cc8d(0x183)+encodeURIComponent(_0x3bcfaf),{'method':'POST','body':_0x2b19b3});return _0x5bc3f2['data'];}export async function listPersonalKnowledgeBaseItems(_0x357342){const _0x4db851=a75_0xc8b5,_0x2450d9=await apiRequest('/client/knowledge-base/personal/list?appCode='+encodeURIComponent(_0x357342));return Array[_0x4db851(0x162)](_0x2450d9[_0x4db851(0x14a)])?_0x2450d9[_0x4db851(0x14a)]:[];}export async function getPersonalKnowledgeBaseItem(_0xf6ead,_0x2cbe65){const _0xa91a3f=a75_0xc8b5,_0x4533e3=await apiRequest('/client/knowledge-base/personal/'+_0xf6ead+_0xa91a3f(0x17f)+encodeURIComponent(_0x2cbe65));if(!_0x4533e3[_0xa91a3f(0x14a)])throw CliErrors[_0xa91a3f(0x16b)](_0xa91a3f(0x150)+_0xf6ead);return _0x4533e3['data'];}export async function createPersonalKnowledgeBaseItem(_0x26b101,_0x453616){const _0x180c2a=a75_0xc8b5,_0x3c70d9=await apiRequest(_0x180c2a(0x1c0),{'method':_0x180c2a(0x180),'body':{'appCode':_0x26b101,..._0x453616}});return _0x3c70d9['data'];}function a75_0xc8b5(_0x3ee0c5,_0xf31aa3){_0x3ee0c5=_0x3ee0c5-0x12b;const _0x27ad98=a75_0x27ad();let _0xc8b5f1=_0x27ad98[_0x3ee0c5];return _0xc8b5f1;}export async function updatePersonalKnowledgeBaseItem(_0x335143,_0x4651ce,_0xe9e661){const _0xff7e89=a75_0xc8b5,_0x1e0306=await apiRequest(_0xff7e89(0x1a9)+_0x335143+_0xff7e89(0x1bd),{'method':'POST','body':{'appCode':_0x4651ce,..._0xe9e661}});return _0x1e0306[_0xff7e89(0x14a)];}export async function searchKnowledgeBase(_0x2f6c2d,_0x4d4502){const _0x1f65b4=a75_0xc8b5,_0x27564c=await apiRequest(_0x1f65b4(0x152),{'method':_0x1f65b4(0x180),'body':{'appCode':_0x2f6c2d,'query':_0x4d4502[_0x1f65b4(0x169)],..._0x4d4502[_0x1f65b4(0x194)]!==undefined?{'topK':_0x4d4502[_0x1f65b4(0x194)]}:{}}});return Array[_0x1f65b4(0x162)](_0x27564c[_0x1f65b4(0x14a)])?_0x27564c['data']:[];}function a75_0x27ad(){const _0x1ccc5c=['/client/knowledge-base/personal/','/skills','/api/node-toolbox/','/client/artifact/','2952AIJVJc','/client/artifact/create','/client/bff/endpoint/','newConfigFileName','undefined','trim','623706bZELzJ','errors','set','/client/runtime-bff/personal/list?appCode=','Configure\x20accessKey\x20in\x20','API\x20error\x20code:\x20','84YuDyOj','application/octet-stream','publishedVersion','warnings','/update','api-doc-generator','application/zip','/client/knowledge-base/personal/create','scope','success','/client/app-config/getByKey?','/client/sql/query','searchParams','SQL\x20query\x20not\x20found:\x20','GET','confirmWarnings','PRIVATE','summary','Request\x20timeout:\x20','code','/client/uploadFile','slug','Artifact\x20not\x20found:\x20id=','namespace','.zip','/client/runtime-bff/personal/create','appName','values','appCode','authRequired','NAMESPACE_ONLY','/client/ocr','company','/client/runtime-bff/personal/','content','base64','items','Missing\x20Skill\x20package\x20payload.','gmtModified','invokeSource','error','data','replace','number','Toolbox\x20API\x20error:\x20','personal','filter','Knowledge-base\x20entry\x20not\x20found:\x20id=','/client/dataset/list','/client/knowledge-base/search','type','object','json','packageBase64','abort','functionName','displayName','errorCode','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','message','string','5962302ZSGGTQ','BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','220xHvjFz','Invalid\x20app\x20config\x20value:\x20key=','isArray','version','source','functions','application/json','url','3766zhfuzS','query','/publish','validation','toLowerCase','skillCode','tags','SkillHub\x20error\x20code:\x20','/client/app/my-apps','apiError','effective','valid','Check\x20your\x20credentials\x20and\x20try\x20again.','SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20','entries','30emPcuw','favorite','API\x20error:\x20','Toolbox\x20error\x20code:\x20','text','artifactType','skill','join','?appCode=','POST','visibility','skillName','/execute?appCode=','ownerPreviewVersion','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','status','find','arrayBuffer','msg',',\x20name=','/publish/validate','740686oqSqYQ','errorMsg','toString','554807TwMHNx','from','SkillHub\x20API\x20error:\x20','/client/user/loginUserInfo','headers','topK','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','51465Skkwea','Download\x20failed:\x20','/client/artifact/list?','signal','append','191995LNxTga','resolvedVersion','description','/api/runtime/v1/namespaces/','/download','/versions/','markdown','AbortError','/api/cli/v1/skills/','Personal\x20BFF\x20not\x20found:\x20id=','boolean','tableData','name','isJson'];a75_0x27ad=function(){return _0x1ccc5c;};return a75_0x27ad();}export async function getRuntimeSkillByCode(_0xf5df64,_0x4596ca){const _0x84dc9b=await skillHubJsonRequest('/api/v1/skills/'+encodeURIComponent(_0xf5df64)+'/'+encodeURIComponent(_0x4596ca),{'allowNotFound':!![]});return _0x84dc9b?skillHubRuntimeDetailToRuntimeSkill(_0x84dc9b):undefined;}export async function listRuntimeSkills(_0x271a13){const _0x4b922c=a75_0xc8b5,_0xc505ef=await skillHubJsonRequest(_0x4b922c(0x19e)+encodeURIComponent(_0x271a13[_0x4b922c(0x13d)])+_0x4b922c(0x1aa),{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x271a13[_0x4b922c(0x13d)],_0xc505ef,_0x271a13[_0x4b922c(0x1c1)]??'all',_0x271a13[_0x4b922c(0x134)]);}export async function listPersonalRuntimeSkills(_0x234931){const _0x1f32d3=a75_0xc8b5;return(await listRuntimeSkills({'appCode':_0x234931,'scope':_0x1f32d3(0x14e)}))[_0x1f32d3(0x14e)];}export async function listCompanyRuntimeSkills(_0x5cfe8c){const _0x2f9df3=a75_0xc8b5;return(await listRuntimeSkills({'appCode':_0x5cfe8c,'scope':_0x2f9df3(0x141)}))[_0x2f9df3(0x141)];}export async function listVisibleRuntimeSkills(_0x5deba6){return(await listRuntimeSkills({'appCode':_0x5deba6,'scope':'all'}))['effective'];}export async function createPersonalRuntimeSkill(_0x51c964,_0x16e901,_0x4e9884={}){const _0x13bf34=a75_0xc8b5;return publishRuntimeSkill(_0x51c964,_0x16e901,{'visibility':_0x13bf34(0x131),'confirmWarnings':_0x4e9884[_0x13bf34(0x130)]});}export async function updatePersonalRuntimeSkill(_0x25e8bf,_0x56529e,_0x2b7e63,_0x427f8d={}){const _0x133dcd=a75_0xc8b5;return publishRuntimeSkill(_0x56529e,{..._0x2b7e63,'skillCode':_0x2b7e63[_0x133dcd(0x16d)]??_0x25e8bf},{'visibility':'PRIVATE','confirmWarnings':_0x427f8d[_0x133dcd(0x130)]});}export async function publishCompanyRuntimeSkill(_0x3a2d00,_0x469ef8,_0x47699c={}){const _0xde2ace=a75_0xc8b5;return publishRuntimeSkill(_0x3a2d00,_0x469ef8,{'visibility':_0xde2ace(0x13f),'confirmWarnings':_0x47699c[_0xde2ace(0x130)]});}export async function validateRuntimeSkillPublish(_0x1bb91d,_0x43555a,_0x33262c){const _0x406a61=a75_0xc8b5,_0x43862a=buildRuntimeSkillPublishForm(_0x43555a,_0x33262c['visibility']),_0x680db2=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0x1bb91d)+_0x406a61(0x18b),{'method':_0x406a61(0x180),'body':_0x43862a});return{'valid':_0x680db2[_0x406a61(0x173)]===!![],'errors':Array[_0x406a61(0x162)](_0x680db2[_0x406a61(0x1b4)])?_0x680db2[_0x406a61(0x1b4)]:[],'warnings':Array[_0x406a61(0x162)](_0x680db2[_0x406a61(0x1bc)])?_0x680db2[_0x406a61(0x1bc)]:[],'resolvedSlug':_0x680db2['resolvedSlug'],'resolvedVersion':_0x680db2[_0x406a61(0x19c)]};}export async function downloadRuntimeSkillPackage(_0x3353ce,_0x471f74,_0x34f0aa,_0x5a3082){const _0x58d652=a75_0xc8b5;void _0x3353ce;const _0x344b12=_0x5a3082?_0x58d652(0x1a3)+encodeURIComponent(_0x34f0aa)+'/'+encodeURIComponent(_0x471f74)+_0x58d652(0x1a0)+encodeURIComponent(_0x5a3082)+_0x58d652(0x19f):'/api/cli/v1/skills/'+encodeURIComponent(_0x34f0aa)+'/'+encodeURIComponent(_0x471f74)+_0x58d652(0x19f);return skillHubBinaryRequest(_0x344b12);}async function publishRuntimeSkill(_0x1834d0,_0x45565f,_0x18aa2d){const _0x54aa08=a75_0xc8b5,_0x5a0191=buildRuntimeSkillPublishForm(_0x45565f,_0x18aa2d[_0x54aa08(0x181)]),_0x3ae2a0=await skillHubJsonRequest(_0x54aa08(0x1a3)+encodeURIComponent(_0x1834d0)+_0x54aa08(0x16a),{'method':_0x54aa08(0x180),'query':{'confirmWarnings':_0x18aa2d['confirmWarnings']===!![]?!![]:undefined},'body':_0x5a0191});return{'appCode':_0x3ae2a0['namespace']??_0x1834d0,'skillCode':_0x3ae2a0[_0x54aa08(0x136)]??_0x45565f[_0x54aa08(0x16d)]??'','skillName':_0x45565f[_0x54aa08(0x182)]??_0x3ae2a0[_0x54aa08(0x136)]??_0x45565f['skillCode'],'description':_0x45565f[_0x54aa08(0x19d)],'scope':skillHubVisibilityToScope(_0x3ae2a0[_0x54aa08(0x181)]??_0x18aa2d[_0x54aa08(0x181)])??_0x54aa08(0x14e),'version':_0x3ae2a0['version']??_0x45565f[_0x54aa08(0x163)],'tags':_0x45565f[_0x54aa08(0x16e)],'content':_0x45565f[_0x54aa08(0x143)]};}function buildRuntimeSkillPublishForm(_0x5142e9,_0x341335){const _0x22cda1=a75_0xc8b5,_0x3dd5bd=new FormData();return _0x3dd5bd[_0x22cda1(0x1b5)]('file',runtimeSkillPackageFile(_0x5142e9)),_0x5142e9[_0x22cda1(0x182)]?.[_0x22cda1(0x1b2)]()&&_0x3dd5bd[_0x22cda1(0x1b5)]('displayName',_0x5142e9[_0x22cda1(0x182)]['trim']()),_0x3dd5bd[_0x22cda1(0x1b5)](_0x22cda1(0x181),_0x341335),_0x3dd5bd;}function runtimeSkillPackageFile(_0x4249d4){const _0x210e42=a75_0xc8b5;if(!_0x4249d4[_0x210e42(0x156)])throw CliErrors['validation'](_0x210e42(0x146));const _0x4c2fcd=Buffer[_0x210e42(0x190)](_0x4249d4[_0x210e42(0x156)],_0x210e42(0x144)),_0x11878e=new Blob([_0x4c2fcd],{'type':_0x210e42(0x1bf)}),_0x4028e9=(_0x4249d4[_0x210e42(0x16d)]||_0x210e42(0x17d))+_0x210e42(0x139);if(typeof File!==_0x210e42(0x1b1))return new File([_0x11878e],_0x4028e9,{'type':'application/zip'});return _0x11878e;}function normalizeSkillHubRuntimeListResponse(_0x79adac,_0x1fd32f,_0x471da3,_0x174376){const _0x58592c=a75_0xc8b5,_0x10bde2=Array[_0x58592c(0x162)](_0x1fd32f)?_0x1fd32f:Array[_0x58592c(0x162)](_0x1fd32f?.[_0x58592c(0x145)])?_0x1fd32f[_0x58592c(0x145)]:[],_0x13ec73=_0x174376?.[_0x58592c(0x1b2)](),_0x59409e=_0x10bde2[_0x58592c(0x14f)](_0x4007c4=>!_0x13ec73||_0x4007c4[_0x58592c(0x136)]===_0x13ec73)['map'](skillHubRuntimeItemToRuntimeSkill)[_0x58592c(0x14f)](_0x33c3e9=>Boolean(_0x33c3e9)),_0x2fc33a=_0x59409e[_0x58592c(0x14f)](_0x406f80=>_0x406f80[_0x58592c(0x1c1)]===_0x58592c(0x14e)),_0x2b5197=_0x59409e[_0x58592c(0x14f)](_0x249191=>_0x249191[_0x58592c(0x1c1)]===_0x58592c(0x141));return{'appCode':_0x79adac,'personal':_0x471da3===_0x58592c(0x141)?[]:_0x2fc33a,'company':_0x471da3==='personal'?[]:_0x2b5197,'effective':buildEffectiveRuntimeSkills(_0x2fc33a,_0x2b5197,_0x471da3)};}function skillHubRuntimeItemToRuntimeSkill(_0x2ca623){const _0x5ba448=a75_0xc8b5,_0x4f8cf8=_0x2ca623[_0x5ba448(0x136)]?.[_0x5ba448(0x1b2)](),_0x4d387b=skillHubVisibilityToScope(_0x2ca623[_0x5ba448(0x181)]);if(!_0x4f8cf8||!_0x4d387b)return undefined;return{'id':_0x2ca623['id'],'appCode':_0x2ca623['namespace'],'skillCode':_0x4f8cf8,'skillName':_0x2ca623[_0x5ba448(0x159)]??_0x4f8cf8,'description':_0x2ca623[_0x5ba448(0x132)],'scope':_0x4d387b,'version':skillHubRuntimeItemVersion(_0x2ca623),'status':_0x2ca623['status']};}function skillHubRuntimeDetailToRuntimeSkill(_0x5e34d7){const _0x256d03=a75_0xc8b5,_0x3c0f89=_0x5e34d7[_0x256d03(0x136)]?.[_0x256d03(0x1b2)]();if(!_0x3c0f89)return undefined;return{'id':_0x5e34d7['id'],'appCode':_0x5e34d7[_0x256d03(0x138)],'skillCode':_0x3c0f89,'skillName':_0x5e34d7[_0x256d03(0x159)]??_0x3c0f89,'description':_0x5e34d7[_0x256d03(0x132)],'example':_0x5e34d7['example'],'scope':skillHubVisibilityToScope(_0x5e34d7[_0x256d03(0x181)])??_0x5e34d7[_0x256d03(0x181)]?.[_0x256d03(0x16c)](),'version':skillHubRuntimeItemVersion(_0x5e34d7),'status':_0x5e34d7[_0x256d03(0x186)]};}function skillHubVisibilityToScope(_0x46eba6){const _0x42f48a=a75_0xc8b5;if(_0x46eba6===_0x42f48a(0x131))return'personal';if(_0x46eba6===_0x42f48a(0x13f))return _0x42f48a(0x141);return undefined;}function skillHubRuntimeItemVersion(_0x43ebbb){const _0x4f57b1=a75_0xc8b5;return _0x43ebbb[_0x4f57b1(0x1bb)]?.[_0x4f57b1(0x163)]??_0x43ebbb['headlineVersion']?.[_0x4f57b1(0x163)]??_0x43ebbb[_0x4f57b1(0x184)]?.[_0x4f57b1(0x163)];}function buildEffectiveRuntimeSkills(_0x5241f6,_0x197866,_0x34a0fa){const _0x48c28f=a75_0xc8b5;if(_0x34a0fa===_0x48c28f(0x14e))return _0x5241f6;if(_0x34a0fa===_0x48c28f(0x141))return _0x197866;const _0x283d4d=new Map();for(const _0x4567e8 of _0x197866){_0x283d4d[_0x48c28f(0x1b5)](_0x4567e8['skillCode'],_0x4567e8);}for(const _0x3475cf of _0x5241f6){_0x283d4d[_0x48c28f(0x1b5)](_0x3475cf[_0x48c28f(0x16d)],_0x3475cf);}return Array[_0x48c28f(0x190)](_0x283d4d[_0x48c28f(0x13c)]());}function normalizeRuntimeSkillListResponse(_0x41a9e3,_0x3e32b6){const _0x5d9be8=a75_0xc8b5;if(Array[_0x5d9be8(0x162)](_0x3e32b6)){const _0x1ab4bc=_0x3e32b6[_0x5d9be8(0x14f)](_0x289f60=>_0x289f60[_0x5d9be8(0x1c1)]===_0x5d9be8(0x14e)),_0x69acb7=_0x3e32b6[_0x5d9be8(0x14f)](_0x5bab62=>_0x5bab62[_0x5d9be8(0x1c1)]===_0x5d9be8(0x141));return{'appCode':_0x41a9e3,'personal':_0x1ab4bc,'company':_0x69acb7,'effective':[..._0x69acb7,..._0x1ab4bc]};}return{'appCode':_0x3e32b6?.[_0x5d9be8(0x13d)]??_0x41a9e3,'personal':Array[_0x5d9be8(0x162)](_0x3e32b6?.['personal'])?_0x3e32b6['personal']:[],'company':Array[_0x5d9be8(0x162)](_0x3e32b6?.[_0x5d9be8(0x141)])?_0x3e32b6[_0x5d9be8(0x141)]:[],'effective':Array[_0x5d9be8(0x162)](_0x3e32b6?.[_0x5d9be8(0x172)])?_0x3e32b6[_0x5d9be8(0x172)]:[]};}
1
+ (function(_0x4e166d,_0x27bb90){const _0x2b591c=a76_0x10a8,_0xbea22=_0x4e166d();while(!![]){try{const _0xa75a8=-parseInt(_0x2b591c(0x195))/0x1+parseInt(_0x2b591c(0x129))/0x2+-parseInt(_0x2b591c(0x1b0))/0x3+-parseInt(_0x2b591c(0x150))/0x4*(parseInt(_0x2b591c(0x186))/0x5)+parseInt(_0x2b591c(0x11f))/0x6*(-parseInt(_0x2b591c(0x142))/0x7)+-parseInt(_0x2b591c(0x1b9))/0x8*(-parseInt(_0x2b591c(0x12f))/0x9)+parseInt(_0x2b591c(0x140))/0xa;if(_0xa75a8===_0x27bb90)break;else _0xbea22['push'](_0xbea22['shift']());}catch(_0x357137){_0xbea22['push'](_0xbea22['shift']());}}}(a76_0x75c2,0xeebd5));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{createRateLimitError,readRetryAfter,readRetryAfterSeconds}from'../framework/rate-limit.js';import{extractList}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x25d074){_activeAK=_0x25d074||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0xbca451){const _0x101b53=a76_0x10a8;for(const _0x3a1b52 of _0xbca451){if(typeof _0x3a1b52==='string'&&_0x3a1b52[_0x101b53(0x143)]())return _0x3a1b52[_0x101b53(0x143)]();}return undefined;}async function decodeResponseBody(_0x5eb98a){const _0x48a238=a76_0x10a8;if(typeof _0x5eb98a[_0x48a238(0x16d)]===_0x48a238(0x197))try{const _0x2156ad=await _0x5eb98a[_0x48a238(0x16d)]();try{return{'isJson':!![],'data':parseLosslessJson(_0x2156ad),'text':_0x2156ad};}catch{return{'isJson':![],'text':_0x2156ad[_0x48a238(0x143)]()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x5eb98a[_0x48a238(0x12a)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x92e400,_0x3f8dac,_0x112ba7){const _0x19d101=a76_0x10a8,_0x4b8518=_0x3f8dac&&typeof _0x3f8dac===_0x19d101(0x155)?_0x3f8dac:{},_0x7320e4=[_0x4b8518['status'],_0x4b8518[_0x19d101(0x131)]][_0x19d101(0x158)](_0x473eca=>Number(_0x473eca)===0x1ad),_0x1d257e=createRateLimitError({'status':_0x92e400[_0x19d101(0x1a2)]===0x1ad?_0x92e400[_0x19d101(0x1a2)]:_0x7320e4??_0x92e400[_0x19d101(0x1a2)],'errorCode':firstString(_0x4b8518[_0x19d101(0x1ae)],typeof _0x4b8518[_0x19d101(0x131)]===_0x19d101(0x1b7)?_0x4b8518[_0x19d101(0x131)]:undefined),'message':firstString(_0x4b8518[_0x19d101(0x122)],_0x4b8518['message'],_0x4b8518[_0x19d101(0x196)],_0x112ba7),'retryAfter':readRetryAfter(_0x92e400[_0x19d101(0x14e)])??readRetryAfterSeconds(_0x3f8dac)});if(_0x1d257e)throw _0x1d257e;}async function apiRequest(_0x2437f0,_0x19adaf={}){const _0x5d3067=a76_0x10a8,{method:method=_0x5d3067(0x1a8),body:_0x323f52,headers:headers={},timeout:timeout=0x7530}=_0x19adaf,_0xc10dca=_activeAK,_0x5bd51b=getRuntimeDomain();if(!_0xc10dca)throw CliErrors[_0x5d3067(0x12d)](_0x5d3067(0x16e)+PRODUCT_CONFIG[_0x5d3067(0x14a)]+'.');const _0x49b573=''+_0x5bd51b+_0x2437f0,_0x34729f={'X-User-AK':_0xc10dca},_0x3a5705=new AbortController(),_0x30aeda=setTimeout(()=>_0x3a5705[_0x5d3067(0x128)](),timeout);try{const _0x14c59e=await fetch(_0x49b573,{'method':method,'headers':{'Content-Type':_0x5d3067(0x16b),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],..._0x34729f,...headers},'body':_0x323f52?JSON[_0x5d3067(0x168)](_0x323f52):undefined,'signal':_0x3a5705[_0x5d3067(0x18a)]}),_0x59d3a6=await decodeResponseBody(_0x14c59e);if(!_0x59d3a6[_0x5d3067(0x156)]){throwIfRateLimited(_0x14c59e,undefined,_0x59d3a6[_0x5d3067(0x16d)]);throw CliErrors[_0x5d3067(0x190)](_0x5d3067(0x172)+_0x14c59e['status']+')',_0x14c59e[_0x5d3067(0x1a2)]>=0x190?_0x5d3067(0x167):undefined);}const _0xe0c28f=_0x59d3a6[_0x5d3067(0x132)];throwIfRateLimited(_0x14c59e,_0xe0c28f);if(!_0x14c59e['ok']||_0xe0c28f[_0x5d3067(0x164)]===![])throw CliErrors[_0x5d3067(0x190)](_0xe0c28f[_0x5d3067(0x122)]||_0xe0c28f[_0x5d3067(0x14b)]||_0x5d3067(0x1b6)+_0x14c59e[_0x5d3067(0x1a2)],_0xe0c28f[_0x5d3067(0x1ae)]?_0x5d3067(0x17b)+_0xe0c28f[_0x5d3067(0x1ae)]:undefined);return _0xe0c28f;}catch(_0x211c2a){if(_0x211c2a instanceof Error&&_0x211c2a[_0x5d3067(0x19f)]===_0x5d3067(0x138))throw CliErrors['apiError'](_0x5d3067(0x133)+_0x49b573);throw _0x211c2a;}finally{clearTimeout(_0x30aeda);}}async function apiBinaryRequest(_0x5e8ac7,_0x91c6bb={}){const _0x2c24d7=a76_0x10a8,{method:method='GET',headers:headers={},timeout:timeout=0x7530}=_0x91c6bb,_0x42b9c5=_activeAK,_0x3a4a04=getRuntimeDomain();if(!_0x42b9c5)throw CliErrors['authRequired'](_0x2c24d7(0x16e)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x16726d=''+_0x3a4a04+_0x5e8ac7,_0x17663e=new AbortController(),_0x5ba368=setTimeout(()=>_0x17663e['abort'](),timeout);try{const _0x560441=await fetch(_0x16726d,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x2c24d7(0x19e)],'X-User-AK':_0x42b9c5,...headers},'signal':_0x17663e[_0x2c24d7(0x18a)]});if(!_0x560441['ok']){const _0x4dc522=await decodeResponseBody(_0x560441),_0x1fd1db=_0x4dc522[_0x2c24d7(0x132)]&&typeof _0x4dc522[_0x2c24d7(0x132)]==='object'?_0x4dc522[_0x2c24d7(0x132)]:{},_0x3dd662=firstString(_0x1fd1db[_0x2c24d7(0x122)],_0x1fd1db[_0x2c24d7(0x14b)],_0x1fd1db[_0x2c24d7(0x1ae)],_0x4dc522[_0x2c24d7(0x16d)]);throwIfRateLimited(_0x560441,_0x4dc522[_0x2c24d7(0x132)],_0x3dd662);throw CliErrors['apiError'](_0x3dd662||_0x2c24d7(0x1b6)+_0x560441[_0x2c24d7(0x1a2)],'Download\x20failed:\x20'+_0x16726d);}return Buffer['from'](await _0x560441['arrayBuffer']());}catch(_0x57f7e5){if(_0x57f7e5 instanceof Error&&_0x57f7e5['name']===_0x2c24d7(0x138))throw CliErrors['apiError'](_0x2c24d7(0x133)+_0x16726d);throw _0x57f7e5;}finally{clearTimeout(_0x5ba368);}}async function apiFormRequest(_0x4d7a50,_0x3ccdad,_0x2e644d={}){const _0x4f8bcf=a76_0x10a8,{timeout:timeout=0x7530}=_0x2e644d,_0x29964a=_activeAK,_0x3df321=getRuntimeDomain();if(!_0x29964a)throw CliErrors['authRequired'](_0x4f8bcf(0x16e)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x423212=''+_0x3df321+_0x4d7a50,_0x253112=new AbortController(),_0x20c1ac=setTimeout(()=>_0x253112['abort'](),timeout);try{const _0x177115=await fetch(_0x423212,{'method':'POST','headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x4f8bcf(0x19e)],'X-User-AK':_0x29964a},'body':_0x3ccdad,'signal':_0x253112[_0x4f8bcf(0x18a)]}),_0x2eb60a=await decodeResponseBody(_0x177115);if(!_0x2eb60a[_0x4f8bcf(0x156)]){throwIfRateLimited(_0x177115,undefined,_0x2eb60a['text']);throw CliErrors[_0x4f8bcf(0x190)](_0x4f8bcf(0x172)+_0x177115['status']+')',_0x177115['status']>=0x190?_0x4f8bcf(0x167):undefined);}const _0x5042ba=_0x2eb60a[_0x4f8bcf(0x132)];throwIfRateLimited(_0x177115,_0x5042ba);if(!_0x177115['ok']||_0x5042ba[_0x4f8bcf(0x164)]===![])throw CliErrors[_0x4f8bcf(0x190)](_0x5042ba[_0x4f8bcf(0x122)]||_0x5042ba[_0x4f8bcf(0x14b)]||'API\x20error:\x20'+_0x177115[_0x4f8bcf(0x1a2)],_0x5042ba[_0x4f8bcf(0x1ae)]?'API\x20error\x20code:\x20'+_0x5042ba[_0x4f8bcf(0x1ae)]:undefined);return _0x5042ba;}catch(_0x195247){if(_0x195247 instanceof Error&&_0x195247['name']===_0x4f8bcf(0x138))throw CliErrors[_0x4f8bcf(0x190)](_0x4f8bcf(0x133)+_0x423212);throw _0x195247;}finally{clearTimeout(_0x20c1ac);}}async function toolboxRequest(_0x541598,_0x22e8af,_0x613ea6={}){const _0x43b935=a76_0x10a8,{method:method=_0x43b935(0x1a8),headers:headers={},timeout:timeout=0x7530}=_0x613ea6,_0x3a9509=_activeAK;if(!_0x3a9509)throw CliErrors[_0x43b935(0x12d)](_0x43b935(0x16e)+PRODUCT_CONFIG[_0x43b935(0x14a)]+'.');const _0x5553cf=getApiDomain()[_0x43b935(0x147)](/\/$/,''),_0x3ba636=new URL(_0x541598,_0x5553cf+_0x43b935(0x11d));if(_0x22e8af)for(const [_0x121f06,_0x4cb2a3]of Object[_0x43b935(0x144)](_0x22e8af)){_0x4cb2a3!==undefined&&_0x4cb2a3!==null&&_0x3ba636['searchParams'][_0x43b935(0x1b3)](_0x121f06,String(_0x4cb2a3));}const _0x5391f4=new AbortController(),_0x2d93ec=setTimeout(()=>_0x5391f4['abort'](),timeout);try{const _0x228475=await fetch(_0x3ba636,{'method':method,'headers':{'Content-Type':_0x43b935(0x16b),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x3a9509,...headers},'signal':_0x5391f4[_0x43b935(0x18a)]}),_0x1b49cb=await decodeResponseBody(_0x228475);if(!_0x1b49cb[_0x43b935(0x156)]){throwIfRateLimited(_0x228475,undefined,_0x1b49cb[_0x43b935(0x16d)]);throw CliErrors[_0x43b935(0x190)](_0x43b935(0x177)+_0x228475[_0x43b935(0x1a2)]+')',_0x228475[_0x43b935(0x1a2)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x5a7978=_0x1b49cb[_0x43b935(0x132)];throwIfRateLimited(_0x228475,_0x5a7978);if(!_0x228475['ok']){const _0x195655=_0x5a7978&&typeof _0x5a7978==='object'?_0x5a7978:{};throw CliErrors[_0x43b935(0x190)](_0x195655[_0x43b935(0x122)]||_0x195655[_0x43b935(0x14b)]||_0x43b935(0x125)+_0x228475[_0x43b935(0x1a2)],_0x195655[_0x43b935(0x1ae)]?_0x43b935(0x15c)+_0x195655[_0x43b935(0x1ae)]:undefined);}if(_0x5a7978&&typeof _0x5a7978===_0x43b935(0x155)&&'success'in _0x5a7978&&typeof _0x5a7978[_0x43b935(0x164)]===_0x43b935(0x13b)){const _0x6cc252=_0x5a7978;if(!_0x6cc252['success'])throw CliErrors['apiError'](_0x6cc252[_0x43b935(0x122)]||_0x6cc252[_0x43b935(0x14b)]||_0x43b935(0x17f),_0x6cc252[_0x43b935(0x1ae)]?'Toolbox\x20error\x20code:\x20'+_0x6cc252['errorCode']:undefined);return _0x6cc252[_0x43b935(0x132)];}return _0x5a7978;}catch(_0x1f42b0){if(_0x1f42b0 instanceof Error&&_0x1f42b0[_0x43b935(0x19f)]===_0x43b935(0x138))throw CliErrors[_0x43b935(0x190)](_0x43b935(0x133)+_0x3ba636[_0x43b935(0x17c)]());throw _0x1f42b0;}finally{clearTimeout(_0x2d93ec);}}async function skillHubJsonRequest(_0x2d5bef,_0x17d012={}){const _0x15def5=a76_0x10a8,{method:method=_0x15def5(0x1a8),query:_0x561cfe,body:_0x18a381,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x17d012,_0x44cda7=_activeAK;if(!_0x44cda7)throw CliErrors[_0x15def5(0x12d)](_0x15def5(0x16e)+PRODUCT_CONFIG[_0x15def5(0x14a)]+'.');const _0x28d7ae=getSkillHubDomain()['replace'](/\/$/,''),_0x2ba4d3=new URL(_0x2d5bef,_0x28d7ae+'/');if(_0x561cfe)for(const [_0x4b6c71,_0x55f0f6]of Object[_0x15def5(0x144)](_0x561cfe)){_0x55f0f6!==undefined&&_0x55f0f6!==null&&_0x2ba4d3['searchParams']['set'](_0x4b6c71,String(_0x55f0f6));}const _0x2e7550=new AbortController(),_0x500091=setTimeout(()=>_0x2e7550[_0x15def5(0x128)](),timeout);try{const _0x1e19fa=await fetch(_0x2ba4d3[_0x15def5(0x17c)](),{'method':method,'headers':{'Accept':_0x15def5(0x16b),'X-Invoke-Source':PRODUCT_CONFIG[_0x15def5(0x19e)],'X-User-AK':_0x44cda7,...headers},'body':_0x18a381,'signal':_0x2e7550['signal']}),_0x8dc795=await decodeResponseBody(_0x1e19fa);if(!_0x8dc795[_0x15def5(0x156)]){if(allowNotFound&&_0x1e19fa[_0x15def5(0x1a2)]===0x194)return undefined;throwIfRateLimited(_0x1e19fa,undefined,_0x8dc795[_0x15def5(0x16d)]);throw CliErrors[_0x15def5(0x190)]('SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1e19fa[_0x15def5(0x1a2)]+')',_0x1e19fa[_0x15def5(0x1a2)]>=0x190?_0x15def5(0x167):undefined);}const _0x50550c=_0x8dc795[_0x15def5(0x132)];throwIfRateLimited(_0x1e19fa,_0x50550c);if(allowNotFound&&isSkillHubNotFoundResponse(_0x1e19fa[_0x15def5(0x1a2)],_0x50550c))return undefined;const _0x326941=!_0x1e19fa['ok']||_0x50550c?.[_0x15def5(0x164)]===![]||typeof _0x50550c?.[_0x15def5(0x131)]===_0x15def5(0x15d)&&_0x50550c[_0x15def5(0x131)]>=0x190;if(_0x326941)throw CliErrors['apiError'](_0x50550c?.[_0x15def5(0x122)]||_0x50550c?.[_0x15def5(0x14b)]||_0x50550c?.[_0x15def5(0x196)]||'SkillHub\x20API\x20error:\x20'+_0x1e19fa[_0x15def5(0x1a2)],_0x50550c?.[_0x15def5(0x1ae)]?'SkillHub\x20error\x20code:\x20'+_0x50550c[_0x15def5(0x1ae)]:undefined);return _0x50550c?.[_0x15def5(0x132)]??_0x50550c;}catch(_0x9ad9ba){if(_0x9ad9ba instanceof Error&&_0x9ad9ba['name']==='AbortError')throw CliErrors[_0x15def5(0x190)]('Request\x20timeout:\x20'+_0x2ba4d3[_0x15def5(0x17c)]());throw _0x9ad9ba;}finally{clearTimeout(_0x500091);}}function isSkillHubNotFoundResponse(_0x879609,_0x3af4ec){const _0x47e562=a76_0x10a8;if(_0x879609===0x194||_0x3af4ec?.[_0x47e562(0x131)]===0x194)return!![];if(_0x879609!==0x190&&_0x3af4ec?.['code']!==0x190)return![];const _0x4ed8d1=[_0x3af4ec?.[_0x47e562(0x196)],_0x3af4ec?.['message'],_0x3af4ec?.['errorMsg'],_0x3af4ec?.[_0x47e562(0x1aa)]][_0x47e562(0x176)](_0x1c2e95=>typeof _0x1c2e95===_0x47e562(0x1b7))[_0x47e562(0x185)]('\x20');return/skill not found\b/i['test'](_0x4ed8d1);}async function skillHubBinaryRequest(_0xf9987,_0x18290c={}){const _0x253f0a=a76_0x10a8,{query:_0x4ca81e,headers:headers={},timeout:timeout=0x7530}=_0x18290c,_0x49f94d=_activeAK;if(!_0x49f94d)throw CliErrors[_0x253f0a(0x12d)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x253f0a(0x14a)]+'.');const _0x41d043=getSkillHubDomain()[_0x253f0a(0x147)](/\/$/,''),_0x4c59bc=new URL(_0xf9987,_0x41d043+'/');if(_0x4ca81e)for(const [_0x3215b3,_0x2989ac]of Object[_0x253f0a(0x144)](_0x4ca81e)){_0x2989ac!==undefined&&_0x2989ac!==null&&_0x4c59bc[_0x253f0a(0x14c)]['set'](_0x3215b3,String(_0x2989ac));}const _0x1f19f3=new AbortController(),_0x23f245=setTimeout(()=>_0x1f19f3['abort'](),timeout);try{const _0x2882bc=await fetch(_0x4c59bc[_0x253f0a(0x17c)](),{'method':_0x253f0a(0x1a8),'headers':{'Accept':_0x253f0a(0x1ab),'X-Invoke-Source':PRODUCT_CONFIG[_0x253f0a(0x19e)],'X-User-AK':_0x49f94d,...headers},'signal':_0x1f19f3['signal']});if(!_0x2882bc['ok']){const _0x802f0b=await decodeResponseBody(_0x2882bc),_0x34c24b=_0x802f0b['data']&&typeof _0x802f0b[_0x253f0a(0x132)]===_0x253f0a(0x155)?_0x802f0b[_0x253f0a(0x132)]:{},_0x4e0e0c=firstString(_0x34c24b[_0x253f0a(0x122)],_0x34c24b[_0x253f0a(0x14b)],_0x34c24b[_0x253f0a(0x196)],_0x34c24b[_0x253f0a(0x1ae)],_0x802f0b['text']);throwIfRateLimited(_0x2882bc,_0x802f0b['data'],_0x4e0e0c);throw CliErrors[_0x253f0a(0x190)](_0x4e0e0c||_0x253f0a(0x170)+_0x2882bc['status'],'Download\x20failed:\x20'+_0x4c59bc['toString']());}return Buffer[_0x253f0a(0x16f)](await _0x2882bc[_0x253f0a(0x1af)]());}catch(_0x2e0062){if(_0x2e0062 instanceof Error&&_0x2e0062['name']===_0x253f0a(0x138))throw CliErrors['apiError'](_0x253f0a(0x133)+_0x4c59bc['toString']());throw _0x2e0062;}finally{clearTimeout(_0x23f245);}}export async function getBffEndpointContract(_0x5ca55e,_0x237198){const _0x333a21=a76_0x10a8;if(_0x237198==='functions')throw CliErrors[_0x333a21(0x146)]('BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode='+_0x5ca55e+_0x333a21(0x161)+_0x237198);const _0xc12e2d=await apiRequest(_0x333a21(0x163)+encodeURIComponent(_0x5ca55e)+'/'+encodeURIComponent(_0x237198)),_0x122270=_0xc12e2d[_0x333a21(0x132)];if(!_0x122270||typeof _0x122270!==_0x333a21(0x155)||Array[_0x333a21(0x178)](_0x122270)||_0x122270['appCode']!==_0x5ca55e||_0x122270[_0x333a21(0x141)]!==_0x237198)throw CliErrors[_0x333a21(0x146)](_0x333a21(0x182)+_0x5ca55e+_0x333a21(0x161)+_0x237198);return{'appCode':_0x122270['appCode'],'functionName':_0x122270[_0x333a21(0x141)],'description':_0x122270[_0x333a21(0x165)],'version':_0x122270[_0x333a21(0x15b)],'gmtModified':_0x122270[_0x333a21(0x1a6)]};}export async function getSqlQueryInfo(_0x2f39c5,_0x99fc03){const _0x5923c6=a76_0x10a8,_0x5de1e2=await apiRequest('/client/sql/query',{'method':'POST','body':{'appCode':_0x2f39c5,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x99fc03}}),_0x3e096b=_0x5de1e2[_0x5923c6(0x132)],_0x5e6b13=_0x3e096b&&typeof _0x3e096b===_0x5923c6(0x155)&&'tableData'in _0x3e096b?_0x3e096b[_0x5923c6(0x180)]?.[0x0]:_0x3e096b&&typeof _0x3e096b===_0x5923c6(0x155)&&_0x5923c6(0x18f)in _0x3e096b?_0x3e096b:undefined;if(!_0x5e6b13)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x99fc03);return _0x5e6b13;}function isRemoteAppItem(_0x3bdf34){const _0x5871d6=a76_0x10a8;return!!_0x3bdf34&&typeof _0x3bdf34===_0x5871d6(0x155)&&typeof _0x3bdf34[_0x5871d6(0x13e)]===_0x5871d6(0x1b7)&&typeof _0x3bdf34['appName']===_0x5871d6(0x1b7);}function extractRemoteAppItems(_0x415877){const _0xba1cae=a76_0x10a8;if(Array[_0xba1cae(0x178)](_0x415877))return _0x415877[_0xba1cae(0x176)](isRemoteAppItem);if(!_0x415877||typeof _0x415877!==_0xba1cae(0x155))throw CliErrors[_0xba1cae(0x190)](_0xba1cae(0x174));const _0x5467d6=_0x415877;if(Array['isArray'](_0x5467d6[_0xba1cae(0x180)]))return _0x5467d6[_0xba1cae(0x180)][_0xba1cae(0x176)](isRemoteAppItem);if(_0x5467d6[_0xba1cae(0x132)]&&typeof _0x5467d6[_0xba1cae(0x132)]==='object'){const _0x84dcb9=_0x5467d6[_0xba1cae(0x132)];if(Array[_0xba1cae(0x178)](_0x84dcb9[_0xba1cae(0x180)]))return _0x84dcb9[_0xba1cae(0x180)][_0xba1cae(0x176)](isRemoteAppItem);}throw CliErrors[_0xba1cae(0x190)](_0xba1cae(0x1a5));}export async function getMyApps(){const _0x3bfdd2=a76_0x10a8,_0x2cb3d7=await apiRequest('/client/app/my-apps');return extractRemoteAppItems(_0x2cb3d7[_0x3bfdd2(0x132)]);}export async function getLoginUserInfo(){const _0x434fd3=a76_0x10a8,_0x5c027c=await apiRequest(_0x434fd3(0x17a));if(!_0x5c027c[_0x434fd3(0x132)]||typeof _0x5c027c[_0x434fd3(0x132)]!==_0x434fd3(0x155)||Array['isArray'](_0x5c027c['data']))throw CliErrors[_0x434fd3(0x190)](_0x434fd3(0x17e));return _0x5c027c[_0x434fd3(0x132)];}function runtimeSchedulePath(_0x1d6dfc,_0x258e89=''){const _0x3f8543=a76_0x10a8;return _0x3f8543(0x169)+encodeURIComponent(_0x1d6dfc)+'/schedules'+_0x258e89;}export async function validateRuntimeSchedule(_0x447bec,_0x1d3daf){const _0x1a92fc=a76_0x10a8,_0x43c457=await apiRequest(runtimeSchedulePath(_0x447bec,_0x1a92fc(0x148)),{'method':_0x1a92fc(0x17d),'body':_0x1d3daf});return _0x43c457['data'];}export async function createRuntimeSchedule(_0x1c4cca,_0x3eaad7){const _0x5dd319=await apiRequest(runtimeSchedulePath(_0x1c4cca),{'method':'POST','body':_0x3eaad7});return _0x5dd319['data'];}export async function listRuntimeSchedules(_0x216df7,_0x489f39={}){const _0x56c141=a76_0x10a8,_0x2e8154=new URLSearchParams();if(_0x489f39[_0x56c141(0x1ac)]!==undefined)_0x2e8154['set'](_0x56c141(0x1ac),String(_0x489f39[_0x56c141(0x1ac)]));if(_0x489f39[_0x56c141(0x193)])_0x2e8154[_0x56c141(0x1b3)]('cursor',_0x489f39[_0x56c141(0x193)]);const _0x32b517=_0x2e8154[_0x56c141(0x19a)]>0x0?'?'+_0x2e8154['toString']():'',_0x2374a7=await apiRequest(''+runtimeSchedulePath(_0x216df7)+_0x32b517);return _0x2374a7[_0x56c141(0x132)];}export async function getRuntimeSchedule(_0x4cb5b4,_0x171501){const _0xf0bbab=a76_0x10a8,_0x548fc1=await apiRequest(runtimeSchedulePath(_0x4cb5b4,'/'+encodeURIComponent(_0x171501)));return _0x548fc1[_0xf0bbab(0x132)];}export async function deleteRuntimeSchedule(_0x2ef502,_0x426093){const _0x55ab57=a76_0x10a8,_0xbd6283=await apiRequest(runtimeSchedulePath(_0x2ef502,'/'+encodeURIComponent(_0x426093)),{'method':_0x55ab57(0x136)});return _0xbd6283[_0x55ab57(0x132)];}export async function runRuntimeSchedule(_0x54a14d,_0x4ad435){const _0x11357b=a76_0x10a8,_0x5687fe=await apiRequest(runtimeSchedulePath(_0x54a14d,'/'+encodeURIComponent(_0x4ad435)+_0x11357b(0x1b5)),{'method':_0x11357b(0x17d)});return _0x5687fe[_0x11357b(0x132)];}export async function listDatasets(_0x4c82ed,_0x3db8ec){const _0xb84097=a76_0x10a8,_0x394a34=await apiRequest(_0xb84097(0x13a),{'method':_0xb84097(0x17d),'body':{'appCode':_0x4c82ed,..._0x3db8ec?.['code']&&{'code':_0x3db8ec[_0xb84097(0x131)]},..._0x3db8ec?.[_0xb84097(0x19f)]&&{'name':_0x3db8ec[_0xb84097(0x19f)]}}});return extractList(_0x394a34[_0xb84097(0x132)]);}export async function getDatasetDetail(_0x2e7de9){const _0x51cd6c=a76_0x10a8,_0x34b239=await apiRequest(_0x51cd6c(0x18c)+encodeURIComponent(_0x2e7de9));return _0x34b239[_0x51cd6c(0x132)];}export async function getDatasetSdkUsageDoc(_0x1fe33f,_0x5eaeb6){const _0x40aec2=a76_0x10a8,_0xc6451e=await toolboxRequest(_0x40aec2(0x135),{'datasetCode':_0x1fe33f,'appCode':_0x5eaeb6});return typeof _0xc6451e?.[_0x40aec2(0x189)]===_0x40aec2(0x1b7)?_0xc6451e[_0x40aec2(0x189)]:'';}export async function uploadRuntimeFile(_0x5779f6,_0x3cebf4){const _0x14c708=a76_0x10a8,_0xc64217=await readFile(_0x3cebf4),_0x4a1663=new FormData();_0x4a1663['append']('appCode',_0x5779f6),_0x4a1663[_0x14c708(0x15a)](_0x14c708(0x1b1),new Blob([new Uint8Array(_0xc64217)]),basename(_0x3cebf4));const _0x3331ec=await apiFormRequest(_0x14c708(0x154),_0x4a1663);return _0x3331ec[_0x14c708(0x132)];}export async function queryRuntimeFileUrl(_0x52f4c1,_0x453ca7={}){const _0x2f2e43=a76_0x10a8,_0x2b2fba=await apiRequest(_0x2f2e43(0x183),{'method':_0x2f2e43(0x17d),'body':{'filePath':_0x52f4c1,'downloadFlag':_0x453ca7[_0x2f2e43(0x139)]??![],..._0x453ca7[_0x2f2e43(0x18b)]?{'longTerm':!![]}:{}}});return _0x2b2fba[_0x2f2e43(0x132)];}export async function recognizeRuntimeOcr(_0x342eae,_0x7978f7){const _0x2a36c0=a76_0x10a8,_0x5a0cfa=await apiRequest(_0x2a36c0(0x19d),{'method':_0x2a36c0(0x17d),'body':{'appCode':_0x342eae,'url':_0x7978f7['url'],'type':_0x7978f7[_0x2a36c0(0x12b)]}});return _0x5a0cfa[_0x2a36c0(0x132)];}export async function getRuntimeAppConfigByKey(_0x4e7c76,_0x570336){const _0xbeaab1=a76_0x10a8,_0x512802=new URLSearchParams({'appCode':_0x4e7c76,'key':_0x570336}),_0x45d76e=await apiRequest('/client/app-config/getByKey?'+_0x512802[_0xbeaab1(0x17c)]());if(typeof _0x45d76e[_0xbeaab1(0x132)]!==_0xbeaab1(0x1b7))throw CliErrors['validation']('Invalid\x20app\x20config\x20value:\x20key='+_0x570336);return _0x45d76e[_0xbeaab1(0x132)];}export async function listRuntimeArtifacts(_0x3d3dac,_0x262549){const _0x1d7d9b=a76_0x10a8,_0x3c4074=new URLSearchParams({'appCode':_0x3d3dac});if(_0x262549?.[_0x1d7d9b(0x1a7)])_0x3c4074[_0x1d7d9b(0x1b3)](_0x1d7d9b(0x1a7),_0x262549[_0x1d7d9b(0x1a7)]);if(_0x262549?.['source'])_0x3c4074[_0x1d7d9b(0x1b3)](_0x1d7d9b(0x188),_0x262549['source']);if(_0x262549?.[_0x1d7d9b(0x179)]!==undefined)_0x3c4074[_0x1d7d9b(0x1b3)]('favorite',String(_0x262549[_0x1d7d9b(0x179)]));const _0x14b6f2=await apiRequest(_0x1d7d9b(0x18d)+_0x3c4074['toString']());return Array[_0x1d7d9b(0x178)](_0x14b6f2[_0x1d7d9b(0x132)])?_0x14b6f2[_0x1d7d9b(0x132)]:[];}export async function getRuntimeArtifact(_0x4151de,_0x17917d){const _0x3dee00=a76_0x10a8,_0x1b151d=await apiRequest(_0x3dee00(0x175)+_0x4151de+_0x3dee00(0x166)+encodeURIComponent(_0x17917d));if(!_0x1b151d[_0x3dee00(0x132)])throw CliErrors[_0x3dee00(0x146)](_0x3dee00(0x19b)+_0x4151de);return _0x1b151d[_0x3dee00(0x132)];}export async function createRuntimeArtifact(_0x26b5ae,_0xaa3438){const _0x377228=a76_0x10a8,_0x374755=await apiRequest(_0x377228(0x1a0),{'method':_0x377228(0x17d),'body':{'appCode':_0x26b5ae,..._0xaa3438}});return _0x374755[_0x377228(0x132)];}export async function updateRuntimeArtifact(_0x4819c2,_0x2277a1,_0x4cd55d){const _0x291f02=a76_0x10a8,_0x54e869=await apiRequest(_0x291f02(0x175)+_0x4819c2+_0x291f02(0x191),{'method':_0x291f02(0x17d),'body':{'appCode':_0x2277a1,..._0x4cd55d}});return _0x54e869[_0x291f02(0x132)];}export async function listPersonalBffs(_0x50de95){const _0x2f595a=await apiRequest('/client/runtime-bff/personal/list?appCode='+encodeURIComponent(_0x50de95));return Array['isArray'](_0x2f595a['data'])?_0x2f595a['data']:[];}export async function getPersonalBff(_0x322dfb,_0x57a14c){const _0x49ee09=a76_0x10a8,_0x328fc3=await apiRequest(_0x49ee09(0x159)+_0x322dfb+_0x49ee09(0x166)+encodeURIComponent(_0x57a14c));if(!_0x328fc3['data'])throw CliErrors[_0x49ee09(0x146)](_0x49ee09(0x15e)+_0x322dfb);return _0x328fc3[_0x49ee09(0x132)];}export async function createPersonalBff(_0x4418d3,_0x2cde1e){const _0x2ed7a6=a76_0x10a8,_0x2ae8b0=await apiRequest(_0x2ed7a6(0x11e),{'method':_0x2ed7a6(0x17d),'body':{'appCode':_0x4418d3,..._0x2cde1e}});return _0x2ae8b0[_0x2ed7a6(0x132)];}export async function updatePersonalBff(_0x161e4a,_0x100102,_0x440b4b){const _0x30bf9d=a76_0x10a8,_0xc7aeed=await apiRequest(_0x30bf9d(0x159)+_0x161e4a+_0x30bf9d(0x191),{'method':'POST','body':{'appCode':_0x100102,..._0x440b4b}});return _0xc7aeed[_0x30bf9d(0x132)];}export async function executePersonalBff(_0xf9ded5,_0x19ade3,_0xdb7303){const _0x22bf97=a76_0x10a8,_0x22568d=await apiRequest(_0x22bf97(0x159)+_0xf9ded5+_0x22bf97(0x153)+encodeURIComponent(_0x19ade3),{'method':_0x22bf97(0x17d),'body':_0xdb7303});return _0x22568d['data'];}export async function listPersonalKnowledgeBaseItems(_0x4e20c7){const _0x124bbe=a76_0x10a8,_0x17cdde=await apiRequest(_0x124bbe(0x137)+encodeURIComponent(_0x4e20c7));return Array[_0x124bbe(0x178)](_0x17cdde[_0x124bbe(0x132)])?_0x17cdde[_0x124bbe(0x132)]:[];}export async function getPersonalKnowledgeBaseItem(_0x179be2,_0x4ab0d2){const _0x549939=a76_0x10a8,_0x48360a=await apiRequest(_0x549939(0x1ad)+_0x179be2+_0x549939(0x166)+encodeURIComponent(_0x4ab0d2));if(!_0x48360a[_0x549939(0x132)])throw CliErrors[_0x549939(0x146)]('Knowledge-base\x20entry\x20not\x20found:\x20id='+_0x179be2);return _0x48360a[_0x549939(0x132)];}export async function createPersonalKnowledgeBaseItem(_0x3facc3,_0x58f906){const _0x1f2e72=a76_0x10a8,_0x43a930=await apiRequest(_0x1f2e72(0x149),{'method':_0x1f2e72(0x17d),'body':{'appCode':_0x3facc3,..._0x58f906}});return _0x43a930['data'];}export async function updatePersonalKnowledgeBaseItem(_0x5eeb4e,_0x3eed3d,_0x1823ce){const _0x53b6e1=a76_0x10a8,_0x2ea5e3=await apiRequest(_0x53b6e1(0x1ad)+_0x5eeb4e+_0x53b6e1(0x191),{'method':'POST','body':{'appCode':_0x3eed3d,..._0x1823ce}});return _0x2ea5e3[_0x53b6e1(0x132)];}export async function searchKnowledgeBase(_0x3f9f17,_0x3602fd){const _0x1b2cf5=a76_0x10a8,_0x5a31d0=await apiRequest(_0x1b2cf5(0x151),{'method':_0x1b2cf5(0x17d),'body':{'appCode':_0x3f9f17,'query':_0x3602fd[_0x1b2cf5(0x120)],..._0x3602fd[_0x1b2cf5(0x194)]!==undefined?{'topK':_0x3602fd['topK']}:{}}});return Array[_0x1b2cf5(0x178)](_0x5a31d0[_0x1b2cf5(0x132)])?_0x5a31d0[_0x1b2cf5(0x132)]:[];}export async function getRuntimeSkillByCode(_0x35b13c,_0x5e32fc){const _0x335725=a76_0x10a8,_0x3e5b43=await skillHubJsonRequest(_0x335725(0x1a4)+encodeURIComponent(_0x35b13c)+'/'+encodeURIComponent(_0x5e32fc),{'allowNotFound':!![]});return _0x3e5b43?skillHubRuntimeDetailToRuntimeSkill(_0x3e5b43):undefined;}function a76_0x75c2(){const _0x8b8226=['API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','personal','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','/client/artifact/','filter','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','isArray','favorite','/client/user/loginUserInfo','API\x20error\x20code:\x20','toString','POST','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','Toolbox\x20API\x20error','tableData','/publish/validate','BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','/client/queryFileUrl','application/zip','join','1495PsyQLF','/api/cli/v1/skills/','source','markdown','signal','longTerm','/client/dataset/get-driven-data?code=','/client/artifact/list?','base64','sqlCode','apiError','/update','warnings','cursor','topK','1702529DRlUzl','msg','function','scope','namespace','size','Artifact\x20not\x20found:\x20id=','values','/client/ocr','invokeSource','name','/client/artifact/create','/download','status','valid','/api/v1/skills/','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','gmtModified','artifactType','GET','skillCode','error','application/octet-stream','limit','/client/knowledge-base/personal/','errorCode','arrayBuffer','5245338kyUkrK','file','confirmWarnings','set','.zip','/run','API\x20error:\x20','string','packageBase64','16XoObuy','/api/runtime/v1/namespaces/','/api/node-toolbox/','/client/runtime-bff/personal/create','18NxzlxK','query','company','errorMsg','PRIVATE','map','Toolbox\x20API\x20error:\x20','undefined','visibility','abort','2385046LHmpPs','json','type','skillName','authRequired','summary','1652526QXOgTz','resolvedVersion','code','data','Request\x20timeout:\x20','publishedVersion','api-doc-generator','DELETE','/client/knowledge-base/personal/list?appCode=','AbortError','download','/client/dataset/list','boolean','slug','/versions/','appCode','items','41755610lUsSbI','functionName','1955163gFqiDE','trim','entries','errors','validation','replace','/validate','/client/knowledge-base/personal/create','newConfigFileName','message','searchParams','resolvedSlug','headers','effective','6268sGQdKY','/client/knowledge-base/search','NAMESPACE_ONLY','/execute?appCode=','/client/uploadFile','object','isJson','ownerPreviewVersion','find','/client/runtime-bff/personal/','append','version','Toolbox\x20error\x20code:\x20','number','Personal\x20BFF\x20not\x20found:\x20id=','displayName','content',',\x20name=','all','/client/bff/endpoint/','success','description','?appCode=','Check\x20your\x20credentials\x20and\x20try\x20again.','stringify','/api/harness/apps/','/skills','application/json','headlineVersion','text','Configure\x20accessKey\x20in\x20','from','SkillHub\x20API\x20error:\x20','skill'];a76_0x75c2=function(){return _0x8b8226;};return a76_0x75c2();}export async function listRuntimeSkills(_0x5d5bf9){const _0x554f66=a76_0x10a8,_0x5d69d4=await skillHubJsonRequest(_0x554f66(0x11c)+encodeURIComponent(_0x5d5bf9['appCode'])+_0x554f66(0x16a),{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x5d5bf9[_0x554f66(0x13e)],_0x5d69d4,_0x5d5bf9['scope']??_0x554f66(0x162),_0x5d5bf9[_0x554f66(0x131)]);}export async function listPersonalRuntimeSkills(_0x432d41){const _0x45c066=a76_0x10a8;return(await listRuntimeSkills({'appCode':_0x432d41,'scope':_0x45c066(0x173)}))[_0x45c066(0x173)];}function a76_0x10a8(_0x3d6136,_0x31c1af){_0x3d6136=_0x3d6136-0x11c;const _0x75c217=a76_0x75c2();let _0x10a8e2=_0x75c217[_0x3d6136];return _0x10a8e2;}export async function listCompanyRuntimeSkills(_0x17ee89){const _0x420fb0=a76_0x10a8;return(await listRuntimeSkills({'appCode':_0x17ee89,'scope':_0x420fb0(0x121)}))['company'];}export async function listVisibleRuntimeSkills(_0x5f51c1){const _0x2648ef=a76_0x10a8;return(await listRuntimeSkills({'appCode':_0x5f51c1,'scope':_0x2648ef(0x162)}))[_0x2648ef(0x14f)];}export async function createPersonalRuntimeSkill(_0x47dcc2,_0x3d26aa,_0x582a1b={}){const _0x41d59a=a76_0x10a8;return publishRuntimeSkill(_0x47dcc2,_0x3d26aa,{'visibility':_0x41d59a(0x123),'confirmWarnings':_0x582a1b[_0x41d59a(0x1b2)]});}export async function updatePersonalRuntimeSkill(_0x10ce9c,_0x1d8c25,_0x4677e3,_0x366505={}){const _0x100246=a76_0x10a8;return publishRuntimeSkill(_0x1d8c25,{..._0x4677e3,'skillCode':_0x4677e3['skillCode']??_0x10ce9c},{'visibility':_0x100246(0x123),'confirmWarnings':_0x366505['confirmWarnings']});}export async function publishCompanyRuntimeSkill(_0x563645,_0x3c4ba0,_0x477152={}){const _0xd9c115=a76_0x10a8;return publishRuntimeSkill(_0x563645,_0x3c4ba0,{'visibility':'NAMESPACE_ONLY','confirmWarnings':_0x477152[_0xd9c115(0x1b2)]});}export async function validateRuntimeSkillPublish(_0x4daf31,_0x5625d2,_0x2b4fe9){const _0x4b02ad=a76_0x10a8,_0x4c0907=buildRuntimeSkillPublishForm(_0x5625d2,_0x2b4fe9[_0x4b02ad(0x127)]),_0x1d6c5a=await skillHubJsonRequest(_0x4b02ad(0x187)+encodeURIComponent(_0x4daf31)+_0x4b02ad(0x181),{'method':_0x4b02ad(0x17d),'body':_0x4c0907});return{'valid':_0x1d6c5a[_0x4b02ad(0x1a3)]===!![],'errors':Array[_0x4b02ad(0x178)](_0x1d6c5a[_0x4b02ad(0x145)])?_0x1d6c5a[_0x4b02ad(0x145)]:[],'warnings':Array[_0x4b02ad(0x178)](_0x1d6c5a['warnings'])?_0x1d6c5a[_0x4b02ad(0x192)]:[],'resolvedSlug':_0x1d6c5a[_0x4b02ad(0x14d)],'resolvedVersion':_0x1d6c5a[_0x4b02ad(0x130)]};}export async function downloadRuntimeSkillPackage(_0x92b8a1,_0x8d9070,_0x1284cc,_0x4f4e0a){const _0x3f6954=a76_0x10a8;void _0x92b8a1;const _0xb30d94=_0x4f4e0a?_0x3f6954(0x187)+encodeURIComponent(_0x1284cc)+'/'+encodeURIComponent(_0x8d9070)+_0x3f6954(0x13d)+encodeURIComponent(_0x4f4e0a)+_0x3f6954(0x1a1):'/api/cli/v1/skills/'+encodeURIComponent(_0x1284cc)+'/'+encodeURIComponent(_0x8d9070)+_0x3f6954(0x1a1);return skillHubBinaryRequest(_0xb30d94);}async function publishRuntimeSkill(_0x366290,_0x2f304b,_0x14b62f){const _0x3a3f67=a76_0x10a8,_0x395f7f=buildRuntimeSkillPublishForm(_0x2f304b,_0x14b62f[_0x3a3f67(0x127)]),_0x388f41=await skillHubJsonRequest(_0x3a3f67(0x187)+encodeURIComponent(_0x366290)+'/publish',{'method':_0x3a3f67(0x17d),'query':{'confirmWarnings':_0x14b62f['confirmWarnings']===!![]?!![]:undefined},'body':_0x395f7f});return{'appCode':_0x388f41[_0x3a3f67(0x199)]??_0x366290,'skillCode':_0x388f41['slug']??_0x2f304b[_0x3a3f67(0x1a9)]??'','skillName':_0x2f304b['skillName']??_0x388f41['slug']??_0x2f304b['skillCode'],'description':_0x2f304b[_0x3a3f67(0x165)],'scope':skillHubVisibilityToScope(_0x388f41[_0x3a3f67(0x127)]??_0x14b62f['visibility'])??'personal','version':_0x388f41[_0x3a3f67(0x15b)]??_0x2f304b[_0x3a3f67(0x15b)],'tags':_0x2f304b['tags'],'content':_0x2f304b[_0x3a3f67(0x160)]};}function buildRuntimeSkillPublishForm(_0x1916de,_0x2664f8){const _0x508d1d=a76_0x10a8,_0x47f9a0=new FormData();return _0x47f9a0[_0x508d1d(0x1b3)](_0x508d1d(0x1b1),runtimeSkillPackageFile(_0x1916de)),_0x1916de[_0x508d1d(0x12c)]?.[_0x508d1d(0x143)]()&&_0x47f9a0['set'](_0x508d1d(0x15f),_0x1916de[_0x508d1d(0x12c)][_0x508d1d(0x143)]()),_0x47f9a0['set'](_0x508d1d(0x127),_0x2664f8),_0x47f9a0;}function runtimeSkillPackageFile(_0x31d45b){const _0x17afa7=a76_0x10a8;if(!_0x31d45b[_0x17afa7(0x1b8)])throw CliErrors['validation']('Missing\x20Skill\x20package\x20payload.');const _0x2a19ca=Buffer[_0x17afa7(0x16f)](_0x31d45b['packageBase64'],_0x17afa7(0x18e)),_0x245a52=new Blob([_0x2a19ca],{'type':'application/zip'}),_0x862902=(_0x31d45b[_0x17afa7(0x1a9)]||_0x17afa7(0x171))+_0x17afa7(0x1b4);if(typeof File!==_0x17afa7(0x126))return new File([_0x245a52],_0x862902,{'type':_0x17afa7(0x184)});return _0x245a52;}function normalizeSkillHubRuntimeListResponse(_0x2b44cb,_0x36df2f,_0x5779e9,_0x33b26f){const _0x45c9f1=a76_0x10a8,_0x5e051f=Array[_0x45c9f1(0x178)](_0x36df2f)?_0x36df2f:Array['isArray'](_0x36df2f?.[_0x45c9f1(0x13f)])?_0x36df2f[_0x45c9f1(0x13f)]:[],_0x811346=_0x33b26f?.[_0x45c9f1(0x143)](),_0x5dd13c=_0x5e051f['filter'](_0x9fb12d=>!_0x811346||_0x9fb12d[_0x45c9f1(0x13c)]===_0x811346)[_0x45c9f1(0x124)](skillHubRuntimeItemToRuntimeSkill)[_0x45c9f1(0x176)](_0xc3b6b1=>Boolean(_0xc3b6b1)),_0x5b0bc3=_0x5dd13c[_0x45c9f1(0x176)](_0x16e7bd=>_0x16e7bd[_0x45c9f1(0x198)]===_0x45c9f1(0x173)),_0x32551c=_0x5dd13c['filter'](_0x52a8af=>_0x52a8af[_0x45c9f1(0x198)]===_0x45c9f1(0x121));return{'appCode':_0x2b44cb,'personal':_0x5779e9==='company'?[]:_0x5b0bc3,'company':_0x5779e9==='personal'?[]:_0x32551c,'effective':buildEffectiveRuntimeSkills(_0x5b0bc3,_0x32551c,_0x5779e9)};}function skillHubRuntimeItemToRuntimeSkill(_0x1eb524){const _0x5587e6=a76_0x10a8,_0x2ee65d=_0x1eb524[_0x5587e6(0x13c)]?.[_0x5587e6(0x143)](),_0x1d6d05=skillHubVisibilityToScope(_0x1eb524[_0x5587e6(0x127)]);if(!_0x2ee65d||!_0x1d6d05)return undefined;return{'id':_0x1eb524['id'],'appCode':_0x1eb524['namespace'],'skillCode':_0x2ee65d,'skillName':_0x1eb524['displayName']??_0x2ee65d,'description':_0x1eb524[_0x5587e6(0x12e)],'scope':_0x1d6d05,'version':skillHubRuntimeItemVersion(_0x1eb524),'status':_0x1eb524[_0x5587e6(0x1a2)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x3177f3){const _0x36ab01=a76_0x10a8,_0x5a8220=_0x3177f3[_0x36ab01(0x13c)]?.[_0x36ab01(0x143)]();if(!_0x5a8220)return undefined;return{'id':_0x3177f3['id'],'appCode':_0x3177f3[_0x36ab01(0x199)],'skillCode':_0x5a8220,'skillName':_0x3177f3[_0x36ab01(0x15f)]??_0x5a8220,'description':_0x3177f3['summary'],'example':_0x3177f3['example'],'scope':skillHubVisibilityToScope(_0x3177f3[_0x36ab01(0x127)])??_0x3177f3[_0x36ab01(0x127)]?.['toLowerCase'](),'version':skillHubRuntimeItemVersion(_0x3177f3),'status':_0x3177f3['status']};}function skillHubVisibilityToScope(_0x32d2a2){const _0x4c845b=a76_0x10a8;if(_0x32d2a2===_0x4c845b(0x123))return'personal';if(_0x32d2a2===_0x4c845b(0x152))return'company';return undefined;}function skillHubRuntimeItemVersion(_0x34fb41){const _0x2353c1=a76_0x10a8;return _0x34fb41[_0x2353c1(0x134)]?.[_0x2353c1(0x15b)]??_0x34fb41[_0x2353c1(0x16c)]?.[_0x2353c1(0x15b)]??_0x34fb41[_0x2353c1(0x157)]?.['version'];}function buildEffectiveRuntimeSkills(_0x367b86,_0x2d748a,_0x227c0a){const _0x72ced5=a76_0x10a8;if(_0x227c0a===_0x72ced5(0x173))return _0x367b86;if(_0x227c0a===_0x72ced5(0x121))return _0x2d748a;const _0x28131b=new Map();for(const _0x3a68a3 of _0x2d748a){_0x28131b[_0x72ced5(0x1b3)](_0x3a68a3[_0x72ced5(0x1a9)],_0x3a68a3);}for(const _0x9c233a of _0x367b86){_0x28131b[_0x72ced5(0x1b3)](_0x9c233a[_0x72ced5(0x1a9)],_0x9c233a);}return Array[_0x72ced5(0x16f)](_0x28131b[_0x72ced5(0x19c)]());}function normalizeRuntimeSkillListResponse(_0x153e81,_0x97c4ec){const _0x59f850=a76_0x10a8;if(Array[_0x59f850(0x178)](_0x97c4ec)){const _0x4b054d=_0x97c4ec['filter'](_0x391615=>_0x391615['scope']===_0x59f850(0x173)),_0x286757=_0x97c4ec[_0x59f850(0x176)](_0x48abb0=>_0x48abb0[_0x59f850(0x198)]==='company');return{'appCode':_0x153e81,'personal':_0x4b054d,'company':_0x286757,'effective':[..._0x286757,..._0x4b054d]};}return{'appCode':_0x97c4ec?.[_0x59f850(0x13e)]??_0x153e81,'personal':Array[_0x59f850(0x178)](_0x97c4ec?.[_0x59f850(0x173)])?_0x97c4ec[_0x59f850(0x173)]:[],'company':Array['isArray'](_0x97c4ec?.['company'])?_0x97c4ec[_0x59f850(0x121)]:[],'effective':Array[_0x59f850(0x178)](_0x97c4ec?.[_0x59f850(0x14f)])?_0x97c4ec[_0x59f850(0x14f)]:[]};}