@unstable-dev/unmeshed-mcp 0.1.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.
Files changed (47) hide show
  1. package/README.md +64 -0
  2. package/dist/auth.d.ts +6 -0
  3. package/dist/auth.js +11 -0
  4. package/dist/client.d.ts +46 -0
  5. package/dist/client.js +97 -0
  6. package/dist/config.d.ts +10 -0
  7. package/dist/config.js +31 -0
  8. package/dist/get-docs.d.ts +8 -0
  9. package/dist/get-docs.js +64 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.js +35 -0
  12. package/dist/server.d.ts +4 -0
  13. package/dist/server.js +203 -0
  14. package/knowledge/README.md +16 -0
  15. package/knowledge/SKILL.md +359 -0
  16. package/knowledge/assets/patterns.md +637 -0
  17. package/knowledge/execution/debugging-guide.md +18 -0
  18. package/knowledge/execution/process-run.schema.md +24 -0
  19. package/knowledge/execution/step-run.schema.md +21 -0
  20. package/knowledge/process-definition.schema.md +36 -0
  21. package/knowledge/references/integrations.md +914 -0
  22. package/knowledge/references/steps-knowledge.md +834 -0
  23. package/knowledge/step-definition.schema.md +140 -0
  24. package/knowledge/step-output-paths.md +45 -0
  25. package/knowledge/steps/DECISION_ENGINE.md +248 -0
  26. package/knowledge/steps/DEPENDSON.md +296 -0
  27. package/knowledge/steps/EXIT.md +220 -0
  28. package/knowledge/steps/FAIL.md +198 -0
  29. package/knowledge/steps/FLOW_GATEWAY.md +405 -0
  30. package/knowledge/steps/FOREACH.md +250 -0
  31. package/knowledge/steps/HTTP.md +183 -0
  32. package/knowledge/steps/JAVASCRIPT.md +192 -0
  33. package/knowledge/steps/JQ.md +189 -0
  34. package/knowledge/steps/LIST.md +279 -0
  35. package/knowledge/steps/NOOP.md +165 -0
  36. package/knowledge/steps/PARALLEL.md +366 -0
  37. package/knowledge/steps/PYTHON.md +206 -0
  38. package/knowledge/steps/SEND_RESPONSE.md +301 -0
  39. package/knowledge/steps/SQLITE.md +301 -0
  40. package/knowledge/steps/SUB_PROCESS.md +296 -0
  41. package/knowledge/steps/SWITCH.md +369 -0
  42. package/knowledge/steps/UPDATE_STEP.md +257 -0
  43. package/knowledge/steps/WAIT.md +218 -0
  44. package/knowledge/steps/WHILE.md +328 -0
  45. package/knowledge/steps/WORKER.md +233 -0
  46. package/knowledge/system-prompt.md +274 -0
  47. package/package.json +39 -0
@@ -0,0 +1,189 @@
1
+ # JQ Step Schema
2
+
3
+ `JQ` runs a [jq 1.6](https://jqlang.org/) expression against JSON input inside
4
+ Unmeshed. Use it to extract fields, filter arrays, reshape payloads, or perform
5
+ lightweight JSON transformations without writing JavaScript or Python.
6
+
7
+ The Unmeshed JQ engine is compatible with jq version `1.6`.
8
+
9
+ ## Definition Input Schema
10
+
11
+ ```json
12
+ {
13
+ "script": ".color",
14
+ "input": {
15
+ "name": "apple",
16
+ "color": "red",
17
+ "price": 10
18
+ }
19
+ }
20
+ ```
21
+
22
+ | Field | Type | Required | Description |
23
+ |---|---|---|---|
24
+ | `script` | string | Yes | jq expression to run against the provided input JSON. |
25
+ | `input` | object, array, string, number, boolean, or null | Yes | JSON value that becomes the jq input document. |
26
+
27
+ ## Runtime Output Schema
28
+
29
+ The jq result is stored in `output.result`.
30
+
31
+ ```json
32
+ {
33
+ "result": "red"
34
+ }
35
+ ```
36
+
37
+ Process-level output for a single-step JQ workflow can mirror the JQ step
38
+ output:
39
+
40
+ ```json
41
+ {
42
+ "result": "red"
43
+ }
44
+ ```
45
+
46
+ ## Output Access Paths
47
+
48
+ Use:
49
+ - `steps.<ref>.output.result` for the entire jq result.
50
+ - `steps.<ref>.output.result.<field>` when the jq result is an object.
51
+ - `steps.<ref>.output.result[0]` when the jq result is an array.
52
+
53
+ Do not use:
54
+ - `steps.<ref>.output.response`
55
+ - `steps.<ref>.output.results`
56
+ - `steps.<ref>.output.<field>` directly unless the jq result itself is wrapped by another step later
57
+
58
+ ## Generation Rules
59
+
60
+ - Use uppercase step type: `"JQ"`.
61
+ - Put the jq expression in `input.script`.
62
+ - Put the JSON document to transform in `input.input`.
63
+ - Keep jq scripts deterministic and focused on JSON transformation.
64
+ - Use template references in `input.input` when reading another step's runtime output, for example `{{ steps.fetch_posts_1.output.response }}`.
65
+ - When using native `HTTP` output as JQ input, reference `output.response`, not `output.result`.
66
+ - Prefer JQ for simple extraction and reshaping; switch to `JAVASCRIPT` only when the logic becomes hard to express in jq.
67
+ - Do not hardcode secrets or credentials inside the jq input.
68
+
69
+ ## Debugging Rules
70
+
71
+ When a JQ step fails or returns an unexpected result:
72
+ - Inspect the exact `input.script` expression.
73
+ - Inspect the concrete JSON under `input.input`.
74
+ - Verify that upstream template references point to the correct producer output path.
75
+ - If the result is empty or null, check whether the jq expression selected a missing path.
76
+ - If the result type is wrong, check whether the jq script emits a scalar, array, or object.
77
+
78
+ Common failures:
79
+ - Reading native `HTTP` output from `steps.<http_ref>.output.result` instead of `output.response`.
80
+ - Passing a string that looks like JSON instead of an actual JSON object or array.
81
+ - Expecting `output.result.<field>` when the jq result is a scalar like a string or number.
82
+ - Using jq syntax that is incompatible with jq `1.6`.
83
+ - Forgetting to wrap a template reference inside the `input.input` object where the jq script expects it.
84
+
85
+ ## Minimal Process Definition Example
86
+
87
+ ```json
88
+ {
89
+ "orgId": 1,
90
+ "namespace": "default",
91
+ "name": "jq_test",
92
+ "version": 1,
93
+ "type": "API_ORCHESTRATION",
94
+ "description": "Return a color from a JSON object using jq.",
95
+ "configuration": null,
96
+ "steps": [
97
+ {
98
+ "orgId": 1,
99
+ "namespace": "default",
100
+ "name": "jq",
101
+ "type": "JQ",
102
+ "ref": "jq_1",
103
+ "optional": false,
104
+ "createdBy": "system",
105
+ "updatedBy": "system",
106
+ "description": "jq step",
107
+ "label": null,
108
+ "created": 1700000000000,
109
+ "updated": 1700000000000,
110
+ "configuration": {
111
+ "errorPolicyName": null,
112
+ "useCache": false,
113
+ "cacheKey": null,
114
+ "cacheTimeoutSeconds": 0,
115
+ "stream": false,
116
+ "streamAllStatuses": false,
117
+ "preExecutionScript": null,
118
+ "constructInputFromScript": false,
119
+ "scriptLanguage": null,
120
+ "jqTransformer": null,
121
+ "rateLimitMaxRequests": 0,
122
+ "rateLimitWindowSeconds": 0
123
+ },
124
+ "children": [],
125
+ "input": {
126
+ "script": ".color",
127
+ "input": {
128
+ "name": "apple",
129
+ "color": "red",
130
+ "price": 10
131
+ }
132
+ },
133
+ "output": null
134
+ }
135
+ ],
136
+ "defaultInput": null,
137
+ "defaultOutput": null,
138
+ "outputMapping": null,
139
+ "signature": null,
140
+ "metadata": null,
141
+ "tags": null,
142
+ "dependencies": null,
143
+ "dependents": null
144
+ }
145
+ ```
146
+
147
+ ## Minimal Executed Step Example
148
+
149
+ ```json
150
+ {
151
+ "id": 30050003,
152
+ "processId": 30050001,
153
+ "ref": "jq_1",
154
+ "namespace": "default",
155
+ "name": "jq",
156
+ "type": "JQ",
157
+ "status": "COMPLETED",
158
+ "input": {
159
+ "input": {
160
+ "color": "red",
161
+ "price": 10,
162
+ "name": "apple"
163
+ },
164
+ "script": ".color",
165
+ "__currentExecutionStartTime": 1778615106162
166
+ },
167
+ "output": {
168
+ "result": "red"
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## Example: Extract Values From a Native HTTP Response
174
+
175
+ If a native `HTTP` step with ref `fetch_posts_1` returns a JSON array response,
176
+ use that response as the JQ input:
177
+
178
+ ```json
179
+ {
180
+ "script": "map(.author.nationality)",
181
+ "input": "{{ steps.fetch_posts_1.output.response }}"
182
+ }
183
+ ```
184
+
185
+ If you only want items published after 2019, use jq filtering:
186
+
187
+ ```jq
188
+ .bestsellers[] | select(.published_year > 2019) | .author.nationality
189
+ ```
@@ -0,0 +1,279 @@
1
+ # List Step Schema
2
+
3
+ `LIST` is a container step that runs its child steps sequentially. Use it when a
4
+ workflow branch needs to execute a series of steps in order.
5
+
6
+ The primary use case is inside another container, such as a `SWITCH`,
7
+ `PARALLEL`, `FOREACH`, or `WHILE`, where each branch/body needs multiple steps.
8
+ It can also appear as a top-level step when a process definition needs a simple
9
+ sequential container.
10
+
11
+ ## Definition Input Schema
12
+
13
+ LIST usually has no meaningful input:
14
+
15
+ ```json
16
+ {}
17
+ ```
18
+
19
+ The important definition field is `children`, which contains the ordered steps
20
+ to run.
21
+
22
+ ```json
23
+ {
24
+ "type": "LIST",
25
+ "ref": "list_1",
26
+ "children": [
27
+ {
28
+ "type": "HTTP",
29
+ "ref": "http_1"
30
+ }
31
+ ],
32
+ "input": {}
33
+ }
34
+ ```
35
+
36
+ ## Runtime Output Schema
37
+
38
+ The LIST container's own step output is usually an empty object:
39
+
40
+ ```json
41
+ {}
42
+ ```
43
+
44
+ Child steps produce their own outputs under their own refs. For example, an
45
+ HTTP child inside a LIST still exposes:
46
+
47
+ ```json
48
+ {
49
+ "response": {
50
+ "randomId": "690a837c-f44f-4bf6-a624-a90bf564024d",
51
+ "counter": 1
52
+ },
53
+ "statusCode": 200
54
+ }
55
+ ```
56
+
57
+ In process run records, child steps are linked back to the LIST by `parentId`
58
+ and `parentRef`.
59
+
60
+ ```json
61
+ {
62
+ "ref": "http_1",
63
+ "parentRef": "list_1",
64
+ "type": "HTTP",
65
+ "status": "COMPLETED"
66
+ }
67
+ ```
68
+
69
+ ## Output Access Paths
70
+
71
+ Use:
72
+ - `steps.<child_ref>.output...` to access a child step's output directly.
73
+ - `steps.<http_child_ref>.output.response` for a native HTTP child response body.
74
+ - `steps.<javascript_child_ref>.output.result` for a JavaScript child result.
75
+ - `steps.<python_child_ref>.output.result` for a Python child result.
76
+ - `stepRecords[].parentRef` when debugging executed process data.
77
+
78
+ Do not use:
79
+ - `steps.<list_ref>.output.result`
80
+ - `steps.<list_ref>.output.response`
81
+ - `steps.<list_ref>.children.<child_ref>.output`
82
+ - `steps.<list_ref>.output.<child_ref>`
83
+
84
+ ## Generation Rules
85
+
86
+ - Use uppercase step type: `"LIST"`.
87
+ - Put ordered child steps in `children`.
88
+ - Use `input: {}` for the LIST container unless a backend-specific field is documented.
89
+ - LIST children must be complete step definitions with the same required fields as top-level steps.
90
+ - Child `ref` values must be unique across the whole workflow, not only inside the LIST.
91
+ - Use LIST as a branch body when a `SWITCH`, `PARALLEL`, `FOREACH`, or `WHILE` branch needs multiple steps.
92
+ - Do not invent a special LIST result wrapper for child outputs.
93
+ - Later steps should reference child outputs by child refs directly.
94
+
95
+ ## Debugging Rules
96
+
97
+ When debugging a LIST:
98
+ - Check the LIST step record status first.
99
+ - Inspect child step records whose `parentRef` equals the LIST ref.
100
+ - Find the first failed child step if the LIST or process failed.
101
+ - Do not stop at the LIST step's own `output: {}`; inspect child outputs.
102
+ - If process-level output mirrors a child output, explain which child produced it.
103
+ - Use child step type rules to interpret child outputs.
104
+
105
+ Common failures:
106
+ - Assistant tries to read child output from `steps.<list_ref>.output.result`.
107
+ - A child step fails but the explanation only mentions the LIST container.
108
+ - Duplicate child refs collide with refs elsewhere in the workflow.
109
+ - Branch containers use a single child step directly when a LIST branch is expected.
110
+ - Later steps reference LIST output instead of the child step output.
111
+
112
+ ## Minimal Process Definition Example
113
+
114
+ ```json
115
+ {
116
+ "orgId": 1,
117
+ "namespace": "default",
118
+ "name": "kebab-case-name",
119
+ "version": 1,
120
+ "type": "API_ORCHESTRATION",
121
+ "description": "Run an HTTP step inside a LIST container.",
122
+ "configuration": null,
123
+ "steps": [
124
+ {
125
+ "orgId": 1,
126
+ "namespace": "default",
127
+ "name": "list",
128
+ "type": "LIST",
129
+ "ref": "list_1",
130
+ "optional": false,
131
+ "createdBy": "system",
132
+ "updatedBy": "system",
133
+ "description": null,
134
+ "label": null,
135
+ "created": 1700000000000,
136
+ "updated": 1700000000000,
137
+ "configuration": {
138
+ "errorPolicyName": null,
139
+ "useCache": false,
140
+ "cacheKey": null,
141
+ "cacheTimeoutSeconds": 0,
142
+ "stream": false,
143
+ "streamAllStatuses": false,
144
+ "preExecutionScript": null,
145
+ "constructInputFromScript": false,
146
+ "scriptLanguage": null,
147
+ "jqTransformer": null,
148
+ "rateLimitMaxRequests": 0,
149
+ "rateLimitWindowSeconds": 0
150
+ },
151
+ "children": [
152
+ {
153
+ "orgId": 1,
154
+ "namespace": "default",
155
+ "name": "http",
156
+ "type": "HTTP",
157
+ "ref": "http_1",
158
+ "optional": false,
159
+ "createdBy": "system",
160
+ "updatedBy": "system",
161
+ "description": null,
162
+ "label": null,
163
+ "created": 1700000000000,
164
+ "updated": 1700000000000,
165
+ "configuration": {
166
+ "errorPolicyName": null,
167
+ "useCache": false,
168
+ "cacheKey": null,
169
+ "cacheTimeoutSeconds": 0,
170
+ "stream": false,
171
+ "streamAllStatuses": false,
172
+ "preExecutionScript": null,
173
+ "constructInputFromScript": false,
174
+ "scriptLanguage": null,
175
+ "jqTransformer": null,
176
+ "rateLimitMaxRequests": 0,
177
+ "rateLimitWindowSeconds": 0
178
+ },
179
+ "children": [],
180
+ "input": {
181
+ "method": "GET",
182
+ "url": "http://localhost:8080/api/test/get",
183
+ "headers": {
184
+ "Content-Type": "application/json",
185
+ "Accept": "application/json",
186
+ "Authorization": "Bearer {{secrets.test_token}}"
187
+ },
188
+ "params": {
189
+ "sampleKey": "sampleValue"
190
+ },
191
+ "repeatUntilEnabled": null,
192
+ "repeatUntilCondition": {
193
+ "script": "(steps, context) => {\n return steps.__self.output.response.counter === 100;\n}"
194
+ },
195
+ "repeatIntervalSeconds": null,
196
+ "maxRepeatCount": null,
197
+ "includeFullResponseString": false,
198
+ "noEncode": false,
199
+ "extraLongTimeouts": false
200
+ },
201
+ "output": null
202
+ }
203
+ ],
204
+ "input": {},
205
+ "output": null
206
+ }
207
+ ],
208
+ "defaultInput": null,
209
+ "defaultOutput": null,
210
+ "outputMapping": null,
211
+ "signature": null,
212
+ "metadata": null,
213
+ "tags": null,
214
+ "dependencies": null,
215
+ "dependents": null
216
+ }
217
+ ```
218
+
219
+ ## Minimal Executed Step Records Example
220
+
221
+ LIST container step record:
222
+
223
+ ```json
224
+ {
225
+ "id": 28800012,
226
+ "processId": 28800010,
227
+ "ref": "list_1",
228
+ "parentId": null,
229
+ "parentRef": null,
230
+ "namespace": "default",
231
+ "name": "list",
232
+ "type": "LIST",
233
+ "status": "COMPLETED",
234
+ "input": {
235
+ "__currentExecutionStartTime": 1778183092448
236
+ },
237
+ "output": {},
238
+ "optional": false
239
+ }
240
+ ```
241
+
242
+ HTTP child step record:
243
+
244
+ ```json
245
+ {
246
+ "id": 28800013,
247
+ "processId": 28800010,
248
+ "ref": "http_1",
249
+ "parentId": 28800012,
250
+ "parentRef": "list_1",
251
+ "namespace": "default",
252
+ "name": "http",
253
+ "type": "HTTP",
254
+ "status": "COMPLETED",
255
+ "output": {
256
+ "response": {
257
+ "counter": 1,
258
+ "randomId": "690a837c-f44f-4bf6-a624-a90bf564024d"
259
+ },
260
+ "statusCode": 200
261
+ },
262
+ "optional": false
263
+ }
264
+ ```
265
+
266
+ ## Example: Read Output From A LIST Child
267
+
268
+ Use the child ref directly:
269
+
270
+ ```javascript
271
+ (steps, context) => {
272
+ const response = steps.http_1.output.response || {};
273
+ return {
274
+ counter: response.counter,
275
+ randomId: response.randomId
276
+ };
277
+ }
278
+ ```
279
+
@@ -0,0 +1,165 @@
1
+ # Noop Step Schema
2
+
3
+ `NOOP` means no-operation. Use it as a placeholder, static data carrier, or
4
+ simple pass-through step. A NOOP step copies its runtime input directly onto its
5
+ output.
6
+
7
+ If a NOOP is the last step in a process, the NOOP input/output can determine the
8
+ process output.
9
+
10
+ ## Definition Input Schema
11
+
12
+ NOOP input can be any JSON object.
13
+
14
+ ```json
15
+ {
16
+ "abc": "def",
17
+ "myArray": ["a", "n"]
18
+ }
19
+ ```
20
+
21
+ ## Runtime Output Schema
22
+
23
+ NOOP output is the input copied directly, plus runtime-injected fields such as
24
+ `__currentExecutionStartTime`.
25
+
26
+ ```json
27
+ {
28
+ "abc": "def",
29
+ "myArray": ["a", "n"],
30
+ "__currentExecutionStartTime": 1778186395606
31
+ }
32
+ ```
33
+
34
+ NOOP output is not wrapped in `result`.
35
+
36
+ ## Output Access Paths
37
+
38
+ Use:
39
+ - `steps.<ref>.output.<field>` for fields from the NOOP input.
40
+ - `steps.<ref>.output.abc`
41
+ - `steps.<ref>.output.myArray`
42
+ - `steps.<ref>.output.__currentExecutionStartTime` when debugging runtime timing.
43
+
44
+ Do not use:
45
+ - `steps.<ref>.output.result`
46
+ - `steps.<ref>.output.response`
47
+ - `steps.<ref>.output.results`
48
+
49
+ ## Generation Rules
50
+
51
+ - Use uppercase step type: `"NOOP"`.
52
+ - Use `children: []`; NOOP is not a container.
53
+ - Put static/pass-through fields directly in `input`.
54
+ - Use NOOP for constants, placeholders, test output, simple static config, or branch outputs.
55
+ - Use NOOP as the final step when the workflow should return a static or assembled object.
56
+ - Do not use NOOP for computation; use `JAVASCRIPT` or `PYTHON` for logic.
57
+ - Do not invent `script`, `result`, or HTTP-style response fields for NOOP.
58
+
59
+ ## Debugging Rules
60
+
61
+ When debugging a NOOP:
62
+ - Compare step `input` and `output`; output should copy input fields.
63
+ - Remember runtime may inject fields such as `__currentExecutionStartTime`.
64
+ - If the process output equals the NOOP output, check whether NOOP was the final step.
65
+ - If later steps cannot read a NOOP field, verify they are not looking under `output.result`.
66
+
67
+ Common failures:
68
+ - Looking for NOOP data at `steps.<ref>.output.result.<field>`.
69
+ - Expecting NOOP to transform data.
70
+ - Forgetting that a final NOOP can define process output.
71
+ - Adding script fields to NOOP instead of using a script step.
72
+
73
+ ## Minimal Process Definition Example
74
+
75
+ ```json
76
+ {
77
+ "orgId": 1,
78
+ "namespace": "default",
79
+ "name": "kebab-case-name",
80
+ "version": 1,
81
+ "type": "API_ORCHESTRATION",
82
+ "description": "Return static data from a NOOP step.",
83
+ "configuration": null,
84
+ "steps": [
85
+ {
86
+ "orgId": 1,
87
+ "namespace": "default",
88
+ "name": "noop",
89
+ "type": "NOOP",
90
+ "ref": "noop_1",
91
+ "optional": false,
92
+ "createdBy": "system",
93
+ "updatedBy": "system",
94
+ "description": null,
95
+ "label": null,
96
+ "created": 1700000000000,
97
+ "updated": 1700000000000,
98
+ "configuration": {
99
+ "errorPolicyName": null,
100
+ "useCache": false,
101
+ "cacheKey": null,
102
+ "cacheTimeoutSeconds": 0,
103
+ "stream": false,
104
+ "streamAllStatuses": false,
105
+ "preExecutionScript": null,
106
+ "constructInputFromScript": false,
107
+ "scriptLanguage": null,
108
+ "jqTransformer": null,
109
+ "rateLimitMaxRequests": 0,
110
+ "rateLimitWindowSeconds": 0
111
+ },
112
+ "children": [],
113
+ "input": {
114
+ "abc": "def",
115
+ "myArray": ["a", "n"]
116
+ },
117
+ "output": null
118
+ }
119
+ ],
120
+ "defaultInput": null,
121
+ "defaultOutput": null,
122
+ "outputMapping": null,
123
+ "signature": null,
124
+ "metadata": null,
125
+ "tags": null,
126
+ "dependencies": null,
127
+ "dependents": null
128
+ }
129
+ ```
130
+
131
+ ## Minimal Executed Step Example
132
+
133
+ ```json
134
+ {
135
+ "id": 28800067,
136
+ "processId": 28800065,
137
+ "ref": "noop_1",
138
+ "namespace": "default",
139
+ "name": "noop",
140
+ "type": "NOOP",
141
+ "status": "COMPLETED",
142
+ "input": {
143
+ "myArray": ["a", "n"],
144
+ "abc": "def",
145
+ "__currentExecutionStartTime": 1778186395606
146
+ },
147
+ "output": {
148
+ "abc": "def",
149
+ "myArray": ["a", "n"],
150
+ "__currentExecutionStartTime": 1778186395606
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## Example: Reading NOOP Output
156
+
157
+ ```javascript
158
+ (steps, context) => {
159
+ return {
160
+ value: steps.noop_1.output.abc,
161
+ items: steps.noop_1.output.myArray
162
+ };
163
+ }
164
+ ```
165
+