@shwfed/config 3.0.6 → 3.0.8
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/runtime/components/actions/ai-l1.md +24 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.js +2 -1
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/prompt.md +8 -0
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +6 -0
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +4 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/prompt.md +8 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +2 -1
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/prompt.md +9 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.js +2 -1
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/prompt.md +8 -0
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.d.ts +1 -0
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.js +2 -1
- package/dist/runtime/components/actions/config.vue +109 -3
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.d.ts +1 -0
- package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.js +2 -1
- package/dist/runtime/components/actions/utils/ai-button-tools.d.ts +29 -0
- package/dist/runtime/components/actions/utils/ai-button-tools.js +664 -0
- package/dist/runtime/components/actions/utils/resolve.d.ts +22 -0
- package/dist/runtime/components/actions/utils/resolve.js +23 -1
- package/dist/runtime/components/config/ai-generate.d.vue.ts +7 -0
- package/dist/runtime/components/config/ai-generate.system.md +39 -0
- package/dist/runtime/components/{table → config}/ai-generate.vue +55 -32
- package/dist/runtime/components/config/ai-generate.vue.d.ts +7 -0
- package/dist/runtime/components/config/ai-page-slot.l1.md +25 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.d.ts +1 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.js +1 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +44 -44
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +44 -44
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +44 -44
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +44 -44
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +28 -22
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.d.ts +7 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +1 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +1 -0
- package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.d.ts +1 -0
- package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.js +1 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.d.ts +1 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.js +1 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.d.vue.ts +18 -18
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue.d.ts +18 -18
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.d.vue.ts +18 -18
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue.d.ts +18 -18
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.js +4 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.d.ts +7 -0
- package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.js +4 -0
- package/dist/runtime/components/config/config.vue +24 -3
- package/dist/runtime/components/config/history-picker.vue +6 -4
- package/dist/runtime/components/config/prune-dialog.vue +15 -4
- package/dist/runtime/components/config/use-editor.d.ts +1 -0
- package/dist/runtime/components/config/use-editor.js +20 -2
- package/dist/runtime/components/config/utils/ai-cursor.d.ts +21 -0
- package/dist/runtime/components/config/utils/ai-cursor.js +827 -0
- package/dist/runtime/components/config/utils/ai-host-manuals.d.ts +2 -0
- package/dist/runtime/components/config/utils/ai-host-manuals.js +19 -0
- package/dist/runtime/components/config/utils/linkage.d.ts +15 -6
- package/dist/runtime/components/config/utils/linkage.js +23 -7
- package/dist/runtime/components/config/utils/resolve.d.ts +19 -0
- package/dist/runtime/components/config/utils/resolve.js +25 -2
- package/dist/runtime/components/form/ai-l1.md +22 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +7 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/prompt.md +8 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +7 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/prompt.md +12 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +6 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.d.ts +6 -0
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/prompt.md +7 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/prompt.md +7 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/prompt.md +9 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +26 -26
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/prompt.md +11 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +12 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/prompt.md +14 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/prompt.md +19 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +1 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.d.ts +7 -0
- package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.js +4 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/prompt.md +14 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.js +1 -0
- package/dist/runtime/components/form/unit-config.vue +2 -2
- package/dist/runtime/components/form/utils/ai-field-tools.d.ts +2 -2
- package/dist/runtime/components/form/utils/ai-field-tools.js +47 -30
- package/dist/runtime/components/form/utils/resolve.d.ts +11 -0
- package/dist/runtime/components/form/utils/resolve.js +13 -1
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.js +2 -1
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +1 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js +2 -1
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.js +2 -1
- package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.d.ts +1 -0
- package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.js +2 -1
- package/dist/runtime/components/operations/utils/resolve.d.ts +17 -0
- package/dist/runtime/components/operations/utils/resolve.js +18 -1
- package/dist/runtime/components/table/ai-l1.md +38 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +7 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.js +5 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-21/com.shwfed.table.column.drag-handle/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-21/com.shwfed.table.column.drag-handle/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/prompt.md +12 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.js +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/prompt.md +16 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.js +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +8 -8
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +8 -8
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +1 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-07-12/com.shwfed.table.column.dynamic/prompt.md +15 -0
- package/dist/runtime/components/table/config.d.vue.ts +3 -3
- package/dist/runtime/components/table/config.vue +3 -35
- package/dist/runtime/components/table/config.vue.d.ts +3 -3
- package/dist/runtime/components/table/row-provider.vue +7 -1
- package/dist/runtime/components/table/schema.d.ts +44 -44
- package/dist/runtime/components/table/utils/ai-tools.js +16 -7
- package/dist/runtime/components/table/utils/resolve.d.ts +5 -0
- package/dist/runtime/components/table/utils/resolve.js +12 -1
- package/dist/runtime/share/clipboard.d.ts +15 -9
- package/dist/runtime/share/clipboard.js +22 -10
- package/dist/runtime/share/define-registry.d.ts +66 -0
- package/dist/runtime/share/define-registry.js +37 -1
- package/dist/runtime/share/use-persisted-chat.d.ts +11 -9
- package/dist/runtime/share/use-persisted-chat.js +3 -3
- package/dist/runtime/utils/ai/index.d.ts +1 -1
- package/dist/runtime/utils/ai/index.js +18 -11
- package/dist/runtime/utils/cel-catalog.d.ts +1 -0
- package/dist/runtime/utils/cel-catalog.js +10 -0
- package/dist/runtime/utils/cel-catalog.md +42 -0
- package/dist/runtime/utils/cel-context.d.ts +15 -0
- package/dist/runtime/utils/cel-context.js +8 -0
- package/dist/runtime/vendor/cel-js/CLAUDE.md +7 -2
- package/dist/runtime/vendor/cel-js/PROMPT.md +27 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
- package/dist/runtime/vendor/cel-js/lib/globals.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/globals.js +10 -0
- package/dist/runtime/vendor/cel-js/lib/map-builtins.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/map-builtins.js +80 -0
- package/dist/runtime/vendor/cel-js/lib/operators.js +2 -12
- package/package.json +1 -1
- package/dist/runtime/components/table/ai-generate.d.vue.ts +0 -16
- package/dist/runtime/components/table/ai-generate.system.md +0 -101
- package/dist/runtime/components/table/ai-generate.vue.d.ts +0 -16
- /package/dist/runtime/components/{table → config}/ai-generate.system.d.ts +0 -0
- /package/dist/runtime/components/{table → config}/ai-generate.system.js +0 -0
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import { JSONSchema, ParseResult, Schema } from "effect";
|
|
2
|
+
import { Environment } from "../../../vendor/cel-js/lib/index.js";
|
|
3
|
+
import { coerceFromString } from "../../../share/coerce-from-string.js";
|
|
4
|
+
import { getCelCatalog } from "../../../utils/cel-catalog.js";
|
|
5
|
+
import { Expression } from "../../../share/expression.js";
|
|
6
|
+
import { activeButtons, findButton } from "./resolve.js";
|
|
7
|
+
import { activeOperations } from "../../operations/utils/resolve.js";
|
|
8
|
+
const ACTION_HARNESS_KEYS = ["type", "compatibilityDate"];
|
|
9
|
+
function emptyLocale() {
|
|
10
|
+
return [{ locale: "zh", message: "" }];
|
|
11
|
+
}
|
|
12
|
+
function toLocale(title) {
|
|
13
|
+
if (typeof title === "string") return [{ locale: "zh", message: title }];
|
|
14
|
+
if (Array.isArray(title)) return title;
|
|
15
|
+
return emptyLocale();
|
|
16
|
+
}
|
|
17
|
+
function decode(schema, input) {
|
|
18
|
+
const result = Schema.decodeUnknownEither(schema)(coerceFromString(input, schema));
|
|
19
|
+
if (result._tag === "Right") return { ok: true, value: result.right };
|
|
20
|
+
const issues = ParseResult.ArrayFormatter.formatErrorSync(result.left);
|
|
21
|
+
const report = issues.map((i) => `- ${i.path.map(String).join(".") || "(root)"}: ${i.message}`).join("\n");
|
|
22
|
+
return { ok: false, report };
|
|
23
|
+
}
|
|
24
|
+
function publicActionSchema(entry, configure) {
|
|
25
|
+
return entry.schema(configure).pipe(Schema.omit(...ACTION_HARNESS_KEYS));
|
|
26
|
+
}
|
|
27
|
+
function safeJsonSchema(schema) {
|
|
28
|
+
try {
|
|
29
|
+
return JSONSchema.make(schema);
|
|
30
|
+
} catch {
|
|
31
|
+
return "(schema unavailable)";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function detectTriggerFields(jsonSchema) {
|
|
35
|
+
if (!jsonSchema || typeof jsonSchema !== "object") return [];
|
|
36
|
+
const props = jsonSchema.properties;
|
|
37
|
+
if (!props) return [];
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const [name, spec] of Object.entries(props)) {
|
|
40
|
+
const s = spec;
|
|
41
|
+
const candidates = Array.isArray(s.anyOf) ? s.anyOf : [s];
|
|
42
|
+
for (const c of candidates) {
|
|
43
|
+
if (c?.type === "array" && c.items && typeof c.items === "object") {
|
|
44
|
+
const itemProps = c.items.properties ?? c.items.$ref;
|
|
45
|
+
if (typeof itemProps === "object" && "target" in itemProps && "operation" in itemProps) {
|
|
46
|
+
out.push(name);
|
|
47
|
+
} else if (typeof c.items.$ref === "string" && c.items.$ref.includes("Trigger")) {
|
|
48
|
+
out.push(name);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
function validateTriggerRows(action, targets, configure) {
|
|
56
|
+
if (!targets) return null;
|
|
57
|
+
const byId = new Map(targets.filter((t) => t.id !== null).map((t) => [t.id, t]));
|
|
58
|
+
const validTargetsBlock = targets.filter((t) => t.id !== null).map((t) => ` - ${t.id}\uFF08${t.name}\uFF09: ${t.operations.map((o) => o.id).join(" / ")}`).join("\n");
|
|
59
|
+
const errors = [];
|
|
60
|
+
for (const [field, v] of Object.entries(action)) {
|
|
61
|
+
if (!Array.isArray(v) || v.length === 0) continue;
|
|
62
|
+
if (!v.every((x) => x && typeof x === "object" && typeof x.target === "string" && typeof x.operation === "string")) continue;
|
|
63
|
+
v.forEach((row, i) => {
|
|
64
|
+
const t = byId.get(row.target);
|
|
65
|
+
if (!t) {
|
|
66
|
+
errors.push(
|
|
67
|
+
`- ${field}[${i}].target "${row.target}" is not a reachable target from this actions bar. Valid targets (id\uFF08name\uFF09: operations):
|
|
68
|
+
${validTargetsBlock || " (none \u2014 this bar has no reachable targets)"}`
|
|
69
|
+
);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const op = t.operations.find((o) => o.id === row.operation);
|
|
73
|
+
if (!op) {
|
|
74
|
+
errors.push(
|
|
75
|
+
`- ${field}[${i}].operation "${row.operation}" is not exposed by target "${t.name}" (${t.id}). Its operations: ${t.operations.map((o) => o.id).join(" / ")}.`
|
|
76
|
+
);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (op.compatibilityDate !== void 0) {
|
|
80
|
+
if (row.compatibilityDate !== op.compatibilityDate) {
|
|
81
|
+
errors.push(
|
|
82
|
+
`- ${field}[${i}]: operation "${op.id}" is parameterized \u2014 the row must carry compatibilityDate "${op.compatibilityDate}" (see list_operations).`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const opEntry = activeOperations().find((o) => o.type === row.operation);
|
|
86
|
+
if (opEntry) {
|
|
87
|
+
const paramsVerdict = decode(opEntry.schema(configure), row.params ?? {});
|
|
88
|
+
if (!paramsVerdict.ok) {
|
|
89
|
+
errors.push(
|
|
90
|
+
`- ${field}[${i}].params (operation "${op.id}"; contract in list_operations):
|
|
91
|
+
` + paramsVerdict.report.split("\n").map((l) => ` ${l}`).join("\n")
|
|
92
|
+
);
|
|
93
|
+
} else {
|
|
94
|
+
v[i] = { ...row, params: paramsVerdict.value };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return errors.length > 0 ? errors.join("\n") : null;
|
|
101
|
+
}
|
|
102
|
+
function probeCelScope(configure) {
|
|
103
|
+
const env = new Environment({ unlistedVariablesAreDyn: false });
|
|
104
|
+
const baseline = new Set(env.getDefinitions().variables.map((v) => v.name));
|
|
105
|
+
configure(env);
|
|
106
|
+
const out = [];
|
|
107
|
+
for (const v of env.getDefinitions().variables) {
|
|
108
|
+
if (baseline.has(v.name)) continue;
|
|
109
|
+
out.push({
|
|
110
|
+
name: v.name,
|
|
111
|
+
type: v.type,
|
|
112
|
+
...v.label && v.label !== v.name ? { label: v.label } : {},
|
|
113
|
+
...v.description ? { description: v.description } : {}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
function isDropdown(item) {
|
|
119
|
+
return Array.isArray(item.items);
|
|
120
|
+
}
|
|
121
|
+
function isButton(item) {
|
|
122
|
+
return item.action !== void 0 && typeof item.action === "object";
|
|
123
|
+
}
|
|
124
|
+
function itemKind(item) {
|
|
125
|
+
if (isDropdown(item)) return "dropdown";
|
|
126
|
+
if (isButton(item)) return "button";
|
|
127
|
+
return "item";
|
|
128
|
+
}
|
|
129
|
+
function isModalLayout(action) {
|
|
130
|
+
return action?.type === "com.shwfed.actions.button.modal.layout";
|
|
131
|
+
}
|
|
132
|
+
function locateButton(container, id) {
|
|
133
|
+
const items = Array.isArray(container.items) ? container.items : [];
|
|
134
|
+
const topIdx = items.findIndex((it) => it.id === id);
|
|
135
|
+
if (topIdx >= 0) {
|
|
136
|
+
return {
|
|
137
|
+
node: items[topIdx],
|
|
138
|
+
replace: (next) => {
|
|
139
|
+
container.items = items.map((it, i) => i === topIdx ? next : it);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
for (let di = 0; di < items.length; di++) {
|
|
144
|
+
const dd = items[di];
|
|
145
|
+
if (!isDropdown(dd)) continue;
|
|
146
|
+
const subs = dd.items;
|
|
147
|
+
const subIdx = subs.findIndex((s) => s.id === id);
|
|
148
|
+
if (subIdx >= 0) {
|
|
149
|
+
return {
|
|
150
|
+
node: subs[subIdx],
|
|
151
|
+
replace: (next) => {
|
|
152
|
+
const nextSubs = subs.map((s, i) => i === subIdx ? next : s);
|
|
153
|
+
container.items = items.map((it, i) => i === di ? { ...dd, items: nextSubs } : it);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
export function createActionsAiTools(deps) {
|
|
161
|
+
function readContainer() {
|
|
162
|
+
const c = deps.read();
|
|
163
|
+
return c && typeof c === "object" ? { ...c } : {};
|
|
164
|
+
}
|
|
165
|
+
function groupsOf(c) {
|
|
166
|
+
return Array.isArray(c.groups) ? [...c.groups] : [];
|
|
167
|
+
}
|
|
168
|
+
function itemsOf(c) {
|
|
169
|
+
return Array.isArray(c.items) ? [...c.items] : [];
|
|
170
|
+
}
|
|
171
|
+
function commit(c, next) {
|
|
172
|
+
deps.write({
|
|
173
|
+
...c,
|
|
174
|
+
...next.groups !== void 0 ? { groups: next.groups } : {},
|
|
175
|
+
...next.items !== void 0 ? { items: next.items } : {}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const CelBool = Expression({ configure: deps.configure, resultType: "bool" });
|
|
179
|
+
return [
|
|
180
|
+
// ---- 信息获取 ----
|
|
181
|
+
{
|
|
182
|
+
name: "list_available_button_types",
|
|
183
|
+
description: "List the button (action) types you can insert into this actions bar. Returns each type's name and, when set, a one-line description of when to use it. Use this first to discover what buttons exist; for a button's full config contract, trigger fields, and gotchas call describe_specific_button_type. Deprecated types are hidden.",
|
|
184
|
+
inputJsonSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
185
|
+
execute: () => activeButtons().map((b) => {
|
|
186
|
+
const entry = { type: b.type, name: b.metadata.name };
|
|
187
|
+
if (b.metadata.description !== void 0) entry.description = b.metadata.description;
|
|
188
|
+
return entry;
|
|
189
|
+
})
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "describe_specific_button_type",
|
|
193
|
+
description: "Return, for one button type: the JSON Schema of its action config (without type/compatibilityDate \u2014 managed by the harness), the names of its trigger-list fields (e.g. `triggers`, `before`, `onSuccess` \u2014 each an ordered list of `{ target, operation, params }` rows), and \u2014 when the type has one \u2014 a prose `guide`. Call this before insert_button / configure_button to learn the contract. For a `modal.layout` button, its inner slot is configured by enter_node-ing into it. Deprecated types are not accepted.",
|
|
194
|
+
inputJsonSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {
|
|
197
|
+
type: { type: "string", description: "A `type` value from list_available_button_types." }
|
|
198
|
+
},
|
|
199
|
+
required: ["type"],
|
|
200
|
+
additionalProperties: false
|
|
201
|
+
},
|
|
202
|
+
execute: (input) => {
|
|
203
|
+
const { type } = input ?? {};
|
|
204
|
+
if (typeof type !== "string" || type.length === 0) {
|
|
205
|
+
return "describe failed: `type` must be a non-empty string.";
|
|
206
|
+
}
|
|
207
|
+
const entry = activeButtons().find((b) => b.type === type);
|
|
208
|
+
if (!entry) {
|
|
209
|
+
return `describe failed: button type "${type}" is not available. Call list_available_button_types to see what is.`;
|
|
210
|
+
}
|
|
211
|
+
const jsonSchema = safeJsonSchema(publicActionSchema(entry, deps.configure));
|
|
212
|
+
const result = {
|
|
213
|
+
schema: jsonSchema,
|
|
214
|
+
triggerFields: detectTriggerFields(jsonSchema),
|
|
215
|
+
drillable: entry.type === "com.shwfed.actions.button.modal.layout"
|
|
216
|
+
};
|
|
217
|
+
if (entry.prompt !== void 0) result.guide = entry.prompt;
|
|
218
|
+
return result;
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "list_operations",
|
|
223
|
+
description: "List the parameterized operations a trigger row can invoke (alert / send request / navigate / download \u2026), each with its params JSON Schema and \u2014 when it publishes a chain-step output \u2014 an `output` label. A trigger row is `{ target, operation, params }`: `operation` is this `type`, `params` is validated against this schema, and `compatibilityDate` (returned here) must be carried on the row. Param-LESS operations (a table's search / reset, the page's close) are NOT listed here \u2014 discover those via describe_event_targets, where each target lists the operation ids it exposes.",
|
|
224
|
+
inputJsonSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
225
|
+
execute: () => activeOperations().map((o) => {
|
|
226
|
+
const entry = {
|
|
227
|
+
operation: o.type,
|
|
228
|
+
compatibilityDate: o.compatibilityDate,
|
|
229
|
+
name: o.metadata.name,
|
|
230
|
+
params: safeJsonSchema(o.schema(deps.configure))
|
|
231
|
+
};
|
|
232
|
+
if (o.metadata.description !== void 0) entry.description = o.metadata.description;
|
|
233
|
+
if (o.metadata.output !== void 0) entry.output = o.metadata.output;
|
|
234
|
+
if (o.prompt !== void 0) entry.guide = o.prompt;
|
|
235
|
+
return entry;
|
|
236
|
+
})
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "describe_event_targets",
|
|
240
|
+
description: "List the instances a button in THIS actions bar can dispatch operations to \u2014 the valid `target` (an instance id) and, per target, the `operation` ids it exposes for a trigger row `{ target, operation, params }`. Targets are the page plus the operation-exposing hosts that enclose this actions bar (the owning table / tree, and any button hosting the modal you are inside). A trigger's `target` MUST be one id returned here. Operations whose entry carries a `compatibilityDate` are parameterized \u2014 consult list_operations for their params; the rest are param-less (search / reset / close / validate).",
|
|
241
|
+
inputJsonSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
242
|
+
execute: () => {
|
|
243
|
+
if (!deps.eventTargets) {
|
|
244
|
+
return "This actions bar has no enclosing operation targets wired yet. A button here cannot reliably dispatch an operation.";
|
|
245
|
+
}
|
|
246
|
+
return deps.eventTargets();
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "list_action_groups",
|
|
251
|
+
description: "Return the current button groups \u2014 each with its `id`, optional `variant` (the default variant new buttons in it inherit), and how many items it holds. Buttons live inside groups; get a group id here before insert_button, or create one with insert_action_group.",
|
|
252
|
+
inputJsonSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
253
|
+
execute: () => {
|
|
254
|
+
const c = readContainer();
|
|
255
|
+
const groups = groupsOf(c);
|
|
256
|
+
const items = itemsOf(c);
|
|
257
|
+
return groups.map((g) => ({
|
|
258
|
+
id: g.id,
|
|
259
|
+
variant: g.variant ?? null,
|
|
260
|
+
itemCount: items.filter((it) => it.groupId === g.id).length
|
|
261
|
+
}));
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "list_action_items",
|
|
266
|
+
description: "Return the current items in this actions bar. Each has an `id`, `groupId`, and `kind`: a `button` (with `buttonType`, its `title`, and `drillable` true for a modal.layout button you can enter_node into), a `dropdown` (with its `subItems`, each a button), or a plug-in `item`. Use this to discover ids before configure_button / set_action_item / delete_action_items / enter_node.",
|
|
267
|
+
inputJsonSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
268
|
+
execute: () => {
|
|
269
|
+
const c = readContainer();
|
|
270
|
+
return itemsOf(c).map((it) => {
|
|
271
|
+
const kind = itemKind(it);
|
|
272
|
+
if (kind === "dropdown") {
|
|
273
|
+
return {
|
|
274
|
+
id: it.id,
|
|
275
|
+
groupId: it.groupId,
|
|
276
|
+
kind,
|
|
277
|
+
subItems: it.items.map((s) => ({
|
|
278
|
+
id: s.id,
|
|
279
|
+
buttonType: s.action?.type ?? null,
|
|
280
|
+
drillable: isModalLayout(s.action)
|
|
281
|
+
}))
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
if (kind === "button") {
|
|
285
|
+
return {
|
|
286
|
+
id: it.id,
|
|
287
|
+
groupId: it.groupId,
|
|
288
|
+
kind,
|
|
289
|
+
buttonType: it.action.type ?? null,
|
|
290
|
+
drillable: isModalLayout(it.action)
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
return { id: it.id, groupId: it.groupId, kind, type: it.type ?? null };
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "describe_button_settings",
|
|
299
|
+
description: "Return one button's current action config values (including any trigger rows), its trigger-list field names, and the CEL scope for this actions bar: `celScope` lists every variable expressions here may reference (e.g. `row` for a table row action, `selected` / `query` for a table toolbar, `form` for a form field), and `celFunctions` is the operator & function catalog. Call this before configure_button to see what is set and what CEL you may write. Pass the item id from list_action_items (a top-level button or a dropdown sub-item).",
|
|
300
|
+
inputJsonSchema: {
|
|
301
|
+
type: "object",
|
|
302
|
+
properties: {
|
|
303
|
+
itemId: { type: "string", description: "A button item id from list_action_items." }
|
|
304
|
+
},
|
|
305
|
+
required: ["itemId"],
|
|
306
|
+
additionalProperties: false
|
|
307
|
+
},
|
|
308
|
+
execute: (input) => {
|
|
309
|
+
const { itemId } = input ?? {};
|
|
310
|
+
if (typeof itemId !== "string" || itemId.length === 0) {
|
|
311
|
+
return "describe_button_settings failed: `itemId` must be a non-empty string.";
|
|
312
|
+
}
|
|
313
|
+
const c = readContainer();
|
|
314
|
+
const loc = locateButton(c, itemId);
|
|
315
|
+
if (!loc || !isButton(loc.node)) {
|
|
316
|
+
return `describe_button_settings failed: no button with id "${itemId}". Call list_action_items to see ids.`;
|
|
317
|
+
}
|
|
318
|
+
const action = loc.node.action;
|
|
319
|
+
const entry = findButton(action.type, action.compatibilityDate) ?? activeButtons().find((b) => b.type === action.type);
|
|
320
|
+
const jsonSchema = entry ? safeJsonSchema(publicActionSchema(entry, deps.configure)) : "(schema unavailable)";
|
|
321
|
+
const { type: _t, compatibilityDate: _c, ...values } = action;
|
|
322
|
+
return {
|
|
323
|
+
buttonType: action.type,
|
|
324
|
+
values,
|
|
325
|
+
triggerFields: detectTriggerFields(jsonSchema),
|
|
326
|
+
schema: jsonSchema,
|
|
327
|
+
celScope: probeCelScope(deps.configure),
|
|
328
|
+
celFunctions: getCelCatalog()
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
// ---- 配置:分组 ----
|
|
333
|
+
{
|
|
334
|
+
name: "insert_action_group",
|
|
335
|
+
description: "Create a new empty button group and return its `id`. Buttons belong to a group; create one (or reuse an existing id from list_action_groups) before insert_button. `variant` optionally sets the group's default button variant.",
|
|
336
|
+
inputJsonSchema: {
|
|
337
|
+
type: "object",
|
|
338
|
+
properties: {
|
|
339
|
+
variant: {
|
|
340
|
+
type: "string",
|
|
341
|
+
enum: ["default", "primary", "destructive", "ghost", "link"],
|
|
342
|
+
description: "Optional default variant for buttons added to this group."
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
additionalProperties: false
|
|
346
|
+
},
|
|
347
|
+
execute: (input) => {
|
|
348
|
+
const { variant } = input ?? {};
|
|
349
|
+
const c = readContainer();
|
|
350
|
+
const groups = groupsOf(c);
|
|
351
|
+
const id = deps.genUuid();
|
|
352
|
+
const group = { id };
|
|
353
|
+
if (typeof variant === "string" && variant.length > 0) group.variant = variant;
|
|
354
|
+
commit(c, { groups: [...groups, group] });
|
|
355
|
+
return { id };
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: "delete_action_groups",
|
|
360
|
+
description: "Delete one or more button groups by id, along with every item inside them. Get ids from list_action_groups. On any unknown id the whole call is rejected without writing.",
|
|
361
|
+
inputJsonSchema: {
|
|
362
|
+
type: "object",
|
|
363
|
+
properties: {
|
|
364
|
+
ids: {
|
|
365
|
+
type: "array",
|
|
366
|
+
items: { type: "string", minLength: 1 },
|
|
367
|
+
minItems: 1,
|
|
368
|
+
description: "Group ids to delete. Get them from list_action_groups first."
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
required: ["ids"],
|
|
372
|
+
additionalProperties: false
|
|
373
|
+
},
|
|
374
|
+
execute: (input) => {
|
|
375
|
+
const raw = input ?? {};
|
|
376
|
+
const ids = raw.ids;
|
|
377
|
+
if (!Array.isArray(ids) || ids.length === 0) {
|
|
378
|
+
return "delete failed: `ids` must be a non-empty array of group ids.";
|
|
379
|
+
}
|
|
380
|
+
for (const id of ids) {
|
|
381
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
382
|
+
return "delete failed: every `ids` entry must be a non-empty string.";
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const c = readContainer();
|
|
386
|
+
const groups = groupsOf(c);
|
|
387
|
+
const existing = new Set(groups.map((g) => g.id));
|
|
388
|
+
for (const id of ids) {
|
|
389
|
+
if (!existing.has(id)) {
|
|
390
|
+
return `delete failed: group id "${id}" is not present. Call list_action_groups to see current ids.`;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
const drop = new Set(ids);
|
|
394
|
+
commit(c, {
|
|
395
|
+
groups: groups.filter((g) => !drop.has(g.id)),
|
|
396
|
+
items: itemsOf(c).filter((it) => !drop.has(it.groupId))
|
|
397
|
+
});
|
|
398
|
+
return { deleted: ids, count: ids.length };
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
// ---- 配置:按钮 / 下拉 ----
|
|
402
|
+
{
|
|
403
|
+
name: "insert_button",
|
|
404
|
+
description: 'Add one button of the given `type` (from list_available_button_types). The harness mints the id and seeds an empty title; the button\'s action config starts minimal (invalid until you fill required fields via configure_button \u2014 mirror the human "add then configure" flow). Pass `groupId` to add into an existing group, or omit it to create a fresh group for this button. Pass `dropdownId` to add the button as a sub-item inside an existing dropdown instead. `title` optionally sets the label. Returns the new item id; configure it with configure_button, and for a modal.layout button enter_node into it.',
|
|
405
|
+
inputJsonSchema: {
|
|
406
|
+
type: "object",
|
|
407
|
+
properties: {
|
|
408
|
+
type: { type: "string", description: "A button type from list_available_button_types." },
|
|
409
|
+
groupId: { type: "string", description: "Existing group id (from list_action_groups); omit to create a new group." },
|
|
410
|
+
dropdownId: { type: "string", description: "Add as a sub-item of this dropdown item instead of a top-level button." },
|
|
411
|
+
title: { type: "string", description: "Optional button label." }
|
|
412
|
+
},
|
|
413
|
+
required: ["type"],
|
|
414
|
+
additionalProperties: false
|
|
415
|
+
},
|
|
416
|
+
execute: (input) => {
|
|
417
|
+
const { type, groupId, dropdownId, title } = input ?? {};
|
|
418
|
+
if (typeof type !== "string" || type.length === 0) {
|
|
419
|
+
return "insert_button failed: `type` must be a non-empty string.";
|
|
420
|
+
}
|
|
421
|
+
const entry = activeButtons().find((b) => b.type === type);
|
|
422
|
+
if (!entry) {
|
|
423
|
+
return `insert_button failed: button type "${type}" is not available. Call list_available_button_types to see what is.`;
|
|
424
|
+
}
|
|
425
|
+
const c = readContainer();
|
|
426
|
+
const items = itemsOf(c);
|
|
427
|
+
const action = { type: entry.type, compatibilityDate: entry.compatibilityDate };
|
|
428
|
+
if (typeof dropdownId === "string" && dropdownId.length > 0) {
|
|
429
|
+
const idx = items.findIndex((it) => it.id === dropdownId);
|
|
430
|
+
if (idx < 0 || !isDropdown(items[idx])) {
|
|
431
|
+
return `insert_button failed: no dropdown with id "${dropdownId}". Call list_action_items to see dropdown ids.`;
|
|
432
|
+
}
|
|
433
|
+
const sub = { id: deps.genUuid(), title: toLocale(title), action };
|
|
434
|
+
const dd = items[idx];
|
|
435
|
+
const nextItems = items.map((it, i) => i === idx ? { ...dd, items: [...dd.items, sub] } : it);
|
|
436
|
+
commit(c, { items: nextItems });
|
|
437
|
+
return { id: sub.id, buttonType: type, dropdownId };
|
|
438
|
+
}
|
|
439
|
+
const groups = groupsOf(c);
|
|
440
|
+
let gid;
|
|
441
|
+
let nextGroups = groups;
|
|
442
|
+
if (typeof groupId === "string" && groupId.length > 0) {
|
|
443
|
+
if (!groups.some((g) => g.id === groupId)) {
|
|
444
|
+
return `insert_button failed: group id "${groupId}" is not present. Call list_action_groups, or omit groupId to create one.`;
|
|
445
|
+
}
|
|
446
|
+
gid = groupId;
|
|
447
|
+
} else {
|
|
448
|
+
gid = deps.genUuid();
|
|
449
|
+
nextGroups = [...groups, { id: gid }];
|
|
450
|
+
}
|
|
451
|
+
const item = { id: deps.genUuid(), groupId: gid, title: toLocale(title), action };
|
|
452
|
+
commit(c, { groups: nextGroups, items: [...items, item] });
|
|
453
|
+
return { id: item.id, buttonType: type, groupId: gid };
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
name: "insert_dropdown",
|
|
458
|
+
description: "Add an empty dropdown menu item to this actions bar. A dropdown groups several buttons behind one trigger; add buttons into it with insert_button ({ dropdownId }). Pass `groupId` to place it in an existing group, or omit to create a fresh group. `title` optionally sets the dropdown trigger label. Returns the new dropdown id.",
|
|
459
|
+
inputJsonSchema: {
|
|
460
|
+
type: "object",
|
|
461
|
+
properties: {
|
|
462
|
+
groupId: { type: "string", description: "Existing group id; omit to create a new group." },
|
|
463
|
+
title: { type: "string", description: "Optional dropdown trigger label." }
|
|
464
|
+
},
|
|
465
|
+
additionalProperties: false
|
|
466
|
+
},
|
|
467
|
+
execute: (input) => {
|
|
468
|
+
const { groupId, title } = input ?? {};
|
|
469
|
+
const c = readContainer();
|
|
470
|
+
const items = itemsOf(c);
|
|
471
|
+
const groups = groupsOf(c);
|
|
472
|
+
let gid;
|
|
473
|
+
let nextGroups = groups;
|
|
474
|
+
if (typeof groupId === "string" && groupId.length > 0) {
|
|
475
|
+
if (!groups.some((g) => g.id === groupId)) {
|
|
476
|
+
return `insert_dropdown failed: group id "${groupId}" is not present. Call list_action_groups, or omit groupId.`;
|
|
477
|
+
}
|
|
478
|
+
gid = groupId;
|
|
479
|
+
} else {
|
|
480
|
+
gid = deps.genUuid();
|
|
481
|
+
nextGroups = [...groups, { id: gid }];
|
|
482
|
+
}
|
|
483
|
+
const dropdown = { id: deps.genUuid(), groupId: gid, title: toLocale(title), items: [] };
|
|
484
|
+
commit(c, { groups: nextGroups, items: [...items, dropdown] });
|
|
485
|
+
return { id: dropdown.id, groupId: gid };
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "configure_button",
|
|
490
|
+
description: "Set a button's action config \u2014 its own fields (e.g. a request expression, a state path/value, a modal title) AND its trigger lists (`triggers` / `before` / `onSuccess` / \u2026 , each an ordered list of `{ target, operation, params, compatibilityDate }` rows). Pass `itemId` (a button or dropdown sub-item id) plus `values` with only the action fields you want to set; omitted fields keep their current value. Discover targets/operations with describe_event_targets + list_operations first \u2014 every trigger row's `target` MUST be an id from describe_event_targets and its `operation` one that target exposes (the tool rejects anything else, listing the valid options), and a parameterized operation's `params` are validated against its schema. On validation failure the tool returns the issues; fix and call again. (A modal.layout button's inner slot is configured by enter_node, not here.)",
|
|
491
|
+
inputJsonSchema: {
|
|
492
|
+
type: "object",
|
|
493
|
+
properties: {
|
|
494
|
+
itemId: { type: "string", description: "The button item id (from list_action_items)." },
|
|
495
|
+
values: {
|
|
496
|
+
type: "object",
|
|
497
|
+
description: "Action config fields to set (merged over current). See describe_specific_button_type for the contract.",
|
|
498
|
+
additionalProperties: true
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
required: ["itemId", "values"],
|
|
502
|
+
additionalProperties: false
|
|
503
|
+
},
|
|
504
|
+
execute: (input) => {
|
|
505
|
+
const { itemId, values } = input ?? {};
|
|
506
|
+
if (typeof itemId !== "string" || itemId.length === 0) {
|
|
507
|
+
return "configure_button failed: `itemId` must be a non-empty string.";
|
|
508
|
+
}
|
|
509
|
+
if (!values || typeof values !== "object" || Array.isArray(values)) {
|
|
510
|
+
return "configure_button failed: `values` must be an object of action fields.";
|
|
511
|
+
}
|
|
512
|
+
for (const k of ACTION_HARNESS_KEYS) {
|
|
513
|
+
if (k in values) {
|
|
514
|
+
return `configure_button failed: do not pass \`${k}\` \u2014 it is fixed by the button type.`;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
const c = readContainer();
|
|
518
|
+
const loc = locateButton(c, itemId);
|
|
519
|
+
if (!loc || !isButton(loc.node)) {
|
|
520
|
+
return `configure_button failed: no button with id "${itemId}". Call list_action_items to see ids.`;
|
|
521
|
+
}
|
|
522
|
+
const action = loc.node.action;
|
|
523
|
+
const entry = findButton(action.type, action.compatibilityDate) ?? activeButtons().find((b) => b.type === action.type);
|
|
524
|
+
if (!entry) {
|
|
525
|
+
return `configure_button failed: this button's type "${action.type}" is no longer available.`;
|
|
526
|
+
}
|
|
527
|
+
const schema = publicActionSchema(entry, deps.configure);
|
|
528
|
+
const { type: _t, compatibilityDate: _c, ...current } = action;
|
|
529
|
+
const verdict = decode(schema, { ...current, ...values });
|
|
530
|
+
if (!verdict.ok) {
|
|
531
|
+
return `configure_button failed for "${entry.type}". Fix these and call configure_button again:
|
|
532
|
+
${verdict.report}`;
|
|
533
|
+
}
|
|
534
|
+
const triggerReport = validateTriggerRows(verdict.value, deps.eventTargets?.(), deps.configure);
|
|
535
|
+
if (triggerReport !== null) {
|
|
536
|
+
return `configure_button failed for "${entry.type}". Fix these and call configure_button again:
|
|
537
|
+
${triggerReport}`;
|
|
538
|
+
}
|
|
539
|
+
for (const v of Object.values(verdict.value)) {
|
|
540
|
+
if (!Array.isArray(v) || v.length === 0) continue;
|
|
541
|
+
if (!v.every((x) => x && typeof x === "object" && typeof x.target === "string" && typeof x.operation === "string")) continue;
|
|
542
|
+
v.forEach((row, i) => {
|
|
543
|
+
if (typeof row.id !== "string" || row.id.length === 0) {
|
|
544
|
+
v[i] = { ...row, id: deps.genUuid() };
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
loc.replace({ ...loc.node, action: { type: entry.type, compatibilityDate: entry.compatibilityDate, ...verdict.value } });
|
|
549
|
+
deps.write(c);
|
|
550
|
+
return { id: itemId, buttonType: entry.type };
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
name: "set_action_item",
|
|
555
|
+
description: "Set a button item's shell (chrome) fields \u2014 everything but its action: `title` (label), `icon`, `variant`, `hideTitle` (icon-only), and the CEL `hidden` / `disabled` conditions (each an expression returning bool). Pass `itemId` plus only the fields to change. Use configure_button for the button's behaviour; use this for how it looks. On a CEL error the tool returns the issue; fix and call again.",
|
|
556
|
+
inputJsonSchema: {
|
|
557
|
+
type: "object",
|
|
558
|
+
properties: {
|
|
559
|
+
itemId: { type: "string", description: "The button item id (from list_action_items)." },
|
|
560
|
+
title: { type: "string", description: "Button label." },
|
|
561
|
+
icon: { type: "string", description: "Iconify icon id, e.g. `fluent:search-20-regular`." },
|
|
562
|
+
variant: { type: "string", enum: ["default", "primary", "destructive", "ghost", "link"] },
|
|
563
|
+
hideTitle: { type: "boolean", description: "Show only the icon." },
|
|
564
|
+
hidden: { type: "string", description: "CEL bool expression; true \u2192 button hidden." },
|
|
565
|
+
disabled: { type: "string", description: "CEL bool expression; true \u2192 button visible but disabled." }
|
|
566
|
+
},
|
|
567
|
+
required: ["itemId"],
|
|
568
|
+
additionalProperties: false
|
|
569
|
+
},
|
|
570
|
+
execute: (input) => {
|
|
571
|
+
const raw = input ?? {};
|
|
572
|
+
const { itemId } = raw;
|
|
573
|
+
if (typeof itemId !== "string" || itemId.length === 0) {
|
|
574
|
+
return "set_action_item failed: `itemId` must be a non-empty string.";
|
|
575
|
+
}
|
|
576
|
+
const c = readContainer();
|
|
577
|
+
const loc = locateButton(c, itemId);
|
|
578
|
+
if (!loc || !isButton(loc.node)) {
|
|
579
|
+
return `set_action_item failed: no button with id "${itemId}". Call list_action_items to see ids.`;
|
|
580
|
+
}
|
|
581
|
+
for (const k of ["hidden", "disabled"]) {
|
|
582
|
+
const v = raw[k];
|
|
583
|
+
if (v === void 0) continue;
|
|
584
|
+
if (typeof v !== "string") return `set_action_item failed: \`${k}\` must be a string CEL expression.`;
|
|
585
|
+
if (v.length === 0) continue;
|
|
586
|
+
const res = Schema.decodeUnknownEither(CelBool)(v);
|
|
587
|
+
if (res._tag === "Left") {
|
|
588
|
+
const msg = ParseResult.ArrayFormatter.formatErrorSync(res.left)[0]?.message ?? "invalid";
|
|
589
|
+
return `set_action_item failed. Fix this and call again:
|
|
590
|
+
- ${k}: ${msg}`;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const next = { ...loc.node };
|
|
594
|
+
if (typeof raw.title === "string") next.title = toLocale(raw.title);
|
|
595
|
+
if (typeof raw.icon === "string") next.icon = raw.icon;
|
|
596
|
+
if (typeof raw.variant === "string") next.variant = raw.variant;
|
|
597
|
+
if (typeof raw.hideTitle === "boolean") next.hideTitle = raw.hideTitle;
|
|
598
|
+
for (const k of ["hidden", "disabled"]) {
|
|
599
|
+
const v = raw[k];
|
|
600
|
+
if (typeof v !== "string") continue;
|
|
601
|
+
if (v.length === 0) Reflect.deleteProperty(next, k);
|
|
602
|
+
else next[k] = v;
|
|
603
|
+
}
|
|
604
|
+
loc.replace(next);
|
|
605
|
+
deps.write(c);
|
|
606
|
+
return { id: itemId };
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: "delete_action_items",
|
|
611
|
+
description: "Delete one or more items by id \u2014 a top-level button, a dropdown, or a dropdown sub-item. Get ids from list_action_items. On any unknown id the whole call is rejected without writing. Deleting the last item of a group leaves the (empty) group; delete it separately with delete_action_groups.",
|
|
612
|
+
inputJsonSchema: {
|
|
613
|
+
type: "object",
|
|
614
|
+
properties: {
|
|
615
|
+
ids: {
|
|
616
|
+
type: "array",
|
|
617
|
+
items: { type: "string", minLength: 1 },
|
|
618
|
+
minItems: 1,
|
|
619
|
+
description: "Item ids to delete. Get them from list_action_items first."
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
required: ["ids"],
|
|
623
|
+
additionalProperties: false
|
|
624
|
+
},
|
|
625
|
+
execute: (input) => {
|
|
626
|
+
const raw = input ?? {};
|
|
627
|
+
const ids = raw.ids;
|
|
628
|
+
if (!Array.isArray(ids) || ids.length === 0) {
|
|
629
|
+
return "delete failed: `ids` must be a non-empty array of item ids.";
|
|
630
|
+
}
|
|
631
|
+
for (const id of ids) {
|
|
632
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
633
|
+
return "delete failed: every `ids` entry must be a non-empty string.";
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
const seen = /* @__PURE__ */ new Set();
|
|
637
|
+
for (const id of ids) {
|
|
638
|
+
if (seen.has(id)) return `delete failed: duplicate id "${id}" in input \u2014 dedupe and call again.`;
|
|
639
|
+
seen.add(id);
|
|
640
|
+
}
|
|
641
|
+
const c = readContainer();
|
|
642
|
+
const items = itemsOf(c);
|
|
643
|
+
const known = /* @__PURE__ */ new Set();
|
|
644
|
+
for (const it of items) {
|
|
645
|
+
known.add(it.id);
|
|
646
|
+
if (isDropdown(it)) for (const s of it.items) known.add(s.id);
|
|
647
|
+
}
|
|
648
|
+
for (const id of ids) {
|
|
649
|
+
if (!known.has(id)) {
|
|
650
|
+
return `delete failed: item id "${id}" is not present. Call list_action_items to see current ids.`;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
const drop = new Set(ids);
|
|
654
|
+
const nextItems = items.filter((it) => !drop.has(it.id)).map((it) => {
|
|
655
|
+
if (!isDropdown(it)) return it;
|
|
656
|
+
const subs = it.items.filter((s) => !drop.has(s.id));
|
|
657
|
+
return subs.length === it.items.length ? it : { ...it, items: subs };
|
|
658
|
+
});
|
|
659
|
+
commit(c, { items: nextItems });
|
|
660
|
+
return { deleted: ids, count: ids.length };
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
];
|
|
664
|
+
}
|