{
 "preview_dialog": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "accept": {
    "type": "boolean"
   },
   "promptText": {
    "type": "string"
   }
  },
  "required": [
   "accept"
  ]
 },
 "preview_status": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   }
  }
 },
 "preview_open": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "url": {
    "type": "string",
    "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$",
    "minLength": 1,
    "maxLength": 2048,
    "description": "First page URL. Absolute http(s) URL, or a bare host (https; http for loopback). Omit to open a blank tab."
   },
   "open": {
    "type": "boolean",
    "description": "Show the preview to the user. Default true. False for background only."
   },
   "show": {
    "type": "boolean",
    "description": "Old alias for `open`."
   },
   "reuseExistingTab": {
    "type": "boolean",
    "description": "Reuse `tabId`, or your current tab. Default true. False makes a new tab."
   },
   "profileId": {
    "type": "string",
    "description": "Profile id or name from preview_status, for a new tab. Default: the user's. A tab keeps its profile."
   },
   "target": {
    "type": "object",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "environment-port"
      ]
     },
     "port": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 65536,
      "description": "Dev-server port here."
     },
     "protocol": {
      "type": "string",
      "enum": [
       "http",
       "https"
      ],
      "description": "Default http."
     },
     "path": {
      "type": "string",
      "description": "Path, query, and fragment, such as /settings?tab=account."
     }
    },
    "required": [
     "kind",
     "port"
    ]
   }
  }
 },
 "preview_navigate": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "url": {
    "type": "string",
    "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$",
    "minLength": 1,
    "maxLength": 2048,
    "description": "Website URL. Absolute http(s) URL, or a bare host (https; http for loopback). For public pages."
   },
   "target": {
    "type": "object",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "url",
       "environment-port"
      ]
     },
     "url": {
      "type": "string",
      "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$",
      "minLength": 1,
      "maxLength": 2048,
      "description": "Website URL. Absolute http(s) URL, or a bare host (https; http for loopback)."
     },
     "port": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "exclusiveMaximum": 65536,
      "description": "Dev-server port here."
     },
     "protocol": {
      "type": "string",
      "enum": [
       "http",
       "https"
      ],
      "description": "Default http."
     },
     "path": {
      "type": "string",
      "description": "Path, query, and fragment, such as /settings?tab=account."
     }
    },
    "required": [
     "kind"
    ]
   },
   "readiness": {
    "type": "string",
    "enum": [
     "load",
     "domContentLoaded",
     "none"
    ],
    "description": "Default 'load'. 'none': return at once."
   },
   "timeoutMs": {
    "type": "integer",
    "maximum": 60000,
    "exclusiveMinimum": 0,
    "description": "Default 15000."
   }
  }
 },
 "preview_resize": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "mode": {
    "type": "string",
    "enum": [
     "fill",
     "freeform",
     "preset"
    ]
   },
   "preset": {
    "type": "string",
    "enum": [
     "iphone-se",
     "iphone-xr",
     "iphone-12-pro",
     "iphone-14-pro-max",
     "pixel-7",
     "samsung-galaxy-s8-plus",
     "samsung-galaxy-s20-ultra",
     "ipad-mini",
     "ipad-air",
     "ipad-pro",
     "surface-pro-7",
     "surface-duo",
     "galaxy-z-fold-5",
     "asus-zenbook-fold",
     "samsung-galaxy-a51-71",
     "nest-hub",
     "nest-hub-max"
    ]
   },
   "width": {
    "type": "integer",
    "minimum": 240,
    "maximum": 3840
   },
   "height": {
    "type": "integer",
    "minimum": 240,
    "maximum": 3840
   },
   "orientation": {
    "type": "string",
    "enum": [
     "portrait",
     "landscape"
    ]
   },
   "timeoutMs": {
    "type": "integer",
    "maximum": 60000,
    "exclusiveMinimum": 0,
    "description": "Default 15000."
   }
  },
  "required": [
   "mode"
  ]
 },
 "preview_set_appearance": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "colorScheme": {
    "type": "string",
    "enum": [
     "system",
     "light",
     "dark"
    ]
   }
  },
  "required": [
   "colorScheme"
  ]
 },
 "preview_act": {
  "type": "object",
  "properties": {
   "action": {
    "type": "string",
    "enum": [
     "click",
     "type",
     "hover",
     "select",
     "drag",
     "upload",
     "press",
     "scroll"
    ]
   },
   "tabId": {
    "type": "string"
   },
   "locator": {
    "type": "string"
   },
   "selector": {
    "type": "string"
   },
   "x": {
    "type": "number"
   },
   "y": {
    "type": "number"
   },
   "button": {
    "type": "string",
    "enum": [
     "left",
     "right",
     "middle"
    ]
   },
   "clickCount": {
    "type": "integer"
   },
   "text": {
    "type": "string"
   },
   "clear": {
    "type": "boolean"
   },
   "values": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "source": {
    "type": "string"
   },
   "target": {
    "type": "string"
   },
   "paths": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "key": {
    "type": "string"
   },
   "modifiers": {
    "type": "array",
    "items": {
     "type": "string",
     "enum": [
      "Alt",
      "Control",
      "Meta",
      "Shift"
     ]
    }
   },
   "deltaX": {
    "type": "number"
   },
   "deltaY": {
    "type": "number"
   },
   "timeoutMs": {
    "type": "integer"
   }
  },
  "required": [
   "action"
  ]
 },
 "preview_evaluate": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "expression": {
    "type": "string",
    "pattern": "^\\S[\\s\\S]*\\S$|^\\S$|^$",
    "minLength": 1,
    "maxLength": 64000
   },
   "awaitPromise": {
    "type": "boolean",
    "description": "Default true."
   },
   "returnByValue": {
    "type": "boolean",
    "description": "False returns a ref. Default true."
   }
  },
  "required": [
   "expression"
  ]
 },
 "preview_wait_for": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "selector": {
    "type": "string"
   },
   "locator": {
    "type": "string"
   },
   "text": {
    "type": "string",
    "description": "Case counts."
   },
   "urlIncludes": {
    "type": "string"
   },
   "timeoutMs": {
    "type": "integer",
    "maximum": 60000,
    "exclusiveMinimum": 0,
    "description": "Default 15000."
   }
  }
 },
 "preview_recording_start": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   }
  }
 },
 "preview_recording_stop": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   }
  }
 },
 "preview_snapshot": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   },
   "includeImage": {
    "type": "boolean",
    "description": "Default false. True only to see the page."
   },
   "save": {
    "type": "boolean",
    "description": "Write PNG, return `screenshotPath`."
   }
  }
 },
 "orchestrator_capabilities": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "search": {
    "type": "string"
   }
  }
 },
 "delegate_task": {
  "type": "object",
  "properties": {
   "task": {
    "type": "string"
   },
   "target": {
    "type": "object",
    "properties": {
     "providerInstanceId": {
      "type": "string"
     },
     "driverKind": {
      "type": "string"
     },
     "model": {
      "type": "string"
     },
     "options": {
      "description": "Options from `orchestrator_capabilities`, such as {effort:'max'}. Given values override inherited. [] or {} clears.",
      "anyOf": [
       {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          },
          "value": {
           "anyOf": [
            {
             "type": "string"
            },
            {
             "type": "boolean"
            }
           ]
          }
         },
         "required": [
          "id",
          "value"
         ]
        }
       },
       {
        "type": "object",
        "additionalProperties": {
         "anyOf": [
          {
           "type": "string"
          },
          {
           "type": "boolean"
          }
         ]
        }
       }
      ]
     },
     "environmentId": {
      "type": "string"
     },
     "projectId": {
      "type": "string"
     }
    }
   },
   "title": {
    "type": "string"
   },
   "role": {
    "type": "string",
    "enum": [
     "implementation",
     "research",
     "review",
     "design",
     "test",
     "general"
    ]
   },
   "isolation": {
    "type": "string",
    "enum": [
     "shared",
     "worktree"
    ],
    "description": "'shared' (default): parent checkout. 'worktree': new prepared checkout from the parent commit, for a separate checkout or PR per child. Uncommitted edits stay out."
   },
   "mode": {
    "type": "string",
    "enum": [
     "async",
     "wait"
    ],
    "description": "Default 'async'. 'wait' only if this turn needs the result. A question or approval ends the wait."
   },
   "timeoutMs": {
    "type": "number",
    "description": "Mode 'wait' only. Default 10 min. A timeout does not cancel the child."
   },
   "clientRequestId": {
    "type": "string"
   },
   "runtimeMode": {
    "type": "string",
    "enum": [
     "inherit",
     "approval-required",
     "auto-accept-edits",
     "auto",
     "full-access"
    ],
    "description": "Omit unless the user asks for a supervised child. Narrow modes pause for human approval, not read-only. Above yours is rejected."
   },
   "interactionMode": {
    "type": "string",
    "enum": [
     "inherit",
     "default",
     "plan"
    ]
   }
  },
  "required": [
   "task"
  ]
 },
 "task_status": {
  "type": "object",
  "properties": {
   "taskId": {
    "type": "string"
   }
  },
  "required": [
   "taskId"
  ]
 },
 "task_cancel": {
  "type": "object",
  "properties": {
   "taskId": {
    "type": "string"
   },
   "reason": {
    "type": "string",
    "maxLength": 2000
   },
   "clientRequestId": {
    "type": "string"
   }
  },
  "required": [
   "taskId"
  ]
 },
 "t3_workflow_stop": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "subagentId": {
    "type": "string"
   }
  },
  "required": [
   "threadId",
   "subagentId"
  ]
 },
 "t3_background_wait": {
  "type": "object",
  "properties": {
   "taskIds": {
    "type": "array",
    "items": {
     "type": "string"
    },
    "minItems": 1,
    "maxItems": 20
   },
   "waiting": {
    "type": "boolean"
   }
  },
  "required": [
   "taskIds"
  ]
 },
 "schedule_task": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   },
   "prompt": {
    "type": "string"
   },
   "schedule": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "interval",
       "fixed_time",
       "once",
       "webhook"
      ]
     },
     "everyMs": {
      "type": "integer",
      "minimum": 60000,
      "description": "Min 60000."
     },
     "timeOfDay": {
      "type": "string"
     },
     "weekdays": {
      "type": "array",
      "items": {
       "type": "integer",
       "minimum": 0,
       "maximum": 6,
       "description": "Weekday. 0 is Sunday, 6 is Saturday."
      },
      "description": "Default: every day."
     },
     "runAt": {
      "type": "string"
     },
     "signature": {
      "description": "Omit for URL token only.",
      "anyOf": [
       {
        "type": "object",
        "properties": {
         "header": {
          "type": "string"
         },
         "encoding": {
          "type": "string",
          "enum": [
           "hex",
           "base64"
          ]
         },
         "prefix": {
          "type": "string",
          "description": "Text before the digest, such as 'sha256='. Empty for none."
         },
         "secret": {
          "type": "string",
          "description": "Default: stored secret."
         },
         "secretRef": {
          "type": "string",
          "description": "From `request_secret`. Instead of `secret`. Spent by this save."
         }
        },
        "required": [
         "header",
         "encoding",
         "prefix"
        ]
       },
       {
        "type": "null"
       }
      ]
     },
     "maxDeliveryAgeMinutes": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 1,
        "maximum": 1440,
        "description": "Skip requests held offline over this many minutes. Omit to run all."
       },
       {
        "type": "null"
       }
      ]
     },
     "dedupe": {
      "type": "object",
      "properties": {
       "replayKey": {
        "type": "string"
       },
       "coalesceKey": {
        "type": "string"
       },
       "coalesceWindowSeconds": {
        "type": "integer",
        "minimum": 10,
        "maximum": 3600
       }
      },
      "description": "Replay and coalesce key templates. Window in seconds, default 120."
     },
     "filters": {
      "type": "array",
      "items": {
       "description": "Path: `headers.x-event` or `body.action`. String compare. Objects pass only 'exists'. A `[]` segment matches any array item. `notEquals` passes only if no item equals.",
       "anyOf": [
        {
         "type": "object",
         "properties": {
          "path": {
           "type": "string"
          },
          "op": {
           "type": "string",
           "enum": [
            "equals",
            "notEquals",
            "startsWith"
           ]
          },
          "value": {
           "type": "string"
          }
         },
         "required": [
          "path",
          "op",
          "value"
         ]
        },
        {
         "type": "object",
         "properties": {
          "path": {
           "type": "string"
          },
          "op": {
           "type": "string",
           "enum": [
            "in"
           ]
          },
          "value": {
           "type": "array",
           "items": {
            "type": "string",
            "description": "Non-empty, without commas or surrounding whitespace."
           },
           "minItems": 1
          }
         },
         "required": [
          "path",
          "op",
          "value"
         ]
        },
        {
         "type": "object",
         "properties": {
          "path": {
           "type": "string"
          },
          "op": {
           "type": "string",
           "enum": [
            "exists"
           ]
          }
         },
         "required": [
          "path",
          "op"
         ]
        }
       ]
      },
      "maxItems": 16,
      "description": "All must match. Max 16. Omitted: keep stored. [] clears."
     }
    },
    "required": [
     "type"
    ],
    "description": "Trigger: {type:'interval',everyMs}, {type:'fixed_time',timeOfDay,weekdays?}, {type:'once',runAt}, or {type:'webhook'}."
   },
   "title": {
    "type": "string"
   },
   "enabled": {
    "type": "boolean",
    "description": "Default true."
   },
   "bindToCurrentThread": {
    "type": "boolean",
    "description": "Default true: runs post in this thread. False: new thread per run."
   },
   "freshSession": {
    "type": "boolean",
    "description": "Runs share one thread but each starts a fresh session without earlier runs' context. Unbound: the first run makes the thread."
   },
   "clientRequestId": {
    "type": "string"
   },
   "scheduledTaskId": {
    "type": "string"
   }
  }
 },
 "list_scheduled_tasks": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   }
  }
 },
 "delete_scheduled_task": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "scheduledTaskId": {
    "type": "string"
   }
  },
  "required": [
   "scheduledTaskId"
  ]
 },
 "request_secret": {
  "type": "object",
  "properties": {
   "label": {
    "type": "string"
   },
   "reason": {
    "type": "string"
   },
   "url": {
    "type": "string",
    "description": "Sign-in or setup page for the value. Shown as a button."
   },
   "placeholder": {
    "type": "string"
   },
   "delivery": {
    "type": "string",
    "enum": [
     "secretRef",
     "file"
    ],
    "description": "secretRef (default) for a T3 tool; file for a command."
   },
   "value": {
    "type": "string",
    "description": "Pasted in this thread; no card."
   },
   "timeoutMs": {
    "type": "integer",
    "minimum": 1000,
    "maximum": 3600000
   },
   "clientRequestId": {
    "type": "string",
    "description": "Retry key."
   }
  },
  "required": [
   "label",
   "reason"
  ]
 },
 "create_threads": {
  "type": "object",
  "properties": {
   "threads": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "prompt": {
       "type": "string"
      },
      "title": {
       "type": "string"
      },
      "target": {
       "type": "object",
       "properties": {
        "providerInstanceId": {
         "type": "string"
        },
        "driverKind": {
         "type": "string"
        },
        "model": {
         "type": "string"
        },
        "options": {
         "description": "Options from `orchestrator_capabilities`, such as {effort:'max'}. Given values override inherited. [] or {} clears.",
         "anyOf": [
          {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "value": {
              "anyOf": [
               {
                "type": "string"
               },
               {
                "type": "boolean"
               }
              ]
             }
            },
            "required": [
             "id",
             "value"
            ]
           }
          },
          {
           "type": "object",
           "additionalProperties": {
            "anyOf": [
             {
              "type": "string"
             },
             {
              "type": "boolean"
             }
            ]
           }
          }
         ]
        },
        "environmentId": {
         "type": "string"
        },
        "projectId": {
         "type": "string"
        }
       }
      },
      "runtimeMode": {
       "type": "string",
       "enum": [
        "inherit",
        "approval-required",
        "auto-accept-edits",
        "auto",
        "full-access"
       ]
      },
      "interactionMode": {
       "type": "string",
       "enum": [
        "inherit",
        "default",
        "plan"
       ]
      }
     }
    },
    "minItems": 1,
    "maxItems": 20
   },
   "clientRequestId": {
    "type": "string"
   }
  },
  "required": [
   "threads"
  ]
 },
 "t3_thread_list": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   },
   "allProjects": {
    "type": "boolean"
   },
   "statuses": {
    "type": "array",
    "items": {
     "type": "string",
     "enum": [
      "idle",
      "preparing",
      "queued",
      "starting",
      "running",
      "waiting",
      "completed",
      "interrupted",
      "failed",
      "cancelled",
      "rolled_back"
     ]
    },
    "maxItems": 10
   },
   "titleContains": {
    "type": "string"
   },
   "settled": {
    "type": "boolean"
   },
   "snoozed": {
    "type": "boolean"
   },
   "includeSubagents": {
    "type": "boolean"
   },
   "cursor": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 100
   }
  }
 },
 "t3_thread_read": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "itemId": {
    "type": "string"
   },
   "textOffset": {
    "type": "integer",
    "minimum": 0
   },
   "view": {
    "type": "string",
    "enum": [
     "messages",
     "activity"
    ]
   },
   "afterPosition": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "description": "Max items, 1 to 100."
   },
   "runLimit": {
    "type": "integer",
    "minimum": 1,
    "description": "Max recent runs, 1 to 50."
   },
   "maxCharsPerItem": {
    "type": "integer",
    "minimum": 1,
    "description": "Max chars per item, 1 to 50000."
   }
  },
  "required": [
   "threadId"
  ]
 },
 "t3_thread_update": {
  "type": "object",
  "properties": {
   "threadId": {
    "type": "string"
   },
   "action": {
    "type": "string",
    "enum": [
     "rename",
     "regenerate_title"
    ]
   },
   "title": {
    "type": "string"
   },
   "clientRequestId": {
    "type": "string"
   },
   "environmentId": {
    "type": "string"
   }
  },
  "required": [
   "action"
  ]
 },
 "t3_thread_send": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "message": {
    "type": "string"
   },
   "mode": {
    "type": "string",
    "enum": [
     "auto",
     "queue",
     "steer",
     "restart"
    ]
   },
   "freshContext": {
    "type": "boolean",
    "description": "Start a new provider session without the thread's earlier context, like /clear. Never steers."
   },
   "clientRequestId": {
    "type": "string"
   }
  },
  "required": [
   "threadId",
   "message"
  ]
 },
 "t3_thread_wait": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "runId": {
    "type": "string"
   },
   "timeoutMs": {
    "type": "number"
   },
   "untilDelegatedWorkSettled": {
    "type": "boolean",
    "description": "Also wait for its delegated and background tasks and their completions to settle. `resultRun` then names the run with its final answer."
   }
  },
  "required": [
   "threadId"
  ]
 },
 "t3_thread_interrupt": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "runId": {
    "type": "string"
   },
   "reason": {
    "type": "string",
    "maxLength": 2000
   },
   "stop": {
    "type": "boolean"
   },
   "clientRequestId": {
    "type": "string"
   }
  },
  "required": [
   "threadId"
  ]
 },
 "t3_environment_links": {
  "type": "object",
  "additionalProperties": false
 },
 "t3_environment_link": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string",
    "description": "The machine, when known, e.g. from a mentioned machine. Otherwise the user picks it in the card."
   },
   "url": {
    "type": "string",
    "description": "Only an address the user gave: https, Tailscale, LAN or loopback. Never guess one."
   },
   "hint": {
    "type": "string",
    "description": "The user's words for the machine, e.g. \"vps\". Preselects it in the card."
   },
   "reason": {
    "type": "string",
    "description": "One sentence for the card."
   },
   "requestedAccess": {
    "type": "string",
    "enum": [
     "read-only",
     "approval-required",
     "auto-accept-edits",
     "auto",
     "full-access"
    ],
    "description": "Suggested access. The user picks; default approval-required."
   },
   "clientRequestId": {
    "type": "string"
   }
  }
 },
 "t3_environment_unlink": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   }
  },
  "required": [
   "environmentId"
  ]
 },
 "run_scheduled_task_now": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "taskId": {
    "type": "string"
   }
  },
  "required": [
   "taskId"
  ]
 },
 "t3_thread_search": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "query": {
    "type": "string"
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 50
   },
   "projectId": {
    "type": "string"
   }
  },
  "required": [
   "query"
  ]
 },
 "t3_thread_configure": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "modelSelection": {
    "type": "object",
    "properties": {
     "provider": {},
     "instanceId": {},
     "model": {},
     "options": {}
    },
    "required": [
     "model"
    ]
   }
  }
 },
 "t3_thread_transfer": {
  "type": "object",
  "properties": {
   "action": {
    "type": "string",
    "enum": [
     "fork",
     "merge_back",
     "status"
    ]
   },
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "sourcePoint": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "latest_stable",
       "run",
       "checkpoint"
      ]
     },
     "runId": {
      "type": "string"
     },
     "checkpointId": {
      "type": "string"
     }
    },
    "required": [
     "type"
    ]
   },
   "targetThreadId": {
    "type": "string"
   },
   "title": {
    "type": "string"
   }
  },
  "required": [
   "action"
  ]
 },
 "t3_thread_organize": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "action": {
    "type": "string",
    "enum": [
     "pin",
     "unpin",
     "snooze",
     "unsnooze",
     "settle",
     "unsettle",
     "archive",
     "unarchive",
     "mark_unread"
    ]
   },
   "snoozedUntil": {
    "type": "string"
   }
  },
  "required": [
   "action"
  ]
 },
 "t3_pending_request": {
  "type": "object",
  "properties": {
   "action": {
    "type": "string",
    "enum": [
     "list",
     "read",
     "respond"
    ]
   },
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "requestId": {
    "type": "string"
   },
   "answers": {
    "type": "object"
   }
  },
  "required": [
   "action"
  ]
 },
 "t3_queue": {
  "type": "object",
  "properties": {
   "action": {
    "type": "string",
    "enum": [
     "list",
     "read",
     "edit",
     "cancel",
     "reorder",
     "promote_to_steer"
    ]
   },
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "queuedRunId": {
    "type": "string"
   },
   "text": {
    "type": "string",
    "maxLength": 100000
   },
   "beforeRunId": {
    "anyOf": [
     {
      "type": "string"
     },
     {
      "type": "null"
     }
    ]
   },
   "targetRunId": {
    "type": "string"
   },
   "cursor": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 100
   }
  },
  "required": [
   "action"
  ]
 },
 "t3_attachment_prepare_upload": {
  "type": "object",
  "properties": {
   "upload": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "image",
       "file"
      ]
     },
     "name": {
      "type": "string"
     },
     "mimeType": {
      "anyOf": [
       {
        "type": "string",
        "enum": [
         "image/gif",
         "image/jpeg",
         "image/png",
         "image/webp"
        ]
       },
       {
        "type": "string"
       }
      ]
     },
     "sizeBytes": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 1,
        "maximum": 10485760
       },
       {
        "type": "integer",
        "minimum": 1,
        "maximum": 52428800
       }
      ]
     }
    },
    "required": [
     "type",
     "name",
     "mimeType",
     "sizeBytes"
    ]
   }
  },
  "required": [
   "upload"
  ]
 },
 "t3_attachment_discard": {
  "type": "object",
  "properties": {
   "attachmentId": {
    "type": "string"
   }
  },
  "required": [
   "attachmentId"
  ]
 },
 "t3_thread_send_attachments": {
  "type": "object",
  "properties": {
   "threadId": {
    "type": "string"
   },
   "message": {
    "type": "string",
    "maxLength": 120000
   },
   "attachments": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "type": {
       "type": "string",
       "enum": [
        "image",
        "file"
       ]
      },
      "id": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "mimeType": {
       "type": "string"
      },
      "sizeBytes": {
       "anyOf": [
        {
         "type": "integer",
         "minimum": 0,
         "maximum": 10485760
        },
        {
         "type": "integer",
         "minimum": 1,
         "maximum": 52428800
        }
       ]
      },
      "source": {
       "type": "object",
       "properties": {
        "_tag": {
         "type": "string",
         "enum": [
          "pasted-text"
         ]
        }
       },
       "required": [
        "_tag"
       ]
      }
     },
     "required": [
      "type",
      "id",
      "name",
      "mimeType",
      "sizeBytes"
     ]
    },
    "minItems": 1,
    "maxItems": 8
   }
  },
  "required": [
   "attachments"
  ]
 },
 "t3_thread_launch": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   },
   "scratch": {
    "type": "boolean",
    "description": "No project: a new Scratch folder. Not with `projectId` or `workspaceStrategy`."
   },
   "title": {
    "type": "string"
   },
   "modelSelection": {
    "type": "object",
    "properties": {
     "provider": {},
     "instanceId": {},
     "model": {},
     "options": {}
    },
    "required": [
     "model"
    ]
   },
   "runtimeMode": {
    "type": "string",
    "enum": [
     "approval-required",
     "auto-accept-edits",
     "auto",
     "full-access"
    ]
   },
   "interactionMode": {
    "type": "string",
    "enum": [
     "default",
     "plan"
    ]
   },
   "workspaceStrategy": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "enum": [
       "root",
       "existing_worktree",
       "worktree"
      ]
     },
     "branch": {
      "type": "string"
     },
     "worktreePath": {
      "type": "string"
     },
     "baseRef": {
      "type": "string"
     },
     "startFromOrigin": {
      "type": "boolean"
     }
    },
    "required": [
     "type"
    ],
    "description": "'worktree': new checkout from `baseRef`. Honor a requested base. Otherwise, independent work uses the default branch as `remote/branch` (e.g. `origin/main`) with `startFromOrigin: true`; with no remote, use the local default branch. Required unpublished commits and dependent or stacked work use their local base with `startFromOrigin: false`. 'existing_worktree': bind `worktreePath`, a project worktree. 'root': project checkout, the default, not your worktree. Uncommitted edits are not copied."
   },
   "message": {
    "type": "string",
    "maxLength": 120000,
    "description": "First prompt. Omit it and `attachments` for idle."
   },
   "attachments": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "type": {
       "type": "string",
       "enum": [
        "image",
        "file"
       ]
      },
      "id": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "mimeType": {
       "type": "string"
      },
      "sizeBytes": {
       "anyOf": [
        {
         "type": "integer",
         "minimum": 0,
         "maximum": 10485760
        },
        {
         "type": "integer",
         "minimum": 1,
         "maximum": 52428800
        }
       ]
      },
      "source": {
       "type": "object",
       "properties": {
        "_tag": {
         "type": "string",
         "enum": [
          "pasted-text"
         ]
        }
       },
       "required": [
        "_tag"
       ]
      }
     },
     "required": [
      "type",
      "id",
      "name",
      "mimeType",
      "sizeBytes"
     ]
    },
    "maxItems": 8
   },
   "clientRequestId": {
    "type": "string"
   },
   "delegatedFrom": {
    "type": "object",
    "properties": {
     "environmentId": {
      "type": "string"
     },
     "threadId": {
      "type": "string"
     },
     "title": {
      "type": "string"
     }
    },
    "required": [
     "environmentId",
     "threadId",
     "title"
    ]
   }
  },
  "required": [
   "title"
  ]
 },
 "t3_project_list": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "cursor": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 100
   }
  }
 },
 "t3_project_read": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   }
  },
  "required": [
   "projectId"
  ]
 },
 "t3_project_create": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "title": {
    "type": "string"
   },
   "workspaceRoot": {
    "type": "string"
   },
   "createWorkspaceRootIfMissing": {
    "type": "boolean"
   },
   "defaultModelSelection": {
    "anyOf": [
     {
      "type": "object",
      "properties": {
       "provider": {},
       "instanceId": {},
       "model": {},
       "options": {}
      },
      "required": [
       "model"
      ]
     },
     {
      "type": "null"
     }
    ]
   },
   "scripts": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "command": {
       "type": "string"
      },
      "icon": {
       "type": "string",
       "enum": [
        "play",
        "test",
        "lint",
        "configure",
        "build",
        "debug"
       ]
      },
      "runOnWorktreeCreate": {
       "type": "boolean"
      },
      "runOnSettle": {
       "type": "boolean"
      },
      "stopOnSettle": {
       "type": "boolean"
      },
      "async": {
       "type": "boolean"
      },
      "previewUrl": {
       "type": "string"
      },
      "autoOpenPreview": {
       "type": "boolean"
      }
     },
     "required": [
      "id",
      "name",
      "command",
      "icon",
      "runOnWorktreeCreate"
     ]
    }
   }
  },
  "required": [
   "title"
  ]
 },
 "t3_project_update": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   },
   "title": {
    "type": "string"
   },
   "workspaceRoot": {
    "type": "string"
   },
   "defaultModelSelection": {
    "anyOf": [
     {
      "type": "object",
      "properties": {
       "provider": {},
       "instanceId": {},
       "model": {},
       "options": {}
      },
      "required": [
       "model"
      ]
     },
     {
      "type": "null"
     }
    ]
   },
   "autoPull": {
    "type": "boolean"
   },
   "projectIcon": {
    "anyOf": [
     {
      "type": "object",
      "properties": {
       "kind": {
        "type": "string",
        "enum": [
         "lucide",
         "emoji",
         "monogram"
        ]
       },
       "name": {
        "type": "string"
       },
       "color": {
        "type": "string",
        "enum": [
         "gray",
         "red",
         "orange",
         "amber",
         "yellow",
         "lime",
         "green",
         "emerald",
         "teal",
         "cyan",
         "sky",
         "blue",
         "indigo",
         "violet",
         "purple",
         "fuchsia",
         "pink",
         "rose"
        ]
       },
       "emoji": {
        "type": "string"
       },
       "text": {
        "type": "string"
       }
      },
      "required": [
       "kind"
      ]
     },
     {
      "type": "null"
     }
    ]
   },
   "faviconPath": {
    "anyOf": [
     {
      "type": "string"
     },
     {
      "type": "null"
     }
    ]
   },
   "defaultThreadEnvMode": {
    "anyOf": [
     {
      "type": "string",
      "enum": [
       "local",
       "worktree"
      ]
     },
     {
      "type": "null"
     }
    ]
   },
   "scripts": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "command": {
       "type": "string"
      },
      "icon": {
       "type": "string",
       "enum": [
        "play",
        "test",
        "lint",
        "configure",
        "build",
        "debug"
       ]
      },
      "runOnWorktreeCreate": {
       "type": "boolean"
      },
      "runOnSettle": {
       "type": "boolean"
      },
      "stopOnSettle": {
       "type": "boolean"
      },
      "async": {
       "type": "boolean"
      },
      "previewUrl": {
       "type": "string"
      },
      "autoOpenPreview": {
       "type": "boolean"
      }
     },
     "required": [
      "id",
      "name",
      "command",
      "icon",
      "runOnWorktreeCreate"
     ]
    }
   },
   "pinned": {
    "type": "boolean"
   },
   "archived": {
    "type": "boolean",
    "description": "Threads and files are kept."
   }
  },
  "required": [
   "projectId"
  ]
 },
 "t3_project_delete": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "projectId": {
    "type": "string"
   },
   "force": {
    "type": "boolean"
   }
  },
  "required": [
   "projectId"
  ]
 },
 "t3_project_clone": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "provider": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "remoteUrl": {
    "type": "string"
   },
   "destinationPath": {
    "type": "string"
   },
   "protocol": {
    "type": "string",
    "enum": [
     "auto",
     "ssh",
     "https"
    ]
   }
  },
  "required": [
   "destinationPath"
  ]
 },
 "t3_environment_read": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   }
  }
 },
 "t3_environment_preferences_update": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "defaultThreadEnvMode": {
    "type": "string",
    "enum": [
     "local",
     "worktree"
    ]
   },
   "newWorktreesStartFromOrigin": {
    "type": "boolean"
   },
   "enableProviderUpdateChecks": {
    "type": "boolean"
   },
   "backgroundActivity": {
    "type": "object",
    "properties": {
     "profile": {
      "type": "string",
      "enum": [
       "balanced",
       "performance",
       "battery-saver"
      ]
     }
    },
    "required": [
     "profile"
    ]
   },
   "sourceControlWritingStyle": {
    "type": "object",
    "properties": {
     "mode": {
      "type": "string",
      "enum": [
       "repo_conventions",
       "conventional_commits",
       "custom"
      ]
     },
     "customInstructions": {
      "type": "string"
     },
     "followChangeRequestTemplates": {
      "type": "boolean"
     }
    }
   }
  }
 },
 "t3_preview_list": {
  "type": "object",
  "properties": {
   "cursor": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 50
   }
  }
 },
 "t3_preview_close": {
  "type": "object",
  "properties": {
   "tabId": {
    "type": "string"
   }
  },
  "required": [
   "tabId"
  ]
 },
 "t3_worktree_handoff": {
  "type": "object",
  "properties": {
   "branch": {
    "type": "string"
   },
   "baseRef": {
    "type": "string"
   },
   "startFromOrigin": {
    "type": "boolean",
    "description": "True: fetch, start from the remote ref; check `startedFromOrigin`. Default: server setting."
   },
   "runSetupScript": {
    "type": "boolean",
    "description": "Default true."
   },
   "continuationPrompt": {
    "type": "string"
   }
  },
  "required": [
   "branch"
  ]
 },
 "t3_worktree_status": {
  "type": "object",
  "additionalProperties": false
 },
 "t3_worktree_list": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "query": {
    "type": "string"
   },
   "cursor": {
    "type": "integer",
    "minimum": 0
   },
   "limit": {
    "type": "integer",
    "minimum": 1,
    "maximum": 200
   },
   "refKind": {
    "type": "string",
    "enum": [
     "all",
     "local",
     "remote"
    ]
   },
   "includeMatchingRemoteRefs": {
    "type": "boolean"
   }
  }
 },
 "link_pull_request": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "url": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "number": {
    "type": "integer",
    "minimum": 1,
    "description": "With `repository`, when no `url`."
   },
   "host": {
    "type": "string"
   }
  }
 },
 "link_pull_requests": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "urls": {
    "type": "array",
    "items": {
     "type": "string"
    },
    "minItems": 1
   }
  },
  "required": [
   "urls"
  ]
 },
 "unlink_pull_request": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "url": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "number": {
    "type": "integer",
    "minimum": 1,
    "description": "With `repository`, when no `url`."
   },
   "host": {
    "type": "string"
   }
  }
 },
 "unlink_pull_requests": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "states": {
    "type": "array",
    "items": {
     "type": "string",
     "enum": [
      "open",
      "closed",
      "merged"
     ]
    },
    "minItems": 1
   }
  },
  "required": [
   "states"
  ]
 },
 "list_thread_pull_requests": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   }
  }
 },
 "watch_pull_request": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "url": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "number": {
    "type": "integer",
    "minimum": 1,
    "description": "With `repository`, when no `url`."
   },
   "host": {
    "type": "string"
   }
  }
 },
 "unwatch_pull_request": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "threadId": {
    "type": "string"
   },
   "url": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "number": {
    "type": "integer",
    "minimum": 1,
    "description": "With `repository`, when no `url`."
   },
   "host": {
    "type": "string"
   }
  }
 },
 "write_pull_request_guides": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "pullRequests": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "url": {
       "type": "string"
      },
      "repository": {
       "type": "string"
      },
      "number": {
       "type": "integer",
       "minimum": 1,
       "description": "With `repository`, when no `url`."
      },
      "host": {
       "type": "string"
      }
     }
    },
    "minItems": 1,
    "maxItems": 20
   }
  },
  "required": [
   "pullRequests"
  ]
 },
 "read_pull_request_guide": {
  "type": "object",
  "properties": {
   "environmentId": {
    "type": "string"
   },
   "url": {
    "type": "string"
   },
   "repository": {
    "type": "string"
   },
   "number": {
    "type": "integer",
    "minimum": 1,
    "description": "With `repository`, when no `url`."
   },
   "host": {
    "type": "string"
   }
  }
 },
 "device_list": {
  "type": "object",
  "properties": {
   "hostId": {
    "type": "string",
    "description": "Limit to one device host. Defaults to all hosts."
   }
  }
 },
 "device_open": {
  "type": "object",
  "properties": {
   "deviceId": {
    "type": "string"
   },
   "platform": {
    "type": "string",
    "enum": [
     "ios",
     "android"
    ],
    "description": "Needed with no `deviceId` when both platforms exist."
   },
   "hostId": {
    "type": "string"
   }
  }
 },
 "device_close": {
  "type": "object",
  "properties": {
   "deviceId": {
    "type": "string"
   },
   "hostId": {
    "type": "string"
   },
   "shutdown": {
    "type": "boolean",
    "description": "Also turn it off. Default false."
   }
  }
 },
 "device_screenshot": {
  "type": "object",
  "properties": {
   "deviceId": {
    "type": "string"
   },
   "hostId": {
    "type": "string"
   }
  }
 },
 "html_render": {
  "type": "object",
  "properties": {
   "path": {
    "type": "string",
    "description": "Absolute .html file path."
   },
   "html": {
    "type": "string",
    "minLength": 1,
    "maxLength": 512000,
    "description": "Inline HTML."
   },
   "title": {
    "type": "string",
    "minLength": 1,
    "maxLength": 200
   },
   "height": {
    "type": "integer",
    "description": "Frame height in CSS pixels, 80 to 2000. Use the contentHeight from html_preview."
   }
  },
  "required": [
   "title",
   "height"
  ]
 },
 "html_preview": {
  "type": "object",
  "properties": {
   "path": {
    "type": "string",
    "description": "Absolute .html file path."
   },
   "html": {
    "type": "string",
    "minLength": 1,
    "maxLength": 512000,
    "description": "Inline HTML."
   },
   "width": {
    "type": "integer",
    "description": "CSS pixels, 240 to 1600. Default 728. Use about 390 for phones."
   },
   "appearance": {
    "type": "string",
    "enum": [
     "dark",
     "light"
    ],
    "description": "Default dark."
   }
  }
 }
}