@quarry-systems/drift-timer 0.1.0 → 0.1.1-alpha.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quarry-systems/drift-timer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-alpha.1",
4
4
  "description": "Timer and scheduling plugin for Drift",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "vitest": "^2.1.0"
27
27
  },
28
28
  "files": [
29
- "dist",
29
+ "src",
30
30
  "README.md",
31
31
  "LICENSE.md",
32
32
  "CHANGELOG.md"
package/src/index.d.ts ADDED
@@ -0,0 +1,110 @@
1
+ /**
2
+ * MCG Timer Plugin
3
+ *
4
+ * Provides timing and scheduling capabilities for Managed Cyclic Graph nodes.
5
+ * Supports delays, scheduled waits, and cron-like patterns.
6
+ */
7
+ import type { Plugin } from '@quarry-systems/drift-contracts';
8
+ type AnyCtx = any;
9
+ export interface TimerConfig {
10
+ /** Sleep for a specific duration in milliseconds */
11
+ sleepMs?: number;
12
+ /** Wait until a specific date/time */
13
+ waitUntil?: Date | string | number;
14
+ /** Cron-like pattern for scheduling (simplified) */
15
+ cronPattern?: CronPattern;
16
+ /** Custom path to store timer metadata (default: data.timer.{nodeId}) */
17
+ storePath?: string;
18
+ /** Callback when timer starts */
19
+ onStart?: (ctx: AnyCtx) => void | Promise<void>;
20
+ /** Callback when timer completes */
21
+ onComplete?: (ctx: AnyCtx) => void | Promise<void>;
22
+ }
23
+ export interface CronPattern {
24
+ /** Type of cron pattern */
25
+ type: 'daily' | 'weekly' | 'monthly' | 'custom';
26
+ /** Hour (0-23) */
27
+ hour?: number;
28
+ /** Minute (0-59) */
29
+ minute?: number;
30
+ /** Day of week (0-6, Sunday=0) for weekly patterns */
31
+ dayOfWeek?: number;
32
+ /** Day of month (1-31) for monthly patterns */
33
+ dayOfMonth?: number;
34
+ /** Skip weekends (Saturday/Sunday) */
35
+ skipWeekends?: boolean;
36
+ /** Custom cron expression (advanced) */
37
+ expression?: string;
38
+ }
39
+ export interface TimerNode {
40
+ id: string;
41
+ meta: {
42
+ timer: TimerConfig;
43
+ };
44
+ }
45
+ export interface TimerMetadata {
46
+ startTime: number;
47
+ targetTime: number;
48
+ duration: number;
49
+ completed: boolean;
50
+ pattern?: string;
51
+ }
52
+ /**
53
+ * Sleep for a specified duration
54
+ */
55
+ export declare function sleep(ms: number): TimerConfig;
56
+ /**
57
+ * Wait until a specific date/time
58
+ */
59
+ export declare function waitUntil(date: Date | string | number): TimerConfig;
60
+ /**
61
+ * Wait until next occurrence of daily time (e.g., "8:00 AM")
62
+ */
63
+ export declare function dailyAt(hour: number, minute?: number): TimerConfig;
64
+ /**
65
+ * Wait until next occurrence of weekly time (e.g., "Monday 9:00 AM")
66
+ */
67
+ export declare function weeklyAt(dayOfWeek: number, hour: number, minute?: number): TimerConfig;
68
+ /**
69
+ * Wait until next business day at specified time
70
+ */
71
+ export declare function nextBusinessDay(hour?: number, minute?: number): TimerConfig;
72
+ /**
73
+ * Create an execute action that performs a timer delay
74
+ *
75
+ * @param nodeId - The node ID (used for storing metadata in context)
76
+ * @param config - Timer configuration
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * .node('wait', {
81
+ * execute: [
82
+ * createTimerAction('wait', sleep(5000))
83
+ * ]
84
+ * })
85
+ * ```
86
+ */
87
+ export declare function createTimerAction(nodeId: string, config: TimerConfig): {
88
+ id: string;
89
+ description: string;
90
+ run: (ctx: AnyCtx) => Promise<AnyCtx>;
91
+ };
92
+ /**
93
+ * MCG Timer Plugin
94
+ *
95
+ * Register this plugin to enable timer/scheduling nodes.
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const graph = new ManagedCyclicGraph()
100
+ * .use(mcgTimerPlugin)
101
+ * .node('wait5sec', {
102
+ * type: 'timernode',
103
+ * meta: {
104
+ * timer: sleep(5000)
105
+ * }
106
+ * })
107
+ * ```
108
+ */
109
+ export declare const mcgTimerPlugin: Plugin<AnyCtx>;
110
+ export default mcgTimerPlugin;
package/src/index.js ADDED
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ /**
3
+ * MCG Timer Plugin
4
+ *
5
+ * Provides timing and scheduling capabilities for Managed Cyclic Graph nodes.
6
+ * Supports delays, scheduled waits, and cron-like patterns.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.mcgTimerPlugin = void 0;
10
+ exports.sleep = sleep;
11
+ exports.waitUntil = waitUntil;
12
+ exports.dailyAt = dailyAt;
13
+ exports.weeklyAt = weeklyAt;
14
+ exports.nextBusinessDay = nextBusinessDay;
15
+ exports.createTimerAction = createTimerAction;
16
+ // ============================================================================
17
+ // Helper Functions
18
+ // ============================================================================
19
+ /**
20
+ * Sleep for a specified duration
21
+ */
22
+ function sleep(ms) {
23
+ return { sleepMs: ms };
24
+ }
25
+ /**
26
+ * Wait until a specific date/time
27
+ */
28
+ function waitUntil(date) {
29
+ return { waitUntil: date };
30
+ }
31
+ /**
32
+ * Wait until next occurrence of daily time (e.g., "8:00 AM")
33
+ */
34
+ function dailyAt(hour, minute = 0) {
35
+ return {
36
+ cronPattern: {
37
+ type: 'daily',
38
+ hour,
39
+ minute
40
+ }
41
+ };
42
+ }
43
+ /**
44
+ * Wait until next occurrence of weekly time (e.g., "Monday 9:00 AM")
45
+ */
46
+ function weeklyAt(dayOfWeek, hour, minute = 0) {
47
+ return {
48
+ cronPattern: {
49
+ type: 'weekly',
50
+ dayOfWeek,
51
+ hour,
52
+ minute
53
+ }
54
+ };
55
+ }
56
+ /**
57
+ * Wait until next business day at specified time
58
+ */
59
+ function nextBusinessDay(hour = 9, minute = 0) {
60
+ return {
61
+ cronPattern: {
62
+ type: 'daily',
63
+ hour,
64
+ minute,
65
+ skipWeekends: true
66
+ }
67
+ };
68
+ }
69
+ /**
70
+ * Calculate next execution time based on cron pattern
71
+ */
72
+ function calculateNextExecution(pattern) {
73
+ const now = new Date();
74
+ const next = new Date(now);
75
+ switch (pattern.type) {
76
+ case 'daily': {
77
+ next.setHours(pattern.hour ?? 0, pattern.minute ?? 0, 0, 0);
78
+ // If time has passed today, move to tomorrow
79
+ if (next <= now) {
80
+ next.setDate(next.getDate() + 1);
81
+ }
82
+ // Skip weekends if requested
83
+ if (pattern.skipWeekends) {
84
+ while (next.getDay() === 0 || next.getDay() === 6) {
85
+ next.setDate(next.getDate() + 1);
86
+ }
87
+ }
88
+ return next;
89
+ }
90
+ case 'weekly': {
91
+ const targetDay = pattern.dayOfWeek ?? 0;
92
+ const currentDay = next.getDay();
93
+ let daysToAdd = targetDay - currentDay;
94
+ if (daysToAdd < 0 || (daysToAdd === 0 && next.getHours() >= (pattern.hour ?? 0))) {
95
+ daysToAdd += 7;
96
+ }
97
+ next.setDate(next.getDate() + daysToAdd);
98
+ next.setHours(pattern.hour ?? 0, pattern.minute ?? 0, 0, 0);
99
+ return next;
100
+ }
101
+ case 'monthly': {
102
+ next.setDate(pattern.dayOfMonth ?? 1);
103
+ next.setHours(pattern.hour ?? 0, pattern.minute ?? 0, 0, 0);
104
+ // If time has passed this month, move to next month
105
+ if (next <= now) {
106
+ next.setMonth(next.getMonth() + 1);
107
+ }
108
+ return next;
109
+ }
110
+ default:
111
+ return new Date(now.getTime() + 60000); // Default: 1 minute from now
112
+ }
113
+ }
114
+ /**
115
+ * Execute the timer delay
116
+ */
117
+ async function executeTimer(config) {
118
+ const startTime = Date.now();
119
+ let targetTime;
120
+ let duration;
121
+ let pattern;
122
+ if (config.sleepMs !== undefined) {
123
+ // Simple sleep
124
+ duration = config.sleepMs;
125
+ targetTime = startTime + duration;
126
+ await new Promise(resolve => setTimeout(resolve, duration));
127
+ }
128
+ else if (config.waitUntil !== undefined) {
129
+ // Wait until specific time
130
+ const target = typeof config.waitUntil === 'string' || typeof config.waitUntil === 'number'
131
+ ? new Date(config.waitUntil)
132
+ : config.waitUntil;
133
+ targetTime = target.getTime();
134
+ duration = Math.max(0, targetTime - startTime);
135
+ if (duration > 0) {
136
+ await new Promise(resolve => setTimeout(resolve, duration));
137
+ }
138
+ }
139
+ else if (config.cronPattern) {
140
+ // Cron-like scheduling
141
+ const target = calculateNextExecution(config.cronPattern);
142
+ targetTime = target.getTime();
143
+ duration = Math.max(0, targetTime - startTime);
144
+ pattern = JSON.stringify(config.cronPattern);
145
+ if (duration > 0) {
146
+ await new Promise(resolve => setTimeout(resolve, duration));
147
+ }
148
+ }
149
+ else {
150
+ // No timer specified, return immediately
151
+ targetTime = startTime;
152
+ duration = 0;
153
+ }
154
+ return {
155
+ startTime,
156
+ targetTime,
157
+ duration,
158
+ completed: true,
159
+ pattern
160
+ };
161
+ }
162
+ // ============================================================================
163
+ // Plugin Handler
164
+ // ============================================================================
165
+ const timernode = async (node, ctx, meta) => {
166
+ const config = meta;
167
+ if (!config) {
168
+ throw new Error(`Timer node "${node.id}" missing timer configuration in meta.timer`);
169
+ }
170
+ // Call onStart callback
171
+ if (config.onStart) {
172
+ await config.onStart(ctx);
173
+ }
174
+ // Execute the timer
175
+ const metadata = await executeTimer(config);
176
+ // Call onComplete callback
177
+ if (config.onComplete) {
178
+ await config.onComplete(ctx);
179
+ }
180
+ // Store metadata in context
181
+ const storePath = config.storePath || `data.timer.${node.id}`;
182
+ const pathParts = storePath.split('.');
183
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
184
+ let target = ctx;
185
+ for (let i = 0; i < pathParts.length - 1; i++) {
186
+ const part = pathParts[i];
187
+ if (!target[part]) {
188
+ target[part] = {};
189
+ }
190
+ target = target[part];
191
+ }
192
+ const finalKey = pathParts[pathParts.length - 1];
193
+ target[finalKey] = metadata;
194
+ return ctx;
195
+ };
196
+ // ============================================================================
197
+ // Action Creator (Convenience Wrapper)
198
+ // ============================================================================
199
+ /**
200
+ * Create an execute action that performs a timer delay
201
+ *
202
+ * @param nodeId - The node ID (used for storing metadata in context)
203
+ * @param config - Timer configuration
204
+ *
205
+ * @example
206
+ * ```typescript
207
+ * .node('wait', {
208
+ * execute: [
209
+ * createTimerAction('wait', sleep(5000))
210
+ * ]
211
+ * })
212
+ * ```
213
+ */
214
+ function createTimerAction(nodeId, config) {
215
+ return {
216
+ id: `timer-${nodeId}`,
217
+ description: `Timer: ${config.sleepMs ? `sleep ${config.sleepMs}ms` : config.waitUntil ? `wait until ${config.waitUntil}` : 'cron schedule'}`,
218
+ run: async (ctx) => {
219
+ const tempNode = {
220
+ id: nodeId,
221
+ meta: { timer: config }
222
+ };
223
+ return await timernode(tempNode, ctx, config);
224
+ }
225
+ };
226
+ }
227
+ // ============================================================================
228
+ // Plugin Export
229
+ // ============================================================================
230
+ /**
231
+ * MCG Timer Plugin
232
+ *
233
+ * Register this plugin to enable timer/scheduling nodes.
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * const graph = new ManagedCyclicGraph()
238
+ * .use(mcgTimerPlugin)
239
+ * .node('wait5sec', {
240
+ * type: 'timernode',
241
+ * meta: {
242
+ * timer: sleep(5000)
243
+ * }
244
+ * })
245
+ * ```
246
+ */
247
+ exports.mcgTimerPlugin = {
248
+ name: 'drift-timer',
249
+ version: '0.1.0',
250
+ description: 'Timer and scheduling plugin for Drift',
251
+ nodes: {
252
+ timernode,
253
+ },
254
+ };
255
+ exports.default = exports.mcgTimerPlugin;
256
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/drift/drift-plugins/mcg-timer/src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA4EH,sBAEC;AAKD,8BAEC;AAKD,0BAQC;AAKD,4BASC;AAKD,0CASC;AA8KD,8CAaC;AApPD,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,SAAgB,KAAK,CAAC,EAAU;IAC9B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,SAAgB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E;YAC1C,MAAM,QAAQ,GAAc;gBAC1B,EAAE,EAAE,MAAM;gBACV,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;aACxB,CAAC;YAEF,OAAO,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,cAAc,GAAmB;IAC5C,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,SAAS;KACV;CACF,CAAC;AAEF,kBAAe,sBAAc,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Plugin Manifest for @quarry-systems/mcg-timer
3
+ *
4
+ * This manifest declares the plugin's metadata, capabilities, and requirements.
5
+ * It enables future security policies, sandboxing, and hosted execution.
6
+ */
7
+ import type { PluginManifest } from '@quarry-systems/drift-contracts';
8
+ export declare const manifest: PluginManifest;
9
+ export default manifest;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * Plugin Manifest for @quarry-systems/mcg-timer
4
+ *
5
+ * This manifest declares the plugin's metadata, capabilities, and requirements.
6
+ * It enables future security policies, sandboxing, and hosted execution.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.manifest = void 0;
10
+ exports.manifest = {
11
+ name: '@quarry-systems/mcg-timer',
12
+ version: '0.6.0',
13
+ apiVersion: '1.0',
14
+ description: 'Timer and delay plugin for Managed Cyclic Graph (MCG)',
15
+ author: {
16
+ name: 'Quarry Systems',
17
+ email: 'support@quarrysystems.com',
18
+ },
19
+ license: 'ISC',
20
+ type: ['node'],
21
+ capabilities: {
22
+ network: false,
23
+ filesystem: false,
24
+ secrets: false,
25
+ subprocess: false,
26
+ },
27
+ nodes: [
28
+ {
29
+ id: 'delay',
30
+ name: 'Delay',
31
+ description: 'Delay execution for a specified duration',
32
+ category: 'utility',
33
+ },
34
+ {
35
+ id: 'timer',
36
+ name: 'Timer',
37
+ description: 'Execute at scheduled intervals',
38
+ category: 'utility',
39
+ },
40
+ ],
41
+ services: [],
42
+ peerDependencies: {
43
+ '@quarry-systems/drift-core': '^0.6.0',
44
+ '@quarry-systems/drift-contracts': '^0.6.0',
45
+ },
46
+ keywords: ['drift', 'mcg', 'managed-cyclic-graph', 'plugin', 'timer', 'delay', 'schedule', 'cron'],
47
+ repository: {
48
+ type: 'git',
49
+ url: 'https://github.com/quarry-systems/quarry-systems',
50
+ directory: 'libs/drift/drift-plugins/mcg-timer',
51
+ },
52
+ };
53
+ exports.default = exports.manifest;
54
+ //# sourceMappingURL=plugin.manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.manifest.js","sourceRoot":"","sources":["../../../../../../libs/drift/drift-plugins/mcg-timer/src/plugin.manifest.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAIU,QAAA,QAAQ,GAAmB;IACtC,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,KAAK;IAEjB,WAAW,EAAE,uDAAuD;IAEpE,MAAM,EAAE;QACN,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,2BAA2B;KACnC;IAED,OAAO,EAAE,KAAK;IAEd,IAAI,EAAE,CAAC,MAAM,CAAC;IAEd,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,KAAK;KAClB;IAED,KAAK,EAAE;QACL;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,SAAS;SACpB;QACD;YACE,EAAE,EAAE,OAAO;YACX,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,SAAS;SACpB;KACF;IAED,QAAQ,EAAE,EAAE;IAEZ,gBAAgB,EAAE;QAChB,4BAA4B,EAAE,QAAQ;QACtC,iCAAiC,EAAE,QAAQ;KAC5C;IAED,QAAQ,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IAElG,UAAU,EAAE;QACV,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,kDAAkD;QACvD,SAAS,EAAE,oCAAoC;KAChD;CACF,CAAC;AAEF,kBAAe,gBAAQ,CAAC"}