@cozeloop/prompt-components 0.0.2 → 0.0.3
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/es/basic-editor/custom-facet.js +9 -0
- package/dist/es/basic-editor/diff.js +138 -0
- package/dist/{go-syntax-067c4f5d.mjs → es/basic-editor/extensions/go-syntax.js} +9 -16
- package/dist/es/basic-editor/extensions/go-template.js +16 -0
- package/dist/{go-theme-062a6df6.mjs → es/basic-editor/extensions/go-theme.js} +4 -3
- package/dist/es/basic-editor/extensions/jinja.js +80 -0
- package/dist/es/basic-editor/extensions/keymap.js +442 -0
- package/dist/es/basic-editor/extensions/language-support.js +12 -0
- package/dist/es/basic-editor/extensions/markdown.js +58 -0
- package/dist/es/basic-editor/extensions/search/dom/icon.js +250 -0
- package/dist/es/basic-editor/extensions/search/dom/match-count.js +33 -0
- package/dist/es/basic-editor/extensions/search/index.js +18 -0
- package/dist/es/basic-editor/extensions/search/panel.js +418 -0
- package/dist/es/basic-editor/extensions/search/theme.js +184 -0
- package/dist/es/basic-editor/extensions/validation.js +84 -0
- package/dist/es/basic-editor/extensions/validation.module.js +5 -0
- package/dist/es/basic-editor/extensions/validation_module.css +7 -0
- package/dist/es/basic-editor/extensions/variable.js +178 -0
- package/dist/es/basic-editor/index.js +171 -0
- package/dist/es/code-editor/code-editor.js +83 -0
- package/dist/es/code-editor/index.js +12 -0
- package/dist/es/code-editor/json-editor.js +157 -0
- package/dist/es/code-editor/raw-text-editor.js +46 -0
- package/dist/es/code-editor/text-editor.js +41 -0
- package/dist/es/code-editor/themes/coze-dark.js +112 -0
- package/dist/es/code-editor/themes/coze-light.js +118 -0
- package/dist/es/consts/index.js +12 -0
- package/dist/es/dev-layout/index.js +35 -0
- package/dist/es/idls/fornax_ml_flow/index.js +2322 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/ai_annotate.js +41 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/aidpcallback.js +108 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/annotation_job.js +52 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/base.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/batch_infer.js +72 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/dataprocess.js +10 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/dataset.js +36 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2.js +139 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2job.js +40 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2lineage.js +25 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/datasetv2similarity.js +12 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/filter.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.js +36 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.js +318 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/fornax_domain_model.js +326 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.js +327 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/openapi.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.js +0 -0
- package/dist/es/idls/fornax_ml_flow/namespaces/tag.js +33 -0
- package/dist/es/idls/prompt_api/index.js +2009 -0
- package/dist/es/idls/prompt_api/namespaces/base.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_callback.js +35 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_common.js +318 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_debug.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_manage.js +23 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_mcp.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_optimize.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_paas.js +43 -0
- package/dist/es/idls/prompt_api/namespaces/flow_devops_prompt_platform.js +0 -0
- package/dist/es/idls/prompt_api/namespaces/mcp.js +9 -0
- package/dist/es/idls/prompt_api/namespaces/model.js +320 -0
- package/dist/es/idls/prompt_api/namespaces/permission.js +47 -0
- package/dist/es/idls/prompt_api/namespaces/release.js +25 -0
- package/dist/es/index.js +66 -0
- package/dist/es/mermaid-diagram/index.js +148 -0
- package/dist/es/mermaid-diagram/index.module.js +5 -0
- package/dist/es/mermaid-diagram/index_module.css +4 -0
- package/dist/es/mermaid-diagram/use-svg-pan-zoom.js +49 -0
- package/dist/es/mermaid-diagram/utils.js +74 -0
- package/dist/es/model-config-editor/basic-type.js +73 -0
- package/dist/es/model-config-editor/index.module.js +5 -0
- package/dist/es/model-config-editor/index_module.css +8 -0
- package/dist/es/model-config-editor/model-config-form.js +130 -0
- package/dist/es/model-config-editor/popover-type.js +118 -0
- package/dist/es/model-select/index.js +136 -0
- package/dist/es/model-select/index.module.js +5 -0
- package/dist/es/model-select/index_module.css +14 -0
- package/dist/es/model-select/model-option/index.js +161 -0
- package/dist/es/model-select/model-option/index.module.js +5 -0
- package/dist/es/model-select/model-option/index_module.css +23 -0
- package/dist/es/model-select/model-option-group/index.js +44 -0
- package/dist/es/prompt-editor/index.js +188 -0
- package/dist/es/prompt-editor/index.module.js +5 -0
- package/dist/es/prompt-editor/index_module.css +71 -0
- package/dist/es/prompt-editor/message-type-select.js +74 -0
- package/dist/es/schema-editor/index.js +43 -0
- package/dist/es/utils/base.js +53 -0
- package/dist/es/utils/model-config.js +32 -0
- package/dist/lib/basic-editor/custom-facet.js +33 -0
- package/dist/lib/basic-editor/diff.js +167 -0
- package/dist/lib/basic-editor/extensions/go-syntax.js +146 -0
- package/dist/lib/basic-editor/extensions/go-template.js +50 -0
- package/dist/lib/basic-editor/extensions/go-theme.js +1091 -0
- package/dist/lib/basic-editor/extensions/jinja.js +100 -0
- package/dist/lib/basic-editor/extensions/keymap.js +465 -0
- package/dist/lib/basic-editor/extensions/language-support.js +32 -0
- package/dist/lib/basic-editor/extensions/markdown.js +78 -0
- package/dist/lib/basic-editor/extensions/search/dom/icon.js +291 -0
- package/dist/lib/basic-editor/extensions/search/dom/match-count.js +67 -0
- package/dist/lib/basic-editor/extensions/search/index.js +38 -0
- package/dist/lib/basic-editor/extensions/search/panel.js +429 -0
- package/dist/lib/basic-editor/extensions/search/theme.js +208 -0
- package/dist/lib/basic-editor/extensions/validation.js +118 -0
- package/dist/lib/basic-editor/extensions/validation.module.js +25 -0
- package/dist/lib/basic-editor/extensions/validation_module.css +7 -0
- package/dist/lib/basic-editor/extensions/variable.js +190 -0
- package/dist/lib/basic-editor/index.js +193 -0
- package/dist/lib/code-editor/code-editor.js +117 -0
- package/dist/lib/code-editor/index.js +40 -0
- package/dist/lib/code-editor/json-editor.js +184 -0
- package/dist/lib/code-editor/raw-text-editor.js +70 -0
- package/dist/lib/code-editor/text-editor.js +75 -0
- package/dist/lib/code-editor/themes/coze-dark.js +136 -0
- package/dist/lib/code-editor/themes/coze-light.js +142 -0
- package/dist/lib/consts/index.js +38 -0
- package/dist/lib/dev-layout/index.js +69 -0
- package/dist/lib/idls/fornax_ml_flow/index.js +2414 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/ai_annotate.js +69 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/aidpcallback.js +140 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/annotation_job.js +82 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/base.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/batch_infer.js +105 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/dataprocess.js +34 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/dataset.js +63 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2.js +177 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2job.js +68 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2lineage.js +50 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/datasetv2similarity.js +37 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/filter.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.js +62 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.js +378 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/fornax_domain_model.js +384 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.js +385 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/openapi.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.js +16 -0
- package/dist/lib/idls/fornax_ml_flow/namespaces/tag.js +60 -0
- package/dist/lib/idls/prompt_api/index.js +2071 -0
- package/dist/lib/idls/prompt_api/namespaces/base.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_callback.js +62 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_common.js +378 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_debug.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_manage.js +49 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_mcp.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_optimize.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_paas.js +72 -0
- package/dist/lib/idls/prompt_api/namespaces/flow_devops_prompt_platform.js +16 -0
- package/dist/lib/idls/prompt_api/namespaces/mcp.js +33 -0
- package/dist/lib/idls/prompt_api/namespaces/model.js +377 -0
- package/dist/lib/idls/prompt_api/namespaces/permission.js +72 -0
- package/dist/lib/idls/prompt_api/namespaces/release.js +50 -0
- package/dist/lib/index.js +110 -0
- package/dist/lib/mermaid-diagram/index.js +174 -0
- package/dist/lib/mermaid-diagram/index.module.js +25 -0
- package/dist/lib/mermaid-diagram/index_module.css +4 -0
- package/dist/lib/mermaid-diagram/use-svg-pan-zoom.js +83 -0
- package/dist/lib/mermaid-diagram/utils.js +98 -0
- package/dist/lib/model-config-editor/basic-type.js +105 -0
- package/dist/lib/model-config-editor/index.module.js +25 -0
- package/dist/lib/model-config-editor/index_module.css +8 -0
- package/dist/lib/model-config-editor/model-config-form.js +149 -0
- package/dist/lib/model-config-editor/popover-type.js +145 -0
- package/dist/lib/model-select/index.js +170 -0
- package/dist/lib/model-select/index.module.js +25 -0
- package/dist/lib/model-select/index_module.css +14 -0
- package/dist/lib/model-select/model-option/index.js +188 -0
- package/dist/lib/model-select/model-option/index.module.js +25 -0
- package/dist/lib/model-select/model-option/index_module.css +23 -0
- package/dist/lib/model-select/model-option-group/index.js +75 -0
- package/dist/lib/prompt-editor/index.js +218 -0
- package/dist/lib/prompt-editor/index.module.js +25 -0
- package/dist/lib/prompt-editor/index_module.css +71 -0
- package/dist/lib/prompt-editor/message-type-select.js +108 -0
- package/dist/lib/schema-editor/index.js +77 -0
- package/dist/lib/utils/base.js +82 -0
- package/dist/lib/utils/model-config.js +67 -0
- package/dist/{src → types}/basic-editor/custom-facet.d.ts +1 -2
- package/dist/types/basic-editor/diff.d.ts +15 -0
- package/dist/types/basic-editor/extensions/go-syntax.d.ts +71 -0
- package/dist/types/basic-editor/extensions/go-template.d.ts +1 -0
- package/dist/{src → types}/basic-editor/extensions/go-theme.d.ts +1 -1
- package/dist/types/basic-editor/extensions/jinja.d.ts +6 -0
- package/dist/{src → types}/basic-editor/extensions/keymap.d.ts +2 -3
- package/dist/types/basic-editor/extensions/language-support.d.ts +2 -0
- package/dist/types/basic-editor/extensions/markdown.d.ts +2 -0
- package/dist/types/basic-editor/extensions/search/dom/icon.d.ts +59 -0
- package/dist/types/basic-editor/extensions/search/dom/match-count.d.ts +14 -0
- package/dist/types/basic-editor/extensions/search/index.d.ts +1 -0
- package/dist/types/basic-editor/extensions/search/panel.d.ts +32 -0
- package/dist/types/basic-editor/extensions/search/theme.d.ts +1 -0
- package/dist/types/basic-editor/extensions/validation.d.ts +10 -0
- package/dist/types/basic-editor/extensions/variable.d.ts +14 -0
- package/dist/types/basic-editor/index.d.ts +28 -0
- package/dist/types/code-editor/code-editor.d.ts +23 -0
- package/dist/{src → types}/code-editor/index.d.ts +1 -1
- package/dist/types/code-editor/json-editor.d.ts +17 -0
- package/dist/types/code-editor/raw-text-editor.d.ts +11 -0
- package/dist/types/code-editor/text-editor.d.ts +23 -0
- package/dist/types/code-editor/themes/coze-dark.d.ts +1 -0
- package/dist/types/code-editor/themes/coze-light.d.ts +1 -0
- package/dist/{src → types}/consts/index.d.ts +1 -1
- package/dist/types/dev-layout/index.d.ts +13 -0
- package/dist/types/idls/fornax_ml_flow/index.d.ts +779 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/ai_annotate.d.ts +102 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/aidpcallback.d.ts +227 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/annotation_job.d.ts +402 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/base.d.ts +18 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/batch_infer.d.ts +331 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/dataprocess.d.ts +16 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/dataset.d.ts +88 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2.d.ts +462 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2job.d.ts +180 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2lineage.d.ts +69 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/datasetv2similarity.d.ts +8 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/filter.d.ts +39 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/flow_devops_evaluation_callback_common.d.ts +88 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/flow_devops_prompt_common.d.ts +370 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/fornax_domain_model.d.ts +320 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/ml_flow_domain_model.d.ts +510 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/openapi.d.ts +6 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotateservice.d.ts +106 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_annotationjobservice.d.ts +256 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_batchinferservice.d.ts +73 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_crowdsourcingannotationjobservice.d.ts +94 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_dataprocessservice.d.ts +11 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservice.d.ts +24 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_datasetservicev2.d.ts +653 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_modelservice.d.ts +83 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_annotationjobservice.d.ts +81 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_batchinferservice.d.ts +24 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_openapi_datasetservicev2.d.ts +260 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/stone_fornax_ml_flow_tagservice.d.ts +111 -0
- package/dist/types/idls/fornax_ml_flow/namespaces/tag.d.ts +109 -0
- package/dist/types/idls/prompt_api/index.d.ts +667 -0
- package/dist/types/idls/prompt_api/namespaces/base.d.ts +18 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_callback.d.ts +102 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_commercial_openapi.d.ts +81 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_common.d.ts +1270 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_debug.d.ts +197 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_manage.d.ts +769 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_mcp.d.ts +301 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_optimize.d.ts +155 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_paas.d.ts +198 -0
- package/dist/types/idls/prompt_api/namespaces/flow_devops_prompt_platform.d.ts +230 -0
- package/dist/types/idls/prompt_api/namespaces/mcp.d.ts +95 -0
- package/dist/types/idls/prompt_api/namespaces/model.d.ts +315 -0
- package/dist/types/idls/prompt_api/namespaces/permission.d.ts +52 -0
- package/dist/types/idls/prompt_api/namespaces/release.d.ts +62 -0
- package/dist/{src → types}/index.d.ts +7 -7
- package/dist/types/mermaid-diagram/index.d.ts +12 -0
- package/dist/types/mermaid-diagram/use-svg-pan-zoom.d.ts +17 -0
- package/dist/{src → types}/mermaid-diagram/utils.d.ts +1 -1
- package/dist/types/model-config-editor/basic-type.d.ts +19 -0
- package/dist/types/model-config-editor/model-config-form.d.ts +14 -0
- package/dist/types/model-config-editor/popover-type.d.ts +25 -0
- package/dist/types/model-select/index.d.ts +38 -0
- package/dist/types/model-select/model-option/index.d.ts +30 -0
- package/dist/types/model-select/model-option-group/index.d.ts +15 -0
- package/dist/types/prompt-editor/index.d.ts +30 -0
- package/dist/types/prompt-editor/message-type-select.d.ts +16 -0
- package/dist/types/schema-editor/index.d.ts +18 -0
- package/dist/{src → types}/utils/base.d.ts +4 -5
- package/dist/types/utils/model-config.d.ts +4 -0
- package/package.json +8 -16
- package/dist/edenx.config.d.ts +0 -2
- package/dist/go-syntax-4deb0289.js +0 -8
- package/dist/go-theme-fbd8a4fa.js +0 -1
- package/dist/index.cjs +0 -61
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2788
- package/dist/src/basic-editor/diff.d.ts +0 -16
- package/dist/src/basic-editor/extensions/go-syntax.d.ts +0 -71
- package/dist/src/basic-editor/extensions/go-template.d.ts +0 -1
- package/dist/src/basic-editor/extensions/jinja.d.ts +0 -4
- package/dist/src/basic-editor/extensions/language-support.d.ts +0 -2
- package/dist/src/basic-editor/extensions/markdown.d.ts +0 -2
- package/dist/src/basic-editor/extensions/search/dom/icon.d.ts +0 -59
- package/dist/src/basic-editor/extensions/search/dom/match-count.d.ts +0 -14
- package/dist/src/basic-editor/extensions/search/index.d.ts +0 -1
- package/dist/src/basic-editor/extensions/search/panel.d.ts +0 -33
- package/dist/src/basic-editor/extensions/search/theme.d.ts +0 -1
- package/dist/src/basic-editor/extensions/validation.d.ts +0 -8
- package/dist/src/basic-editor/extensions/variable.d.ts +0 -11
- package/dist/src/basic-editor/index.d.ts +0 -29
- package/dist/src/code-editor/json-editor.d.ts +0 -18
- package/dist/src/code-editor/raw-text-editor.d.ts +0 -11
- package/dist/src/dev-layout/index.d.ts +0 -7
- package/dist/src/mermaid-diagram/index.d.ts +0 -12
- package/dist/src/mermaid-diagram/use-svg-pan-zoom.d.ts +0 -12
- package/dist/src/model-config-editor/basic-type.d.ts +0 -13
- package/dist/src/model-config-editor/model-config-form.d.ts +0 -13
- package/dist/src/model-config-editor/popover-type.d.ts +0 -19
- package/dist/src/model-select/index.d.ts +0 -27
- package/dist/src/model-select/model-option/index.d.ts +0 -25
- package/dist/src/model-select/model-option-group/index.d.ts +0 -16
- package/dist/src/prompt-editor/index.d.ts +0 -31
- package/dist/src/prompt-editor/message-type-select.d.ts +0 -11
- package/dist/src/schema-editor/index.d.ts +0 -11
- package/dist/src/utils/model-config.d.ts +0 -5
- package/dist/style.css +0 -1
- package/dist/test-build.d.ts +0 -7
- package/dist/vite.config.d.ts +0 -2
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
var prompt_editor_exports = {};
|
|
59
|
+
__export(prompt_editor_exports, {
|
|
60
|
+
PromptEditor: () => PromptEditor
|
|
61
|
+
});
|
|
62
|
+
module.exports = __toCommonJS(prompt_editor_exports);
|
|
63
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
64
|
+
var import_react = require("react");
|
|
65
|
+
var import_classnames = __toESM(require("classnames"));
|
|
66
|
+
var import_prompt_api = require("../idls/prompt_api");
|
|
67
|
+
var import_icons = require("@coze-arch/coze-design/icons");
|
|
68
|
+
var import_coze_design = require("@coze-arch/coze-design");
|
|
69
|
+
var import_consts = require("../consts");
|
|
70
|
+
var import_basic_editor = require("../basic-editor");
|
|
71
|
+
var import_message_type_select = require("./message-type-select");
|
|
72
|
+
var import_index = __toESM(require("./index.module"));
|
|
73
|
+
const PromptEditor = (0, import_react.forwardRef)(
|
|
74
|
+
(_a, ref) => {
|
|
75
|
+
var _b = _a, {
|
|
76
|
+
className,
|
|
77
|
+
message,
|
|
78
|
+
dragBtnHidden,
|
|
79
|
+
messageTypeDisabled,
|
|
80
|
+
variables,
|
|
81
|
+
disabled,
|
|
82
|
+
isDrag,
|
|
83
|
+
onMessageChange,
|
|
84
|
+
onMessageTypeChange,
|
|
85
|
+
placeholder,
|
|
86
|
+
messageTypeList,
|
|
87
|
+
leftActionBtns,
|
|
88
|
+
rightActionBtns,
|
|
89
|
+
children,
|
|
90
|
+
hideActionWrap,
|
|
91
|
+
isFullscreen
|
|
92
|
+
} = _b, rest = __objRest(_b, [
|
|
93
|
+
"className",
|
|
94
|
+
"message",
|
|
95
|
+
"dragBtnHidden",
|
|
96
|
+
"messageTypeDisabled",
|
|
97
|
+
"variables",
|
|
98
|
+
"disabled",
|
|
99
|
+
"isDrag",
|
|
100
|
+
"onMessageChange",
|
|
101
|
+
"onMessageTypeChange",
|
|
102
|
+
"placeholder",
|
|
103
|
+
"messageTypeList",
|
|
104
|
+
"leftActionBtns",
|
|
105
|
+
"rightActionBtns",
|
|
106
|
+
"children",
|
|
107
|
+
"hideActionWrap",
|
|
108
|
+
"isFullscreen"
|
|
109
|
+
]);
|
|
110
|
+
const [editorActive, setEditorActive] = (0, import_react.useState)(false);
|
|
111
|
+
const handleMessageContentChange = (v) => {
|
|
112
|
+
onMessageChange == null ? void 0 : onMessageChange(__spreadProps(__spreadValues({}, message), { content: v }));
|
|
113
|
+
};
|
|
114
|
+
const readonly = disabled || isDrag;
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: (0, import_classnames.default)(
|
|
119
|
+
import_index.default["prompt-editor-container"],
|
|
120
|
+
{
|
|
121
|
+
[import_index.default["prompt-editor-container-active"]]: editorActive,
|
|
122
|
+
[import_index.default["prompt-editor-container-disabled"]]: disabled,
|
|
123
|
+
[import_index.default["full-screen"]]: isFullscreen
|
|
124
|
+
},
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
children: [
|
|
128
|
+
hideActionWrap ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.header, children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_coze_design.Space, { spacing: 2, children: [
|
|
130
|
+
dragBtnHidden ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
import_coze_design.IconButton,
|
|
132
|
+
{
|
|
133
|
+
color: "secondary",
|
|
134
|
+
size: "mini",
|
|
135
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.IconCozHandle, { fontSize: 14 }),
|
|
136
|
+
className: (0, import_classnames.default)("drag !w-[14px]", import_index.default["drag-btn"])
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
(message == null ? void 0 : message.message_type) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
+
import_message_type_select.MessageTypeSelect,
|
|
141
|
+
{
|
|
142
|
+
value: message.message_type,
|
|
143
|
+
onChange: onMessageTypeChange,
|
|
144
|
+
disabled: messageTypeDisabled || readonly,
|
|
145
|
+
messageTypeList
|
|
146
|
+
}
|
|
147
|
+
) : null,
|
|
148
|
+
leftActionBtns
|
|
149
|
+
] }),
|
|
150
|
+
rightActionBtns
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
className: (0, import_classnames.default)("w-full overflow-y-auto styled-scrollbar", {
|
|
156
|
+
"py-1": (message == null ? void 0 : message.message_type) !== import_prompt_api.flow_devops_prompt_common.MessageType.Placeholder
|
|
157
|
+
}),
|
|
158
|
+
children: (message == null ? void 0 : message.message_type) === import_prompt_api.flow_devops_prompt_common.MessageType.Placeholder ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
159
|
+
import_coze_design.Input,
|
|
160
|
+
{
|
|
161
|
+
value: message.content,
|
|
162
|
+
onChange: handleMessageContentChange,
|
|
163
|
+
borderless: true,
|
|
164
|
+
disabled: readonly,
|
|
165
|
+
style: { border: 0, borderRadius: 0 },
|
|
166
|
+
onInput: (event) => {
|
|
167
|
+
const target = event.target;
|
|
168
|
+
if (target) {
|
|
169
|
+
let { value } = target;
|
|
170
|
+
if (value === "") {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (!/^[A-Za-z]/.test(value)) {
|
|
174
|
+
value = value.slice(1);
|
|
175
|
+
}
|
|
176
|
+
value = value.replace(/[^A-Za-z0-9_]/g, "");
|
|
177
|
+
target.value = value;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
maxLength: import_consts.VARIABLE_MAX_LEN,
|
|
181
|
+
max: 50,
|
|
182
|
+
className: "!pl-3 font-sm",
|
|
183
|
+
inputStyle: {
|
|
184
|
+
fontSize: 13,
|
|
185
|
+
color: "var(--Green-COZColorGreen7, #00A136)",
|
|
186
|
+
fontFamily: "JetBrainsMonoRegular"
|
|
187
|
+
},
|
|
188
|
+
onFocus: () => setEditorActive(true),
|
|
189
|
+
onBlur: () => setEditorActive(false),
|
|
190
|
+
placeholder: "支持输入英文字母和下划线,且首字母必须是字母"
|
|
191
|
+
},
|
|
192
|
+
message.key || message.id
|
|
193
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
194
|
+
import_basic_editor.PromptBasicEditor,
|
|
195
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
196
|
+
defaultValue: message == null ? void 0 : message.content,
|
|
197
|
+
onChange: handleMessageContentChange,
|
|
198
|
+
variables,
|
|
199
|
+
readOnly: readonly,
|
|
200
|
+
linePlaceholder: placeholder,
|
|
201
|
+
onFocus: () => setEditorActive(true),
|
|
202
|
+
onBlur: () => setEditorActive(false),
|
|
203
|
+
ref,
|
|
204
|
+
children
|
|
205
|
+
}),
|
|
206
|
+
(message == null ? void 0 : message.key) || (message == null ? void 0 : message.id)
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
216
|
+
0 && (module.exports = {
|
|
217
|
+
PromptEditor
|
|
218
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_module_exports = {};
|
|
20
|
+
__export(index_module_exports, {
|
|
21
|
+
default: () => index_module_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(index_module_exports);
|
|
24
|
+
var import_index_module = require("./index_module.css");
|
|
25
|
+
var index_module_default = { "prompt-editor-container": "prompt-editor-container_8d7ff", "header": "header_8d7ff", "drag-btn": "drag-btn_8d7ff", "prompt-editor-container-error": "prompt-editor-container-error_8d7ff", "prompt-editor-btn-group": "prompt-editor-btn-group_8d7ff", "prompt-editor-container-active": "prompt-editor-container-active_8d7ff", "prompt-editor-container-disabled": "prompt-editor-container-disabled_8d7ff", "role-display": "role-display_8d7ff", "full-screen": "full-screen_8d7ff" };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* stylelint-disable font-family-no-missing-generic-family-keyword */
|
|
2
|
+
/* stylelint-disable declaration-no-important */
|
|
3
|
+
.prompt-editor-container_8d7ff {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
align-self: stretch;
|
|
9
|
+
background: var(--Bg-COZ-bg-max, #FFF);
|
|
10
|
+
border: 1px solid var(--Stroke-COZ-stroke-plus, rgba(68, 83, 130, 0.25));
|
|
11
|
+
border-radius: var(--Radius-Default, 6px);
|
|
12
|
+
}
|
|
13
|
+
.prompt-editor-container_8d7ff .header_8d7ff {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 36px;
|
|
20
|
+
padding: 12px 8px;
|
|
21
|
+
border-bottom: 1px solid var(--Stroke-COZ-stroke-primary, rgba(82, 100, 154, 0.13));
|
|
22
|
+
}
|
|
23
|
+
.prompt-editor-container_8d7ff .header_8d7ff .drag-btn_8d7ff {
|
|
24
|
+
color: var(--coz-fg-dim);
|
|
25
|
+
}
|
|
26
|
+
.prompt-editor-container_8d7ff .header_8d7ff .drag-btn_8d7ff:hover {
|
|
27
|
+
color: var(--coz-fg-secondary);
|
|
28
|
+
}
|
|
29
|
+
.prompt-editor-container-error_8d7ff {
|
|
30
|
+
border: 1px solid var(--Red-COZ-red-500, #F54A45);
|
|
31
|
+
}
|
|
32
|
+
.prompt-editor-container_8d7ff .prompt-editor-btn-group_8d7ff {
|
|
33
|
+
display: none;
|
|
34
|
+
transition: all 0.2s ease-in-out;
|
|
35
|
+
}
|
|
36
|
+
.prompt-editor-container_8d7ff input::placeholder {
|
|
37
|
+
font-family: JetBrainsMonoBold !important;
|
|
38
|
+
font-size: 13px !important;
|
|
39
|
+
}
|
|
40
|
+
.prompt-editor-container_8d7ff .cm-scroller {
|
|
41
|
+
scrollbar-gutter: stable;
|
|
42
|
+
}
|
|
43
|
+
.prompt-editor-container_8d7ff .cm-scroller::-webkit-scrollbar-thumb {
|
|
44
|
+
visibility: hidden;
|
|
45
|
+
}
|
|
46
|
+
.prompt-editor-container-active_8d7ff {
|
|
47
|
+
border: 1px solid rgba(var(--coze-up-brand-9), 1);
|
|
48
|
+
}
|
|
49
|
+
.prompt-editor-container-active_8d7ff .cm-scroller::-webkit-scrollbar-thumb {
|
|
50
|
+
visibility: visible;
|
|
51
|
+
}
|
|
52
|
+
.prompt-editor-container-disabled_8d7ff {
|
|
53
|
+
background: var(--coz-bg-primary, #F7F7FC);
|
|
54
|
+
}
|
|
55
|
+
.prompt-editor-container_8d7ff:hover .prompt-editor-btn-group_8d7ff {
|
|
56
|
+
display: flex;
|
|
57
|
+
}
|
|
58
|
+
.prompt-editor-container_8d7ff:hover .cm-scroller::-webkit-scrollbar-thumb {
|
|
59
|
+
visibility: visible;
|
|
60
|
+
}
|
|
61
|
+
.role-display_8d7ff {
|
|
62
|
+
color: var(--Fg-COZ-fg-dim, rgba(55, 67, 106, 0.38)) !important;
|
|
63
|
+
}
|
|
64
|
+
.full-screen_8d7ff {
|
|
65
|
+
position: fixed !important;
|
|
66
|
+
z-index: 1000;
|
|
67
|
+
inset: 0 !important;
|
|
68
|
+
width: 100% !important;
|
|
69
|
+
height: 100% !important;
|
|
70
|
+
background-color: var(--semi-color-bg-0);
|
|
71
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var message_type_select_exports = {};
|
|
30
|
+
__export(message_type_select_exports, {
|
|
31
|
+
MessageTypeSelect: () => MessageTypeSelect
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(message_type_select_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_icons = require("@coze-arch/coze-design/icons");
|
|
38
|
+
var import_coze_design = require("@coze-arch/coze-design");
|
|
39
|
+
var import_index = __toESM(require("./index.module"));
|
|
40
|
+
function MessageTypeSelect({
|
|
41
|
+
value,
|
|
42
|
+
onChange,
|
|
43
|
+
disabled,
|
|
44
|
+
messageTypeList = []
|
|
45
|
+
}) {
|
|
46
|
+
var _a, _b, _c, _d;
|
|
47
|
+
const [visible, setVisible] = (0, import_react.useState)(false);
|
|
48
|
+
if (disabled) {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_coze_design.Typography.Text,
|
|
51
|
+
{
|
|
52
|
+
size: "small",
|
|
53
|
+
type: "tertiary",
|
|
54
|
+
className: (0, import_classnames.default)("px-2", import_index.default["role-display"], "variable-text"),
|
|
55
|
+
children: (_b = ((_a = messageTypeList.find((it) => it.value === value)) == null ? void 0 : _a.label) || value) != null ? _b : "-"
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_coze_design.Menu,
|
|
61
|
+
{
|
|
62
|
+
visible,
|
|
63
|
+
trigger: "custom",
|
|
64
|
+
position: "bottomLeft",
|
|
65
|
+
showTick: false,
|
|
66
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_coze_design.Menu.SubMenu,
|
|
68
|
+
{
|
|
69
|
+
mode: "selection",
|
|
70
|
+
selectedKeys: [`${value}`],
|
|
71
|
+
onSelectionChange: (v) => {
|
|
72
|
+
onChange == null ? void 0 : onChange(Number(v));
|
|
73
|
+
setVisible(false);
|
|
74
|
+
},
|
|
75
|
+
children: messageTypeList == null ? void 0 : messageTypeList.map((it) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_coze_design.Menu.Item,
|
|
77
|
+
{
|
|
78
|
+
itemKey: `${it.value}`,
|
|
79
|
+
className: (0, import_classnames.default)("!px-2", {
|
|
80
|
+
"coz-mg-primary": `${it}` === `${value}`
|
|
81
|
+
}),
|
|
82
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_coze_design.Typography.Text, { className: "variable-text", children: it.label })
|
|
83
|
+
},
|
|
84
|
+
it.value
|
|
85
|
+
))
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
onClickOutSide: () => setVisible(false),
|
|
89
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
90
|
+
import_coze_design.Button,
|
|
91
|
+
{
|
|
92
|
+
size: "mini",
|
|
93
|
+
color: "secondary",
|
|
94
|
+
onClick: () => setVisible(true),
|
|
95
|
+
className: (0, import_classnames.default)(import_index.default["role-display"], "variable-text"),
|
|
96
|
+
children: [
|
|
97
|
+
(_d = ((_c = messageTypeList.find((it) => it.value === value)) == null ? void 0 : _c.label) || value) != null ? _d : "-",
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.IconCozNodeExpand, { className: "ml-0.5" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
+
0 && (module.exports = {
|
|
107
|
+
MessageTypeSelect
|
|
108
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var schema_editor_exports = {};
|
|
30
|
+
__export(schema_editor_exports, {
|
|
31
|
+
SchemaEditor: () => SchemaEditor
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(schema_editor_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_classnames = __toESM(require("classnames"));
|
|
36
|
+
var import_code_editor = require("../code-editor");
|
|
37
|
+
const SchemaEditor = ({
|
|
38
|
+
value,
|
|
39
|
+
onChange,
|
|
40
|
+
placeholder,
|
|
41
|
+
readOnly,
|
|
42
|
+
language,
|
|
43
|
+
className
|
|
44
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: (0, import_classnames.default)(
|
|
48
|
+
"w-full h-[500px] border border-solid coz-stroke-primary rounded-[4px] overflow-hidden relative bg-white",
|
|
49
|
+
{ "opacity-70": readOnly },
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
children: language === "json" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
import_code_editor.BaseJsonEditor,
|
|
54
|
+
{
|
|
55
|
+
className: "w-full h-full overflow-y-auto",
|
|
56
|
+
onChange,
|
|
57
|
+
value: value || "",
|
|
58
|
+
placeholder,
|
|
59
|
+
readonly: readOnly,
|
|
60
|
+
borderRadius: 4
|
|
61
|
+
}
|
|
62
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
import_code_editor.BaseRawTextEditor,
|
|
64
|
+
{
|
|
65
|
+
className: "w-full h-full overflow-y-auto",
|
|
66
|
+
onChange,
|
|
67
|
+
value: value || "",
|
|
68
|
+
placeholder,
|
|
69
|
+
readonly: readOnly
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
SchemaEditor
|
|
77
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var base_exports = {};
|
|
20
|
+
__export(base_exports, {
|
|
21
|
+
convertNumberToThousands: () => convertNumberToThousands,
|
|
22
|
+
handleScrollToBottom: () => handleScrollToBottom,
|
|
23
|
+
messageId: () => messageId,
|
|
24
|
+
recordToArray: () => recordToArray,
|
|
25
|
+
safeParseJson: () => safeParseJson,
|
|
26
|
+
sleep: () => sleep
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(base_exports);
|
|
29
|
+
var import_lodash_es = require("lodash-es");
|
|
30
|
+
const safeParseJson = (jsonString, fallback) => {
|
|
31
|
+
try {
|
|
32
|
+
if (jsonString) {
|
|
33
|
+
return JSON.parse(jsonString);
|
|
34
|
+
}
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return fallback;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const HEIGHT_BUFFER = 20;
|
|
40
|
+
const handleScrollToBottom = (e, callback) => {
|
|
41
|
+
const { scrollTop, clientHeight, scrollHeight } = e.currentTarget;
|
|
42
|
+
if (scrollTop + clientHeight + HEIGHT_BUFFER >= scrollHeight) {
|
|
43
|
+
callback();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function sleep(timer = 600) {
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
setTimeout(() => resolve(), timer);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const messageId = () => {
|
|
52
|
+
const date = /* @__PURE__ */ new Date();
|
|
53
|
+
return date.getTime() + (0, import_lodash_es.uniqueId)();
|
|
54
|
+
};
|
|
55
|
+
const thousand = 1e3;
|
|
56
|
+
const convertNumberToThousands = (num) => {
|
|
57
|
+
if (!num) {
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
const number = Number(num);
|
|
61
|
+
if (number < thousand) {
|
|
62
|
+
return number;
|
|
63
|
+
} else {
|
|
64
|
+
return `${(number / thousand).toFixed(1)} K`;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
function recordToArray(record) {
|
|
68
|
+
return Object.entries(record).map(([key, value]) => ({
|
|
69
|
+
label: key,
|
|
70
|
+
value
|
|
71
|
+
// 将值转换为字符串,如果值为 undefined 则不设置
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
convertNumberToThousands,
|
|
77
|
+
handleScrollToBottom,
|
|
78
|
+
messageId,
|
|
79
|
+
recordToArray,
|
|
80
|
+
safeParseJson,
|
|
81
|
+
sleep
|
|
82
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var model_config_exports = {};
|
|
30
|
+
__export(model_config_exports, {
|
|
31
|
+
convertModelToModelConfig: () => convertModelToModelConfig,
|
|
32
|
+
renderModelOfflineTag: () => renderModelOfflineTag
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(model_config_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var FornaxMlFlow = __toESM(require("../idls/fornax_ml_flow"));
|
|
37
|
+
var import_coze_design = require("@coze-arch/coze-design");
|
|
38
|
+
var import_model_config_form = require("../model-config-editor/model-config-form");
|
|
39
|
+
var import_consts = require("../consts");
|
|
40
|
+
const convertModelToModelConfig = (model) => {
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
return {
|
|
43
|
+
id: model == null ? void 0 : model.id,
|
|
44
|
+
name: model == null ? void 0 : model.displayName,
|
|
45
|
+
provider: model == null ? void 0 : model.provider,
|
|
46
|
+
provider_model_id: model == null ? void 0 : model.identification,
|
|
47
|
+
temperature: (0, import_model_config_form.convertInt64ToNumber)((_a = model == null ? void 0 : model.defaultRuntimeParam) == null ? void 0 : _a.temperature),
|
|
48
|
+
max_tokens: (0, import_model_config_form.convertInt64ToNumber)(
|
|
49
|
+
((_b = model == null ? void 0 : model.defaultRuntimeParam) == null ? void 0 : _b.maxTokens) || import_consts.DEFAULT_MAX_TOKENS
|
|
50
|
+
),
|
|
51
|
+
top_p: (0, import_model_config_form.convertInt64ToNumber)((_c = model == null ? void 0 : model.defaultRuntimeParam) == null ? void 0 : _c.topP),
|
|
52
|
+
function_call_mode: (_d = model == null ? void 0 : model.ability) == null ? void 0 : _d.functionCallEnabled
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
const renderModelOfflineTag = (model) => {
|
|
56
|
+
if ((model == null ? void 0 : model.modelStatus) === FornaxMlFlow.ModelStatus.Offlining) {
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_coze_design.Tag, { color: "yellow", className: "flex-shrink-0", size: "mini", children: "下线中" });
|
|
58
|
+
} else if ((model == null ? void 0 : model.modelStatus) === FornaxMlFlow.ModelStatus.Unavailable) {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_coze_design.Tag, { color: "red", className: "flex-shrink-0", size: "mini", children: "已下线" });
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
convertModelToModelConfig,
|
|
66
|
+
renderModelOfflineTag
|
|
67
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface PromptDiffEditorRef {
|
|
3
|
+
goToPreviousChunk: () => void;
|
|
4
|
+
goToNextChunk?: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface PromptDiffEditorProps {
|
|
7
|
+
oldValue?: string;
|
|
8
|
+
newValue?: string;
|
|
9
|
+
autoScrollToBottom?: boolean;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
editorAble?: boolean;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const PromptDiffEditor: import("react").ForwardRefExoticComponent<PromptDiffEditorProps & import("react").RefAttributes<PromptDiffEditorRef>>;
|
|
15
|
+
export {};
|