diff --git a/actions/hello.yaml b/actions/hello.yaml index f978f89..1a46545 100644 --- a/actions/hello.yaml +++ b/actions/hello.yaml @@ -9,6 +9,9 @@ enabled: true # Runner type determines how the action is executed runner_type: python +# Minimum Python version required (semver constraint) +runtime_version: ">=3.9" + # Entry point is the Python script to execute entry_point: hello.py diff --git a/actions/http_example.yaml b/actions/http_example.yaml index 93c0369..9d7c0d9 100644 --- a/actions/http_example.yaml +++ b/actions/http_example.yaml @@ -9,6 +9,9 @@ enabled: true # Runner type runner_type: python +# Minimum Python version required (semver constraint) +runtime_version: ">=3.9" + # Entry point entry_point: http_example.py diff --git a/actions/list_numbers.py b/actions/list_numbers.py new file mode 100644 index 0000000..3069969 --- /dev/null +++ b/actions/list_numbers.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +""" +List Numbers Action - Python Example Pack + +Returns a list of sequential integers as JSON. +Result format: {"items": [start, start+1, ..., start+n-1]} + +Actions receive parameters as JSON on stdin and write results to stdout. +""" + +import json +import sys + + +def main(): + # Read parameters from stdin (JSON format) + params = json.loads(sys.stdin.readline()) + n = int(params.get("n", 10)) + start = int(params.get("start", 0)) + + result = {"items": list(range(start, n + start))} + print(json.dumps(result)) + + +if __name__ == "__main__": + main() diff --git a/actions/list_numbers.yaml b/actions/list_numbers.yaml new file mode 100644 index 0000000..6c8eabc --- /dev/null +++ b/actions/list_numbers.yaml @@ -0,0 +1,47 @@ +# List Numbers Action +# Returns a list of sequential integers as JSON + +ref: python_example.list_numbers +label: "List Numbers" +description: "Returns a list of sequential integers starting from a given value" +enabled: true + +# Runner type determines how the action is executed +runner_type: python + +# Minimum Python version required (semver constraint) +runtime_version: ">=3.9" + +# Entry point is the Python script to execute +entry_point: list_numbers.py + +# Parameter delivery: stdin for secure parameter passing +parameter_delivery: stdin +parameter_format: json + +# Output format: json (structured data parsing enabled) +output_format: json + +# Action parameters schema (flat format with inline required/secret) +parameters: + n: + type: integer + description: "How many numbers to generate" + default: 10 + start: + type: integer + description: "Starting value of the sequence" + default: 0 + +# Output schema (flat format) +output_schema: + items: + type: array + description: "The list of sequential integers" + required: true + +# Tags for categorization +tags: + - python + - example + - utility diff --git a/actions/read_counter.yaml b/actions/read_counter.yaml index a1e9cd9..c125a33 100644 --- a/actions/read_counter.yaml +++ b/actions/read_counter.yaml @@ -8,6 +8,8 @@ enabled: true # Runner type runner_type: python +# Minimum Python version required (semver constraint) +runtime_version: ">=3.9" # Entry point entry_point: read_counter.py diff --git a/sensors/counter_sensor.yaml b/sensors/counter_sensor.yaml index c373a8c..e7e358e 100644 --- a/sensors/counter_sensor.yaml +++ b/sensors/counter_sensor.yaml @@ -13,6 +13,9 @@ enabled: true # Sensor runner type runner_type: python +# Minimum Python version required +runtime_version: ">=3.9" + # Entry point for sensor execution entry_point: counter_sensor.py