{
  "name": "Sort Downloads with Jev",
  "version": 1,
  "nodes": [
    {
      "localID": 0,
      "typeID": "trigger.directory_changed",
      "customName": "Downloads",
      "isDisabled": false,
      "x": 60.0,
      "y": 110.0,
      "config": {
        "watchPath": "~/Downloads",
        "recursive": false,
        "eventTypes": "created",
        "waitForCloudDownload": true,
        "customArgs": {}
      }
    },
    {
      "localID": 1,
      "typeID": "condition.compare",
      "customName": "Finished download?",
      "isDisabled": false,
      "x": 380.0,
      "y": 110.0,
      "config": {
        "rules": [
          {
            "field": "fileExtension",
            "operator": "matches_regex",
            "value": "^(crdownload|part|download)$",
            "negate": true
          }
        ],
        "logic": "and",
        "caseInsensitive": true,
        "field": "",
        "operator": "equals",
        "value": ""
      }
    },
    {
      "localID": 2,
      "typeID": "condition.compare",
      "customName": "PDF?",
      "isDisabled": false,
      "x": 700.0,
      "y": 110.0,
      "config": {
        "rules": [
          {
            "field": "fileExtension",
            "operator": "equals",
            "value": "pdf",
            "negate": false
          }
        ],
        "logic": "and",
        "caseInsensitive": true,
        "field": "",
        "operator": "equals",
        "value": ""
      }
    },
    {
      "localID": 3,
      "typeID": "transformer.extract_text_pdf",
      "customName": "Extract Text (PDF)",
      "isDisabled": false,
      "x": 1020.0,
      "y": 110.0,
      "config": {
        "filePath": "{{filePath}}",
        "pageRange": "1",
        "outputKey": "text",
        "renderPageImages": false
      }
    },
    {
      "localID": 4,
      "typeID": "condition.compare",
      "customName": "Image?",
      "isDisabled": false,
      "x": 700.0,
      "y": 330.0,
      "config": {
        "rules": [
          {
            "field": "fileType",
            "operator": "equals",
            "value": "Images",
            "negate": false
          }
        ],
        "logic": "and",
        "caseInsensitive": false,
        "field": "",
        "operator": "equals",
        "value": ""
      }
    },
    {
      "localID": 5,
      "typeID": "transformer.extract_text_ocr",
      "customName": "Extract Text (OCR)",
      "isDisabled": false,
      "x": 1020.0,
      "y": 330.0,
      "config": {
        "imagePath": "{{filePath}}",
        "recognitionLevel": "accurate",
        "usesLanguageCorrection": true,
        "outputKey": "extractedText"
      }
    },
    {
      "localID": 6,
      "typeID": "ai.jev_choice",
      "customName": "Jev: Choose",
      "isDisabled": false,
      "x": 1340.0,
      "y": 110.0,
      "config": {
        "account": "",
        "model": "jev-latest",
        "state": "File name: {{fileName}}\nKind: {{fileType}}\n\nText from the file, if any:\n{{text}}{{extractedText}}",
        "question": "What is this downloaded file?",
        "options": {
          "Invoices": "A bill that asks for payment and has not been paid yet: invoice number, amount due, due date.",
          "Receipts": "Proof that a payment already happened: order confirmation, paid total, last digits of a card.",
          "Statements": "A bank, card or brokerage statement listing many transactions over a period.",
          "Contracts": "An agreement between parties with terms and signature lines: NDA, lease, offer letter, service agreement.",
          "Papers": "An academic or technical paper: title, authors, abstract, references.",
          "Installers": "Software to install or update a Mac app: a .dmg, a .pkg, or an app inside a .zip.",
          "Screenshots": "A capture of a screen: app windows, menus, a web page.",
          "Other": "Anything that is none of the above."
        },
        "threshold": 0.8
      }
    },
    {
      "localID": 7,
      "typeID": "condition.compare",
      "customName": "Worth filing?",
      "isDisabled": false,
      "x": 1660.0,
      "y": 110.0,
      "config": {
        "rules": [
          {
            "field": "jev.choice",
            "operator": "not_equals",
            "value": "Other",
            "negate": false
          }
        ],
        "logic": "and",
        "caseInsensitive": false,
        "field": "",
        "operator": "equals",
        "value": ""
      }
    },
    {
      "localID": 8,
      "typeID": "action.move_file",
      "customName": "Move File",
      "isDisabled": false,
      "x": 1980.0,
      "y": 110.0,
      "config": {
        "destination": "~/Documents/Sorted/{{jev.choice}}/",
        "mode": "move",
        "overwrite": false,
        "createDirectories": true,
        "allowFolders": false
      }
    },
    {
      "localID": 9,
      "typeID": "note",
      "customName": "Read section",
      "isDisabled": false,
      "x": 20.0,
      "y": 30.0,
      "config": {
        "backdrop": true,
        "color": "#64B5F6",
        "text": "Read the file",
        "_width": 1260.0,
        "_height": 440.0
      }
    },
    {
      "localID": 10,
      "typeID": "note",
      "customName": "Ask section",
      "isDisabled": false,
      "x": 1300.0,
      "y": 30.0,
      "config": {
        "backdrop": true,
        "color": "#BA68C8",
        "text": "Ask Jev",
        "_width": 300.0,
        "_height": 440.0
      }
    },
    {
      "localID": 11,
      "typeID": "note",
      "customName": "File section",
      "isDisabled": false,
      "x": 1620.0,
      "y": 30.0,
      "config": {
        "backdrop": true,
        "color": "#81C784",
        "text": "File it",
        "_width": 620.0,
        "_height": 440.0
      }
    }
  ],
  "connections": [
    {
      "sourceLocalID": 0,
      "sourcePortID": "outlet_output",
      "targetLocalID": 1,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 1,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 2,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 2,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 3,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 2,
      "sourcePortID": "outlet_no",
      "targetLocalID": 4,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 4,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 5,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 3,
      "sourcePortID": "outlet_document",
      "targetLocalID": 6,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 5,
      "sourcePortID": "outlet_output",
      "targetLocalID": 6,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 4,
      "sourcePortID": "outlet_no",
      "targetLocalID": 6,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 6,
      "sourcePortID": "outlet_confident",
      "targetLocalID": 7,
      "targetPortID": "inlet_input"
    },
    {
      "sourceLocalID": 7,
      "sourcePortID": "outlet_yes",
      "targetLocalID": 8,
      "targetPortID": "inlet_input"
    }
  ],
  "background": {
    "type": "image",
    "ref": {
      "type": "bundled",
      "id": "aurora"
    },
    "fit": "cover"
  }
}
