- message: 'Please provide content to echo it:'
  options:
    - label: ๐ SELECTED TEXT
      value: '{{selection}}'
    - label: ๐ป TRANSCRIPT
      value: '{{transcript}}'
    - label: ๐ PAGE
      value: '{{page}}'
    - label: โ ADD
      value: add
    - label: โ DELETE
      value: delete
    - $custom
  vision:
    enabled: false
    mode: area
    hint: ''
    send: true
  type: ask
  param: textContent
  default: ''
  optionsInvalid: false
  label: SAY INPUT
- type: group
  steps:
    - type: ask
      param: textContentGlobal
      message: Which text would you like to save globally?
      options: null
      default: ''
      vision:
        enabled: false
        mode: area
        hint: ''
        send: true
      condition: '{{textContent}} = add'
      label: SET TEXT | ADD
    - type: ask
      param: addParameter
      message: >-
        Create a parameter name! What should the global parameter be called?
        Like โparam1โ without โg.โ
      options: null
      default: ''
      vision:
        enabled: false
        mode: area
        hint: ''
        send: true
      label: PARAMETER NAME | ADD
    - type: calc
      func: set
      param: g.{{addParameter}}
      format: ''
      value: '{{textContentGlobal}}'
      label: SET PARAMETER
    - type: say
      message: >-
        The parameter was created successfully and the list is saved in
        {{g.list.global.parameter}}!
      interpolate: false
      label: DISPLAY GLOBAL VARIABLES | ADD
    - type: js
      args: addParameter, g.list.global.parameter
      code: |-
        let globalList = args['g.list.global.parameter'] || '';
        const newParam = args.addParameter;
        if (globalList === '') {
          globalList = newParam;
        } else {
          globalList += ',' + newParam;
        }
        return globalList;
      param: globalList
      timeout: 15000
      onFailure: SET NEW VALUES TO LIST.GLOBAL.PARAMETER
      silent: true
      label: ADD TO GLOBAL PARAMETER LIST
  condition: '{{textContent}} = add'
  label: ADD PARAMETER GLOBAL STORAGE
- type: group
  steps:
    - type: ask
      param: deleteParameter
      message: >-
        Provide the name of the parameter you want to delete, such as: `param1`
        without the `g.`.
      options: null
      default: ' '
      vision:
        enabled: false
        mode: area
        hint: ''
        send: true
      label: PARAMETER NAME | DELETE
    - type: calc
      func: delete
      param: g.{{deleteParameter}}
      label: DELETE PARAMETER
    - type: say
      message: >-
        The parameter was deleted successfully and the list is shown in
        {{g.list.global.parameter}}!
      interpolate: false
      label: DISPLAY GLOBAL VARIABLES | DELETE
    - type: js
      args: deleteParameter, g.list.global.parameter
      code: |-
        let globalList = args['g.list.global.parameter'] || '';
        const paramToDelete = args.deleteParameter;
        if (globalList !== '') {
          const params = globalList.split(',');
          const updatedParams = params.filter(param => param !== paramToDelete);
          globalList = updatedParams.join(',');
        }
        return globalList;
      param: globalList
      timeout: 15000
      onFailure: SET NEW VALUES TO LIST.GLOBAL.PARAMETER
      silent: true
      label: DELETE FROM GLOBAL PARAMETER LIST
  label: DELETE PARAMETER GLOBAL STORAGE
  condition: '{{textContent}} = delete'
- type: group
  steps:
    - type: say
      message: User input is empty!
      condition: '{{textContent}} ='
      label: OUTPUT NULL
    - type: say
      message: '{{textContent}}'
      label: SAY OUTPUT
      condition: '{{textContent}} !='
    - type: jump
      to: SAY INPUT
  label: JUST THE SAY INPUT | ECHO
  condition: '{{textContent}} =~ \b(?!add$|delete$)\w+|\s+'
- type: group
  steps:
    - type: calc
      func: set
      param: g.list.global.parameter
      format: auto
      value: '{{globalList}}'
      label: SET NEW VALUES TO LIST.GLOBAL.PARAMETER
    - type: say
      message: |-
        **Global Parameters List:**
        `{{g.list.global.parameter}}`
      label: DISPLAY EXISTING GLOBAL PARAMETER
    - type: jump
      to: SAY INPUT
  label: LIST GLOBAL PARAMETER
  condition:
    - '{{textContent}} = add'
    - '{{textContent}} = delete'
This automation command is created by a community member. HARPA AI team does not audit community commands.
Please review the command carefully and only install if you trust the creator.
All rights reserved ยฉ HARPA AI TECHNOLOGIES LLC, 2021 โ 2025
Designed and engineered in Finland ๐ซ๐ฎ