@lowdefy/docs-content 0.0.0-experimental-20260710073520

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 (304) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +20 -0
  3. package/content/actions/callapi.md +66 -0
  4. package/content/actions/callmethod.md +41 -0
  5. package/content/actions/copytoclipboard.md +32 -0
  6. package/content/actions/displaymessage.md +53 -0
  7. package/content/actions/downloadcsv.md +89 -0
  8. package/content/actions/fetch.md +50 -0
  9. package/content/actions/geolocationcurrentposition.md +56 -0
  10. package/content/actions/link.md +104 -0
  11. package/content/actions/login.md +85 -0
  12. package/content/actions/logout.md +56 -0
  13. package/content/actions/pdfmake.md +304 -0
  14. package/content/actions/request.md +67 -0
  15. package/content/actions/reset.md +27 -0
  16. package/content/actions/resetvalidation.md +85 -0
  17. package/content/actions/scrollto.md +85 -0
  18. package/content/actions/setdarkmode.md +62 -0
  19. package/content/actions/setfocus.md +33 -0
  20. package/content/actions/setglobal.md +63 -0
  21. package/content/actions/setlocale.md +69 -0
  22. package/content/actions/setstate.md +70 -0
  23. package/content/actions/throw.md +72 -0
  24. package/content/actions/validate.md +87 -0
  25. package/content/actions/wait.md +24 -0
  26. package/content/agents/agent-endpoint-tools.md +190 -0
  27. package/content/agents/agent-mcp-tools.md +124 -0
  28. package/content/agents/agent-multi-agent.md +136 -0
  29. package/content/agents/agent-properties.md +174 -0
  30. package/content/agents/agent-server-hooks.md +336 -0
  31. package/content/agents/agentchat.md +515 -0
  32. package/content/agents/agentconversations.md +148 -0
  33. package/content/concepts/ai-agent-docs.md +190 -0
  34. package/content/concepts/cli.md +213 -0
  35. package/content/concepts/connections-and-requests.md +7 -0
  36. package/content/concepts/custom-html.md +3 -0
  37. package/content/concepts/custom-styling.md +161 -0
  38. package/content/concepts/events-and-actions.md +271 -0
  39. package/content/concepts/hosting-files.md +18 -0
  40. package/content/concepts/i18n.md +320 -0
  41. package/content/concepts/keyboard-shortcuts.md +218 -0
  42. package/content/concepts/layout-overview.md +478 -0
  43. package/content/concepts/lists.md +144 -0
  44. package/content/concepts/logger.md +43 -0
  45. package/content/concepts/lowdefy-schema.md +365 -0
  46. package/content/concepts/menus.md +144 -0
  47. package/content/concepts/module-authoring.md +564 -0
  48. package/content/concepts/modules.md +338 -0
  49. package/content/concepts/operators.md +45 -0
  50. package/content/concepts/overview.md +19 -0
  51. package/content/concepts/references-and-templates.md +207 -0
  52. package/content/concepts/secrets.md +24 -0
  53. package/content/concepts/selectors.md +143 -0
  54. package/content/connections/amazonredshift.md +176 -0
  55. package/content/connections/anthropic.md +232 -0
  56. package/content/connections/awss3.md +313 -0
  57. package/content/connections/azureblobstorage.md +133 -0
  58. package/content/connections/elasticsearch.md +371 -0
  59. package/content/connections/google.md +228 -0
  60. package/content/connections/googlecloudstorage.md +139 -0
  61. package/content/connections/googlesheet.md +313 -0
  62. package/content/connections/knex.md +206 -0
  63. package/content/connections/mariadb.md +177 -0
  64. package/content/connections/mcp.md +134 -0
  65. package/content/connections/mongodb.md +739 -0
  66. package/content/connections/mssql.md +191 -0
  67. package/content/connections/mysql.md +192 -0
  68. package/content/connections/openai-connection.md +228 -0
  69. package/content/connections/postgresql.md +200 -0
  70. package/content/connections/redis.md +116 -0
  71. package/content/connections/sendgridmail.md +94 -0
  72. package/content/connections/smtp.md +149 -0
  73. package/content/connections/sqlite.md +187 -0
  74. package/content/connections/stripe.md +115 -0
  75. package/content/container-blocks/affix.md +413 -0
  76. package/content/container-blocks/alert.md +937 -0
  77. package/content/container-blocks/badge.md +1222 -0
  78. package/content/container-blocks/box.md +1453 -0
  79. package/content/container-blocks/card.md +1200 -0
  80. package/content/container-blocks/carousel.md +2247 -0
  81. package/content/container-blocks/collapse.md +1335 -0
  82. package/content/container-blocks/configprovider.md +1070 -0
  83. package/content/container-blocks/confirmmodal.md +1159 -0
  84. package/content/container-blocks/content.md +597 -0
  85. package/content/container-blocks/descriptions.md +870 -0
  86. package/content/container-blocks/drawer.md +1379 -0
  87. package/content/container-blocks/dropdownmenu.md +643 -0
  88. package/content/container-blocks/flex.md +1510 -0
  89. package/content/container-blocks/footer.md +380 -0
  90. package/content/container-blocks/googlemaps.md +546 -0
  91. package/content/container-blocks/googlemapsheatmap.md +607 -0
  92. package/content/container-blocks/googlemapsscript.md +61 -0
  93. package/content/container-blocks/header.md +302 -0
  94. package/content/container-blocks/label.md +739 -0
  95. package/content/container-blocks/layout.md +604 -0
  96. package/content/container-blocks/masonry.md +1090 -0
  97. package/content/container-blocks/mobilemenu.md +1244 -0
  98. package/content/container-blocks/modal.md +1180 -0
  99. package/content/container-blocks/pageheadermenu.md +614 -0
  100. package/content/container-blocks/pagesidebarlayout.md +438 -0
  101. package/content/container-blocks/pagesidermenu.md +651 -0
  102. package/content/container-blocks/popover.md +1421 -0
  103. package/content/container-blocks/result.md +972 -0
  104. package/content/container-blocks/sider.md +1064 -0
  105. package/content/container-blocks/span.md +747 -0
  106. package/content/container-blocks/spinner.md +267 -0
  107. package/content/container-blocks/splitter.md +1735 -0
  108. package/content/container-blocks/tabs.md +1718 -0
  109. package/content/container-blocks/tooltip.md +1274 -0
  110. package/content/container-blocks/watermark.md +515 -0
  111. package/content/controls/for.md +103 -0
  112. package/content/controls/if.md +107 -0
  113. package/content/controls/log.md +50 -0
  114. package/content/controls/parallel.md +71 -0
  115. package/content/controls/parallel_for.md +36 -0
  116. package/content/controls/reject.md +56 -0
  117. package/content/controls/return.md +66 -0
  118. package/content/controls/set_state.md +98 -0
  119. package/content/controls/switch.md +90 -0
  120. package/content/controls/throw.md +79 -0
  121. package/content/controls/try.md +88 -0
  122. package/content/deployment/docker.md +149 -0
  123. package/content/deployment/node-server.md +27 -0
  124. package/content/deployment/vercel.md +101 -0
  125. package/content/display-blocks/aggrid.md +1459 -0
  126. package/content/display-blocks/anchor.md +336 -0
  127. package/content/display-blocks/avatar.md +1154 -0
  128. package/content/display-blocks/breadcrumb.md +517 -0
  129. package/content/display-blocks/button.md +758 -0
  130. package/content/display-blocks/calendar.md +156 -0
  131. package/content/display-blocks/dangeroushtml.md +314 -0
  132. package/content/display-blocks/dangerousmarkdown.md +423 -0
  133. package/content/display-blocks/diffgit.md +44 -0
  134. package/content/display-blocks/difflist.md +225 -0
  135. package/content/display-blocks/diffsidebyside.md +56 -0
  136. package/content/display-blocks/difftimeline.md +94 -0
  137. package/content/display-blocks/divider.md +406 -0
  138. package/content/display-blocks/download.md +60 -0
  139. package/content/display-blocks/dropdownbutton.md +661 -0
  140. package/content/display-blocks/echart.md +418 -0
  141. package/content/display-blocks/floatbutton.md +545 -0
  142. package/content/display-blocks/html.md +311 -0
  143. package/content/display-blocks/icon.md +717 -0
  144. package/content/display-blocks/img.md +479 -0
  145. package/content/display-blocks/markdown.md +520 -0
  146. package/content/display-blocks/markdownwithcode.md +730 -0
  147. package/content/display-blocks/menu.md +1123 -0
  148. package/content/display-blocks/message.md +941 -0
  149. package/content/display-blocks/notification.md +1410 -0
  150. package/content/display-blocks/paragraph.md +643 -0
  151. package/content/display-blocks/progress.md +818 -0
  152. package/content/display-blocks/qrcode.md +519 -0
  153. package/content/display-blocks/s3download.md +240 -0
  154. package/content/display-blocks/search.md +360 -0
  155. package/content/display-blocks/skeleton.md +272 -0
  156. package/content/display-blocks/skeletonavatar.md +222 -0
  157. package/content/display-blocks/skeletonbutton.md +245 -0
  158. package/content/display-blocks/skeletoninput.md +223 -0
  159. package/content/display-blocks/skeletonparagraph.md +201 -0
  160. package/content/display-blocks/statistic.md +485 -0
  161. package/content/display-blocks/steps.md +585 -0
  162. package/content/display-blocks/tag.md +620 -0
  163. package/content/display-blocks/title.md +654 -0
  164. package/content/display-blocks/tour.md +2359 -0
  165. package/content/input-blocks/autocomplete.md +786 -0
  166. package/content/input-blocks/buttonselector.md +964 -0
  167. package/content/input-blocks/checkboxselector.md +765 -0
  168. package/content/input-blocks/checkboxswitch.md +497 -0
  169. package/content/input-blocks/colorselector.md +884 -0
  170. package/content/input-blocks/daterangeselector.md +777 -0
  171. package/content/input-blocks/dateselector.md +693 -0
  172. package/content/input-blocks/datetimeselector.md +791 -0
  173. package/content/input-blocks/inputgallery.md +528 -0
  174. package/content/input-blocks/monthselector.md +717 -0
  175. package/content/input-blocks/multipleselector.md +1337 -0
  176. package/content/input-blocks/numberinput.md +855 -0
  177. package/content/input-blocks/pagination.md +679 -0
  178. package/content/input-blocks/paragraphinput.md +1664 -0
  179. package/content/input-blocks/passwordinput.md +480 -0
  180. package/content/input-blocks/phonenumberinput.md +688 -0
  181. package/content/input-blocks/radioselector.md +820 -0
  182. package/content/input-blocks/ratingslider.md +684 -0
  183. package/content/input-blocks/s3uploadbutton.md +384 -0
  184. package/content/input-blocks/s3uploaddragger.md +305 -0
  185. package/content/input-blocks/s3uploadphoto.md +288 -0
  186. package/content/input-blocks/segmentedselector.md +782 -0
  187. package/content/input-blocks/selector.md +1162 -0
  188. package/content/input-blocks/switch.md +552 -0
  189. package/content/input-blocks/textarea.md +714 -0
  190. package/content/input-blocks/textinput.md +639 -0
  191. package/content/input-blocks/tiptapinput.md +226 -0
  192. package/content/input-blocks/tiptapmentioninput.md +471 -0
  193. package/content/input-blocks/titleinput.md +1094 -0
  194. package/content/input-blocks/treeinput.md +144 -0
  195. package/content/input-blocks/treemultipleselector.md +162 -0
  196. package/content/input-blocks/treeselector.md +185 -0
  197. package/content/input-blocks/upload.md +149 -0
  198. package/content/input-blocks/uploaddragger.md +85 -0
  199. package/content/input-blocks/uploadphoto.md +84 -0
  200. package/content/input-blocks/weekselector.md +630 -0
  201. package/content/list-blocks/controlledlist.md +498 -0
  202. package/content/list-blocks/list.md +529 -0
  203. package/content/list-blocks/listselector.md +301 -0
  204. package/content/list-blocks/masonrylist.md +230 -0
  205. package/content/migration/upgrade-guide.md +106 -0
  206. package/content/migration/v4-to-v5.md +589 -0
  207. package/content/migration/v5-to-v6.md +36 -0
  208. package/content/operators/_actions.md +58 -0
  209. package/content/operators/_and.md +76 -0
  210. package/content/operators/_api.md +254 -0
  211. package/content/operators/_app.md +114 -0
  212. package/content/operators/_args.md +65 -0
  213. package/content/operators/_array.md +331 -0
  214. package/content/operators/_base64.md +49 -0
  215. package/content/operators/_boolean.md +33 -0
  216. package/content/operators/_build.md +166 -0
  217. package/content/operators/_change_case.md +357 -0
  218. package/content/operators/_date.md +415 -0
  219. package/content/operators/_dayjs.md +128 -0
  220. package/content/operators/_diff.md +61 -0
  221. package/content/operators/_divide.md +32 -0
  222. package/content/operators/_eq.md +52 -0
  223. package/content/operators/_event.md +86 -0
  224. package/content/operators/_function.md +52 -0
  225. package/content/operators/_get.md +92 -0
  226. package/content/operators/_global.md +86 -0
  227. package/content/operators/_gt.md +50 -0
  228. package/content/operators/_gte.md +50 -0
  229. package/content/operators/_hash.md +112 -0
  230. package/content/operators/_if.md +30 -0
  231. package/content/operators/_if_none.md +47 -0
  232. package/content/operators/_index.md +48 -0
  233. package/content/operators/_input.md +86 -0
  234. package/content/operators/_intl.md +135 -0
  235. package/content/operators/_item.md +166 -0
  236. package/content/operators/_js.md +113 -0
  237. package/content/operators/_json.md +120 -0
  238. package/content/operators/_jsonata.md +152 -0
  239. package/content/operators/_locale.md +65 -0
  240. package/content/operators/_location.md +40 -0
  241. package/content/operators/_log.md +22 -0
  242. package/content/operators/_lt.md +50 -0
  243. package/content/operators/_lte.md +50 -0
  244. package/content/operators/_math.md +407 -0
  245. package/content/operators/_media.md +83 -0
  246. package/content/operators/_menu.md +62 -0
  247. package/content/operators/_module.md +340 -0
  248. package/content/operators/_mql.md +95 -0
  249. package/content/operators/_ne.md +62 -0
  250. package/content/operators/_not.md +33 -0
  251. package/content/operators/_number.md +159 -0
  252. package/content/operators/_nunjucks.md +117 -0
  253. package/content/operators/_object.md +253 -0
  254. package/content/operators/_operator.md +33 -0
  255. package/content/operators/_or.md +67 -0
  256. package/content/operators/_product.md +45 -0
  257. package/content/operators/_random.md +90 -0
  258. package/content/operators/_ref.md +80 -0
  259. package/content/operators/_regex.md +69 -0
  260. package/content/operators/_request.md +35 -0
  261. package/content/operators/_request_details.md +29 -0
  262. package/content/operators/_secret.md +56 -0
  263. package/content/operators/_state.md +134 -0
  264. package/content/operators/_step.md +98 -0
  265. package/content/operators/_string.md +327 -0
  266. package/content/operators/_subtract.md +24 -0
  267. package/content/operators/_sum.md +45 -0
  268. package/content/operators/_switch.md +37 -0
  269. package/content/operators/_t.md +96 -0
  270. package/content/operators/_theme.md +65 -0
  271. package/content/operators/_type.md +78 -0
  272. package/content/operators/_uri.md +49 -0
  273. package/content/operators/_url_query.md +92 -0
  274. package/content/operators/_user.md +154 -0
  275. package/content/operators/_uuid.md +118 -0
  276. package/content/operators/_var.md +88 -0
  277. package/content/operators/_yaml.md +96 -0
  278. package/content/other/introduction.md +39 -0
  279. package/content/other/next-auth-providers.md +3 -0
  280. package/content/other/updatesession.md +26 -0
  281. package/content/plugins/plugins-actions.md +80 -0
  282. package/content/plugins/plugins-connections.md +98 -0
  283. package/content/plugins/plugins-dev.md +138 -0
  284. package/content/plugins/plugins-introduction.md +29 -0
  285. package/content/plugins/plugins-operators.md +71 -0
  286. package/content/testing/e2e-auth.md +108 -0
  287. package/content/testing/e2e-configuration.md +107 -0
  288. package/content/testing/e2e-getting-started.md +96 -0
  289. package/content/testing/e2e-introduction.md +53 -0
  290. package/content/testing/e2e-mocking.md +155 -0
  291. package/content/testing/e2e-writing-tests.md +214 -0
  292. package/content/tutorial/tutorial-actions-operators.md +222 -0
  293. package/content/tutorial/tutorial-add-blocks.md +86 -0
  294. package/content/tutorial/tutorial-create-page.md +57 -0
  295. package/content/tutorial/tutorial-display-data-page.md +181 -0
  296. package/content/tutorial/tutorial-next-steps.md +53 -0
  297. package/content/tutorial/tutorial-requests-sql.md +22 -0
  298. package/content/tutorial/tutorial-start.md +71 -0
  299. package/content/user-authentication/auth-providers.md +15 -0
  300. package/content/user-authentication/login-and-logout.md +122 -0
  301. package/content/user-authentication/users-introduction.md +31 -0
  302. package/index.json +2281 -0
  303. package/package.json +34 -0
  304. package/scripts/extractAgentDocs.js +130 -0
@@ -0,0 +1,143 @@
1
+ # Driving Selectors
2
+
3
+ Selector blocks — `Selector`, `MultipleSelector`, `ButtonSelector`, `RadioSelector`,
4
+ `CheckboxSelector`, `SegmentedSelector` and the list-style `ListSelector` — can be driven
5
+ two ways. Both produce the same kind of value in [`state`](/page-and-app-state); pick the
6
+ one that fits where your data comes from.
7
+
8
+ ## Way 1 — `options` (label / value pairs)
9
+
10
+ Provide an array of primitives, or `{ label, value }` objects. The `value` is stored in
11
+ state and the `label` is shown to the user. This is ideal when you write the options by
12
+ hand, but when the data comes from a [request](/connections-and-requests) you usually have
13
+ to build the `label` and `value` fields in the query first.
14
+
15
+ ```yaml
16
+ id: plan
17
+ type: Selector
18
+ properties:
19
+ options:
20
+ - label: Starter
21
+ value: 1
22
+ - label: Pro
23
+ value: 2
24
+ - label: Enterprise
25
+ value: 3
26
+ ```
27
+
28
+ ## Way 2 — `data` + `html`
29
+
30
+ Pass the raw rows in `data` and render each option's label with an `html`
31
+ [Nunjucks](/custom-html) template. There's no need to reshape the data into label/value
32
+ pairs — point the selector straight at a request's results.
33
+
34
+ - **`html`** — the template for each option label. The context exposes `item` (the row)
35
+ and `index`.
36
+ - **`valueKey`** — the field stored as the value when an option is selected. Omit it to
37
+ store the whole row.
38
+ - **`primaryKey`** — the field used to match the current value back to an option for
39
+ highlighting. Defaults to `valueKey`; set it when you store the whole row but a single
40
+ field (such as `id`) uniquely identifies it.
41
+
42
+ ```yaml
43
+ id: plan
44
+ type: Selector
45
+ properties:
46
+ data:
47
+ - id: 1
48
+ name: Starter
49
+ - id: 2
50
+ name: Pro
51
+ - id: 3
52
+ name: Enterprise
53
+ html: '{{ item.name }}'
54
+ valueKey: id
55
+ ```
56
+
57
+ With `valueKey: id`, selecting "Pro" sets `state.plan` to `2`.
58
+
59
+ ## Tree selectors
60
+
61
+ `TreeSelector` (single) and `TreeMultipleSelector` (multiple) are searchable dropdowns that
62
+ present the options as a tree. They use the same model plus a **`parentKey`**: build a flat
63
+ `data`/`options` array where each row has a `primaryKey` (its own id) and a `parentKey`
64
+ whose value equals the parent row's `primaryKey`. Rows whose `parentKey` is empty or points
65
+ at no row become tree roots. `valueKey` is still the stored value; `primaryKey`/`parentKey`
66
+ only build the hierarchy.
67
+
68
+ ```yaml
69
+ id: category
70
+ type: TreeSelector
71
+ properties:
72
+ primaryKey: id
73
+ parentKey: parentId
74
+ valueKey: id
75
+ html: '{{ item.label }}'
76
+ data:
77
+ - { id: 1, label: Electronics }
78
+ - { id: 2, label: Phones, parentId: 1 }
79
+ - { id: 3, label: Laptops, parentId: 1 }
80
+ ```
81
+
82
+ (The `TreeInput` block is a different, inline antd `Tree` — not a dropdown.)
83
+
84
+ ## Controlling the selection from state
85
+
86
+ Because the value lives in state under the block's id, you can drive the selection with
87
+ [`SetState`](/SetState). The selector highlights the option whose `primaryKey` (or
88
+ `valueKey`) matches the value you set.
89
+
90
+ ```yaml
91
+ id: select_pro
92
+ type: Button
93
+ events:
94
+ onClick:
95
+ - id: select_pro
96
+ type: SetState
97
+ params:
98
+ plan: 2 # highlights the "Pro" option
99
+ ```
100
+
101
+ For the multi-value selectors (`MultipleSelector`, `CheckboxSelector`) the value is an
102
+ array of keys, so `SetState` with `[1, 3]` selects those two options.
103
+
104
+ ## Large datasets — the `setData` method
105
+
106
+ Anything placed in a block's `properties` (including `data` and `options`) is re-parsed
107
+ and re-serialized by the engine on **every** update cycle — once per keystroke, anywhere
108
+ on the page. For a few hundred rows that's fine, but a selector holding tens of thousands
109
+ of rows in `properties` makes the whole page feel sluggish.
110
+
111
+ Every selector exposes a **`setData`** method instead. Call it with
112
+ [`CallMethod`](/CallMethod) from the block's **`onMount`** event — after a request has
113
+ loaded the rows — to push the dataset straight into the block. The data is held inside the
114
+ block and never enters `properties`, so the engine has nothing large to parse or
115
+ serialize: other inputs on the page stay responsive no matter how big the list is.
116
+ `ListSelector` additionally virtualises its rows, so only the visible cards are ever in
117
+ the DOM.
118
+
119
+ Use the block's `onMount` (not the page's `onInit`): `onInit` runs before any block has
120
+ mounted, so the `setData` method does not exist yet.
121
+
122
+ ```yaml
123
+ id: people
124
+ type: ListSelector
125
+ properties:
126
+ valueKey: id
127
+ html: '{{ item.name }}'
128
+ events:
129
+ onMount:
130
+ - id: load_rows
131
+ type: Request
132
+ params: get_rows
133
+ - id: fill
134
+ type: CallMethod
135
+ params:
136
+ blockId: people
137
+ method: setData
138
+ args:
139
+ - _request: get_rows
140
+ ```
141
+
142
+ The selector still falls back to `properties.data` / `properties.options` until `setData`
143
+ is called, so small lists need no extra wiring.
@@ -0,0 +1,176 @@
1
+ # Amazon Redshift
2
+
3
+ The [Knex](/Knex) connection can be used to connect to a [Amazon Redshift](https://aws.amazon.com/redshift) database.
4
+
5
+ ## Connections
6
+
7
+ Connection types:
8
+ - Knex
9
+
10
+ ### Knex
11
+
12
+ #### Properties
13
+ - `client: enum`: __Required__ - Should be `redshift` to connect to Amazon Redshift.
14
+ - `connection: object | string`: __Required__ - Connection string or object to pass to the [`pg`](https://www.npmjs.com/package/pg) database client.
15
+ - `useNullAsDefault: boolean`: If true, undefined keys are replaced with NULL instead of DEFAULT.
16
+
17
+ #### Examples
18
+
19
+ ###### Connection object:
20
+ ```yaml
21
+ connections:
22
+ - id: redshift
23
+ type: Knex
24
+ properties:
25
+ client: redshift
26
+ connection:
27
+ host:
28
+ _secret: REDSHIFT_HOST
29
+ database:
30
+ _secret: REDSHIFT_DB
31
+ user:
32
+ _secret: REDSHIFT_USER
33
+ password:
34
+ _secret: REDSHIFT_PASSWORD
35
+ ```
36
+ Environment variables:
37
+ ```
38
+ LOWDEFY_SECRET_REDSHIFT_HOST = examplecluster.XXXXXXXXXXXX.us-west-2.redshift.amazonaws.com
39
+ LOWDEFY_SECRET_REDSHIFT_REDSHIFT_DB = db
40
+ LOWDEFY_SECRET_REDSHIFT_USER = user
41
+ LOWDEFY_SECRET_REDSHIFT_PASSWORD = password
42
+ ```
43
+
44
+ ## Requests
45
+
46
+ Request types:
47
+
48
+ - KnexBuilder
49
+ - KnexRaw
50
+
51
+ ### KnexBuilder
52
+
53
+ #### Properties
54
+
55
+ - `query: object[]`: **Required** - SQL query builder array. An array of objects, with a single key which is the name of the knex builder function. The value should be an array of arguments to pass to the builder function.
56
+ - `tableName: string | object`: The name of the table to query from.
57
+
58
+ #### Examples
59
+
60
+ ###### Build a query:
61
+
62
+ ```yaml
63
+ id: knexBuilder
64
+ type: KnexBuilder
65
+ connectionId: knex
66
+ payload:
67
+ name:
68
+ _state: name
69
+ properties:
70
+ query:
71
+ - select:
72
+ - '*'
73
+ - from:
74
+ - users
75
+ - where:
76
+ - name
77
+ - _payload: name
78
+ ```
79
+
80
+ ###### Using `tableName`:
81
+
82
+ ```yaml
83
+ id: knexBuilder
84
+ type: KnexBuilder
85
+ connectionId: knex
86
+ payload:
87
+ name:
88
+ _state: name
89
+ properties:
90
+ tableName: users
91
+ query:
92
+ - select:
93
+ - '*'
94
+ - where:
95
+ - name
96
+ - _payload: name
97
+ ```
98
+
99
+ ###### Aliases:
100
+
101
+ ```yaml
102
+ id: knexBuilder
103
+ type: KnexBuilder
104
+ connectionId: knex
105
+ properties:
106
+ tableName:
107
+ a: tableA
108
+ b: tableB
109
+ query:
110
+ - select:
111
+ - aField: 'a.field'
112
+ - bField: 'b.field'
113
+ - limit:
114
+ - 1
115
+ ```
116
+
117
+ ### KnexRaw
118
+
119
+ #### Properties
120
+
121
+ - `query: string`: **Required** - SQL query string.
122
+ - `parameters: string | number | array | object`: SQL query parameters.
123
+
124
+ #### Examples
125
+
126
+ ###### Simple raw query:
127
+
128
+ ```yaml
129
+ id: knexRaw
130
+ type: KnexRaw
131
+ connectionId: knex
132
+ properties:
133
+ query: SELECT * FROM "my_table";
134
+ ```
135
+
136
+ ###### Query with named parameters:
137
+
138
+ ```yaml
139
+ id: knexRaw
140
+ type: KnexRaw
141
+ connectionId: knex
142
+ payload:
143
+ selected_name:
144
+ _state: selected_name
145
+ properties:
146
+ query: select * from users where name = :name
147
+ parameters:
148
+ name:
149
+ _payload: selected_name
150
+ ```
151
+
152
+ ###### Query with positional parameters:
153
+
154
+ ```yaml
155
+ id: knexRaw
156
+ type: KnexRaw
157
+ connectionId: knex
158
+ payload:
159
+ selected_name:
160
+ _state: selected_name
161
+ properties:
162
+ query: select * from users where name = ?
163
+ parameters:
164
+ - _payload: selected_name
165
+ ```
166
+
167
+ ###### Reference a `.sql` file:
168
+
169
+ ```yaml
170
+ id: knexRaw
171
+ type: KnexRaw
172
+ connectionId: knex
173
+ properties:
174
+ query:
175
+ _ref: my_query.sql
176
+ ```
@@ -0,0 +1,232 @@
1
+ # Anthropic
2
+
3
+ The Anthropic connection connects to the [Anthropic API](https://docs.anthropic.com/) and provides the `ClaudeAgent` agent type for use with [Lowdefy agents](/agents-introduction).
4
+
5
+ > The Anthropic connection is provided by the `@lowdefy/connection-anthropic` package, which is included by default.
6
+
7
+ ## Connections
8
+
9
+ ### Anthropic
10
+
11
+ #### Properties
12
+ - `apiKey: string`: __Required__ - Anthropic API key. Use [`_secret`](/_secret) to reference this securely.
13
+ - `baseURL: string`: Optional base URL for the Anthropic API. Use this to connect to a proxy or compatible endpoint.
14
+
15
+ ###### Connection example:
16
+ ```yaml
17
+ connections:
18
+ - id: anthropic
19
+ type: Anthropic
20
+ properties:
21
+ apiKey:
22
+ _secret: ANTHROPIC_API_KEY
23
+ ```
24
+
25
+ ## Agent Types
26
+
27
+ ### ClaudeAgent
28
+
29
+ The `ClaudeAgent` supports all [common agent properties](/agents-introduction) plus the following:
30
+
31
+ | Property | Type | Description |
32
+ | --- | --- | --- |
33
+ | `thinking` | object | Extended thinking configuration. The model shows its reasoning before responding. |
34
+ | `thinking.type` | string | Set to `'enabled'` to turn on extended thinking. |
35
+ | `thinking.budgetTokens` | integer | Maximum tokens the model can use for thinking. |
36
+ | `effort` | string | Thinking effort level: `'low'`, `'medium'`, or `'high'`. Simpler alternative to `thinking`. |
37
+
38
+ > Use `effort` for a simple control or `thinking` for fine-grained token budget control — not both at the same time.
39
+
40
+ ###### Agent with extended thinking:
41
+ ```yaml
42
+ connections:
43
+ - id: anthropic
44
+ type: Anthropic
45
+ properties:
46
+ apiKey:
47
+ _secret: ANTHROPIC_API_KEY
48
+
49
+ agents:
50
+ - id: analyst
51
+ type: ClaudeAgent
52
+ connectionId: anthropic
53
+ properties:
54
+ model: claude-sonnet-4-20250514
55
+ thinking:
56
+ type: enabled
57
+ budgetTokens: 10000
58
+ instructions: |
59
+ You are a data analyst. Think carefully through each
60
+ question before answering. Show your reasoning.
61
+ maxSteps: 8
62
+ tools:
63
+ - query-analytics
64
+ - get-dashboard-data
65
+ ```
66
+
67
+ ###### Agent with effort level:
68
+ ```yaml
69
+ agents:
70
+ - id: support_agent
71
+ type: ClaudeAgent
72
+ connectionId: anthropic
73
+ properties:
74
+ model: claude-sonnet-4-20250514
75
+ effort: high
76
+ instructions: |
77
+ You are a customer support agent. Search the knowledge
78
+ base before answering questions. Be concise and friendly.
79
+ maxSteps: 5
80
+ temperature: 0.3
81
+ tools:
82
+ - search-knowledge-base
83
+ - get-account-info
84
+ - endpointId: create-ticket
85
+ confirm: true
86
+ ```
87
+
88
+ ## Requests
89
+
90
+ Request types:
91
+
92
+ - GenerateText
93
+ - GenerateObject
94
+
95
+ All AI provider connections (`Anthropic`, `OpenAI`, `Google`, `AIGateway`) provide the same `GenerateText` and `GenerateObject` request types — the `connectionId` selects the provider. These make a single, one-shot model call and return the result. They can be used as page requests, or as steps in [API endpoint routines](/api) — useful for classify, extract, summarize, or decide steps where the surrounding logic stays in your routine.
96
+
97
+ For multi-step tool use, see [agents](/agents-introduction) instead.
98
+
99
+ ### GenerateText
100
+
101
+ Generates text from a prompt.
102
+
103
+ #### Properties
104
+
105
+ - `model: string`: **Required** - Model id to generate with.
106
+ - `prompt: string`: Text prompt. Use either `prompt` or `messages`, not both.
107
+ - `messages: object[]`: Model messages (`{ role, content }`). Use either `prompt` or `messages`, not both.
108
+ - `system: string`: System prompt.
109
+ - `maxOutputTokens: number`: Maximum number of tokens to generate.
110
+ - `temperature: number`: Sampling temperature (0 to 2).
111
+ - `topP: number`: Nucleus sampling.
112
+ - `topK: number`: Only sample from the top K options for each subsequent token.
113
+ - `frequencyPenalty: number`: Penalize repeated tokens by frequency.
114
+ - `presencePenalty: number`: Penalize tokens that have already appeared.
115
+ - `seed: number`: Seed for deterministic sampling, if supported by the model.
116
+ - `stopSequences: string[]`: Sequences that stop generation.
117
+ - `maxRetries: number`: Maximum number of retries. Defaults to 2.
118
+ - `providerOptions: object`: Provider-specific options, keyed by provider (e.g. `anthropic`, `openai`, `google`).
119
+
120
+ #### Response
121
+
122
+ ```yaml
123
+ text: string # The generated text.
124
+ reasoningText: string # Reasoning text, when the model produced any.
125
+ finishReason: string # 'stop', 'length', 'content-filter', ...
126
+ usage: object # Token usage ({ inputTokens, outputTokens, totalTokens, ... }).
127
+ providerMetadata: object # Provider-specific metadata, when returned.
128
+ warnings: array # Call warnings from the provider, when returned.
129
+ ```
130
+
131
+ #### Examples
132
+
133
+ ###### Summarize text in an API endpoint routine:
134
+
135
+ ```yaml
136
+ api:
137
+ - id: summarize-text
138
+ type: Api
139
+ routine:
140
+ - id: summarize
141
+ type: GenerateText
142
+ connectionId: claude
143
+ properties:
144
+ model: claude-haiku-4-5
145
+ system: You are a concise summarizer.
146
+ prompt:
147
+ _payload: text
148
+ - ':return':
149
+ summary:
150
+ _step: summarize.text
151
+ ```
152
+
153
+ ###### Text generation as a page request:
154
+
155
+ ```yaml
156
+ requests:
157
+ - id: generate_reply
158
+ type: GenerateText
159
+ connectionId: claude
160
+ payload:
161
+ message:
162
+ _state: customer_message
163
+ properties:
164
+ model: claude-haiku-4-5
165
+ system: Draft a friendly reply to the customer message.
166
+ prompt:
167
+ _payload: message
168
+ ```
169
+
170
+ ### GenerateObject
171
+
172
+ Generates a structured object matching a JSON Schema. Ideal for classification, extraction, and routing decisions — the result lands in `_step` (or `_request`) as plain data your config can act on.
173
+
174
+ #### Properties
175
+
176
+ Takes the same properties as `GenerateText`, except `stopSequences`, plus:
177
+
178
+ - `schema: object`: **Required** - JSON Schema describing the object the model must generate.
179
+ - `schemaName: string`: Optional name for the output schema, passed to the model.
180
+ - `schemaDescription: string`: Optional description of the output schema, passed to the model.
181
+
182
+ #### Response
183
+
184
+ ```yaml
185
+ object: object # The generated object, matching the schema.
186
+ reasoningText: string # Reasoning text, when the model produced any.
187
+ finishReason: string # 'stop', 'length', 'content-filter', ...
188
+ usage: object # Token usage ({ inputTokens, outputTokens, totalTokens, ... }).
189
+ providerMetadata: object # Provider-specific metadata, when returned.
190
+ warnings: array # Call warnings from the provider, when returned.
191
+ ```
192
+
193
+ #### Examples
194
+
195
+ ###### Classify then route in an API endpoint routine:
196
+
197
+ ```yaml
198
+ api:
199
+ - id: triage-ticket
200
+ type: Api
201
+ routine:
202
+ - id: classify
203
+ type: GenerateObject
204
+ connectionId: claude
205
+ properties:
206
+ model: claude-haiku-4-5
207
+ prompt:
208
+ _payload: ticket_text
209
+ schema:
210
+ type: object
211
+ properties:
212
+ category:
213
+ type: string
214
+ enum:
215
+ - billing
216
+ - technical
217
+ - other
218
+ urgent:
219
+ type: boolean
220
+ - ':if':
221
+ _eq:
222
+ - _step: classify.object.urgent
223
+ - true
224
+ ':then':
225
+ - id: escalate
226
+ type: CallApi
227
+ properties:
228
+ endpointId: escalate-ticket
229
+ payload:
230
+ category:
231
+ _step: classify.object.category
232
+ ```