@eaera-com/cms-sdk 0.1.61

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 (288) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +479 -0
  3. package/dist/chunks/_shared-DdBWuPm_.js +27 -0
  4. package/dist/chunks/_shared-DdBWuPm_.js.map +1 -0
  5. package/dist/chunks/auth.constant-CMI1lqQc.js +37 -0
  6. package/dist/chunks/auth.constant-CMI1lqQc.js.map +1 -0
  7. package/dist/chunks/authz.constant-BAarvacV.js +9 -0
  8. package/dist/chunks/authz.constant-BAarvacV.js.map +1 -0
  9. package/dist/chunks/http.constant-BzH5tJTG.js +33 -0
  10. package/dist/chunks/http.constant-BzH5tJTG.js.map +1 -0
  11. package/dist/chunks/mt5Retcode-DlZLQOLA.js +178 -0
  12. package/dist/chunks/mt5Retcode-DlZLQOLA.js.map +1 -0
  13. package/dist/chunks/storage.constant--64BDSPW.js +44 -0
  14. package/dist/chunks/storage.constant--64BDSPW.js.map +1 -0
  15. package/dist/common/constants/auth.constant.d.ts +54 -0
  16. package/dist/common/constants/auth.constant.d.ts.map +1 -0
  17. package/dist/common/constants/authz.constant.d.ts +27 -0
  18. package/dist/common/constants/authz.constant.d.ts.map +1 -0
  19. package/dist/common/constants/bars.constant.d.ts +15 -0
  20. package/dist/common/constants/bars.constant.d.ts.map +1 -0
  21. package/dist/common/constants/content-types.constant.d.ts +31 -0
  22. package/dist/common/constants/content-types.constant.d.ts.map +1 -0
  23. package/dist/common/constants/content.constant.d.ts +114 -0
  24. package/dist/common/constants/content.constant.d.ts.map +1 -0
  25. package/dist/common/constants/executions.constant.d.ts +56 -0
  26. package/dist/common/constants/executions.constant.d.ts.map +1 -0
  27. package/dist/common/constants/gov.constant.d.ts +118 -0
  28. package/dist/common/constants/gov.constant.d.ts.map +1 -0
  29. package/dist/common/constants/history.constant.d.ts +108 -0
  30. package/dist/common/constants/history.constant.d.ts.map +1 -0
  31. package/dist/common/constants/http.constant.d.ts +46 -0
  32. package/dist/common/constants/http.constant.d.ts.map +1 -0
  33. package/dist/common/constants/index.d.ts +16 -0
  34. package/dist/common/constants/index.d.ts.map +1 -0
  35. package/dist/common/constants/kalshi.constant.d.ts +35 -0
  36. package/dist/common/constants/kalshi.constant.d.ts.map +1 -0
  37. package/dist/common/constants/llm.constant.d.ts +37 -0
  38. package/dist/common/constants/llm.constant.d.ts.map +1 -0
  39. package/dist/common/constants/mt5-action.constant.d.ts +131 -0
  40. package/dist/common/constants/mt5-action.constant.d.ts.map +1 -0
  41. package/dist/common/constants/mt5.constant.d.ts +254 -0
  42. package/dist/common/constants/mt5.constant.d.ts.map +1 -0
  43. package/dist/common/constants/notifications.constant.d.ts +45 -0
  44. package/dist/common/constants/notifications.constant.d.ts.map +1 -0
  45. package/dist/common/constants/people.constant.d.ts +269 -0
  46. package/dist/common/constants/people.constant.d.ts.map +1 -0
  47. package/dist/common/constants/rules.constant.d.ts +14 -0
  48. package/dist/common/constants/rules.constant.d.ts.map +1 -0
  49. package/dist/common/constants/settings.constant.d.ts +17 -0
  50. package/dist/common/constants/settings.constant.d.ts.map +1 -0
  51. package/dist/common/constants/sort.constant.d.ts +14 -0
  52. package/dist/common/constants/sort.constant.d.ts.map +1 -0
  53. package/dist/common/constants/storage.constant.d.ts +74 -0
  54. package/dist/common/constants/storage.constant.d.ts.map +1 -0
  55. package/dist/common/helpers/format.d.ts +7 -0
  56. package/dist/common/helpers/format.d.ts.map +1 -0
  57. package/dist/common/helpers/format.js +20 -0
  58. package/dist/common/helpers/format.js.map +1 -0
  59. package/dist/common/helpers/mt5Retcode.d.ts +18 -0
  60. package/dist/common/helpers/mt5Retcode.d.ts.map +1 -0
  61. package/dist/common/helpers/mt5Retcode.js +2 -0
  62. package/dist/common/helpers/mt5Retcode.js.map +1 -0
  63. package/dist/common/utils/case.d.ts +12 -0
  64. package/dist/common/utils/case.d.ts.map +1 -0
  65. package/dist/common/utils/clone.d.ts +9 -0
  66. package/dist/common/utils/clone.d.ts.map +1 -0
  67. package/dist/composables/cbsStateKey.d.ts +27 -0
  68. package/dist/composables/cbsStateKey.d.ts.map +1 -0
  69. package/dist/core/createApi.d.ts +69 -0
  70. package/dist/core/createApi.d.ts.map +1 -0
  71. package/dist/core/createCmsSDK.d.ts +19 -0
  72. package/dist/core/createCmsSDK.d.ts.map +1 -0
  73. package/dist/core/credentials/TokenManager.d.ts +38 -0
  74. package/dist/core/credentials/TokenManager.d.ts.map +1 -0
  75. package/dist/core/credentials/credential.type.d.ts +16 -0
  76. package/dist/core/credentials/credential.type.d.ts.map +1 -0
  77. package/dist/core/credentials/resolveStorage.d.ts +6 -0
  78. package/dist/core/credentials/resolveStorage.d.ts.map +1 -0
  79. package/dist/core/credentials/storages/cookieStorage.d.ts +18 -0
  80. package/dist/core/credentials/storages/cookieStorage.d.ts.map +1 -0
  81. package/dist/core/credentials/storages/localStorageAdapter.d.ts +8 -0
  82. package/dist/core/credentials/storages/localStorageAdapter.d.ts.map +1 -0
  83. package/dist/core/credentials/storages/memoryStorage.d.ts +7 -0
  84. package/dist/core/credentials/storages/memoryStorage.d.ts.map +1 -0
  85. package/dist/core/errors.d.ts +26 -0
  86. package/dist/core/errors.d.ts.map +1 -0
  87. package/dist/core/sdk.type.d.ts +123 -0
  88. package/dist/core/sdk.type.d.ts.map +1 -0
  89. package/dist/core/ws/createEaeraWebSocket.d.ts +21 -0
  90. package/dist/core/ws/createEaeraWebSocket.d.ts.map +1 -0
  91. package/dist/core/ws/index.d.ts +4 -0
  92. package/dist/core/ws/index.d.ts.map +1 -0
  93. package/dist/core/ws/ws.constants.d.ts +246 -0
  94. package/dist/core/ws/ws.constants.d.ts.map +1 -0
  95. package/dist/core/ws/ws.events.d.ts +264 -0
  96. package/dist/core/ws/ws.events.d.ts.map +1 -0
  97. package/dist/core/ws/ws.type.d.ts +225 -0
  98. package/dist/core/ws/ws.type.d.ts.map +1 -0
  99. package/dist/index.d.ts +135 -0
  100. package/dist/index.d.ts.map +1 -0
  101. package/dist/index.js +8608 -0
  102. package/dist/index.js.map +1 -0
  103. package/dist/nuxt.d.ts +55 -0
  104. package/dist/nuxt.d.ts.map +1 -0
  105. package/dist/nuxt.js +48 -0
  106. package/dist/nuxt.js.map +1 -0
  107. package/dist/runtime/plugin.d.ts +6 -0
  108. package/dist/runtime/plugin.js +197 -0
  109. package/dist/runtime/plugin.js.map +1 -0
  110. package/dist/server/auth/cbs-callback.post.js +43 -0
  111. package/dist/server/auth/cbs-callback.post.js.map +1 -0
  112. package/dist/server/auth/cbs-start.post.js +35 -0
  113. package/dist/server/auth/cbs-start.post.js.map +1 -0
  114. package/dist/server/auth/idp-callback.get.js +53 -0
  115. package/dist/server/auth/idp-callback.get.js.map +1 -0
  116. package/dist/server/auth/idp-link.post.js +39 -0
  117. package/dist/server/auth/idp-link.post.js.map +1 -0
  118. package/dist/server/auth/idp-login.get.js +43 -0
  119. package/dist/server/auth/idp-login.get.js.map +1 -0
  120. package/dist/server/auth/idp-unlink.delete.js +39 -0
  121. package/dist/server/auth/idp-unlink.delete.js.map +1 -0
  122. package/dist/server/auth/login.post.js +46 -0
  123. package/dist/server/auth/login.post.js.map +1 -0
  124. package/dist/server/auth/logout.post.js +32 -0
  125. package/dist/server/auth/logout.post.js.map +1 -0
  126. package/dist/server/auth/refresh.post.js +47 -0
  127. package/dist/server/auth/refresh.post.js.map +1 -0
  128. package/dist/server/authz/portal-access.get.js +43 -0
  129. package/dist/server/authz/portal-access.get.js.map +1 -0
  130. package/dist/server/clear-token.delete.js +12 -0
  131. package/dist/server/clear-token.delete.js.map +1 -0
  132. package/dist/server/persist.post.js +31 -0
  133. package/dist/server/persist.post.js.map +1 -0
  134. package/dist/server/set-token.post.js +27 -0
  135. package/dist/server/set-token.post.js.map +1 -0
  136. package/dist/services/auth/auth.type.d.ts +73 -0
  137. package/dist/services/auth/auth.type.d.ts.map +1 -0
  138. package/dist/services/auth/index.d.ts +127 -0
  139. package/dist/services/auth/index.d.ts.map +1 -0
  140. package/dist/services/auth/mock.d.ts +13 -0
  141. package/dist/services/auth/mock.d.ts.map +1 -0
  142. package/dist/services/authz/authz.type.d.ts +21 -0
  143. package/dist/services/authz/authz.type.d.ts.map +1 -0
  144. package/dist/services/authz/index.d.ts +43 -0
  145. package/dist/services/authz/index.d.ts.map +1 -0
  146. package/dist/services/bars/bars.type.d.ts +78 -0
  147. package/dist/services/bars/bars.type.d.ts.map +1 -0
  148. package/dist/services/bars/index.d.ts +24 -0
  149. package/dist/services/bars/index.d.ts.map +1 -0
  150. package/dist/services/bars/mock.d.ts +23 -0
  151. package/dist/services/bars/mock.d.ts.map +1 -0
  152. package/dist/services/content/content.type.d.ts +832 -0
  153. package/dist/services/content/content.type.d.ts.map +1 -0
  154. package/dist/services/content/filter.d.ts +46 -0
  155. package/dist/services/content/filter.d.ts.map +1 -0
  156. package/dist/services/content/index.d.ts +35 -0
  157. package/dist/services/content/index.d.ts.map +1 -0
  158. package/dist/services/content/mock.d.ts +16 -0
  159. package/dist/services/content/mock.d.ts.map +1 -0
  160. package/dist/services/content-types/content-types.type.d.ts +70 -0
  161. package/dist/services/content-types/content-types.type.d.ts.map +1 -0
  162. package/dist/services/content-types/index.d.ts +25 -0
  163. package/dist/services/content-types/index.d.ts.map +1 -0
  164. package/dist/services/content-types/mock.d.ts +15 -0
  165. package/dist/services/content-types/mock.d.ts.map +1 -0
  166. package/dist/services/executions/executions.type.d.ts +67 -0
  167. package/dist/services/executions/executions.type.d.ts.map +1 -0
  168. package/dist/services/executions/index.d.ts +30 -0
  169. package/dist/services/executions/index.d.ts.map +1 -0
  170. package/dist/services/executions/mock.d.ts +29 -0
  171. package/dist/services/executions/mock.d.ts.map +1 -0
  172. package/dist/services/gov/gov.type.d.ts +740 -0
  173. package/dist/services/gov/gov.type.d.ts.map +1 -0
  174. package/dist/services/gov/index.d.ts +84 -0
  175. package/dist/services/gov/index.d.ts.map +1 -0
  176. package/dist/services/history/history.type.d.ts +167 -0
  177. package/dist/services/history/history.type.d.ts.map +1 -0
  178. package/dist/services/history/index.d.ts +38 -0
  179. package/dist/services/history/index.d.ts.map +1 -0
  180. package/dist/services/history/mock.d.ts +21 -0
  181. package/dist/services/history/mock.d.ts.map +1 -0
  182. package/dist/services/kalshi/index.d.ts +19 -0
  183. package/dist/services/kalshi/index.d.ts.map +1 -0
  184. package/dist/services/kalshi/kalshi.type.d.ts +99 -0
  185. package/dist/services/kalshi/kalshi.type.d.ts.map +1 -0
  186. package/dist/services/kalshi/mock.d.ts +5 -0
  187. package/dist/services/kalshi/mock.d.ts.map +1 -0
  188. package/dist/services/llm/index.d.ts +38 -0
  189. package/dist/services/llm/index.d.ts.map +1 -0
  190. package/dist/services/llm/llm.type.d.ts +106 -0
  191. package/dist/services/llm/llm.type.d.ts.map +1 -0
  192. package/dist/services/notifications/index.d.ts +38 -0
  193. package/dist/services/notifications/index.d.ts.map +1 -0
  194. package/dist/services/notifications/mock.d.ts +39 -0
  195. package/dist/services/notifications/mock.d.ts.map +1 -0
  196. package/dist/services/notifications/notifications.type.d.ts +75 -0
  197. package/dist/services/notifications/notifications.type.d.ts.map +1 -0
  198. package/dist/services/people/_invoke.d.ts +26 -0
  199. package/dist/services/people/_invoke.d.ts.map +1 -0
  200. package/dist/services/people/copilot/index.d.ts +132 -0
  201. package/dist/services/people/copilot/index.d.ts.map +1 -0
  202. package/dist/services/people/identity/actions.d.ts +116 -0
  203. package/dist/services/people/identity/actions.d.ts.map +1 -0
  204. package/dist/services/people/identity/ct.types.d.ts +133 -0
  205. package/dist/services/people/identity/ct.types.d.ts.map +1 -0
  206. package/dist/services/people/identity/index.d.ts +14 -0
  207. package/dist/services/people/identity/index.d.ts.map +1 -0
  208. package/dist/services/people/identity/projections.d.ts +63 -0
  209. package/dist/services/people/identity/projections.d.ts.map +1 -0
  210. package/dist/services/people/index.d.ts +31 -0
  211. package/dist/services/people/index.d.ts.map +1 -0
  212. package/dist/services/people/legal/actions.d.ts +161 -0
  213. package/dist/services/people/legal/actions.d.ts.map +1 -0
  214. package/dist/services/people/legal/ct.types.d.ts +186 -0
  215. package/dist/services/people/legal/ct.types.d.ts.map +1 -0
  216. package/dist/services/people/legal/index.d.ts +15 -0
  217. package/dist/services/people/legal/index.d.ts.map +1 -0
  218. package/dist/services/people/packops/index.d.ts +79 -0
  219. package/dist/services/people/packops/index.d.ts.map +1 -0
  220. package/dist/services/people/packops/packops.type.d.ts +208 -0
  221. package/dist/services/people/packops/packops.type.d.ts.map +1 -0
  222. package/dist/services/people/perms/actions.d.ts +214 -0
  223. package/dist/services/people/perms/actions.d.ts.map +1 -0
  224. package/dist/services/people/perms/ct.types.d.ts +140 -0
  225. package/dist/services/people/perms/ct.types.d.ts.map +1 -0
  226. package/dist/services/people/perms/index.d.ts +14 -0
  227. package/dist/services/people/perms/index.d.ts.map +1 -0
  228. package/dist/services/people/perms/projections.d.ts +47 -0
  229. package/dist/services/people/perms/projections.d.ts.map +1 -0
  230. package/dist/services/people/process/actions.d.ts +154 -0
  231. package/dist/services/people/process/actions.d.ts.map +1 -0
  232. package/dist/services/people/process/ct.types.d.ts +304 -0
  233. package/dist/services/people/process/ct.types.d.ts.map +1 -0
  234. package/dist/services/people/process/index.d.ts +12 -0
  235. package/dist/services/people/process/index.d.ts.map +1 -0
  236. package/dist/services/people/shared.types.d.ts +36 -0
  237. package/dist/services/people/shared.types.d.ts.map +1 -0
  238. package/dist/services/rules/conditions.d.ts +264 -0
  239. package/dist/services/rules/conditions.d.ts.map +1 -0
  240. package/dist/services/rules/index.d.ts +49 -0
  241. package/dist/services/rules/index.d.ts.map +1 -0
  242. package/dist/services/rules/llm-rule.constant.d.ts +84 -0
  243. package/dist/services/rules/llm-rule.constant.d.ts.map +1 -0
  244. package/dist/services/rules/mock.d.ts +20 -0
  245. package/dist/services/rules/mock.d.ts.map +1 -0
  246. package/dist/services/rules/rules.type.d.ts +262 -0
  247. package/dist/services/rules/rules.type.d.ts.map +1 -0
  248. package/dist/services/rules/triggers.d.ts +140 -0
  249. package/dist/services/rules/triggers.d.ts.map +1 -0
  250. package/dist/services/settings/index.d.ts +36 -0
  251. package/dist/services/settings/index.d.ts.map +1 -0
  252. package/dist/services/settings/mock.d.ts +14 -0
  253. package/dist/services/settings/mock.d.ts.map +1 -0
  254. package/dist/services/settings/settings.type.d.ts +39 -0
  255. package/dist/services/settings/settings.type.d.ts.map +1 -0
  256. package/dist/stores/auth.d.ts +192 -0
  257. package/dist/stores/auth.d.ts.map +1 -0
  258. package/dist/stores/authz.d.ts +116 -0
  259. package/dist/stores/authz.d.ts.map +1 -0
  260. package/dist/stores/bars.d.ts +288 -0
  261. package/dist/stores/bars.d.ts.map +1 -0
  262. package/dist/stores/content.d.ts +4101 -0
  263. package/dist/stores/content.d.ts.map +1 -0
  264. package/dist/stores/executions.d.ts +249 -0
  265. package/dist/stores/executions.d.ts.map +1 -0
  266. package/dist/stores/gov.d.ts +238 -0
  267. package/dist/stores/gov.d.ts.map +1 -0
  268. package/dist/stores/history.d.ts +833 -0
  269. package/dist/stores/history.d.ts.map +1 -0
  270. package/dist/stores/index.d.ts +16 -0
  271. package/dist/stores/index.d.ts.map +1 -0
  272. package/dist/stores/kalshi.d.ts +728 -0
  273. package/dist/stores/kalshi.d.ts.map +1 -0
  274. package/dist/stores/llm-providers.d.ts +97 -0
  275. package/dist/stores/llm-providers.d.ts.map +1 -0
  276. package/dist/stores/llm.d.ts +102 -0
  277. package/dist/stores/llm.d.ts.map +1 -0
  278. package/dist/stores/people.d.ts +596 -0
  279. package/dist/stores/people.d.ts.map +1 -0
  280. package/dist/stores/persist.d.ts +58 -0
  281. package/dist/stores/persist.d.ts.map +1 -0
  282. package/dist/stores/rules.d.ts +485 -0
  283. package/dist/stores/rules.d.ts.map +1 -0
  284. package/dist/stores/settings.d.ts +36 -0
  285. package/dist/stores/settings.d.ts.map +1 -0
  286. package/dist/stores/ws.d.ts +66 -0
  287. package/dist/stores/ws.d.ts.map +1 -0
  288. package/package.json +90 -0
@@ -0,0 +1,49 @@
1
+ import { $Fetch } from 'ofetch';
2
+ import { ContentRule, ContentRuleListResponse, RuleCreatePayload, RuleListQuery, RuleUpdatePayload, SignalFireContext, SignalFireResponse } from './rules.type';
3
+ export interface IRulesServiceOptions {
4
+ /** The CMS `$Fetch` instance (one of `sdk.apis`). */
5
+ api: $Fetch;
6
+ /** Lazy flag — when true, the service returns fake data. */
7
+ mock: () => boolean;
8
+ }
9
+ export interface IRulesService {
10
+ list(query?: RuleListQuery): Promise<ContentRuleListResponse>;
11
+ detail(uuid: string): Promise<ContentRule>;
12
+ create(payload: RuleCreatePayload): Promise<ContentRule>;
13
+ update(uuid: string, payload: RuleUpdatePayload): Promise<ContentRule>;
14
+ remove(uuid: string): Promise<void>;
15
+ /**
16
+ * Manually fire a signal rule (`POST /api/v1/rules/signals/fire`). Runs
17
+ * synchronously in the API pod — the canonical way to verify an action
18
+ * handler works without scheduling cron (cron + action is currently broken
19
+ * backend-side; see `risk-rules-api-guide.md` §8.F).
20
+ *
21
+ * Pass `options.timeoutMs` to override the SDK-wide 30s HTTP timeout
22
+ * (the API pod runs the rule synchronously and a multi-step action chain
23
+ * can exceed 30s on real traffic — the dashboard's "Fire now" dialog
24
+ * raises the ceiling to 120s by default).
25
+ */
26
+ signalFire(signalName: string, context: SignalFireContext, options?: {
27
+ timeoutMs?: number;
28
+ }): Promise<SignalFireResponse>;
29
+ }
30
+ /**
31
+ * Content-rules service. CRUD over `/api/v1/rules`. Serves both FEAT-002
32
+ * (`conditionType: 'llm_agent'` skills) and FEAT-004 (expression/chain).
33
+ *
34
+ * Endpoint contract (`eaera_cms/core/rules/routes.py`):
35
+ * GET /api/v1/rules → list (no pagination; `total === items.length`)
36
+ * GET /api/v1/rules/{uuid} → single rule
37
+ * POST /api/v1/rules → create (flat payload)
38
+ * PUT /api/v1/rules/{uuid} → update
39
+ * DELETE /api/v1/rules/{uuid} → remove
40
+ * POST /api/v1/rules/signals/fire → fire a signal rule synchronously
41
+ *
42
+ * The route accepts the flat `RuleCreatePayload` (`TriggerCreateRequest`,
43
+ * `extra: allow`) and the service reads flat top-level keys. See rules.type.ts.
44
+ *
45
+ * While `mock()` returns true, all methods resolve against the local fake
46
+ * dataset and never touch `api`.
47
+ */
48
+ export declare function createRulesService(opts: IRulesServiceOptions): IRulesService;
49
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUrC,OAAO,KAAK,EACV,WAAW,EACX,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC9D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACvE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC;;;;;;;;;;OAUG;IACH,UAAU,CACR,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CA4C5E"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Constants for `conditionType: 'llm_agent'` rule configuration.
3
+ *
4
+ * The `llm_agent` rule is composed of two parts:
5
+ * - **Prompt** — the user-facing Skill entity (`/api/v1/llm/prompts`).
6
+ * Owned by the Skills page. The rule references it via
7
+ * `trigger.sourceConfig.promptName`.
8
+ * - **Rule** — the `ContentRule` (owned by the Fixed Rules editor).
9
+ * Carries trigger mode, read-only MCP `queryTools` allowlist,
10
+ * `executionParams.llmEval` knobs (`maxIterations` / `budgetUsd`),
11
+ * and the `executionType`/`executionParams` shape (single action or
12
+ * action chain — same shape the fixed-rule builder emits).
13
+ *
14
+ * Reference: `risk-rules-api-guide.md` §7.B (LLM evaluator behaviour),
15
+ * §7.B Sample 7B.5 (canonical llm_agent payload), §8.B (rule editor knobs).
16
+ */
17
+ /** The full read-only MCP tool set the evaluator accepts. The dashboard
18
+ * only ever offers these — the engine rejects anything else with
19
+ * `tool '…' is not available (read-only)`. */
20
+ export declare const LLM_QUERY_TOOL: {
21
+ readonly CONTENT_QUERY: "content_query";
22
+ readonly CONTENT_GET: "content_get";
23
+ readonly EXECUTE_REPORT: "execute_report";
24
+ readonly GET_SCHEMA: "get_schema";
25
+ readonly LIST_CTS: "list_cts";
26
+ readonly CH_QUERY: "ch_query";
27
+ };
28
+ /** Read-only MCP tool union — derived from {@link LLM_QUERY_TOOL}. */
29
+ export type LlmQueryTool = (typeof LLM_QUERY_TOOL)[keyof typeof LLM_QUERY_TOOL];
30
+ /** Human-labelled option for the queryTools multi-select. */
31
+ export interface LlmQueryToolOption {
32
+ label: string;
33
+ value: LlmQueryTool;
34
+ /** Short hint shown under the label — explains what the tool does. */
35
+ hint: string;
36
+ }
37
+ /** All {@link LlmQueryTool} options in the canonical order. */
38
+ export declare const LLM_QUERY_TOOL_OPTIONS: readonly LlmQueryToolOption[];
39
+ /** The minimum allowlist the engine recommends for scan-mode rules. */
40
+ export declare const DEFAULT_LLM_QUERY_TOOLS: readonly LlmQueryTool[];
41
+ /** Per-rule LLM-eval knobs. Bounds are enforced by
42
+ * `eaera_cms/core/rules/llm_evaluator.py`: `maxIterations` defaults to 5
43
+ * and is hard-capped at 20; `budgetUsd` defaults to 1.0 and is enforced
44
+ * before every LLM call; `maxTokens` caps the per-completion token output
45
+ * (no temperature — the backend does not accept it). */
46
+ export declare const LLM_EVAL_BOUNDS: {
47
+ readonly maxIterations: {
48
+ readonly min: 1;
49
+ readonly default: 5;
50
+ readonly max: 20;
51
+ };
52
+ readonly budgetUsd: {
53
+ readonly min: 0;
54
+ readonly default: 1;
55
+ };
56
+ readonly maxTokens: {
57
+ readonly min: 1;
58
+ readonly default: 1024;
59
+ readonly max: 32000;
60
+ };
61
+ };
62
+ /** Shape of `executionParams.llmEval` — the engine reads both fields at
63
+ * `LLMConditionEvaluator.run_iteration()` time. */
64
+ export interface LlmEval {
65
+ maxIterations: number;
66
+ budgetUsd: number;
67
+ /** Max tokens per completion. */
68
+ maxTokens?: number;
69
+ }
70
+ /** Read `executionParams.llmEval` from a stored rule, with defaults. */
71
+ export declare const llmEvalOf: (executionParams: Record<string, unknown> | null | undefined) => LlmEval;
72
+ /** Read `trigger.sourceConfig.queryTools` from a stored trigger.
73
+ *
74
+ * ⚠️ **Advisory only.** The dashboard persists the per-rule allowlist
75
+ * here, but `LLMConditionEvaluator` (`eaera-cms/core/rules/llm_evaluator.py`)
76
+ * uses its own hardcoded `_readonly_tool_names()` set today — the per-rule
77
+ * value is NOT yet honoured by the engine. The UI shows the checkbox grid
78
+ * and persists the choice so it's ready for the day the backend wires it
79
+ * through; until then, restricting this list has no runtime effect on the
80
+ * agent. Do not promise the user otherwise in the UI copy. */
81
+ export declare const queryToolsOf: (trigger: Record<string, unknown> | null | undefined) => LlmQueryTool[];
82
+ /** Read `trigger.sourceConfig.promptName` from a stored trigger. */
83
+ export declare const promptNameOf: (trigger: Record<string, unknown> | null | undefined) => string;
84
+ //# sourceMappingURL=llm-rule.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-rule.constant.d.ts","sourceRoot":"","sources":["../../../src/services/rules/llm-rule.constant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;+CAE+C;AAC/C,eAAO,MAAM,cAAc;;;;;;;CAOjB,CAAC;AAEX,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;IACpB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+DAA+D;AAC/D,eAAO,MAAM,sBAAsB,EAAE,SAAS,kBAAkB,EA+B/D,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,uBAAuB,EAAE,SAAS,YAAY,EAG1D,CAAC;AAEF;;;;yDAIyD;AACzD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAIlB,CAAC;AAEX;oDACoD;AACpD,MAAM,WAAW,OAAO;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wEAAwE;AACxE,eAAO,MAAM,SAAS,GAAI,iBAAiB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,OAYvF,CAAC;AAEF;;;;;;;;+DAQ+D;AAC/D,eAAO,MAAM,YAAY,GACvB,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAClD,YAAY,EAOd,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,MAIlF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ContentRule, RuleCreatePayload, RuleListQuery } from './rules.type';
2
+ /**
3
+ * Fake rules dataset used while the CMS rules endpoints are under
4
+ * development. Covers both FEAT-002 (`llmAgent`) and FEAT-004
5
+ * (expression/chain) rule shapes.
6
+ *
7
+ * Field names use camelCase to match the backend API response. Action
8
+ * parameters are nested under `params` and `conditionExpr` references the
9
+ * real condition-field catalog (`account_state.*` / `account_metric_by_deal.*`).
10
+ */
11
+ export declare const MOCK_RULES: ContentRule[];
12
+ export declare function mockRuleList(query?: RuleListQuery): {
13
+ items: ContentRule[];
14
+ total: number;
15
+ };
16
+ export declare function mockRuleDetail(uuid: string): ContentRule | undefined;
17
+ export declare function mockRuleCreate(payload: RuleCreatePayload): ContentRule;
18
+ export declare function mockRuleUpdate(uuid: string, patch: Partial<RuleCreatePayload>): ContentRule | undefined;
19
+ export declare function mockRuleRemove(uuid: string): boolean;
20
+ //# sourceMappingURL=mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/services/rules/mock.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElF;;;;;;;;GAQG;AAEH,eAAO,MAAM,UAAU,EAAE,WAAW,EAuHnC,CAAC;AAOF,wBAAgB,YAAY,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG;IACnD,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAUA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEpE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CAuBtE;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,WAAW,GAAG,SAAS,CAkBzB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKpD"}
@@ -0,0 +1,262 @@
1
+ import { SerializationFormat } from '../../common/constants/http.constant';
2
+ import { TriggerTypeValue } from './triggers';
3
+ export type TriggerType = TriggerTypeValue;
4
+ /**
5
+ * Wire-level `trigger_type` union (schema-validated by
6
+ * `eaera_cms/core/rules/definitions.py:33-39`).
7
+ *
8
+ * Note this is **different** from the `source_type` value the engine matcher
9
+ * reads (`event_dto | cron | batch | stream | signal`). The canonical
10
+ * pair for event rules is `trigger_type: "event"` +
11
+ * `source_type: "event_dto"` — see `packs/registry.py:463-470` and the
12
+ * SDK `TRIGGER_TYPE` / `TRIGGER_MODE` constants in `triggers.ts`.
13
+ *
14
+ * Aliased to `TriggerType` via the `index.ts` barrel for backwards
15
+ * compatibility with consumers that imported it from this module.
16
+ */
17
+ /**
18
+ * One row in `trigger.conditions[]` — the flat AND list the engine evaluates
19
+ * when `conditionType` is `'trigger_conds'` or omitted. The dashboard's visual
20
+ * tree builder (`LogicTree.vue`) emits these; backend-authored packs (`*.yaml`)
21
+ * emit them too. `field` is either a CH catalog key (`account_state.equity`),
22
+ * a dotted event-payload path (`deal.profit`), or a flat event field
23
+ * (`profit` — engine fallback).
24
+ *
25
+ * `operator` is one of the word forms exposed by the SDK
26
+ * (`CONDITION_OPERATORS`: `gt`/`gte`/`lt`/`lte`/`eq`/`ne`/`in`/`not_in`/
27
+ * `contains`/`startswith`/`endswith`/`is_null`/`is_not_null`) plus the
28
+ * cron-specific `sum_within_days` (carries a numeric `days` window).
29
+ *
30
+ * `value` shape depends on the operator — see
31
+ * `cms-sdk/src/services/rules/conditions.ts:CONDITION_OPERATOR_VALUE_KINDS`:
32
+ * - numeric operators → number
33
+ * - `in` / `not_in` → array of primitives
34
+ * - string operators → string (entity is coerced via `str()`)
35
+ * - `is_null` / `is_not_null` → ignored (send `null`)
36
+ * - `sum_within_days` → number (threshold), `days` is the window
37
+ */
38
+ export interface TriggerConditionRow {
39
+ field: string;
40
+ operator: string;
41
+ value: unknown;
42
+ /** Cron-only: window size for `sum_within_days`. */
43
+ days?: number;
44
+ }
45
+ export interface TriggerDefinition {
46
+ /**
47
+ * The backend SQL filter (`trigger_api.py:fire_signal`) and engine matcher
48
+ * (`engine.py:_match_trigger`) read `trigger.source_type`, NOT
49
+ * `trigger.trigger_type`. Builders in `triggers.ts` emit BOTH
50
+ * `sourceType` and `triggerType` (camelCase) so the CMS casing middleware
51
+ * produces both keys in the stored JSONB.
52
+ *
53
+ * IMPORTANT: for event rules the two values DIVERGE — see the canonical
54
+ * contract documented on `TRIGGER_MODE` / `TRIGGER_TYPE` in
55
+ * `cms-sdk/src/services/rules/triggers.ts`. `sourceType: 'event_dto'`
56
+ * (engine matcher), `triggerType: 'event'` (schema validator). Earlier
57
+ * SDK builds emitted both as `'event_dto'`, which drifted from the
58
+ * pack-authored contract.
59
+ */
60
+ sourceType?: 'event_dto' | 'cron' | 'batch' | 'stream' | 'signal';
61
+ triggerType: TriggerType;
62
+ topic?: string;
63
+ /**
64
+ * Top-level AND condition list. Backend reads this when
65
+ * `conditionType` is `'trigger_conds'` (or omitted). Dashboard tree
66
+ * builder emits here; the Fixed Rules editor's `trigger_conds` path
67
+ * goes through here too.
68
+ */
69
+ conditions?: TriggerConditionRow[];
70
+ /**
71
+ * Type-specific trigger config ONLY — e.g. `signalName`, `topic`, `schedule`,
72
+ * `timezone`, `streamName`, `windowSeconds`, `contentTypes`, `eventTypes`,
73
+ * `promptName` (LLM rules), `queryTools` (LLM rules).
74
+ *
75
+ * There is **no `scope` concept** on a rule. A rule is scoped by `contentType`
76
+ * + trigger-source matching + the `conditionExpr`; do not write a `scope`
77
+ * (`groups`/`symbols`/`logins`/`emails`) key here — the backend ignores it.
78
+ */
79
+ sourceConfig: Record<string, unknown>;
80
+ }
81
+ /** Value-level constants for ConditionType — single source of truth. */
82
+ export declare const CONDITION_TYPE: {
83
+ readonly EXPRESSION: "expression";
84
+ readonly CODE: "code";
85
+ readonly LLM_AGENT: "llm_agent";
86
+ readonly TRIGGER_CONDS: "trigger_conds";
87
+ };
88
+ /** Condition type — derived from {@link CONDITION_TYPE}. */
89
+ export type ConditionType = (typeof CONDITION_TYPE)[keyof typeof CONDITION_TYPE];
90
+ /** Value-level constants for ExecutionType — single source of truth. */
91
+ export declare const EXECUTION_TYPE: {
92
+ readonly ACTION: "action";
93
+ readonly SET_FIELD: "set_field";
94
+ readonly NOTIFY: "notify";
95
+ readonly TRANSITION: "transition";
96
+ readonly HTTP_CALL: "http_call";
97
+ readonly CHAIN: "chain";
98
+ };
99
+ /** Execution type — derived from {@link EXECUTION_TYPE}. */
100
+ export type ExecutionType = (typeof EXECUTION_TYPE)[keyof typeof EXECUTION_TYPE];
101
+ /**
102
+ * One action invocation. The dispatcher reads `actionName` and a **nested**
103
+ * `params`; e.g. a group move is `{ actionName: 'change_group', params: { newGroup } }`
104
+ * and a leverage change is `{ actionName: 'change_leverage', params: { newLeverage } }`.
105
+ */
106
+ export interface ActionExecutionParams {
107
+ actionName: string;
108
+ /** Action-specific payload (`{ newGroup }` / `{ newLeverage }`). */
109
+ params: Record<string, unknown>;
110
+ }
111
+ /**
112
+ * One step in an ordered action chain. Each step dispatches via its own
113
+ * `type` (any `ExecutionType` except `chain`); an `action` step uses
114
+ * {@link ActionExecutionParams} as its `params`.
115
+ */
116
+ export interface ChainStep {
117
+ type: Exclude<ExecutionType, typeof EXECUTION_TYPE.CHAIN>;
118
+ params: Record<string, unknown>;
119
+ }
120
+ /**
121
+ * Flat execution params stored on `ContentRule.executionParams`. The backend
122
+ * dispatcher (`dispatch_target`) selects behaviour by `executionType`:
123
+ *
124
+ * - `action` → `{ actionName, params }`
125
+ * - `set_field` → `{ field, value }`
126
+ * - `notify` → `{ data?, notificationType?, recipient? }`
127
+ * - `transition`→ `{ transitionName, params }`
128
+ * - `http_call` → `{ url, method?, params?, headers?, timeout? }`
129
+ * - `chain` → `{ steps: ChainStep[], stepParams?: Record<string, Record<string, unknown>> }`
130
+ *
131
+ * Action parameters are **nested** under `params` — `{ actionName, newGroup }`
132
+ * (flat) is silently dropped. See {@link ActionExecutionParams}.
133
+ */
134
+ export interface ExecutionParams {
135
+ actionName?: string;
136
+ params?: Record<string, unknown>;
137
+ field?: string;
138
+ value?: unknown;
139
+ data?: Record<string, unknown>;
140
+ notificationType?: string;
141
+ recipient?: string;
142
+ transitionName?: string;
143
+ url?: string;
144
+ method?: string;
145
+ headers?: Record<string, string>;
146
+ timeout?: number;
147
+ steps?: ChainStep[];
148
+ stepParams?: Record<string, Record<string, unknown>>;
149
+ [key: string]: unknown;
150
+ }
151
+ /** POST /api/v1/rules body (flat — matches `create_trigger()`). */
152
+ export interface RuleCreatePayload {
153
+ name: string;
154
+ description?: string;
155
+ /** `null`/omitted = global rule. Backend reads `contentType`, not `typeName`. */
156
+ contentType?: string | null;
157
+ trigger: TriggerDefinition;
158
+ /** Default `'expression'`. */
159
+ conditionType?: ConditionType;
160
+ /** Inline Python expression (conditionType=expression). */
161
+ conditionExpr?: string | null;
162
+ /** Full Python code block (conditionType=code). */
163
+ conditionCode?: string | null;
164
+ /** Default `'action'`. */
165
+ executionType?: ExecutionType;
166
+ executionParams?: ExecutionParams | null;
167
+ cronSchedule?: string | null;
168
+ cronTimeZone?: string | null;
169
+ /** Default `0`. */
170
+ priority?: number;
171
+ /** Default `true`. */
172
+ isActive?: boolean;
173
+ /** 1-3600, default 30. */
174
+ timeoutSeconds?: number;
175
+ }
176
+ /** PUT /api/v1/rules/{uuid} body (all optional, same flat keys). */
177
+ export interface RuleUpdatePayload {
178
+ name?: string;
179
+ description?: string;
180
+ contentType?: string | null;
181
+ trigger?: TriggerDefinition;
182
+ conditionType?: ConditionType;
183
+ conditionExpr?: string | null;
184
+ conditionCode?: string | null;
185
+ executionType?: ExecutionType;
186
+ executionParams?: ExecutionParams | null;
187
+ priority?: number;
188
+ isActive?: boolean;
189
+ timeoutSeconds?: number;
190
+ }
191
+ /** GET /api/v1/rules, GET /api/v1/rules/{uuid} (`ContentRuleResponse`). */
192
+ export interface ContentRule {
193
+ id: number;
194
+ uuid: string;
195
+ name: string;
196
+ description?: string | null;
197
+ /** Echoes `contentType` on the response. */
198
+ typeName?: string | null;
199
+ /** Default `'python'`. */
200
+ codeType: string;
201
+ /** AES-256-GCM encrypted. */
202
+ conditionCode?: string | null;
203
+ conditionType?: ConditionType;
204
+ conditionExpr?: string | null;
205
+ /** Inline trigger JSONB (`{ sourceType, sourceConfig, conditions, settings }`). */
206
+ trigger: Record<string, unknown>;
207
+ executionType: ExecutionType;
208
+ executionParams?: Record<string, unknown> | null;
209
+ priority: number;
210
+ isActive: boolean;
211
+ timeoutSeconds: number;
212
+ /** Cron: top-level normalized schedule. Dashboard emits via
213
+ * `trigger.sourceConfig.schedule`; the backend reads both. */
214
+ cronSchedule?: string | null;
215
+ cronTimezone?: string | null;
216
+ /** ISO 8601. */
217
+ nextTriggerAt?: string | null;
218
+ /** ISO 8601 — FEAT-004 sidebar "last triggered". */
219
+ lastFiredAt?: string | null;
220
+ packId?: string | null;
221
+ createdBy?: number | null;
222
+ updatedBy?: number | null;
223
+ createdAt?: string | null;
224
+ updatedAt?: string | null;
225
+ }
226
+ export interface ContentRuleListResponse {
227
+ items: ContentRule[];
228
+ /** `=== items.length` — the list endpoint does NOT paginate. */
229
+ total: number;
230
+ }
231
+ /**
232
+ * Signal-fire context (`POST /api/v1/rules/signals/fire`). Carries the target
233
+ * account + any extra payload the engine/condition evaluator reads. A `null`
234
+ * `contentUuid` means scan-mode (the LLM discovers candidates itself).
235
+ */
236
+ export interface SignalFireContext {
237
+ /** Content type of the target (e.g. `'Mt5Account'`). */
238
+ typeName?: string;
239
+ /** Target account UUID, or `null` for scan-mode `llm_agent` rules. */
240
+ contentUuid?: string | null;
241
+ /** Extra payload (e.g. `{ serverName, login }`). */
242
+ data?: Record<string, unknown>;
243
+ }
244
+ /** `POST /api/v1/rules/signals/fire` response. */
245
+ export interface SignalFireResponse {
246
+ /** Number of rules that matched and were dispatched. */
247
+ triggeredCount: number;
248
+ /** UUIDs of the matched rules. */
249
+ matchedRules: string[];
250
+ }
251
+ /** Query params for GET /api/v1/rules (route-level Query() params; no limit/offset). */
252
+ export interface RuleListQuery {
253
+ sourceType?: string;
254
+ executionType?: ExecutionType;
255
+ /** contentType filter. */
256
+ typeName?: string;
257
+ isActive?: boolean;
258
+ /** UUID or slug (FEAT-008 v1.1). */
259
+ packId?: string;
260
+ format?: SerializationFormat;
261
+ }
262
+ //# sourceMappingURL=rules.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rules.type.d.ts","sourceRoot":"","sources":["../../../src/services/rules/rules.type.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,MAAM,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAC3C;;;;;;;;;;;;GAYG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAClE,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAA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C;IAC9B,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
@@ -0,0 +1,140 @@
1
+ import { TriggerDefinition, TriggerType } from './rules.type';
2
+ /** Value-level constants for trigger modes (the *builder* view used by the
3
+ * dashboard UI). Each entry's string is the *backend* `source_type` value
4
+ * read off `ContentRule.trigger` by `engine.py:_match_trigger` and the SQL
5
+ * filter at `trigger_api.py:fire_signal`:
6
+ *
7
+ * - `SIGNAL` → `"signal"` (API pod, `POST /api/v1/rules/signals/fire`).
8
+ * - `CRON` → `"cron"` (cron evaluator pod).
9
+ * - `EVENT` → `"event_dto"` (NOT `"event"` — the engine matcher reads
10
+ * `source_type` as `"event_dto"`).
11
+ *
12
+ * Use {@link TRIGGER_TYPE} for the wire-level `trigger_type` value (which
13
+ * uses `"event"`, not `"event_dto"`). */
14
+ export declare const TRIGGER_MODE: {
15
+ readonly SIGNAL: "signal";
16
+ readonly CRON: "cron";
17
+ readonly EVENT: "event_dto";
18
+ };
19
+ /** The trigger modes the dashboard builders author — derived from {@link TRIGGER_MODE}. */
20
+ export type TriggerMode = (typeof TRIGGER_MODE)[keyof typeof TRIGGER_MODE];
21
+ /** Value-level constants for the *wire-level* `trigger_type` field (the
22
+ * schema-validated field on `TriggerDefinition`,
23
+ * `eaera_cms/core/rules/definitions.py:33-39`).
24
+ *
25
+ * For event rules the wire value is `"event"`, NOT `"event_dto"` — the
26
+ * latter is the `source_type` value. The two diverge on purpose; the
27
+ * pack loader emits `trigger_type: "event"` + `source_type: "event_dto"`
28
+ * (`packs/registry.py:463-470`).
29
+ *
30
+ * - `SIGNAL` → `"signal"`
31
+ * - `CRON` → `"cron"`
32
+ * - `EVENT` → `"event"`
33
+ * - `STREAM` → `"stream"` (backend-only — no SDK builder). */
34
+ export declare const TRIGGER_TYPE: {
35
+ readonly SIGNAL: "signal";
36
+ readonly CRON: "cron";
37
+ readonly EVENT: "event";
38
+ readonly STREAM: "stream";
39
+ };
40
+ /** The wire-level `trigger_type` union — derived from {@link TRIGGER_TYPE}. */
41
+ export type TriggerTypeValue = (typeof TRIGGER_TYPE)[keyof typeof TRIGGER_TYPE];
42
+ /** The Kafka `content.events` event types the trigger pod subscribes to.
43
+ *
44
+ * Authoritative list — `eaera-mt5/eaera_mt5/pipeline/event_publisher.py` (the
45
+ * four MT5 pipeline publishers) and `eaera-mt5/worker/sync/account_sync.py`
46
+ * (`_emit_account_upsert_events`). The CMS schema validator does not whitelist
47
+ * the value (any string is accepted), but the engine matcher and the
48
+ * `Mt5AccountSyncService` only act on these five. */
49
+ export declare const EVENT_TYPE: {
50
+ readonly DEAL_CLOSE: "deal_close";
51
+ readonly STATEMENT: "statement";
52
+ readonly POSITION: "position";
53
+ readonly ORDER: "order";
54
+ /** FEAT-009 identity-provisioning bridge — emitted by the MT5 `account_sync`
55
+ * worker whenever an account is upserted. The trigger service ALSO
56
+ * auto-upserts an `Mt5Account` content row on `(server_name, login)` via
57
+ * `Mt5AccountSyncService` before evaluating rules. Common use: provision
58
+ * a CMS user when the account email is present (the live `user_sync` rule
59
+ * uses `event: 'mt5_account_upsert'` + `trigger.conditions: [email contains '@']`). */
60
+ readonly MT5_ACCOUNT_UPSERT: "mt5_account_upsert";
61
+ };
62
+ /** Event type union — derived from {@link EVENT_TYPE}. */
63
+ export type EventType = (typeof EVENT_TYPE)[keyof typeof EVENT_TYPE];
64
+ /** A labelled option for the event-payload picker. */
65
+ export interface EventTypeOption {
66
+ label: string;
67
+ value: EventType;
68
+ /** Short human hint shown in tooltips / Data Set reference. */
69
+ hint?: string;
70
+ }
71
+ /** Human labels for the {@link EVENT_TYPE} options. */
72
+ export declare const EVENT_TYPE_OPTIONS: readonly EventTypeOption[];
73
+ /** Helper: true iff the given string is a known event type. */
74
+ export declare const isKnownEventType: (raw: unknown) => raw is EventType;
75
+ /** Coerce an arbitrary event-type string (e.g. from a stored `sourceConfig.event`)
76
+ * to a known {@link EventType}. Falls back to {@link EVENT_TYPE.DEAL_CLOSE} for
77
+ * unknown / missing values so the rule editor always has a valid pick. */
78
+ export declare const coerceEventType: (raw: unknown) => EventType;
79
+ /** A labelled cron preset for the schedule picker. */
80
+ export interface CronPreset {
81
+ label: string;
82
+ value: string;
83
+ }
84
+ /** Human cron presets (standard 5-field expressions). */
85
+ export declare const CRON_PRESETS: readonly CronPreset[];
86
+ /** Default cron schedule when none is provided (skills' historical default). */
87
+ export declare const DEFAULT_CRON_SCHEDULE = "*/5 * * * *";
88
+ /** Default Kafka topic for event triggers. Sourced from `CONTENT_TYPE.MT5_ACCOUNT`. */
89
+ export declare const DEFAULT_EVENT_CONTENT_TYPE: "Mt5Account";
90
+ /** Build a signal trigger over the metric stream.
91
+ *
92
+ * Emits the canonical pair:
93
+ * - `triggerType: 'signal'` (schema-validated)
94
+ * - `sourceType: 'signal'` (engine matcher)
95
+ *
96
+ * Both are the same value for signal rules. */
97
+ export declare const buildSignalTrigger: (signalName: string) => TriggerDefinition;
98
+ /**
99
+ * Build a cron trigger. `schedule` is a standard 5-field cron expression;
100
+ * `extra` is merged into `sourceConfig` (e.g. skills pass `promptName` /
101
+ * `queryTools`).
102
+ *
103
+ * Emits the canonical pair:
104
+ * - `triggerType: 'cron'` (schema-validated)
105
+ * - `sourceType: 'cron'` (engine matcher)
106
+ */
107
+ export declare const buildCronTrigger: (schedule: string, extra?: Record<string, unknown>, timezone?: string) => TriggerDefinition;
108
+ /**
109
+ * Build an event trigger on the Kafka `content.events` topic.
110
+ *
111
+ * Emits the canonical pair — NOT the same value on both fields:
112
+ * - `triggerType: 'event'` (schema-validated, `definitions.py:36`)
113
+ * - `sourceType: 'event_dto'` (engine matcher, `engine.py:369`)
114
+ *
115
+ * Earlier SDK builds emitted both as `"event_dto"`, which passed engine
116
+ * matching but drifted from the canonical pack-authored contract
117
+ * (`packs/registry.py:463-470`). This builder now emits the correct pair.
118
+ *
119
+ * The `event` (singular) and `eventTypes`/`contentTypes` (plural) shapes
120
+ * are both stored so the engine reads either form.
121
+ */
122
+ export declare const buildEventTrigger: (event: EventType, contentType?: string, extra?: Record<string, unknown>) => TriggerDefinition;
123
+ /** Derive the builder trigger mode from a stored `ContentRule.trigger`.
124
+ *
125
+ * Accepts BOTH the camelCase fields the SDK writes (`sourceType`,
126
+ * `triggerType`) and the snake_case JSONB keys the backend reads
127
+ * (`source_type`, `trigger_type`) so rules authored before the trigger
128
+ * wire-shape fix still load in the Fixed Rules editor without showing up
129
+ * as the wrong mode.
130
+ *
131
+ * Both `source_type === "event_dto"` (engine matcher) and `trigger_type
132
+ * === "event"` (schema-validated) map to the builder's `EVENT` mode. */
133
+ export declare const triggerModeOf: (trigger: TriggerDefinition | Record<string, unknown> | null | undefined) => TriggerMode;
134
+ /** Read the cron `schedule` out of a stored `ContentRule.trigger`. */
135
+ export declare const scheduleOf: (trigger: TriggerDefinition | Record<string, unknown> | null | undefined) => string;
136
+ /** Read the signal `signalName` out of a stored `ContentRule.trigger`. */
137
+ export declare const signalNameOf: (trigger: TriggerDefinition | Record<string, unknown> | null | undefined) => string;
138
+ export type { TriggerType };
139
+ export { TRIGGER_TYPE as TRIGGER_TYPE_VALUE };
140
+ //# sourceMappingURL=triggers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/services/rules/triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEnE;;;;;;;;;;;0CAW0C;AAC1C,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E;;;;;;;;;;;;+DAY+D;AAC/D,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAEhF;;;;;;sDAMsD;AACtD,eAAO,MAAM,UAAU;;;;;IAKrB;;;;;4FAKwF;;CAEhF,CAAC;AAEX,0DAA0D;AAC1D,MAAM,MAAM,SAAS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EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACtE,WAoBF,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,UAAU,GACrB,SAAS,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACtE,MAKF,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,YAAY,GACvB,SAAS,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACtE,MAKF,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { $Fetch } from 'ofetch';
2
+ import { IPublicMarketsData } from './settings.type';
3
+ export interface ISettingsServiceOptions {
4
+ /** The CMS `$Fetch` instance (one of `sdk.apis`). */
5
+ api: $Fetch;
6
+ /** Lazy flag — when true, the service returns fake data. */
7
+ mock: () => boolean;
8
+ }
9
+ export interface ISettingsService {
10
+ getMonitoredGroups(): Promise<string[]>;
11
+ setMonitoredGroups(groups: string[]): Promise<string[]>;
12
+ /**
13
+ * Anonymous UI defaults from `setting.public.markets` (api-inventory §5.7.5):
14
+ * the default MT5 server id + the curated common-symbol list (order is
15
+ * significant). Readable without a JWT — the backend returns the schema
16
+ * defaults when no record has been written yet.
17
+ */
18
+ getPublicMarkets(): Promise<IPublicMarketsData>;
19
+ }
20
+ /**
21
+ * Settings service. The CMS is the source of truth for monitored groups;
22
+ * the service reads/writes the generic setting
23
+ * `setting.dashboard.monitored_groups`.
24
+ *
25
+ * Endpoint contract (`eaera_cms/settings/routes.py`):
26
+ * GET /api/v1/settings/{typeName} → { typeName, displayName, data, exists }
27
+ * PUT /api/v1/settings/{typeName} → { ..., data } (body = key/value pairs)
28
+ *
29
+ * NOTE: the CT `setting.dashboard.monitored_groups` (schema `{ groups: string[] }`)
30
+ * must be registered in the CMS settings catalog for these calls to succeed.
31
+ *
32
+ * While `mock()` returns true, all methods resolve against the local fake
33
+ * dataset and never touch `api`.
34
+ */
35
+ export declare function createSettingsService(opts: ISettingsServiceOptions): ISettingsService;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,OAAO,KAAK,EAGV,kBAAkB,EAEnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,uBAAuB;IACtC,qDAAqD;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACxD;;;;;OAKG;IACH,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,uBAAuB,GAAG,gBAAgB,CA+BrF"}
@@ -0,0 +1,14 @@
1
+ /** Fake monitored-groups set used while the settings endpoint is under development. */
2
+ export declare const MOCK_MONITORED_GROUPS: string[];
3
+ export declare function mockGetMonitoredGroups(): string[];
4
+ export declare function mockSetMonitoredGroups(groups: string[]): string[];
5
+ /** Fake public-markets payload (mirrors the schema defaults in api-inventory §5.7.5). */
6
+ export declare const MOCK_PUBLIC_MARKETS: {
7
+ readonly defaultServer: "live";
8
+ readonly commonSymbols: readonly ["EURUSD", "GBPUSD", "USDJPY", "XAUUSD", "XAGUSD", "BTCUSD", "ETHUSD"];
9
+ };
10
+ export declare function mockGetPublicMarkets(): {
11
+ defaultServer: string;
12
+ commonSymbols: string[];
13
+ };
14
+ //# sourceMappingURL=mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/services/settings/mock.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAIzC,CAAC;AAKF,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAEjD;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAGjE;AAED,yFAAyF;AACzF,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,wBAAgB,oBAAoB,IAAI;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAKA"}