feat: improve decision conditions with param-based JS evaluation

- Add stripTemplateVarsForJS() to convert {{var}} outside quotes to bare JS variable names, enabling direct param/export access in condition expressions
- Add normalizeBoolStringsForJS() to convert string 'true'/'false' to actual booleans for correct JS truthiness evaluation
- Auto-classify asset types in db_import_asset_from_file() and default source to 'web' when empty
- Improve table display with terminal auto-width detection via term.GetSize(), custom column weights, and display name aliases (status_code → status)
- Change default --width to 0 (auto-detect) with weighted column distribution and minimum header-based sizing
- Add comprehensive tests for param-based conditions and JSON asset imports
- Update test data to use direct param references in conditions instead of exports
This commit is contained in:
j3ssie
2026-02-17 22:05:18 +07:00
parent fba43ba3b5
commit 0da63bf9b3
6 changed files with 401 additions and 32 deletions
+2 -4
View File
@@ -14,15 +14,13 @@ params:
default: "3"
steps:
# Step 1: Single condition match with function
# Step 1: Single condition match — uses params directly (no exports needed)
- name: check-target
type: bash
command: echo "Checking target"
exports:
has_target: "true"
decision:
conditions:
- if: "{{has_target}}"
- if: "{{enable_extra}} && {{target}} != ''"
function: "log_info('[COND] Target is present')"
# Step 2: Multiple conditions - all matching ones execute