@lovrabet/rabetbase-cli 2.4.7 → 2.5.0-beta.1

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 (364) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.d.ts +13 -3
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +7 -0
  6. package/lib/api/generate-sdk-config-file.js +1 -0
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.d.ts +2 -5
  27. package/lib/commands/app/shared.js +1 -1
  28. package/lib/commands/app-config/delete.js +1 -1
  29. package/lib/commands/app-config/get.js +1 -1
  30. package/lib/commands/app-config/index.js +1 -1
  31. package/lib/commands/app-config/list.js +1 -1
  32. package/lib/commands/app-config/set.js +1 -1
  33. package/lib/commands/app-config/shared.js +1 -1
  34. package/lib/commands/auth/index.js +1 -1
  35. package/lib/commands/bff/create.js +1 -1
  36. package/lib/commands/bff/delete.js +1 -1
  37. package/lib/commands/bff/detail.js +1 -1
  38. package/lib/commands/bff/index.js +1 -1
  39. package/lib/commands/bff/list.js +1 -1
  40. package/lib/commands/bff/pull.js +1 -1
  41. package/lib/commands/bff/push.js +1 -1
  42. package/lib/commands/bff/status.js +1 -1
  43. package/lib/commands/cli-skill/index.js +1 -1
  44. package/lib/commands/cli-update.js +1 -1
  45. package/lib/commands/codegen/index.js +1 -1
  46. package/lib/commands/codegen/sdk.js +1 -1
  47. package/lib/commands/codegen/sql.js +1 -1
  48. package/lib/commands/common/app-registry.js +1 -1
  49. package/lib/commands/common/app-selector.js +1 -1
  50. package/lib/commands/common/async-task.js +1 -1
  51. package/lib/commands/common/dry-run.js +1 -1
  52. package/lib/commands/common/flags.js +1 -1
  53. package/lib/commands/common/local-file.js +1 -1
  54. package/lib/commands/common/validate.js +1 -1
  55. package/lib/commands/config/delete.d.ts +5 -0
  56. package/lib/commands/config/delete.js +1 -0
  57. package/lib/commands/config/get.js +1 -1
  58. package/lib/commands/config/index.js +1 -1
  59. package/lib/commands/config/init.d.ts +12 -0
  60. package/lib/commands/config/init.js +1 -0
  61. package/lib/commands/config/list.js +1 -1
  62. package/lib/commands/config/set.js +1 -1
  63. package/lib/commands/config/shared.js +1 -1
  64. package/lib/commands/dataset/business-group-update.js +1 -1
  65. package/lib/commands/dataset/business-groups.js +1 -1
  66. package/lib/commands/dataset/capability.js +1 -1
  67. package/lib/commands/dataset/delete.js +1 -1
  68. package/lib/commands/dataset/detail.js +1 -1
  69. package/lib/commands/dataset/extend-update.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/db/analysis-batching.js +1 -1
  84. package/lib/commands/db/analyze-batch-plan.js +1 -1
  85. package/lib/commands/db/analyze-cancel.js +1 -1
  86. package/lib/commands/db/analyze-start.js +1 -1
  87. package/lib/commands/db/analyze-status.js +1 -1
  88. package/lib/commands/db/create.js +1 -1
  89. package/lib/commands/db/delete.js +1 -1
  90. package/lib/commands/db/detail.js +1 -1
  91. package/lib/commands/db/diff-refresh-start.js +1 -1
  92. package/lib/commands/db/diff-refresh-status.js +1 -1
  93. package/lib/commands/db/diff.js +1 -1
  94. package/lib/commands/db/index.js +1 -1
  95. package/lib/commands/db/list.js +1 -1
  96. package/lib/commands/db/shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/doctor.js +1 -1
  101. package/lib/commands/file/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/search.js +1 -1
  112. package/lib/commands/kb/shared.js +1 -1
  113. package/lib/commands/kb/update.js +1 -1
  114. package/lib/commands/logs/index.js +1 -1
  115. package/lib/commands/menu/asset-update.js +1 -1
  116. package/lib/commands/menu/delete.js +1 -1
  117. package/lib/commands/menu/external-link-create.js +1 -1
  118. package/lib/commands/menu/external-link-update.js +1 -1
  119. package/lib/commands/menu/group-create.js +1 -1
  120. package/lib/commands/menu/group-update.js +1 -1
  121. package/lib/commands/menu/index.js +1 -1
  122. package/lib/commands/menu/list.js +1 -1
  123. package/lib/commands/menu/move.js +1 -1
  124. package/lib/commands/menu/regroup-start.js +1 -1
  125. package/lib/commands/menu/rename.js +1 -1
  126. package/lib/commands/menu/shared/compare-table.js +1 -1
  127. package/lib/commands/menu/shared/delete-plan.js +1 -1
  128. package/lib/commands/menu/shared/facts.js +1 -1
  129. package/lib/commands/menu/shared/index.js +1 -1
  130. package/lib/commands/menu/shared/inquirer.js +1 -1
  131. package/lib/commands/menu/shared/local-pages.js +1 -1
  132. package/lib/commands/menu/shared/logic.js +1 -1
  133. package/lib/commands/menu/shared/mutations.js +1 -1
  134. package/lib/commands/menu/shared/service.js +1 -1
  135. package/lib/commands/menu/shared/sync-core.js +1 -1
  136. package/lib/commands/menu/shared/update-core.js +1 -1
  137. package/lib/commands/menu/shared/valid-url.js +1 -1
  138. package/lib/commands/menu/sync.js +1 -1
  139. package/lib/commands/menu/visibility-update.js +1 -1
  140. package/lib/commands/notification/config-create.js +1 -1
  141. package/lib/commands/notification/config-delete.js +1 -1
  142. package/lib/commands/notification/config-list.js +1 -1
  143. package/lib/commands/notification/config-update.js +1 -1
  144. package/lib/commands/notification/index.js +1 -1
  145. package/lib/commands/notification/shared.js +1 -1
  146. package/lib/commands/ocr/index.js +1 -1
  147. package/lib/commands/page/create.js +1 -1
  148. package/lib/commands/page/custom/detail.js +1 -1
  149. package/lib/commands/page/custom/list.js +1 -1
  150. package/lib/commands/page/custom/publish.js +1 -1
  151. package/lib/commands/page/custom/shared.js +1 -1
  152. package/lib/commands/page/custom/syntax.js +1 -1
  153. package/lib/commands/page/custom/template.js +1 -1
  154. package/lib/commands/page/custom/update.js +1 -1
  155. package/lib/commands/page/data-list-status.js +1 -1
  156. package/lib/commands/page/generate-start.js +1 -1
  157. package/lib/commands/page/generate-status.js +1 -1
  158. package/lib/commands/page/index.js +1 -1
  159. package/lib/commands/page/pull.js +1 -1
  160. package/lib/commands/page/push.js +1 -1
  161. package/lib/commands/page/relation-audit.js +1 -1
  162. package/lib/commands/page/restore.js +1 -1
  163. package/lib/commands/page/shared.js +1 -1
  164. package/lib/commands/page/sync.js +1 -1
  165. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  166. package/lib/commands/project/create/format-elapsed.js +1 -1
  167. package/lib/commands/project/create/main.d.ts +1 -0
  168. package/lib/commands/project/create/main.js +1 -1
  169. package/lib/commands/project/create/materialize-project-template.d.ts +6 -2
  170. package/lib/commands/project/create/materialize-project-template.js +1 -1
  171. package/lib/commands/project/create/project-name.js +1 -1
  172. package/lib/commands/project/create/project-template-archive.js +1 -1
  173. package/lib/commands/project/create/project-template-path.js +1 -1
  174. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -1
  175. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  176. package/lib/commands/project/create/use-format-code.js +1 -1
  177. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  178. package/lib/commands/project/index.js +1 -1
  179. package/lib/commands/project/upgrade.js +1 -1
  180. package/lib/commands/registry.d.ts +2 -2
  181. package/lib/commands/registry.js +1 -1
  182. package/lib/commands/role/delete.js +1 -1
  183. package/lib/commands/role/detail.js +1 -1
  184. package/lib/commands/role/index.js +1 -1
  185. package/lib/commands/role/list.js +1 -1
  186. package/lib/commands/role/shared.d.ts +1 -1
  187. package/lib/commands/role/shared.js +1 -1
  188. package/lib/commands/role/update.js +1 -1
  189. package/lib/commands/role/user-add.js +1 -1
  190. package/lib/commands/role/user-remove.js +1 -1
  191. package/lib/commands/role/user-resolve.js +1 -1
  192. package/lib/commands/run/index.js +1 -1
  193. package/lib/commands/schema.js +1 -1
  194. package/lib/commands/sql/create.js +1 -1
  195. package/lib/commands/sql/delete.js +1 -1
  196. package/lib/commands/sql/detail.js +1 -1
  197. package/lib/commands/sql/exec.js +1 -1
  198. package/lib/commands/sql/index.js +1 -1
  199. package/lib/commands/sql/list.js +1 -1
  200. package/lib/commands/sql/pull.js +1 -1
  201. package/lib/commands/sql/push.js +1 -1
  202. package/lib/commands/sql/shared.js +1 -1
  203. package/lib/commands/sql/status.js +1 -1
  204. package/lib/commands/sql/validate.js +1 -1
  205. package/lib/commands/task/index.js +1 -1
  206. package/lib/commands/task/status.js +1 -1
  207. package/lib/commands/tenant/index.js +1 -1
  208. package/lib/commands/tenant/members-list.js +1 -1
  209. package/lib/commands/tenant/shared.js +1 -1
  210. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  211. package/lib/commands/user-account/index.js +1 -1
  212. package/lib/commands/workspace/add.js +1 -1
  213. package/lib/commands/workspace/index.js +1 -1
  214. package/lib/commands/workspace/remove.js +1 -1
  215. package/lib/config/domain-config.d.ts +10 -0
  216. package/lib/config/domain-config.js +1 -0
  217. package/lib/config/schema.d.ts +3 -1
  218. package/lib/config/schema.js +1 -1
  219. package/lib/constant/cdn.js +1 -1
  220. package/lib/constant/cli.js +1 -1
  221. package/lib/constant/defaults.js +1 -1
  222. package/lib/constant/domain.d.ts +23 -1
  223. package/lib/constant/domain.js +1 -1
  224. package/lib/constant/env.js +1 -1
  225. package/lib/constant/output.js +1 -1
  226. package/lib/constant/paths.js +1 -1
  227. package/lib/constant/region.d.ts +9 -0
  228. package/lib/constant/region.js +1 -0
  229. package/lib/constant/risk.js +1 -1
  230. package/lib/context/app-resolver.js +1 -1
  231. package/lib/context/auth-resolver.js +1 -1
  232. package/lib/context/config-loader.d.ts +4 -6
  233. package/lib/context/config-loader.js +1 -1
  234. package/lib/context.d.ts +2 -2
  235. package/lib/context.js +1 -1
  236. package/lib/core/alias-resolver.js +1 -1
  237. package/lib/core/api-client.d.ts +2 -0
  238. package/lib/core/api-client.js +1 -1
  239. package/lib/core/bff/config.js +1 -1
  240. package/lib/core/bff/file-system.js +1 -1
  241. package/lib/core/bff/hash.js +1 -1
  242. package/lib/core/bff/lock.js +1 -1
  243. package/lib/core/bff/utils.js +1 -1
  244. package/lib/core/db-resolver.js +1 -1
  245. package/lib/core/page/file-system.js +1 -1
  246. package/lib/core/page/hash.js +1 -1
  247. package/lib/core/page/lock.js +1 -1
  248. package/lib/core/sql-index-auditor.js +1 -1
  249. package/lib/core/sql-sync/config.js +1 -1
  250. package/lib/core/sql-sync/file-system.js +1 -1
  251. package/lib/core/sql-sync/hash.js +1 -1
  252. package/lib/core/sql-sync/lock.js +1 -1
  253. package/lib/core/sql-sync/utils.js +1 -1
  254. package/lib/core/sql-validator.js +1 -1
  255. package/lib/errors.d.ts +11 -1
  256. package/lib/errors.js +1 -1
  257. package/lib/framework/build-all-flags.js +1 -1
  258. package/lib/framework/error-output.js +1 -1
  259. package/lib/framework/explicit-yes.js +1 -1
  260. package/lib/framework/flags.js +1 -1
  261. package/lib/framework/help.d.ts +2 -2
  262. package/lib/framework/help.js +1 -1
  263. package/lib/framework/index.js +1 -1
  264. package/lib/framework/output.js +1 -1
  265. package/lib/framework/response.js +1 -1
  266. package/lib/framework/runner-alias.js +1 -1
  267. package/lib/framework/runner.js +1 -1
  268. package/lib/framework/schema-export.js +1 -1
  269. package/lib/framework/types.js +1 -1
  270. package/lib/generated/build-info.d.ts +4 -4
  271. package/lib/generated/build-info.js +1 -1
  272. package/lib/help.js +1 -1
  273. package/lib/postinstall.js +1 -1
  274. package/lib/runtime/confirmation.js +1 -1
  275. package/lib/runtime/event.js +1 -1
  276. package/lib/runtime/index.js +1 -1
  277. package/lib/runtime/queue.js +1 -1
  278. package/lib/runtime/resolve.js +1 -1
  279. package/lib/skills/builtin-skill.js +1 -1
  280. package/lib/skills/main.js +1 -1
  281. package/lib/skills/npx-skills-add.js +1 -1
  282. package/lib/skills/skill-presence.js +1 -1
  283. package/lib/telemetry/cli-command-trace.js +1 -1
  284. package/lib/telemetry/cli-help-trace.js +1 -1
  285. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  286. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  287. package/lib/telemetry/send-cli-trace-log.js +1 -1
  288. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  289. package/lib/types/index.d.ts +28 -0
  290. package/lib/utils/ai_config.d.ts +1 -2
  291. package/lib/utils/ai_config.js +1 -1
  292. package/lib/utils/apply-jq-filter.js +1 -1
  293. package/lib/utils/cdn-config.js +1 -1
  294. package/lib/utils/check-sdk-version.js +1 -1
  295. package/lib/utils/cli-version-check.js +1 -1
  296. package/lib/utils/cli-version-policy.js +1 -1
  297. package/lib/utils/config.js +1 -1
  298. package/lib/utils/entity-with-id.js +1 -1
  299. package/lib/utils/file-utils.js +1 -1
  300. package/lib/utils/guides-cdn.js +1 -1
  301. package/lib/utils/http-client.js +1 -1
  302. package/lib/utils/is-non-interactive.js +1 -1
  303. package/lib/utils/logger.js +1 -1
  304. package/lib/utils/params.js +1 -1
  305. package/lib/utils/platform.js +1 -1
  306. package/lib/utils/sleep.js +1 -1
  307. package/lib/utils/template-replacer.js +1 -1
  308. package/lib/utils/update-notice.js +1 -1
  309. package/lib/utils/version.js +1 -1
  310. package/lib/utils/with-active-cookie.js +1 -1
  311. package/lib/utils/write-cli-side-channel.js +1 -1
  312. package/package.json +1 -3
  313. package/skills/rabetbase/SKILL.md +33 -28
  314. package/skills/rabetbase/guides/backend-function.md +41 -12
  315. package/skills/rabetbase/guides/bff-creation-workflow.md +6 -4
  316. package/skills/rabetbase/guides/custom-page-workflow.md +1 -1
  317. package/skills/rabetbase/guides/data-api-guidelines.md +8 -8
  318. package/skills/rabetbase/guides/database-connection-workflow.md +8 -16
  319. package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +1 -6
  320. package/skills/rabetbase/guides/sdk-client-generation.md +146 -0
  321. package/skills/rabetbase/guides/sql-creation-workflow.md +1 -1
  322. package/skills/rabetbase/guides/troubleshooting.md +1 -1
  323. package/skills/rabetbase/guides/typescript-sdk.md +46 -10
  324. package/skills/rabetbase/references/rabetbase-api-list.md +4 -4
  325. package/skills/rabetbase/references/rabetbase-api-pull.md +44 -29
  326. package/skills/rabetbase/references/rabetbase-app-list.md +2 -2
  327. package/skills/rabetbase/references/rabetbase-auth-login.md +4 -2
  328. package/skills/rabetbase/references/rabetbase-bff-push.md +3 -1
  329. package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -1
  330. package/skills/rabetbase/references/rabetbase-config.md +75 -30
  331. package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
  332. package/skills/rabetbase/references/rabetbase-db-analyze.md +3 -3
  333. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -2
  334. package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -4
  335. package/skills/rabetbase/references/rabetbase-db-diff.md +6 -9
  336. package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
  337. package/skills/rabetbase/references/rabetbase-init.md +57 -51
  338. package/skills/rabetbase/references/rabetbase-kb.md +2 -0
  339. package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
  340. package/skills/rabetbase/references/rabetbase-page-custom-detail.md +3 -3
  341. package/skills/rabetbase/references/rabetbase-page-custom-list.md +2 -2
  342. package/skills/rabetbase/references/rabetbase-project-create.md +12 -3
  343. package/skills/rabetbase/references/rabetbase-project-upgrade.md +2 -2
  344. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-user-account.md +1 -1
  346. package/skills/rabetbase/references/rabetbase-workspace.md +6 -6
  347. package/skills/rabetbase.manifest.json +4 -3
  348. package/templates/README.md +17 -28
  349. package/templates/generate-api/api.ts.tpl +3 -3
  350. package/templates/generate-api/client.ts.tpl +10 -37
  351. package/lib/commands/data/filter.d.ts +0 -7
  352. package/lib/commands/data/filter.js +0 -1
  353. package/lib/commands/data/getOne.d.ts +0 -7
  354. package/lib/commands/data/getOne.js +0 -1
  355. package/lib/commands/data/index.d.ts +0 -8
  356. package/lib/commands/data/index.js +0 -1
  357. package/lib/commands/data/shared.d.ts +0 -33
  358. package/lib/commands/data/shared.js +0 -1
  359. package/lib/commands/init/index.d.ts +0 -11
  360. package/lib/commands/init/index.js +0 -1
  361. package/lib/utils/rules-cdn.d.ts +0 -38
  362. package/lib/utils/rules-cdn.js +0 -1
  363. package/templates/rules/lovrabet_rules.mdc.tpl +0 -893
  364. package/templates/skill/SKILL.md.tpl +0 -120
@@ -1,70 +1,76 @@
1
- # rabetbase init
1
+ # rabetbase config init
2
2
 
3
- 智能初始化 `.rabetbase.json` 配置。
4
-
5
- > **风险等级:write** — 创建或修改配置文件。
6
-
7
- ## 命令
3
+ 首次使用、切换官方节点或切换企业独立部署地址时,重建全局 Lovrabet 连接配置。该命令只处理 region/Domain,不负责认证或项目应用绑定。
8
4
 
9
5
  ```bash
10
- # 交互模式(从平台拉取应用列表选择)
11
- rabetbase init
12
-
13
- # 指定 appcode 直接写入(非交互)
14
- rabetbase init --appcode <code>
15
-
16
- # 指定环境
17
- rabetbase init --appcode <code> --env daily
18
-
19
- # 写入全局配置
20
- rabetbase init --appcode <code> --global
6
+ # 交互选择 cn / id
7
+ rabetbase config init
8
+
9
+ # 自动化选择官方节点
10
+ rabetbase config init --region id
11
+
12
+ # 企业独立部署
13
+ rabetbase config init --domain-config ./lovrabet-domains.json
14
+
15
+ # 企业独立部署也可直接传 Domain flags
16
+ rabetbase config init \
17
+ --user-domain https://user.customer.example.com \
18
+ --api-domain https://api.customer.example.com \
19
+ --runtime-domain https://runtime.customer.example.com \
20
+ --skill-domain https://skills.customer.example.com \
21
+ --kb-domain https://kb.customer.example.com \
22
+ --app-domain https://app.customer.example.com
21
23
  ```
22
24
 
23
- ## 参数
24
-
25
- | Flag | 类型 | 必填 | 默认 | 说明 |
26
- |------|------|------|------|------|
27
- | `--appcode <code>` | string | 否 | — | 直接写入配置,跳过交互选择 |
28
- | `--env <env>` | string | 否 | `production` | 目标环境:`production` / `daily` |
29
- | `--global` | boolean | 否 | `false` | 写入全局配置而非项目配置 |
25
+ ## 交互与默认行为
30
26
 
31
- ## 执行逻辑
27
+ - 交互执行时选择 `Mainland China (cn)` 或 `Indonesia (id)`,默认选中 `cn`
28
+ - 非交互执行时应显式传 `--region cn|id`;未传 region/Domain 时回退 `cn`
29
+ - 当前只开放 `cn`、`id`;`global` 不可选择
32
30
 
33
- 按优先级自动路由:
31
+ ## 写入行为
34
32
 
35
- 1. **老项目检测**(仅 project scope)→ 若检测到旧配置文件(如 `.lovrabet.json`)且无 `.rabetbase.json`,自动触发 `project upgrade`
36
- 2. **`--appcode`** → 直接写入配置(单应用或 CI 模式)
37
- 3. **CI `--appcode`** → 报错 `flag_missing`
38
- 4. **TTY 交互** 从平台拉取应用列表,用户多选后写入配置
33
+ - 固定写入全局 `~/.rabetbase.json`
34
+ - 不使用也不需要 `--global`,不能写入项目配置
35
+ - 默认中国节点 `cn` 不写冗余 `region` 字段
36
+ - 官方节点模式会清除六个显式 Domain,以及遗留的 `agentDomain` / `platformDomain` / `skillHubDomain`
37
+ - 独立部署模式会清除旧 `region`、显式 Domain 和遗留 Domain,再写入本次提供的 Domain
38
+ - 保留 Cookie、AccessKey、format、locale、apps 等无关配置
39
+ - 不负责登录,也不绑定当前项目应用
39
40
 
40
- ## 输出
41
+ ## 独立部署 Domain
41
42
 
42
- - 成功:`✓ Successfully initialized project config` 并显示 AppCode、Env、Config 路径
43
- - 已有配置:报错 `.rabetbase.json already exists`
44
- - 旧项目:自动进入 `project upgrade` 流程
45
-
46
- ## 多应用
47
-
48
- 交互模式支持选择多个应用,生成多应用配置:
43
+ `--domain-config` 接受只包含以下字段的 JSON 对象:
49
44
 
50
45
  ```json
51
46
  {
52
- "apps": {
53
- "app1": { "appcode": "code1", "env": "production" },
54
- "app2": { "appcode": "code2", "env": "production" }
55
- },
56
- "defaultApp": "app1"
47
+ "userDomain": "https://user.customer.example.com",
48
+ "apiDomain": "https://api.customer.example.com",
49
+ "runtimeDomain": "https://runtime.customer.example.com",
50
+ "skillDomain": "https://skills.customer.example.com",
51
+ "kbDomain": "https://kb.customer.example.com",
52
+ "appDomain": "https://app.customer.example.com"
57
53
  }
58
54
  ```
59
55
 
60
- ## 提示
56
+ - 每个值必须是 HTTPS origin,不能包含账号、密码、path、query 或 fragment
57
+ - 文件至少提供一个受支持 Domain;企业完整独立部署建议显式提供全部六个
58
+ - 同名 `--*-domain` flag 覆盖文件中的值
59
+ - `--region` 与任意独立部署 Domain 互斥,不能混用
60
+ - 未提供的 Domain 会按默认 `cn` 映射回退,因此完整独立部署不要遗漏实际由客户部署的服务入口
61
+
62
+ ## 结果语义
61
63
 
62
- - 这是新用户首次使用的推荐入口命令
63
- - CI/CD 场景必须传 `--appcode`
64
- - 已有配置时先删除,或用 `config set env ...` / `workspace add` / `workspace use` 修改;`config set appcode` 仅适合单应用场景,会写成 `apps + defaultApp`
64
+ - 官方节点返回 `data.mode="official"` 与选中的 `data.region`
65
+ - 独立部署返回 `data.mode="independent"` 与实际写入的 `data.domains`
66
+ - 重复执行用于切换连接配置,不会清除认证、输出偏好或应用绑定
65
67
 
66
- ## 参考
68
+ 首次使用推荐顺序:
69
+
70
+ ```bash
71
+ rabetbase config init
72
+ rabetbase auth login
73
+ rabetbase workspace init --appcode <code>
74
+ ```
67
75
 
68
- - [SKILL.md](../SKILL.md)
69
- - [配置参考](rabetbase-config.md)
70
- - [project upgrade](rabetbase-project-upgrade.md)
76
+ 旧的项目初始化能力已统一到 `rabetbase workspace init`。
@@ -2,6 +2,8 @@
2
2
 
3
3
  管理开发者侧当前解析应用下的 `company` 知识库,并检索当前应用可访问的公司与公共知识。所有命令都通过标准工作区、`--app <name>` 或 `--appcode <code>` 解析目标应用。
4
4
 
5
+ 企业知识库请求使用 `kbDomain`;普通研发平台接口仍使用 `apiDomain`。当前 rabetbase-cli 没有调用 SkillHub 业务 API,未来新增时必须使用独立的 `skillDomain`。
6
+
5
7
  > 边界:`lovrabet kb` 使用运行态 AK/当前应用/当前用户,面向个人知识库和可见知识搜索;`rabetbase kb` 使用开发者登录态,面向公司知识库管理以及公司/公共知识检索。不要用其中一个替代另一个。
6
8
 
7
9
  ## 命令
@@ -14,7 +14,7 @@ rabetbase page create --name "客户看板" --page-content '<json>' --appcode <a
14
14
 
15
15
  | 参数 | 必填 | 说明 |
16
16
  |---|---|---|
17
- | `--name <name>` | 否 | 可选页面名称,1–100 个字符;省略时默认 `自定义页面_<timestamp>` |
17
+ | `--name <name>` | 否 | 可选页面名称,1–100 个字符;省略时默认 `Custom_page_<timestamp>` |
18
18
  | `--parent-menu-id <id>` | 否 | 父菜单 ID |
19
19
  | `--page-pattern <pattern>` | 条件必填 | 页面模式;当前只支持 `BLANK`,与 `--page-content` 必须且只能提供一个 |
20
20
  | `--page-content <json>` | 条件必填 | 完整页面文件 JSON;对象的键为相对路径,值为文件内容,与 `--page-pattern` 必须且只能提供一个 |
@@ -17,10 +17,10 @@ rabetbase page custom-detail --id <pageId> --format compress
17
17
 
18
18
  返回页面详情和当前完整页面文件。`createTime` 和 `updateTime` 以 `YYYY-MM-DD HH:mm:ss` 展示。
19
19
 
20
- 地址说明(按当前环境):
20
+ 地址说明(按当前环境、region 与显式 `appDomain`):
21
21
 
22
22
  - `pageUrl`:查看最新保存内容的页面地址,包含尚未发布的修改
23
- - `runtimePageUrl`:查看已发布内容的页面地址,仅在有已发布内容时返回;格式为 `https://<appCode>.app.lovrabet.com/<pageCode>`(线上)或 `https://<appCode>.daily.lovrabet.com/<pageCode>`(日常)
24
- - `editPageUrl`:打开页面编辑器的地址,可继续修改页面;线上为 `https://app.lovrabet.com/app/<appCode>/ide/<pageId>`,日常为 `https://daily.lovrabet.com/web-app/app/<appCode>/ide/<pageId>`
23
+ - `runtimePageUrl`:查看已发布内容的页面地址,仅在有已发布内容时返回;host 为 `<appCode>.<appDomain host>`
24
+ - `editPageUrl`:打开当前节点或独立部署工作台中的页面编辑器
25
25
 
26
26
  `data.codeContent` 是当前完整页面文件,可在本地完成新增、修改或删除后,作为 `page custom-update --page-content <json>` 的完整页面内容提交。
@@ -19,5 +19,5 @@ rabetbase page custom-list --appcode <appCode> --format json
19
19
  `data.pages` 是当前应用中可操作的 自定义页面列表
20
20
 
21
21
  - `label`:页面名称
22
- - `pageUrl`:查看最新保存内容的页面地址,包含尚未发布的修改;日常为 `https://daily.lovrabet.com/web-app/app/<appCode>/pages/<path>`,线上为 `https://app.lovrabet.com/app/<appCode>/pages/<path>`
23
- - `editPageUrl`:打开页面编辑器的地址,可继续修改页面;线上为 `https://app.lovrabet.com/app/<appCode>/ide/<pageId>`,日常为 `https://daily.lovrabet.com/web-app/app/<appCode>/ide/<pageId>`
22
+ - `pageUrl`:查看最新保存内容的页面地址,包含尚未发布的修改;基于当前 region 或显式 `appDomain`
23
+ - `editPageUrl`:打开当前节点或独立部署工作台中的页面编辑器
@@ -32,7 +32,7 @@ rabetbase project create my-project --appcode <code> --env production
32
32
  ## 两种模式
33
33
 
34
34
  1. **交互模式** — 通过提示选择项目配置
35
- 2. **非交互模式**(`--ci` 或非 TTY)— 必须提供项目名称,支持 `--appcode` 跳过应用选择
35
+ 2. **非交互模式**(`--non-interactive` 或非 TTY)— 必须提供项目名称,支持 `--appcode` 跳过应用选择
36
36
 
37
37
  ## 提示
38
38
 
@@ -41,9 +41,18 @@ rabetbase project create my-project --appcode <code> --env production
41
41
  - 项目名只接受字母、数字、`-`、`_`,不能传绝对路径、`../`、子目录路径或 Windows 保留名称
42
42
  - 交互与非交互模式使用同一创建流程,都会安装依赖、格式化代码并写入项目配置
43
43
  - 项目模板从 CDN 下载并校验 SHA-256;CDN 不可用、模板不兼容或校验失败时命令停止,修复后重试
44
- - 新项目中的 `.rabetbase.json` **只继承**全局中的少量偏好(如 `cookie`、`accessKey`、`locale`、`format`、`riskLevel`),**不会**把全局的 `apps` / `defaultApp` 复制进新项目
44
+ - 新项目中的 `.rabetbase.json` **只继承**全局中的少量偏好及 `region` / Domain 路由配置,**不会**把全局的 `apps` / `defaultApp` 复制进新项目
45
+ - `src/api/sdk-config.ts` 只生成浏览器可公开的非默认 SDK 路由,不会写入 `cookie`、`accessKey` 等认证配置;后续执行 `rabetbase api pull` 会按当前有效配置刷新该文件。`api.ts` / `client.ts` 仅在缺失时由 CLI 写脚手架,已有文件按 [`sdk-client-generation.md`](../guides/sdk-client-generation.md) 更新
46
+
47
+ | 当前有效路由 | `src/api/sdk-config.ts` |
48
+ |--------------|-------------------------|
49
+ | 默认 CN,且没有非默认 `runtimeDomain` | `{}`,由 SDK 使用默认 CN 映射 |
50
+ | ID,且没有非默认 `runtimeDomain` | `{ region: "id" }`,由 SDK 结合项目 env 选择 ID Runtime |
51
+ | 非默认企业 `runtimeDomain` | `{ runtimeDomain: "https://…" }`,不再冗余写 region |
52
+
53
+ 如果显式 `runtimeDomain` 恰好等于当前 region/env 的 SDK 内置地址,CLI 会把它视为默认值:CN 不写路由,ID 仍只写 `region: "id"`。这样生成项目不会固定当前的具体公共 URL,后续仍可跟随 SDK 的内置映射升级。
45
54
 
46
55
  ## 参考
47
56
 
48
57
  - [SKILL.md](../SKILL.md)
49
- - [rabetbase init](rabetbase-init.md)
58
+ - [rabetbase config init](rabetbase-init.md)
@@ -49,9 +49,9 @@ rabetbase project upgrade --yes
49
49
  ## 触发方式
50
50
 
51
51
  - 手动执行:`rabetbase project upgrade`
52
- - 自动触发:`rabetbase init` 检测到旧配置时自动路由
52
+ - 显式执行:`rabetbase project upgrade` 检测并迁移旧配置
53
53
 
54
54
  ## 参考
55
55
 
56
56
  - [SKILL.md](../SKILL.md)
57
- - [rabetbase init](rabetbase-init.md)
57
+ - [rabetbase config init](rabetbase-init.md)
@@ -11,8 +11,8 @@ rabetbase role user-resolve --name 小张 --format compress
11
11
  ## 行为
12
12
 
13
13
  - 精确匹配 `nickname` 或 `username`(大小写不敏感)。
14
- - 命中 0 个:报 validation error,提示核对或改用 `--user <id>`。
15
- - 命中多个:报歧义并列出候选 `nickname(userId)`,要求用 id 消歧。
14
+ - 命中 0 个:报 validation error,提示核对昵称或用户名。
15
+ - 命中多个:报歧义并列出候选 `nickname(userId)`;选定后,把该 ID 传给 `role user-add/user-remove --user <id>`,不要向 `user-resolve` 传不存在的 `--user` flag。
16
16
  - 输出 `data.user`:`userId`、`username`、`nickname`、`matchedBy`(`id` / `name`)。
17
17
 
18
18
  ## 边界
@@ -28,7 +28,7 @@ rabetbase user-account dingding-sandbox-bind \
28
28
  重点检查以下字段:
29
29
 
30
30
  - `data.operation = "bind"`
31
- - `data.selector.providerId = "dingding-sandbox"`
31
+ - `data.selector.providerId = "dingtalk"`
32
32
  - `data.selector.dingTalkUserId` 与输入一致
33
33
  - 正式执行成功时 `data.after.bound = true`
34
34
  - `data.dryRun` 与本次执行模式一致
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **边界**:`workspace` 负责所有「配置我的工作环境」的写操作——绑定目录默认应用(`init` / `use`),以及登记/移除应用清单(`add` / `remove`)。默认写当前项目 `.rabetbase.json`;`add` / `remove` 支持 `--global`(全局视作一个大工作空间);`init` / `use` 只写当前目录。纯事实查询「有哪些 app」用 [`app list`](rabetbase-app-list.md)。
6
6
 
7
- **选型**:首次安装全局引导用 `rabetbase init`;当前目录还没绑定默认 app → `workspace init`(始终写 `defaultApp`);已有配置只再登记 profile → `workspace add`;切换默认 → `workspace use`。
7
+ **选型**:首次安装全局引导用 `rabetbase config init`;当前目录还没绑定 app → `workspace init`(单应用不写 `defaultApp`);已有配置只再登记 profile → `workspace add`;多应用切换默认 → `workspace use`。
8
8
 
9
9
  ## 命令
10
10
 
@@ -28,18 +28,18 @@ rabetbase workspace remove <name> [--global]
28
28
  | `--defaultFormat <format>` | 写入该 app profile 的默认输出格式 |
29
29
  | `--pageSize <n>` | 写入该 app profile 的分页大小 |
30
30
  | `--riskLevel <level>` | 写入该 app profile 的风险等级 |
31
- | `--locale <locale>` | 写入该 app profile 的地区设置 |
31
+ | `--locale <locale>` | 写入该 app profile 的本地化设置(不是 CLI 语言;目前命令尚未消费) |
32
32
 
33
33
  `add` / `remove` 用位置参数 `<name>` 指定应用名;`add` 必带 `--appcode <code>`,两者都支持 `--global`(写/删全局清单,全局视作一个大工作空间),其余 profile flags 与上表一致。
34
34
 
35
35
  ## 行为
36
36
 
37
- - `workspace init --appcode app-xxx`:用 appcode 作为应用名,写入 `apps.app-xxx` `defaultApp`。
38
- - `workspace init --app crm --appcode app-xxx`:用业务名 `crm` 绑定 appcode,写入 `apps.crm` 和 `defaultApp`。
37
+ - `workspace init --appcode app-xxx`:用 appcode 作为应用名写入 `apps.app-xxx`;若它是唯一应用,不写 `defaultApp`。
38
+ - `workspace init --app crm --appcode app-xxx`:用业务名 `crm` 绑定 appcode;若它是唯一应用,不写 `defaultApp`。
39
39
  - `workspace use --app crm`:切换当前目录默认应用;如果 `crm` 只存在于全局配置,会复制非敏感 profile 字段到当前目录。
40
40
  - `workspace use --app crm --appcode app-xxx`:直接在当前目录新增或更新 `crm`,并设为默认应用。
41
- - `workspace add crm --appcode app-xxx`:登记应用 profile(默认写当前项目,`--global` 写全局);当前无 `defaultApp` 时首个自动设为默认。已存在则更新。
42
- - `workspace remove crm`:移除本地应用 profile。默认按「项目优先、其次全局」定位要删的那一层,`--global` 强制删全局;若删的是当前 `defaultApp`,自动切到剩余的第一个;若该应用在项目与全局都有定义,只删单侧并在结果里提示另一侧仍存在。
41
+ - `workspace add crm --appcode app-xxx`:登记应用 profile(默认写当前项目,`--global` 写全局)。第一个应用不写 `defaultApp`;增加第二个应用时保留原应用为默认。已存在则更新。
42
+ - `workspace remove crm`:移除本地应用 profile。默认按「项目优先、其次全局」定位要删的那一层,`--global` 强制删全局;只剩一个应用时删除冗余的 `defaultApp`,仍有多个应用时才自动切换;若该应用在项目与全局都有定义,只删单侧并在结果里提示另一侧仍存在。
43
43
 
44
44
  `workspace init` / `workspace use` 不会从全局配置复制 `cookie` / `accessKey` 到项目文件。若当前项目文件里原本已有这些字段,更新应用时会保留它们。
45
45
 
@@ -2,8 +2,8 @@
2
2
  "schemaVersion": 1,
3
3
  "name": "rabetbase",
4
4
  "packageName": "@lovrabet/rabetbase-cli",
5
- "packageVersion": "2.4.7",
6
- "skillVersion": "2.4.7",
5
+ "packageVersion": "2.5.0-beta.1",
6
+ "skillVersion": "2.5.0-beta.1",
7
7
  "files": [
8
8
  "SKILL.md",
9
9
  "guides/backend-function.md",
@@ -17,6 +17,7 @@
17
17
  "guides/legacy-application-blueprint-workflow.md",
18
18
  "guides/menu-anomaly-manual-cleanup.md",
19
19
  "guides/page-development-workflow.md",
20
+ "guides/sdk-client-generation.md",
20
21
  "guides/sql-creation-workflow.md",
21
22
  "guides/sql-mybatis.md",
22
23
  "guides/troubleshooting.md",
@@ -131,5 +132,5 @@
131
132
  "references/rabetbase-user-account.md",
132
133
  "references/rabetbase-workspace.md"
133
134
  ],
134
- "digest": "74ec8ca69aff4db403008c1a5201142a12adaae91916d9fbb1dc8fb837fa8085"
135
+ "digest": "f8905b3969e94a98cbc8a676aeee553f7f1f5258dd2ff9988306210b00246de9"
135
136
  }
@@ -31,6 +31,23 @@ templates/
31
31
  npm run sync-template
32
32
  ```
33
33
 
34
+ 在提交、推送和生成 CDN ZIP 前,可先把本地工作区(包含未提交修改)转换到独立目录:
35
+
36
+ ```bash
37
+ npm run sync-template -- --source ../sub-app-react-demo --output /tmp/sub-app-react-template
38
+ ```
39
+
40
+ 再使用已经准备好的模板创建调试项目:
41
+
42
+ ```bash
43
+ node lib/cli.js project create template-test --template-source /tmp/sub-app-react-template
44
+ ```
45
+
46
+ `sync-template` 负责“原始项目 → 标准模板”,`project create --template-source` 负责
47
+ “标准模板 → 新项目”,并保留普通创建的认证、AppCode、依赖安装和格式化流程。
48
+ 使用尚未发布的 CLI 时,先执行 `npm run build:dev`;
49
+ 使用已安装版本时,可把第二条命令换成 `rabetbase project create ...`。
50
+
34
51
  模板同步完成后,更新模板自身的 `package.json#version`,再生成待发布的 CDN 资产:
35
52
 
36
53
  ```bash
@@ -69,31 +86,3 @@ npm run sync:cdn
69
86
  - CLI 使用 `TemplateReplacer` 工具处理 `.tpl` 类模板
70
87
  - 生成的文件包含显示生成元数据的头部注释
71
88
  - 所有模板支持国际化并可根据需要扩展
72
-
73
- ## Cursor Rules 模板
74
-
75
- ### 用途
76
-
77
- `rules/` 目录包含 Cursor Rules 模板,用于指导 AI 助手(Claude、GPT 等)正确使用 Lovrabet SDK。
78
-
79
- ### 功能特性
80
-
81
- - ✅ **SDK 使用规范** - 完整的 API 调用指南
82
- - ✅ **Agent 开发约束** - 约定模型读取、数据调用和页面开发方式
83
- - ✅ **性能优化** - 避免不必要的 API 调用
84
- - ✅ **错误处理** - 完善的错误处理模式
85
- - ✅ **类型安全** - TypeScript 最佳实践
86
- - ✅ **用户体验** - 加载状态、乐观更新等
87
- - ✅ **常见错误避免** - 清单式检查
88
-
89
- ### 使用方法
90
-
91
- ```bash
92
- # 项目级别配置(推荐)
93
- cp templates/rules/.cursorrules ./
94
-
95
- # 全局配置
96
- cp templates/rules/.cursorrules ~/.cursorrules
97
- ```
98
-
99
- 详细说明请参考 `rules/README.md`。
@@ -3,7 +3,7 @@
3
3
  * Created: {CreatedAt}
4
4
  *
5
5
  * 这个文件包含了项目的模型配置,并自动注册到 SDK 中
6
- * CLI 工具会自动维护这个文件,通常不需要手动修改
6
+ * CLI 仅在文件缺失时写入脚手架;已有文件由 Agent 按 pull 返回的 models 更新
7
7
  */
8
8
 
9
9
  import { registerModels, CONFIG_NAMES, type ModelsConfig } from "@lovrabet/sdk";
@@ -15,8 +15,8 @@ export const {VarPrefix}_APP_CODE = "{AppCode}";
15
15
  * 使用数组格式,每个模型包含 datasetCode、tableName、name 和可选的 alias
16
16
  *
17
17
  * 访问方式:
18
- * - 标准访问:client.models.dataset_[datasetCode]
19
- * - 别名访问:client.models.[alias](如果配置了 alias)
18
+ * - 标准访问:client.models["dataset_" + datasetCode](动态)或 client.models.dataset_<datasetCode 字面量>
19
+ * - 别名访问:client.models[alias] 或 client.models.<别名>(如果配置了 alias)
20
20
  */
21
21
  export const {VarPrefix}_MODELS_CONFIG: ModelsConfig = {
22
22
  appCode: {VarPrefix}_APP_CODE,
@@ -7,8 +7,9 @@
7
7
  * 通过导入 './api' 文件来自动执行配置注册
8
8
  */
9
9
 
10
- import { createClient,CONFIG_NAMES } from "@lovrabet/sdk";
10
+ import { createClient, CONFIG_NAMES } from "@lovrabet/sdk";
11
11
  import "./{ApiFileName}"; // 导入配置文件,执行 registerModels() 注册
12
+ import { LOVRABET_SDK_CONFIG } from "./sdk-config";
12
13
 
13
14
  /**
14
15
  * 主要的客户端实例
@@ -22,43 +23,15 @@ export const lovrabetClient = createClient({ClientConfigParam});
22
23
  * // 在组件中使用
23
24
  * import { lovrabetClient } from '@/api/client';
24
25
  *
25
- * // 获取数据列表
26
- * const data = await lovrabetClient.models.{ExampleModelName}.getList({
27
- * currentPage: 1,
28
- * pageSize: 20
29
- * });
30
- *
31
- * // 获取单条记录
32
- * const record = await lovrabetClient.models.{ExampleModelName}.getOne('123');
33
- *
34
- * // 创建新记录
35
- * const newRecord = await lovrabetClient.models.{ExampleModelName}.create({
36
- * // 记录数据
37
- * });
38
- */
39
-
40
- /**
41
- * 其他创建客户端的方式(根据需要选择):
42
- *
43
- * 1. 使用默认配置(无参数调用):
44
- * export const lovrabetClient = createClient();
26
+ * // 查看当前可用模型
27
+ * const models = lovrabetClient.getModelList();
45
28
  *
46
- * 2. 使用其他已注册的配置:
47
- * export const devClient = createClient('dev');
48
- * export const prodClient = createClient('prod');
49
- *
50
- * 3. 直接传入配置对象:
51
- * import { {VarPrefix}_MODELS_CONFIG } from './api';
52
- * export const lovrabetClient = createClient({VarPrefix}_MODELS_CONFIG);
53
- *
54
- * 4. 通过 ClientConfig 指定配置名和其他选项:
55
- * export const lovrabetClient = createClient({
56
- * apiConfigName: 'default',
57
- * token: 'custom-token',
58
- * env: 'daily'
29
+ * // 按生成的模型别名查询(推荐用 filter)
30
+ * const data = await lovrabetClient.models.{ExampleModelName}.filter({
31
+ * currentPage: 1,
32
+ * pageSize: 20,
59
33
  * });
60
34
  *
61
- * 5. 多项目支持示例:
62
- * export const projectAClient = createClient('project-a');
63
- * export const projectBClient = createClient('project-b');
35
+ * 浏览器子应用默认走登录态 Cookie,无需在此文件写入 accessKey / token;
36
+ * 需要服务端 accessKey / OpenAPI token 的用法见 SDK 文档与 skill guides。
64
37
  */
@@ -1,7 +0,0 @@
1
- /**
2
- * @fileoverview `data filter` command definition.
3
- */
4
- /**
5
- * Read-only Instant API command for SDK-style filter semantics.
6
- */
7
- export declare const dataFilter: import("../../framework/types.js").CommandDefinition;
@@ -1 +0,0 @@
1
- const a55_0x248709=a55_0x5305;function a55_0x5305(_0x59fd62,_0x49d43e){_0x59fd62=_0x59fd62-0xc5;const _0x28e392=a55_0x28e3();let _0x530552=_0x28e392[_0x59fd62];return _0x530552;}function a55_0x28e3(){const _0x1a57cd=['\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','4312759YLHsgZ','Filter\x20dataset\x20records\x20with\x20query\x20conditions','50jXarLC','1115718lUiOTC','190143bgShrX','1069094MZAhps','join','3GEFQAT','filter','70316xHZOHO','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','7ZEumPP','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','341945MLvDzM','2004184pnZsuT','32xgUHYq','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)'];a55_0x28e3=function(){return _0x1a57cd;};return a55_0x28e3();}(function(_0x91eef0,_0x2acac3){const _0x4ad2aa=a55_0x5305,_0x48aa67=_0x91eef0();while(!![]){try{const _0x1e1c28=-parseInt(_0x4ad2aa(0xd1))/0x1+parseInt(_0x4ad2aa(0xcd))/0x2*(-parseInt(_0x4ad2aa(0xcf))/0x3)+-parseInt(_0x4ad2aa(0xc5))/0x4*(-parseInt(_0x4ad2aa(0xd7))/0x5)+-parseInt(_0x4ad2aa(0xcb))/0x6*(parseInt(_0x4ad2aa(0xd5))/0x7)+parseInt(_0x4ad2aa(0xd8))/0x8+-parseInt(_0x4ad2aa(0xcc))/0x9*(parseInt(_0x4ad2aa(0xca))/0xa)+parseInt(_0x4ad2aa(0xc8))/0xb;if(_0x1e1c28===_0x2acac3)break;else _0x48aa67['push'](_0x48aa67['shift']());}catch(_0x27a40e){_0x48aa67['push'](_0x48aa67['shift']());}}}(a55_0x28e3,0x47985));import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a55_0x248709(0xd0),'operation':a55_0x248709(0xd0),'description':a55_0x248709(0xc9),'paramsRequired':![],'paramsHint':a55_0x248709(0xd4),'helpExtra':[a55_0x248709(0xc6),a55_0x248709(0xd3),a55_0x248709(0xd6),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]',a55_0x248709(0xd2),a55_0x248709(0xc7)][a55_0x248709(0xce)]('\x0a')});
@@ -1,7 +0,0 @@
1
- /**
2
- * @fileoverview `data getOne` command definition.
3
- */
4
- /**
5
- * Read-only Instant API command for fetching one record by id.
6
- */
7
- export declare const dataGetOne: import("../../framework/types.js").CommandDefinition;
@@ -1 +0,0 @@
1
- function a56_0x2792(){const _0x5e5e83=['597258yVVUDb','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','1508090tcUvqz','3994278zXeXhM','40pwTkXf','2712108fQnMMF','633965TEvBgL','633622GElsls','32TxCcXD','1702882LBtljk','7cAYuIv'];a56_0x2792=function(){return _0x5e5e83;};return a56_0x2792();}const a56_0x438f81=a56_0x3525;(function(_0x70dbc,_0x2142ca){const _0x9d6262=a56_0x3525,_0x3e4ad6=_0x70dbc();while(!![]){try{const _0x533d05=parseInt(_0x9d6262(0x1a9))/0x1+parseInt(_0x9d6262(0x1ab))/0x2+parseInt(_0x9d6262(0x1a7))/0x3+-parseInt(_0x9d6262(0x1aa))/0x4*(parseInt(_0x9d6262(0x1a8))/0x5)+-parseInt(_0x9d6262(0x1a5))/0x6*(parseInt(_0x9d6262(0x1a1))/0x7)+parseInt(_0x9d6262(0x1a6))/0x8*(-parseInt(_0x9d6262(0x1a2))/0x9)+parseInt(_0x9d6262(0x1a4))/0xa;if(_0x533d05===_0x2142ca)break;else _0x3e4ad6['push'](_0x3e4ad6['shift']());}catch(_0x8e4982){_0x3e4ad6['push'](_0x3e4ad6['shift']());}}}(a56_0x2792,0x80ea9));function a56_0x3525(_0x59fdbe,_0x29a6cb){_0x59fdbe=_0x59fdbe-0x1a1;const _0x2792ac=a56_0x2792();let _0x35256a=_0x2792ac[_0x59fdbe];return _0x35256a;}import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':'getOne','operation':'getOne','description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsRequired':!![],'paramsHint':a56_0x438f81(0x1a3)});
@@ -1,8 +0,0 @@
1
- /**
2
- * @fileoverview Declarative exports for the read-only `data` command group.
3
- */
4
- import type { CommandDefinition } from "../../framework/types.js";
5
- /**
6
- * Ordered command list used by help output, schema export, and registry wiring.
7
- */
8
- export declare const dataDefinitions: CommandDefinition[];
@@ -1 +0,0 @@
1
- function a57_0x33ea(){const _0xffffa=['27VIKEwn','740244LQPqcx','1943780GuHFqW','6407422snoHaX','938383NRAySm','1751072EDzESL','2381478IbNErG','78984HYsenO','6eCDQWK'];a57_0x33ea=function(){return _0xffffa;};return a57_0x33ea();}(function(_0x31402e,_0x10c3fa){const _0x538eca=a57_0x3ee1,_0x54f2d7=_0x31402e();while(!![]){try{const _0x3abde3=parseInt(_0x538eca(0x15b))/0x1+-parseInt(_0x538eca(0x15d))/0x2+-parseInt(_0x538eca(0x156))/0x3*(parseInt(_0x538eca(0x15e))/0x4)+-parseInt(_0x538eca(0x159))/0x5+-parseInt(_0x538eca(0x158))/0x6+parseInt(_0x538eca(0x15a))/0x7+parseInt(_0x538eca(0x15c))/0x8*(parseInt(_0x538eca(0x157))/0x9);if(_0x3abde3===_0x10c3fa)break;else _0x54f2d7['push'](_0x54f2d7['shift']());}catch(_0xfaed8f){_0x54f2d7['push'](_0x54f2d7['shift']());}}}(a57_0x33ea,0xbb814));import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';function a57_0x3ee1(_0x1911c7,_0x4e98bb){_0x1911c7=_0x1911c7-0x156;const _0x33ea5f=a57_0x33ea();let _0x3ee108=_0x33ea5f[_0x1911c7];return _0x3ee108;}export const dataDefinitions=[dataFilter,dataGetOne];
@@ -1,33 +0,0 @@
1
- /**
2
- * @fileoverview Shared builder for the read-only `data` command group.
3
- *
4
- * The `data filter` and `data getOne` commands differ only in metadata and
5
- * parameter validation. A small factory keeps them aligned with the unified
6
- * command pipeline while avoiding duplicated parsing and execution logic.
7
- */
8
- import { type DatasetDataReadOperation } from "../../core/api-client.js";
9
- import type { CommandDefinition } from "../../framework/types.js";
10
- /**
11
- * Declarative metadata for a single read-only data command.
12
- */
13
- export interface DataCommandSpec {
14
- /** CLI subcommand name, for example `filter` or `getOne`. */
15
- command: string;
16
- /** Runtime API operation name. */
17
- operation: DatasetDataReadOperation;
18
- /** Human-readable command description. */
19
- description: string;
20
- /** Whether `--params` is mandatory. */
21
- paramsRequired: boolean;
22
- /** Help text shown for the `--params` flag. */
23
- paramsHint: string;
24
- /** Optional extended help shown in `--help`. */
25
- helpExtra?: string;
26
- }
27
- /**
28
- * Builds one read-only data command definition.
29
- *
30
- * @param spec - Command metadata.
31
- * @returns A command definition wired to the runtime data API.
32
- */
33
- export declare function buildDataCommand(spec: DataCommandSpec): CommandDefinition;
@@ -1 +0,0 @@
1
- (function(_0x1dc8ea,_0x7b2ecf){const _0x5e25e7=a58_0x3454,_0xeca77b=_0x1dc8ea();while(!![]){try{const _0x1c6a39=parseInt(_0x5e25e7(0x1b1))/0x1+parseInt(_0x5e25e7(0x19a))/0x2+-parseInt(_0x5e25e7(0x199))/0x3+-parseInt(_0x5e25e7(0x1a2))/0x4*(-parseInt(_0x5e25e7(0x193))/0x5)+-parseInt(_0x5e25e7(0x1a6))/0x6*(-parseInt(_0x5e25e7(0x1b3))/0x7)+parseInt(_0x5e25e7(0x1b0))/0x8+parseInt(_0x5e25e7(0x1ac))/0x9*(-parseInt(_0x5e25e7(0x196))/0xa);if(_0x1c6a39===_0x7b2ecf)break;else _0xeca77b['push'](_0xeca77b['shift']());}catch(_0x28aa58){_0xeca77b['push'](_0xeca77b['shift']());}}}(a58_0x15c6,0x59d2d));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a58_0x15c6(){const _0x5479dc=['read','2724UlTthe','paramsRequired','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','operation','appCode','data','14286141NWiyAn','data\x20','code','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','633688TUervB','431393jGaLpT','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','4739iRPUmQ','10dzjWRa','description','flagMissing','10TrNFop','command','string','371724GoNkAb','1274972qVTYcR','getOne','compress','\x20completed\x20in\x20','str','helpExtra','params','now','1247452TNetUy','paramsHint','alias'];a58_0x15c6=function(){return _0x5479dc;};return a58_0x15c6();}import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x339009){const _0x14c7b8=a58_0x3454;if(!_0x339009)throw CliErrors[_0x14c7b8(0x195)](_0x14c7b8(0x1a0),'Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.');const _0x3f37e3=_0x339009['id'];if(_0x3f37e3===undefined||_0x3f37e3===null||_0x3f37e3==='')throw CliErrors['validation'](_0x14c7b8(0x1b2),_0x14c7b8(0x1a8));}function a58_0x3454(_0x45b313,_0x52148a){_0x45b313=_0x45b313-0x193;const _0x15c607=a58_0x15c6();let _0x34540c=_0x15c607[_0x45b313];return _0x34540c;}function parseCommandParams(_0x3465af){return parseJsonParams(_0x3465af)??{};}export function buildDataCommand(_0x28658d){const _0xfe322c=a58_0x3454,_0x186b7b=_0xfe322c(0x1af);return{'service':_0xfe322c(0x1ab),'command':_0x28658d[_0xfe322c(0x197)],'description':_0x28658d[_0xfe322c(0x194)],'risk':_0xfe322c(0x1a5),'defaultOutputFormat':_0xfe322c(0x19c),'helpExtra':_0x28658d[_0xfe322c(0x19f)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0xfe322c(0x1a4),'type':_0xfe322c(0x198),'description':_0x186b7b},{'name':_0xfe322c(0x1a0),'type':_0xfe322c(0x198),'description':_0x28658d[_0xfe322c(0x1a3)]}],async 'validate'(_0x1dc63d){const _0x286bb7=_0xfe322c,_0x450543=_0x1dc63d[_0x286bb7(0x19e)](_0x286bb7(0x1a0));if(_0x28658d[_0x286bb7(0x1a7)]&&!_0x450543)throw CliErrors[_0x286bb7(0x195)](_0x286bb7(0x1a0),_0x28658d[_0x286bb7(0x1a3)]);const _0x586a00=parseJsonParams(_0x450543);_0x28658d[_0x286bb7(0x1a9)]===_0x286bb7(0x19b)&&assertGetOneId(_0x586a00);},async 'execute'(_0x5c5c73){const _0x28caae=_0xfe322c,_0x4d2602=parseCommandParams(_0x5c5c73['str'](_0x28caae(0x1a0))),_0x59a9e4=Date[_0x28caae(0x1a1)](),_0xb8c492=await executeDatasetDataOperation(_0x5c5c73[_0x28caae(0x1aa)],_0x5c5c73[_0x28caae(0x19e)](_0x28caae(0x1ae)),_0x28658d['operation'],_0x4d2602),_0x358b38=Date[_0x28caae(0x1a1)]()-_0x59a9e4;return{'ok':!![],'data':{'result':_0xb8c492,'elapsed':_0x358b38},'message':_0x28caae(0x1ad)+_0x28658d['command']+_0x28caae(0x19d)+_0x358b38+'ms'};}};}
@@ -1,11 +0,0 @@
1
- /**
2
- * init —— 智能初始化(声明式)
3
- *
4
- * 一站式初始化:
5
- * 1. 老项目自动升级(检测旧配置文件)
6
- * 2. --appcode 直接写入配置
7
- * 3. 交互模式:从平台拉取应用列表让用户选择
8
- * 4. CI 模式:必须传 --appcode
9
- */
10
- import type { CommandDefinition } from "../../framework/types.js";
11
- export declare const initDefinitions: CommandDefinition[];
@@ -1 +0,0 @@
1
- const a97_0x410534=a97_0x512c;(function(_0x1c2a54,_0x5bb9fe){const _0x258165=a97_0x512c,_0xb80989=_0x1c2a54();while(!![]){try{const _0x145e5d=parseInt(_0x258165(0x9b))/0x1*(parseInt(_0x258165(0x9e))/0x2)+-parseInt(_0x258165(0x7f))/0x3+parseInt(_0x258165(0x9f))/0x4+parseInt(_0x258165(0xa0))/0x5+parseInt(_0x258165(0x84))/0x6*(parseInt(_0x258165(0x88))/0x7)+parseInt(_0x258165(0x91))/0x8*(-parseInt(_0x258165(0x76))/0x9)+parseInt(_0x258165(0xa2))/0xa*(-parseInt(_0x258165(0x8f))/0xb);if(_0x145e5d===_0x5bb9fe)break;else _0xb80989['push'](_0xb80989['shift']());}catch(_0x49d930){_0xb80989['push'](_0xb80989['shift']());}}}(a97_0x59da,0x7cc4c));import{NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES,writeConfigFile,resolveWriteConfigPath}from'../../context.js';import{upgradeApp}from'../../commands/project/upgrade.js';import{getCliVersion}from'../../utils/version.js';function a97_0x59da(){const _0x36bcc0=['1688074BXsnLV','1102736DbsxSk','916530WWycfp','map','34930UDDQvN','\x20\x20Apps:\x20','Target\x20environment','run','\x0a✓\x20Successfully\x20initialized\x20','defaultApp','string','9HGzKbt','bool','env','Auto-confirm\x20prompts','validation','\x20\x20Env:\x20','valid','str','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.','1390605EkDlIK','\x20config','project','nonInteractive','boolean','6KemIQZ','appcode','toLocaleString','\x20\x20Default:\x20','3426101pTMpYD','Write\x20to\x20global\x20config\x20instead\x20of\x20project','Usage:\x20','custom','cwd','global','\x20init\x20--appcode\x20<code>\x20[--env\x20<env>]','902NgtYca','yes','4251656lqdDSm','检测到旧配置文件,正在自动升级...\x0a','\x20\x20Config:\x20','log','production','App\x20code\x20to\x20initialize\x20with','Use\x20`','Smart\x20init:\x20auto-detect,\x20upgrade,\x20or\x20select\x20app\x20from\x20platform','init','\x20project\x20upgrade`\x20to\x20migrate\x20from\x20legacy\x20config.','1OYFZup','some','appCode'];a97_0x59da=function(){return _0x36bcc0;};return a97_0x59da();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';function a97_0x512c(_0x8d6569,_0x3c07c7){_0x8d6569=_0x8d6569-0x70;const _0x59dab6=a97_0x59da();let _0x512ceb=_0x59dab6[_0x8d6569];return _0x512ceb;}import{existsSync}from'node:fs';import{resolve}from'node:path';import{validateAppcode}from'../../commands/common/validate.js';import{promptCustomAppcode,selectMultipleApps}from'../../commands/common/app-selector.js';import{getCookie}from'../../auth/get-cookie.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';function syntheticApp(_0x38433e){return{'appCode':_0x38433e,'appName':_0x38433e};}function writeInitConfig(_0x4f8a07,_0x36f494,_0x980e8c){const _0x11e441=a97_0x512c,_0x4607e3=resolveWriteConfigPath(_0x4f8a07),_0x273058=buildCanonicalProjectConfig({},{'appCodes':_0x36f494[_0x11e441(0xa1)](_0x5991d7=>_0x5991d7[_0x11e441(0x9d)]),'env':_0x980e8c,'metadata':{'version':getCliVersion(),'createdAt':new Date()[_0x11e441(0x86)]()}});writeConfigFile(_0x4607e3,_0x273058);const _0x3a635c=_0x4f8a07===_0x11e441(0x8d)?'global':_0x11e441(0x81);console[_0x11e441(0x94)](_0x11e441(0x73)+_0x3a635c+_0x11e441(0x80)),console['log'](_0x11e441(0x70)+_0x36f494['map'](_0x5e1fcb=>_0x5e1fcb[_0x11e441(0x9d)])['join'](',\x20')),console[_0x11e441(0x94)](_0x11e441(0x87)+_0x273058[_0x11e441(0x74)]),console[_0x11e441(0x94)](_0x11e441(0x7b)+_0x273058[_0x11e441(0x78)]),console['log'](_0x11e441(0x93)+_0x4607e3);}async function runSmartInit(_0x5fcad2){const _0x331cab=a97_0x512c,_0x4a5c39=process[_0x331cab(0x8c)](),_0x20ef66=_0x5fcad2[_0x331cab(0x77)](_0x331cab(0x8d))?'global':_0x331cab(0x81),_0x1342b6=_0x5fcad2[_0x331cab(0x7d)]('env')||_0x331cab(0x95),_0x1cd282=_0x5fcad2[_0x331cab(0x7d)](_0x331cab(0x85))||undefined;if(_0x20ef66==='project'){const _0x3b31db=existsSync(resolve(_0x4a5c39,NEW_CONFIG_NAME)),_0x10e645=LEGACY_CONFIG_NAMES[_0x331cab(0x9c)](_0x39085c=>existsSync(resolve(_0x4a5c39,_0x39085c)));if(_0x10e645&&!_0x3b31db)return console[_0x331cab(0x94)](_0x331cab(0x92)),upgradeApp(_0x5fcad2[_0x331cab(0x82)],{'yes':_0x5fcad2[_0x331cab(0x77)](_0x331cab(0x90))});if(_0x3b31db)throw CliErrors[_0x331cab(0x7a)](_0x331cab(0x7e),_0x331cab(0x97)+CLI_BIN_NAME+_0x331cab(0x9a));}if(_0x1cd282){const _0x418791=validateAppcode(_0x1cd282);if(!_0x418791[_0x331cab(0x7c)])throw CliErrors[_0x331cab(0x7a)](_0x418791['message']);writeInitConfig(_0x20ef66,[syntheticApp(_0x1cd282)],_0x1342b6);return;}if(_0x5fcad2[_0x331cab(0x82)])throw CliErrors['flagMissing'](_0x331cab(0x85),_0x331cab(0x8a)+CLI_BIN_NAME+_0x331cab(0x8e));const _0x2d8eaa=getCookie(),_0x556009=await selectMultipleApps(_0x2d8eaa),_0xd96763=_0x556009===_0x331cab(0x8b)?[syntheticApp(await promptCustomAppcode())]:_0x556009;writeInitConfig(_0x20ef66,_0xd96763,_0x1342b6);}const initFlags=[{'name':a97_0x410534(0x8d),'type':'boolean','description':a97_0x410534(0x89),'default':![]},{'name':a97_0x410534(0x78),'type':a97_0x410534(0x75),'description':a97_0x410534(0x71),'default':a97_0x410534(0x95),'enum':[...RABETBASE_ENV_VALUES]},{'name':a97_0x410534(0x85),'type':a97_0x410534(0x75),'description':a97_0x410534(0x96)},{'name':a97_0x410534(0x90),'type':a97_0x410534(0x83),'description':a97_0x410534(0x79),'default':![]}];export const initDefinitions=[{'service':a97_0x410534(0x99),'command':a97_0x410534(0x72),'description':a97_0x410534(0x98),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x2ed9e0){return await runSmartInit(_0x2ed9e0),{'ok':!![]};}}];
@@ -1,38 +0,0 @@
1
- /**
2
- * Rules CDN 工具
3
- *
4
- * 从 CDN 拉取 rules 数据,并写入到用户项目
5
- */
6
- /**
7
- * Rules 数据结构
8
- */
9
- export interface RulesData {
10
- version: string;
11
- buildTime: string;
12
- content: string;
13
- lastUpdated?: string;
14
- }
15
- /**
16
- * 从 CDN 拉取 rules 数据
17
- */
18
- export declare function fetchRulesFromCDN(): Promise<RulesData>;
19
- /**
20
- * 获取 rules 内容(优先 CDN,降级本地)
21
- */
22
- export declare function getRulesContent(): Promise<string>;
23
- /**
24
- * 读取本地模板文件
25
- */
26
- export declare function readLocalTemplate(): string;
27
- /**
28
- * 写入 rules 文件到目标路径
29
- */
30
- export declare function writeRulesFile(destPath: string): Promise<void>;
31
- /**
32
- * 复制 rules 到 Cursor rules 目录
33
- */
34
- export declare function copyRulesToCursor(projectRoot: string): Promise<boolean>;
35
- /**
36
- * 复制 rules 到 agents.md(用于 Claude Code)
37
- */
38
- export declare function copyRulesToAgentsMd(projectRoot: string): Promise<boolean>;
@@ -1 +0,0 @@
1
- const a289_0x5376a3=a289_0x1cc5;(function(_0xc6af82,_0xa70912){const _0xd50112=a289_0x1cc5,_0x16b382=_0xc6af82();while(!![]){try{const _0x167679=-parseInt(_0xd50112(0xe2))/0x1*(parseInt(_0xd50112(0xeb))/0x2)+-parseInt(_0xd50112(0xd9))/0x3*(-parseInt(_0xd50112(0xd7))/0x4)+parseInt(_0xd50112(0xe6))/0x5*(parseInt(_0xd50112(0xe0))/0x6)+-parseInt(_0xd50112(0xea))/0x7*(-parseInt(_0xd50112(0xe8))/0x8)+parseInt(_0xd50112(0xe4))/0x9*(parseInt(_0xd50112(0xdd))/0xa)+-parseInt(_0xd50112(0xd8))/0xb*(parseInt(_0xd50112(0xe7))/0xc)+-parseInt(_0xd50112(0xe5))/0xd;if(_0x167679===_0xa70912)break;else _0x16b382['push'](_0x16b382['shift']());}catch(_0x3eeec6){_0x16b382['push'](_0x16b382['shift']());}}}(a289_0x2444,0xc01af));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';function a289_0x2444(){const _0x1540a8=['70002Uimqii','content','1ZluWJx','CDN\x20返回数据格式错误','45eRoeyV','1851148eacXvB','225MKAkrF','11951976CKPBTY','794432bPscaH','utf-8','28qkseft','2008442DefIxi','本地模板文件不存在:\x20','CDN\x20请求失败:\x20','status','4eRVSeO','11PLLDdf','3367521IttwQX','string','../../templates/rules/lovrabet_rules.mdc.tpl','application/json','1769480fhHfjw','json','lastUpdated'];a289_0x2444=function(){return _0x1540a8;};return a289_0x2444();}import{getTemplateBaseUrl}from'../utils/config.js';function a289_0x1cc5(_0x271dce,_0x17caba){_0x271dce=_0x271dce-0xd6;const _0x2444ba=a289_0x2444();let _0x1cc511=_0x2444ba[_0x271dce];return _0x1cc511;}import{appendUpdateTime}from'../utils/guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x1f9af1=getTemplateBaseUrl();return _0x1f9af1+'/rules/rules.json';}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a289_0x5376a3(0xdb));export async function fetchRulesFromCDN(){const _0x156544=a289_0x5376a3,_0x1fed24=getRulesCdnUrl(),_0x5b9a59=await fetch(_0x1fed24,{'headers':{'Accept':_0x156544(0xdc)}});if(!_0x5b9a59['ok'])throw new Error(_0x156544(0xed)+_0x5b9a59[_0x156544(0xd6)]+'\x20'+_0x5b9a59['statusText']);const _0x3a22a5=await _0x5b9a59[_0x156544(0xde)]();if(!_0x3a22a5[_0x156544(0xe1)]||typeof _0x3a22a5[_0x156544(0xe1)]!==_0x156544(0xda))throw new Error(_0x156544(0xe3));return _0x3a22a5;}export async function getRulesContent(){try{const _0x4d6abc=await fetchRulesFromCDN();return _0x4d6abc['content'];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x4b6e1b=a289_0x5376a3;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x4b6e1b(0xe9));throw new Error(_0x4b6e1b(0xec)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x18b6fa){const _0x2c31ab=a289_0x5376a3,_0x4087f0=await fetchRulesFromCDN()['catch'](()=>null);let _0x10387e;_0x4087f0?(_0x10387e=_0x4087f0[_0x2c31ab(0xe1)],_0x4087f0[_0x2c31ab(0xdf)]&&(_0x10387e=appendUpdateTime(_0x10387e,_0x4087f0[_0x2c31ab(0xdf)]))):_0x10387e=readLocalTemplate();const _0x3926fc=dirname(_0x18b6fa);!existsSync(_0x3926fc)&&mkdirSync(_0x3926fc,{'recursive':!![]}),writeFileSync(_0x18b6fa,_0x10387e,_0x2c31ab(0xe9));}export async function copyRulesToCursor(_0xe9a06b){const _0x3f489e=join(_0xe9a06b,'.cursor/rules'),_0x11d0dd=join(_0x3f489e,'lovrabet_rules.mdc');if(existsSync(_0x11d0dd))return![];return await writeRulesFile(_0x11d0dd),!![];}export async function copyRulesToAgentsMd(_0x58ca14){const _0x3ed23b=join(_0x58ca14,'agents.md');if(existsSync(_0x3ed23b))return![];return await writeRulesFile(_0x3ed23b),!![];}