{
  "format": "scripttap-ai-json-contract",
  "version": 1,
  "scriptPackage": {
    "requiredLiteralFields": {
      "format": "scripttap-json-script",
      "version": 1,
      "kind": "script_package"
    },
    "topLevelFields": [
      "format",
      "version",
      "kind",
      "packageId",
      "createdAtMs",
      "source",
      "rootScriptId",
      "requirements",
      "folders",
      "scripts",
      "assetRequirements",
      "notes"
    ],
    "allowedSourceValues": [
      "user_export",
      "ai_generated",
      "script_builder"
    ],
    "requirementsFields": [
      "commandCatalogVersion",
      "requiresUserCompletion",
      "requiresAssets"
    ],
    "folderFields": [
      "id",
      "name",
      "parentId"
    ],
    "scriptFields": [
      "id",
      "name",
      "folderId",
      "disabled",
      "validationState",
      "commands"
    ],
    "assetRequirementFields": [
      "scriptId",
      "commandId",
      "commandType",
      "assetName",
      "reason"
    ],
    "allowedAssetRequirementReasons": [
      "user_must_capture",
      "user_must_attach_existing",
      "source_export_requires_recapture",
      "ai_cannot_provide"
    ],
    "allowedValidationStates": [
      "complete",
      "incomplete",
      "unknown"
    ],
    "idPrefixes": {
      "packageId": "pkg_",
      "scriptId": "script_",
      "folderId": "folder_",
      "commandId": "cmd_"
    },
    "idAllowedCharacters": "A-Z a-z 0-9 _ -",
    "nameLimits": {
      "scriptNameMaxChars": 28,
      "folderNameMaxChars": 28,
      "nicknameMaxChars": 20
    }
  },
  "commandBaseFields": [
    "id",
    "type",
    "nickname",
    "disabled",
    "validationState"
  ],
  "forbiddenAnywhere": [
    "assets",
    "images",
    "screenshots",
    "files",
    "bytesBase64",
    "archiveBytes",
    "sts",
    "filesystemPath",
    "accountData",
    "bridgeToken",
    "firebaseData",
    "runtimeLogs"
  ],
  "forbiddenCommandFields": [
    "estimatedWorkPerSecond",
    "workEstimateVersion",
    "validationReason",
    "validationSignature",
    "validationVersion",
    "validationAssetGeneration"
  ],
  "publicCommandTypes": [
    "click",
    "delay",
    "delay_until",
    "retap",
    "multi_click",
    "swipe",
    "pinch",
    "gesture",
    "img_find",
    "smart_tap",
    "pixel_find",
    "get_pixel_color",
    "pixel_color_result",
    "visual_trigger",
    "screenshot",
    "set_variable",
    "mod_variable",
    "color_classify",
    "array_get",
    "array_set",
    "for_each_index",
    "end_for_each_index",
    "stack_move_valid",
    "append_tap_move",
    "prompt_me",
    "text_type",
    "label",
    "goto",
    "loop",
    "end_loop",
    "break_loop",
    "call",
    "break_call",
    "stop_call",
    "pause_concurrent",
    "unpause_concurrent",
    "break_exclusive",
    "or",
    "and",
    "xor",
    "rgb_confidence",
    "else",
    "end_or",
    "end_and",
    "end_xor",
    "device_open_app",
    "device_settings",
    "device_brightness",
    "device_volume",
    "device_wifi",
    "device_bluetooth",
    "device_do_not_disturb",
    "device_rotation",
    "device_airplane",
    "divider"
  ],
  "retiredDoNotGenerate": [
    "set_integer_array",
    "if",
    "end_if"
  ],
  "flowPairingRules": [
    "loop pairs with end_loop",
    "pause_concurrent pairs with unpause_concurrent",
    "or pairs with end_or",
    "and pairs with end_and",
    "xor pairs with end_xor",
    "rgb_confidence uses an IF end row and should be kept structurally inside the IF segment",
    "else may appear only inside an IF segment and before that segment's end row"
  ],
  "assetPolicy": {
    "jsonContainsAssetBytes": false,
    "assetReferencesAreNamesOnly": true,
    "missingAssetsRequireAssetRequirements": true,
    "assetBackedCommandsWithMissingAssetsMustBeIncomplete": true
  },
  "minimalPackage": {
    "format": "scripttap-json-script",
    "version": 1,
    "kind": "script_package",
    "packageId": "pkg_example",
    "createdAtMs": 0,
    "source": "ai_generated",
    "rootScriptId": "script_root",
    "requirements": {
      "commandCatalogVersion": 1,
      "requiresUserCompletion": false,
      "requiresAssets": false
    },
    "folders": [],
    "scripts": [
      {
        "id": "script_root",
        "name": "New Script",
        "folderId": "",
        "disabled": false,
        "validationState": "unknown",
        "commands": []
      }
    ],
    "assetRequirements": [],
    "notes": ""
  }
}
