You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fastlane/schemas/fastlane_response.schema.json

286 lines
9.0 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "fastlane_response.schema.json",
"title": "Fastlane Claude Response",
"description": "Zwei Modi: 'form' = Claude braucht Eingaben (flutter_form_builder Formular). 'result' = Claude liefert Ergebnis (HTML + Intents + Code).",
"type": "object",
"properties": {
"response_type": {
"type": "string",
"enum": ["form", "result"]
},
"message": {
"type": "string",
"description": "Bei 'form': warum Eingaben noetig. Bei 'result': Zusammenfassung."
},
"form": {
"$ref": "#/$defs/FormDefinition"
},
"intents": {
"type": "array",
"items": { "$ref": "#/$defs/Intent" }
},
"html_content": {
"type": ["string", "null"],
"maxLength": 100000
},
"code_blocks": {
"type": "array",
"items": { "$ref": "#/$defs/CodeBlock" }
},
"metadata": {
"$ref": "#/$defs/ResponseMetadata"
}
},
"required": ["response_type", "message"],
"if": { "properties": { "response_type": { "const": "form" } } },
"then": { "required": ["response_type", "message", "form"] },
"additionalProperties": false,
"$defs": {
"FormDefinition": {
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": ["string", "null"] },
"fields": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/FormField" }
},
"submit_label": { "type": "string", "default": "Absenden" },
"cancel_label": { "type": ["string", "null"] },
"autovalidate_mode": {
"type": "string",
"enum": ["disabled", "always", "on_user_interaction"],
"default": "on_user_interaction"
},
"layout": {
"type": "string",
"enum": ["vertical", "stepper", "sections"],
"default": "vertical"
},
"sections": {
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": ["string", "null"] },
"icon": { "type": ["string", "null"] },
"field_names": { "type": "array", "items": { "type": "string" } }
},
"required": ["title", "field_names"]
}
}
},
"required": ["title", "fields"]
},
"FormField": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"widget": {
"type": "string",
"enum": [
"text_field",
"dropdown",
"date_time_picker",
"date_range_picker",
"checkbox",
"checkbox_group",
"radio_group",
"switch_field",
"slider",
"range_slider",
"choice_chip",
"filter_chip",
"segmented_control",
"typeahead"
]
},
"label": { "type": "string" },
"hint_text": { "type": ["string", "null"] },
"helper_text": { "type": ["string", "null"] },
"prefix_icon": { "type": ["string", "null"] },
"initial_value": {},
"enabled": { "type": "boolean", "default": true },
"read_only": { "type": "boolean", "default": false },
"validators": {
"type": "array",
"items": { "$ref": "#/$defs/Validator" }
},
"options": {
"type": ["array", "null"],
"items": { "$ref": "#/$defs/FieldOption" }
},
"text_field_config": { "$ref": "#/$defs/TextFieldConfig" },
"date_config": { "$ref": "#/$defs/DateConfig" },
"slider_config": { "$ref": "#/$defs/SliderConfig" },
"conditional": { "$ref": "#/$defs/ConditionalRule" }
},
"required": ["name", "widget", "label"]
},
"Validator": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"required",
"min", "max",
"min_length", "max_length",
"min_words_count", "max_words_count",
"email", "url", "ip",
"match",
"numeric", "integer",
"credit_card",
"date_string",
"equal", "not_equal",
"between",
"contains", "not_contains",
"ends_with", "starts_with",
"has_uppercase_chars", "has_lowercase_chars",
"has_numeric_chars", "has_special_chars",
"file_extension", "file_size",
"conditional"
]
},
"value": { "description": "Parameter (z.B. 70 fuer max, 3 fuer min_length, Regex fuer match)." },
"value2": { "description": "Zweiter Parameter (z.B. Obergrenze fuer between)." },
"error_text": { "type": ["string", "null"] }
},
"required": ["type"]
},
"FieldOption": {
"type": "object",
"properties": {
"value": { "type": "string" },
"label": { "type": "string" },
"icon": { "type": ["string", "null"] },
"enabled": { "type": "boolean", "default": true },
"group": { "type": ["string", "null"] }
},
"required": ["value", "label"]
},
"TextFieldConfig": {
"type": "object",
"properties": {
"keyboard_type": {
"type": "string",
"enum": ["text", "multiline", "number", "phone", "email_address", "url", "datetime", "visible_password"],
"default": "text"
},
"max_lines": { "type": "integer", "minimum": 1, "default": 1 },
"min_lines": { "type": ["integer", "null"], "minimum": 1 },
"obscure_text": { "type": "boolean", "default": false },
"autocorrect": { "type": "boolean", "default": true },
"text_capitalization": {
"type": "string",
"enum": ["none", "words", "sentences", "characters"],
"default": "none"
},
"input_formatters": {
"type": ["array", "null"],
"items": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["digits_only", "allow", "deny", "mask"] },
"pattern": { "type": ["string", "null"] }
},
"required": ["type"]
}
}
}
},
"DateConfig": {
"type": "object",
"properties": {
"input_type": { "type": "string", "enum": ["date", "time", "both"], "default": "date" },
"first_date": { "type": ["string", "null"], "format": "date" },
"last_date": { "type": ["string", "null"], "format": "date" },
"format": { "type": ["string", "null"], "default": "dd.MM.yyyy" },
"locale": { "type": ["string", "null"] }
}
},
"SliderConfig": {
"type": "object",
"properties": {
"min": { "type": "number" },
"max": { "type": "number" },
"divisions": { "type": ["integer", "null"] },
"display_values": { "type": "string", "enum": ["current", "min_max", "all", "none"], "default": "current" },
"number_format": { "type": ["string", "null"] }
},
"required": ["min", "max"]
},
"ConditionalRule": {
"type": "object",
"properties": {
"field_name": { "type": "string" },
"operator": {
"type": "string",
"enum": ["equals", "not_equals", "contains", "not_contains", "greater_than", "less_than", "is_empty", "is_not_empty", "in_list"]
},
"value": {},
"action": { "type": "string", "enum": ["show", "hide", "enable", "disable"], "default": "show" }
},
"required": ["field_name", "operator"]
},
"Intent": {
"type": "object",
"properties": {
"action": { "type": "string", "enum": ["navigate", "display", "confirm", "refresh", "notify"] },
"target": { "type": ["string", "null"] },
"params": { "type": "object", "additionalProperties": true },
"label": { "type": ["string", "null"] }
},
"required": ["action"]
},
"CodeBlock": {
"type": "object",
"properties": {
"execution_type": { "type": "string", "enum": ["python", "graphql", "odata"] },
"code": { "type": "string", "minLength": 1, "maxLength": 50000 },
"description": { "type": ["string", "null"] },
"variables": { "type": ["object", "null"], "additionalProperties": true },
"idempotent": { "type": "boolean", "default": true }
},
"required": ["execution_type", "code"]
},
"ResponseMetadata": {
"type": "object",
"properties": {
"domain": { "type": "string", "enum": ["fleet", "energy", "logistics", "hr", "finance", "general"] },
"confidence": { "type": "number", "minimum": 0.0, "maximum": 1.0 },
"requires_confirmation": { "type": "boolean", "default": false },
"estimated_records": { "type": "integer", "minimum": 0 },
"tags": { "type": "array", "items": { "type": "string" } }
},
"additionalProperties": true
}
}
}