@shwfed/config 3.0.7 → 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.
Files changed (246) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/ai-l1.md +24 -0
  3. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.d.ts +1 -0
  4. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/schema.js +2 -1
  5. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/prompt.md +8 -0
  6. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +6 -0
  7. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +4 -0
  8. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/prompt.md +8 -0
  9. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +1 -0
  10. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +2 -1
  11. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/prompt.md +9 -0
  12. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.d.ts +1 -0
  13. package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/schema.js +2 -1
  14. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/prompt.md +8 -0
  15. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.d.ts +1 -0
  16. package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.js +2 -1
  17. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.d.ts +1 -0
  18. package/dist/runtime/components/actions/items/2026-05-21/com.shwfed.actions.item.markdown/schema.js +2 -1
  19. package/dist/runtime/components/actions/utils/ai-button-tools.d.ts +29 -0
  20. package/dist/runtime/components/actions/utils/ai-button-tools.js +664 -0
  21. package/dist/runtime/components/actions/utils/resolve.d.ts +22 -0
  22. package/dist/runtime/components/actions/utils/resolve.js +23 -1
  23. package/dist/runtime/components/config/ai-generate.d.vue.ts +7 -0
  24. package/dist/runtime/components/config/ai-generate.system.md +39 -0
  25. package/dist/runtime/components/{table → config}/ai-generate.vue +55 -32
  26. package/dist/runtime/components/config/ai-generate.vue.d.ts +7 -0
  27. package/dist/runtime/components/config/ai-page-slot.l1.md +25 -0
  28. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.d.ts +6 -0
  29. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.actions/schema.js +4 -0
  30. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +6 -0
  31. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.js +4 -0
  32. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.d.ts +1 -0
  33. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.js +1 -0
  34. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +58 -58
  35. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +58 -58
  36. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +58 -58
  37. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +58 -58
  38. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +35 -29
  39. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.js +4 -0
  40. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.d.ts +7 -0
  41. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.js +4 -0
  42. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +1 -0
  43. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +1 -0
  44. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.d.ts +1 -0
  45. package/dist/runtime/components/config/blocks/2026-06-01/com.shwfed.block.animated.number/schema.js +1 -0
  46. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.d.ts +6 -0
  47. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +4 -0
  48. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.d.ts +1 -0
  49. package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.js +1 -0
  50. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.d.vue.ts +18 -18
  51. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue.d.ts +18 -18
  52. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.d.vue.ts +18 -18
  53. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue.d.ts +18 -18
  54. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts +6 -0
  55. package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.js +4 -0
  56. package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.d.ts +7 -0
  57. package/dist/runtime/components/config/blocks/2026-06-25/com.shwfed.block.loop/schema.js +4 -0
  58. package/dist/runtime/components/config/config.vue +24 -3
  59. package/dist/runtime/components/config/use-editor.d.ts +1 -0
  60. package/dist/runtime/components/config/use-editor.js +18 -0
  61. package/dist/runtime/components/config/utils/ai-cursor.d.ts +21 -0
  62. package/dist/runtime/components/config/utils/ai-cursor.js +827 -0
  63. package/dist/runtime/components/config/utils/ai-host-manuals.d.ts +2 -0
  64. package/dist/runtime/components/config/utils/ai-host-manuals.js +19 -0
  65. package/dist/runtime/components/config/utils/linkage.d.ts +15 -6
  66. package/dist/runtime/components/config/utils/linkage.js +23 -7
  67. package/dist/runtime/components/config/utils/resolve.d.ts +19 -0
  68. package/dist/runtime/components/config/utils/resolve.js +25 -2
  69. package/dist/runtime/components/form/ai-l1.md +22 -0
  70. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.d.ts +1 -0
  71. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.js +1 -0
  72. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +1 -0
  73. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +1 -0
  74. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +1 -0
  75. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +1 -0
  76. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +7 -0
  77. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.js +4 -0
  78. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +1 -0
  79. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +1 -0
  80. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +1 -0
  81. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +1 -0
  82. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +1 -0
  83. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +1 -0
  84. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +1 -0
  85. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +1 -0
  86. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +1 -0
  87. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +1 -0
  88. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +1 -0
  89. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +1 -0
  90. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +1 -0
  91. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +1 -0
  92. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +1 -0
  93. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +1 -0
  94. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +1 -0
  95. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +1 -0
  96. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +1 -0
  97. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +1 -0
  98. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/prompt.md +8 -0
  99. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +7 -0
  100. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +4 -0
  101. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +1 -0
  102. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +1 -0
  103. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +1 -0
  104. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +1 -0
  105. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/prompt.md +12 -0
  106. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +6 -0
  107. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -0
  108. package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.d.ts +6 -0
  109. package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.js +4 -0
  110. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
  111. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
  112. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +1 -0
  113. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.js +1 -0
  114. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +1 -0
  115. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.js +1 -0
  116. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
  117. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
  118. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
  119. package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
  120. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +26 -26
  121. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +26 -26
  122. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/prompt.md +7 -0
  123. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +1 -0
  124. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +1 -0
  125. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +26 -26
  126. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +26 -26
  127. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/prompt.md +7 -0
  128. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +1 -0
  129. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +1 -0
  130. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +26 -26
  131. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +26 -26
  132. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/prompt.md +9 -0
  133. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +1 -0
  134. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +1 -0
  135. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +26 -26
  136. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +26 -26
  137. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/prompt.md +11 -0
  138. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +1 -0
  139. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +1 -0
  140. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/prompt.md +12 -0
  141. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.d.ts +1 -0
  142. package/dist/runtime/components/form/fields/2026-06-09/com.shwfed.form.field.upload/schema.js +1 -0
  143. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/prompt.md +14 -0
  144. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.d.ts +1 -0
  145. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.multi/schema.js +1 -0
  146. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/prompt.md +19 -0
  147. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.d.ts +1 -0
  148. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/schema.js +1 -0
  149. package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.d.ts +7 -0
  150. package/dist/runtime/components/form/fields/2026-06-20/com.shwfed.form.field.tabs/schema.js +4 -0
  151. package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/prompt.md +14 -0
  152. package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.d.ts +1 -0
  153. package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.js +1 -0
  154. package/dist/runtime/components/form/utils/ai-field-tools.d.ts +2 -2
  155. package/dist/runtime/components/form/utils/ai-field-tools.js +47 -30
  156. package/dist/runtime/components/form/utils/resolve.d.ts +11 -0
  157. package/dist/runtime/components/form/utils/resolve.js +13 -1
  158. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.d.ts +1 -0
  159. package/dist/runtime/components/operations/2026-06-09/com.shwfed.operation.alert/schema.js +2 -1
  160. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.d.ts +1 -0
  161. package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +1 -0
  162. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.d.ts +1 -0
  163. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js +2 -1
  164. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.d.ts +1 -0
  165. package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.js +2 -1
  166. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.d.ts +1 -0
  167. package/dist/runtime/components/operations/2026-07-06/com.shwfed.operation.table.add-row/schema.js +2 -1
  168. package/dist/runtime/components/operations/utils/resolve.d.ts +17 -0
  169. package/dist/runtime/components/operations/utils/resolve.js +18 -1
  170. package/dist/runtime/components/table/ai-l1.md +38 -0
  171. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.d.ts +7 -0
  172. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/schema.js +5 -1
  173. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +1 -0
  174. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.js +2 -1
  175. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +1 -0
  176. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.js +2 -1
  177. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.d.ts +1 -0
  178. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.js +2 -1
  179. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +1 -0
  180. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.js +2 -1
  181. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +1 -0
  182. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +2 -1
  183. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +1 -0
  184. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +2 -1
  185. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +1 -0
  186. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.js +2 -1
  187. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +1 -0
  188. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +2 -1
  189. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +1 -0
  190. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +2 -1
  191. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +1 -0
  192. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +2 -1
  193. package/dist/runtime/components/table/columns/2026-05-21/com.shwfed.table.column.drag-handle/schema.d.ts +1 -0
  194. package/dist/runtime/components/table/columns/2026-05-21/com.shwfed.table.column.drag-handle/schema.js +2 -1
  195. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  196. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  197. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  198. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  199. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  200. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  201. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  202. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  203. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/prompt.md +12 -0
  204. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
  205. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/schema.js +1 -0
  206. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/prompt.md +16 -0
  207. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
  208. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/schema.js +1 -0
  209. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +10 -10
  210. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +10 -10
  211. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
  212. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +1 -0
  213. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +10 -10
  214. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +10 -10
  215. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
  216. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +1 -0
  217. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +1 -0
  218. package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +2 -1
  219. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.d.ts +1 -0
  220. package/dist/runtime/components/table/columns/2026-06-22/com.shwfed.table.column.date-range-input/schema.js +2 -1
  221. package/dist/runtime/components/table/columns/2026-07-12/com.shwfed.table.column.dynamic/prompt.md +15 -0
  222. package/dist/runtime/components/table/config.d.vue.ts +3 -3
  223. package/dist/runtime/components/table/config.vue +1 -33
  224. package/dist/runtime/components/table/config.vue.d.ts +3 -3
  225. package/dist/runtime/components/table/row-provider.vue +7 -1
  226. package/dist/runtime/components/table/schema.d.ts +58 -58
  227. package/dist/runtime/components/table/utils/ai-tools.js +16 -7
  228. package/dist/runtime/components/table/utils/resolve.d.ts +5 -0
  229. package/dist/runtime/components/table/utils/resolve.js +12 -1
  230. package/dist/runtime/share/define-registry.d.ts +66 -0
  231. package/dist/runtime/share/define-registry.js +37 -1
  232. package/dist/runtime/share/use-persisted-chat.d.ts +11 -9
  233. package/dist/runtime/share/use-persisted-chat.js +3 -3
  234. package/dist/runtime/utils/ai/index.d.ts +1 -1
  235. package/dist/runtime/utils/ai/index.js +18 -11
  236. package/dist/runtime/utils/cel-catalog.d.ts +1 -0
  237. package/dist/runtime/utils/cel-catalog.js +10 -0
  238. package/dist/runtime/utils/cel-catalog.md +42 -0
  239. package/dist/runtime/utils/cel-context.d.ts +15 -0
  240. package/dist/runtime/utils/cel-context.js +8 -0
  241. package/package.json +1 -1
  242. package/dist/runtime/components/table/ai-generate.d.vue.ts +0 -16
  243. package/dist/runtime/components/table/ai-generate.system.md +0 -101
  244. package/dist/runtime/components/table/ai-generate.vue.d.ts +0 -16
  245. /package/dist/runtime/components/{table → config}/ai-generate.system.d.ts +0 -0
  246. /package/dist/runtime/components/{table → config}/ai-generate.system.js +0 -0
@@ -3,6 +3,7 @@ import type { Schema, Effect } from 'effect';
3
3
  import type { ColumnDef } from '@tanstack/vue-table';
4
4
  import type { Environment } from '../../../vendor/cel-js/lib/index.js';
5
5
  import type { LocaleValue } from '../../../share/locale.js';
6
+ import { type RegistryEdge } from '../../../share/define-registry.js';
6
7
  import type { ColumnValue } from '../schema.js';
7
8
  type CelEvaluator = <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, any>;
8
9
  type AnySchema = Schema.Schema<any, any, never>;
@@ -159,6 +160,10 @@ export type ColumnEntry = Readonly<{
159
160
  * `enableRowSelection`. See `ColumnRowSelection`.
160
161
  */
161
162
  rowSelection?: ColumnRowSelection;
163
+ /** The column's `prompt.md` (L2 fragment) raw text, surfaced by the AI describe tool. */
164
+ prompt?: string;
165
+ /** Recursion edges the AI scope cursor walks (empty for leaf columns). */
166
+ edges: ReadonlyArray<RegistryEdge>;
162
167
  }>;
163
168
  export declare const COLUMNS: ReadonlyArray<ColumnEntry>;
164
169
  export declare function allColumnSchemas(configure: (env: Environment) => void): ReadonlyArray<AnySchema>;
@@ -11,6 +11,10 @@ const runtimeModules = import.meta.glob(
11
11
  "../columns/*/*/runtime.vue",
12
12
  { eager: true, import: "default", exhaustive: true }
13
13
  );
14
+ const promptModules = import.meta.glob(
15
+ "../columns/*/*/prompt.md",
16
+ { eager: true, query: "?raw", import: "default", exhaustive: true }
17
+ );
14
18
  const sourceKey = (type, compatibilityDate) => `${type}@${compatibilityDate}`;
15
19
  const registry = defineRegistry({
16
20
  hostName: "shwfed-table",
@@ -18,6 +22,7 @@ const registry = defineRegistry({
18
22
  schemaModules,
19
23
  configModules,
20
24
  runtimeModules,
25
+ promptModules,
21
26
  validateModule: (mod, type, date) => {
22
27
  const hasToColumnDef = typeof mod.toColumnDef === "function";
23
28
  const hasExpand = typeof mod.expand === "function";
@@ -30,6 +35,10 @@ const registry = defineRegistry({
30
35
  // Generator (`expand`) entries have no cell renderer, so they need no
31
36
  // sibling `runtime.vue`. Every other column keeps requiring one.
32
37
  runtimeOptional: (mod) => typeof mod.expand === "function",
38
+ // Validate declared `edges` keys against the built schema (only column.actions
39
+ // declares one today). Inert configure — the edge check only reads field names.
40
+ buildSchemaForEdges: (mod) => mod.schema(() => {
41
+ }),
33
42
  // Deprecation rules mirror the form host:
34
43
  // (a) date-versioned: another entry shares this entry's `type` with a
35
44
  // strictly greater `compatibilityDate`;
@@ -80,13 +89,15 @@ export const COLUMNS = registry.ENTRIES.map((e) => ({
80
89
  config: e.config,
81
90
  runtime: e.runtime,
82
91
  toColumnDef: e.module.toColumnDef,
92
+ edges: e.module.edges ?? [],
83
93
  deprecated: e.deprecated,
84
94
  ...e.supersededBy !== void 0 ? { supersededBy: e.supersededBy } : {},
85
95
  ...e.module.migrate !== void 0 ? { migrate: e.module.migrate } : {},
86
96
  ...e.module.migrateFrom !== void 0 ? { migrateFrom: e.module.migrateFrom } : {},
87
97
  ...e.module.defaults !== void 0 ? { defaults: e.module.defaults } : {},
88
98
  ...e.module.expand !== void 0 ? { expand: e.module.expand } : {},
89
- ...e.module.rowSelection !== void 0 ? { rowSelection: e.module.rowSelection } : {}
99
+ ...e.module.rowSelection !== void 0 ? { rowSelection: e.module.rowSelection } : {},
100
+ ...e.prompt !== void 0 ? { prompt: e.prompt } : {}
90
101
  }));
91
102
  const migrationTargets = (() => {
92
103
  const map = /* @__PURE__ */ new Map();
@@ -1,4 +1,40 @@
1
1
  import type { Component } from 'vue';
2
+ import type { Schema } from 'effect';
3
+ type AnySchema = Schema.Schema<any, any, any>;
4
+ /**
5
+ * A recursion edge: a schema field on this block/host that embeds ANOTHER
6
+ * host's config (a table's `TableConfig`, a container's `Slot`, an actions
7
+ * bar's `ActionsConfig`…). Declared next to the schema — NEVER in a central
8
+ * table (that switch would be the drift class CLAUDE.md bans) — and aggregated
9
+ * by the registry so the AI scope cursor can walk them (`config/utils/ai-cursor`).
10
+ *
11
+ * - `key` — the schema field holding the embedded config. Validated at registry
12
+ * load (see `buildSchemaForEdges`): the declared key MUST be a real top-level
13
+ * field on the block's schema, exactly like the type/date drift checks.
14
+ * - `host` — the host kind whose tool family configures that subtree
15
+ * (`table` / `form` / `actions` / `slot`). The cursor maps this to a family;
16
+ * hosts with no family yet stay declared-but-not-enterable (Phase C).
17
+ * - `label` — designer-facing crumb for the edge (breadcrumb / orientation).
18
+ * - `itemSlot` — set when `key` is an ARRAY of items and the embedded host
19
+ * config lives at `item[itemSlot]` on each element (tabs: `key: 'tabs'`,
20
+ * `itemSlot: 'slot'`). Absent → `key` holds the embedded config directly.
21
+ * - `self` — set when the embedded host config is NOT under a sub-field but the
22
+ * record ITSELF (its fields spread the embedded host's fields, as `field.actions`
23
+ * / `column.actions` spread `ActionSchemaFields` at the top level). `key` still
24
+ * names a real field (for the load-time existence check), but the cursor bridges
25
+ * the whole record and the family merges its keys back (`config/utils/ai-cursor`).
26
+ * - `celScope` — names a per-edge CEL scope extension the cursor threads into the
27
+ * child frame's `configure` when entering (`loop-item` → `item`/`index`). Absent
28
+ * → the child inherits the parent scope unchanged. See design §5.
29
+ */
30
+ export type RegistryEdge = Readonly<{
31
+ key: string;
32
+ host: string;
33
+ label: string;
34
+ itemSlot?: string;
35
+ self?: boolean;
36
+ celScope?: string;
37
+ }>;
2
38
  /**
3
39
  * Minimum shape every host's schema module must satisfy. Hosts extend this
4
40
  * with their own metadata / capability fields via the generic.
@@ -6,6 +42,13 @@ import type { Component } from 'vue';
6
42
  export type RegistryModuleBase = Readonly<{
7
43
  type: string;
8
44
  compatibilityDate: string;
45
+ /**
46
+ * Optional recursion-edge declarations — a block/host embedding another
47
+ * host's config lists them here (see `RegistryEdge`). Validated at load when
48
+ * the host supplies `buildSchemaForEdges`; otherwise carried through
49
+ * unvalidated. Absent for leaf and generator entries.
50
+ */
51
+ edges?: ReadonlyArray<RegistryEdge>;
9
52
  }>;
10
53
  /**
11
54
  * Per-entry shape produced by the factory before host-specific extras are
@@ -18,6 +61,8 @@ export type RegistryDraft<TModule extends RegistryModuleBase> = Readonly<{
18
61
  config: Component;
19
62
  runtime: Component;
20
63
  module: TModule;
64
+ /** The sibling `prompt.md`'s raw text (L2 fragment), when one exists. */
65
+ prompt?: string;
21
66
  }>;
22
67
  export type RegistryOptions<TModule extends RegistryModuleBase, TEntryExtras extends object> = Readonly<{
23
68
  /** Error-message prefix, e.g. `shwfed-form`. */
@@ -30,12 +75,30 @@ export type RegistryOptions<TModule extends RegistryModuleBase, TEntryExtras ext
30
75
  configModules: Record<string, Component>;
31
76
  /** Eager `import.meta.glob` over the host's runtime.vue files (default import). */
32
77
  runtimeModules: Record<string, Component>;
78
+ /**
79
+ * Optional eager `import.meta.glob` over the host's sibling `prompt.md` files
80
+ * ({ query: '?raw', import: 'default', eager: true }), keyed by path exactly
81
+ * like `schemaModules`. Each entry's `prompt` is looked up from here by the
82
+ * same folder-suffix match. `prompt.md` is OPTIONAL per folder — an absent one
83
+ * leaves `entry.prompt` undefined. No dist extension tolerance is needed
84
+ * (unlike `schema.{ts,js}`): `@nuxt/module-builder` transpiles `.ts`→`.js` but
85
+ * copies `.md` verbatim, so the `.md` suffix is stable in source and `dist`.
86
+ */
87
+ promptModules?: Record<string, string>;
33
88
  /**
34
89
  * Optional per-module validation beyond the type/date drift checks. Throw
35
90
  * to fail at module load. Used by table to require `toColumnDef`
36
91
  * to be a function.
37
92
  */
38
93
  validateModule?: (mod: TModule, type: string, date: string) => void;
94
+ /**
95
+ * Optional builder that constructs a module's schema with INERT args (a
96
+ * no-op configure, a stand-in `blockRef`) purely so the registry can verify
97
+ * every declared `edges[].key` is a real top-level field on it — the
98
+ * edge-declaration analog of the type/date drift check. Only invoked for
99
+ * modules that declare `edges`. Omit → edges are carried through unvalidated.
100
+ */
101
+ buildSchemaForEdges?: (mod: TModule) => AnySchema;
39
102
  /**
40
103
  * Optional predicate deciding whether a given module may ship WITHOUT a
41
104
  * sibling `runtime.vue`. Returns true → the runtime lookup is tolerant and
@@ -60,9 +123,12 @@ export type RegistryEntry<TModule extends RegistryModuleBase, TEntryExtras exten
60
123
  config: Component;
61
124
  runtime: Component;
62
125
  module: TModule;
126
+ /** The sibling `prompt.md`'s raw text (L2 fragment), when one exists. */
127
+ prompt?: string;
63
128
  } & TEntryExtras>;
64
129
  export type Registry<TModule extends RegistryModuleBase, TEntryExtras extends object> = Readonly<{
65
130
  ENTRIES: ReadonlyArray<RegistryEntry<TModule, TEntryExtras>>;
66
131
  find: (type: string, compatibilityDate: string) => RegistryEntry<TModule, TEntryExtras> | undefined;
67
132
  }>;
68
133
  export declare function defineRegistry<TModule extends RegistryModuleBase, TEntryExtras extends object = Record<never, never>>(options: RegistryOptions<TModule, TEntryExtras>): Registry<TModule, TEntryExtras>;
134
+ export {};
@@ -1,3 +1,21 @@
1
+ function topLevelFieldNames(schema) {
2
+ const unwrap = (ast) => {
3
+ switch (ast._tag) {
4
+ case "TypeLiteral":
5
+ return ast;
6
+ case "Transformation":
7
+ return unwrap(ast.to);
8
+ case "Refinement":
9
+ return unwrap(ast.from);
10
+ case "Suspend":
11
+ return unwrap(ast.f());
12
+ default:
13
+ return null;
14
+ }
15
+ };
16
+ const tl = unwrap(schema.ast);
17
+ return tl ? tl.propertySignatures.map((p) => String(p.name)) : [];
18
+ }
1
19
  export function defineRegistry(options) {
2
20
  const {
3
21
  hostName,
@@ -5,7 +23,9 @@ export function defineRegistry(options) {
5
23
  schemaModules,
6
24
  configModules,
7
25
  runtimeModules,
26
+ promptModules,
8
27
  validateModule,
28
+ buildSchemaForEdges,
9
29
  runtimeOptional,
10
30
  deriveEntryExtras
11
31
  } = options;
@@ -27,6 +47,18 @@ export function defineRegistry(options) {
27
47
  if (found === void 0) throw new Error(`[${hostName}] missing ${file} for ${type}@${date}`);
28
48
  return found;
29
49
  };
50
+ const validateEdges = (mod, type, date) => {
51
+ const edges = mod.edges;
52
+ if (!edges || edges.length === 0 || !buildSchemaForEdges) return;
53
+ const fields = new Set(topLevelFieldNames(buildSchemaForEdges(mod)));
54
+ for (const edge of edges) {
55
+ if (!fields.has(edge.key)) {
56
+ throw new Error(
57
+ `[${hostName}] edge key "${edge.key}" declared on "${type}@${date}" is not a field on its schema (has: ${[...fields].join(", ") || "<none>"})`
58
+ );
59
+ }
60
+ }
61
+ };
30
62
  let cached = null;
31
63
  const compute = () => {
32
64
  if (cached) return cached;
@@ -40,13 +72,16 @@ export function defineRegistry(options) {
40
72
  throw new Error(`[${hostName}] compatibilityDate "${mod.compatibilityDate}" does not match folder "${date}"`);
41
73
  }
42
74
  validateModule?.(mod, type, date);
75
+ validateEdges(mod, type, date);
43
76
  const runtime = runtimeOptional?.(mod) ? findSiblingOptional(runtimeModules, date, type, "runtime.vue") : findSibling(runtimeModules, date, type, "runtime.vue");
44
77
  drafts.push({
45
78
  type: mod.type,
46
79
  compatibilityDate: mod.compatibilityDate,
47
80
  config: findSibling(configModules, date, type, "config.vue"),
48
81
  runtime,
49
- module: mod
82
+ module: mod,
83
+ // `prompt.md` is optional per folder; absent → undefined.
84
+ ...promptModules ? { prompt: findSiblingOptional(promptModules, date, type, "prompt.md") } : {}
50
85
  });
51
86
  }
52
87
  const mapExtras = deriveEntryExtras ? deriveEntryExtras(drafts) : () => ({});
@@ -56,6 +91,7 @@ export function defineRegistry(options) {
56
91
  config: draft.config,
57
92
  runtime: draft.runtime,
58
93
  module: draft.module,
94
+ ...draft.prompt !== void 0 ? { prompt: draft.prompt } : {},
59
95
  ...mapExtras(draft)
60
96
  }));
61
97
  return cached;
@@ -1,16 +1,18 @@
1
1
  import { type Ref } from 'vue';
2
2
  import type { UIMessage } from '../utils/ai/parts.js';
3
3
  /**
4
- * Mirrors a table editor's AI-chat history into `sessionStorage`, keyed on the
5
- * table's stable `config.id`, so the conversation survives both the chat
6
- * component unmounting — switching away from the "AI 生成" section `v-if`-
7
- * unmounts `<TableAiGenerate>`, dropping its local `ref<UIMessage[]>` — and a
8
- * page reload. It clears when the browser tab is closed (`sessionStorage`
9
- * lifetime), giving each table a per-instance, session-scoped chat memory.
4
+ * Mirrors an AI-chat history into `sessionStorage`, keyed on a stable id (the
5
+ * top-level config panel uses `location.pathname`), so the conversation survives
6
+ * both the chat component unmounting — switching away from the AI view
7
+ * `v-if`-unmounts it, dropping its local `ref<UIMessage[]>` — and a page reload.
8
+ * It clears when the browser tab is closed (`sessionStorage` lifetime), giving a
9
+ * per-instance, session-scoped chat memory. (Originally built for the table AI
10
+ * panel, removed in Phase C; now serves the top-level `config/ai-generate.vue`.)
10
11
  *
11
12
  * Modeled on `usePersistedQuery`: every access is SSR-guarded and guarded
12
- * against unavailable storage (privacy modes). With no `tableId()` persistence
13
- * is a no-op (in-memory only) so id-less drafts can't collide on a shared key.
13
+ * against unavailable storage (privacy modes). With no `tableId()` (the key
14
+ * getter a misnomer kept from its table origin) persistence is a no-op
15
+ * (in-memory only) so id-less drafts can't collide on a shared key.
14
16
  *
15
17
  * - `restore()` seeds `messages` from the stored snapshot. Call it in
16
18
  * `onMounted`, after the fresh component's empty ref exists, so a remount
@@ -24,7 +26,7 @@ import type { UIMessage } from '../utils/ai/parts.js';
24
26
  * replays history as prose only (`partsToText` in `utils/ai`), so a continued
25
27
  * conversation never re-sends a dangling tool_use across the restore boundary.
26
28
  */
27
- export declare function usePersistedChat(tableId: () => string | undefined, messages: Ref<UIMessage[]>): {
29
+ export declare function usePersistedChat(tableId: () => string | undefined, messages: Ref<UIMessage[]>, keyPrefix?: string): {
28
30
  restore: () => void;
29
31
  clear: () => void;
30
32
  };
@@ -1,7 +1,7 @@
1
1
  import { watch } from "vue";
2
2
  const STORAGE_PREFIX = "shwfed.table.ai-chat.";
3
- export function usePersistedChat(tableId, messages) {
4
- const key = () => `${STORAGE_PREFIX}${tableId()}`;
3
+ export function usePersistedChat(tableId, messages, keyPrefix = STORAGE_PREFIX) {
4
+ const key = () => `${keyPrefix}${tableId()}`;
5
5
  const active = () => Boolean(tableId()) && typeof window !== "undefined";
6
6
  function restore() {
7
7
  if (!active()) return;
@@ -18,7 +18,7 @@ export function usePersistedChat(tableId, messages) {
18
18
  const id = tableId();
19
19
  if (!id) return;
20
20
  try {
21
- window.sessionStorage.removeItem(`${STORAGE_PREFIX}${id}`);
21
+ window.sessionStorage.removeItem(`${keyPrefix}${id}`);
22
22
  } catch {
23
23
  }
24
24
  }
@@ -31,7 +31,7 @@ export interface GenerateObjectInput<A, I extends Record<string, unknown>> {
31
31
  export interface StreamChatInput {
32
32
  readonly messages: ReadonlyArray<UIMessage>;
33
33
  readonly system?: string;
34
- readonly tools?: ReadonlyArray<AgenticTool>;
34
+ readonly tools?: ReadonlyArray<AgenticTool> | (() => ReadonlyArray<AgenticTool>);
35
35
  readonly signal?: AbortSignal;
36
36
  readonly maxTokens?: number;
37
37
  readonly onMessageUpdate?: (assistant: UIMessage) => void;
@@ -257,25 +257,32 @@ function partsToText(parts) {
257
257
  return parts.filter((p) => p.type === "text").map((p) => p.text).join("");
258
258
  }
259
259
  async function streamChat(input) {
260
- const helperTools = input.tools ?? [];
261
- const helperByName = new Map(helperTools.map((t) => [t.name, t]));
262
- const tools = helperTools.length > 0 ? helperTools.map((t) => ({
263
- name: t.name,
264
- description: t.description,
265
- input_schema: t.inputJsonSchema
266
- })) : void 0;
260
+ const readTools = (() => {
261
+ const t = input.tools;
262
+ if (typeof t === "function") return t;
263
+ const arr = t ?? [];
264
+ return () => arr;
265
+ })();
267
266
  const messages = input.messages.map(
268
267
  (m) => ({ role: m.role, content: partsToText(m.parts) })
269
268
  );
270
- const opts = {
271
- ...tools !== void 0 ? { tools } : {},
272
- ...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {}
273
- };
269
+ const maxTokensOpt = input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {};
274
270
  const assistant = { id: createMessageId(), role: "assistant", parts: [] };
275
271
  const publish = () => input.onMessageUpdate?.(assistant);
276
272
  const MAX_TRUNCATION_STREAK = 3;
277
273
  let truncationStreak = 0;
278
274
  for (; ; ) {
275
+ const helperTools = readTools();
276
+ const helperByName = new Map(helperTools.map((t) => [t.name, t]));
277
+ const anthropicTools = helperTools.length > 0 ? helperTools.map((t) => ({
278
+ name: t.name,
279
+ description: t.description,
280
+ input_schema: t.inputJsonSchema
281
+ })) : void 0;
282
+ const opts = {
283
+ ...anthropicTools !== void 0 ? { tools: anthropicTools } : {},
284
+ ...maxTokensOpt
285
+ };
279
286
  const partByIndex = /* @__PURE__ */ new Map();
280
287
  const response = await callStream(messages, input.system, opts, input.signal, () => {
281
288
  }, {
@@ -0,0 +1 @@
1
+ export declare function getCelCatalog(): string;
@@ -0,0 +1,10 @@
1
+ import rawCatalog from "./cel-catalog.md?raw";
2
+ let catalog = rawCatalog;
3
+ if (import.meta.hot) {
4
+ import.meta.hot.accept("./cel-catalog.md?raw", (mod) => {
5
+ if (typeof mod?.default === "string") catalog = mod.default;
6
+ });
7
+ }
8
+ export function getCelCatalog() {
9
+ return catalog;
10
+ }
@@ -0,0 +1,42 @@
1
+ CEL(Common Expression Language)是一门小而安全的**单表达式**语言:没有语句、赋值、循环或函数定义,整段表达式求值为一个值。以下是本项目可用的操作符与函数速查(完整语义见字段级注解与实际类型检查报错)。
2
+
3
+ ## 类型
4
+
5
+ `number`(任意精度小数,无 int/float 之分)、`string`(单双引号,`'''多行'''`,`r'原始'`)、`bool`、`bytes`、`null`、`list`、`map`、`Date`(`date('2023-01-15')` 或 `date(unixSeconds)`)。
6
+
7
+ ## 操作符
8
+
9
+ - 算术:`+ - * / %`、一元 `-`(仅 `number`;`/` 保留 20 位有效数字,勿用 `==` 直接比较除法结果)。
10
+ - 比较:`== != < <= > >=`(对 list/map 深比较)。
11
+ - 逻辑:`&& || !`(短路)。
12
+ - 三元:`cond ? a : b`。
13
+ - 成员:`x in [列表]`、`key in {映射}`。
14
+ - 拼接:字符串 / 列表用 `+`;`[...a, x]` / `{...a, "k": v}` 展开(后写覆盖先写)。
15
+ - 字段访问:`obj.field`、`obj["field"]`;**可选访问** `obj.?field`、`obj[?0]`(返回 `optional`,字段可能缺失时优先用)。
16
+
17
+ ## Optional(可选值,`.?` 会产生)
18
+
19
+ `optional.of(x)` / `optional.ofNullable(x)`(null→None)/ `optional.none()`;`o.orValue(默认值)`(取值或默认)、`o.or(其他optional)`、`o.hasValue()`、`o.value()`;`o.map(v, 表达式)`、`o.flatMap(v, optional)`、`o.filter(v, 布尔)`、`o.exists(v, 布尔)`。典型:`row.?amount.orValue(0)`。
20
+
21
+ ## 常用函数
22
+
23
+ - 类型转换:`number(x)`、`string(x)`、`bool(x)`、`type(x)`、`dyn(x)`。无 `int()`,取整用 `math.trunc/floor/ceil/round`。
24
+ - 数学:`math.trunc/floor/ceil/round/abs(n)`、`math.min/max(a, b)` 或 `math.min/max(list)`。
25
+ - 字符串(方法):`s.size()`、`s.contains(x)`、`s.startsWith/endsWith(x)`、`s.matches(正则)`、`s.substring(i[, j])`、`s.split(sep)`、`s.trim()`、`s.replace(from, to[, limit])`、`s.lowerAscii()/upperAscii()`。
26
+ - 列表(宏 / 方法):`l.size()`、`l.map(x, 表达式)`、`l.filter(x, 布尔)`、`l.all(x, 布尔)`、`l.exists(x, 布尔)`、`l.exists_one(x, 布尔)`、`l.enumerate()`(→ `{index, value}` 列表)、`l.slice(i[, j])`(支持负索引)。
27
+ - 映射:`Map.fromList(pairs)` / `Map.toList(m)`(pair 为 `{key, value}`,是从数据构建 map 的唯一方式)。
28
+ - JSON:`JSON.parse(s)`、`JSON.stringify(x)`。
29
+ - 日期:`date(...)`、`d.get('year'|'month'(1基)|'day'|'hour'|...)`、`d.diff(other, unit)`(有符号,受者为被减数)、`d.offset(n, unit)`、`d.startOf/endOf(unit)`、`d.format(...)`、`Date.tz(...)`。
30
+ - 区间:`range(a, b[, step])`、`range(startDate, endDate, unit)`(右开)。
31
+
32
+ ## HTTP(构建请求,不发起)
33
+
34
+ CEL 只**构建** `HttpRequest`,由宿主发起。链式:
35
+ ```cel
36
+ http.get(hostname + '/path') // 或 .post / .put / .delete;端点须为绝对 URL,用 hostname 变量,勿写 {{env}}
37
+ .header('Content-Type', 'application/json')
38
+ .query(query) // query = 全部搜索条件;放在最前
39
+ .query('key', value) // 值可为 string | number | optional<...>(None 则不追加该参数)
40
+ .body({ ... }) // POST/PUT 请求体
41
+ ```
42
+ `form({...})` 构建 `FormData`(文件上传:`.body(form({"file": f, "name": "a"}))`)。
@@ -6,6 +6,21 @@ export type CELVar = {
6
6
  value: unknown;
7
7
  };
8
8
  export type CELContext = Record<string, CELVar>;
9
+ /**
10
+ * A compact CEL scope entry for AI tool output — `name` + `type`, plus the
11
+ * designer-facing `label` / `description` when they add anything. Flattens a
12
+ * `CELContext` (whose `value` thunks are irrelevant to the model) into the
13
+ * variable table `describe_*_settings` hands the agent alongside the function
14
+ * catalog. Same probed source the ExpressionEditor advertises, so the two can't
15
+ * drift.
16
+ */
17
+ export type CELScopeEntry = {
18
+ name: string;
19
+ type: string;
20
+ label?: string;
21
+ description?: string;
22
+ };
23
+ export declare function renderCelScope(context: CELContext): CELScopeEntry[];
9
24
  export declare const SCOPE_ADDRESS_VAR = "__scopes__";
10
25
  export declare const SELECTIONS_VAR = "selections";
11
26
  export declare const OPTIONS_VAR = "options";
@@ -1,5 +1,13 @@
1
1
  import { computed, inject, provide, shallowRef } from "vue";
2
2
  import { injectLocal, provideLocal } from "@vueuse/core";
3
+ export function renderCelScope(context) {
4
+ return Object.entries(context).map(([name, v]) => ({
5
+ name,
6
+ type: v.type,
7
+ ...v.label && v.label !== name ? { label: v.label } : {},
8
+ ...v.description ? { description: v.description } : {}
9
+ }));
10
+ }
3
11
  export const SCOPE_ADDRESS_VAR = "__scopes__";
4
12
  export const SELECTIONS_VAR = "selections";
5
13
  export const OPTIONS_VAR = "options";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,16 +0,0 @@
1
- import type { Environment } from '../../vendor/cel-js/lib/index.js';
2
- type AnyRecord = Record<string, any>;
3
- type __VLS_Props = {
4
- configure?: (env: Environment) => void;
5
- };
6
- type __VLS_ModelProps = {
7
- modelValue: AnyRecord;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- "update:modelValue": (value: AnyRecord) => any;
12
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- "onUpdate:modelValue"?: ((value: AnyRecord) => any) | undefined;
14
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
- declare const _default: typeof __VLS_export;
16
- export default _default;
@@ -1,101 +0,0 @@
1
- 帮助用户进行配置表格。你的回复可以使用 CommonMark。你应该按照:确认既存配置、变更新增配置、验证配置结果的循环进行。
2
-
3
- ## 处理 API 接口
4
-
5
- 用户可能发送给你 API 接口信息。根据 API 接口可以配置如下内容
6
-
7
- - 通用配置
8
- - 列
9
- - 搜索条件
10
-
11
- ### 配置通用配置
12
-
13
- 利用 API 接口名字等相关信息,配置表格 `displayName`。
14
-
15
- 根据 API 接口,构造 `dataSource` 相关字段。对于 `request` 应当形如
16
-
17
- ```cel
18
- http
19
- .post('<construct full URL>') // use .get if request is in GET method
20
-
21
- // API doc might use env var surrounded by double brackets, these are NOT AVAILABLE in CEL, you should use the `hostname` var instead, e.g., `.get(hostname + '/foo/bar')`
22
-
23
- .header('<key>', '<value>') // use this to set request header
24
-
25
- .query(query) // `query` represents all the table search conditions, put it as the first query
26
- .query('<key>', '<value>') // .query method signature: .query(string, string | number | optional<string> | optional<number> | dyn)
27
-
28
- // API doc might contain demonstration purpose query, DO NOT hardcode
29
- // same name query will NOT overwrite, but form URL like `&foo=bar&foo=zoo`
30
-
31
- // if the API supports pagination, you might need to use `pageIndex` and `pageSize` to pass pagination info to the backend, like `.query('page_index', pageIndex + 1).query('page_size', pageSize)`, be aware the `pageIndex` var starts from 0
32
-
33
- // if the request is POST, you can set `.body`, it's signature is `.body(dyn)`
34
- // if you're gonna sent JSON request, remember to set `.header('Content-Type', 'application/json')` where header name is case-insensitive following RFC.
35
- .body({
36
- // ...
37
- })
38
- ```
39
-
40
- 对于 `data` 应当指向 Response 的列表,比如对于下面的这个响应,`data` 应当设置为 `json.?data.?list`
41
-
42
- ```json
43
- {
44
- "code": 0,
45
- "data": {
46
- "list": [
47
- {
48
- "foo": "bar",
49
- "buz": {
50
- "bao": "zoo"
51
- }
52
- }
53
- ],
54
- "total": 100,
55
- }
56
- }
57
- ```
58
-
59
- 对于 `total`,应当指向 Response 中服务器查询到的**总数**,对于上述例子是 `json.?data.?total` 如果你没有找到对应的字段,这个字段可以不填写,并且调用工具将分页功能关闭。
60
-
61
- ### 配置列
62
-
63
- 你应该寻找到最外侧的列表。这个列表的每一个元素,通常代表了一行。而其中的每个字段,通常代表了一列。
64
-
65
- 调用工具,选取合适的类型。你应该首要考虑文本、数值、日期类型。
66
-
67
- 对于只读的字段,你需要配置 `accessor`,可以使用 `row` 变量,`row` 特指当前行。`accessor` 应该**相对于列表元素**来写,不需要再重复访问列表字段本身。使用 CEL 的 optional 语法,如 `row.?foo.?bar`。
68
-
69
- ```json
70
- {
71
- "code": 0,
72
- "data": {
73
- "list": [
74
- {
75
- "foo": "bar",
76
- "buz": {
77
- "bao": "zoo"
78
- }
79
- }
80
- ]
81
- }
82
- }
83
- ```
84
-
85
- 对于上述例子,如果需要展示 `bar` 这个值作为一列,其 `accessor` 应为 `row.?foo`;如果需要展示 `zoo` 这个值作为一列,其 `accessor` 应为 `row.?buz.?bao`。
86
-
87
- 你应当选取至少一列,并且设置它的 `grow` 为 `true`。
88
-
89
- 对于金额类型的字段:使用数字类型的列;将其 `align` 设置为 `right`;将其 `displayMode` 设置为 `monoThousand`;设置一个合理的宽度,如 200 或 `grow` 为 `true`。
90
-
91
- 对于普通的数字:使用数字类型的列;将其 `align` 设置为 `center`。
92
-
93
- 对于日期、时间类型的字段:使用日期类型的列;对于时间,设置列宽为 140;对于日期,设置列宽为 120;将其 `align` 设置为 `center`。
94
-
95
- 对于用户名、ID、各种类型等较短字段,酌情将其 `align` 设置为 `center`。
96
-
97
- ### 配置搜索条件
98
-
99
- 你应该根据 API 文档配置其支持的搜索条件。搜索条件应该排除分页、排序相关信息,仅包含业务逻辑。
100
-
101
- 你应该首要考虑文本输入、数字输入、数字范围输入、日期范围输入、日期时间范围输入。如果你遇到了从多个值中选取一个或多个,考虑单选或者多选。如果你不能确定单选和多选的选项,向用户提问。当你不确定选项时,向用户所要配置选项的相关信息。
@@ -1,16 +0,0 @@
1
- import type { Environment } from '../../vendor/cel-js/lib/index.js';
2
- type AnyRecord = Record<string, any>;
3
- type __VLS_Props = {
4
- configure?: (env: Environment) => void;
5
- };
6
- type __VLS_ModelProps = {
7
- modelValue: AnyRecord;
8
- };
9
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- "update:modelValue": (value: AnyRecord) => any;
12
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- "onUpdate:modelValue"?: ((value: AnyRecord) => any) | undefined;
14
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
- declare const _default: typeof __VLS_export;
16
- export default _default;