@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,296 @@
1
+ # DEPENDSON Step Schema
2
+
3
+ `DEPENDSON` pauses the current workflow branch until an external condition is met —
4
+ either a specific **process** has reached a target status, or a specific **step**
5
+ within a process has reached a target status. The engine polls at a configurable
6
+ interval until the dependency is satisfied or the step is cancelled.
7
+
8
+ Use it for cross-workflow synchronisation, fan-out/fan-in patterns, or waiting for
9
+ a sibling parallel branch's step to complete before proceeding.
10
+
11
+ ## Definition Input Schema
12
+
13
+ ```json
14
+ {
15
+ "dependsOnStatement": "STEP('process-def-name', 'step-ref', 'COMPLETED')",
16
+ "intervalSeconds": 10
17
+ }
18
+ ```
19
+
20
+ | Field | Type | Required | Description |
21
+ |---|---|---|---|
22
+ | `dependsOnStatement` | string | Yes | An SQL-style expression describing the dependency condition. See syntax below. |
23
+ | `intervalSeconds` | integer | Yes | How often (in seconds) the engine re-evaluates the condition. |
24
+
25
+ ## Dependency Statement Syntax
26
+
27
+ Two functions are available, and they can be combined with `AND` / `OR` operators.
28
+
29
+ ### PROCESS function
30
+
31
+ Wait for an entire process (by definition name) to reach a status.
32
+
33
+ ```
34
+ PROCESS('process-def-name', 'STATUS')
35
+ ```
36
+
37
+ ### STEP function
38
+
39
+ Wait for a specific step (by ref) inside a process (by definition name) to reach a status.
40
+
41
+ ```
42
+ STEP('process-def-name', 'step-ref-name', 'STATUS')
43
+ ```
44
+
45
+ ### Combining conditions
46
+
47
+ Use `AND`, `OR`, and parentheses to build compound expressions.
48
+
49
+ ```
50
+ (PROCESS('process-def-name', 'COMPLETED')
51
+ OR
52
+ PROCESS('process-def-name', 'TERMINATED')
53
+ OR
54
+ PROCESS('process-def-name', 'FAILED'))
55
+ AND
56
+ STEP('process-def-name', 'step-ref-name', 'COMPLETED')
57
+ ```
58
+
59
+ ### Common statuses
60
+
61
+ `COMPLETED`, `FAILED`, `TERMINATED`, `CANCELLED`
62
+
63
+ ## Runtime Output Schema
64
+
65
+ ```json
66
+ {
67
+ "__repeatConditionMatched": true,
68
+ "__dependsOnOutput": {
69
+ "result": true,
70
+ "evaluation": "step in process 7_dependson_parallel_test and ref new_http_1 should be COMPLETED, result COMPLETED",
71
+ "evaluatedDependencies": [
72
+ {
73
+ "conditionMet": true,
74
+ "condition": "STEP('7_dependson_parallel_test','new_http_1','COMPLETED')",
75
+ "actualStatus": "COMPLETED",
76
+ "processName": "7_dependson_parallel_test",
77
+ "stepRef": "new_http_1",
78
+ "matchedExecutionId": 593081549,
79
+ "matchedExecutionProcessId": 593080545,
80
+ "matchedExecutionProcessVersion": 1,
81
+ "expectedStatus": "COMPLETED",
82
+ "type": "STEP",
83
+ "matchedExecutionProcessName": "7_dependson_parallel_test"
84
+ }
85
+ ]
86
+ },
87
+ "__dependsOnMetadata": {
88
+ "evaluatedDependencies": [...]
89
+ }
90
+ }
91
+ ```
92
+
93
+ When the condition is **not met** (e.g. the target process/step doesn't exist yet or hasn't reached the expected status):
94
+
95
+ ```json
96
+ {
97
+ "__repeatConditionMatched": false,
98
+ "__repeatCount": 1,
99
+ "__updatedKeySchedule": 1778222111362,
100
+ "__dependsOnOutput": {
101
+ "result": false,
102
+ "evaluation": "Unexpected error, will retry: Unable to find the record 1 automated_tests name",
103
+ "evaluatedDependencies": []
104
+ }
105
+ }
106
+ ```
107
+
108
+ ## Output Access Paths
109
+
110
+ Use:
111
+ - `steps.<ref>.output.__repeatConditionMatched` — `true` if the dependency was satisfied, `false` if cancelled/timed-out before match.
112
+ - `steps.<ref>.output.__dependsOnOutput.result` — `true` / `false` boolean result.
113
+ - `steps.<ref>.output.__dependsOnOutput.evaluation` — human-readable description of what was checked.
114
+ - `steps.<ref>.output.__dependsOnOutput.evaluatedDependencies` — array of per-condition details.
115
+ - `steps.<ref>.output.__dependsOnOutput.evaluatedDependencies[0].conditionMet` — whether that specific condition matched.
116
+ - `steps.<ref>.output.__dependsOnOutput.evaluatedDependencies[0].actualStatus` — the actual status found.
117
+
118
+ Do not use:
119
+ - `steps.<ref>.output.result` — the result is nested inside `__dependsOnOutput`.
120
+ - `steps.<ref>.output.response` — DEPENDSON does not have a `response` wrapper.
121
+
122
+ ## Generation Rules
123
+
124
+ - Use uppercase step type: `"DEPENDSON"`.
125
+ - Use `children: []`; DEPENDSON is not a container.
126
+ - `dependsOnStatement` must use the exact syntax: `STEP('name', 'ref', 'STATUS')` or `PROCESS('name', 'STATUS')`.
127
+ - String values inside the statement use **single quotes**.
128
+ - Combine multiple conditions with `AND` / `OR` and parentheses for grouping.
129
+ - `intervalSeconds` controls polling frequency — lower values mean faster detection but higher load.
130
+ - DEPENDSON is commonly used inside a PARALLEL branch to wait for a sibling branch's step to finish.
131
+ - The process name in the statement refers to the **process definition name** (not a runtime process ID).
132
+ - The step ref in the statement refers to the step's `ref` field in the process definition.
133
+ - DEPENDSON can reference steps/processes in the **same** workflow (cross-branch sync) or in **other** workflows.
134
+
135
+ ## Debugging Rules
136
+
137
+ When debugging a DEPENDSON step:
138
+ - Check `__repeatConditionMatched` — if `false`, the dependency was never satisfied before the step was cancelled or the workflow ended.
139
+ - Inspect `__dependsOnOutput.evaluation` for a human-readable explanation.
140
+ - Look at `evaluatedDependencies` to see each condition individually — check `conditionMet`, `actualStatus`, and `expectedStatus`.
141
+ - If `evaluation` says "Unable to find the record", the referenced process name or step ref does not exist or hasn't run yet.
142
+ - Check `__repeatCount` to see how many polling attempts were made.
143
+
144
+ Common failures:
145
+ - Wrong process definition name in the statement (case-sensitive, must match exactly).
146
+ - Wrong step ref in the statement.
147
+ - Expecting `output.result` instead of `output.__dependsOnOutput.result`.
148
+ - DEPENDSON waiting forever because the referenced step/process never reaches the expected status — always pair with a timeout strategy (e.g. `optional: true` on the parent PARALLEL, or a FAIL step in a sibling branch).
149
+ - Using double quotes inside the statement instead of single quotes.
150
+
151
+ ## Minimal Process Definition Example
152
+
153
+ ```json
154
+ {
155
+ "orgId": 1,
156
+ "namespace": "default",
157
+ "name": "dependson-example",
158
+ "version": 1,
159
+ "type": "API_ORCHESTRATION",
160
+ "description": "Wait for a step in another process to complete.",
161
+ "configuration": null,
162
+ "steps": [
163
+ {
164
+ "orgId": 1,
165
+ "namespace": "default",
166
+ "name": "new_dependson",
167
+ "type": "DEPENDSON",
168
+ "ref": "dependson_1",
169
+ "optional": false,
170
+ "createdBy": "system",
171
+ "updatedBy": "system",
172
+ "description": null,
173
+ "label": null,
174
+ "created": 1700000000000,
175
+ "updated": 1700000000000,
176
+ "configuration": {
177
+ "errorPolicyName": null,
178
+ "useCache": false,
179
+ "cacheKey": null,
180
+ "cacheTimeoutSeconds": 0,
181
+ "stream": false,
182
+ "streamAllStatuses": false,
183
+ "preExecutionScript": null,
184
+ "constructInputFromScript": false,
185
+ "scriptLanguage": null,
186
+ "jqTransformer": null,
187
+ "rateLimitMaxRequests": 0,
188
+ "rateLimitWindowSeconds": 0
189
+ },
190
+ "children": [],
191
+ "input": {
192
+ "dependsOnStatement": "STEP('my-workflow', 'http_step_1', 'COMPLETED')",
193
+ "intervalSeconds": 10
194
+ },
195
+ "output": null
196
+ }
197
+ ],
198
+ "defaultInput": null,
199
+ "defaultOutput": null,
200
+ "outputMapping": null,
201
+ "signature": null,
202
+ "metadata": null,
203
+ "tags": null,
204
+ "dependencies": null,
205
+ "dependents": null
206
+ }
207
+ ```
208
+
209
+ ## Minimal Executed Step Example
210
+
211
+ ```json
212
+ {
213
+ "id": 593085064,
214
+ "processId": 593084539,
215
+ "ref": "new_dependson_2",
216
+ "namespace": "automated_tests",
217
+ "name": "new_dependson",
218
+ "type": "DEPENDSON",
219
+ "status": "COMPLETED",
220
+ "input": {
221
+ "__currentExecutionStartTime": 1778222100956,
222
+ "dependsOnStatement": "STEP('7_dependson_parallel_test', 'new_http_1', 'COMPLETED')",
223
+ "intervalSeconds": 10
224
+ },
225
+ "output": {
226
+ "__repeatConditionMatched": true,
227
+ "__dependsOnOutput": {
228
+ "result": true,
229
+ "evaluation": "step in process 7_dependson_parallel_test and ref new_http_1 should be COMPLETED, result COMPLETED",
230
+ "evaluatedDependencies": [
231
+ {
232
+ "conditionMet": true,
233
+ "condition": "STEP('7_dependson_parallel_test','new_http_1','COMPLETED')",
234
+ "actualStatus": "COMPLETED",
235
+ "processName": "7_dependson_parallel_test",
236
+ "stepRef": "new_http_1",
237
+ "expectedStatus": "COMPLETED",
238
+ "type": "STEP"
239
+ }
240
+ ]
241
+ }
242
+ }
243
+ }
244
+ ```
245
+
246
+ ## Example: Checking DEPENDSON Result in a Later Step
247
+
248
+ ```javascript
249
+ (steps, context) => {
250
+ // Check if the dependency was satisfied
251
+ if (steps.dependson_1.output.__dependsOnOutput.result === false) {
252
+ throw Error("Dependency was not satisfied");
253
+ }
254
+
255
+ // Check if condition was matched before cancellation
256
+ if (steps.dependson_1.output.__repeatConditionMatched !== true) {
257
+ throw Error("DEPENDSON was cancelled before matching");
258
+ }
259
+
260
+ return {
261
+ dependencyMet: true,
262
+ actualStatus: steps.dependson_1.output.__dependsOnOutput.evaluatedDependencies[0].actualStatus
263
+ };
264
+ }
265
+ ```
266
+
267
+ ## Common Pattern: Cross-Branch Synchronisation in PARALLEL
268
+
269
+ Use DEPENDSON inside one PARALLEL branch to wait for a step in a sibling branch:
270
+
271
+ ```
272
+ PARALLEL
273
+ ├── LIST (branch A)
274
+ │ ├── WAIT (1s delay)
275
+ │ └── HTTP (new_http_1) ← this step must complete first
276
+ └── LIST (branch B)
277
+ ├── WAIT (0.5s delay)
278
+ └── DEPENDSON ← waits for new_http_1 in the same workflow
279
+ input.dependsOnStatement: "STEP('my-workflow', 'new_http_1', 'COMPLETED')"
280
+ ```
281
+
282
+ ## Statement Syntax Reference
283
+
284
+ ```
285
+ # Wait for a process to complete
286
+ PROCESS('order-processor', 'COMPLETED')
287
+
288
+ # Wait for a step in a process to complete
289
+ STEP('order-processor', 'validate_order', 'COMPLETED')
290
+
291
+ # Wait for a process to reach any terminal state
292
+ PROCESS('order-processor', 'COMPLETED') OR PROCESS('order-processor', 'FAILED')
293
+
294
+ # Compound: process done AND a specific step done
295
+ PROCESS('order-processor', 'COMPLETED') AND STEP('order-processor', 'notify_step', 'COMPLETED')
296
+ ```
@@ -0,0 +1,220 @@
1
+ # Exit Step Schema
2
+
3
+ `EXIT` stops the current process intentionally with a chosen process status and
4
+ message. Use it in branching workflows when a path should terminate the process
5
+ cleanly, for example after validation, approval/denial, or a business rule that
6
+ means no further steps should run.
7
+
8
+ Use `FAIL` for hard failure scenarios where the process should fail directly.
9
+ Use `EXIT` when the workflow author wants to choose the final status.
10
+
11
+ ## Definition Input Schema
12
+
13
+ ```json
14
+ {
15
+ "message": "Exit message",
16
+ "status": "COMPLETED"
17
+ }
18
+ ```
19
+
20
+ Optional/observed:
21
+ - `message`: textual explanation of why the process exited.
22
+ - `status`: process status to exit with, for example `COMPLETED` or `FAILED`.
23
+
24
+ ## Runtime Output Schema
25
+
26
+ The EXIT output mirrors the exit reason/status in runtime-specific fields.
27
+
28
+ ```json
29
+ {
30
+ "__exitReason": "Exit message",
31
+ "__exitStatus": "COMPLETED",
32
+ "message": "Exit message"
33
+ }
34
+ ```
35
+
36
+ The process status is configured from the EXIT input `status`.
37
+
38
+ ## Output Access Paths
39
+
40
+ Use:
41
+ - `steps.<ref>.output.__exitStatus` for the status used to exit.
42
+ - `steps.<ref>.output.__exitReason` for the exit reason.
43
+ - `steps.<ref>.output.message` for the user-facing message.
44
+
45
+ Do not use:
46
+ - `steps.<ref>.output.result`
47
+ - `steps.<ref>.output.response`
48
+ - `steps.<ref>.output.status`
49
+
50
+ ## Generation Rules
51
+
52
+ - Use uppercase step type: `"EXIT"`.
53
+ - Use `children: []`; EXIT is not a container.
54
+ - Put `message` and `status` in `input`.
55
+ - Choose `status` deliberately based on the business outcome.
56
+ - Use `COMPLETED` when the workflow is intentionally ending successfully.
57
+ - Use `FAILED` when the workflow should intentionally end as failed.
58
+ - In complex branches, place EXIT inside the branch that should stop the process.
59
+ - Do not place important later sibling steps after an EXIT if they must run.
60
+ - Use dynamic templating in `message` only when needed and supported by the surrounding context.
61
+
62
+ ## Debugging Rules
63
+
64
+ When debugging an EXIT:
65
+ - Inspect the EXIT step record's `input.status`.
66
+ - Inspect `output.__exitStatus` and process-level `status`.
67
+ - Inspect `output.__exitReason` and `output.message`.
68
+ - If later steps did not run, check whether EXIT intentionally stopped the process.
69
+ - If the process completed unexpectedly, check whether EXIT used `status: "COMPLETED"`.
70
+ - If the process failed intentionally, check whether EXIT used `status: "FAILED"`.
71
+
72
+ Common failures:
73
+ - Using EXIT where FAIL is more appropriate for an unrecoverable technical error.
74
+ - Setting `status: "COMPLETED"` in a failure branch.
75
+ - Expecting steps after EXIT to continue.
76
+ - Looking for `output.result` instead of `__exitStatus`/`__exitReason`.
77
+ - Forgetting to include a clear message for end users.
78
+
79
+ ## Minimal Process Definition Example
80
+
81
+ ```json
82
+ {
83
+ "orgId": 1,
84
+ "namespace": "default",
85
+ "name": "kebab-case-name",
86
+ "version": 1,
87
+ "type": "API_ORCHESTRATION",
88
+ "description": "Call HTTP and then exit intentionally.",
89
+ "configuration": null,
90
+ "steps": [
91
+ {
92
+ "orgId": 1,
93
+ "namespace": "default",
94
+ "name": "http",
95
+ "type": "HTTP",
96
+ "ref": "http_1",
97
+ "optional": false,
98
+ "createdBy": "system",
99
+ "updatedBy": "system",
100
+ "description": null,
101
+ "label": null,
102
+ "created": 1700000000000,
103
+ "updated": 1700000000000,
104
+ "configuration": {
105
+ "errorPolicyName": null,
106
+ "useCache": false,
107
+ "cacheKey": null,
108
+ "cacheTimeoutSeconds": 0,
109
+ "stream": false,
110
+ "streamAllStatuses": false,
111
+ "preExecutionScript": null,
112
+ "constructInputFromScript": false,
113
+ "scriptLanguage": null,
114
+ "jqTransformer": null,
115
+ "rateLimitMaxRequests": 0,
116
+ "rateLimitWindowSeconds": 0
117
+ },
118
+ "children": [],
119
+ "input": {
120
+ "method": "GET",
121
+ "url": "http://localhost:8080/api/test/get",
122
+ "headers": {
123
+ "Content-Type": "application/json",
124
+ "Accept": "application/json",
125
+ "Authorization": "Bearer {{secrets.test_token}}"
126
+ },
127
+ "params": {
128
+ "sampleKey": "sampleValue"
129
+ },
130
+ "repeatUntilEnabled": null,
131
+ "repeatUntilCondition": {
132
+ "script": "(steps, context) => {\n return steps.__self.output.response.counter === 100;\n}"
133
+ },
134
+ "repeatIntervalSeconds": null,
135
+ "maxRepeatCount": null,
136
+ "includeFullResponseString": false,
137
+ "noEncode": false,
138
+ "extraLongTimeouts": false
139
+ },
140
+ "output": null
141
+ },
142
+ {
143
+ "orgId": 1,
144
+ "namespace": "default",
145
+ "name": "exit",
146
+ "type": "EXIT",
147
+ "ref": "exit_1",
148
+ "optional": false,
149
+ "createdBy": "system",
150
+ "updatedBy": "system",
151
+ "description": null,
152
+ "label": null,
153
+ "created": 1700000000000,
154
+ "updated": 1700000000000,
155
+ "configuration": {
156
+ "errorPolicyName": null,
157
+ "useCache": false,
158
+ "cacheKey": null,
159
+ "cacheTimeoutSeconds": 0,
160
+ "stream": false,
161
+ "streamAllStatuses": false,
162
+ "preExecutionScript": null,
163
+ "constructInputFromScript": false,
164
+ "scriptLanguage": null,
165
+ "jqTransformer": null,
166
+ "rateLimitMaxRequests": 0,
167
+ "rateLimitWindowSeconds": 0
168
+ },
169
+ "children": [],
170
+ "input": {
171
+ "message": "Exit message",
172
+ "status": "COMPLETED"
173
+ },
174
+ "output": null
175
+ }
176
+ ],
177
+ "defaultInput": null,
178
+ "defaultOutput": null,
179
+ "outputMapping": null,
180
+ "signature": null,
181
+ "metadata": null,
182
+ "tags": null,
183
+ "dependencies": null,
184
+ "dependents": null
185
+ }
186
+ ```
187
+
188
+ ## Minimal Executed Step Example
189
+
190
+ ```json
191
+ {
192
+ "id": 28800040,
193
+ "processId": 28800037,
194
+ "ref": "exit_1",
195
+ "namespace": "default",
196
+ "name": "exit",
197
+ "type": "EXIT",
198
+ "status": "COMPLETED",
199
+ "input": {
200
+ "message": "Exit message",
201
+ "__currentExecutionStartTime": 1778184661988,
202
+ "status": "COMPLETED"
203
+ },
204
+ "output": {
205
+ "__exitReason": "Exit message",
206
+ "__exitStatus": "COMPLETED",
207
+ "message": "Exit message"
208
+ }
209
+ }
210
+ ```
211
+
212
+ ## Example: Validation Branch Exit
213
+
214
+ ```json
215
+ {
216
+ "message": "Required customer email is missing.",
217
+ "status": "FAILED"
218
+ }
219
+ ```
220
+