@open-loyalty/mcp-server 1.3.7 → 1.4.1

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 (39) hide show
  1. package/dist/instructions.d.ts +1 -1
  2. package/dist/instructions.js +18 -5
  3. package/dist/tools/reward/handlers.d.ts +2 -0
  4. package/dist/tools/reward/handlers.js +52 -6
  5. package/dist/tools/reward/index.d.ts +2 -0
  6. package/dist/tools/reward/index.js +13 -7
  7. package/dist/tools/reward/schemas.d.ts +2 -0
  8. package/dist/tools/reward/schemas.js +15 -5
  9. package/dist/tools/tierset.d.ts +1 -1
  10. package/dist/tools/tierset.js +49 -25
  11. package/dist/tools/transaction.js +5 -2
  12. package/dist/tools/wallet-type.js +26 -17
  13. package/dist/types/schemas/admin.d.ts +6 -6
  14. package/dist/types/schemas/role.d.ts +4 -4
  15. package/package.json +1 -1
  16. package/dist/prompts/fan-engagement-setup.d.ts +0 -107
  17. package/dist/prompts/fan-engagement-setup.js +0 -492
  18. package/dist/tools/achievement.d.ts +0 -1017
  19. package/dist/tools/achievement.js +0 -354
  20. package/dist/tools/campaign.d.ts +0 -1800
  21. package/dist/tools/campaign.js +0 -737
  22. package/dist/tools/member.d.ts +0 -366
  23. package/dist/tools/member.js +0 -352
  24. package/dist/tools/reward.d.ts +0 -279
  25. package/dist/tools/reward.js +0 -361
  26. package/dist/tools/segment.d.ts +0 -816
  27. package/dist/tools/segment.js +0 -333
  28. package/dist/workflows/app-login-streak.d.ts +0 -39
  29. package/dist/workflows/app-login-streak.js +0 -298
  30. package/dist/workflows/early-arrival.d.ts +0 -33
  31. package/dist/workflows/early-arrival.js +0 -148
  32. package/dist/workflows/index.d.ts +0 -101
  33. package/dist/workflows/index.js +0 -208
  34. package/dist/workflows/match-attendance.d.ts +0 -45
  35. package/dist/workflows/match-attendance.js +0 -308
  36. package/dist/workflows/sportsbar-visit.d.ts +0 -41
  37. package/dist/workflows/sportsbar-visit.js +0 -284
  38. package/dist/workflows/vod-watching.d.ts +0 -43
  39. package/dist/workflows/vod-watching.js +0 -326
@@ -11,16 +11,16 @@ export declare const AdminRoleSchema: z.ZodObject<{
11
11
  default: z.ZodOptional<z.ZodBoolean>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  name?: string | undefined;
14
+ default?: boolean | undefined;
14
15
  id?: string | number | undefined;
15
16
  role?: string | undefined;
16
17
  master?: boolean | undefined;
17
- default?: boolean | undefined;
18
18
  }, {
19
19
  name?: string | undefined;
20
+ default?: boolean | undefined;
20
21
  id?: string | number | undefined;
21
22
  role?: string | undefined;
22
23
  master?: boolean | undefined;
23
- default?: boolean | undefined;
24
24
  }>;
25
25
  export type AdminRole = z.infer<typeof AdminRoleSchema>;
26
26
  /**
@@ -58,16 +58,16 @@ export declare const AdminUserSchema: z.ZodObject<{
58
58
  default: z.ZodOptional<z.ZodBoolean>;
59
59
  }, "strip", z.ZodTypeAny, {
60
60
  name?: string | undefined;
61
+ default?: boolean | undefined;
61
62
  id?: string | number | undefined;
62
63
  role?: string | undefined;
63
64
  master?: boolean | undefined;
64
- default?: boolean | undefined;
65
65
  }, {
66
66
  name?: string | undefined;
67
+ default?: boolean | undefined;
67
68
  id?: string | number | undefined;
68
69
  role?: string | undefined;
69
70
  master?: boolean | undefined;
70
- default?: boolean | undefined;
71
71
  }>, "many">>;
72
72
  settings: z.ZodOptional<z.ZodObject<{
73
73
  notificationsEnabled: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
@@ -92,10 +92,10 @@ export declare const AdminUserSchema: z.ZodObject<{
92
92
  canChangePassword?: boolean | undefined;
93
93
  roles?: {
94
94
  name?: string | undefined;
95
+ default?: boolean | undefined;
95
96
  id?: string | number | undefined;
96
97
  role?: string | undefined;
97
98
  master?: boolean | undefined;
98
- default?: boolean | undefined;
99
99
  }[] | undefined;
100
100
  settings?: {
101
101
  notificationsEnabled?: string | boolean | undefined;
@@ -115,10 +115,10 @@ export declare const AdminUserSchema: z.ZodObject<{
115
115
  canChangePassword?: boolean | undefined;
116
116
  roles?: {
117
117
  name?: string | undefined;
118
+ default?: boolean | undefined;
118
119
  id?: string | number | undefined;
119
120
  role?: string | undefined;
120
121
  master?: boolean | undefined;
121
- default?: boolean | undefined;
122
122
  }[] | undefined;
123
123
  settings?: {
124
124
  notificationsEnabled?: string | boolean | undefined;
@@ -56,9 +56,9 @@ export declare const RoleSchema: z.ZodObject<{
56
56
  }, "strip", z.ZodTypeAny, {
57
57
  name: string;
58
58
  id: string | number;
59
+ default?: boolean | undefined;
59
60
  role?: string | undefined;
60
61
  master?: boolean | undefined;
61
- default?: boolean | undefined;
62
62
  permissions?: {
63
63
  resource: string;
64
64
  access: string;
@@ -70,9 +70,9 @@ export declare const RoleSchema: z.ZodObject<{
70
70
  }, {
71
71
  name: string;
72
72
  id: string | number;
73
+ default?: boolean | undefined;
73
74
  role?: string | undefined;
74
75
  master?: boolean | undefined;
75
- default?: boolean | undefined;
76
76
  permissions?: {
77
77
  resource: string;
78
78
  access: string;
@@ -116,9 +116,9 @@ export declare const RoleListItemSchema: z.ZodObject<{
116
116
  }, "strip", z.ZodTypeAny, {
117
117
  name: string;
118
118
  id: string | number;
119
+ default?: boolean | undefined;
119
120
  role?: string | undefined;
120
121
  master?: boolean | undefined;
121
- default?: boolean | undefined;
122
122
  permissions?: {
123
123
  resource: string;
124
124
  access: string;
@@ -130,9 +130,9 @@ export declare const RoleListItemSchema: z.ZodObject<{
130
130
  }, {
131
131
  name: string;
132
132
  id: string | number;
133
+ default?: boolean | undefined;
133
134
  role?: string | undefined;
134
135
  master?: boolean | undefined;
135
- default?: boolean | undefined;
136
136
  permissions?: {
137
137
  resource: string;
138
138
  access: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-loyalty/mcp-server",
3
- "version": "1.3.7",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "description": "MCP server for Open Loyalty API - enables AI agents to manage loyalty programs, members, points, rewards, and transactions",
6
6
  "author": "Marcin Dyguda <md@openloyalty.io>",
@@ -1,107 +0,0 @@
1
- /**
2
- * Fan Engagement Setup Prompts
3
- *
4
- * MCP prompt templates for guided campaign setup.
5
- * These define conversational flows and default values for AI agents
6
- * to help program admins create fan engagement campaigns.
7
- */
8
- export interface WorkflowQuestion {
9
- id: string;
10
- question: string;
11
- type: "number" | "boolean" | "string" | "select";
12
- default?: unknown;
13
- options?: string[];
14
- validation?: (value: unknown) => boolean;
15
- hint?: string;
16
- }
17
- export interface WorkflowStep {
18
- id: string;
19
- action: string;
20
- tool: string;
21
- description: string;
22
- }
23
- export interface WorkflowDefinition {
24
- id: string;
25
- name: string;
26
- description: string;
27
- triggerPhrases: string[];
28
- questions: WorkflowQuestion[];
29
- steps: WorkflowStep[];
30
- }
31
- export declare const DEFAULTS: {
32
- readonly matchAttendance: {
33
- readonly coinsPerMatch: 50;
34
- readonly milestones: number[];
35
- readonly milestoneBonuses: Record<string | number, number>;
36
- readonly limitPerDay: 1;
37
- readonly badges: Record<string | number, string>;
38
- };
39
- readonly earlyArrival: {
40
- readonly minutesBefore: 60;
41
- readonly coinsPerArrival: 25;
42
- readonly limitPerMatch: 1;
43
- };
44
- readonly sportsbarVisit: {
45
- readonly coinsPerVisit: 50;
46
- readonly visitMilestone: 5;
47
- readonly milestoneBonus: 500;
48
- readonly limitPerDay: 1;
49
- };
50
- readonly vodWatching: {
51
- readonly trackBy: "views" | "minutes";
52
- readonly coinsPerUnit: 10;
53
- readonly unitSize: 10;
54
- readonly achievementMinutes: 300;
55
- readonly achievementBonus: 200;
56
- };
57
- readonly appLoginStreak: {
58
- readonly coinsPerLogin: 5;
59
- readonly streakDays: 7;
60
- readonly streakBonus: 50;
61
- readonly limitPerDay: 1;
62
- };
63
- readonly seasonDates: {
64
- readonly start: string;
65
- readonly end: string;
66
- };
67
- };
68
- export declare const MATCH_ATTENDANCE_WORKFLOW: WorkflowDefinition;
69
- export declare const EARLY_ARRIVAL_WORKFLOW: WorkflowDefinition;
70
- export declare const SPORTSBAR_VISIT_WORKFLOW: WorkflowDefinition;
71
- export declare const VOD_WATCHING_WORKFLOW: WorkflowDefinition;
72
- export declare const APP_LOGIN_STREAK_WORKFLOW: WorkflowDefinition;
73
- export declare const ALL_WORKFLOWS: WorkflowDefinition[];
74
- /**
75
- * Find matching workflow based on user input
76
- */
77
- export declare function findMatchingWorkflow(userInput: string): WorkflowDefinition | undefined;
78
- /**
79
- * Get workflow by ID
80
- */
81
- export declare function getWorkflowById(id: string): WorkflowDefinition | undefined;
82
- /**
83
- * Parse comma-separated values to array
84
- */
85
- export declare function parseCommaSeparated(value: string): string[];
86
- /**
87
- * Parse milestones (handles both numbers and percentages like "80%")
88
- */
89
- export declare function parseMilestones(value: string): (number | string)[];
90
- /**
91
- * Format ISO date for Open Loyalty (YYYY-MM-DD HH:mm+TZ)
92
- */
93
- export declare function formatOLDate(date: string | Date): string;
94
- export declare const AGENT_PROMPTS: {
95
- /**
96
- * System prompt for fan engagement setup
97
- */
98
- systemPrompt: string;
99
- /**
100
- * Workflow completion template
101
- */
102
- completionTemplate: (results: {
103
- campaignIds: string[];
104
- achievementIds: string[];
105
- summary: string;
106
- }) => string;
107
- };