@culvii/cli 0.0.7 → 0.0.9
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/COMMANDS.md +5 -5
- package/README.md +15 -6
- package/USAGE.md +11 -10
- package/dist/DeployView-D4UEXMDJ.js +2 -0
- package/dist/DevView-GPKSSOLA.js +2 -0
- package/dist/EnvView-3ZURMIZS.js +2 -0
- package/dist/{HelpView-YLCEPIFY.js → HelpView-PELQJJQQ.js} +1 -1
- package/dist/WhoamiView-TKSYSHQ2.js +2 -0
- package/dist/{WorkspaceView-RNFALIPM.js → WorkspaceView-ID7ZMBHV.js} +1 -1
- package/dist/{chunk-IRZMWFC3.js → chunk-KM7ZWOEG.js} +1 -1
- package/dist/index.js +31 -681
- package/dist/lib/evaluator.js +2 -2
- package/dist/login-3OMS75QL.js +39 -0
- package/dist/{logout-TDZA462P.js → logout-ZYTERDYA.js} +1 -1
- package/dist/skill-bundle-Z4FQO3CQ.js +2553 -0
- package/package.json +9 -5
- package/skills/culvii/.culvii-skill.json +90 -0
- package/skills/culvii/SKILL.md +104 -0
- package/skills/culvii/agents/openai.yaml +4 -0
- package/skills/culvii/examples/agent-workflow.culvii.ts +47 -0
- package/skills/culvii/examples/binary-document-workflow.culvii.ts +80 -0
- package/skills/culvii/examples/complete-workflow.culvii.ts +81 -0
- package/skills/culvii/examples/custom-output-surface.culvii.ts +69 -0
- package/skills/culvii/examples/custom-wait-surface.culvii.ts +90 -0
- package/skills/culvii/examples/human-in-the-loop-workflow.culvii.ts +125 -0
- package/skills/culvii/examples/integration-agent-workflow.culvii.ts +101 -0
- package/skills/culvii/examples/multi-agent-workflow-tools.culvii.ts +157 -0
- package/skills/culvii/examples/nested-agent-workflow.culvii.ts +108 -0
- package/skills/culvii/examples/output-surface.culvii.ts +45 -0
- package/skills/culvii/examples/wait-surface.culvii.ts +24 -0
- package/skills/culvii/references/agents.md +77 -0
- package/skills/culvii/references/authoring-files.md +21 -0
- package/skills/culvii/references/cli-guide.md +22 -0
- package/skills/culvii/references/cli-reference.md +217 -0
- package/skills/culvii/references/feedback-cycle.md +43 -0
- package/skills/culvii/references/integrations.md +13 -0
- package/skills/culvii/references/kit-api.md +35 -0
- package/skills/culvii/references/node-argocd.md +44 -0
- package/skills/culvii/references/node-clickup-doc.md +38 -0
- package/skills/culvii/references/node-clickup-ticket.md +47 -0
- package/skills/culvii/references/node-core-agent.md +27 -0
- package/skills/culvii/references/node-core-browser-automation.md +53 -0
- package/skills/culvii/references/node-core-code.md +28 -0
- package/skills/culvii/references/node-core-http.md +42 -0
- package/skills/culvii/references/node-core-if.md +26 -0
- package/skills/culvii/references/node-core-jwt.md +31 -0
- package/skills/culvii/references/node-core-loop-break.md +26 -0
- package/skills/culvii/references/node-core-loop-continue.md +26 -0
- package/skills/culvii/references/node-core-loop-output.md +24 -0
- package/skills/culvii/references/node-core-loop.md +25 -0
- package/skills/culvii/references/node-core-merge.md +23 -0
- package/skills/culvii/references/node-core-set.md +24 -0
- package/skills/culvii/references/node-core-switch.md +24 -0
- package/skills/culvii/references/node-cost-explorer.md +45 -0
- package/skills/culvii/references/node-cron-trigger.md +25 -0
- package/skills/culvii/references/node-elasticsearch.md +39 -0
- package/skills/culvii/references/node-github-poll-trigger.md +31 -0
- package/skills/culvii/references/node-github-webhook-trigger.md +27 -0
- package/skills/culvii/references/node-github.md +251 -0
- package/skills/culvii/references/node-gmail-trigger.md +44 -0
- package/skills/culvii/references/node-gmail.md +57 -0
- package/skills/culvii/references/node-google-calendar.md +51 -0
- package/skills/culvii/references/node-google-docs.md +46 -0
- package/skills/culvii/references/node-grafana-dashboard.md +38 -0
- package/skills/culvii/references/node-grafana-data-source.md +42 -0
- package/skills/culvii/references/node-grafana-query.md +34 -0
- package/skills/culvii/references/node-hibp-list-domains.md +27 -0
- package/skills/culvii/references/node-hibp-stealer-logs.md +30 -0
- package/skills/culvii/references/node-kubernetes.md +51 -0
- package/skills/culvii/references/node-manual-trigger.md +24 -0
- package/skills/culvii/references/node-microsoft-outlook-trigger.md +41 -0
- package/skills/culvii/references/node-microsoft-outlook.md +56 -0
- package/skills/culvii/references/node-microsoft-sharepoint.md +40 -0
- package/skills/culvii/references/node-onionsearch.md +27 -0
- package/skills/culvii/references/node-prometheus.md +40 -0
- package/skills/culvii/references/node-s3.md +40 -0
- package/skills/culvii/references/node-slack-events-trigger.md +37 -0
- package/skills/culvii/references/node-slack-interactions-trigger.md +28 -0
- package/skills/culvii/references/node-slack-trigger.md +40 -0
- package/skills/culvii/references/node-slack.md +162 -0
- package/skills/culvii/references/node-supabase.md +61 -0
- package/skills/culvii/references/node-twilio.md +39 -0
- package/skills/culvii/references/node-wait-timer.md +24 -0
- package/skills/culvii/references/node-webhook-trigger.md +24 -0
- package/skills/culvii/references/nodes-index.md +51 -0
- package/skills/culvii/references/runtime-values.md +36 -0
- package/skills/culvii/references/surface-authoring.md +38 -0
- package/skills/culvii/references/surface-display.md +390 -0
- package/skills/culvii/references/surface-feedback.md +38 -0
- package/skills/culvii/references/surface-input-actions.md +143 -0
- package/skills/culvii/references/surface-layout.md +97 -0
- package/skills/culvii/references/validation.md +18 -0
- package/skills/culvii/references/workflows.md +30 -0
- package/dist/DeployView-GEJNL26A.js +0 -2
- package/dist/DevView-SOPAMSZ4.js +0 -2
- package/dist/EnvView-MCZC2NBO.js +0 -2
- package/dist/WhoamiView-67HV2L5J.js +0 -2
- package/dist/chunk-MPKGJC7N.js +0 -2
- package/dist/login-G5QUR55L.js +0 -36
- /package/dist/{chunk-5NBKYMD7.js → chunk-56C3DFV2.js} +0 -0
- /package/dist/{chunk-JFIFRAAR.js → chunk-RS5GDTRN.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@culvii/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Culvii CLI",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
+
"skills",
|
|
13
14
|
"README.md",
|
|
14
15
|
"COMMANDS.md",
|
|
15
16
|
"USAGE.md"
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
"tsup": "8.5.1",
|
|
50
51
|
"typescript": "6.0.3",
|
|
51
52
|
"vitest": "^4.1.5",
|
|
53
|
+
"@culvii/kit": "0.0.8",
|
|
52
54
|
"surface-contract": "1.0.0"
|
|
53
55
|
},
|
|
54
56
|
"engines": {
|
|
@@ -56,12 +58,14 @@
|
|
|
56
58
|
"pnpm": ">=10.0.0"
|
|
57
59
|
},
|
|
58
60
|
"scripts": {
|
|
59
|
-
"
|
|
61
|
+
"skill:generate": "node --import tsx scripts/generate-skill-bundle.ts",
|
|
62
|
+
"skill:check": "node --import tsx scripts/generate-skill-bundle.ts --check",
|
|
63
|
+
"prebuild": "pnpm skill:generate",
|
|
60
64
|
"build": "tsup",
|
|
61
|
-
"predev": "
|
|
65
|
+
"predev": "pnpm skill:generate",
|
|
62
66
|
"dev": "tsup --watch",
|
|
63
|
-
"pretest": "
|
|
64
|
-
"test": "vitest run",
|
|
67
|
+
"pretest": "pnpm --filter @culvii/kit build && pnpm skill:check && pnpm skill:generate",
|
|
68
|
+
"test": "vitest run && tsc --noEmit -p tsconfig.skill-examples.json",
|
|
65
69
|
"test:watch": "vitest",
|
|
66
70
|
"test:coverage": "vitest run --coverage"
|
|
67
71
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"name": "culvii",
|
|
4
|
+
"bundleHash": "bb8ee103e0534e36fbf3df701f1c1539e2061f4f50e1a6affc1a0b173b29b672",
|
|
5
|
+
"generatorVersion": 1,
|
|
6
|
+
"sources": {
|
|
7
|
+
"@culvii/kit": "0.0.8",
|
|
8
|
+
"nodes": "1.0.0",
|
|
9
|
+
"surface-contract": "1.0.0",
|
|
10
|
+
"@culvii/cli": "0.0.9"
|
|
11
|
+
},
|
|
12
|
+
"files": {
|
|
13
|
+
"agents/openai.yaml": "80196c1dbde488639e31d4bbc0addcd253ba626ea0b3cb524d06ee1eabe3263b",
|
|
14
|
+
"examples/agent-workflow.culvii.ts": "c82471aa06e2fb2f939f50b70ae797b6fed22f2d51277975a93c16d0b94ecd76",
|
|
15
|
+
"examples/binary-document-workflow.culvii.ts": "3bc13dd2cf04b426449d5509749343a9c040b5e51bcb7e5982339b1173a459c6",
|
|
16
|
+
"examples/complete-workflow.culvii.ts": "2c59f6b9d525092e75b980aa174ccd8b0187621c8c196270453e03591000a08d",
|
|
17
|
+
"examples/custom-output-surface.culvii.ts": "8ccfb826d8b140dae94f8e57458eba7d98bf1cdf3dda372c23b757f9f47cb72b",
|
|
18
|
+
"examples/custom-wait-surface.culvii.ts": "4efef08381de6b51c4530fa312450682a09c3008c77f74c4b55c44b685bf4348",
|
|
19
|
+
"examples/human-in-the-loop-workflow.culvii.ts": "9daee28598cdae498786aea1b55640c1065097825d19262eb072c1b584328cfc",
|
|
20
|
+
"examples/integration-agent-workflow.culvii.ts": "3c9b3a3c174ebdfc4f128b2076d44685355d4ce952e54a5a4ec7061e1f231daf",
|
|
21
|
+
"examples/multi-agent-workflow-tools.culvii.ts": "ac96689205433dc647078acb323e970ac1c2ef06be118f087d428200b852a560",
|
|
22
|
+
"examples/nested-agent-workflow.culvii.ts": "e1255b0e22e83c26ea09876c9e90496c4c5ab4c24a52cf30d2cc2a7e9b1212a7",
|
|
23
|
+
"examples/output-surface.culvii.ts": "1959d8bc5c987c32d6c21fa6f36a1eb70bea5a18742885dff85f353170645702",
|
|
24
|
+
"examples/wait-surface.culvii.ts": "ae533ae4cf2ed533bc333528bd971d65b4140be033e65025663f78bc99d77cf2",
|
|
25
|
+
"references/agents.md": "bdd14922138c42c9b2ac6466d0eca5960365750451079e8ab28b65f2e0602ae5",
|
|
26
|
+
"references/authoring-files.md": "ea93dafc36e6643a1040e430aec0fd41f1a5f93c5d24794ae3db0624b26dff53",
|
|
27
|
+
"references/cli-guide.md": "f127193a2e669861ec9884fdf1f3618af6baf37324029943a05cc13a49d696bc",
|
|
28
|
+
"references/cli-reference.md": "1c97ed69b833a62b8e9000f20684c99315ff1eabaca265ba9fe54817c3b67020",
|
|
29
|
+
"references/feedback-cycle.md": "54ad5b36049e377344220e10a7ddaea1e010f532d9fe7ab39b6abd3d435a6a2a",
|
|
30
|
+
"references/integrations.md": "9fa3db838b4e48d3aae2949012bbbfa7ce84b32779048d17c21ac4548482ee68",
|
|
31
|
+
"references/kit-api.md": "c082d1b63bec52fdd7124e711f4e86bfae015f1cd7045b25e4910349c4fca1fd",
|
|
32
|
+
"references/node-argocd.md": "5abd8bfc02ced232d85d366108f2395bfe8d82e0dd0414527ccf932d85da6191",
|
|
33
|
+
"references/node-clickup-doc.md": "bf62328992963604fe0e015063b9af34d67ca49181c744b77b591a635c1b8c35",
|
|
34
|
+
"references/node-clickup-ticket.md": "b616e8c02a771eb5283fe33972e100aa6be410f88dd01adfbbfc58fe794b6d23",
|
|
35
|
+
"references/node-core-agent.md": "09b0b3a5607dbdd06f3f463d140f9633a27b580e59b22f135f1bb349b7fcc0bf",
|
|
36
|
+
"references/node-core-browser-automation.md": "797f7dbd3374c2ea38de830ab2e9b08a2762e45a3cf56dad1ff274cf8109e7e7",
|
|
37
|
+
"references/node-core-code.md": "2768aa7a0fec5f12d716ece9727b038ee2a205647e7c41bd85f0139165bbbd51",
|
|
38
|
+
"references/node-core-http.md": "4799365201368c31d270644161a6e415d5ecfa25d9c75cf5e550330aff7679b4",
|
|
39
|
+
"references/node-core-if.md": "3298f6dbe803eae9e3a69eb7084b08f43a6c76e139e56051539c7603a705b7e1",
|
|
40
|
+
"references/node-core-jwt.md": "8828d11751ee88474f962a296cf29b279fa055ea2b95d9ee0362d211596bdedb",
|
|
41
|
+
"references/node-core-loop-break.md": "d383011f16ae620860e2535be49cafc862a57c7ecae7d7fbd57ac767a5afbd3c",
|
|
42
|
+
"references/node-core-loop-continue.md": "308af6ffa74572a211f784ffc77b565702105cc73718ae5e8874f1f13254a0ff",
|
|
43
|
+
"references/node-core-loop-output.md": "dd70d65ad423387cf1190f9e103d4ba734763e32b82674299b733cdb299dbac6",
|
|
44
|
+
"references/node-core-loop.md": "35d9e5f15ef49d9e5eb1ed824f438a1c61382ca00ff2a838e371fd60919f3b26",
|
|
45
|
+
"references/node-core-merge.md": "f1c2753761791f872a3e786552ba776742c81b5b56985c23660d90bed6c9422a",
|
|
46
|
+
"references/node-core-set.md": "511944327b31f9af70fbdcc5769c512a78129f901f98bb03ae3e464205b76468",
|
|
47
|
+
"references/node-core-switch.md": "512edc581e410f44f7f15ac31ed27fbd1698c0c4cfb9a7fd93feb42bbb29d1ae",
|
|
48
|
+
"references/node-cost-explorer.md": "65bafd0f0e3c9910f3af2f210d492fc0d1648b570c61ff258642c4b441e688f2",
|
|
49
|
+
"references/node-cron-trigger.md": "ab958969a2a30b6643ad1d31a3241fed427d3db2e3871ea7ab68c0af4d4cc82b",
|
|
50
|
+
"references/node-elasticsearch.md": "276ca5fa4368a0c7a12a4383dd01404bdc3c345f6c837ec5fc1c9d609b3138b2",
|
|
51
|
+
"references/node-github-poll-trigger.md": "132d7a0d7b56cfa29be552418725eeddefb0a11716b7b7192f53de6d57667ee8",
|
|
52
|
+
"references/node-github-webhook-trigger.md": "09de1c2b493476d908611f71a88850fc76786d6aed48b74e573c6b647110c6a3",
|
|
53
|
+
"references/node-github.md": "b7ed8f59ecdbcf3ea0166268a27905f1ada3c3fcc5e3e121dc32dea5427a3d06",
|
|
54
|
+
"references/node-gmail-trigger.md": "59ca6745079299e3bdf77f87fa328bd7900227bbe131ed7a977f781d2ee606e1",
|
|
55
|
+
"references/node-gmail.md": "f9d8f18d005acc6423c49e8741d909fe8541c4d849ae8ae590c04b561576bd82",
|
|
56
|
+
"references/node-google-calendar.md": "3bf8ed7c280036fd0009c299fcacbf920bb3b18429f2734ac603e18e16796f73",
|
|
57
|
+
"references/node-google-docs.md": "b8d6d68914b4228f11adf575753bcaa86cbf71fd3c7dfa36fb07d84627250ad1",
|
|
58
|
+
"references/node-grafana-dashboard.md": "9bdfafcdfd461a0082b0645a4089826204021fb273589732071ee56ff97ab83e",
|
|
59
|
+
"references/node-grafana-data-source.md": "050f9dda595a35346b5396563de0e8c18acb05a9139655c61d2a706cc39b5544",
|
|
60
|
+
"references/node-grafana-query.md": "35c95c6528c01766cfe0c88a9f1adcf786a95061ce81e963025ec131da1d1873",
|
|
61
|
+
"references/node-hibp-list-domains.md": "b977ed4babb1c419bfe13d76166528fffeddbaeb81147ece07b3c19d34d0f797",
|
|
62
|
+
"references/node-hibp-stealer-logs.md": "13758678d5eebd520823bc0e56d12cbef8b72835b54b0fc00e9402b744d44550",
|
|
63
|
+
"references/node-kubernetes.md": "293fd70959588d4f10fd8869388cf37809f477e2f987752da5ab0cdfb2c7cdc2",
|
|
64
|
+
"references/node-manual-trigger.md": "4bebd22e2a76d6e90acb08ece0d88a6c7040f1a0ac11da298f712251194b7086",
|
|
65
|
+
"references/node-microsoft-outlook-trigger.md": "aa4385d1734de97e79ce59d2c6ca802683e6c07f625b521d606f8bf5f8540ac5",
|
|
66
|
+
"references/node-microsoft-outlook.md": "51d55b369461dc0b88dd9b1fcf905f6f9b37fd9270053fc9e2022c2d3c33bed2",
|
|
67
|
+
"references/node-microsoft-sharepoint.md": "10f27d6507989598ead041a5e1965dd3014dd610848d2b12e4ee81864e4373ed",
|
|
68
|
+
"references/node-onionsearch.md": "3711791d3c5516ae6ee88bf29b1d18a79da3446cb310446d1e4fb77e22934fe6",
|
|
69
|
+
"references/node-prometheus.md": "337c4583bbe7f18b54bd7bcf452b8b7f0eb8dbab5d4c65945e6bdec2bbddc35b",
|
|
70
|
+
"references/node-s3.md": "8ecc9a791cda334707431dfcfed34abe9eedbedbb9c06f1ad03907f8af59b2a8",
|
|
71
|
+
"references/node-slack-events-trigger.md": "9884a5f369f654b5bf78cd352aaee9df27ec6e5fa548edde8485ea7f47d31eb2",
|
|
72
|
+
"references/node-slack-interactions-trigger.md": "b8fe95a36582dc8bc0d96b842a621e50fbacf6141914d00c13abfc9912748916",
|
|
73
|
+
"references/node-slack-trigger.md": "43e6caa5ee349e1ba3c256da3d3279b7385e182829b78e134f2123a650c3d052",
|
|
74
|
+
"references/node-slack.md": "2d24da368e43494487fa740b111f33d7ab9b763ec88ab45be852a8a8b64c3ff7",
|
|
75
|
+
"references/node-supabase.md": "c67e87065053adbb5c44425ad62d1e531c0fd9d98de0a7dc91b45e582a24c270",
|
|
76
|
+
"references/node-twilio.md": "a191b4c071a738c1283d545512e6b73f52aabb1c7fae4d9acb08c5346f5a6ad3",
|
|
77
|
+
"references/node-wait-timer.md": "72749e63f27b512aa6c51190fbc7a79195cdc37acd6c0f2305285012ce5fd06d",
|
|
78
|
+
"references/node-webhook-trigger.md": "b98b9cfc92b2e6eb5b1d75e651abccd022b7914d609052d7f7de4e588af45b5a",
|
|
79
|
+
"references/nodes-index.md": "e8feb33feff53ddf84628f6db9a45db26f9dd5cd6c14082912606af4f1c299eb",
|
|
80
|
+
"references/runtime-values.md": "93dbe09b2f150ffec02a1d1e2bebdce3eda6e885f1daaae05354ecaceb41f038",
|
|
81
|
+
"references/surface-authoring.md": "21ae1e1b64e15c8d89ff1d95efec84829ffa2f2aa2f0d5ba400c78742463586d",
|
|
82
|
+
"references/surface-display.md": "9a24b5fc81f48ad517d36f202c99291258866b7e607f8481763a985bd26d1a26",
|
|
83
|
+
"references/surface-feedback.md": "425f70b7bbda1923624bd9639fb0d7f071828ad7b59feb54867ef6fe5b5054cb",
|
|
84
|
+
"references/surface-input-actions.md": "54cd475120fcb650e4c876b9787905d47b87638483d73fc7dc7fb3a06305a8da",
|
|
85
|
+
"references/surface-layout.md": "3381fea6ed2ed16f4d1e9a9186aa853ecf834fb8f31a1bd09408e9c218e6b559",
|
|
86
|
+
"references/validation.md": "224ab2041ab6d823b8468b381e16a9823eb2a97b2ea33a812e89b2592ac72f68",
|
|
87
|
+
"references/workflows.md": "5988f86d8053c44c12decf4d43e98c13d2b3e22f124060198ede182b1e0fc648",
|
|
88
|
+
"SKILL.md": "d885d3601c21bd69156cdce3116268464edbbf88bc7cec0b6e98989d3a33e41b"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: culvii
|
|
3
|
+
description: Use this skill when writing and validating Culvii agents, workflows, nodes, or dynamic UI surfaces with @culvii/kit and culvii dev, including recursive runtime expressions, surface bindings, and cross-resource references.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Culvii authoring
|
|
7
|
+
|
|
8
|
+
Build Culvii resources in TypeScript using public @culvii/kit APIs. This file routes you to the minimum detailed references needed for the task.
|
|
9
|
+
|
|
10
|
+
## Start here
|
|
11
|
+
|
|
12
|
+
1. Inspect the project's package.json, culvii.yaml, and existing *.culvii.ts files before generating code.
|
|
13
|
+
2. Read [authoring files](references/authoring-files.md), then read only the task-specific references below.
|
|
14
|
+
3. Never invent node types, component types, props, flags, or APIs. Open the generated reference first.
|
|
15
|
+
4. Never write raw credentials. Resolve Culvii credential IDs through [integration selection](references/integrations.md); never ask the user to copy or paste an ID.
|
|
16
|
+
5. Author the requested resources as drafts, then follow the authenticated validation loop in [the CLI development guide](references/cli-guide.md). Never guess the tenant, never run culvii deploy, and never leave culvii dev running.
|
|
17
|
+
|
|
18
|
+
For every newly authored workflow, offer runtime widget configuration before starting `culvii dev`. If the user opts in, follow [surface configuration and visual approval](references/surface-feedback.md): choose custom, existing, or default per node, and attach every custom candidate before the first validation. Do not finish while a custom surface is unvalidated or awaiting visual approval.
|
|
19
|
+
|
|
20
|
+
## Missing required inputs
|
|
21
|
+
|
|
22
|
+
- Gather every known blocking input before authoring placeholders. Ask them together in one interactive prompt, or the fewest batches allowed by the agent.
|
|
23
|
+
- Use the agent's native in-run question tool, such as Codex request_user_input or Claude AskUserQuestion, so the task pauses and resumes in the same run. Never return a final answer merely to request missing values.
|
|
24
|
+
- Use selectable options only when every option is a complete usable value or a decision that needs no dependent value. Options must come from the user's request, existing project files, or real command output; never invent IDs.
|
|
25
|
+
- An answer such as "DM by user ID" is incomplete when the actual user ID is still missing. If a semantic decision and an ID are both required, collect both in the same in-run prompt or immediately ask for the ID before continuing.
|
|
26
|
+
- For credentials, follow [integration selection](references/integrations.md). For an unknown channel, user, tenant, or resource ID, use a free-text input when the agent supports one. If the question UI only offers radio options plus custom/Other, explicitly ask the user to select custom/Other and paste the literal ID; do not offer a semantic radio answer that can be mistaken for the ID.
|
|
27
|
+
- After the user responds, verify that every required opaque value contains the literal usable ID. Continue authoring and validation automatically only when all required values are present. If no interactive question tool exists, leave the task explicitly waiting for input rather than marking it complete.
|
|
28
|
+
|
|
29
|
+
## Task routing
|
|
30
|
+
|
|
31
|
+
- Agents, models, secondary agents, permissions, and tools: [agents](references/agents.md) and [Kit API](references/kit-api.md).
|
|
32
|
+
- Workflows, steps, branching, errors, and references: [workflows](references/workflows.md), [runtime values](references/runtime-values.md), and [validation](references/validation.md).
|
|
33
|
+
- Surfaces: [surface configuration and visual approval](references/surface-feedback.md), [surface authoring](references/surface-authoring.md), then [layout](references/surface-layout.md), [display](references/surface-display.md), or [input/actions](references/surface-input-actions.md).
|
|
34
|
+
- CLI use: [development lifecycle](references/cli-guide.md), [workflow feedback cycle](references/feedback-cycle.md), and [exact CLI reference](references/cli-reference.md).
|
|
35
|
+
- Credentials and provider integrations: [integration selection](references/integrations.md).
|
|
36
|
+
- Node selection: [node index](references/nodes-index.md), then the exact page linked below.
|
|
37
|
+
|
|
38
|
+
## Node references
|
|
39
|
+
|
|
40
|
+
- [`argocd`](references/node-argocd.md)
|
|
41
|
+
- [`clickupDoc`](references/node-clickup-doc.md)
|
|
42
|
+
- [`clickupTicket`](references/node-clickup-ticket.md)
|
|
43
|
+
- [`core.agent`](references/node-core-agent.md)
|
|
44
|
+
- [`core.browserAutomation`](references/node-core-browser-automation.md)
|
|
45
|
+
- [`core.code`](references/node-core-code.md)
|
|
46
|
+
- [`core.http`](references/node-core-http.md)
|
|
47
|
+
- [`core.if`](references/node-core-if.md)
|
|
48
|
+
- [`core.jwt`](references/node-core-jwt.md)
|
|
49
|
+
- [`core.loop`](references/node-core-loop.md)
|
|
50
|
+
- [`core.loopBreak`](references/node-core-loop-break.md)
|
|
51
|
+
- [`core.loopContinue`](references/node-core-loop-continue.md)
|
|
52
|
+
- [`core.loopOutput`](references/node-core-loop-output.md)
|
|
53
|
+
- [`core.merge`](references/node-core-merge.md)
|
|
54
|
+
- [`core.set`](references/node-core-set.md)
|
|
55
|
+
- [`core.switch`](references/node-core-switch.md)
|
|
56
|
+
- [`costExplorer`](references/node-cost-explorer.md)
|
|
57
|
+
- [`cronTrigger`](references/node-cron-trigger.md)
|
|
58
|
+
- [`elasticsearch`](references/node-elasticsearch.md)
|
|
59
|
+
- [`github`](references/node-github.md)
|
|
60
|
+
- [`githubPollTrigger`](references/node-github-poll-trigger.md)
|
|
61
|
+
- [`githubWebhookTrigger`](references/node-github-webhook-trigger.md)
|
|
62
|
+
- [`gmail`](references/node-gmail.md)
|
|
63
|
+
- [`gmailTrigger`](references/node-gmail-trigger.md)
|
|
64
|
+
- [`googleCalendar`](references/node-google-calendar.md)
|
|
65
|
+
- [`googleDocs`](references/node-google-docs.md)
|
|
66
|
+
- [`grafanaDashboard`](references/node-grafana-dashboard.md)
|
|
67
|
+
- [`grafanaDataSource`](references/node-grafana-data-source.md)
|
|
68
|
+
- [`grafanaQuery`](references/node-grafana-query.md)
|
|
69
|
+
- [`hibp.listDomains`](references/node-hibp-list-domains.md)
|
|
70
|
+
- [`hibp.stealerLogs`](references/node-hibp-stealer-logs.md)
|
|
71
|
+
- [`kubernetes`](references/node-kubernetes.md)
|
|
72
|
+
- [`manualTrigger`](references/node-manual-trigger.md)
|
|
73
|
+
- [`microsoftOutlook`](references/node-microsoft-outlook.md)
|
|
74
|
+
- [`microsoftOutlookTrigger`](references/node-microsoft-outlook-trigger.md)
|
|
75
|
+
- [`microsoftSharepoint`](references/node-microsoft-sharepoint.md)
|
|
76
|
+
- [`onionsearch`](references/node-onionsearch.md)
|
|
77
|
+
- [`prometheus`](references/node-prometheus.md)
|
|
78
|
+
- [`s3`](references/node-s3.md)
|
|
79
|
+
- [`slack`](references/node-slack.md)
|
|
80
|
+
- [`slackEventsTrigger`](references/node-slack-events-trigger.md)
|
|
81
|
+
- [`slackInteractionsTrigger`](references/node-slack-interactions-trigger.md)
|
|
82
|
+
- [`slackTrigger`](references/node-slack-trigger.md)
|
|
83
|
+
- [`supabase`](references/node-supabase.md)
|
|
84
|
+
- [`twilio`](references/node-twilio.md)
|
|
85
|
+
- [`waitTimer`](references/node-wait-timer.md)
|
|
86
|
+
- [`webhookTrigger`](references/node-webhook-trigger.md)
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
- [Agent and workflow](examples/agent-workflow.culvii.ts)
|
|
91
|
+
- [Binary document workflow](examples/binary-document-workflow.culvii.ts)
|
|
92
|
+
- [Custom output surface](examples/custom-output-surface.culvii.ts)
|
|
93
|
+
- [Custom wait surface](examples/custom-wait-surface.culvii.ts)
|
|
94
|
+
- [Human-in-the-loop workflow](examples/human-in-the-loop-workflow.culvii.ts)
|
|
95
|
+
- [Integration agent workflow](examples/integration-agent-workflow.culvii.ts)
|
|
96
|
+
- [Nested agent workflow](examples/nested-agent-workflow.culvii.ts)
|
|
97
|
+
- [Multi-agent workflow tools](examples/multi-agent-workflow-tools.culvii.ts)
|
|
98
|
+
- [Output surface](examples/output-surface.culvii.ts)
|
|
99
|
+
- [Wait surface](examples/wait-surface.culvii.ts)
|
|
100
|
+
- [Complete workflow](examples/complete-workflow.culvii.ts)
|
|
101
|
+
|
|
102
|
+
## Safety
|
|
103
|
+
|
|
104
|
+
Do not bypass platform validation, add unsupported surface markup/CSS/JavaScript, or expose raw binary data. Never run culvii deploy. Test workflows through the feedback cycle; do not execute standalone agents. Always close the exact culvii dev process you started and wait for it to exit before finishing. Workflow expressions use {{ ... }} selectors; surface bindings use JSON Pointer objects. Keep them separate.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MultiAgentEngine, Step, Workflow, createAgentModelConfigFromRef } from '@culvii/kit';
|
|
2
|
+
|
|
3
|
+
const MODEL = createAgentModelConfigFromRef('openai/gpt-4.1', 'credential-id');
|
|
4
|
+
|
|
5
|
+
function createAgent() {
|
|
6
|
+
return new MultiAgentEngine({
|
|
7
|
+
id: 'review-agent',
|
|
8
|
+
name: 'Review Agent',
|
|
9
|
+
role: 'primary',
|
|
10
|
+
description: 'Reviews a request.',
|
|
11
|
+
systemPrompt: 'Return a concise review.',
|
|
12
|
+
model: MODEL,
|
|
13
|
+
metadata: {
|
|
14
|
+
runtimeDetails: {
|
|
15
|
+
sandboxProfile: 'default',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
permissions: {
|
|
19
|
+
default: {
|
|
20
|
+
'*': 'ask',
|
|
21
|
+
read_file: 'approve',
|
|
22
|
+
git: 'ask',
|
|
23
|
+
delete_file: 'deny',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
secondaryAgents: [],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createWorkflow() {
|
|
31
|
+
const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
|
|
32
|
+
const run = new Step({
|
|
33
|
+
id: 'run-review',
|
|
34
|
+
name: 'Run Review',
|
|
35
|
+
type: 'core.agent',
|
|
36
|
+
params: {
|
|
37
|
+
agentReferenceKey: 'review-agent',
|
|
38
|
+
prompt: 'Review the request.',
|
|
39
|
+
autoCloseSession: true,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
trigger.connectTo(run);
|
|
43
|
+
return new Workflow({ id: 'review-workflow', name: 'Review Workflow', steps: [trigger, run] });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
createAgent();
|
|
47
|
+
createWorkflow();
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { MultiAgentEngine, Step, Workflow, createAgentModelConfigFromRef } from '@culvii/kit';
|
|
2
|
+
|
|
3
|
+
const MODEL = createAgentModelConfigFromRef(
|
|
4
|
+
'google-vertex/gemini-3.1-pro-preview',
|
|
5
|
+
'credential-id'
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
const CREATE_DOCUMENT_CODE = `
|
|
9
|
+
export default async function main() {
|
|
10
|
+
const { Buffer } = require('node:buffer');
|
|
11
|
+
const document = 'Quarterly review\\nRevenue grew 18 percent.\\nNext step: renew the account.';
|
|
12
|
+
return {
|
|
13
|
+
json: { generated: true },
|
|
14
|
+
binary: {
|
|
15
|
+
sourceFile: {
|
|
16
|
+
data: Buffer.from(document, 'utf8').toString('base64'),
|
|
17
|
+
mimeType: 'text/plain',
|
|
18
|
+
fileName: 'quarterly-review.txt',
|
|
19
|
+
fileExtension: 'txt',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
function createDocumentAgent() {
|
|
27
|
+
return new MultiAgentEngine({
|
|
28
|
+
id: 'document-reviewer',
|
|
29
|
+
name: 'Document Reviewer',
|
|
30
|
+
role: 'primary',
|
|
31
|
+
description: 'Reads workflow files and returns a concise review plus a text artifact.',
|
|
32
|
+
systemPrompt:
|
|
33
|
+
'Uploaded workflow files are only available through the binary tools. Always list files first, read the requested file, and never guess its contents.',
|
|
34
|
+
model: MODEL,
|
|
35
|
+
metadata: {
|
|
36
|
+
runtimeDetails: { sandboxProfile: 'default' },
|
|
37
|
+
},
|
|
38
|
+
permissions: { default: { '*': 'deny' } },
|
|
39
|
+
secondaryAgents: [],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createWorkflow() {
|
|
44
|
+
const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
|
|
45
|
+
const createDocument = new Step({
|
|
46
|
+
id: 'create-document',
|
|
47
|
+
name: 'Create Document',
|
|
48
|
+
type: 'core.code',
|
|
49
|
+
params: { code: CREATE_DOCUMENT_CODE, codeType: 'js' },
|
|
50
|
+
});
|
|
51
|
+
const review = new Step({
|
|
52
|
+
id: 'review',
|
|
53
|
+
name: 'Review Document',
|
|
54
|
+
type: 'core.agent',
|
|
55
|
+
params: {
|
|
56
|
+
agentReferenceKey: 'document-reviewer',
|
|
57
|
+
prompt:
|
|
58
|
+
'List the workflow binary files, read the file with key "sourceFile", summarize its exact contents, then create a text/plain binary output named "review.txt" containing your summary. Reply with the source filename and the output filename.',
|
|
59
|
+
autoCloseSession: true,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const persist = new Step({
|
|
63
|
+
id: 'persist',
|
|
64
|
+
name: 'Persist Review',
|
|
65
|
+
type: 'core.set',
|
|
66
|
+
params: { values: { response: "={{ $('Review Document').json.response }}" } },
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
trigger.connectTo(createDocument);
|
|
70
|
+
createDocument.connectTo(review);
|
|
71
|
+
review.connectTo(persist);
|
|
72
|
+
return new Workflow({
|
|
73
|
+
id: 'binary-document-workflow',
|
|
74
|
+
name: 'Binary Document Workflow',
|
|
75
|
+
steps: [trigger, createDocument, review, persist],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
createDocumentAgent();
|
|
80
|
+
createWorkflow();
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MultiAgentEngine,
|
|
3
|
+
Step,
|
|
4
|
+
Workflow,
|
|
5
|
+
createAgentModelConfigFromRef,
|
|
6
|
+
defineWorkflowTool,
|
|
7
|
+
} from '@culvii/kit';
|
|
8
|
+
|
|
9
|
+
const MODEL = createAgentModelConfigFromRef('anthropic/claude-sonnet-4-5', 'credential-id');
|
|
10
|
+
|
|
11
|
+
function createLookupWorkflow() {
|
|
12
|
+
const trigger = new Step({ id: 'lookup-trigger', name: 'Lookup Trigger', type: 'manualTrigger' });
|
|
13
|
+
const lookup = new Step({
|
|
14
|
+
id: 'lookup',
|
|
15
|
+
name: 'Lookup',
|
|
16
|
+
type: 'core.set',
|
|
17
|
+
params: { values: { plan: 'Enterprise' } },
|
|
18
|
+
});
|
|
19
|
+
trigger.connectTo(lookup);
|
|
20
|
+
return new Workflow({ id: 'lookup-workflow', name: 'Lookup Workflow', steps: [trigger, lookup] });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function createAgent() {
|
|
24
|
+
return new MultiAgentEngine({
|
|
25
|
+
id: 'concierge-agent',
|
|
26
|
+
name: 'Concierge Agent',
|
|
27
|
+
role: 'primary',
|
|
28
|
+
description: 'Looks up and reviews account context.',
|
|
29
|
+
systemPrompt: 'Use lookup_account before answering.',
|
|
30
|
+
model: MODEL,
|
|
31
|
+
// This agent uses only its workflow tool, so sandbox tools are unavailable.
|
|
32
|
+
metadata: {
|
|
33
|
+
runtimeDetails: { sandboxProfile: 'default' },
|
|
34
|
+
},
|
|
35
|
+
permissions: { default: { '*': 'deny' } },
|
|
36
|
+
tools: {
|
|
37
|
+
lookup_account: defineWorkflowTool({
|
|
38
|
+
name: 'lookup_account',
|
|
39
|
+
description: 'Looks up account data.',
|
|
40
|
+
workflowId: 'lookup-workflow',
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
secondaryAgents: [],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function createParentWorkflow() {
|
|
48
|
+
const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
|
|
49
|
+
const prepare = new Step({
|
|
50
|
+
id: 'prepare',
|
|
51
|
+
name: 'Prepare',
|
|
52
|
+
type: 'core.set',
|
|
53
|
+
params: {
|
|
54
|
+
values: {
|
|
55
|
+
account: 'Acme',
|
|
56
|
+
nested: { ids: ['={{ $system.execId }}', '={{ $json.account }}'] },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const agent = new Step({
|
|
61
|
+
id: 'agent',
|
|
62
|
+
name: 'Concierge',
|
|
63
|
+
type: 'core.agent',
|
|
64
|
+
params: {
|
|
65
|
+
agentReferenceKey: 'concierge-agent',
|
|
66
|
+
prompt: "Review {{ $('Prepare').json.account }}",
|
|
67
|
+
autoCloseSession: true,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
trigger.connectTo(prepare);
|
|
71
|
+
prepare.connectTo(agent);
|
|
72
|
+
return new Workflow({
|
|
73
|
+
id: 'parent-workflow',
|
|
74
|
+
name: 'Parent Workflow',
|
|
75
|
+
steps: [trigger, prepare, agent],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
createLookupWorkflow();
|
|
80
|
+
createAgent();
|
|
81
|
+
createParentWorkflow();
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Step, Surface, Workflow } from '@culvii/kit';
|
|
2
|
+
|
|
3
|
+
const responseSurface = new Surface({
|
|
4
|
+
id: 'http-response-summary',
|
|
5
|
+
name: 'HTTP Response Summary',
|
|
6
|
+
description: 'Displays an operation status and response body.',
|
|
7
|
+
slot: 'output',
|
|
8
|
+
definition: {
|
|
9
|
+
schema: 'kit.ui/v1',
|
|
10
|
+
root: 'card',
|
|
11
|
+
components: [
|
|
12
|
+
{ id: 'card', type: 'Card', props: { title: 'Operation result' }, children: ['content'] },
|
|
13
|
+
{ id: 'content', type: 'Stack', children: ['status', 'body'] },
|
|
14
|
+
{
|
|
15
|
+
id: 'status',
|
|
16
|
+
type: 'StatusPill',
|
|
17
|
+
props: {
|
|
18
|
+
label: { path: '$output/Fetch Resource/0/statusMessage' },
|
|
19
|
+
status: { path: '$output/Fetch Resource/0/statusCode' },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'body',
|
|
24
|
+
type: 'JsonInspector',
|
|
25
|
+
props: { value: { path: '$output/Fetch Resource/0/body' } },
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
function createWorkflow(id: string, output: 'define' | 'reuse') {
|
|
32
|
+
const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
|
|
33
|
+
const fetch = new Step({
|
|
34
|
+
id: 'fetch',
|
|
35
|
+
name: 'Fetch Resource',
|
|
36
|
+
type: 'core.code',
|
|
37
|
+
params: {
|
|
38
|
+
code: `export default async function main() {
|
|
39
|
+
return { json: { statusCode: 200, statusMessage: 'OK', body: { ready: true } } };
|
|
40
|
+
}`,
|
|
41
|
+
codeType: 'js',
|
|
42
|
+
},
|
|
43
|
+
// One workflow defines and attaches the custom output UI.
|
|
44
|
+
ui:
|
|
45
|
+
output === 'define'
|
|
46
|
+
? { output: responseSurface }
|
|
47
|
+
: {
|
|
48
|
+
// Another workflow can reuse it by key with a safe fallback.
|
|
49
|
+
output: {
|
|
50
|
+
kind: 'custom',
|
|
51
|
+
surfaceKey: responseSurface.id,
|
|
52
|
+
fallbackSurfaceId: 'default.json',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
trigger.connectTo(fetch);
|
|
58
|
+
return new Workflow({
|
|
59
|
+
id,
|
|
60
|
+
name:
|
|
61
|
+
id === 'custom-output-surface-workflow'
|
|
62
|
+
? 'Custom Output Surface Workflow'
|
|
63
|
+
: 'Reused Output Surface Workflow',
|
|
64
|
+
steps: [trigger, fetch],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
createWorkflow('custom-output-surface-workflow', 'define');
|
|
69
|
+
createWorkflow('reused-output-surface-workflow', 'reuse');
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Step, Surface, Workflow } from '@culvii/kit';
|
|
2
|
+
|
|
3
|
+
const approvalSurface = new Surface({
|
|
4
|
+
id: 'expense-approval',
|
|
5
|
+
name: 'Expense Approval',
|
|
6
|
+
description: 'Shows an amount and lets a reviewer approve or reject it.',
|
|
7
|
+
slot: 'wait',
|
|
8
|
+
definition: {
|
|
9
|
+
schema: 'kit.ui/v1',
|
|
10
|
+
root: 'form',
|
|
11
|
+
components: [
|
|
12
|
+
{ id: 'form', type: 'Form', children: ['amount', 'comment', 'decision'] },
|
|
13
|
+
{
|
|
14
|
+
id: 'amount',
|
|
15
|
+
type: 'KeyValue',
|
|
16
|
+
props: {
|
|
17
|
+
entries: [
|
|
18
|
+
{ label: 'Requested amount', value: { path: '$input/Collect Request/0/amount' } },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'comment',
|
|
24
|
+
type: 'TextArea',
|
|
25
|
+
props: { label: 'Reviewer comment', bind: '/$form/comment' },
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'decision',
|
|
29
|
+
type: 'ApproveRejectBar',
|
|
30
|
+
actions: {
|
|
31
|
+
approve: {
|
|
32
|
+
type: 'node.resume',
|
|
33
|
+
payload: {
|
|
34
|
+
approved: { path: '$form/approved', default: true },
|
|
35
|
+
comment: { path: '$form/comment', default: '' },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
reject: {
|
|
39
|
+
type: 'node.stop',
|
|
40
|
+
payload: { reason: { path: '$form/comment', default: 'Rejected by reviewer' } },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
form: {
|
|
46
|
+
fields: [
|
|
47
|
+
{ name: 'comment', label: 'Reviewer comment', type: 'textarea' },
|
|
48
|
+
{ name: 'approved', label: 'Approved', type: 'checkbox' },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
function createApprovalWorkflow(id: string, selection: 'define' | 'reuse', amount: number) {
|
|
55
|
+
const trigger = new Step({ id: 'trigger', name: 'Manual Trigger', type: 'manualTrigger' });
|
|
56
|
+
const collect = new Step({
|
|
57
|
+
id: 'collect',
|
|
58
|
+
name: 'Collect Request',
|
|
59
|
+
type: 'core.set',
|
|
60
|
+
params: { values: { amount, stage: 'awaiting-approval' } },
|
|
61
|
+
});
|
|
62
|
+
const approval = new Step({
|
|
63
|
+
id: 'approval',
|
|
64
|
+
name: 'Approval',
|
|
65
|
+
type: 'core.set',
|
|
66
|
+
params: { values: { reviewer: 'manager' } },
|
|
67
|
+
ui: {
|
|
68
|
+
wait:
|
|
69
|
+
selection === 'define'
|
|
70
|
+
? approvalSurface
|
|
71
|
+
: { kind: 'custom', surfaceKey: approvalSurface.id },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
const result = new Step({
|
|
75
|
+
id: 'result',
|
|
76
|
+
name: 'Persist Decision',
|
|
77
|
+
type: 'core.set',
|
|
78
|
+
params: { values: { approved: "={{ $('Approval').json.approved }}" } },
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
trigger.connectTo(collect);
|
|
82
|
+
collect.connectTo(approval);
|
|
83
|
+
approval.connectTo(result);
|
|
84
|
+
return new Workflow({ id, name: id, steps: [trigger, collect, approval, result] });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// A wait surface automatically sets pauseAfterExecution: true. It can be
|
|
88
|
+
// reused by key in another workflow, and $form is valid only in the wait slot.
|
|
89
|
+
createApprovalWorkflow('manager-approval-workflow', 'define', 450);
|
|
90
|
+
createApprovalWorkflow('finance-approval-workflow', 'reuse', 12000);
|