@workglow/task-graph 0.0.124 → 0.0.126
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/README.md +108 -12
- package/dist/browser.d.ts +1 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +1242 -767
- package/dist/browser.js.map +21 -21
- package/dist/bun.js +605 -767
- package/dist/bun.js.map +19 -20
- package/dist/debug/console/ConsoleFormatters.d.ts +45 -0
- package/dist/debug/console/ConsoleFormatters.d.ts.map +1 -0
- package/dist/node.js +605 -767
- package/dist/node.js.map +19 -20
- package/dist/task-graph/Conversions.d.ts.map +1 -1
- package/package.json +20 -11
- package/src/debug/README.md +115 -0
- package/src/storage/README.md +51 -5
- package/dist/types.d.ts +0 -7
- package/dist/types.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
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;AAO7C,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;
|
|
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;AAO7C,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;AA2GpB,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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/task-graph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.126",
|
|
5
5
|
"description": "Task graph management for Workglow, providing DAG construction, execution planning, and workflow orchestration.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"watch": "concurrently -c 'auto' 'bun:watch-*'",
|
|
@@ -22,10 +22,19 @@
|
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"react-native":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
"react-native": {
|
|
26
|
+
"types": "./dist/browser.d.ts",
|
|
27
|
+
"import": "./dist/browser.js"
|
|
28
|
+
},
|
|
29
|
+
"browser": {
|
|
30
|
+
"types": "./dist/browser.d.ts",
|
|
31
|
+
"import": "./dist/browser.js"
|
|
32
|
+
},
|
|
33
|
+
"bun": {
|
|
34
|
+
"types": "./dist/bun.d.ts",
|
|
35
|
+
"import": "./dist/bun.js"
|
|
36
|
+
},
|
|
37
|
+
"types": "./dist/node.d.ts",
|
|
29
38
|
"import": "./dist/node.js"
|
|
30
39
|
}
|
|
31
40
|
},
|
|
@@ -37,9 +46,9 @@
|
|
|
37
46
|
"access": "public"
|
|
38
47
|
},
|
|
39
48
|
"peerDependencies": {
|
|
40
|
-
"@workglow/job-queue": "0.0.
|
|
41
|
-
"@workglow/storage": "0.0.
|
|
42
|
-
"@workglow/util": "0.0.
|
|
49
|
+
"@workglow/job-queue": "0.0.126",
|
|
50
|
+
"@workglow/storage": "0.0.126",
|
|
51
|
+
"@workglow/util": "0.0.126"
|
|
43
52
|
},
|
|
44
53
|
"peerDependenciesMeta": {
|
|
45
54
|
"@workglow/job-queue": {
|
|
@@ -53,8 +62,8 @@
|
|
|
53
62
|
}
|
|
54
63
|
},
|
|
55
64
|
"devDependencies": {
|
|
56
|
-
"@workglow/job-queue": "0.0.
|
|
57
|
-
"@workglow/storage": "0.0.
|
|
58
|
-
"@workglow/util": "0.0.
|
|
65
|
+
"@workglow/job-queue": "0.0.126",
|
|
66
|
+
"@workglow/storage": "0.0.126",
|
|
67
|
+
"@workglow/util": "0.0.126"
|
|
59
68
|
}
|
|
60
69
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Chrome DevTools formatters (`ConsoleFormatters`)
|
|
2
|
+
|
|
3
|
+
Debug utilities for Workglow task graphs and workflows.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`ConsoleFormatters.ts` is re-exported from the main **`@workglow/task-graph`** entry when using the **browser** build (`dist/browser.js`). It provides Chrome DevTools custom formatters for rich console output for task graphs, workflows, tasks, and dataflows.
|
|
8
|
+
|
|
9
|
+
This code is **browser-oriented** (it uses `window` and the DevTools formatter API). Do not call it from Node-only bundles.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Chrome DevTools Custom Formatters**: Rich, colored console output for Workglow objects
|
|
14
|
+
- **Dark Mode Support**: Automatically adapts colors based on browser theme
|
|
15
|
+
- **DAG Visualization**: Visual graph rendering for directed acyclic graphs
|
|
16
|
+
- **React Element Formatting**: Pretty-print React elements in the console
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
`@workglow/util` is a peer dependency of `@workglow/task-graph` (graph and schema types used by the formatters).
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @workglow/task-graph @workglow/util
|
|
24
|
+
# or
|
|
25
|
+
bun add @workglow/task-graph @workglow/util
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### Installing DevTools Formatters
|
|
31
|
+
|
|
32
|
+
Call `installDevToolsFormatters()` early in your application to enable rich console output:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import { installDevToolsFormatters } from "@workglow/task-graph";
|
|
36
|
+
|
|
37
|
+
// Call once during app initialization
|
|
38
|
+
installDevToolsFormatters();
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Enabling Custom Formatters in Chrome DevTools
|
|
42
|
+
|
|
43
|
+
1. Open Chrome DevTools (F12 or Cmd+Option+I)
|
|
44
|
+
2. Go to Settings (gear icon or F1)
|
|
45
|
+
3. Under "Console", check "Enable custom formatters"
|
|
46
|
+
4. Refresh the page
|
|
47
|
+
|
|
48
|
+
### Viewing Rich Output
|
|
49
|
+
|
|
50
|
+
Once formatters are installed and enabled, simply `console.log` any Workglow object:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { Workflow } from "@workglow/task-graph";
|
|
54
|
+
import { installDevToolsFormatters } from "@workglow/task-graph";
|
|
55
|
+
|
|
56
|
+
installDevToolsFormatters();
|
|
57
|
+
|
|
58
|
+
const workflow = new Workflow();
|
|
59
|
+
// ... add tasks ...
|
|
60
|
+
|
|
61
|
+
// Rich formatted output in DevTools
|
|
62
|
+
console.log(workflow);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Supported Objects
|
|
66
|
+
|
|
67
|
+
The following Workglow objects will display with rich formatting:
|
|
68
|
+
|
|
69
|
+
- **Workflow**: Shows task count, error state, and expandable task list
|
|
70
|
+
- **TaskGraph**: Displays all tasks and dataflows with DAG visualization
|
|
71
|
+
- **Task**: Shows input/output data, configuration, and status with color coding
|
|
72
|
+
- **Dataflow**: Displays source and target connections with values
|
|
73
|
+
- **DirectedAcyclicGraph**: Renders a visual canvas representation
|
|
74
|
+
- **React Elements**: Pretty-prints React components with props
|
|
75
|
+
|
|
76
|
+
## API
|
|
77
|
+
|
|
78
|
+
### `installDevToolsFormatters()`
|
|
79
|
+
|
|
80
|
+
Registers custom formatters with Chrome DevTools. Call once during application startup.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { installDevToolsFormatters } from "@workglow/task-graph";
|
|
84
|
+
|
|
85
|
+
installDevToolsFormatters();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### `isDarkMode()`
|
|
89
|
+
|
|
90
|
+
Returns whether the browser is currently in dark mode.
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { isDarkMode } from "@workglow/task-graph";
|
|
94
|
+
|
|
95
|
+
if (isDarkMode()) {
|
|
96
|
+
console.log("Using dark theme colors");
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Color Coding
|
|
101
|
+
|
|
102
|
+
The formatters use consistent color coding:
|
|
103
|
+
|
|
104
|
+
| Color | Meaning |
|
|
105
|
+
| --------- | ------------------------------ |
|
|
106
|
+
| Green | Input parameters |
|
|
107
|
+
| Red/Brown | Output values |
|
|
108
|
+
| Yellow | Highlighted names/keywords |
|
|
109
|
+
| Grey | Punctuation and secondary text |
|
|
110
|
+
|
|
111
|
+
Colors automatically adjust for dark/light mode.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
Apache 2.0 - See [LICENSE](../../LICENSE) for details.
|
package/src/storage/README.md
CHANGED
|
@@ -14,8 +14,25 @@ TaskOutputRepository is a repository for task caching. If a task has the same in
|
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
16
|
// Example usage
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
TaskOutputPrimaryKeyNames,
|
|
19
|
+
TaskOutputSchema,
|
|
20
|
+
TaskOutputTabularRepository,
|
|
21
|
+
} from "@workglow/task-graph";
|
|
22
|
+
import { SqliteTabularStorage } from "@workglow/storage";
|
|
23
|
+
import { Sqlite } from "@workglow/storage/sqlite";
|
|
24
|
+
|
|
25
|
+
await Sqlite.init();
|
|
26
|
+
|
|
27
|
+
const outputRepo = new TaskOutputTabularRepository({
|
|
28
|
+
tabularRepository: new SqliteTabularStorage(
|
|
29
|
+
":memory:",
|
|
30
|
+
"task_outputs",
|
|
31
|
+
TaskOutputSchema,
|
|
32
|
+
TaskOutputPrimaryKeyNames,
|
|
33
|
+
["createdAt"]
|
|
34
|
+
),
|
|
35
|
+
});
|
|
19
36
|
await outputRepo.saveOutput("MyTaskType", { param: "value" }, { result: "data" });
|
|
20
37
|
```
|
|
21
38
|
|
|
@@ -31,9 +48,38 @@ The `TaskGraphRepository` class provides:
|
|
|
31
48
|
|
|
32
49
|
```typescript
|
|
33
50
|
// Example usage
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
import {
|
|
52
|
+
TaskGraphPrimaryKeyNames,
|
|
53
|
+
TaskGraphSchema,
|
|
54
|
+
TaskGraphTabularRepository,
|
|
55
|
+
} from "@workglow/task-graph";
|
|
56
|
+
import {
|
|
57
|
+
FsFolderTabularStorage,
|
|
58
|
+
InMemoryTabularStorage,
|
|
59
|
+
SqliteTabularStorage,
|
|
60
|
+
} from "@workglow/storage";
|
|
61
|
+
import { Sqlite } from "@workglow/storage/sqlite";
|
|
62
|
+
|
|
63
|
+
const fsRepo = new TaskGraphTabularRepository({
|
|
64
|
+
tabularRepository: new FsFolderTabularStorage(
|
|
65
|
+
"./storage",
|
|
66
|
+
TaskGraphSchema,
|
|
67
|
+
TaskGraphPrimaryKeyNames
|
|
68
|
+
),
|
|
69
|
+
});
|
|
70
|
+
const memoryRepo = new TaskGraphTabularRepository({
|
|
71
|
+
tabularRepository: new InMemoryTabularStorage(TaskGraphSchema, TaskGraphPrimaryKeyNames),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
await Sqlite.init();
|
|
75
|
+
const sqliteRepo = new TaskGraphTabularRepository({
|
|
76
|
+
tabularRepository: new SqliteTabularStorage(
|
|
77
|
+
":memory:",
|
|
78
|
+
"task_graphs",
|
|
79
|
+
TaskGraphSchema,
|
|
80
|
+
TaskGraphPrimaryKeyNames
|
|
81
|
+
),
|
|
82
|
+
});
|
|
37
83
|
```
|
|
38
84
|
|
|
39
85
|
## Testing
|
package/dist/types.d.ts
DELETED
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,UAAU,CAAC"}
|