@memberjunction/core-entities 5.42.0 → 5.43.0

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.
@@ -0,0 +1,48 @@
1
+ /**
2
+ * @fileoverview Metadata cache for `MJ: Remote Operations` rows — the `@RegisterForStartup` engine the
3
+ * generic `ExecuteRemoteOperation` resolver consults to gate dispatch on the operation's metadata
4
+ * (Status / approval), independent of the in-code ClassFactory registration.
5
+ *
6
+ * Why this exists as defense-in-depth: CodeGen only emits Active + Approved operations, so a Disabled or
7
+ * unapproved op normally has no generated class and is therefore unregistered + already unreachable. But a
8
+ * hand-authored (`GenerationType='Manual'`) op keeps its `@RegisterClass` decorator in source even if the
9
+ * metadata row is later set to `Status='Disabled'`. This engine lets the resolver honor that metadata state
10
+ * at runtime — a registered-but-disabled op is rejected — with a synchronous in-memory cache hit (no per-call
11
+ * DB query), kept fresh by the BaseEngine entity-event subscription.
12
+ *
13
+ * @module @memberjunction/core-entities
14
+ */
15
+ import { BaseEngine, IMetadataProvider, UserInfo } from '@memberjunction/core';
16
+ import { MJRemoteOperationEntity } from '../generated/entity_subclasses.js';
17
+ /** Why an operation is not currently invokable (for a clear caller-facing rejection). */
18
+ export interface RemoteOperationInvokabilityResult {
19
+ /** True when the operation may be dispatched. */
20
+ Invokable: boolean;
21
+ /** Machine-readable reason code when not invokable (e.g. `OPERATION_DISABLED`, `OPERATION_NOT_APPROVED`). */
22
+ ResultCode?: string;
23
+ /** Human-readable reason when not invokable. */
24
+ Reason?: string;
25
+ }
26
+ /**
27
+ * Caches every `MJ: Remote Operations` row and answers "may this operation key be dispatched?" from metadata.
28
+ * Client-safe (pure metadata caching); the server resolver uses it as a defense-in-depth gate.
29
+ */
30
+ export declare class RemoteOperationEngineBase extends BaseEngine<RemoteOperationEngineBase> {
31
+ private _remoteOperations;
32
+ private _byKey;
33
+ /** The process-wide singleton. */
34
+ static get Instance(): RemoteOperationEngineBase;
35
+ /** Loads (or refreshes) the cached Remote Operation rows. */
36
+ Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
37
+ /** All cached Remote Operation rows. */
38
+ get RemoteOperations(): MJRemoteOperationEntity[];
39
+ /** Case-insensitive lookup of an operation row by its `OperationKey` (`undefined` if there is no row). */
40
+ GetOperationByKey(operationKey: string): MJRemoteOperationEntity | undefined;
41
+ /**
42
+ * Decides whether the operation key may be dispatched, from its metadata row. When there is NO row for the
43
+ * key (a code-only operation), it is considered invokable — the in-code ClassFactory registration governs.
44
+ * When a row exists it must be `Active`, and `AI`-generated ops must additionally be `Approved`.
45
+ */
46
+ IsInvokable(operationKey: string): RemoteOperationInvokabilityResult;
47
+ }
48
+ //# sourceMappingURL=RemoteOperationEngineBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteOperationEngineBase.d.ts","sourceRoot":"","sources":["../../src/engines/RemoteOperationEngineBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,iCAAiC;IAC9C,iDAAiD;IACjD,SAAS,EAAE,OAAO,CAAC;IACnB,6GAA6G;IAC7G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBACa,yBAA0B,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IAChF,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,MAAM,CAAqD;IAEnE,kCAAkC;IAClC,WAAkB,QAAQ,IAAI,yBAAyB,CAEtD;IAED,6DAA6D;IAChD,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhH,wCAAwC;IACxC,IAAW,gBAAgB,IAAI,uBAAuB,EAAE,CAEvD;IAED,0GAA0G;IACnG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAUnF;;;;OAIG;IACI,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,iCAAiC;CAa9E"}
@@ -0,0 +1,85 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /**
8
+ * @fileoverview Metadata cache for `MJ: Remote Operations` rows — the `@RegisterForStartup` engine the
9
+ * generic `ExecuteRemoteOperation` resolver consults to gate dispatch on the operation's metadata
10
+ * (Status / approval), independent of the in-code ClassFactory registration.
11
+ *
12
+ * Why this exists as defense-in-depth: CodeGen only emits Active + Approved operations, so a Disabled or
13
+ * unapproved op normally has no generated class and is therefore unregistered + already unreachable. But a
14
+ * hand-authored (`GenerationType='Manual'`) op keeps its `@RegisterClass` decorator in source even if the
15
+ * metadata row is later set to `Status='Disabled'`. This engine lets the resolver honor that metadata state
16
+ * at runtime — a registered-but-disabled op is rejected — with a synchronous in-memory cache hit (no per-call
17
+ * DB query), kept fresh by the BaseEngine entity-event subscription.
18
+ *
19
+ * @module @memberjunction/core-entities
20
+ */
21
+ import { BaseEngine, RegisterForStartup } from '@memberjunction/core';
22
+ /**
23
+ * Caches every `MJ: Remote Operations` row and answers "may this operation key be dispatched?" from metadata.
24
+ * Client-safe (pure metadata caching); the server resolver uses it as a defense-in-depth gate.
25
+ */
26
+ let RemoteOperationEngineBase = class RemoteOperationEngineBase extends BaseEngine {
27
+ constructor() {
28
+ super(...arguments);
29
+ this._remoteOperations = [];
30
+ this._byKey = null;
31
+ }
32
+ /** The process-wide singleton. */
33
+ static get Instance() {
34
+ return super.getInstance();
35
+ }
36
+ /** Loads (or refreshes) the cached Remote Operation rows. */
37
+ async Config(forceRefresh, contextUser, provider) {
38
+ const configs = [
39
+ {
40
+ PropertyName: '_remoteOperations',
41
+ EntityName: 'MJ: Remote Operations',
42
+ CacheLocal: true,
43
+ },
44
+ ];
45
+ this._byKey = null; // invalidate the key index; rebuilt lazily after (re)load
46
+ await this.Load(configs, provider, forceRefresh, contextUser);
47
+ }
48
+ /** All cached Remote Operation rows. */
49
+ get RemoteOperations() {
50
+ return this._remoteOperations;
51
+ }
52
+ /** Case-insensitive lookup of an operation row by its `OperationKey` (`undefined` if there is no row). */
53
+ GetOperationByKey(operationKey) {
54
+ if (!operationKey) {
55
+ return undefined;
56
+ }
57
+ if (!this._byKey) {
58
+ this._byKey = new Map(this._remoteOperations.map((o) => [o.OperationKey.trim().toLowerCase(), o]));
59
+ }
60
+ return this._byKey.get(operationKey.trim().toLowerCase());
61
+ }
62
+ /**
63
+ * Decides whether the operation key may be dispatched, from its metadata row. When there is NO row for the
64
+ * key (a code-only operation), it is considered invokable — the in-code ClassFactory registration governs.
65
+ * When a row exists it must be `Active`, and `AI`-generated ops must additionally be `Approved`.
66
+ */
67
+ IsInvokable(operationKey) {
68
+ const row = this.GetOperationByKey(operationKey);
69
+ if (!row) {
70
+ return { Invokable: true }; // no metadata row → governed solely by code registration
71
+ }
72
+ if (row.Status !== 'Active') {
73
+ return { Invokable: false, ResultCode: 'OPERATION_DISABLED', Reason: `Remote operation '${operationKey}' is not active (Status='${row.Status}')` };
74
+ }
75
+ if (row.GenerationType === 'AI' && row.CodeApprovalStatus !== 'Approved') {
76
+ return { Invokable: false, ResultCode: 'OPERATION_NOT_APPROVED', Reason: `Remote operation '${operationKey}' has unapproved AI-generated code (CodeApprovalStatus='${row.CodeApprovalStatus}')` };
77
+ }
78
+ return { Invokable: true };
79
+ }
80
+ };
81
+ RemoteOperationEngineBase = __decorate([
82
+ RegisterForStartup()
83
+ ], RemoteOperationEngineBase);
84
+ export { RemoteOperationEngineBase };
85
+ //# sourceMappingURL=RemoteOperationEngineBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemoteOperationEngineBase.js","sourceRoot":"","sources":["../../src/engines/RemoteOperationEngineBase.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,UAAU,EAAyD,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAa7H;;;GAGG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAqC;IAA7E;;QACK,sBAAiB,GAA8B,EAAE,CAAC;QAClD,WAAM,GAAgD,IAAI,CAAC;IAsDvE,CAAC;IApDG,kCAAkC;IAC3B,MAAM,KAAK,QAAQ;QACtB,OAAO,KAAK,CAAC,WAAW,EAA6B,CAAC;IAC1D,CAAC;IAED,6DAA6D;IACtD,KAAK,CAAC,MAAM,CAAC,YAAsB,EAAE,WAAsB,EAAE,QAA4B;QAC5F,MAAM,OAAO,GAAwC;YACjD;gBACI,YAAY,EAAE,mBAAmB;gBACjC,UAAU,EAAE,uBAAuB;gBACnC,UAAU,EAAE,IAAI;aACnB;SACJ,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,0DAA0D;QAC9E,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED,wCAAwC;IACxC,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED,0GAA0G;IACnG,iBAAiB,CAAC,YAAoB;QACzC,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvG,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,YAAoB;QACnC,MAAM,GAAG,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACjD,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,yDAAyD;QACzF,CAAC;QACD,IAAI,GAAG,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,EAAE,qBAAqB,YAAY,4BAA4B,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;QACvJ,CAAC;QACD,IAAI,GAAG,CAAC,cAAc,KAAK,IAAI,IAAI,GAAG,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;YACvE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,EAAE,qBAAqB,YAAY,2DAA2D,GAAG,CAAC,kBAAkB,IAAI,EAAE,CAAC;QACtM,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC/B,CAAC;CACJ,CAAA;AAxDY,yBAAyB;IADrC,kBAAkB,EAAE;GACR,yBAAyB,CAwDrC"}
@@ -9160,6 +9160,7 @@ export declare const MJEntityActionInvocationSchema: z.ZodObject<{
9160
9160
  Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Disabled">, z.ZodLiteral<"Pending">]>;
9161
9161
  __mj_CreatedAt: z.ZodDate;
9162
9162
  __mj_UpdatedAt: z.ZodDate;
9163
+ RuntimeUXDriverClass: z.ZodNullable<z.ZodString>;
9163
9164
  EntityAction: z.ZodString;
9164
9165
  InvocationType: z.ZodString;
9165
9166
  }, "strip", z.ZodTypeAny, {
@@ -9170,6 +9171,7 @@ export declare const MJEntityActionInvocationSchema: z.ZodObject<{
9170
9171
  EntityActionID?: string;
9171
9172
  EntityAction?: string;
9172
9173
  InvocationTypeID?: string;
9174
+ RuntimeUXDriverClass?: string;
9173
9175
  InvocationType?: string;
9174
9176
  }, {
9175
9177
  ID?: string;
@@ -9179,6 +9181,7 @@ export declare const MJEntityActionInvocationSchema: z.ZodObject<{
9179
9181
  EntityActionID?: string;
9180
9182
  EntityAction?: string;
9181
9183
  InvocationTypeID?: string;
9184
+ RuntimeUXDriverClass?: string;
9182
9185
  InvocationType?: string;
9183
9186
  }>;
9184
9187
  export type MJEntityActionInvocationEntityType = z.infer<typeof MJEntityActionInvocationSchema>;
@@ -12404,6 +12407,7 @@ export declare const MJOpenAppSchema: z.ZodObject<{
12404
12407
  Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Disabled">, z.ZodLiteral<"Error">, z.ZodLiteral<"Installing">, z.ZodLiteral<"Removed">, z.ZodLiteral<"Removing">, z.ZodLiteral<"Upgrading">]>;
12405
12408
  __mj_CreatedAt: z.ZodDate;
12406
12409
  __mj_UpdatedAt: z.ZodDate;
12410
+ Subpath: z.ZodNullable<z.ZodString>;
12407
12411
  InstalledByUser: z.ZodString;
12408
12412
  }, "strip", z.ZodTypeAny, {
12409
12413
  ID?: string;
@@ -12426,6 +12430,7 @@ export declare const MJOpenAppSchema: z.ZodObject<{
12426
12430
  License?: string;
12427
12431
  ConfigurationSchemaJSON?: string;
12428
12432
  InstalledByUserID?: string;
12433
+ Subpath?: string;
12429
12434
  InstalledByUser?: string;
12430
12435
  }, {
12431
12436
  ID?: string;
@@ -12448,6 +12453,7 @@ export declare const MJOpenAppSchema: z.ZodObject<{
12448
12453
  License?: string;
12449
12454
  ConfigurationSchemaJSON?: string;
12450
12455
  InstalledByUserID?: string;
12456
+ Subpath?: string;
12451
12457
  InstalledByUser?: string;
12452
12458
  }>;
12453
12459
  export type MJOpenAppEntityType = z.infer<typeof MJOpenAppSchema>;
@@ -12664,6 +12670,7 @@ export declare const MJProcessRunSchema: z.ZodObject<{
12664
12670
  StartedByUserID: z.ZodNullable<z.ZodString>;
12665
12671
  __mj_CreatedAt: z.ZodDate;
12666
12672
  __mj_UpdatedAt: z.ZodDate;
12673
+ DryRun: z.ZodBoolean;
12667
12674
  RecordProcess: z.ZodNullable<z.ZodString>;
12668
12675
  Entity: z.ZodNullable<z.ZodString>;
12669
12676
  ScheduledJobRun: z.ZodNullable<z.ZodString>;
@@ -12697,6 +12704,7 @@ export declare const MJProcessRunSchema: z.ZodObject<{
12697
12704
  SuccessCount?: number;
12698
12705
  SkippedCount?: number;
12699
12706
  LastProcessedKey?: string;
12707
+ DryRun?: boolean;
12700
12708
  RecordProcess?: string;
12701
12709
  }, {
12702
12710
  ID?: string;
@@ -12727,6 +12735,7 @@ export declare const MJProcessRunSchema: z.ZodObject<{
12727
12735
  SuccessCount?: number;
12728
12736
  SkippedCount?: number;
12729
12737
  LastProcessedKey?: string;
12738
+ DryRun?: boolean;
12730
12739
  RecordProcess?: string;
12731
12740
  }>;
12732
12741
  export type MJProcessRunEntityType = z.infer<typeof MJProcessRunSchema>;
@@ -13888,7 +13897,7 @@ export declare const MJRecordProcessSchema: z.ZodObject<{
13888
13897
  CategoryID: z.ZodNullable<z.ZodString>;
13889
13898
  EntityID: z.ZodString;
13890
13899
  Status: z.ZodUnion<[z.ZodLiteral<"Active">, z.ZodLiteral<"Disabled">, z.ZodLiteral<"Draft">]>;
13891
- WorkType: z.ZodUnion<[z.ZodLiteral<"Action">, z.ZodLiteral<"Agent">, z.ZodLiteral<"Infer">]>;
13900
+ WorkType: z.ZodUnion<[z.ZodLiteral<"Action">, z.ZodLiteral<"Agent">, z.ZodLiteral<"FieldRules">, z.ZodLiteral<"Infer">]>;
13892
13901
  ActionID: z.ZodNullable<z.ZodString>;
13893
13902
  AgentID: z.ZodNullable<z.ZodString>;
13894
13903
  PromptID: z.ZodNullable<z.ZodString>;
@@ -13911,6 +13920,7 @@ export declare const MJRecordProcessSchema: z.ZodObject<{
13911
13920
  MaxConcurrency: z.ZodNullable<z.ZodNumber>;
13912
13921
  __mj_CreatedAt: z.ZodDate;
13913
13922
  __mj_UpdatedAt: z.ZodDate;
13923
+ Configuration: z.ZodNullable<z.ZodString>;
13914
13924
  Category: z.ZodNullable<z.ZodString>;
13915
13925
  Entity: z.ZodString;
13916
13926
  Action: z.ZodNullable<z.ZodString>;
@@ -13933,12 +13943,13 @@ export declare const MJRecordProcessSchema: z.ZodObject<{
13933
13943
  Category?: string;
13934
13944
  AgentID?: string;
13935
13945
  Agent?: string;
13946
+ Configuration?: string;
13936
13947
  PromptID?: string;
13937
13948
  Prompt?: string;
13938
13949
  BatchSize?: number;
13939
13950
  ScheduleEnabled?: boolean;
13940
13951
  CronExpression?: string;
13941
- WorkType?: "Action" | "Agent" | "Infer";
13952
+ WorkType?: "Action" | "Agent" | "FieldRules" | "Infer";
13942
13953
  ScopeType?: "View" | "List" | "Filter" | "SingleRecord";
13943
13954
  ScopeViewID?: string;
13944
13955
  ScopeListID?: string;
@@ -13970,12 +13981,13 @@ export declare const MJRecordProcessSchema: z.ZodObject<{
13970
13981
  Category?: string;
13971
13982
  AgentID?: string;
13972
13983
  Agent?: string;
13984
+ Configuration?: string;
13973
13985
  PromptID?: string;
13974
13986
  Prompt?: string;
13975
13987
  BatchSize?: number;
13976
13988
  ScheduleEnabled?: boolean;
13977
13989
  CronExpression?: string;
13978
- WorkType?: "Action" | "Agent" | "Infer";
13990
+ WorkType?: "Action" | "Agent" | "FieldRules" | "Infer";
13979
13991
  ScopeType?: "View" | "List" | "Filter" | "SingleRecord";
13980
13992
  ScopeViewID?: string;
13981
13993
  ScopeListID?: string;
@@ -14056,6 +14068,9 @@ export declare const MJRemoteOperationSchema: z.ZodObject<{
14056
14068
  MaxConcurrency: z.ZodNullable<z.ZodNumber>;
14057
14069
  __mj_CreatedAt: z.ZodDate;
14058
14070
  __mj_UpdatedAt: z.ZodDate;
14071
+ CodeLocked: z.ZodBoolean;
14072
+ CodeComments: z.ZodNullable<z.ZodString>;
14073
+ Libraries: z.ZodNullable<z.ZodAny>;
14059
14074
  Category: z.ZodNullable<z.ZodString>;
14060
14075
  CodeApprovedByUser: z.ZodNullable<z.ZodString>;
14061
14076
  }, "strip", z.ZodTypeAny, {
@@ -14067,9 +14082,11 @@ export declare const MJRemoteOperationSchema: z.ZodObject<{
14067
14082
  Status?: "Active" | "Disabled" | "Pending";
14068
14083
  Code?: string;
14069
14084
  CategoryID?: string;
14085
+ CodeComments?: string;
14070
14086
  CodeApprovalStatus?: "Pending" | "Approved" | "Rejected";
14071
14087
  CodeApprovedByUserID?: string;
14072
14088
  CodeApprovedAt?: Date;
14089
+ CodeLocked?: boolean;
14073
14090
  Category?: string;
14074
14091
  CodeApprovedByUser?: string;
14075
14092
  ExecutionMode?: "Sync" | "LongRunning";
@@ -14087,6 +14104,7 @@ export declare const MJRemoteOperationSchema: z.ZodObject<{
14087
14104
  GenerationType?: "Default" | "Manual" | "AI";
14088
14105
  ContractFingerprint?: string;
14089
14106
  TimeoutMS?: number;
14107
+ Libraries?: any;
14090
14108
  }, {
14091
14109
  ID?: string;
14092
14110
  __mj_CreatedAt?: Date;
@@ -14096,9 +14114,11 @@ export declare const MJRemoteOperationSchema: z.ZodObject<{
14096
14114
  Status?: "Active" | "Disabled" | "Pending";
14097
14115
  Code?: string;
14098
14116
  CategoryID?: string;
14117
+ CodeComments?: string;
14099
14118
  CodeApprovalStatus?: "Pending" | "Approved" | "Rejected";
14100
14119
  CodeApprovedByUserID?: string;
14101
14120
  CodeApprovedAt?: Date;
14121
+ CodeLocked?: boolean;
14102
14122
  Category?: string;
14103
14123
  CodeApprovedByUser?: string;
14104
14124
  ExecutionMode?: "Sync" | "LongRunning";
@@ -14116,6 +14136,7 @@ export declare const MJRemoteOperationSchema: z.ZodObject<{
14116
14136
  GenerationType?: "Default" | "Manual" | "AI";
14117
14137
  ContractFingerprint?: string;
14118
14138
  TimeoutMS?: number;
14139
+ Libraries?: any;
14119
14140
  }>;
14120
14141
  export type MJRemoteOperationEntityType = z.infer<typeof MJRemoteOperationSchema>;
14121
14142
  /**
@@ -45130,6 +45151,14 @@ export declare class MJEntityActionInvocationEntity extends BaseEntity<MJEntityA
45130
45151
  */
45131
45152
  get __mj_UpdatedAt(): Date;
45132
45153
  /**
45154
+ * * Field Name: RuntimeUXDriverClass
45155
+ * * Display Name: Runtime UX Driver Class
45156
+ * * SQL Data Type: nvarchar(255)
45157
+ * * Description: Optional class name of a registered runtime-UX driver component (a BaseEntityActionRuntimeUX subclass resolved via MJGlobal.ClassFactory) that owns this invocation's interaction — parameter collection, dry-run preview, confirmation, and progress. NULL invokes the action directly with no custom UX. This lets any action opt into a richer, reusable runtime experience while the grid/toolbar stays operation-agnostic.
45158
+ */
45159
+ get RuntimeUXDriverClass(): string | null;
45160
+ set RuntimeUXDriverClass(value: string | null);
45161
+ /**
45133
45162
  * * Field Name: EntityAction
45134
45163
  * * Display Name: Entity Action Name
45135
45164
  * * SQL Data Type: nvarchar(425)
@@ -54249,6 +54278,14 @@ export declare class MJOpenAppEntity extends BaseEntity<MJOpenAppEntityType> {
54249
54278
  */
54250
54279
  get __mj_UpdatedAt(): Date;
54251
54280
  /**
54281
+ * * Field Name: Subpath
54282
+ * * Display Name: Subpath
54283
+ * * SQL Data Type: nvarchar(500)
54284
+ * * Description: In-repo subdirectory the app was installed from for multi-app repositories (e.g. 'CRM/HubSpot'). NULL when the app's mj-app.json is at the repository root.
54285
+ */
54286
+ get Subpath(): string | null;
54287
+ set Subpath(value: string | null);
54288
+ /**
54252
54289
  * * Field Name: InstalledByUser
54253
54290
  * * Display Name: Installed By User
54254
54291
  * * SQL Data Type: nvarchar(100)
@@ -54979,7 +55016,7 @@ export declare class MJProcessRunEntity extends BaseEntity<MJProcessRunEntityTyp
54979
55016
  set CancellationRequested(value: boolean);
54980
55017
  /**
54981
55018
  * * Field Name: Configuration
54982
- * * Display Name: Configuration
55019
+ * * Display Name: Configuration JSON
54983
55020
  * * SQL Data Type: nvarchar(MAX)
54984
55021
  * * Description: JSON snapshot of the effective configuration for this run
54985
55022
  */
@@ -55017,6 +55054,15 @@ export declare class MJProcessRunEntity extends BaseEntity<MJProcessRunEntityTyp
55017
55054
  */
55018
55055
  get __mj_UpdatedAt(): Date;
55019
55056
  /**
55057
+ * * Field Name: DryRun
55058
+ * * Display Name: Is Dry Run
55059
+ * * SQL Data Type: bit
55060
+ * * Default Value: 0
55061
+ * * Description: When 1, this run was a dry-run (compute-only) preview: the per-record diffs were computed and persisted as Process Run Details, but no changes were written back to the target records. When 0, the run applied its changes.
55062
+ */
55063
+ get DryRun(): boolean;
55064
+ set DryRun(value: boolean);
55065
+ /**
55020
55066
  * * Field Name: RecordProcess
55021
55067
  * * Display Name: Record Process Name
55022
55068
  * * SQL Data Type: nvarchar(255)
@@ -58295,11 +58341,12 @@ export declare class MJRecordProcessEntity extends BaseEntity<MJRecordProcessEnt
58295
58341
  * * Possible Values
58296
58342
  * * Action
58297
58343
  * * Agent
58344
+ * * FieldRules
58298
58345
  * * Infer
58299
58346
  * * Description: Whether the work is an Action, an Agent, or an Infer (per-record AI Prompt). Agents are dispatched through the Execute Agent action and must be top-level + ExposeAsAction; Infer runs the AI Prompt named by PromptID for each record and writes its structured output back via OutputMapping.
58300
58347
  */
58301
- get WorkType(): 'Action' | 'Agent' | 'Infer';
58302
- set WorkType(value: 'Action' | 'Agent' | 'Infer');
58348
+ get WorkType(): 'Action' | 'Agent' | 'FieldRules' | 'Infer';
58349
+ set WorkType(value: 'Action' | 'Agent' | 'FieldRules' | 'Infer');
58303
58350
  /**
58304
58351
  * * Field Name: ActionID
58305
58352
  * * Display Name: Action
@@ -58504,44 +58551,52 @@ export declare class MJRecordProcessEntity extends BaseEntity<MJRecordProcessEnt
58504
58551
  */
58505
58552
  get __mj_UpdatedAt(): Date;
58506
58553
  /**
58554
+ * * Field Name: Configuration
58555
+ * * Display Name: Configuration
58556
+ * * SQL Data Type: nvarchar(MAX)
58557
+ * * Description: JSON configuration for the process's work, used by work types that need structured config beyond Input/Output mappings. For WorkType='FieldRules' this holds the serialized FieldRuleSet (the rules applied to each record). NULL for work types that do not use it.
58558
+ */
58559
+ get Configuration(): string | null;
58560
+ set Configuration(value: string | null);
58561
+ /**
58507
58562
  * * Field Name: Category
58508
- * * Display Name: Category (Display)
58563
+ * * Display Name: Category Name
58509
58564
  * * SQL Data Type: nvarchar(255)
58510
58565
  */
58511
58566
  get Category(): string | null;
58512
58567
  /**
58513
58568
  * * Field Name: Entity
58514
- * * Display Name: Entity (Display)
58569
+ * * Display Name: Entity Name
58515
58570
  * * SQL Data Type: nvarchar(255)
58516
58571
  */
58517
58572
  get Entity(): string;
58518
58573
  /**
58519
58574
  * * Field Name: Action
58520
- * * Display Name: Action (Display)
58575
+ * * Display Name: Action Name
58521
58576
  * * SQL Data Type: nvarchar(425)
58522
58577
  */
58523
58578
  get Action(): string | null;
58524
58579
  /**
58525
58580
  * * Field Name: Agent
58526
- * * Display Name: Agent (Display)
58581
+ * * Display Name: Agent Name
58527
58582
  * * SQL Data Type: nvarchar(255)
58528
58583
  */
58529
58584
  get Agent(): string | null;
58530
58585
  /**
58531
58586
  * * Field Name: Prompt
58532
- * * Display Name: Prompt (Display)
58587
+ * * Display Name: Prompt Name
58533
58588
  * * SQL Data Type: nvarchar(255)
58534
58589
  */
58535
58590
  get Prompt(): string | null;
58536
58591
  /**
58537
58592
  * * Field Name: ScopeView
58538
- * * Display Name: Scope View (Display)
58593
+ * * Display Name: Scope View Name
58539
58594
  * * SQL Data Type: nvarchar(100)
58540
58595
  */
58541
58596
  get ScopeView(): string | null;
58542
58597
  /**
58543
58598
  * * Field Name: ScopeList
58544
- * * Display Name: Scope List (Display)
58599
+ * * Display Name: Scope List Name
58545
58600
  * * SQL Data Type: nvarchar(100)
58546
58601
  */
58547
58602
  get ScopeList(): string | null;
@@ -58630,6 +58685,19 @@ export declare class MJRemoteOperationCategoryEntity extends BaseEntity<MJRemote
58630
58685
  */
58631
58686
  get RootParentID(): string | null;
58632
58687
  }
58688
+ /**
58689
+ * One library that an AI-authored Remote Operation body imports. CodeGen turns the `LibrariesObject` array
58690
+ * (the strongly-typed accessor bound to `MJ: Remote Operations.Libraries` via JSONType metadata) into one
58691
+ * `import { ...ItemsUsed } from "Library"` per entry at the top of the generated `remote_operations.ts`.
58692
+ * The always-available default libraries (RunView / Metadata / RunQuery from @memberjunction/core) are NOT
58693
+ * listed here — they are emitted for every operation automatically.
58694
+ */
58695
+ export interface MJRemoteOperationEntity_RemoteOperationLibrary {
58696
+ /** The npm package to import from, e.g. "@memberjunction/ai-prompts". */
58697
+ Library: string;
58698
+ /** The exported items used from that package, e.g. ["AIPromptRunner"]. */
58699
+ ItemsUsed: string[];
58700
+ }
58633
58701
  /**
58634
58702
  * MJ: Remote Operations - strongly typed entity sub-class
58635
58703
  * * Schema: __mj
@@ -58713,7 +58781,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58713
58781
  set InputTypeDefinition(value: string | null);
58714
58782
  /**
58715
58783
  * * Field Name: InputTypeIsArray
58716
- * * Display Name: Is Input Array
58784
+ * * Display Name: Input Is Array
58717
58785
  * * SQL Data Type: bit
58718
58786
  * * Default Value: 0
58719
58787
  * * Description: When 1, the input type is emitted as an array (TInput[])
@@ -58738,7 +58806,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58738
58806
  set OutputTypeDefinition(value: string | null);
58739
58807
  /**
58740
58808
  * * Field Name: OutputTypeIsArray
58741
- * * Display Name: Is Output Array
58809
+ * * Display Name: Output Is Array
58742
58810
  * * SQL Data Type: bit
58743
58811
  * * Default Value: 0
58744
58812
  * * Description: When 1, the output type is emitted as an array (TOutput[])
@@ -58791,7 +58859,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58791
58859
  set GenerationType(value: 'AI' | 'Default' | 'Manual');
58792
58860
  /**
58793
58861
  * * Field Name: Code
58794
- * * Display Name: Implementation Code
58862
+ * * Display Name: Code
58795
58863
  * * SQL Data Type: nvarchar(MAX)
58796
58864
  * * Description: The AI-generated implementation body (when GenerationType=AI); regenerated only when Description changes
58797
58865
  */
@@ -58799,7 +58867,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58799
58867
  set Code(value: string | null);
58800
58868
  /**
58801
58869
  * * Field Name: CodeApprovalStatus
58802
- * * Display Name: Approval Status
58870
+ * * Display Name: Code Approval Status
58803
58871
  * * SQL Data Type: nvarchar(20)
58804
58872
  * * Default Value: Pending
58805
58873
  * * Value List Type: List
@@ -58813,7 +58881,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58813
58881
  set CodeApprovalStatus(value: 'Approved' | 'Pending' | 'Rejected');
58814
58882
  /**
58815
58883
  * * Field Name: CodeApprovedByUserID
58816
- * * Display Name: Approved By User ID
58884
+ * * Display Name: Code Approved By User ID
58817
58885
  * * SQL Data Type: uniqueidentifier
58818
58886
  * * Related Entity/Foreign Key: MJ: Users (vwUsers.ID)
58819
58887
  * * Description: Foreign key to the user who approved the generated code
@@ -58822,7 +58890,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58822
58890
  set CodeApprovedByUserID(value: string | null);
58823
58891
  /**
58824
58892
  * * Field Name: CodeApprovedAt
58825
- * * Display Name: Approved At
58893
+ * * Display Name: Code Approved At
58826
58894
  * * SQL Data Type: datetimeoffset
58827
58895
  * * Description: When the generated code was approved
58828
58896
  */
@@ -58889,6 +58957,40 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58889
58957
  */
58890
58958
  get __mj_UpdatedAt(): Date;
58891
58959
  /**
58960
+ * * Field Name: CodeLocked
58961
+ * * Display Name: Code Locked
58962
+ * * SQL Data Type: bit
58963
+ * * Default Value: 0
58964
+ * * Description: When 1, the AI-generated Code is frozen and Save() will not regenerate it even if Description changes (the Generated-Actions CodeLocked analog). Default 0.
58965
+ */
58966
+ get CodeLocked(): boolean;
58967
+ set CodeLocked(value: boolean);
58968
+ /**
58969
+ * * Field Name: CodeComments
58970
+ * * Display Name: Code Comments
58971
+ * * SQL Data Type: nvarchar(MAX)
58972
+ * * Description: The model's explanation / comments for the AI-generated Code (populated alongside Code when GenerationType=AI). Human-facing review aid.
58973
+ */
58974
+ get CodeComments(): string | null;
58975
+ set CodeComments(value: string | null);
58976
+ /**
58977
+ * * Field Name: Libraries
58978
+ * * Display Name: Libraries
58979
+ * * SQL Data Type: nvarchar(MAX)
58980
+ * * JSON Type: Array<MJRemoteOperationEntity_RemoteOperationLibrary>
58981
+ * * Description: JSON array of the libraries the generated body imports: [{ "Library": "@memberjunction/ai-prompts", "ItemsUsed": ["AIPromptRunner"] }, ...]. Bound to the RemoteOperationLibrary JSONType via metadata sync so CodeGen emits a typed LibrariesObject accessor; CodeGen uses it to emit the imports at the top of the generated remote_operations.ts. NULL/empty = only the default always-available libraries are imported.
58982
+ */
58983
+ get Libraries(): string | null;
58984
+ set Libraries(value: string | null);
58985
+ private _LibrariesObject_cached;
58986
+ private _LibrariesObject_lastRaw;
58987
+ /**
58988
+ * Typed accessor for Libraries — returns parsed JSON as Array<MJRemoteOperationEntity_RemoteOperationLibrary>.
58989
+ * Uses lazy parsing with cache invalidation when the underlying raw value changes.
58990
+ */
58991
+ get LibrariesObject(): Array<MJRemoteOperationEntity_RemoteOperationLibrary> | null;
58992
+ set LibrariesObject(value: Array<MJRemoteOperationEntity_RemoteOperationLibrary> | null);
58993
+ /**
58892
58994
  * * Field Name: Category
58893
58995
  * * Display Name: Category Name
58894
58996
  * * SQL Data Type: nvarchar(255)
@@ -58896,7 +58998,7 @@ export declare class MJRemoteOperationEntity extends BaseEntity<MJRemoteOperatio
58896
58998
  get Category(): string | null;
58897
58999
  /**
58898
59000
  * * Field Name: CodeApprovedByUser
58899
- * * Display Name: Approved By User
59001
+ * * Display Name: Code Approved By User
58900
59002
  * * SQL Data Type: nvarchar(100)
58901
59003
  */
58902
59004
  get CodeApprovedByUser(): string | null;