@rkmodules/rules 0.0.178 → 0.0.180
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.
|
@@ -40,7 +40,7 @@ export interface EngineFunctionBuiltEvent {
|
|
|
40
40
|
}
|
|
41
41
|
export type EngineEvent = EngineStartEvent | EngineEndEvent | EngineFunctionBuiltEvent;
|
|
42
42
|
export type EngineEventName = "result" | "functionCall" | "functionResult" | "functionBuilt";
|
|
43
|
-
export declare class Engine<Env extends Record<string, any> =
|
|
43
|
+
export declare class Engine<Env extends Record<string, any> = {}> {
|
|
44
44
|
private fnIndex;
|
|
45
45
|
private graphDefinitions;
|
|
46
46
|
private automaticMounts;
|
|
@@ -32,7 +32,7 @@ export type RecOfTrees = Record<string, Tree<any>>;
|
|
|
32
32
|
* primitive node, with input and output definitions and an implementation
|
|
33
33
|
* this is similar to native functions
|
|
34
34
|
*/
|
|
35
|
-
export type PrimitiveFunction = {
|
|
35
|
+
export type PrimitiveFunction<Env extends Record<string, any> = {}> = {
|
|
36
36
|
name: string;
|
|
37
37
|
/** Deterministic from immutable inputs, params and own call metadata; no side effects. */
|
|
38
38
|
pure?: boolean;
|
|
@@ -47,7 +47,7 @@ export type PrimitiveFunction = {
|
|
|
47
47
|
params?: Record<string, VarDef>;
|
|
48
48
|
inputs?: Record<string, VarDef>;
|
|
49
49
|
outputs?: Record<string, VarDef>;
|
|
50
|
-
impl: (inputs: RecOfTrees, params: Record<string, any>, engine: Engine
|
|
50
|
+
impl: (inputs: RecOfTrees, params: Record<string, any>, engine: Engine<Env>, context: ExecutionContext | null, name: string) => Promise<RecOfTrees>;
|
|
51
51
|
mount?: (trigger: () => void) => (() => void) | void;
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -9,7 +9,7 @@ type FlowContextState = {
|
|
|
9
9
|
prompts?: Prompts;
|
|
10
10
|
};
|
|
11
11
|
export declare const FlowContext: React.Context<FlowContextState>;
|
|
12
|
-
export declare const useEngine: () => Engine<
|
|
12
|
+
export declare const useEngine: () => Engine<{}>;
|
|
13
13
|
export declare const useControls: () => {};
|
|
14
14
|
export declare const useGraphedFunction: () => GraphedFunction;
|
|
15
15
|
export declare const usePrompts: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rkmodules/rules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.180",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.esm.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
"build": "npm run rollup",
|
|
32
32
|
"rollup": "rm -rf dist && rollup -c",
|
|
33
33
|
"prepare": "npm run rollup",
|
|
34
|
-
"dev": "next dev"
|
|
34
|
+
"dev": "next dev",
|
|
35
|
+
"next:build": "next build",
|
|
36
|
+
"next:start": "next start"
|
|
35
37
|
},
|
|
36
38
|
"author": "rikkert@rikkertkoppes.com",
|
|
37
39
|
"license": "ISC",
|