@pie-qti/transform-core 0.1.1 → 0.1.4

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 (129) hide show
  1. package/dist/config/config-loader.d.ts +25 -0
  2. package/dist/config/config-loader.d.ts.map +1 -0
  3. package/dist/config/config-loader.js +142 -0
  4. package/dist/config/config-loader.js.map +1 -0
  5. package/dist/config/plugin-loader.d.ts +19 -0
  6. package/dist/config/plugin-loader.d.ts.map +1 -0
  7. package/dist/config/plugin-loader.js +62 -0
  8. package/dist/config/plugin-loader.js.map +1 -0
  9. package/dist/config/vendor-registry.d.ts +21 -0
  10. package/dist/config/vendor-registry.d.ts.map +1 -0
  11. package/dist/config/vendor-registry.js +91 -0
  12. package/dist/config/vendor-registry.js.map +1 -0
  13. package/dist/detectors/pie-detector.d.ts +19 -0
  14. package/dist/detectors/pie-detector.d.ts.map +1 -0
  15. package/dist/detectors/pie-detector.js +46 -0
  16. package/dist/detectors/pie-detector.js.map +1 -0
  17. package/dist/detectors/qti-detector.d.ts +20 -0
  18. package/dist/detectors/qti-detector.d.ts.map +1 -0
  19. package/dist/detectors/qti-detector.js +34 -0
  20. package/dist/detectors/qti-detector.js.map +1 -0
  21. package/dist/detectors/qti22-detector.d.ts +20 -0
  22. package/dist/detectors/qti22-detector.d.ts.map +1 -0
  23. package/dist/detectors/qti22-detector.js +34 -0
  24. package/dist/detectors/qti22-detector.js.map +1 -0
  25. package/dist/engine/index.d.ts +1 -1
  26. package/dist/engine/index.d.ts.map +1 -1
  27. package/dist/engine/index.js +1 -1
  28. package/dist/engine/index.js.map +1 -1
  29. package/dist/engine/transform-engine.d.ts +27 -10
  30. package/dist/engine/transform-engine.d.ts.map +1 -1
  31. package/dist/engine/transform-engine.js +96 -85
  32. package/dist/engine/transform-engine.js.map +1 -1
  33. package/dist/index.d.ts +8 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +11 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/orchestration/activities/detect-format-activity.d.ts +18 -0
  38. package/dist/orchestration/activities/detect-format-activity.d.ts.map +1 -0
  39. package/dist/orchestration/activities/detect-format-activity.js +51 -0
  40. package/dist/orchestration/activities/detect-format-activity.js.map +1 -0
  41. package/dist/orchestration/activities/detect-vendor-activity.d.ts +25 -0
  42. package/dist/orchestration/activities/detect-vendor-activity.d.ts.map +1 -0
  43. package/dist/orchestration/activities/detect-vendor-activity.js +27 -0
  44. package/dist/orchestration/activities/detect-vendor-activity.js.map +1 -0
  45. package/dist/orchestration/activities/index.d.ts +18 -0
  46. package/dist/orchestration/activities/index.d.ts.map +1 -0
  47. package/dist/orchestration/activities/index.js +11 -0
  48. package/dist/orchestration/activities/index.js.map +1 -0
  49. package/dist/orchestration/activities/parse-xml-activity.d.ts +18 -0
  50. package/dist/orchestration/activities/parse-xml-activity.d.ts.map +1 -0
  51. package/dist/orchestration/activities/parse-xml-activity.js +37 -0
  52. package/dist/orchestration/activities/parse-xml-activity.js.map +1 -0
  53. package/dist/orchestration/activities/read-content-activity.d.ts +24 -0
  54. package/dist/orchestration/activities/read-content-activity.d.ts.map +1 -0
  55. package/dist/orchestration/activities/read-content-activity.js +49 -0
  56. package/dist/orchestration/activities/read-content-activity.js.map +1 -0
  57. package/dist/orchestration/activities/transform-qti-to-pie-activity.d.ts +23 -0
  58. package/dist/orchestration/activities/transform-qti-to-pie-activity.d.ts.map +1 -0
  59. package/dist/orchestration/activities/transform-qti-to-pie-activity.js +48 -0
  60. package/dist/orchestration/activities/transform-qti-to-pie-activity.js.map +1 -0
  61. package/dist/orchestration/activities/validate-qti-activity.d.ts +19 -0
  62. package/dist/orchestration/activities/validate-qti-activity.d.ts.map +1 -0
  63. package/dist/orchestration/activities/validate-qti-activity.js +47 -0
  64. package/dist/orchestration/activities/validate-qti-activity.js.map +1 -0
  65. package/dist/orchestration/activities/write-content-activity.d.ts +22 -0
  66. package/dist/orchestration/activities/write-content-activity.d.ts.map +1 -0
  67. package/dist/orchestration/activities/write-content-activity.js +36 -0
  68. package/dist/orchestration/activities/write-content-activity.js.map +1 -0
  69. package/dist/orchestration/in-memory-orchestrator.d.ts +44 -0
  70. package/dist/orchestration/in-memory-orchestrator.d.ts.map +1 -0
  71. package/dist/orchestration/in-memory-orchestrator.js +375 -0
  72. package/dist/orchestration/in-memory-orchestrator.js.map +1 -0
  73. package/dist/orchestration/index.d.ts +7 -0
  74. package/dist/orchestration/index.d.ts.map +1 -0
  75. package/dist/orchestration/index.js +10 -0
  76. package/dist/orchestration/index.js.map +1 -0
  77. package/dist/orchestration/workflows/batch-transform-workflow.d.ts +58 -0
  78. package/dist/orchestration/workflows/batch-transform-workflow.d.ts.map +1 -0
  79. package/dist/orchestration/workflows/batch-transform-workflow.js +100 -0
  80. package/dist/orchestration/workflows/batch-transform-workflow.js.map +1 -0
  81. package/dist/orchestration/workflows/index.d.ts +8 -0
  82. package/dist/orchestration/workflows/index.d.ts.map +1 -0
  83. package/dist/orchestration/workflows/index.js +6 -0
  84. package/dist/orchestration/workflows/index.js.map +1 -0
  85. package/dist/orchestration/workflows/transform-item-workflow.d.ts +57 -0
  86. package/dist/orchestration/workflows/transform-item-workflow.d.ts.map +1 -0
  87. package/dist/orchestration/workflows/transform-item-workflow.js +148 -0
  88. package/dist/orchestration/workflows/transform-item-workflow.js.map +1 -0
  89. package/dist/registry/format-detector-registry.d.ts +55 -0
  90. package/dist/registry/format-detector-registry.d.ts.map +1 -0
  91. package/dist/registry/format-detector-registry.js +55 -0
  92. package/dist/registry/format-detector-registry.js.map +1 -0
  93. package/dist/registry/index.d.ts +1 -1
  94. package/dist/registry/index.d.ts.map +1 -1
  95. package/dist/registry/index.js +1 -1
  96. package/dist/registry/index.js.map +1 -1
  97. package/dist/registry/plugin-registry.d.ts +1 -0
  98. package/dist/registry/plugin-registry.d.ts.map +1 -1
  99. package/dist/registry/plugin-registry.js +6 -2
  100. package/dist/registry/plugin-registry.js.map +1 -1
  101. package/dist/utils/errors.d.ts +79 -0
  102. package/dist/utils/errors.d.ts.map +1 -0
  103. package/dist/utils/errors.js +159 -0
  104. package/dist/utils/errors.js.map +1 -0
  105. package/dist/utils/index.d.ts +1 -1
  106. package/dist/utils/index.d.ts.map +1 -1
  107. package/dist/utils/index.js +1 -1
  108. package/dist/utils/index.js.map +1 -1
  109. package/dist/utils/logger.d.ts +9 -37
  110. package/dist/utils/logger.d.ts.map +1 -1
  111. package/dist/utils/logger.js +10 -58
  112. package/dist/utils/logger.js.map +1 -1
  113. package/package.json +69 -36
  114. package/.turbo/turbo-build.log +0 -1
  115. package/CHANGELOG.md +0 -10
  116. package/VALIDATION.md +0 -217
  117. package/src/engine/index.ts +0 -1
  118. package/src/engine/transform-engine.ts +0 -257
  119. package/src/index.ts +0 -18
  120. package/src/registry/index.ts +0 -1
  121. package/src/registry/plugin-registry.ts +0 -116
  122. package/src/utils/index.ts +0 -1
  123. package/src/utils/logger.ts +0 -79
  124. package/src/utils/validator.ts +0 -193
  125. package/tests/plugin-registry.test.ts +0 -154
  126. package/tests/transform-engine.test.ts +0 -168
  127. package/tests/validator.test.ts +0 -234
  128. package/tsconfig.json +0 -13
  129. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,375 @@
1
+ /**
2
+ * In-memory workflow orchestrator
3
+ *
4
+ * Simple orchestrator for development and CLI usage.
5
+ * No external dependencies, all execution happens in-process.
6
+ */
7
+ import { randomUUID } from 'crypto';
8
+ /**
9
+ * Default retry policy
10
+ */
11
+ const DEFAULT_RETRY_POLICY = {
12
+ maxAttempts: 3,
13
+ initialInterval: 1000,
14
+ maxInterval: 30000,
15
+ backoffCoefficient: 2,
16
+ };
17
+ /**
18
+ * In-memory implementation of workflow orchestrator
19
+ */
20
+ export class InMemoryOrchestrator {
21
+ name = 'in-memory';
22
+ config;
23
+ executions = new Map();
24
+ eventListeners = [];
25
+ async initialize(config) {
26
+ this.config = config;
27
+ }
28
+ async startWorkflow(definition, input, options) {
29
+ const workflowId = options?.workflowId || randomUUID();
30
+ // Create workflow context
31
+ const context = this.createWorkflowContext(workflowId, options);
32
+ // Create execution promise
33
+ const resultPromise = this.executeWorkflow(definition, context, input, options);
34
+ // Track execution
35
+ const record = {
36
+ workflowId,
37
+ workflowType: definition.type,
38
+ status: 'running',
39
+ startTime: new Date(),
40
+ resultPromise,
41
+ cancelRequested: false,
42
+ };
43
+ this.executions.set(workflowId, record);
44
+ // Emit started event
45
+ this.emitEvent({
46
+ type: 'started',
47
+ workflowId,
48
+ workflowType: definition.type,
49
+ timestamp: new Date(),
50
+ });
51
+ // Handle completion/failure
52
+ resultPromise
53
+ .then(() => {
54
+ record.status = 'completed';
55
+ record.endTime = new Date();
56
+ this.emitEvent({
57
+ type: 'completed',
58
+ workflowId,
59
+ workflowType: definition.type,
60
+ timestamp: new Date(),
61
+ });
62
+ })
63
+ .catch((error) => {
64
+ record.status = 'failed';
65
+ record.endTime = new Date();
66
+ record.error = {
67
+ message: error.message,
68
+ stack: error.stack,
69
+ };
70
+ this.emitEvent({
71
+ type: 'failed',
72
+ workflowId,
73
+ workflowType: definition.type,
74
+ timestamp: new Date(),
75
+ error: {
76
+ message: error.message,
77
+ stack: error.stack,
78
+ type: error.name,
79
+ },
80
+ });
81
+ });
82
+ return this.createWorkflowHandle(workflowId);
83
+ }
84
+ async getWorkflow(workflowId) {
85
+ const record = this.executions.get(workflowId);
86
+ if (!record) {
87
+ throw new Error(`Workflow not found: ${workflowId}`);
88
+ }
89
+ return this.createWorkflowHandle(workflowId);
90
+ }
91
+ async listWorkflows(filter) {
92
+ let workflows = Array.from(this.executions.values());
93
+ // Apply filters
94
+ if (filter?.workflowType) {
95
+ workflows = workflows.filter((w) => w.workflowType === filter.workflowType);
96
+ }
97
+ if (filter?.status) {
98
+ const statuses = Array.isArray(filter.status) ? filter.status : [filter.status];
99
+ workflows = workflows.filter((w) => statuses.includes(w.status));
100
+ }
101
+ if (filter?.startTime) {
102
+ if (filter.startTime.after) {
103
+ workflows = workflows.filter((w) => w.startTime >= filter.startTime.after);
104
+ }
105
+ if (filter.startTime.before) {
106
+ workflows = workflows.filter((w) => w.startTime <= filter.startTime.before);
107
+ }
108
+ }
109
+ // Apply limit
110
+ if (filter?.limit) {
111
+ workflows = workflows.slice(0, filter.limit);
112
+ }
113
+ return workflows.map((w) => ({
114
+ workflowId: w.workflowId,
115
+ workflowType: w.workflowType,
116
+ status: w.status,
117
+ startTime: w.startTime,
118
+ endTime: w.endTime,
119
+ progress: w.progress,
120
+ error: w.error,
121
+ }));
122
+ }
123
+ on(_event, listener) {
124
+ this.eventListeners.push(listener);
125
+ }
126
+ off(_event, listener) {
127
+ const index = this.eventListeners.indexOf(listener);
128
+ if (index >= 0) {
129
+ this.eventListeners.splice(index, 1);
130
+ }
131
+ }
132
+ async shutdown() {
133
+ // Wait for all running workflows to complete
134
+ const runningWorkflows = Array.from(this.executions.values()).filter((w) => w.status === 'running');
135
+ await Promise.allSettled(runningWorkflows.map((w) => w.resultPromise));
136
+ this.executions.clear();
137
+ this.eventListeners = [];
138
+ }
139
+ /**
140
+ * Create workflow context for execution
141
+ */
142
+ createWorkflowContext(workflowId, options) {
143
+ const record = this.executions.get(workflowId);
144
+ return {
145
+ workflowId,
146
+ executeActivity: async (activity, input, activityOptions) => {
147
+ const activityId = randomUUID();
148
+ const retryPolicy = activityOptions?.retryPolicy ||
149
+ activity.retryPolicy ||
150
+ options?.retryPolicy ||
151
+ this.config?.defaultRetryPolicy ||
152
+ DEFAULT_RETRY_POLICY;
153
+ const timeout = activityOptions?.timeout ||
154
+ activity.timeout ||
155
+ this.config?.defaultTimeout?.activityTimeout;
156
+ return this.executeActivityWithRetry(workflowId, activityId, activity, input, retryPolicy, timeout);
157
+ },
158
+ log: (level, message, metadata) => {
159
+ // Simple console logging for in-memory orchestrator
160
+ const logMessage = `[${workflowId}] ${message}`;
161
+ switch (level) {
162
+ case 'debug':
163
+ console.debug(logMessage, metadata);
164
+ break;
165
+ case 'info':
166
+ console.info(logMessage, metadata);
167
+ break;
168
+ case 'warn':
169
+ console.warn(logMessage, metadata);
170
+ break;
171
+ case 'error':
172
+ console.error(logMessage, metadata);
173
+ break;
174
+ }
175
+ },
176
+ reportProgress: (progress) => {
177
+ if (record) {
178
+ record.progress = progress;
179
+ }
180
+ },
181
+ sleep: async (durationMs) => {
182
+ return new Promise((resolve) => setTimeout(resolve, durationMs));
183
+ },
184
+ now: () => new Date(),
185
+ };
186
+ }
187
+ /**
188
+ * Execute workflow with timeout handling
189
+ */
190
+ async executeWorkflow(definition, context, input, options) {
191
+ const timeout = options?.timeout?.workflowTimeout ||
192
+ definition.timeout?.workflowTimeout ||
193
+ this.config?.defaultTimeout?.workflowTimeout;
194
+ const workflowPromise = definition.execute(context, input);
195
+ if (timeout) {
196
+ return Promise.race([
197
+ workflowPromise,
198
+ new Promise((_, reject) => setTimeout(() => reject(new Error(`Workflow timeout after ${timeout}ms`)), timeout)),
199
+ ]);
200
+ }
201
+ return workflowPromise;
202
+ }
203
+ /**
204
+ * Execute activity with retry logic
205
+ */
206
+ async executeActivityWithRetry(workflowId, activityId, activity, input, retryPolicy, timeout) {
207
+ let lastError;
208
+ for (let attempt = 1; attempt <= retryPolicy.maxAttempts; attempt++) {
209
+ try {
210
+ // Emit activity started event
211
+ this.emitEvent({
212
+ type: 'activity-started',
213
+ workflowId,
214
+ workflowType: activity.type,
215
+ activityType: activity.type,
216
+ timestamp: new Date(),
217
+ metadata: { attempt },
218
+ });
219
+ // Create activity context
220
+ const context = {
221
+ activityId,
222
+ workflowId,
223
+ attempt,
224
+ log: (level, message, metadata) => {
225
+ const logMessage = `[${workflowId}:${activityId}] ${message}`;
226
+ switch (level) {
227
+ case 'debug':
228
+ console.debug(logMessage, metadata);
229
+ break;
230
+ case 'info':
231
+ console.info(logMessage, metadata);
232
+ break;
233
+ case 'warn':
234
+ console.warn(logMessage, metadata);
235
+ break;
236
+ case 'error':
237
+ console.error(logMessage, metadata);
238
+ break;
239
+ }
240
+ },
241
+ heartbeat: () => {
242
+ // No-op for in-memory orchestrator
243
+ },
244
+ isCancelled: () => {
245
+ const record = this.executions.get(workflowId);
246
+ return record?.cancelRequested ?? false;
247
+ },
248
+ };
249
+ // Execute with timeout
250
+ const activityPromise = activity.execute(context, input);
251
+ const result = timeout
252
+ ? await Promise.race([
253
+ activityPromise,
254
+ new Promise((_, reject) => setTimeout(() => reject(new Error(`Activity timeout after ${timeout}ms`)), timeout)),
255
+ ])
256
+ : await activityPromise;
257
+ // Emit activity completed event
258
+ this.emitEvent({
259
+ type: 'activity-completed',
260
+ workflowId,
261
+ workflowType: activity.type,
262
+ activityType: activity.type,
263
+ timestamp: new Date(),
264
+ metadata: { attempt },
265
+ });
266
+ return result;
267
+ }
268
+ catch (error) {
269
+ lastError = error instanceof Error ? error : new Error(String(error));
270
+ // Check if error is non-retryable
271
+ if (retryPolicy.nonRetryableErrors &&
272
+ retryPolicy.nonRetryableErrors.includes(lastError.name)) {
273
+ throw lastError;
274
+ }
275
+ // Emit activity failed event
276
+ this.emitEvent({
277
+ type: 'activity-failed',
278
+ workflowId,
279
+ workflowType: activity.type,
280
+ activityType: activity.type,
281
+ timestamp: new Date(),
282
+ error: {
283
+ message: lastError.message,
284
+ stack: lastError.stack,
285
+ type: lastError.name,
286
+ },
287
+ attempt,
288
+ });
289
+ // Don't retry on last attempt
290
+ if (attempt === retryPolicy.maxAttempts) {
291
+ break;
292
+ }
293
+ // Calculate backoff delay (exponential)
294
+ const backoffDelay = Math.min(retryPolicy.initialInterval * Math.pow(retryPolicy.backoffCoefficient, attempt - 1), retryPolicy.maxInterval);
295
+ // Emit retry event
296
+ this.emitEvent({
297
+ type: 'retry',
298
+ workflowId,
299
+ workflowType: activity.type,
300
+ activityType: activity.type,
301
+ timestamp: new Date(),
302
+ attempt: attempt + 1,
303
+ metadata: { backoffDelay },
304
+ });
305
+ // Wait before retry
306
+ await new Promise((resolve) => setTimeout(resolve, backoffDelay));
307
+ }
308
+ }
309
+ throw lastError || new Error('Activity failed with unknown error');
310
+ }
311
+ /**
312
+ * Create workflow handle
313
+ */
314
+ createWorkflowHandle(workflowId) {
315
+ const self = this;
316
+ return {
317
+ workflowId,
318
+ get workflowType() {
319
+ const record = self.executions.get(workflowId);
320
+ return record?.workflowType || '';
321
+ },
322
+ status: async () => {
323
+ const record = self.executions.get(workflowId);
324
+ if (!record) {
325
+ throw new Error(`Workflow not found: ${workflowId}`);
326
+ }
327
+ return record.status;
328
+ },
329
+ progress: async () => {
330
+ const record = self.executions.get(workflowId);
331
+ return record?.progress ?? null;
332
+ },
333
+ result: async () => {
334
+ const record = self.executions.get(workflowId);
335
+ if (!record) {
336
+ throw new Error(`Workflow not found: ${workflowId}`);
337
+ }
338
+ return (await record.resultPromise);
339
+ },
340
+ cancel: async () => {
341
+ const record = self.executions.get(workflowId);
342
+ if (!record) {
343
+ throw new Error(`Workflow not found: ${workflowId}`);
344
+ }
345
+ record.cancelRequested = true;
346
+ record.status = 'cancelled';
347
+ record.endTime = new Date();
348
+ },
349
+ terminate: async (reason) => {
350
+ const record = self.executions.get(workflowId);
351
+ if (!record) {
352
+ throw new Error(`Workflow not found: ${workflowId}`);
353
+ }
354
+ record.cancelRequested = true;
355
+ record.status = 'cancelled';
356
+ record.endTime = new Date();
357
+ record.error = { message: reason || 'Workflow terminated' };
358
+ },
359
+ };
360
+ }
361
+ /**
362
+ * Emit workflow event to listeners
363
+ */
364
+ emitEvent(event) {
365
+ for (const listener of this.eventListeners) {
366
+ try {
367
+ listener(event);
368
+ }
369
+ catch (error) {
370
+ console.error('Error in event listener:', error);
371
+ }
372
+ }
373
+ }
374
+ }
375
+ //# sourceMappingURL=in-memory-orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory-orchestrator.js","sourceRoot":"","sources":["../../src/orchestration/in-memory-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;GAEG;AACH,MAAM,oBAAoB,GAAgB;I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AC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC/C,IAAI,CAAC,MAAM,EAAE,CAAC;oBACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,UAAU,EAAE,CAAC,CAAC;gBACvD,CAAC;gBACD,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;gBAC9B,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC;gBAC5B,MAAM,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;gBAC5B,MAAM,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,CAAC;YAC9D,CAAC;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,SAAS,CAAC,KAAoB;QACpC,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YAC3C,IAAI,CAAC;gBACH,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;YACnD,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Orchestration implementation
3
+ */
4
+ export { InMemoryOrchestrator } from './in-memory-orchestrator.js';
5
+ export * from './activities/index.js';
6
+ export * from './workflows/index.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/orchestration/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Orchestration implementation
3
+ */
4
+ // Orchestrator implementations
5
+ export { InMemoryOrchestrator } from './in-memory-orchestrator.js';
6
+ // Activities
7
+ export * from './activities/index.js';
8
+ // Workflows
9
+ export * from './workflows/index.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestration/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+BAA+B;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,aAAa;AACb,cAAc,uBAAuB,CAAC;AAEtC,YAAY;AACZ,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Batch Transform Workflow
3
+ *
4
+ * Orchestrates batch transformation of multiple QTI items to PIE format
5
+ */
6
+ import type { WorkflowDefinition, TransformFormat, TransformPlugin, TransformContext, StorageBackend } from '@pie-qti/transform-types';
7
+ import { type TransformItemOutput } from './transform-item-workflow.js';
8
+ export interface BatchTransformInput {
9
+ /** List of items to transform */
10
+ items: Array<{
11
+ itemId: string;
12
+ contentUri: string;
13
+ outputUri?: string;
14
+ }>;
15
+ /** Source format (if known for all items) */
16
+ sourceFormat?: TransformFormat;
17
+ /** Target format */
18
+ targetFormat: TransformFormat;
19
+ /** Transform plugin to use */
20
+ plugin: TransformPlugin;
21
+ /** Transform context */
22
+ context: TransformContext;
23
+ /** Storage backend */
24
+ storage: StorageBackend;
25
+ /** Skip validation */
26
+ skipValidation?: boolean;
27
+ /** Maximum concurrent transformations */
28
+ maxConcurrent?: number;
29
+ }
30
+ export interface BatchTransformOutput {
31
+ /** Successfully transformed items */
32
+ successful: Array<{
33
+ itemId: string;
34
+ result: TransformItemOutput;
35
+ }>;
36
+ /** Failed items */
37
+ failed: Array<{
38
+ itemId: string;
39
+ error: string;
40
+ }>;
41
+ /** Batch metadata */
42
+ metadata: {
43
+ totalItems: number;
44
+ successCount: number;
45
+ failureCount: number;
46
+ startTime: Date;
47
+ endTime: Date;
48
+ totalProcessingTime: number;
49
+ };
50
+ }
51
+ /**
52
+ * Workflow for batch transformation of multiple items
53
+ *
54
+ * This workflow executes TransformItemWorkflow for each item,
55
+ * with controlled concurrency and error handling
56
+ */
57
+ export declare const BatchTransformWorkflow: WorkflowDefinition<BatchTransformInput, BatchTransformOutput>;
58
+ //# sourceMappingURL=batch-transform-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-transform-workflow.d.ts","sourceRoot":"","sources":["../../../src/orchestration/workflows/batch-transform-workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvI,OAAO,EAAkD,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExH,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,6CAA6C;IAC7C,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,oBAAoB;IACpB,YAAY,EAAE,eAAe,CAAC;IAC9B,8BAA8B;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,wBAAwB;IACxB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,sBAAsB;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,UAAU,EAAE,KAAK,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,mBAAmB,CAAC;KAC7B,CAAC,CAAC;IACH,mBAAmB;IACnB,MAAM,EAAE,KAAK,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH,qBAAqB;IACrB,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;QACd,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,mBAAmB,EAAE,oBAAoB,CAwGhG,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Batch Transform Workflow
3
+ *
4
+ * Orchestrates batch transformation of multiple QTI items to PIE format
5
+ */
6
+ import { TransformItemWorkflow } from './transform-item-workflow.js';
7
+ /**
8
+ * Workflow for batch transformation of multiple items
9
+ *
10
+ * This workflow executes TransformItemWorkflow for each item,
11
+ * with controlled concurrency and error handling
12
+ */
13
+ export const BatchTransformWorkflow = {
14
+ type: 'batch-transform',
15
+ version: '1.0',
16
+ name: 'Batch Transform QTI Items to PIE',
17
+ async execute(ctx, input) {
18
+ const startTime = ctx.now();
19
+ const maxConcurrent = input.maxConcurrent || 5;
20
+ ctx.log('info', `Starting batch transformation of ${input.items.length} items (concurrency: ${maxConcurrent})`);
21
+ const successful = [];
22
+ const failed = [];
23
+ // Process items in chunks for controlled concurrency
24
+ const chunks = [];
25
+ for (let i = 0; i < input.items.length; i += maxConcurrent) {
26
+ chunks.push(input.items.slice(i, i + maxConcurrent));
27
+ }
28
+ let completedItems = 0;
29
+ for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
30
+ const chunk = chunks[chunkIndex];
31
+ ctx.log('debug', `Processing chunk ${chunkIndex + 1}/${chunks.length} (${chunk.length} items)`);
32
+ // Execute all items in chunk concurrently
33
+ const chunkResults = await Promise.allSettled(chunk.map(async (item) => {
34
+ const transformInput = {
35
+ content: item.contentUri,
36
+ itemId: item.itemId,
37
+ sourceFormat: input.sourceFormat,
38
+ targetFormat: input.targetFormat,
39
+ plugin: input.plugin,
40
+ context: input.context,
41
+ storage: input.storage,
42
+ outputUri: item.outputUri,
43
+ skipValidation: input.skipValidation,
44
+ };
45
+ // Execute the transform item workflow as a child workflow
46
+ // In InMemoryOrchestrator, this is just a direct call
47
+ // In TemporalOrchestrator, this would be executeChildWorkflow
48
+ return TransformItemWorkflow.execute(ctx, transformInput);
49
+ }));
50
+ // Process results
51
+ for (let i = 0; i < chunkResults.length; i++) {
52
+ const result = chunkResults[i];
53
+ const item = chunk[i];
54
+ if (result.status === 'fulfilled') {
55
+ successful.push({
56
+ itemId: item.itemId,
57
+ result: result.value,
58
+ });
59
+ ctx.log('info', `Item ${item.itemId} transformed successfully`);
60
+ }
61
+ else {
62
+ failed.push({
63
+ itemId: item.itemId,
64
+ error: result.reason instanceof Error ? result.reason.message : String(result.reason),
65
+ });
66
+ ctx.log('error', `Item ${item.itemId} transformation failed: ${result.reason}`);
67
+ }
68
+ completedItems++;
69
+ // Report progress
70
+ ctx.reportProgress({
71
+ currentStep: `Processing item ${completedItems}/${input.items.length}`,
72
+ completedSteps: completedItems,
73
+ totalSteps: input.items.length,
74
+ percentage: Math.floor((completedItems / input.items.length) * 100),
75
+ message: `${completedItems}/${input.items.length} items processed (${successful.length} successful, ${failed.length} failed)`,
76
+ });
77
+ }
78
+ }
79
+ const endTime = ctx.now();
80
+ const totalProcessingTime = endTime.getTime() - startTime.getTime();
81
+ ctx.log('info', `Batch transformation complete: ${successful.length} successful, ${failed.length} failed in ${totalProcessingTime}ms`);
82
+ return {
83
+ successful,
84
+ failed,
85
+ metadata: {
86
+ totalItems: input.items.length,
87
+ successCount: successful.length,
88
+ failureCount: failed.length,
89
+ startTime,
90
+ endTime,
91
+ totalProcessingTime,
92
+ },
93
+ };
94
+ },
95
+ timeout: {
96
+ workflowTimeout: 3600000, // 1 hour for batch processing
97
+ activityTimeout: 300000, // 5 minutes per activity
98
+ },
99
+ };
100
+ //# sourceMappingURL=batch-transform-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-transform-workflow.js","sourceRoot":"","sources":["../../../src/orchestration/workflows/batch-transform-workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAqD,MAAM,8BAA8B,CAAC;AA+CxH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkE;IACnG,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,kCAAkC;IAExC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK;QACtB,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,IAAI,CAAC,CAAC;QAE/C,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,oCAAoC,KAAK,CAAC,KAAK,CAAC,MAAM,wBAAwB,aAAa,GAAG,CAAC,CAAC;QAEhH,MAAM,UAAU,GAA2D,EAAE,CAAC;QAC9E,MAAM,MAAM,GAA6C,EAAE,CAAC;QAE5D,qDAAqD;QACrD,MAAM,MAAM,GAA8B,EAAE,CAAC;QAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,cAAc,GAAG,CAAC,CAAC;QAEvB,KAAK,IAAI,UAAU,GAAG,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,CAAC;YAClE,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;YAEjC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,oBAAoB,UAAU,GAAG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K,CAAC,KAAK,CAAC,MAAM;gBAC9B,YAAY,EAAE,UAAU,CAAC,MAAM;gBAC/B,YAAY,EAAE,MAAM,CAAC,MAAM;gBAC3B,SAAS;gBACT,OAAO;gBACP,mBAAmB;aACpB;SACF,CAAC;IACJ,CAAC;IAED,OAAO,EAAE;QACP,eAAe,EAAE,OAAO,EAAE,8BAA8B;QACxD,eAAe,EAAE,MAAM,EAAE,yBAAyB;KACnD;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Workflow definitions for transformation pipeline
3
+ */
4
+ export { BatchTransformWorkflow } from './batch-transform-workflow.js';
5
+ export type { BatchTransformInput, BatchTransformOutput } from './batch-transform-workflow.js';
6
+ export { TransformItemWorkflow } from './transform-item-workflow.js';
7
+ export type { TransformItemInput, TransformItemOutput } from './transform-item-workflow.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/orchestration/workflows/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Workflow definitions for transformation pipeline
3
+ */
4
+ export { BatchTransformWorkflow } from './batch-transform-workflow.js';
5
+ export { TransformItemWorkflow } from './transform-item-workflow.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/orchestration/workflows/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}