Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
316 changes: 297 additions & 19 deletions src/command_generation/schemas/command_package_ir.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,27 +463,306 @@
"runtime_module_handlers": {
"type": "array",
"items": {
"type": "object",
"required": [
"operation_id",
"import_module",
"function"
],
"properties": {
"operation_id": {
"type": "string",
"minLength": 1
"oneOf": [
{
"type": "object",
"required": [
"operation_id",
"import_module",
"function"
],
"properties": {
"operation_id": {
"type": "string",
"minLength": 1
},
"import_module": {
"type": "string",
"minLength": 1
},
"function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
}
},
"additionalProperties": false
},
"import_module": {
"type": "string",
"minLength": 1
{
"type": "object",
"required": [
"operation_id",
"handler",
"import_module",
"function"
],
"properties": {
"operation_id": {
"type": "string",
"minLength": 1
},
"handler": {
"const": "argparse_function_call"
},
"import_module": {
"type": "string",
"minLength": 1
},
"function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"support_import_module": {
"type": "string",
"minLength": 1
},
"result": {
"enum": [
"return_zero",
"return_int",
"emit_payload"
]
},
"emit_payload": {
"type": "object",
"properties": {
"import_module": {
"type": "string",
"minLength": 1
},
"function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"format_attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
}
},
"additionalProperties": false
},
"arguments": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"kind"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"kind": {
"enum": [
"attr",
"bool_attr",
"list_attr",
"target_root",
"diagnostic_profile",
"module_descriptors"
]
},
"attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"default": {},
"default_current": {
"type": "boolean"
},
"allow_none": {
"type": "boolean"
},
"validate_command": {
"type": "string",
"minLength": 1
},
"validate": {
"type": "boolean"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
{
"type": "object",
"required": [
"operation_id",
"handler",
"command_attr",
"module_import",
"module_program",
"help_payload_import_module",
"help_payload_function",
"help_text_function",
"missing_module_message"
],
"properties": {
"operation_id": {
"type": "string",
"minLength": 1
},
"handler": {
"const": "module_front_door"
},
"command_attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"target_attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"format_attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"module_import": {
"type": "string",
"minLength": 1
},
"module_main": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"module_program": {
"type": "string",
"minLength": 1
},
"include_module_program": {
"type": "boolean"
},
"help_payload_import_module": {
"type": "string",
"minLength": 1
},
"help_payload_function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"help_text_import_module": {
"type": "string",
"minLength": 1
},
"help_text_function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"missing_module_message": {
"type": "string",
"minLength": 1
},
"stdout_replacements": {
"type": "array",
"items": {
"type": "object",
"required": [
"old",
"new"
],
"properties": {
"old": {
"type": "string"
},
"new": {
"type": "string"
}
},
"additionalProperties": false
}
},
"option_specs": {
"type": "array",
"items": {
"type": "object",
"required": [
"option",
"attr"
],
"properties": {
"option": {
"type": "string",
"minLength": 1
},
"attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"fallback_attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
},
"kind": {
"enum": [
"value",
"flag",
"repeated",
"repeated_group"
]
}
},
"additionalProperties": false
}
},
"positionals": {
"type": "array",
"items": {
"type": "object",
"required": [
"commands",
"attr"
],
"properties": {
"commands": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"attr": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
}
},
"additionalProperties": false
}
},
"local_command_handlers": {
"type": "array",
"items": {
"type": "object",
"required": [
"command",
"import_module",
"function"
],
"properties": {
"command": {
"type": "string",
"minLength": 1
},
"import_module": {
"type": "string",
"minLength": 1
},
"function": {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
]
},
"description": "Operation handlers rendered into a generated runtime handler map by importing named runtime primitive functions."
},
Expand Down Expand Up @@ -1513,4 +1792,3 @@
},
"x-command-generation-doc-role": "contract-reference"
}

Loading
Loading