@jarenjs/flow 0.34.0

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,200 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://jarenjs.dev/schemas/jaren-dag/0.1/draft-07",
4
+ "title": "Jaren dataflow graph 0.1",
5
+ "description": "Structural grammar of an executable jaren-dag document (see packages/flow/docs/FLOW-FORMAT.md sections 6-7): named nodes from a closed kind vocabulary (input, output, const, query, jslt, task) wired by edges that carry data, with embedded Jaren JSON Query and JSLT documents composed by reference - register those published grammars alongside this artifact. This schema is structural validation only: the compiler remains authoritative for the wiring rules it cannot express - unknown node references, port completeness and uniqueness, acyclicity, the exactly-one-output rule and task-registry resolution are compile-time checks (JF0xxx), and unknown members are ignored for forward compatibility.",
6
+ "type": "object",
7
+ "required": [
8
+ "$dag",
9
+ "nodes",
10
+ "edges"
11
+ ],
12
+ "properties": {
13
+ "$dag": {
14
+ "description": "The dag format version; required.",
15
+ "const": "0.1"
16
+ },
17
+ "nodes": {
18
+ "description": "Node declarations, id to declaration. The id is what edges reference.",
19
+ "type": "object",
20
+ "additionalProperties": {
21
+ "$ref": "#/definitions/node"
22
+ }
23
+ },
24
+ "edges": {
25
+ "description": "The wiring: data flows from a node's result to a consumer's input scope, in document order for port-object assembly.",
26
+ "type": "array",
27
+ "items": {
28
+ "$ref": "#/definitions/edge"
29
+ }
30
+ }
31
+ },
32
+ "definitions": {
33
+ "node": {
34
+ "oneOf": [
35
+ {
36
+ "description": "Yields the run's input value (null when absent). Accepts no inbound edge.",
37
+ "type": "object",
38
+ "properties": {
39
+ "kind": {
40
+ "const": "input"
41
+ },
42
+ "checkpoint": {
43
+ "type": "boolean",
44
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
45
+ }
46
+ },
47
+ "required": [
48
+ "kind"
49
+ ]
50
+ },
51
+ {
52
+ "description": "The run's result is this node's input scope value. Exactly one per document; no outbound edge.",
53
+ "type": "object",
54
+ "properties": {
55
+ "kind": {
56
+ "const": "output"
57
+ },
58
+ "checkpoint": {
59
+ "type": "boolean",
60
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
61
+ }
62
+ },
63
+ "required": [
64
+ "kind"
65
+ ]
66
+ },
67
+ {
68
+ "description": "Yields its literal value. Accepts no inbound edge.",
69
+ "type": "object",
70
+ "properties": {
71
+ "kind": {
72
+ "const": "const"
73
+ },
74
+ "value": {
75
+ "description": "Any JSON value, delivered by reference."
76
+ },
77
+ "checkpoint": {
78
+ "type": "boolean",
79
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
80
+ }
81
+ },
82
+ "required": [
83
+ "kind",
84
+ "value"
85
+ ]
86
+ },
87
+ {
88
+ "description": "A Jaren JSON Query evaluated with $ bound to the node's input scope; an empty result yields null.",
89
+ "type": "object",
90
+ "properties": {
91
+ "kind": {
92
+ "const": "query"
93
+ },
94
+ "query": {
95
+ "description": "The query document.",
96
+ "allOf": [
97
+ {
98
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1/draft-07"
99
+ }
100
+ ]
101
+ },
102
+ "checkpoint": {
103
+ "type": "boolean",
104
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
105
+ }
106
+ },
107
+ "required": [
108
+ "kind",
109
+ "query"
110
+ ]
111
+ },
112
+ {
113
+ "description": "A JSLT stylesheet transforming the node's input scope; an empty result yields null.",
114
+ "type": "object",
115
+ "properties": {
116
+ "kind": {
117
+ "const": "jslt"
118
+ },
119
+ "stylesheet": {
120
+ "description": "The stylesheet document (bare rule array or envelope form).",
121
+ "allOf": [
122
+ {
123
+ "$ref": "https://jarenjs.dev/schemas/jaren-jslt/0.1/draft-07"
124
+ }
125
+ ]
126
+ },
127
+ "checkpoint": {
128
+ "type": "boolean",
129
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
130
+ }
131
+ },
132
+ "required": [
133
+ "kind",
134
+ "stylesheet"
135
+ ]
136
+ },
137
+ {
138
+ "description": "A registered async handler, called as handler({ with, input }, signal); the handler must honor the run's shared AbortSignal.",
139
+ "type": "object",
140
+ "properties": {
141
+ "kind": {
142
+ "const": "task"
143
+ },
144
+ "run": {
145
+ "description": "The compile-time registry handler name.",
146
+ "type": "string",
147
+ "minLength": 1
148
+ },
149
+ "with": {
150
+ "description": "Handler props: a query resolved against the node's input scope (null when absent or empty).",
151
+ "allOf": [
152
+ {
153
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1/draft-07"
154
+ }
155
+ ]
156
+ },
157
+ "checkpoint": {
158
+ "type": "boolean",
159
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
160
+ }
161
+ },
162
+ "required": [
163
+ "kind",
164
+ "run"
165
+ ]
166
+ }
167
+ ]
168
+ },
169
+ "edge": {
170
+ "type": "object",
171
+ "properties": {
172
+ "from": {
173
+ "description": "The producing node id.",
174
+ "type": "string"
175
+ },
176
+ "to": {
177
+ "description": "The consuming node id.",
178
+ "type": "string"
179
+ },
180
+ "port": {
181
+ "description": "Names this delivery in the consumer's input-scope object; when any inbound edge of a node is ported, all must be, uniquely.",
182
+ "type": "string",
183
+ "minLength": 1
184
+ },
185
+ "select": {
186
+ "description": "A query applied to the source value before delivery; an empty result delivers null.",
187
+ "allOf": [
188
+ {
189
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1/draft-07"
190
+ }
191
+ ]
192
+ }
193
+ },
194
+ "required": [
195
+ "from",
196
+ "to"
197
+ ]
198
+ }
199
+ }
200
+ }
@@ -0,0 +1,200 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jarenjs.dev/schemas/jaren-dag/0.1",
4
+ "title": "Jaren dataflow graph 0.1",
5
+ "description": "Structural grammar of an executable jaren-dag document (see packages/flow/docs/FLOW-FORMAT.md sections 6-7): named nodes from a closed kind vocabulary (input, output, const, query, jslt, task) wired by edges that carry data, with embedded Jaren JSON Query and JSLT documents composed by reference - register those published grammars alongside this artifact. This schema is structural validation only: the compiler remains authoritative for the wiring rules it cannot express - unknown node references, port completeness and uniqueness, acyclicity, the exactly-one-output rule and task-registry resolution are compile-time checks (JF0xxx), and unknown members are ignored for forward compatibility.",
6
+ "type": "object",
7
+ "required": [
8
+ "$dag",
9
+ "nodes",
10
+ "edges"
11
+ ],
12
+ "properties": {
13
+ "$dag": {
14
+ "description": "The dag format version; required.",
15
+ "const": "0.1"
16
+ },
17
+ "nodes": {
18
+ "description": "Node declarations, id to declaration. The id is what edges reference.",
19
+ "type": "object",
20
+ "additionalProperties": {
21
+ "$ref": "#/$defs/node"
22
+ }
23
+ },
24
+ "edges": {
25
+ "description": "The wiring: data flows from a node's result to a consumer's input scope, in document order for port-object assembly.",
26
+ "type": "array",
27
+ "items": {
28
+ "$ref": "#/$defs/edge"
29
+ }
30
+ }
31
+ },
32
+ "$defs": {
33
+ "node": {
34
+ "oneOf": [
35
+ {
36
+ "description": "Yields the run's input value (null when absent). Accepts no inbound edge.",
37
+ "type": "object",
38
+ "properties": {
39
+ "kind": {
40
+ "const": "input"
41
+ },
42
+ "checkpoint": {
43
+ "type": "boolean",
44
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
45
+ }
46
+ },
47
+ "required": [
48
+ "kind"
49
+ ]
50
+ },
51
+ {
52
+ "description": "The run's result is this node's input scope value. Exactly one per document; no outbound edge.",
53
+ "type": "object",
54
+ "properties": {
55
+ "kind": {
56
+ "const": "output"
57
+ },
58
+ "checkpoint": {
59
+ "type": "boolean",
60
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
61
+ }
62
+ },
63
+ "required": [
64
+ "kind"
65
+ ]
66
+ },
67
+ {
68
+ "description": "Yields its literal value. Accepts no inbound edge.",
69
+ "type": "object",
70
+ "properties": {
71
+ "kind": {
72
+ "const": "const"
73
+ },
74
+ "value": {
75
+ "description": "Any JSON value, delivered by reference."
76
+ },
77
+ "checkpoint": {
78
+ "type": "boolean",
79
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
80
+ }
81
+ },
82
+ "required": [
83
+ "kind",
84
+ "value"
85
+ ]
86
+ },
87
+ {
88
+ "description": "A Jaren JSON Query evaluated with $ bound to the node's input scope; an empty result yields null.",
89
+ "type": "object",
90
+ "properties": {
91
+ "kind": {
92
+ "const": "query"
93
+ },
94
+ "query": {
95
+ "description": "The query document.",
96
+ "allOf": [
97
+ {
98
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1"
99
+ }
100
+ ]
101
+ },
102
+ "checkpoint": {
103
+ "type": "boolean",
104
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
105
+ }
106
+ },
107
+ "required": [
108
+ "kind",
109
+ "query"
110
+ ]
111
+ },
112
+ {
113
+ "description": "A JSLT stylesheet transforming the node's input scope; an empty result yields null.",
114
+ "type": "object",
115
+ "properties": {
116
+ "kind": {
117
+ "const": "jslt"
118
+ },
119
+ "stylesheet": {
120
+ "description": "The stylesheet document (bare rule array or envelope form).",
121
+ "allOf": [
122
+ {
123
+ "$ref": "https://jarenjs.dev/schemas/jaren-jslt/0.1"
124
+ }
125
+ ]
126
+ },
127
+ "checkpoint": {
128
+ "type": "boolean",
129
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
130
+ }
131
+ },
132
+ "required": [
133
+ "kind",
134
+ "stylesheet"
135
+ ]
136
+ },
137
+ {
138
+ "description": "A registered async handler, called as handler({ with, input }, signal); the handler must honor the run's shared AbortSignal.",
139
+ "type": "object",
140
+ "properties": {
141
+ "kind": {
142
+ "const": "task"
143
+ },
144
+ "run": {
145
+ "description": "The compile-time registry handler name.",
146
+ "type": "string",
147
+ "minLength": 1
148
+ },
149
+ "with": {
150
+ "description": "Handler props: a query resolved against the node's input scope (null when absent or empty).",
151
+ "allOf": [
152
+ {
153
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1"
154
+ }
155
+ ]
156
+ },
157
+ "checkpoint": {
158
+ "type": "boolean",
159
+ "description": "Opt-in durable checkpointing (FLOW-FORMAT §7.6): asserts this node's output is JSON-serializable; recorded values are seeded on resume instead of re-evaluated."
160
+ }
161
+ },
162
+ "required": [
163
+ "kind",
164
+ "run"
165
+ ]
166
+ }
167
+ ]
168
+ },
169
+ "edge": {
170
+ "type": "object",
171
+ "properties": {
172
+ "from": {
173
+ "description": "The producing node id.",
174
+ "type": "string"
175
+ },
176
+ "to": {
177
+ "description": "The consuming node id.",
178
+ "type": "string"
179
+ },
180
+ "port": {
181
+ "description": "Names this delivery in the consumer's input-scope object; when any inbound edge of a node is ported, all must be, uniquely.",
182
+ "type": "string",
183
+ "minLength": 1
184
+ },
185
+ "select": {
186
+ "description": "A query applied to the source value before delivery; an empty result delivers null.",
187
+ "allOf": [
188
+ {
189
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1"
190
+ }
191
+ ]
192
+ }
193
+ },
194
+ "required": [
195
+ "from",
196
+ "to"
197
+ ]
198
+ }
199
+ }
200
+ }
@@ -0,0 +1,127 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://jarenjs.dev/schemas/jaren-fsm/0.1/draft-07",
4
+ "title": "Jaren finite state machine 0.1",
5
+ "description": "Structural grammar of an executable jaren-fsm document (see packages/flow/docs/FLOW-FORMAT.md): declared states, an initial state and a document-ordered transition table whose guards and effect props are Jaren JSON Query documents — register the published query grammar alongside this artifact. The shape is a strict superset of the mermaid state-diagram projection ('jaren-workflow'): its version key is optional, a plain-string guard is a query document (a $-path expression; any other non-empty string is a literal and therefore always true), and null means no guard / any event. This schema is structural validation only: the compiler remains authoritative for semantic rules it cannot express — undeclared state references, duplicate ids and guard compilability are compile-time checks (JF0xxx), and unknown members are ignored for forward compatibility.",
6
+ "type": "object",
7
+ "properties": {
8
+ "$fsm": {
9
+ "description": "The fsm format version; absent implies 0.1.",
10
+ "const": "0.1"
11
+ },
12
+ "initial": {
13
+ "description": "The id of the machine's initial state, or null when the document does not choose one (a session must then be started with an explicit state).",
14
+ "type": [
15
+ "string",
16
+ "null"
17
+ ]
18
+ },
19
+ "states": {
20
+ "description": "Declared states, in document order. A string is shorthand for { id }.",
21
+ "type": "array",
22
+ "items": {
23
+ "anyOf": [
24
+ {
25
+ "type": "string"
26
+ },
27
+ {
28
+ "type": "object",
29
+ "properties": {
30
+ "id": {
31
+ "description": "The state id transitions refer to.",
32
+ "type": "string"
33
+ },
34
+ "entry": {
35
+ "$ref": "#/definitions/effects"
36
+ },
37
+ "exit": {
38
+ "$ref": "#/definitions/effects"
39
+ },
40
+ "final": {
41
+ "description": "Marks a terminal state; a session reports done here.",
42
+ "type": "boolean"
43
+ }
44
+ },
45
+ "required": [
46
+ "id"
47
+ ]
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ "transitions": {
53
+ "description": "The transition table. Document order IS the selection order: the first entry whose from-state, event (a null or absent event matches any name) and guard all match fires.",
54
+ "type": "array",
55
+ "items": {
56
+ "type": "object",
57
+ "properties": {
58
+ "from": {
59
+ "description": "The state this transition leaves.",
60
+ "type": "string"
61
+ },
62
+ "event": {
63
+ "description": "The event name this transition answers; null or absent matches any event (a wildcard). A transition never fires spontaneously.",
64
+ "type": [
65
+ "string",
66
+ "null"
67
+ ]
68
+ },
69
+ "guard": {
70
+ "description": "A Jaren JSON Query document asserted by effective boolean value against the evaluation scope { state, event, payload, context }; null or absent means no guard. A plain string not starting with '$' is a literal and therefore always true — projection-produced display guards are vacuous by design.",
71
+ "anyOf": [
72
+ {
73
+ "type": "null"
74
+ },
75
+ {
76
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1/draft-07"
77
+ }
78
+ ]
79
+ },
80
+ "to": {
81
+ "description": "The state this transition enters.",
82
+ "type": "string"
83
+ },
84
+ "effects": {
85
+ "$ref": "#/definitions/effects"
86
+ }
87
+ },
88
+ "required": [
89
+ "from",
90
+ "to"
91
+ ]
92
+ }
93
+ }
94
+ },
95
+ "required": [
96
+ "initial",
97
+ "states",
98
+ "transitions"
99
+ ],
100
+ "definitions": {
101
+ "effects": {
102
+ "description": "Effect descriptors, returned as resolved data when their state or transition fires — the engine never executes them.",
103
+ "type": "array",
104
+ "items": {
105
+ "type": "object",
106
+ "properties": {
107
+ "run": {
108
+ "description": "The host-registered handler name.",
109
+ "type": "string",
110
+ "minLength": 1
111
+ },
112
+ "with": {
113
+ "description": "Handler props: a Jaren JSON Query document evaluated against the scope at fire time; an empty result omits the member.",
114
+ "allOf": [
115
+ {
116
+ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1/draft-07"
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ "required": [
122
+ "run"
123
+ ]
124
+ }
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jarenjs.dev/schemas/jaren-fsm/0.1",
4
+ "title": "Jaren finite state machine 0.1",
5
+ "description": "Structural grammar of an executable jaren-fsm document (see packages/flow/docs/FLOW-FORMAT.md): declared states, an initial state and a document-ordered transition table whose guards and effect props are Jaren JSON Query documents — register the published query grammar alongside this artifact. The shape is a strict superset of the mermaid state-diagram projection ('jaren-workflow'): its version key is optional, a plain-string guard is a query document (a $-path expression; any other non-empty string is a literal and therefore always true), and null means no guard / any event. This schema is structural validation only: the compiler remains authoritative for semantic rules it cannot express — undeclared state references, duplicate ids and guard compilability are compile-time checks (JF0xxx), and unknown members are ignored for forward compatibility.",
6
+ "type": "object",
7
+ "properties": {
8
+ "$fsm": {
9
+ "description": "The fsm format version; absent implies 0.1.",
10
+ "const": "0.1"
11
+ },
12
+ "initial": {
13
+ "description": "The id of the machine's initial state, or null when the document does not choose one (a session must then be started with an explicit state).",
14
+ "type": ["string", "null"]
15
+ },
16
+ "states": {
17
+ "description": "Declared states, in document order. A string is shorthand for { id }.",
18
+ "type": "array",
19
+ "items": {
20
+ "anyOf": [
21
+ { "type": "string" },
22
+ {
23
+ "type": "object",
24
+ "properties": {
25
+ "id": {
26
+ "description": "The state id transitions refer to.",
27
+ "type": "string"
28
+ },
29
+ "entry": { "$ref": "#/$defs/effects" },
30
+ "exit": { "$ref": "#/$defs/effects" },
31
+ "final": {
32
+ "description": "Marks a terminal state; a session reports done here.",
33
+ "type": "boolean"
34
+ }
35
+ },
36
+ "required": ["id"]
37
+ }
38
+ ]
39
+ }
40
+ },
41
+ "transitions": {
42
+ "description": "The transition table. Document order IS the selection order: the first entry whose from-state, event (a null or absent event matches any name) and guard all match fires.",
43
+ "type": "array",
44
+ "items": {
45
+ "type": "object",
46
+ "properties": {
47
+ "from": {
48
+ "description": "The state this transition leaves.",
49
+ "type": "string"
50
+ },
51
+ "event": {
52
+ "description": "The event name this transition answers; null or absent matches any event (a wildcard). A transition never fires spontaneously.",
53
+ "type": ["string", "null"]
54
+ },
55
+ "guard": {
56
+ "description": "A Jaren JSON Query document asserted by effective boolean value against the evaluation scope { state, event, payload, context }; null or absent means no guard. A plain string not starting with '$' is a literal and therefore always true — projection-produced display guards are vacuous by design.",
57
+ "anyOf": [
58
+ { "type": "null" },
59
+ { "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1" }
60
+ ]
61
+ },
62
+ "to": {
63
+ "description": "The state this transition enters.",
64
+ "type": "string"
65
+ },
66
+ "effects": { "$ref": "#/$defs/effects" }
67
+ },
68
+ "required": ["from", "to"]
69
+ }
70
+ }
71
+ },
72
+ "required": ["initial", "states", "transitions"],
73
+ "$defs": {
74
+ "effects": {
75
+ "description": "Effect descriptors, returned as resolved data when their state or transition fires — the engine never executes them.",
76
+ "type": "array",
77
+ "items": {
78
+ "type": "object",
79
+ "properties": {
80
+ "run": {
81
+ "description": "The host-registered handler name.",
82
+ "type": "string",
83
+ "minLength": 1
84
+ },
85
+ "with": {
86
+ "description": "Handler props: a Jaren JSON Query document evaluated against the scope at fire time; an empty result omits the member.",
87
+ "allOf": [{ "$ref": "https://jarenjs.dev/schemas/jaren-query/0.1" }]
88
+ }
89
+ },
90
+ "required": ["run"]
91
+ }
92
+ }
93
+ }
94
+ }