{
  "name": "@powerhousedao/piece-reactor",
  "version": "6.2.3",
  "displayName": "Powerhouse Reactor",
  "logoUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMTQgMTE0IiBmaWxsPSJub25lIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZmlsbD0iIzE2MTYxNiIgZD0iTTcxLjI5MTkgMEwyNC4zNDE1IDM4Ljg3NzJDMTcuNDU0OCA0NC41Nzk4IDE2Ljk1MzkgNTQuOTY1OSAyMy4yNiA2MS4zMDQ3TDM5LjUwMjggNzcuNjMxOEM0NC4yNjg0IDgyLjQyMjEgNDUuMjk5NiA4OS43ODM0IDQyLjAzMzUgOTUuNjk4OEwzMS45MjkgMTE0SDE1LjJDNi44MDUyNyAxMTQgMCAxMDcuMTk1IDAgOTguOFYxNS4yQzAgNi44MDUyNyA2LjgwNTI3IDAgMTUuMiAwSDcxLjI5MTlaTTgwLjExMSAwTDcxLjM0MTIgMTUuOTc1OEM2OC4xMDc4IDIxLjg2NiA2OS4xMjU1IDI5LjE4MDQgNzMuODQ0MSAzMy45NjQxTDkxLjA3NTEgNTEuNDMzMUM5Ny4zNjc0IDU3LjgxMjQgOTYuODA0NCA2OC4yMjI3IDg5Ljg2MDcgNzMuODg2MUw0MC42NzgyIDExNEg5OC44QzEwNy4xOTUgMTE0IDExNCAxMDcuMTk1IDExNCA5OC44VjE1LjJDMTE0IDYuODA1MjcgMTA3LjE5NSAwIDk4LjggMEg4MC4xMTFaIi8+PC9zdmc+",
  "actions": {
    "document-create": {
      "name": "document-create",
      "displayName": "Create document",
      "description": "Creates a Powerhouse document.",
      "props": {
        "documentType": {
          "displayName": "Document type",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "name": {
          "displayName": "Document name",
          "required": false,
          "type": "SHORT_TEXT"
        },
        "parentId": {
          "displayName": "Parent drive",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "folderId": {
          "displayName": "Folder",
          "description": "Omit for the drive's root",
          "required": false,
          "refreshers": [
            "parentId"
          ],
          "type": "DROPDOWN"
        },
        "actionType": {
          "displayName": "Type",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId"
          ],
          "type": "DROPDOWN"
        },
        "input": {
          "displayName": "Input",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId",
            "actionType"
          ],
          "type": "DYNAMIC"
        },
        "actions": {
          "displayName": "Action list (JSON)",
          "required": false,
          "description": "Several actions after the create, or a payload from an earlier step: [{ \"type\": …, \"input\": … }]",
          "advanced": true,
          "type": "LONG_TEXT",
          "display": "code"
        },
        "payload": {
          "displayName": "Payload",
          "description": "JSON {documentType, name, actions?}, e.g. {{steps.draft.output}}",
          "required": false,
          "advanced": true,
          "type": "SHORT_TEXT"
        },
        "parse": {
          "displayName": "Parse",
          "description": "Exact takes ids and JSON as given. Extract reads them out of an AI step's prose, and reports what it read from in extractedFrom",
          "required": false,
          "defaultValue": "exact",
          "advanced": true,
          "options": {
            "options": [
              {
                "label": "Exact",
                "value": "exact"
              },
              {
                "label": "Extract from AI output",
                "value": "extract"
              }
            ]
          },
          "type": "STATIC_DROPDOWN"
        }
      },
      "propertyGroups": [
        {
          "key": "action",
          "display": "section",
          "label": "Action",
          "description": "Optional, sent right after the create. Pick a type, then fill in its input: the action needs both.",
          "props": [
            "actionType",
            "input"
          ]
        }
      ],
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    },
    "document-dispatch": {
      "name": "document-dispatch",
      "displayName": "Dispatch actions",
      "description": "Sends actions to a document.",
      "props": {
        "documentId": {
          "displayName": "Document id",
          "description": "e.g. {{steps.create.output.documentId}}",
          "required": true,
          "refreshers": [
            "documentType"
          ],
          "type": "DROPDOWN"
        },
        "documentType": {
          "displayName": "Document type",
          "description": "Design-time hint when the document id is an expression",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "actionType": {
          "displayName": "Type",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId"
          ],
          "type": "DROPDOWN"
        },
        "input": {
          "displayName": "Input",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId",
            "actionType"
          ],
          "type": "DYNAMIC"
        },
        "actions": {
          "displayName": "Action list (JSON)",
          "required": false,
          "description": "Several actions at once, or a payload from an earlier step: [{ \"type\": …, \"input\": … }]",
          "advanced": true,
          "type": "LONG_TEXT",
          "display": "code"
        },
        "allowedActions": {
          "displayName": "Allowed action types",
          "description": "Comma-separated whitelist; enforced when set",
          "required": false,
          "advanced": true,
          "type": "SHORT_TEXT"
        },
        "branch": {
          "displayName": "Branch",
          "description": "Defaults to \"main\"",
          "required": false,
          "advanced": true,
          "type": "SHORT_TEXT"
        },
        "parse": {
          "displayName": "Parse",
          "description": "Exact takes ids and JSON as given. Extract reads them out of an AI step's prose, and reports what it read from in extractedFrom",
          "required": false,
          "defaultValue": "exact",
          "advanced": true,
          "options": {
            "options": [
              {
                "label": "Exact",
                "value": "exact"
              },
              {
                "label": "Extract from AI output",
                "value": "extract"
              }
            ]
          },
          "type": "STATIC_DROPDOWN"
        }
      },
      "propertyGroups": [
        {
          "key": "action",
          "display": "section",
          "label": "Action",
          "description": "Sent to the document. Pick a type, then fill in its input: the action needs both.",
          "props": [
            "actionType",
            "input"
          ]
        }
      ],
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    },
    "document-get": {
      "name": "document-get",
      "displayName": "Get document",
      "description": "Reads a document's current state.",
      "props": {
        "documentId": {
          "displayName": "Document id",
          "description": "e.g. {{steps.find.output.documents.0.documentId}}",
          "required": true,
          "refreshers": [
            "documentType"
          ],
          "type": "DROPDOWN"
        },
        "documentType": {
          "displayName": "Document type",
          "description": "Design-time hint when the document id is an expression",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "parse": {
          "displayName": "Parse",
          "description": "Exact takes ids and JSON as given. Extract reads them out of an AI step's prose, and reports what it read from in extractedFrom",
          "required": false,
          "defaultValue": "exact",
          "advanced": true,
          "options": {
            "options": [
              {
                "label": "Exact",
                "value": "exact"
              },
              {
                "label": "Extract from AI output",
                "value": "extract"
              }
            ]
          },
          "type": "STATIC_DROPDOWN"
        }
      },
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    },
    "document-find": {
      "name": "document-find",
      "displayName": "Find documents",
      "description": "Lists documents by type and name.",
      "props": {
        "documentType": {
          "displayName": "Document type",
          "description": "Omit for any type",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "parentId": {
          "displayName": "In drive",
          "description": "Omit for the whole reactor",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "name": {
          "displayName": "Name contains",
          "description": "Case-insensitive match",
          "required": false,
          "type": "SHORT_TEXT"
        },
        "matchPath": {
          "displayName": "State field",
          "description": "Dotted path into the document's state, e.g. \"orderId\" or \"settlement.status\". With a value below, only documents holding it are returned.",
          "required": false,
          "type": "SHORT_TEXT"
        },
        "matchValue": {
          "displayName": "State value",
          "description": "Compared as text, e.g. {{trigger.payload.orderId}}. Documents missing the field never match.",
          "required": false,
          "type": "SHORT_TEXT"
        },
        "includeState": {
          "displayName": "Include state",
          "description": "Returns each document's state as well as its id and name. Off by default: a page of documents carries a page of states.",
          "required": false,
          "defaultValue": false,
          "type": "CHECKBOX"
        },
        "limit": {
          "displayName": "Max results",
          "description": "Defaults to 25",
          "required": false,
          "type": "NUMBER"
        }
      },
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    },
    "document-schema": {
      "name": "document-schema",
      "displayName": "Get document schema",
      "description": "Action and state schemas of a document type.",
      "props": {
        "documentType": {
          "displayName": "Document type",
          "description": "Required unless a document id is given",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "documentId": {
          "displayName": "Document id",
          "description": "Resolves the type from this document instead",
          "required": false,
          "refreshers": [
            "documentType"
          ],
          "type": "DROPDOWN"
        },
        "actionType": {
          "displayName": "Only this action",
          "description": "Omit to list every action",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId"
          ],
          "type": "DROPDOWN"
        },
        "parse": {
          "displayName": "Parse",
          "description": "Exact takes ids and JSON as given. Extract reads them out of an AI step's prose, and reports what it read from in extractedFrom",
          "required": false,
          "defaultValue": "exact",
          "advanced": true,
          "options": {
            "options": [
              {
                "label": "Exact",
                "value": "exact"
              },
              {
                "label": "Extract from AI output",
                "value": "extract"
              }
            ]
          },
          "type": "STATIC_DROPDOWN"
        }
      },
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    },
    "document-types": {
      "name": "document-types",
      "displayName": "List document types",
      "description": "Document models installed on this reactor.",
      "props": {},
      "requireAuth": false,
      "errorHandlingOptions": {
        "continueOnFailure": {
          "defaultValue": false
        },
        "retryOnFailure": {
          "defaultValue": false
        }
      }
    }
  },
  "triggers": {
    "document-event": {
      "name": "document-event",
      "displayName": "Document event",
      "description": "Fires when a matching document operation lands.",
      "requireAuth": false,
      "props": {
        "documentType": {
          "displayName": "Document type",
          "description": "e.g. powerhouse/connection",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "documentId": {
          "displayName": "Document id",
          "description": "Omit to match any document",
          "required": false,
          "refreshers": [
            "documentType"
          ],
          "type": "DROPDOWN"
        },
        "actionType": {
          "displayName": "Action type",
          "description": "Omit to match any action",
          "required": false,
          "refreshers": [
            "documentType",
            "documentId"
          ],
          "type": "DROPDOWN"
        }
      },
      "type": "POLLING",
      "handshakeConfiguration": {
        "strategy": "NONE"
      },
      "renewConfiguration": {
        "strategy": "NONE"
      },
      "sampleData": {
        "documentId": "01234567-89ab-cdef-0123-456789abcdef",
        "documentType": "powerhouse/workflow",
        "branch": "main",
        "scope": "global",
        "action": {
          "type": "SET_NAME",
          "input": {
            "name": "Invoice"
          }
        },
        "operation": {
          "index": 7,
          "timestampUtcMs": "1757500000000"
        }
      },
      "testStrategy": "TEST_FUNCTION"
    },
    "document-created": {
      "name": "document-created",
      "displayName": "Document created",
      "description": "Fires when a document is added to a drive.",
      "requireAuth": false,
      "props": {
        "documentType": {
          "displayName": "Document type",
          "description": "Type of the created document; omit to match any",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "driveId": {
          "displayName": "Drive",
          "description": "Omit to match documents outside every drive too",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        }
      },
      "type": "POLLING",
      "handshakeConfiguration": {
        "strategy": "NONE"
      },
      "renewConfiguration": {
        "strategy": "NONE"
      },
      "sampleData": {
        "documentId": "01234567-89ab-cdef-0123-456789abcdef",
        "documentType": "powerhouse/workflow",
        "name": "Invoice",
        "driveId": "fedcba98-7654-3210-fedc-ba9876543210",
        "parentId": null,
        "operation": {
          "index": 0,
          "timestampUtcMs": "1757500000000"
        }
      },
      "testStrategy": "TEST_FUNCTION"
    },
    "document-deleted": {
      "name": "document-deleted",
      "displayName": "Document deleted",
      "description": "Fires when a document is removed from a drive.",
      "requireAuth": false,
      "props": {
        "documentType": {
          "displayName": "Document type",
          "description": "Type of the deleted document; omit to match any",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        },
        "driveId": {
          "displayName": "Drive",
          "description": "Omit to match documents outside every drive too",
          "required": false,
          "refreshers": [],
          "type": "DROPDOWN"
        }
      },
      "type": "POLLING",
      "handshakeConfiguration": {
        "strategy": "NONE"
      },
      "renewConfiguration": {
        "strategy": "NONE"
      },
      "sampleData": {
        "documentId": "01234567-89ab-cdef-0123-456789abcdef",
        "documentType": "powerhouse/workflow",
        "name": "Invoice",
        "driveId": "fedcba98-7654-3210-fedc-ba9876543210",
        "parentId": null,
        "operation": {
          "index": 0,
          "timestampUtcMs": "1757500000000"
        }
      },
      "testStrategy": "TEST_FUNCTION"
    }
  },
  "categories": [],
  "description": "Read and write Powerhouse documents on the reactor this workflow runs in: create documents, dispatch actions, read state and schemas, and fire on document events.",
  "authors": [
    "powerhouse"
  ],
  "minimumSupportedRelease": "0.82.0",
  "contextInfo": {
    "version": "2"
  }
}
