@takeshape/schema 11.49.0 → 11.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,6 @@
23
23
  "$ref": "#/definitions/agentStateMap"
24
24
  },
25
25
  "guards": {
26
- "title": "AgentGuardList",
27
26
  "type": "array",
28
27
  "items": {
29
28
  "$ref": "#/definitions/agentGuard"
@@ -496,10 +495,11 @@
496
495
  ]
497
496
  },
498
497
  "agentGuard": {
499
- "title": "AgentGuard",
498
+ "title": "Agent Guard",
500
499
  "type": "object",
501
500
  "properties": {
502
501
  "guardId": {
502
+ "title": "Guard ID",
503
503
  "type": "string"
504
504
  }
505
505
  },
@@ -789,6 +789,16 @@
789
789
  "title": "Description",
790
790
  "description": "A description of the Guard."
791
791
  },
792
+ "guardrailIdentifier": {
793
+ "type": "string",
794
+ "title": "Guardrail Identifier",
795
+ "description": "The remote id of the Guardrail."
796
+ },
797
+ "guardrailVersion": {
798
+ "type": "string",
799
+ "title": "Guardrail Version",
800
+ "description": "The remote version of the Guardrail."
801
+ },
792
802
  "blockedInputMessaging": {
793
803
  "type": "string",
794
804
  "title": "Blocked Input Messaging",
@@ -805,10 +815,10 @@
805
815
  "description": "Topics to identify and block.",
806
816
  "properties": {
807
817
  "topicsConfig": {
818
+ "title": "Topic",
819
+ "description": "A topic to block.",
808
820
  "type": "array",
809
821
  "items": {
810
- "title": "Topic",
811
- "description": "A topic to block.",
812
822
  "type": "object",
813
823
  "properties": {
814
824
  "name": {
@@ -818,20 +828,26 @@
818
828
  "type": "string"
819
829
  },
820
830
  "examples": {
831
+ "description": "Examples of the topic that can hint the LLM.",
821
832
  "type": "array",
822
833
  "items": {
834
+ "title": "Example",
823
835
  "type": "string"
824
- }
836
+ },
837
+ "minItems": 1
825
838
  },
826
839
  "type": {
827
840
  "type": "string",
828
841
  "enum": ["DENY"]
829
842
  }
830
843
  },
844
+ "required": ["name", "definition", "type"],
831
845
  "additionalProperties": false
832
- }
846
+ },
847
+ "minItems": 1
833
848
  }
834
849
  },
850
+ "required": ["topicsConfig"],
835
851
  "additionalProperties": false
836
852
  },
837
853
  "contentPolicyConfig": {
@@ -840,10 +856,10 @@
840
856
  "description": "Types of content to filter and strength configuration.",
841
857
  "properties": {
842
858
  "filtersConfig": {
859
+ "title": "Filter",
860
+ "description": "Types of content to filter.",
843
861
  "type": "array",
844
862
  "items": {
845
- "title": "Filter",
846
- "description": "Types of content to filter.",
847
863
  "type": "object",
848
864
  "properties": {
849
865
  "type": {
@@ -851,54 +867,69 @@
851
867
  "enum": ["HATE", "INSULTS", "MICONDUCT", "PROMPT_ATTACK", "SEXUAL", "VIOLENCE"]
852
868
  },
853
869
  "inputStrength": {
854
- "$ref": "#/definitions/guardrailFilterStrength"
870
+ "title": "Input Strength",
871
+ "type": "string",
872
+ "enum": ["NONE", "LOW", "MEDIUM", "HIGH"]
855
873
  },
856
874
  "outputStrength": {
857
- "$ref": "#/definitions/guardrailFilterStrength"
875
+ "title": "Output Strength",
876
+ "type": "string",
877
+ "enum": ["NONE", "LOW", "MEDIUM", "HIGH"]
858
878
  },
859
879
  "inputModalities": {
880
+ "title": "Input Modalities",
881
+ "description": "Whether to filter images or text",
860
882
  "type": "array",
861
883
  "items": {
862
884
  "$ref": "#/definitions/guardrailModality"
863
- }
885
+ },
886
+ "minItems": 1
864
887
  },
865
888
  "outputModalities": {
889
+ "title": "Output Modalities",
890
+ "description": "Whether to filter images or text",
866
891
  "type": "array",
867
892
  "items": {
868
893
  "$ref": "#/definitions/guardrailModality"
869
- }
894
+ },
895
+ "minItems": 1
870
896
  }
871
897
  },
898
+ "required": ["type", "inputStrength", "outputStrength"],
872
899
  "additionalProperties": false
873
- }
900
+ },
901
+ "minItems": 1
874
902
  }
875
903
  },
904
+ "required": ["filtersConfig"],
876
905
  "additionalProperties": false
877
906
  },
878
907
  "wordPolicyConfig": {
879
908
  "type": "object",
880
909
  "title": "Word Policy",
881
- "description": "Specific words to identify and block. The managedWordListsConfig is solely used for blocking profanity.",
910
+ "description": "Specific words to identify and block.",
882
911
  "properties": {
883
912
  "wordsConfig": {
913
+ "title": "Word List",
914
+ "description": "Specific words to block.",
884
915
  "type": "array",
885
916
  "items": {
886
- "title": "Word List",
887
- "description": "Specific words to block.",
888
917
  "type": "object",
889
918
  "properties": {
890
919
  "text": {
891
920
  "type": "string"
892
921
  }
893
922
  },
923
+ "required": ["text"],
894
924
  "additionalProperties": false
895
- }
925
+ },
926
+ "minItems": 1
896
927
  },
897
928
  "managedWordListsConfig": {
929
+ "title": "Managed Word List",
930
+ "description": "This is solely used for blocking profanity.",
898
931
  "type": "array",
899
932
  "items": {
900
- "title": "Managed Words",
901
- "description": "Managed word list to block. This is solely used for blocking profanity.",
902
933
  "type": "object",
903
934
  "properties": {
904
935
  "type": {
@@ -906,8 +937,10 @@
906
937
  "enum": ["PROFANITY"]
907
938
  }
908
939
  },
940
+ "required": ["type"],
909
941
  "additionalProperties": false
910
- }
942
+ },
943
+ "minItems": 1
911
944
  }
912
945
  },
913
946
  "additionalProperties": false
@@ -918,10 +951,10 @@
918
951
  "type": "object",
919
952
  "properties": {
920
953
  "piiEntitiesConfig": {
954
+ "title": "PII Entity",
955
+ "description": "PII entity to infer from the text.",
921
956
  "type": "array",
922
957
  "items": {
923
- "title": "PII Entity",
924
- "description": "PII entity to infer from the text.",
925
958
  "type": "object",
926
959
  "properties": {
927
960
  "type": {
@@ -964,14 +997,16 @@
964
997
  "$ref": "#/definitions/guardrailSensitiveInformationAction"
965
998
  }
966
999
  },
1000
+ "required": ["type", "action"],
967
1001
  "additionalProperties": false
968
- }
1002
+ },
1003
+ "minItems": 1
969
1004
  },
970
1005
  "regexesConfig": {
1006
+ "title": "Regular Expression",
1007
+ "description": "A regular expression to match sensitive information.",
971
1008
  "type": "array",
972
1009
  "items": {
973
- "title": "Regular Expression",
974
- "description": "A regular expression to match sensitive information.",
975
1010
  "type": "object",
976
1011
  "properties": {
977
1012
  "name": {
@@ -987,8 +1022,10 @@
987
1022
  "$ref": "#/definitions/guardrailSensitiveInformationAction"
988
1023
  }
989
1024
  },
1025
+ "required": ["name", "pattern", "action"],
990
1026
  "additionalProperties": false
991
- }
1027
+ },
1028
+ "minItems": 1
992
1029
  }
993
1030
  },
994
1031
  "additionalProperties": false
@@ -999,10 +1036,10 @@
999
1036
  "type": "object",
1000
1037
  "properties": {
1001
1038
  "filtersConfig": {
1039
+ "title": "Filter",
1040
+ "description": "Filter to evaluate grounding text.",
1002
1041
  "type": "array",
1003
1042
  "items": {
1004
- "title": "Filter",
1005
- "description": "Filter to evaluate grounding text.",
1006
1043
  "type": "object",
1007
1044
  "properties": {
1008
1045
  "type": {
@@ -1013,16 +1050,20 @@
1013
1050
  },
1014
1051
  "threshold": {
1015
1052
  "title": "Threshold",
1016
- "description": "The threshold for the filter as a floating point value between 0.0 - 1.0.",
1053
+ "description": "The threshold for the filter as a floating point value greater than 0.0 and less than 1.0.",
1017
1054
  "type": "number",
1018
- "minimum": 0,
1019
- "maximum": 1
1055
+ "multipleOf": 0.01,
1056
+ "exclusiveMinimum": 0,
1057
+ "exclusiveMaximum": 1
1020
1058
  }
1021
1059
  },
1060
+ "required": ["type", "threshold"],
1022
1061
  "additionalProperties": false
1023
- }
1062
+ },
1063
+ "minItems": 1
1024
1064
  }
1025
1065
  },
1066
+ "required": ["filtersConfig"],
1026
1067
  "additionalProperties": false
1027
1068
  }
1028
1069
  },
@@ -1039,11 +1080,6 @@
1039
1080
  },
1040
1081
  "additionalProperties": false
1041
1082
  },
1042
- "guardrailFilterStrength": {
1043
- "title": "Guardrail Filter Strength",
1044
- "type": "string",
1045
- "enum": ["NONE", "HIGH", "LOW", "MEDIUM"]
1046
- },
1047
1083
  "guardrailModality": {
1048
1084
  "title": "Guardrail Modality",
1049
1085
  "type": "string",
@@ -18,7 +18,8 @@ const schemaUpdateMergedKeys = [
18
18
  'workflows',
19
19
  'forms',
20
20
  'services',
21
- 'ai-experimental.agents'
21
+ 'ai-experimental.agents',
22
+ 'ai-experimental.guards'
22
23
  ];
23
24
  function shallowMerge(original, update) {
24
25
  const result = { ...original };
@@ -23,7 +23,6 @@
23
23
  "$ref": "#/definitions/agentStateMap"
24
24
  },
25
25
  "guards": {
26
- "title": "AgentGuardList",
27
26
  "type": "array",
28
27
  "items": {
29
28
  "$ref": "#/definitions/agentGuard"
@@ -496,10 +495,11 @@
496
495
  ]
497
496
  },
498
497
  "agentGuard": {
499
- "title": "AgentGuard",
498
+ "title": "Agent Guard",
500
499
  "type": "object",
501
500
  "properties": {
502
501
  "guardId": {
502
+ "title": "Guard ID",
503
503
  "type": "string"
504
504
  }
505
505
  },
@@ -789,6 +789,16 @@
789
789
  "title": "Description",
790
790
  "description": "A description of the Guard."
791
791
  },
792
+ "guardrailIdentifier": {
793
+ "type": "string",
794
+ "title": "Guardrail Identifier",
795
+ "description": "The remote id of the Guardrail."
796
+ },
797
+ "guardrailVersion": {
798
+ "type": "string",
799
+ "title": "Guardrail Version",
800
+ "description": "The remote version of the Guardrail."
801
+ },
792
802
  "blockedInputMessaging": {
793
803
  "type": "string",
794
804
  "title": "Blocked Input Messaging",
@@ -805,10 +815,10 @@
805
815
  "description": "Topics to identify and block.",
806
816
  "properties": {
807
817
  "topicsConfig": {
818
+ "title": "Topic",
819
+ "description": "A topic to block.",
808
820
  "type": "array",
809
821
  "items": {
810
- "title": "Topic",
811
- "description": "A topic to block.",
812
822
  "type": "object",
813
823
  "properties": {
814
824
  "name": {
@@ -818,20 +828,26 @@
818
828
  "type": "string"
819
829
  },
820
830
  "examples": {
831
+ "description": "Examples of the topic that can hint the LLM.",
821
832
  "type": "array",
822
833
  "items": {
834
+ "title": "Example",
823
835
  "type": "string"
824
- }
836
+ },
837
+ "minItems": 1
825
838
  },
826
839
  "type": {
827
840
  "type": "string",
828
841
  "enum": ["DENY"]
829
842
  }
830
843
  },
844
+ "required": ["name", "definition", "type"],
831
845
  "additionalProperties": false
832
- }
846
+ },
847
+ "minItems": 1
833
848
  }
834
849
  },
850
+ "required": ["topicsConfig"],
835
851
  "additionalProperties": false
836
852
  },
837
853
  "contentPolicyConfig": {
@@ -840,10 +856,10 @@
840
856
  "description": "Types of content to filter and strength configuration.",
841
857
  "properties": {
842
858
  "filtersConfig": {
859
+ "title": "Filter",
860
+ "description": "Types of content to filter.",
843
861
  "type": "array",
844
862
  "items": {
845
- "title": "Filter",
846
- "description": "Types of content to filter.",
847
863
  "type": "object",
848
864
  "properties": {
849
865
  "type": {
@@ -851,54 +867,69 @@
851
867
  "enum": ["HATE", "INSULTS", "MICONDUCT", "PROMPT_ATTACK", "SEXUAL", "VIOLENCE"]
852
868
  },
853
869
  "inputStrength": {
854
- "$ref": "#/definitions/guardrailFilterStrength"
870
+ "title": "Input Strength",
871
+ "type": "string",
872
+ "enum": ["NONE", "LOW", "MEDIUM", "HIGH"]
855
873
  },
856
874
  "outputStrength": {
857
- "$ref": "#/definitions/guardrailFilterStrength"
875
+ "title": "Output Strength",
876
+ "type": "string",
877
+ "enum": ["NONE", "LOW", "MEDIUM", "HIGH"]
858
878
  },
859
879
  "inputModalities": {
880
+ "title": "Input Modalities",
881
+ "description": "Whether to filter images or text",
860
882
  "type": "array",
861
883
  "items": {
862
884
  "$ref": "#/definitions/guardrailModality"
863
- }
885
+ },
886
+ "minItems": 1
864
887
  },
865
888
  "outputModalities": {
889
+ "title": "Output Modalities",
890
+ "description": "Whether to filter images or text",
866
891
  "type": "array",
867
892
  "items": {
868
893
  "$ref": "#/definitions/guardrailModality"
869
- }
894
+ },
895
+ "minItems": 1
870
896
  }
871
897
  },
898
+ "required": ["type", "inputStrength", "outputStrength"],
872
899
  "additionalProperties": false
873
- }
900
+ },
901
+ "minItems": 1
874
902
  }
875
903
  },
904
+ "required": ["filtersConfig"],
876
905
  "additionalProperties": false
877
906
  },
878
907
  "wordPolicyConfig": {
879
908
  "type": "object",
880
909
  "title": "Word Policy",
881
- "description": "Specific words to identify and block. The managedWordListsConfig is solely used for blocking profanity.",
910
+ "description": "Specific words to identify and block.",
882
911
  "properties": {
883
912
  "wordsConfig": {
913
+ "title": "Word List",
914
+ "description": "Specific words to block.",
884
915
  "type": "array",
885
916
  "items": {
886
- "title": "Word List",
887
- "description": "Specific words to block.",
888
917
  "type": "object",
889
918
  "properties": {
890
919
  "text": {
891
920
  "type": "string"
892
921
  }
893
922
  },
923
+ "required": ["text"],
894
924
  "additionalProperties": false
895
- }
925
+ },
926
+ "minItems": 1
896
927
  },
897
928
  "managedWordListsConfig": {
929
+ "title": "Managed Word List",
930
+ "description": "This is solely used for blocking profanity.",
898
931
  "type": "array",
899
932
  "items": {
900
- "title": "Managed Words",
901
- "description": "Managed word list to block. This is solely used for blocking profanity.",
902
933
  "type": "object",
903
934
  "properties": {
904
935
  "type": {
@@ -906,8 +937,10 @@
906
937
  "enum": ["PROFANITY"]
907
938
  }
908
939
  },
940
+ "required": ["type"],
909
941
  "additionalProperties": false
910
- }
942
+ },
943
+ "minItems": 1
911
944
  }
912
945
  },
913
946
  "additionalProperties": false
@@ -918,10 +951,10 @@
918
951
  "type": "object",
919
952
  "properties": {
920
953
  "piiEntitiesConfig": {
954
+ "title": "PII Entity",
955
+ "description": "PII entity to infer from the text.",
921
956
  "type": "array",
922
957
  "items": {
923
- "title": "PII Entity",
924
- "description": "PII entity to infer from the text.",
925
958
  "type": "object",
926
959
  "properties": {
927
960
  "type": {
@@ -964,14 +997,16 @@
964
997
  "$ref": "#/definitions/guardrailSensitiveInformationAction"
965
998
  }
966
999
  },
1000
+ "required": ["type", "action"],
967
1001
  "additionalProperties": false
968
- }
1002
+ },
1003
+ "minItems": 1
969
1004
  },
970
1005
  "regexesConfig": {
1006
+ "title": "Regular Expression",
1007
+ "description": "A regular expression to match sensitive information.",
971
1008
  "type": "array",
972
1009
  "items": {
973
- "title": "Regular Expression",
974
- "description": "A regular expression to match sensitive information.",
975
1010
  "type": "object",
976
1011
  "properties": {
977
1012
  "name": {
@@ -987,8 +1022,10 @@
987
1022
  "$ref": "#/definitions/guardrailSensitiveInformationAction"
988
1023
  }
989
1024
  },
1025
+ "required": ["name", "pattern", "action"],
990
1026
  "additionalProperties": false
991
- }
1027
+ },
1028
+ "minItems": 1
992
1029
  }
993
1030
  },
994
1031
  "additionalProperties": false
@@ -999,10 +1036,10 @@
999
1036
  "type": "object",
1000
1037
  "properties": {
1001
1038
  "filtersConfig": {
1039
+ "title": "Filter",
1040
+ "description": "Filter to evaluate grounding text.",
1002
1041
  "type": "array",
1003
1042
  "items": {
1004
- "title": "Filter",
1005
- "description": "Filter to evaluate grounding text.",
1006
1043
  "type": "object",
1007
1044
  "properties": {
1008
1045
  "type": {
@@ -1013,16 +1050,20 @@
1013
1050
  },
1014
1051
  "threshold": {
1015
1052
  "title": "Threshold",
1016
- "description": "The threshold for the filter as a floating point value between 0.0 - 1.0.",
1053
+ "description": "The threshold for the filter as a floating point value greater than 0.0 and less than 1.0.",
1017
1054
  "type": "number",
1018
- "minimum": 0,
1019
- "maximum": 1
1055
+ "multipleOf": 0.01,
1056
+ "exclusiveMinimum": 0,
1057
+ "exclusiveMaximum": 1
1020
1058
  }
1021
1059
  },
1060
+ "required": ["type", "threshold"],
1022
1061
  "additionalProperties": false
1023
- }
1062
+ },
1063
+ "minItems": 1
1024
1064
  }
1025
1065
  },
1066
+ "required": ["filtersConfig"],
1026
1067
  "additionalProperties": false
1027
1068
  }
1028
1069
  },
@@ -1039,11 +1080,6 @@
1039
1080
  },
1040
1081
  "additionalProperties": false
1041
1082
  },
1042
- "guardrailFilterStrength": {
1043
- "title": "Guardrail Filter Strength",
1044
- "type": "string",
1045
- "enum": ["NONE", "HIGH", "LOW", "MEDIUM"]
1046
- },
1047
1083
  "guardrailModality": {
1048
1084
  "title": "Guardrail Modality",
1049
1085
  "type": "string",
@@ -12,7 +12,8 @@ const schemaUpdateMergedKeys = [
12
12
  'workflows',
13
13
  'forms',
14
14
  'services',
15
- 'ai-experimental.agents'
15
+ 'ai-experimental.agents',
16
+ 'ai-experimental.guards'
16
17
  ];
17
18
  function shallowMerge(original, update) {
18
19
  const result = { ...original };
@@ -1,4 +1,4 @@
1
- import type { AgentJSON, FormConfig, ProjectSchemaJSON, QueryJSON, ServiceConfigJSON, ShapeJSON, Workflow } from '../project-schema';
1
+ import type { AgentJSON, FormConfig, GuardJSON, ProjectSchemaJSON, QueryJSON, ServiceConfigJSON, ShapeJSON, Workflow } from '../project-schema';
2
2
  import type { EncryptFn, SafeDecryptFn } from '../services/types';
3
3
  export type ProjectSchemaMigrationContext = {
4
4
  generateDataKeyFn: () => Promise<string>;
@@ -10,6 +10,7 @@ export type ProjectSchemaUpdate = {
10
10
  mutations?: Record<string, QueryJSON | null>;
11
11
  shapes?: Record<string, ShapeJSON | null>;
12
12
  'ai-experimental.agents'?: Record<string, AgentJSON | null>;
13
+ 'ai-experimental.guards'?: Record<string, GuardJSON | null>;
13
14
  forms?: Record<string, FormConfig | null>;
14
15
  workflows?: Record<string, Workflow | null>;
15
16
  services?: Record<string, ServiceConfigJSON | null>;