@workglow/task-graph 0.3.12 → 0.3.13
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/dist/browser.js +3368 -3321
- package/dist/browser.js.map +26 -24
- package/dist/bun.js +3368 -3321
- package/dist/bun.js.map +26 -24
- package/dist/cache/CacheJanitor.d.ts +2 -2
- package/dist/cache/RunPrivateCacheRepo.d.ts +6 -5
- package/dist/cache/RunPrivateCacheRepo.d.ts.map +1 -1
- package/dist/common.d.ts +9 -6
- package/dist/common.d.ts.map +1 -1
- package/dist/node.js +3368 -3321
- package/dist/node.js.map +26 -24
- package/dist/storage/ITaskOutputStorage.d.ts +35 -0
- package/dist/storage/ITaskOutputStorage.d.ts.map +1 -0
- package/dist/storage/TabularTaskOutputStorage.d.ts +29 -0
- package/dist/storage/TabularTaskOutputStorage.d.ts.map +1 -0
- package/dist/storage/TaskOutputStorageSchema.d.ts +31 -0
- package/dist/storage/TaskOutputStorageSchema.d.ts.map +1 -0
- package/dist/storage/TaskOutputTabularRepository.d.ts +10 -90
- package/dist/storage/TaskOutputTabularRepository.d.ts.map +1 -1
- package/dist/task/CacheCoordinator.d.ts +8 -2
- package/dist/task/CacheCoordinator.d.ts.map +1 -1
- package/dist/task/GraphAsTask.d.ts.map +1 -1
- package/dist/task/Task.d.ts +1 -1
- package/dist/task/index.d.ts +6 -6
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task-graph/Conversions.d.ts +10 -0
- package/dist/task-graph/Conversions.d.ts.map +1 -1
- package/dist/task-graph/Dataflow.d.ts +1 -1
- package/dist/task-graph/Dataflow.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/EXECUTION_MODEL.md +4 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { SearchCondition } from "@workglow/storage";
|
|
7
|
+
/** One cached task output row. */
|
|
8
|
+
export interface TaskOutputRow {
|
|
9
|
+
readonly taskType: string;
|
|
10
|
+
readonly key: string;
|
|
11
|
+
/** Serialized (optionally compressed) output payload. */
|
|
12
|
+
readonly value: string;
|
|
13
|
+
readonly createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
export type TaskOutputRowPrimaryKey = Pick<TaskOutputRow, "key" | "taskType">;
|
|
16
|
+
export type TaskOutputDeleteSearchCriteria = {
|
|
17
|
+
readonly createdAt?: SearchCondition<string>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Minimal storage contract used by {@link TaskOutputTabularRepository}.
|
|
21
|
+
* Narrower than full tabular storage — only the methods the output cache calls.
|
|
22
|
+
*/
|
|
23
|
+
export interface ITaskOutputStorage {
|
|
24
|
+
setupDatabase?(): Promise<void>;
|
|
25
|
+
put(row: TaskOutputRow): Promise<void>;
|
|
26
|
+
get(key: TaskOutputRowPrimaryKey): Promise<TaskOutputRow | undefined>;
|
|
27
|
+
delete(key: TaskOutputRowPrimaryKey): Promise<void>;
|
|
28
|
+
deleteAll(): Promise<void>;
|
|
29
|
+
size(): Promise<number>;
|
|
30
|
+
deleteSearch(criteria: TaskOutputDeleteSearchCriteria): Promise<void>;
|
|
31
|
+
records(pageSize?: number): AsyncGenerator<TaskOutputRow, void, undefined>;
|
|
32
|
+
/** When false, restart-survival for run-private cache is not guaranteed. */
|
|
33
|
+
isDurable?(): boolean;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ITaskOutputStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITaskOutputStorage.d.ts","sourceRoot":"","sources":["../../src/storage/ITaskOutputStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,kCAAkC;AAClC,MAAM,WAAW,aAAa;I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
6
|
+
import type { ITabularStorage } from "@workglow/storage";
|
|
7
|
+
import type { ITaskOutputStorage, TaskOutputDeleteSearchCriteria, TaskOutputRow, TaskOutputRowPrimaryKey } from "./ITaskOutputStorage";
|
|
8
|
+
import { TaskOutputPrimaryKeyNames, TaskOutputSchema } from "./TaskOutputStorageSchema";
|
|
9
|
+
type TaskOutputTabularBacking = ITabularStorage<typeof TaskOutputSchema, typeof TaskOutputPrimaryKeyNames>;
|
|
10
|
+
export type { TaskOutputTabularBacking };
|
|
11
|
+
/**
|
|
12
|
+
* Adapts a full {@link ITabularStorage} table to {@link ITaskOutputStorage}.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TabularTaskOutputStorage implements ITaskOutputStorage {
|
|
15
|
+
private readonly tabular;
|
|
16
|
+
constructor(tabular: TaskOutputTabularBacking);
|
|
17
|
+
setupDatabase(): Promise<void>;
|
|
18
|
+
put(row: TaskOutputRow): Promise<void>;
|
|
19
|
+
get(key: TaskOutputRowPrimaryKey): Promise<TaskOutputRow | undefined>;
|
|
20
|
+
delete(key: TaskOutputRowPrimaryKey): Promise<void>;
|
|
21
|
+
deleteAll(): Promise<void>;
|
|
22
|
+
size(): Promise<number>;
|
|
23
|
+
deleteSearch(criteria: TaskOutputDeleteSearchCriteria): Promise<void>;
|
|
24
|
+
records(pageSize?: number): AsyncGenerator<TaskOutputRow, void, undefined>;
|
|
25
|
+
isDurable(): boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Convenience factory for {@link TabularTaskOutputStorage}. */
|
|
28
|
+
export declare function tabularTaskOutputStorage(tabular: TaskOutputTabularBacking): ITaskOutputStorage;
|
|
29
|
+
//# sourceMappingURL=TabularTaskOutputStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabularTaskOutputStorage.d.ts","sourceRoot":"","sources":["../../src/storage/TabularTaskOutputStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE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
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type TaskOutputPrimaryKey = {
|
|
7
|
+
key: string;
|
|
8
|
+
taskType: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TaskOutputSchema: {
|
|
11
|
+
type: "object";
|
|
12
|
+
properties: {
|
|
13
|
+
key: {
|
|
14
|
+
type: "string";
|
|
15
|
+
};
|
|
16
|
+
taskType: {
|
|
17
|
+
type: "string";
|
|
18
|
+
};
|
|
19
|
+
value: {
|
|
20
|
+
type: "string";
|
|
21
|
+
contentEncoding: string;
|
|
22
|
+
};
|
|
23
|
+
createdAt: {
|
|
24
|
+
type: "string";
|
|
25
|
+
format: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
additionalProperties: false;
|
|
29
|
+
};
|
|
30
|
+
export declare const TaskOutputPrimaryKeyNames: readonly ["key", "taskType"];
|
|
31
|
+
//# sourceMappingURL=TaskOutputStorageSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskOutputStorageSchema.d.ts","sourceRoot":"","sources":["../../src/storage/TaskOutputStorageSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;CASG,CAAC;AAEjC,eAAO,MAAM,yBAAyB,YAAI,KAAK,EAAE,UAAU,CAAU,CAAC"}
|
|
@@ -3,114 +3,34 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { BaseTabularStorage } from "@workglow/storage";
|
|
7
6
|
import { TaskInput, TaskOutput } from "../task/TaskTypes";
|
|
7
|
+
import type { ITaskOutputStorage } from "./ITaskOutputStorage";
|
|
8
|
+
import type { TaskOutputTabularBacking } from "./TabularTaskOutputStorage";
|
|
8
9
|
import { TaskOutputRepository } from "./TaskOutputRepository";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
taskType: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const TaskOutputSchema: {
|
|
14
|
-
type: "object";
|
|
15
|
-
properties: {
|
|
16
|
-
key: {
|
|
17
|
-
type: "string";
|
|
18
|
-
};
|
|
19
|
-
taskType: {
|
|
20
|
-
type: "string";
|
|
21
|
-
};
|
|
22
|
-
value: {
|
|
23
|
-
type: "string";
|
|
24
|
-
contentEncoding: string;
|
|
25
|
-
};
|
|
26
|
-
createdAt: {
|
|
27
|
-
type: "string";
|
|
28
|
-
format: string;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
additionalProperties: false;
|
|
32
|
-
};
|
|
33
|
-
export declare const TaskOutputPrimaryKeyNames: readonly ["key", "taskType"];
|
|
34
|
-
export type TaskOutputRepositoryStorage = BaseTabularStorage<typeof TaskOutputSchema, typeof TaskOutputPrimaryKeyNames>;
|
|
10
|
+
export { TaskOutputPrimaryKeyNames, TaskOutputSchema } from "./TaskOutputStorageSchema";
|
|
11
|
+
export type { TaskOutputPrimaryKey } from "./TaskOutputStorageSchema";
|
|
35
12
|
export type TaskOutputRepositoryOptions = {
|
|
36
|
-
|
|
13
|
+
storage: ITaskOutputStorage;
|
|
37
14
|
outputCompression?: boolean;
|
|
38
15
|
};
|
|
16
|
+
/** Backing tabular table type for {@link tabularTaskOutputStorage}. */
|
|
17
|
+
export type TaskOutputRepositoryStorage = TaskOutputTabularBacking;
|
|
39
18
|
/**
|
|
40
|
-
*
|
|
41
|
-
* Provides methods for saving, retrieving, and clearing task outputs
|
|
19
|
+
* Repository for task output caching backed by {@link ITaskOutputStorage}.
|
|
42
20
|
*/
|
|
43
21
|
export declare class TaskOutputTabularRepository extends TaskOutputRepository {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*/
|
|
47
|
-
tabularRepository: TaskOutputRepositoryStorage;
|
|
48
|
-
/**
|
|
49
|
-
* Constructor for the TaskOutputTabularRepository
|
|
50
|
-
* @param options The options for the repository
|
|
51
|
-
*/
|
|
52
|
-
constructor({ tabularRepository, outputCompression }: TaskOutputRepositoryOptions);
|
|
22
|
+
readonly storage: ITaskOutputStorage;
|
|
23
|
+
constructor({ storage, outputCompression }: TaskOutputRepositoryOptions);
|
|
53
24
|
isDurable(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Sets up the database for the repository.
|
|
56
|
-
* Must be called before using any other methods.
|
|
57
|
-
*/
|
|
58
25
|
setupDatabase(): Promise<void>;
|
|
59
26
|
keyFromInputs(inputs: TaskInput): Promise<string>;
|
|
60
|
-
/**
|
|
61
|
-
* Saves a task output to the repository
|
|
62
|
-
* @param taskType The type of task to save the output for
|
|
63
|
-
* @param inputs The input parameters for the task
|
|
64
|
-
* @param output The task output to save
|
|
65
|
-
*/
|
|
66
27
|
saveOutput(taskType: string, inputs: TaskInput, output: TaskOutput, createdAt?: Date): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* Retrieves a task output from the repository
|
|
69
|
-
* @param taskType The type of task to retrieve the output for
|
|
70
|
-
* @param inputs The input parameters for the task
|
|
71
|
-
* @returns The retrieved task output, or undefined if not found
|
|
72
|
-
*/
|
|
73
28
|
getOutput(taskType: string, inputs: TaskInput): Promise<TaskOutput | undefined>;
|
|
74
|
-
/**
|
|
75
|
-
* Clears all task outputs from the repository
|
|
76
|
-
* @emits output_cleared when the operation completes
|
|
77
|
-
*/
|
|
78
29
|
clear(): Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
* Returns the number of task outputs stored in the repository
|
|
81
|
-
* @returns The count of stored task outputs
|
|
82
|
-
*/
|
|
83
30
|
size(): Promise<number>;
|
|
84
|
-
/**
|
|
85
|
-
* Clear all task outputs from the repository that are older than the given date
|
|
86
|
-
* @param olderThanInMs The time in milliseconds to clear task outputs older than
|
|
87
|
-
*/
|
|
88
31
|
clearOlderThan(olderThanInMs: number): Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Deletes all entries whose `taskType` starts with the given prefix.
|
|
91
|
-
* Used by {@link RunPrivateCacheRepo.clearRun} to remove all entries for a specific runId.
|
|
92
|
-
*
|
|
93
|
-
* @param prefix - The prefix to match against `taskType` (e.g. `__run:my-run::`)
|
|
94
|
-
*/
|
|
95
32
|
deleteByTaskTypePrefix(prefix: string): Promise<void>;
|
|
96
|
-
/**
|
|
97
|
-
* Deletes entries whose `taskType` starts with the given prefix AND whose
|
|
98
|
-
* `createdAt` is older than `olderThanInMs` milliseconds ago.
|
|
99
|
-
*
|
|
100
|
-
* Used by {@link CacheJanitor} to prune stale run-private entries left behind
|
|
101
|
-
* by runs that crashed and were never restarted.
|
|
102
|
-
*
|
|
103
|
-
* @param prefix - The taskType prefix to match (e.g. `__run:`)
|
|
104
|
-
* @param olderThanInMs - Age threshold in milliseconds; rows older than this are deleted
|
|
105
|
-
*/
|
|
106
33
|
clearOlderThanWithTaskTypePrefix(prefix: string, olderThanInMs: number): Promise<void>;
|
|
107
|
-
/**
|
|
108
|
-
* Counts entries whose `taskType` starts with the given prefix.
|
|
109
|
-
* Used by {@link RunPrivateCacheRepo.size} so the wrapper's count reflects
|
|
110
|
-
* only its own namespaced view.
|
|
111
|
-
*
|
|
112
|
-
* @param prefix - The taskType prefix to match (e.g. `__run:my-run::`)
|
|
113
|
-
*/
|
|
114
34
|
sizeByTaskTypePrefix(prefix: string): Promise<number>;
|
|
115
35
|
}
|
|
116
36
|
//# sourceMappingURL=TaskOutputTabularRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskOutputTabularRepository.d.ts","sourceRoot":"","sources":["../../src/storage/TaskOutputTabularRepository.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"TaskOutputTabularRepository.d.ts","sourceRoot":"","sources":["../../src/storage/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C,MAAM,CAAC,CAE5B;IAEK,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzD;IAEc,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnE;IAEc,gCAAgC,CAC7C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAUf;IAEc,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQnE;CACF"}
|
|
@@ -42,12 +42,18 @@ export declare class CacheCoordinator<Input extends TaskInput, Output extends Ta
|
|
|
42
42
|
*
|
|
43
43
|
* Returns the deserialized output if found, undefined otherwise.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Cache identity for the `taskType` axis of {@link TaskOutputRepository}.
|
|
47
|
+
* Deterministic entries key by task class; private (run-resume) entries key by
|
|
48
|
+
* task instance id so two nodes of the same type in one graph do not collide.
|
|
49
|
+
*/
|
|
50
|
+
private cacheIdentityKey;
|
|
51
|
+
lookup(keyInputs: Input, outputCache: TaskOutputRepository | undefined, policy: CachePolicy, isStreamable: boolean, ctx: TaskRunContext): Promise<Output | undefined>;
|
|
46
52
|
/**
|
|
47
53
|
* Serializes and saves output. No-op when no cache is configured or task is
|
|
48
54
|
* not cacheable.
|
|
49
55
|
*/
|
|
50
|
-
save(keyInputs: Input, output: Output, outputCache: TaskOutputRepository | undefined): Promise<void>;
|
|
56
|
+
save(keyInputs: Input, output: Output, outputCache: TaskOutputRepository | undefined, policy: CachePolicy): Promise<void>;
|
|
51
57
|
/**
|
|
52
58
|
* Resolve the repository slot to use given a registry and policy. Returns
|
|
53
59
|
* `undefined` if the registry is missing, the policy is `kind: "none"`, or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CacheCoordinator.d.ts","sourceRoot":"","sources":["../../src/task/CacheCoordinator.ts"],"names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WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf;mBAOoB,oBAAoB;mBAepB,sBAAsB;mBAetB,0BAA0B;CAchD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphAsTask.d.ts","sourceRoot":"","sources":["../../src/task/GraphAsTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphAsTask.d.ts","sourceRoot":"","sources":["../../src/task/GraphAsTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAkB,MAAM,+BAA+B,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGnF,eAAO,MAAM,uBAAuB;mBAC5B,QAAQ;;;;;;;;;;;;;;;;;;;;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S,CAKjC;IAMe,MAAM,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,iBAAiB,CAWxE;IAEe,gBAAgB,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,YAAY,CAS7E;CACF;AAkDD,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,QAAQ;QAChB;;;WAGG;QACH,KAAK,EAAE,kBAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;QAE/E;;WAEG;QACH,QAAQ,IAAI,QAAQ,CAAC;KACtB;CACF"}
|
package/dist/task/Task.d.ts
CHANGED
|
@@ -398,7 +398,7 @@ export declare class Task<Input extends TaskInput = TaskInput, Output extends Ta
|
|
|
398
398
|
regenerateGraph(): void;
|
|
399
399
|
}
|
|
400
400
|
/**
|
|
401
|
-
* Test helper: clear the
|
|
401
|
+
* Test helper: clear the dedup Set so each test case can re-trigger the
|
|
402
402
|
* one-time legacy-`cacheable` deprecation warning. Lives in production code
|
|
403
403
|
* (not a __tests__ file) so it's reachable from outside the package's test
|
|
404
404
|
* harness; the leading double-underscore signals "do not rely on this in
|
package/dist/task/index.d.ts
CHANGED
|
@@ -10,16 +10,10 @@ export * from "./EntitlementPolicy";
|
|
|
10
10
|
export * from "./EntitlementProfile";
|
|
11
11
|
export * from "./EntitlementProfiles";
|
|
12
12
|
export * from "./EntitlementResolver";
|
|
13
|
-
export * from "./FallbackTask";
|
|
14
|
-
export * from "./FallbackTaskRunner";
|
|
15
|
-
export * from "./GraphAsTask";
|
|
16
|
-
export * from "./GraphAsTaskRunner";
|
|
17
13
|
export * from "./InputCompactor";
|
|
18
14
|
export * from "./InputResolver";
|
|
19
15
|
export * from "./ITask";
|
|
20
16
|
export * from "./iterationSchema";
|
|
21
|
-
export * from "./IteratorTask";
|
|
22
|
-
export * from "./IteratorTaskRunner";
|
|
23
17
|
export * from "./JobQueueFactory";
|
|
24
18
|
export * from "./MapTask";
|
|
25
19
|
export * from "./ReduceTask";
|
|
@@ -32,6 +26,12 @@ export * from "./TaskJSON";
|
|
|
32
26
|
export * from "./TaskQueueRegistry";
|
|
33
27
|
export * from "./TaskRegistry";
|
|
34
28
|
export * from "./TaskTypes";
|
|
29
|
+
export * from "./GraphAsTask";
|
|
30
|
+
export * from "./GraphAsTaskRunner";
|
|
31
|
+
export * from "./FallbackTask";
|
|
32
|
+
export * from "./FallbackTaskRunner";
|
|
33
|
+
export * from "./IteratorTask";
|
|
34
|
+
export * from "./IteratorTaskRunner";
|
|
35
35
|
export * from "./WhileTask";
|
|
36
36
|
export * from "./WhileTaskRunner";
|
|
37
37
|
import { ConditionalTask } from "./ConditionalTask";
|
package/dist/task/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,eAAO,MAAM,iBAAiB,qIAI7B,CAAC"}
|
|
@@ -7,7 +7,17 @@ import type { IExecuteContext, ITask } from "../task/ITask";
|
|
|
7
7
|
import type { DataPorts } from "../task/TaskTypes";
|
|
8
8
|
import type { ITaskGraph } from "./ITaskGraph";
|
|
9
9
|
import type { IWorkflow } from "./IWorkflow";
|
|
10
|
+
import { TaskGraph } from "./TaskGraph";
|
|
10
11
|
export type PipeFunction<I extends DataPorts = any, O extends DataPorts = any> = (input: I, context: IExecuteContext) => O | Promise<O>;
|
|
11
12
|
export type Taskish<A extends DataPorts = DataPorts, B extends DataPorts = DataPorts> = PipeFunction<A, B> | ITask<A, B> | ITaskGraph | IWorkflow<A, B>;
|
|
13
|
+
export type GraphWrapperParams = {
|
|
14
|
+
subGraph: TaskGraph;
|
|
15
|
+
isOwned: boolean;
|
|
16
|
+
isWorkflow: boolean;
|
|
17
|
+
config: any;
|
|
18
|
+
};
|
|
19
|
+
export type GraphWrapperFactory = (params: GraphWrapperParams) => ITask<any, any, any>;
|
|
20
|
+
/** Called from {@link GraphAsTask} once its module has finished evaluating. */
|
|
21
|
+
export declare function registerGraphWrapperFactory(factory: GraphWrapperFactory): void;
|
|
12
22
|
export declare function ensureTask<I extends DataPorts, O extends DataPorts>(arg: Taskish<I, O>, config?: any): ITask<any, any, any>;
|
|
13
23
|
//# sourceMappingURL=Conversions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Conversions.d.ts","sourceRoot":"","sources":["../../src/task-graph/Conversions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"Conversions.d.ts","sourceRoot":"","sources":["../../src/task-graph/Conversions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,GAAG,GAAG,EAAE,CAAC,SAAS,SAAS,GAAG,GAAG,IAAI,CAC/E,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,eAAe,KACrB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAEpB,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,SAAS,GAAG,SAAS,IAChF,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAClB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GACX,UAAU,GACV,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAYpB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAIvF,+EAA+E;AAC/E,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAE9E;AAuED,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,SAAS,EACjE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAClB,MAAM,GAAE,GAAQ,GACf,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAuBtB"}
|
|
@@ -7,7 +7,7 @@ import type { ServiceRegistry } from "@workglow/util";
|
|
|
7
7
|
import { EventEmitter } from "@workglow/util";
|
|
8
8
|
import type { StreamEvent } from "../task/StreamTypes";
|
|
9
9
|
import { TaskError } from "../task/TaskError";
|
|
10
|
-
import { DataflowJson } from "../task/TaskJSON";
|
|
10
|
+
import type { DataflowJson } from "../task/TaskJSON";
|
|
11
11
|
import { TaskIdType, TaskOutput, TaskStatus } from "../task/TaskTypes";
|
|
12
12
|
import { DataflowEventListener, DataflowEventListeners, DataflowEventParameters, DataflowEvents } from "./DataflowEvents";
|
|
13
13
|
import { TaskGraph } from "./TaskGraph";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dataflow.d.ts","sourceRoot":"","sources":["../../src/task-graph/Dataflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,g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IACI,MAAM,CAAC,KAAK,SAAS,cAAc,EACxC,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAEzC;IAEM,IAAI,CAAC,KAAK,SAAS,cAAc,EACtC,IAAI,EAAE,KAAK,EACX,GAAG,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC,GACtC,IAAI,CAEN;CACF;AAED;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,QAAQ;IACzC,YAAY,QAAQ,EAAE,cAAc,EAWnC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/task-graph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.13",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/workglow-dev/libs.git",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@workglow/job-queue": "0.3.
|
|
54
|
-
"@workglow/storage": "0.3.
|
|
55
|
-
"@workglow/util": "0.3.
|
|
53
|
+
"@workglow/job-queue": "0.3.13",
|
|
54
|
+
"@workglow/storage": "0.3.13",
|
|
55
|
+
"@workglow/util": "0.3.13"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@workglow/job-queue": {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@workglow/job-queue": "0.3.
|
|
70
|
-
"@workglow/storage": "0.3.
|
|
71
|
-
"@workglow/util": "0.3.
|
|
69
|
+
"@workglow/job-queue": "0.3.13",
|
|
70
|
+
"@workglow/storage": "0.3.13",
|
|
71
|
+
"@workglow/util": "0.3.13"
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/EXECUTION_MODEL.md
CHANGED
|
@@ -245,7 +245,7 @@ interface CacheRegistry {
|
|
|
245
245
|
|
|
246
246
|
`TaskGraphRunner` resolves the registry from the per-run `ServiceRegistry` and dispatches each task's read/write to the slot named by its policy. Both slots are independently optional. A missing slot is a silent no-op: the task runs uncached, no error.
|
|
247
247
|
|
|
248
|
-
For the `private` slot, the runner constructs a per-run `RunPrivateCacheRepo` wrapper that prefixes every key with `__run:${runId}
|
|
248
|
+
For the `private` slot, the runner constructs a per-run `RunPrivateCacheRepo` wrapper that prefixes every key with `__run:${runId}::${taskId}`. Two runs with different `runId`s never see each other's rows; the same `runId` (a restart) does. Two task nodes of the same class in one graph never share private entries because each keys by its instance id, not its type.
|
|
249
249
|
|
|
250
250
|
### Run identity (`runId`)
|
|
251
251
|
|
|
@@ -275,9 +275,9 @@ key = sha256(taskType + getCacheVersion() + fingerprint(inputs))
|
|
|
275
275
|
|
|
276
276
|
### Lifecycle of cache rows
|
|
277
277
|
|
|
278
|
-
| Tier | Written
|
|
279
|
-
| --------------- |
|
|
280
|
-
| `deterministic` | On task success | On task start
|
|
278
|
+
| Tier | Written | Read | Deleted |
|
|
279
|
+
| --------------- | --------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
280
|
+
| `deterministic` | On task success | On task start | Never automatically. App owns invalidation (typically via `version` bumps). |
|
|
281
281
|
| `private` | On task success | On task start, filtered to current `runId` | **(a)** `privateRepo.clearRun()` on `succeeded` (the wrapper already knows its `runId`). **(b)** TTL sweep via `CacheJanitor.sweepStaleRunPrivate(olderThanMs)` for abandoned runs. |
|
|
282
282
|
|
|
283
283
|
Failed tasks are never cached — only `Ok` results reach `saveOutput`. `saveOutput` is upsert by primary key (last writer wins) — the underlying `TaskOutputTabularRepository` calls `put()` on its tabular storage, so a same-key write replaces the existing row.
|