@shwfed/config 2.11.5 → 2.12.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.
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +13 -7
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/config.vue +1 -0
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +13 -7
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +13 -7
- package/dist/runtime/components/actions/config.vue +2 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.d.ts +13 -7
- package/dist/runtime/components/actions/schema.d.ts +82 -52
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +5 -5
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.d.ts +13 -7
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +62 -38
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.d.ts +26 -14
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +39 -21
- package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.d.ts +13 -7
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.d.ts +26 -14
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts +44 -26
- package/dist/runtime/components/config/schema.d.ts +13 -7
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.d.ts +26 -14
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +57 -33
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +52 -28
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +18 -12
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +65 -35
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +91 -49
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +91 -49
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +39 -21
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +39 -21
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +57 -33
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +65 -35
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +65 -35
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +104 -56
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +65 -35
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +91 -49
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +91 -49
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +39 -21
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.d.ts +13 -7
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +91 -49
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +65 -35
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +169 -91
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +169 -91
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +78 -42
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +130 -70
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +130 -70
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.d.ts +26 -14
- package/dist/runtime/components/form/utils/common.d.ts +26 -14
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +13 -7
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.d.ts +13 -7
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.d.ts +13 -7
- package/dist/runtime/components/table/ai-generate.d.vue.ts +16 -0
- package/dist/runtime/components/table/ai-generate.system.d.ts +1 -0
- package/dist/runtime/components/table/ai-generate.system.js +10 -0
- package/dist/runtime/components/table/ai-generate.system.md +95 -0
- package/dist/runtime/components/table/ai-generate.vue +172 -0
- package/dist/runtime/components/table/ai-generate.vue.d.ts +16 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +18 -12
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/runtime.vue +3 -4
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +3 -3
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.d.ts +39 -21
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +5 -6
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue +5 -6
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +26 -14
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +91 -49
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +44 -26
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +44 -26
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +91 -49
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +91 -49
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +91 -49
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +65 -35
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.d.ts +65 -35
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +156 -84
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +65 -35
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +65 -35
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.d.ts +117 -63
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.d.ts +117 -63
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/runtime.vue +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.d.ts +52 -28
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +3 -3
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +70 -40
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/runtime.vue +4 -4
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +78 -42
- package/dist/runtime/components/table/config.d.vue.ts +3 -3
- package/dist/runtime/components/table/config.vue +38 -3
- package/dist/runtime/components/table/config.vue.d.ts +3 -3
- package/dist/runtime/components/table/row-provider.vue +2 -2
- package/dist/runtime/components/table/schema.d.ts +114 -66
- package/dist/runtime/components/table/utils/ai-tools.d.ts +11 -0
- package/dist/runtime/components/table/utils/ai-tools.js +458 -0
- package/dist/runtime/components/table/utils/resolve.d.ts +23 -0
- package/dist/runtime/components/table/utils/resolve.js +3 -0
- package/dist/runtime/components/table/utils/shared.d.ts +65 -35
- package/dist/runtime/components/table/utils/shared.js +16 -17
- package/dist/runtime/components/ui/alert-dialog/AlertDialogFooter.vue +1 -1
- package/dist/runtime/components/ui/chat/ChatMessage.d.vue.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatMessage.vue +35 -0
- package/dist/runtime/components/ui/chat/ChatMessage.vue.d.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatMessagePart.d.vue.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatMessagePart.vue +43 -0
- package/dist/runtime/components/ui/chat/ChatMessagePart.vue.d.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatMessages.d.vue.ts +18 -0
- package/dist/runtime/components/ui/chat/ChatMessages.vue +63 -0
- package/dist/runtime/components/ui/chat/ChatMessages.vue.d.ts +18 -0
- package/dist/runtime/components/ui/chat/ChatPrompt.d.vue.ts +24 -0
- package/dist/runtime/components/ui/chat/ChatPrompt.vue +43 -0
- package/dist/runtime/components/ui/chat/ChatPrompt.vue.d.ts +24 -0
- package/dist/runtime/components/ui/chat/ChatPromptSubmit.d.vue.ts +18 -0
- package/dist/runtime/components/ui/chat/ChatPromptSubmit.vue +41 -0
- package/dist/runtime/components/ui/chat/ChatPromptSubmit.vue.d.ts +18 -0
- package/dist/runtime/components/ui/chat/ChatReasoning.d.vue.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatReasoning.vue +33 -0
- package/dist/runtime/components/ui/chat/ChatReasoning.vue.d.ts +7 -0
- package/dist/runtime/components/ui/chat/ChatToolCall.d.vue.ts +10 -0
- package/dist/runtime/components/ui/chat/ChatToolCall.vue +92 -0
- package/dist/runtime/components/ui/chat/ChatToolCall.vue.d.ts +10 -0
- package/dist/runtime/components/ui/chat/index.d.ts +9 -0
- package/dist/runtime/components/ui/chat/index.js +8 -0
- package/dist/runtime/components/ui/stream-markdown/StreamMarkdown.d.vue.ts +15 -0
- package/dist/runtime/components/ui/stream-markdown/StreamMarkdown.vue +22 -0
- package/dist/runtime/components/ui/stream-markdown/StreamMarkdown.vue.d.ts +15 -0
- package/dist/runtime/components/ui/stream-markdown/index.d.ts +1 -0
- package/dist/runtime/components/ui/stream-markdown/index.js +1 -0
- package/dist/runtime/share/coerce-from-string.d.ts +62 -0
- package/dist/runtime/share/coerce-from-string.js +154 -0
- package/dist/runtime/share/locale.d.ts +13 -7
- package/dist/runtime/share/locale.js +27 -5
- package/dist/runtime/share/use-persisted-chat.d.ts +30 -0
- package/dist/runtime/share/use-persisted-chat.js +34 -0
- package/dist/runtime/utils/ai/index.d.ts +10 -0
- package/dist/runtime/utils/ai/index.js +123 -33
- package/dist/runtime/utils/ai/parts.d.ts +30 -0
- package/dist/runtime/utils/ai/parts.js +9 -0
- package/dist/runtime/utils/cel-context.d.ts +1 -0
- package/dist/runtime/utils/cel-context.js +28 -0
- package/package.json +4 -8
- package/dist/mcp.mjs +0 -102434
- package/dist/preview/assets/FieldGroup.vue_vue_type_script_setup_true_lang-BK4nj6mF.js +0 -1
- package/dist/preview/assets/badge-Df9KgnrB.js +0 -1
- package/dist/preview/assets/config-B3NwVBxT.js +0 -1
- package/dist/preview/assets/config-BrtNnMlJ.js +0 -1
- package/dist/preview/assets/config-CUJNegvX.js +0 -1
- package/dist/preview/assets/config-ChrXUmKf.js +0 -1
- package/dist/preview/assets/config-CmEXMpIU.js +0 -1
- package/dist/preview/assets/config-CrBoFiYB.js +0 -1
- package/dist/preview/assets/config-D-Hf0dls.js +0 -1
- package/dist/preview/assets/config-D4cXwy75.js +0 -1
- package/dist/preview/assets/config-DCj5Qyiq.js +0 -1
- package/dist/preview/assets/config-DPfx03nM.js +0 -1
- package/dist/preview/assets/config-DWF0bcmF.js +0 -1
- package/dist/preview/assets/config-Do4K9hI7.js +0 -1
- package/dist/preview/assets/config-DwblM1r8.js +0 -1
- package/dist/preview/assets/config-MW5Hs8yE.js +0 -1
- package/dist/preview/assets/config-uNoNEc-1.js +0 -1
- package/dist/preview/assets/definition.vue_vue_type_script_setup_true_lang-CbtpddWK.js +0 -1
- package/dist/preview/assets/index-Bm7I4Tr0.css +0 -1
- package/dist/preview/assets/index-CkyV576r.js +0 -775
- package/dist/preview/assets/index-CtW2E0ME.js +0 -1
- package/dist/preview/assets/index-xDmBF3zO.js +0 -1
- package/dist/preview/assets/item-D0e9Cx1Q.js +0 -1
- package/dist/preview/assets/runtime-3tGIbclh.js +0 -1
- package/dist/preview/assets/runtime-BCePD3XR.js +0 -1
- package/dist/preview/assets/runtime-BMyFUaSM.js +0 -1
- package/dist/preview/assets/runtime-BXZU3EqA.js +0 -1
- package/dist/preview/assets/runtime-BySNFNSO.js +0 -1
- package/dist/preview/assets/runtime-CI02gDFj.js +0 -1
- package/dist/preview/assets/runtime-DCo1Qp8a.js +0 -1
- package/dist/preview/assets/runtime-DDSKV70N.js +0 -1
- package/dist/preview/assets/runtime-Dc7pytUy.js +0 -1
- package/dist/preview/assets/runtime-ckLrkTMm.js +0 -1
- package/dist/preview/assets/runtime-y4oJ8VkY.js +0 -1
- package/dist/preview/assets/schema-meta-D0y0sKal.js +0 -1
- package/dist/preview/index.html +0 -19
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
import { JSONSchema, ParseResult, Schema } from "effect";
|
|
2
|
+
import { coerceFromString } from "../../../share/coerce-from-string.js";
|
|
3
|
+
import { Expression, HttpRequestResult } from "../../../share/expression.js";
|
|
4
|
+
import {
|
|
5
|
+
defaultTableConfig,
|
|
6
|
+
registerDataSourceRequestVars,
|
|
7
|
+
registerDataSourceResponseVars
|
|
8
|
+
} from "../schema.js";
|
|
9
|
+
import { registerRowVariablesIfAbsent } from "./shared.js";
|
|
10
|
+
import { activeColumns } from "./resolve.js";
|
|
11
|
+
const HARNESS_KEYS = ["id", "groupId", "compatibilityDate"];
|
|
12
|
+
function publicColumnSchema(entry, configure) {
|
|
13
|
+
return entry.schema(configure).pipe(Schema.omit(...HARNESS_KEYS));
|
|
14
|
+
}
|
|
15
|
+
function decode(schema, input) {
|
|
16
|
+
const result = Schema.decodeUnknownEither(schema)(coerceFromString(input, schema));
|
|
17
|
+
if (result._tag === "Right") return { ok: true, value: result.right };
|
|
18
|
+
const issues = ParseResult.ArrayFormatter.formatErrorSync(result.left);
|
|
19
|
+
const report = issues.map((i) => `- ${i.path.map(String).join(".") || "(root)"}: ${i.message}`).join("\n");
|
|
20
|
+
return { ok: false, report };
|
|
21
|
+
}
|
|
22
|
+
function decodeField(field, schema, value) {
|
|
23
|
+
const result = Schema.decodeUnknownEither(schema)(value);
|
|
24
|
+
if (result._tag === "Right") return null;
|
|
25
|
+
const message = ParseResult.ArrayFormatter.formatErrorSync(result.left)[0]?.message ?? "invalid";
|
|
26
|
+
return `${field}: ${message}`;
|
|
27
|
+
}
|
|
28
|
+
function buildDataSourceExpressionSchemas(configure) {
|
|
29
|
+
return {
|
|
30
|
+
request: Expression({
|
|
31
|
+
configure: (env) => {
|
|
32
|
+
configure(env);
|
|
33
|
+
registerDataSourceRequestVars(env);
|
|
34
|
+
},
|
|
35
|
+
resultType: HttpRequestResult
|
|
36
|
+
}),
|
|
37
|
+
data: Expression({
|
|
38
|
+
configure: (env) => {
|
|
39
|
+
configure(env);
|
|
40
|
+
registerDataSourceResponseVars(env);
|
|
41
|
+
},
|
|
42
|
+
// Mirrors `tableDataSource`'s `CelRows` resultType: list / dyn /
|
|
43
|
+
// optional<T> all pass — a data expression that yields a parsed JSON
|
|
44
|
+
// array (the common case), a `dyn`, or `optional<list<…>>` is fine.
|
|
45
|
+
resultType: (t) => t.startsWith("list") || t === "dyn" || t.startsWith("optional")
|
|
46
|
+
}),
|
|
47
|
+
total: Expression({
|
|
48
|
+
configure: (env) => {
|
|
49
|
+
configure(env);
|
|
50
|
+
registerDataSourceResponseVars(env);
|
|
51
|
+
},
|
|
52
|
+
// Mirrors `tableDataSource`'s `CelTotal` resultType: a server-total
|
|
53
|
+
// expression that resolves to a number, `dyn`, or `optional<number>`
|
|
54
|
+
// is acceptable (the runtime normalizes None → 0 on the wire).
|
|
55
|
+
resultType: (t) => t === "number" || t === "dyn" || t.startsWith("optional")
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function buildRowKeyExpressionSchema(configure) {
|
|
60
|
+
return Expression({
|
|
61
|
+
configure: (env) => {
|
|
62
|
+
configure(env);
|
|
63
|
+
registerRowVariablesIfAbsent(env);
|
|
64
|
+
},
|
|
65
|
+
// Mirrors `TableConfig`'s `CelRowKey` resultType: row-key expressions
|
|
66
|
+
// resolve to a string, number, or `dyn` (the runtime hashes anything
|
|
67
|
+
// non-string to a stable string for TanStack's row.id).
|
|
68
|
+
resultType: (t) => t === "string" || t === "number" || t === "dyn"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function safeJsonSchema(schema) {
|
|
72
|
+
try {
|
|
73
|
+
return JSONSchema.make(schema);
|
|
74
|
+
} catch {
|
|
75
|
+
return "(schema unavailable)";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export function createTableAiTools(deps) {
|
|
79
|
+
const dataSourceSchemas = buildDataSourceExpressionSchemas(deps.configure);
|
|
80
|
+
const rowKeySchema = buildRowKeyExpressionSchema(deps.configure);
|
|
81
|
+
return [
|
|
82
|
+
// ---- 信息获取 ----
|
|
83
|
+
{
|
|
84
|
+
name: "list_available_column_types",
|
|
85
|
+
description: "List the column types you can currently insert into a table. Returns each type's name and, when set, a one-line description of when to use it. Use this first to discover what columns exist; for a column's full field contract and defaults, follow up with `describe_specific_column_type`. Deprecated types are hidden.",
|
|
86
|
+
inputJsonSchema: {
|
|
87
|
+
type: "object",
|
|
88
|
+
properties: {},
|
|
89
|
+
additionalProperties: false
|
|
90
|
+
},
|
|
91
|
+
execute: () => activeColumns().map((c) => {
|
|
92
|
+
const entry = { type: c.type, name: c.metadata.name };
|
|
93
|
+
if (c.metadata.description !== void 0) entry.description = c.metadata.description;
|
|
94
|
+
return entry;
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "describe_specific_column_type",
|
|
99
|
+
description: "Return the JSON Schema (without `id`/`groupId` \u2014 those are managed by the harness) and the default values for one column type. Call this before `insert_column` to learn the field contract. Deprecated types are not accepted.",
|
|
100
|
+
inputJsonSchema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
type: { type: "string", description: "A `type` value from `list_available_column_types`." }
|
|
104
|
+
},
|
|
105
|
+
required: ["type"],
|
|
106
|
+
additionalProperties: false
|
|
107
|
+
},
|
|
108
|
+
execute: (input) => {
|
|
109
|
+
const { type } = input ?? {};
|
|
110
|
+
if (typeof type !== "string" || type.length === 0) {
|
|
111
|
+
return "describe failed: `type` must be a non-empty string.";
|
|
112
|
+
}
|
|
113
|
+
const entry = activeColumns().find((c) => c.type === type);
|
|
114
|
+
if (!entry) {
|
|
115
|
+
return `describe failed: column type "${type}" is not available. Call list_available_column_types to see what is.`;
|
|
116
|
+
}
|
|
117
|
+
const publicSchema = publicColumnSchema(entry, deps.configure);
|
|
118
|
+
let jsonSchema;
|
|
119
|
+
try {
|
|
120
|
+
jsonSchema = JSONSchema.make(publicSchema);
|
|
121
|
+
} catch {
|
|
122
|
+
jsonSchema = "(schema unavailable)";
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
schema: jsonSchema,
|
|
126
|
+
defaults: entry.defaults?.() ?? null
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "describe_general_settings",
|
|
132
|
+
description: "Return the schema and current values for the table's general settings: `displayName` (internal label), `dataSource` (HTTP request / data extraction / total \u2014 each with its own CEL scope and available variables baked into the JSON Schema description), `rowKey` (per-row CEL expression evaluated against `row` / `index`), and the `pagination` toggle's current on/off state. Call this first when configuring a fresh table from API documentation; the CEL expressions reference the same scopes the inline UI validates against, so what you learn here is what the setters accept.",
|
|
133
|
+
inputJsonSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {},
|
|
136
|
+
additionalProperties: false
|
|
137
|
+
},
|
|
138
|
+
execute: () => {
|
|
139
|
+
const working = deps.read();
|
|
140
|
+
const dataSource = working.dataSource;
|
|
141
|
+
return {
|
|
142
|
+
values: {
|
|
143
|
+
displayName: typeof working.displayName === "string" ? working.displayName : null,
|
|
144
|
+
dataSource: dataSource ? {
|
|
145
|
+
request: dataSource.request ?? null,
|
|
146
|
+
data: dataSource.data ?? null,
|
|
147
|
+
total: dataSource.total ?? null
|
|
148
|
+
} : null,
|
|
149
|
+
rowKey: typeof working.rowKey === "string" ? working.rowKey : null,
|
|
150
|
+
// The toggle's current state — does NOT expose pageSize/pageSizes,
|
|
151
|
+
// those are user-facing knobs the AI never needs to set.
|
|
152
|
+
paginationEnabled: working.pagination !== void 0
|
|
153
|
+
},
|
|
154
|
+
fields: [
|
|
155
|
+
{
|
|
156
|
+
name: "displayName",
|
|
157
|
+
title: "\u5185\u90E8\u540D\u79F0",
|
|
158
|
+
description: "\u4EC5\u5728\u914D\u7F6E\u754C\u9762\u53EF\u89C1\u7684\u8868\u683C\u540D\u79F0\uFF0C\u7528\u4E8E\u5728\u4E8B\u4EF6\u76EE\u6807\u7B49\u4F4D\u7F6E\u6807\u8BC6\u8BE5\u8868\u683C\uFF1B\u8FD0\u884C\u65F6\u4E0D\u5C55\u793A\u3002",
|
|
159
|
+
kind: "string"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "dataSource",
|
|
163
|
+
title: "\u6570\u636E\u6E90",
|
|
164
|
+
kind: "group",
|
|
165
|
+
subfields: [
|
|
166
|
+
{
|
|
167
|
+
name: "request",
|
|
168
|
+
title: "\u8BF7\u6C42",
|
|
169
|
+
description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF1B\u672A\u914D\u7F6E\u65F6\u6570\u636E\u4ECE `data` \u8868\u8FBE\u5F0F\u4E2D\u8BFB\u53D6\uFF08\u901A\u5E38\u5F15\u7528\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF09\u3002",
|
|
170
|
+
kind: "cel",
|
|
171
|
+
resultType: "HttpRequest | optional<HttpRequest> | dyn | optional<dyn>",
|
|
172
|
+
jsonSchema: safeJsonSchema(dataSourceSchemas.request)
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "data",
|
|
176
|
+
title: "\u6570\u636E",
|
|
177
|
+
description: "\u8FD4\u56DE\u884C\u6570\u636E\u5217\u8868\uFF08`list<dyn>`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u5728\u914D\u7F6E\u4E86 `request` \u65F6\u53EF\u901A\u8FC7 `json` \u5F15\u7528\u54CD\u5E94\u4F53\u3002",
|
|
178
|
+
kind: "cel",
|
|
179
|
+
resultType: "list<\u2026> | dyn | optional<\u2026>",
|
|
180
|
+
jsonSchema: safeJsonSchema(dataSourceSchemas.data)
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "total",
|
|
184
|
+
title: "\u603B\u6570",
|
|
185
|
+
description: "\u8FD4\u56DE\u603B\u884C\u6570\uFF08`number`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u914D\u7F6E\u540E\u542F\u7528\u670D\u52A1\u7AEF\u5206\u9875\uFF0C\u7559\u7A7A\u5219\u8D70\u524D\u7AEF\u5206\u9875\u3002",
|
|
186
|
+
kind: "cel",
|
|
187
|
+
resultType: "number | dyn | optional<\u2026>",
|
|
188
|
+
jsonSchema: safeJsonSchema(dataSourceSchemas.total)
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "rowKey",
|
|
194
|
+
title: "\u884C\u552F\u4E00\u6807\u8BC6",
|
|
195
|
+
description: "\u4E3A\u6BCF\u4E00\u884C\u8BA1\u7B97\u7A33\u5B9A\u552F\u4E00 ID \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u8BBF\u95EE `row` / `index`\uFF0C\u7ED3\u679C\u987B\u4E3A\u5B57\u7B26\u4E32\u6216\u6570\u5B57\uFF08\u4F8B\u5982 `row.id`\uFF09\u3002\u914D\u7F6E\u540E\uFF0C\u8DE8\u5237\u65B0\u7684\u52FE\u9009\u3001\u5C55\u5F00\u7B49\u884C\u7EA7\u72B6\u6001\u6309\u8BE5 ID \u5339\u914D\uFF1B\u7559\u7A7A\u65F6\u884C\u8EAB\u4EFD\u6309\u5BF9\u8C61\u5F15\u7528\u515C\u5E95\uFF0C\u8FDC\u7AEF\u6570\u636E\u5237\u65B0\u4F1A\u4E22\u3002",
|
|
196
|
+
kind: "cel",
|
|
197
|
+
resultType: "string | number | dyn",
|
|
198
|
+
jsonSchema: safeJsonSchema(rowKeySchema)
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "pagination",
|
|
202
|
+
title: "\u5206\u9875",
|
|
203
|
+
description: "\u5206\u9875\u7EC4\u4EF6\u5F00\u5173\uFF1B\u5F00\u542F\u540E\u7528\u6237\u770B\u5230\u5206\u9875\u5668\uFF0C\u5173\u95ED\u5219\u4E00\u6B21\u6027\u6E32\u67D3\u6240\u6709\u6570\u636E\u3002`pageSize` \u7B49\u5177\u4F53\u53C2\u6570\u8BF7\u5728\u53F3\u4FA7\u9762\u677F\u914D\u7F6E\u3002",
|
|
204
|
+
kind: "toggle",
|
|
205
|
+
enabled: working.pagination !== void 0
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
// ---- 配置 ----
|
|
212
|
+
{
|
|
213
|
+
name: "insert_column",
|
|
214
|
+
description: "Insert one new column into the table. Provide `type` (from `list_available_column_types`) plus the column's fields as described by `describe_specific_column_type`. Do NOT include `id` or `groupId` \u2014 the harness assigns `id` automatically and grouping is a separate operation. On validation failure the tool returns the issues; fix them and call again.",
|
|
215
|
+
inputJsonSchema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: {
|
|
218
|
+
type: { type: "string", description: "The column type to insert." }
|
|
219
|
+
},
|
|
220
|
+
required: ["type"],
|
|
221
|
+
additionalProperties: true
|
|
222
|
+
},
|
|
223
|
+
execute: (input) => {
|
|
224
|
+
const raw = input ?? {};
|
|
225
|
+
const { type, ...rest } = raw;
|
|
226
|
+
if (typeof type !== "string" || type.length === 0) {
|
|
227
|
+
return "insert failed: `type` must be a non-empty string.";
|
|
228
|
+
}
|
|
229
|
+
for (const k of HARNESS_KEYS) {
|
|
230
|
+
if (k in rest) {
|
|
231
|
+
return `insert failed: do not pass \`${k}\` \u2014 the harness assigns it.`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const entry = activeColumns().find((c) => c.type === type);
|
|
235
|
+
if (!entry) {
|
|
236
|
+
return `insert failed: column type "${type}" is not available. Call list_available_column_types to see what is.`;
|
|
237
|
+
}
|
|
238
|
+
const publicSchema = publicColumnSchema(entry, deps.configure);
|
|
239
|
+
const verdict = decode(publicSchema, raw);
|
|
240
|
+
if (!verdict.ok) {
|
|
241
|
+
return `insert failed for type "${type}". Fix these and call insert_column again:
|
|
242
|
+
${verdict.report}`;
|
|
243
|
+
}
|
|
244
|
+
const working = deps.read();
|
|
245
|
+
const columns = Array.isArray(working.columns) ? working.columns : [];
|
|
246
|
+
const newColumn = {
|
|
247
|
+
id: deps.genUuid(),
|
|
248
|
+
compatibilityDate: entry.compatibilityDate,
|
|
249
|
+
...verdict.value
|
|
250
|
+
};
|
|
251
|
+
working.columns = [...columns, newColumn];
|
|
252
|
+
deps.write(working);
|
|
253
|
+
return { id: newColumn.id, type };
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "delete_columns",
|
|
258
|
+
description: "Delete one or more columns by id. Call `list_columns` first to obtain ids. Columns are matched by id only (type / title are not unique). On any unknown id the call is rejected without writing; fix and call again. This does not touch group definitions; grouping remains a separate operation.",
|
|
259
|
+
inputJsonSchema: {
|
|
260
|
+
type: "object",
|
|
261
|
+
properties: {
|
|
262
|
+
ids: {
|
|
263
|
+
type: "array",
|
|
264
|
+
items: { type: "string", minLength: 1 },
|
|
265
|
+
minItems: 1,
|
|
266
|
+
description: "Column ids to delete. Get them from `list_columns` first."
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
required: ["ids"],
|
|
270
|
+
additionalProperties: false
|
|
271
|
+
},
|
|
272
|
+
execute: (input) => {
|
|
273
|
+
const raw = input ?? {};
|
|
274
|
+
const ids = raw.ids;
|
|
275
|
+
if (!Array.isArray(ids) || ids.length === 0) {
|
|
276
|
+
return "delete failed: `ids` must be a non-empty array of column ids.";
|
|
277
|
+
}
|
|
278
|
+
for (const id of ids) {
|
|
279
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
280
|
+
return "delete failed: every `ids` entry must be a non-empty string.";
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
const seen = /* @__PURE__ */ new Set();
|
|
284
|
+
for (const id of ids) {
|
|
285
|
+
if (seen.has(id)) {
|
|
286
|
+
return `delete failed: duplicate id "${id}" in input \u2014 dedupe and call again.`;
|
|
287
|
+
}
|
|
288
|
+
seen.add(id);
|
|
289
|
+
}
|
|
290
|
+
const working = deps.read();
|
|
291
|
+
const columns = Array.isArray(working.columns) ? working.columns : [];
|
|
292
|
+
const existing = new Set(columns.map((c) => c.id));
|
|
293
|
+
for (const id of ids) {
|
|
294
|
+
if (!existing.has(id)) {
|
|
295
|
+
return `delete failed: column id "${id}" is not present. Call list_columns to see current ids.`;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const deleted = new Set(ids);
|
|
299
|
+
working.columns = columns.filter((c) => !deleted.has(c.id));
|
|
300
|
+
deps.write(working);
|
|
301
|
+
return { deleted: ids, count: ids.length };
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "list_columns",
|
|
306
|
+
description: "Return the currently-configured columns, including their `id` and `groupId`. Use this to discover existing ids (e.g. before grouping them in a later step).",
|
|
307
|
+
inputJsonSchema: {
|
|
308
|
+
type: "object",
|
|
309
|
+
properties: {},
|
|
310
|
+
additionalProperties: false
|
|
311
|
+
},
|
|
312
|
+
execute: () => {
|
|
313
|
+
const working = deps.read();
|
|
314
|
+
return Array.isArray(working.columns) ? working.columns : [];
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "set_display_name",
|
|
319
|
+
description: `Set the table's internal label (used in event-target pickers and the config tree; not shown to end users). Pass an empty string to clear it. The same setter is used for both set and clear \u2014 empty is a valid intentional state, not a "missing" one.`,
|
|
320
|
+
inputJsonSchema: {
|
|
321
|
+
type: "object",
|
|
322
|
+
properties: {
|
|
323
|
+
value: { type: "string", description: 'The new display name; pass `""` to clear.' }
|
|
324
|
+
},
|
|
325
|
+
required: ["value"],
|
|
326
|
+
additionalProperties: false
|
|
327
|
+
},
|
|
328
|
+
execute: (input) => {
|
|
329
|
+
const raw = input ?? {};
|
|
330
|
+
if (typeof raw.value !== "string") {
|
|
331
|
+
return "set_display_name failed: `value` must be a string.";
|
|
332
|
+
}
|
|
333
|
+
const working = deps.read();
|
|
334
|
+
if (raw.value.length === 0) {
|
|
335
|
+
delete working.displayName;
|
|
336
|
+
} else {
|
|
337
|
+
working.displayName = raw.value;
|
|
338
|
+
}
|
|
339
|
+
deps.write(working);
|
|
340
|
+
return { displayName: working.displayName ?? null };
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "set_data_source",
|
|
345
|
+
description: "Update one or more of the table's three `dataSource` CEL expressions: `request` (HTTP request), `data` (row extraction from response), `total` (server-side total count, leave empty for client-side pagination). Provide only the fields you want to change \u2014 omitted fields are inherited from the existing `dataSource`. At least one non-empty expression must be provided. `data` is required across the merged result (it stays from the existing source if you don't pass it). On CEL error the tool returns per-field messages; fix and call again.",
|
|
346
|
+
inputJsonSchema: {
|
|
347
|
+
type: "object",
|
|
348
|
+
properties: {
|
|
349
|
+
request: { type: "string", description: "HTTP request CEL expression (optional)." },
|
|
350
|
+
data: { type: "string", description: "Row extraction CEL expression (optional; preserved from existing if omitted)." },
|
|
351
|
+
total: { type: "string", description: "Total count CEL expression (optional; leave empty for client pagination)." }
|
|
352
|
+
},
|
|
353
|
+
additionalProperties: false
|
|
354
|
+
},
|
|
355
|
+
execute: (input) => {
|
|
356
|
+
const raw = input ?? {};
|
|
357
|
+
const updates = {};
|
|
358
|
+
const provided = [];
|
|
359
|
+
for (const k of ["request", "data", "total"]) {
|
|
360
|
+
const v = raw[k];
|
|
361
|
+
if (v === void 0) continue;
|
|
362
|
+
if (typeof v !== "string") {
|
|
363
|
+
return `set_data_source failed: \`${k}\` must be a string when provided.`;
|
|
364
|
+
}
|
|
365
|
+
if (v.length === 0) {
|
|
366
|
+
return `set_data_source failed: \`${k}\` cannot be empty (omit the field to leave it unchanged).`;
|
|
367
|
+
}
|
|
368
|
+
updates[k] = v;
|
|
369
|
+
provided.push(k);
|
|
370
|
+
}
|
|
371
|
+
if (provided.length === 0) {
|
|
372
|
+
return "set_data_source failed: provide at least one of `request` / `data` / `total`.";
|
|
373
|
+
}
|
|
374
|
+
const fieldErrors = provided.map((k) => {
|
|
375
|
+
const schema = dataSourceSchemas[k];
|
|
376
|
+
return decodeField(k, schema, updates[k]);
|
|
377
|
+
}).filter((x) => x !== null);
|
|
378
|
+
if (fieldErrors.length > 0) {
|
|
379
|
+
return `set_data_source failed. Fix these and call set_data_source again:
|
|
380
|
+
${fieldErrors.map((e) => `- ${e}`).join("\n")}`;
|
|
381
|
+
}
|
|
382
|
+
const working = deps.read();
|
|
383
|
+
const existing = working.dataSource ?? {};
|
|
384
|
+
const merged = { ...existing, ...updates };
|
|
385
|
+
if (typeof merged.data !== "string" || merged.data.length === 0) {
|
|
386
|
+
return "set_data_source failed: `data` is required (no existing dataSource.data to inherit).";
|
|
387
|
+
}
|
|
388
|
+
working.dataSource = merged;
|
|
389
|
+
deps.write(working);
|
|
390
|
+
return { dataSource: merged };
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
name: "set_row_key",
|
|
395
|
+
description: "Set the CEL expression that derives each row's stable id from the row payload (e.g. `row.id`, `row.?code`). Required scope: `row` (the current row object) and `index` (its zero-based position). The result must be a string, number, or `dyn` \u2014 anything else is rejected. Pass an empty string to clear the override (rows will fall back to the runtime's object-identity key, which fails to match after a remote refresh). On CEL error the tool returns the issue; fix and call again.",
|
|
396
|
+
inputJsonSchema: {
|
|
397
|
+
type: "object",
|
|
398
|
+
properties: {
|
|
399
|
+
value: { type: "string", description: 'Row-key CEL expression; pass `""` to clear.' }
|
|
400
|
+
},
|
|
401
|
+
required: ["value"],
|
|
402
|
+
additionalProperties: false
|
|
403
|
+
},
|
|
404
|
+
execute: (input) => {
|
|
405
|
+
const raw = input ?? {};
|
|
406
|
+
if (typeof raw.value !== "string") {
|
|
407
|
+
return "set_row_key failed: `value` must be a string.";
|
|
408
|
+
}
|
|
409
|
+
if (raw.value.length > 0) {
|
|
410
|
+
const err = decodeField("value", rowKeySchema, raw.value);
|
|
411
|
+
if (err !== null) {
|
|
412
|
+
return `set_row_key failed. Fix this and call set_row_key again:
|
|
413
|
+
- ${err}`;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
const working = deps.read();
|
|
417
|
+
if (raw.value.length === 0) {
|
|
418
|
+
delete working.rowKey;
|
|
419
|
+
} else {
|
|
420
|
+
working.rowKey = raw.value;
|
|
421
|
+
}
|
|
422
|
+
deps.write(working);
|
|
423
|
+
return { rowKey: working.rowKey ?? null };
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "set_pagination",
|
|
428
|
+
description: "Toggle the table's pagination component on or off. This is the one pagination knob AI controls \u2014 `pageSize` and `pageSizes` are user-facing knobs in the right-side panel and the AI does not set them. `enabled: true` seeds a sensible default (`pageSize: 100`, common `pageSizes` list) when there is no existing pagination, and is a no-op when one is already set (preserves whatever the user tuned). `enabled: false` removes the pagination field entirely. This tool does NOT touch `dataSource.total` \u2014 leaving the total expression in place is a legal state; the user can clear it from the panel if they want to drop server-side pagination alongside this toggle.",
|
|
429
|
+
inputJsonSchema: {
|
|
430
|
+
type: "object",
|
|
431
|
+
properties: {
|
|
432
|
+
enabled: { type: "boolean", description: "Whether the pagination component should be visible." }
|
|
433
|
+
},
|
|
434
|
+
required: ["enabled"],
|
|
435
|
+
additionalProperties: false
|
|
436
|
+
},
|
|
437
|
+
execute: (input) => {
|
|
438
|
+
const raw = input ?? {};
|
|
439
|
+
if (typeof raw.enabled !== "boolean") {
|
|
440
|
+
return "set_pagination failed: `enabled` must be a boolean.";
|
|
441
|
+
}
|
|
442
|
+
const working = deps.read();
|
|
443
|
+
const currentlySet = working.pagination !== void 0;
|
|
444
|
+
if (raw.enabled) {
|
|
445
|
+
if (!currentlySet) {
|
|
446
|
+
working.pagination = { ...defaultTableConfig().pagination };
|
|
447
|
+
}
|
|
448
|
+
} else {
|
|
449
|
+
if (currentlySet) {
|
|
450
|
+
delete working.pagination;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
deps.write(working);
|
|
454
|
+
return { enabled: working.pagination !== void 0, pagination: working.pagination ?? null };
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
];
|
|
458
|
+
}
|
|
@@ -9,6 +9,12 @@ type SchemaFactory = (configure: (env: Environment) => void) => AnySchema;
|
|
|
9
9
|
export type ColumnMetadata = Readonly<{
|
|
10
10
|
name: string;
|
|
11
11
|
icon: string;
|
|
12
|
+
/**
|
|
13
|
+
* 一句话说明该列的适用场景;AI 在 `list_available_column_types` 工具里看到。
|
|
14
|
+
* **可选** —— 用户后续按列单独补;缺失时工具返回里省略该字段,工具与 schema
|
|
15
|
+
* 都不报错(人类 picker / 旧调用点不受影响)。AI 工具以外不应读取该字段。
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
12
18
|
/**
|
|
13
19
|
* True when this column publishes its resolved option to the per-row
|
|
14
20
|
* `selections` registry (its runtime keyed by `column.id`). Set it together
|
|
@@ -103,4 +109,21 @@ export declare function findColumn(type: string, compatibilityDate: string): Col
|
|
|
103
109
|
*/
|
|
104
110
|
export declare function findMigrationTarget(type: string, compatibilityDate: string): ColumnEntry | undefined;
|
|
105
111
|
export declare function latestColumnByType(): ReadonlyArray<ColumnEntry>;
|
|
112
|
+
/**
|
|
113
|
+
* AI 工具可见的列集合:按 `type` 取最新版本 + 排除 `deprecated`。
|
|
114
|
+
*
|
|
115
|
+
* 两层过滤的原因:
|
|
116
|
+
* (a) `latestColumnByType()` 解决同 `type` 多版本时只留最新版——避免 AI 拿到
|
|
117
|
+
* 已被新版本替代的旧 `compatibilityDate`(我们对 AI 隐藏 compDate,所以
|
|
118
|
+
* 不能让它先查到旧版再被 supersededBy 推回去,多绕一步);
|
|
119
|
+
* (b) `!deprecated` 同时屏蔽两类情况:
|
|
120
|
+
* - 同 type 不同日期——已由 (a) 消除(因为旧日期 = deprecated);
|
|
121
|
+
* - 跨类型迁移的源条目——`deriveEntryExtras` 给所有被 `migrateFrom` 指
|
|
122
|
+
* 名的源都打了 `deprecated: true`,AI 永远不会看到它们,避免它读取到
|
|
123
|
+
* 一个 schema 还在但应被迁移的旧 type 后误以为是合法 API。
|
|
124
|
+
*
|
|
125
|
+
* 人类 picker 仍走 `COLUMNS`(含废弃)—— picker 的存在意义就是让用户能选到旧
|
|
126
|
+
* 列再触发迁移。
|
|
127
|
+
*/
|
|
128
|
+
export declare function activeColumns(): ReadonlyArray<ColumnEntry>;
|
|
106
129
|
export {};
|
|
@@ -8,49 +8,73 @@ export declare function columnIdentityFields(): {
|
|
|
8
8
|
groupId: Schema.optional<typeof Schema.UUID>;
|
|
9
9
|
};
|
|
10
10
|
export declare function columnFields(configure: (env: Environment) => void): {
|
|
11
|
-
title: Schema.
|
|
12
|
-
locale:
|
|
13
|
-
message:
|
|
14
|
-
}
|
|
15
|
-
locale:
|
|
16
|
-
message:
|
|
17
|
-
}
|
|
11
|
+
title: Schema.suspend<readonly [{
|
|
12
|
+
readonly locale: "zh";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
}, ...{
|
|
15
|
+
readonly locale: "en" | "ja" | "ko";
|
|
16
|
+
readonly message: string;
|
|
17
|
+
}[]], string | readonly [{
|
|
18
|
+
readonly locale: "zh";
|
|
19
|
+
readonly message: string;
|
|
20
|
+
}, ...{
|
|
21
|
+
readonly locale: "en" | "ja" | "ko";
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}[]], never>;
|
|
18
24
|
accessor: Schema.optional<Schema.Schema<string, string, never>>;
|
|
19
25
|
enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
20
26
|
sortKey: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
21
27
|
size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
|
|
22
28
|
grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
23
|
-
tooltip: Schema.optional<Schema.
|
|
24
|
-
locale:
|
|
25
|
-
message:
|
|
26
|
-
}
|
|
27
|
-
locale:
|
|
28
|
-
message:
|
|
29
|
-
}
|
|
29
|
+
tooltip: Schema.optional<Schema.suspend<readonly [{
|
|
30
|
+
readonly locale: "zh";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
}, ...{
|
|
33
|
+
readonly locale: "en" | "ja" | "ko";
|
|
34
|
+
readonly message: string;
|
|
35
|
+
}[]], string | readonly [{
|
|
36
|
+
readonly locale: "zh";
|
|
37
|
+
readonly message: string;
|
|
38
|
+
}, ...{
|
|
39
|
+
readonly locale: "en" | "ja" | "ko";
|
|
40
|
+
readonly message: string;
|
|
41
|
+
}[]], never>>;
|
|
30
42
|
hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
31
43
|
id: Schema.refine<string, typeof Schema.String>;
|
|
32
44
|
groupId: Schema.optional<typeof Schema.UUID>;
|
|
33
45
|
};
|
|
34
46
|
export declare function editableColumnFields(): {
|
|
35
|
-
title: Schema.
|
|
36
|
-
locale:
|
|
37
|
-
message:
|
|
38
|
-
}
|
|
39
|
-
locale:
|
|
40
|
-
message:
|
|
41
|
-
}
|
|
47
|
+
title: Schema.suspend<readonly [{
|
|
48
|
+
readonly locale: "zh";
|
|
49
|
+
readonly message: string;
|
|
50
|
+
}, ...{
|
|
51
|
+
readonly locale: "en" | "ja" | "ko";
|
|
52
|
+
readonly message: string;
|
|
53
|
+
}[]], string | readonly [{
|
|
54
|
+
readonly locale: "zh";
|
|
55
|
+
readonly message: string;
|
|
56
|
+
}, ...{
|
|
57
|
+
readonly locale: "en" | "ja" | "ko";
|
|
58
|
+
readonly message: string;
|
|
59
|
+
}[]], never>;
|
|
42
60
|
binding: Schema.refine<string, typeof Schema.String>;
|
|
43
61
|
enableSorting: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
44
62
|
sortKey: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
45
63
|
size: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
|
|
46
64
|
grow: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
47
|
-
tooltip: Schema.optional<Schema.
|
|
48
|
-
locale:
|
|
49
|
-
message:
|
|
50
|
-
}
|
|
51
|
-
locale:
|
|
52
|
-
message:
|
|
53
|
-
}
|
|
65
|
+
tooltip: Schema.optional<Schema.suspend<readonly [{
|
|
66
|
+
readonly locale: "zh";
|
|
67
|
+
readonly message: string;
|
|
68
|
+
}, ...{
|
|
69
|
+
readonly locale: "en" | "ja" | "ko";
|
|
70
|
+
readonly message: string;
|
|
71
|
+
}[]], string | readonly [{
|
|
72
|
+
readonly locale: "zh";
|
|
73
|
+
readonly message: string;
|
|
74
|
+
}, ...{
|
|
75
|
+
readonly locale: "en" | "ja" | "ko";
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}[]], never>>;
|
|
54
78
|
hidden: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
55
79
|
id: Schema.refine<string, typeof Schema.String>;
|
|
56
80
|
groupId: Schema.optional<typeof Schema.UUID>;
|
|
@@ -61,13 +85,19 @@ export declare function registerRowVariablesIfAbsent(env: Environment): void;
|
|
|
61
85
|
export declare function CelRowAccess(configure: (env: Environment) => void, options?: {
|
|
62
86
|
resultType?: ResultType;
|
|
63
87
|
}): Schema.Schema<string, string, never>;
|
|
64
|
-
export declare function LocaleMarkdownWithRow(configure: (env: Environment) => void): Schema.filter<Schema.
|
|
65
|
-
locale:
|
|
66
|
-
message:
|
|
67
|
-
}
|
|
68
|
-
locale:
|
|
69
|
-
message:
|
|
70
|
-
}
|
|
88
|
+
export declare function LocaleMarkdownWithRow(configure: (env: Environment) => void): Schema.filter<Schema.suspend<readonly [{
|
|
89
|
+
readonly locale: "zh";
|
|
90
|
+
readonly message: string;
|
|
91
|
+
}, ...{
|
|
92
|
+
readonly locale: "en" | "ja" | "ko";
|
|
93
|
+
readonly message: string;
|
|
94
|
+
}[]], string | readonly [{
|
|
95
|
+
readonly locale: "zh";
|
|
96
|
+
readonly message: string;
|
|
97
|
+
}, ...{
|
|
98
|
+
readonly locale: "en" | "ja" | "ko";
|
|
99
|
+
readonly message: string;
|
|
100
|
+
}[]], never>>;
|
|
71
101
|
export declare function derivedRowField(configure: (env: Environment) => void, resultType: ResultType): Schema.optional<Schema.Struct<{
|
|
72
102
|
mode: Schema.Literal<["formula", "prefill"]>;
|
|
73
103
|
expression: Schema.Schema<string, string, never>;
|