@memberjunction/core 6.3.0-edge.0 → 6.3.0-edge.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/generic/QueryCache.d.ts +2 -2
  2. package/dist/generic/QueryCache.d.ts.map +1 -1
  3. package/dist/generic/QueryCache.js +12 -7
  4. package/dist/generic/QueryCache.js.map +1 -1
  5. package/dist/generic/baseEngine.d.ts +9 -0
  6. package/dist/generic/baseEngine.d.ts.map +1 -1
  7. package/dist/generic/baseEngine.js +23 -1
  8. package/dist/generic/baseEngine.js.map +1 -1
  9. package/dist/generic/baseEngineRegistry.d.ts +8 -0
  10. package/dist/generic/baseEngineRegistry.d.ts.map +1 -1
  11. package/dist/generic/baseEngineRegistry.js +28 -10
  12. package/dist/generic/baseEngineRegistry.js.map +1 -1
  13. package/dist/generic/baseEntity.d.ts +69 -3
  14. package/dist/generic/baseEntity.d.ts.map +1 -1
  15. package/dist/generic/baseEntity.js +141 -53
  16. package/dist/generic/baseEntity.js.map +1 -1
  17. package/dist/generic/baseRemotableOperation.d.ts +17 -0
  18. package/dist/generic/baseRemotableOperation.d.ts.map +1 -1
  19. package/dist/generic/baseRemotableOperation.js +18 -0
  20. package/dist/generic/baseRemotableOperation.js.map +1 -1
  21. package/dist/generic/constraintErrorRedaction.d.ts +26 -0
  22. package/dist/generic/constraintErrorRedaction.d.ts.map +1 -0
  23. package/dist/generic/constraintErrorRedaction.js +166 -0
  24. package/dist/generic/constraintErrorRedaction.js.map +1 -0
  25. package/dist/generic/dataHooks.d.ts +27 -3
  26. package/dist/generic/dataHooks.d.ts.map +1 -1
  27. package/dist/generic/dataHooks.js +82 -0
  28. package/dist/generic/dataHooks.js.map +1 -1
  29. package/dist/generic/databaseProviderBase.d.ts +69 -7
  30. package/dist/generic/databaseProviderBase.d.ts.map +1 -1
  31. package/dist/generic/databaseProviderBase.js +230 -38
  32. package/dist/generic/databaseProviderBase.js.map +1 -1
  33. package/dist/generic/entityInfo.d.ts +56 -6
  34. package/dist/generic/entityInfo.d.ts.map +1 -1
  35. package/dist/generic/entityInfo.js +200 -50
  36. package/dist/generic/entityInfo.js.map +1 -1
  37. package/dist/generic/entitySavePlan.d.ts +6 -0
  38. package/dist/generic/entitySavePlan.d.ts.map +1 -1
  39. package/dist/generic/entitySavePlan.js +145 -1
  40. package/dist/generic/entitySavePlan.js.map +1 -1
  41. package/dist/generic/entityValueFieldSecurity.d.ts.map +1 -1
  42. package/dist/generic/entityValueFieldSecurity.js +1 -0
  43. package/dist/generic/entityValueFieldSecurity.js.map +1 -1
  44. package/dist/generic/interfaces.d.ts +69 -18
  45. package/dist/generic/interfaces.d.ts.map +1 -1
  46. package/dist/generic/interfaces.js +9 -9
  47. package/dist/generic/interfaces.js.map +1 -1
  48. package/dist/generic/limitsConfig.d.ts +577 -0
  49. package/dist/generic/limitsConfig.d.ts.map +1 -0
  50. package/dist/generic/limitsConfig.js +1126 -0
  51. package/dist/generic/limitsConfig.js.map +1 -0
  52. package/dist/generic/localCacheManager.d.ts +10 -13
  53. package/dist/generic/localCacheManager.d.ts.map +1 -1
  54. package/dist/generic/localCacheManager.js +189 -67
  55. package/dist/generic/localCacheManager.js.map +1 -1
  56. package/dist/generic/metadata.d.ts +4 -4
  57. package/dist/generic/metadata.d.ts.map +1 -1
  58. package/dist/generic/metadata.js +4 -4
  59. package/dist/generic/metadata.js.map +1 -1
  60. package/dist/generic/providerBase.d.ts +242 -12
  61. package/dist/generic/providerBase.d.ts.map +1 -1
  62. package/dist/generic/providerBase.js +744 -101
  63. package/dist/generic/providerBase.js.map +1 -1
  64. package/dist/generic/queryResultEnricher.d.ts +4 -1
  65. package/dist/generic/queryResultEnricher.d.ts.map +1 -1
  66. package/dist/generic/queryResultEnricher.js.map +1 -1
  67. package/dist/generic/queryTemplateContext.d.ts.map +1 -1
  68. package/dist/generic/queryTemplateContext.js +38 -3
  69. package/dist/generic/queryTemplateContext.js.map +1 -1
  70. package/dist/generic/relatedRecordCollection.d.ts +20 -0
  71. package/dist/generic/relatedRecordCollection.d.ts.map +1 -1
  72. package/dist/generic/relatedRecordCollection.js +257 -22
  73. package/dist/generic/relatedRecordCollection.js.map +1 -1
  74. package/dist/generic/securityInfo.d.ts +56 -2
  75. package/dist/generic/securityInfo.d.ts.map +1 -1
  76. package/dist/generic/securityInfo.js +141 -12
  77. package/dist/generic/securityInfo.js.map +1 -1
  78. package/dist/generic/telemetryManager.d.ts +40 -4
  79. package/dist/generic/telemetryManager.d.ts.map +1 -1
  80. package/dist/generic/telemetryManager.js +68 -15
  81. package/dist/generic/telemetryManager.js.map +1 -1
  82. package/dist/generic/transactionGroup.d.ts +41 -23
  83. package/dist/generic/transactionGroup.d.ts.map +1 -1
  84. package/dist/generic/transactionGroup.js +133 -70
  85. package/dist/generic/transactionGroup.js.map +1 -1
  86. package/dist/index.d.ts +3 -1
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +3 -1
  89. package/dist/index.js.map +1 -1
  90. package/dist/tsconfig.tsbuildinfo +1 -0
  91. package/dist/views/decisionReadGuard.d.ts +143 -0
  92. package/dist/views/decisionReadGuard.d.ts.map +1 -0
  93. package/dist/views/decisionReadGuard.js +220 -0
  94. package/dist/views/decisionReadGuard.js.map +1 -0
  95. package/dist/views/runView.d.ts +8 -0
  96. package/dist/views/runView.d.ts.map +1 -1
  97. package/dist/views/runView.js +20 -3
  98. package/dist/views/runView.js.map +1 -1
  99. package/package.json +3 -3
  100. package/readme.md +6 -5
  101. package/dist/generic/typedQuery.d.ts +0 -151
  102. package/dist/generic/typedQuery.d.ts.map +0 -1
  103. package/dist/generic/typedQuery.js +0 -286
  104. package/dist/generic/typedQuery.js.map +0 -1
@@ -0,0 +1,577 @@
1
+ /**
2
+ * @fileoverview Centralized, strongly-typed `limits` configuration contract and 5-tier
3
+ * hierarchical resolver (`LimitsConfigResolver`).
4
+ *
5
+ * Pure and browser-safe (no Node-specific `fs` / `cosmiconfig` imports): hosts load `mj.config.cjs`
6
+ * outside `@memberjunction/core` and pass its `limits` object into {@link LimitsConfigResolver.Resolve}
7
+ * or register it once at startup via {@link LimitsConfigResolver.RegisterMjConfigLimits}.
8
+ *
9
+ * Precedence order (lowest -> highest):
10
+ * 1. `CodeFallback`
11
+ * 2. `MjConfig` (`mj.config.cjs` `limits` section)
12
+ * 3. `AgentOrWorkflowMetadata` (Agent or workflow metadata overrides)
13
+ * 4. `UserAgentPolicy` (User's agent policy overrides)
14
+ * 5. `RunOverride` (Individual run overrides)
15
+ *
16
+ * @module @memberjunction/core
17
+ */
18
+ import { BaseSingleton } from '@memberjunction/global';
19
+ import type { IMetadataProvider } from './interfaces.js';
20
+ import type { UserInfo } from './securityInfo.js';
21
+ /**
22
+ * Precedence tier identifiers for limits resolution, ordered from lowest (`CodeFallback`)
23
+ * to highest (`RunOverride`).
24
+ */
25
+ export type LimitsSourceTier = 'CodeFallback' | 'MjConfig' | 'AgentOrWorkflowMetadata' | 'UserAgentPolicy' | 'RunOverride';
26
+ /**
27
+ * Canonical 5-tier precedence chain from lowest to highest priority.
28
+ */
29
+ export declare const LIMITS_TIER_PRECEDENCE: readonly LimitsSourceTier[];
30
+ /**
31
+ * Fallback action when the sub-200ms fast convergence judge times out, errors, or returns invalid output.
32
+ */
33
+ export type FastJudgeFailureFallbackMode = 'ContinueWithWarning' | 'PauseForHuman';
34
+ /**
35
+ * Supported execution isolation levels for task graphs and persisted workflows (`AIAgent.Isolation`).
36
+ * Alphabetically ordered union matches CodeGen entity value-list generation.
37
+ */
38
+ export type TaskGraphIsolationLevel = 'Container' | 'InProcess' | 'Process' | 'Worker';
39
+ /**
40
+ * Ordered list of valid {@link TaskGraphIsolationLevel} values.
41
+ */
42
+ export declare const TASK_GRAPH_ISOLATION_LEVELS: readonly TaskGraphIsolationLevel[];
43
+ /**
44
+ * Runtime type guard verifying whether an untyped value is a valid {@link TaskGraphIsolationLevel}.
45
+ */
46
+ export declare function IsTaskGraphIsolationLevel(value: unknown): value is TaskGraphIsolationLevel;
47
+ /**
48
+ * Execution isolation defaults and resource-containment guard settings for task graphs and workflows.
49
+ */
50
+ export interface MJLimitsIsolationConfig {
51
+ /** Default isolation mode for existing or unspecified workflows (`'InProcess'` for safe upgrade compatibility). */
52
+ DefaultIsolation: TaskGraphIsolationLevel;
53
+ /** Default isolation mode applied to newly drafted workflows authored via `Workflow.Draft` (`'Worker'`). */
54
+ DraftDefaultIsolation: TaskGraphIsolationLevel;
55
+ /** V8 max old-generation heap ceiling (MB) passed to `worker_threads` `resourceLimits` in `'Worker'` mode. */
56
+ WorkerMaxOldGenerationSizeMb: number;
57
+ /** V8 max young-generation heap ceiling (MB) passed to `worker_threads` `resourceLimits` in `'Worker'` mode. */
58
+ WorkerMaxYoungGenerationSizeMb: number;
59
+ /** Maximum wall-clock execution timeout (ms) for `'Worker'` mode step execution. */
60
+ WorkerTimeoutMs: number;
61
+ /** OS memory ceiling (MB) enforced for `'Process'` mode (`child_process`) execution. */
62
+ ProcessMaxMemoryMb: number;
63
+ /** Maximum wall-clock execution timeout (ms) for `'Process'` mode (`child_process`) execution. */
64
+ ProcessTimeoutMs: number;
65
+ /** Container memory limit (MB) passed to container runtime (`--memory`) in `'Container'` mode. */
66
+ ContainerMemoryMb: number;
67
+ /** Container CPU quota (logical vCPUs) passed to container runtime (`--cpus`) in `'Container'` mode. */
68
+ ContainerCpuQuota: number;
69
+ /** Maximum wall-clock execution timeout (ms) for `'Container'` mode execution. */
70
+ ContainerTimeoutMs: number;
71
+ /** Default OCI image reference used by the `'Container'` isolation runner. */
72
+ ContainerImage: string;
73
+ /** Container runtime binary (`'docker'` | `'podman'`) used by the `'Container'` isolation runner. */
74
+ ContainerRuntime: string;
75
+ }
76
+ /**
77
+ * Queue dispatch, bounded `Enqueue` fan-out concurrency, isolated runner backpressure,
78
+ * redelivery retry caps, and caller notification retention limits for queued TaskGraphs.
79
+ */
80
+ export interface MJLimitsTaskGraphQueueConfig {
81
+ /** Default WorkQueue topic used when `TaskGraph.Submit` runs with `Dispatch: 'Queue'`. */
82
+ GraphDispatchTopicName: string;
83
+ /** Default WorkQueue topic used by `Enqueue` steps when no explicit topic is supplied. */
84
+ DefaultEnqueueTopicName: string;
85
+ /** Bounded concurrent WorkQueue publish operations permitted during `ForEach` + `Enqueue` fan-out. */
86
+ MaxEnqueuePublishConcurrency: number;
87
+ /** Batch size for WorkQueue publishes inside `ForEach` + `Enqueue` fan-out. */
88
+ EnqueuePublishBatchSize: number;
89
+ /** Bounded concurrent active isolated runners executing queued graph/step work items per host. */
90
+ MaxConcurrentIsolatedRunners: number;
91
+ /** Hard safety ceiling on items emitted by a single `ForEach` + `Enqueue` fan-out. */
92
+ MaxEnqueueItemsPerFanOut: number;
93
+ /** Maximum delivery/retry attempts before a queued step/item transitions to terminal failure. */
94
+ MaxEnqueueRedeliveryAttempts: number;
95
+ /** Maximum publish retry attempts when WorkQueue transport publish fails transiently. */
96
+ EnqueuePublishRetryAttempts: number;
97
+ /** Retention window (ms) for recovering unacknowledged terminal caller notifications across restarts. */
98
+ CallerNotificationRetentionMs: number;
99
+ }
100
+ /**
101
+ * Dollar USD and wall-clock time budget ceilings for a single scope.
102
+ */
103
+ export interface MJLimitsScopeBudget {
104
+ /** Maximum dollar cost in USD for this scope; `null` means no dollar ceiling at this scope. */
105
+ MaxCostUsd: number | null;
106
+ /** Maximum wall-clock duration in milliseconds for this scope; `null` means no time ceiling at this scope. */
107
+ MaxWallClockMs: number | null;
108
+ }
109
+ /**
110
+ * Budget ceilings for an individual agent or workflow run.
111
+ */
112
+ export interface MJLimitsRunScopeBudget extends MJLimitsScopeBudget {
113
+ /** Maximum total tokens (prompt + completion) for a single run; `null` means no token ceiling. */
114
+ MaxTokens: number | null;
115
+ }
116
+ /**
117
+ * Daily per-user cumulative budget ceilings across all runs.
118
+ */
119
+ export interface MJLimitsUserDailyScopeBudget extends MJLimitsScopeBudget {
120
+ /** IANA timezone or `'UTC'` governing the daily reset boundary. */
121
+ DayBoundaryTimezone: string;
122
+ }
123
+ /**
124
+ * Multi-scope dollar and wall-clock budget configuration and accounting rules.
125
+ */
126
+ export interface MJLimitsBudgetsConfig {
127
+ /** Budget ceilings applied to an individual run. */
128
+ PerRun: MJLimitsRunScopeBudget;
129
+ /** Cumulative budget ceilings applied across runs of a routine or scheduled workflow. */
130
+ PerRoutine: MJLimitsScopeBudget;
131
+ /** Cumulative daily budget ceilings applied per user across all runs. */
132
+ PerUserPerDay: MJLimitsUserDailyScopeBudget;
133
+ /** Whether time spent paused awaiting human approval counts toward wall-clock budgets. */
134
+ CountPausedTimeTowardsWallClock: boolean;
135
+ /** Bounded USD tolerance allowed for in-flight billable calls already started before pause. */
136
+ AllowedInFlightOvershootUsd: number;
137
+ /** Bounded wall-clock ms tolerance allowed for in-flight operations before pause. */
138
+ AllowedInFlightOvershootMs: number;
139
+ }
140
+ /**
141
+ * Deterministic sliding-window progress detector and fast convergence judge thresholds.
142
+ */
143
+ export interface MJLimitsProgressDetectorConfig {
144
+ /** Master switch for deterministic sliding-window progress detection. */
145
+ Enabled: boolean;
146
+ /** Number of recent iterations evaluated per sliding progress window. */
147
+ WindowSize: number;
148
+ /** Minimum iterations before progress stall checks trigger. */
149
+ MinIterationsBeforeCheck: number;
150
+ /** Fraction (`0..1`) of repeated identical steps in a window signaling low progress. */
151
+ DuplicateStepRatioThreshold: number;
152
+ /** Consecutive iterations with zero meaningful payload delta before signaling stall. */
153
+ NoPayloadDeltaWindowCount: number;
154
+ /** Consecutive repeating identical error signatures before signaling stall. */
155
+ RepeatingErrorWindowCount: number;
156
+ /** Deterministic progress score (`0..1`) strictly below which a run is treated as stalled. */
157
+ AmbiguityLowScoreThreshold: number;
158
+ /** Deterministic progress score (`0..1`) at or above which a run is clearly making progress. */
159
+ AmbiguityHighScoreThreshold: number;
160
+ /** Whether the sub-200ms fast convergence judge runs when deterministic signals are ambiguous. */
161
+ FastJudgeEnabled: boolean;
162
+ /** Deadline in milliseconds for the fast convergence judge invocation (default `200`). */
163
+ FastJudgeTimeoutMs: number;
164
+ /** Minimum iterations between consecutive fast judge invocations to bound judge cost. */
165
+ FastJudgeMinIntervalIterations: number;
166
+ /** Maximum input characters serialized to the fast judge per invocation. */
167
+ FastJudgeMaxInputChars: number;
168
+ /** Fallback policy when the fast judge times out, errors, or returns invalid output. */
169
+ FastJudgeFailureFallback: FastJudgeFailureFallbackMode;
170
+ }
171
+ /**
172
+ * Bounded resource, retry, depth, and concurrency guard ceilings resolved at current defaults.
173
+ */
174
+ export interface MJLimitsResourceGuardsConfig {
175
+ /** Maximum validation retries before forcing failure. */
176
+ MaxValidationRetries: number;
177
+ /** Maximum consecutive failed (non-terminating) steps before forcing termination. */
178
+ MaxConsecutiveFailedSteps: number;
179
+ /** Maximum consecutive unproductive retry steps before forcing termination. */
180
+ MaxConsecutiveUnproductiveRetries: number;
181
+ /** Maximum identical failing step repetitions before forcing termination. */
182
+ MaxRepeatedFailingStep: number;
183
+ /** Maximum consecutive inline read-tool preemptions before honoring terminal step. */
184
+ MaxConsecutiveReadToolPreemptions: number;
185
+ /** Maximum retries for final payload schema validation failures. */
186
+ FinalPayloadValidationMaxRetries: number;
187
+ /** Maximum ancestor chain hops when validating a run's `lastRunId` lineage. */
188
+ MaxRunChainLength: number;
189
+ /** Maximum recursive tree depth loaded for an AI Agent Run tree. */
190
+ MaxAgentRunTreeDepth: number;
191
+ /** Maximum agent-to-agent handoffs permitted within a single user turn. */
192
+ MaxHandoffHops: number;
193
+ /** Default maximum consultation rounds per parent/sub-agent pair. */
194
+ MaxSubAgentConsultRounds: number;
195
+ /** Maximum decision requests answered per agent turn. */
196
+ MaxDecisionRequestsPerTurn: number;
197
+ /** Maximum total decision calls executed per agent turn. */
198
+ MaxDecisionCallsPerTurn: number;
199
+ /** Maximum conversation tool calls executed per LLM turn. */
200
+ MaxConversationToolCallsPerTurn: number;
201
+ /** Maximum consecutive settlement retry passes on a task graph. */
202
+ MaxSettlementRetryPasses: number;
203
+ /** Maximum continuation re-invocation depth across task graphs. */
204
+ MaxReinvokeDepth: number;
205
+ /** Maximum inline provider signal raise attempts per waiting step. */
206
+ MaxProviderRaiseAttempts: number;
207
+ /** Default timeout in milliseconds for client tool executions. */
208
+ ClientToolTimeoutMs: number;
209
+ /** Default deadline in milliseconds for pipeline executions. */
210
+ PipelineDeadlineMs: number;
211
+ /** Maximum stages permitted in a single pipeline execution. */
212
+ MaxPipelineStages: number;
213
+ /** Maximum collection elements expanded by pipeline map stages. */
214
+ MaxMapElements: number;
215
+ /** Default maximum concurrency for parallel ForEach loops. */
216
+ MaxLoopConcurrency: number;
217
+ /** Default maximum consecutive agent turns in realtime voice rooms. */
218
+ MaxRealtimeConsecutiveAgentTurns: number;
219
+ }
220
+ /**
221
+ * Operational tuning knobs for caching, compaction, candidate narrowing, and batching.
222
+ */
223
+ export interface MJLimitsTuningConfig {
224
+ /** Maximum cached preloaded entries per agent. */
225
+ MaxPerAgentCacheEntries: number;
226
+ /** Maximum concurrent client tool sessions tracked in memory. */
227
+ MaxClientToolSessions: number;
228
+ /** Maximum tools retained per client tool session. */
229
+ MaxToolsPerSession: number;
230
+ /** Fallback model context token limit for conversation compaction. */
231
+ CompactionDefaultContextTokens: number;
232
+ /** Default context utilization percentage triggering compaction. */
233
+ CompactionDefaultTriggerPercent: number;
234
+ /** Default target context utilization percentage after compaction. */
235
+ CompactionDefaultTargetPercent: number;
236
+ /** Minimum projected token gain required before running compaction. */
237
+ CompactionMinGainTokens: number;
238
+ /** Minimum message count required before attempting compaction. */
239
+ CompactionMinMessages: number;
240
+ /** Maximum character budget for delta messages during compaction. */
241
+ CompactionMaxDeltaMessageChars: number;
242
+ /** Default maximum skill decision candidates injected into prompt context. */
243
+ MaxSkillDecisionCandidates: number;
244
+ /** Maximum handoff candidates serialized into prompt context. */
245
+ MaxHandoffCandidates: number;
246
+ /** Default maximum entries in QueryCache. */
247
+ QueryCacheDefaultMaxSize: number;
248
+ /** Default cache TTL in minutes for QueryCache. */
249
+ QueryCacheDefaultTtlMinutes: number;
250
+ /** Default maximum tasks retained in an agent scratchpad. */
251
+ ScratchpadMaxTasks: number;
252
+ /** Default maximum items processed per decision request. */
253
+ DecisionsMaxItems: number;
254
+ /** Maximum initial operations accepted in a single artifact batch request. */
255
+ MaxInitialArtifactOperations: number;
256
+ /** Maximum IDs placed in a direct SQL `IN (...)` clause for artifact queries. */
257
+ MaxDirectInIds: number;
258
+ /** Maximum assignable agents offered in workflow draft prompts. */
259
+ MaxAgentsOfferedInDraft: number;
260
+ /** Maximum waiting steps scanned per signal dispatch. */
261
+ MaxStepsPerSignal: number;
262
+ }
263
+ /**
264
+ * Complete resolved configuration surface for MemberJunction execution limits, backstops,
265
+ * budgets, briefing bounds, progress detection, resource guards, and tuning knobs.
266
+ */
267
+ export interface MJLimitsConfig {
268
+ /** Maximum consecutive agent turns in an Agent Channel before pausing for a human. */
269
+ AgentChannelConsecutiveTurns: number;
270
+ /** Maximum peer-agent wakes per hour in an Agent Channel. */
271
+ AgentChannelWakesPerHour: number;
272
+ /** System-wide absolute safety net on prompt iterations per agent run. */
273
+ AgentAbsoluteIterations: number;
274
+ /** Maximum nodes in a model-authored task graph (`MAX_TASKS_PER_AGENT_GRAPH`). */
275
+ MaxTasksPerAgentGraph: number;
276
+ /** Default maximum iterations for While loop operations. */
277
+ WhileLoopMaxIterations: number;
278
+ /** Default maximum iterations for ForEach loop operations. */
279
+ ForEachMaxIterations: number;
280
+ /** Blast-radius ceiling on nodes in any submitted task graph (`MAX_TASKS_PER_GRAPH`). */
281
+ MaxTasksPerGraph: number;
282
+ /** Timeout in milliseconds for each briefing skill contributor action. */
283
+ BriefingContributorTimeoutMs: number;
284
+ /** Maximum serialized character length retained per briefing skill contributor. */
285
+ BriefingMaxContributorChars: number;
286
+ /** Multi-scope dollar and wall-clock budget limits and accounting rules. */
287
+ Budgets: MJLimitsBudgetsConfig;
288
+ /** Deterministic sliding-window progress detector and fast convergence judge thresholds. */
289
+ ProgressDetector: MJLimitsProgressDetectorConfig;
290
+ /** Bounded resource, retry, depth, and concurrency guard ceilings. */
291
+ ResourceGuards: MJLimitsResourceGuardsConfig;
292
+ /** Operational tuning defaults for caching, compaction, candidate caps, and batching. */
293
+ Tuning: MJLimitsTuningConfig;
294
+ /** Task graph and workflow execution isolation defaults and runtime resource ceilings. */
295
+ Isolation: MJLimitsIsolationConfig;
296
+ /** Task graph queue dispatch, bounded fan-out, runner backpressure, and notification retention limits. */
297
+ TaskGraphQueue: MJLimitsTaskGraphQueueConfig;
298
+ }
299
+ /** Partial override for {@link MJLimitsScopeBudget}. */
300
+ export interface MJLimitsScopeBudgetOverride {
301
+ MaxCostUsd?: number | null;
302
+ MaxWallClockMs?: number | null;
303
+ }
304
+ /** Partial override for {@link MJLimitsRunScopeBudget}. */
305
+ export interface MJLimitsRunScopeBudgetOverride extends MJLimitsScopeBudgetOverride {
306
+ MaxTokens?: number | null;
307
+ }
308
+ /** Partial override for {@link MJLimitsUserDailyScopeBudget}. */
309
+ export interface MJLimitsUserDailyScopeBudgetOverride extends MJLimitsScopeBudgetOverride {
310
+ DayBoundaryTimezone?: string;
311
+ }
312
+ /** Partial override for {@link MJLimitsBudgetsConfig}. */
313
+ export interface MJLimitsBudgetsOverride {
314
+ PerRun?: MJLimitsRunScopeBudgetOverride;
315
+ PerRoutine?: MJLimitsScopeBudgetOverride;
316
+ PerUserPerDay?: MJLimitsUserDailyScopeBudgetOverride;
317
+ CountPausedTimeTowardsWallClock?: boolean;
318
+ AllowedInFlightOvershootUsd?: number;
319
+ AllowedInFlightOvershootMs?: number;
320
+ }
321
+ /** Partial override for {@link MJLimitsProgressDetectorConfig}. */
322
+ export interface MJLimitsProgressDetectorOverride {
323
+ Enabled?: boolean;
324
+ WindowSize?: number;
325
+ MinIterationsBeforeCheck?: number;
326
+ DuplicateStepRatioThreshold?: number;
327
+ NoPayloadDeltaWindowCount?: number;
328
+ RepeatingErrorWindowCount?: number;
329
+ AmbiguityLowScoreThreshold?: number;
330
+ AmbiguityHighScoreThreshold?: number;
331
+ FastJudgeEnabled?: boolean;
332
+ FastJudgeTimeoutMs?: number;
333
+ FastJudgeMinIntervalIterations?: number;
334
+ FastJudgeMaxInputChars?: number;
335
+ FastJudgeFailureFallback?: FastJudgeFailureFallbackMode;
336
+ }
337
+ /** Partial override for {@link MJLimitsResourceGuardsConfig}. */
338
+ export type MJLimitsResourceGuardsOverride = Partial<MJLimitsResourceGuardsConfig>;
339
+ /** Partial override for {@link MJLimitsTuningConfig}. */
340
+ export type MJLimitsTuningOverride = Partial<MJLimitsTuningConfig>;
341
+ /** Partial override for {@link MJLimitsIsolationConfig}. */
342
+ export type MJLimitsIsolationOverride = Partial<MJLimitsIsolationConfig>;
343
+ /** Partial override for {@link MJLimitsTaskGraphQueueConfig}. */
344
+ export type MJLimitsTaskGraphQueueOverride = Partial<MJLimitsTaskGraphQueueConfig>;
345
+ /**
346
+ * Partial override object accepted by any tier of {@link LimitsConfigResolver}.
347
+ */
348
+ export interface MJLimitsOverride {
349
+ AgentChannelConsecutiveTurns?: number;
350
+ AgentChannelWakesPerHour?: number;
351
+ AgentAbsoluteIterations?: number;
352
+ MaxTasksPerAgentGraph?: number;
353
+ WhileLoopMaxIterations?: number;
354
+ ForEachMaxIterations?: number;
355
+ MaxTasksPerGraph?: number;
356
+ BriefingContributorTimeoutMs?: number;
357
+ BriefingMaxContributorChars?: number;
358
+ Budgets?: MJLimitsBudgetsOverride;
359
+ ProgressDetector?: MJLimitsProgressDetectorOverride;
360
+ ResourceGuards?: MJLimitsResourceGuardsOverride;
361
+ Tuning?: MJLimitsTuningOverride;
362
+ Isolation?: MJLimitsIsolationOverride;
363
+ TaskGraphQueue?: MJLimitsTaskGraphQueueOverride;
364
+ }
365
+ /**
366
+ * Canonical approved code fallback defaults for all MemberJunction limits and backstops.
367
+ */
368
+ export declare const CODE_FALLBACK_LIMITS: Readonly<MJLimitsConfig>;
369
+ /**
370
+ * Alias for {@link CODE_FALLBACK_LIMITS} representing the default MemberJunction limits
371
+ * configuration used when `mj.config.cjs` omits a `limits` block.
372
+ */
373
+ export declare const DEFAULT_MJ_LIMITS_CONFIG: Readonly<MJLimitsConfig>;
374
+ type ResourceGuardKey = keyof MJLimitsResourceGuardsConfig;
375
+ type TuningKey = keyof MJLimitsTuningConfig;
376
+ type IsolationKey = keyof MJLimitsIsolationConfig;
377
+ type TaskGraphQueueKey = keyof MJLimitsTaskGraphQueueConfig;
378
+ export type ResourceGuardKeyPath = `ResourceGuards.${ResourceGuardKey}`;
379
+ export type TuningKeyPath = `Tuning.${TuningKey}`;
380
+ export type IsolationKeyPath = `Isolation.${IsolationKey}`;
381
+ export type TaskGraphQueueKeyPath = `TaskGraphQueue.${TaskGraphQueueKey}`;
382
+ /**
383
+ * Union of all canonical dot-separated limit key paths tracked for provenance.
384
+ */
385
+ export type LimitsKeyPath = 'AgentChannelConsecutiveTurns' | 'AgentChannelWakesPerHour' | 'AgentAbsoluteIterations' | 'MaxTasksPerAgentGraph' | 'WhileLoopMaxIterations' | 'ForEachMaxIterations' | 'MaxTasksPerGraph' | 'BriefingContributorTimeoutMs' | 'BriefingMaxContributorChars' | 'Budgets.PerRun.MaxCostUsd' | 'Budgets.PerRun.MaxWallClockMs' | 'Budgets.PerRun.MaxTokens' | 'Budgets.PerRoutine.MaxCostUsd' | 'Budgets.PerRoutine.MaxWallClockMs' | 'Budgets.PerUserPerDay.MaxCostUsd' | 'Budgets.PerUserPerDay.MaxWallClockMs' | 'Budgets.PerUserPerDay.DayBoundaryTimezone' | 'Budgets.CountPausedTimeTowardsWallClock' | 'Budgets.AllowedInFlightOvershootUsd' | 'Budgets.AllowedInFlightOvershootMs' | 'ProgressDetector.Enabled' | 'ProgressDetector.WindowSize' | 'ProgressDetector.MinIterationsBeforeCheck' | 'ProgressDetector.DuplicateStepRatioThreshold' | 'ProgressDetector.NoPayloadDeltaWindowCount' | 'ProgressDetector.RepeatingErrorWindowCount' | 'ProgressDetector.AmbiguityLowScoreThreshold' | 'ProgressDetector.AmbiguityHighScoreThreshold' | 'ProgressDetector.FastJudgeEnabled' | 'ProgressDetector.FastJudgeTimeoutMs' | 'ProgressDetector.FastJudgeMinIntervalIterations' | 'ProgressDetector.FastJudgeMaxInputChars' | 'ProgressDetector.FastJudgeFailureFallback' | ResourceGuardKeyPath | TuningKeyPath | IsolationKeyPath | TaskGraphQueueKeyPath;
386
+ /**
387
+ * Ordered list of every {@link LimitsKeyPath} covered by {@link LimitsConfigResolver}.
388
+ */
389
+ export declare const LIMITS_KEY_PATHS: readonly LimitsKeyPath[];
390
+ /** Primitive value type for an individual resolved limit key. */
391
+ export type LimitsScalarValue = number | string | boolean | null;
392
+ /**
393
+ * Governance role distinguishing hard safety/quota ceilings (`PolicyCeiling`) from
394
+ * operational defaults/tuning knobs (`OverridableDefault`).
395
+ */
396
+ export type LimitsKeyRole = 'PolicyCeiling' | 'OverridableDefault';
397
+ /**
398
+ * Per-key resolution provenance record showing the winning value, winning tier, and every tier's input.
399
+ */
400
+ export interface LimitsKeyProvenance {
401
+ /** Canonical key path. */
402
+ Key: LimitsKeyPath;
403
+ /** Whether this key acts as an enforced policy ceiling or an overridable operational default. */
404
+ KeyRole: LimitsKeyRole;
405
+ /** Effective resolved value after precedence merging. */
406
+ Value: LimitsScalarValue;
407
+ /** Highest-precedence tier that supplied the effective value. */
408
+ SourceTier: LimitsSourceTier;
409
+ /** True when any tier above `CodeFallback` supplied the winning value. */
410
+ IsOverridden: boolean;
411
+ /** Values supplied at each tier that explicitly specified this key. */
412
+ TierValues: Partial<Record<LimitsSourceTier, LimitsScalarValue>>;
413
+ /** True when ceiling enforcement clamped a `RunOverride` down to an enforced lower-tier ceiling. */
414
+ WasClampedByPolicyCeiling: boolean;
415
+ }
416
+ /**
417
+ * Layer inputs passed to {@link LimitsConfigResolver.Resolve}.
418
+ */
419
+ export interface LimitsResolutionInput {
420
+ /** Optional override layer applied to Tier 1 (`CodeFallback`) before higher tiers. */
421
+ CodeFallback?: MJLimitsOverride | null;
422
+ /** Tier 2: Settings loaded from `mj.config.cjs` `limits` object. Omitted (`undefined`) uses registered MjConfig; `null` clears it for this call. */
423
+ MjConfig?: MJLimitsOverride | null;
424
+ /** Tier 3: Agent or workflow metadata overrides. */
425
+ AgentOrWorkflowMetadata?: MJLimitsOverride | null;
426
+ /** Tier 4: User's agent policy overrides. */
427
+ UserAgentPolicy?: MJLimitsOverride | null;
428
+ /** Tier 5: Individual run overrides (highest precedence). */
429
+ RunOverride?: MJLimitsOverride | null;
430
+ }
431
+ /**
432
+ * Options controlling {@link LimitsConfigResolver.Resolve}.
433
+ */
434
+ export interface LimitsResolveOptions {
435
+ /**
436
+ * When true, `RunOverride` cannot raise a numeric ceiling above a tighter finite ceiling set
437
+ * in `UserAgentPolicy` (or replace a finite `UserAgentPolicy` limit with `null`) unless
438
+ * `AllowAuthorizedCeilingOverride` is also true and `ContextUser` passes
439
+ * {@link CanUserRaiseEnforcedLimitsCeilings}.
440
+ */
441
+ EnforceUserPolicyAsCeiling?: boolean;
442
+ /**
443
+ * When true, enforces lower-tier finite `PolicyCeiling` bounds (`CodeFallback`, `MjConfig`,
444
+ * `AgentOrWorkflowMetadata`, `UserAgentPolicy`) against widening by `RunOverride` unless
445
+ * `AllowAuthorizedCeilingOverride` is true and `ContextUser` passes
446
+ * {@link CanUserRaiseEnforcedLimitsCeilings}.
447
+ */
448
+ EnforceConfiguredCeilings?: boolean;
449
+ /**
450
+ * Server-side execution user evaluated when `RunOverride` attempts to raise an enforced
451
+ * `PolicyCeiling`. Missing or unauthorized users fail closed and are clamped to the ceiling.
452
+ */
453
+ ContextUser?: UserInfo | null;
454
+ /**
455
+ * Metadata provider supplying `Authorizations` for {@link CanUserRaiseEnforcedLimitsCeilings}.
456
+ */
457
+ Provider?: IMetadataProvider | null;
458
+ /**
459
+ * When true, allows an authorized `ContextUser` (`Owner`, `System Administrator`, or
460
+ * `AI: Manage Agents`) to raise enforced `PolicyCeiling` values via `RunOverride`.
461
+ */
462
+ AllowAuthorizedCeilingOverride?: boolean;
463
+ /** Optional deterministic timestamp override (ISO-8601) for repeatable snapshots/tests. */
464
+ ResolvedAtISO?: string;
465
+ }
466
+ /**
467
+ * Full output of {@link LimitsConfigResolver.Resolve}, including resolved values and per-key provenance.
468
+ */
469
+ export interface MJLimitsResolutionResult {
470
+ /** Complete resolved limits configuration with all defaults applied. */
471
+ Limits: MJLimitsConfig;
472
+ /** Per-key provenance records keyed by {@link LimitsKeyPath}. */
473
+ Provenance: Record<LimitsKeyPath, LimitsKeyProvenance>;
474
+ /** ISO-8601 timestamp when resolution ran. */
475
+ ResolvedAtISO: string;
476
+ /** Keys whose winning tier is above `CodeFallback`. */
477
+ OverriddenKeys: LimitsKeyPath[];
478
+ /** Keys where `RunOverride` was clamped by `UserAgentPolicy` ceiling enforcement. */
479
+ ClampedKeys: LimitsKeyPath[];
480
+ }
481
+ /** One validation finding produced by {@link ValidateLimitsConfig}. */
482
+ export interface LimitsValidationIssue {
483
+ Key: LimitsKeyPath;
484
+ Message: string;
485
+ }
486
+ /** Outcome of {@link ValidateLimitsConfig}. */
487
+ export interface LimitsValidationResult {
488
+ Valid: boolean;
489
+ Issues: LimitsValidationIssue[];
490
+ }
491
+ /**
492
+ * Explicit classification of every {@link LimitsKeyPath} into `'PolicyCeiling'` (cannot be raised
493
+ * above an enforced ceiling without authorization) vs `'OverridableDefault'` (operational default
494
+ * or tuning setting).
495
+ */
496
+ export declare const LIMITS_KEY_ROLES: Readonly<Record<LimitsKeyPath, LimitsKeyRole>>;
497
+ /**
498
+ * Returns the governance role (`'PolicyCeiling'` vs `'OverridableDefault'`) for a canonical limit key.
499
+ */
500
+ export declare function GetLimitsKeyRole(key: LimitsKeyPath): LimitsKeyRole;
501
+ /**
502
+ * Returns `true` when {@link key} is a numeric policy ceiling that requires authorization to raise
503
+ * above an enforced lower-tier ceiling.
504
+ */
505
+ export declare function IsPolicyCeilingKey(key: LimitsKeyPath): boolean;
506
+ /**
507
+ * Named MJ Authorizations permitted to raise enforced `PolicyCeiling` limits or approve
508
+ * governance pause overrides.
509
+ */
510
+ export declare const LIMITS_CEILING_OVERRIDE_AUTHORIZATIONS: readonly string[];
511
+ /**
512
+ * Evaluates whether a server-side `ContextUser` is authorized to raise enforced limits ceilings
513
+ * (`Owner` user type or holding `'System Administrator'` / `'AI: Manage Agents'` authorization).
514
+ * Fails closed (`false`) when `user` is missing or lacks required authorization.
515
+ */
516
+ export declare function CanUserRaiseEnforcedLimitsCeilings(user?: UserInfo | null, provider?: IMetadataProvider | null): boolean;
517
+ /** Scalar input value accepted by {@link NormalizeLimitsInput}. */
518
+ export type LimitsInputScalar = string | number | boolean | null | undefined;
519
+ /** Object input shape accepted by {@link NormalizeLimitsInput}. */
520
+ export interface LimitsInputObject {
521
+ [key: string]: LimitsInputValue;
522
+ }
523
+ /** Strongly-typed recursive input value accepted by {@link NormalizeLimitsInput} without `unknown` or `any`. */
524
+ export type LimitsInputValue = LimitsInputScalar | LimitsInputObject | readonly LimitsInputValue[] | MJLimitsOverride | object;
525
+ /**
526
+ * Tolerantly normalizes an untyped `limits` object (from `mj.config.cjs`, agent metadata JSON,
527
+ * or API payloads) into a strongly-typed {@link MJLimitsOverride}. Accepts both PascalCase and
528
+ * camelCase field names plus standard legacy aliases (`ContributorTimeoutMs`, `MaxContributorChars`,
529
+ * `MaxConsecutiveAgentTurns`, `MaxHourlyWakes`, `MAX_TASKS_PER_AGENT_GRAPH`, `MAX_TASKS_PER_GRAPH`,
530
+ * `absoluteMaxIterations`). Invalid or out-of-range values are omitted rather than throwing.
531
+ *
532
+ * @param raw - Raw input object (typically from `mj.config.cjs` `limits` or parsed JSON).
533
+ * @returns Normalized {@link MJLimitsOverride} containing only valid fields.
534
+ */
535
+ export declare function NormalizeLimitsInput(raw: LimitsInputValue): MJLimitsOverride;
536
+ /**
537
+ * Validates a resolved {@link MJLimitsConfig} for structural and range invariants.
538
+ *
539
+ * @param config - Resolved limits config to inspect.
540
+ * @returns Validation result with any violated limit keys and descriptions.
541
+ */
542
+ export declare function ValidateLimitsConfig(config: MJLimitsConfig): LimitsValidationResult;
543
+ /**
544
+ * 5-tier hierarchical resolver for {@link MJLimitsConfig} backed by `BaseSingleton` so server
545
+ * bootstrap can register `mj.config.cjs` `limits` once across the process without adding Node
546
+ * dependencies to `@memberjunction/core`.
547
+ */
548
+ export declare class LimitsConfigResolver extends BaseSingleton<LimitsConfigResolver> {
549
+ private registeredMjConfigLimits;
550
+ constructor();
551
+ /** Returns the process-wide singleton {@link LimitsConfigResolver}. */
552
+ static get Instance(): LimitsConfigResolver;
553
+ /**
554
+ * Convenience static entry point delegating to {@link LimitsConfigResolver.Instance.Resolve}.
555
+ */
556
+ static Resolve(input?: LimitsResolutionInput, options?: LimitsResolveOptions): MJLimitsResolutionResult;
557
+ /**
558
+ * Registers Tier 2 (`MjConfig`) limits loaded from `mj.config.cjs` by a host bootstrapper.
559
+ * Pass `null` to clear any registered config.
560
+ */
561
+ RegisterMjConfigLimits(limits: MJLimitsOverride | LimitsInputObject | null): void;
562
+ /** Returns the currently registered Tier 2 (`MjConfig`) override, or `null` when unset. */
563
+ GetMjConfigLimits(): MJLimitsOverride | null;
564
+ /** Clears any registered Tier 2 (`MjConfig`) override (primarily for unit test isolation). */
565
+ ClearMjConfigLimits(): void;
566
+ /**
567
+ * Resolves all limit keys across the 5 precedence tiers (`CodeFallback` -> `MjConfig` ->
568
+ * `AgentOrWorkflowMetadata` -> `UserAgentPolicy` -> `RunOverride`), tracking full provenance.
569
+ */
570
+ Resolve(input?: LimitsResolutionInput, options?: LimitsResolveOptions): MJLimitsResolutionResult;
571
+ /**
572
+ * Reads a single resolved limit value from a resolution result by canonical key path.
573
+ */
574
+ GetLimitValue(result: MJLimitsResolutionResult, key: LimitsKeyPath): LimitsScalarValue;
575
+ }
576
+ export {};
577
+ //# sourceMappingURL=limitsConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limitsConfig.d.ts","sourceRoot":"","sources":["../../src/generic/limitsConfig.ts"],"names":[],"mappings":"AA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