@workglow/util 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.
- package/LICENSE +203 -0
- package/README.md +318 -0
- package/dist/browser.js +1554 -0
- package/dist/browser.js.map +27 -0
- package/dist/bun.js +1558 -0
- package/dist/bun.js.map +27 -0
- package/dist/common.d.ts +20 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/compress/compress.browser.d.ts +8 -0
- package/dist/compress/compress.browser.d.ts.map +1 -0
- package/dist/compress/compress.node.d.ts +8 -0
- package/dist/compress/compress.node.d.ts.map +1 -0
- package/dist/crypto/Crypto.browser.d.ts +9 -0
- package/dist/crypto/Crypto.browser.d.ts.map +1 -0
- package/dist/crypto/Crypto.bun.d.ts +9 -0
- package/dist/crypto/Crypto.bun.d.ts.map +1 -0
- package/dist/crypto/Crypto.node.d.ts +9 -0
- package/dist/crypto/Crypto.node.d.ts.map +1 -0
- package/dist/di/Container.d.ts +53 -0
- package/dist/di/Container.d.ts.map +1 -0
- package/dist/di/ServiceRegistry.d.ts +60 -0
- package/dist/di/ServiceRegistry.d.ts.map +1 -0
- package/dist/di/index.d.ts +8 -0
- package/dist/di/index.d.ts.map +1 -0
- package/dist/events/EventEmitter.d.ts +80 -0
- package/dist/events/EventEmitter.d.ts.map +1 -0
- package/dist/graph/directedAcyclicGraph.d.ts +70 -0
- package/dist/graph/directedAcyclicGraph.d.ts.map +1 -0
- package/dist/graph/directedGraph.d.ts +90 -0
- package/dist/graph/directedGraph.d.ts.map +1 -0
- package/dist/graph/errors.d.ts +38 -0
- package/dist/graph/errors.d.ts.map +1 -0
- package/dist/graph/graph.d.ts +217 -0
- package/dist/graph/graph.d.ts.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/json-schema/DataPortSchema.d.ts +17 -0
- package/dist/json-schema/DataPortSchema.d.ts.map +1 -0
- package/dist/json-schema/FromSchema.d.ts +96 -0
- package/dist/json-schema/FromSchema.d.ts.map +1 -0
- package/dist/json-schema/JsonSchema.d.ts +22 -0
- package/dist/json-schema/JsonSchema.d.ts.map +1 -0
- package/dist/json-schema/SchemaUtils.d.ts +58 -0
- package/dist/json-schema/SchemaUtils.d.ts.map +1 -0
- package/dist/json-schema/SchemaValidation.d.ts +8 -0
- package/dist/json-schema/SchemaValidation.d.ts.map +1 -0
- package/dist/node.js +1579 -0
- package/dist/node.js.map +27 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utilities/BaseError.d.ts +14 -0
- package/dist/utilities/BaseError.d.ts.map +1 -0
- package/dist/utilities/Misc.d.ts +20 -0
- package/dist/utilities/Misc.d.ts.map +1 -0
- package/dist/utilities/TypeUtilities.d.ts +27 -0
- package/dist/utilities/TypeUtilities.d.ts.map +1 -0
- package/dist/utilities/objectOfArraysAsArrayOfObjects.d.ts +26 -0
- package/dist/utilities/objectOfArraysAsArrayOfObjects.d.ts.map +1 -0
- package/dist/worker/Worker.browser.d.ts +7 -0
- package/dist/worker/Worker.browser.d.ts.map +1 -0
- package/dist/worker/Worker.bun.d.ts +7 -0
- package/dist/worker/Worker.bun.d.ts.map +1 -0
- package/dist/worker/Worker.node.d.ts +11 -0
- package/dist/worker/Worker.node.d.ts.map +1 -0
- package/dist/worker/WorkerManager.d.ts +17 -0
- package/dist/worker/WorkerManager.d.ts.map +1 -0
- package/dist/worker/WorkerServer.d.ts +26 -0
- package/dist/worker/WorkerServer.d.ts.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FromSchema.d.ts","sourceRoot":"","sources":["../../src/json-schema/FromSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,cAAc,C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AAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;CAAE,GAC1D,EAAE,CAAC,CAAC;AAEV;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,YAAY,CACtB,MAAM,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EACxF,IAAI,SAAS,SAAS,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAClD,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC,GAAG;IAC5C,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,CAAC,IAAI,OAAO,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;KAC3F,CAAC;CACH,GAAG,CAAC,MAAM,SAAS;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,SAAS,MAAM,CAAC,EAAE,CAAA;CAAE,GACxE;IAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;CAAE,GAC1D,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { ExtendedJSONSchema, JSONSchemaExtension } from "json-schema-to-ts";
|
|
7
|
+
export type JsonSchemaCustomProps = {
|
|
8
|
+
"x-replicate"?: boolean;
|
|
9
|
+
"x-ui-reactive"?: boolean | string;
|
|
10
|
+
"x-ui-hidden"?: boolean;
|
|
11
|
+
"x-ui-order"?: number;
|
|
12
|
+
"x-ui-priority"?: number;
|
|
13
|
+
"x-ui-viewer"?: string;
|
|
14
|
+
"x-ui-editor"?: string;
|
|
15
|
+
"x-ui-group"?: string;
|
|
16
|
+
"x-ui-group-order"?: number;
|
|
17
|
+
"x-ui-group-priority"?: number;
|
|
18
|
+
"x-ui-group-open"?: boolean;
|
|
19
|
+
"x-ui"?: unknown;
|
|
20
|
+
};
|
|
21
|
+
export type JsonSchema<EXTENSION extends JSONSchemaExtension = JsonSchemaCustomProps> = ExtendedJSONSchema<EXTENSION>;
|
|
22
|
+
//# sourceMappingURL=JsonSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonSchema.d.ts","sourceRoot":"","sources":["../../src/json-schema/JsonSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,SAAS,SAAS,mBAAmB,GAAG,qBAAqB,IAClF,kBAAkB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Semantic Compatibility Utilities for Task Graph Dataflows
|
|
8
|
+
*
|
|
9
|
+
* In this project, task graphs have connections between tasks called dataflows.
|
|
10
|
+
* These dataflows have different kinds of compatibility checks:
|
|
11
|
+
*
|
|
12
|
+
* **Static Compatibility:**
|
|
13
|
+
* Static rules help decide if an edge should be connected at all. A connection
|
|
14
|
+
* is statically compatible if:
|
|
15
|
+
* - The source and target are the same exact type
|
|
16
|
+
* - The source connects to the equivalent of "any" (target accepts anything)
|
|
17
|
+
* - The source type is acceptable to the target (e.g., a string to something
|
|
18
|
+
* that accepts oneOf[string[], string])
|
|
19
|
+
*
|
|
20
|
+
* **Runtime Compatibility:**
|
|
21
|
+
* Assuming the connection is allowed at design time (passes static check),
|
|
22
|
+
* runtime rules determine if they are compatible during execution.
|
|
23
|
+
*
|
|
24
|
+
* Currently, there is one runtime compatibility check:
|
|
25
|
+
* - If both input and output schemas have 'format' annotations attached,
|
|
26
|
+
* the format annotation has the format /\w+(:\w+)?/ where the first part
|
|
27
|
+
* is the "name" and if alone matches any other with the same "name".
|
|
28
|
+
* If there is a second part, then that narrows the type.
|
|
29
|
+
* - Format checks apply to all types (strings, arrays, etc.), not just strings
|
|
30
|
+
* - A schema with format can connect to a schema with no format (source has format, target doesn't)
|
|
31
|
+
* - A schema with no format cannot connect to a schema with format (source doesn't have format, target does)
|
|
32
|
+
*
|
|
33
|
+
* Example: In the AI package, 'format':'model' and 'format': 'model:EmbeddingTask'
|
|
34
|
+
* are used on string types. An input with property `model` and 'format':'model'
|
|
35
|
+
* connects to a target with property `model` and 'format':'model:EmbeddingTask' --
|
|
36
|
+
* this compatibility is called "runtime". It first passes the static check as
|
|
37
|
+
* compatible and then notices a difference in format runtime.
|
|
38
|
+
*
|
|
39
|
+
* Format is also used on array types, e.g., 'format':'Float64Array' on arrays
|
|
40
|
+
* containing Float64 numbers.
|
|
41
|
+
*
|
|
42
|
+
* Only connections that pass the runtime check will pass data at runtime.
|
|
43
|
+
*/
|
|
44
|
+
import type { JsonSchema } from "./JsonSchema";
|
|
45
|
+
/**
|
|
46
|
+
* Checks if two JSON schemas are semantically compatible.
|
|
47
|
+
* Returns:
|
|
48
|
+
* - "static": Compatible at design time, no runtime check needed
|
|
49
|
+
* - "runtime": Compatible at design time, but needs runtime semantic check
|
|
50
|
+
* - "incompatible": Not compatible
|
|
51
|
+
*/
|
|
52
|
+
export declare function areSemanticallyCompatible(sourceSchema: JsonSchema, targetSchema: JsonSchema): "static" | "runtime" | "incompatible";
|
|
53
|
+
/**
|
|
54
|
+
* Checks if two object schemas are semantically compatible.
|
|
55
|
+
* This is a helper function for checking object-level schema compatibility.
|
|
56
|
+
*/
|
|
57
|
+
export declare function areObjectSchemasSemanticallyCompatible(sourceSchema: JsonSchema, targetSchema: JsonSchema): "static" | "runtime" | "incompatible";
|
|
58
|
+
//# sourceMappingURL=SchemaUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaUtils.d.ts","sourceRoot":"","sources":["../../src/json-schema/SchemaUtils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA6N/C;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,UAAU,EACxB,YAAY,EAAE,UAAU,GACvB,QAAQ,GAAG,SAAS,GAAG,cAAc,CAgSvC;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,YAAY,EAAE,UAAU,EACxB,YAAY,EAAE,UAAU,GACvB,QAAQ,GAAG,SAAS,GAAG,cAAc,CAEvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export { compileSchema } from "json-schema-library";
|
|
7
|
+
export type { SchemaNode } from "json-schema-library";
|
|
8
|
+
//# sourceMappingURL=SchemaValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaValidation.d.ts","sourceRoot":"","sources":["../../src/json-schema/SchemaValidation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|