@baishuyun/agents 0.0.2 → 0.0.4

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 (51) hide show
  1. package/CHANGELOG.md +25 -13
  2. package/index.ts +10 -10
  3. package/package.json +3 -3
  4. package/src/continue-confirmer/index.ts +41 -41
  5. package/src/continue-confirmer/prompt.ts +11 -11
  6. package/src/fields-builder/fields-builder.ts +43 -43
  7. package/src/fields-builder/index.ts +109 -109
  8. package/src/form-builder/consts/index.ts +5 -5
  9. package/src/form-builder/index.ts +24 -24
  10. package/src/form-builder/model/ds.ts +8 -8
  11. package/src/form-builder/model/openai.ts +7 -7
  12. package/src/form-builder/model/v0.ts +7 -7
  13. package/src/form-builder/model/xai.ts +7 -7
  14. package/src/form-builder/prompts/fields-design-docs.ts +3 -3
  15. package/src/form-builder/prompts/index.ts +32 -32
  16. package/src/form-builder/schema/index.ts +7 -7
  17. package/src/form-builder/tools/address.ts +58 -58
  18. package/src/form-builder/tools/attachment.ts +62 -62
  19. package/src/form-builder/tools/button.ts +73 -73
  20. package/src/form-builder/tools/checkbox.ts +55 -55
  21. package/src/form-builder/tools/confirm-to-create-fields-for-related-form.ts +16 -16
  22. package/src/form-builder/tools/confirm-to-create-form.ts +11 -11
  23. package/src/form-builder/tools/confirm-to-create-related-form.ts +16 -16
  24. package/src/form-builder/tools/confirm-to-save-checked-fields.ts +11 -11
  25. package/src/form-builder/tools/date-time.ts +73 -73
  26. package/src/form-builder/tools/department-group.ts +49 -49
  27. package/src/form-builder/tools/department.ts +49 -49
  28. package/src/form-builder/tools/image.ts +123 -123
  29. package/src/form-builder/tools/index.ts +27 -27
  30. package/src/form-builder/tools/input.ts +70 -70
  31. package/src/form-builder/tools/link-data.ts +70 -70
  32. package/src/form-builder/tools/load-data.ts +49 -49
  33. package/src/form-builder/tools/location.ts +94 -94
  34. package/src/form-builder/tools/member-group.ts +51 -51
  35. package/src/form-builder/tools/member.ts +51 -51
  36. package/src/form-builder/tools/number-input.ts +106 -106
  37. package/src/form-builder/tools/prompt-to-create-realted-form.ts +12 -12
  38. package/src/form-builder/tools/radio.ts +54 -54
  39. package/src/form-builder/tools/select-checker.ts +58 -58
  40. package/src/form-builder/tools/select.ts +56 -56
  41. package/src/form-builder/tools/serial-number.ts +75 -75
  42. package/src/form-builder/tools/signature.ts +38 -38
  43. package/src/form-builder/tools/splitline.ts +41 -41
  44. package/src/form-builder/tools/textarea.ts +55 -55
  45. package/src/form-builder/types/index.ts +53 -53
  46. package/src/form-builder/utils/index.ts +5 -5
  47. package/src/form-builder/utils/process-confirm-tool-call.ts +123 -123
  48. package/src/form-designer/index.ts +61 -61
  49. package/src/form-designer/prompts.ts +50 -50
  50. package/src/utils/index.ts +104 -104
  51. package/tsconfig.json +7 -7
@@ -1,32 +1,32 @@
1
- export const formBuilderPrompt = `
2
- 你是表单设计专家,根据用户业务需求,完成表单设计。请控制表单规模,合理使用关联字段,尽量进行表单拆分。
3
-
4
-
5
- 步骤:
6
- 1. 根据用户需求,创建表单,列出字段,从业务角度给出每个字段的设计说明
7
- 2. 调用确认工具,确认是否继续创建表单
8
- 3. 用户确认后,调用工具创建正式表单字段,如果字段需要关联其他表单,创建关联字段(buildLinkDataField),并记住关联表单名称
9
- 4. 字段设计完毕后,调用确认工具,确认是否保存字段
10
- 5. 如果步骤 3. 中创建了关联表单,调用确认工具,提示确认是否创建所有关联表单
11
- 6. 如果用户确认继续创建关联表单,调用确认工具,确认为哪一个关联表单创建字段
12
- 7. 如果用户确认为关联表单创建字段,回到步骤 3.,继续创建对应关联表单字段
13
-
14
- 格式:
15
- - 关联字段 label 命名无需加“关联”二字,直接像设计普通字段一样命名
16
- - 关联字段创建无需特定分区和说明,像设计普通字段一样设计
17
- - 统一使用中文
18
- - 字段设计时,不要返回分区说明,请直接用分割线工具表示分区信息
19
- - 表单布局需要紧凑合理,不同区域尝试用分割线字段分割
20
- - 确保回复精简,不要有多余的解释
21
-
22
- 注意:
23
- - 每次设计表单字段时,就考虑到后续可能需要设计的关联表单,而不是设计新表单时再关联旧表单
24
- - 关联表单无需重复设计字段反向关联
25
- - 如果有多个表,主表单就应该有关联字段关联其他表单
26
- - 对于身份证号、手机号等字段,使用文本字段,并添加相应的正则表达式校验
27
- - 字段设计时,注意字段的必填项和选填项
28
- - 字段类型尽量使用多样化字段,避免单一字段类型
29
- - 尽量进行表单拆分,避免单个表单字段过多,使用关联字段连接不同表单
30
- - 涉及到合同、人员、记录等信息时,使用关联字段
31
- - 完成后,不需要总结
32
- `;
1
+ export const formBuilderPrompt = `
2
+ 你是表单设计专家,根据用户业务需求,完成表单设计。请控制表单规模,合理使用关联字段,尽量进行表单拆分。
3
+
4
+
5
+ 步骤:
6
+ 1. 根据用户需求,创建表单,列出字段,从业务角度给出每个字段的设计说明
7
+ 2. 调用确认工具,确认是否继续创建表单
8
+ 3. 用户确认后,调用工具创建正式表单字段,如果字段需要关联其他表单,创建关联字段(buildLinkDataField),并记住关联表单名称
9
+ 4. 字段设计完毕后,调用确认工具,确认是否保存字段
10
+ 5. 如果步骤 3. 中创建了关联表单,调用确认工具,提示确认是否创建所有关联表单
11
+ 6. 如果用户确认继续创建关联表单,调用确认工具,确认为哪一个关联表单创建字段
12
+ 7. 如果用户确认为关联表单创建字段,回到步骤 3.,继续创建对应关联表单字段
13
+
14
+ 格式:
15
+ - 关联字段 label 命名无需加“关联”二字,直接像设计普通字段一样命名
16
+ - 关联字段创建无需特定分区和说明,像设计普通字段一样设计
17
+ - 统一使用中文
18
+ - 字段设计时,不要返回分区说明,请直接用分割线工具表示分区信息
19
+ - 表单布局需要紧凑合理,不同区域尝试用分割线字段分割
20
+ - 确保回复精简,不要有多余的解释
21
+
22
+ 注意:
23
+ - 每次设计表单字段时,就考虑到后续可能需要设计的关联表单,而不是设计新表单时再关联旧表单
24
+ - 关联表单无需重复设计字段反向关联
25
+ - 如果有多个表,主表单就应该有关联字段关联其他表单
26
+ - 对于身份证号、手机号等字段,使用文本字段,并添加相应的正则表达式校验
27
+ - 字段设计时,注意字段的必填项和选填项
28
+ - 字段类型尽量使用多样化字段,避免单一字段类型
29
+ - 尽量进行表单拆分,避免单个表单字段过多,使用关联字段连接不同表单
30
+ - 涉及到合同、人员、记录等信息时,使用关联字段
31
+ - 完成后,不需要总结
32
+ `;
@@ -1,7 +1,7 @@
1
- import { z } from "zod";
2
-
3
- export const option = z.object({
4
- value: z.string().min(1).max(100),
5
- text: z.string().min(1).max(100),
6
- color: z.string().optional(),
7
- });
1
+ import { z } from "zod";
2
+
3
+ export const option = z.object({
4
+ value: z.string().min(1).max(100),
5
+ text: z.string().min(1).max(100),
6
+ color: z.string().optional(),
7
+ });
@@ -1,58 +1,58 @@
1
- import { z } from "zod";
2
- import { tool } from "ai";
3
- import { buildWidgetName } from "../utils/index.js";
4
-
5
- export const buildAddressField = tool({
6
- name: "buildAddressField",
7
- description:
8
- "Builds a form field for collecting address information from users.",
9
- inputSchema: z.object({
10
- label: z.string().min(1).max(100),
11
- required: z.boolean().default(false),
12
- fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
13
- description: z.string().min(1).max(100).optional(),
14
- addressMode: z
15
- .enum(["all", "provinceCityDistrict", "provinceCity", "provinceOnly"])
16
- .default("all"),
17
- }),
18
- execute: (input) => {
19
- const { label, required, fieldWidth, description, addressMode } = input;
20
- const modeMap: Record<string, string> = {
21
- all: "pcda",
22
- provinceCityDistrict: "pcd",
23
- provinceCity: "pc",
24
- provinceOnly: "p",
25
- };
26
- return {
27
- widget: {
28
- type: "address",
29
- widgetName: buildWidgetName(),
30
- widgetNameAlias: "",
31
- customCls: null,
32
- width: 720,
33
- enable: true,
34
- visible: true,
35
- allowBlank: !required,
36
- labelStyle: label,
37
- funMode: "module",
38
- module: null,
39
- libs: [],
40
- extendSet: {
41
- sort: ["datahelp", "module", "formEvent"],
42
- status: true,
43
- triggerField: "",
44
- triggerFieldMode: "none",
45
- version: 1,
46
- },
47
- needDetail: true,
48
- format: modeMap[addressMode] || "all",
49
- eventMode: 1, //公式联动触发模式 1 默认,省市县/详细地址内容改变都触发 2 只有省市县改变才触发 3 只有详细地址改变才触发
50
- seleceMapAddress: true, //开启经纬度定位
51
- },
52
- description,
53
- label,
54
- lineWidth: parseInt(fieldWidth, 10),
55
- tab: null,
56
- };
57
- },
58
- });
1
+ import { z } from "zod";
2
+ import { tool } from "ai";
3
+ import { buildWidgetName } from "../utils/index.js";
4
+
5
+ export const buildAddressField = tool({
6
+ name: "buildAddressField",
7
+ description:
8
+ "Builds a form field for collecting address information from users.",
9
+ inputSchema: z.object({
10
+ label: z.string().min(1).max(100),
11
+ required: z.boolean().default(false),
12
+ fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
13
+ description: z.string().min(1).max(100).optional(),
14
+ addressMode: z
15
+ .enum(["all", "provinceCityDistrict", "provinceCity", "provinceOnly"])
16
+ .default("all"),
17
+ }),
18
+ execute: (input) => {
19
+ const { label, required, fieldWidth, description, addressMode } = input;
20
+ const modeMap: Record<string, string> = {
21
+ all: "pcda",
22
+ provinceCityDistrict: "pcd",
23
+ provinceCity: "pc",
24
+ provinceOnly: "p",
25
+ };
26
+ return {
27
+ widget: {
28
+ type: "address",
29
+ widgetName: buildWidgetName(),
30
+ widgetNameAlias: "",
31
+ customCls: null,
32
+ width: 720,
33
+ enable: true,
34
+ visible: true,
35
+ allowBlank: !required,
36
+ labelStyle: label,
37
+ funMode: "module",
38
+ module: null,
39
+ libs: [],
40
+ extendSet: {
41
+ sort: ["datahelp", "module", "formEvent"],
42
+ status: true,
43
+ triggerField: "",
44
+ triggerFieldMode: "none",
45
+ version: 1,
46
+ },
47
+ needDetail: true,
48
+ format: modeMap[addressMode] || "all",
49
+ eventMode: 1, //公式联动触发模式 1 默认,省市县/详细地址内容改变都触发 2 只有省市县改变才触发 3 只有详细地址改变才触发
50
+ seleceMapAddress: true, //开启经纬度定位
51
+ },
52
+ description,
53
+ label,
54
+ lineWidth: parseInt(fieldWidth, 10),
55
+ tab: null,
56
+ };
57
+ },
58
+ });
@@ -1,62 +1,62 @@
1
- import { z } from "zod";
2
- import { tool } from "ai";
3
- import { buildWidgetName } from "../utils/index.js";
4
-
5
- export const buildAttachmentField = tool({
6
- name: "buildAttachmentField",
7
- description: "Builds an attachment field for a form.",
8
- inputSchema: z.object({
9
- label: z.string().min(1).max(100),
10
- placeholder: z.string().min(1).max(100).optional(),
11
- required: z.boolean().default(false),
12
- fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
13
- description: z.string().min(1).max(100).optional(),
14
- fileType: z
15
- .enum([
16
- "exe",
17
- "pdf",
18
- "doc",
19
- "docx",
20
- "xls",
21
- "xlsx",
22
- "ppt",
23
- "pptx",
24
- "txt",
25
- "jpg",
26
- "jpeg",
27
- "png",
28
- "gif",
29
- "bmp",
30
- ])
31
- .array()
32
- .optional()
33
- .default(["exe", "pdf"]),
34
- }),
35
- execute: (input) => {
36
- const { label, required, fieldWidth, description, fileType } = input;
37
- return {
38
- widget: {
39
- type: "upload",
40
- widgetName: buildWidgetName(),
41
- widgetNameAlias: "",
42
- customCls: null,
43
- enable: true,
44
- visible: true,
45
- allowBlank: !required,
46
- labelStyle: label,
47
- maxFileCount: 50, //允许多文件上传 1为不可以 50为可以
48
- download: true, //打包下载
49
- is_file_down: true, //操作权限 可下载
50
- check_image_exif: true, //照片支持查看EXIF扩展信息
51
- online_edit: true, //允许文档在线编辑
52
- online_edit_record: true, //是否查看协作记录
53
- fileSizeLimit: 10485760, //设置单个文件大小上限,单位是字节,范围 1M-20M
54
- fileType,
55
- },
56
- description,
57
- label,
58
- lineWidth: parseInt(fieldWidth),
59
- tab: null,
60
- };
61
- },
62
- });
1
+ import { z } from "zod";
2
+ import { tool } from "ai";
3
+ import { buildWidgetName } from "../utils/index.js";
4
+
5
+ export const buildAttachmentField = tool({
6
+ name: "buildAttachmentField",
7
+ description: "Builds an attachment field for a form.",
8
+ inputSchema: z.object({
9
+ label: z.string().min(1).max(100),
10
+ placeholder: z.string().min(1).max(100).optional(),
11
+ required: z.boolean().default(false),
12
+ fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
13
+ description: z.string().min(1).max(100).optional(),
14
+ fileType: z
15
+ .enum([
16
+ "exe",
17
+ "pdf",
18
+ "doc",
19
+ "docx",
20
+ "xls",
21
+ "xlsx",
22
+ "ppt",
23
+ "pptx",
24
+ "txt",
25
+ "jpg",
26
+ "jpeg",
27
+ "png",
28
+ "gif",
29
+ "bmp",
30
+ ])
31
+ .array()
32
+ .optional()
33
+ .default(["exe", "pdf"]),
34
+ }),
35
+ execute: (input) => {
36
+ const { label, required, fieldWidth, description, fileType } = input;
37
+ return {
38
+ widget: {
39
+ type: "upload",
40
+ widgetName: buildWidgetName(),
41
+ widgetNameAlias: "",
42
+ customCls: null,
43
+ enable: true,
44
+ visible: true,
45
+ allowBlank: !required,
46
+ labelStyle: label,
47
+ maxFileCount: 50, //允许多文件上传 1为不可以 50为可以
48
+ download: true, //打包下载
49
+ is_file_down: true, //操作权限 可下载
50
+ check_image_exif: true, //照片支持查看EXIF扩展信息
51
+ online_edit: true, //允许文档在线编辑
52
+ online_edit_record: true, //是否查看协作记录
53
+ fileSizeLimit: 10485760, //设置单个文件大小上限,单位是字节,范围 1M-20M
54
+ fileType,
55
+ },
56
+ description,
57
+ label,
58
+ lineWidth: parseInt(fieldWidth),
59
+ tab: null,
60
+ };
61
+ },
62
+ });
@@ -1,73 +1,73 @@
1
- import { z } from "zod";
2
- import { tool } from "ai";
3
- import { buildWidgetName } from "../utils/index.js";
4
-
5
- export const buildButtonField = tool({
6
- name: "buildButtonField",
7
- description: "build a button field",
8
- inputSchema: z.object({
9
- label: z.string().min(1).max(100),
10
- theme: z.enum(["primary", "bordered", "ghost"]).default("primary"),
11
- buttonText: z.string().min(1).max(100),
12
- backgroundColor: z.string().min(1).max(7),
13
- required: z.boolean().default(false),
14
- fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
15
- description: z.string().min(1).max(100).default(""),
16
- }),
17
- execute: (input) => {
18
- const {
19
- label,
20
- buttonText,
21
- backgroundColor,
22
- theme,
23
- required,
24
- fieldWidth,
25
- description,
26
- } = input;
27
- const themeMap = {
28
- primary: "default",
29
- bordered: "style1",
30
- ghost: "none",
31
- };
32
- return {
33
- widget: {
34
- type: "button",
35
- widgetName: buildWidgetName(),
36
- widgetNameAlias: "",
37
- triggerEvent: 0,
38
- customCls: null,
39
- height: 36,
40
- width: 350,
41
- text: buttonText,
42
- enable: true,
43
- visible: true,
44
- allowBlank: !required,
45
- labelStyle: label,
46
- extendSet: {
47
- sort: ["datahelp", "module", "formEvent"],
48
- status: true,
49
- triggerField: "",
50
- triggerFieldMode: "none",
51
- funMode: "popupreport",
52
- },
53
- background: {
54
- //颜色
55
- mode: "color",
56
- color: backgroundColor,
57
- position: "center",
58
- },
59
- mode: "all", //模式 all 扩展 popupreport 弹出报表 popupform 弹出表单 print 页面打印 popuppage 弹出外部网页
60
- theme: themeMap[theme] || "default", //风格 default 默认,有边框有底色 style1 有边框无底色 none 无边框无底色
61
- eventAlert: false, //是否显示提醒框
62
- alertinfo: {
63
- icon: "success",
64
- tip: "请设置提示内容",
65
- },
66
- },
67
- description,
68
- label,
69
- lineWidth: parseInt(fieldWidth),
70
- tab: null,
71
- };
72
- },
73
- });
1
+ import { z } from "zod";
2
+ import { tool } from "ai";
3
+ import { buildWidgetName } from "../utils/index.js";
4
+
5
+ export const buildButtonField = tool({
6
+ name: "buildButtonField",
7
+ description: "build a button field",
8
+ inputSchema: z.object({
9
+ label: z.string().min(1).max(100),
10
+ theme: z.enum(["primary", "bordered", "ghost"]).default("primary"),
11
+ buttonText: z.string().min(1).max(100),
12
+ backgroundColor: z.string().min(1).max(7),
13
+ required: z.boolean().default(false),
14
+ fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
15
+ description: z.string().min(1).max(100).default(""),
16
+ }),
17
+ execute: (input) => {
18
+ const {
19
+ label,
20
+ buttonText,
21
+ backgroundColor,
22
+ theme,
23
+ required,
24
+ fieldWidth,
25
+ description,
26
+ } = input;
27
+ const themeMap = {
28
+ primary: "default",
29
+ bordered: "style1",
30
+ ghost: "none",
31
+ };
32
+ return {
33
+ widget: {
34
+ type: "button",
35
+ widgetName: buildWidgetName(),
36
+ widgetNameAlias: "",
37
+ triggerEvent: 0,
38
+ customCls: null,
39
+ height: 36,
40
+ width: 350,
41
+ text: buttonText,
42
+ enable: true,
43
+ visible: true,
44
+ allowBlank: !required,
45
+ labelStyle: label,
46
+ extendSet: {
47
+ sort: ["datahelp", "module", "formEvent"],
48
+ status: true,
49
+ triggerField: "",
50
+ triggerFieldMode: "none",
51
+ funMode: "popupreport",
52
+ },
53
+ background: {
54
+ //颜色
55
+ mode: "color",
56
+ color: backgroundColor,
57
+ position: "center",
58
+ },
59
+ mode: "all", //模式 all 扩展 popupreport 弹出报表 popupform 弹出表单 print 页面打印 popuppage 弹出外部网页
60
+ theme: themeMap[theme] || "default", //风格 default 默认,有边框有底色 style1 有边框无底色 none 无边框无底色
61
+ eventAlert: false, //是否显示提醒框
62
+ alertinfo: {
63
+ icon: "success",
64
+ tip: "请设置提示内容",
65
+ },
66
+ },
67
+ description,
68
+ label,
69
+ lineWidth: parseInt(fieldWidth),
70
+ tab: null,
71
+ };
72
+ },
73
+ });
@@ -1,55 +1,55 @@
1
- import { tool } from "ai";
2
- import { z } from "zod";
3
- import { buildWidgetName } from "../utils/index.js";
4
-
5
- export const buildCheckBoxGroupField = tool({
6
- name: "buildCheckBoxGroupField",
7
- description: "build a check boxk group field",
8
- inputSchema: z.object({
9
- label: z.string().min(1).max(100),
10
- fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
11
- description: z.string().min(1).max(100).optional(),
12
- required: z.boolean().default(false),
13
- layout: z.enum(["horizontal", "vertical"]).default("horizontal"),
14
- options: z.array(
15
- z.object({
16
- value: z.string().min(1).max(100),
17
- text: z.string().min(1).max(100),
18
- color: z.string().min(1).max(7),
19
- }),
20
- ),
21
- }),
22
- execute: (input) => {
23
- const { label, fieldWidth, description, options, required, layout } = input;
24
- return {
25
- widget: {
26
- type: "checkboxgroup",
27
- widgetName: buildWidgetName(),
28
- widgetNameAlias: "",
29
- customCls: null,
30
- enable: true,
31
- visible: true,
32
- allowBlank: !required,
33
- labelStyle: label,
34
- funMode: "module",
35
- module: null,
36
- libs: [],
37
- extendSet: {
38
- sort: ["datahelp", "module", "formEvent"],
39
- status: true,
40
- triggerField: "",
41
- triggerFieldMode: "none",
42
- version: 1,
43
- },
44
- items: options,
45
- colorEnable: true, //颜色 是否开启颜色
46
- layout,
47
- allowAddOptions: false, //允许成员填写时添加新选项
48
- },
49
- description,
50
- label,
51
- lineWidth: parseInt(fieldWidth),
52
- tab: null,
53
- };
54
- },
55
- });
1
+ import { tool } from "ai";
2
+ import { z } from "zod";
3
+ import { buildWidgetName } from "../utils/index.js";
4
+
5
+ export const buildCheckBoxGroupField = tool({
6
+ name: "buildCheckBoxGroupField",
7
+ description: "build a check boxk group field",
8
+ inputSchema: z.object({
9
+ label: z.string().min(1).max(100),
10
+ fieldWidth: z.enum(["3", "4", "6", "8", "9", "12"]).default("12"),
11
+ description: z.string().min(1).max(100).optional(),
12
+ required: z.boolean().default(false),
13
+ layout: z.enum(["horizontal", "vertical"]).default("horizontal"),
14
+ options: z.array(
15
+ z.object({
16
+ value: z.string().min(1).max(100),
17
+ text: z.string().min(1).max(100),
18
+ color: z.string().min(1).max(7),
19
+ }),
20
+ ),
21
+ }),
22
+ execute: (input) => {
23
+ const { label, fieldWidth, description, options, required, layout } = input;
24
+ return {
25
+ widget: {
26
+ type: "checkboxgroup",
27
+ widgetName: buildWidgetName(),
28
+ widgetNameAlias: "",
29
+ customCls: null,
30
+ enable: true,
31
+ visible: true,
32
+ allowBlank: !required,
33
+ labelStyle: label,
34
+ funMode: "module",
35
+ module: null,
36
+ libs: [],
37
+ extendSet: {
38
+ sort: ["datahelp", "module", "formEvent"],
39
+ status: true,
40
+ triggerField: "",
41
+ triggerFieldMode: "none",
42
+ version: 1,
43
+ },
44
+ items: options,
45
+ colorEnable: true, //颜色 是否开启颜色
46
+ layout,
47
+ allowAddOptions: false, //允许成员填写时添加新选项
48
+ },
49
+ description,
50
+ label,
51
+ lineWidth: parseInt(fieldWidth),
52
+ tab: null,
53
+ };
54
+ },
55
+ });
@@ -1,16 +1,16 @@
1
- import { z } from "zod";
2
- import { tool } from "ai";
3
-
4
- export const confirmToCreateFieldsForRelatedForm = tool({
5
- name: "confirmToCreateFieldsForRelatedForm",
6
- description: "require user confirm to create fields for related forms.",
7
- inputSchema: z.object({
8
- forms: z.array(
9
- z.object({
10
- title: z.string().min(2).max(100),
11
- description: z.string().min(2).max(500),
12
- }),
13
- ),
14
- }),
15
- outputSchema: z.string(),
16
- });
1
+ import { z } from "zod";
2
+ import { tool } from "ai";
3
+
4
+ export const confirmToCreateFieldsForRelatedForm = tool({
5
+ name: "confirmToCreateFieldsForRelatedForm",
6
+ description: "require user confirm to create fields for related forms.",
7
+ inputSchema: z.object({
8
+ forms: z.array(
9
+ z.object({
10
+ title: z.string().min(2).max(100),
11
+ description: z.string().min(2).max(500),
12
+ }),
13
+ ),
14
+ }),
15
+ outputSchema: z.string(),
16
+ });
@@ -1,11 +1,11 @@
1
- import { z } from "zod";
2
- import { tool } from "ai";
3
-
4
- export const confirmToCreateForm = tool({
5
- name: "confirmToCreateForm",
6
- description: "confirm to start creating a form",
7
- inputSchema: z.object({
8
- formName: z.string().min(2).max(100),
9
- }),
10
- outputSchema: z.string(),
11
- });
1
+ import { z } from "zod";
2
+ import { tool } from "ai";
3
+
4
+ export const confirmToCreateForm = tool({
5
+ name: "confirmToCreateForm",
6
+ description: "confirm to start creating a form",
7
+ inputSchema: z.object({
8
+ formName: z.string().min(2).max(100),
9
+ }),
10
+ outputSchema: z.string(),
11
+ });