@workglow/tasks 0.0.52

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.
@@ -0,0 +1,492 @@
1
+ export class Interpreter {
2
+ private constructor();
3
+ REGEXP_MODE: number;
4
+ REGEXP_THREAD_TIMEOUT: number;
5
+ POLYFILL_TIMEOUT: number;
6
+ /**
7
+ * Flag indicating that a getter function needs to be called immediately.
8
+ * @private
9
+ */
10
+ private getterStep_;
11
+ /**
12
+ * Flag indicating that a setter function needs to be called immediately.
13
+ * @private
14
+ */
15
+ private setterStep_;
16
+ /**
17
+ * Number of code chunks appended to the interpreter.
18
+ * @private
19
+ */
20
+ private appendCodeNumber_;
21
+ /**
22
+ * Number of parsed tasks.
23
+ * @private
24
+ */
25
+ private taskCodeNumber_;
26
+ private parse_;
27
+ /**
28
+ * Add more code to the interpreter.
29
+ * @param {string|!Object} code Raw JavaScript text or AST.
30
+ */
31
+ appendCode: (code: string | Object) => void;
32
+ /**
33
+ * Execute one step of the interpreter.
34
+ * @returns {boolean} True if a step was executed, false if no more instructions.
35
+ */
36
+ step: () => boolean;
37
+ value: any;
38
+ /**
39
+ * Execute the interpreter to program completion. Vulnerable to infinite loops.
40
+ * @returns {boolean} True if a execution is asynchronously blocked,
41
+ * false if no more instructions.
42
+ */
43
+ run: () => boolean;
44
+ /**
45
+ * Current status of the interpreter.
46
+ * @returns {Interpreter.Status} One of DONE, STEP, TASK, or ASYNC.
47
+ */
48
+ getStatus: () => Interpreter.Status;
49
+ /**
50
+ * Initialize the global object with built-in properties and functions.
51
+ * @param {!Interpreter.Object} globalObject Global object.
52
+ */
53
+ initGlobal(globalObject: Interpreter.Object): void;
54
+ OBJECT_PROTO: any;
55
+ FUNCTION_PROTO: any;
56
+ OBJECT: any;
57
+ FUNCTION: any;
58
+ ARRAY: any;
59
+ ARRAY_PROTO: any;
60
+ REGEXP: any;
61
+ REGEXP_PROTO: any;
62
+ DATE: any;
63
+ DATE_PROTO: any;
64
+ /**
65
+ * Number of functions created by the interpreter.
66
+ * @private
67
+ */
68
+ private functionCodeNumber_;
69
+ /**
70
+ * Initialize the Function class.
71
+ * @param {!Interpreter.Object} globalObject Global object.
72
+ */
73
+ initFunction(globalObject: Interpreter.Object): void;
74
+ /**
75
+ * Initialize the Object class.
76
+ * @param {!Interpreter.Object} globalObject Global object.
77
+ */
78
+ initObject(globalObject: Interpreter.Object): void;
79
+ /**
80
+ * Initialize the Array class.
81
+ * @param {!Interpreter.Object} globalObject Global object.
82
+ */
83
+ initArray(globalObject: Interpreter.Object): void;
84
+ /**
85
+ * Initialize the String class.
86
+ * @param {!Interpreter.Object} globalObject Global object.
87
+ */
88
+ initString(globalObject: Interpreter.Object): void;
89
+ STRING: any;
90
+ /**
91
+ * Initialize the Boolean class.
92
+ * @param {!Interpreter.Object} globalObject Global object.
93
+ */
94
+ initBoolean(globalObject: Interpreter.Object): void;
95
+ BOOLEAN: any;
96
+ /**
97
+ * Initialize the Number class.
98
+ * @param {!Interpreter.Object} globalObject Global object.
99
+ */
100
+ initNumber(globalObject: Interpreter.Object): void;
101
+ NUMBER: any;
102
+ /**
103
+ * Initialize the Date class.
104
+ * @param {!Interpreter.Object} globalObject Global object.
105
+ */
106
+ initDate(globalObject: Interpreter.Object): void;
107
+ /**
108
+ * Initialize Regular Expression object.
109
+ * @param {!Interpreter.Object} globalObject Global object.
110
+ */
111
+ initRegExp(globalObject: Interpreter.Object): void;
112
+ /**
113
+ * Initialize the Error class.
114
+ * @param {!Interpreter.Object} globalObject Global object.
115
+ */
116
+ initError(globalObject: Interpreter.Object): void;
117
+ ERROR: any;
118
+ EVAL_ERROR: any;
119
+ RANGE_ERROR: any;
120
+ REFERENCE_ERROR: any;
121
+ SYNTAX_ERROR: any;
122
+ TYPE_ERROR: any;
123
+ URI_ERROR: any;
124
+ /**
125
+ * Initialize Math object.
126
+ * @param {!Interpreter.Object} globalObject Global object.
127
+ */
128
+ initMath(globalObject: Interpreter.Object): void;
129
+ /**
130
+ * Initialize JSON object.
131
+ * @param {!Interpreter.Object} globalObject Global object.
132
+ */
133
+ initJSON(globalObject: Interpreter.Object): void;
134
+ /**
135
+ * Is an object of a certain class?
136
+ * @param {Interpreter.Value} child Object to check.
137
+ * @param {Interpreter.Object} constructor Constructor of object.
138
+ * @returns {boolean} True if object is the class or inherits from it.
139
+ * False otherwise.
140
+ */
141
+ isa(child: Interpreter.Value, constructor: Interpreter.Object): boolean;
142
+ /**
143
+ * Initialize a pseudo regular expression object based on a native regular
144
+ * expression object.
145
+ * @param {!Interpreter.Object} pseudoRegexp The existing object to set.
146
+ * @param {!RegExp} nativeRegexp The native regular expression.
147
+ */
148
+ populateRegExp(pseudoRegexp: Interpreter.Object, nativeRegexp: RegExp): void;
149
+ /**
150
+ * Initialize a pseudo error object.
151
+ * @param {!Interpreter.Object} pseudoError The existing object to set.
152
+ * @param {string=} opt_message Error's message.
153
+ */
154
+ populateError(pseudoError: Interpreter.Object, opt_message?: string | undefined): void;
155
+ /**
156
+ * Create a Web Worker to execute regular expressions.
157
+ * Using a separate file fails in Chrome when run locally on a file:// URI.
158
+ * Using a data encoded URI fails in IE and Edge.
159
+ * Using a blob works in IE11 and all other browsers.
160
+ * @returns {!Worker} Web Worker with regexp execution code loaded.
161
+ */
162
+ createWorker(): Worker;
163
+ /**
164
+ * Execute regular expressions in a node vm.
165
+ * @param {string} code Code to execute.
166
+ * @param {!Object} sandbox Global variables for new vm.
167
+ * @param {!RegExp} nativeRegExp Regular expression.
168
+ * @param {!Function} callback Asynchronous callback function.
169
+ */
170
+ vmCall(code: string, sandbox: Object, nativeRegExp: RegExp, callback: Function): any;
171
+ /**
172
+ * If REGEXP_MODE is 0, then throw an error.
173
+ * Also throw if REGEXP_MODE is 2 and JS doesn't support Web Workers or vm.
174
+ * @param {!RegExp} nativeRegExp Regular expression.
175
+ * @param {!Function} callback Asynchronous callback function.
176
+ */
177
+ maybeThrowRegExp(nativeRegExp: RegExp, callback: Function): void;
178
+ /**
179
+ * Set a timeout for regular expression threads. Unless cancelled, this will
180
+ * terminate the thread and throw an error.
181
+ * @param {!RegExp} nativeRegExp Regular expression (used for error message).
182
+ * @param {!Worker} worker Thread to terminate.
183
+ * @param {!Function} callback Async callback function to continue execution.
184
+ * @returns {number} PID of timeout. Used to cancel if thread completes.
185
+ */
186
+ regExpTimeout(nativeRegExp: RegExp, worker: Worker, callback: Function): number;
187
+ /**
188
+ * Create a new data object based on a constructor's prototype.
189
+ * @param {Interpreter.Object} constructor Parent constructor function,
190
+ * or null if scope object.
191
+ * @returns {!Interpreter.Object} New data object.
192
+ */
193
+ createObject: (constructor: Interpreter.Object) => Interpreter.Object;
194
+ /**
195
+ * Create a new data object based on a prototype.
196
+ * @param {Interpreter.Object} proto Prototype object.
197
+ * @returns {!Interpreter.Object} New data object.
198
+ */
199
+ createObjectProto: (proto: Interpreter.Object) => Interpreter.Object;
200
+ /**
201
+ * Create a new array.
202
+ * @returns {!Interpreter.Object} New array.
203
+ */
204
+ createArray(): Interpreter.Object;
205
+ private createFunctionBase_;
206
+ /**
207
+ * Create a new interpreted function.
208
+ * @param {!Object} node AST node defining the function.
209
+ * @param {!Interpreter.Scope} scope Parent scope.
210
+ * @param {string=} opt_name Optional name for function.
211
+ * @returns {!Interpreter.Object} New function.
212
+ */
213
+ createFunction(node: Object, scope: typeof Scope, opt_name?: string | undefined): Interpreter.Object;
214
+ /**
215
+ * Create a new native function.
216
+ * @param {!Function} nativeFunc JavaScript function.
217
+ * @param {boolean} isConstructor True if function can be used with 'new'.
218
+ * @returns {!Interpreter.Object} New function.
219
+ */
220
+ createNativeFunction: (nativeFunc: Function, isConstructor: boolean) => Interpreter.Object;
221
+ /**
222
+ * Create a new native asynchronous function.
223
+ * @param {!Function} asyncFunc JavaScript function.
224
+ * @returns {!Interpreter.Object} New function.
225
+ */
226
+ createAsyncFunction: (asyncFunc: Function) => Interpreter.Object;
227
+ /**
228
+ * Converts from a native JavaScript object or value to a JS-Interpreter object.
229
+ * Can handle JSON-style values, regular expressions, dates and functions.
230
+ * Does NOT handle cycles.
231
+ * @param {*} nativeObj The native JavaScript object to be converted.
232
+ * @returns {Interpreter.Value} The equivalent JS-Interpreter object.
233
+ */
234
+ nativeToPseudo: (nativeObj: any) => Interpreter.Value;
235
+ /**
236
+ * Converts from a JS-Interpreter object to native JavaScript object.
237
+ * Can handle JSON-style values, regular expressions, and dates.
238
+ * Does handle cycles.
239
+ * @param {Interpreter.Value} pseudoObj The JS-Interpreter object to be
240
+ * converted.
241
+ * @param {Object=} opt_cycles Cycle detection object (used by recursive calls).
242
+ * @returns {*} The equivalent native JavaScript object or value.
243
+ */
244
+ pseudoToNative: (pseudoObj: Interpreter.Value, opt_cycles?: Object | undefined) => any;
245
+ /**
246
+ * Converts from a native JavaScript array to a JS-Interpreter array.
247
+ * Does handle non-numeric properties (like str.match's index prop).
248
+ * Does NOT recurse into the array's contents.
249
+ * @param {!Array} nativeArray The JavaScript array to be converted.
250
+ * @returns {!Interpreter.Object} The equivalent JS-Interpreter array.
251
+ */
252
+ arrayNativeToPseudo(nativeArray: any[]): Interpreter.Object;
253
+ /**
254
+ * Converts from a JS-Interpreter array to native JavaScript array.
255
+ * Does handle non-numeric properties (like str.match's index prop).
256
+ * Does NOT recurse into the array's contents.
257
+ * @param {!Interpreter.Object} pseudoArray The JS-Interpreter array,
258
+ * or JS-Interpreter object pretending to be an array.
259
+ * @returns {!Array} The equivalent native JavaScript array.
260
+ */
261
+ arrayPseudoToNative(pseudoArray: Interpreter.Object): any[];
262
+ /**
263
+ * Look up the prototype for this value.
264
+ * @param {Interpreter.Value} value Data object.
265
+ * @returns {Interpreter.Object} Prototype object, null if none.
266
+ */
267
+ getPrototype(value: Interpreter.Value): Interpreter.Object;
268
+ /**
269
+ * Fetch a property value from a data object.
270
+ * @param {Interpreter.Value} obj Data object.
271
+ * @param {Interpreter.Value} name Name of property.
272
+ * @returns {Interpreter.Value} Property value (may be undefined).
273
+ */
274
+ getProperty: (obj: Interpreter.Value, name: Interpreter.Value) => Interpreter.Value;
275
+ /**
276
+ * Does the named property exist on a data object.
277
+ * @param {Interpreter.Object} obj Data object.
278
+ * @param {Interpreter.Value} name Name of property.
279
+ * @returns {boolean} True if property exists.
280
+ */
281
+ hasProperty(obj: Interpreter.Object, name: Interpreter.Value): boolean;
282
+ /**
283
+ * Set a property value on a data object.
284
+ * @param {Interpreter.Value} obj Data object.
285
+ * @param {Interpreter.Value} name Name of property.
286
+ * @param {Interpreter.Value} value New property value.
287
+ * Use Interpreter.VALUE_IN_DESCRIPTOR if value is handled by
288
+ * descriptor instead.
289
+ * @param {Object=} opt_descriptor Optional descriptor object.
290
+ * @returns {!Interpreter.Object|undefined} Returns a setter function if one
291
+ * needs to be called, otherwise undefined.
292
+ */
293
+ setProperty: (obj: Interpreter.Value, name: Interpreter.Value, value: Interpreter.Value, opt_descriptor?: Object | undefined) => Interpreter.Object | undefined;
294
+ /**
295
+ * Convenience method for adding a native function as a non-enumerable property
296
+ * onto an object's prototype.
297
+ * @param {!Interpreter.Object} obj Data object.
298
+ * @param {Interpreter.Value} name Name of property.
299
+ * @param {!Function} wrapper Function object.
300
+ */
301
+ setNativeFunctionPrototype(obj: Interpreter.Object, name: Interpreter.Value, wrapper: Function): void;
302
+ /**
303
+ * Convenience method for adding an async function as a non-enumerable property
304
+ * onto an object's prototype.
305
+ * @param {!Interpreter.Object} obj Data object.
306
+ * @param {Interpreter.Value} name Name of property.
307
+ * @param {!Function} wrapper Function object.
308
+ */
309
+ setAsyncFunctionPrototype(obj: Interpreter.Object, name: Interpreter.Value, wrapper: Function): void;
310
+ /**
311
+ * Returns the current scope from the stateStack.
312
+ * @returns {!Interpreter.Scope} Current scope.
313
+ */
314
+ getScope(): typeof Scope;
315
+ /**
316
+ * Create a new scope dictionary.
317
+ * @param {!Object} node AST node defining the scope container
318
+ * (e.g. a function).
319
+ * @param {Interpreter.Scope} parentScope Scope to link to.
320
+ * @returns {!Interpreter.Scope} New scope.
321
+ */
322
+ createScope(node: Object, parentScope: typeof Scope): typeof Scope;
323
+ /**
324
+ * Create a new special scope dictionary. Similar to createScope(), but
325
+ * doesn't assume that the scope is for a function body.
326
+ * This is used for 'catch' clauses, 'with' statements,
327
+ * and named function expressions.
328
+ * @param {!Interpreter.Scope} parentScope Scope to link to.
329
+ * @param {Interpreter.Object=} opt_object Optional object to transform into
330
+ * scope.
331
+ * @returns {!Interpreter.Scope} New scope.
332
+ */
333
+ createSpecialScope(parentScope: typeof Scope, opt_object?: Interpreter.Object | undefined): typeof Scope;
334
+ /**
335
+ * Retrieves a value from the scope chain.
336
+ * @param {string} name Name of variable.
337
+ * @returns {Interpreter.Value} Any value.
338
+ * May be flagged as being a getter and thus needing immediate execution
339
+ * (rather than being the value of the property).
340
+ */
341
+ getValueFromScope(name: string): Interpreter.Value;
342
+ /**
343
+ * Sets a value to the current scope.
344
+ * @param {string} name Name of variable.
345
+ * @param {Interpreter.Value} value Value.
346
+ * @returns {!Interpreter.Object|undefined} Returns a setter function if one
347
+ * needs to be called, otherwise undefined.
348
+ */
349
+ setValueToScope(name: string, value: Interpreter.Value): Interpreter.Object | undefined;
350
+ private populateScope_;
351
+ /**
352
+ * Is the current state directly being called with as a construction with 'new'.
353
+ * @returns {boolean} True if 'new foo()', false if 'foo()'.
354
+ */
355
+ calledWithNew(): boolean;
356
+ /**
357
+ * Gets a value from the scope chain or from an object property.
358
+ * @param {!Array} ref Name of variable or object/propname tuple.
359
+ * @returns {Interpreter.Value} Any value.
360
+ * May be flagged as being a getter and thus needing immediate execution
361
+ * (rather than being the value of the property).
362
+ */
363
+ getValue(ref: any[]): Interpreter.Value;
364
+ /**
365
+ * Sets a value to the scope chain or to an object property.
366
+ * @param {!Array} ref Name of variable or object/propname tuple.
367
+ * @param {Interpreter.Value} value Value.
368
+ * @returns {!Interpreter.Object|undefined} Returns a setter function if one
369
+ * needs to be called, otherwise undefined.
370
+ */
371
+ setValue(ref: any[], value: Interpreter.Value): Interpreter.Object | undefined;
372
+ /**
373
+ * Throw an exception in the interpreter that can be handled by an
374
+ * interpreter try/catch statement. If unhandled, a real exception will
375
+ * be thrown. Can be called with either an error class and a message, or
376
+ * with an actual object to be thrown.
377
+ * @param {!Interpreter.Object|Interpreter.Value} errorClass Type of error
378
+ * (if message is provided) or the value to throw (if no message).
379
+ * @param {string=} opt_message Message being thrown.
380
+ */
381
+ throwException(errorClass: Interpreter.Object | Interpreter.Value, opt_message?: string | undefined): never;
382
+ /**
383
+ * Unwind the stack to the innermost relevant enclosing TryStatement,
384
+ * For/ForIn/WhileStatement or Call/NewExpression. If this results in
385
+ * the stack being completely unwound the thread will be terminated
386
+ * and the appropriate error being thrown.
387
+ * @param {Interpreter.Completion} type Completion type.
388
+ * @param {Interpreter.Value} value Value computed, returned or thrown.
389
+ * @param {string|undefined} label Target label for break or return.
390
+ */
391
+ unwind(type: Interpreter.Completion, value: Interpreter.Value, label: string | undefined): void;
392
+ /**
393
+ * AST to code. Summarizes the expression at the given node. Currently
394
+ * not guaranteed to be correct or complete. Used for error messages.
395
+ * E.g. `escape('hello') + 42` -> 'escape(...) + 42'
396
+ * @param {!Object} node AST node.
397
+ * @returns {string} Code string.
398
+ */
399
+ nodeSummary(node: Object): string;
400
+ private createTask_;
401
+ private scheduleTask_;
402
+ private deleteTask_;
403
+ private nextTask_;
404
+ private createGetter_;
405
+ private createSetter_;
406
+ private boxThis_;
407
+ /**
408
+ * Return the global scope object.
409
+ * @returns {!Interpreter.Scope} Scope object.
410
+ */
411
+ getGlobalScope: () => typeof Scope;
412
+ /**
413
+ * Return the state stack.
414
+ * @returns {!Array<!Interpreter.State>} State stack.
415
+ */
416
+ getStateStack: () => Array<typeof State>;
417
+ /**
418
+ * Replace the state stack with a new one.
419
+ * @param {!Array<!Interpreter.State>} newStack New state stack.
420
+ */
421
+ setStateStack: (newStack: Array<typeof State>) => void;
422
+ stateStack: (typeof State)[] | undefined;
423
+ stepArrayExpression(stack: any, state: any, node: any): any;
424
+ stepAssignmentExpression(stack: any, state: any, node: any): any;
425
+ stepBinaryExpression(stack: any, state: any, node: any): any;
426
+ stepBlockStatement(stack: any, state: any, node: any): any;
427
+ stepBreakStatement(stack: any, state: any, node: any): void;
428
+ /**
429
+ * Number of evals called by the interpreter.
430
+ * @private
431
+ */
432
+ private evalCodeNumber_;
433
+ stepCallExpression(stack: any, state: any, node: any): any;
434
+ paused_: boolean | undefined;
435
+ stepConditionalExpression(stack: any, state: any, node: any): any;
436
+ stepContinueStatement(stack: any, state: any, node: any): void;
437
+ stepDebuggerStatement(stack: any, state: any, node: any): void;
438
+ stepDoWhileStatement(stack: any, state: any, node: any): any;
439
+ stepEmptyStatement(stack: any, state: any, node: any): void;
440
+ stepEvalProgram_(stack: any, state: any, node: any): any;
441
+ stepExpressionStatement(stack: any, state: any, node: any): any;
442
+ stepForInStatement(stack: any, state: any, node: any): any;
443
+ stepForStatement(stack: any, state: any, node: any): any;
444
+ stepFunctionDeclaration(stack: any, state: any, node: any): void;
445
+ stepFunctionExpression(stack: any, state: any, node: any): void;
446
+ stepIdentifier(stack: any, state: any, node: any): any;
447
+ stepIfStatement: any;
448
+ stepLabeledStatement(stack: any, state: any, node: any): any;
449
+ stepLiteral(stack: any, state: any, node: any): void;
450
+ stepLogicalExpression(stack: any, state: any, node: any): any;
451
+ stepMemberExpression(stack: any, state: any, node: any): any;
452
+ stepNewExpression: any;
453
+ stepObjectExpression(stack: any, state: any, node: any): any;
454
+ stepProgram(stack: any, state: any, node: any): any;
455
+ stepReturnStatement(stack: any, state: any, node: any): any;
456
+ stepSequenceExpression(stack: any, state: any, node: any): any;
457
+ stepSwitchStatement(stack: any, state: any, node: any): any;
458
+ stepThisExpression(stack: any, state: any, node: any): void;
459
+ stepThrowStatement(stack: any, state: any, node: any): any;
460
+ stepTryStatement(stack: any, state: any, node: any): any;
461
+ stepUnaryExpression(stack: any, state: any, node: any): any;
462
+ stepUpdateExpression(stack: any, state: any, node: any): any;
463
+ stepVariableDeclaration(stack: any, state: any, node: any): any;
464
+ stepWithStatement(stack: any, state: any, node: any): any;
465
+ stepWhileStatement: any;
466
+ }
467
+ /**
468
+ * Class for a scope.
469
+ * @param {Interpreter.Scope} parentScope Parent scope.
470
+ * @param {boolean} strict True if "use strict".
471
+ * @param {!Interpreter.Object} object Object containing scope's variables.
472
+ * @type Class
473
+ */
474
+ declare class Scope {
475
+ constructor(parentScope: any, strict: any, object: any);
476
+ parentScope: any;
477
+ strict: any;
478
+ object: any;
479
+ }
480
+ /**
481
+ * Class for a state.
482
+ * @param {!Object} node AST node for the state.
483
+ * @param {!Interpreter.Scope} scope Scope object for the state.
484
+ * @type Class
485
+ */
486
+ declare class State {
487
+ constructor(node: any, scope: any);
488
+ node: any;
489
+ scope: any;
490
+ }
491
+ export {};
492
+ //# sourceMappingURL=interpreter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../../src/util/interpreter.js"],"names":[],"mappings":";;;;;IAoUA;;;OAGG;IACH,oBAAiC;IAEjC;;;OAGG;IACH,oBAAiC;IAEjC;;;OAGG;IACH,0BAAuC;IAEvC;;;OAGG;IACH,wBAAqC;IASN,eAU9B;IAED;;;OAGG;IACH,mBAFW,MAAM,GAAE,MAAM,UAEO;IAkBhC;;;OAGG;IACH,YAFa,OAAO,CAEM;IAkChB,WAAsB;IA+BhC;;;;OAIG;IACH,WAHa,OAAO,CAGK;IAKzB;;;OAGG;IACH,iBAFa,WAAW,CAAC,MAAM,CAEA;IAsB/B;;;OAGG;IACH,yBAFY,WAAW,CAAC,MAAM,QA6K7B;IA5IC,kBAAgD;IAChD,oBAA+D;IA4H/D,YAA4B;IAE5B,cAAgC;IAEhC,WAA0B;IAC1B,iBAAsC;IACtC,YAA4B;IAC5B,kBAAwC;IACxC,UAAwB;IACxB,gBAAoC;IAQtC;;;OAGG;IACH,4BAAyC;IAEzC;;;OAGG;IACH,2BAFY,WAAW,CAAC,MAAM,QAgK7B;IAED;;;OAGG;IACH,yBAFY,WAAW,CAA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;IA6BzB,kEAwBC;IAED,+DAGC;IAED,+DAGC;IAED,6DAoBC;IAED,4DAEC;IAED,yDASC;IAED,gEAUC;IAED,2DAqHC;IAED,yDAgCC;IAED,iEAGC;IAED,gEAmBC;IAED,uDAcC;;IAID,6DASC;IAED,qDASC;IAED,8DAqBC;IAED,6DA8BC;;IAID,6DAqDC;IAED,oDASC;IAED,4DAMC;IAED,+DASC;IAED,4DAmDC;IAED,4DAGC;IAED,2DAOC;IAED,yDA+BC;IAED,4DA0DC;IAED,6DAkDC;IAED,gEA8BC;IAED,0DAQC;;;AA5uCD;;;;;;GAMG;AACH;IACE,wDAIC;IAHC,iBAA8B;IAC9B,YAAoB;IACpB,YAAoB;CAEvB;AA1BD;;;;;GAKG;AACH;IACE,mCAGC;IAFC,UAAgB;IAChB,WAAkB;CAErB"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@workglow/tasks",
3
+ "type": "module",
4
+ "version": "0.0.52",
5
+ "description": "Pre-built task implementations for Workglow, including common AI operations and utility functions.",
6
+ "scripts": {
7
+ "watch": "concurrently -c 'auto' 'bun:watch-*'",
8
+ "watch-code": "bun build --watch --no-clear-screen --target=browser --sourcemap=external --packages=external --outdir ./dist ./src/index.ts",
9
+ "watch-types": "tsc --watch --preserveWatchOutput",
10
+ "build-package": "bun run build-clean && concurrently -c 'auto' -n 'code,types' 'bun run build-code' 'bun run build-types'",
11
+ "build-clean": "rm -fr dist/*",
12
+ "build-code": "bun build --target=browser --sourcemap=external --packages=external --outdir ./dist ./src/index.ts",
13
+ "build-types": "rm -f tsconfig.tsbuildinfo && tsc",
14
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
15
+ "test": "bun test",
16
+ "prepare": "node -e \"const pkg=require('./package.json');pkg.exports['.'].bun='./dist/index.js';pkg.exports['.'].types='./dist/types.d.ts';require('fs').writeFileSync('package.json',JSON.stringify(pkg,null,2))\""
17
+ },
18
+ "exports": {
19
+ ".": {
20
+ "bun": "./dist/index.js",
21
+ "types": "./dist/types.d.ts",
22
+ "import": "./dist/index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "src/**/*.md"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "peerDependencies": {
33
+ "@workglow/task-graph": "0.0.52",
34
+ "@workglow/util": "0.0.52",
35
+ "@workglow/job-queue": "0.0.52",
36
+ "@workglow/storage": "0.0.52"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "@workglow/task-graph": {
40
+ "optional": false
41
+ },
42
+ "@workglow/util": {
43
+ "optional": false
44
+ },
45
+ "@workglow/job-queue": {
46
+ "optional": false
47
+ },
48
+ "@workglow/storage": {
49
+ "optional": false
50
+ }
51
+ },
52
+ "devDependencies": {
53
+ "@workglow/job-queue": "0.0.52",
54
+ "@workglow/storage": "0.0.52",
55
+ "@workglow/task-graph": "0.0.52",
56
+ "@workglow/util": "0.0.52"
57
+ }
58
+ }