assignment-user-matcher 1.2.0 → 1.2.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.
- package/README.md +523 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/learning/features.d.ts +19 -0
- package/dist/learning/features.d.ts.map +1 -0
- package/dist/learning/features.js +55 -0
- package/dist/managers/LearningManager.d.ts +94 -0
- package/dist/managers/LearningManager.d.ts.map +1 -0
- package/dist/managers/LearningManager.js +194 -0
- package/dist/managers/WorkflowManager.d.ts +10 -6
- package/dist/managers/WorkflowManager.d.ts.map +1 -1
- package/dist/managers/WorkflowManager.js +115 -23
- package/dist/matcher.class.d.ts +79 -8
- package/dist/matcher.class.d.ts.map +1 -1
- package/dist/matcher.class.js +352 -22
- package/dist/scoring/match-score.d.ts +11 -1
- package/dist/scoring/match-score.d.ts.map +1 -1
- package/dist/scoring/match-score.js +49 -2
- package/dist/types/matcher.d.ts +133 -5
- package/dist/types/matcher.d.ts.map +1 -1
- package/dist/utils/keys.d.ts +5 -0
- package/dist/utils/keys.d.ts.map +1 -1
- package/dist/utils/keys.js +6 -0
- package/dist/workflow-builder.d.ts +15 -4
- package/dist/workflow-builder.d.ts.map +1 -1
- package/dist/workflow-builder.js +25 -42
- package/dist/workflow-validation.d.ts +4 -0
- package/dist/workflow-validation.d.ts.map +1 -0
- package/dist/workflow-validation.js +85 -0
- package/package.json +4 -2
|
@@ -6,11 +6,21 @@ import type { User } from '../matcher.class';
|
|
|
6
6
|
* Check if a pattern matches a tag (supports wildcard patterns ending with *)
|
|
7
7
|
*/
|
|
8
8
|
export declare function matchesPattern(pattern: string, tag: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get the effective weight for a skill tag from user's routingWeights
|
|
11
|
+
* Supports wildcard patterns (e.g., 'eng*' matches 'english')
|
|
12
|
+
*/
|
|
13
|
+
export declare function getEffectiveWeight(routingWeights: Record<string, number>, tag: string): number;
|
|
14
|
+
/**
|
|
15
|
+
* Check if user meets all skill thresholds
|
|
16
|
+
* Returns true if all thresholds are met, false otherwise
|
|
17
|
+
*/
|
|
18
|
+
export declare function meetsSkillThresholds(routingWeights: Record<string, number> | undefined, skillThresholds: Record<string, number> | undefined): boolean;
|
|
9
19
|
/**
|
|
10
20
|
* Calculate match score between a user and assignment tags
|
|
11
21
|
* Returns [score, combinedPriority]
|
|
12
22
|
*/
|
|
13
|
-
export declare function calculateMatchScore(user: User, assignmentTags: string, assignmentPriority: string | number, enableDefaultMatching: boolean): [number, number];
|
|
23
|
+
export declare function calculateMatchScore(user: User, assignmentTags: string, assignmentPriority: string | number, enableDefaultMatching: boolean, skillThresholds?: Record<string, number>): [number, number];
|
|
14
24
|
/**
|
|
15
25
|
* Calculate default priority based on creation time
|
|
16
26
|
* Note: Returns 0 if createdAt is undefined to match original behavior
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-score.d.ts","sourceRoot":"","sources":["../../src/scoring/match-score.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOpE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,GAAG,MAAM,EACnC,qBAAqB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"match-score.d.ts","sourceRoot":"","sources":["../../src/scoring/match-score.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtC,GAAG,EAAE,MAAM,GACZ,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAClD,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACpD,OAAO,CAeT;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,GAAG,MAAM,EACnC,qBAAqB,EAAE,OAAO,EAC9B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,CAAC,MAAM,EAAE,MAAM,CAAC,CAoElB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateDefaultPriority = exports.calculateMatchScore = exports.matchesPattern = void 0;
|
|
3
|
+
exports.calculateDefaultPriority = exports.calculateMatchScore = exports.meetsSkillThresholds = exports.getEffectiveWeight = exports.matchesPattern = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Check if a pattern matches a tag (supports wildcard patterns ending with *)
|
|
6
6
|
*/
|
|
@@ -14,14 +14,56 @@ function matchesPattern(pattern, tag) {
|
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
exports.matchesPattern = matchesPattern;
|
|
17
|
+
/**
|
|
18
|
+
* Get the effective weight for a skill tag from user's routingWeights
|
|
19
|
+
* Supports wildcard patterns (e.g., 'eng*' matches 'english')
|
|
20
|
+
*/
|
|
21
|
+
function getEffectiveWeight(routingWeights, tag) {
|
|
22
|
+
// First check for exact match
|
|
23
|
+
if (tag in routingWeights) {
|
|
24
|
+
return routingWeights[tag];
|
|
25
|
+
}
|
|
26
|
+
// Check wildcard patterns
|
|
27
|
+
for (const [pattern, weight] of Object.entries(routingWeights)) {
|
|
28
|
+
if (matchesPattern(pattern, tag)) {
|
|
29
|
+
return weight;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
exports.getEffectiveWeight = getEffectiveWeight;
|
|
35
|
+
/**
|
|
36
|
+
* Check if user meets all skill thresholds
|
|
37
|
+
* Returns true if all thresholds are met, false otherwise
|
|
38
|
+
*/
|
|
39
|
+
function meetsSkillThresholds(routingWeights, skillThresholds) {
|
|
40
|
+
if (!skillThresholds || Object.keys(skillThresholds).length === 0) {
|
|
41
|
+
return true; // No thresholds to check
|
|
42
|
+
}
|
|
43
|
+
if (!routingWeights || Object.keys(routingWeights).length === 0) {
|
|
44
|
+
return false; // User has no weights but thresholds exist
|
|
45
|
+
}
|
|
46
|
+
for (const [skill, minWeight] of Object.entries(skillThresholds)) {
|
|
47
|
+
const userWeight = getEffectiveWeight(routingWeights, skill);
|
|
48
|
+
if (userWeight < minWeight) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
exports.meetsSkillThresholds = meetsSkillThresholds;
|
|
17
55
|
/**
|
|
18
56
|
* Calculate match score between a user and assignment tags
|
|
19
57
|
* Returns [score, combinedPriority]
|
|
20
58
|
*/
|
|
21
|
-
function calculateMatchScore(user, assignmentTags, assignmentPriority, enableDefaultMatching) {
|
|
59
|
+
function calculateMatchScore(user, assignmentTags, assignmentPriority, enableDefaultMatching, skillThresholds) {
|
|
22
60
|
const aTags = assignmentTags ? assignmentTags.split(',') : [];
|
|
23
61
|
// If weighted skills are present, use them for scoring
|
|
24
62
|
if (user.routingWeights && Object.keys(user.routingWeights).length > 0) {
|
|
63
|
+
// Check skill thresholds first - reject if not met
|
|
64
|
+
if (!meetsSkillThresholds(user.routingWeights, skillThresholds)) {
|
|
65
|
+
return [0, Number(assignmentPriority) || 0];
|
|
66
|
+
}
|
|
25
67
|
// Check for exclusions (weight 0)
|
|
26
68
|
for (const [pattern, weight] of Object.entries(user.routingWeights)) {
|
|
27
69
|
if (weight === 0) {
|
|
@@ -52,6 +94,11 @@ function calculateMatchScore(user, assignmentTags, assignmentPriority, enableDef
|
|
|
52
94
|
const base = Number(assignmentPriority) || 0;
|
|
53
95
|
return [weightSum, base + weightSum];
|
|
54
96
|
}
|
|
97
|
+
// For tag-based matching (no routingWeights), check thresholds
|
|
98
|
+
// If thresholds exist but user has no routingWeights, reject
|
|
99
|
+
if (skillThresholds && Object.keys(skillThresholds).length > 0) {
|
|
100
|
+
return [0, Number(assignmentPriority) || 0];
|
|
101
|
+
}
|
|
55
102
|
// Fallback to default tag-intersection scoring
|
|
56
103
|
const userTagSet = new Set(user.tags);
|
|
57
104
|
const assignmentTagSet = new Set(aTags);
|
package/dist/types/matcher.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export type Assignment = {
|
|
|
12
12
|
tags: string[];
|
|
13
13
|
priority?: number;
|
|
14
14
|
allowedCidrs?: string[];
|
|
15
|
+
skillThresholds?: Record<string, number>;
|
|
15
16
|
[key: string]: any;
|
|
16
17
|
};
|
|
17
18
|
export type Stats = {
|
|
@@ -19,14 +20,29 @@ export type Stats = {
|
|
|
19
20
|
usersWithoutAssignment?: string[];
|
|
20
21
|
remainingAssignments?: number;
|
|
21
22
|
};
|
|
23
|
+
export type PendingAssignmentInfo = {
|
|
24
|
+
assignment: Assignment;
|
|
25
|
+
ownerId: string | null;
|
|
26
|
+
pendingForMs: number | null;
|
|
27
|
+
pendingSince: number | null;
|
|
28
|
+
expiresAt: number | null;
|
|
29
|
+
};
|
|
22
30
|
export type MatcherOptions = {
|
|
23
31
|
relevantBatchSize?: number;
|
|
24
32
|
redisPrefix?: string;
|
|
25
33
|
maxUserBacklogSize?: number;
|
|
26
34
|
enableDefaultMatching?: boolean;
|
|
27
35
|
matchExpirationMs?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Opt-in idle user auto-rejection. When set, users that have pending
|
|
38
|
+
* (not yet accepted/rejected) assignments and show no activity for this
|
|
39
|
+
* many milliseconds are removed from the matching pool by
|
|
40
|
+
* processIdleUsers(), and their pending assignments are requeued.
|
|
41
|
+
* Disabled when undefined (default), preserving existing behavior.
|
|
42
|
+
*/
|
|
43
|
+
idleUserTimeoutMs?: number;
|
|
28
44
|
prioritizationFunction?: (...args: (Assignment | undefined)[]) => Promise<number>;
|
|
29
|
-
matchingFunction?: (user: User, assignmentTags: string, assignmentPriority: number | string, assignmentId?: string) => Promise<[number, number]>;
|
|
45
|
+
matchingFunction?: (user: User, assignmentTags: string, assignmentPriority: number | string, assignmentId?: string, skillThresholds?: Record<string, number>) => Promise<[number, number]>;
|
|
30
46
|
/** Enable workflow orchestration features */
|
|
31
47
|
enableWorkflows?: boolean;
|
|
32
48
|
/** Consumer group name for Redis Streams (defaults to 'orchestrator') */
|
|
@@ -39,6 +55,8 @@ export type MatcherOptions = {
|
|
|
39
55
|
workflowIdempotencyTtlMs?: number;
|
|
40
56
|
/** Minimum idle time before reclaiming orphaned messages in ms (default: 60000 = 1min) */
|
|
41
57
|
workflowOrphanReclaimMs?: number;
|
|
58
|
+
/** Polling interval for reclaim loop in ms (default: 5000) */
|
|
59
|
+
workflowReclaimPollIntervalMs?: number;
|
|
42
60
|
/** Number of failures before circuit breaker opens (default: 5) */
|
|
43
61
|
workflowCircuitBreakerThreshold?: number;
|
|
44
62
|
/** Time to wait before attempting to close circuit breaker in ms (default: 30000) */
|
|
@@ -49,11 +67,44 @@ export type MatcherOptions = {
|
|
|
49
67
|
workflowSnapshotDefinitions?: boolean;
|
|
50
68
|
/** Enable OpenTelemetry tracing (default: false) */
|
|
51
69
|
enableOpenTelemetry?: boolean;
|
|
70
|
+
/** Enable the contextual-bandit learning layer (default: false) */
|
|
71
|
+
enableLearning?: boolean;
|
|
72
|
+
/** SGD learning rate for online model updates (default: 0.1) */
|
|
73
|
+
learningRate?: number;
|
|
74
|
+
/** Epsilon-greedy exploration rate in [0, 1] (default: 0.05) */
|
|
75
|
+
learningExplorationRate?: number;
|
|
76
|
+
/** Shadow mode: record decisions and learn, but never alter ranking (default: false) */
|
|
77
|
+
learningShadowMode?: boolean;
|
|
78
|
+
/** Multiplier applied to predicted reward when re-ranking candidates (default: 1) */
|
|
79
|
+
learningBoostFactor?: number;
|
|
80
|
+
/** Override rewards per lifecycle outcome (merged with defaults) */
|
|
81
|
+
learningRewards?: Partial<LearningRewards>;
|
|
82
|
+
/** Custom feature extractor; defaults to tag/skill/overlap/embedding features */
|
|
83
|
+
learningFeatureExtractor?: LearningFeatureExtractor;
|
|
84
|
+
/** TTL for stored decision contexts in ms (default: 604800000 = 7 days) */
|
|
85
|
+
learningDecisionTtlMs?: number;
|
|
86
|
+
/** Weights applied to named external feedback signals when computing rewards (default weight: 1) */
|
|
87
|
+
learningSignalWeights?: Record<string, number>;
|
|
88
|
+
/** TTL for archived episodes awaiting external feedback in ms (default: 604800000 = 7 days) */
|
|
89
|
+
learningFeedbackTtlMs?: number;
|
|
52
90
|
};
|
|
53
91
|
/** @deprecated Use MatcherOptions instead */
|
|
54
92
|
export type options = MatcherOptions;
|
|
55
93
|
/** Event types for workflow lifecycle */
|
|
56
94
|
export type WorkflowEventType = 'STARTED' | 'COMPLETED' | 'REJECTED' | 'EXPIRED' | 'FAILED';
|
|
95
|
+
/** Step execution mode */
|
|
96
|
+
export type WorkflowTaskType = 'assignment' | 'machine';
|
|
97
|
+
/** Target user selector for workflow assignment steps */
|
|
98
|
+
export type WorkflowTargetUser = 'initiator' | 'previous' | string | {
|
|
99
|
+
tag: string;
|
|
100
|
+
};
|
|
101
|
+
/** Machine task metadata for code-driven workflow steps */
|
|
102
|
+
export interface WorkflowMachineTask {
|
|
103
|
+
/** Machine handler identifier (resolver-specific) */
|
|
104
|
+
handler: string;
|
|
105
|
+
/** Optional static input merged with workflow context */
|
|
106
|
+
input?: Record<string, any>;
|
|
107
|
+
}
|
|
57
108
|
/** Event published to Redis Streams for workflow orchestration */
|
|
58
109
|
export interface WorkflowEvent {
|
|
59
110
|
eventId: string;
|
|
@@ -78,12 +129,14 @@ export interface WorkflowStep {
|
|
|
78
129
|
id: string;
|
|
79
130
|
/** Human-readable name */
|
|
80
131
|
name: string;
|
|
132
|
+
/** Step execution mode (default: 'assignment') */
|
|
133
|
+
taskType?: WorkflowTaskType;
|
|
81
134
|
/** Assignment template - merged with workflow context when creating the assignment */
|
|
82
|
-
assignmentTemplate
|
|
135
|
+
assignmentTemplate?: Partial<Assignment>;
|
|
83
136
|
/** Target user selector: 'initiator' | 'previous' | specific userId | tag-based selector */
|
|
84
|
-
targetUser
|
|
85
|
-
|
|
86
|
-
|
|
137
|
+
targetUser?: WorkflowTargetUser;
|
|
138
|
+
/** Machine task metadata used for code/task worker execution */
|
|
139
|
+
machineTask?: WorkflowMachineTask;
|
|
87
140
|
/** Routing rules for branching (evaluated in order, first match wins) */
|
|
88
141
|
routing?: WorkflowRouting[];
|
|
89
142
|
/** Default next step if no routing condition matches (null = end workflow) */
|
|
@@ -116,6 +169,28 @@ export interface WorkflowDefinition {
|
|
|
116
169
|
/** Metadata for the workflow */
|
|
117
170
|
metadata?: Record<string, any>;
|
|
118
171
|
}
|
|
172
|
+
/** User-friendly input shape for registering or executing workflows */
|
|
173
|
+
export interface WorkflowDefinitionInput {
|
|
174
|
+
/** Unique identifier for this workflow definition */
|
|
175
|
+
id: string;
|
|
176
|
+
/** Human-readable name */
|
|
177
|
+
name: string;
|
|
178
|
+
/** Version for schema evolution (defaults to 1) */
|
|
179
|
+
version?: number;
|
|
180
|
+
/** The entry point step ID (defaults to the first step ID) */
|
|
181
|
+
initialStepId?: string;
|
|
182
|
+
/** All steps in this workflow */
|
|
183
|
+
steps: WorkflowStep[];
|
|
184
|
+
/** Default timeout for steps in milliseconds */
|
|
185
|
+
defaultTimeoutMs?: number;
|
|
186
|
+
/** Metadata for the workflow */
|
|
187
|
+
metadata?: Record<string, any>;
|
|
188
|
+
}
|
|
189
|
+
/** Compact workflow metadata returned by list endpoints */
|
|
190
|
+
export interface WorkflowDefinitionSummary {
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
}
|
|
119
194
|
/** Status of a workflow instance */
|
|
120
195
|
export type WorkflowInstanceStatus = 'active' | 'completed' | 'failed' | 'cancelled';
|
|
121
196
|
/** Tracks the state of a parallel execution branch */
|
|
@@ -214,12 +289,65 @@ export interface WorkflowInstanceWithSnapshot extends WorkflowInstance {
|
|
|
214
289
|
/** Resolved definition (from snapshot or registry) */
|
|
215
290
|
resolvedDefinition?: WorkflowDefinition;
|
|
216
291
|
}
|
|
292
|
+
/** Assignment lifecycle outcomes that generate learning rewards */
|
|
293
|
+
export type LearningOutcome = 'accept' | 'complete' | 'reject' | 'expire' | 'fail';
|
|
294
|
+
/** Reward values per lifecycle outcome */
|
|
295
|
+
export type LearningRewards = Record<LearningOutcome, number>;
|
|
296
|
+
/** Sparse feature vector describing a user/assignment match context */
|
|
297
|
+
export type LearningFeatures = Record<string, number>;
|
|
298
|
+
/** Minimal assignment context passed to feature extractors */
|
|
299
|
+
export interface LearningAssignmentContext {
|
|
300
|
+
id: string;
|
|
301
|
+
tags: string[];
|
|
302
|
+
[key: string]: any;
|
|
303
|
+
}
|
|
304
|
+
/** Pluggable feature extractor for the learning layer */
|
|
305
|
+
export type LearningFeatureExtractor = (user: User, assignment: LearningAssignmentContext) => LearningFeatures;
|
|
306
|
+
/** Stored decision context awaiting an outcome */
|
|
307
|
+
export interface LearningDecisionRecord {
|
|
308
|
+
userId: string;
|
|
309
|
+
assignmentId: string;
|
|
310
|
+
features: LearningFeatures;
|
|
311
|
+
predictedReward: number;
|
|
312
|
+
timestamp: number;
|
|
313
|
+
}
|
|
314
|
+
/** Archived episode retained after a terminal outcome for late external feedback */
|
|
315
|
+
export interface LearningEpisodeRecord {
|
|
316
|
+
userId: string;
|
|
317
|
+
assignmentId: string;
|
|
318
|
+
features: LearningFeatures;
|
|
319
|
+
/** Terminal outcome that archived this episode */
|
|
320
|
+
outcome?: LearningOutcome;
|
|
321
|
+
timestamp: number;
|
|
322
|
+
}
|
|
323
|
+
/** Named external signal values (e.g. { accuracy: 0.95, csat: 0.8 }) */
|
|
324
|
+
export type LearningSignals = Record<string, number>;
|
|
325
|
+
/** Raw training sample for offline/batch model updates */
|
|
326
|
+
export interface LearningSample {
|
|
327
|
+
features: LearningFeatures;
|
|
328
|
+
reward: number;
|
|
329
|
+
}
|
|
330
|
+
/** Aggregate learning statistics */
|
|
331
|
+
export interface LearningStats {
|
|
332
|
+
/** Number of recorded match decisions */
|
|
333
|
+
decisions: number;
|
|
334
|
+
/** Number of reward updates applied */
|
|
335
|
+
rewards: number;
|
|
336
|
+
/** Sum of all applied rewards */
|
|
337
|
+
totalReward: number;
|
|
338
|
+
/** totalReward / rewards (0 when no rewards) */
|
|
339
|
+
averageReward: number;
|
|
340
|
+
}
|
|
217
341
|
/** Fluent builder for creating workflow steps */
|
|
218
342
|
export interface WorkflowStepBuilder {
|
|
219
343
|
/** Set the step name */
|
|
220
344
|
name(name: string): WorkflowStepBuilder;
|
|
345
|
+
/** Set the execution task type */
|
|
346
|
+
taskType(type: WorkflowTaskType): WorkflowStepBuilder;
|
|
221
347
|
/** Set the assignment template */
|
|
222
348
|
assignment(template: Partial<Assignment>): WorkflowStepBuilder;
|
|
349
|
+
/** Configure machine task metadata */
|
|
350
|
+
machineTask(handler: string, input?: Record<string, any>): WorkflowStepBuilder;
|
|
223
351
|
/** Set the target user */
|
|
224
352
|
targetUser(target: 'initiator' | 'previous' | string | {
|
|
225
353
|
tag: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../src/types/matcher.ts"],"names":[],"mappings":"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AG,mBAAmB,CAAC;IAC/C,yBAAyB;IACzB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,mBAAmB,CAAC;IACvE,sBAAsB;IACtB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC5C,uBAAuB;IACvB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,CAAC;IACzC,qBAAqB;IACrB,KAAK,IAAI,YAAY,CAAC;CACzB;AAED,uDAAuD;AACvD,MAAM,WAAW,yBAAyB;IACtC,4BAA4B;IAC5B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,yBAAyB,CAAC;IAC9C,+BAA+B;IAC/B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB,CAAC;IACpD,8BAA8B;IAC9B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB,CAAC;IACrD,iCAAiC;IACjC,OAAO,CAAC,IAAI,EAAE,YAAY,GAAG,yBAAyB,CAAC;IACvD,wCAAwC;IACxC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,yBAAyB,CAAC;IACtD,mBAAmB;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,yBAAyB,CAAC;IAC/D,oCAAoC;IACpC,KAAK,IAAI,kBAAkB,CAAC;CAC/B"}
|
package/dist/utils/keys.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function createKeyBuilders(config: RedisKeyConfig): {
|
|
|
12
12
|
users: () => string;
|
|
13
13
|
userAssignments: (userId: string) => string;
|
|
14
14
|
userRejected: (userId: string) => string;
|
|
15
|
+
userActivity: () => string;
|
|
15
16
|
assignments: () => string;
|
|
16
17
|
assignmentsRef: () => string;
|
|
17
18
|
assignmentsGeo: () => string;
|
|
@@ -35,6 +36,10 @@ export declare function createKeyBuilders(config: RedisKeyConfig): {
|
|
|
35
36
|
completedAssignments: () => string;
|
|
36
37
|
eventStream: () => string;
|
|
37
38
|
eventStreamDeadLetter: () => string;
|
|
39
|
+
learningModel: () => string;
|
|
40
|
+
learningDecision: (assignmentId: string) => string;
|
|
41
|
+
learningEpisode: (assignmentId: string) => string;
|
|
42
|
+
learningStats: () => string;
|
|
38
43
|
deadLetterQueue: () => string;
|
|
39
44
|
processedEvents: () => string;
|
|
40
45
|
eventRetryCount: (eventId: string) => string;
|
package/dist/utils/keys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/utils/keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;8BAMtB,MAAM;2BACT,MAAM
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/utils/keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;8BAMtB,MAAM;2BACT,MAAM;;;;;6BAOJ,MAAM;yBACV,MAAM;;;;;;0BAUL,MAAM;iCAGC,MAAM;8BACT,MAAM;4BACR,MAAM;;6BAIL,MAAM;;2BAER,MAAM;sCACK,MAAM;2CACD,MAAM;;;;;qCAWZ,MAAM;oCACP,MAAM;;;;+BAOX,MAAM;qCACA,MAAM,UAAU,MAAM;;EAG9D;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/utils/keys.js
CHANGED
|
@@ -15,6 +15,7 @@ function createKeyBuilders(config) {
|
|
|
15
15
|
users: () => `${prefix}users`,
|
|
16
16
|
userAssignments: (userId) => `${prefix}user:${userId}:assignments`,
|
|
17
17
|
userRejected: (userId) => `${prefix}user:${userId}:rejected`,
|
|
18
|
+
userActivity: () => `${prefix}users:activity`,
|
|
18
19
|
// Assignment keys
|
|
19
20
|
assignments: () => `${prefix}assignments`,
|
|
20
21
|
assignmentsRef: () => `${prefix}assignments:ref`,
|
|
@@ -45,6 +46,11 @@ function createKeyBuilders(config) {
|
|
|
45
46
|
// Redis Streams keys
|
|
46
47
|
eventStream: () => `${prefix}events:stream`,
|
|
47
48
|
eventStreamDeadLetter: () => `${prefix}events:deadletter`,
|
|
49
|
+
// Learning (contextual bandit) keys
|
|
50
|
+
learningModel: () => `${prefix}learning:model`,
|
|
51
|
+
learningDecision: (assignmentId) => `${prefix}learning:decision:${assignmentId}`,
|
|
52
|
+
learningEpisode: (assignmentId) => `${prefix}learning:episode:${assignmentId}`,
|
|
53
|
+
learningStats: () => `${prefix}learning:stats`,
|
|
48
54
|
// Workflow reliability keys
|
|
49
55
|
// Reliability and audit keys
|
|
50
56
|
deadLetterQueue: () => `${prefix}workflow:dlq`,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* .build();
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
import type { WorkflowDefinition, WorkflowStep, Assignment } from './types/matcher';
|
|
40
|
+
import type { WorkflowDefinition, WorkflowStep, Assignment, WorkflowTaskType, WorkflowTargetUser } from './types/matcher';
|
|
41
41
|
/**
|
|
42
42
|
* Builder for individual workflow steps.
|
|
43
43
|
*/
|
|
@@ -45,6 +45,10 @@ export declare class WorkflowStepBuilder {
|
|
|
45
45
|
private step;
|
|
46
46
|
private parentBuilder;
|
|
47
47
|
constructor(id: string, parentBuilder: WorkflowBuilder);
|
|
48
|
+
/**
|
|
49
|
+
* Set execution mode for this step.
|
|
50
|
+
*/
|
|
51
|
+
taskType(type: WorkflowTaskType): this;
|
|
48
52
|
/**
|
|
49
53
|
* Set the step name.
|
|
50
54
|
*/
|
|
@@ -53,13 +57,15 @@ export declare class WorkflowStepBuilder {
|
|
|
53
57
|
* Set the assignment template for this step.
|
|
54
58
|
*/
|
|
55
59
|
assignment(template: Partial<Assignment>): this;
|
|
60
|
+
/**
|
|
61
|
+
* Configure this step as a machine/code task.
|
|
62
|
+
*/
|
|
63
|
+
machineTask(handler: string, input?: Record<string, any>): this;
|
|
56
64
|
/**
|
|
57
65
|
* Set the target user for this step.
|
|
58
66
|
* @param target - 'initiator' | 'previous' | userId | { tag: string }
|
|
59
67
|
*/
|
|
60
|
-
targetUser(target:
|
|
61
|
-
tag: string;
|
|
62
|
-
}): this;
|
|
68
|
+
targetUser(target: WorkflowTargetUser): this;
|
|
63
69
|
/**
|
|
64
70
|
* Add a routing rule for conditional branching.
|
|
65
71
|
* @param condition - Expression to evaluate (e.g., 'result.approved === true')
|
|
@@ -166,6 +172,11 @@ export declare function linearWorkflow(id: string, name: string, steps: Array<{
|
|
|
166
172
|
targetUser?: 'initiator' | 'previous' | string | {
|
|
167
173
|
tag: string;
|
|
168
174
|
};
|
|
175
|
+
taskType?: WorkflowTaskType;
|
|
176
|
+
machineTask?: {
|
|
177
|
+
handler: string;
|
|
178
|
+
input?: Record<string, any>;
|
|
179
|
+
};
|
|
169
180
|
timeoutMs?: number;
|
|
170
181
|
}>): WorkflowDefinition;
|
|
171
182
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-builder.d.ts","sourceRoot":"","sources":["../src/workflow-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EACR,kBAAkB,
|
|
1
|
+
{"version":3,"file":"workflow-builder.d.ts","sourceRoot":"","sources":["../src/workflow-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EACR,kBAAkB,EAElB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,iBAAiB,CAAC;AAG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AC;CACtB,CAAC,GACH,kBAAkB,CAuBpB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACL,gBAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,gBAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,GACF,kBAAkB,CA6BpB"}
|
package/dist/workflow-builder.js
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
*/
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
exports.approvalWorkflow = exports.linearWorkflow = exports.workflow = exports.WorkflowBuilder = exports.WorkflowStepBuilder = void 0;
|
|
43
|
+
const workflow_validation_1 = require("./workflow-validation");
|
|
43
44
|
/**
|
|
44
45
|
* Builder for individual workflow steps.
|
|
45
46
|
*/
|
|
@@ -49,10 +50,18 @@ class WorkflowStepBuilder {
|
|
|
49
50
|
this.step = {
|
|
50
51
|
id,
|
|
51
52
|
name: id,
|
|
53
|
+
taskType: 'assignment',
|
|
52
54
|
assignmentTemplate: {},
|
|
53
55
|
targetUser: 'initiator',
|
|
54
56
|
};
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Set execution mode for this step.
|
|
60
|
+
*/
|
|
61
|
+
taskType(type) {
|
|
62
|
+
this.step.taskType = type;
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
56
65
|
/**
|
|
57
66
|
* Set the step name.
|
|
58
67
|
*/
|
|
@@ -67,6 +76,14 @@ class WorkflowStepBuilder {
|
|
|
67
76
|
this.step.assignmentTemplate = template;
|
|
68
77
|
return this;
|
|
69
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Configure this step as a machine/code task.
|
|
81
|
+
*/
|
|
82
|
+
machineTask(handler, input) {
|
|
83
|
+
this.step.taskType = 'machine';
|
|
84
|
+
this.step.machineTask = { handler, input };
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
70
87
|
/**
|
|
71
88
|
* Set the target user for this step.
|
|
72
89
|
* @param target - 'initiator' | 'previous' | userId | { tag: string }
|
|
@@ -135,6 +152,9 @@ class WorkflowStepBuilder {
|
|
|
135
152
|
* Finish configuring this step and return to the parent builder.
|
|
136
153
|
*/
|
|
137
154
|
done() {
|
|
155
|
+
if ((this.step.taskType ?? 'assignment') === 'machine' && !this.step.machineTask?.handler) {
|
|
156
|
+
throw new Error(`Machine step "${this.step.id}" requires machineTask(handler)`);
|
|
157
|
+
}
|
|
138
158
|
this.parentBuilder._addStep(this.step);
|
|
139
159
|
return this.parentBuilder;
|
|
140
160
|
}
|
|
@@ -220,54 +240,15 @@ class WorkflowBuilder {
|
|
|
220
240
|
* @throws Error if the workflow is invalid
|
|
221
241
|
*/
|
|
222
242
|
build() {
|
|
223
|
-
|
|
224
|
-
if (!this.definition.id) {
|
|
225
|
-
throw new Error('Workflow ID is required');
|
|
226
|
-
}
|
|
227
|
-
if (!this.definition.name) {
|
|
228
|
-
throw new Error('Workflow name is required');
|
|
229
|
-
}
|
|
230
|
-
if (this.steps.length === 0) {
|
|
231
|
-
throw new Error('Workflow must have at least one step');
|
|
232
|
-
}
|
|
233
|
-
if (!this.definition.initialStepId) {
|
|
234
|
-
// Default to first step if not specified
|
|
235
|
-
this.definition.initialStepId = this.steps[0].id;
|
|
236
|
-
}
|
|
237
|
-
// Validate initial step exists
|
|
238
|
-
const initialStep = this.steps.find(s => s.id === this.definition.initialStepId);
|
|
239
|
-
if (!initialStep) {
|
|
240
|
-
throw new Error(`Initial step "${this.definition.initialStepId}" not found`);
|
|
241
|
-
}
|
|
242
|
-
// Validate all referenced step IDs exist
|
|
243
|
-
for (const step of this.steps) {
|
|
244
|
-
if (step.routing) {
|
|
245
|
-
for (const route of step.routing) {
|
|
246
|
-
if (!this.steps.find(s => s.id === route.targetStepId)) {
|
|
247
|
-
throw new Error(`Step "${step.id}" references non-existent step "${route.targetStepId}" in routing`);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (step.defaultNextStepId && !this.steps.find(s => s.id === step.defaultNextStepId)) {
|
|
252
|
-
throw new Error(`Step "${step.id}" references non-existent step "${step.defaultNextStepId}" as default next`);
|
|
253
|
-
}
|
|
254
|
-
if (step.parallelStepIds) {
|
|
255
|
-
for (const parallelId of step.parallelStepIds) {
|
|
256
|
-
if (!this.steps.find(s => s.id === parallelId)) {
|
|
257
|
-
throw new Error(`Step "${step.id}" references non-existent parallel step "${parallelId}"`);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
243
|
+
return (0, workflow_validation_1.normalizeWorkflowDefinition)({
|
|
263
244
|
id: this.definition.id,
|
|
264
245
|
name: this.definition.name,
|
|
265
|
-
version: this.definition.version
|
|
246
|
+
version: this.definition.version,
|
|
266
247
|
initialStepId: this.definition.initialStepId,
|
|
267
248
|
steps: this.steps,
|
|
268
249
|
defaultTimeoutMs: this.definition.defaultTimeoutMs,
|
|
269
250
|
metadata: this.definition.metadata,
|
|
270
|
-
};
|
|
251
|
+
});
|
|
271
252
|
}
|
|
272
253
|
}
|
|
273
254
|
exports.WorkflowBuilder = WorkflowBuilder;
|
|
@@ -291,8 +272,10 @@ function linearWorkflow(id, name, steps) {
|
|
|
291
272
|
const workflowSteps = steps.map((step, index) => ({
|
|
292
273
|
id: step.id,
|
|
293
274
|
name: step.name,
|
|
275
|
+
taskType: step.taskType ?? 'assignment',
|
|
294
276
|
assignmentTemplate: step.assignment,
|
|
295
277
|
targetUser: step.targetUser ?? 'initiator',
|
|
278
|
+
machineTask: step.machineTask,
|
|
296
279
|
defaultNextStepId: index < steps.length - 1 ? steps[index + 1].id : null,
|
|
297
280
|
timeoutMs: step.timeoutMs,
|
|
298
281
|
}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WorkflowDefinition, WorkflowDefinitionInput } from './types/matcher';
|
|
2
|
+
export declare function validateWorkflowDefinition(definition: WorkflowDefinition): WorkflowDefinition;
|
|
3
|
+
export declare function normalizeWorkflowDefinition(definition: WorkflowDefinitionInput | WorkflowDefinition): WorkflowDefinition;
|
|
4
|
+
//# sourceMappingURL=workflow-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-validation.d.ts","sourceRoot":"","sources":["../src/workflow-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kBAAkB,EAClB,uBAAuB,EAE1B,MAAM,iBAAiB,CAAC;AAgCzB,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,CAsD7F;AAED,wBAAgB,2BAA2B,CACvC,UAAU,EAAE,uBAAuB,GAAG,kBAAkB,GACzD,kBAAkB,CAuBpB"}
|