@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.
- package/LICENSE +19 -0
- package/README.md +479 -0
- package/dist/chunks/_shared-DdBWuPm_.js +27 -0
- package/dist/chunks/_shared-DdBWuPm_.js.map +1 -0
- package/dist/chunks/auth.constant-CMI1lqQc.js +37 -0
- package/dist/chunks/auth.constant-CMI1lqQc.js.map +1 -0
- package/dist/chunks/authz.constant-BAarvacV.js +9 -0
- package/dist/chunks/authz.constant-BAarvacV.js.map +1 -0
- package/dist/chunks/http.constant-BzH5tJTG.js +33 -0
- package/dist/chunks/http.constant-BzH5tJTG.js.map +1 -0
- package/dist/chunks/mt5Retcode-DlZLQOLA.js +178 -0
- package/dist/chunks/mt5Retcode-DlZLQOLA.js.map +1 -0
- package/dist/chunks/storage.constant--64BDSPW.js +44 -0
- package/dist/chunks/storage.constant--64BDSPW.js.map +1 -0
- package/dist/common/constants/auth.constant.d.ts +54 -0
- package/dist/common/constants/auth.constant.d.ts.map +1 -0
- package/dist/common/constants/authz.constant.d.ts +27 -0
- package/dist/common/constants/authz.constant.d.ts.map +1 -0
- package/dist/common/constants/bars.constant.d.ts +15 -0
- package/dist/common/constants/bars.constant.d.ts.map +1 -0
- package/dist/common/constants/content-types.constant.d.ts +31 -0
- package/dist/common/constants/content-types.constant.d.ts.map +1 -0
- package/dist/common/constants/content.constant.d.ts +114 -0
- package/dist/common/constants/content.constant.d.ts.map +1 -0
- package/dist/common/constants/executions.constant.d.ts +56 -0
- package/dist/common/constants/executions.constant.d.ts.map +1 -0
- package/dist/common/constants/gov.constant.d.ts +118 -0
- package/dist/common/constants/gov.constant.d.ts.map +1 -0
- package/dist/common/constants/history.constant.d.ts +108 -0
- package/dist/common/constants/history.constant.d.ts.map +1 -0
- package/dist/common/constants/http.constant.d.ts +46 -0
- package/dist/common/constants/http.constant.d.ts.map +1 -0
- package/dist/common/constants/index.d.ts +16 -0
- package/dist/common/constants/index.d.ts.map +1 -0
- package/dist/common/constants/kalshi.constant.d.ts +35 -0
- package/dist/common/constants/kalshi.constant.d.ts.map +1 -0
- package/dist/common/constants/llm.constant.d.ts +37 -0
- package/dist/common/constants/llm.constant.d.ts.map +1 -0
- package/dist/common/constants/mt5-action.constant.d.ts +131 -0
- package/dist/common/constants/mt5-action.constant.d.ts.map +1 -0
- package/dist/common/constants/mt5.constant.d.ts +254 -0
- package/dist/common/constants/mt5.constant.d.ts.map +1 -0
- package/dist/common/constants/notifications.constant.d.ts +45 -0
- package/dist/common/constants/notifications.constant.d.ts.map +1 -0
- package/dist/common/constants/people.constant.d.ts +269 -0
- package/dist/common/constants/people.constant.d.ts.map +1 -0
- package/dist/common/constants/rules.constant.d.ts +14 -0
- package/dist/common/constants/rules.constant.d.ts.map +1 -0
- package/dist/common/constants/settings.constant.d.ts +17 -0
- package/dist/common/constants/settings.constant.d.ts.map +1 -0
- package/dist/common/constants/sort.constant.d.ts +14 -0
- package/dist/common/constants/sort.constant.d.ts.map +1 -0
- package/dist/common/constants/storage.constant.d.ts +74 -0
- package/dist/common/constants/storage.constant.d.ts.map +1 -0
- package/dist/common/helpers/format.d.ts +7 -0
- package/dist/common/helpers/format.d.ts.map +1 -0
- package/dist/common/helpers/format.js +20 -0
- package/dist/common/helpers/format.js.map +1 -0
- package/dist/common/helpers/mt5Retcode.d.ts +18 -0
- package/dist/common/helpers/mt5Retcode.d.ts.map +1 -0
- package/dist/common/helpers/mt5Retcode.js +2 -0
- package/dist/common/helpers/mt5Retcode.js.map +1 -0
- package/dist/common/utils/case.d.ts +12 -0
- package/dist/common/utils/case.d.ts.map +1 -0
- package/dist/common/utils/clone.d.ts +9 -0
- package/dist/common/utils/clone.d.ts.map +1 -0
- package/dist/composables/cbsStateKey.d.ts +27 -0
- package/dist/composables/cbsStateKey.d.ts.map +1 -0
- package/dist/core/createApi.d.ts +69 -0
- package/dist/core/createApi.d.ts.map +1 -0
- package/dist/core/createCmsSDK.d.ts +19 -0
- package/dist/core/createCmsSDK.d.ts.map +1 -0
- package/dist/core/credentials/TokenManager.d.ts +38 -0
- package/dist/core/credentials/TokenManager.d.ts.map +1 -0
- package/dist/core/credentials/credential.type.d.ts +16 -0
- package/dist/core/credentials/credential.type.d.ts.map +1 -0
- package/dist/core/credentials/resolveStorage.d.ts +6 -0
- package/dist/core/credentials/resolveStorage.d.ts.map +1 -0
- package/dist/core/credentials/storages/cookieStorage.d.ts +18 -0
- package/dist/core/credentials/storages/cookieStorage.d.ts.map +1 -0
- package/dist/core/credentials/storages/localStorageAdapter.d.ts +8 -0
- package/dist/core/credentials/storages/localStorageAdapter.d.ts.map +1 -0
- package/dist/core/credentials/storages/memoryStorage.d.ts +7 -0
- package/dist/core/credentials/storages/memoryStorage.d.ts.map +1 -0
- package/dist/core/errors.d.ts +26 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/sdk.type.d.ts +123 -0
- package/dist/core/sdk.type.d.ts.map +1 -0
- package/dist/core/ws/createEaeraWebSocket.d.ts +21 -0
- package/dist/core/ws/createEaeraWebSocket.d.ts.map +1 -0
- package/dist/core/ws/index.d.ts +4 -0
- package/dist/core/ws/index.d.ts.map +1 -0
- package/dist/core/ws/ws.constants.d.ts +246 -0
- package/dist/core/ws/ws.constants.d.ts.map +1 -0
- package/dist/core/ws/ws.events.d.ts +264 -0
- package/dist/core/ws/ws.events.d.ts.map +1 -0
- package/dist/core/ws/ws.type.d.ts +225 -0
- package/dist/core/ws/ws.type.d.ts.map +1 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8608 -0
- package/dist/index.js.map +1 -0
- package/dist/nuxt.d.ts +55 -0
- package/dist/nuxt.d.ts.map +1 -0
- package/dist/nuxt.js +48 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/runtime/plugin.d.ts +6 -0
- package/dist/runtime/plugin.js +197 -0
- package/dist/runtime/plugin.js.map +1 -0
- package/dist/server/auth/cbs-callback.post.js +43 -0
- package/dist/server/auth/cbs-callback.post.js.map +1 -0
- package/dist/server/auth/cbs-start.post.js +35 -0
- package/dist/server/auth/cbs-start.post.js.map +1 -0
- package/dist/server/auth/idp-callback.get.js +53 -0
- package/dist/server/auth/idp-callback.get.js.map +1 -0
- package/dist/server/auth/idp-link.post.js +39 -0
- package/dist/server/auth/idp-link.post.js.map +1 -0
- package/dist/server/auth/idp-login.get.js +43 -0
- package/dist/server/auth/idp-login.get.js.map +1 -0
- package/dist/server/auth/idp-unlink.delete.js +39 -0
- package/dist/server/auth/idp-unlink.delete.js.map +1 -0
- package/dist/server/auth/login.post.js +46 -0
- package/dist/server/auth/login.post.js.map +1 -0
- package/dist/server/auth/logout.post.js +32 -0
- package/dist/server/auth/logout.post.js.map +1 -0
- package/dist/server/auth/refresh.post.js +47 -0
- package/dist/server/auth/refresh.post.js.map +1 -0
- package/dist/server/authz/portal-access.get.js +43 -0
- package/dist/server/authz/portal-access.get.js.map +1 -0
- package/dist/server/clear-token.delete.js +12 -0
- package/dist/server/clear-token.delete.js.map +1 -0
- package/dist/server/persist.post.js +31 -0
- package/dist/server/persist.post.js.map +1 -0
- package/dist/server/set-token.post.js +27 -0
- package/dist/server/set-token.post.js.map +1 -0
- package/dist/services/auth/auth.type.d.ts +73 -0
- package/dist/services/auth/auth.type.d.ts.map +1 -0
- package/dist/services/auth/index.d.ts +127 -0
- package/dist/services/auth/index.d.ts.map +1 -0
- package/dist/services/auth/mock.d.ts +13 -0
- package/dist/services/auth/mock.d.ts.map +1 -0
- package/dist/services/authz/authz.type.d.ts +21 -0
- package/dist/services/authz/authz.type.d.ts.map +1 -0
- package/dist/services/authz/index.d.ts +43 -0
- package/dist/services/authz/index.d.ts.map +1 -0
- package/dist/services/bars/bars.type.d.ts +78 -0
- package/dist/services/bars/bars.type.d.ts.map +1 -0
- package/dist/services/bars/index.d.ts +24 -0
- package/dist/services/bars/index.d.ts.map +1 -0
- package/dist/services/bars/mock.d.ts +23 -0
- package/dist/services/bars/mock.d.ts.map +1 -0
- package/dist/services/content/content.type.d.ts +832 -0
- package/dist/services/content/content.type.d.ts.map +1 -0
- package/dist/services/content/filter.d.ts +46 -0
- package/dist/services/content/filter.d.ts.map +1 -0
- package/dist/services/content/index.d.ts +35 -0
- package/dist/services/content/index.d.ts.map +1 -0
- package/dist/services/content/mock.d.ts +16 -0
- package/dist/services/content/mock.d.ts.map +1 -0
- package/dist/services/content-types/content-types.type.d.ts +70 -0
- package/dist/services/content-types/content-types.type.d.ts.map +1 -0
- package/dist/services/content-types/index.d.ts +25 -0
- package/dist/services/content-types/index.d.ts.map +1 -0
- package/dist/services/content-types/mock.d.ts +15 -0
- package/dist/services/content-types/mock.d.ts.map +1 -0
- package/dist/services/executions/executions.type.d.ts +67 -0
- package/dist/services/executions/executions.type.d.ts.map +1 -0
- package/dist/services/executions/index.d.ts +30 -0
- package/dist/services/executions/index.d.ts.map +1 -0
- package/dist/services/executions/mock.d.ts +29 -0
- package/dist/services/executions/mock.d.ts.map +1 -0
- package/dist/services/gov/gov.type.d.ts +740 -0
- package/dist/services/gov/gov.type.d.ts.map +1 -0
- package/dist/services/gov/index.d.ts +84 -0
- package/dist/services/gov/index.d.ts.map +1 -0
- package/dist/services/history/history.type.d.ts +167 -0
- package/dist/services/history/history.type.d.ts.map +1 -0
- package/dist/services/history/index.d.ts +38 -0
- package/dist/services/history/index.d.ts.map +1 -0
- package/dist/services/history/mock.d.ts +21 -0
- package/dist/services/history/mock.d.ts.map +1 -0
- package/dist/services/kalshi/index.d.ts +19 -0
- package/dist/services/kalshi/index.d.ts.map +1 -0
- package/dist/services/kalshi/kalshi.type.d.ts +99 -0
- package/dist/services/kalshi/kalshi.type.d.ts.map +1 -0
- package/dist/services/kalshi/mock.d.ts +5 -0
- package/dist/services/kalshi/mock.d.ts.map +1 -0
- package/dist/services/llm/index.d.ts +38 -0
- package/dist/services/llm/index.d.ts.map +1 -0
- package/dist/services/llm/llm.type.d.ts +106 -0
- package/dist/services/llm/llm.type.d.ts.map +1 -0
- package/dist/services/notifications/index.d.ts +38 -0
- package/dist/services/notifications/index.d.ts.map +1 -0
- package/dist/services/notifications/mock.d.ts +39 -0
- package/dist/services/notifications/mock.d.ts.map +1 -0
- package/dist/services/notifications/notifications.type.d.ts +75 -0
- package/dist/services/notifications/notifications.type.d.ts.map +1 -0
- package/dist/services/people/_invoke.d.ts +26 -0
- package/dist/services/people/_invoke.d.ts.map +1 -0
- package/dist/services/people/copilot/index.d.ts +132 -0
- package/dist/services/people/copilot/index.d.ts.map +1 -0
- package/dist/services/people/identity/actions.d.ts +116 -0
- package/dist/services/people/identity/actions.d.ts.map +1 -0
- package/dist/services/people/identity/ct.types.d.ts +133 -0
- package/dist/services/people/identity/ct.types.d.ts.map +1 -0
- package/dist/services/people/identity/index.d.ts +14 -0
- package/dist/services/people/identity/index.d.ts.map +1 -0
- package/dist/services/people/identity/projections.d.ts +63 -0
- package/dist/services/people/identity/projections.d.ts.map +1 -0
- package/dist/services/people/index.d.ts +31 -0
- package/dist/services/people/index.d.ts.map +1 -0
- package/dist/services/people/legal/actions.d.ts +161 -0
- package/dist/services/people/legal/actions.d.ts.map +1 -0
- package/dist/services/people/legal/ct.types.d.ts +186 -0
- package/dist/services/people/legal/ct.types.d.ts.map +1 -0
- package/dist/services/people/legal/index.d.ts +15 -0
- package/dist/services/people/legal/index.d.ts.map +1 -0
- package/dist/services/people/packops/index.d.ts +79 -0
- package/dist/services/people/packops/index.d.ts.map +1 -0
- package/dist/services/people/packops/packops.type.d.ts +208 -0
- package/dist/services/people/packops/packops.type.d.ts.map +1 -0
- package/dist/services/people/perms/actions.d.ts +214 -0
- package/dist/services/people/perms/actions.d.ts.map +1 -0
- package/dist/services/people/perms/ct.types.d.ts +140 -0
- package/dist/services/people/perms/ct.types.d.ts.map +1 -0
- package/dist/services/people/perms/index.d.ts +14 -0
- package/dist/services/people/perms/index.d.ts.map +1 -0
- package/dist/services/people/perms/projections.d.ts +47 -0
- package/dist/services/people/perms/projections.d.ts.map +1 -0
- package/dist/services/people/process/actions.d.ts +154 -0
- package/dist/services/people/process/actions.d.ts.map +1 -0
- package/dist/services/people/process/ct.types.d.ts +304 -0
- package/dist/services/people/process/ct.types.d.ts.map +1 -0
- package/dist/services/people/process/index.d.ts +12 -0
- package/dist/services/people/process/index.d.ts.map +1 -0
- package/dist/services/people/shared.types.d.ts +36 -0
- package/dist/services/people/shared.types.d.ts.map +1 -0
- package/dist/services/rules/conditions.d.ts +264 -0
- package/dist/services/rules/conditions.d.ts.map +1 -0
- package/dist/services/rules/index.d.ts +49 -0
- package/dist/services/rules/index.d.ts.map +1 -0
- package/dist/services/rules/llm-rule.constant.d.ts +84 -0
- package/dist/services/rules/llm-rule.constant.d.ts.map +1 -0
- package/dist/services/rules/mock.d.ts +20 -0
- package/dist/services/rules/mock.d.ts.map +1 -0
- package/dist/services/rules/rules.type.d.ts +262 -0
- package/dist/services/rules/rules.type.d.ts.map +1 -0
- package/dist/services/rules/triggers.d.ts +140 -0
- package/dist/services/rules/triggers.d.ts.map +1 -0
- package/dist/services/settings/index.d.ts +36 -0
- package/dist/services/settings/index.d.ts.map +1 -0
- package/dist/services/settings/mock.d.ts +14 -0
- package/dist/services/settings/mock.d.ts.map +1 -0
- package/dist/services/settings/settings.type.d.ts +39 -0
- package/dist/services/settings/settings.type.d.ts.map +1 -0
- package/dist/stores/auth.d.ts +192 -0
- package/dist/stores/auth.d.ts.map +1 -0
- package/dist/stores/authz.d.ts +116 -0
- package/dist/stores/authz.d.ts.map +1 -0
- package/dist/stores/bars.d.ts +288 -0
- package/dist/stores/bars.d.ts.map +1 -0
- package/dist/stores/content.d.ts +4101 -0
- package/dist/stores/content.d.ts.map +1 -0
- package/dist/stores/executions.d.ts +249 -0
- package/dist/stores/executions.d.ts.map +1 -0
- package/dist/stores/gov.d.ts +238 -0
- package/dist/stores/gov.d.ts.map +1 -0
- package/dist/stores/history.d.ts +833 -0
- package/dist/stores/history.d.ts.map +1 -0
- package/dist/stores/index.d.ts +16 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/kalshi.d.ts +728 -0
- package/dist/stores/kalshi.d.ts.map +1 -0
- package/dist/stores/llm-providers.d.ts +97 -0
- package/dist/stores/llm-providers.d.ts.map +1 -0
- package/dist/stores/llm.d.ts +102 -0
- package/dist/stores/llm.d.ts.map +1 -0
- package/dist/stores/people.d.ts +596 -0
- package/dist/stores/people.d.ts.map +1 -0
- package/dist/stores/persist.d.ts +58 -0
- package/dist/stores/persist.d.ts.map +1 -0
- package/dist/stores/rules.d.ts +485 -0
- package/dist/stores/rules.d.ts.map +1 -0
- package/dist/stores/settings.d.ts +36 -0
- package/dist/stores/settings.d.ts.map +1 -0
- package/dist/stores/ws.d.ts +66 -0
- package/dist/stores/ws.d.ts.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { ContentItem } from '../../content/content.type';
|
|
2
|
+
/** Authored state entry inside a request-type definition (translator D1). */
|
|
3
|
+
export interface PeopleRequestTypeStateDef {
|
|
4
|
+
key: string;
|
|
5
|
+
kind: 'initial' | 'terminal' | 'regular';
|
|
6
|
+
businessMeaning?: string;
|
|
7
|
+
availableActionRefs?: string[];
|
|
8
|
+
/** Reactions — definition fields (FR-010s): on_entry[] / await[] / sla. */
|
|
9
|
+
onEntry?: unknown[];
|
|
10
|
+
await?: unknown[];
|
|
11
|
+
sla?: unknown;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** Authored action entry (S1–S14 chain vocabulary). */
|
|
15
|
+
export interface PeopleRequestTypeActionDef {
|
|
16
|
+
key: string;
|
|
17
|
+
intent?: string;
|
|
18
|
+
invocationScope?: 'User-callable' | 'System-only';
|
|
19
|
+
permissionRef?: string;
|
|
20
|
+
actorRuleRef?: string | null;
|
|
21
|
+
validatorRefs?: string[];
|
|
22
|
+
requiredInputEvidence?: string[];
|
|
23
|
+
executor?: Record<string, unknown> | null;
|
|
24
|
+
stateChanges?: Record<string, unknown>;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
/** The authored definition tree — one frozen world per version (RT-21). */
|
|
28
|
+
export interface PeopleRequestTypeDefinition {
|
|
29
|
+
contentFields?: unknown[];
|
|
30
|
+
processOutcomes?: Array<{
|
|
31
|
+
outcomeKey: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
businessMeaning?: string;
|
|
34
|
+
}>;
|
|
35
|
+
states: PeopleRequestTypeStateDef[];
|
|
36
|
+
actions: PeopleRequestTypeActionDef[];
|
|
37
|
+
validators?: unknown[];
|
|
38
|
+
outcomeSpawns?: unknown[];
|
|
39
|
+
supportingConfig?: Record<string, unknown>;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
/** Catalogue finding from validate/publish (CS/AC/VA/SP/RC series). */
|
|
43
|
+
export interface PeopleDefinitionFinding {
|
|
44
|
+
id?: string;
|
|
45
|
+
severity?: string;
|
|
46
|
+
message?: string;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface PeopleDefinitionValidationResult {
|
|
50
|
+
passed?: boolean;
|
|
51
|
+
checkedAt?: string;
|
|
52
|
+
findings?: PeopleDefinitionFinding[];
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/** `request_type` row payload (registry §3.19). */
|
|
56
|
+
export interface PeopleRequestTypeData {
|
|
57
|
+
/** snake_case `^[a-z][a-z0-9_]*$` — becomes the generated CT name. */
|
|
58
|
+
typeKey: string;
|
|
59
|
+
/** Owning process_type; null = standalone lane (spine §7.5). */
|
|
60
|
+
ownerTypeKey?: string | null;
|
|
61
|
+
sotType?: string;
|
|
62
|
+
/** Empty in the interim (drift D-5) — the publisher stamps it. */
|
|
63
|
+
sotRef?: {
|
|
64
|
+
repo?: string;
|
|
65
|
+
artifactPath?: string;
|
|
66
|
+
revision?: string;
|
|
67
|
+
} | Record<string, never>;
|
|
68
|
+
/** Canonical hash of the definition — stamped at publish. */
|
|
69
|
+
version?: string | null;
|
|
70
|
+
canonicalHash?: string | null;
|
|
71
|
+
definition: PeopleRequestTypeDefinition;
|
|
72
|
+
validationResult?: PeopleDefinitionValidationResult;
|
|
73
|
+
/** Last safe-test trace (scenario → S1–S14 steps, simulated capabilities). */
|
|
74
|
+
sandbox?: Record<string, unknown>;
|
|
75
|
+
/** Publish products for the FEAT-015 generated-pack install path. */
|
|
76
|
+
generated?: Record<string, unknown>;
|
|
77
|
+
verify?: {
|
|
78
|
+
badge?: 'GREEN' | 'DRIFT';
|
|
79
|
+
checkedAt?: string;
|
|
80
|
+
} | Record<string, unknown>;
|
|
81
|
+
/** Derived count of in-flight requests pinned to this version (RT-21). */
|
|
82
|
+
activePins?: number;
|
|
83
|
+
state: 'draft' | 'validated' | 'published' | 'superseded' | 'decommissioned';
|
|
84
|
+
}
|
|
85
|
+
export type PeopleRequestType = ContentItem<PeopleRequestTypeData>;
|
|
86
|
+
/** `registered_capability` row payload — the 9-field contract (registry §3.20). */
|
|
87
|
+
export interface PeopleRegisteredCapabilityData {
|
|
88
|
+
capabilityKey: string;
|
|
89
|
+
/** `"module:function"` PROCESSOR of the owning pack/domain (importlib dispatch). */
|
|
90
|
+
providerRef: string;
|
|
91
|
+
/** Target object family, e.g. `m365_mailbox`. */
|
|
92
|
+
targetType: string;
|
|
93
|
+
/** Operation verb. */
|
|
94
|
+
operation: string;
|
|
95
|
+
inputContract: Record<string, unknown>;
|
|
96
|
+
outputContract: Record<string, unknown>;
|
|
97
|
+
/** Contexts allowed to invoke (`request:<type_key>`); empty = unrestricted (AC-09). */
|
|
98
|
+
allowedContexts?: string[];
|
|
99
|
+
/** false ⇒ Safe Test runs simulated + flagged. */
|
|
100
|
+
supportsTestMode?: boolean;
|
|
101
|
+
/** `required` ⇒ re-invocation after executor failure must be safe (US10 TC3). */
|
|
102
|
+
idempotencyRequirement?: 'none' | 'required';
|
|
103
|
+
state: 'draft' | 'published' | 'superseded';
|
|
104
|
+
}
|
|
105
|
+
export type PeopleRegisteredCapability = ContentItem<PeopleRegisteredCapabilityData>;
|
|
106
|
+
/** Cross-domain automation action — ONLY spawn | capability | notify (SP-14). */
|
|
107
|
+
export interface PeopleGlueRuleAction {
|
|
108
|
+
kind: 'spawn' | 'capability' | 'notify';
|
|
109
|
+
target: string;
|
|
110
|
+
inputBindings?: Record<string, unknown>;
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
}
|
|
113
|
+
/** `glue_rule` row payload (registry §3.24). P9 sync product — never hand-authored. */
|
|
114
|
+
export interface PeopleGlueRuleData {
|
|
115
|
+
/** Grammar `glue.<domain>.<event>.<NN>` — ordinal from `orderKey` (GEN-10). */
|
|
116
|
+
ruleKey: string;
|
|
117
|
+
/** uuid of the owning `policy` registry row. */
|
|
118
|
+
policyRef: string;
|
|
119
|
+
/** Git path of the owning artifact — empty interim (Option A, drift D-5). */
|
|
120
|
+
artifactRef?: string | null;
|
|
121
|
+
/** Policy canonical-hash version this handle was synced from (verify walks it). */
|
|
122
|
+
sourceVersion?: string | null;
|
|
123
|
+
domain?: string;
|
|
124
|
+
trigger: {
|
|
125
|
+
type: 'domain_event' | 'external_signal' | 'cron';
|
|
126
|
+
params: Record<string, unknown>;
|
|
127
|
+
};
|
|
128
|
+
/** ONE-layer side-effect-free predicate (RC-02 whitelist DSL). */
|
|
129
|
+
guard?: Record<string, unknown> | null;
|
|
130
|
+
actions: PeopleGlueRuleAction[];
|
|
131
|
+
orderKey?: number;
|
|
132
|
+
/** Display mirror of state — the handler reads the STATE (D3). */
|
|
133
|
+
enabled?: boolean;
|
|
134
|
+
/** Default `rule_event` — spawn keys on `(ruleKey, event_id)` (RC-10). */
|
|
135
|
+
idempotencyScope?: string;
|
|
136
|
+
lastInvokedAt?: string | null;
|
|
137
|
+
disabledAt?: string | null;
|
|
138
|
+
disabledReason?: string | null;
|
|
139
|
+
tombstonedAt?: string | null;
|
|
140
|
+
state: 'draft' | 'published' | 'disabled' | 'superseded' | 'removed';
|
|
141
|
+
}
|
|
142
|
+
export type PeopleGlueRule = ContentItem<PeopleGlueRuleData>;
|
|
143
|
+
/** Authored phase entry inside a process definition (PC-04 linear). */
|
|
144
|
+
export interface PeopleProcessPhaseDef {
|
|
145
|
+
name: string;
|
|
146
|
+
/** Resolves in the same repo's composition policy (PC-08). */
|
|
147
|
+
entryRuleRef?: string | null;
|
|
148
|
+
manual?: boolean;
|
|
149
|
+
[key: string]: unknown;
|
|
150
|
+
}
|
|
151
|
+
/** Terminal status → success/partial/fail + business label (PC-04). */
|
|
152
|
+
export interface PeopleProcessOverallOutcomes extends Record<string, {
|
|
153
|
+
outcome: 'success' | 'partial' | 'fail';
|
|
154
|
+
label?: string;
|
|
155
|
+
}> {
|
|
156
|
+
}
|
|
157
|
+
/** The authored process tree — the FEAT-014 twin of the 010/011 trees. */
|
|
158
|
+
export interface PeopleProcessDefinition {
|
|
159
|
+
typeKey?: string;
|
|
160
|
+
name?: string;
|
|
161
|
+
phases?: PeopleProcessPhaseDef[];
|
|
162
|
+
overallOutcomes?: PeopleProcessOverallOutcomes;
|
|
163
|
+
subjectType?: string;
|
|
164
|
+
compositionPolicyKey?: string | null;
|
|
165
|
+
artifactTypes?: string[];
|
|
166
|
+
compositionEntries?: Array<Record<string, unknown>>;
|
|
167
|
+
[key: string]: unknown;
|
|
168
|
+
}
|
|
169
|
+
/** Validate/publish finding (PC-01..08 + SP-13 series). */
|
|
170
|
+
export interface PeopleProcessFinding {
|
|
171
|
+
id?: string;
|
|
172
|
+
severity?: 'block' | 'warn' | string;
|
|
173
|
+
path?: string;
|
|
174
|
+
message?: string;
|
|
175
|
+
[key: string]: unknown;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* `process_type` row payload (registry §4.6) — T1 definition holder.
|
|
179
|
+
* Lifecycle: draft → validated → published → superseded → decommissioned.
|
|
180
|
+
*/
|
|
181
|
+
export interface PeopleProcessTypeData {
|
|
182
|
+
/** snake_case `^[a-z][a-z0-9_]*$` — feeds the rule-key grammar. */
|
|
183
|
+
typeKey: string;
|
|
184
|
+
name?: string;
|
|
185
|
+
/** Owning process repo URL+branch; empty interim (row-plane). */
|
|
186
|
+
repoRef?: string | null;
|
|
187
|
+
artifactPath?: string | null;
|
|
188
|
+
sotType?: string;
|
|
189
|
+
sotRef?: {
|
|
190
|
+
repo?: string;
|
|
191
|
+
path?: string;
|
|
192
|
+
revision?: string;
|
|
193
|
+
} | Record<string, never>;
|
|
194
|
+
/** Canonical-hash version stamp — set at publish. */
|
|
195
|
+
version?: string | null;
|
|
196
|
+
canonicalHash?: string | null;
|
|
197
|
+
manifestRef?: string | null;
|
|
198
|
+
/** INTERIM authored tree until the publisher stamps SOT pointers. */
|
|
199
|
+
artifact?: PeopleProcessDefinition;
|
|
200
|
+
phases?: PeopleProcessPhaseDef[];
|
|
201
|
+
overallOutcomes?: PeopleProcessOverallOutcomes;
|
|
202
|
+
subjectType?: string;
|
|
203
|
+
compositionPolicyKey?: string | null;
|
|
204
|
+
artifactTypes?: string[];
|
|
205
|
+
/** Derived read-only — instances currently pinning this version. */
|
|
206
|
+
activePins?: string[];
|
|
207
|
+
validationResult?: {
|
|
208
|
+
passed?: boolean;
|
|
209
|
+
checkedAt?: string;
|
|
210
|
+
findings?: PeopleProcessFinding[];
|
|
211
|
+
};
|
|
212
|
+
verify?: {
|
|
213
|
+
badge?: 'GREEN' | 'DRIFT' | 'STALE';
|
|
214
|
+
checkedAt?: string;
|
|
215
|
+
reason?: string;
|
|
216
|
+
} & Record<string, unknown>;
|
|
217
|
+
generated?: Record<string, unknown>;
|
|
218
|
+
state: 'draft' | 'validated' | 'published' | 'superseded' | 'decommissioned';
|
|
219
|
+
}
|
|
220
|
+
export type PeopleProcessType = ContentItem<PeopleProcessTypeData>;
|
|
221
|
+
/** One spawned-request slot in the `process_instance` registry (D2). */
|
|
222
|
+
export interface PeopleSpawnedRequestSlot {
|
|
223
|
+
typeKey?: string;
|
|
224
|
+
slot?: string;
|
|
225
|
+
requestUuid?: string;
|
|
226
|
+
requestState?: string;
|
|
227
|
+
holder?: boolean;
|
|
228
|
+
pinnedVersion?: string;
|
|
229
|
+
phase?: string;
|
|
230
|
+
waitTerminal?: boolean;
|
|
231
|
+
[key: string]: unknown;
|
|
232
|
+
}
|
|
233
|
+
/** RT-21 snapshot pins frozen at start — handlers read ONLY this. */
|
|
234
|
+
export interface PeopleProcessSnapshot {
|
|
235
|
+
typeSha?: string;
|
|
236
|
+
phases?: PeopleProcessPhaseDef[];
|
|
237
|
+
overallOutcomes?: PeopleProcessOverallOutcomes;
|
|
238
|
+
subjectType?: string;
|
|
239
|
+
spawnSets?: Record<string, Array<Record<string, unknown>>>;
|
|
240
|
+
policy?: {
|
|
241
|
+
policyRef?: string;
|
|
242
|
+
policySha?: string;
|
|
243
|
+
policyKey?: string;
|
|
244
|
+
compositionEntries?: Array<Record<string, unknown>>;
|
|
245
|
+
versions?: Record<string, unknown>;
|
|
246
|
+
} & Record<string, unknown>;
|
|
247
|
+
[key: string]: unknown;
|
|
248
|
+
}
|
|
249
|
+
/** US5 completion record — written once at completed. */
|
|
250
|
+
export interface PeopleCompletionRecord {
|
|
251
|
+
overallOutcome?: 'success' | 'partial' | 'fail' | string;
|
|
252
|
+
completedAt?: string;
|
|
253
|
+
subjectRef?: string;
|
|
254
|
+
requests?: Array<{
|
|
255
|
+
uuid?: string;
|
|
256
|
+
typeKey?: string;
|
|
257
|
+
slot?: string;
|
|
258
|
+
terminalState?: string;
|
|
259
|
+
outcome?: string;
|
|
260
|
+
}>;
|
|
261
|
+
artifacts?: Array<Record<string, unknown>>;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
}
|
|
264
|
+
/** US6 cancellation — everything produced is LISTED, never dropped. */
|
|
265
|
+
export interface PeopleProcessCancellation {
|
|
266
|
+
at?: string;
|
|
267
|
+
by?: string;
|
|
268
|
+
reason?: string | null;
|
|
269
|
+
producedListing?: Array<Record<string, unknown>>;
|
|
270
|
+
propagatedToRequests?: number;
|
|
271
|
+
[key: string]: unknown;
|
|
272
|
+
}
|
|
273
|
+
/** D4 phase-hold bookkeeping — a FIELD, not a state machine. */
|
|
274
|
+
export interface PeopleProcessHold {
|
|
275
|
+
phase?: string;
|
|
276
|
+
failedSlots?: string[];
|
|
277
|
+
reason?: string;
|
|
278
|
+
detectedAt?: string;
|
|
279
|
+
[key: string]: unknown;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* `process_instance` row payload (registry §4.8) — the generic runtime
|
|
283
|
+
* ledger. Lifecycle: draft → processing → completed | failed | cancelled;
|
|
284
|
+
* `degraded` is a flag, phase transitions are NEVER invocable (RT-19).
|
|
285
|
+
*/
|
|
286
|
+
export interface PeopleProcessInstanceData {
|
|
287
|
+
typeKey?: string;
|
|
288
|
+
/** uuid of the published process_type row pinned at start. */
|
|
289
|
+
processTypeRef: string;
|
|
290
|
+
subjectRef: string;
|
|
291
|
+
snapshot?: PeopleProcessSnapshot;
|
|
292
|
+
currentPhase?: string | null;
|
|
293
|
+
spawnedRequests?: PeopleSpawnedRequestSlot[];
|
|
294
|
+
degraded?: boolean;
|
|
295
|
+
hold?: PeopleProcessHold;
|
|
296
|
+
completionRecord?: PeopleCompletionRecord;
|
|
297
|
+
cancellation?: PeopleProcessCancellation;
|
|
298
|
+
deferDecisions?: Record<string, boolean>;
|
|
299
|
+
startedAt?: string | null;
|
|
300
|
+
completedAt?: string | null;
|
|
301
|
+
state: 'draft' | 'processing' | 'completed' | 'failed' | 'cancelled';
|
|
302
|
+
}
|
|
303
|
+
export type PeopleProcessInstance = ContentItem<PeopleProcessInstanceData>;
|
|
304
|
+
//# sourceMappingURL=ct.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct.types.d.ts","sourceRoot":"","sources":["../../../../src/services/people/process/ct.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,C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IACjB,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,gBAAgB,CAAC,EAAE,sBAAsB,CAAC;IAC1C,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;CACtE;AACD,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process domain — barrel.
|
|
3
|
+
*
|
|
4
|
+
* FEAT-010 (request_type + registered_capability + the runtime lane on
|
|
5
|
+
* generated CTs) + FEAT-011 (glue_rule handle + policy actions) + FEAT-014
|
|
6
|
+
* (process_type definition lane + process_instance lifecycle). Re-exports
|
|
7
|
+
* the typed payloads, the action params, and the mixin surface.
|
|
8
|
+
*/
|
|
9
|
+
export type { PeopleRequestTypeData, PeopleRequestType, PeopleRequestTypeDefinition, PeopleRequestTypeStateDef, PeopleRequestTypeActionDef, PeopleDefinitionFinding, PeopleDefinitionValidationResult, PeopleRegisteredCapabilityData, PeopleRegisteredCapability, PeopleGlueRuleData, PeopleGlueRule, PeopleGlueRuleAction, PeopleProcessType, PeopleProcessTypeData, PeopleProcessDefinition, PeopleProcessPhaseDef, PeopleProcessOverallOutcomes, PeopleProcessFinding, PeopleProcessInstance, PeopleProcessInstanceData, PeopleProcessSnapshot, PeopleSpawnedRequestSlot, PeopleCompletionRecord, PeopleProcessCancellation, PeopleProcessHold, } from './ct.types';
|
|
10
|
+
export type { ProcessActions, PeopleEditRequestTypeParams, PeopleSafeTestRequestTypeParams, PeopleEditPolicyParams, PeoplePublishPolicyParams, PeopleArchivePolicyParams, PeopleTogglePolicyParams, PeopleToggleGlueRuleParams, PeopleRuntimeRequestCreateParams, PeopleEditProcessParams, PeoplePublishProcessParams, PeopleSupersedeProcessParams, PeopleDecommissionProcessParams, PeopleCreateProcessParams, PeopleCancelProcessParams, } from './actions';
|
|
11
|
+
export { buildProcessActions } from './actions';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/people/process/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,8BAA8B,EAC9B,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,cAAc,EACd,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* People Hub — cross-domain shared types.
|
|
3
|
+
*
|
|
4
|
+
* Domain folders (legal/, perms/, identity/, process/) import these for the
|
|
5
|
+
* shapes used everywhere (action opts, error guard shape). Keeping them here
|
|
6
|
+
* lets each domain file declare only what its actions actually need without
|
|
7
|
+
* re-declaring them or reaching across domain boundaries.
|
|
8
|
+
*/
|
|
9
|
+
/** Options accepted by every People action wrapper. Mirrors `GovActionOpts`
|
|
10
|
+
* so consumers have one shape across packs. */
|
|
11
|
+
export interface PeopleActionOpts {
|
|
12
|
+
/** UUIDv4 idempotency token (ADR-006 D3). Repeat ⇒ audited NO_OP. */
|
|
13
|
+
intentionId?: string;
|
|
14
|
+
/** Optimistic concurrency guard; mismatch ⇒ 409 `version_conflict` (ADR-006 D4). */
|
|
15
|
+
expectedVersion?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Singleton shape returned by engine domain guard rejections (HTTP 200 path;
|
|
18
|
+
* rendered as data — never raised. See api_references §9.1). */
|
|
19
|
+
export interface PeopleGuardRejection {
|
|
20
|
+
success: false;
|
|
21
|
+
error: string;
|
|
22
|
+
/** Top-level per-rule structured reasons (api_references §1: the guard
|
|
23
|
+
* rejection body carries `details` beside `error`, not under `output`). */
|
|
24
|
+
details?: unknown[];
|
|
25
|
+
durationMs: number;
|
|
26
|
+
output?: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** Domain guard outcome union — consumers narrow the `success` branch before
|
|
31
|
+
* casting `output` to the per-action type. */
|
|
32
|
+
export type PeopleActionResult = {
|
|
33
|
+
success: true;
|
|
34
|
+
output?: Record<string, unknown>;
|
|
35
|
+
} | PeopleGuardRejection;
|
|
36
|
+
//# sourceMappingURL=shared.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.types.d.ts","sourceRoot":"","sources":["../../../src/services/people/shared.types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;gDACgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;iEACiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd;gFAC4E;IAC5E,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED;+CAC+C;AAC/C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACnD,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { ExecutionType } from './rules.type';
|
|
2
|
+
export type ConditionValueType = 'float' | 'integer' | 'string';
|
|
3
|
+
/** ClickHouse metric tables the CMS evaluator resolves condition fields from.
|
|
4
|
+
* Mirrors the L1–L3a tables in `eaera_mt5/models` + the `deal` table. */
|
|
5
|
+
export type ConditionTable = 'account_state' | 'account_metric_by_deal' | 'account_symbol_metric_by_deal' | 'account_metric_daily' | 'position_metric_by_deal' | 'deal';
|
|
6
|
+
export interface ConditionField {
|
|
7
|
+
/** Backend key, e.g. `account_state.equity`. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Human label, e.g. `Account Equity`. */
|
|
10
|
+
label: string;
|
|
11
|
+
table: ConditionTable;
|
|
12
|
+
column: string;
|
|
13
|
+
valueType: ConditionValueType;
|
|
14
|
+
description: string;
|
|
15
|
+
unit: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const CONDITION_FIELDS: readonly ConditionField[];
|
|
18
|
+
/** Comparison operators the condition builder emits into `trigger.conditions[]`.
|
|
19
|
+
*
|
|
20
|
+
* These are the **word forms** the CMS condition evaluator expects on the wire
|
|
21
|
+
* (`eaera_cms/core/rules/conditions.py:_apply_operator`). The evaluator also
|
|
22
|
+
* accepts the JSON-Logic symbol aliases (`==`, `!=`, `>`, `>=`, `<`, `<=`),
|
|
23
|
+
* but the canonical contract uses the word forms — see the FEAT-006 testing
|
|
24
|
+
* guide and `risk-rules-api-guide.md` §4.E.a.
|
|
25
|
+
*
|
|
26
|
+
* Operator kind, per the backend `value` semantics:
|
|
27
|
+
* - `gt`, `gte`, `lt`, `lte` — numeric (`account_state.*`,
|
|
28
|
+
* `account_metric_by_deal.*`)
|
|
29
|
+
* - `eq`, `ne` — any (string / number / boolean)
|
|
30
|
+
* - `in`, `not_in` — value MUST be a JSON list
|
|
31
|
+
* - `contains`, `startswith`, `endswith` — string substring/affix;
|
|
32
|
+
* backend coerces entity via `str()`
|
|
33
|
+
* - `is_null`, `is_not_null` — `value` is IGNORED by the backend;
|
|
34
|
+
* UI should hide the value input
|
|
35
|
+
* - `sum_within_days` — CH-windowed SUM; carries a sibling
|
|
36
|
+
* `days` window (defaults to 30).
|
|
37
|
+
* Special — see {@link SUM_WITHIN_DAYS}
|
|
38
|
+
* constant; not in {@link CONDITION_OPERATORS}.
|
|
39
|
+
*
|
|
40
|
+
* The UI renders the friendlier symbol for the 6 numeric word-forms via
|
|
41
|
+
* {@link CONDITION_OPERATOR_LABELS}; the others have explicit text labels
|
|
42
|
+
* (see {@link CONDITION_OPERATOR_LABELS} + {@link CONDITION_OPERATOR_LABELS_TEXT}).
|
|
43
|
+
*/
|
|
44
|
+
export declare const CONDITION_OPERATORS: readonly ["gt", "gte", "lt", "lte", "eq", "ne", "in", "not_in", "contains", "startswith", "endswith", "is_null", "is_not_null"];
|
|
45
|
+
export type ConditionOperator = (typeof CONDITION_OPERATORS)[number];
|
|
46
|
+
/** The CH-windowed SUM operator — special, NOT a member of
|
|
47
|
+
* {@link CONDITION_OPERATORS} because it carries a sibling `days` key.
|
|
48
|
+
* Authored through the rule YAML/expression path or directly via the API.
|
|
49
|
+
* The dashboard does not surface this in the standard operator dropdown. */
|
|
50
|
+
export declare const SUM_WITHIN_DAYS: "sum_within_days";
|
|
51
|
+
export type SumWithinDaysOperator = typeof SUM_WITHIN_DAYS;
|
|
52
|
+
/** Symbol label shown in the UI for each numeric word-form operator. */
|
|
53
|
+
export declare const CONDITION_OPERATOR_LABELS: Record<ConditionOperator, string>;
|
|
54
|
+
/** Per-operator value-type metadata. Drives the dashboard's value-input widget:
|
|
55
|
+
* - `number` → numeric input
|
|
56
|
+
* - `string` → single-line text input (substrings/affixes)
|
|
57
|
+
* - `list` → JSON-array editor (CSV/JSON toggle recommended)
|
|
58
|
+
* - `none` → value is ignored by the backend; UI should hide the input
|
|
59
|
+
*/
|
|
60
|
+
export type ConditionOperatorValueKind = 'number' | 'string' | 'list' | 'none';
|
|
61
|
+
export declare const CONDITION_OPERATOR_VALUE_KINDS: Record<ConditionOperator, ConditionOperatorValueKind>;
|
|
62
|
+
/** Symbol form → word form. The backend accepts both on the wire; the dashboard
|
|
63
|
+
* canonicalises to the word form on save and on load (`useRuleBuilder`
|
|
64
|
+
* `_normalizeOperator`). */
|
|
65
|
+
export declare const CONDITION_OPERATOR_SYMBOL_TO_WORD: Record<string, ConditionOperator>;
|
|
66
|
+
/** Normalise any operator string (symbol, word, or unknown) to a word form.
|
|
67
|
+
* Unknown inputs are returned as-is so the backend's `eq`-fallback semantics
|
|
68
|
+
* remain the source of truth. */
|
|
69
|
+
export declare const normalizeConditionOperator: (raw: unknown) => string;
|
|
70
|
+
/**
|
|
71
|
+
* Allowed MT5 leverage values for the `change_leverage` action. MT5 accepts a
|
|
72
|
+
* constrained integer set; the rule builder offers these as a select rather
|
|
73
|
+
* than a free-text input. The MT5 worker coerces the value to a positive int
|
|
74
|
+
* (`worker/tasks/dispatcher.py:_change_leverage`); this list mirrors the
|
|
75
|
+
* common broker-configured leverages.
|
|
76
|
+
*/
|
|
77
|
+
export declare const LEVERAGE_OPTIONS: readonly [1, 5, 10, 20, 25, 30, 40, 50, 100, 200, 300, 400, 500, 1000];
|
|
78
|
+
export type LeverageOption = (typeof LEVERAGE_OPTIONS)[number];
|
|
79
|
+
/**
|
|
80
|
+
* Builder action kinds → CMS action wiring. The fixed-rule action chain maps
|
|
81
|
+
* a UI `kind` to its `actionName` + nested `params` key. Kept here so the FE
|
|
82
|
+
* serializer (and the docs) stay in sync with the worker dispatcher contract.
|
|
83
|
+
*
|
|
84
|
+
* Specialized kinds (`move`, `leverage`, `tag`, `setField`) have dedicated UI
|
|
85
|
+
* inputs. The `custom` kind is a fallback for any action not in this list — it
|
|
86
|
+
* renders the `actionName` as read-only and exposes raw `params` as JSON.
|
|
87
|
+
*/
|
|
88
|
+
/** Value-level constants for action kinds — single source of truth. */
|
|
89
|
+
export declare const ACTION_KIND: {
|
|
90
|
+
readonly MOVE: "move";
|
|
91
|
+
readonly LEVERAGE: "leverage";
|
|
92
|
+
readonly TAG: "tag";
|
|
93
|
+
readonly SET_FIELD: "setField";
|
|
94
|
+
readonly DISABLE_TRADE: "disableTrade";
|
|
95
|
+
readonly ENABLE_TRADE: "enableTrade";
|
|
96
|
+
readonly GENERATE_REPORT: "generateReport";
|
|
97
|
+
readonly GENERATE_AI_SUMMARY: "generateAiSummary";
|
|
98
|
+
readonly PROVISION_USER: "provisionUser";
|
|
99
|
+
readonly CUSTOM: "custom";
|
|
100
|
+
};
|
|
101
|
+
/** Action kind type — derived from {@link ACTION_KIND}. */
|
|
102
|
+
export type RuleActionKind = (typeof ACTION_KIND)[keyof typeof ACTION_KIND];
|
|
103
|
+
export interface ActionKindDef {
|
|
104
|
+
kind: RuleActionKind;
|
|
105
|
+
actionName: string;
|
|
106
|
+
/** Nested `params` key the worker dispatcher reads (camelCase; the CMS
|
|
107
|
+
* casing middleware converts to snake_case before the worker sees it). */
|
|
108
|
+
paramKey?: string;
|
|
109
|
+
/** Default codeRef (pack handler path) for actions that require one. */
|
|
110
|
+
defaultCodeRef?: string;
|
|
111
|
+
/** Human label shown in the UI kind selector. */
|
|
112
|
+
label: string;
|
|
113
|
+
}
|
|
114
|
+
export declare const ACTION_KINDS: readonly ActionKindDef[];
|
|
115
|
+
/** Lookup an ActionKindDef by backend actionName. Returns undefined for unknown names. */
|
|
116
|
+
export declare const actionDefByActionName: (actionName: string) => ActionKindDef | undefined;
|
|
117
|
+
/** Per-action `result.output` field shapes — the authoritative reference for
|
|
118
|
+
* what the CMS completion handler stores at `execution.result.output` after a
|
|
119
|
+
* successful action.
|
|
120
|
+
*
|
|
121
|
+
* When the history/detection feeds fetch with `?exclude_params=true`, the
|
|
122
|
+
* `params` JSONB is dropped entirely. The dashboard reads action details from
|
|
123
|
+
* `result.output` (and `operationName`) instead. This map tells the dashboard
|
|
124
|
+
* which keys to expect per action.
|
|
125
|
+
*
|
|
126
|
+
* Source: `eaera-mt5/worker/tasks/dispatcher.py` (worker return shape) +
|
|
127
|
+
* `eaera-mt5/eaera_mt5/handlers/*.py` (handler ActionResult.output) +
|
|
128
|
+
* `eaera-cms/eaera_cms/core/content/completion.py:427`
|
|
129
|
+
* (`execution.result = {"success": True, "output": res.output}`).
|
|
130
|
+
*
|
|
131
|
+
* Each entry lists the keys the output dict carries. The values are always
|
|
132
|
+
* primitives (string / number / boolean / string[]). */
|
|
133
|
+
export interface ActionResultField {
|
|
134
|
+
/** Key in `result.output`. */
|
|
135
|
+
key: string;
|
|
136
|
+
/** Human label. */
|
|
137
|
+
label: string;
|
|
138
|
+
/** Value type. */
|
|
139
|
+
type: 'string' | 'number' | 'boolean' | 'string[]';
|
|
140
|
+
}
|
|
141
|
+
export declare const ACTION_RESULT_FIELDS: Record<string, readonly ActionResultField[]>;
|
|
142
|
+
/** Extract a flat `{key: value}` dict from `result.output` for a given action.
|
|
143
|
+
* Returns `{}` when output is missing or not an object. */
|
|
144
|
+
export declare const resultOutputOf: (result: Record<string, unknown> | null | undefined, actionName: string) => Record<string, unknown>;
|
|
145
|
+
/** Lookup an ActionKindDef by UI kind. Returns undefined for 'custom'. */
|
|
146
|
+
export declare const actionDefByKind: (kind: RuleActionKind) => ActionKindDef | undefined;
|
|
147
|
+
/** FE-only action step view-model. The single canonical shape used by both
|
|
148
|
+
* the Fixed Rules editor and the LLM-rule (skill) editor. The dashboard
|
|
149
|
+
* imports this from the SDK so the two editors serialize identically and
|
|
150
|
+
* never diverge on what an action looks like. */
|
|
151
|
+
export interface RuleActionView {
|
|
152
|
+
/** Local UI key — never sent to the backend. */
|
|
153
|
+
id: string;
|
|
154
|
+
/** FE-only action kind; maps 1:1 to {@link RuleActionKind}. */
|
|
155
|
+
kind: RuleActionKind;
|
|
156
|
+
/** Target group for `kind === 'move'`. */
|
|
157
|
+
targetGroup?: string;
|
|
158
|
+
/** Tags array for `kind === 'tag'`. */
|
|
159
|
+
tags?: string[];
|
|
160
|
+
/** Tag mode for `kind === 'tag'`. */
|
|
161
|
+
tagMode?: 'append' | 'replace' | 'remove';
|
|
162
|
+
/** Field name for `kind === 'setField'` / `kind === 'provisionUser'`. */
|
|
163
|
+
field?: string;
|
|
164
|
+
/** Value for `kind === 'leverage'` (numeric) or `kind === 'setField'`
|
|
165
|
+
* (stringified). */
|
|
166
|
+
value?: number | string;
|
|
167
|
+
/** Report period start (ISO `YYYY-MM-DD`) for `kind === 'generateReport'`. */
|
|
168
|
+
dateFrom?: string;
|
|
169
|
+
/** Report period end (ISO `YYYY-MM-DD`) for `kind === 'generateReport'`. */
|
|
170
|
+
dateTo?: string;
|
|
171
|
+
/** Reason string for `kind === 'disableTrade' | 'enableTrade'`. */
|
|
172
|
+
reason?: string;
|
|
173
|
+
/** Backend actionName — auto-populated for specialized kinds; required for `custom`. */
|
|
174
|
+
actionName?: string;
|
|
175
|
+
/** Backend codeRef (handler path). Preserved on load, emitted on save. */
|
|
176
|
+
codeRef?: string;
|
|
177
|
+
/** Raw params object — used by `custom` and preserved for round-tripping. */
|
|
178
|
+
params?: Record<string, unknown>;
|
|
179
|
+
}
|
|
180
|
+
/** Serialize the per-kind `params` payload for the CMS dispatcher.
|
|
181
|
+
* Mirrors the historical `useRuleBuilder._serializeActionParams`.
|
|
182
|
+
*
|
|
183
|
+
* Critical contract:
|
|
184
|
+
* - The dispatcher passes `params` through `ctx.data` to the worker handler.
|
|
185
|
+
* - The MT5 worker reads snake_case keys (`from_time`, `new_group`,
|
|
186
|
+
* `new_leverage`, …) and the CMS casing middleware converts our
|
|
187
|
+
* camelCase keys to snake_case on the way in.
|
|
188
|
+
* - Empty / zero required fields are omitted so the worker doesn't pick
|
|
189
|
+
* up its default-0 placeholder and silently fail. The rule can be
|
|
190
|
+
* saved with empty inputs; the action will then fail gracefully at
|
|
191
|
+
* fire time with a clear error.
|
|
192
|
+
* - Do NOT emit `login` / `serverName` placeholders — the runtime context
|
|
193
|
+
* (trigger event or fire payload) carries those.
|
|
194
|
+
*/
|
|
195
|
+
export declare const serializeActionParams: (action: RuleActionView) => Record<string, unknown>;
|
|
196
|
+
/** Serialize a single action view into the CMS wire shape
|
|
197
|
+
* `{ actionName, codeRef?, params }` — used for both single-step and chain
|
|
198
|
+
* rule executionParams. */
|
|
199
|
+
export declare const serializeAction: (action: RuleActionView) => {
|
|
200
|
+
actionName: string;
|
|
201
|
+
codeRef?: string;
|
|
202
|
+
params: Record<string, unknown>;
|
|
203
|
+
};
|
|
204
|
+
/** Build the `executionParams` payload from a list of actions.
|
|
205
|
+
*
|
|
206
|
+
* - 0 actions → `executionType: 'action'` with empty params.
|
|
207
|
+
* - 1 action, kind `SET_FIELD` → `executionType: 'set_field'` with
|
|
208
|
+
* `executionParams: { field, value }`. The CMS dispatcher (`_dispatch_target`'s
|
|
209
|
+
* `set_field` branch) only takes this dedicated path — emitting it as a
|
|
210
|
+
* plain `action` would land on the action-executor path, which requires a
|
|
211
|
+
* `code_ref` that `set_field` does not have.
|
|
212
|
+
* - 1 action, any other kind → `executionType: 'action'` with the
|
|
213
|
+
* `serializeAction(...)` shape (actionName + optional codeRef + params).
|
|
214
|
+
* - 2+ actions → `executionType: 'chain'` with `executionParams.steps[]`.
|
|
215
|
+
*/
|
|
216
|
+
export declare const actionsToExecutionParams: (actions: RuleActionView[]) => {
|
|
217
|
+
executionType: ExecutionType;
|
|
218
|
+
executionParams: Record<string, unknown>;
|
|
219
|
+
};
|
|
220
|
+
/** Read the action list back from a stored `ContentRule.executionParams`.
|
|
221
|
+
* Supports `set_field`, single-step `action`, and multi-step `chain`
|
|
222
|
+
* payloads. */
|
|
223
|
+
export declare const actionsFromExecution: (rule: {
|
|
224
|
+
executionType: ExecutionType | string;
|
|
225
|
+
executionParams?: Record<string, unknown> | null;
|
|
226
|
+
}) => RuleActionView[];
|
|
227
|
+
/**
|
|
228
|
+
* Event-payload fields for `triggerType === 'event'` rules. The CMS
|
|
229
|
+
* condition evaluator resolves dotted paths from the Kafka event payload
|
|
230
|
+
* (`event.data.*`) with a fallback to flat fields
|
|
231
|
+
* (`eaera_cms/core/rules/conditions.py:_resolve_field`). These are NOT
|
|
232
|
+
* ClickHouse metric fields — they come from the event itself.
|
|
233
|
+
*
|
|
234
|
+
* The dashboard tree builder emits these verbatim so the engine can resolve
|
|
235
|
+
* them at fire time. Source: `eaera-mt5/reference-v0/ch/ddl.py` payload
|
|
236
|
+
* schemas + `eaera-mt5/worker/tasks/realtime.py` event shapes.
|
|
237
|
+
*/
|
|
238
|
+
/** Top-level key of the event payload each field belongs to. */
|
|
239
|
+
export declare const EVENT_PAYLOAD_SOURCE: {
|
|
240
|
+
readonly DEAL: "deal";
|
|
241
|
+
readonly POSITION: "position";
|
|
242
|
+
readonly ORDER: "order";
|
|
243
|
+
};
|
|
244
|
+
export type EventPayloadSource = (typeof EVENT_PAYLOAD_SOURCE)[keyof typeof EVENT_PAYLOAD_SOURCE];
|
|
245
|
+
export interface EventPayloadField {
|
|
246
|
+
/** Backend dotted-path key, e.g. `deal.profit`. */
|
|
247
|
+
key: string;
|
|
248
|
+
/** Human label, e.g. `Deal Profit`. */
|
|
249
|
+
label: string;
|
|
250
|
+
/** Which event payload this field is sourced from. */
|
|
251
|
+
source: EventPayloadSource;
|
|
252
|
+
valueType: ConditionValueType;
|
|
253
|
+
unit: string;
|
|
254
|
+
}
|
|
255
|
+
export declare const EVENT_PAYLOAD_FIELDS: readonly EventPayloadField[];
|
|
256
|
+
/**
|
|
257
|
+
* Filter the event-payload catalog to a subset appropriate for an event type.
|
|
258
|
+
* The dashboard uses this to narrow the metric dropdown so a `deal_close`
|
|
259
|
+
* rule can only select `deal.*` fields, etc. Returns all fields if the event
|
|
260
|
+
* type doesn't have a known narrowing (e.g. `statement` falls back to CH
|
|
261
|
+
* catalog fields).
|
|
262
|
+
*/
|
|
263
|
+
export declare const eventPayloadFieldsFor: (_eventType: string | null | undefined) => readonly EventPayloadField[];
|
|
264
|
+
//# sourceMappingURL=conditions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../src/services/rules/conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhE;0EAC0E;AAC1E,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,wBAAwB,GACxB,+BAA+B,GAC/B,sBAAsB,GACtB,yBAAyB,GACzB,MAAM,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;I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