{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://openclaw.ai/protocol.schema.json",
  "title": "OpenClaw Gateway Protocol",
  "description": "Handshake, request/response, and event frames for the Gateway WebSocket.",
  "oneOf": [
    {
      "$ref": "#/definitions/RequestFrame"
    },
    {
      "$ref": "#/definitions/ResponseFrame"
    },
    {
      "$ref": "#/definitions/EventFrame"
    }
  ],
  "discriminator": {
    "propertyName": "type",
    "mapping": {
      "req": "#/definitions/RequestFrame",
      "res": "#/definitions/ResponseFrame",
      "event": "#/definitions/EventFrame"
    }
  },
  "methods": {
    "health": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "diagnostics.stability": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "doctor.memory.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "doctor.memory.dreamDiary": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "doctor.memory.backfillDreamDiary": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "doctor.memory.resetDreamDiary": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "doctor.memory.resetGroundedShortTerm": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "doctor.memory.repairDreamingArtifacts": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "doctor.memory.dedupeDreamDiary": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "doctor.memory.remHarness": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "logs.tail": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "channels.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "channels.start": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "channels.stop": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "channels.logout": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "usage.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "usage.cost": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tts.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tts.providers": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tts.personas": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tts.enable": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "tts.disable": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "tts.convert": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "tts.setProvider": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "tts.setPersona": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "config.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "config.set": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "config.apply": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "config.patch": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "config.schema": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "config.schema.lookup": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "exec.approvals.get": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "exec.approvals.set": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "exec.approvals.node.get": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "exec.approvals.node.set": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "exec.approval.get": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "exec.approval.list": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "exec.approval.request": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "exec.approval.waitDecision": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "exec.approval.resolve": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "question.request": {
      "since": "2026.7",
      "scope": "operator.questions"
    },
    "question.waitAnswer": {
      "since": "2026.7",
      "scope": "operator.questions"
    },
    "question.resolve": {
      "since": "2026.7",
      "scope": "operator.questions"
    },
    "question.get": {
      "since": "2026.7",
      "scope": "operator.questions"
    },
    "question.list": {
      "since": "2026.7",
      "scope": "operator.questions"
    },
    "plugin.approval.list": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "plugin.approval.request": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "plugin.approval.waitDecision": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "plugin.approval.resolve": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "plugins.uiDescriptors": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "plugins.sessionAction": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "openclaw.chat": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "openclaw.chat.history": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "openclaw.changes.list": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "openclaw.approval.list": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "openclaw.setup.detect": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "openclaw.setup.activate": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "openclaw.setup.auth.start": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "openclaw.setup.prepare.start": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "wizard.start": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "wizard.next": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "wizard.cancel": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "wizard.status": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "talk.catalog": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "talk.config": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "talk.client.create": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.client.transcript": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.client.close": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.client.toolCall": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.client.steer": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.create": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.join": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.appendAudio": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.startTurn": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.endTurn": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.cancelTurn": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.cancelOutput": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.acknowledgeMark": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.submitToolResult": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.steer": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.session.close": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.speak": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "talk.mode": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "commands.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "models.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "models.authStatus": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "models.authLogout": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "tools.catalog": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tools.effective": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tools.invoke": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "mcp.app.view": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "mcp.app.listTools": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "mcp.app.listResources": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "mcp.app.listResourceTemplates": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "mcp.app.readResource": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "mcp.app.callTool": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "mcp.app.updateModelContext": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "board.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "board.update": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "board.widget.put": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "board.widget.grant": {
      "since": "<=2026.7",
      "scope": "operator.approvals"
    },
    "board.widget.appView": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "board.event": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "audit.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "audit.activity.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "users.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "users.self": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "users.linkEmail": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "users.setDisplayName": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "users.setAvatar": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "tasks.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tasks.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "tasks.cancel": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "taskSuggestions.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "taskSuggestions.create": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "taskSuggestions.accept": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "taskSuggestions.dismiss": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "environments.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "environments.status": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "worktrees.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "worktrees.branches": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "fs.listDir": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "worktrees.create": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "worktrees.remove": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "worktrees.restore": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "worktrees.gc": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "agents.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "agents.create": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "agents.update": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "agents.delete": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "agents.files.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "agents.files.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "agents.files.set": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.files.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.files.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.files.set": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.files.reveal": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "artifacts.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "artifacts.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "artifacts.download": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.search": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.detail": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.securityVerdicts": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.skillCard": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.bins": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "skills.upload.begin": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.upload.chunk": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.upload.commit": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.install": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.update": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.curator.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.curator.pin": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.curator.unpin": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.curator.restore": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.proposals.inspect": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.proposals.historyStatus": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "skills.proposals.historyScan": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.create": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.update": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.revise": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.requestRevision": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.apply": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.reject": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "skills.proposals.quarantine": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "update.status": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "update.run": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "voicewake.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "voicewake.set": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "secrets.reload": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "secrets.resolve": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "voicewake.routing.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "voicewake.routing.set": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.subscribe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.unsubscribe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.messages.subscribe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.messages.unsubscribe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.preview": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.describe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.compaction.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.compaction.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.compaction.branch": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.compaction.restore": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.branches.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.branches.switch": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.rewind": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.fork": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.create": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "sessions.send": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.abort": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.patch": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "sessions.pluginPatch": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.cleanup": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.reset": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.delete": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "sessions.compact": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "sessions.groups.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.groups.put": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.groups.rename": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.groups.delete": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "last-heartbeat": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "set-heartbeats": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "wake": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "node.pair.list": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "node.pair.approve": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "node.pair.reject": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "node.pair.remove": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.list": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.approve": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.reject": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.remove": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.rename": {
      "since": "2026.7",
      "scope": "operator.pairing"
    },
    "device.token.rotate": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.token.revoke": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "device.pair.setupCode": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "node.rename": {
      "since": "<=2026.7",
      "scope": "operator.pairing"
    },
    "node.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "node.describe": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "node.pluginSurface.refresh": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.pluginTools.update": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.skills.update": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.pending.drain": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.pending.enqueue": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "node.invoke": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "node.pending.pull": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.pending.ack": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.invoke.progress": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.invoke.result": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "node.event": {
      "since": "<=2026.7",
      "scope": "node"
    },
    "cron.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "cron.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "cron.status": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "cron.scratch.get": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "cron.scratch.set": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "cron.add": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "cron.update": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "cron.remove": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "cron.run": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "cron.runs": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "gateway.identity.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "gateway.restart.preflight": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "gateway.restart.request": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "system-presence": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "system-event": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "message.action": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "conversations.send": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "conversations.turn": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "conversations.turn.cancel": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "send": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "agent": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "agent.identity.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "agent.wait": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "chat.history": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "chat.startup": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "chat.metadata": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "chat.message.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "chat.abort": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "chat.send": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "terminal.open": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "terminal.input": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "terminal.resize": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "terminal.close": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "channels.pairing.list": {
      "since": "2026.7",
      "scope": "operator.pairing"
    },
    "channels.pairing.approve": {
      "since": "2026.7",
      "scope": "dynamic"
    },
    "channels.pairing.dismiss": {
      "since": "2026.7",
      "scope": "operator.pairing"
    },
    "assistant.media.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.get": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.resolve": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.usage": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.usage.timeseries": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.usage.logs": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "poll": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.steer": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "push.test": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "attach.grant": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "attach.revoke": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "push.web.vapidPublicKey": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "push.web.subscribe": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "push.web.unsubscribe": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "push.web.test": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "config.openFile": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "connect": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "chat.inject": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "nativeHook.invoke": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "web.login.start": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "web.login.wait": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "terminal.attach": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "terminal.list": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "terminal.text": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "controlUi.githubPreview": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "system.info": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "agents.workspace.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "agents.workspace.get": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "tts.speak": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "plugins.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "plugins.search": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "plugins.install": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "plugins.setEnabled": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "plugins.uninstall": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "plugins.refresh": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "controlUi.sessionPullRequests": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "gateway.suspend.prepare": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "gateway.suspend.status": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "gateway.suspend.resume": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "chat.toolTitles": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.diff": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "openclaw.setup.verify": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "environments.create": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "environments.destroy": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "sessions.catalog.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "sessions.catalog.read": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "terminal.upload": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "sessions.catalog.continue": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "sessions.catalog.archive": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "approval.get": {
      "since": "2026.7",
      "scope": "operator.approvals"
    },
    "approval.resolve": {
      "since": "2026.7",
      "scope": "operator.approvals"
    },
    "sessions.search": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.dispatch": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "sessions.reclaim": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "models.probe": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "migrations.memory.plan": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "migrations.memory.apply": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "ui.command": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "approval.history": {
      "since": "2026.7",
      "scope": "operator.approvals"
    },
    "plugin.surface.refresh": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "conversations.list": {
      "since": "<=2026.7",
      "scope": "operator.admin"
    },
    "session.discussion.info": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "session.discussion.open": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "board.prompt.authorize": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "board.data.read": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "board.action": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "sessions.observer.visibility": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "session.visibility.set": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "session.members.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "session.members.add": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "session.members.remove": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "session.suggestions.add": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "session.suggestions.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "session.suggestions.resolve": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "session.typing": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "sessions.companion.ask": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "sessions.companion.state": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "sessions.companion.reset": {
      "since": "2026.7",
      "scope": "operator.write"
    }
  },
  "definitions": {
    "BoardTab": {
      "type": "object",
      "required": [
        "tabId",
        "title",
        "position",
        "chatDock"
      ],
      "properties": {
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "position": {
          "type": "integer",
          "minimum": 0
        },
        "chatDock": {
          "anyOf": [
            {
              "type": "string",
              "const": "left"
            },
            {
              "type": "string",
              "const": "right"
            },
            {
              "type": "string",
              "const": "bottom"
            },
            {
              "type": "string",
              "const": "hidden"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BoardWidget": {
      "type": "object",
      "required": [
        "name",
        "tabId",
        "contentKind",
        "sizeW",
        "sizeH",
        "position",
        "grantState",
        "revision"
      ],
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "contentKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "html"
            },
            {
              "type": "string",
              "const": "mcp-app"
            },
            {
              "type": "string",
              "const": "plugin"
            }
          ]
        },
        "pluginKind": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "props": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "presentation": {
          "anyOf": [
            {
              "type": "string",
              "const": "card"
            },
            {
              "type": "string",
              "const": "full-bleed"
            },
            {
              "type": "string",
              "const": "frameless"
            }
          ]
        },
        "heightMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "string",
              "const": "fixed"
            }
          ]
        },
        "sizeW": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "sizeH": {
          "type": "integer",
          "minimum": 1,
          "maximum": 20
        },
        "position": {
          "type": "integer",
          "minimum": 0
        },
        "grantState": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "granted"
            },
            {
              "type": "string",
              "const": "rejected"
            }
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "instanceId": {
          "type": "string",
          "minLength": 1
        },
        "declaredSummary": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "declared": {
          "type": "object",
          "properties": {
            "netOrigins": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "maxItems": 32
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 269
              },
              "maxItems": 64
            }
          },
          "additionalProperties": false
        },
        "frameUrl": {
          "type": "string"
        },
        "viewTicket": {
          "type": "string"
        },
        "viewTicketTtlMs": {
          "type": "integer",
          "minimum": 1
        },
        "viewGeneration": {
          "type": "string",
          "pattern": "^[a-f0-9]{32}$"
        },
        "sandboxUrl": {
          "type": "string"
        },
        "sandboxPort": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "sandboxOrigin": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetDeclared": {
      "type": "object",
      "properties": {
        "netOrigins": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "maxItems": 32
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 269
          },
          "maxItems": 64
        }
      },
      "additionalProperties": false
    },
    "BoardSnapshot": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision",
        "tabs",
        "widgets"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "tabs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "tabId",
              "title",
              "position",
              "chatDock"
            ],
            "properties": {
              "tabId": {
                "type": "string",
                "pattern": "^[a-z0-9-]{1,40}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "position": {
                "type": "integer",
                "minimum": 0
              },
              "chatDock": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "left"
                  },
                  {
                    "type": "string",
                    "const": "right"
                  },
                  {
                    "type": "string",
                    "const": "bottom"
                  },
                  {
                    "type": "string",
                    "const": "hidden"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "widgets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "tabId",
              "contentKind",
              "sizeW",
              "sizeH",
              "position",
              "grantState",
              "revision"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
              },
              "tabId": {
                "type": "string",
                "pattern": "^[a-z0-9-]{1,40}$"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "contentKind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "html"
                  },
                  {
                    "type": "string",
                    "const": "mcp-app"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  }
                ]
              },
              "pluginKind": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
              },
              "props": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {}
                }
              },
              "presentation": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "card"
                  },
                  {
                    "type": "string",
                    "const": "full-bleed"
                  },
                  {
                    "type": "string",
                    "const": "frameless"
                  }
                ]
              },
              "heightMode": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "auto"
                  },
                  {
                    "type": "string",
                    "const": "fixed"
                  }
                ]
              },
              "sizeW": {
                "type": "integer",
                "minimum": 1,
                "maximum": 12
              },
              "sizeH": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "position": {
                "type": "integer",
                "minimum": 0
              },
              "grantState": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "none"
                  },
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "granted"
                  },
                  {
                    "type": "string",
                    "const": "rejected"
                  }
                ]
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              },
              "instanceId": {
                "type": "string",
                "minLength": 1
              },
              "declaredSummary": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "declared": {
                "type": "object",
                "properties": {
                  "netOrigins": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2048
                    },
                    "maxItems": 32
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 269
                    },
                    "maxItems": 64
                  }
                },
                "additionalProperties": false
              },
              "frameUrl": {
                "type": "string"
              },
              "viewTicket": {
                "type": "string"
              },
              "viewTicketTtlMs": {
                "type": "integer",
                "minimum": 1
              },
              "viewGeneration": {
                "type": "string",
                "pattern": "^[a-f0-9]{32}$"
              },
              "sandboxUrl": {
                "type": "string"
              },
              "sandboxPort": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "sandboxOrigin": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "BoardTabCreateOp": {
      "type": "object",
      "required": [
        "kind",
        "tabId",
        "title"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "tab_create"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "chatDock": {
          "anyOf": [
            {
              "type": "string",
              "const": "left"
            },
            {
              "type": "string",
              "const": "right"
            },
            {
              "type": "string",
              "const": "bottom"
            },
            {
              "type": "string",
              "const": "hidden"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BoardTabUpdateOp": {
      "type": "object",
      "required": [
        "kind",
        "tabId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "tab_update"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "chatDock": {
          "anyOf": [
            {
              "type": "string",
              "const": "left"
            },
            {
              "type": "string",
              "const": "right"
            },
            {
              "type": "string",
              "const": "bottom"
            },
            {
              "type": "string",
              "const": "hidden"
            }
          ]
        },
        "position": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "BoardTabDeleteOp": {
      "type": "object",
      "required": [
        "kind",
        "tabId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "tab_delete"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        }
      },
      "additionalProperties": false
    },
    "BoardTabsReorderOp": {
      "type": "object",
      "required": [
        "kind",
        "tabIds"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "tabs_reorder"
        },
        "tabIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,40}$"
          }
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetMoveOp": {
      "type": "object",
      "required": [
        "kind",
        "name"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "widget_move"
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        },
        "position": {
          "type": "integer",
          "minimum": 0
        },
        "after": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetResizeOp": {
      "type": "object",
      "required": [
        "kind",
        "name",
        "sizeW",
        "sizeH"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "widget_resize"
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "sizeW": {
          "type": "integer"
        },
        "sizeH": {
          "type": "integer"
        },
        "heightMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "string",
              "const": "fixed"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetRemoveOp": {
      "type": "object",
      "required": [
        "kind",
        "name"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "widget_remove"
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        }
      },
      "additionalProperties": false
    },
    "BoardOp": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "tabId",
            "title"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "tab_create"
            },
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "chatDock": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "left"
                },
                {
                  "type": "string",
                  "const": "right"
                },
                {
                  "type": "string",
                  "const": "bottom"
                },
                {
                  "type": "string",
                  "const": "hidden"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "tabId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "tab_update"
            },
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "chatDock": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "left"
                },
                {
                  "type": "string",
                  "const": "right"
                },
                {
                  "type": "string",
                  "const": "bottom"
                },
                {
                  "type": "string",
                  "const": "hidden"
                }
              ]
            },
            "position": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "tabId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "tab_delete"
            },
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "tabIds"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "tabs_reorder"
            },
            "tabIds": {
              "type": "array",
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9-]{1,40}$"
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "name"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "widget_move"
            },
            "name": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            },
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            },
            "position": {
              "type": "integer",
              "minimum": 0
            },
            "after": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "name",
            "sizeW",
            "sizeH"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "widget_resize"
            },
            "name": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            },
            "sizeW": {
              "type": "integer"
            },
            "sizeH": {
              "type": "integer"
            },
            "heightMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "auto"
                },
                {
                  "type": "string",
                  "const": "fixed"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "name"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "widget_remove"
            },
            "name": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardMcpAppDescriptor": {
      "type": "object",
      "required": [
        "serverName",
        "toolName",
        "uiResourceUri",
        "toolCallId"
      ],
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1
        },
        "toolName": {
          "type": "string",
          "minLength": 1
        },
        "uiResourceUri": {
          "type": "string",
          "minLength": 1
        },
        "toolCallId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetHtmlContent": {
      "type": "object",
      "required": [
        "kind",
        "html"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "html"
        },
        "html": {
          "type": "string",
          "maxLength": 262144
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetMcpAppContent": {
      "type": "object",
      "required": [
        "kind",
        "descriptor"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp-app"
        },
        "descriptor": {
          "type": "object",
          "required": [
            "serverName",
            "toolName",
            "uiResourceUri",
            "toolCallId"
          ],
          "properties": {
            "serverName": {
              "type": "string",
              "minLength": 1
            },
            "toolName": {
              "type": "string",
              "minLength": 1
            },
            "uiResourceUri": {
              "type": "string",
              "minLength": 1
            },
            "toolCallId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetMcpAppPutContent": {
      "type": "object",
      "required": [
        "kind",
        "viewId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp-app"
        },
        "viewId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetPluginContent": {
      "type": "object",
      "required": [
        "kind",
        "pluginKind"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "plugin"
        },
        "pluginKind": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "props": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        }
      },
      "additionalProperties": false
    },
    "BoardCanvasDocumentSource": {
      "type": "object",
      "required": [
        "kind",
        "docId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "canvas-doc"
        },
        "docId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetContent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "html"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "html"
            },
            "html": {
              "type": "string",
              "maxLength": 262144
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "descriptor"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "mcp-app"
            },
            "descriptor": {
              "type": "object",
              "required": [
                "serverName",
                "toolName",
                "uiResourceUri",
                "toolCallId"
              ],
              "properties": {
                "serverName": {
                  "type": "string",
                  "minLength": 1
                },
                "toolName": {
                  "type": "string",
                  "minLength": 1
                },
                "uiResourceUri": {
                  "type": "string",
                  "minLength": 1
                },
                "toolCallId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "pluginKind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "plugin"
            },
            "pluginKind": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
            },
            "props": {
              "type": "object",
              "patternProperties": {
                "^.*$": {}
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardWidgetPutContent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "html"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "html"
            },
            "html": {
              "type": "string",
              "maxLength": 262144
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "viewId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "mcp-app"
            },
            "viewId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "pluginKind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "plugin"
            },
            "pluginKind": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
            },
            "props": {
              "type": "object",
              "patternProperties": {
                "^.*$": {}
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "docId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "canvas-doc"
            },
            "docId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardGetParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardUpdateParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "ops"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "ops": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "kind",
                  "tabId",
                  "title"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "tab_create"
                  },
                  "tabId": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "chatDock": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "left"
                      },
                      {
                        "type": "string",
                        "const": "right"
                      },
                      {
                        "type": "string",
                        "const": "bottom"
                      },
                      {
                        "type": "string",
                        "const": "hidden"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "tabId"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "tab_update"
                  },
                  "tabId": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,40}$"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "chatDock": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "left"
                      },
                      {
                        "type": "string",
                        "const": "right"
                      },
                      {
                        "type": "string",
                        "const": "bottom"
                      },
                      {
                        "type": "string",
                        "const": "hidden"
                      }
                    ]
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "tabId"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "tab_delete"
                  },
                  "tabId": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,40}$"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "tabIds"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "tabs_reorder"
                  },
                  "tabIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9-]{1,40}$"
                    }
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "name"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "widget_move"
                  },
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
                  },
                  "tabId": {
                    "type": "string",
                    "pattern": "^[a-z0-9-]{1,40}$"
                  },
                  "position": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "after": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "name",
                  "sizeW",
                  "sizeH"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "widget_resize"
                  },
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
                  },
                  "sizeW": {
                    "type": "integer"
                  },
                  "sizeH": {
                    "type": "integer"
                  },
                  "heightMode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "auto"
                      },
                      {
                        "type": "string",
                        "const": "fixed"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "name"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "widget_remove"
                  },
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
                  }
                },
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetPutParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "name",
        "content"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "content": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "html"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "html"
                },
                "html": {
                  "type": "string",
                  "maxLength": 262144
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "viewId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "mcp-app"
                },
                "viewId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "pluginKind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "pluginKind": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}$"
                },
                "props": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {}
                  }
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "docId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "canvas-doc"
                },
                "docId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "presentation": {
          "anyOf": [
            {
              "type": "string",
              "const": "card"
            },
            {
              "type": "string",
              "const": "full-bleed"
            },
            {
              "type": "string",
              "const": "frameless"
            }
          ]
        },
        "heightMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "string",
              "const": "fixed"
            }
          ]
        },
        "placement": {
          "type": "object",
          "properties": {
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            },
            "size": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "sm"
                },
                {
                  "type": "string",
                  "const": "md"
                },
                {
                  "type": "string",
                  "const": "lg"
                },
                {
                  "type": "string",
                  "const": "xl"
                },
                {
                  "type": "string",
                  "const": "full"
                }
              ]
            },
            "after": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            }
          },
          "additionalProperties": false
        },
        "declared": {
          "type": "object",
          "properties": {
            "netOrigins": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "maxItems": 32
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 269
              },
              "maxItems": 64
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetGrantParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "name",
        "decision",
        "revision",
        "instanceId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "decision": {
          "anyOf": [
            {
              "type": "string",
              "const": "granted"
            },
            {
              "type": "string",
              "const": "rejected"
            }
          ]
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "instanceId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetAppViewParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "name",
        "revision",
        "instanceId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "instanceId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetAppViewResult": {
      "type": "object",
      "required": [
        "viewId",
        "expiresAtMs"
      ],
      "properties": {
        "viewId": {
          "type": "string",
          "minLength": 1
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "BoardEventParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "sessionKey",
            "widget",
            "payload"
          ],
          "properties": {
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "widget": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            },
            "payload": {}
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ticket",
            "payload"
          ],
          "properties": {
            "ticket": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "payload": {}
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardPromptAuthorizeParams": {
      "type": "object",
      "required": [
        "ticket"
      ],
      "properties": {
        "ticket": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        }
      },
      "additionalProperties": false
    },
    "BoardDataReadParams": {
      "type": "object",
      "required": [
        "ticket",
        "bindingId"
      ],
      "properties": {
        "ticket": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "bindingId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "params": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          },
          "maxProperties": 64
        }
      },
      "additionalProperties": false
    },
    "BoardActionParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "ticket",
            "action",
            "jobId"
          ],
          "properties": {
            "ticket": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "action": {
              "type": "string",
              "const": "cron.trigger"
            },
            "jobId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ticket",
            "action"
          ],
          "properties": {
            "ticket": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "action": {
              "type": "string",
              "minLength": 1,
              "maxLength": 269
            },
            "params": {
              "type": "object",
              "patternProperties": {
                "^.*$": {}
              },
              "maxProperties": 64
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardChangedEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "widget": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        }
      },
      "additionalProperties": false
    },
    "BoardFocusTabCommand": {
      "type": "object",
      "required": [
        "kind",
        "tabId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "focus_tab"
        },
        "tabId": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,40}$"
        }
      },
      "additionalProperties": false
    },
    "BoardSetChatDockCommand": {
      "type": "object",
      "required": [
        "kind",
        "dock"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "set_chat_dock"
        },
        "dock": {
          "anyOf": [
            {
              "type": "string",
              "const": "left"
            },
            {
              "type": "string",
              "const": "right"
            },
            {
              "type": "string",
              "const": "bottom"
            },
            {
              "type": "string",
              "const": "hidden"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "BoardCommand": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "tabId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "focus_tab"
            },
            "tabId": {
              "type": "string",
              "pattern": "^[a-z0-9-]{1,40}$"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "dock"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "set_chat_dock"
            },
            "dock": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "left"
                },
                {
                  "type": "string",
                  "const": "right"
                },
                {
                  "type": "string",
                  "const": "bottom"
                },
                {
                  "type": "string",
                  "const": "hidden"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardCommandEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "command"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "tabId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "focus_tab"
                },
                "tabId": {
                  "type": "string",
                  "pattern": "^[a-z0-9-]{1,40}$"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "dock"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "set_chat_dock"
                },
                "dock": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "left"
                    },
                    {
                      "type": "string",
                      "const": "right"
                    },
                    {
                      "type": "string",
                      "const": "bottom"
                    },
                    {
                      "type": "string",
                      "const": "hidden"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "AuthProbeStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "ok"
        },
        {
          "type": "string",
          "const": "auth"
        },
        {
          "type": "string",
          "const": "rate_limit"
        },
        {
          "type": "string",
          "const": "billing"
        },
        {
          "type": "string",
          "const": "timeout"
        },
        {
          "type": "string",
          "const": "format"
        },
        {
          "type": "string",
          "const": "unknown"
        },
        {
          "type": "string",
          "const": "no_model"
        }
      ]
    },
    "ConnectParams": {
      "type": "object",
      "required": [
        "minProtocol",
        "maxProtocol",
        "client"
      ],
      "properties": {
        "minProtocol": {
          "type": "integer",
          "minimum": 1
        },
        "maxProtocol": {
          "type": "integer",
          "minimum": 1
        },
        "client": {
          "type": "object",
          "required": [
            "id",
            "version",
            "platform",
            "mode"
          ],
          "properties": {
            "id": {
              "enum": [
                "webchat-ui",
                "openclaw-control-ui",
                "openclaw-browser-copilot",
                "openclaw-tui",
                "webchat",
                "cli",
                "gateway-client",
                "openclaw-macos",
                "openclaw-linux",
                "openclaw-ios",
                "openclaw-watchos",
                "openclaw-android",
                "node-host",
                "openclaw-worker",
                "test",
                "fingerprint",
                "openclaw-probe"
              ]
            },
            "displayName": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "platform": {
              "type": "string",
              "minLength": 1
            },
            "deviceFamily": {
              "type": "string",
              "minLength": 1
            },
            "modelIdentifier": {
              "type": "string",
              "minLength": 1
            },
            "mode": {
              "enum": [
                "webchat",
                "cli",
                "ui",
                "backend",
                "node",
                "worker",
                "probe",
                "test"
              ]
            },
            "instanceId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "caps": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "default": []
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "permissions": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "boolean"
            }
          }
        },
        "pathEnv": {
          "type": "string"
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "device": {
          "type": "object",
          "required": [
            "id",
            "publicKey",
            "signature",
            "signedAt",
            "nonce"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "publicKey": {
              "type": "string",
              "minLength": 1
            },
            "signature": {
              "type": "string",
              "minLength": 1
            },
            "signedAt": {
              "type": "integer",
              "minimum": 0
            },
            "nonce": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "auth": {
          "type": "object",
          "properties": {
            "token": {
              "type": "string"
            },
            "bootstrapToken": {
              "type": "string"
            },
            "deviceToken": {
              "type": "string"
            },
            "password": {
              "type": "string"
            },
            "approvalRuntimeToken": {
              "type": "string"
            },
            "agentRuntimeIdentityToken": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "locale": {
          "type": "string"
        },
        "userAgent": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WorkerAdmissionHandshake": {
      "type": "object",
      "required": [
        "bundleHash",
        "openclawVersion",
        "protocolFeatures"
      ],
      "properties": {
        "bundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "openclawVersion": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "protocolFeatures": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 64,
          "uniqueItems": true
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "HelloOk": {
      "type": "object",
      "required": [
        "type",
        "protocol",
        "server",
        "features",
        "snapshot",
        "auth",
        "policy"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "hello-ok"
        },
        "protocol": {
          "type": "integer",
          "minimum": 1
        },
        "server": {
          "type": "object",
          "required": [
            "version",
            "connId"
          ],
          "properties": {
            "version": {
              "type": "string",
              "minLength": 1
            },
            "connId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "features": {
          "type": "object",
          "required": [
            "methods",
            "events"
          ],
          "properties": {
            "methods": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "events": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "capabilities": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        "snapshot": {
          "type": "object",
          "required": [
            "presence",
            "health",
            "stateVersion",
            "uptimeMs"
          ],
          "properties": {
            "presence": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "ts"
                ],
                "properties": {
                  "host": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ip": {
                    "type": "string",
                    "minLength": 1
                  },
                  "version": {
                    "type": "string",
                    "minLength": 1
                  },
                  "platform": {
                    "type": "string",
                    "minLength": 1
                  },
                  "deviceFamily": {
                    "type": "string",
                    "minLength": 1
                  },
                  "modelIdentifier": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mode": {
                    "type": "string",
                    "minLength": 1
                  },
                  "lastInputSeconds": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "text": {
                    "type": "string"
                  },
                  "ts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "deviceId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "roles": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "instanceId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "user": {
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "email": {
                        "type": "string",
                        "minLength": 1
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "avatarUrl": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "watchedSessions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "health": {
              "type": "object",
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "ts": {
                  "type": "integer",
                  "minimum": 0
                },
                "durationMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "eventLoop": {
                  "type": "object",
                  "required": [
                    "degraded",
                    "reasons",
                    "intervalMs",
                    "delayP99Ms",
                    "delayMaxMs",
                    "utilization",
                    "cpuCoreRatio"
                  ],
                  "properties": {
                    "degraded": {
                      "type": "boolean"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "event_loop_delay"
                          },
                          {
                            "type": "string",
                            "const": "event_loop_utilization"
                          },
                          {
                            "type": "string",
                            "const": "cpu"
                          }
                        ]
                      }
                    },
                    "intervalMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "delayP99Ms": {
                      "type": "number",
                      "minimum": 0
                    },
                    "delayMaxMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "utilization": {
                      "type": "number",
                      "minimum": 0
                    },
                    "cpuCoreRatio": {
                      "type": "number",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                },
                "plugins": {
                  "type": "object",
                  "required": [
                    "loaded",
                    "errors"
                  ],
                  "properties": {
                    "loaded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "origin",
                          "activated",
                          "error"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "origin": {
                            "type": "string"
                          },
                          "activated": {
                            "type": "boolean"
                          },
                          "activationSource": {
                            "type": "string"
                          },
                          "activationReason": {
                            "type": "string"
                          },
                          "failurePhase": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "unavailable": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "state",
                          "diagnostic"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string",
                            "const": "configured-unavailable"
                          },
                          "diagnostic": {
                            "type": "object",
                            "required": [
                              "kind",
                              "reason",
                              "detail"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "plugin-verification"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "detail": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "contextEngines": {
                  "type": "object",
                  "required": [
                    "quarantined"
                  ],
                  "properties": {
                    "quarantined": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "engineId",
                          "operation",
                          "reason",
                          "failedAt"
                        ],
                        "properties": {
                          "engineId": {
                            "type": "string"
                          },
                          "owner": {
                            "type": "string"
                          },
                          "operation": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "failedAt": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "deliveryQueues": {
                  "type": "object",
                  "required": [
                    "failed"
                  ],
                  "properties": {
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "queueName",
                          "count"
                        ],
                        "properties": {
                          "queueName": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "oldestFailedAt": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "modelPricing": {
                  "type": "object",
                  "required": [
                    "state",
                    "sources"
                  ],
                  "properties": {
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "degraded"
                        },
                        {
                          "type": "string",
                          "const": "disabled"
                        }
                      ]
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "source",
                          "state"
                        ],
                        "properties": {
                          "source": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "openrouter"
                              },
                              {
                                "type": "string",
                                "const": "litellm"
                              },
                              {
                                "type": "string",
                                "const": "bootstrap"
                              },
                              {
                                "type": "string",
                                "const": "refresh"
                              }
                            ]
                          },
                          "state": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "ok"
                              },
                              {
                                "type": "string",
                                "const": "degraded"
                              }
                            ]
                          },
                          "lastFailureAt": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lastFailureAt": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "detail": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "configReload": {
                  "type": "object",
                  "required": [
                    "hotReloadStatus"
                  ],
                  "properties": {
                    "hotReloadStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "active"
                        },
                        {
                          "type": "string",
                          "const": "disabled"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "channels": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {}
                  }
                },
                "channelOrder": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "channelLabels": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "string"
                    }
                  }
                },
                "heartbeatSeconds": {
                  "type": "integer",
                  "minimum": 0
                },
                "defaultAgentId": {
                  "type": "string"
                },
                "agents": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "agentId",
                      "isDefault",
                      "heartbeat",
                      "sessions"
                    ],
                    "properties": {
                      "agentId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "heartbeat": {
                        "type": "object",
                        "required": [
                          "enabled",
                          "every",
                          "everyMs",
                          "prompt",
                          "target",
                          "ackMaxChars"
                        ],
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "every": {
                            "type": "string"
                          },
                          "everyMs": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "prompt": {
                            "type": "string"
                          },
                          "target": {
                            "type": "string"
                          },
                          "model": {
                            "type": "string"
                          },
                          "ackMaxChars": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "additionalProperties": false
                      },
                      "sessions": {
                        "type": "object",
                        "required": [
                          "path",
                          "count",
                          "recent"
                        ],
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "recent": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "key",
                                "updatedAt",
                                "age"
                              ],
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "updatedAt": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "age": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "sessions": {
                  "type": "object",
                  "required": [
                    "path",
                    "count",
                    "recent"
                  ],
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "recent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "updatedAt",
                          "age"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "age": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "stateVersion": {
              "type": "object",
              "required": [
                "presence",
                "health"
              ],
              "properties": {
                "presence": {
                  "type": "integer",
                  "minimum": 0
                },
                "health": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            "uptimeMs": {
              "type": "integer",
              "minimum": 0
            },
            "appliedConfigHash": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "configPath": {
              "type": "string",
              "minLength": 1
            },
            "stateDir": {
              "type": "string",
              "minLength": 1
            },
            "sessionDefaults": {
              "type": "object",
              "required": [
                "defaultAgentId",
                "mainKey",
                "mainSessionKey"
              ],
              "properties": {
                "defaultAgentId": {
                  "type": "string",
                  "minLength": 1
                },
                "mainKey": {
                  "type": "string",
                  "minLength": 1
                },
                "mainSessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "scope": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "authMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "none"
                },
                {
                  "type": "string",
                  "const": "token"
                },
                {
                  "type": "string",
                  "const": "password"
                },
                {
                  "type": "string",
                  "const": "trusted-proxy"
                }
              ]
            },
            "updateAvailable": {
              "type": "object",
              "required": [
                "currentVersion",
                "latestVersion",
                "channel"
              ],
              "properties": {
                "currentVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "latestVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "channel": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "additionalProperties": false
        },
        "controlUiTabs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pluginId",
              "id",
              "label"
            ],
            "properties": {
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "icon": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "requiresGatewayAuth": {
                "type": "boolean"
              },
              "group": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "control"
                  },
                  {
                    "type": "string",
                    "const": "agent"
                  }
                ]
              },
              "order": {
                "type": "number"
              }
            },
            "additionalProperties": false
          }
        },
        "controlUiWidgetKinds": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pluginId",
              "kind",
              "label"
            ],
            "properties": {
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "pluginSurfaceUrls": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "deviceAuthMigration": {
          "type": "object",
          "required": [
            "pending"
          ],
          "properties": {
            "pending": {
              "type": "boolean",
              "const": true
            }
          },
          "additionalProperties": false
        },
        "auth": {
          "type": "object",
          "required": [
            "role",
            "scopes"
          ],
          "properties": {
            "deviceToken": {
              "type": "string",
              "minLength": 1
            },
            "role": {
              "type": "string",
              "minLength": 1
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "issuedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "deviceTokens": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "deviceToken",
                  "role",
                  "scopes",
                  "issuedAtMs"
                ],
                "properties": {
                  "deviceToken": {
                    "type": "string",
                    "minLength": 1
                  },
                  "role": {
                    "type": "string",
                    "minLength": 1
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "issuedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "policy": {
          "type": "object",
          "required": [
            "maxPayload",
            "maxBufferedBytes",
            "tickIntervalMs"
          ],
          "properties": {
            "maxPayload": {
              "type": "integer",
              "minimum": 1
            },
            "maxBufferedBytes": {
              "type": "integer",
              "minimum": 1
            },
            "tickIntervalMs": {
              "type": "integer",
              "minimum": 1
            },
            "allowedSessionVisibilities": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "shared"
                  },
                  {
                    "type": "string",
                    "const": "read-only"
                  },
                  {
                    "type": "string",
                    "const": "suggest"
                  },
                  {
                    "type": "string",
                    "const": "draft"
                  }
                ]
              }
            },
            "hasMultipleSessionSharingIdentities": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "RequestFrame": {
      "type": "object",
      "required": [
        "type",
        "id",
        "method"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "req"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "method": {
          "type": "string",
          "minLength": 1
        },
        "params": {}
      },
      "additionalProperties": false
    },
    "ResponseFrame": {
      "type": "object",
      "required": [
        "type",
        "id",
        "ok"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "res"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "ok": {
          "type": "boolean"
        },
        "payload": {},
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            },
            "details": {},
            "retryable": {
              "type": "boolean"
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "EventFrame": {
      "type": "object",
      "required": [
        "type",
        "event"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "event"
        },
        "event": {
          "type": "string",
          "minLength": 1
        },
        "payload": {},
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "stateVersion": {
          "type": "object",
          "required": [
            "presence",
            "health"
          ],
          "properties": {
            "presence": {
              "type": "integer",
              "minimum": 0
            },
            "health": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "GatewayFrame": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "type",
            "id",
            "method"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "req"
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "method": {
              "type": "string",
              "minLength": 1
            },
            "params": {}
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "id",
            "ok"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "res"
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "ok": {
              "type": "boolean"
            },
            "payload": {},
            "error": {
              "type": "object",
              "required": [
                "code",
                "message"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1
                },
                "message": {
                  "type": "string",
                  "minLength": 1
                },
                "details": {},
                "retryable": {
                  "type": "boolean"
                },
                "retryAfterMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "event"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "event"
            },
            "event": {
              "type": "string",
              "minLength": 1
            },
            "payload": {},
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "stateVersion": {
              "type": "object",
              "required": [
                "presence",
                "health"
              ],
              "properties": {
                "presence": {
                  "type": "integer",
                  "minimum": 0
                },
                "health": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      ],
      "discriminator": "type"
    },
    "PresenceEntry": {
      "type": "object",
      "required": [
        "ts"
      ],
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1
        },
        "ip": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "deviceFamily": {
          "type": "string",
          "minLength": 1
        },
        "modelIdentifier": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "type": "string",
          "minLength": 1
        },
        "lastInputSeconds": {
          "type": "integer",
          "minimum": 0
        },
        "reason": {
          "type": "string",
          "minLength": 1
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "text": {
          "type": "string"
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "instanceId": {
          "type": "string",
          "minLength": 1
        },
        "user": {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "email": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "watchedSessions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "StateVersion": {
      "type": "object",
      "required": [
        "presence",
        "health"
      ],
      "properties": {
        "presence": {
          "type": "integer",
          "minimum": 0
        },
        "health": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "Snapshot": {
      "type": "object",
      "required": [
        "presence",
        "health",
        "stateVersion",
        "uptimeMs"
      ],
      "properties": {
        "presence": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "ts"
            ],
            "properties": {
              "host": {
                "type": "string",
                "minLength": 1
              },
              "ip": {
                "type": "string",
                "minLength": 1
              },
              "version": {
                "type": "string",
                "minLength": 1
              },
              "platform": {
                "type": "string",
                "minLength": 1
              },
              "deviceFamily": {
                "type": "string",
                "minLength": 1
              },
              "modelIdentifier": {
                "type": "string",
                "minLength": 1
              },
              "mode": {
                "type": "string",
                "minLength": 1
              },
              "lastInputSeconds": {
                "type": "integer",
                "minimum": 0
              },
              "reason": {
                "type": "string",
                "minLength": 1
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "text": {
                "type": "string"
              },
              "ts": {
                "type": "integer",
                "minimum": 0
              },
              "deviceId": {
                "type": "string",
                "minLength": 1
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "instanceId": {
                "type": "string",
                "minLength": 1
              },
              "user": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "email": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "avatarUrl": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "watchedSessions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          }
        },
        "health": {
          "type": "object",
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "ts": {
              "type": "integer",
              "minimum": 0
            },
            "durationMs": {
              "type": "integer",
              "minimum": 0
            },
            "eventLoop": {
              "type": "object",
              "required": [
                "degraded",
                "reasons",
                "intervalMs",
                "delayP99Ms",
                "delayMaxMs",
                "utilization",
                "cpuCoreRatio"
              ],
              "properties": {
                "degraded": {
                  "type": "boolean"
                },
                "reasons": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "event_loop_delay"
                      },
                      {
                        "type": "string",
                        "const": "event_loop_utilization"
                      },
                      {
                        "type": "string",
                        "const": "cpu"
                      }
                    ]
                  }
                },
                "intervalMs": {
                  "type": "number",
                  "minimum": 0
                },
                "delayP99Ms": {
                  "type": "number",
                  "minimum": 0
                },
                "delayMaxMs": {
                  "type": "number",
                  "minimum": 0
                },
                "utilization": {
                  "type": "number",
                  "minimum": 0
                },
                "cpuCoreRatio": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            "plugins": {
              "type": "object",
              "required": [
                "loaded",
                "errors"
              ],
              "properties": {
                "loaded": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "origin",
                      "activated",
                      "error"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "origin": {
                        "type": "string"
                      },
                      "activated": {
                        "type": "boolean"
                      },
                      "activationSource": {
                        "type": "string"
                      },
                      "activationReason": {
                        "type": "string"
                      },
                      "failurePhase": {
                        "type": "string"
                      },
                      "error": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "unavailable": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "state",
                      "diagnostic"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string",
                        "const": "configured-unavailable"
                      },
                      "diagnostic": {
                        "type": "object",
                        "required": [
                          "kind",
                          "reason",
                          "detail"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "plugin-verification"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "detail": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "contextEngines": {
              "type": "object",
              "required": [
                "quarantined"
              ],
              "properties": {
                "quarantined": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "engineId",
                      "operation",
                      "reason",
                      "failedAt"
                    ],
                    "properties": {
                      "engineId": {
                        "type": "string"
                      },
                      "owner": {
                        "type": "string"
                      },
                      "operation": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "failedAt": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "deliveryQueues": {
              "type": "object",
              "required": [
                "failed"
              ],
              "properties": {
                "failed": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "queueName",
                      "count"
                    ],
                    "properties": {
                      "queueName": {
                        "type": "string"
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "oldestFailedAt": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "modelPricing": {
              "type": "object",
              "required": [
                "state",
                "sources"
              ],
              "properties": {
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "degraded"
                    },
                    {
                      "type": "string",
                      "const": "disabled"
                    }
                  ]
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "source",
                      "state"
                    ],
                    "properties": {
                      "source": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "openrouter"
                          },
                          {
                            "type": "string",
                            "const": "litellm"
                          },
                          {
                            "type": "string",
                            "const": "bootstrap"
                          },
                          {
                            "type": "string",
                            "const": "refresh"
                          }
                        ]
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "ok"
                          },
                          {
                            "type": "string",
                            "const": "degraded"
                          }
                        ]
                      },
                      "lastFailureAt": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "detail": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "lastFailureAt": {
                  "type": "integer",
                  "minimum": 0
                },
                "detail": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "configReload": {
              "type": "object",
              "required": [
                "hotReloadStatus"
              ],
              "properties": {
                "hotReloadStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "active"
                    },
                    {
                      "type": "string",
                      "const": "disabled"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "channels": {
              "type": "object",
              "patternProperties": {
                "^.*$": {}
              }
            },
            "channelOrder": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "channelLabels": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "string"
                }
              }
            },
            "heartbeatSeconds": {
              "type": "integer",
              "minimum": 0
            },
            "defaultAgentId": {
              "type": "string"
            },
            "agents": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "agentId",
                  "isDefault",
                  "heartbeat",
                  "sessions"
                ],
                "properties": {
                  "agentId": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "isDefault": {
                    "type": "boolean"
                  },
                  "heartbeat": {
                    "type": "object",
                    "required": [
                      "enabled",
                      "every",
                      "everyMs",
                      "prompt",
                      "target",
                      "ackMaxChars"
                    ],
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "every": {
                        "type": "string"
                      },
                      "everyMs": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "prompt": {
                        "type": "string"
                      },
                      "target": {
                        "type": "string"
                      },
                      "model": {
                        "type": "string"
                      },
                      "ackMaxChars": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  },
                  "sessions": {
                    "type": "object",
                    "required": [
                      "path",
                      "count",
                      "recent"
                    ],
                    "properties": {
                      "path": {
                        "type": "string"
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "recent": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "key",
                            "updatedAt",
                            "age"
                          ],
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "age": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "sessions": {
              "type": "object",
              "required": [
                "path",
                "count",
                "recent"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                },
                "recent": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "key",
                      "updatedAt",
                      "age"
                    ],
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "age": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "stateVersion": {
          "type": "object",
          "required": [
            "presence",
            "health"
          ],
          "properties": {
            "presence": {
              "type": "integer",
              "minimum": 0
            },
            "health": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "uptimeMs": {
          "type": "integer",
          "minimum": 0
        },
        "appliedConfigHash": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "configPath": {
          "type": "string",
          "minLength": 1
        },
        "stateDir": {
          "type": "string",
          "minLength": 1
        },
        "sessionDefaults": {
          "type": "object",
          "required": [
            "defaultAgentId",
            "mainKey",
            "mainSessionKey"
          ],
          "properties": {
            "defaultAgentId": {
              "type": "string",
              "minLength": 1
            },
            "mainKey": {
              "type": "string",
              "minLength": 1
            },
            "mainSessionKey": {
              "type": "string",
              "minLength": 1
            },
            "scope": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "authMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "token"
            },
            {
              "type": "string",
              "const": "password"
            },
            {
              "type": "string",
              "const": "trusted-proxy"
            }
          ]
        },
        "updateAvailable": {
          "type": "object",
          "required": [
            "currentVersion",
            "latestVersion",
            "channel"
          ],
          "properties": {
            "currentVersion": {
              "type": "string",
              "minLength": 1
            },
            "latestVersion": {
              "type": "string",
              "minLength": 1
            },
            "channel": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "additionalProperties": false
    },
    "ErrorShape": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "details": {},
        "retryable": {
          "type": "boolean"
        },
        "retryAfterMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "MissingScopeErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "missingScope",
        "requiredScopes"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "MISSING_SCOPE"
        },
        "missingScope": {
          "type": "string",
          "minLength": 1
        },
        "requiredScopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        }
      },
      "additionalProperties": false
    },
    "McpAppViewExpiredErrorDetails": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "MCP_APP_VIEW_EXPIRED"
        }
      },
      "additionalProperties": false
    },
    "UnknownAgentIdErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "agentId"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "UNKNOWN_AGENT_ID"
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WizardNotFoundErrorDetails": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "WIZARD_NOT_FOUND"
        }
      },
      "additionalProperties": false
    },
    "GatewayErrorDetails": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "code",
            "missingScope",
            "requiredScopes"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "MISSING_SCOPE"
            },
            "missingScope": {
              "type": "string",
              "minLength": 1
            },
            "requiredScopes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "MCP_APP_VIEW_EXPIRED"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "agentId"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "UNKNOWN_AGENT_ID"
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "WIZARD_NOT_FOUND"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "GatewaySuspendTaskBlocker": {
      "type": "object",
      "required": [
        "taskId",
        "status",
        "runtime"
      ],
      "properties": {
        "taskId": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "running"
        },
        "runtime": {
          "anyOf": [
            {
              "type": "string",
              "const": "subagent"
            },
            {
              "type": "string",
              "const": "acp"
            },
            {
              "type": "string",
              "const": "cli"
            },
            {
              "type": "string",
              "const": "cron"
            }
          ]
        },
        "runId": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendBlocker": {
      "type": "object",
      "required": [
        "kind",
        "count",
        "message"
      ],
      "properties": {
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "queue"
            },
            {
              "type": "string",
              "const": "reply"
            },
            {
              "type": "string",
              "const": "embedded-run"
            },
            {
              "type": "string",
              "const": "background-exec"
            },
            {
              "type": "string",
              "const": "cron-run"
            },
            {
              "type": "string",
              "const": "task"
            },
            {
              "type": "string",
              "const": "root-request"
            },
            {
              "type": "string",
              "const": "session-admission"
            },
            {
              "type": "string",
              "const": "session-mutation"
            },
            {
              "type": "string",
              "const": "chat-run"
            },
            {
              "type": "string",
              "const": "queued-turn"
            },
            {
              "type": "string",
              "const": "terminal-persistence"
            },
            {
              "type": "string",
              "const": "terminal-session"
            }
          ]
        },
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "message": {
          "type": "string"
        },
        "task": {
          "type": "object",
          "required": [
            "taskId",
            "status",
            "runtime"
          ],
          "properties": {
            "taskId": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "const": "running"
            },
            "runtime": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "subagent"
                },
                {
                  "type": "string",
                  "const": "acp"
                },
                {
                  "type": "string",
                  "const": "cli"
                },
                {
                  "type": "string",
                  "const": "cron"
                }
              ]
            },
            "runId": {
              "type": "string"
            },
            "label": {
              "type": "string"
            },
            "title": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendPrepareParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "\\S"
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendPrepareBusyResult": {
      "type": "object",
      "required": [
        "status",
        "reason",
        "retryAfterMs",
        "activeCount",
        "blockers"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "busy"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "active-work"
            },
            {
              "type": "string",
              "const": "gateway-draining"
            }
          ]
        },
        "retryAfterMs": {
          "type": "integer",
          "minimum": 0
        },
        "activeCount": {
          "type": "integer",
          "minimum": 0
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "count",
              "message"
            ],
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "queue"
                  },
                  {
                    "type": "string",
                    "const": "reply"
                  },
                  {
                    "type": "string",
                    "const": "embedded-run"
                  },
                  {
                    "type": "string",
                    "const": "background-exec"
                  },
                  {
                    "type": "string",
                    "const": "cron-run"
                  },
                  {
                    "type": "string",
                    "const": "task"
                  },
                  {
                    "type": "string",
                    "const": "root-request"
                  },
                  {
                    "type": "string",
                    "const": "session-admission"
                  },
                  {
                    "type": "string",
                    "const": "session-mutation"
                  },
                  {
                    "type": "string",
                    "const": "chat-run"
                  },
                  {
                    "type": "string",
                    "const": "queued-turn"
                  },
                  {
                    "type": "string",
                    "const": "terminal-persistence"
                  },
                  {
                    "type": "string",
                    "const": "terminal-session"
                  }
                ]
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "message": {
                "type": "string"
              },
              "task": {
                "type": "object",
                "required": [
                  "taskId",
                  "status",
                  "runtime"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "const": "running"
                  },
                  "runtime": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "subagent"
                      },
                      {
                        "type": "string",
                        "const": "acp"
                      },
                      {
                        "type": "string",
                        "const": "cli"
                      },
                      {
                        "type": "string",
                        "const": "cron"
                      }
                    ]
                  },
                  "runId": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendPrepareReadyResult": {
      "type": "object",
      "required": [
        "status",
        "suspensionId",
        "expiresAtMs",
        "activeCount",
        "blockers"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "ready"
        },
        "suspensionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "\\S"
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "activeCount": {
          "type": "integer",
          "minimum": 0
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "count",
              "message"
            ],
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "queue"
                  },
                  {
                    "type": "string",
                    "const": "reply"
                  },
                  {
                    "type": "string",
                    "const": "embedded-run"
                  },
                  {
                    "type": "string",
                    "const": "background-exec"
                  },
                  {
                    "type": "string",
                    "const": "cron-run"
                  },
                  {
                    "type": "string",
                    "const": "task"
                  },
                  {
                    "type": "string",
                    "const": "root-request"
                  },
                  {
                    "type": "string",
                    "const": "session-admission"
                  },
                  {
                    "type": "string",
                    "const": "session-mutation"
                  },
                  {
                    "type": "string",
                    "const": "chat-run"
                  },
                  {
                    "type": "string",
                    "const": "queued-turn"
                  },
                  {
                    "type": "string",
                    "const": "terminal-persistence"
                  },
                  {
                    "type": "string",
                    "const": "terminal-session"
                  }
                ]
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "message": {
                "type": "string"
              },
              "task": {
                "type": "object",
                "required": [
                  "taskId",
                  "status",
                  "runtime"
                ],
                "properties": {
                  "taskId": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "const": "running"
                  },
                  "runtime": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "subagent"
                      },
                      {
                        "type": "string",
                        "const": "acp"
                      },
                      {
                        "type": "string",
                        "const": "cli"
                      },
                      {
                        "type": "string",
                        "const": "cron"
                      }
                    ]
                  },
                  "runId": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendPrepareResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status",
            "reason",
            "retryAfterMs",
            "activeCount",
            "blockers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "busy"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "active-work"
                },
                {
                  "type": "string",
                  "const": "gateway-draining"
                }
              ]
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 0
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0
            },
            "blockers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "kind",
                  "count",
                  "message"
                ],
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "queue"
                      },
                      {
                        "type": "string",
                        "const": "reply"
                      },
                      {
                        "type": "string",
                        "const": "embedded-run"
                      },
                      {
                        "type": "string",
                        "const": "background-exec"
                      },
                      {
                        "type": "string",
                        "const": "cron-run"
                      },
                      {
                        "type": "string",
                        "const": "task"
                      },
                      {
                        "type": "string",
                        "const": "root-request"
                      },
                      {
                        "type": "string",
                        "const": "session-admission"
                      },
                      {
                        "type": "string",
                        "const": "session-mutation"
                      },
                      {
                        "type": "string",
                        "const": "chat-run"
                      },
                      {
                        "type": "string",
                        "const": "queued-turn"
                      },
                      {
                        "type": "string",
                        "const": "terminal-persistence"
                      },
                      {
                        "type": "string",
                        "const": "terminal-session"
                      }
                    ]
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "message": {
                    "type": "string"
                  },
                  "task": {
                    "type": "object",
                    "required": [
                      "taskId",
                      "status",
                      "runtime"
                    ],
                    "properties": {
                      "taskId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "const": "running"
                      },
                      "runtime": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "subagent"
                          },
                          {
                            "type": "string",
                            "const": "acp"
                          },
                          {
                            "type": "string",
                            "const": "cli"
                          },
                          {
                            "type": "string",
                            "const": "cron"
                          }
                        ]
                      },
                      "runId": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "suspensionId",
            "expiresAtMs",
            "activeCount",
            "blockers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "ready"
            },
            "suspensionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "\\S"
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "activeCount": {
              "type": "integer",
              "minimum": 0
            },
            "blockers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "kind",
                  "count",
                  "message"
                ],
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "queue"
                      },
                      {
                        "type": "string",
                        "const": "reply"
                      },
                      {
                        "type": "string",
                        "const": "embedded-run"
                      },
                      {
                        "type": "string",
                        "const": "background-exec"
                      },
                      {
                        "type": "string",
                        "const": "cron-run"
                      },
                      {
                        "type": "string",
                        "const": "task"
                      },
                      {
                        "type": "string",
                        "const": "root-request"
                      },
                      {
                        "type": "string",
                        "const": "session-admission"
                      },
                      {
                        "type": "string",
                        "const": "session-mutation"
                      },
                      {
                        "type": "string",
                        "const": "chat-run"
                      },
                      {
                        "type": "string",
                        "const": "queued-turn"
                      },
                      {
                        "type": "string",
                        "const": "terminal-persistence"
                      },
                      {
                        "type": "string",
                        "const": "terminal-session"
                      }
                    ]
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "message": {
                    "type": "string"
                  },
                  "task": {
                    "type": "object",
                    "required": [
                      "taskId",
                      "status",
                      "runtime"
                    ],
                    "properties": {
                      "taskId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "const": "running"
                      },
                      "runtime": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "subagent"
                          },
                          {
                            "type": "string",
                            "const": "acp"
                          },
                          {
                            "type": "string",
                            "const": "cli"
                          },
                          {
                            "type": "string",
                            "const": "cron"
                          }
                        ]
                      },
                      "runId": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "GatewaySuspendStatusParams": {
      "type": "object",
      "required": [
        "suspensionId"
      ],
      "properties": {
        "suspensionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "\\S"
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendStatusRunningResult": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "running"
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendStatusReadyResult": {
      "type": "object",
      "required": [
        "status",
        "expiresAtMs"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "ready"
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendStatusResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "running"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "expiresAtMs"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "ready"
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "GatewaySuspendResumeParams": {
      "type": "object",
      "required": [
        "suspensionId"
      ],
      "properties": {
        "suspensionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "\\S"
        }
      },
      "additionalProperties": false
    },
    "GatewaySuspendResumeResult": {
      "type": "object",
      "required": [
        "ok",
        "status",
        "resumed"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "status": {
          "type": "string",
          "const": "running"
        },
        "resumed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "EnvironmentStatus": {
      "type": "string",
      "enum": [
        "available",
        "unavailable",
        "starting",
        "stopping",
        "error"
      ]
    },
    "WorkerEnvironmentState": {
      "anyOf": [
        {
          "type": "string",
          "const": "requested"
        },
        {
          "type": "string",
          "const": "provisioning"
        },
        {
          "type": "string",
          "const": "bootstrapping"
        },
        {
          "type": "string",
          "const": "ready"
        },
        {
          "type": "string",
          "const": "attached"
        },
        {
          "type": "string",
          "const": "idle"
        },
        {
          "type": "string",
          "const": "draining"
        },
        {
          "type": "string",
          "const": "destroying"
        },
        {
          "type": "string",
          "const": "destroyed"
        },
        {
          "type": "string",
          "const": "failed"
        },
        {
          "type": "string",
          "const": "orphaned"
        }
      ]
    },
    "WorkerTunnelStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "stopped"
        },
        {
          "type": "string",
          "const": "connecting"
        },
        {
          "type": "string",
          "const": "connected"
        },
        {
          "type": "string",
          "const": "reconnecting"
        }
      ]
    },
    "WorkerEnvironmentMetadata": {
      "type": "object",
      "required": [
        "providerId",
        "state",
        "ageMs",
        "attachedSessionIds",
        "tunnelStatus"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "leaseId": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "requested"
            },
            {
              "type": "string",
              "const": "provisioning"
            },
            {
              "type": "string",
              "const": "bootstrapping"
            },
            {
              "type": "string",
              "const": "ready"
            },
            {
              "type": "string",
              "const": "attached"
            },
            {
              "type": "string",
              "const": "idle"
            },
            {
              "type": "string",
              "const": "draining"
            },
            {
              "type": "string",
              "const": "destroying"
            },
            {
              "type": "string",
              "const": "destroyed"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "orphaned"
            }
          ]
        },
        "ageMs": {
          "type": "integer",
          "minimum": 0
        },
        "idleMs": {
          "type": "integer",
          "minimum": 0
        },
        "attachedSessionIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "tunnelStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "stopped"
            },
            {
              "type": "string",
              "const": "connecting"
            },
            {
              "type": "string",
              "const": "connected"
            },
            {
              "type": "string",
              "const": "reconnecting"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "EnvironmentSummary": {
      "type": "object",
      "required": [
        "id",
        "type",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable",
            "starting",
            "stopping",
            "error"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "worker": {
          "type": "object",
          "required": [
            "providerId",
            "state",
            "ageMs",
            "attachedSessionIds",
            "tunnelStatus"
          ],
          "properties": {
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "leaseId": {
              "type": "string",
              "minLength": 1
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "requested"
                },
                {
                  "type": "string",
                  "const": "provisioning"
                },
                {
                  "type": "string",
                  "const": "bootstrapping"
                },
                {
                  "type": "string",
                  "const": "ready"
                },
                {
                  "type": "string",
                  "const": "attached"
                },
                {
                  "type": "string",
                  "const": "idle"
                },
                {
                  "type": "string",
                  "const": "draining"
                },
                {
                  "type": "string",
                  "const": "destroying"
                },
                {
                  "type": "string",
                  "const": "destroyed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "orphaned"
                }
              ]
            },
            "ageMs": {
              "type": "integer",
              "minimum": 0
            },
            "idleMs": {
              "type": "integer",
              "minimum": 0
            },
            "attachedSessionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tunnelStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "stopped"
                },
                {
                  "type": "string",
                  "const": "connecting"
                },
                {
                  "type": "string",
                  "const": "connected"
                },
                {
                  "type": "string",
                  "const": "reconnecting"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsCreateParams": {
      "type": "object",
      "required": [
        "profileId",
        "idempotencyKey"
      ],
      "properties": {
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsCreateResult": {
      "type": "object",
      "required": [
        "id",
        "type",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable",
            "starting",
            "stopping",
            "error"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "worker": {
          "type": "object",
          "required": [
            "providerId",
            "state",
            "ageMs",
            "attachedSessionIds",
            "tunnelStatus"
          ],
          "properties": {
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "leaseId": {
              "type": "string",
              "minLength": 1
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "requested"
                },
                {
                  "type": "string",
                  "const": "provisioning"
                },
                {
                  "type": "string",
                  "const": "bootstrapping"
                },
                {
                  "type": "string",
                  "const": "ready"
                },
                {
                  "type": "string",
                  "const": "attached"
                },
                {
                  "type": "string",
                  "const": "idle"
                },
                {
                  "type": "string",
                  "const": "draining"
                },
                {
                  "type": "string",
                  "const": "destroying"
                },
                {
                  "type": "string",
                  "const": "destroyed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "orphaned"
                }
              ]
            },
            "ageMs": {
              "type": "integer",
              "minimum": 0
            },
            "idleMs": {
              "type": "integer",
              "minimum": 0
            },
            "attachedSessionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tunnelStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "stopped"
                },
                {
                  "type": "string",
                  "const": "connecting"
                },
                {
                  "type": "string",
                  "const": "connected"
                },
                {
                  "type": "string",
                  "const": "reconnecting"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsDestroyParams": {
      "type": "object",
      "required": [
        "environmentId"
      ],
      "properties": {
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "force": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsDestroyResult": {
      "type": "object",
      "required": [
        "id",
        "type",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable",
            "starting",
            "stopping",
            "error"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "worker": {
          "type": "object",
          "required": [
            "providerId",
            "state",
            "ageMs",
            "attachedSessionIds",
            "tunnelStatus"
          ],
          "properties": {
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "leaseId": {
              "type": "string",
              "minLength": 1
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "requested"
                },
                {
                  "type": "string",
                  "const": "provisioning"
                },
                {
                  "type": "string",
                  "const": "bootstrapping"
                },
                {
                  "type": "string",
                  "const": "ready"
                },
                {
                  "type": "string",
                  "const": "attached"
                },
                {
                  "type": "string",
                  "const": "idle"
                },
                {
                  "type": "string",
                  "const": "draining"
                },
                {
                  "type": "string",
                  "const": "destroying"
                },
                {
                  "type": "string",
                  "const": "destroyed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "orphaned"
                }
              ]
            },
            "ageMs": {
              "type": "integer",
              "minimum": 0
            },
            "idleMs": {
              "type": "integer",
              "minimum": 0
            },
            "attachedSessionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tunnelStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "stopped"
                },
                {
                  "type": "string",
                  "const": "connecting"
                },
                {
                  "type": "string",
                  "const": "connected"
                },
                {
                  "type": "string",
                  "const": "reconnecting"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "EnvironmentsListResult": {
      "type": "object",
      "required": [
        "environments"
      ],
      "properties": {
        "environments": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "type": "string",
                "enum": [
                  "available",
                  "unavailable",
                  "starting",
                  "stopping",
                  "error"
                ]
              },
              "capabilities": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "worker": {
                "type": "object",
                "required": [
                  "providerId",
                  "state",
                  "ageMs",
                  "attachedSessionIds",
                  "tunnelStatus"
                ],
                "properties": {
                  "providerId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "leaseId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "requested"
                      },
                      {
                        "type": "string",
                        "const": "provisioning"
                      },
                      {
                        "type": "string",
                        "const": "bootstrapping"
                      },
                      {
                        "type": "string",
                        "const": "ready"
                      },
                      {
                        "type": "string",
                        "const": "attached"
                      },
                      {
                        "type": "string",
                        "const": "idle"
                      },
                      {
                        "type": "string",
                        "const": "draining"
                      },
                      {
                        "type": "string",
                        "const": "destroying"
                      },
                      {
                        "type": "string",
                        "const": "destroyed"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "orphaned"
                      }
                    ]
                  },
                  "ageMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "idleMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "attachedSessionIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "tunnelStatus": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "stopped"
                      },
                      {
                        "type": "string",
                        "const": "connecting"
                      },
                      {
                        "type": "string",
                        "const": "connected"
                      },
                      {
                        "type": "string",
                        "const": "reconnecting"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "profiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "providerId"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "providerId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsStatusParams": {
      "type": "object",
      "required": [
        "environmentId"
      ],
      "properties": {
        "environmentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "EnvironmentsStatusResult": {
      "type": "object",
      "required": [
        "id",
        "type",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "unavailable",
            "starting",
            "stopping",
            "error"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "worker": {
          "type": "object",
          "required": [
            "providerId",
            "state",
            "ageMs",
            "attachedSessionIds",
            "tunnelStatus"
          ],
          "properties": {
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "leaseId": {
              "type": "string",
              "minLength": 1
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "requested"
                },
                {
                  "type": "string",
                  "const": "provisioning"
                },
                {
                  "type": "string",
                  "const": "bootstrapping"
                },
                {
                  "type": "string",
                  "const": "ready"
                },
                {
                  "type": "string",
                  "const": "attached"
                },
                {
                  "type": "string",
                  "const": "idle"
                },
                {
                  "type": "string",
                  "const": "draining"
                },
                {
                  "type": "string",
                  "const": "destroying"
                },
                {
                  "type": "string",
                  "const": "destroyed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "orphaned"
                }
              ]
            },
            "ageMs": {
              "type": "integer",
              "minimum": 0
            },
            "idleMs": {
              "type": "integer",
              "minimum": 0
            },
            "attachedSessionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tunnelStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "stopped"
                },
                {
                  "type": "string",
                  "const": "connecting"
                },
                {
                  "type": "string",
                  "const": "connected"
                },
                {
                  "type": "string",
                  "const": "reconnecting"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SystemInfoParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SystemInfoResult": {
      "type": "object",
      "required": [
        "machineName",
        "hostname",
        "platform",
        "release",
        "arch",
        "osLabel",
        "nodeVersion",
        "pid",
        "uptimeMs",
        "cpuCount",
        "memoryTotalBytes",
        "memoryFreeBytes"
      ],
      "properties": {
        "machineName": {
          "type": "string"
        },
        "hostname": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "release": {
          "type": "string"
        },
        "arch": {
          "type": "string"
        },
        "osLabel": {
          "type": "string"
        },
        "lanAddress": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        },
        "nodeVersion": {
          "type": "string"
        },
        "pid": {
          "type": "integer"
        },
        "processInstanceId": {
          "type": "string",
          "minLength": 1
        },
        "uptimeMs": {
          "type": "integer"
        },
        "cpuCount": {
          "type": "integer"
        },
        "cpuModel": {
          "type": "string"
        },
        "loadAverage": {
          "type": "array",
          "additionalItems": false,
          "items": [
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ],
          "minItems": 3
        },
        "memoryTotalBytes": {
          "type": "integer"
        },
        "memoryFreeBytes": {
          "type": "integer"
        },
        "diskTotalBytes": {
          "type": "integer"
        },
        "diskAvailableBytes": {
          "type": "integer"
        },
        "diskPath": {
          "type": "string"
        },
        "defaultAgentUtilityModel": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "model"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "auto"
                },
                "model": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status",
                "model"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "configured"
                },
                "model": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "disabled"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "unavailable"
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "AgentEvent": {
      "type": "object",
      "required": [
        "runId",
        "seq",
        "stream",
        "ts",
        "data"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "stream": {
          "type": "string",
          "minLength": 1
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "isHeartbeat": {
          "type": "boolean"
        },
        "data": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        }
      },
      "additionalProperties": false
    },
    "ConversationSendParams": {
      "type": "object",
      "required": [
        "agentId",
        "operationId",
        "conversationRef",
        "message"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceSessionKey": {
          "type": "string",
          "minLength": 1
        },
        "operationId": {
          "type": "string",
          "minLength": 1
        },
        "conversationRef": {
          "type": "string",
          "pattern": "^conv_[a-f0-9]{32}$"
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConversationSendResult": {
      "type": "object",
      "required": [
        "status",
        "conversationRef",
        "channel"
      ],
      "properties": {
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "sent"
            },
            {
              "type": "string",
              "const": "queued"
            },
            {
              "type": "string",
              "const": "suppressed"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "conversationRef": {
          "type": "string",
          "pattern": "^conv_[a-f0-9]{32}$"
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "queueId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConversationListItem": {
      "type": "object",
      "required": [
        "conversationRef",
        "channel",
        "accountId",
        "kind",
        "target",
        "firstSeenAt",
        "lastSeenAt"
      ],
      "properties": {
        "conversationRef": {
          "type": "string",
          "pattern": "^conv_[a-f0-9]{32}$"
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "direct"
            },
            {
              "type": "string",
              "const": "group"
            },
            {
              "type": "string",
              "const": "channel"
            }
          ]
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "firstSeenAt": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ConversationListParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "query": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "additionalProperties": false
    },
    "ConversationListResult": {
      "type": "object",
      "required": [
        "conversations"
      ],
      "properties": {
        "conversations": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "conversationRef",
              "channel",
              "accountId",
              "kind",
              "target",
              "firstSeenAt",
              "lastSeenAt"
            ],
            "properties": {
              "conversationRef": {
                "type": "string",
                "pattern": "^conv_[a-f0-9]{32}$"
              },
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "direct"
                  },
                  {
                    "type": "string",
                    "const": "group"
                  },
                  {
                    "type": "string",
                    "const": "channel"
                  }
                ]
              },
              "target": {
                "type": "string",
                "minLength": 1
              },
              "threadId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "firstSeenAt": {
                "type": "integer",
                "minimum": 0
              },
              "lastSeenAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ConversationTurnCancelParams": {
      "type": "object",
      "required": [
        "agentId",
        "turnId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConversationTurnCancelResult": {
      "type": "object",
      "required": [
        "cancelled"
      ],
      "properties": {
        "cancelled": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ConversationTurnParams": {
      "type": "object",
      "required": [
        "agentId",
        "turnId",
        "conversationRef",
        "message",
        "timeoutMs"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceSessionKey": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string",
          "minLength": 1
        },
        "conversationRef": {
          "type": "string",
          "pattern": "^conv_[a-f0-9]{32}$"
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300000
        }
      },
      "additionalProperties": false
    },
    "ConversationTurnReply": {
      "type": "object",
      "required": [
        "conversationRef",
        "messageId",
        "text",
        "timestamp"
      ],
      "properties": {
        "conversationRef": {
          "type": "string",
          "pattern": "^conv_[a-f0-9]{32}$"
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "replyToId": {
          "type": "string",
          "minLength": 1
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string"
        },
        "timestamp": {
          "type": "integer",
          "minimum": 0
        },
        "transcriptArtifactId": {
          "type": "string",
          "minLength": 1
        },
        "transcriptMessageId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConversationTurnResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "conversationRef",
            "channel",
            "messageId",
            "correlationPersisted",
            "status",
            "reply"
          ],
          "properties": {
            "conversationRef": {
              "type": "string",
              "pattern": "^conv_[a-f0-9]{32}$"
            },
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "messageId": {
              "type": "string",
              "minLength": 1
            },
            "correlationPersisted": {
              "type": "boolean"
            },
            "status": {
              "type": "string",
              "const": "replied"
            },
            "reply": {
              "type": "object",
              "required": [
                "conversationRef",
                "messageId",
                "text",
                "timestamp"
              ],
              "properties": {
                "conversationRef": {
                  "type": "string",
                  "pattern": "^conv_[a-f0-9]{32}$"
                },
                "messageId": {
                  "type": "string",
                  "minLength": 1
                },
                "replyToId": {
                  "type": "string",
                  "minLength": 1
                },
                "threadId": {
                  "type": "string",
                  "minLength": 1
                },
                "text": {
                  "type": "string"
                },
                "timestamp": {
                  "type": "integer",
                  "minimum": 0
                },
                "transcriptArtifactId": {
                  "type": "string",
                  "minLength": 1
                },
                "transcriptMessageId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "conversationRef",
            "channel",
            "messageId",
            "correlationPersisted",
            "status"
          ],
          "properties": {
            "conversationRef": {
              "type": "string",
              "pattern": "^conv_[a-f0-9]{32}$"
            },
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "messageId": {
              "type": "string",
              "minLength": 1
            },
            "correlationPersisted": {
              "type": "boolean"
            },
            "status": {
              "type": "string",
              "const": "timeout"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "conversationRef",
            "channel",
            "correlationPersisted",
            "status",
            "error"
          ],
          "properties": {
            "conversationRef": {
              "type": "string",
              "pattern": "^conv_[a-f0-9]{32}$"
            },
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "messageId": {
              "type": "string",
              "minLength": 1
            },
            "correlationPersisted": {
              "type": "boolean"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "sent"
                },
                {
                  "type": "string",
                  "const": "queued"
                },
                {
                  "type": "string",
                  "const": "suppressed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "MessageActionParams": {
      "type": "object",
      "required": [
        "channel",
        "action",
        "params",
        "idempotencyKey"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "action": {
          "type": "string",
          "minLength": 1
        },
        "params": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "accountId": {
          "type": "string"
        },
        "requesterAccountId": {
          "type": "string"
        },
        "requesterSenderId": {
          "type": "string"
        },
        "senderIsOwner": {
          "type": "boolean"
        },
        "sessionKey": {
          "type": "string"
        },
        "sessionId": {
          "type": "string"
        },
        "inboundTurnKind": {
          "type": "string",
          "enum": [
            "user_request",
            "room_event"
          ]
        },
        "agentId": {
          "type": "string"
        },
        "toolContext": {
          "type": "object",
          "properties": {
            "currentChannelId": {
              "type": "string"
            },
            "currentMessagingTarget": {
              "type": "string"
            },
            "currentGraphChannelId": {
              "type": "string"
            },
            "currentChannelProvider": {
              "type": "string"
            },
            "currentThreadTs": {
              "type": "string"
            },
            "currentMessageId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            },
            "replyToMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "off"
                },
                {
                  "type": "string",
                  "const": "first"
                },
                {
                  "type": "string",
                  "const": "all"
                },
                {
                  "type": "string",
                  "const": "batched"
                }
              ]
            },
            "hasRepliedRef": {
              "type": "object",
              "required": [
                "value"
              ],
              "properties": {
                "value": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "sameChannelThreadRequired": {
              "type": "boolean"
            },
            "skipCrossContextDecoration": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "conversationReadOrigin": {
          "type": "string",
          "const": "direct-operator"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SendParams": {
      "type": "object",
      "required": [
        "to",
        "idempotencyKey"
      ],
      "properties": {
        "to": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "mediaUrl": {
          "type": "string"
        },
        "mediaUrls": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "buffer": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "contentType": {
          "type": "string"
        },
        "asVoice": {
          "type": "boolean"
        },
        "gifPlayback": {
          "type": "boolean"
        },
        "channel": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "replyToId": {
          "type": "string"
        },
        "threadId": {
          "type": "string"
        },
        "forceDocument": {
          "type": "boolean"
        },
        "silent": {
          "type": "boolean"
        },
        "parseMode": {
          "type": "string",
          "const": "HTML"
        },
        "sessionKey": {
          "type": "string"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PollParams": {
      "type": "object",
      "required": [
        "to",
        "question",
        "options",
        "idempotencyKey"
      ],
      "properties": {
        "to": {
          "type": "string",
          "minLength": 1
        },
        "question": {
          "type": "string",
          "minLength": 1
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 2,
          "maxItems": 12
        },
        "maxSelections": {
          "type": "integer",
          "minimum": 1,
          "maximum": 12
        },
        "durationSeconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 604800
        },
        "durationHours": {
          "type": "integer",
          "minimum": 1
        },
        "silent": {
          "type": "boolean"
        },
        "isAnonymous": {
          "type": "boolean"
        },
        "threadId": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentParams": {
      "type": "object",
      "required": [
        "message",
        "idempotencyKey"
      ],
      "properties": {
        "message": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "replyTo": {
          "type": "string"
        },
        "sessionId": {
          "type": "string"
        },
        "sessionKey": {
          "type": "string"
        },
        "expectedExistingSessionId": {
          "type": "string",
          "minLength": 1
        },
        "thinking": {
          "type": "string"
        },
        "deliver": {
          "type": "boolean"
        },
        "attachments": {
          "type": "array",
          "items": {}
        },
        "channel": {
          "type": "string"
        },
        "replyChannel": {
          "type": "string"
        },
        "accountId": {
          "type": "string"
        },
        "replyAccountId": {
          "type": "string"
        },
        "threadId": {
          "type": "string"
        },
        "groupId": {
          "type": "string"
        },
        "groupChannel": {
          "type": "string"
        },
        "groupSpace": {
          "type": "string"
        },
        "timeout": {
          "type": "integer",
          "minimum": 0
        },
        "bestEffortDeliver": {
          "type": "boolean"
        },
        "lane": {
          "type": "string"
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "cleanupBundleMcpOnRunEnd": {
          "type": "boolean"
        },
        "modelRun": {
          "type": "boolean"
        },
        "promptMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "minimal"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "extraSystemPrompt": {
          "type": "string"
        },
        "bootstrapContextMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "lightweight"
            }
          ]
        },
        "bootstrapContextRunKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "default"
            },
            {
              "type": "string",
              "const": "heartbeat"
            },
            {
              "type": "string",
              "const": "cron"
            }
          ]
        },
        "acpTurnSource": {
          "type": "string",
          "const": "manual_spawn"
        },
        "internalRuntimeHandoffId": {
          "type": "string",
          "minLength": 1
        },
        "execApprovalFollowupExpectedSessionId": {
          "type": "string",
          "minLength": 1
        },
        "internalEvents": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "type",
              "source",
              "childSessionKey",
              "announceType",
              "taskLabel",
              "status",
              "statusLabel",
              "result",
              "replyInstruction"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "task_completion"
              },
              "source": {
                "type": "string",
                "enum": [
                  "subagent",
                  "cron",
                  "image_generation",
                  "video_generation",
                  "music_generation"
                ]
              },
              "childSessionKey": {
                "type": "string"
              },
              "childSessionId": {
                "type": "string"
              },
              "announceType": {
                "type": "string"
              },
              "taskLabel": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "ok",
                  "timeout",
                  "error",
                  "unknown"
                ]
              },
              "statusLabel": {
                "type": "string"
              },
              "result": {
                "type": "string"
              },
              "attachments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "image",
                        "audio",
                        "video",
                        "file"
                      ]
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "mediaUrl": {
                      "type": "string"
                    },
                    "filePath": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "mediaUrls": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "statsLine": {
                "type": "string"
              },
              "replyInstruction": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "inputProvenance": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "external_user",
                "inter_session",
                "internal_system"
              ]
            },
            "originSessionId": {
              "type": "string"
            },
            "sourceSessionKey": {
              "type": "string"
            },
            "sourceChannel": {
              "type": "string"
            },
            "sourceTool": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "suppressPromptPersistence": {
          "type": "boolean"
        },
        "sessionEffects": {
          "anyOf": [
            {
              "type": "string",
              "const": "visible"
            },
            {
              "type": "string",
              "const": "internal"
            }
          ]
        },
        "sourceReplyDeliveryMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "automatic"
            },
            {
              "type": "string",
              "const": "message_tool_only"
            }
          ]
        },
        "disableMessageTool": {
          "type": "boolean"
        },
        "swarmCollector": {
          "type": "boolean"
        },
        "swarmOutputSchema": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "forceRestartSafeTools": {
          "type": "boolean"
        },
        "voiceWakeTrigger": {
          "type": "string"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "AgentIdentityParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentIdentityResult": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "avatar": {
          "type": "string",
          "minLength": 1
        },
        "avatarSource": {
          "type": "string",
          "minLength": 1
        },
        "avatarStatus": {
          "type": "string",
          "enum": [
            "none",
            "local",
            "remote",
            "data"
          ]
        },
        "avatarReason": {
          "type": "string",
          "minLength": 1
        },
        "emoji": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentWaitParams": {
      "type": "object",
      "required": [
        "runId"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "WakeParams": {
      "type": "object",
      "required": [
        "mode",
        "text"
      ],
      "properties": {
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "now"
            },
            {
              "type": "string",
              "const": "next-heartbeat"
            }
          ]
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    },
    "WorktreeRecord": {
      "type": "object",
      "required": [
        "id",
        "name",
        "repoFingerprint",
        "repoRoot",
        "path",
        "branch",
        "baseRef",
        "ownerKind",
        "createdAt",
        "lastActiveAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
        },
        "repoFingerprint": {
          "type": "string",
          "pattern": "^[a-f0-9]{16}$"
        },
        "repoRoot": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "branch": {
          "type": "string",
          "minLength": 1
        },
        "baseRef": {
          "type": "string",
          "minLength": 1
        },
        "ownerKind": {
          "type": "string",
          "enum": [
            "manual",
            "workboard",
            "session"
          ]
        },
        "ownerId": {
          "type": "string",
          "minLength": 1
        },
        "snapshotRef": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "lastActiveAt": {
          "type": "integer",
          "minimum": 0
        },
        "removedAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "WorktreesListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "WorktreesListResult": {
      "type": "object",
      "required": [
        "worktrees"
      ],
      "properties": {
        "worktrees": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "repoFingerprint",
              "repoRoot",
              "path",
              "branch",
              "baseRef",
              "ownerKind",
              "createdAt",
              "lastActiveAt"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
              },
              "repoFingerprint": {
                "type": "string",
                "pattern": "^[a-f0-9]{16}$"
              },
              "repoRoot": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "minLength": 1
              },
              "branch": {
                "type": "string",
                "minLength": 1
              },
              "baseRef": {
                "type": "string",
                "minLength": 1
              },
              "ownerKind": {
                "type": "string",
                "enum": [
                  "manual",
                  "workboard",
                  "session"
                ]
              },
              "ownerId": {
                "type": "string",
                "minLength": 1
              },
              "snapshotRef": {
                "type": "string",
                "minLength": 1
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              },
              "lastActiveAt": {
                "type": "integer",
                "minimum": 0
              },
              "removedAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "WorktreesCreateParams": {
      "type": "object",
      "required": [
        "repoRoot"
      ],
      "properties": {
        "repoRoot": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
        },
        "baseRef": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WorktreesRemoveParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "force": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "WorktreesRemoveResult": {
      "type": "object",
      "required": [
        "removed"
      ],
      "properties": {
        "removed": {
          "type": "boolean"
        },
        "snapshotRef": {
          "type": "string",
          "minLength": 1
        },
        "snapshotError": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WorktreesRestoreParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WorktreesGcParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "WorktreesGcResult": {
      "type": "object",
      "required": [
        "removed",
        "orphansDeleted",
        "snapshotsPruned"
      ],
      "properties": {
        "removed": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "orphansDeleted": {
          "type": "integer",
          "minimum": 0
        },
        "snapshotsPruned": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "WorktreeBranch": {
      "type": "object",
      "required": [
        "name",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "local"
            },
            {
              "type": "string",
              "const": "remote"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "WorktreeRepositoryStatus": {
      "type": "string",
      "enum": [
        "git",
        "not_git",
        "unavailable"
      ]
    },
    "WorktreesBranchesParams": {
      "type": "object",
      "required": [
        "repoRoot"
      ],
      "properties": {
        "repoRoot": {
          "type": "string",
          "minLength": 1
        },
        "includeRepositoryStatus": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "WorktreesBranchesResult": {
      "type": "object",
      "required": [
        "branches"
      ],
      "properties": {
        "branches": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "kind"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "local"
                  },
                  {
                    "type": "string",
                    "const": "remote"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "defaultBranch": {
          "type": "string",
          "minLength": 1
        },
        "headBranch": {
          "type": "string",
          "minLength": 1
        },
        "repositoryStatus": {
          "type": "string",
          "enum": [
            "git",
            "not_git",
            "unavailable"
          ]
        }
      },
      "additionalProperties": false
    },
    "FsDirEntry": {
      "type": "object",
      "required": [
        "name",
        "path"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "hidden": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "FsListDirParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "FsListDirResult": {
      "type": "object",
      "required": [
        "path",
        "home",
        "entries"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "parent": {
          "type": "string",
          "minLength": 1
        },
        "home": {
          "type": "string",
          "minLength": 1
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "path"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "minLength": 1
              },
              "hidden": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "NodePairListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "NodePairApproveParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodePairRejectParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodePairRemoveParams": {
      "type": "object",
      "required": [
        "nodeId"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodeRenameParams": {
      "type": "object",
      "required": [
        "nodeId",
        "displayName"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodeListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "NodePluginToolDescriptor": {
      "type": "object",
      "required": [
        "pluginId",
        "name",
        "description"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "parameters": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "mcp": {
          "type": "object",
          "required": [
            "server",
            "tool"
          ],
          "properties": {
            "server": {
              "type": "string",
              "minLength": 1
            },
            "tool": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "NodePluginToolsUpdateParams": {
      "type": "object",
      "required": [
        "tools"
      ],
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pluginId",
              "name",
              "description"
            ],
            "properties": {
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "parameters": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {}
                }
              },
              "command": {
                "type": "string",
                "minLength": 1
              },
              "mcp": {
                "type": "object",
                "required": [
                  "server",
                  "tool"
                ],
                "properties": {
                  "server": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tool": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "NodeSkillDescriptor": {
      "type": "object",
      "required": [
        "name",
        "description",
        "content"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^(?!.*--)[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 65536
        }
      },
      "additionalProperties": false
    },
    "NodeSkillsUpdateParams": {
      "type": "object",
      "required": [
        "skills"
      ],
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "description",
              "content"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^(?!.*--)[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "content": {
                "type": "string",
                "minLength": 1,
                "maxLength": 65536
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        }
      },
      "additionalProperties": false
    },
    "NodePendingAckParams": {
      "type": "object",
      "required": [
        "ids"
      ],
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        }
      },
      "additionalProperties": false
    },
    "NodeDescribeParams": {
      "type": "object",
      "required": [
        "nodeId"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodeInvokeParams": {
      "type": "object",
      "required": [
        "nodeId",
        "command",
        "idempotencyKey"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "params": {},
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "turnSourceChannel": {
          "type": "string"
        },
        "turnSourceTo": {
          "type": "string"
        },
        "turnSourceAccountId": {
          "type": "string"
        },
        "turnSourceThreadId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "NodeInvokeInputEvent": {
      "type": "object",
      "required": [
        "id",
        "nodeId",
        "seq",
        "payloadJSON"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "payloadJSON": {
          "type": "string",
          "maxLength": 16384
        }
      },
      "additionalProperties": false
    },
    "NodeInvokeProgressParams": {
      "type": "object",
      "required": [
        "invokeId",
        "nodeId",
        "seq",
        "chunk"
      ],
      "properties": {
        "invokeId": {
          "type": "string",
          "minLength": 1
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "chunk": {
          "type": "string",
          "maxLength": 16384
        }
      },
      "additionalProperties": false
    },
    "NodeInvokeResultParams": {
      "type": "object",
      "required": [
        "id",
        "nodeId",
        "ok"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "ok": {
          "type": "boolean"
        },
        "payload": {},
        "payloadJSON": {
          "type": "string"
        },
        "error": {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "NodeInvokeRequestEvent": {
      "type": "object",
      "required": [
        "id",
        "nodeId",
        "command"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "paramsJSON": {
          "type": "string"
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodeEventParams": {
      "type": "object",
      "required": [
        "event"
      ],
      "properties": {
        "event": {
          "type": "string",
          "minLength": 1
        },
        "payload": {},
        "payloadJSON": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "NodeEventResult": {
      "type": "object",
      "required": [
        "ok",
        "event",
        "handled"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "event": {
          "type": "string",
          "minLength": 1
        },
        "handled": {
          "type": "boolean"
        },
        "reason": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodePresenceAlivePayload": {
      "type": "object",
      "required": [
        "trigger"
      ],
      "properties": {
        "trigger": {
          "type": "string",
          "enum": [
            "background",
            "silent_push",
            "bg_app_refresh",
            "significant_location",
            "manual",
            "connect"
          ]
        },
        "sentAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "deviceFamily": {
          "type": "string",
          "minLength": 1
        },
        "modelIdentifier": {
          "type": "string",
          "minLength": 1
        },
        "pushTransport": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "NodePresenceAliveReason": {
      "type": "string",
      "enum": [
        "background",
        "silent_push",
        "bg_app_refresh",
        "significant_location",
        "manual",
        "connect"
      ]
    },
    "NodePresenceActivityPayload": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "idleSeconds"
          ],
          "properties": {
            "idleSeconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2592000
            },
            "saturated": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "action"
          ],
          "properties": {
            "action": {
              "type": "string",
              "const": "clear"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "NodePendingDrainParams": {
      "type": "object",
      "properties": {
        "maxItems": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        }
      },
      "additionalProperties": false
    },
    "NodePendingDrainResult": {
      "type": "object",
      "required": [
        "nodeId",
        "revision",
        "items",
        "hasMore"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "priority",
              "createdAtMs"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "enum": [
                  "status.request",
                  "location.request"
                ]
              },
              "priority": {
                "type": "string",
                "enum": [
                  "default",
                  "normal",
                  "high"
                ]
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAtMs": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "payload": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {}
                }
              }
            },
            "additionalProperties": false
          }
        },
        "hasMore": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "NodePendingEnqueueParams": {
      "type": "object",
      "required": [
        "nodeId",
        "type"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "enum": [
            "status.request",
            "location.request"
          ]
        },
        "priority": {
          "type": "string",
          "enum": [
            "normal",
            "high"
          ]
        },
        "expiresInMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 86400000
        },
        "wake": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "NodePendingEnqueueResult": {
      "type": "object",
      "required": [
        "nodeId",
        "revision",
        "queued",
        "wakeTriggered"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 0
        },
        "queued": {
          "type": "object",
          "required": [
            "id",
            "type",
            "priority",
            "createdAtMs"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "enum": [
                "status.request",
                "location.request"
              ]
            },
            "priority": {
              "type": "string",
              "enum": [
                "default",
                "normal",
                "high"
              ]
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "payload": {
              "type": "object",
              "patternProperties": {
                "^.*$": {}
              }
            }
          },
          "additionalProperties": false
        },
        "wakeTriggered": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PushTestParams": {
      "type": "object",
      "required": [
        "nodeId"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string"
        },
        "body": {
          "type": "string"
        },
        "environment": {
          "type": "string",
          "enum": [
            "sandbox",
            "production"
          ]
        }
      },
      "additionalProperties": false
    },
    "PushTestResult": {
      "type": "object",
      "required": [
        "ok",
        "status",
        "tokenSuffix",
        "topic",
        "environment",
        "transport"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "status": {
          "type": "integer"
        },
        "apnsId": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "tokenSuffix": {
          "type": "string"
        },
        "topic": {
          "type": "string"
        },
        "environment": {
          "type": "string",
          "enum": [
            "sandbox",
            "production"
          ]
        },
        "transport": {
          "type": "string",
          "enum": [
            "direct",
            "relay"
          ]
        }
      },
      "additionalProperties": false
    },
    "UiSplitCommand": {
      "type": "object",
      "required": [
        "kind",
        "direction",
        "sessionKey"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "split"
        },
        "direction": {
          "anyOf": [
            {
              "type": "string",
              "const": "right"
            },
            {
              "type": "string",
              "const": "down"
            }
          ]
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiClosePaneCommand": {
      "type": "object",
      "required": [
        "kind",
        "sessionKey"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "close-pane"
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiFocusCommand": {
      "type": "object",
      "required": [
        "kind",
        "sessionKey"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "focus"
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiSidebarCommand": {
      "type": "object",
      "required": [
        "kind",
        "visible"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "sidebar"
        },
        "visible": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "UiPanelCommand": {
      "type": "object",
      "required": [
        "kind",
        "panel",
        "open"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "panel"
        },
        "panel": {
          "anyOf": [
            {
              "type": "string",
              "const": "terminal"
            },
            {
              "type": "string",
              "const": "browser"
            }
          ]
        },
        "open": {
          "type": "boolean"
        },
        "dock": {
          "anyOf": [
            {
              "type": "string",
              "const": "bottom"
            },
            {
              "type": "string",
              "const": "right"
            }
          ]
        },
        "terminalSessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiNavigateCommand": {
      "type": "object",
      "required": [
        "kind",
        "sessionKey"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "navigate"
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiCommand": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "direction",
            "sessionKey"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "split"
            },
            "direction": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "right"
                },
                {
                  "type": "string",
                  "const": "down"
                }
              ]
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "sessionKey"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "close-pane"
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "sessionKey"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "focus"
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "visible"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "sidebar"
            },
            "visible": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "panel",
            "open"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "panel"
            },
            "panel": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "terminal"
                },
                {
                  "type": "string",
                  "const": "browser"
                }
              ]
            },
            "open": {
              "type": "boolean"
            },
            "dock": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "bottom"
                },
                {
                  "type": "string",
                  "const": "right"
                }
              ]
            },
            "terminalSessionId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "sessionKey"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "navigate"
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "UiCommandParams": {
      "type": "object",
      "required": [
        "command"
      ],
      "properties": {
        "command": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "direction",
                "sessionKey"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "split"
                },
                "direction": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "right"
                    },
                    {
                      "type": "string",
                      "const": "down"
                    }
                  ]
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "sessionKey"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "close-pane"
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "sessionKey"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "focus"
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "visible"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "sidebar"
                },
                "visible": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "panel",
                "open"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "panel"
                },
                "panel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "terminal"
                    },
                    {
                      "type": "string",
                      "const": "browser"
                    }
                  ]
                },
                "open": {
                  "type": "boolean"
                },
                "dock": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "bottom"
                    },
                    {
                      "type": "string",
                      "const": "right"
                    }
                  ]
                },
                "terminalSessionId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "sessionKey"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "navigate"
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiCommandResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SecretsReloadParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SecretsResolveParams": {
      "type": "object",
      "required": [
        "commandName",
        "targetIds"
      ],
      "properties": {
        "commandName": {
          "type": "string",
          "minLength": 1
        },
        "targetIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "allowedPaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "forcedActivePaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "optionalActivePaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "providerOverrides": {
          "type": "object",
          "properties": {
            "webSearch": {
              "type": "string",
              "minLength": 1
            },
            "webFetch": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SecretsResolveAssignment": {
      "type": "object",
      "required": [
        "pathSegments",
        "value"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "pathSegments": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "value": {}
      },
      "additionalProperties": false
    },
    "SecretsResolveResult": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "assignments": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pathSegments",
              "value"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "pathSegments": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "value": {}
            },
            "additionalProperties": false
          }
        },
        "diagnostics": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "inactiveRefPaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsListParams": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "activeMinutes": {
          "type": "integer",
          "minimum": 1
        },
        "requireLastInteraction": {
          "type": "boolean"
        },
        "sortBy": {
          "anyOf": [
            {
              "type": "string",
              "const": "updatedAt"
            },
            {
              "type": "string",
              "const": "lastInteractionAt"
            }
          ]
        },
        "includeGlobal": {
          "type": "boolean"
        },
        "includeUnknown": {
          "type": "boolean"
        },
        "configuredAgentsOnly": {
          "type": "boolean"
        },
        "includeDerivedTitles": {
          "type": "boolean"
        },
        "includeLastMessage": {
          "type": "boolean"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "creatorId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "search": {
          "type": "string"
        },
        "archived": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "all"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogCapabilities": {
      "type": "object",
      "required": [
        "continueSession",
        "archive"
      ],
      "properties": {
        "continueSession": {
          "type": "boolean"
        },
        "archive": {
          "type": "boolean"
        },
        "createSession": {
          "type": "object",
          "required": [
            "model"
          ],
          "properties": {
            "model": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "openTerminal": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogDescriptor": {
      "type": "object",
      "required": [
        "id",
        "label",
        "capabilities"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "capabilities": {
          "type": "object",
          "required": [
            "continueSession",
            "archive"
          ],
          "properties": {
            "continueSession": {
              "type": "boolean"
            },
            "archive": {
              "type": "boolean"
            },
            "createSession": {
              "type": "object",
              "required": [
                "model"
              ],
              "properties": {
                "model": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "openTerminal": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogPullRequestSummary": {
      "type": "object",
      "required": [
        "numbers",
        "state"
      ],
      "properties": {
        "numbers": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1
          },
          "minItems": 1,
          "maxItems": 20,
          "uniqueItems": true
        },
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "open"
            },
            {
              "type": "string",
              "const": "draft"
            },
            {
              "type": "string",
              "const": "merged"
            },
            {
              "type": "string",
              "const": "closed"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogSession": {
      "type": "object",
      "required": [
        "threadId",
        "status",
        "archived",
        "canContinue",
        "canArchive"
      ],
      "properties": {
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string"
        },
        "cwd": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "number"
        },
        "updatedAt": {
          "type": "number"
        },
        "recencyAt": {
          "type": "number"
        },
        "source": {
          "type": "string"
        },
        "modelProvider": {
          "type": "string"
        },
        "cliVersion": {
          "type": "string"
        },
        "gitBranch": {
          "type": "string"
        },
        "customGroup": {
          "type": "string"
        },
        "pullRequest": {
          "type": "object",
          "required": [
            "numbers",
            "state"
          ],
          "properties": {
            "numbers": {
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 1
              },
              "minItems": 1,
              "maxItems": 20,
              "uniqueItems": true
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "open"
                },
                {
                  "type": "string",
                  "const": "draft"
                },
                {
                  "type": "string",
                  "const": "merged"
                },
                {
                  "type": "string",
                  "const": "closed"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "archived": {
          "type": "boolean"
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "createdActor": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "canContinue": {
          "type": "boolean"
        },
        "canArchive": {
          "type": "boolean"
        },
        "canOpenTerminal": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogHost": {
      "type": "object",
      "required": [
        "hostId",
        "label",
        "kind",
        "connected",
        "sessions"
      ],
      "properties": {
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "gateway"
            },
            {
              "type": "string",
              "const": "node"
            }
          ]
        },
        "connected": {
          "type": "boolean"
        },
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "threadId",
              "status",
              "archived",
              "canContinue",
              "canArchive"
            ],
            "properties": {
              "threadId": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string"
              },
              "cwd": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "minLength": 1
              },
              "createdAt": {
                "type": "number"
              },
              "updatedAt": {
                "type": "number"
              },
              "recencyAt": {
                "type": "number"
              },
              "source": {
                "type": "string"
              },
              "modelProvider": {
                "type": "string"
              },
              "cliVersion": {
                "type": "string"
              },
              "gitBranch": {
                "type": "string"
              },
              "customGroup": {
                "type": "string"
              },
              "pullRequest": {
                "type": "object",
                "required": [
                  "numbers",
                  "state"
                ],
                "properties": {
                  "numbers": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "minItems": 1,
                    "maxItems": 20,
                    "uniqueItems": true
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "open"
                      },
                      {
                        "type": "string",
                        "const": "draft"
                      },
                      {
                        "type": "string",
                        "const": "merged"
                      },
                      {
                        "type": "string",
                        "const": "closed"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "archived": {
                "type": "boolean"
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "createdActor": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "human"
                      },
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "system"
                      }
                    ]
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "canContinue": {
                "type": "boolean"
              },
              "canArchive": {
                "type": "boolean"
              },
              "canOpenTerminal": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "nextCursor": {
          "type": "string"
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionCatalog": {
      "type": "object",
      "required": [
        "id",
        "label",
        "capabilities",
        "hosts"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "capabilities": {
          "type": "object",
          "required": [
            "continueSession",
            "archive"
          ],
          "properties": {
            "continueSession": {
              "type": "boolean"
            },
            "archive": {
              "type": "boolean"
            },
            "createSession": {
              "type": "object",
              "required": [
                "model"
              ],
              "properties": {
                "model": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "openTerminal": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "hosts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "hostId",
              "label",
              "kind",
              "connected",
              "sessions"
            ],
            "properties": {
              "hostId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "gateway"
                  },
                  {
                    "type": "string",
                    "const": "node"
                  }
                ]
              },
              "connected": {
                "type": "boolean"
              },
              "nodeId": {
                "type": "string",
                "minLength": 1
              },
              "sessions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "threadId",
                    "status",
                    "archived",
                    "canContinue",
                    "canArchive"
                  ],
                  "properties": {
                    "threadId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "name": {
                      "type": "string"
                    },
                    "cwd": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "updatedAt": {
                      "type": "number"
                    },
                    "recencyAt": {
                      "type": "number"
                    },
                    "source": {
                      "type": "string"
                    },
                    "modelProvider": {
                      "type": "string"
                    },
                    "cliVersion": {
                      "type": "string"
                    },
                    "gitBranch": {
                      "type": "string"
                    },
                    "customGroup": {
                      "type": "string"
                    },
                    "pullRequest": {
                      "type": "object",
                      "required": [
                        "numbers",
                        "state"
                      ],
                      "properties": {
                        "numbers": {
                          "type": "array",
                          "items": {
                            "type": "integer",
                            "minimum": 1
                          },
                          "minItems": 1,
                          "maxItems": 20,
                          "uniqueItems": true
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "open"
                            },
                            {
                              "type": "string",
                              "const": "draft"
                            },
                            {
                              "type": "string",
                              "const": "merged"
                            },
                            {
                              "type": "string",
                              "const": "closed"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "archived": {
                      "type": "boolean"
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdActor": {
                      "type": "object",
                      "required": [
                        "type"
                      ],
                      "properties": {
                        "type": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "canContinue": {
                      "type": "boolean"
                    },
                    "canArchive": {
                      "type": "boolean"
                    },
                    "canOpenTerminal": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "nextCursor": {
                "type": "string"
              },
              "error": {
                "type": "object",
                "required": [
                  "code",
                  "message"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionCatalogTranscriptItem": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "anyOf": [
            {
              "type": "string",
              "const": "userMessage"
            },
            {
              "type": "string",
              "const": "agentMessage"
            },
            {
              "type": "string",
              "const": "reasoning"
            },
            {
              "type": "string",
              "const": "toolCall"
            },
            {
              "type": "string",
              "const": "toolResult"
            },
            {
              "type": "string",
              "const": "other"
            }
          ]
        },
        "text": {
          "type": "string"
        },
        "timestamp": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "truncated": {
          "type": "boolean"
        },
        "raw": {}
      },
      "additionalProperties": false
    },
    "SessionsCatalogListParams": {
      "type": "object",
      "properties": {
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "cursors": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          }
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "progressId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "search": {
          "type": "string"
        },
        "limitPerHost": {
          "type": "integer",
          "minimum": 1
        },
        "hostIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogListResult": {
      "type": "object",
      "required": [
        "catalogs"
      ],
      "properties": {
        "catalogs": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "capabilities",
              "hosts"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "capabilities": {
                "type": "object",
                "required": [
                  "continueSession",
                  "archive"
                ],
                "properties": {
                  "continueSession": {
                    "type": "boolean"
                  },
                  "archive": {
                    "type": "boolean"
                  },
                  "createSession": {
                    "type": "object",
                    "required": [
                      "model"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "openTerminal": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "hosts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "hostId",
                    "label",
                    "kind",
                    "connected",
                    "sessions"
                  ],
                  "properties": {
                    "hostId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "gateway"
                        },
                        {
                          "type": "string",
                          "const": "node"
                        }
                      ]
                    },
                    "connected": {
                      "type": "boolean"
                    },
                    "nodeId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "threadId",
                          "status",
                          "archived",
                          "canContinue",
                          "canArchive"
                        ],
                        "properties": {
                          "threadId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string"
                          },
                          "cwd": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "minLength": 1
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "updatedAt": {
                            "type": "number"
                          },
                          "recencyAt": {
                            "type": "number"
                          },
                          "source": {
                            "type": "string"
                          },
                          "modelProvider": {
                            "type": "string"
                          },
                          "cliVersion": {
                            "type": "string"
                          },
                          "gitBranch": {
                            "type": "string"
                          },
                          "customGroup": {
                            "type": "string"
                          },
                          "pullRequest": {
                            "type": "object",
                            "required": [
                              "numbers",
                              "state"
                            ],
                            "properties": {
                              "numbers": {
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": 1
                                },
                                "minItems": 1,
                                "maxItems": 20,
                                "uniqueItems": true
                              },
                              "state": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "open"
                                  },
                                  {
                                    "type": "string",
                                    "const": "draft"
                                  },
                                  {
                                    "type": "string",
                                    "const": "merged"
                                  },
                                  {
                                    "type": "string",
                                    "const": "closed"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "archived": {
                            "type": "boolean"
                          },
                          "sessionKey": {
                            "type": "string",
                            "minLength": 1
                          },
                          "createdActor": {
                            "type": "object",
                            "required": [
                              "type"
                            ],
                            "properties": {
                              "type": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "human"
                                  },
                                  {
                                    "type": "string",
                                    "const": "agent"
                                  },
                                  {
                                    "type": "string",
                                    "const": "system"
                                  }
                                ]
                              },
                              "id": {
                                "type": "string",
                                "minLength": 1
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "additionalProperties": false
                          },
                          "canContinue": {
                            "type": "boolean"
                          },
                          "canArchive": {
                            "type": "boolean"
                          },
                          "canOpenTerminal": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": "string"
                    },
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "minLength": 1
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              },
              "error": {
                "type": "object",
                "required": [
                  "code",
                  "message"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogReadParams": {
      "type": "object",
      "required": [
        "catalogId",
        "hostId",
        "threadId"
      ],
      "properties": {
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1
        },
        "cursor": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogReadResult": {
      "type": "object",
      "required": [
        "hostId",
        "threadId",
        "items"
      ],
      "properties": {
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string"
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "userMessage"
                  },
                  {
                    "type": "string",
                    "const": "agentMessage"
                  },
                  {
                    "type": "string",
                    "const": "reasoning"
                  },
                  {
                    "type": "string",
                    "const": "toolCall"
                  },
                  {
                    "type": "string",
                    "const": "toolResult"
                  },
                  {
                    "type": "string",
                    "const": "other"
                  }
                ]
              },
              "text": {
                "type": "string"
              },
              "timestamp": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "truncated": {
                "type": "boolean"
              },
              "raw": {}
            },
            "additionalProperties": false
          }
        },
        "nextCursor": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogContinueParams": {
      "type": "object",
      "required": [
        "catalogId",
        "hostId",
        "threadId"
      ],
      "properties": {
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogContinueResult": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogArchiveParams": {
      "type": "object",
      "required": [
        "catalogId",
        "hostId",
        "threadId",
        "confirmNoOtherRunner"
      ],
      "properties": {
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "threadId": {
          "type": "string",
          "minLength": 1
        },
        "confirmNoOtherRunner": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogArchiveResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCleanupParams": {
      "type": "object",
      "properties": {
        "agent": {
          "type": "string",
          "minLength": 1
        },
        "allAgents": {
          "type": "boolean"
        },
        "enforce": {
          "type": "boolean"
        },
        "activeKey": {
          "type": "string",
          "minLength": 1
        },
        "fixMissing": {
          "type": "boolean"
        },
        "fixDmScope": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsPreviewParams": {
      "type": "object",
      "required": [
        "keys"
      ],
      "properties": {
        "keys": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1
        },
        "maxChars": {
          "type": "integer",
          "minimum": 20
        }
      },
      "additionalProperties": false
    },
    "SessionsDescribeParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "includeDerivedTitles": {
          "type": "boolean"
        },
        "includeLastMessage": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsResolveParams": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "includeGlobal": {
          "type": "boolean"
        },
        "includeUnknown": {
          "type": "boolean"
        },
        "allowMissing": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsSearchHit": {
      "type": "object",
      "required": [
        "sessionKey",
        "sessionId",
        "messageId",
        "role",
        "timestamp",
        "snippet",
        "score"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            },
            {
              "type": "string",
              "const": "assistant"
            }
          ]
        },
        "timestamp": {
          "type": "integer",
          "minimum": 0
        },
        "snippet": {
          "type": "string"
        },
        "score": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "SessionsSearchParams": {
      "type": "object",
      "required": [
        "query"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKeys": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "maxItems": 200
        },
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 25
        }
      },
      "additionalProperties": false
    },
    "SessionsSearchResult": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "sessionKey",
              "sessionId",
              "messageId",
              "role",
              "timestamp",
              "snippet",
              "score"
            ],
            "properties": {
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "messageId": {
                "type": "string",
                "minLength": 1
              },
              "role": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "user"
                  },
                  {
                    "type": "string",
                    "const": "assistant"
                  }
                ]
              },
              "timestamp": {
                "type": "integer",
                "minimum": 0
              },
              "snippet": {
                "type": "string"
              },
              "score": {
                "type": "number"
              }
            },
            "additionalProperties": false
          }
        },
        "indexing": {
          "type": "boolean"
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionCompactionCheckpoint": {
      "type": "object",
      "required": [
        "checkpointId",
        "sessionKey",
        "sessionId",
        "createdAt",
        "reason",
        "preCompaction",
        "postCompaction"
      ],
      "properties": {
        "checkpointId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "manual"
            },
            {
              "type": "string",
              "const": "auto-threshold"
            },
            {
              "type": "string",
              "const": "overflow-retry"
            },
            {
              "type": "string",
              "const": "timeout-retry"
            }
          ]
        },
        "tokensBefore": {
          "type": "integer",
          "minimum": 0
        },
        "tokensAfter": {
          "type": "integer",
          "minimum": 0
        },
        "summary": {
          "type": "string"
        },
        "firstKeptEntryId": {
          "type": "string",
          "minLength": 1
        },
        "preCompaction": {
          "type": "object",
          "required": [
            "sessionId"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "sessionFile": {
              "type": "string",
              "minLength": 1
            },
            "leafId": {
              "type": "string",
              "minLength": 1
            },
            "entryId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "postCompaction": {
          "type": "object",
          "required": [
            "sessionId"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "sessionFile": {
              "type": "string",
              "minLength": 1
            },
            "leafId": {
              "type": "string",
              "minLength": 1
            },
            "entryId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionOperationEvent": {
      "type": "object",
      "required": [
        "operationId",
        "operation",
        "phase",
        "sessionKey",
        "ts"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "minLength": 1
        },
        "operation": {
          "type": "string",
          "const": "compact"
        },
        "phase": {
          "anyOf": [
            {
              "type": "string",
              "const": "start"
            },
            {
              "type": "string",
              "const": "end"
            }
          ]
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        },
        "completed": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionCreatedActor": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string",
              "const": "human"
            },
            {
              "type": "string",
              "const": "agent"
            },
            {
              "type": "string",
              "const": "system"
            }
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionObserverHealth": {
      "anyOf": [
        {
          "type": "string",
          "const": "on-track"
        },
        {
          "type": "string",
          "const": "grinding"
        },
        {
          "type": "string",
          "const": "stuck"
        },
        {
          "type": "string",
          "const": "waiting-on-user"
        },
        {
          "type": "string",
          "const": "wrapping-up"
        },
        {
          "type": "string",
          "const": "done"
        },
        {
          "type": "string",
          "const": "failed"
        }
      ]
    },
    "SessionObserverPlanProgress": {
      "type": "object",
      "required": [
        "completed",
        "total"
      ],
      "properties": {
        "completed": {
          "type": "integer",
          "minimum": 0
        },
        "total": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionObserverDigest": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision",
        "updatedAt",
        "headline",
        "health"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "updatedAt": {
          "type": "integer",
          "minimum": 0
        },
        "headline": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "assessment": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "health": {
          "anyOf": [
            {
              "type": "string",
              "const": "on-track"
            },
            {
              "type": "string",
              "const": "grinding"
            },
            {
              "type": "string",
              "const": "stuck"
            },
            {
              "type": "string",
              "const": "waiting-on-user"
            },
            {
              "type": "string",
              "const": "wrapping-up"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "failed"
            }
          ]
        },
        "planProgress": {
          "type": "object",
          "required": [
            "completed",
            "total"
          ],
          "properties": {
            "completed": {
              "type": "integer",
              "minimum": 0
            },
            "total": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionCompanionExchange": {
      "type": "object",
      "required": [
        "question",
        "answer",
        "ts"
      ],
      "properties": {
        "question": {
          "type": "string",
          "minLength": 1,
          "maxLength": 400
        },
        "answer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1200
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionRow": {
      "type": "object",
      "required": [
        "key",
        "kind"
      ],
      "properties": {
        "key": {
          "type": "string"
        },
        "sessionId": {
          "type": "string"
        },
        "incognito": {
          "type": "boolean",
          "const": true
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "direct"
            },
            {
              "type": "string",
              "const": "group"
            },
            {
              "type": "string",
              "const": "global"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "label": {
          "type": "string"
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "displayName": {
          "type": "string"
        },
        "derivedTitle": {
          "type": "string"
        },
        "lastMessagePreview": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "chatType": {
          "anyOf": [
            {
              "type": "string",
              "const": "direct"
            },
            {
              "type": "string",
              "const": "group"
            },
            {
              "type": "string",
              "const": "channel"
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "archived": {
          "type": "boolean"
        },
        "archivedAt": {
          "type": "number"
        },
        "archivedBy": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "pinned": {
          "type": "boolean"
        },
        "pinnedAt": {
          "type": "number"
        },
        "icon": {
          "type": "string"
        },
        "unread": {
          "type": "boolean"
        },
        "lastReadAt": {
          "type": "number"
        },
        "lastActivityAt": {
          "type": "number"
        },
        "lastInteractionAt": {
          "type": "number"
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "killed"
            },
            {
              "type": "string",
              "const": "timeout"
            }
          ]
        },
        "lastRunError": {
          "type": "string"
        },
        "activeLeafEntryId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "spawnedBy": {
          "type": "string"
        },
        "parentSessionKey": {
          "type": "string"
        },
        "controlOwnerSessionKey": {
          "type": "string"
        },
        "childSessions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "forkedFromParent": {
          "type": "boolean"
        },
        "spawnDepth": {
          "type": "number"
        },
        "subagentRole": {
          "anyOf": [
            {
              "type": "string",
              "const": "orchestrator"
            },
            {
              "type": "string",
              "const": "leaf"
            }
          ]
        },
        "subagentControlScope": {
          "anyOf": [
            {
              "type": "string",
              "const": "children"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "swarmGroupId": {
          "type": "string"
        },
        "worktree": {
          "type": "object",
          "required": [
            "id",
            "branch",
            "repoRoot"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "branch": {
              "type": "string"
            },
            "repoRoot": {
              "type": "string"
            }
          }
        },
        "execNode": {
          "type": "string"
        },
        "execCwd": {
          "type": "string"
        },
        "spawnedWorkspaceDir": {
          "type": "string"
        },
        "spawnedCwd": {
          "type": "string"
        },
        "createdVia": {
          "anyOf": [
            {
              "type": "string",
              "const": "operator"
            },
            {
              "type": "string",
              "const": "spawn"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "cron"
            },
            {
              "type": "string",
              "const": "talk"
            },
            {
              "type": "string",
              "const": "run"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "internal"
            }
          ]
        },
        "createdActor": {
          "type": "object",
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "shared"
            },
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "suggest"
            },
            {
              "type": "string",
              "const": "draft"
            }
          ]
        },
        "sharingRole": {
          "anyOf": [
            {
              "type": "string",
              "const": "admin"
            },
            {
              "type": "string",
              "const": "owner"
            },
            {
              "type": "string",
              "const": "member"
            },
            {
              "type": "string",
              "const": "viewer"
            }
          ]
        },
        "createdAt": {
          "type": "number"
        },
        "forkSource": {
          "type": "object",
          "required": [
            "sessionKey",
            "sessionId"
          ],
          "properties": {
            "sessionKey": {
              "type": "string"
            },
            "sessionId": {
              "type": "string"
            },
            "entryId": {
              "type": "string"
            }
          }
        },
        "previousSessionId": {
          "type": "string"
        },
        "inputTokens": {
          "type": "number"
        },
        "outputTokens": {
          "type": "number"
        },
        "totalTokens": {
          "type": "number"
        },
        "totalTokensFresh": {
          "type": "boolean"
        },
        "contextTokens": {
          "type": "number"
        },
        "estimatedCostUsd": {
          "type": "number"
        },
        "model": {
          "type": "string"
        },
        "modelProvider": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "SessionsCompanionAskParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "question"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "question": {
          "type": "string",
          "minLength": 1,
          "maxLength": 400
        }
      },
      "additionalProperties": false
    },
    "SessionsCompanionAskResult": {
      "type": "object",
      "required": [
        "answer",
        "ts"
      ],
      "properties": {
        "answer": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1200
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionsCompanionResetParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompanionResetResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCompanionStateParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompanionStateResult": {
      "type": "object",
      "required": [
        "exchanges"
      ],
      "properties": {
        "exchanges": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "question",
              "answer",
              "ts"
            ],
            "properties": {
              "question": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400
              },
              "answer": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1200
              },
              "ts": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "maxItems": 24
        }
      },
      "additionalProperties": false
    },
    "SessionsObserverVisibilityParams": {
      "type": "object",
      "required": [
        "visible"
      ],
      "properties": {
        "visible": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsObserverVisibilityResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionVisibility": {
      "anyOf": [
        {
          "type": "string",
          "const": "shared"
        },
        {
          "type": "string",
          "const": "read-only"
        },
        {
          "type": "string",
          "const": "suggest"
        },
        {
          "type": "string",
          "const": "draft"
        }
      ]
    },
    "SessionSharingIdentity": {
      "type": "object",
      "required": [
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "anyOf": [
            {
              "type": "string",
              "const": "human"
            },
            {
              "type": "string",
              "const": "agent"
            },
            {
              "type": "string",
              "const": "system"
            }
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionSharingRole": {
      "anyOf": [
        {
          "type": "string",
          "const": "admin"
        },
        {
          "type": "string",
          "const": "owner"
        },
        {
          "type": "string",
          "const": "member"
        },
        {
          "type": "string",
          "const": "viewer"
        }
      ]
    },
    "SessionVisibilitySetParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "visibility"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "shared"
            },
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "suggest"
            },
            {
              "type": "string",
              "const": "draft"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionVisibilitySetResult": {
      "type": "object",
      "required": [
        "ok",
        "sessionKey",
        "visibility"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "shared"
            },
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "suggest"
            },
            {
              "type": "string",
              "const": "draft"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionMembersListParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionMember": {
      "type": "object",
      "required": [
        "identityId",
        "addedBy",
        "addedAt"
      ],
      "properties": {
        "identityId": {
          "type": "string",
          "minLength": 1
        },
        "addedBy": {
          "type": "string",
          "minLength": 1
        },
        "addedAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionMembersListResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "members",
        "identities",
        "role",
        "allowedVisibilities"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "owner": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "identityId",
              "addedBy",
              "addedAt"
            ],
            "properties": {
              "identityId": {
                "type": "string",
                "minLength": 1
              },
              "addedBy": {
                "type": "string",
                "minLength": 1
              },
              "addedAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "identities": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "type",
              "id"
            ],
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "human"
                  },
                  {
                    "type": "string",
                    "const": "agent"
                  },
                  {
                    "type": "string",
                    "const": "system"
                  }
                ]
              },
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "role": {
          "anyOf": [
            {
              "type": "string",
              "const": "admin"
            },
            {
              "type": "string",
              "const": "owner"
            },
            {
              "type": "string",
              "const": "member"
            },
            {
              "type": "string",
              "const": "viewer"
            }
          ]
        },
        "allowedVisibilities": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "shared"
              },
              {
                "type": "string",
                "const": "read-only"
              },
              {
                "type": "string",
                "const": "suggest"
              },
              {
                "type": "string",
                "const": "draft"
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "SessionMemberAddParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "identityId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "identityId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionMemberRemoveParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "identityId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "identityId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionMemberMutationResult": {
      "type": "object",
      "required": [
        "ok",
        "sessionKey",
        "identityId"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "identityId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionSharingAction": {
      "anyOf": [
        {
          "type": "string",
          "const": "visibility"
        },
        {
          "type": "string",
          "const": "member-added"
        },
        {
          "type": "string",
          "const": "member-removed"
        }
      ]
    },
    "SessionSharingEvent": {
      "type": "object",
      "required": [
        "action",
        "sessionKey",
        "agentId",
        "actor",
        "ts"
      ],
      "properties": {
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "visibility"
            },
            {
              "type": "string",
              "const": "member-added"
            },
            {
              "type": "string",
              "const": "member-removed"
            }
          ]
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "shared"
            },
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "suggest"
            },
            {
              "type": "string",
              "const": "draft"
            }
          ]
        },
        "identityId": {
          "type": "string",
          "minLength": 1
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionState": {
      "anyOf": [
        {
          "type": "string",
          "const": "pending"
        },
        {
          "type": "string",
          "const": "accepted"
        },
        {
          "type": "string",
          "const": "dismissed"
        }
      ]
    },
    "SessionSuggestionAction": {
      "anyOf": [
        {
          "type": "string",
          "const": "added"
        },
        {
          "type": "string",
          "const": "resolved"
        }
      ]
    },
    "SessionSuggestionResolution": {
      "anyOf": [
        {
          "type": "string",
          "const": "send"
        },
        {
          "type": "string",
          "const": "queue"
        },
        {
          "type": "string",
          "const": "edit"
        },
        {
          "type": "string",
          "const": "dismiss"
        }
      ]
    },
    "SessionSuggestion": {
      "type": "object",
      "required": [
        "id",
        "sessionKey",
        "agentId",
        "author",
        "text",
        "createdAt",
        "state"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "author": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "accepted"
            },
            {
              "type": "string",
              "const": "dismissed"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsAddParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "text"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsAddResult": {
      "type": "object",
      "required": [
        "suggestion"
      ],
      "properties": {
        "suggestion": {
          "type": "object",
          "required": [
            "id",
            "sessionKey",
            "agentId",
            "author",
            "text",
            "createdAt",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "author": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32768
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "accepted"
                },
                {
                  "type": "string",
                  "const": "dismissed"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsListParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsListResult": {
      "type": "object",
      "required": [
        "suggestions",
        "role"
      ],
      "properties": {
        "suggestions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "sessionKey",
              "agentId",
              "author",
              "text",
              "createdAt",
              "state"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              },
              "author": {
                "type": "object",
                "required": [
                  "type",
                  "id"
                ],
                "properties": {
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "human"
                      },
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "system"
                      }
                    ]
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "accepted"
                  },
                  {
                    "type": "string",
                    "const": "dismissed"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "role": {
          "anyOf": [
            {
              "type": "string",
              "const": "admin"
            },
            {
              "type": "string",
              "const": "owner"
            },
            {
              "type": "string",
              "const": "member"
            },
            {
              "type": "string",
              "const": "viewer"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsResolveParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "id",
        "resolution"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "resolution": {
          "anyOf": [
            {
              "type": "string",
              "const": "send"
            },
            {
              "type": "string",
              "const": "queue"
            },
            {
              "type": "string",
              "const": "edit"
            },
            {
              "type": "string",
              "const": "dismiss"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionsResolveResult": {
      "type": "object",
      "required": [
        "suggestion"
      ],
      "properties": {
        "suggestion": {
          "type": "object",
          "required": [
            "id",
            "sessionKey",
            "agentId",
            "author",
            "text",
            "createdAt",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "author": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32768
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "accepted"
                },
                {
                  "type": "string",
                  "const": "dismissed"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionSuggestionEvent": {
      "type": "object",
      "required": [
        "action",
        "suggestion"
      ],
      "properties": {
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "added"
            },
            {
              "type": "string",
              "const": "resolved"
            }
          ]
        },
        "suggestion": {
          "type": "object",
          "required": [
            "id",
            "sessionKey",
            "agentId",
            "author",
            "text",
            "createdAt",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "author": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "label": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32768
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "accepted"
                },
                {
                  "type": "string",
                  "const": "dismissed"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionTypingParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "sessionId",
        "typing"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "typing": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionTypingResult": {
      "type": "object",
      "required": [
        "ok",
        "broadcast"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "broadcast": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionTypingEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "sessionId",
        "agentId",
        "actor",
        "typing",
        "ts"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "label": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "typing": {
          "type": "boolean"
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionPlacementState": {
      "anyOf": [
        {
          "type": "string",
          "const": "local"
        },
        {
          "type": "string",
          "const": "requested"
        },
        {
          "type": "string",
          "const": "provisioning"
        },
        {
          "type": "string",
          "const": "syncing"
        },
        {
          "type": "string",
          "const": "starting"
        },
        {
          "type": "string",
          "const": "active"
        },
        {
          "type": "string",
          "const": "draining"
        },
        {
          "type": "string",
          "const": "reconciling"
        },
        {
          "type": "string",
          "const": "reclaimed"
        },
        {
          "type": "string",
          "const": "failed"
        }
      ]
    },
    "LocalSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "local"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "RequestedSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "requested"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "ProvisioningSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "provisioning"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SyncingSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "environmentId",
        "workerBundleHash"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "syncing"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "StartingSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "environmentId",
        "workerBundleHash",
        "workspaceBaseManifestRef",
        "remoteWorkspaceDir"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "starting"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ActiveWorkerSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "environmentId",
        "activeOwnerEpoch",
        "workerBundleHash",
        "workspaceBaseManifestRef",
        "remoteWorkspaceDir"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "active"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "activeOwnerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        },
        "lastTranscriptAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastLiveEventAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "workspaceResultConflict": {
          "type": "object",
          "required": [
            "paths",
            "stagedResultRef"
          ],
          "properties": {
            "paths": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 256
            },
            "stagedResultRef": {
              "type": "string",
              "minLength": 1
            },
            "totalCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "DrainingSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "environmentId",
        "activeOwnerEpoch",
        "workerBundleHash",
        "workspaceBaseManifestRef",
        "remoteWorkspaceDir"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "draining"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "activeOwnerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        },
        "lastTranscriptAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastLiveEventAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "workspaceResultConflict": {
          "type": "object",
          "required": [
            "paths",
            "stagedResultRef"
          ],
          "properties": {
            "paths": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 256
            },
            "stagedResultRef": {
              "type": "string",
              "minLength": 1
            },
            "totalCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ReconcilingSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "environmentId",
        "activeOwnerEpoch",
        "workerBundleHash",
        "workspaceBaseManifestRef",
        "remoteWorkspaceDir"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "reconciling"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "activeOwnerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        },
        "lastTranscriptAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastLiveEventAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "workspaceResultConflict": {
          "type": "object",
          "required": [
            "paths",
            "stagedResultRef"
          ],
          "properties": {
            "paths": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 256
            },
            "stagedResultRef": {
              "type": "string",
              "minLength": 1
            },
            "totalCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ReclaimedSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "reclaimed"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "activeOwnerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "lastTranscriptAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastLiveEventAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "workspaceResultConflict": {
          "type": "object",
          "required": [
            "paths",
            "stagedResultRef"
          ],
          "properties": {
            "paths": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 256
            },
            "stagedResultRef": {
              "type": "string",
              "minLength": 1
            },
            "totalCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "FailedSessionPlacement": {
      "type": "object",
      "required": [
        "state",
        "generation",
        "createdAtMs",
        "updatedAtMs",
        "stateChangedAtMs",
        "recoveryError"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "failed"
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "stateChangedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "activeOwnerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "workspaceBaseManifestRef": {
          "type": "string",
          "minLength": 1
        },
        "remoteWorkspaceDir": {
          "type": "string",
          "minLength": 1
        },
        "workerBundleHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "lastTranscriptAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "lastLiveEventAckCursor": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "workspaceResultConflict": {
          "type": "object",
          "required": [
            "paths",
            "stagedResultRef"
          ],
          "properties": {
            "paths": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 256
            },
            "stagedResultRef": {
              "type": "string",
              "minLength": 1
            },
            "totalCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        },
        "recoveryError": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionPlacement": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "local"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "requested"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "provisioning"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "workerBundleHash"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "syncing"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "workerBundleHash",
            "workspaceBaseManifestRef",
            "remoteWorkspaceDir"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "starting"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "activeOwnerEpoch",
            "workerBundleHash",
            "workspaceBaseManifestRef",
            "remoteWorkspaceDir"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "active"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "activeOwnerEpoch",
            "workerBundleHash",
            "workspaceBaseManifestRef",
            "remoteWorkspaceDir"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "draining"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "activeOwnerEpoch",
            "workerBundleHash",
            "workspaceBaseManifestRef",
            "remoteWorkspaceDir"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "reconciling"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "reclaimed"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "recoveryError"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "failed"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            "recoveryError": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SessionsDispatchParams": {
      "type": "object",
      "required": [
        "key",
        "profileId"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsDispatchResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "sessionId",
        "placement"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "placement": {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs",
            "environmentId",
            "activeOwnerEpoch",
            "workerBundleHash",
            "workspaceBaseManifestRef",
            "remoteWorkspaceDir"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "active"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsReclaimParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsReclaimResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "sessionId",
        "placement"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "placement": {
          "type": "object",
          "required": [
            "state",
            "generation",
            "createdAtMs",
            "updatedAtMs",
            "stateChangedAtMs"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "reclaimed"
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "stateChangedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            },
            "activeOwnerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            "workspaceBaseManifestRef": {
              "type": "string",
              "minLength": 1
            },
            "remoteWorkspaceDir": {
              "type": "string",
              "minLength": 1
            },
            "workerBundleHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            },
            "lastTranscriptAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "lastLiveEventAckCursor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "workspaceResultConflict": {
              "type": "object",
              "required": [
                "paths",
                "stagedResultRef"
              ],
              "properties": {
                "paths": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1,
                  "maxItems": 256
                },
                "stagedResultRef": {
                  "type": "string",
                  "minLength": 1
                },
                "totalCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionDiscussionState": {
      "anyOf": [
        {
          "type": "string",
          "const": "none"
        },
        {
          "type": "string",
          "const": "available"
        },
        {
          "type": "string",
          "const": "open"
        }
      ]
    },
    "SessionDiscussionInfo": {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "open"
            }
          ]
        },
        "embedUrl": {
          "type": "string"
        },
        "openUrl": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionDiscussionInfoParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionDiscussionInfoResult": {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "open"
            }
          ]
        },
        "embedUrl": {
          "type": "string"
        },
        "openUrl": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionDiscussionOpenParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionDiscussionOpenResult": {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "open"
            }
          ]
        },
        "embedUrl": {
          "type": "string"
        },
        "openUrl": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionListParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionGetParams": {
      "type": "object",
      "required": [
        "key",
        "checkpointId"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "checkpointId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionBranchParams": {
      "type": "object",
      "required": [
        "key",
        "checkpointId"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "checkpointId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionRestoreParams": {
      "type": "object",
      "required": [
        "key",
        "checkpointId"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "checkpointId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionListResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "checkpoints"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "checkpoints": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "checkpointId",
              "sessionKey",
              "sessionId",
              "createdAt",
              "reason",
              "preCompaction",
              "postCompaction"
            ],
            "properties": {
              "checkpointId": {
                "type": "string",
                "minLength": 1
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              },
              "reason": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "manual"
                  },
                  {
                    "type": "string",
                    "const": "auto-threshold"
                  },
                  {
                    "type": "string",
                    "const": "overflow-retry"
                  },
                  {
                    "type": "string",
                    "const": "timeout-retry"
                  }
                ]
              },
              "tokensBefore": {
                "type": "integer",
                "minimum": 0
              },
              "tokensAfter": {
                "type": "integer",
                "minimum": 0
              },
              "summary": {
                "type": "string"
              },
              "firstKeptEntryId": {
                "type": "string",
                "minLength": 1
              },
              "preCompaction": {
                "type": "object",
                "required": [
                  "sessionId"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionFile": {
                    "type": "string",
                    "minLength": 1
                  },
                  "leafId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "entryId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "postCompaction": {
                "type": "object",
                "required": [
                  "sessionId"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionFile": {
                    "type": "string",
                    "minLength": 1
                  },
                  "leafId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "entryId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionGetResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "checkpoint"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "checkpoint": {
          "type": "object",
          "required": [
            "checkpointId",
            "sessionKey",
            "sessionId",
            "createdAt",
            "reason",
            "preCompaction",
            "postCompaction"
          ],
          "properties": {
            "checkpointId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "manual"
                },
                {
                  "type": "string",
                  "const": "auto-threshold"
                },
                {
                  "type": "string",
                  "const": "overflow-retry"
                },
                {
                  "type": "string",
                  "const": "timeout-retry"
                }
              ]
            },
            "tokensBefore": {
              "type": "integer",
              "minimum": 0
            },
            "tokensAfter": {
              "type": "integer",
              "minimum": 0
            },
            "summary": {
              "type": "string"
            },
            "firstKeptEntryId": {
              "type": "string",
              "minLength": 1
            },
            "preCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "postCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionBranchResult": {
      "type": "object",
      "required": [
        "ok",
        "sourceKey",
        "key",
        "sessionId",
        "checkpoint",
        "entry"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "sourceKey": {
          "type": "string",
          "minLength": 1
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "checkpoint": {
          "type": "object",
          "required": [
            "checkpointId",
            "sessionKey",
            "sessionId",
            "createdAt",
            "reason",
            "preCompaction",
            "postCompaction"
          ],
          "properties": {
            "checkpointId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "manual"
                },
                {
                  "type": "string",
                  "const": "auto-threshold"
                },
                {
                  "type": "string",
                  "const": "overflow-retry"
                },
                {
                  "type": "string",
                  "const": "timeout-retry"
                }
              ]
            },
            "tokensBefore": {
              "type": "integer",
              "minimum": 0
            },
            "tokensAfter": {
              "type": "integer",
              "minimum": 0
            },
            "summary": {
              "type": "string"
            },
            "firstKeptEntryId": {
              "type": "string",
              "minLength": 1
            },
            "preCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "postCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "entry": {
          "type": "object",
          "required": [
            "sessionId",
            "updatedAt"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "updatedAt": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionRestoreResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "sessionId",
        "checkpoint",
        "entry"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "checkpoint": {
          "type": "object",
          "required": [
            "checkpointId",
            "sessionKey",
            "sessionId",
            "createdAt",
            "reason",
            "preCompaction",
            "postCompaction"
          ],
          "properties": {
            "checkpointId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "manual"
                },
                {
                  "type": "string",
                  "const": "auto-threshold"
                },
                {
                  "type": "string",
                  "const": "overflow-retry"
                },
                {
                  "type": "string",
                  "const": "timeout-retry"
                }
              ]
            },
            "tokensBefore": {
              "type": "integer",
              "minimum": 0
            },
            "tokensAfter": {
              "type": "integer",
              "minimum": 0
            },
            "summary": {
              "type": "string"
            },
            "firstKeptEntryId": {
              "type": "string",
              "minLength": 1
            },
            "preCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "postCompaction": {
              "type": "object",
              "required": [
                "sessionId"
              ],
              "properties": {
                "sessionId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionFile": {
                  "type": "string",
                  "minLength": 1
                },
                "leafId": {
                  "type": "string",
                  "minLength": 1
                },
                "entryId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "entry": {
          "type": "object",
          "required": [
            "sessionId",
            "updatedAt"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "updatedAt": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "SessionsRewindParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "entryId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "entryId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsRewindResult": {
      "type": "object",
      "properties": {
        "editorText": {
          "type": "string"
        },
        "editorAttachments": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "mimeType",
              "data"
            ],
            "properties": {
              "mimeType": {
                "type": "string"
              },
              "data": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsForkParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "entryId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "entryId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsForkResult": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "editorText": {
          "type": "string"
        },
        "editorAttachments": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "mimeType",
              "data"
            ],
            "properties": {
              "mimeType": {
                "type": "string"
              },
              "data": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionBranch": {
      "type": "object",
      "required": [
        "leafEntryId",
        "headline",
        "messageCount",
        "active"
      ],
      "properties": {
        "leafEntryId": {
          "type": "string",
          "minLength": 1
        },
        "headline": {
          "type": "string"
        },
        "messageCount": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAt": {
          "type": "string",
          "minLength": 1
        },
        "active": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsBranchesListParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsBranchesListResult": {
      "type": "object",
      "required": [
        "branches"
      ],
      "properties": {
        "branches": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "leafEntryId",
              "headline",
              "messageCount",
              "active"
            ],
            "properties": {
              "leafEntryId": {
                "type": "string",
                "minLength": 1
              },
              "headline": {
                "type": "string"
              },
              "messageCount": {
                "type": "integer",
                "minimum": 0
              },
              "updatedAt": {
                "type": "string",
                "minLength": 1
              },
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsBranchesSwitchParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "leafEntryId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "leafEntryId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsBranchesSwitchResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SessionFileBrowserEntry": {
      "type": "object",
      "required": [
        "path",
        "name",
        "kind"
      ],
      "properties": {
        "path": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "file"
            },
            {
              "type": "string",
              "const": "directory"
            }
          ]
        },
        "sessionKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "modified"
            },
            {
              "type": "string",
              "const": "read"
            },
            {
              "type": "string",
              "const": "mixed"
            }
          ]
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionFileBrowserResult": {
      "type": "object",
      "required": [
        "path",
        "entries"
      ],
      "properties": {
        "path": {
          "type": "string"
        },
        "parentPath": {
          "type": "string"
        },
        "search": {
          "type": "string"
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "name",
              "kind"
            ],
            "properties": {
              "path": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "file"
                  },
                  {
                    "type": "string",
                    "const": "directory"
                  }
                ]
              },
              "sessionKind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "modified"
                  },
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "mixed"
                  }
                ]
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionFileKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "modified"
        },
        {
          "type": "string",
          "const": "read"
        }
      ]
    },
    "SessionFileEntry": {
      "type": "object",
      "required": [
        "path",
        "name",
        "kind",
        "missing"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "workspacePath": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "modified"
            },
            {
              "type": "string",
              "const": "read"
            }
          ]
        },
        "missing": {
          "type": "boolean"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "content": {
          "type": "string"
        },
        "hash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "SessionFileRelevance": {
      "anyOf": [
        {
          "type": "string",
          "const": "modified"
        },
        {
          "type": "string",
          "const": "read"
        },
        {
          "type": "string",
          "const": "mixed"
        }
      ]
    },
    "SessionsFilesListParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "search": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesListResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "files"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "root": {
          "type": "string",
          "minLength": 1
        },
        "gitCheckout": {
          "type": "boolean"
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "name",
              "kind",
              "missing"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "workspacePath": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "modified"
                  },
                  {
                    "type": "string",
                    "const": "read"
                  }
                ]
              },
              "missing": {
                "type": "boolean"
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "content": {
                "type": "string"
              },
              "hash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64,
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "additionalProperties": false
          }
        },
        "browser": {
          "type": "object",
          "required": [
            "path",
            "entries"
          ],
          "properties": {
            "path": {
              "type": "string"
            },
            "parentPath": {
              "type": "string"
            },
            "search": {
              "type": "string"
            },
            "entries": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "path",
                  "name",
                  "kind"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "file"
                      },
                      {
                        "type": "string",
                        "const": "directory"
                      }
                    ]
                  },
                  "sessionKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "modified"
                      },
                      {
                        "type": "string",
                        "const": "read"
                      },
                      {
                        "type": "string",
                        "const": "mixed"
                      }
                    ]
                  },
                  "size": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              }
            },
            "truncated": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesGetParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "path"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesGetResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "file"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "root": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "path",
            "name",
            "kind",
            "missing"
          ],
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1
            },
            "workspacePath": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "modified"
                },
                {
                  "type": "string",
                  "const": "read"
                }
              ]
            },
            "missing": {
              "type": "boolean"
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "content": {
              "type": "string"
            },
            "hash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesRevealParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesRevealResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "error": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesSetParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "path",
        "content",
        "expectedHash"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string"
        },
        "expectedHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "SessionsFilesSetResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "file"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "root": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "path",
            "name",
            "kind",
            "missing"
          ],
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1
            },
            "workspacePath": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "modified"
                },
                {
                  "type": "string",
                  "const": "read"
                }
              ]
            },
            "missing": {
              "type": "boolean"
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "content": {
              "type": "string"
            },
            "hash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionDiffFileStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "added"
        },
        {
          "type": "string",
          "const": "modified"
        },
        {
          "type": "string",
          "const": "deleted"
        },
        {
          "type": "string",
          "const": "renamed"
        }
      ]
    },
    "SessionDiffFile": {
      "type": "object",
      "required": [
        "path",
        "status",
        "additions",
        "deletions"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "oldPath": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "added"
            },
            {
              "type": "string",
              "const": "modified"
            },
            {
              "type": "string",
              "const": "deleted"
            },
            {
              "type": "string",
              "const": "renamed"
            }
          ]
        },
        "additions": {
          "type": "integer",
          "minimum": 0
        },
        "deletions": {
          "type": "integer",
          "minimum": 0
        },
        "binary": {
          "type": "boolean"
        },
        "untracked": {
          "type": "boolean"
        },
        "patch": {
          "type": "string"
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsDiffParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsDiffResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "files",
        "additions",
        "deletions"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "root": {
          "type": "string",
          "minLength": 1
        },
        "branch": {
          "type": "string",
          "minLength": 1
        },
        "baseRef": {
          "type": "string",
          "minLength": 1
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "status",
              "additions",
              "deletions"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "oldPath": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "added"
                  },
                  {
                    "type": "string",
                    "const": "modified"
                  },
                  {
                    "type": "string",
                    "const": "deleted"
                  },
                  {
                    "type": "string",
                    "const": "renamed"
                  }
                ]
              },
              "additions": {
                "type": "integer",
                "minimum": 0
              },
              "deletions": {
                "type": "integer",
                "minimum": 0
              },
              "binary": {
                "type": "boolean"
              },
              "untracked": {
                "type": "boolean"
              },
              "patch": {
                "type": "string"
              },
              "truncated": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additions": {
          "type": "integer",
          "minimum": 0
        },
        "deletions": {
          "type": "integer",
          "minimum": 0
        },
        "truncated": {
          "type": "boolean"
        },
        "unavailableReason": {
          "anyOf": [
            {
              "type": "string",
              "const": "unknown_session"
            },
            {
              "type": "string",
              "const": "not_git"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionWorktreeInfo": {
      "type": "object",
      "required": [
        "id",
        "path",
        "branch"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "branch": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsCreateParams": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "thinkingLevel": {
          "type": "string",
          "minLength": 1
        },
        "incognito": {
          "type": "boolean"
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "shared"
            },
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "suggest"
            },
            {
              "type": "string",
              "const": "draft"
            }
          ]
        },
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "parentSessionKey": {
          "type": "string",
          "minLength": 1
        },
        "spawnDepth": {
          "type": "integer",
          "minimum": 1,
          "description": "Spawn-lineage depth for spawn-owned creations (visible subagent sessions); requires parentSessionKey. Omitted creations persist as root sessions (depth 0)."
        },
        "fork": {
          "type": "boolean",
          "description": "Fork the parent transcript; requires parentSessionKey."
        },
        "emitCommandHooks": {
          "type": "boolean"
        },
        "succeedsParent": {
          "type": "boolean",
          "description": "When sessions.create creates a distinct child, whether that child succeeds its parent and emits the parent's terminal session_end. Requires parentSessionKey and emitCommandHooks. False keeps the parent active; omission preserves legacy behavior."
        },
        "task": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {}
        },
        "worktree": {
          "type": "boolean"
        },
        "worktreeBaseRef": {
          "type": "string",
          "minLength": 1,
          "description": "Base ref for the new managed worktree branch. Requires worktree=true."
        },
        "worktreeName": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}$",
          "description": "Managed worktree name; becomes branch openclaw/<name>. Requires worktree=true."
        },
        "execNode": {
          "type": "string",
          "minLength": 1,
          "description": "Bind session exec to host=node with this node id/name. Requires operator.admin."
        },
        "cwd": {
          "type": "string",
          "minLength": 1,
          "description": "Absolute Gateway working directory, managed-worktree source directory, or working directory on execNode. Requires operator.admin."
        }
      },
      "additionalProperties": false
    },
    "SessionsCreateResult": {
      "type": "object",
      "required": [
        "ok",
        "key"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "entry": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "runStarted": {
          "type": "boolean"
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "messageSeq": {
          "type": "integer",
          "minimum": 1
        },
        "runError": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            },
            "details": {},
            "retryable": {
              "type": "boolean"
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "worktree": {
          "type": "object",
          "required": [
            "id",
            "path",
            "branch"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "branch": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": true
    },
    "SessionsSendParams": {
      "type": "object",
      "required": [
        "key",
        "message"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "thinking": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {}
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsMessagesSubscribeParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "includeApprovals": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsMessagesUnsubscribeParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsAbortParams": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "clearQueued": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsPatchParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "expectedSessionId": {
          "type": "string",
          "minLength": 1
        },
        "expectedLifecycleRevision": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "category": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "icon": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ],
          "description": "Sidebar icon: one emoji, name:<id>, or svg:<svg ...>...</svg>."
        },
        "statusNote": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ],
          "description": "Short expiring sidebar status note; null clears it and any declared attention."
        },
        "attention": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "hand",
                "key",
                "alert",
                "flag",
                "lock",
                "hourglass"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "ttlMinutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 120
        },
        "archived": {
          "type": "boolean"
        },
        "pinned": {
          "type": "boolean"
        },
        "unread": {
          "type": "boolean",
          "description": "Set true to mark unread; false records the session as read."
        },
        "thinkingLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "fastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "null"
            }
          ]
        },
        "verboseLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "traceLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "reasoningLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "responseUsage": {
          "anyOf": [
            {
              "type": "string",
              "const": "off"
            },
            {
              "type": "string",
              "const": "tokens"
            },
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "on"
            },
            {
              "type": "null"
            }
          ]
        },
        "elevatedLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "execHost": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "execSecurity": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "execAsk": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "execNode": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "model": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "completionOwnerSessionKey": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "inheritedToolPolicyVersion": {
          "anyOf": [
            {
              "type": "number",
              "const": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "inheritedToolAllow": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "inheritedToolDeny": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "sendPolicy": {
          "anyOf": [
            {
              "type": "string",
              "const": "allow"
            },
            {
              "type": "string",
              "const": "deny"
            },
            {
              "type": "null"
            }
          ]
        },
        "groupActivation": {
          "anyOf": [
            {
              "type": "string",
              "const": "mention"
            },
            {
              "type": "string",
              "const": "always"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionsPluginPatchParams": {
      "type": "object",
      "required": [
        "key",
        "pluginId",
        "namespace"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "namespace": {
          "type": "string",
          "minLength": 1
        },
        "value": {},
        "unset": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsPluginPatchResult": {
      "type": "object",
      "required": [
        "ok",
        "key"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "value": {}
      },
      "additionalProperties": false
    },
    "SessionsResetParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "new"
            },
            {
              "type": "string",
              "const": "reset"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionsDeleteParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "deleteTranscript": {
          "type": "boolean"
        },
        "expectedSessionId": {
          "type": "string",
          "minLength": 1
        },
        "expectedLifecycleRevision": {
          "type": "string",
          "minLength": 1
        },
        "expectedSessionUpdatedAt": {
          "type": "number",
          "minimum": 0
        },
        "emitLifecycleHooks": {
          "type": "boolean"
        },
        "archivedOnly": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionGroup": {
      "type": "object",
      "required": [
        "name",
        "position"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "position": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SessionsGroupsListResult": {
      "type": "object",
      "required": [
        "groups"
      ],
      "properties": {
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "position"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "position": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "sectionOrder": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 232
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsPutParams": {
      "type": "object",
      "required": [
        "names"
      ],
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 200
        },
        "sectionOrder": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 232
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsRenameParams": {
      "type": "object",
      "required": [
        "name",
        "to"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "to": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsDeleteParams": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsMutationResult": {
      "type": "object",
      "required": [
        "ok",
        "groups"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "position"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "position": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "sectionOrder": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 232
        },
        "updatedSessions": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "maxLines": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsUsageParams": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "agentScope": {
          "type": "string",
          "const": "all"
        },
        "startDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "endDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "utc"
            },
            {
              "type": "string",
              "const": "gateway"
            },
            {
              "type": "string",
              "const": "specific"
            }
          ]
        },
        "range": {
          "anyOf": [
            {
              "type": "string",
              "const": "7d"
            },
            {
              "type": "string",
              "const": "30d"
            },
            {
              "type": "string",
              "const": "90d"
            },
            {
              "type": "string",
              "const": "1y"
            },
            {
              "type": "string",
              "const": "all"
            }
          ]
        },
        "groupBy": {
          "anyOf": [
            {
              "type": "string",
              "const": "instance"
            },
            {
              "type": "string",
              "const": "family"
            }
          ]
        },
        "includeHistorical": {
          "type": "boolean",
          "deprecated": true,
          "description": "Deprecated alias for groupBy: family."
        },
        "utcOffset": {
          "type": "string",
          "pattern": "^UTC[+-]\\d{1,2}(?::[0-5]\\d)?$",
          "deprecated": true,
          "description": "Deprecated compatibility fallback; use timeZone."
        },
        "timeZone": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1
        },
        "includeContextWeight": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "AuditActivityAgentRunV1": {
      "type": "object",
      "required": [
        "eventType",
        "schemaVersion",
        "eventId",
        "sequence",
        "sourceSequence",
        "occurredAt",
        "redaction",
        "actor",
        "agentId",
        "runId",
        "kind",
        "action",
        "status"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "agent_run"
        },
        "schemaVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1
        },
        "eventId": {
          "type": "string",
          "minLength": 1
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "sourceSequence": {
          "type": "integer",
          "minimum": 1
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "redaction": {
          "type": "string",
          "const": "metadata_only"
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "const": "agent_run"
        },
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent.run.started"
            },
            {
              "type": "string",
              "const": "agent.run.finished"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            },
            {
              "type": "string",
              "const": "blocked"
            }
          ]
        },
        "errorCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "run_failed"
            },
            {
              "type": "string",
              "const": "run_cancelled"
            },
            {
              "type": "string",
              "const": "run_timed_out"
            },
            {
              "type": "string",
              "const": "run_blocked"
            }
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.started"
                    },
                    "status": {
                      "type": "string",
                      "const": "started"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "succeeded"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "agent.run.finished"
                },
                "status": {
                  "type": "string",
                  "const": "failed"
                },
                "errorCode": {
                  "type": "string",
                  "const": "run_failed"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "agent.run.finished"
                },
                "status": {
                  "type": "string",
                  "const": "cancelled"
                },
                "errorCode": {
                  "type": "string",
                  "const": "run_cancelled"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "agent.run.finished"
                },
                "status": {
                  "type": "string",
                  "const": "timed_out"
                },
                "errorCode": {
                  "type": "string",
                  "const": "run_timed_out"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "agent.run.finished"
                },
                "status": {
                  "type": "string",
                  "const": "blocked"
                },
                "errorCode": {
                  "type": "string",
                  "const": "run_blocked"
                }
              }
            }
          ]
        }
      ]
    },
    "AuditActivityToolActionV1": {
      "type": "object",
      "required": [
        "eventType",
        "schemaVersion",
        "eventId",
        "sequence",
        "sourceSequence",
        "occurredAt",
        "redaction",
        "actor",
        "agentId",
        "runId",
        "kind",
        "action",
        "status"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "tool_action"
        },
        "schemaVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1
        },
        "eventId": {
          "type": "string",
          "minLength": 1
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "sourceSequence": {
          "type": "integer",
          "minimum": 1
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "redaction": {
          "type": "string",
          "const": "metadata_only"
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "const": "tool_action"
        },
        "toolCallId": {
          "type": "string",
          "minLength": 1
        },
        "toolName": {
          "type": "string",
          "minLength": 1
        },
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "tool.action.started"
            },
            {
              "type": "string",
              "const": "tool.action.finished"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "errorCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "tool_failed"
            },
            {
              "type": "string",
              "const": "tool_cancelled"
            },
            {
              "type": "string",
              "const": "tool_timed_out"
            },
            {
              "type": "string",
              "const": "tool_blocked"
            },
            {
              "type": "string",
              "const": "tool_outcome_unknown"
            }
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.started"
                    },
                    "status": {
                      "type": "string",
                      "const": "started"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "succeeded"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "tool.action.finished"
                },
                "status": {
                  "type": "string",
                  "const": "failed"
                },
                "errorCode": {
                  "type": "string",
                  "const": "tool_failed"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "tool.action.finished"
                },
                "status": {
                  "type": "string",
                  "const": "cancelled"
                },
                "errorCode": {
                  "type": "string",
                  "const": "tool_cancelled"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "tool.action.finished"
                },
                "status": {
                  "type": "string",
                  "const": "timed_out"
                },
                "errorCode": {
                  "type": "string",
                  "const": "tool_timed_out"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "tool.action.finished"
                },
                "status": {
                  "type": "string",
                  "const": "blocked"
                },
                "errorCode": {
                  "type": "string",
                  "const": "tool_blocked"
                }
              }
            },
            {
              "type": "object",
              "required": [
                "action",
                "status",
                "errorCode"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "const": "tool.action.finished"
                },
                "status": {
                  "type": "string",
                  "const": "unknown"
                },
                "errorCode": {
                  "type": "string",
                  "const": "tool_outcome_unknown"
                }
              }
            }
          ]
        }
      ]
    },
    "AuditActivityInboundMessageV1": {
      "type": "object",
      "required": [
        "eventType",
        "schemaVersion",
        "eventId",
        "sequence",
        "sourceSequence",
        "occurredAt",
        "redaction",
        "channel",
        "conversationKind",
        "kind",
        "action",
        "direction",
        "actor",
        "status",
        "outcome"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "inbound_message"
        },
        "schemaVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1
        },
        "eventId": {
          "type": "string",
          "minLength": 1
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "sourceSequence": {
          "type": "integer",
          "minimum": 1
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "redaction": {
          "type": "string",
          "const": "metadata_only"
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "conversationKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "direct"
            },
            {
              "type": "string",
              "const": "group"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0
        },
        "resultCount": {
          "type": "integer",
          "minimum": 0
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "accountRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "conversationRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "messageRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "targetRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "kind": {
          "type": "string",
          "const": "message"
        },
        "action": {
          "type": "string",
          "const": "message.inbound.processed"
        },
        "direction": {
          "type": "string",
          "const": "inbound"
        },
        "actor": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "channel_sender"
                },
                "id": {
                  "type": "string",
                  "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "system"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "failed"
            }
          ]
        },
        "outcome": {
          "anyOf": [
            {
              "type": "string",
              "const": "completed"
            },
            {
              "type": "string",
              "const": "skipped"
            },
            {
              "type": "string",
              "const": "failed"
            }
          ]
        },
        "errorCode": {
          "type": "string",
          "const": "message_processing_failed"
        },
        "reasonCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "fast_abort"
            },
            {
              "type": "string",
              "const": "plugin_bound_handled"
            },
            {
              "type": "string",
              "const": "plugin_bound_unavailable"
            },
            {
              "type": "string",
              "const": "plugin_bound_declined"
            },
            {
              "type": "string",
              "const": "before_dispatch_handled"
            },
            {
              "type": "string",
              "const": "acp_dispatch_completed"
            },
            {
              "type": "string",
              "const": "acp_dispatch_empty"
            },
            {
              "type": "string",
              "const": "duplicate"
            },
            {
              "type": "string",
              "const": "reply_operation_active"
            },
            {
              "type": "string",
              "const": "reply_operation_aborted"
            },
            {
              "type": "string",
              "const": "acp_dispatch_aborted"
            },
            {
              "type": "string",
              "const": "acp_dispatch_failed"
            },
            {
              "type": "string",
              "const": "plugin_bound_error"
            }
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "succeeded"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "completed"
                    },
                    "reasonCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "fast_abort"
                        },
                        {
                          "type": "string",
                          "const": "plugin_bound_handled"
                        },
                        {
                          "type": "string",
                          "const": "plugin_bound_unavailable"
                        },
                        {
                          "type": "string",
                          "const": "plugin_bound_declined"
                        },
                        {
                          "type": "string",
                          "const": "before_dispatch_handled"
                        },
                        {
                          "type": "string",
                          "const": "acp_dispatch_completed"
                        },
                        {
                          "type": "string",
                          "const": "acp_dispatch_empty"
                        }
                      ]
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "blocked"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "skipped"
                    },
                    "reasonCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "duplicate"
                        },
                        {
                          "type": "string",
                          "const": "reply_operation_active"
                        },
                        {
                          "type": "string",
                          "const": "reply_operation_aborted"
                        },
                        {
                          "type": "string",
                          "const": "acp_dispatch_aborted"
                        }
                      ]
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                }
              ]
            },
            {
              "type": "object",
              "required": [
                "status",
                "outcome",
                "errorCode"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "failed"
                },
                "outcome": {
                  "type": "string",
                  "const": "failed"
                },
                "errorCode": {
                  "type": "string",
                  "const": "message_processing_failed"
                },
                "reasonCode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "acp_dispatch_failed"
                    },
                    {
                      "type": "string",
                      "const": "plugin_bound_error"
                    }
                  ]
                }
              }
            }
          ]
        }
      ]
    },
    "AuditActivityOutboundMessageV1": {
      "type": "object",
      "required": [
        "eventType",
        "schemaVersion",
        "eventId",
        "sequence",
        "sourceSequence",
        "occurredAt",
        "redaction",
        "channel",
        "conversationKind",
        "kind",
        "action",
        "direction",
        "actor",
        "status",
        "outcome"
      ],
      "properties": {
        "eventType": {
          "type": "string",
          "const": "outbound_message"
        },
        "schemaVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1
        },
        "eventId": {
          "type": "string",
          "minLength": 1
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "sourceSequence": {
          "type": "integer",
          "minimum": 1
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "redaction": {
          "type": "string",
          "const": "metadata_only"
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "conversationKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "direct"
            },
            {
              "type": "string",
              "const": "group"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0
        },
        "resultCount": {
          "type": "integer",
          "minimum": 0
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "accountRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "conversationRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "messageRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "targetRef": {
          "type": "string",
          "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
        },
        "kind": {
          "type": "string",
          "const": "message"
        },
        "action": {
          "type": "string",
          "const": "message.outbound.finished"
        },
        "direction": {
          "type": "string",
          "const": "outbound"
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "deliveryKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "text"
            },
            {
              "type": "string",
              "const": "media"
            },
            {
              "type": "string",
              "const": "other"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "outcome": {
          "anyOf": [
            {
              "type": "string",
              "const": "sent"
            },
            {
              "type": "string",
              "const": "suppressed"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "errorCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "message_delivery_failed"
            },
            {
              "type": "string",
              "const": "message_delivery_partial_failure"
            }
          ]
        },
        "reasonCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "cancelled_by_message_sending_hook"
            },
            {
              "type": "string",
              "const": "cancelled_by_reply_payload_sending_hook"
            },
            {
              "type": "string",
              "const": "empty_after_message_sending_hook"
            },
            {
              "type": "string",
              "const": "empty_after_reply_payload_sending_hook"
            },
            {
              "type": "string",
              "const": "no_visible_payload"
            }
          ]
        },
        "failureStage": {
          "anyOf": [
            {
              "type": "string",
              "const": "platform_send"
            },
            {
              "type": "string",
              "const": "queue"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "succeeded"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "sent"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "reasonCode"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "failureStage"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome",
                    "reasonCode"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "blocked"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "suppressed"
                    },
                    "reasonCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "cancelled_by_message_sending_hook"
                        },
                        {
                          "type": "string",
                          "const": "cancelled_by_reply_payload_sending_hook"
                        },
                        {
                          "type": "string",
                          "const": "empty_after_message_sending_hook"
                        },
                        {
                          "type": "string",
                          "const": "empty_after_reply_payload_sending_hook"
                        },
                        {
                          "type": "string",
                          "const": "no_visible_payload"
                        }
                      ]
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "failureStage"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "deliveryKind"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome",
                    "errorCode",
                    "failureStage"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "failed"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "failed"
                    },
                    "errorCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "message_delivery_failed"
                        },
                        {
                          "type": "string",
                          "const": "message_delivery_partial_failure"
                        }
                      ]
                    },
                    "failureStage": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "platform_send"
                        },
                        {
                          "type": "string",
                          "const": "queue"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "reasonCode"
                    ]
                  }
                }
              ]
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome",
                    "failureStage"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "unknown"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "unknown"
                    },
                    "failureStage": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "platform_send"
                        },
                        {
                          "type": "string",
                          "const": "queue"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "errorCode"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "reasonCode"
                    ]
                  }
                },
                {
                  "not": {
                    "required": [
                      "deliveryKind"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    "AuditActivityEventV1": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "eventType",
            "schemaVersion",
            "eventId",
            "sequence",
            "sourceSequence",
            "occurredAt",
            "redaction",
            "actor",
            "agentId",
            "runId",
            "kind",
            "action",
            "status"
          ],
          "properties": {
            "eventType": {
              "type": "string",
              "const": "agent_run"
            },
            "schemaVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1
            },
            "eventId": {
              "type": "string",
              "minLength": 1
            },
            "sequence": {
              "type": "integer",
              "minimum": 1
            },
            "sourceSequence": {
              "type": "integer",
              "minimum": 1
            },
            "occurredAt": {
              "type": "integer",
              "minimum": 0
            },
            "redaction": {
              "type": "string",
              "const": "metadata_only"
            },
            "actor": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "string",
              "const": "agent_run"
            },
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent.run.started"
                },
                {
                  "type": "string",
                  "const": "agent.run.finished"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "started"
                },
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "timed_out"
                },
                {
                  "type": "string",
                  "const": "blocked"
                }
              ]
            },
            "errorCode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "run_failed"
                },
                {
                  "type": "string",
                  "const": "run_cancelled"
                },
                {
                  "type": "string",
                  "const": "run_timed_out"
                },
                {
                  "type": "string",
                  "const": "run_blocked"
                }
              ]
            }
          },
          "additionalProperties": false,
          "allOf": [
            {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "action",
                        "status"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "const": "agent.run.started"
                        },
                        "status": {
                          "type": "string",
                          "const": "started"
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "action",
                        "status"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "const": "agent.run.finished"
                        },
                        "status": {
                          "type": "string",
                          "const": "succeeded"
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "failed"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "run_failed"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "cancelled"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "run_cancelled"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "timed_out"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "run_timed_out"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "agent.run.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "blocked"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "run_blocked"
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "type": "object",
          "required": [
            "eventType",
            "schemaVersion",
            "eventId",
            "sequence",
            "sourceSequence",
            "occurredAt",
            "redaction",
            "actor",
            "agentId",
            "runId",
            "kind",
            "action",
            "status"
          ],
          "properties": {
            "eventType": {
              "type": "string",
              "const": "tool_action"
            },
            "schemaVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1
            },
            "eventId": {
              "type": "string",
              "minLength": 1
            },
            "sequence": {
              "type": "integer",
              "minimum": 1
            },
            "sourceSequence": {
              "type": "integer",
              "minimum": 1
            },
            "occurredAt": {
              "type": "integer",
              "minimum": 0
            },
            "redaction": {
              "type": "string",
              "const": "metadata_only"
            },
            "actor": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "string",
              "const": "tool_action"
            },
            "toolCallId": {
              "type": "string",
              "minLength": 1
            },
            "toolName": {
              "type": "string",
              "minLength": 1
            },
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "tool.action.started"
                },
                {
                  "type": "string",
                  "const": "tool.action.finished"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "started"
                },
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "timed_out"
                },
                {
                  "type": "string",
                  "const": "blocked"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "errorCode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "tool_failed"
                },
                {
                  "type": "string",
                  "const": "tool_cancelled"
                },
                {
                  "type": "string",
                  "const": "tool_timed_out"
                },
                {
                  "type": "string",
                  "const": "tool_blocked"
                },
                {
                  "type": "string",
                  "const": "tool_outcome_unknown"
                }
              ]
            }
          },
          "additionalProperties": false,
          "allOf": [
            {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "action",
                        "status"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "const": "tool.action.started"
                        },
                        "status": {
                          "type": "string",
                          "const": "started"
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "action",
                        "status"
                      ],
                      "properties": {
                        "action": {
                          "type": "string",
                          "const": "tool.action.finished"
                        },
                        "status": {
                          "type": "string",
                          "const": "succeeded"
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "failed"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "tool_failed"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "cancelled"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "tool_cancelled"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "timed_out"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "tool_timed_out"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "blocked"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "tool_blocked"
                    }
                  }
                },
                {
                  "type": "object",
                  "required": [
                    "action",
                    "status",
                    "errorCode"
                  ],
                  "properties": {
                    "action": {
                      "type": "string",
                      "const": "tool.action.finished"
                    },
                    "status": {
                      "type": "string",
                      "const": "unknown"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "tool_outcome_unknown"
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "type": "object",
          "required": [
            "eventType",
            "schemaVersion",
            "eventId",
            "sequence",
            "sourceSequence",
            "occurredAt",
            "redaction",
            "channel",
            "conversationKind",
            "kind",
            "action",
            "direction",
            "actor",
            "status",
            "outcome"
          ],
          "properties": {
            "eventType": {
              "type": "string",
              "const": "inbound_message"
            },
            "schemaVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1
            },
            "eventId": {
              "type": "string",
              "minLength": 1
            },
            "sequence": {
              "type": "integer",
              "minimum": 1
            },
            "sourceSequence": {
              "type": "integer",
              "minimum": 1
            },
            "occurredAt": {
              "type": "integer",
              "minimum": 0
            },
            "redaction": {
              "type": "string",
              "const": "metadata_only"
            },
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "conversationKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "direct"
                },
                {
                  "type": "string",
                  "const": "group"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "durationMs": {
              "type": "integer",
              "minimum": 0
            },
            "resultCount": {
              "type": "integer",
              "minimum": 0
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "accountRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "conversationRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "messageRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "targetRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "kind": {
              "type": "string",
              "const": "message"
            },
            "action": {
              "type": "string",
              "const": "message.inbound.processed"
            },
            "direction": {
              "type": "string",
              "const": "inbound"
            },
            "actor": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "channel_sender"
                    },
                    "id": {
                      "type": "string",
                      "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "system"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "blocked"
                },
                {
                  "type": "string",
                  "const": "failed"
                }
              ]
            },
            "outcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "completed"
                },
                {
                  "type": "string",
                  "const": "skipped"
                },
                {
                  "type": "string",
                  "const": "failed"
                }
              ]
            },
            "errorCode": {
              "type": "string",
              "const": "message_processing_failed"
            },
            "reasonCode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "fast_abort"
                },
                {
                  "type": "string",
                  "const": "plugin_bound_handled"
                },
                {
                  "type": "string",
                  "const": "plugin_bound_unavailable"
                },
                {
                  "type": "string",
                  "const": "plugin_bound_declined"
                },
                {
                  "type": "string",
                  "const": "before_dispatch_handled"
                },
                {
                  "type": "string",
                  "const": "acp_dispatch_completed"
                },
                {
                  "type": "string",
                  "const": "acp_dispatch_empty"
                },
                {
                  "type": "string",
                  "const": "duplicate"
                },
                {
                  "type": "string",
                  "const": "reply_operation_active"
                },
                {
                  "type": "string",
                  "const": "reply_operation_aborted"
                },
                {
                  "type": "string",
                  "const": "acp_dispatch_aborted"
                },
                {
                  "type": "string",
                  "const": "acp_dispatch_failed"
                },
                {
                  "type": "string",
                  "const": "plugin_bound_error"
                }
              ]
            }
          },
          "additionalProperties": false,
          "allOf": [
            {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "succeeded"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "completed"
                        },
                        "reasonCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "fast_abort"
                            },
                            {
                              "type": "string",
                              "const": "plugin_bound_handled"
                            },
                            {
                              "type": "string",
                              "const": "plugin_bound_unavailable"
                            },
                            {
                              "type": "string",
                              "const": "plugin_bound_declined"
                            },
                            {
                              "type": "string",
                              "const": "before_dispatch_handled"
                            },
                            {
                              "type": "string",
                              "const": "acp_dispatch_completed"
                            },
                            {
                              "type": "string",
                              "const": "acp_dispatch_empty"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "blocked"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "skipped"
                        },
                        "reasonCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "duplicate"
                            },
                            {
                              "type": "string",
                              "const": "reply_operation_active"
                            },
                            {
                              "type": "string",
                              "const": "reply_operation_aborted"
                            },
                            {
                              "type": "string",
                              "const": "acp_dispatch_aborted"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "type": "object",
                  "required": [
                    "status",
                    "outcome",
                    "errorCode"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "failed"
                    },
                    "outcome": {
                      "type": "string",
                      "const": "failed"
                    },
                    "errorCode": {
                      "type": "string",
                      "const": "message_processing_failed"
                    },
                    "reasonCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "acp_dispatch_failed"
                        },
                        {
                          "type": "string",
                          "const": "plugin_bound_error"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          ]
        },
        {
          "type": "object",
          "required": [
            "eventType",
            "schemaVersion",
            "eventId",
            "sequence",
            "sourceSequence",
            "occurredAt",
            "redaction",
            "channel",
            "conversationKind",
            "kind",
            "action",
            "direction",
            "actor",
            "status",
            "outcome"
          ],
          "properties": {
            "eventType": {
              "type": "string",
              "const": "outbound_message"
            },
            "schemaVersion": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1
            },
            "eventId": {
              "type": "string",
              "minLength": 1
            },
            "sequence": {
              "type": "integer",
              "minimum": 1
            },
            "sourceSequence": {
              "type": "integer",
              "minimum": 1
            },
            "occurredAt": {
              "type": "integer",
              "minimum": 0
            },
            "redaction": {
              "type": "string",
              "const": "metadata_only"
            },
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "conversationKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "direct"
                },
                {
                  "type": "string",
                  "const": "group"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "durationMs": {
              "type": "integer",
              "minimum": 0
            },
            "resultCount": {
              "type": "integer",
              "minimum": 0
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "accountRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "conversationRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "messageRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "targetRef": {
              "type": "string",
              "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
            },
            "kind": {
              "type": "string",
              "const": "message"
            },
            "action": {
              "type": "string",
              "const": "message.outbound.finished"
            },
            "direction": {
              "type": "string",
              "const": "outbound"
            },
            "actor": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "deliveryKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "media"
                },
                {
                  "type": "string",
                  "const": "other"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "blocked"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "outcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "sent"
                },
                {
                  "type": "string",
                  "const": "suppressed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "errorCode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "message_delivery_failed"
                },
                {
                  "type": "string",
                  "const": "message_delivery_partial_failure"
                }
              ]
            },
            "reasonCode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "cancelled_by_message_sending_hook"
                },
                {
                  "type": "string",
                  "const": "cancelled_by_reply_payload_sending_hook"
                },
                {
                  "type": "string",
                  "const": "empty_after_message_sending_hook"
                },
                {
                  "type": "string",
                  "const": "empty_after_reply_payload_sending_hook"
                },
                {
                  "type": "string",
                  "const": "no_visible_payload"
                }
              ]
            },
            "failureStage": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "platform_send"
                },
                {
                  "type": "string",
                  "const": "queue"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            }
          },
          "additionalProperties": false,
          "allOf": [
            {
              "anyOf": [
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "succeeded"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "sent"
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "reasonCode"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "failureStage"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome",
                        "reasonCode"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "blocked"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "suppressed"
                        },
                        "reasonCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "cancelled_by_message_sending_hook"
                            },
                            {
                              "type": "string",
                              "const": "cancelled_by_reply_payload_sending_hook"
                            },
                            {
                              "type": "string",
                              "const": "empty_after_message_sending_hook"
                            },
                            {
                              "type": "string",
                              "const": "empty_after_reply_payload_sending_hook"
                            },
                            {
                              "type": "string",
                              "const": "no_visible_payload"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "failureStage"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "deliveryKind"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome",
                        "errorCode",
                        "failureStage"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "failed"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "failed"
                        },
                        "errorCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "message_delivery_failed"
                            },
                            {
                              "type": "string",
                              "const": "message_delivery_partial_failure"
                            }
                          ]
                        },
                        "failureStage": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "platform_send"
                            },
                            {
                              "type": "string",
                              "const": "queue"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "reasonCode"
                        ]
                      }
                    }
                  ]
                },
                {
                  "allOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "outcome",
                        "failureStage"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "unknown"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "unknown"
                        },
                        "failureStage": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "platform_send"
                            },
                            {
                              "type": "string",
                              "const": "queue"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "errorCode"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "reasonCode"
                        ]
                      }
                    },
                    {
                      "not": {
                        "required": [
                          "deliveryKind"
                        ]
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    },
    "AuditActivityListParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent_run"
            },
            {
              "type": "string",
              "const": "tool_action"
            },
            {
              "type": "string",
              "const": "message"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "direction": {
          "anyOf": [
            {
              "type": "string",
              "const": "inbound"
            },
            {
              "type": "string",
              "const": "outbound"
            }
          ]
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "after": {
          "type": "integer",
          "minimum": 0
        },
        "before": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        },
        "cursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AuditActivityListResult": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "eventType",
                  "schemaVersion",
                  "eventId",
                  "sequence",
                  "sourceSequence",
                  "occurredAt",
                  "redaction",
                  "actor",
                  "agentId",
                  "runId",
                  "kind",
                  "action",
                  "status"
                ],
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "agent_run"
                  },
                  "schemaVersion": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                  },
                  "eventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "sourceSequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "occurredAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "redaction": {
                    "type": "string",
                    "const": "metadata_only"
                  },
                  "actor": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "agent"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionKey": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "const": "agent_run"
                  },
                  "action": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "agent.run.started"
                      },
                      {
                        "type": "string",
                        "const": "agent.run.finished"
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "started"
                      },
                      {
                        "type": "string",
                        "const": "succeeded"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "cancelled"
                      },
                      {
                        "type": "string",
                        "const": "timed_out"
                      },
                      {
                        "type": "string",
                        "const": "blocked"
                      }
                    ]
                  },
                  "errorCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "run_failed"
                      },
                      {
                        "type": "string",
                        "const": "run_cancelled"
                      },
                      {
                        "type": "string",
                        "const": "run_timed_out"
                      },
                      {
                        "type": "string",
                        "const": "run_blocked"
                      }
                    ]
                  }
                },
                "additionalProperties": false,
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "action",
                              "status"
                            ],
                            "properties": {
                              "action": {
                                "type": "string",
                                "const": "agent.run.started"
                              },
                              "status": {
                                "type": "string",
                                "const": "started"
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "action",
                              "status"
                            ],
                            "properties": {
                              "action": {
                                "type": "string",
                                "const": "agent.run.finished"
                              },
                              "status": {
                                "type": "string",
                                "const": "succeeded"
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "agent.run.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "failed"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "run_failed"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "agent.run.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "cancelled"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "run_cancelled"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "agent.run.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "timed_out"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "run_timed_out"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "agent.run.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "blocked"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "run_blocked"
                          }
                        }
                      }
                    ]
                  }
                ]
              },
              {
                "type": "object",
                "required": [
                  "eventType",
                  "schemaVersion",
                  "eventId",
                  "sequence",
                  "sourceSequence",
                  "occurredAt",
                  "redaction",
                  "actor",
                  "agentId",
                  "runId",
                  "kind",
                  "action",
                  "status"
                ],
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "tool_action"
                  },
                  "schemaVersion": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                  },
                  "eventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "sourceSequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "occurredAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "redaction": {
                    "type": "string",
                    "const": "metadata_only"
                  },
                  "actor": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "agent"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionKey": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "type": "string",
                    "const": "tool_action"
                  },
                  "toolCallId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "toolName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "action": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "tool.action.started"
                      },
                      {
                        "type": "string",
                        "const": "tool.action.finished"
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "started"
                      },
                      {
                        "type": "string",
                        "const": "succeeded"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "cancelled"
                      },
                      {
                        "type": "string",
                        "const": "timed_out"
                      },
                      {
                        "type": "string",
                        "const": "blocked"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "errorCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "tool_failed"
                      },
                      {
                        "type": "string",
                        "const": "tool_cancelled"
                      },
                      {
                        "type": "string",
                        "const": "tool_timed_out"
                      },
                      {
                        "type": "string",
                        "const": "tool_blocked"
                      },
                      {
                        "type": "string",
                        "const": "tool_outcome_unknown"
                      }
                    ]
                  }
                },
                "additionalProperties": false,
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "action",
                              "status"
                            ],
                            "properties": {
                              "action": {
                                "type": "string",
                                "const": "tool.action.started"
                              },
                              "status": {
                                "type": "string",
                                "const": "started"
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "action",
                              "status"
                            ],
                            "properties": {
                              "action": {
                                "type": "string",
                                "const": "tool.action.finished"
                              },
                              "status": {
                                "type": "string",
                                "const": "succeeded"
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "tool.action.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "failed"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "tool_failed"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "tool.action.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "cancelled"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "tool_cancelled"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "tool.action.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "timed_out"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "tool_timed_out"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "tool.action.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "blocked"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "tool_blocked"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "required": [
                          "action",
                          "status",
                          "errorCode"
                        ],
                        "properties": {
                          "action": {
                            "type": "string",
                            "const": "tool.action.finished"
                          },
                          "status": {
                            "type": "string",
                            "const": "unknown"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "tool_outcome_unknown"
                          }
                        }
                      }
                    ]
                  }
                ]
              },
              {
                "type": "object",
                "required": [
                  "eventType",
                  "schemaVersion",
                  "eventId",
                  "sequence",
                  "sourceSequence",
                  "occurredAt",
                  "redaction",
                  "channel",
                  "conversationKind",
                  "kind",
                  "action",
                  "direction",
                  "actor",
                  "status",
                  "outcome"
                ],
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "inbound_message"
                  },
                  "schemaVersion": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                  },
                  "eventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "sourceSequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "occurredAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "redaction": {
                    "type": "string",
                    "const": "metadata_only"
                  },
                  "channel": {
                    "type": "string",
                    "minLength": 1
                  },
                  "conversationKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "direct"
                      },
                      {
                        "type": "string",
                        "const": "group"
                      },
                      {
                        "type": "string",
                        "const": "channel"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "durationMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "resultCount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "conversationRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "messageRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "targetRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "message"
                  },
                  "action": {
                    "type": "string",
                    "const": "message.inbound.processed"
                  },
                  "direction": {
                    "type": "string",
                    "const": "inbound"
                  },
                  "actor": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "channel_sender"
                          },
                          "id": {
                            "type": "string",
                            "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "system"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "succeeded"
                      },
                      {
                        "type": "string",
                        "const": "blocked"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      }
                    ]
                  },
                  "outcome": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "completed"
                      },
                      {
                        "type": "string",
                        "const": "skipped"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      }
                    ]
                  },
                  "errorCode": {
                    "type": "string",
                    "const": "message_processing_failed"
                  },
                  "reasonCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "fast_abort"
                      },
                      {
                        "type": "string",
                        "const": "plugin_bound_handled"
                      },
                      {
                        "type": "string",
                        "const": "plugin_bound_unavailable"
                      },
                      {
                        "type": "string",
                        "const": "plugin_bound_declined"
                      },
                      {
                        "type": "string",
                        "const": "before_dispatch_handled"
                      },
                      {
                        "type": "string",
                        "const": "acp_dispatch_completed"
                      },
                      {
                        "type": "string",
                        "const": "acp_dispatch_empty"
                      },
                      {
                        "type": "string",
                        "const": "duplicate"
                      },
                      {
                        "type": "string",
                        "const": "reply_operation_active"
                      },
                      {
                        "type": "string",
                        "const": "reply_operation_aborted"
                      },
                      {
                        "type": "string",
                        "const": "acp_dispatch_aborted"
                      },
                      {
                        "type": "string",
                        "const": "acp_dispatch_failed"
                      },
                      {
                        "type": "string",
                        "const": "plugin_bound_error"
                      }
                    ]
                  }
                },
                "additionalProperties": false,
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "succeeded"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "completed"
                              },
                              "reasonCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "fast_abort"
                                  },
                                  {
                                    "type": "string",
                                    "const": "plugin_bound_handled"
                                  },
                                  {
                                    "type": "string",
                                    "const": "plugin_bound_unavailable"
                                  },
                                  {
                                    "type": "string",
                                    "const": "plugin_bound_declined"
                                  },
                                  {
                                    "type": "string",
                                    "const": "before_dispatch_handled"
                                  },
                                  {
                                    "type": "string",
                                    "const": "acp_dispatch_completed"
                                  },
                                  {
                                    "type": "string",
                                    "const": "acp_dispatch_empty"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "blocked"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "skipped"
                              },
                              "reasonCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "duplicate"
                                  },
                                  {
                                    "type": "string",
                                    "const": "reply_operation_active"
                                  },
                                  {
                                    "type": "string",
                                    "const": "reply_operation_aborted"
                                  },
                                  {
                                    "type": "string",
                                    "const": "acp_dispatch_aborted"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "type": "object",
                        "required": [
                          "status",
                          "outcome",
                          "errorCode"
                        ],
                        "properties": {
                          "status": {
                            "type": "string",
                            "const": "failed"
                          },
                          "outcome": {
                            "type": "string",
                            "const": "failed"
                          },
                          "errorCode": {
                            "type": "string",
                            "const": "message_processing_failed"
                          },
                          "reasonCode": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "acp_dispatch_failed"
                              },
                              {
                                "type": "string",
                                "const": "plugin_bound_error"
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                ]
              },
              {
                "type": "object",
                "required": [
                  "eventType",
                  "schemaVersion",
                  "eventId",
                  "sequence",
                  "sourceSequence",
                  "occurredAt",
                  "redaction",
                  "channel",
                  "conversationKind",
                  "kind",
                  "action",
                  "direction",
                  "actor",
                  "status",
                  "outcome"
                ],
                "properties": {
                  "eventType": {
                    "type": "string",
                    "const": "outbound_message"
                  },
                  "schemaVersion": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                  },
                  "eventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "sourceSequence": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "occurredAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "redaction": {
                    "type": "string",
                    "const": "metadata_only"
                  },
                  "channel": {
                    "type": "string",
                    "minLength": 1
                  },
                  "conversationKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "direct"
                      },
                      {
                        "type": "string",
                        "const": "group"
                      },
                      {
                        "type": "string",
                        "const": "channel"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "durationMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "resultCount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "conversationRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "messageRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "targetRef": {
                    "type": "string",
                    "pattern": "^hmac-sha256:v1:[a-f0-9]{32}:[a-f0-9]{64}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "message"
                  },
                  "action": {
                    "type": "string",
                    "const": "message.outbound.finished"
                  },
                  "direction": {
                    "type": "string",
                    "const": "outbound"
                  },
                  "actor": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "agent"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "deliveryKind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "text"
                      },
                      {
                        "type": "string",
                        "const": "media"
                      },
                      {
                        "type": "string",
                        "const": "other"
                      }
                    ]
                  },
                  "status": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "succeeded"
                      },
                      {
                        "type": "string",
                        "const": "blocked"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "outcome": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "sent"
                      },
                      {
                        "type": "string",
                        "const": "suppressed"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "errorCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "message_delivery_failed"
                      },
                      {
                        "type": "string",
                        "const": "message_delivery_partial_failure"
                      }
                    ]
                  },
                  "reasonCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "cancelled_by_message_sending_hook"
                      },
                      {
                        "type": "string",
                        "const": "cancelled_by_reply_payload_sending_hook"
                      },
                      {
                        "type": "string",
                        "const": "empty_after_message_sending_hook"
                      },
                      {
                        "type": "string",
                        "const": "empty_after_reply_payload_sending_hook"
                      },
                      {
                        "type": "string",
                        "const": "no_visible_payload"
                      }
                    ]
                  },
                  "failureStage": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "platform_send"
                      },
                      {
                        "type": "string",
                        "const": "queue"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  }
                },
                "additionalProperties": false,
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "succeeded"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "sent"
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "reasonCode"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "failureStage"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome",
                              "reasonCode"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "blocked"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "suppressed"
                              },
                              "reasonCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "cancelled_by_message_sending_hook"
                                  },
                                  {
                                    "type": "string",
                                    "const": "cancelled_by_reply_payload_sending_hook"
                                  },
                                  {
                                    "type": "string",
                                    "const": "empty_after_message_sending_hook"
                                  },
                                  {
                                    "type": "string",
                                    "const": "empty_after_reply_payload_sending_hook"
                                  },
                                  {
                                    "type": "string",
                                    "const": "no_visible_payload"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "failureStage"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "deliveryKind"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome",
                              "errorCode",
                              "failureStage"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "failed"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "failed"
                              },
                              "errorCode": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "message_delivery_failed"
                                  },
                                  {
                                    "type": "string",
                                    "const": "message_delivery_partial_failure"
                                  }
                                ]
                              },
                              "failureStage": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "platform_send"
                                  },
                                  {
                                    "type": "string",
                                    "const": "queue"
                                  },
                                  {
                                    "type": "string",
                                    "const": "unknown"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "reasonCode"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "allOf": [
                          {
                            "type": "object",
                            "required": [
                              "status",
                              "outcome",
                              "failureStage"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "unknown"
                              },
                              "outcome": {
                                "type": "string",
                                "const": "unknown"
                              },
                              "failureStage": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "platform_send"
                                  },
                                  {
                                    "type": "string",
                                    "const": "queue"
                                  },
                                  {
                                    "type": "string",
                                    "const": "unknown"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "errorCode"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "reasonCode"
                              ]
                            }
                          },
                          {
                            "not": {
                              "required": [
                                "deliveryKind"
                              ]
                            }
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        },
        "nextCursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AuditEvent": {
      "type": "object",
      "required": [
        "eventId",
        "sequence",
        "sourceSequence",
        "occurredAt",
        "kind",
        "action",
        "status",
        "actor",
        "agentId",
        "runId",
        "redaction"
      ],
      "properties": {
        "eventId": {
          "type": "string",
          "minLength": 1
        },
        "sequence": {
          "type": "integer",
          "minimum": 1
        },
        "sourceSequence": {
          "type": "integer",
          "minimum": 1
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent_run"
            },
            {
              "type": "string",
              "const": "tool_action"
            }
          ]
        },
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent.run.started"
            },
            {
              "type": "string",
              "const": "agent.run.finished"
            },
            {
              "type": "string",
              "const": "tool.action.started"
            },
            {
              "type": "string",
              "const": "tool.action.finished"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "errorCode": {
          "anyOf": [
            {
              "type": "string",
              "const": "run_failed"
            },
            {
              "type": "string",
              "const": "run_cancelled"
            },
            {
              "type": "string",
              "const": "run_timed_out"
            },
            {
              "type": "string",
              "const": "run_blocked"
            },
            {
              "type": "string",
              "const": "tool_failed"
            },
            {
              "type": "string",
              "const": "tool_cancelled"
            },
            {
              "type": "string",
              "const": "tool_timed_out"
            },
            {
              "type": "string",
              "const": "tool_blocked"
            },
            {
              "type": "string",
              "const": "tool_outcome_unknown"
            }
          ]
        },
        "actor": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "toolCallId": {
          "type": "string",
          "minLength": 1
        },
        "toolName": {
          "type": "string",
          "minLength": 1
        },
        "redaction": {
          "type": "string",
          "const": "metadata_only"
        }
      },
      "additionalProperties": false
    },
    "AuditListParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent_run"
            },
            {
              "type": "string",
              "const": "tool_action"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            },
            {
              "type": "string",
              "const": "blocked"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "after": {
          "type": "integer",
          "minimum": 0
        },
        "before": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        },
        "cursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AuditListResult": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "eventId",
              "sequence",
              "sourceSequence",
              "occurredAt",
              "kind",
              "action",
              "status",
              "actor",
              "agentId",
              "runId",
              "redaction"
            ],
            "properties": {
              "eventId": {
                "type": "string",
                "minLength": 1
              },
              "sequence": {
                "type": "integer",
                "minimum": 1
              },
              "sourceSequence": {
                "type": "integer",
                "minimum": 1
              },
              "occurredAt": {
                "type": "integer",
                "minimum": 0
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "agent_run"
                  },
                  {
                    "type": "string",
                    "const": "tool_action"
                  }
                ]
              },
              "action": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "agent.run.started"
                  },
                  {
                    "type": "string",
                    "const": "agent.run.finished"
                  },
                  {
                    "type": "string",
                    "const": "tool.action.started"
                  },
                  {
                    "type": "string",
                    "const": "tool.action.finished"
                  }
                ]
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "started"
                  },
                  {
                    "type": "string",
                    "const": "succeeded"
                  },
                  {
                    "type": "string",
                    "const": "failed"
                  },
                  {
                    "type": "string",
                    "const": "cancelled"
                  },
                  {
                    "type": "string",
                    "const": "timed_out"
                  },
                  {
                    "type": "string",
                    "const": "blocked"
                  },
                  {
                    "type": "string",
                    "const": "unknown"
                  }
                ]
              },
              "errorCode": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "run_failed"
                  },
                  {
                    "type": "string",
                    "const": "run_cancelled"
                  },
                  {
                    "type": "string",
                    "const": "run_timed_out"
                  },
                  {
                    "type": "string",
                    "const": "run_blocked"
                  },
                  {
                    "type": "string",
                    "const": "tool_failed"
                  },
                  {
                    "type": "string",
                    "const": "tool_cancelled"
                  },
                  {
                    "type": "string",
                    "const": "tool_timed_out"
                  },
                  {
                    "type": "string",
                    "const": "tool_blocked"
                  },
                  {
                    "type": "string",
                    "const": "tool_outcome_unknown"
                  }
                ]
              },
              "actor": {
                "type": "object",
                "required": [
                  "type",
                  "id"
                ],
                "properties": {
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "system"
                      }
                    ]
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "runId": {
                "type": "string",
                "minLength": 1
              },
              "toolCallId": {
                "type": "string",
                "minLength": 1
              },
              "toolName": {
                "type": "string",
                "minLength": 1
              },
              "redaction": {
                "type": "string",
                "const": "metadata_only"
              }
            },
            "additionalProperties": false
          }
        },
        "nextCursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestion": {
      "type": "object",
      "required": [
        "id",
        "title",
        "prompt",
        "tldr",
        "cwd",
        "sessionKey",
        "createdAt"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 60
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768
        },
        "tldr": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "cwd": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "agentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionEvent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "action",
            "suggestion"
          ],
          "properties": {
            "action": {
              "type": "string",
              "const": "created"
            },
            "suggestion": {
              "type": "object",
              "required": [
                "id",
                "title",
                "prompt",
                "tldr",
                "cwd",
                "sessionKey",
                "createdAt"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 60
                },
                "prompt": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32768
                },
                "tldr": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "agentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "createdAt": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "action",
            "taskId",
            "resolution"
          ],
          "properties": {
            "action": {
              "type": "string",
              "const": "resolved"
            },
            "taskId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "resolution": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "dismissed"
                },
                {
                  "type": "string",
                  "const": "accepted"
                },
                {
                  "type": "string",
                  "const": "expired"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "TaskSuggestionResolution": {
      "anyOf": [
        {
          "type": "string",
          "const": "dismissed"
        },
        {
          "type": "string",
          "const": "accepted"
        },
        {
          "type": "string",
          "const": "expired"
        }
      ]
    },
    "TaskSuggestionsAcceptParams": {
      "type": "object",
      "required": [
        "taskId"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsAcceptResult": {
      "type": "object",
      "required": [
        "taskId",
        "key"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsCreateParams": {
      "type": "object",
      "required": [
        "title",
        "prompt",
        "tldr",
        "cwd",
        "sessionKey"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 60
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768
        },
        "tldr": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "cwd": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "agentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsCreateResult": {
      "type": "object",
      "required": [
        "taskId",
        "suggestion"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "suggestion": {
          "type": "object",
          "required": [
            "id",
            "title",
            "prompt",
            "tldr",
            "cwd",
            "sessionKey",
            "createdAt"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "prompt": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32768
            },
            "tldr": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            },
            "cwd": {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "agentId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsDismissParams": {
      "type": "object",
      "required": [
        "taskId"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "reason": {
          "type": "string",
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsDismissResult": {
      "type": "object",
      "required": [
        "taskId",
        "dismissed"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "dismissed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsListParams": {
      "type": "object",
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "agentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "TaskSuggestionsListResult": {
      "type": "object",
      "required": [
        "suggestions"
      ],
      "properties": {
        "suggestions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "title",
              "prompt",
              "tldr",
              "cwd",
              "sessionKey",
              "createdAt"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 60
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768
              },
              "tldr": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024
              },
              "cwd": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "agentId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "TaskSummary": {
      "type": "object",
      "required": [
        "id",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string"
        },
        "runtime": {
          "type": "string"
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "queued"
            },
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "completed"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "timed_out"
            }
          ]
        },
        "title": {
          "type": "string"
        },
        "agentId": {
          "type": "string"
        },
        "sessionKey": {
          "type": "string"
        },
        "childSessionKey": {
          "type": "string"
        },
        "ownerKey": {
          "type": "string"
        },
        "runId": {
          "type": "string"
        },
        "taskId": {
          "type": "string"
        },
        "flowId": {
          "type": "string"
        },
        "parentTaskId": {
          "type": "string"
        },
        "sourceId": {
          "type": "string"
        },
        "createdAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0
            }
          ]
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0
            }
          ]
        },
        "startedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0
            }
          ]
        },
        "endedAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "integer",
              "minimum": 0
            }
          ]
        },
        "toolUseCount": {
          "type": "integer",
          "minimum": 0
        },
        "lastToolName": {
          "type": "string"
        },
        "progressSummary": {
          "type": "string"
        },
        "terminalSummary": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "prompt": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TasksListParams": {
      "type": "object",
      "properties": {
        "status": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "const": "queued"
                },
                {
                  "type": "string",
                  "const": "running"
                },
                {
                  "type": "string",
                  "const": "completed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "timed_out"
                }
              ]
            },
            {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "queued"
                  },
                  {
                    "type": "string",
                    "const": "running"
                  },
                  {
                    "type": "string",
                    "const": "completed"
                  },
                  {
                    "type": "string",
                    "const": "failed"
                  },
                  {
                    "type": "string",
                    "const": "cancelled"
                  },
                  {
                    "type": "string",
                    "const": "timed_out"
                  }
                ]
              }
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        },
        "cursor": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TasksListResult": {
      "type": "object",
      "required": [
        "tasks"
      ],
      "properties": {
        "tasks": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "type": "string"
              },
              "runtime": {
                "type": "string"
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "queued"
                  },
                  {
                    "type": "string",
                    "const": "running"
                  },
                  {
                    "type": "string",
                    "const": "completed"
                  },
                  {
                    "type": "string",
                    "const": "failed"
                  },
                  {
                    "type": "string",
                    "const": "cancelled"
                  },
                  {
                    "type": "string",
                    "const": "timed_out"
                  }
                ]
              },
              "title": {
                "type": "string"
              },
              "agentId": {
                "type": "string"
              },
              "sessionKey": {
                "type": "string"
              },
              "childSessionKey": {
                "type": "string"
              },
              "ownerKey": {
                "type": "string"
              },
              "runId": {
                "type": "string"
              },
              "taskId": {
                "type": "string"
              },
              "flowId": {
                "type": "string"
              },
              "parentTaskId": {
                "type": "string"
              },
              "sourceId": {
                "type": "string"
              },
              "createdAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 0
                  }
                ]
              },
              "updatedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 0
                  }
                ]
              },
              "startedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 0
                  }
                ]
              },
              "endedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer",
                    "minimum": 0
                  }
                ]
              },
              "toolUseCount": {
                "type": "integer",
                "minimum": 0
              },
              "lastToolName": {
                "type": "string"
              },
              "progressSummary": {
                "type": "string"
              },
              "terminalSummary": {
                "type": "string"
              },
              "error": {
                "type": "string"
              },
              "prompt": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "nextCursor": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TasksGetParams": {
      "type": "object",
      "required": [
        "taskId"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TasksGetResult": {
      "type": "object",
      "required": [
        "task"
      ],
      "properties": {
        "task": {
          "type": "object",
          "required": [
            "id",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "string"
            },
            "runtime": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "queued"
                },
                {
                  "type": "string",
                  "const": "running"
                },
                {
                  "type": "string",
                  "const": "completed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "timed_out"
                }
              ]
            },
            "title": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "sessionKey": {
              "type": "string"
            },
            "childSessionKey": {
              "type": "string"
            },
            "ownerKey": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "flowId": {
              "type": "string"
            },
            "parentTaskId": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "createdAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "updatedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "startedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "endedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "toolUseCount": {
              "type": "integer",
              "minimum": 0
            },
            "lastToolName": {
              "type": "string"
            },
            "progressSummary": {
              "type": "string"
            },
            "terminalSummary": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TasksCancelParams": {
      "type": "object",
      "required": [
        "taskId"
      ],
      "properties": {
        "taskId": {
          "type": "string",
          "minLength": 1
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TasksCancelResult": {
      "type": "object",
      "required": [
        "found",
        "cancelled"
      ],
      "properties": {
        "found": {
          "type": "boolean"
        },
        "cancelled": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "task": {
          "type": "object",
          "required": [
            "id",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "string"
            },
            "runtime": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "queued"
                },
                {
                  "type": "string",
                  "const": "running"
                },
                {
                  "type": "string",
                  "const": "completed"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "timed_out"
                }
              ]
            },
            "title": {
              "type": "string"
            },
            "agentId": {
              "type": "string"
            },
            "sessionKey": {
              "type": "string"
            },
            "childSessionKey": {
              "type": "string"
            },
            "ownerKey": {
              "type": "string"
            },
            "runId": {
              "type": "string"
            },
            "taskId": {
              "type": "string"
            },
            "flowId": {
              "type": "string"
            },
            "parentTaskId": {
              "type": "string"
            },
            "sourceId": {
              "type": "string"
            },
            "createdAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "updatedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "startedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "endedAt": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer",
                  "minimum": 0
                }
              ]
            },
            "toolUseCount": {
              "type": "integer",
              "minimum": 0
            },
            "lastToolName": {
              "type": "string"
            },
            "progressSummary": {
              "type": "string"
            },
            "terminalSummary": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ConfigGetParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "ConfigSetParams": {
      "type": "object",
      "required": [
        "raw"
      ],
      "properties": {
        "raw": {
          "type": "string",
          "minLength": 1
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConfigApplyParams": {
      "type": "object",
      "required": [
        "raw"
      ],
      "properties": {
        "raw": {
          "type": "string",
          "minLength": 1
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string"
        },
        "deliveryContext": {
          "type": "object",
          "properties": {
            "channel": {
              "type": "string"
            },
            "to": {
              "type": "string"
            },
            "accountId": {
              "type": "string"
            },
            "threadId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "note": {
          "type": "string"
        },
        "restartDelayMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ConfigPatchParams": {
      "type": "object",
      "required": [
        "raw"
      ],
      "properties": {
        "raw": {
          "type": "string",
          "minLength": 1
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string"
        },
        "deliveryContext": {
          "type": "object",
          "properties": {
            "channel": {
              "type": "string"
            },
            "to": {
              "type": "string"
            },
            "accountId": {
              "type": "string"
            },
            "threadId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "note": {
          "type": "string"
        },
        "restartDelayMs": {
          "type": "integer",
          "minimum": 0
        },
        "replacePaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "maxItems": 256
        }
      },
      "additionalProperties": false
    },
    "ConfigSchemaParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "ConfigSchemaLookupParams": {
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^[A-Za-z0-9_./\\[\\]\\-*]+$"
        }
      },
      "additionalProperties": false
    },
    "ConfigSchemaResponse": {
      "type": "object",
      "required": [
        "schema",
        "uiHints",
        "version",
        "generatedAt"
      ],
      "properties": {
        "schema": {},
        "uiHints": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "help": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "group": {
                  "type": "string"
                },
                "order": {
                  "type": "integer"
                },
                "advanced": {
                  "type": "boolean"
                },
                "sensitive": {
                  "type": "boolean"
                },
                "placeholder": {
                  "type": "string"
                },
                "presentation": {
                  "type": "string",
                  "const": "phone-number"
                },
                "itemTemplate": {}
              },
              "additionalProperties": false
            }
          }
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "generatedAt": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ConfigSchemaLookupResult": {
      "type": "object",
      "required": [
        "path",
        "schema",
        "children"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "schema": {},
        "reloadKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "restart"
            },
            {
              "type": "string",
              "const": "hot"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "hint": {
          "type": "object",
          "properties": {
            "label": {
              "type": "string"
            },
            "help": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "group": {
              "type": "string"
            },
            "order": {
              "type": "integer"
            },
            "advanced": {
              "type": "boolean"
            },
            "sensitive": {
              "type": "boolean"
            },
            "placeholder": {
              "type": "string"
            },
            "presentation": {
              "type": "string",
              "const": "phone-number"
            },
            "itemTemplate": {}
          },
          "additionalProperties": false
        },
        "hintPath": {
          "type": "string"
        },
        "children": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "key",
              "path",
              "required",
              "hasChildren"
            ],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              },
              "required": {
                "type": "boolean"
              },
              "hasChildren": {
                "type": "boolean"
              },
              "reloadKind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "restart"
                  },
                  {
                    "type": "string",
                    "const": "hot"
                  },
                  {
                    "type": "string",
                    "const": "none"
                  }
                ]
              },
              "hint": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "help": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "group": {
                    "type": "string"
                  },
                  "order": {
                    "type": "integer"
                  },
                  "advanced": {
                    "type": "boolean"
                  },
                  "sensitive": {
                    "type": "boolean"
                  },
                  "placeholder": {
                    "type": "string"
                  },
                  "presentation": {
                    "type": "string",
                    "const": "phone-number"
                  },
                  "itemTemplate": {}
                },
                "additionalProperties": false
              },
              "hintPath": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SystemAgentChatParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "welcomeVariant": {
          "anyOf": [
            {
              "type": "string",
              "const": "onboarding"
            },
            {
              "type": "string",
              "const": "new-agent"
            }
          ]
        },
        "reset": {
          "type": "boolean"
        },
        "delegation": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "turnSourceChannel": {
              "type": "string",
              "minLength": 1
            },
            "turnSourceTo": {
              "type": "string",
              "minLength": 1
            },
            "turnSourceAccountId": {
              "type": "string",
              "minLength": 1
            },
            "turnSourceThreadId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SystemAgentChatResult": {
      "type": "object",
      "required": [
        "sessionId",
        "reply",
        "action"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "reply": {
          "type": "string",
          "minLength": 1
        },
        "sensitive": {
          "type": "boolean"
        },
        "wizardInputPending": {
          "type": "boolean"
        },
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "open-agent"
            },
            {
              "type": "string",
              "const": "exit"
            }
          ]
        },
        "agentDraft": {
          "type": "string",
          "const": "hatch"
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "needsApproval": {
          "type": "boolean"
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "question": {
          "type": "object",
          "required": [
            "id",
            "header",
            "question",
            "options"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "header": {
              "type": "string",
              "minLength": 1
            },
            "question": {
              "type": "string",
              "minLength": 1
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "label"
                ],
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "recommended": {
                    "type": "boolean"
                  },
                  "reply": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "minItems": 2,
              "maxItems": 4
            },
            "isOther": {
              "type": "boolean"
            },
            "skipAction": {
              "type": "string",
              "const": "exit"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SystemAgentChatHistoryParams": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "default": 100
        }
      },
      "additionalProperties": false
    },
    "SystemAgentChatHistoryTurn": {
      "type": "object",
      "required": [
        "role",
        "text",
        "at"
      ],
      "properties": {
        "role": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            },
            {
              "type": "string",
              "const": "assistant"
            }
          ]
        },
        "text": {
          "type": "string"
        },
        "at": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "SystemAgentChatHistoryResult": {
      "type": "object",
      "required": [
        "turns"
      ],
      "properties": {
        "turns": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "role",
              "text",
              "at"
            ],
            "properties": {
              "role": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "user"
                  },
                  {
                    "type": "string",
                    "const": "assistant"
                  }
                ]
              },
              "text": {
                "type": "string"
              },
              "at": {
                "type": "number"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SystemChangeEntry": {
      "type": "object",
      "required": [
        "id",
        "at",
        "kind",
        "source",
        "summary"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "at": {
          "type": "number"
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "operation"
            },
            {
              "type": "string",
              "const": "config-write"
            },
            {
              "type": "string",
              "const": "external-edit"
            }
          ]
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "system-agent"
            },
            {
              "type": "string",
              "const": "doctor"
            },
            {
              "type": "string",
              "const": "config-rpc"
            },
            {
              "type": "string",
              "const": "cli"
            },
            {
              "type": "string",
              "const": "plugin-install"
            },
            {
              "type": "string",
              "const": "external"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "summary": {
          "type": "string"
        },
        "changedPaths": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "invalid": {
          "type": "boolean"
        },
        "opaqueChange": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SystemChangeKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "operation"
        },
        {
          "type": "string",
          "const": "config-write"
        },
        {
          "type": "string",
          "const": "external-edit"
        }
      ]
    },
    "SystemChangeSource": {
      "anyOf": [
        {
          "type": "string",
          "const": "system-agent"
        },
        {
          "type": "string",
          "const": "doctor"
        },
        {
          "type": "string",
          "const": "config-rpc"
        },
        {
          "type": "string",
          "const": "cli"
        },
        {
          "type": "string",
          "const": "plugin-install"
        },
        {
          "type": "string",
          "const": "external"
        },
        {
          "type": "string",
          "const": "unknown"
        }
      ]
    },
    "SystemChangesListParams": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        },
        "beforeCursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SystemChangesListResult": {
      "type": "object",
      "required": [
        "entries"
      ],
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "at",
              "kind",
              "source",
              "summary"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "at": {
                "type": "number"
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "operation"
                  },
                  {
                    "type": "string",
                    "const": "config-write"
                  },
                  {
                    "type": "string",
                    "const": "external-edit"
                  }
                ]
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "system-agent"
                  },
                  {
                    "type": "string",
                    "const": "doctor"
                  },
                  {
                    "type": "string",
                    "const": "config-rpc"
                  },
                  {
                    "type": "string",
                    "const": "cli"
                  },
                  {
                    "type": "string",
                    "const": "plugin-install"
                  },
                  {
                    "type": "string",
                    "const": "external"
                  },
                  {
                    "type": "string",
                    "const": "unknown"
                  }
                ]
              },
              "summary": {
                "type": "string"
              },
              "changedPaths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "invalid": {
                "type": "boolean"
              },
              "opaqueChange": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "nextCursor": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SystemAgentSetupDetectParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SystemAgentSetupDetectResult": {
      "type": "object",
      "required": [
        "candidates",
        "manualProviders",
        "workspace",
        "setupComplete"
      ],
      "properties": {
        "candidates": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "label",
              "detail",
              "modelRef",
              "recommended"
            ],
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "existing-model"
                  },
                  {
                    "type": "string",
                    "const": "openai-api-key"
                  },
                  {
                    "type": "string",
                    "const": "anthropic-api-key"
                  },
                  {
                    "type": "string",
                    "const": "claude-cli"
                  },
                  {
                    "type": "string",
                    "const": "codex-cli"
                  },
                  {
                    "type": "string",
                    "const": "gemini-cli"
                  },
                  {
                    "type": "string",
                    "pattern": "^provider-auto:.+$"
                  }
                ]
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "detail": {
                "type": "string"
              },
              "modelRef": {
                "type": "string",
                "minLength": 1
              },
              "recommended": {
                "type": "boolean"
              },
              "credentials": {
                "type": "boolean"
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              }
            },
            "additionalProperties": false
          }
        },
        "unavailableCandidates": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "detail",
              "reason"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "detail": {
                "type": "string"
              },
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "manualProviders": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "hint": {
                "type": "string"
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              }
            },
            "additionalProperties": false
          }
        },
        "authOptions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "kind",
              "featured"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "hint": {
                "type": "string"
              },
              "groupLabel": {
                "type": "string"
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "oauth"
                  },
                  {
                    "type": "string",
                    "const": "device-code"
                  }
                ]
              },
              "featured": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "recommendedInstalls": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "hint",
              "website",
              "icon"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "hint": {
                "type": "string",
                "minLength": 1
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              }
            },
            "additionalProperties": false
          }
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "codexAppServerDetected": {
          "type": "boolean"
        },
        "configuredModel": {
          "type": "string"
        },
        "setupComplete": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SystemAgentSetupVerifyParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SystemAgentSetupVerifyResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "ok",
            "modelRef",
            "latencyMs"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "modelRef": {
              "type": "string",
              "minLength": 1
            },
            "latencyMs": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ok",
            "status",
            "error"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": false
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "auth"
                },
                {
                  "type": "string",
                  "const": "rate_limit"
                },
                {
                  "type": "string",
                  "const": "billing"
                },
                {
                  "type": "string",
                  "const": "timeout"
                },
                {
                  "type": "string",
                  "const": "format"
                },
                {
                  "type": "string",
                  "const": "unavailable"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SystemAgentSetupActivateParams": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "existing-model"
            },
            {
              "type": "string",
              "const": "openai-api-key"
            },
            {
              "type": "string",
              "const": "anthropic-api-key"
            },
            {
              "type": "string",
              "const": "claude-cli"
            },
            {
              "type": "string",
              "const": "codex-cli"
            },
            {
              "type": "string",
              "const": "gemini-cli"
            },
            {
              "type": "string",
              "pattern": "^provider-auto:.+$"
            },
            {
              "type": "string",
              "const": "api-key"
            }
          ]
        },
        "modelRef": {
          "type": "string",
          "minLength": 1
        },
        "authChoice": {
          "type": "string"
        },
        "apiKey": {
          "type": "string"
        },
        "workspace": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SystemAgentSetupActivateResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "modelRef": {
          "type": "string"
        },
        "latencyMs": {
          "type": "number"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "auth"
            },
            {
              "type": "string",
              "const": "rate_limit"
            },
            {
              "type": "string",
              "const": "billing"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "format"
            },
            {
              "type": "string",
              "const": "unavailable"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "error": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SystemAgentSetupAuthStartParams": {
      "type": "object",
      "required": [
        "sessionId",
        "authChoice"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "authChoice": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SystemAgentSetupAuthStartResult": {
      "type": "object",
      "required": [
        "sessionId",
        "done"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "done": {
          "type": "boolean"
        },
        "step": {
          "type": "object",
          "required": [
            "id",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "note"
                },
                {
                  "type": "string",
                  "const": "select"
                },
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "confirm"
                },
                {
                  "type": "string",
                  "const": "multiselect"
                },
                {
                  "type": "string",
                  "const": "progress"
                },
                {
                  "type": "string",
                  "const": "action"
                }
              ]
            },
            "title": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "format": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "plain"
                }
              ]
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "label"
                ],
                "properties": {
                  "value": {},
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "hint": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "initialValue": {},
            "placeholder": {
              "type": "string"
            },
            "sensitive": {
              "type": "boolean"
            },
            "executor": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "gateway"
                },
                {
                  "type": "string",
                  "const": "client"
                }
              ]
            },
            "externalUrl": {
              "type": "string"
            },
            "deviceCode": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1
                },
                "expiresInMinutes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1440
                },
                "message": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "error": {
          "type": "string"
        },
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "channel",
              "accountId"
            ],
            "properties": {
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "WizardStartParams": {
      "type": "object",
      "properties": {
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "local"
            },
            {
              "type": "string",
              "const": "remote"
            }
          ]
        },
        "workspace": {
          "type": "string"
        },
        "flow": {
          "anyOf": [
            {
              "type": "string",
              "const": "setup"
            },
            {
              "type": "string",
              "const": "channels"
            }
          ]
        },
        "channel": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WizardNextParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "answer": {
          "type": "object",
          "required": [
            "stepId"
          ],
          "properties": {
            "stepId": {
              "type": "string",
              "minLength": 1
            },
            "value": {}
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "WizardCancelParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WizardStatusParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WizardStep": {
      "type": "object",
      "required": [
        "id",
        "type"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "anyOf": [
            {
              "type": "string",
              "const": "note"
            },
            {
              "type": "string",
              "const": "select"
            },
            {
              "type": "string",
              "const": "text"
            },
            {
              "type": "string",
              "const": "confirm"
            },
            {
              "type": "string",
              "const": "multiselect"
            },
            {
              "type": "string",
              "const": "progress"
            },
            {
              "type": "string",
              "const": "action"
            }
          ]
        },
        "title": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "format": {
          "anyOf": [
            {
              "type": "string",
              "const": "plain"
            }
          ]
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "value",
              "label"
            ],
            "properties": {
              "value": {},
              "label": {
                "type": "string",
                "minLength": 1
              },
              "hint": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "initialValue": {},
        "placeholder": {
          "type": "string"
        },
        "sensitive": {
          "type": "boolean"
        },
        "executor": {
          "anyOf": [
            {
              "type": "string",
              "const": "gateway"
            },
            {
              "type": "string",
              "const": "client"
            }
          ]
        },
        "externalUrl": {
          "type": "string"
        },
        "deviceCode": {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "expiresInMinutes": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1440
            },
            "message": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "WizardNextResult": {
      "type": "object",
      "required": [
        "done"
      ],
      "properties": {
        "done": {
          "type": "boolean"
        },
        "step": {
          "type": "object",
          "required": [
            "id",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "note"
                },
                {
                  "type": "string",
                  "const": "select"
                },
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "confirm"
                },
                {
                  "type": "string",
                  "const": "multiselect"
                },
                {
                  "type": "string",
                  "const": "progress"
                },
                {
                  "type": "string",
                  "const": "action"
                }
              ]
            },
            "title": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "format": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "plain"
                }
              ]
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "label"
                ],
                "properties": {
                  "value": {},
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "hint": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "initialValue": {},
            "placeholder": {
              "type": "string"
            },
            "sensitive": {
              "type": "boolean"
            },
            "executor": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "gateway"
                },
                {
                  "type": "string",
                  "const": "client"
                }
              ]
            },
            "externalUrl": {
              "type": "string"
            },
            "deviceCode": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1
                },
                "expiresInMinutes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1440
                },
                "message": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "error": {
          "type": "string"
        },
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "channel",
              "accountId"
            ],
            "properties": {
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "WizardStartResult": {
      "type": "object",
      "required": [
        "sessionId",
        "done"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "done": {
          "type": "boolean"
        },
        "step": {
          "type": "object",
          "required": [
            "id",
            "type"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "note"
                },
                {
                  "type": "string",
                  "const": "select"
                },
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "confirm"
                },
                {
                  "type": "string",
                  "const": "multiselect"
                },
                {
                  "type": "string",
                  "const": "progress"
                },
                {
                  "type": "string",
                  "const": "action"
                }
              ]
            },
            "title": {
              "type": "string"
            },
            "message": {
              "type": "string"
            },
            "format": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "plain"
                }
              ]
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "value",
                  "label"
                ],
                "properties": {
                  "value": {},
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "hint": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "initialValue": {},
            "placeholder": {
              "type": "string"
            },
            "sensitive": {
              "type": "boolean"
            },
            "executor": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "gateway"
                },
                {
                  "type": "string",
                  "const": "client"
                }
              ]
            },
            "externalUrl": {
              "type": "string"
            },
            "deviceCode": {
              "type": "object",
              "required": [
                "code"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1
                },
                "expiresInMinutes": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1440
                },
                "message": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "error": {
          "type": "string"
        },
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "accounts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "channel",
              "accountId"
            ],
            "properties": {
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "WizardStatusResult": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "error": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TalkModeParams": {
      "type": "object",
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "phase": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TalkEvent": {
      "type": "object",
      "required": [
        "id",
        "type",
        "sessionId",
        "seq",
        "timestamp",
        "mode",
        "transport",
        "brain",
        "payload"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "anyOf": [
            {
              "type": "string",
              "const": "session.started"
            },
            {
              "type": "string",
              "const": "session.ready"
            },
            {
              "type": "string",
              "const": "session.closed"
            },
            {
              "type": "string",
              "const": "session.error"
            },
            {
              "type": "string",
              "const": "session.replaced"
            },
            {
              "type": "string",
              "const": "turn.started"
            },
            {
              "type": "string",
              "const": "turn.ended"
            },
            {
              "type": "string",
              "const": "turn.cancelled"
            },
            {
              "type": "string",
              "const": "capture.started"
            },
            {
              "type": "string",
              "const": "capture.stopped"
            },
            {
              "type": "string",
              "const": "capture.cancelled"
            },
            {
              "type": "string",
              "const": "capture.once"
            },
            {
              "type": "string",
              "const": "input.audio.delta"
            },
            {
              "type": "string",
              "const": "input.audio.committed"
            },
            {
              "type": "string",
              "const": "transcript.delta"
            },
            {
              "type": "string",
              "const": "transcript.done"
            },
            {
              "type": "string",
              "const": "output.text.delta"
            },
            {
              "type": "string",
              "const": "output.text.done"
            },
            {
              "type": "string",
              "const": "output.audio.started"
            },
            {
              "type": "string",
              "const": "output.audio.delta"
            },
            {
              "type": "string",
              "const": "output.audio.done"
            },
            {
              "type": "string",
              "const": "tool.call"
            },
            {
              "type": "string",
              "const": "tool.progress"
            },
            {
              "type": "string",
              "const": "tool.result"
            },
            {
              "type": "string",
              "const": "tool.error"
            },
            {
              "type": "string",
              "const": "usage.metrics"
            },
            {
              "type": "string",
              "const": "latency.metrics"
            },
            {
              "type": "string",
              "const": "health.changed"
            }
          ]
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string"
        },
        "captureId": {
          "type": "string"
        },
        "seq": {
          "type": "integer",
          "minimum": 1
        },
        "timestamp": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "realtime"
            },
            {
              "type": "string",
              "const": "stt-tts"
            },
            {
              "type": "string",
              "const": "transcription"
            }
          ]
        },
        "transport": {
          "anyOf": [
            {
              "type": "string",
              "const": "webrtc"
            },
            {
              "type": "string",
              "const": "provider-websocket"
            },
            {
              "type": "string",
              "const": "gateway-relay"
            },
            {
              "type": "string",
              "const": "managed-room"
            }
          ]
        },
        "brain": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent-consult"
            },
            {
              "type": "string",
              "const": "direct-tools"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "provider": {
          "type": "string"
        },
        "final": {
          "type": "boolean"
        },
        "callId": {
          "type": "string"
        },
        "itemId": {
          "type": "string"
        },
        "parentId": {
          "type": "string"
        },
        "payload": {}
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "turn.started",
                  "turn.ended",
                  "turn.cancelled",
                  "input.audio.delta",
                  "input.audio.committed",
                  "transcript.delta",
                  "transcript.done",
                  "output.text.delta",
                  "output.text.done",
                  "output.audio.started",
                  "output.audio.delta",
                  "output.audio.done",
                  "tool.call",
                  "tool.progress",
                  "tool.result",
                  "tool.error"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "turnId"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "enum": [
                  "capture.started",
                  "capture.stopped",
                  "capture.cancelled",
                  "capture.once"
                ]
              }
            },
            "required": [
              "type"
            ]
          },
          "then": {
            "required": [
              "captureId"
            ]
          }
        }
      ]
    },
    "TalkCatalogParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "TalkCatalogResult": {
      "type": "object",
      "required": [
        "modes",
        "transports",
        "brains",
        "speech",
        "transcription",
        "realtime"
      ],
      "properties": {
        "modes": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "realtime"
              },
              {
                "type": "string",
                "const": "stt-tts"
              },
              {
                "type": "string",
                "const": "transcription"
              }
            ]
          }
        },
        "transports": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "webrtc"
              },
              {
                "type": "string",
                "const": "provider-websocket"
              },
              {
                "type": "string",
                "const": "gateway-relay"
              },
              {
                "type": "string",
                "const": "managed-room"
              }
            ]
          }
        },
        "brains": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "agent-consult"
              },
              {
                "type": "string",
                "const": "direct-tools"
              },
              {
                "type": "string",
                "const": "none"
              }
            ]
          }
        },
        "speech": {
          "type": "object",
          "required": [
            "providers"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "activeProvider": {
              "type": "string"
            },
            "providers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "label",
                  "configured"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "configured": {
                    "type": "boolean"
                  },
                  "aliases": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "voices": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultModel": {
                    "type": "string"
                  },
                  "modes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "realtime"
                        },
                        {
                          "type": "string",
                          "const": "stt-tts"
                        },
                        {
                          "type": "string",
                          "const": "transcription"
                        }
                      ]
                    }
                  },
                  "transports": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "webrtc"
                        },
                        {
                          "type": "string",
                          "const": "provider-websocket"
                        },
                        {
                          "type": "string",
                          "const": "gateway-relay"
                        },
                        {
                          "type": "string",
                          "const": "managed-room"
                        }
                      ]
                    }
                  },
                  "brains": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "agent-consult"
                        },
                        {
                          "type": "string",
                          "const": "direct-tools"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        }
                      ]
                    }
                  },
                  "inputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "outputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "supportsBrowserSession": {
                    "type": "boolean"
                  },
                  "supportsBargeIn": {
                    "type": "boolean"
                  },
                  "supportsToolCalls": {
                    "type": "boolean"
                  },
                  "supportsVideoFrames": {
                    "type": "boolean"
                  },
                  "supportsSessionResumption": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "transcription": {
          "type": "object",
          "required": [
            "providers"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "activeProvider": {
              "type": "string"
            },
            "providers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "label",
                  "configured"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "configured": {
                    "type": "boolean"
                  },
                  "aliases": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "voices": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultModel": {
                    "type": "string"
                  },
                  "modes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "realtime"
                        },
                        {
                          "type": "string",
                          "const": "stt-tts"
                        },
                        {
                          "type": "string",
                          "const": "transcription"
                        }
                      ]
                    }
                  },
                  "transports": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "webrtc"
                        },
                        {
                          "type": "string",
                          "const": "provider-websocket"
                        },
                        {
                          "type": "string",
                          "const": "gateway-relay"
                        },
                        {
                          "type": "string",
                          "const": "managed-room"
                        }
                      ]
                    }
                  },
                  "brains": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "agent-consult"
                        },
                        {
                          "type": "string",
                          "const": "direct-tools"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        }
                      ]
                    }
                  },
                  "inputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "outputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "supportsBrowserSession": {
                    "type": "boolean"
                  },
                  "supportsBargeIn": {
                    "type": "boolean"
                  },
                  "supportsToolCalls": {
                    "type": "boolean"
                  },
                  "supportsVideoFrames": {
                    "type": "boolean"
                  },
                  "supportsSessionResumption": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "realtime": {
          "type": "object",
          "required": [
            "providers"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "activeProvider": {
              "type": "string"
            },
            "providers": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "label",
                  "configured"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1
                  },
                  "configured": {
                    "type": "boolean"
                  },
                  "aliases": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "models": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "voices": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "defaultModel": {
                    "type": "string"
                  },
                  "modes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "realtime"
                        },
                        {
                          "type": "string",
                          "const": "stt-tts"
                        },
                        {
                          "type": "string",
                          "const": "transcription"
                        }
                      ]
                    }
                  },
                  "transports": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "webrtc"
                        },
                        {
                          "type": "string",
                          "const": "provider-websocket"
                        },
                        {
                          "type": "string",
                          "const": "gateway-relay"
                        },
                        {
                          "type": "string",
                          "const": "managed-room"
                        }
                      ]
                    }
                  },
                  "brains": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "agent-consult"
                        },
                        {
                          "type": "string",
                          "const": "direct-tools"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        }
                      ]
                    }
                  },
                  "inputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "outputAudioFormats": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "encoding",
                        "sampleRateHz",
                        "channels"
                      ],
                      "properties": {
                        "encoding": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "pcm16"
                            },
                            {
                              "type": "string",
                              "const": "g711_ulaw"
                            }
                          ]
                        },
                        "sampleRateHz": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channels": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "supportsBrowserSession": {
                    "type": "boolean"
                  },
                  "supportsBargeIn": {
                    "type": "boolean"
                  },
                  "supportsToolCalls": {
                    "type": "boolean"
                  },
                  "supportsVideoFrames": {
                    "type": "boolean"
                  },
                  "supportsSessionResumption": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TalkClientCreateParams": {
      "type": "object",
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "voiceSessionId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        },
        "vadThreshold": {
          "type": "number"
        },
        "silenceDurationMs": {
          "type": "integer",
          "minimum": 1
        },
        "prefixPaddingMs": {
          "type": "integer",
          "minimum": 0
        },
        "reasoningEffort": {
          "type": "string"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "realtime"
            },
            {
              "type": "string",
              "const": "stt-tts"
            },
            {
              "type": "string",
              "const": "transcription"
            }
          ]
        },
        "transport": {
          "anyOf": [
            {
              "type": "string",
              "const": "webrtc"
            },
            {
              "type": "string",
              "const": "provider-websocket"
            },
            {
              "type": "string",
              "const": "gateway-relay"
            },
            {
              "type": "string",
              "const": "managed-room"
            }
          ]
        },
        "brain": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent-consult"
            },
            {
              "type": "string",
              "const": "direct-tools"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "camera-frame"
              },
              {
                "type": "string",
                "const": "voice-transcript"
              }
            ]
          },
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "TalkClientCreateResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "provider",
            "transport",
            "voiceSessionId",
            "clientSecret"
          ],
          "properties": {
            "provider": {
              "type": "string",
              "minLength": 1
            },
            "transport": {
              "type": "string",
              "const": "webrtc"
            },
            "voiceSessionId": {
              "type": "string",
              "minLength": 1
            },
            "clientSecret": {
              "type": "string",
              "minLength": 1
            },
            "offerUrl": {
              "type": "string"
            },
            "offerHeaders": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "string"
                }
              }
            },
            "model": {
              "type": "string"
            },
            "voice": {
              "type": "string"
            },
            "expiresAt": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "provider",
            "transport",
            "voiceSessionId",
            "protocol",
            "clientSecret",
            "websocketUrl",
            "audio"
          ],
          "properties": {
            "provider": {
              "type": "string",
              "minLength": 1
            },
            "transport": {
              "type": "string",
              "const": "provider-websocket"
            },
            "voiceSessionId": {
              "type": "string",
              "minLength": 1
            },
            "protocol": {
              "type": "string",
              "minLength": 1
            },
            "clientSecret": {
              "type": "string",
              "minLength": 1
            },
            "websocketUrl": {
              "type": "string",
              "minLength": 1
            },
            "audio": {
              "type": "object",
              "required": [
                "inputEncoding",
                "inputSampleRateHz",
                "outputEncoding",
                "outputSampleRateHz"
              ],
              "properties": {
                "inputEncoding": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pcm16"
                    },
                    {
                      "type": "string",
                      "const": "g711_ulaw"
                    }
                  ]
                },
                "inputSampleRateHz": {
                  "type": "integer",
                  "minimum": 1
                },
                "outputEncoding": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pcm16"
                    },
                    {
                      "type": "string",
                      "const": "g711_ulaw"
                    }
                  ]
                },
                "outputSampleRateHz": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "initialMessage": {},
            "model": {
              "type": "string"
            },
            "voice": {
              "type": "string"
            },
            "expiresAt": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "provider",
            "transport",
            "relaySessionId",
            "audio"
          ],
          "properties": {
            "provider": {
              "type": "string",
              "minLength": 1
            },
            "transport": {
              "type": "string",
              "const": "gateway-relay"
            },
            "voiceSessionId": {
              "type": "string",
              "minLength": 1
            },
            "relaySessionId": {
              "type": "string",
              "minLength": 1
            },
            "audio": {
              "type": "object",
              "required": [
                "inputEncoding",
                "inputSampleRateHz",
                "outputEncoding",
                "outputSampleRateHz"
              ],
              "properties": {
                "inputEncoding": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pcm16"
                    },
                    {
                      "type": "string",
                      "const": "g711_ulaw"
                    }
                  ]
                },
                "inputSampleRateHz": {
                  "type": "integer",
                  "minimum": 1
                },
                "outputEncoding": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pcm16"
                    },
                    {
                      "type": "string",
                      "const": "g711_ulaw"
                    }
                  ]
                },
                "outputSampleRateHz": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "model": {
              "type": "string"
            },
            "voice": {
              "type": "string"
            },
            "expiresAt": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "provider",
            "transport",
            "roomUrl"
          ],
          "properties": {
            "provider": {
              "type": "string",
              "minLength": 1
            },
            "transport": {
              "type": "string",
              "const": "managed-room"
            },
            "voiceSessionId": {
              "type": "string",
              "minLength": 1
            },
            "roomUrl": {
              "type": "string",
              "minLength": 1
            },
            "token": {
              "type": "string"
            },
            "model": {
              "type": "string"
            },
            "voice": {
              "type": "string"
            },
            "expiresAt": {
              "type": "number"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "TalkClientCloseParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "voiceSessionId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "voiceSessionId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        }
      },
      "additionalProperties": false
    },
    "TalkClientMutationResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "TalkClientSteerParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "text"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "status"
            },
            {
              "type": "string",
              "const": "steer"
            },
            {
              "type": "string",
              "const": "cancel"
            },
            {
              "type": "string",
              "const": "followup"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "TalkAgentControlResult": {
      "type": "object",
      "required": [
        "ok",
        "mode",
        "sessionKey",
        "active",
        "message",
        "speak",
        "show",
        "suppress"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "status"
            },
            {
              "type": "string",
              "const": "steer"
            },
            {
              "type": "string",
              "const": "cancel"
            },
            {
              "type": "string",
              "const": "followup"
            }
          ]
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "active": {
          "type": "boolean"
        },
        "queued": {
          "type": "boolean"
        },
        "aborted": {
          "type": "boolean"
        },
        "target": {
          "anyOf": [
            {
              "type": "string",
              "const": "embedded_run"
            },
            {
              "type": "string",
              "const": "reply_run"
            }
          ]
        },
        "reason": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "speak": {
          "type": "boolean"
        },
        "show": {
          "type": "boolean"
        },
        "suppress": {
          "type": "boolean"
        },
        "providerResult": {
          "type": "object",
          "required": [
            "status",
            "message"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "cancelled"
            },
            "message": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "enqueuedAtMs": {
          "type": "number"
        },
        "deliveredAtMs": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TalkClientToolCallParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "callId",
        "name"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "voiceSessionId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        },
        "callId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "args": {},
        "relaySessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TalkClientToolCallResult": {
      "type": "object",
      "required": [
        "runId",
        "idempotencyKey"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TalkClientTranscriptParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "voiceSessionId",
        "entryId",
        "role",
        "text"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "voiceSessionId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        },
        "entryId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{1,128}$"
        },
        "role": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            },
            {
              "type": "string",
              "const": "assistant"
            }
          ]
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "timestamp": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TalkConfigParams": {
      "type": "object",
      "properties": {
        "includeSecrets": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "TalkConfigResult": {
      "type": "object",
      "required": [
        "config"
      ],
      "properties": {
        "config": {
          "type": "object",
          "properties": {
            "talk": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string"
                },
                "providers": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "object",
                      "properties": {
                        "apiKey": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "env"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "file"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "anyOf": [
                                        {
                                          "const": "value"
                                        },
                                        {
                                          "allOf": [
                                            {
                                              "pattern": "^/"
                                            },
                                            {
                                              "not": {
                                                "pattern": "~(?:[^01]|$)"
                                              }
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "exec"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9][A-Za-z0-9._:/#-]{0,255}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            }
                          ]
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                },
                "realtime": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "providers": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "object",
                          "properties": {
                            "apiKey": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "required": [
                                        "source",
                                        "provider",
                                        "id"
                                      ],
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "env"
                                        },
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "required": [
                                        "source",
                                        "provider",
                                        "id"
                                      ],
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "file"
                                        },
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "anyOf": [
                                            {
                                              "const": "value"
                                            },
                                            {
                                              "allOf": [
                                                {
                                                  "pattern": "^/"
                                                },
                                                {
                                                  "not": {
                                                    "pattern": "~(?:[^01]|$)"
                                                  }
                                                }
                                              ]
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "required": [
                                        "source",
                                        "provider",
                                        "id"
                                      ],
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "exec"
                                        },
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9][A-Za-z0-9._:/#-]{0,255}$"
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              ]
                            }
                          },
                          "additionalProperties": true
                        }
                      }
                    },
                    "model": {
                      "type": "string"
                    },
                    "speakerVoice": {
                      "type": "string"
                    },
                    "speakerVoiceId": {
                      "type": "string"
                    },
                    "voice": {
                      "type": "string"
                    },
                    "instructions": {
                      "type": "string"
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "realtime"
                        },
                        {
                          "type": "string",
                          "const": "stt-tts"
                        },
                        {
                          "type": "string",
                          "const": "transcription"
                        }
                      ]
                    },
                    "transport": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "webrtc"
                        },
                        {
                          "type": "string",
                          "const": "provider-websocket"
                        },
                        {
                          "type": "string",
                          "const": "gateway-relay"
                        },
                        {
                          "type": "string",
                          "const": "managed-room"
                        }
                      ]
                    },
                    "vadThreshold": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "silenceDurationMs": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "prefixPaddingMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "reasoningEffort": {
                      "type": "string",
                      "minLength": 1
                    },
                    "brain": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "agent-consult"
                        },
                        {
                          "type": "string",
                          "const": "direct-tools"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        }
                      ]
                    },
                    "consultRouting": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "provider-direct"
                        },
                        {
                          "type": "string",
                          "const": "force-agent-consult"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "resolved": {
                  "type": "object",
                  "required": [
                    "provider",
                    "config"
                  ],
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "config": {
                      "type": "object",
                      "properties": {
                        "apiKey": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "env"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "file"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "anyOf": [
                                        {
                                          "const": "value"
                                        },
                                        {
                                          "allOf": [
                                            {
                                              "pattern": "^/"
                                            },
                                            {
                                              "not": {
                                                "pattern": "~(?:[^01]|$)"
                                              }
                                            }
                                          ]
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "exec"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^(?!.*(?:^|/)\\.{1,2}(?:/|$))[A-Za-z0-9][A-Za-z0-9._:/#-]{0,255}$"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            }
                          ]
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": false
                },
                "consultThinkingLevel": {
                  "type": "string"
                },
                "consultFastMode": {
                  "type": "boolean"
                },
                "speechLocale": {
                  "type": "string"
                },
                "interruptOnSpeech": {
                  "type": "boolean"
                },
                "silenceTimeoutMs": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "session": {
              "type": "object",
              "properties": {
                "mainKey": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "ui": {
              "type": "object",
              "properties": {
                "seamColor": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TalkSessionAppendAudioParams": {
      "type": "object",
      "required": [
        "sessionId",
        "audioBase64"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "audioBase64": {
          "type": "string",
          "minLength": 1
        },
        "timestamp": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TalkSessionAcknowledgeMarkParams": {
      "type": "object",
      "required": [
        "sessionId",
        "markName"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "markName": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TalkSessionCancelOutputParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TalkSessionCancelTurnParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TalkSessionCreateParams": {
      "type": "object",
      "properties": {
        "sessionKey": {
          "type": "string"
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2}$"
        },
        "vadThreshold": {
          "type": "number"
        },
        "silenceDurationMs": {
          "type": "integer",
          "minimum": 1
        },
        "prefixPaddingMs": {
          "type": "integer",
          "minimum": 0
        },
        "reasoningEffort": {
          "type": "string"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "realtime"
            },
            {
              "type": "string",
              "const": "stt-tts"
            },
            {
              "type": "string",
              "const": "transcription"
            }
          ]
        },
        "transport": {
          "anyOf": [
            {
              "type": "string",
              "const": "webrtc"
            },
            {
              "type": "string",
              "const": "provider-websocket"
            },
            {
              "type": "string",
              "const": "gateway-relay"
            },
            {
              "type": "string",
              "const": "managed-room"
            }
          ]
        },
        "brain": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent-consult"
            },
            {
              "type": "string",
              "const": "direct-tools"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "ttlMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 3600000
        }
      },
      "additionalProperties": false
    },
    "TalkSessionCreateResult": {
      "type": "object",
      "required": [
        "sessionId",
        "mode",
        "transport",
        "brain"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "realtime"
            },
            {
              "type": "string",
              "const": "stt-tts"
            },
            {
              "type": "string",
              "const": "transcription"
            }
          ]
        },
        "transport": {
          "anyOf": [
            {
              "type": "string",
              "const": "webrtc"
            },
            {
              "type": "string",
              "const": "provider-websocket"
            },
            {
              "type": "string",
              "const": "gateway-relay"
            },
            {
              "type": "string",
              "const": "managed-room"
            }
          ]
        },
        "brain": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent-consult"
            },
            {
              "type": "string",
              "const": "direct-tools"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "relaySessionId": {
          "type": "string",
          "minLength": 1
        },
        "transcriptionSessionId": {
          "type": "string",
          "minLength": 1
        },
        "handoffId": {
          "type": "string",
          "minLength": 1
        },
        "roomId": {
          "type": "string",
          "minLength": 1
        },
        "roomUrl": {
          "type": "string",
          "minLength": 1
        },
        "token": {
          "type": "string",
          "minLength": 1
        },
        "audio": {},
        "model": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        },
        "expiresAt": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "TalkSessionJoinParams": {
      "type": "object",
      "required": [
        "sessionId",
        "token"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "token": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TalkSessionJoinResult": {
      "type": "object",
      "required": [
        "id",
        "roomId",
        "roomUrl",
        "sessionKey",
        "mode",
        "transport",
        "brain",
        "createdAt",
        "expiresAt",
        "room"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "roomId": {
          "type": "string",
          "minLength": 1
        },
        "roomUrl": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "target": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "voice": {
          "type": "string"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "realtime"
            },
            {
              "type": "string",
              "const": "stt-tts"
            },
            {
              "type": "string",
              "const": "transcription"
            }
          ]
        },
        "transport": {
          "anyOf": [
            {
              "type": "string",
              "const": "webrtc"
            },
            {
              "type": "string",
              "const": "provider-websocket"
            },
            {
              "type": "string",
              "const": "gateway-relay"
            },
            {
              "type": "string",
              "const": "managed-room"
            }
          ]
        },
        "brain": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent-consult"
            },
            {
              "type": "string",
              "const": "direct-tools"
            },
            {
              "type": "string",
              "const": "none"
            }
          ]
        },
        "createdAt": {
          "type": "number"
        },
        "expiresAt": {
          "type": "number"
        },
        "room": {
          "type": "object",
          "required": [
            "recentTalkEvents"
          ],
          "properties": {
            "activeClientId": {
              "type": "string"
            },
            "activeTurnId": {
              "type": "string"
            },
            "recentTalkEvents": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "sessionId",
                  "seq",
                  "timestamp",
                  "mode",
                  "transport",
                  "brain",
                  "payload"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "session.started"
                      },
                      {
                        "type": "string",
                        "const": "session.ready"
                      },
                      {
                        "type": "string",
                        "const": "session.closed"
                      },
                      {
                        "type": "string",
                        "const": "session.error"
                      },
                      {
                        "type": "string",
                        "const": "session.replaced"
                      },
                      {
                        "type": "string",
                        "const": "turn.started"
                      },
                      {
                        "type": "string",
                        "const": "turn.ended"
                      },
                      {
                        "type": "string",
                        "const": "turn.cancelled"
                      },
                      {
                        "type": "string",
                        "const": "capture.started"
                      },
                      {
                        "type": "string",
                        "const": "capture.stopped"
                      },
                      {
                        "type": "string",
                        "const": "capture.cancelled"
                      },
                      {
                        "type": "string",
                        "const": "capture.once"
                      },
                      {
                        "type": "string",
                        "const": "input.audio.delta"
                      },
                      {
                        "type": "string",
                        "const": "input.audio.committed"
                      },
                      {
                        "type": "string",
                        "const": "transcript.delta"
                      },
                      {
                        "type": "string",
                        "const": "transcript.done"
                      },
                      {
                        "type": "string",
                        "const": "output.text.delta"
                      },
                      {
                        "type": "string",
                        "const": "output.text.done"
                      },
                      {
                        "type": "string",
                        "const": "output.audio.started"
                      },
                      {
                        "type": "string",
                        "const": "output.audio.delta"
                      },
                      {
                        "type": "string",
                        "const": "output.audio.done"
                      },
                      {
                        "type": "string",
                        "const": "tool.call"
                      },
                      {
                        "type": "string",
                        "const": "tool.progress"
                      },
                      {
                        "type": "string",
                        "const": "tool.result"
                      },
                      {
                        "type": "string",
                        "const": "tool.error"
                      },
                      {
                        "type": "string",
                        "const": "usage.metrics"
                      },
                      {
                        "type": "string",
                        "const": "latency.metrics"
                      },
                      {
                        "type": "string",
                        "const": "health.changed"
                      }
                    ]
                  },
                  "sessionId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "turnId": {
                    "type": "string"
                  },
                  "captureId": {
                    "type": "string"
                  },
                  "seq": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "timestamp": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "realtime"
                      },
                      {
                        "type": "string",
                        "const": "stt-tts"
                      },
                      {
                        "type": "string",
                        "const": "transcription"
                      }
                    ]
                  },
                  "transport": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "webrtc"
                      },
                      {
                        "type": "string",
                        "const": "provider-websocket"
                      },
                      {
                        "type": "string",
                        "const": "gateway-relay"
                      },
                      {
                        "type": "string",
                        "const": "managed-room"
                      }
                    ]
                  },
                  "brain": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "agent-consult"
                      },
                      {
                        "type": "string",
                        "const": "direct-tools"
                      },
                      {
                        "type": "string",
                        "const": "none"
                      }
                    ]
                  },
                  "provider": {
                    "type": "string"
                  },
                  "final": {
                    "type": "boolean"
                  },
                  "callId": {
                    "type": "string"
                  },
                  "itemId": {
                    "type": "string"
                  },
                  "parentId": {
                    "type": "string"
                  },
                  "payload": {}
                },
                "additionalProperties": false,
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "type": {
                          "enum": [
                            "turn.started",
                            "turn.ended",
                            "turn.cancelled",
                            "input.audio.delta",
                            "input.audio.committed",
                            "transcript.delta",
                            "transcript.done",
                            "output.text.delta",
                            "output.text.done",
                            "output.audio.started",
                            "output.audio.delta",
                            "output.audio.done",
                            "tool.call",
                            "tool.progress",
                            "tool.result",
                            "tool.error"
                          ]
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    "then": {
                      "required": [
                        "turnId"
                      ]
                    }
                  },
                  {
                    "if": {
                      "properties": {
                        "type": {
                          "enum": [
                            "capture.started",
                            "capture.stopped",
                            "capture.cancelled",
                            "capture.once"
                          ]
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    "then": {
                      "required": [
                        "captureId"
                      ]
                    }
                  }
                ]
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TalkSessionTurnParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "turnId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TalkSessionTurnResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "turnId": {
          "type": "string"
        },
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "sessionId",
              "seq",
              "timestamp",
              "mode",
              "transport",
              "brain",
              "payload"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "session.started"
                  },
                  {
                    "type": "string",
                    "const": "session.ready"
                  },
                  {
                    "type": "string",
                    "const": "session.closed"
                  },
                  {
                    "type": "string",
                    "const": "session.error"
                  },
                  {
                    "type": "string",
                    "const": "session.replaced"
                  },
                  {
                    "type": "string",
                    "const": "turn.started"
                  },
                  {
                    "type": "string",
                    "const": "turn.ended"
                  },
                  {
                    "type": "string",
                    "const": "turn.cancelled"
                  },
                  {
                    "type": "string",
                    "const": "capture.started"
                  },
                  {
                    "type": "string",
                    "const": "capture.stopped"
                  },
                  {
                    "type": "string",
                    "const": "capture.cancelled"
                  },
                  {
                    "type": "string",
                    "const": "capture.once"
                  },
                  {
                    "type": "string",
                    "const": "input.audio.delta"
                  },
                  {
                    "type": "string",
                    "const": "input.audio.committed"
                  },
                  {
                    "type": "string",
                    "const": "transcript.delta"
                  },
                  {
                    "type": "string",
                    "const": "transcript.done"
                  },
                  {
                    "type": "string",
                    "const": "output.text.delta"
                  },
                  {
                    "type": "string",
                    "const": "output.text.done"
                  },
                  {
                    "type": "string",
                    "const": "output.audio.started"
                  },
                  {
                    "type": "string",
                    "const": "output.audio.delta"
                  },
                  {
                    "type": "string",
                    "const": "output.audio.done"
                  },
                  {
                    "type": "string",
                    "const": "tool.call"
                  },
                  {
                    "type": "string",
                    "const": "tool.progress"
                  },
                  {
                    "type": "string",
                    "const": "tool.result"
                  },
                  {
                    "type": "string",
                    "const": "tool.error"
                  },
                  {
                    "type": "string",
                    "const": "usage.metrics"
                  },
                  {
                    "type": "string",
                    "const": "latency.metrics"
                  },
                  {
                    "type": "string",
                    "const": "health.changed"
                  }
                ]
              },
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "turnId": {
                "type": "string"
              },
              "captureId": {
                "type": "string"
              },
              "seq": {
                "type": "integer",
                "minimum": 1
              },
              "timestamp": {
                "type": "string",
                "minLength": 1
              },
              "mode": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "realtime"
                  },
                  {
                    "type": "string",
                    "const": "stt-tts"
                  },
                  {
                    "type": "string",
                    "const": "transcription"
                  }
                ]
              },
              "transport": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "webrtc"
                  },
                  {
                    "type": "string",
                    "const": "provider-websocket"
                  },
                  {
                    "type": "string",
                    "const": "gateway-relay"
                  },
                  {
                    "type": "string",
                    "const": "managed-room"
                  }
                ]
              },
              "brain": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "agent-consult"
                  },
                  {
                    "type": "string",
                    "const": "direct-tools"
                  },
                  {
                    "type": "string",
                    "const": "none"
                  }
                ]
              },
              "provider": {
                "type": "string"
              },
              "final": {
                "type": "boolean"
              },
              "callId": {
                "type": "string"
              },
              "itemId": {
                "type": "string"
              },
              "parentId": {
                "type": "string"
              },
              "payload": {}
            },
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "properties": {
                    "type": {
                      "enum": [
                        "turn.started",
                        "turn.ended",
                        "turn.cancelled",
                        "input.audio.delta",
                        "input.audio.committed",
                        "transcript.delta",
                        "transcript.done",
                        "output.text.delta",
                        "output.text.done",
                        "output.audio.started",
                        "output.audio.delta",
                        "output.audio.done",
                        "tool.call",
                        "tool.progress",
                        "tool.result",
                        "tool.error"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "then": {
                  "required": [
                    "turnId"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "type": {
                      "enum": [
                        "capture.started",
                        "capture.stopped",
                        "capture.cancelled",
                        "capture.once"
                      ]
                    }
                  },
                  "required": [
                    "type"
                  ]
                },
                "then": {
                  "required": [
                    "captureId"
                  ]
                }
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "TalkSessionSteerParams": {
      "type": "object",
      "required": [
        "sessionId",
        "text"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "status"
            },
            {
              "type": "string",
              "const": "steer"
            },
            {
              "type": "string",
              "const": "cancel"
            },
            {
              "type": "string",
              "const": "followup"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "TalkSessionSubmitToolResultParams": {
      "type": "object",
      "required": [
        "sessionId",
        "callId",
        "result"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "callId": {
          "type": "string",
          "minLength": 1
        },
        "result": {},
        "options": {
          "type": "object",
          "properties": {
            "suppressResponse": {
              "type": "boolean"
            },
            "willContinue": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TalkSessionCloseParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TalkSessionOkResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "TalkSpeakParams": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1
        },
        "voiceId": {
          "type": "string"
        },
        "modelId": {
          "type": "string"
        },
        "outputFormat": {
          "type": "string"
        },
        "speed": {
          "type": "number"
        },
        "rateWpm": {
          "type": "integer",
          "minimum": 1
        },
        "stability": {
          "type": "number"
        },
        "similarity": {
          "type": "number"
        },
        "style": {
          "type": "number"
        },
        "speakerBoost": {
          "type": "boolean"
        },
        "seed": {
          "type": "integer",
          "minimum": 0
        },
        "normalize": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "latencyTier": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "TalkSpeakResult": {
      "type": "object",
      "required": [
        "audioBase64",
        "provider"
      ],
      "properties": {
        "audioBase64": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "outputFormat": {
          "type": "string"
        },
        "voiceCompatible": {
          "type": "boolean"
        },
        "mimeType": {
          "type": "string"
        },
        "fileExtension": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TtsSpeakParams": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TtsSpeakResult": {
      "type": "object",
      "required": [
        "audioBase64",
        "provider"
      ],
      "properties": {
        "audioBase64": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "outputFormat": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "fileExtension": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ChannelsStatusParams": {
      "type": "object",
      "properties": {
        "probe": {
          "type": "boolean"
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "channel": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChannelsStatusResult": {
      "type": "object",
      "required": [
        "ts",
        "channelOrder",
        "channelLabels",
        "channels",
        "channelAccounts",
        "channelDefaultAccountId"
      ],
      "properties": {
        "ts": {
          "type": "integer",
          "minimum": 0
        },
        "channelOrder": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "channelLabels": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "channelDetailLabels": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "channelSystemImages": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "channelMeta": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "detailLabel"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "detailLabel": {
                "type": "string",
                "minLength": 1
              },
              "systemImage": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "channels": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "channelAccounts": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "accountId"
                ],
                "properties": {
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "configured": {
                    "type": "boolean"
                  },
                  "linked": {
                    "type": "boolean"
                  },
                  "running": {
                    "type": "boolean"
                  },
                  "connected": {
                    "type": "boolean"
                  },
                  "reconnectAttempts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastConnectedAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastError": {
                    "type": "string"
                  },
                  "healthState": {
                    "type": "string"
                  },
                  "lastStartAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastStopAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastInboundAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastOutboundAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastTransportActivityAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "busy": {
                    "type": "boolean"
                  },
                  "activeRuns": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastRunActivityAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastProbeAt": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "mode": {
                    "type": "string"
                  },
                  "dmPolicy": {
                    "type": "string"
                  },
                  "allowFrom": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tokenSource": {
                    "type": "string"
                  },
                  "botTokenSource": {
                    "type": "string"
                  },
                  "appTokenSource": {
                    "type": "string"
                  },
                  "baseUrl": {
                    "type": "string"
                  },
                  "allowUnmentionedGroups": {
                    "type": "boolean"
                  },
                  "cliPath": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "dbPath": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "port": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "probe": {},
                  "audit": {},
                  "application": {}
                },
                "additionalProperties": true
              }
            }
          }
        },
        "channelDefaultAccountId": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "eventLoop": {
          "type": "object",
          "required": [
            "degraded",
            "reasons",
            "intervalMs",
            "delayP99Ms",
            "delayMaxMs",
            "utilization",
            "cpuCoreRatio"
          ],
          "properties": {
            "degraded": {
              "type": "boolean"
            },
            "reasons": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "event_loop_delay"
                  },
                  {
                    "type": "string",
                    "const": "event_loop_utilization"
                  },
                  {
                    "type": "string",
                    "const": "cpu"
                  }
                ]
              }
            },
            "intervalMs": {
              "type": "integer",
              "minimum": 0
            },
            "delayP99Ms": {
              "type": "number",
              "minimum": 0
            },
            "delayMaxMs": {
              "type": "number",
              "minimum": 0
            },
            "utilization": {
              "type": "number",
              "minimum": 0
            },
            "cpuCoreRatio": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "partial": {
          "type": "boolean"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingListParams": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingListResult": {
      "type": "object",
      "required": [
        "accounts",
        "requests",
        "commandOwnerConfigured",
        "limits"
      ],
      "properties": {
        "accounts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "channel",
              "channelLabel",
              "accountId",
              "notifySupported"
            ],
            "properties": {
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "channelLabel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "accountLabel": {
                "type": "string",
                "minLength": 1
              },
              "notifySupported": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "requests": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "requestId",
              "channel",
              "channelLabel",
              "accountId",
              "senderId",
              "senderLabel",
              "createdAt",
              "lastSeenAt",
              "expiresAt",
              "notifySupported"
            ],
            "properties": {
              "requestId": {
                "type": "string",
                "minLength": 1
              },
              "channel": {
                "type": "string",
                "minLength": 1
              },
              "channelLabel": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "accountLabel": {
                "type": "string",
                "minLength": 1
              },
              "senderId": {
                "type": "string",
                "minLength": 1
              },
              "senderLabel": {
                "type": "string",
                "minLength": 1
              },
              "metadata": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {
                    "type": "string"
                  }
                }
              },
              "createdAt": {
                "type": "string",
                "minLength": 1
              },
              "lastSeenAt": {
                "type": "string",
                "minLength": 1
              },
              "expiresAt": {
                "type": "string",
                "minLength": 1
              },
              "notifySupported": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "commandOwnerConfigured": {
          "type": "boolean"
        },
        "limits": {
          "type": "object",
          "required": [
            "pendingPerAccount",
            "ttlMs"
          ],
          "properties": {
            "pendingPerAccount": {
              "type": "integer",
              "minimum": 0
            },
            "ttlMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingApproveParams": {
      "type": "object",
      "required": [
        "channel",
        "accountId",
        "requestId"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string",
          "minLength": 1
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "notify": {
          "type": "boolean"
        },
        "bootstrapCommandOwner": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingApproveResult": {
      "type": "object",
      "required": [
        "requestId",
        "senderId",
        "notification",
        "commandOwnerBootstrap"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "senderId": {
          "type": "string",
          "minLength": 1
        },
        "notification": {
          "type": "string",
          "enum": [
            "not-requested",
            "sent",
            "unsupported",
            "failed"
          ]
        },
        "commandOwnerBootstrap": {
          "type": "string",
          "enum": [
            "not-requested",
            "configured",
            "already-configured",
            "unavailable"
          ]
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingDismissParams": {
      "type": "object",
      "required": [
        "channel",
        "accountId",
        "requestId"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string",
          "minLength": 1
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChannelsPairingDismissResult": {
      "type": "object",
      "required": [
        "requestId",
        "senderId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "senderId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChannelsStartParams": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ChannelsStopParams": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ChannelsLogoutParams": {
      "type": "object",
      "required": [
        "channel"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WebLoginStartParams": {
      "type": "object",
      "properties": {
        "force": {
          "type": "boolean"
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "verbose": {
          "type": "boolean"
        },
        "accountId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "WebLoginWaitParams": {
      "type": "object",
      "properties": {
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "accountId": {
          "type": "string"
        },
        "currentQrDataUrl": {
          "type": "string",
          "maxLength": 16384,
          "pattern": "^data:image/png;base64,"
        }
      },
      "additionalProperties": false
    },
    "AgentKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "agent"
        },
        {
          "type": "string",
          "const": "system"
        }
      ]
    },
    "AgentSummary": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "agent"
            },
            {
              "type": "string",
              "const": "system"
            }
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "identity": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "theme": {
              "type": "string",
              "minLength": 1
            },
            "emoji": {
              "type": "string",
              "minLength": 1
            },
            "avatar": {
              "type": "string",
              "minLength": 1
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "workspaceGit": {
          "type": "boolean"
        },
        "model": {
          "type": "object",
          "properties": {
            "primary": {
              "type": "string",
              "minLength": 1
            },
            "fallbacks": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        "agentRuntime": {
          "type": "object",
          "required": [
            "id",
            "source"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "fallback": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "openclaw"
                },
                {
                  "type": "string",
                  "const": "none"
                }
              ]
            },
            "source": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "env"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "defaults"
                },
                {
                  "type": "string",
                  "const": "model"
                },
                {
                  "type": "string",
                  "const": "provider"
                },
                {
                  "type": "string",
                  "const": "implicit"
                },
                {
                  "type": "string",
                  "const": "session"
                },
                {
                  "type": "string",
                  "const": "session-key"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "thinkingLevels": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "thinkingOptions": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "thinkingDefault": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsCreateParams": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "emoji": {
          "type": "string"
        },
        "avatar": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentsCreateResult": {
      "type": "object",
      "required": [
        "ok",
        "agentId",
        "name",
        "workspace"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "model": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsUpdateParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "model": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "emoji": {
          "type": "string"
        },
        "avatar": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentsUpdateResult": {
      "type": "object",
      "required": [
        "ok",
        "agentId"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsDeleteParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "deleteFiles": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "AgentsDeleteResult": {
      "type": "object",
      "required": [
        "ok",
        "agentId",
        "removedBindings"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "removedBindings": {
          "type": "integer",
          "minimum": 0
        },
        "removed": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "method"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "method": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "trash"
                  },
                  {
                    "type": "string",
                    "const": "missing"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "failed": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "reason"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "AgentsFileEntry": {
      "type": "object",
      "required": [
        "name",
        "path",
        "missing"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "missing": {
          "type": "boolean"
        },
        "expectedAbsent": {
          "type": "boolean"
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "content": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesListParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesListResult": {
      "type": "object",
      "required": [
        "agentId",
        "workspace",
        "files"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "path",
              "missing"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "minLength": 1
              },
              "missing": {
                "type": "boolean"
              },
              "expectedAbsent": {
                "type": "boolean"
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "content": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesGetParams": {
      "type": "object",
      "required": [
        "agentId",
        "name"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesGetResult": {
      "type": "object",
      "required": [
        "agentId",
        "workspace",
        "file"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "name",
            "path",
            "missing"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "missing": {
              "type": "boolean"
            },
            "expectedAbsent": {
              "type": "boolean"
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "content": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesSetParams": {
      "type": "object",
      "required": [
        "agentId",
        "name",
        "content"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentsFilesSetResult": {
      "type": "object",
      "required": [
        "ok",
        "agentId",
        "workspace",
        "file"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "name",
            "path",
            "missing"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "missing": {
              "type": "boolean"
            },
            "expectedAbsent": {
              "type": "boolean"
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "content": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceEntry": {
      "type": "object",
      "required": [
        "path",
        "name",
        "kind"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "file"
            },
            {
              "type": "string",
              "const": "directory"
            }
          ]
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceFile": {
      "type": "object",
      "required": [
        "path",
        "name",
        "size",
        "updatedAtMs",
        "mimeType",
        "encoding",
        "content"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "mimeType": {
          "type": "string",
          "minLength": 1
        },
        "encoding": {
          "anyOf": [
            {
              "type": "string",
              "const": "utf8"
            },
            {
              "type": "string",
              "const": "base64"
            }
          ]
        },
        "content": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceListParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceListResult": {
      "type": "object",
      "required": [
        "agentId",
        "path",
        "entries",
        "totalEntries",
        "offset"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string"
        },
        "parentPath": {
          "type": "string"
        },
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "name",
              "kind"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "file"
                  },
                  {
                    "type": "string",
                    "const": "directory"
                  }
                ]
              },
              "size": {
                "type": "integer",
                "minimum": 0
              },
              "updatedAtMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "totalEntries": {
          "type": "integer",
          "minimum": 0
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceGetParams": {
      "type": "object",
      "required": [
        "agentId",
        "path"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsWorkspaceGetResult": {
      "type": "object",
      "required": [
        "agentId",
        "file"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "path",
            "name",
            "size",
            "updatedAtMs",
            "mimeType",
            "encoding",
            "content"
          ],
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "size": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "mimeType": {
              "type": "string",
              "minLength": 1
            },
            "encoding": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "utf8"
                },
                {
                  "type": "string",
                  "const": "base64"
                }
              ]
            },
            "content": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ArtifactSummary": {
      "type": "object",
      "required": [
        "id",
        "type",
        "title",
        "download"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "mimeType": {
          "type": "string",
          "minLength": 1
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "taskId": {
          "type": "string",
          "minLength": 1
        },
        "messageSeq": {
          "type": "integer",
          "minimum": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "download": {
          "type": "object",
          "required": [
            "mode"
          ],
          "properties": {
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "bytes"
                },
                {
                  "type": "string",
                  "const": "url"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ArtifactsListParams": {
      "type": "object",
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "taskId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ArtifactsListResult": {
      "type": "object",
      "required": [
        "artifacts"
      ],
      "properties": {
        "artifacts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "type",
              "title",
              "download"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "minLength": 1
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "mimeType": {
                "type": "string",
                "minLength": 1
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "runId": {
                "type": "string",
                "minLength": 1
              },
              "taskId": {
                "type": "string",
                "minLength": 1
              },
              "messageSeq": {
                "type": "integer",
                "minimum": 1
              },
              "source": {
                "type": "string",
                "minLength": 1
              },
              "download": {
                "type": "object",
                "required": [
                  "mode"
                ],
                "properties": {
                  "mode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "bytes"
                      },
                      {
                        "type": "string",
                        "const": "url"
                      },
                      {
                        "type": "string",
                        "const": "unsupported"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ArtifactsGetParams": {
      "type": "object",
      "required": [
        "artifactId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "taskId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "artifactId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ArtifactsGetResult": {
      "type": "object",
      "required": [
        "artifact"
      ],
      "properties": {
        "artifact": {
          "type": "object",
          "required": [
            "id",
            "type",
            "title",
            "download"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "minLength": 1
            },
            "title": {
              "type": "string",
              "minLength": 1
            },
            "mimeType": {
              "type": "string",
              "minLength": 1
            },
            "sizeBytes": {
              "type": "integer",
              "minimum": 0
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "taskId": {
              "type": "string",
              "minLength": 1
            },
            "messageSeq": {
              "type": "integer",
              "minimum": 1
            },
            "source": {
              "type": "string",
              "minLength": 1
            },
            "download": {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "bytes"
                    },
                    {
                      "type": "string",
                      "const": "url"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ArtifactsDownloadParams": {
      "type": "object",
      "required": [
        "artifactId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "taskId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "artifactId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ArtifactsDownloadResult": {
      "type": "object",
      "required": [
        "artifact"
      ],
      "properties": {
        "artifact": {
          "type": "object",
          "required": [
            "id",
            "type",
            "title",
            "download"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "minLength": 1
            },
            "title": {
              "type": "string",
              "minLength": 1
            },
            "mimeType": {
              "type": "string",
              "minLength": 1
            },
            "sizeBytes": {
              "type": "integer",
              "minimum": 0
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "taskId": {
              "type": "string",
              "minLength": 1
            },
            "messageSeq": {
              "type": "integer",
              "minimum": 1
            },
            "source": {
              "type": "string",
              "minLength": 1
            },
            "download": {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "bytes"
                    },
                    {
                      "type": "string",
                      "const": "url"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "encoding": {
          "type": "string",
          "const": "base64"
        },
        "data": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "AgentsListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "AgentsListResult": {
      "type": "object",
      "required": [
        "defaultId",
        "mainKey",
        "scope",
        "agents"
      ],
      "properties": {
        "defaultId": {
          "type": "string",
          "minLength": 1
        },
        "mainKey": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "per-sender"
            },
            {
              "type": "string",
              "const": "global"
            }
          ]
        },
        "agents": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "agent"
                  },
                  {
                    "type": "string",
                    "const": "system"
                  }
                ]
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "identity": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "theme": {
                    "type": "string",
                    "minLength": 1
                  },
                  "emoji": {
                    "type": "string",
                    "minLength": 1
                  },
                  "avatar": {
                    "type": "string",
                    "minLength": 1
                  },
                  "avatarUrl": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "workspace": {
                "type": "string",
                "minLength": 1
              },
              "workspaceGit": {
                "type": "boolean"
              },
              "model": {
                "type": "object",
                "properties": {
                  "primary": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fallbacks": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "additionalProperties": false
              },
              "agentRuntime": {
                "type": "object",
                "required": [
                  "id",
                  "source"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fallback": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "openclaw"
                      },
                      {
                        "type": "string",
                        "const": "none"
                      }
                    ]
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "env"
                      },
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "defaults"
                      },
                      {
                        "type": "string",
                        "const": "model"
                      },
                      {
                        "type": "string",
                        "const": "provider"
                      },
                      {
                        "type": "string",
                        "const": "implicit"
                      },
                      {
                        "type": "string",
                        "const": "session"
                      },
                      {
                        "type": "string",
                        "const": "session-key"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "thinkingLevels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "thinkingOptions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "thinkingDefault": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ModelChoice": {
      "type": "object",
      "required": [
        "id",
        "name",
        "provider"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "alias": {
          "type": "string",
          "minLength": 1
        },
        "available": {
          "type": "boolean"
        },
        "contextWindow": {
          "type": "integer",
          "minimum": 1
        },
        "reasoning": {
          "type": "boolean"
        },
        "agentRuntime": {
          "type": "object",
          "required": [
            "id",
            "source"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "fallback": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "openclaw"
                },
                {
                  "type": "string",
                  "const": "none"
                }
              ]
            },
            "source": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "env"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "defaults"
                },
                {
                  "type": "string",
                  "const": "model"
                },
                {
                  "type": "string",
                  "const": "provider"
                },
                {
                  "type": "string",
                  "const": "implicit"
                },
                {
                  "type": "string",
                  "const": "session"
                },
                {
                  "type": "string",
                  "const": "session-key"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "apiKeySupported": {
          "type": "boolean"
        },
        "input": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "text"
              },
              {
                "type": "string",
                "const": "image"
              },
              {
                "type": "string",
                "const": "audio"
              },
              {
                "type": "string",
                "const": "video"
              },
              {
                "type": "string",
                "const": "document"
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "ModelsAuthLogoutParams": {
      "type": "object",
      "required": [
        "provider"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "profileIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1
        },
        "agentId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ModelsAuthStatusParams": {
      "type": "object",
      "properties": {
        "refresh": {
          "type": "boolean"
        },
        "agentId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ModelsListParams": {
      "type": "object",
      "properties": {
        "includeProviderCapabilities": {
          "type": "boolean"
        },
        "view": {
          "anyOf": [
            {
              "type": "string",
              "const": "default"
            },
            {
              "type": "string",
              "const": "configured"
            },
            {
              "type": "string",
              "const": "provider-config"
            },
            {
              "type": "string",
              "const": "all"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ModelsListResult": {
      "type": "object",
      "required": [
        "models"
      ],
      "properties": {
        "models": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "provider"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "provider": {
                "type": "string",
                "minLength": 1
              },
              "alias": {
                "type": "string",
                "minLength": 1
              },
              "available": {
                "type": "boolean"
              },
              "contextWindow": {
                "type": "integer",
                "minimum": 1
              },
              "reasoning": {
                "type": "boolean"
              },
              "agentRuntime": {
                "type": "object",
                "required": [
                  "id",
                  "source"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fallback": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "openclaw"
                      },
                      {
                        "type": "string",
                        "const": "none"
                      }
                    ]
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "env"
                      },
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "defaults"
                      },
                      {
                        "type": "string",
                        "const": "model"
                      },
                      {
                        "type": "string",
                        "const": "provider"
                      },
                      {
                        "type": "string",
                        "const": "implicit"
                      },
                      {
                        "type": "string",
                        "const": "session"
                      },
                      {
                        "type": "string",
                        "const": "session-key"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "apiKeySupported": {
                "type": "boolean"
              },
              "input": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "text"
                    },
                    {
                      "type": "string",
                      "const": "image"
                    },
                    {
                      "type": "string",
                      "const": "audio"
                    },
                    {
                      "type": "string",
                      "const": "video"
                    },
                    {
                      "type": "string",
                      "const": "document"
                    }
                  ]
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ModelsProbeParams": {
      "type": "object",
      "required": [
        "provider"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1
        },
        "agentId": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ModelsProbeTargetResult": {
      "type": "object",
      "required": [
        "label",
        "status"
      ],
      "properties": {
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "auth"
            },
            {
              "type": "string",
              "const": "rate_limit"
            },
            {
              "type": "string",
              "const": "billing"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "format"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "no_model"
            }
          ]
        },
        "latencyMs": {
          "type": "integer",
          "minimum": 0
        },
        "error": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ModelsProbeResult": {
      "type": "object",
      "required": [
        "provider",
        "status",
        "results"
      ],
      "properties": {
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "auth"
            },
            {
              "type": "string",
              "const": "rate_limit"
            },
            {
              "type": "string",
              "const": "billing"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "format"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "no_model"
            }
          ]
        },
        "latencyMs": {
          "type": "integer",
          "minimum": 0
        },
        "error": {
          "type": "string"
        },
        "results": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label",
              "status"
            ],
            "properties": {
              "profileId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "ok"
                  },
                  {
                    "type": "string",
                    "const": "auth"
                  },
                  {
                    "type": "string",
                    "const": "rate_limit"
                  },
                  {
                    "type": "string",
                    "const": "billing"
                  },
                  {
                    "type": "string",
                    "const": "timeout"
                  },
                  {
                    "type": "string",
                    "const": "format"
                  },
                  {
                    "type": "string",
                    "const": "unknown"
                  },
                  {
                    "type": "string",
                    "const": "no_model"
                  }
                ]
              },
              "latencyMs": {
                "type": "integer",
                "minimum": 0
              },
              "error": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "CommandEntry": {
      "type": "object",
      "required": [
        "name",
        "description",
        "source",
        "scope",
        "acceptsArgs"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "nativeName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "textAliases": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "maxItems": 20
        },
        "description": {
          "type": "string",
          "maxLength": 2000
        },
        "category": {
          "anyOf": [
            {
              "type": "string",
              "const": "session"
            },
            {
              "type": "string",
              "const": "options"
            },
            {
              "type": "string",
              "const": "status"
            },
            {
              "type": "string",
              "const": "management"
            },
            {
              "type": "string",
              "const": "media"
            },
            {
              "type": "string",
              "const": "tools"
            },
            {
              "type": "string",
              "const": "docks"
            }
          ]
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "native"
            },
            {
              "type": "string",
              "const": "skill"
            },
            {
              "type": "string",
              "const": "plugin"
            }
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "text"
            },
            {
              "type": "string",
              "const": "native"
            },
            {
              "type": "string",
              "const": "both"
            }
          ]
        },
        "acceptsArgs": {
          "type": "boolean"
        },
        "args": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "description",
              "type"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "description": {
                "type": "string",
                "maxLength": 500
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "string"
                  },
                  {
                    "type": "string",
                    "const": "number"
                  },
                  {
                    "type": "string",
                    "const": "boolean"
                  }
                ]
              },
              "required": {
                "type": "boolean"
              },
              "choices": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "value",
                    "label"
                  ],
                  "properties": {
                    "value": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "label": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 50
              },
              "dynamic": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 20
        }
      },
      "additionalProperties": false
    },
    "CommandsListParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "provider": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "text"
            },
            {
              "type": "string",
              "const": "native"
            },
            {
              "type": "string",
              "const": "both"
            }
          ]
        },
        "includeArgs": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "CommandsListResult": {
      "type": "object",
      "required": [
        "commands"
      ],
      "properties": {
        "commands": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "description",
              "source",
              "scope",
              "acceptsArgs"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "nativeName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "textAliases": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "maxItems": 20
              },
              "description": {
                "type": "string",
                "maxLength": 2000
              },
              "category": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "session"
                  },
                  {
                    "type": "string",
                    "const": "options"
                  },
                  {
                    "type": "string",
                    "const": "status"
                  },
                  {
                    "type": "string",
                    "const": "management"
                  },
                  {
                    "type": "string",
                    "const": "media"
                  },
                  {
                    "type": "string",
                    "const": "tools"
                  },
                  {
                    "type": "string",
                    "const": "docks"
                  }
                ]
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "native"
                  },
                  {
                    "type": "string",
                    "const": "skill"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  }
                ]
              },
              "scope": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "text"
                  },
                  {
                    "type": "string",
                    "const": "native"
                  },
                  {
                    "type": "string",
                    "const": "both"
                  }
                ]
              },
              "acceptsArgs": {
                "type": "boolean"
              },
              "args": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "name",
                    "description",
                    "type"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "type": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "string"
                        },
                        {
                          "type": "string",
                          "const": "number"
                        },
                        {
                          "type": "string",
                          "const": "boolean"
                        }
                      ]
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "value",
                          "label"
                        ],
                        "properties": {
                          "value": {
                            "type": "string",
                            "maxLength": 200
                          },
                          "label": {
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "additionalProperties": false
                      },
                      "maxItems": 50
                    },
                    "dynamic": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 20
              }
            },
            "additionalProperties": false
          },
          "maxItems": 500
        }
      },
      "additionalProperties": false
    },
    "SkillsStatusParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ToolsCatalogParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "includePlugins": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ToolCatalogProfile": {
      "type": "object",
      "required": [
        "id",
        "label"
      ],
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string",
              "const": "minimal"
            },
            {
              "type": "string",
              "const": "coding"
            },
            {
              "type": "string",
              "const": "messaging"
            },
            {
              "type": "string",
              "const": "full"
            }
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ToolCatalogEntry": {
      "type": "object",
      "required": [
        "id",
        "label",
        "description",
        "source",
        "defaultProfiles"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            }
          ]
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "optional": {
          "type": "boolean"
        },
        "risk": {
          "anyOf": [
            {
              "type": "string",
              "const": "low"
            },
            {
              "type": "string",
              "const": "medium"
            },
            {
              "type": "string",
              "const": "high"
            }
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "defaultProfiles": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "minimal"
              },
              {
                "type": "string",
                "const": "coding"
              },
              {
                "type": "string",
                "const": "messaging"
              },
              {
                "type": "string",
                "const": "full"
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "ToolCatalogGroup": {
      "type": "object",
      "required": [
        "id",
        "label",
        "source",
        "tools"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            }
          ]
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "description",
              "source",
              "defaultProfiles"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "core"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  }
                ]
              },
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "optional": {
                "type": "boolean"
              },
              "risk": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "low"
                  },
                  {
                    "type": "string",
                    "const": "medium"
                  },
                  {
                    "type": "string",
                    "const": "high"
                  }
                ]
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "defaultProfiles": {
                "type": "array",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "minimal"
                    },
                    {
                      "type": "string",
                      "const": "coding"
                    },
                    {
                      "type": "string",
                      "const": "messaging"
                    },
                    {
                      "type": "string",
                      "const": "full"
                    }
                  ]
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ToolsCatalogResult": {
      "type": "object",
      "required": [
        "agentId",
        "profiles",
        "groups"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "profiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "minimal"
                  },
                  {
                    "type": "string",
                    "const": "coding"
                  },
                  {
                    "type": "string",
                    "const": "messaging"
                  },
                  {
                    "type": "string",
                    "const": "full"
                  }
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "source",
              "tools"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "core"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  }
                ]
              },
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "tools": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label",
                    "description",
                    "source",
                    "defaultProfiles"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "core"
                        },
                        {
                          "type": "string",
                          "const": "plugin"
                        }
                      ]
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "optional": {
                      "type": "boolean"
                    },
                    "risk": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "low"
                        },
                        {
                          "type": "string",
                          "const": "medium"
                        },
                        {
                          "type": "string",
                          "const": "high"
                        }
                      ]
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "defaultProfiles": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "minimal"
                          },
                          {
                            "type": "string",
                            "const": "coding"
                          },
                          {
                            "type": "string",
                            "const": "messaging"
                          },
                          {
                            "type": "string",
                            "const": "full"
                          }
                        ]
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ToolsEffectiveParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ToolsEffectiveEntry": {
      "type": "object",
      "required": [
        "id",
        "label",
        "description",
        "rawDescription",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "rawDescription": {
          "type": "string"
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "mcp"
            }
          ]
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "channelId": {
          "type": "string",
          "minLength": 1
        },
        "risk": {
          "anyOf": [
            {
              "type": "string",
              "const": "low"
            },
            {
              "type": "string",
              "const": "medium"
            },
            {
              "type": "string",
              "const": "high"
            }
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "ToolsEffectiveGroup": {
      "type": "object",
      "required": [
        "id",
        "label",
        "source",
        "tools"
      ],
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "mcp"
            }
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string",
              "const": "mcp"
            }
          ]
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "description",
              "rawDescription",
              "source"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "rawDescription": {
                "type": "string"
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "core"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  },
                  {
                    "type": "string",
                    "const": "channel"
                  },
                  {
                    "type": "string",
                    "const": "mcp"
                  }
                ]
              },
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "channelId": {
                "type": "string",
                "minLength": 1
              },
              "risk": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "low"
                  },
                  {
                    "type": "string",
                    "const": "medium"
                  },
                  {
                    "type": "string",
                    "const": "high"
                  }
                ]
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ToolsEffectiveNotice": {
      "type": "object",
      "required": [
        "id",
        "severity",
        "message"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "severity": {
          "anyOf": [
            {
              "type": "string",
              "const": "info"
            },
            {
              "type": "string",
              "const": "warning"
            }
          ]
        },
        "message": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ToolsEffectiveResult": {
      "type": "object",
      "required": [
        "agentId",
        "profile",
        "groups"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "profile": {
          "type": "string",
          "minLength": 1
        },
        "groups": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "source",
              "tools"
            ],
            "properties": {
              "id": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "core"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  },
                  {
                    "type": "string",
                    "const": "channel"
                  },
                  {
                    "type": "string",
                    "const": "mcp"
                  }
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "core"
                  },
                  {
                    "type": "string",
                    "const": "plugin"
                  },
                  {
                    "type": "string",
                    "const": "channel"
                  },
                  {
                    "type": "string",
                    "const": "mcp"
                  }
                ]
              },
              "tools": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label",
                    "description",
                    "rawDescription",
                    "source"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string"
                    },
                    "rawDescription": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "core"
                        },
                        {
                          "type": "string",
                          "const": "plugin"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "mcp"
                        }
                      ]
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "channelId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "risk": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "low"
                        },
                        {
                          "type": "string",
                          "const": "medium"
                        },
                        {
                          "type": "string",
                          "const": "high"
                        }
                      ]
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          }
        },
        "notices": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "severity",
              "message"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "severity": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "info"
                  },
                  {
                    "type": "string",
                    "const": "warning"
                  }
                ]
              },
              "message": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "ToolsInvokeParams": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "args": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "confirm": {
          "type": "boolean"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "conversationReadOrigin": {
          "type": "string",
          "const": "direct-operator"
        }
      },
      "additionalProperties": false
    },
    "ToolsInvokeError": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "details": {}
      },
      "additionalProperties": false
    },
    "ToolsInvokeResult": {
      "type": "object",
      "required": [
        "ok",
        "toolName"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "toolName": {
          "type": "string",
          "minLength": 1
        },
        "output": {},
        "requiresApproval": {
          "type": "boolean"
        },
        "approvalId": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "core"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "mcp"
            },
            {
              "type": "string",
              "const": "channel"
            },
            {
              "type": "string"
            }
          ]
        },
        "error": {
          "type": "object",
          "required": [
            "code",
            "message"
          ],
          "properties": {
            "code": {
              "type": "string",
              "minLength": 1
            },
            "message": {
              "type": "string",
              "minLength": 1
            },
            "details": {}
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SkillsBinsParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SkillsBinsResult": {
      "type": "object",
      "required": [
        "bins"
      ],
      "properties": {
        "bins": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsSearchParams": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "additionalProperties": false
    },
    "SkillsSearchResult": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "score",
              "slug",
              "displayName"
            ],
            "properties": {
              "score": {
                "type": "number"
              },
              "slug": {
                "type": "string",
                "minLength": 1
              },
              "displayName": {
                "type": "string",
                "minLength": 1
              },
              "summary": {
                "type": "string"
              },
              "version": {
                "type": "string",
                "minLength": 1
              },
              "updatedAt": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsDetailParams": {
      "type": "object",
      "required": [
        "slug"
      ],
      "properties": {
        "slug": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsDetailResult": {
      "type": "object",
      "required": [
        "skill"
      ],
      "properties": {
        "skill": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "slug",
                "displayName",
                "createdAt",
                "updatedAt"
              ],
              "properties": {
                "slug": {
                  "type": "string",
                  "minLength": 1
                },
                "displayName": {
                  "type": "string",
                  "minLength": 1
                },
                "summary": {
                  "type": "string"
                },
                "tags": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "string"
                    }
                  }
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "isOfficial": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "createdAt": {
                  "type": "integer"
                },
                "updatedAt": {
                  "type": "integer"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "latestVersion": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "version",
                "createdAt"
              ],
              "properties": {
                "version": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAt": {
                  "type": "integer"
                },
                "changelog": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "metadata": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "os": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "systems": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "owner": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "handle": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "displayName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "image": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "official": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "isOfficial": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SkillsCuratorActionParams": {
      "type": "object",
      "required": [
        "skill"
      ],
      "properties": {
        "skill": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsCuratorActionResult": {
      "type": "object",
      "required": [
        "skillFile",
        "skillKey",
        "skillName",
        "state",
        "pinned",
        "createdAtMs",
        "stateChangedAtMs",
        "lastUsedAtMs",
        "useCount",
        "archivedReason"
      ],
      "properties": {
        "skillFile": {
          "type": "string",
          "minLength": 1
        },
        "skillKey": {
          "type": "string",
          "minLength": 1
        },
        "skillName": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "active"
            },
            {
              "type": "string",
              "const": "stale"
            },
            {
              "type": "string",
              "const": "archived"
            }
          ]
        },
        "pinned": {
          "type": "boolean"
        },
        "createdAtMs": {
          "type": "number"
        },
        "stateChangedAtMs": {
          "type": "number"
        },
        "lastUsedAtMs": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "useCount": {
          "type": "number"
        },
        "archivedReason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SkillsCuratorStatusParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SkillsCuratorStatusResult": {
      "type": "object",
      "required": [
        "lastAttemptAtMs",
        "lastSuccessAtMs",
        "lastError",
        "counts",
        "skills",
        "overlaps"
      ],
      "properties": {
        "lastAttemptAtMs": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastSuccessAtMs": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastError": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "counts": {
          "type": "object",
          "required": [
            "active",
            "stale",
            "archived"
          ],
          "properties": {
            "active": {
              "type": "number"
            },
            "stale": {
              "type": "number"
            },
            "archived": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "skillFile",
              "skillKey",
              "skillName",
              "state",
              "pinned",
              "createdAtMs",
              "stateChangedAtMs",
              "lastUsedAtMs",
              "useCount",
              "archivedReason"
            ],
            "properties": {
              "skillFile": {
                "type": "string",
                "minLength": 1
              },
              "skillKey": {
                "type": "string",
                "minLength": 1
              },
              "skillName": {
                "type": "string",
                "minLength": 1
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "active"
                  },
                  {
                    "type": "string",
                    "const": "stale"
                  },
                  {
                    "type": "string",
                    "const": "archived"
                  }
                ]
              },
              "pinned": {
                "type": "boolean"
              },
              "createdAtMs": {
                "type": "number"
              },
              "stateChangedAtMs": {
                "type": "number"
              },
              "lastUsedAtMs": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "useCount": {
                "type": "number"
              },
              "archivedReason": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "overlaps": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "left",
              "right",
              "score"
            ],
            "properties": {
              "left": {
                "type": "string",
                "minLength": 1
              },
              "right": {
                "type": "string",
                "minLength": 1
              },
              "score": {
                "type": "number"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalsListParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalsListResult": {
      "type": "object",
      "required": [
        "schema",
        "updatedAt",
        "proposals"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "openclaw.skill-workshop.proposals-manifest.v1"
        },
        "updatedAt": {
          "type": "string",
          "minLength": 1
        },
        "proposals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "kind",
              "status",
              "title",
              "description",
              "skillName",
              "skillKey",
              "createdAt",
              "updatedAt",
              "scanState"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "create"
                  },
                  {
                    "type": "string",
                    "const": "update"
                  }
                ]
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "applied"
                  },
                  {
                    "type": "string",
                    "const": "rejected"
                  },
                  {
                    "type": "string",
                    "const": "quarantined"
                  },
                  {
                    "type": "string",
                    "const": "stale"
                  }
                ]
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string",
                "minLength": 1
              },
              "skillName": {
                "type": "string",
                "minLength": 1
              },
              "skillKey": {
                "type": "string",
                "minLength": 1
              },
              "createdAt": {
                "type": "string",
                "minLength": 1
              },
              "updatedAt": {
                "type": "string",
                "minLength": 1
              },
              "scanState": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "clean"
                  },
                  {
                    "type": "string",
                    "const": "failed"
                  },
                  {
                    "type": "string",
                    "const": "quarantined"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalHistoryStatusParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalHistoryScanParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "direction": {
          "anyOf": [
            {
              "type": "string",
              "const": "older"
            },
            {
              "type": "string",
              "const": "newer"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalHistoryScanResult": {
      "type": "object",
      "required": [
        "schema",
        "hasScanned",
        "reviewedSessions",
        "ideasFound",
        "hasMore",
        "lastScanReviewed",
        "lastScanIdeas"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "openclaw.skill-workshop.history-scan.v1"
        },
        "hasScanned": {
          "type": "boolean"
        },
        "reviewedSessions": {
          "type": "integer",
          "minimum": 0
        },
        "ideasFound": {
          "type": "integer",
          "minimum": 0
        },
        "hasMore": {
          "type": "boolean"
        },
        "lastScanReviewed": {
          "type": "integer",
          "minimum": 0
        },
        "lastScanIdeas": {
          "type": "integer",
          "minimum": 0
        },
        "lastScanAt": {
          "type": "string",
          "minLength": 1
        },
        "oldestReviewedAt": {
          "type": "string",
          "minLength": 1
        },
        "newestReviewedAt": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalInspectParams": {
      "type": "object",
      "required": [
        "proposalId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalInspectResult": {
      "type": "object",
      "required": [
        "record",
        "content"
      ],
      "properties": {
        "record": {
          "type": "object",
          "required": [
            "schema",
            "id",
            "kind",
            "status",
            "title",
            "description",
            "createdAt",
            "updatedAt",
            "createdBy",
            "proposedVersion",
            "draftFile",
            "draftHash",
            "target",
            "scan"
          ],
          "properties": {
            "schema": {
              "type": "string",
              "const": "openclaw.skill-workshop.proposal.v1"
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "create"
                },
                {
                  "type": "string",
                  "const": "update"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "applied"
                },
                {
                  "type": "string",
                  "const": "rejected"
                },
                {
                  "type": "string",
                  "const": "quarantined"
                },
                {
                  "type": "string",
                  "const": "stale"
                }
              ]
            },
            "title": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string",
              "minLength": 1
            },
            "createdAt": {
              "type": "string",
              "minLength": 1
            },
            "updatedAt": {
              "type": "string",
              "minLength": 1
            },
            "createdBy": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "skill-workshop"
                },
                {
                  "type": "string",
                  "const": "cli"
                },
                {
                  "type": "string",
                  "const": "gateway"
                }
              ]
            },
            "origin": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "runId": {
                  "type": "string",
                  "minLength": 1
                },
                "messageId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "proposedVersion": {
              "type": "string",
              "minLength": 1
            },
            "draftFile": {
              "type": "string",
              "const": "PROPOSAL.md"
            },
            "draftHash": {
              "type": "string",
              "minLength": 1
            },
            "supportFiles": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "path",
                  "sizeBytes",
                  "hash"
                ],
                "properties": {
                  "path": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sizeBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 262144
                  },
                  "hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  },
                  "targetExisted": {
                    "type": "boolean"
                  },
                  "targetContentHash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 64
            },
            "target": {
              "type": "object",
              "required": [
                "skillName",
                "skillKey",
                "skillDir",
                "skillFile"
              ],
              "properties": {
                "skillName": {
                  "type": "string",
                  "minLength": 1
                },
                "skillKey": {
                  "type": "string",
                  "minLength": 1
                },
                "skillDir": {
                  "type": "string",
                  "minLength": 1
                },
                "skillFile": {
                  "type": "string",
                  "minLength": 1
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "currentContentHash": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "scan": {
              "type": "object",
              "required": [
                "state",
                "scannedAt",
                "critical",
                "warn",
                "info",
                "findings"
              ],
              "properties": {
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pending"
                    },
                    {
                      "type": "string",
                      "const": "clean"
                    },
                    {
                      "type": "string",
                      "const": "failed"
                    },
                    {
                      "type": "string",
                      "const": "quarantined"
                    }
                  ]
                },
                "scannedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "critical": {
                  "type": "integer",
                  "minimum": 0
                },
                "warn": {
                  "type": "integer",
                  "minimum": 0
                },
                "info": {
                  "type": "integer",
                  "minimum": 0
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "ruleId",
                      "severity",
                      "file",
                      "line",
                      "message",
                      "evidence"
                    ],
                    "properties": {
                      "ruleId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "severity": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "info"
                          },
                          {
                            "type": "string",
                            "const": "warn"
                          },
                          {
                            "type": "string",
                            "const": "critical"
                          }
                        ]
                      },
                      "file": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "message": {
                        "type": "string",
                        "minLength": 1
                      },
                      "evidence": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "goal": {
              "type": "string"
            },
            "evidence": {
              "type": "string"
            },
            "appliedAt": {
              "type": "string",
              "minLength": 1
            },
            "rejectedAt": {
              "type": "string",
              "minLength": 1
            },
            "quarantinedAt": {
              "type": "string",
              "minLength": 1
            },
            "staleAt": {
              "type": "string",
              "minLength": 1
            },
            "statusReason": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "content": {
          "type": "string"
        },
        "supportFiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "content"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "string",
                "maxLength": 262144
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalCreateParams": {
      "type": "object",
      "required": [
        "name",
        "description",
        "content"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1048576
        },
        "supportFiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "content"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "string",
                "maxLength": 262144
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        },
        "goal": {
          "type": "string"
        },
        "evidence": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalUpdateParams": {
      "type": "object",
      "required": [
        "skillName",
        "content"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "skillName": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1048576
        },
        "supportFiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "content"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "string",
                "maxLength": 262144
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        },
        "goal": {
          "type": "string"
        },
        "evidence": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalReviseParams": {
      "type": "object",
      "required": [
        "proposalId",
        "content"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1048576
        },
        "supportFiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "content"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "content": {
                "type": "string",
                "maxLength": 262144
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "goal": {
          "type": "string"
        },
        "evidence": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalRequestRevisionParams": {
      "type": "object",
      "required": [
        "proposalId",
        "instructions",
        "sessionKey",
        "idempotencyKey"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "targetAgentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "instructions": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalRequestRevisionResult": {
      "type": "object",
      "required": [
        "runId",
        "status"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "in_flight"
            },
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        }
      },
      "additionalProperties": true
    },
    "SkillsProposalActionParams": {
      "type": "object",
      "required": [
        "proposalId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalApplyResult": {
      "type": "object",
      "required": [
        "record",
        "targetSkillFile"
      ],
      "properties": {
        "record": {
          "type": "object",
          "required": [
            "schema",
            "id",
            "kind",
            "status",
            "title",
            "description",
            "createdAt",
            "updatedAt",
            "createdBy",
            "proposedVersion",
            "draftFile",
            "draftHash",
            "target",
            "scan"
          ],
          "properties": {
            "schema": {
              "type": "string",
              "const": "openclaw.skill-workshop.proposal.v1"
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "create"
                },
                {
                  "type": "string",
                  "const": "update"
                }
              ]
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "applied"
                },
                {
                  "type": "string",
                  "const": "rejected"
                },
                {
                  "type": "string",
                  "const": "quarantined"
                },
                {
                  "type": "string",
                  "const": "stale"
                }
              ]
            },
            "title": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string",
              "minLength": 1
            },
            "createdAt": {
              "type": "string",
              "minLength": 1
            },
            "updatedAt": {
              "type": "string",
              "minLength": 1
            },
            "createdBy": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "skill-workshop"
                },
                {
                  "type": "string",
                  "const": "cli"
                },
                {
                  "type": "string",
                  "const": "gateway"
                }
              ]
            },
            "origin": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "runId": {
                  "type": "string",
                  "minLength": 1
                },
                "messageId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "proposedVersion": {
              "type": "string",
              "minLength": 1
            },
            "draftFile": {
              "type": "string",
              "const": "PROPOSAL.md"
            },
            "draftHash": {
              "type": "string",
              "minLength": 1
            },
            "supportFiles": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "path",
                  "sizeBytes",
                  "hash"
                ],
                "properties": {
                  "path": {
                    "type": "string",
                    "minLength": 1
                  },
                  "sizeBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 262144
                  },
                  "hash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  },
                  "targetExisted": {
                    "type": "boolean"
                  },
                  "targetContentHash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 64
            },
            "target": {
              "type": "object",
              "required": [
                "skillName",
                "skillKey",
                "skillDir",
                "skillFile"
              ],
              "properties": {
                "skillName": {
                  "type": "string",
                  "minLength": 1
                },
                "skillKey": {
                  "type": "string",
                  "minLength": 1
                },
                "skillDir": {
                  "type": "string",
                  "minLength": 1
                },
                "skillFile": {
                  "type": "string",
                  "minLength": 1
                },
                "source": {
                  "type": "string",
                  "minLength": 1
                },
                "currentContentHash": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "scan": {
              "type": "object",
              "required": [
                "state",
                "scannedAt",
                "critical",
                "warn",
                "info",
                "findings"
              ],
              "properties": {
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "pending"
                    },
                    {
                      "type": "string",
                      "const": "clean"
                    },
                    {
                      "type": "string",
                      "const": "failed"
                    },
                    {
                      "type": "string",
                      "const": "quarantined"
                    }
                  ]
                },
                "scannedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "critical": {
                  "type": "integer",
                  "minimum": 0
                },
                "warn": {
                  "type": "integer",
                  "minimum": 0
                },
                "info": {
                  "type": "integer",
                  "minimum": 0
                },
                "findings": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "ruleId",
                      "severity",
                      "file",
                      "line",
                      "message",
                      "evidence"
                    ],
                    "properties": {
                      "ruleId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "severity": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "info"
                          },
                          {
                            "type": "string",
                            "const": "warn"
                          },
                          {
                            "type": "string",
                            "const": "critical"
                          }
                        ]
                      },
                      "file": {
                        "type": "string",
                        "minLength": 1
                      },
                      "line": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "message": {
                        "type": "string",
                        "minLength": 1
                      },
                      "evidence": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "goal": {
              "type": "string"
            },
            "evidence": {
              "type": "string"
            },
            "appliedAt": {
              "type": "string",
              "minLength": 1
            },
            "rejectedAt": {
              "type": "string",
              "minLength": 1
            },
            "quarantinedAt": {
              "type": "string",
              "minLength": 1
            },
            "staleAt": {
              "type": "string",
              "minLength": 1
            },
            "statusReason": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "targetSkillFile": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalRecordResult": {
      "type": "object",
      "required": [
        "schema",
        "id",
        "kind",
        "status",
        "title",
        "description",
        "createdAt",
        "updatedAt",
        "createdBy",
        "proposedVersion",
        "draftFile",
        "draftHash",
        "target",
        "scan"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "openclaw.skill-workshop.proposal.v1"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "create"
            },
            {
              "type": "string",
              "const": "update"
            }
          ]
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "applied"
            },
            {
              "type": "string",
              "const": "rejected"
            },
            {
              "type": "string",
              "const": "quarantined"
            },
            {
              "type": "string",
              "const": "stale"
            }
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "string",
          "minLength": 1
        },
        "updatedAt": {
          "type": "string",
          "minLength": 1
        },
        "createdBy": {
          "anyOf": [
            {
              "type": "string",
              "const": "skill-workshop"
            },
            {
              "type": "string",
              "const": "cli"
            },
            {
              "type": "string",
              "const": "gateway"
            }
          ]
        },
        "origin": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "messageId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "proposedVersion": {
          "type": "string",
          "minLength": 1
        },
        "draftFile": {
          "type": "string",
          "const": "PROPOSAL.md"
        },
        "draftHash": {
          "type": "string",
          "minLength": 1
        },
        "supportFiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "sizeBytes",
              "hash"
            ],
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1
              },
              "sizeBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 262144
              },
              "hash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64,
                "pattern": "^[a-fA-F0-9]{64}$"
              },
              "targetExisted": {
                "type": "boolean"
              },
              "targetContentHash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64,
                "pattern": "^[a-fA-F0-9]{64}$"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 64
        },
        "target": {
          "type": "object",
          "required": [
            "skillName",
            "skillKey",
            "skillDir",
            "skillFile"
          ],
          "properties": {
            "skillName": {
              "type": "string",
              "minLength": 1
            },
            "skillKey": {
              "type": "string",
              "minLength": 1
            },
            "skillDir": {
              "type": "string",
              "minLength": 1
            },
            "skillFile": {
              "type": "string",
              "minLength": 1
            },
            "source": {
              "type": "string",
              "minLength": 1
            },
            "currentContentHash": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "scan": {
          "type": "object",
          "required": [
            "state",
            "scannedAt",
            "critical",
            "warn",
            "info",
            "findings"
          ],
          "properties": {
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "clean"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "quarantined"
                }
              ]
            },
            "scannedAt": {
              "type": "string",
              "minLength": 1
            },
            "critical": {
              "type": "integer",
              "minimum": 0
            },
            "warn": {
              "type": "integer",
              "minimum": 0
            },
            "info": {
              "type": "integer",
              "minimum": 0
            },
            "findings": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "ruleId",
                  "severity",
                  "file",
                  "line",
                  "message",
                  "evidence"
                ],
                "properties": {
                  "ruleId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "severity": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "info"
                      },
                      {
                        "type": "string",
                        "const": "warn"
                      },
                      {
                        "type": "string",
                        "const": "critical"
                      }
                    ]
                  },
                  "file": {
                    "type": "string",
                    "minLength": 1
                  },
                  "line": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1
                  },
                  "evidence": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "goal": {
          "type": "string"
        },
        "evidence": {
          "type": "string"
        },
        "appliedAt": {
          "type": "string",
          "minLength": 1
        },
        "rejectedAt": {
          "type": "string",
          "minLength": 1
        },
        "quarantinedAt": {
          "type": "string",
          "minLength": 1
        },
        "staleAt": {
          "type": "string",
          "minLength": 1
        },
        "statusReason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsSecurityVerdictsParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsSecurityVerdictsResult": {
      "type": "object",
      "required": [
        "schema",
        "items"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "openclaw.skills.security-verdicts.v1"
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "registry",
              "ok",
              "decision",
              "reasons",
              "requestedSlug",
              "requestedVersion"
            ],
            "properties": {
              "registry": {
                "type": "string",
                "minLength": 1
              },
              "ok": {
                "type": "boolean"
              },
              "decision": {
                "type": "string",
                "minLength": 1
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "requestedSlug": {
                "type": "string",
                "minLength": 1
              },
              "requestedVersion": {
                "type": "string",
                "minLength": 1
              },
              "slug": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "version": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "displayName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "publisherHandle": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "publisherDisplayName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "createdAt": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "checkedAt": {
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "skillUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "securityAuditUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "securityStatus": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "securityPassed": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsSkillCardParams": {
      "type": "object",
      "required": [
        "skillKey"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "skillKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SkillsSkillCardResult": {
      "type": "object",
      "required": [
        "schema",
        "skillKey",
        "path",
        "sizeBytes",
        "content"
      ],
      "properties": {
        "schema": {
          "type": "string",
          "const": "openclaw.skills.skill-card.v1"
        },
        "skillKey": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0
        },
        "content": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsUploadBeginParams": {
      "type": "object",
      "required": [
        "kind",
        "slug",
        "sizeBytes"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "skill-archive"
        },
        "slug": {
          "type": "string",
          "minLength": 1
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 1
        },
        "sha256": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "force": {
          "type": "boolean"
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        }
      },
      "additionalProperties": false
    },
    "SkillsUploadChunkParams": {
      "type": "object",
      "required": [
        "uploadId",
        "offset",
        "dataBase64"
      ],
      "properties": {
        "uploadId": {
          "type": "string",
          "minLength": 1
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "dataBase64": {
          "type": "string",
          "minLength": 1,
          "maxLength": 5592408
        }
      },
      "additionalProperties": false
    },
    "SkillsUploadCommitParams": {
      "type": "object",
      "required": [
        "uploadId"
      ],
      "properties": {
        "uploadId": {
          "type": "string",
          "minLength": 1
        },
        "sha256": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "SkillsInstallParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "name",
            "installId"
          ],
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "installId": {
              "type": "string",
              "minLength": 1
            },
            "dangerouslyForceUnsafeInstall": {
              "type": "boolean",
              "deprecated": true,
              "description": "Deprecated compatibility field. Current servers ignore it; install policy is controlled by security.installPolicy."
            },
            "timeoutMs": {
              "type": "integer",
              "minimum": 1000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source",
            "slug"
          ],
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "source": {
              "type": "string",
              "const": "clawhub"
            },
            "slug": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "force": {
              "type": "boolean"
            },
            "acknowledgeClawHubRisk": {
              "type": "boolean"
            },
            "timeoutMs": {
              "type": "integer",
              "minimum": 1000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source",
            "uploadId",
            "slug"
          ],
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "source": {
              "type": "string",
              "const": "upload"
            },
            "uploadId": {
              "type": "string",
              "minLength": 1
            },
            "slug": {
              "type": "string",
              "minLength": 1
            },
            "force": {
              "type": "boolean"
            },
            "sha256": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "timeoutMs": {
              "type": "integer",
              "minimum": 1000
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SkillsUpdateParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "skillKey"
          ],
          "properties": {
            "skillKey": {
              "type": "string",
              "minLength": 1
            },
            "enabled": {
              "type": "boolean"
            },
            "apiKey": {
              "type": "string"
            },
            "env": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "string"
                }
              }
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source"
          ],
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "source": {
              "type": "string",
              "const": "clawhub"
            },
            "slug": {
              "type": "string",
              "minLength": 1
            },
            "all": {
              "type": "boolean"
            },
            "acknowledgeClawHubRisk": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronJob": {
      "type": "object",
      "required": [
        "id",
        "name",
        "enabled",
        "createdAtMs",
        "updatedAtMs",
        "schedule",
        "sessionTarget",
        "wakeMode",
        "payload",
        "state"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "declarationKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "\\S"
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "\\S"
        },
        "owner": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "accountId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "scheduledToolPolicy": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "version",
                "mode"
              ],
              "properties": {
                "version": {
                  "type": "number",
                  "const": 1
                },
                "mode": {
                  "type": "string",
                  "const": "trusted"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "version",
                "mode",
                "ownerSessionKey",
                "ownerAccountId"
              ],
              "properties": {
                "version": {
                  "type": "number",
                  "const": 1
                },
                "mode": {
                  "type": "string",
                  "const": "account"
                },
                "ownerSessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "ownerAccountId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "deleteAfterRun": {
          "type": "boolean"
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "configRevision": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "schedule": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "at"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "at"
                },
                "at": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "everyMs"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "every"
                },
                "everyMs": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "anchorMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "expr"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "cron"
                },
                "expr": {
                  "type": "string",
                  "minLength": 1
                },
                "tz": {
                  "type": "string"
                },
                "staggerMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "on-exit"
                },
                "command": {
                  "type": "string",
                  "minLength": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "stream"
                },
                "command": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "line"
                    },
                    {
                      "type": "string",
                      "const": "match"
                    }
                  ]
                },
                "match": {
                  "type": "string"
                },
                "batchMs": {
                  "type": "integer",
                  "description": "Quiet-window milliseconds; clamped to 50-5000"
                },
                "maxBatchBytes": {
                  "type": "integer",
                  "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "pacing": {
          "type": "object",
          "properties": {
            "min": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            },
            "max": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "additionalProperties": false,
          "description": "Dynamic-cadence bounds; at least one of min or max is required"
        },
        "trigger": {
          "type": "object",
          "required": [
            "script"
          ],
          "properties": {
            "script": {
              "type": "string",
              "minLength": 1,
              "maxLength": 65536
            },
            "once": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "sessionTarget": {
          "anyOf": [
            {
              "type": "string",
              "const": "main"
            },
            {
              "type": "string",
              "const": "isolated"
            },
            {
              "type": "string",
              "const": "current"
            },
            {
              "type": "string",
              "pattern": "^session:.+"
            }
          ]
        },
        "wakeMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "next-heartbeat"
            },
            {
              "type": "string",
              "const": "now"
            }
          ]
        },
        "payload": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "text"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "systemEvent"
                },
                "text": {
                  "type": "string",
                  "minLength": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "message"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "agentTurn"
                },
                "message": {
                  "type": "string",
                  "minLength": 1
                },
                "model": {
                  "type": "string"
                },
                "fallbacks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "thinking": {
                  "type": "string"
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "allowUnsafeExternalContent": {
                  "type": "boolean"
                },
                "lightContext": {
                  "type": "boolean"
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "argv"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "command"
                },
                "argv": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                },
                "env": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "string"
                    }
                  }
                },
                "input": {
                  "type": "string"
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "noOutputTimeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "outputMaxBytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "script"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "script"
                },
                "script": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 65536
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 1
                },
                "toolBudget": {
                  "type": "integer",
                  "minimum": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "heartbeat"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "delivery": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "none"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "announce"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "completionDestination": {
                  "type": "object",
                  "required": [
                    "mode",
                    "to"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "webhook"
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "mode",
                "to"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "webhook"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "failureAlert": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "object",
              "properties": {
                "after": {
                  "type": "integer",
                  "minimum": 1
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                },
                "cooldownMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "includeSkipped": {
                  "type": "boolean"
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "announce"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "state": {
          "type": "object",
          "properties": {
            "nextRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "runningAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "error"
                },
                {
                  "type": "string",
                  "const": "skipped"
                }
              ]
            },
            "lastStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "error"
                },
                {
                  "type": "string",
                  "const": "skipped"
                }
              ],
              "deprecated": true,
              "description": "Deprecated alias for lastRunStatus."
            },
            "lastError": {
              "type": "string"
            },
            "lastDiagnostics": {
              "type": "object",
              "required": [
                "entries"
              ],
              "properties": {
                "summary": {
                  "type": "string"
                },
                "entries": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "ts",
                      "source",
                      "severity",
                      "message"
                    ],
                    "properties": {
                      "ts": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "source": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "cron-preflight"
                          },
                          {
                            "type": "string",
                            "const": "cron-setup"
                          },
                          {
                            "type": "string",
                            "const": "model-preflight"
                          },
                          {
                            "type": "string",
                            "const": "agent-run"
                          },
                          {
                            "type": "string",
                            "const": "tool"
                          },
                          {
                            "type": "string",
                            "const": "exec"
                          },
                          {
                            "type": "string",
                            "const": "delivery"
                          }
                        ]
                      },
                      "severity": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "info"
                          },
                          {
                            "type": "string",
                            "const": "warn"
                          },
                          {
                            "type": "string",
                            "const": "error"
                          }
                        ]
                      },
                      "message": {
                        "type": "string"
                      },
                      "toolName": {
                        "type": "string"
                      },
                      "exitCode": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "truncated": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "lastDiagnosticSummary": {
              "type": "string"
            },
            "lastErrorReason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "auth"
                },
                {
                  "type": "string",
                  "const": "auth_permanent"
                },
                {
                  "type": "string",
                  "const": "format"
                },
                {
                  "type": "string",
                  "const": "rate_limit"
                },
                {
                  "type": "string",
                  "const": "overloaded"
                },
                {
                  "type": "string",
                  "const": "billing"
                },
                {
                  "type": "string",
                  "const": "server_error"
                },
                {
                  "type": "string",
                  "const": "timeout"
                },
                {
                  "type": "string",
                  "const": "context_overflow"
                },
                {
                  "type": "string",
                  "const": "model_not_found"
                },
                {
                  "type": "string",
                  "const": "session_expired"
                },
                {
                  "type": "string",
                  "const": "empty_response"
                },
                {
                  "type": "string",
                  "const": "no_error_details"
                },
                {
                  "type": "string",
                  "const": "unclassified"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "lastDurationMs": {
              "type": "integer",
              "minimum": 0
            },
            "consecutiveErrors": {
              "type": "integer",
              "minimum": 0
            },
            "consecutiveSkipped": {
              "type": "integer",
              "minimum": 0
            },
            "lastDelivered": {
              "type": "boolean"
            },
            "lastDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastDeliveryError": {
              "type": "string"
            },
            "lastFailureNotificationDelivered": {
              "type": "boolean"
            },
            "lastFailureNotificationDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastFailureNotificationDeliveryError": {
              "type": "string"
            },
            "lastFailureAlertAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastTriggerEvalAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "triggerEvalCount": {
              "type": "integer",
              "minimum": 0
            },
            "lastTriggerFireAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "triggerState": {},
            "streamStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "starting"
                },
                {
                  "type": "string",
                  "const": "running"
                },
                {
                  "type": "string",
                  "const": "restarting"
                },
                {
                  "type": "string",
                  "const": "stopped"
                },
                {
                  "type": "string",
                  "const": "disabled"
                },
                {
                  "type": "string",
                  "const": "error"
                }
              ]
            },
            "streamError": {
              "type": "string"
            },
            "streamConsecutiveFailures": {
              "type": "integer",
              "minimum": 0
            },
            "streamRestartExhausted": {
              "type": "boolean"
            },
            "streamSourceIdentity": {
              "type": "string"
            },
            "streamDroppedBatches": {
              "type": "integer",
              "minimum": 0
            },
            "streamCoalescedBatches": {
              "type": "integer",
              "minimum": 0
            },
            "streamLastStartedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "streamLastExitAtMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "nextRunAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastRunAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastRunStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "error"
            },
            {
              "type": "string",
              "const": "skipped"
            }
          ]
        },
        "lastRunError": {
          "type": "string"
        },
        "lastDelivered": {
          "type": "boolean"
        },
        "lastDeliveryStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "delivered"
            },
            {
              "type": "string",
              "const": "not-delivered"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "not-requested"
            }
          ]
        },
        "lastDeliveryError": {
          "type": "string"
        },
        "lastFailureNotificationDelivered": {
          "type": "boolean"
        },
        "lastFailureNotificationDeliveryStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "delivered"
            },
            {
              "type": "string",
              "const": "not-delivered"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "not-requested"
            }
          ]
        },
        "lastFailureNotificationDeliveryError": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "CronListParams": {
      "type": "object",
      "properties": {
        "includeDisabled": {
          "type": "boolean"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "query": {
          "type": "string"
        },
        "enabled": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "enabled"
            },
            {
              "type": "string",
              "const": "disabled"
            }
          ]
        },
        "scheduleKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "at"
            },
            {
              "type": "string",
              "const": "every"
            },
            {
              "type": "string",
              "const": "cron"
            },
            {
              "type": "string",
              "const": "on-exit"
            },
            {
              "type": "string",
              "const": "stream"
            }
          ]
        },
        "lastRunStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "error"
            },
            {
              "type": "string",
              "const": "skipped"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "sortBy": {
          "anyOf": [
            {
              "type": "string",
              "const": "nextRunAtMs"
            },
            {
              "type": "string",
              "const": "updatedAtMs"
            },
            {
              "type": "string",
              "const": "name"
            }
          ]
        },
        "sortDir": {
          "anyOf": [
            {
              "type": "string",
              "const": "asc"
            },
            {
              "type": "string",
              "const": "desc"
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "compact": {
          "type": "boolean"
        },
        "includeDeliveryPreviews": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "CronStatusParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "CronGetParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronAddParams": {
      "type": "object",
      "required": [
        "name",
        "schedule",
        "sessionTarget",
        "wakeMode",
        "payload"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "declarationKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "\\S"
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "pattern": "\\S"
        },
        "owner": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "accountId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "sessionKey": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "description": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "deleteAfterRun": {
          "type": "boolean"
        },
        "schedule": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "at"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "at"
                },
                "at": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "everyMs"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "every"
                },
                "everyMs": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "anchorMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "expr"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "cron"
                },
                "expr": {
                  "type": "string",
                  "minLength": 1
                },
                "tz": {
                  "type": "string"
                },
                "staggerMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "on-exit"
                },
                "command": {
                  "type": "string",
                  "minLength": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "stream"
                },
                "command": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "line"
                    },
                    {
                      "type": "string",
                      "const": "match"
                    }
                  ]
                },
                "match": {
                  "type": "string"
                },
                "batchMs": {
                  "type": "integer",
                  "description": "Quiet-window milliseconds; clamped to 50-5000"
                },
                "maxBatchBytes": {
                  "type": "integer",
                  "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "pacing": {
          "type": "object",
          "properties": {
            "min": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            },
            "max": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "additionalProperties": false,
          "description": "Dynamic-cadence bounds; at least one of min or max is required"
        },
        "trigger": {
          "type": "object",
          "required": [
            "script"
          ],
          "properties": {
            "script": {
              "type": "string",
              "minLength": 1,
              "maxLength": 65536
            },
            "once": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "sessionTarget": {
          "anyOf": [
            {
              "type": "string",
              "const": "main"
            },
            {
              "type": "string",
              "const": "isolated"
            },
            {
              "type": "string",
              "const": "current"
            },
            {
              "type": "string",
              "pattern": "^session:.+"
            }
          ]
        },
        "wakeMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "next-heartbeat"
            },
            {
              "type": "string",
              "const": "now"
            }
          ]
        },
        "payload": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "text"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "systemEvent"
                },
                "text": {
                  "type": "string",
                  "minLength": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "message"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "agentTurn"
                },
                "message": {
                  "type": "string",
                  "minLength": 1
                },
                "model": {
                  "type": "string"
                },
                "fallbacks": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "thinking": {
                  "type": "string"
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "allowUnsafeExternalContent": {
                  "type": "boolean"
                },
                "lightContext": {
                  "type": "boolean"
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "argv"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "command"
                },
                "argv": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 1
                },
                "cwd": {
                  "type": "string",
                  "minLength": 1
                },
                "env": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "string"
                    }
                  }
                },
                "input": {
                  "type": "string"
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "noOutputTimeoutSeconds": {
                  "type": "number",
                  "minimum": 0
                },
                "outputMaxBytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "script"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "script"
                },
                "script": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 65536
                },
                "timeoutSeconds": {
                  "type": "number",
                  "minimum": 1
                },
                "toolBudget": {
                  "type": "integer",
                  "minimum": 1
                },
                "toolsAllow": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "toolsAllowIsDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "delivery": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "none"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "announce"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "completionDestination": {
                  "type": "object",
                  "required": [
                    "mode",
                    "to"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "webhook"
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "mode",
                "to"
              ],
              "properties": {
                "mode": {
                  "type": "string",
                  "const": "webhook"
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "bestEffort": {
                  "type": "boolean"
                },
                "failureDestination": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "failureAlert": {
          "anyOf": [
            {
              "type": "boolean",
              "const": false
            },
            {
              "type": "object",
              "properties": {
                "after": {
                  "type": "integer",
                  "minimum": 1
                },
                "channel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "last"
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  ]
                },
                "to": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                },
                "cooldownMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "includeSkipped": {
                  "type": "boolean"
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "announce"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    }
                  ]
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CronAddResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "name",
            "enabled",
            "createdAtMs",
            "updatedAtMs",
            "schedule",
            "sessionTarget",
            "wakeMode",
            "payload",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "declarationKey": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "\\S"
            },
            "displayName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "\\S"
            },
            "owner": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "scheduledToolPolicy": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "version",
                    "mode"
                  ],
                  "properties": {
                    "version": {
                      "type": "number",
                      "const": 1
                    },
                    "mode": {
                      "type": "string",
                      "const": "trusted"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "version",
                    "mode",
                    "ownerSessionKey",
                    "ownerAccountId"
                  ],
                  "properties": {
                    "version": {
                      "type": "number",
                      "const": 1
                    },
                    "mode": {
                      "type": "string",
                      "const": "account"
                    },
                    "ownerSessionKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "ownerAccountId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "deleteAfterRun": {
              "type": "boolean"
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "configRevision": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "schedule": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "at"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "at"
                    },
                    "at": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "everyMs"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "every"
                    },
                    "everyMs": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "anchorMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "expr"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "cron"
                    },
                    "expr": {
                      "type": "string",
                      "minLength": 1
                    },
                    "tz": {
                      "type": "string"
                    },
                    "staggerMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "on-exit"
                    },
                    "command": {
                      "type": "string",
                      "minLength": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "stream"
                    },
                    "command": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "minItems": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "line"
                        },
                        {
                          "type": "string",
                          "const": "match"
                        }
                      ]
                    },
                    "match": {
                      "type": "string"
                    },
                    "batchMs": {
                      "type": "integer",
                      "description": "Quiet-window milliseconds; clamped to 50-5000"
                    },
                    "maxBatchBytes": {
                      "type": "integer",
                      "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "pacing": {
              "type": "object",
              "properties": {
                "min": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                },
                "max": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false,
              "description": "Dynamic-cadence bounds; at least one of min or max is required"
            },
            "trigger": {
              "type": "object",
              "required": [
                "script"
              ],
              "properties": {
                "script": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 65536
                },
                "once": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "sessionTarget": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "main"
                },
                {
                  "type": "string",
                  "const": "isolated"
                },
                {
                  "type": "string",
                  "const": "current"
                },
                {
                  "type": "string",
                  "pattern": "^session:.+"
                }
              ]
            },
            "wakeMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "next-heartbeat"
                },
                {
                  "type": "string",
                  "const": "now"
                }
              ]
            },
            "payload": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "text"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "systemEvent"
                    },
                    "text": {
                      "type": "string",
                      "minLength": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "message"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "agentTurn"
                    },
                    "message": {
                      "type": "string",
                      "minLength": 1
                    },
                    "model": {
                      "type": "string"
                    },
                    "fallbacks": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "thinking": {
                      "type": "string"
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "allowUnsafeExternalContent": {
                      "type": "boolean"
                    },
                    "lightContext": {
                      "type": "boolean"
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "argv"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "command"
                    },
                    "argv": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "minItems": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    },
                    "env": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "string"
                        }
                      }
                    },
                    "input": {
                      "type": "string"
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "noOutputTimeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "outputMaxBytes": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "script"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "script"
                    },
                    "script": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 65536
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 1
                    },
                    "toolBudget": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "heartbeat"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "delivery": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "mode"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "none"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "mode"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "announce"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "completionDestination": {
                      "type": "object",
                      "required": [
                        "mode",
                        "to"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "const": "webhook"
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "mode",
                    "to"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "webhook"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "failureAlert": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "object",
                  "properties": {
                    "after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "cooldownMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "includeSkipped": {
                      "type": "boolean"
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "state": {
              "type": "object",
              "properties": {
                "nextRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "runningAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    },
                    {
                      "type": "string",
                      "const": "skipped"
                    }
                  ]
                },
                "lastStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    },
                    {
                      "type": "string",
                      "const": "skipped"
                    }
                  ],
                  "deprecated": true,
                  "description": "Deprecated alias for lastRunStatus."
                },
                "lastError": {
                  "type": "string"
                },
                "lastDiagnostics": {
                  "type": "object",
                  "required": [
                    "entries"
                  ],
                  "properties": {
                    "summary": {
                      "type": "string"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "source",
                          "severity",
                          "message"
                        ],
                        "properties": {
                          "ts": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "cron-preflight"
                              },
                              {
                                "type": "string",
                                "const": "cron-setup"
                              },
                              {
                                "type": "string",
                                "const": "model-preflight"
                              },
                              {
                                "type": "string",
                                "const": "agent-run"
                              },
                              {
                                "type": "string",
                                "const": "tool"
                              },
                              {
                                "type": "string",
                                "const": "exec"
                              },
                              {
                                "type": "string",
                                "const": "delivery"
                              }
                            ]
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warn"
                              },
                              {
                                "type": "string",
                                "const": "error"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "toolName": {
                            "type": "string"
                          },
                          "exitCode": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "lastDiagnosticSummary": {
                  "type": "string"
                },
                "lastErrorReason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "auth"
                    },
                    {
                      "type": "string",
                      "const": "auth_permanent"
                    },
                    {
                      "type": "string",
                      "const": "format"
                    },
                    {
                      "type": "string",
                      "const": "rate_limit"
                    },
                    {
                      "type": "string",
                      "const": "overloaded"
                    },
                    {
                      "type": "string",
                      "const": "billing"
                    },
                    {
                      "type": "string",
                      "const": "server_error"
                    },
                    {
                      "type": "string",
                      "const": "timeout"
                    },
                    {
                      "type": "string",
                      "const": "context_overflow"
                    },
                    {
                      "type": "string",
                      "const": "model_not_found"
                    },
                    {
                      "type": "string",
                      "const": "session_expired"
                    },
                    {
                      "type": "string",
                      "const": "empty_response"
                    },
                    {
                      "type": "string",
                      "const": "no_error_details"
                    },
                    {
                      "type": "string",
                      "const": "unclassified"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "lastDurationMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "consecutiveErrors": {
                  "type": "integer",
                  "minimum": 0
                },
                "consecutiveSkipped": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastDelivered": {
                  "type": "boolean"
                },
                "lastDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastDeliveryError": {
                  "type": "string"
                },
                "lastFailureNotificationDelivered": {
                  "type": "boolean"
                },
                "lastFailureNotificationDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastFailureNotificationDeliveryError": {
                  "type": "string"
                },
                "lastFailureAlertAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerEvalAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "triggerEvalCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerFireAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "triggerState": {},
                "streamStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "starting"
                    },
                    {
                      "type": "string",
                      "const": "running"
                    },
                    {
                      "type": "string",
                      "const": "restarting"
                    },
                    {
                      "type": "string",
                      "const": "stopped"
                    },
                    {
                      "type": "string",
                      "const": "disabled"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    }
                  ]
                },
                "streamError": {
                  "type": "string"
                },
                "streamConsecutiveFailures": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamRestartExhausted": {
                  "type": "boolean"
                },
                "streamSourceIdentity": {
                  "type": "string"
                },
                "streamDroppedBatches": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamCoalescedBatches": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamLastStartedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamLastExitAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            "nextRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "error"
                },
                {
                  "type": "string",
                  "const": "skipped"
                }
              ]
            },
            "lastRunError": {
              "type": "string"
            },
            "lastDelivered": {
              "type": "boolean"
            },
            "lastDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastDeliveryError": {
              "type": "string"
            },
            "lastFailureNotificationDelivered": {
              "type": "boolean"
            },
            "lastFailureNotificationDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastFailureNotificationDeliveryError": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "created",
            "job"
          ],
          "properties": {
            "created": {
              "type": "boolean"
            },
            "updated": {
              "type": "boolean"
            },
            "job": {
              "type": "object",
              "required": [
                "id",
                "name",
                "enabled",
                "createdAtMs",
                "updatedAtMs",
                "schedule",
                "sessionTarget",
                "wakeMode",
                "payload",
                "state"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "declarationKey": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "\\S"
                },
                "displayName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200,
                  "pattern": "\\S"
                },
                "owner": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "scheduledToolPolicy": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "mode"
                      ],
                      "properties": {
                        "version": {
                          "type": "number",
                          "const": 1
                        },
                        "mode": {
                          "type": "string",
                          "const": "trusted"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "version",
                        "mode",
                        "ownerSessionKey",
                        "ownerAccountId"
                      ],
                      "properties": {
                        "version": {
                          "type": "number",
                          "const": 1
                        },
                        "mode": {
                          "type": "string",
                          "const": "account"
                        },
                        "ownerSessionKey": {
                          "type": "string",
                          "minLength": 1
                        },
                        "ownerAccountId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "description": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "deleteAfterRun": {
                  "type": "boolean"
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "configRevision": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "schedule": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "at"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "at"
                        },
                        "at": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "everyMs"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "every"
                        },
                        "everyMs": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "expr"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "cron"
                        },
                        "expr": {
                          "type": "string",
                          "minLength": 1
                        },
                        "tz": {
                          "type": "string"
                        },
                        "staggerMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "on-exit"
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "stream"
                        },
                        "command": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "line"
                            },
                            {
                              "type": "string",
                              "const": "match"
                            }
                          ]
                        },
                        "match": {
                          "type": "string"
                        },
                        "batchMs": {
                          "type": "integer",
                          "description": "Quiet-window milliseconds; clamped to 50-5000"
                        },
                        "maxBatchBytes": {
                          "type": "integer",
                          "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "pacing": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "max": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false,
                  "description": "Dynamic-cadence bounds; at least one of min or max is required"
                },
                "trigger": {
                  "type": "object",
                  "required": [
                    "script"
                  ],
                  "properties": {
                    "script": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 65536
                    },
                    "once": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "sessionTarget": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "main"
                    },
                    {
                      "type": "string",
                      "const": "isolated"
                    },
                    {
                      "type": "string",
                      "const": "current"
                    },
                    {
                      "type": "string",
                      "pattern": "^session:.+"
                    }
                  ]
                },
                "wakeMode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "next-heartbeat"
                    },
                    {
                      "type": "string",
                      "const": "now"
                    }
                  ]
                },
                "payload": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "text"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "systemEvent"
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1
                        },
                        "toolsAllow": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "message"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "agentTurn"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1
                        },
                        "model": {
                          "type": "string"
                        },
                        "fallbacks": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "thinking": {
                          "type": "string"
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "allowUnsafeExternalContent": {
                          "type": "boolean"
                        },
                        "lightContext": {
                          "type": "boolean"
                        },
                        "toolsAllow": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "argv"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "command"
                        },
                        "argv": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "env": {
                          "type": "object",
                          "patternProperties": {
                            "^.*$": {
                              "type": "string"
                            }
                          }
                        },
                        "input": {
                          "type": "string"
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "noOutputTimeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "outputMaxBytes": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "script"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "script": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 65536
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 1
                        },
                        "toolBudget": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "heartbeat"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "delivery": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "mode"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "const": "none"
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "threadId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            }
                          ]
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "bestEffort": {
                          "type": "boolean"
                        },
                        "failureDestination": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "last"
                                },
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                }
                              ]
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "mode": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "announce"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "mode"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "const": "announce"
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "threadId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            }
                          ]
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "bestEffort": {
                          "type": "boolean"
                        },
                        "failureDestination": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "last"
                                },
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                }
                              ]
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "mode": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "announce"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "completionDestination": {
                          "type": "object",
                          "required": [
                            "mode",
                            "to"
                          ],
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "webhook"
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          },
                          "additionalProperties": false
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "mode",
                        "to"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "const": "webhook"
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "threadId": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            }
                          ]
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "bestEffort": {
                          "type": "boolean"
                        },
                        "failureDestination": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "last"
                                },
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                }
                              ]
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "mode": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "announce"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "failureAlert": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "const": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "after": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "cooldownMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "includeSkipped": {
                          "type": "boolean"
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "nextRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ]
                    },
                    "lastStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ],
                      "deprecated": true,
                      "description": "Deprecated alias for lastRunStatus."
                    },
                    "lastError": {
                      "type": "string"
                    },
                    "lastDiagnostics": {
                      "type": "object",
                      "required": [
                        "entries"
                      ],
                      "properties": {
                        "summary": {
                          "type": "string"
                        },
                        "entries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "ts",
                              "source",
                              "severity",
                              "message"
                            ],
                            "properties": {
                              "ts": {
                                "type": "integer",
                                "minimum": 0
                              },
                              "source": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "cron-preflight"
                                  },
                                  {
                                    "type": "string",
                                    "const": "cron-setup"
                                  },
                                  {
                                    "type": "string",
                                    "const": "model-preflight"
                                  },
                                  {
                                    "type": "string",
                                    "const": "agent-run"
                                  },
                                  {
                                    "type": "string",
                                    "const": "tool"
                                  },
                                  {
                                    "type": "string",
                                    "const": "exec"
                                  },
                                  {
                                    "type": "string",
                                    "const": "delivery"
                                  }
                                ]
                              },
                              "severity": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "info"
                                  },
                                  {
                                    "type": "string",
                                    "const": "warn"
                                  },
                                  {
                                    "type": "string",
                                    "const": "error"
                                  }
                                ]
                              },
                              "message": {
                                "type": "string"
                              },
                              "toolName": {
                                "type": "string"
                              },
                              "exitCode": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "truncated": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastDiagnosticSummary": {
                      "type": "string"
                    },
                    "lastErrorReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "auth"
                        },
                        {
                          "type": "string",
                          "const": "auth_permanent"
                        },
                        {
                          "type": "string",
                          "const": "format"
                        },
                        {
                          "type": "string",
                          "const": "rate_limit"
                        },
                        {
                          "type": "string",
                          "const": "overloaded"
                        },
                        {
                          "type": "string",
                          "const": "billing"
                        },
                        {
                          "type": "string",
                          "const": "server_error"
                        },
                        {
                          "type": "string",
                          "const": "timeout"
                        },
                        {
                          "type": "string",
                          "const": "context_overflow"
                        },
                        {
                          "type": "string",
                          "const": "model_not_found"
                        },
                        {
                          "type": "string",
                          "const": "session_expired"
                        },
                        {
                          "type": "string",
                          "const": "empty_response"
                        },
                        {
                          "type": "string",
                          "const": "no_error_details"
                        },
                        {
                          "type": "string",
                          "const": "unclassified"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "lastDurationMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveErrors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveSkipped": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastDelivered": {
                      "type": "boolean"
                    },
                    "lastDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureNotificationDelivered": {
                      "type": "boolean"
                    },
                    "lastFailureNotificationDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastFailureNotificationDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureAlertAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerState": {},
                    "streamStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "starting"
                        },
                        {
                          "type": "string",
                          "const": "running"
                        },
                        {
                          "type": "string",
                          "const": "restarting"
                        },
                        {
                          "type": "string",
                          "const": "stopped"
                        },
                        {
                          "type": "string",
                          "const": "disabled"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        }
                      ]
                    },
                    "streamError": {
                      "type": "string"
                    },
                    "streamConsecutiveFailures": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamRestartExhausted": {
                      "type": "boolean"
                    },
                    "streamSourceIdentity": {
                      "type": "string"
                    },
                    "streamDroppedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamCoalescedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastStartedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                },
                "nextRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    },
                    {
                      "type": "string",
                      "const": "skipped"
                    }
                  ]
                },
                "lastRunError": {
                  "type": "string"
                },
                "lastDelivered": {
                  "type": "boolean"
                },
                "lastDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastDeliveryError": {
                  "type": "string"
                },
                "lastFailureNotificationDelivered": {
                  "type": "boolean"
                },
                "lastFailureNotificationDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastFailureNotificationDeliveryError": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronDeclarativeAddResult": {
      "type": "object",
      "required": [
        "created",
        "job"
      ],
      "properties": {
        "created": {
          "type": "boolean"
        },
        "updated": {
          "type": "boolean"
        },
        "job": {
          "type": "object",
          "required": [
            "id",
            "name",
            "enabled",
            "createdAtMs",
            "updatedAtMs",
            "schedule",
            "sessionTarget",
            "wakeMode",
            "payload",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "declarationKey": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "\\S"
            },
            "displayName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "\\S"
            },
            "owner": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "scheduledToolPolicy": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "version",
                    "mode"
                  ],
                  "properties": {
                    "version": {
                      "type": "number",
                      "const": 1
                    },
                    "mode": {
                      "type": "string",
                      "const": "trusted"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "version",
                    "mode",
                    "ownerSessionKey",
                    "ownerAccountId"
                  ],
                  "properties": {
                    "version": {
                      "type": "number",
                      "const": 1
                    },
                    "mode": {
                      "type": "string",
                      "const": "account"
                    },
                    "ownerSessionKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "ownerAccountId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "enabled": {
              "type": "boolean"
            },
            "deleteAfterRun": {
              "type": "boolean"
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "configRevision": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "schedule": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "at"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "at"
                    },
                    "at": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "everyMs"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "every"
                    },
                    "everyMs": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    },
                    "anchorMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "expr"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "cron"
                    },
                    "expr": {
                      "type": "string",
                      "minLength": 1
                    },
                    "tz": {
                      "type": "string"
                    },
                    "staggerMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "on-exit"
                    },
                    "command": {
                      "type": "string",
                      "minLength": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "stream"
                    },
                    "command": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "minItems": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "line"
                        },
                        {
                          "type": "string",
                          "const": "match"
                        }
                      ]
                    },
                    "match": {
                      "type": "string"
                    },
                    "batchMs": {
                      "type": "integer",
                      "description": "Quiet-window milliseconds; clamped to 50-5000"
                    },
                    "maxBatchBytes": {
                      "type": "integer",
                      "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "pacing": {
              "type": "object",
              "properties": {
                "min": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                },
                "max": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false,
              "description": "Dynamic-cadence bounds; at least one of min or max is required"
            },
            "trigger": {
              "type": "object",
              "required": [
                "script"
              ],
              "properties": {
                "script": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 65536
                },
                "once": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "sessionTarget": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "main"
                },
                {
                  "type": "string",
                  "const": "isolated"
                },
                {
                  "type": "string",
                  "const": "current"
                },
                {
                  "type": "string",
                  "pattern": "^session:.+"
                }
              ]
            },
            "wakeMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "next-heartbeat"
                },
                {
                  "type": "string",
                  "const": "now"
                }
              ]
            },
            "payload": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "text"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "systemEvent"
                    },
                    "text": {
                      "type": "string",
                      "minLength": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "message"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "agentTurn"
                    },
                    "message": {
                      "type": "string",
                      "minLength": 1
                    },
                    "model": {
                      "type": "string"
                    },
                    "fallbacks": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "thinking": {
                      "type": "string"
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "allowUnsafeExternalContent": {
                      "type": "boolean"
                    },
                    "lightContext": {
                      "type": "boolean"
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "argv"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "command"
                    },
                    "argv": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      },
                      "minItems": 1
                    },
                    "cwd": {
                      "type": "string",
                      "minLength": 1
                    },
                    "env": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "string"
                        }
                      }
                    },
                    "input": {
                      "type": "string"
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "noOutputTimeoutSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "outputMaxBytes": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "script"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "script"
                    },
                    "script": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 65536
                    },
                    "timeoutSeconds": {
                      "type": "number",
                      "minimum": 1
                    },
                    "toolBudget": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "toolsAllow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "toolsAllowIsDefault": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "heartbeat"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "delivery": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "mode"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "none"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "mode"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "announce"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "completionDestination": {
                      "type": "object",
                      "required": [
                        "mode",
                        "to"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "const": "webhook"
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "mode",
                    "to"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "const": "webhook"
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "type": "object",
                      "properties": {
                        "channel": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        "to": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "accountId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "failureAlert": {
              "anyOf": [
                {
                  "type": "boolean",
                  "const": false
                },
                {
                  "type": "object",
                  "properties": {
                    "after": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "last"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      ]
                    },
                    "to": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "\\S"
                    },
                    "cooldownMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "includeSkipped": {
                      "type": "boolean"
                    },
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "state": {
              "type": "object",
              "properties": {
                "nextRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "runningAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastRunStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    },
                    {
                      "type": "string",
                      "const": "skipped"
                    }
                  ]
                },
                "lastStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    },
                    {
                      "type": "string",
                      "const": "skipped"
                    }
                  ],
                  "deprecated": true,
                  "description": "Deprecated alias for lastRunStatus."
                },
                "lastError": {
                  "type": "string"
                },
                "lastDiagnostics": {
                  "type": "object",
                  "required": [
                    "entries"
                  ],
                  "properties": {
                    "summary": {
                      "type": "string"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "source",
                          "severity",
                          "message"
                        ],
                        "properties": {
                          "ts": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "cron-preflight"
                              },
                              {
                                "type": "string",
                                "const": "cron-setup"
                              },
                              {
                                "type": "string",
                                "const": "model-preflight"
                              },
                              {
                                "type": "string",
                                "const": "agent-run"
                              },
                              {
                                "type": "string",
                                "const": "tool"
                              },
                              {
                                "type": "string",
                                "const": "exec"
                              },
                              {
                                "type": "string",
                                "const": "delivery"
                              }
                            ]
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warn"
                              },
                              {
                                "type": "string",
                                "const": "error"
                              }
                            ]
                          },
                          "message": {
                            "type": "string"
                          },
                          "toolName": {
                            "type": "string"
                          },
                          "exitCode": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "lastDiagnosticSummary": {
                  "type": "string"
                },
                "lastErrorReason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "auth"
                    },
                    {
                      "type": "string",
                      "const": "auth_permanent"
                    },
                    {
                      "type": "string",
                      "const": "format"
                    },
                    {
                      "type": "string",
                      "const": "rate_limit"
                    },
                    {
                      "type": "string",
                      "const": "overloaded"
                    },
                    {
                      "type": "string",
                      "const": "billing"
                    },
                    {
                      "type": "string",
                      "const": "server_error"
                    },
                    {
                      "type": "string",
                      "const": "timeout"
                    },
                    {
                      "type": "string",
                      "const": "context_overflow"
                    },
                    {
                      "type": "string",
                      "const": "model_not_found"
                    },
                    {
                      "type": "string",
                      "const": "session_expired"
                    },
                    {
                      "type": "string",
                      "const": "empty_response"
                    },
                    {
                      "type": "string",
                      "const": "no_error_details"
                    },
                    {
                      "type": "string",
                      "const": "unclassified"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "lastDurationMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "consecutiveErrors": {
                  "type": "integer",
                  "minimum": 0
                },
                "consecutiveSkipped": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastDelivered": {
                  "type": "boolean"
                },
                "lastDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastDeliveryError": {
                  "type": "string"
                },
                "lastFailureNotificationDelivered": {
                  "type": "boolean"
                },
                "lastFailureNotificationDeliveryStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "delivered"
                    },
                    {
                      "type": "string",
                      "const": "not-delivered"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "not-requested"
                    }
                  ]
                },
                "lastFailureNotificationDeliveryError": {
                  "type": "string"
                },
                "lastFailureAlertAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerEvalAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "triggerEvalCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerFireAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "triggerState": {},
                "streamStatus": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "starting"
                    },
                    {
                      "type": "string",
                      "const": "running"
                    },
                    {
                      "type": "string",
                      "const": "restarting"
                    },
                    {
                      "type": "string",
                      "const": "stopped"
                    },
                    {
                      "type": "string",
                      "const": "disabled"
                    },
                    {
                      "type": "string",
                      "const": "error"
                    }
                  ]
                },
                "streamError": {
                  "type": "string"
                },
                "streamConsecutiveFailures": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamRestartExhausted": {
                  "type": "boolean"
                },
                "streamSourceIdentity": {
                  "type": "string"
                },
                "streamDroppedBatches": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamCoalescedBatches": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamLastStartedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "streamLastExitAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            "nextRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "lastRunStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "error"
                },
                {
                  "type": "string",
                  "const": "skipped"
                }
              ]
            },
            "lastRunError": {
              "type": "string"
            },
            "lastDelivered": {
              "type": "boolean"
            },
            "lastDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastDeliveryError": {
              "type": "string"
            },
            "lastFailureNotificationDelivered": {
              "type": "boolean"
            },
            "lastFailureNotificationDeliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "lastFailureNotificationDeliveryError": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "CronUpdateParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "patch"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "patch": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "displayName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sessionKey": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "deleteAfterRun": {
                  "type": "boolean"
                },
                "schedule": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "at"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "at"
                        },
                        "at": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "everyMs"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "every"
                        },
                        "everyMs": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "expr"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "cron"
                        },
                        "expr": {
                          "type": "string",
                          "minLength": 1
                        },
                        "tz": {
                          "type": "string"
                        },
                        "staggerMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "on-exit"
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "stream"
                        },
                        "command": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "line"
                            },
                            {
                              "type": "string",
                              "const": "match"
                            }
                          ]
                        },
                        "match": {
                          "type": "string"
                        },
                        "batchMs": {
                          "type": "integer",
                          "description": "Quiet-window milliseconds; clamped to 50-5000"
                        },
                        "maxBatchBytes": {
                          "type": "integer",
                          "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "pacing": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "min": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "max": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false,
                      "description": "Dynamic-cadence bounds; at least one of min or max is required"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trigger": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "script"
                      ],
                      "properties": {
                        "script": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 65536
                        },
                        "once": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sessionTarget": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "main"
                    },
                    {
                      "type": "string",
                      "const": "isolated"
                    },
                    {
                      "type": "string",
                      "const": "current"
                    },
                    {
                      "type": "string",
                      "pattern": "^session:.+"
                    }
                  ]
                },
                "wakeMode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "next-heartbeat"
                    },
                    {
                      "type": "string",
                      "const": "now"
                    }
                  ]
                },
                "payload": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "systemEvent"
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "agentTurn"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1
                        },
                        "model": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "fallbacks": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "thinking": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "allowUnsafeExternalContent": {
                          "type": "boolean"
                        },
                        "lightContext": {
                          "type": "boolean"
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "command"
                        },
                        "argv": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "env": {
                          "type": "object",
                          "patternProperties": {
                            "^.*$": {
                              "type": "string"
                            }
                          }
                        },
                        "input": {
                          "type": "string"
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "noOutputTimeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "outputMaxBytes": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "script": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 65536
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 1
                        },
                        "toolBudget": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "delivery": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "none"
                        },
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "last"
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "pattern": "\\S"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "to": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "accountId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mode": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "announce"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completionDestination": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "mode",
                            "to"
                          ],
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "webhook"
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "failureAlert": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "const": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "after": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "last"
                                },
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cooldownMs": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "includeSkipped": {
                          "anyOf": [
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "nextRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ]
                    },
                    "lastStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ],
                      "deprecated": true,
                      "description": "Deprecated alias for lastRunStatus."
                    },
                    "lastError": {
                      "type": "string"
                    },
                    "lastErrorReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "auth"
                        },
                        {
                          "type": "string",
                          "const": "auth_permanent"
                        },
                        {
                          "type": "string",
                          "const": "format"
                        },
                        {
                          "type": "string",
                          "const": "rate_limit"
                        },
                        {
                          "type": "string",
                          "const": "overloaded"
                        },
                        {
                          "type": "string",
                          "const": "billing"
                        },
                        {
                          "type": "string",
                          "const": "server_error"
                        },
                        {
                          "type": "string",
                          "const": "timeout"
                        },
                        {
                          "type": "string",
                          "const": "context_overflow"
                        },
                        {
                          "type": "string",
                          "const": "model_not_found"
                        },
                        {
                          "type": "string",
                          "const": "session_expired"
                        },
                        {
                          "type": "string",
                          "const": "empty_response"
                        },
                        {
                          "type": "string",
                          "const": "no_error_details"
                        },
                        {
                          "type": "string",
                          "const": "unclassified"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "lastDurationMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveErrors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveSkipped": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastDelivered": {
                      "type": "boolean"
                    },
                    "lastDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureNotificationDelivered": {
                      "type": "boolean"
                    },
                    "lastFailureNotificationDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastFailureNotificationDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureAlertAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerState": {},
                    "streamStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "starting"
                        },
                        {
                          "type": "string",
                          "const": "running"
                        },
                        {
                          "type": "string",
                          "const": "restarting"
                        },
                        {
                          "type": "string",
                          "const": "stopped"
                        },
                        {
                          "type": "string",
                          "const": "disabled"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        }
                      ]
                    },
                    "streamError": {
                      "type": "string"
                    },
                    "streamConsecutiveFailures": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamRestartExhausted": {
                      "type": "boolean"
                    },
                    "streamDroppedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamCoalescedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastStartedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "expectedConfigRevision": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId",
            "patch"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            },
            "patch": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "displayName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200,
                      "pattern": "\\S"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sessionKey": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "description": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "deleteAfterRun": {
                  "type": "boolean"
                },
                "schedule": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "at"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "at"
                        },
                        "at": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "everyMs"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "every"
                        },
                        "everyMs": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "expr"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "cron"
                        },
                        "expr": {
                          "type": "string",
                          "minLength": 1
                        },
                        "tz": {
                          "type": "string"
                        },
                        "staggerMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "on-exit"
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "stream"
                        },
                        "command": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "line"
                            },
                            {
                              "type": "string",
                              "const": "match"
                            }
                          ]
                        },
                        "match": {
                          "type": "string"
                        },
                        "batchMs": {
                          "type": "integer",
                          "description": "Quiet-window milliseconds; clamped to 50-5000"
                        },
                        "maxBatchBytes": {
                          "type": "integer",
                          "description": "UTF-8 batch byte cap; clamped to 1024-65536"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "pacing": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "min": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        "max": {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      },
                      "additionalProperties": false,
                      "description": "Dynamic-cadence bounds; at least one of min or max is required"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "trigger": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "script"
                      ],
                      "properties": {
                        "script": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 65536
                        },
                        "once": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sessionTarget": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "main"
                    },
                    {
                      "type": "string",
                      "const": "isolated"
                    },
                    {
                      "type": "string",
                      "const": "current"
                    },
                    {
                      "type": "string",
                      "pattern": "^session:.+"
                    }
                  ]
                },
                "wakeMode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "next-heartbeat"
                    },
                    {
                      "type": "string",
                      "const": "now"
                    }
                  ]
                },
                "payload": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "systemEvent"
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "agentTurn"
                        },
                        "message": {
                          "type": "string",
                          "minLength": 1
                        },
                        "model": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "fallbacks": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "thinking": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "allowUnsafeExternalContent": {
                          "type": "boolean"
                        },
                        "lightContext": {
                          "type": "boolean"
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "command"
                        },
                        "argv": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          },
                          "minItems": 1
                        },
                        "cwd": {
                          "type": "string",
                          "minLength": 1
                        },
                        "env": {
                          "type": "object",
                          "patternProperties": {
                            "^.*$": {
                              "type": "string"
                            }
                          }
                        },
                        "input": {
                          "type": "string"
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "noOutputTimeoutSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "outputMaxBytes": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "script"
                        },
                        "script": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 65536
                        },
                        "timeoutSeconds": {
                          "type": "number",
                          "minimum": 1
                        },
                        "toolBudget": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "toolsAllow": {
                          "anyOf": [
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolsAllowIsDefault": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "delivery": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "none"
                        },
                        {
                          "type": "string",
                          "const": "announce"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        }
                      ]
                    },
                    "channel": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "last"
                            },
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "threadId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bestEffort": {
                      "type": "boolean"
                    },
                    "failureDestination": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "last"
                                    },
                                    {
                                      "type": "string",
                                      "minLength": 1,
                                      "pattern": "\\S"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "to": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "accountId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "mode": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "announce"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "completionDestination": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "mode",
                            "to"
                          ],
                          "properties": {
                            "mode": {
                              "type": "string",
                              "const": "webhook"
                            },
                            "to": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "to": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1,
                          "pattern": "\\S"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "failureAlert": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "const": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "after": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "channel": {
                          "anyOf": [
                            {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "last"
                                },
                                {
                                  "type": "string",
                                  "minLength": 1,
                                  "pattern": "\\S"
                                }
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "\\S"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cooldownMs": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "includeSkipped": {
                          "anyOf": [
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "mode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "announce"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "state": {
                  "type": "object",
                  "properties": {
                    "nextRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastRunStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ]
                    },
                    "lastStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "ok"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        }
                      ],
                      "deprecated": true,
                      "description": "Deprecated alias for lastRunStatus."
                    },
                    "lastError": {
                      "type": "string"
                    },
                    "lastErrorReason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "auth"
                        },
                        {
                          "type": "string",
                          "const": "auth_permanent"
                        },
                        {
                          "type": "string",
                          "const": "format"
                        },
                        {
                          "type": "string",
                          "const": "rate_limit"
                        },
                        {
                          "type": "string",
                          "const": "overloaded"
                        },
                        {
                          "type": "string",
                          "const": "billing"
                        },
                        {
                          "type": "string",
                          "const": "server_error"
                        },
                        {
                          "type": "string",
                          "const": "timeout"
                        },
                        {
                          "type": "string",
                          "const": "context_overflow"
                        },
                        {
                          "type": "string",
                          "const": "model_not_found"
                        },
                        {
                          "type": "string",
                          "const": "session_expired"
                        },
                        {
                          "type": "string",
                          "const": "empty_response"
                        },
                        {
                          "type": "string",
                          "const": "no_error_details"
                        },
                        {
                          "type": "string",
                          "const": "unclassified"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "lastDurationMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveErrors": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "consecutiveSkipped": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastDelivered": {
                      "type": "boolean"
                    },
                    "lastDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureNotificationDelivered": {
                      "type": "boolean"
                    },
                    "lastFailureNotificationDeliveryStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "delivered"
                        },
                        {
                          "type": "string",
                          "const": "not-delivered"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "not-requested"
                        }
                      ]
                    },
                    "lastFailureNotificationDeliveryError": {
                      "type": "string"
                    },
                    "lastFailureAlertAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "triggerState": {},
                    "streamStatus": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "starting"
                        },
                        {
                          "type": "string",
                          "const": "running"
                        },
                        {
                          "type": "string",
                          "const": "restarting"
                        },
                        {
                          "type": "string",
                          "const": "stopped"
                        },
                        {
                          "type": "string",
                          "const": "disabled"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        }
                      ]
                    },
                    "streamError": {
                      "type": "string"
                    },
                    "streamConsecutiveFailures": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamRestartExhausted": {
                      "type": "boolean"
                    },
                    "streamDroppedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamCoalescedBatches": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastStartedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "expectedConfigRevision": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronRemoveParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronRunParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "due"
                },
                {
                  "type": "string",
                  "const": "force"
                }
              ]
            },
            "expectedProcessInstanceId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            },
            "mode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "due"
                },
                {
                  "type": "string",
                  "const": "force"
                }
              ]
            },
            "expectedProcessInstanceId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronRunsParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "job"
            },
            {
              "type": "string",
              "const": "all"
            }
          ]
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^/\\\\]+$"
        },
        "jobId": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^/\\\\]+$"
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "statuses": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "ok"
              },
              {
                "type": "string",
                "const": "error"
              },
              {
                "type": "string",
                "const": "skipped"
              }
            ]
          },
          "minItems": 1,
          "maxItems": 3
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "error"
            },
            {
              "type": "string",
              "const": "skipped"
            }
          ]
        },
        "deliveryStatuses": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "delivered"
              },
              {
                "type": "string",
                "const": "not-delivered"
              },
              {
                "type": "string",
                "const": "unknown"
              },
              {
                "type": "string",
                "const": "not-requested"
              }
            ]
          },
          "minItems": 1,
          "maxItems": 4
        },
        "deliveryStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "delivered"
            },
            {
              "type": "string",
              "const": "not-delivered"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "not-requested"
            }
          ]
        },
        "query": {
          "type": "string"
        },
        "sortDir": {
          "anyOf": [
            {
              "type": "string",
              "const": "asc"
            },
            {
              "type": "string",
              "const": "desc"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CronScratchGetParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronScratchGetResult": {
      "type": "object",
      "required": [
        "scratch",
        "currentRevision",
        "maxBytes"
      ],
      "properties": {
        "scratch": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "content",
                "revision",
                "updatedAtMs"
              ],
              "properties": {
                "content": {
                  "type": "string",
                  "maxLength": 262144
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "currentRevision": {
          "type": "integer",
          "minimum": 0
        },
        "maxBytes": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "CronScratchSetParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "content"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "content": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 262144
                },
                {
                  "type": "null"
                }
              ]
            },
            "expectedRevision": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "jobId",
            "content"
          ],
          "properties": {
            "jobId": {
              "type": "string",
              "minLength": 1
            },
            "content": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 262144
                },
                {
                  "type": "null"
                }
              ]
            },
            "expectedRevision": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronScratchSetResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "ok",
            "scratch",
            "currentRevision",
            "maxBytes"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "scratch": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "content",
                    "revision",
                    "updatedAtMs"
                  ],
                  "properties": {
                    "content": {
                      "type": "string",
                      "maxLength": 262144
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "updatedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "currentRevision": {
              "type": "integer",
              "minimum": 0
            },
            "maxBytes": {
              "type": "integer",
              "minimum": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ok",
            "reason",
            "currentRevision"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": false
            },
            "reason": {
              "type": "string",
              "const": "revision-conflict"
            },
            "currentRevision": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "CronRunLogEntry": {
      "type": "object",
      "required": [
        "ts",
        "jobId",
        "action"
      ],
      "properties": {
        "ts": {
          "type": "integer",
          "minimum": 0
        },
        "jobId": {
          "type": "string",
          "minLength": 1
        },
        "action": {
          "type": "string",
          "const": "finished"
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "error"
            },
            {
              "type": "string",
              "const": "skipped"
            }
          ]
        },
        "error": {
          "type": "string"
        },
        "errorReason": {
          "anyOf": [
            {
              "type": "string",
              "const": "auth"
            },
            {
              "type": "string",
              "const": "auth_permanent"
            },
            {
              "type": "string",
              "const": "format"
            },
            {
              "type": "string",
              "const": "rate_limit"
            },
            {
              "type": "string",
              "const": "overloaded"
            },
            {
              "type": "string",
              "const": "billing"
            },
            {
              "type": "string",
              "const": "server_error"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "context_overflow"
            },
            {
              "type": "string",
              "const": "model_not_found"
            },
            {
              "type": "string",
              "const": "session_expired"
            },
            {
              "type": "string",
              "const": "empty_response"
            },
            {
              "type": "string",
              "const": "no_error_details"
            },
            {
              "type": "string",
              "const": "unclassified"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "summary": {
          "type": "string"
        },
        "diagnostics": {
          "type": "object",
          "required": [
            "entries"
          ],
          "properties": {
            "summary": {
              "type": "string"
            },
            "entries": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "ts",
                  "source",
                  "severity",
                  "message"
                ],
                "properties": {
                  "ts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "cron-preflight"
                      },
                      {
                        "type": "string",
                        "const": "cron-setup"
                      },
                      {
                        "type": "string",
                        "const": "model-preflight"
                      },
                      {
                        "type": "string",
                        "const": "agent-run"
                      },
                      {
                        "type": "string",
                        "const": "tool"
                      },
                      {
                        "type": "string",
                        "const": "exec"
                      },
                      {
                        "type": "string",
                        "const": "delivery"
                      }
                    ]
                  },
                  "severity": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "info"
                      },
                      {
                        "type": "string",
                        "const": "warn"
                      },
                      {
                        "type": "string",
                        "const": "error"
                      }
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "toolName": {
                    "type": "string"
                  },
                  "exitCode": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "truncated": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "delivered": {
          "type": "boolean"
        },
        "deliveryStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "delivered"
            },
            {
              "type": "string",
              "const": "not-delivered"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "not-requested"
            }
          ]
        },
        "deliveryError": {
          "type": "string"
        },
        "failureNotificationDelivery": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "delivered": {
              "type": "boolean"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "not-delivered"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "not-requested"
                }
              ]
            },
            "error": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "runAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0
        },
        "nextRunAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "triggerFired": {
          "type": "boolean"
        },
        "model": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "usage": {
          "type": "object",
          "properties": {
            "input_tokens": {
              "type": "number"
            },
            "output_tokens": {
              "type": "number"
            },
            "total_tokens": {
              "type": "number"
            },
            "cache_read_tokens": {
              "type": "number"
            },
            "cache_write_tokens": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        "jobName": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "LogsTailParams": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5000
        },
        "maxBytes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        }
      },
      "additionalProperties": false
    },
    "LogsTailResult": {
      "type": "object",
      "required": [
        "file",
        "cursor",
        "size",
        "lines"
      ],
      "properties": {
        "file": {
          "type": "string",
          "minLength": 1
        },
        "cursor": {
          "type": "integer",
          "minimum": 0
        },
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "truncated": {
          "type": "boolean"
        },
        "reset": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "MemoryMigrationItemStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "planned"
        },
        {
          "type": "string",
          "const": "migrated"
        },
        {
          "type": "string",
          "const": "skipped"
        },
        {
          "type": "string",
          "const": "warning"
        },
        {
          "type": "string",
          "const": "conflict"
        },
        {
          "type": "string",
          "const": "error"
        }
      ]
    },
    "MemoryMigrationItem": {
      "type": "object",
      "required": [
        "id",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "planned"
            },
            {
              "type": "string",
              "const": "migrated"
            },
            {
              "type": "string",
              "const": "skipped"
            },
            {
              "type": "string",
              "const": "warning"
            },
            {
              "type": "string",
              "const": "conflict"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "details": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          }
        }
      },
      "additionalProperties": false
    },
    "MemoryMigrationSummary": {
      "type": "object",
      "required": [
        "total",
        "planned",
        "migrated",
        "skipped",
        "conflicts",
        "errors",
        "sensitive"
      ],
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "planned": {
          "type": "integer",
          "minimum": 0
        },
        "migrated": {
          "type": "integer",
          "minimum": 0
        },
        "skipped": {
          "type": "integer",
          "minimum": 0
        },
        "conflicts": {
          "type": "integer",
          "minimum": 0
        },
        "errors": {
          "type": "integer",
          "minimum": 0
        },
        "sensitive": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "MemoryMigrationProviderPlan": {
      "type": "object",
      "required": [
        "providerId",
        "label",
        "found",
        "summary",
        "items"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "planFingerprint": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "found": {
          "type": "boolean"
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "confidence": {
          "anyOf": [
            {
              "type": "string",
              "const": "low"
            },
            {
              "type": "string",
              "const": "medium"
            },
            {
              "type": "string",
              "const": "high"
            }
          ]
        },
        "message": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "summary": {
          "type": "object",
          "required": [
            "total",
            "planned",
            "migrated",
            "skipped",
            "conflicts",
            "errors",
            "sensitive"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "planned": {
              "type": "integer",
              "minimum": 0
            },
            "migrated": {
              "type": "integer",
              "minimum": 0
            },
            "skipped": {
              "type": "integer",
              "minimum": 0
            },
            "conflicts": {
              "type": "integer",
              "minimum": 0
            },
            "errors": {
              "type": "integer",
              "minimum": 0
            },
            "sensitive": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "planned"
                  },
                  {
                    "type": "string",
                    "const": "migrated"
                  },
                  {
                    "type": "string",
                    "const": "skipped"
                  },
                  {
                    "type": "string",
                    "const": "warning"
                  },
                  {
                    "type": "string",
                    "const": "conflict"
                  },
                  {
                    "type": "string",
                    "const": "error"
                  }
                ]
              },
              "source": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {}
                }
              }
            },
            "additionalProperties": false
          },
          "maxItems": 2000
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "MigrationsMemoryPlanParams": {
      "type": "object",
      "required": [
        "agentId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "overwrite": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "MigrationsMemoryPlanResult": {
      "type": "object",
      "required": [
        "agentId",
        "workspace",
        "providers"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "workspace": {
          "type": "string",
          "minLength": 1
        },
        "providers": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "providerId",
              "label",
              "found",
              "summary",
              "items"
            ],
            "properties": {
              "providerId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "planFingerprint": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64,
                "pattern": "^[a-f0-9]{64}$"
              },
              "found": {
                "type": "boolean"
              },
              "source": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              },
              "confidence": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "low"
                  },
                  {
                    "type": "string",
                    "const": "medium"
                  },
                  {
                    "type": "string",
                    "const": "high"
                  }
                ]
              },
              "message": {
                "type": "string"
              },
              "error": {
                "type": "string"
              },
              "summary": {
                "type": "object",
                "required": [
                  "total",
                  "planned",
                  "migrated",
                  "skipped",
                  "conflicts",
                  "errors",
                  "sensitive"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "planned": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "migrated": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skipped": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "conflicts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "errors": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "sensitive": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "planned"
                        },
                        {
                          "type": "string",
                          "const": "migrated"
                        },
                        {
                          "type": "string",
                          "const": "skipped"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "conflict"
                        },
                        {
                          "type": "string",
                          "const": "error"
                        }
                      ]
                    },
                    "source": {
                      "type": "string",
                      "minLength": 1
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "details": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {}
                      }
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 2000
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "MigrationsMemoryApplyParams": {
      "type": "object",
      "required": [
        "idempotencyKey",
        "agentId",
        "providerId",
        "planFingerprint",
        "itemIds"
      ],
      "properties": {
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "planFingerprint": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-f0-9]{64}$"
        },
        "itemIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "uniqueItems": true,
          "maxItems": 2000
        },
        "overwrite": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "MigrationsMemoryApplyResult": {
      "type": "object",
      "required": [
        "providerId",
        "source",
        "summary",
        "items"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "source": {
          "type": "string",
          "minLength": 1
        },
        "target": {
          "type": "string",
          "minLength": 1
        },
        "summary": {
          "type": "object",
          "required": [
            "total",
            "planned",
            "migrated",
            "skipped",
            "conflicts",
            "errors",
            "sensitive"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "planned": {
              "type": "integer",
              "minimum": 0
            },
            "migrated": {
              "type": "integer",
              "minimum": 0
            },
            "skipped": {
              "type": "integer",
              "minimum": 0
            },
            "conflicts": {
              "type": "integer",
              "minimum": 0
            },
            "errors": {
              "type": "integer",
              "minimum": 0
            },
            "sensitive": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "planned"
                  },
                  {
                    "type": "string",
                    "const": "migrated"
                  },
                  {
                    "type": "string",
                    "const": "skipped"
                  },
                  {
                    "type": "string",
                    "const": "warning"
                  },
                  {
                    "type": "string",
                    "const": "conflict"
                  },
                  {
                    "type": "string",
                    "const": "error"
                  }
                ]
              },
              "source": {
                "type": "string",
                "minLength": 1
              },
              "target": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {}
                }
              }
            },
            "additionalProperties": false
          },
          "maxItems": 2000
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "backupPath": {
          "type": "string",
          "minLength": 1
        },
        "reportDir": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TerminalOpenParams": {
      "type": "object",
      "required": [
        "cols",
        "rows"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "catalog": {
          "type": "object",
          "required": [
            "catalogId",
            "hostId",
            "threadId"
          ],
          "properties": {
            "catalogId": {
              "type": "string",
              "minLength": 1
            },
            "hostId": {
              "type": "string",
              "minLength": 1
            },
            "threadId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "cols": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000
        },
        "rows": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000
        }
      },
      "additionalProperties": false
    },
    "TerminalOpenResult": {
      "type": "object",
      "required": [
        "sessionId",
        "agentId",
        "shell",
        "cwd",
        "confined"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "shell": {
          "type": "string",
          "minLength": 1
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "confined": {
          "type": "boolean"
        },
        "title": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TerminalInputParams": {
      "type": "object",
      "required": [
        "sessionId",
        "data"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "data": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TerminalResizeParams": {
      "type": "object",
      "required": [
        "sessionId",
        "cols",
        "rows"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "cols": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000
        },
        "rows": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000
        }
      },
      "additionalProperties": false
    },
    "TerminalCloseParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TerminalAttachParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TerminalAttachResult": {
      "type": "object",
      "required": [
        "sessionId",
        "agentId",
        "shell",
        "cwd",
        "confined",
        "buffer"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "shell": {
          "type": "string",
          "minLength": 1
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "confined": {
          "type": "boolean"
        },
        "buffer": {
          "type": "string"
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "TerminalSessionInfo": {
      "type": "object",
      "required": [
        "sessionId",
        "agentId",
        "shell",
        "cwd",
        "confined",
        "attached",
        "createdAtMs"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "shell": {
          "type": "string",
          "minLength": 1
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "confined": {
          "type": "boolean"
        },
        "attached": {
          "type": "boolean"
        },
        "owner": {
          "anyOf": [
            {
              "type": "string",
              "const": "conn"
            },
            {
              "type": "string",
              "pattern": "^agent:.+"
            }
          ]
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "TerminalListResult": {
      "type": "object",
      "required": [
        "sessions"
      ],
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "sessionId",
              "agentId",
              "shell",
              "cwd",
              "confined",
              "attached",
              "createdAtMs"
            ],
            "properties": {
              "sessionId": {
                "type": "string",
                "minLength": 1
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              },
              "shell": {
                "type": "string",
                "minLength": 1
              },
              "cwd": {
                "type": "string",
                "minLength": 1
              },
              "confined": {
                "type": "boolean"
              },
              "attached": {
                "type": "boolean"
              },
              "owner": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "conn"
                  },
                  {
                    "type": "string",
                    "pattern": "^agent:.+"
                  }
                ]
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "TerminalTextParams": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "TerminalTextResult": {
      "type": "object",
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TerminalUploadParams": {
      "type": "object",
      "required": [
        "sessionId",
        "name",
        "contentBase64"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "contentBase64": {
          "type": "string",
          "maxLength": 22369624
        }
      },
      "additionalProperties": false
    },
    "TerminalUploadResult": {
      "type": "object",
      "required": [
        "path",
        "size"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "maximum": 16777216
        }
      },
      "additionalProperties": false
    },
    "TerminalAckResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "TerminalDataEvent": {
      "type": "object",
      "required": [
        "sessionId",
        "seq",
        "data"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "data": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "TerminalExitEvent": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "exitCode": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "signal": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "process_exit"
            },
            {
              "type": "string",
              "const": "closed"
            },
            {
              "type": "string",
              "const": "disconnected"
            },
            {
              "type": "string",
              "const": "detached"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "error": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "TerminalEvent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "sessionId",
            "seq",
            "data"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "data": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        },
        {
          "type": "object",
          "required": [
            "sessionId"
          ],
          "properties": {
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "exitCode": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "signal": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "process_exit"
                },
                {
                  "type": "string",
                  "const": "closed"
                },
                {
                  "type": "string",
                  "const": "disconnected"
                },
                {
                  "type": "string",
                  "const": "detached"
                },
                {
                  "type": "string",
                  "const": "error"
                }
              ]
            },
            "error": {
              "type": "string"
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        }
      ],
      "x-openclaw-since": "2026.7"
    },
    "ApprovalKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "exec"
        },
        {
          "type": "string",
          "const": "plugin"
        },
        {
          "type": "string",
          "const": "system-agent"
        }
      ]
    },
    "ApprovalDecision": {
      "anyOf": [
        {
          "type": "string",
          "const": "allow-once"
        },
        {
          "type": "string",
          "const": "allow-always"
        },
        {
          "type": "string",
          "const": "deny"
        }
      ]
    },
    "ApprovalAllowDecision": {
      "anyOf": [
        {
          "type": "string",
          "const": "allow-once"
        },
        {
          "type": "string",
          "const": "allow-always"
        }
      ]
    },
    "ApprovalAllowedReason": {
      "anyOf": [
        {
          "type": "string",
          "const": "user"
        }
      ]
    },
    "ApprovalDeniedReason": {
      "anyOf": [
        {
          "type": "string",
          "const": "user"
        },
        {
          "type": "string",
          "const": "malformed-verdict"
        },
        {
          "type": "string",
          "const": "no-route"
        },
        {
          "type": "string",
          "const": "storage-corrupt"
        }
      ]
    },
    "ApprovalExpiredReason": {
      "anyOf": [
        {
          "type": "string",
          "const": "timeout"
        }
      ]
    },
    "ApprovalCancelledReason": {
      "anyOf": [
        {
          "type": "string",
          "const": "run-aborted"
        },
        {
          "type": "string",
          "const": "gateway-restart"
        }
      ]
    },
    "PluginApprovalSeverity": {
      "anyOf": [
        {
          "type": "string",
          "const": "info"
        },
        {
          "type": "string",
          "const": "warning"
        },
        {
          "type": "string",
          "const": "critical"
        }
      ]
    },
    "ExecApprovalPresentation": {
      "type": "object",
      "required": [
        "kind",
        "commandText",
        "allowedDecisions"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "exec"
        },
        "commandText": {
          "type": "string",
          "minLength": 1
        },
        "commandPreview": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "warningText": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "host": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "nodeId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "allowedDecisions": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "allow-once"
              },
              {
                "type": "string",
                "const": "allow-always"
              },
              {
                "type": "string",
                "const": "deny"
              }
            ]
          },
          "minItems": 1,
          "maxItems": 3,
          "uniqueItems": true,
          "contains": {
            "type": "string",
            "const": "deny"
          },
          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
        }
      },
      "additionalProperties": false,
      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
    },
    "PluginApprovalPresentation": {
      "type": "object",
      "required": [
        "kind",
        "title",
        "description",
        "severity",
        "allowedDecisions"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "plugin"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "detail": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384
        },
        "severity": {
          "anyOf": [
            {
              "type": "string",
              "const": "info"
            },
            {
              "type": "string",
              "const": "warning"
            },
            {
              "type": "string",
              "const": "critical"
            }
          ]
        },
        "pluginId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "toolName": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "allowedDecisions": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "allow-once"
              },
              {
                "type": "string",
                "const": "allow-always"
              },
              {
                "type": "string",
                "const": "deny"
              }
            ]
          },
          "minItems": 1,
          "maxItems": 3,
          "uniqueItems": true,
          "contains": {
            "type": "string",
            "const": "deny"
          },
          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
        }
      },
      "additionalProperties": false
    },
    "SystemAgentApprovalPresentation": {
      "type": "object",
      "required": [
        "kind",
        "title",
        "description",
        "proposalHash",
        "allowedDecisions"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "system-agent"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "proposalHash": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "allowedDecisions": {
          "type": "array",
          "additionalItems": false,
          "items": [
            {
              "type": "string",
              "const": "allow-once"
            },
            {
              "type": "string",
              "const": "deny"
            }
          ],
          "minItems": 2
        }
      },
      "additionalProperties": false
    },
    "ApprovalPresentation": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "commandText",
            "allowedDecisions"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "exec"
            },
            "commandText": {
              "type": "string",
              "minLength": 1
            },
            "commandPreview": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "warningText": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "host": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "nodeId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "agentId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "allowedDecisions": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "allow-once"
                  },
                  {
                    "type": "string",
                    "const": "allow-always"
                  },
                  {
                    "type": "string",
                    "const": "deny"
                  }
                ]
              },
              "minItems": 1,
              "maxItems": 3,
              "uniqueItems": true,
              "contains": {
                "type": "string",
                "const": "deny"
              },
              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
            }
          },
          "additionalProperties": false,
          "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
        },
        {
          "type": "object",
          "required": [
            "kind",
            "title",
            "description",
            "severity",
            "allowedDecisions"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "plugin"
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "detail": {
              "type": "string",
              "minLength": 1,
              "maxLength": 16384
            },
            "severity": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "info"
                },
                {
                  "type": "string",
                  "const": "warning"
                },
                {
                  "type": "string",
                  "const": "critical"
                }
              ]
            },
            "pluginId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "toolName": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "agentId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "allowedDecisions": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "allow-once"
                  },
                  {
                    "type": "string",
                    "const": "allow-always"
                  },
                  {
                    "type": "string",
                    "const": "deny"
                  }
                ]
              },
              "minItems": 1,
              "maxItems": 3,
              "uniqueItems": true,
              "contains": {
                "type": "string",
                "const": "deny"
              },
              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "title",
            "description",
            "proposalHash",
            "allowedDecisions"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "system-agent"
            },
            "title": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            },
            "description": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            "proposalHash": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "agentId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "allowedDecisions": {
              "type": "array",
              "additionalItems": false,
              "items": [
                {
                  "type": "string",
                  "const": "allow-once"
                },
                {
                  "type": "string",
                  "const": "deny"
                }
              ],
              "minItems": 2
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "PendingApprovalSnapshot": {
      "type": "object",
      "required": [
        "id",
        "urlPath",
        "createdAtMs",
        "expiresAtMs",
        "presentation",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "urlPath": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "presentation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "commandText",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "exec"
                },
                "commandText": {
                  "type": "string",
                  "minLength": 1
                },
                "commandPreview": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warningText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "host": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nodeId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false,
              "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "severity",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "detail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "info"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "toolName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "proposalHash",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "system-agent"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "proposalHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "additionalItems": false,
                  "items": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "deny"
                    }
                  ],
                  "minItems": 2
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "status": {
          "type": "string",
          "const": "pending"
        }
      },
      "additionalProperties": false
    },
    "AllowedApprovalSnapshot": {
      "type": "object",
      "required": [
        "id",
        "urlPath",
        "createdAtMs",
        "expiresAtMs",
        "presentation",
        "resolvedAtMs",
        "status",
        "decision",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "urlPath": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "presentation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "commandText",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "exec"
                },
                "commandText": {
                  "type": "string",
                  "minLength": 1
                },
                "commandPreview": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warningText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "host": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nodeId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false,
              "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "severity",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "detail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "info"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "toolName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "proposalHash",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "system-agent"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "proposalHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "additionalItems": false,
                  "items": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "deny"
                    }
                  ],
                  "minItems": 2
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "resolvedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "resolver": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "device"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "runtime"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "status": {
          "type": "string",
          "const": "allowed"
        },
        "decision": {
          "anyOf": [
            {
              "type": "string",
              "const": "allow-once"
            },
            {
              "type": "string",
              "const": "allow-always"
            }
          ]
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "DeniedApprovalSnapshot": {
      "type": "object",
      "required": [
        "id",
        "urlPath",
        "createdAtMs",
        "expiresAtMs",
        "presentation",
        "resolvedAtMs",
        "status",
        "decision",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "urlPath": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "presentation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "commandText",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "exec"
                },
                "commandText": {
                  "type": "string",
                  "minLength": 1
                },
                "commandPreview": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warningText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "host": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nodeId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false,
              "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "severity",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "detail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "info"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "toolName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "proposalHash",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "system-agent"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "proposalHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "additionalItems": false,
                  "items": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "deny"
                    }
                  ],
                  "minItems": 2
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "resolvedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "resolver": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "device"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "runtime"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "status": {
          "type": "string",
          "const": "denied"
        },
        "decision": {
          "type": "string",
          "const": "deny"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            },
            {
              "type": "string",
              "const": "malformed-verdict"
            },
            {
              "type": "string",
              "const": "no-route"
            },
            {
              "type": "string",
              "const": "storage-corrupt"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ExpiredApprovalSnapshot": {
      "type": "object",
      "required": [
        "id",
        "urlPath",
        "createdAtMs",
        "expiresAtMs",
        "presentation",
        "resolvedAtMs",
        "status",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "urlPath": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "presentation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "commandText",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "exec"
                },
                "commandText": {
                  "type": "string",
                  "minLength": 1
                },
                "commandPreview": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warningText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "host": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nodeId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false,
              "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "severity",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "detail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "info"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "toolName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "proposalHash",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "system-agent"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "proposalHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "additionalItems": false,
                  "items": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "deny"
                    }
                  ],
                  "minItems": 2
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "resolvedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "resolver": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "device"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "runtime"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "status": {
          "type": "string",
          "const": "expired"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "timeout"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "CancelledApprovalSnapshot": {
      "type": "object",
      "required": [
        "id",
        "urlPath",
        "createdAtMs",
        "expiresAtMs",
        "presentation",
        "resolvedAtMs",
        "status",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "urlPath": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "presentation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "commandText",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "exec"
                },
                "commandText": {
                  "type": "string",
                  "minLength": 1
                },
                "commandPreview": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "warningText": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "host": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "nodeId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false,
              "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "severity",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "plugin"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "detail": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "severity": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "info"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "toolName": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      }
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 3,
                  "uniqueItems": true,
                  "contains": {
                    "type": "string",
                    "const": "deny"
                  },
                  "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "title",
                "description",
                "proposalHash",
                "allowedDecisions"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "system-agent"
                },
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "proposalHash": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{64}$"
                },
                "agentId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "allowedDecisions": {
                  "type": "array",
                  "additionalItems": false,
                  "items": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "deny"
                    }
                  ],
                  "minItems": 2
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "resolvedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "type": "object",
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "resolver": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "device"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "runtime"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "status": {
          "type": "string",
          "const": "cancelled"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "run-aborted"
            },
            {
              "type": "string",
              "const": "gateway-restart"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ApprovalSnapshot": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "status": {
              "type": "string",
              "const": "pending"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "decision",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "allowed"
            },
            "decision": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "allow-once"
                },
                {
                  "type": "string",
                  "const": "allow-always"
                }
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "user"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "decision",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "denied"
            },
            "decision": {
              "type": "string",
              "const": "deny"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "user"
                },
                {
                  "type": "string",
                  "const": "malformed-verdict"
                },
                {
                  "type": "string",
                  "const": "no-route"
                },
                {
                  "type": "string",
                  "const": "storage-corrupt"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "expired"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "timeout"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "cancelled"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "run-aborted"
                },
                {
                  "type": "string",
                  "const": "gateway-restart"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ApprovalTerminalReason": {
      "anyOf": [
        {
          "type": "string",
          "const": "user"
        },
        {
          "type": "string",
          "const": "timeout"
        },
        {
          "type": "string",
          "const": "malformed-verdict"
        },
        {
          "type": "string",
          "const": "no-route"
        },
        {
          "type": "string",
          "const": "run-aborted"
        },
        {
          "type": "string",
          "const": "gateway-restart"
        },
        {
          "type": "string",
          "const": "storage-corrupt"
        }
      ]
    },
    "TerminalApprovalSnapshot": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "decision",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "allowed"
            },
            "decision": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "allow-once"
                },
                {
                  "type": "string",
                  "const": "allow-always"
                }
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "user"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "decision",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "denied"
            },
            "decision": {
              "type": "string",
              "const": "deny"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "user"
                },
                {
                  "type": "string",
                  "const": "malformed-verdict"
                },
                {
                  "type": "string",
                  "const": "no-route"
                },
                {
                  "type": "string",
                  "const": "storage-corrupt"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "expired"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "timeout"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "resolvedAtMs",
            "status",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "resolvedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "source": {
              "type": "object",
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "resolver": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "device"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "const": "cancelled"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "run-aborted"
                },
                {
                  "type": "string",
                  "const": "gateway-restart"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ApprovalGetParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        }
      },
      "additionalProperties": false
    },
    "ApprovalGetResult": {
      "type": "object",
      "required": [
        "approval"
      ],
      "properties": {
        "approval": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "pending"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "allowed"
                },
                "decision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "allow-always"
                    }
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "denied"
                },
                "decision": {
                  "type": "string",
                  "const": "deny"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    },
                    {
                      "type": "string",
                      "const": "malformed-verdict"
                    },
                    {
                      "type": "string",
                      "const": "no-route"
                    },
                    {
                      "type": "string",
                      "const": "storage-corrupt"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "expired"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "timeout"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "cancelled"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "run-aborted"
                    },
                    {
                      "type": "string",
                      "const": "gateway-restart"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ApprovalHistoryParams": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "exec"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "system-agent"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ApprovalHistoryResult": {
      "type": "object",
      "required": [
        "items"
      ],
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "urlPath",
                  "createdAtMs",
                  "expiresAtMs",
                  "presentation",
                  "resolvedAtMs",
                  "status",
                  "decision",
                  "reason"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                    "description": "Exact full approval id encoded safely in deep-link paths."
                  },
                  "urlPath": {
                    "type": "string",
                    "minLength": 1
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "expiresAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "presentation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "commandText",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "exec"
                          },
                          "commandText": {
                            "type": "string",
                            "minLength": 1
                          },
                          "commandPreview": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "warningText": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "host": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "nodeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false,
                        "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "severity",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "plugin"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "detail": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 16384
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warning"
                              },
                              {
                                "type": "string",
                                "const": "critical"
                              }
                            ]
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "toolName": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "proposalHash",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "system-agent"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "proposalHash": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "additionalItems": false,
                            "items": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ],
                            "minItems": 2
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "resolvedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "agentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sessionKey": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "resolver": {
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "device"
                          },
                          {
                            "type": "string",
                            "const": "channel"
                          },
                          {
                            "type": "string",
                            "const": "runtime"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "allowed"
                  },
                  "decision": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow-once"
                      },
                      {
                        "type": "string",
                        "const": "allow-always"
                      }
                    ]
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "user"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "urlPath",
                  "createdAtMs",
                  "expiresAtMs",
                  "presentation",
                  "resolvedAtMs",
                  "status",
                  "decision",
                  "reason"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                    "description": "Exact full approval id encoded safely in deep-link paths."
                  },
                  "urlPath": {
                    "type": "string",
                    "minLength": 1
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "expiresAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "presentation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "commandText",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "exec"
                          },
                          "commandText": {
                            "type": "string",
                            "minLength": 1
                          },
                          "commandPreview": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "warningText": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "host": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "nodeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false,
                        "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "severity",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "plugin"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "detail": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 16384
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warning"
                              },
                              {
                                "type": "string",
                                "const": "critical"
                              }
                            ]
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "toolName": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "proposalHash",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "system-agent"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "proposalHash": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "additionalItems": false,
                            "items": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ],
                            "minItems": 2
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "resolvedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "agentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sessionKey": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "resolver": {
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "device"
                          },
                          {
                            "type": "string",
                            "const": "channel"
                          },
                          {
                            "type": "string",
                            "const": "runtime"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "denied"
                  },
                  "decision": {
                    "type": "string",
                    "const": "deny"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "user"
                      },
                      {
                        "type": "string",
                        "const": "malformed-verdict"
                      },
                      {
                        "type": "string",
                        "const": "no-route"
                      },
                      {
                        "type": "string",
                        "const": "storage-corrupt"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "urlPath",
                  "createdAtMs",
                  "expiresAtMs",
                  "presentation",
                  "resolvedAtMs",
                  "status",
                  "reason"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                    "description": "Exact full approval id encoded safely in deep-link paths."
                  },
                  "urlPath": {
                    "type": "string",
                    "minLength": 1
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "expiresAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "presentation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "commandText",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "exec"
                          },
                          "commandText": {
                            "type": "string",
                            "minLength": 1
                          },
                          "commandPreview": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "warningText": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "host": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "nodeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false,
                        "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "severity",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "plugin"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "detail": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 16384
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warning"
                              },
                              {
                                "type": "string",
                                "const": "critical"
                              }
                            ]
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "toolName": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "proposalHash",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "system-agent"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "proposalHash": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "additionalItems": false,
                            "items": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ],
                            "minItems": 2
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "resolvedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "agentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sessionKey": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "resolver": {
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "device"
                          },
                          {
                            "type": "string",
                            "const": "channel"
                          },
                          {
                            "type": "string",
                            "const": "runtime"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "expired"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "timeout"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "urlPath",
                  "createdAtMs",
                  "expiresAtMs",
                  "presentation",
                  "resolvedAtMs",
                  "status",
                  "reason"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                    "description": "Exact full approval id encoded safely in deep-link paths."
                  },
                  "urlPath": {
                    "type": "string",
                    "minLength": 1
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "expiresAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "presentation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "commandText",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "exec"
                          },
                          "commandText": {
                            "type": "string",
                            "minLength": 1
                          },
                          "commandPreview": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "warningText": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "host": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "nodeId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false,
                        "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "severity",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "plugin"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "detail": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 16384
                          },
                          "severity": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "info"
                              },
                              {
                                "type": "string",
                                "const": "warning"
                              },
                              {
                                "type": "string",
                                "const": "critical"
                              }
                            ]
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "toolName": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "items": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "allow-always"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ]
                            },
                            "minItems": 1,
                            "maxItems": 3,
                            "uniqueItems": true,
                            "contains": {
                              "type": "string",
                              "const": "deny"
                            },
                            "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "title",
                          "description",
                          "proposalHash",
                          "allowedDecisions"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "system-agent"
                          },
                          "title": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "description": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 512
                          },
                          "proposalHash": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          },
                          "agentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "allowedDecisions": {
                            "type": "array",
                            "additionalItems": false,
                            "items": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ],
                            "minItems": 2
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "resolvedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "source": {
                    "type": "object",
                    "properties": {
                      "agentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "sessionKey": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "resolver": {
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "device"
                          },
                          {
                            "type": "string",
                            "const": "channel"
                          },
                          {
                            "type": "string",
                            "const": "runtime"
                          },
                          {
                            "type": "string",
                            "const": "system"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "cancelled"
                  },
                  "reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "run-aborted"
                      },
                      {
                        "type": "string",
                        "const": "gateway-restart"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            ]
          }
        },
        "nextCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        }
      },
      "additionalProperties": false
    },
    "ApprovalResolveParams": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "decision"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
          "description": "Exact full approval id encoded safely in deep-link paths."
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "exec"
            },
            {
              "type": "string",
              "const": "plugin"
            },
            {
              "type": "string",
              "const": "system-agent"
            }
          ]
        },
        "decision": {
          "anyOf": [
            {
              "type": "string",
              "const": "allow-once"
            },
            {
              "type": "string",
              "const": "allow-always"
            },
            {
              "type": "string",
              "const": "deny"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ApprovalResolveResult": {
      "type": "object",
      "required": [
        "applied",
        "approval"
      ],
      "properties": {
        "applied": {
          "type": "boolean"
        },
        "approval": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "allowed"
                },
                "decision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "allow-always"
                    }
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "denied"
                },
                "decision": {
                  "type": "string",
                  "const": "deny"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    },
                    {
                      "type": "string",
                      "const": "malformed-verdict"
                    },
                    {
                      "type": "string",
                      "const": "no-route"
                    },
                    {
                      "type": "string",
                      "const": "storage-corrupt"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "expired"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "timeout"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "cancelled"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "run-aborted"
                    },
                    {
                      "type": "string",
                      "const": "gateway-restart"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "PendingSessionApprovalEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "updatedAtMs",
        "phase",
        "approval"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sourceSessionKey": {
          "type": "string",
          "minLength": 1
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "phase": {
          "type": "string",
          "const": "pending"
        },
        "approval": {
          "type": "object",
          "required": [
            "id",
            "urlPath",
            "createdAtMs",
            "expiresAtMs",
            "presentation",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
              "description": "Exact full approval id encoded safely in deep-link paths."
            },
            "urlPath": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "presentation": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "commandText",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "exec"
                    },
                    "commandText": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commandPreview": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "warningText": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "host": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "nodeId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false,
                  "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "severity",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "plugin"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "detail": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    },
                    "severity": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "info"
                        },
                        {
                          "type": "string",
                          "const": "warning"
                        },
                        {
                          "type": "string",
                          "const": "critical"
                        }
                      ]
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "toolName": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "allow-always"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ]
                      },
                      "minItems": 1,
                      "maxItems": 3,
                      "uniqueItems": true,
                      "contains": {
                        "type": "string",
                        "const": "deny"
                      },
                      "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "title",
                    "description",
                    "proposalHash",
                    "allowedDecisions"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "system-agent"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "description": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    },
                    "proposalHash": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "agentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "allowedDecisions": {
                      "type": "array",
                      "additionalItems": false,
                      "items": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "deny"
                        }
                      ],
                      "minItems": 2
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "status": {
              "type": "string",
              "const": "pending"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "TerminalSessionApprovalEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "updatedAtMs",
        "phase",
        "approval"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "sourceSessionKey": {
          "type": "string",
          "minLength": 1
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "phase": {
          "type": "string",
          "const": "terminal"
        },
        "approval": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "allowed"
                },
                "decision": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "allow-once"
                    },
                    {
                      "type": "string",
                      "const": "allow-always"
                    }
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "decision",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "denied"
                },
                "decision": {
                  "type": "string",
                  "const": "deny"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "user"
                    },
                    {
                      "type": "string",
                      "const": "malformed-verdict"
                    },
                    {
                      "type": "string",
                      "const": "no-route"
                    },
                    {
                      "type": "string",
                      "const": "storage-corrupt"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "expired"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "timeout"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "resolvedAtMs",
                "status",
                "reason"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "resolvedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "sessionKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "resolver": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "device"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "const": "cancelled"
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "run-aborted"
                    },
                    {
                      "type": "string",
                      "const": "gateway-restart"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "SessionApprovalEvent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "sessionKey",
            "updatedAtMs",
            "phase",
            "approval"
          ],
          "properties": {
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sourceSessionKey": {
              "type": "string",
              "minLength": 1
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "phase": {
              "type": "string",
              "const": "pending"
            },
            "approval": {
              "type": "object",
              "required": [
                "id",
                "urlPath",
                "createdAtMs",
                "expiresAtMs",
                "presentation",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                  "description": "Exact full approval id encoded safely in deep-link paths."
                },
                "urlPath": {
                  "type": "string",
                  "minLength": 1
                },
                "createdAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "presentation": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "commandText",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "exec"
                        },
                        "commandText": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commandPreview": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "warningText": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "host": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "nodeId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "severity",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "plugin"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "detail": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 16384
                        },
                        "severity": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "info"
                            },
                            {
                              "type": "string",
                              "const": "warning"
                            },
                            {
                              "type": "string",
                              "const": "critical"
                            }
                          ]
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "toolName": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "allow-once"
                              },
                              {
                                "type": "string",
                                "const": "allow-always"
                              },
                              {
                                "type": "string",
                                "const": "deny"
                              }
                            ]
                          },
                          "minItems": 1,
                          "maxItems": 3,
                          "uniqueItems": true,
                          "contains": {
                            "type": "string",
                            "const": "deny"
                          },
                          "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "title",
                        "description",
                        "proposalHash",
                        "allowedDecisions"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "system-agent"
                        },
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "description": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "proposalHash": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "agentId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "allowedDecisions": {
                          "type": "array",
                          "additionalItems": false,
                          "items": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ],
                          "minItems": 2
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "status": {
                  "type": "string",
                  "const": "pending"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        },
        {
          "type": "object",
          "required": [
            "sessionKey",
            "updatedAtMs",
            "phase",
            "approval"
          ],
          "properties": {
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "sourceSessionKey": {
              "type": "string",
              "minLength": 1
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "phase": {
              "type": "string",
              "const": "terminal"
            },
            "approval": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "id",
                    "urlPath",
                    "createdAtMs",
                    "expiresAtMs",
                    "presentation",
                    "resolvedAtMs",
                    "status",
                    "decision",
                    "reason"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                      "description": "Exact full approval id encoded safely in deep-link paths."
                    },
                    "urlPath": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "expiresAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "presentation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "commandText",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exec"
                            },
                            "commandText": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commandPreview": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "warningText": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "host": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "nodeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false,
                          "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "severity",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "plugin"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "detail": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 16384
                            },
                            "severity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "info"
                                },
                                {
                                  "type": "string",
                                  "const": "warning"
                                },
                                {
                                  "type": "string",
                                  "const": "critical"
                                }
                              ]
                            },
                            "pluginId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "toolName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "proposalHash",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "system-agent"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalHash": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$"
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "additionalItems": false,
                              "items": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ],
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "resolvedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "agentId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sessionKey": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "resolver": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "device"
                            },
                            {
                              "type": "string",
                              "const": "channel"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "const": "allowed"
                    },
                    "decision": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "allow-once"
                        },
                        {
                          "type": "string",
                          "const": "allow-always"
                        }
                      ]
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "user"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "id",
                    "urlPath",
                    "createdAtMs",
                    "expiresAtMs",
                    "presentation",
                    "resolvedAtMs",
                    "status",
                    "decision",
                    "reason"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                      "description": "Exact full approval id encoded safely in deep-link paths."
                    },
                    "urlPath": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "expiresAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "presentation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "commandText",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exec"
                            },
                            "commandText": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commandPreview": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "warningText": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "host": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "nodeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false,
                          "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "severity",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "plugin"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "detail": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 16384
                            },
                            "severity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "info"
                                },
                                {
                                  "type": "string",
                                  "const": "warning"
                                },
                                {
                                  "type": "string",
                                  "const": "critical"
                                }
                              ]
                            },
                            "pluginId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "toolName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "proposalHash",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "system-agent"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalHash": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$"
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "additionalItems": false,
                              "items": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ],
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "resolvedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "agentId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sessionKey": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "resolver": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "device"
                            },
                            {
                              "type": "string",
                              "const": "channel"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "const": "denied"
                    },
                    "decision": {
                      "type": "string",
                      "const": "deny"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "user"
                        },
                        {
                          "type": "string",
                          "const": "malformed-verdict"
                        },
                        {
                          "type": "string",
                          "const": "no-route"
                        },
                        {
                          "type": "string",
                          "const": "storage-corrupt"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "id",
                    "urlPath",
                    "createdAtMs",
                    "expiresAtMs",
                    "presentation",
                    "resolvedAtMs",
                    "status",
                    "reason"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                      "description": "Exact full approval id encoded safely in deep-link paths."
                    },
                    "urlPath": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "expiresAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "presentation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "commandText",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exec"
                            },
                            "commandText": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commandPreview": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "warningText": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "host": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "nodeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false,
                          "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "severity",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "plugin"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "detail": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 16384
                            },
                            "severity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "info"
                                },
                                {
                                  "type": "string",
                                  "const": "warning"
                                },
                                {
                                  "type": "string",
                                  "const": "critical"
                                }
                              ]
                            },
                            "pluginId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "toolName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "proposalHash",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "system-agent"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalHash": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$"
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "additionalItems": false,
                              "items": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ],
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "resolvedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "agentId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sessionKey": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "resolver": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "device"
                            },
                            {
                              "type": "string",
                              "const": "channel"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "const": "expired"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "timeout"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "id",
                    "urlPath",
                    "createdAtMs",
                    "expiresAtMs",
                    "presentation",
                    "resolvedAtMs",
                    "status",
                    "reason"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                      "description": "Exact full approval id encoded safely in deep-link paths."
                    },
                    "urlPath": {
                      "type": "string",
                      "minLength": 1
                    },
                    "createdAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "expiresAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "presentation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "commandText",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "exec"
                            },
                            "commandText": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commandPreview": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "warningText": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "host": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "nodeId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false,
                          "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "severity",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "plugin"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "detail": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 16384
                            },
                            "severity": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "info"
                                },
                                {
                                  "type": "string",
                                  "const": "warning"
                                },
                                {
                                  "type": "string",
                                  "const": "critical"
                                }
                              ]
                            },
                            "pluginId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "toolName": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "items": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "allow-once"
                                  },
                                  {
                                    "type": "string",
                                    "const": "allow-always"
                                  },
                                  {
                                    "type": "string",
                                    "const": "deny"
                                  }
                                ]
                              },
                              "minItems": 1,
                              "maxItems": 3,
                              "uniqueItems": true,
                              "contains": {
                                "type": "string",
                                "const": "deny"
                              },
                              "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "title",
                            "description",
                            "proposalHash",
                            "allowedDecisions"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "system-agent"
                            },
                            "title": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 80
                            },
                            "description": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 512
                            },
                            "proposalHash": {
                              "type": "string",
                              "pattern": "^[a-f0-9]{64}$"
                            },
                            "agentId": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "minLength": 1
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "allowedDecisions": {
                              "type": "array",
                              "additionalItems": false,
                              "items": [
                                {
                                  "type": "string",
                                  "const": "allow-once"
                                },
                                {
                                  "type": "string",
                                  "const": "deny"
                                }
                              ],
                              "minItems": 2
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "resolvedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "agentId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "sessionKey": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "resolver": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "device"
                            },
                            {
                              "type": "string",
                              "const": "channel"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "const": "cancelled"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "run-aborted"
                        },
                        {
                          "type": "string",
                          "const": "gateway-restart"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        }
      ],
      "x-openclaw-since": "2026.7"
    },
    "SessionApprovalReplay": {
      "type": "object",
      "required": [
        "sessionKey",
        "updatedAtMs",
        "approvals",
        "truncated"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "approvals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "urlPath",
              "createdAtMs",
              "expiresAtMs",
              "presentation",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "pattern": "^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$",
                "description": "Exact full approval id encoded safely in deep-link paths."
              },
              "urlPath": {
                "type": "string",
                "minLength": 1
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "presentation": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "kind",
                      "commandText",
                      "allowedDecisions"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "exec"
                      },
                      "commandText": {
                        "type": "string",
                        "minLength": 1
                      },
                      "commandPreview": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "warningText": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "host": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "nodeId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "agentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "allowedDecisions": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "allow-always"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ]
                        },
                        "minItems": 1,
                        "maxItems": 3,
                        "uniqueItems": true,
                        "contains": {
                          "type": "string",
                          "const": "deny"
                        },
                        "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded."
                  },
                  {
                    "type": "object",
                    "required": [
                      "kind",
                      "title",
                      "description",
                      "severity",
                      "allowedDecisions"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "plugin"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "detail": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16384
                      },
                      "severity": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "info"
                          },
                          {
                            "type": "string",
                            "const": "warning"
                          },
                          {
                            "type": "string",
                            "const": "critical"
                          }
                        ]
                      },
                      "pluginId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "toolName": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "agentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "allowedDecisions": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "allow-once"
                            },
                            {
                              "type": "string",
                              "const": "allow-always"
                            },
                            {
                              "type": "string",
                              "const": "deny"
                            }
                          ]
                        },
                        "minItems": 1,
                        "maxItems": 3,
                        "uniqueItems": true,
                        "contains": {
                          "type": "string",
                          "const": "deny"
                        },
                        "description": "Available reviewer decisions. Deny is always available so malformed or unsafe input can fail closed."
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "kind",
                      "title",
                      "description",
                      "proposalHash",
                      "allowedDecisions"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "system-agent"
                      },
                      "title": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 80
                      },
                      "description": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      },
                      "proposalHash": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "agentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "allowedDecisions": {
                        "type": "array",
                        "additionalItems": false,
                        "items": [
                          {
                            "type": "string",
                            "const": "allow-once"
                          },
                          {
                            "type": "string",
                            "const": "deny"
                          }
                        ],
                        "minItems": 2
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "status": {
                "type": "string",
                "const": "pending"
              }
            },
            "additionalProperties": false
          }
        },
        "truncated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "ExecApprovalsGetParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "ExecApprovalsSetParams": {
      "type": "object",
      "required": [
        "file"
      ],
      "properties": {
        "file": {
          "type": "object",
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "type": "number",
              "const": 1
            },
            "socket": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "token": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "defaults": {
              "type": "object",
              "properties": {
                "security": {
                  "type": "string"
                },
                "ask": {
                  "type": "string"
                },
                "askFallback": {
                  "type": "string"
                },
                "autoAllowSkills": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "agents": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "object",
                  "properties": {
                    "security": {
                      "type": "string"
                    },
                    "ask": {
                      "type": "string"
                    },
                    "askFallback": {
                      "type": "string"
                    },
                    "autoAllowSkills": {
                      "type": "boolean"
                    },
                    "allowlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pattern"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "const": "allow-always"
                          },
                          "commandText": {
                            "type": "string"
                          },
                          "argPattern": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "number",
                            "minimum": 0
                          },
                          "lastUsedCommand": {
                            "type": "string"
                          },
                          "lastResolvedPath": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "additionalProperties": false
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalsNodeGetParams": {
      "type": "object",
      "required": [
        "nodeId"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalsNodeSnapshot": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string"
        },
        "exists": {
          "type": "boolean"
        },
        "hash": {
          "type": "string"
        },
        "file": {
          "type": "object",
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "type": "number",
              "const": 1
            },
            "socket": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "token": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "defaults": {
              "type": "object",
              "properties": {
                "security": {
                  "type": "string"
                },
                "ask": {
                  "type": "string"
                },
                "askFallback": {
                  "type": "string"
                },
                "autoAllowSkills": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "agents": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "object",
                  "properties": {
                    "security": {
                      "type": "string"
                    },
                    "ask": {
                      "type": "string"
                    },
                    "askFallback": {
                      "type": "string"
                    },
                    "autoAllowSkills": {
                      "type": "boolean"
                    },
                    "allowlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pattern"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "const": "allow-always"
                          },
                          "commandText": {
                            "type": "string"
                          },
                          "argPattern": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "number",
                            "minimum": 0
                          },
                          "lastUsedCommand": {
                            "type": "string"
                          },
                          "lastResolvedPath": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "additionalProperties": false
        },
        "resolvedDefaults": {
          "type": "object",
          "required": [
            "security",
            "ask",
            "askFallback",
            "autoAllowSkills"
          ],
          "properties": {
            "security": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "deny"
                },
                {
                  "type": "string",
                  "const": "allowlist"
                },
                {
                  "type": "string",
                  "const": "full"
                }
              ]
            },
            "ask": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "off"
                },
                {
                  "type": "string",
                  "const": "on-miss"
                },
                {
                  "type": "string",
                  "const": "always"
                }
              ]
            },
            "askFallback": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "deny"
                },
                {
                  "type": "string",
                  "const": "allowlist"
                },
                {
                  "type": "string",
                  "const": "full"
                }
              ]
            },
            "autoAllowSkills": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "enabled": {
          "type": "boolean"
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        },
        "defaultAction": {
          "anyOf": [
            {
              "type": "string",
              "const": "allow"
            },
            {
              "type": "string",
              "const": "deny"
            },
            {
              "type": "string",
              "const": "prompt"
            }
          ]
        },
        "rules": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "pattern",
              "action"
            ],
            "properties": {
              "pattern": {
                "type": "string",
                "minLength": 1
              },
              "action": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "allow"
                  },
                  {
                    "type": "string",
                    "const": "deny"
                  },
                  {
                    "type": "string",
                    "const": "prompt"
                  }
                ]
              },
              "shells": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "description": {
                "type": "string"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "constraints": {
          "type": "object",
          "properties": {
            "baseHashRequired": {
              "type": "boolean"
            },
            "defaultAllowAllowed": {
              "type": "boolean"
            },
            "broadAllowRulesAllowed": {
              "type": "boolean"
            },
            "dangerousAllowRulesAllowed": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "message": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "path",
            "exists",
            "hash",
            "file"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "enabled"
                ]
              },
              {
                "required": [
                  "baseHash"
                ]
              },
              {
                "required": [
                  "defaultAction"
                ]
              },
              {
                "required": [
                  "rules"
                ]
              },
              {
                "required": [
                  "constraints"
                ]
              },
              {
                "required": [
                  "message"
                ]
              }
            ]
          }
        },
        {
          "properties": {
            "enabled": {
              "const": true
            },
            "hash": {
              "minLength": 1
            }
          },
          "required": [
            "enabled",
            "hash",
            "defaultAction",
            "rules"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "path"
                ]
              },
              {
                "required": [
                  "exists"
                ]
              },
              {
                "required": [
                  "file"
                ]
              },
              {
                "required": [
                  "resolvedDefaults"
                ]
              },
              {
                "required": [
                  "message"
                ]
              }
            ]
          }
        },
        {
          "properties": {
            "enabled": {
              "const": false
            }
          },
          "required": [
            "enabled"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "path"
                ]
              },
              {
                "required": [
                  "exists"
                ]
              },
              {
                "required": [
                  "hash"
                ]
              },
              {
                "required": [
                  "file"
                ]
              },
              {
                "required": [
                  "resolvedDefaults"
                ]
              },
              {
                "required": [
                  "baseHash"
                ]
              },
              {
                "required": [
                  "defaultAction"
                ]
              },
              {
                "required": [
                  "rules"
                ]
              },
              {
                "required": [
                  "constraints"
                ]
              }
            ]
          }
        }
      ]
    },
    "ExecApprovalsNodeSetParams": {
      "type": "object",
      "required": [
        "nodeId"
      ],
      "properties": {
        "nodeId": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "type": "number",
              "const": 1
            },
            "socket": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "token": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "defaults": {
              "type": "object",
              "properties": {
                "security": {
                  "type": "string"
                },
                "ask": {
                  "type": "string"
                },
                "askFallback": {
                  "type": "string"
                },
                "autoAllowSkills": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "agents": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "object",
                  "properties": {
                    "security": {
                      "type": "string"
                    },
                    "ask": {
                      "type": "string"
                    },
                    "askFallback": {
                      "type": "string"
                    },
                    "autoAllowSkills": {
                      "type": "boolean"
                    },
                    "allowlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pattern"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "const": "allow-always"
                          },
                          "commandText": {
                            "type": "string"
                          },
                          "argPattern": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "number",
                            "minimum": 0
                          },
                          "lastUsedCommand": {
                            "type": "string"
                          },
                          "lastResolvedPath": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "additionalProperties": false
        },
        "native": {
          "type": "object",
          "required": [
            "rules"
          ],
          "properties": {
            "defaultAction": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "allow"
                },
                {
                  "type": "string",
                  "const": "deny"
                },
                {
                  "type": "string",
                  "const": "prompt"
                }
              ]
            },
            "rules": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "pattern",
                  "action"
                ],
                "properties": {
                  "pattern": {
                    "type": "string",
                    "minLength": 1
                  },
                  "action": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allow"
                      },
                      {
                        "type": "string",
                        "const": "deny"
                      },
                      {
                        "type": "string",
                        "const": "prompt"
                      }
                    ]
                  },
                  "shells": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "additionalProperties": false
        },
        "baseHash": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "file"
          ],
          "not": {
            "required": [
              "native"
            ]
          }
        },
        {
          "required": [
            "native",
            "baseHash"
          ],
          "not": {
            "required": [
              "file"
            ]
          }
        }
      ]
    },
    "ExecApprovalsSnapshot": {
      "type": "object",
      "required": [
        "path",
        "exists",
        "hash",
        "file"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "exists": {
          "type": "boolean"
        },
        "hash": {
          "type": "string",
          "minLength": 1
        },
        "file": {
          "type": "object",
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "type": "number",
              "const": 1
            },
            "socket": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string"
                },
                "token": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "defaults": {
              "type": "object",
              "properties": {
                "security": {
                  "type": "string"
                },
                "ask": {
                  "type": "string"
                },
                "askFallback": {
                  "type": "string"
                },
                "autoAllowSkills": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "agents": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "object",
                  "properties": {
                    "security": {
                      "type": "string"
                    },
                    "ask": {
                      "type": "string"
                    },
                    "askFallback": {
                      "type": "string"
                    },
                    "autoAllowSkills": {
                      "type": "boolean"
                    },
                    "allowlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "pattern"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "const": "allow-always"
                          },
                          "commandText": {
                            "type": "string"
                          },
                          "argPattern": {
                            "type": "string"
                          },
                          "lastUsedAt": {
                            "type": "number",
                            "minimum": 0
                          },
                          "lastUsedCommand": {
                            "type": "string"
                          },
                          "lastResolvedPath": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalGetParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalRequestParams": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "command": {
          "type": "string",
          "minLength": 1
        },
        "commandArgv": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "systemRunPlan": {
          "type": "object",
          "required": [
            "argv",
            "cwd",
            "commandText",
            "agentId",
            "sessionKey"
          ],
          "properties": {
            "argv": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "cwd": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "commandText": {
              "type": "string"
            },
            "commandPreview": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "agentId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "sessionKey": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "policySnapshot": {
              "type": "object",
              "required": [
                "security",
                "ask",
                "askFallback",
                "autoAllowSkills",
                "allowlistRules"
              ],
              "properties": {
                "security": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "deny"
                    },
                    {
                      "type": "string",
                      "const": "allowlist"
                    },
                    {
                      "type": "string",
                      "const": "full"
                    }
                  ]
                },
                "ask": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "off"
                    },
                    {
                      "type": "string",
                      "const": "on-miss"
                    },
                    {
                      "type": "string",
                      "const": "always"
                    }
                  ]
                },
                "askFallback": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "deny"
                    },
                    {
                      "type": "string",
                      "const": "allowlist"
                    },
                    {
                      "type": "string",
                      "const": "full"
                    }
                  ]
                },
                "autoAllowSkills": {
                  "type": "boolean"
                },
                "allowlistRules": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "pattern"
                    ],
                    "properties": {
                      "pattern": {
                        "type": "string"
                      },
                      "argPattern": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "const": "allow-always"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              },
              "additionalProperties": false
            },
            "mutableFileOperand": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "argvIndex",
                    "path",
                    "sha256"
                  ],
                  "properties": {
                    "argvIndex": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "path": {
                      "type": "string"
                    },
                    "sha256": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "env": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          }
        },
        "cwd": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "nodeId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "host": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "security": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "ask": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "warningText": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "unavailableDecisions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "allow-always"
            ]
          },
          "minItems": 1,
          "maxItems": 1
        },
        "commandSpans": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "startIndex",
              "endIndex"
            ],
            "properties": {
              "startIndex": {
                "type": "integer",
                "minimum": 0,
                "description": "Inclusive UTF-16 code unit offset into command."
              },
              "endIndex": {
                "type": "integer",
                "minimum": 1,
                "description": "Exclusive UTF-16 code unit offset into command; must be greater than startIndex and no greater than command.length."
              }
            },
            "additionalProperties": false
          }
        },
        "agentId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "resolvedPath": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "sessionKey": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "sessionId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "runId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "toolCallId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "turnSourceChannel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "turnSourceTo": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "turnSourceAccountId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "turnSourceThreadId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "approvalReviewerDeviceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Trusted approval-runtime metadata naming operator devices that may review this approval; ordinary Gateway clients may send the field, but the Gateway only binds it for internal approval-runtime requests."
        },
        "requireDeliveryRoute": {
          "type": "boolean"
        },
        "suppressDelivery": {
          "type": "boolean"
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1
        },
        "twoPhase": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalResolveParams": {
      "type": "object",
      "required": [
        "id",
        "decision"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "decision": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "QuestionOption": {
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "Question": {
      "type": "object",
      "required": [
        "questionId",
        "header",
        "question",
        "options"
      ],
      "properties": {
        "questionId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]*$"
        },
        "header": {
          "type": "string",
          "maxLength": 12
        },
        "question": {
          "type": "string",
          "minLength": 1
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label"
            ],
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 4
        },
        "multiSelect": {
          "type": "boolean"
        },
        "isOther": {
          "type": "boolean"
        },
        "isSecret": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "QuestionRequestQuestion": {
      "type": "object",
      "required": [
        "questionId",
        "header",
        "question",
        "options"
      ],
      "properties": {
        "questionId": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9_]*$"
        },
        "header": {
          "type": "string",
          "maxLength": 12
        },
        "question": {
          "type": "string",
          "minLength": 1
        },
        "options": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "label"
            ],
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 4
        },
        "multiSelect": {
          "type": "boolean"
        },
        "isOther": {
          "type": "boolean"
        },
        "isSecret": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "QuestionAnswers": {
      "type": "object",
      "required": [
        "answers"
      ],
      "properties": {
        "answers": {
          "type": "object",
          "patternProperties": {
            "^[a-z][a-z0-9_]*$": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "additionalProperties": false
    },
    "QuestionStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "pending"
        },
        {
          "type": "string",
          "const": "answered"
        },
        {
          "type": "string",
          "const": "cancelled"
        },
        {
          "type": "string",
          "const": "expired"
        }
      ]
    },
    "QuestionRecord": {
      "type": "object",
      "required": [
        "id",
        "questions",
        "createdAtMs",
        "expiresAtMs",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "questionId",
              "header",
              "question",
              "options"
            ],
            "properties": {
              "questionId": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$"
              },
              "header": {
                "type": "string",
                "maxLength": 12
              },
              "question": {
                "type": "string",
                "minLength": 1
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "label"
                  ],
                  "properties": {
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 4
              },
              "multiSelect": {
                "type": "boolean"
              },
              "isOther": {
                "type": "boolean"
              },
              "isSecret": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 3
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "answered"
            },
            {
              "type": "string",
              "const": "cancelled"
            },
            {
              "type": "string",
              "const": "expired"
            }
          ]
        },
        "answers": {
          "type": "object",
          "required": [
            "answers"
          ],
          "properties": {
            "answers": {
              "type": "object",
              "patternProperties": {
                "^[a-z][a-z0-9_]*$": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "additionalProperties": false
        },
        "resolvedBy": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.7"
    },
    "QuestionRequestParams": {
      "type": "object",
      "required": [
        "questions"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "questionId",
              "header",
              "question",
              "options"
            ],
            "properties": {
              "questionId": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]*$"
              },
              "header": {
                "type": "string",
                "maxLength": 12
              },
              "question": {
                "type": "string",
                "minLength": 1
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "label"
                  ],
                  "properties": {
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 4
              },
              "multiSelect": {
                "type": "boolean"
              },
              "isOther": {
                "type": "boolean"
              },
              "isSecret": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 3
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "QuestionRequestResult": {
      "type": "object",
      "required": [
        "id",
        "expiresAtMs"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "QuestionWaitAnswerParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "QuestionWaitAnswerResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "pending"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "answers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "answered"
            },
            "answers": {
              "type": "object",
              "required": [
                "answers"
              ],
              "properties": {
                "answers": {
                  "type": "object",
                  "patternProperties": {
                    "^[a-z][a-z0-9_]*$": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "cancelled"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "expired"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "QuestionResolveParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "answers"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "answers": {
              "type": "object",
              "required": [
                "answers"
              ],
              "properties": {
                "answers": {
                  "type": "object",
                  "patternProperties": {
                    "^[a-z][a-z0-9_]*$": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "additionalProperties": false
            },
            "resolvedBy": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "cancel"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "cancel": {
              "type": "boolean",
              "const": true
            },
            "resolvedBy": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "QuestionResolveResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status",
            "answers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "answered"
            },
            "answers": {
              "type": "object",
              "required": [
                "answers"
              ],
              "properties": {
                "answers": {
                  "type": "object",
                  "patternProperties": {
                    "^[a-z][a-z0-9_]*$": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "cancelled"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "QuestionGetParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "QuestionGetResult": {
      "type": "object",
      "required": [
        "question"
      ],
      "properties": {
        "question": {
          "type": "object",
          "required": [
            "id",
            "questions",
            "createdAtMs",
            "expiresAtMs",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "questions": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "questionId",
                  "header",
                  "question",
                  "options"
                ],
                "properties": {
                  "questionId": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "header": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "question": {
                    "type": "string",
                    "minLength": 1
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "label"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "minLength": 1
                        },
                        "description": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 4
                  },
                  "multiSelect": {
                    "type": "boolean"
                  },
                  "isOther": {
                    "type": "boolean"
                  },
                  "isSecret": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "minItems": 1,
              "maxItems": 3
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "answered"
                },
                {
                  "type": "string",
                  "const": "cancelled"
                },
                {
                  "type": "string",
                  "const": "expired"
                }
              ]
            },
            "answers": {
              "type": "object",
              "required": [
                "answers"
              ],
              "properties": {
                "answers": {
                  "type": "object",
                  "patternProperties": {
                    "^[a-z][a-z0-9_]*$": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "additionalProperties": false
            },
            "resolvedBy": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        }
      },
      "additionalProperties": false
    },
    "QuestionListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "QuestionListResult": {
      "type": "object",
      "required": [
        "questions"
      ],
      "properties": {
        "questions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "questions",
              "createdAtMs",
              "expiresAtMs",
              "status"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "questions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "questionId",
                    "header",
                    "question",
                    "options"
                  ],
                  "properties": {
                    "questionId": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]*$"
                    },
                    "header": {
                      "type": "string",
                      "maxLength": 12
                    },
                    "question": {
                      "type": "string",
                      "minLength": 1
                    },
                    "options": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "label"
                        ],
                        "properties": {
                          "label": {
                            "type": "string",
                            "minLength": 1
                          },
                          "description": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      },
                      "maxItems": 4
                    },
                    "multiSelect": {
                      "type": "boolean"
                    },
                    "isOther": {
                      "type": "boolean"
                    },
                    "isSecret": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 3
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              },
              "sessionKey": {
                "type": "string",
                "minLength": 1
              },
              "runId": {
                "type": "string",
                "minLength": 1
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "answered"
                  },
                  {
                    "type": "string",
                    "const": "cancelled"
                  },
                  {
                    "type": "string",
                    "const": "expired"
                  }
                ]
              },
              "answers": {
                "type": "object",
                "required": [
                  "answers"
                ],
                "properties": {
                  "answers": {
                    "type": "object",
                    "patternProperties": {
                      "^[a-z][a-z0-9_]*$": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "additionalProperties": false
              },
              "resolvedBy": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false,
            "x-openclaw-since": "2026.7"
          }
        }
      },
      "additionalProperties": false
    },
    "QuestionResolvedEvent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "id",
            "status",
            "answers"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "answered"
            },
            "answers": {
              "type": "object",
              "required": [
                "answers"
              ],
              "properties": {
                "answers": {
                  "type": "object",
                  "patternProperties": {
                    "^[a-z][a-z0-9_]*$": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "cancelled"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "id",
            "status"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "expired"
            }
          },
          "additionalProperties": false
        }
      ],
      "x-openclaw-since": "2026.7"
    },
    "PluginApprovalRequestParams": {
      "type": "object",
      "required": [
        "title",
        "description"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "detail": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16384,
          "description": "Reviewer-surface-only detail; not delivered to channels or push notifications."
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ]
        },
        "toolName": {
          "type": "string"
        },
        "toolCallId": {
          "type": "string"
        },
        "allowedDecisions": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "allow-once",
              "allow-always",
              "deny"
            ]
          },
          "minItems": 1,
          "maxItems": 3
        },
        "agentId": {
          "type": "string"
        },
        "sessionKey": {
          "type": "string"
        },
        "approvalReviewerDeviceIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Trusted approval-runtime metadata naming operator devices that may review this approval; ordinary Gateway clients may send the field, but the Gateway only binds it for internal approval-runtime requests."
        },
        "turnSourceChannel": {
          "type": "string"
        },
        "turnSourceTo": {
          "type": "string"
        },
        "turnSourceAccountId": {
          "type": "string"
        },
        "turnSourceThreadId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 600000
        },
        "twoPhase": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginApprovalResolveParams": {
      "type": "object",
      "required": [
        "id",
        "decision"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "decision": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginCatalogClawHubInstall": {
      "type": "object",
      "required": [
        "source",
        "packageName"
      ],
      "properties": {
        "source": {
          "type": "string",
          "const": "clawhub"
        },
        "packageName": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginCatalogEntry": {
      "type": "object",
      "required": [
        "id",
        "name",
        "installed",
        "enabled",
        "state"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "packageName": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "origin": {
          "type": "string",
          "minLength": 1
        },
        "installed": {
          "type": "boolean"
        },
        "enabled": {
          "type": "boolean"
        },
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "enabled"
            },
            {
              "type": "string",
              "const": "disabled"
            },
            {
              "type": "string",
              "const": "not-installed"
            },
            {
              "type": "string",
              "const": "error"
            }
          ]
        },
        "featured": {
          "type": "boolean"
        },
        "featuredAt": {
          "type": "integer",
          "minimum": 0
        },
        "order": {
          "type": "number"
        },
        "hasIcon": {
          "type": "boolean"
        },
        "install": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "source",
                "packageName"
              ],
              "properties": {
                "source": {
                  "type": "string",
                  "const": "clawhub"
                },
                "packageName": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "source",
                "pluginId"
              ],
              "properties": {
                "source": {
                  "type": "string",
                  "const": "official"
                },
                "pluginId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "error": {
          "type": "string"
        },
        "category": {
          "type": "string",
          "minLength": 1
        },
        "removable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginCatalogInstallAction": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "source",
            "packageName"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "clawhub"
            },
            "packageName": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source",
            "pluginId"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "official"
            },
            "pluginId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "PluginCatalogOfficialInstall": {
      "type": "object",
      "required": [
        "source",
        "pluginId"
      ],
      "properties": {
        "source": {
          "type": "string",
          "const": "official"
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginControlUiDescriptor": {
      "type": "object",
      "required": [
        "id",
        "pluginId",
        "surface",
        "label"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "pluginName": {
          "type": "string",
          "minLength": 1
        },
        "surface": {
          "anyOf": [
            {
              "type": "string",
              "const": "session"
            },
            {
              "type": "string",
              "const": "tool"
            },
            {
              "type": "string",
              "const": "run"
            },
            {
              "type": "string",
              "const": "settings"
            },
            {
              "type": "string",
              "const": "tab"
            },
            {
              "type": "string",
              "const": "widget"
            }
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "placement": {
          "type": "string"
        },
        "schema": {},
        "requiredScopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "PluginSearchPackage": {
      "type": "object",
      "required": [
        "name",
        "displayName",
        "family",
        "channel",
        "isOfficial"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "family": {
          "anyOf": [
            {
              "type": "string",
              "const": "code-plugin"
            },
            {
              "type": "string",
              "const": "bundle-plugin"
            }
          ]
        },
        "channel": {
          "anyOf": [
            {
              "type": "string",
              "const": "official"
            },
            {
              "type": "string",
              "const": "community"
            },
            {
              "type": "string",
              "const": "private"
            }
          ]
        },
        "isOfficial": {
          "type": "boolean"
        },
        "summary": {
          "type": "string"
        },
        "latestVersion": {
          "type": "string",
          "minLength": 1
        },
        "runtimeId": {
          "type": "string",
          "minLength": 1
        },
        "downloads": {
          "type": "number",
          "minimum": 0
        },
        "verificationTier": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginSearchResultEntry": {
      "type": "object",
      "required": [
        "score",
        "package"
      ],
      "properties": {
        "score": {
          "type": "number"
        },
        "package": {
          "type": "object",
          "required": [
            "name",
            "displayName",
            "family",
            "channel",
            "isOfficial"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1
            },
            "displayName": {
              "type": "string",
              "minLength": 1
            },
            "family": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "code-plugin"
                },
                {
                  "type": "string",
                  "const": "bundle-plugin"
                }
              ]
            },
            "channel": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "official"
                },
                {
                  "type": "string",
                  "const": "community"
                },
                {
                  "type": "string",
                  "const": "private"
                }
              ]
            },
            "isOfficial": {
              "type": "boolean"
            },
            "summary": {
              "type": "string"
            },
            "latestVersion": {
              "type": "string",
              "minLength": 1
            },
            "runtimeId": {
              "type": "string",
              "minLength": 1
            },
            "downloads": {
              "type": "number",
              "minimum": 0
            },
            "verificationTier": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "PluginsInstallParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "source",
            "packageName"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "clawhub"
            },
            "packageName": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "acknowledgeClawHubRisk": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source",
            "pluginId"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "official"
            },
            "pluginId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "PluginsInstallResult": {
      "type": "object",
      "required": [
        "ok",
        "plugin",
        "restartRequired"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "plugin": {
          "type": "object",
          "required": [
            "id",
            "name",
            "installed",
            "enabled",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "packageName": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "origin": {
              "type": "string",
              "minLength": 1
            },
            "installed": {
              "type": "boolean"
            },
            "enabled": {
              "type": "boolean"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "enabled"
                },
                {
                  "type": "string",
                  "const": "disabled"
                },
                {
                  "type": "string",
                  "const": "not-installed"
                },
                {
                  "type": "string",
                  "const": "error"
                }
              ]
            },
            "featured": {
              "type": "boolean"
            },
            "featuredAt": {
              "type": "integer",
              "minimum": 0
            },
            "order": {
              "type": "number"
            },
            "hasIcon": {
              "type": "boolean"
            },
            "install": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "source",
                    "packageName"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "clawhub"
                    },
                    "packageName": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "source",
                    "pluginId"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "official"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "error": {
              "type": "string"
            },
            "category": {
              "type": "string",
              "minLength": 1
            },
            "removable": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "restartRequired": {
          "type": "boolean",
          "const": true
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "PluginsListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "PluginsListResult": {
      "type": "object",
      "required": [
        "plugins",
        "diagnostics",
        "mutationAllowed"
      ],
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "installed",
              "enabled",
              "state"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "packageName": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "version": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "origin": {
                "type": "string",
                "minLength": 1
              },
              "installed": {
                "type": "boolean"
              },
              "enabled": {
                "type": "boolean"
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "enabled"
                  },
                  {
                    "type": "string",
                    "const": "disabled"
                  },
                  {
                    "type": "string",
                    "const": "not-installed"
                  },
                  {
                    "type": "string",
                    "const": "error"
                  }
                ]
              },
              "featured": {
                "type": "boolean"
              },
              "featuredAt": {
                "type": "integer",
                "minimum": 0
              },
              "order": {
                "type": "number"
              },
              "hasIcon": {
                "type": "boolean"
              },
              "install": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "source",
                      "packageName"
                    ],
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "clawhub"
                      },
                      "packageName": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "source",
                      "pluginId"
                    ],
                    "properties": {
                      "source": {
                        "type": "string",
                        "const": "official"
                      },
                      "pluginId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "error": {
                "type": "string"
              },
              "category": {
                "type": "string",
                "minLength": 1
              },
              "removable": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "diagnostics": {
          "type": "array",
          "items": {}
        },
        "mutationAllowed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginsRefreshParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "PluginsRefreshResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "PluginsSearchParams": {
      "type": "object",
      "required": [
        "query"
      ],
      "properties": {
        "query": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "additionalProperties": false
    },
    "PluginsSearchResult": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "score",
              "package"
            ],
            "properties": {
              "score": {
                "type": "number"
              },
              "package": {
                "type": "object",
                "required": [
                  "name",
                  "displayName",
                  "family",
                  "channel",
                  "isOfficial"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "family": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "code-plugin"
                      },
                      {
                        "type": "string",
                        "const": "bundle-plugin"
                      }
                    ]
                  },
                  "channel": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "official"
                      },
                      {
                        "type": "string",
                        "const": "community"
                      },
                      {
                        "type": "string",
                        "const": "private"
                      }
                    ]
                  },
                  "isOfficial": {
                    "type": "boolean"
                  },
                  "summary": {
                    "type": "string"
                  },
                  "latestVersion": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runtimeId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "downloads": {
                    "type": "number",
                    "minimum": 0
                  },
                  "verificationTier": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "PluginsSessionActionFailureResult": {
      "type": "object",
      "required": [
        "ok",
        "error"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": false
        },
        "error": {
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "details": {}
      },
      "additionalProperties": false
    },
    "PluginsSessionActionParams": {
      "type": "object",
      "required": [
        "pluginId",
        "actionId"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "actionId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "payload": {}
      },
      "additionalProperties": false
    },
    "PluginsSessionActionResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "ok"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "result": {},
            "continueAgent": {
              "type": "boolean"
            },
            "reply": {}
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ok",
            "error"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": false
            },
            "error": {
              "type": "string"
            },
            "code": {
              "type": "string"
            },
            "details": {}
          },
          "additionalProperties": false
        }
      ]
    },
    "PluginsSessionActionSuccessResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "result": {},
        "continueAgent": {
          "type": "boolean"
        },
        "reply": {}
      },
      "additionalProperties": false
    },
    "PluginsSetEnabledParams": {
      "type": "object",
      "required": [
        "pluginId",
        "enabled"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginsSetEnabledResult": {
      "type": "object",
      "required": [
        "ok",
        "plugin",
        "restartRequired"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "plugin": {
          "type": "object",
          "required": [
            "id",
            "name",
            "installed",
            "enabled",
            "state"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "packageName": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "kind": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "origin": {
              "type": "string",
              "minLength": 1
            },
            "installed": {
              "type": "boolean"
            },
            "enabled": {
              "type": "boolean"
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "enabled"
                },
                {
                  "type": "string",
                  "const": "disabled"
                },
                {
                  "type": "string",
                  "const": "not-installed"
                },
                {
                  "type": "string",
                  "const": "error"
                }
              ]
            },
            "featured": {
              "type": "boolean"
            },
            "featuredAt": {
              "type": "integer",
              "minimum": 0
            },
            "order": {
              "type": "number"
            },
            "hasIcon": {
              "type": "boolean"
            },
            "install": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "source",
                    "packageName"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "clawhub"
                    },
                    "packageName": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "source",
                    "pluginId"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "const": "official"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "error": {
              "type": "string"
            },
            "category": {
              "type": "string",
              "minLength": 1
            },
            "removable": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "restartRequired": {
          "type": "boolean"
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "PluginsUiDescriptorsParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "PluginsUiDescriptorsResult": {
      "type": "object",
      "required": [
        "ok",
        "descriptors"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "descriptors": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "pluginId",
              "surface",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "pluginId": {
                "type": "string",
                "minLength": 1
              },
              "pluginName": {
                "type": "string",
                "minLength": 1
              },
              "surface": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "session"
                  },
                  {
                    "type": "string",
                    "const": "tool"
                  },
                  {
                    "type": "string",
                    "const": "run"
                  },
                  {
                    "type": "string",
                    "const": "settings"
                  },
                  {
                    "type": "string",
                    "const": "tab"
                  },
                  {
                    "type": "string",
                    "const": "widget"
                  }
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "description": {
                "type": "string"
              },
              "placement": {
                "type": "string"
              },
              "schema": {},
              "requiredScopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "PluginsUninstallParams": {
      "type": "object",
      "required": [
        "pluginId"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginsUninstallResult": {
      "type": "object",
      "required": [
        "ok",
        "pluginId",
        "restartRequired",
        "removed"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "restartRequired": {
          "type": "boolean",
          "const": true
        },
        "removed": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "DevicePairListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "DevicePairApproveParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "DevicePairRejectParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "DevicePairRemoveParams": {
      "type": "object",
      "required": [
        "deviceId"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupCodeParams": {
      "type": "object",
      "properties": {
        "publicUrl": {
          "type": "string",
          "minLength": 1
        },
        "preferRemoteUrl": {
          "type": "boolean"
        },
        "includeQr": {
          "type": "boolean"
        },
        "bootstrapProfile": {
          "type": "string",
          "enum": [
            "limited",
            "node"
          ]
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupCodeResult": {
      "type": "object",
      "required": [
        "setupCode",
        "gatewayUrl",
        "auth",
        "urlSource"
      ],
      "properties": {
        "setupCode": {
          "type": "string",
          "minLength": 1
        },
        "qrDataUrl": {
          "type": "string",
          "maxLength": 16384,
          "pattern": "^data:image/png;base64,"
        },
        "gatewayUrl": {
          "type": "string",
          "minLength": 1
        },
        "gatewayUrls": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 2,
          "maxItems": 8,
          "uniqueItems": true
        },
        "auth": {
          "anyOf": [
            {
              "type": "string",
              "const": "token"
            },
            {
              "type": "string",
              "const": "password"
            }
          ]
        },
        "urlSource": {
          "type": "string",
          "minLength": 1
        },
        "access": {
          "anyOf": [
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "limited"
            },
            {
              "type": "string",
              "const": "node"
            }
          ]
        },
        "accessDowngraded": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "DevicePairRenameParams": {
      "type": "object",
      "required": [
        "deviceId",
        "label"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        }
      },
      "additionalProperties": false
    },
    "DeviceTokenRotateParams": {
      "type": "object",
      "required": [
        "deviceId",
        "role"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "DeviceTokenRevokeParams": {
      "type": "object",
      "required": [
        "deviceId",
        "role"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "DevicePairRequestedEvent": {
      "type": "object",
      "required": [
        "requestId",
        "deviceId",
        "publicKey",
        "ts"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "publicKey": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "deviceFamily": {
          "type": "string",
          "minLength": 1
        },
        "clientId": {
          "type": "string",
          "minLength": 1
        },
        "clientMode": {
          "type": "string",
          "minLength": 1
        },
        "browserOrigin": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "remoteIp": {
          "type": "string",
          "minLength": 1
        },
        "silent": {
          "type": "boolean"
        },
        "isRepair": {
          "type": "boolean"
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "DevicePairResolvedEvent": {
      "type": "object",
      "required": [
        "requestId",
        "deviceId",
        "decision",
        "ts"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "decision": {
          "type": "string",
          "minLength": 1
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ChatHistoryParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "maxChars": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500000
        }
      },
      "additionalProperties": false
    },
    "ChatMetadataParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChatMessageGetParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "messageId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "maxChars": {
          "type": "integer",
          "minimum": 1,
          "maximum": 2000000
        }
      },
      "additionalProperties": false
    },
    "ChatMessageGetResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "message": {},
        "unavailableReason": {
          "anyOf": [
            {
              "type": "string",
              "const": "not_found"
            },
            {
              "type": "string",
              "const": "oversized"
            },
            {
              "type": "string",
              "const": "not_visible"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ChatToolTitlesParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "items"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "name",
              "input"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "input": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4000
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 24
        }
      },
      "additionalProperties": false
    },
    "ChatToolTitlesResult": {
      "type": "object",
      "required": [
        "titles"
      ],
      "properties": {
        "titles": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "string"
            }
          }
        },
        "disabled": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ChatSendParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "message",
        "idempotencyKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string"
        },
        "thinking": {
          "type": "string"
        },
        "fastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            }
          ]
        },
        "fastAutoOnSeconds": {
          "type": "integer",
          "minimum": 1
        },
        "queueMode": {
          "type": "string",
          "enum": [
            "steer",
            "followup",
            "collect",
            "interrupt"
          ]
        },
        "deliver": {
          "type": "boolean"
        },
        "originatingChannel": {
          "type": "string"
        },
        "originatingTo": {
          "type": "string"
        },
        "originatingAccountId": {
          "type": "string"
        },
        "originatingThreadId": {
          "type": "string"
        },
        "replyToId": {
          "type": "string",
          "minLength": 1
        },
        "attachments": {
          "type": "array",
          "items": {}
        },
        "toolBindings": {
          "type": "object",
          "patternProperties": {
            "^.*$": {}
          },
          "maxProperties": 16
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 0
        },
        "systemInputProvenance": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "external_user",
                "inter_session",
                "internal_system"
              ]
            },
            "originSessionId": {
              "type": "string"
            },
            "sourceSessionKey": {
              "type": "string"
            },
            "sourceChannel": {
              "type": "string"
            },
            "sourceTool": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "systemProvenanceReceipt": {
          "type": "string"
        },
        "suppressCommandInterpretation": {
          "type": "boolean"
        },
        "expectedLeafEntryId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "expectedSessionRoutingContract": {
          "type": "string",
          "minLength": 1
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ChatAbortParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "preserveSideRuns": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ChatInjectParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "message"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "maxLength": 100
        }
      },
      "additionalProperties": false
    },
    "ChatRunStartupPhase": {
      "anyOf": [
        {
          "type": "string",
          "const": "preparing_workspace"
        },
        {
          "type": "string",
          "const": "provisioning_environment"
        },
        {
          "type": "string",
          "const": "preparing_context"
        },
        {
          "type": "string",
          "const": "starting_model"
        }
      ]
    },
    "ChatStatusEvent": {
      "type": "object",
      "required": [
        "runId",
        "sessionKey",
        "seq",
        "state",
        "phase"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "const": "status"
        },
        "phase": {
          "anyOf": [
            {
              "type": "string",
              "const": "preparing_workspace"
            },
            {
              "type": "string",
              "const": "provisioning_environment"
            },
            {
              "type": "string",
              "const": "preparing_context"
            },
            {
              "type": "string",
              "const": "starting_model"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ChatDeltaEvent": {
      "type": "object",
      "required": [
        "runId",
        "sessionKey",
        "seq",
        "state",
        "deltaText"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "const": "delta"
        },
        "message": {},
        "deltaText": {
          "type": "string"
        },
        "replace": {
          "type": "boolean"
        },
        "usage": {}
      },
      "additionalProperties": false
    },
    "ChatFinalEvent": {
      "type": "object",
      "required": [
        "runId",
        "sessionKey",
        "seq",
        "state"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "const": "final"
        },
        "message": {},
        "usage": {},
        "stopReason": {
          "type": "string"
        },
        "yielded": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "ChatAbortedEvent": {
      "type": "object",
      "required": [
        "runId",
        "sessionKey",
        "seq",
        "state"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "const": "aborted"
        },
        "message": {},
        "errorMessage": {
          "type": "string"
        },
        "stopReason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ChatErrorEvent": {
      "type": "object",
      "required": [
        "runId",
        "sessionKey",
        "seq",
        "state"
      ],
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "seq": {
          "type": "integer",
          "minimum": 0
        },
        "state": {
          "type": "string",
          "const": "error"
        },
        "message": {},
        "errorMessage": {
          "type": "string"
        },
        "errorKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "refusal"
            },
            {
              "type": "string",
              "const": "timeout"
            },
            {
              "type": "string",
              "const": "rate_limit"
            },
            {
              "type": "string",
              "const": "context_length"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "usage": {},
        "stopReason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "ChatEvent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "runId",
            "sessionKey",
            "seq",
            "state",
            "phase"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "spawnedBy": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "type": "string",
              "const": "status"
            },
            "phase": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "preparing_workspace"
                },
                {
                  "type": "string",
                  "const": "provisioning_environment"
                },
                {
                  "type": "string",
                  "const": "preparing_context"
                },
                {
                  "type": "string",
                  "const": "starting_model"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "runId",
            "sessionKey",
            "seq",
            "state",
            "deltaText"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "spawnedBy": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "type": "string",
              "const": "delta"
            },
            "message": {},
            "deltaText": {
              "type": "string"
            },
            "replace": {
              "type": "boolean"
            },
            "usage": {}
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "runId",
            "sessionKey",
            "seq",
            "state"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "spawnedBy": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "type": "string",
              "const": "final"
            },
            "message": {},
            "usage": {},
            "stopReason": {
              "type": "string"
            },
            "yielded": {
              "type": "boolean",
              "const": true
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "runId",
            "sessionKey",
            "seq",
            "state"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "spawnedBy": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "type": "string",
              "const": "aborted"
            },
            "message": {},
            "errorMessage": {
              "type": "string"
            },
            "stopReason": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "runId",
            "sessionKey",
            "seq",
            "state"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "spawnedBy": {
              "type": "string",
              "minLength": 1
            },
            "seq": {
              "type": "integer",
              "minimum": 0
            },
            "state": {
              "type": "string",
              "const": "error"
            },
            "message": {},
            "errorMessage": {
              "type": "string"
            },
            "errorKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "refusal"
                },
                {
                  "type": "string",
                  "const": "timeout"
                },
                {
                  "type": "string",
                  "const": "rate_limit"
                },
                {
                  "type": "string",
                  "const": "context_length"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "usage": {},
            "stopReason": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "UpdateStatusParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "UpdateRunParams": {
      "type": "object",
      "properties": {
        "sessionKey": {
          "type": "string"
        },
        "deliveryContext": {
          "type": "object",
          "properties": {
            "channel": {
              "type": "string"
            },
            "to": {
              "type": "string"
            },
            "accountId": {
              "type": "string"
            },
            "threadId": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "note": {
          "type": "string"
        },
        "continuationMessage": {
          "type": "string"
        },
        "restartDelayMs": {
          "type": "integer",
          "minimum": 0
        },
        "timeoutMs": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "TickEvent": {
      "type": "object",
      "required": [
        "ts"
      ],
      "properties": {
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ShutdownEvent": {
      "type": "object",
      "required": [
        "reason"
      ],
      "properties": {
        "reason": {
          "type": "string",
          "minLength": 1
        },
        "restartExpectedMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  }
}