diff --git a/grimoire-runner/src/grimoire_runner/services/template_service.py b/grimoire-runner/src/grimoire_runner/services/template_service.py index b7678ab..c0666fd 100644 --- a/grimoire-runner/src/grimoire_runner/services/template_service.py +++ b/grimoire-runner/src/grimoire_runner/services/template_service.py @@ -115,6 +115,12 @@ def _try_parse_structured_data(self, result: str) -> Any: except ValueError: pass + # Explicitly handle boolean strings + if result.lower() == "true": + return True + elif result.lower() == "false": + return False + # Try JSON for clearly JSON-formatted results if (result.startswith("{") and result.endswith("}")) or ( result.startswith("[") and result.endswith("]") diff --git a/systems/knave_1e/flows/roll_saving_throw.advantage.yaml b/systems/knave_1e/fixtures/flows/roll_saving_throw.advantage.yaml similarity index 100% rename from systems/knave_1e/flows/roll_saving_throw.advantage.yaml rename to systems/knave_1e/fixtures/flows/roll_saving_throw.advantage.yaml diff --git a/systems/knave_1e/flows/roll_saving_throw.basic.yaml b/systems/knave_1e/fixtures/flows/roll_saving_throw.basic.yaml similarity index 100% rename from systems/knave_1e/flows/roll_saving_throw.basic.yaml rename to systems/knave_1e/fixtures/flows/roll_saving_throw.basic.yaml diff --git a/systems/knave_1e/flows/roll_saving_throw.disadvantage.yaml b/systems/knave_1e/fixtures/flows/roll_saving_throw.disadvantage.yaml similarity index 100% rename from systems/knave_1e/flows/roll_saving_throw.disadvantage.yaml rename to systems/knave_1e/fixtures/flows/roll_saving_throw.disadvantage.yaml diff --git a/systems/knave_1e/flows/roll_saving_throw.test_failure.yaml b/systems/knave_1e/fixtures/flows/roll_saving_throw.test_failure.yaml similarity index 100% rename from systems/knave_1e/flows/roll_saving_throw.test_failure.yaml rename to systems/knave_1e/fixtures/flows/roll_saving_throw.test_failure.yaml diff --git a/systems/knave_1e/flows/roll_saving_throw.test_success.yaml b/systems/knave_1e/fixtures/flows/roll_saving_throw.test_success.yaml similarity index 100% rename from systems/knave_1e/flows/roll_saving_throw.test_success.yaml rename to systems/knave_1e/fixtures/flows/roll_saving_throw.test_success.yaml diff --git a/systems/knave_1e/flows/add_items_to_character.yaml b/systems/knave_1e/flows/add_items_to_character.yaml deleted file mode 100644 index b76bb03..0000000 --- a/systems/knave_1e/flows/add_items_to_character.yaml +++ /dev/null @@ -1,43 +0,0 @@ -id: "add_items_to_character" -type: "flow" -name: "Add Items to Character" -description: "Add multiple items to a character's inventory" -version: "1.0" - -inputs: - - type: "character" - id: "character" - required: true - description: "The character to add the items to" - - type: "list" - id: "items" - required: true - description: "The list of items to add to the character's inventory" - -outputs: - - type: "character" - id: "character" - description: "The updated character with the new items" - -variables: {} - -steps: - - id: "add_items" - name: "Add Items to Inventory" - type: "completion" - # TODO: When flow calling is fully implemented, replace this with: - # for each item in inputs.items: - # flow_call: add_item_to_character(character=character, item=item) - # This will ensure capacity checks and other validation logic is reused - actions: - - set_value: - path: "outputs.character.inventory" - value: "{{ (inputs.character.inventory | default([])) + inputs.items }}" - - log_event: - message: "Added {{ inputs.items | length }} items to {{ inputs.character.name or 'Unnamed Character' }}: {{ inputs.items | map(attribute='display_name') | join(', ') }}. Inventory: {{ ((inputs.character.inventory | default([])) + inputs.items) | length }} slots used / {{ inputs.character.inventory_capacity }} capacity" - data: - character_name: "{{ inputs.character.name }}" - items_added: "{{ inputs.items | map(attribute='display_name') | list }}" - items_count: "{{ inputs.items | length }}" - slots_used_after: "{{ (inputs.character.inventory + inputs.items) | sum(attribute='slot_cost') }}" - inventory_capacity: "{{ inputs.character.inventory_capacity }}"